From da084aacd5bd506dfa5d62fff1b860f60cd616cb Mon Sep 17 00:00:00 2001 From: Alex Petric Date: Wed, 12 Feb 2025 14:17:20 -0500 Subject: [PATCH] quicksave --- backend/windmill-api/openapi-deref.json | 3792 ++++++++++++++- backend/windmill-api/openapi-deref.yaml | 4795 ++++++++++++++----- backend/windmill-api/openapi.yaml | 46 + backend/windmill-api/src/approvals.rs | 157 + backend/windmill-api/src/jobs.rs | 7 +- backend/windmill-api/src/lib.rs | 8 + backend/windmill-api/src/slack_approvals.rs | 138 +- backend/windmill-api/src/teams_approvals.rs | 73 + frontend/src/lib/components/apps/utils.ts | 2 +- typescript-client/build.jsr.sh | 2 +- typescript-client/build.sh | 2 +- typescript-client/client.ts | 101 + 12 files changed, 7600 insertions(+), 1523 deletions(-) create mode 100644 backend/windmill-api/src/approvals.rs create mode 100644 backend/windmill-api/src/teams_approvals.rs diff --git a/backend/windmill-api/openapi-deref.json b/backend/windmill-api/openapi-deref.json index 91214e99b4..ad1b8cc12a 100644 --- a/backend/windmill-api/openapi-deref.json +++ b/backend/windmill-api/openapi-deref.json @@ -1,7 +1,7 @@ { "openapi": "3.0.3", "info": { - "version": "1.423.2", + "version": "1.458.1", "title": "Windmill API", "contact": { "name": "Windmill Team", @@ -618,6 +618,9 @@ "is_super_admin": { "type": "boolean" }, + "is_devops": { + "type": "boolean" + }, "name": { "type": "string" } @@ -1329,9 +1332,24 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CriticalAlert" + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CriticalAlert" + } + }, + "total_rows": { + "type": "integer", + "description": "Total number of rows matching the query.", + "example": 100 + }, + "total_pages": { + "type": "integer", + "description": "Total number of pages based on the page size.", + "example": 10 + } } } } @@ -1670,9 +1688,19 @@ "tags": [ "user" ], + "parameters": [ + { + "name": "if_expiring_in_less_than_s", + "in": "query", + "required": false, + "schema": { + "type": "integer" + } + } + ], "responses": { "200": { - "description": "free usage", + "description": "new token", "content": { "text/plain": { "schema": { @@ -2374,6 +2402,46 @@ } } }, + "/w/{workspace}/workspaces/change_workspace_color": { + "post": { + "summary": "change workspace id", + "operationId": "changeWorkspaceColor", + "tags": [ + "workspace" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "color": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "status", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/w/{workspace}/users/whois/{username}": { "get": { "summary": "whois", @@ -2408,6 +2476,43 @@ } } }, + "/w/{workspace}/workspaces/operator_settings": { + "post": { + "operationId": "updateOperatorSettings", + "summary": "Update operator settings for a workspace", + "description": "Updates the operator settings for a specific workspace. Requires workspace admin privileges.", + "tags": [ + "workspace" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OperatorSettings" + } + } + } + }, + "responses": { + "200": { + "description": "Operator settings updated successfully", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/users/exists/{email}": { "get": { "summary": "exists email", @@ -2540,6 +2645,15 @@ "slack_command_script": { "type": "string" }, + "teams_team_id": { + "type": "string" + }, + "teams_command_script": { + "type": "string" + }, + "teams_team_name": { + "type": "string" + }, "auto_invite_domain": { "type": "string" }, @@ -2565,10 +2679,16 @@ "type": "string" }, "ai_resource": { - "$ref": "#/components/schemas/AiResource" + "$ref": "#/components/schemas/AIResource" }, - "code_completion_enabled": { - "type": "boolean" + "code_completion_model": { + "type": "string" + }, + "ai_models": { + "type": "array", + "items": { + "type": "string" + } }, "error_handler": { "type": "string" @@ -2593,10 +2713,19 @@ }, "default_scripts": { "$ref": "#/components/schemas/WorkspaceDefaultScripts" + }, + "mute_critical_alerts": { + "type": "boolean" + }, + "color": { + "type": "string" + }, + "operator_settings": { + "$ref": "#/components/schemas/OperatorSettings" } }, "required": [ - "code_completion_enabled", + "ai_models", "automatic_billing", "error_handler_muted_on_cancel" ] @@ -2695,11 +2824,15 @@ }, "automatic_billing": { "type": "boolean" + }, + "owner": { + "type": "string" } }, "required": [ "premium", - "automatic_billing" + "automatic_billing", + "owner" ] } } @@ -2756,6 +2889,81 @@ } } }, + "/w/{workspace}/workspaces/threshold_alert": { + "get": { + "summary": "get threshold alert info", + "operationId": "getThresholdAlert", + "tags": [ + "workspace" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "responses": { + "200": { + "description": "status", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "threshold_alert_amount": { + "type": "number" + }, + "last_alert_sent": { + "type": "string", + "format": "date-time" + } + } + } + } + } + } + } + }, + "post": { + "summary": "set threshold alert info", + "operationId": "setThresholdAlert", + "tags": [ + "workspace" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "threshold alert info", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "threshold_alert_amount": { + "type": "number" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "status", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/w/{workspace}/workspaces/edit_slack_command": { "post": { "summary": "edit slack command", @@ -2798,6 +3006,173 @@ } } }, + "/w/{workspace}/workspaces/edit_teams_command": { + "post": { + "summary": "edit teams command", + "operationId": "editTeamsCommand", + "tags": [ + "workspace" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "WorkspaceInvite", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "slack_command_script": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "status", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/workspaces/available_teams_ids": { + "get": { + "summary": "list available teams ids", + "operationId": "listAvailableTeamsIds", + "tags": [ + "workspace" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "responses": { + "200": { + "description": "status", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "team_name": { + "type": "string" + }, + "team_id": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/w/{workspace}/workspaces/available_teams_channels": { + "get": { + "summary": "list available teams channels", + "operationId": "listAvailableTeamsChannels", + "tags": [ + "workspace" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "responses": { + "200": { + "description": "status", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "channel_name": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "service_url": { + "type": "string" + }, + "tenant_id": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/w/{workspace}/workspaces/connect_teams": { + "post": { + "summary": "connect teams", + "operationId": "connectTeams", + "tags": [ + "workspace" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "connect teams", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "team_id": { + "type": "string" + }, + "team_name": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "status", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/w/{workspace}/workspaces/run_slack_message_test_job": { "post": { "summary": "run a job that sends a message to Slack", @@ -2851,6 +3226,59 @@ } } }, + "/w/{workspace}/workspaces/run_teams_message_test_job": { + "post": { + "summary": "run a job that sends a message to Teams", + "operationId": "runTeamsMessageTestJob", + "tags": [ + "workspace" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "path to hub script to run and its corresponding args", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "hub_script_path": { + "type": "string" + }, + "channel": { + "type": "string" + }, + "test_msg": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "status", + "content": { + "text/json": { + "schema": { + "type": "object", + "properties": { + "job_uuid": { + "type": "string" + } + } + } + } + } + } + } + } + }, "/w/{workspace}/workspaces/edit_deploy_to": { "post": { "summary": "edit deploy to", @@ -3002,14 +3430,20 @@ "schema": { "type": "object", "required": [ - "code_completion_enabled" + "ai_models" ], "properties": { "ai_resource": { - "$ref": "#/components/schemas/AiResource" + "$ref": "#/components/schemas/AIResource" }, - "code_completion_enabled": { - "type": "boolean" + "code_completion_model": { + "type": "string" + }, + "ai_models": { + "type": "array", + "items": { + "type": "string" + } } } } @@ -3051,19 +3485,24 @@ "type": "object", "properties": { "ai_provider": { - "type": "string" + "$ref": "#/components/schemas/AIProvider" }, "exists_ai_resource": { "type": "boolean" }, - "code_completion_enabled": { - "type": "boolean" + "code_completion_model": { + "type": "string" + }, + "ai_models": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "ai_provider", "exists_ai_resource", - "code_completion_enabled" + "ai_models" ] } } @@ -3578,11 +4017,23 @@ }, "websocket_used": { "type": "boolean" + }, + "kafka_used": { + "type": "boolean" + }, + "nats_used": { + "type": "boolean" + }, + "postgres_used": { + "type": "boolean" } }, "required": [ "http_routes_used", - "websocket_used" + "websocket_used", + "kafka_used", + "nats_used", + "postgres_used" ] } } @@ -4211,6 +4662,186 @@ } } }, + "/w/{workspace}/workspaces/critical_alerts": { + "get": { + "summary": "Get all critical alerts for this workspace", + "operationId": "workspaceGetCriticalAlerts", + "tags": [ + "setting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1, + "description": "The page number to retrieve (minimum value is 1)" + } + }, + { + "in": "query", + "name": "page_size", + "schema": { + "type": "integer", + "default": 10, + "maximum": 100, + "description": "Number of alerts per page (maximum is 100)" + } + }, + { + "in": "query", + "name": "acknowledged", + "schema": { + "type": "boolean", + "nullable": true, + "description": "Filter by acknowledgment status; true for acknowledged, false for unacknowledged, and omit for all alerts" + } + } + ], + "responses": { + "200": { + "description": "Successfully retrieved all critical alerts", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CriticalAlert" + } + }, + "total_rows": { + "type": "integer", + "description": "Total number of rows matching the query.", + "example": 100 + }, + "total_pages": { + "type": "integer", + "description": "Total number of pages based on the page size.", + "example": 10 + } + } + } + } + } + } + } + } + }, + "/w/{workspace}/workspaces/critical_alerts/{id}/acknowledge": { + "post": { + "summary": "Acknowledge a critical alert for this workspace", + "operationId": "workspaceAcknowledgeCriticalAlert", + "tags": [ + "setting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "integer" + }, + "description": "The ID of the critical alert to acknowledge" + } + ], + "responses": { + "200": { + "description": "Successfully acknowledged the critical alert", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Critical alert acknowledged" + } + } + } + } + } + } + }, + "/w/{workspace}/workspaces/critical_alerts/acknowledge_all": { + "post": { + "summary": "Acknowledge all unacknowledged critical alerts for this workspace", + "operationId": "workspaceAcknowledgeAllCriticalAlerts", + "tags": [ + "setting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "responses": { + "200": { + "description": "Successfully acknowledged all unacknowledged critical alerts.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "All unacknowledged critical alerts acknowledged" + } + } + } + } + } + } + }, + "/w/{workspace}/workspaces/critical_alerts/mute": { + "post": { + "summary": "Mute critical alert UI for this workspace", + "operationId": "workspaceMuteCriticalAlertsUI", + "tags": [ + "setting" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "Boolean flag to mute critical alerts.", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "mute_critical_alerts": { + "type": "boolean", + "description": "Whether critical alerts should be muted.", + "example": true + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Successfully updated mute critical alert settings.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Updated mute critical alert UI settings for workspace: workspace_id" + } + } + } + } + } + } + }, "/oauth/login_callback/{client_name}": { "post": { "security": [], @@ -4562,6 +5193,32 @@ } } }, + "/w/{workspace}/oauth/disconnect_teams": { + "post": { + "summary": "disconnect teams", + "operationId": "disconnectTeams", + "tags": [ + "oauth" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "responses": { + "200": { + "description": "disconnected teams", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/oauth/list_logins": { "get": { "summary": "list oauth logins", @@ -4675,6 +5332,78 @@ } } }, + "/teams/sync": { + "post": { + "operationId": "syncTeams", + "summary": "synchronize Microsoft Teams information (teams/channels)", + "tags": [ + "teams" + ], + "responses": { + "200": { + "description": "Teams information successfully synchronized", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TeamInfo" + } + } + } + } + } + } + } + }, + "/teams/activities": { + "post": { + "summary": "send update to Microsoft Teams activity", + "description": "Respond to a Microsoft Teams activity after a workspace command is run", + "operationId": "sendMessageToConversation", + "tags": [ + "teams" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "conversation_id", + "text" + ], + "properties": { + "conversation_id": { + "type": "string", + "description": "The ID of the Teams conversation/activity" + }, + "success": { + "type": "boolean", + "description": "Used for styling the card conditionally", + "default": true + }, + "text": { + "type": "string", + "description": "The message text to be sent in the Teams card" + }, + "card_block": { + "type": "object", + "description": "The card block to be sent in the Teams card" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Activity processed successfully" + } + } + } + }, "/w/{workspace}/resources/create": { "post": { "summary": "create resource", @@ -5637,6 +6366,44 @@ } } }, + "/apps_u/public_app_by_custom_path/{custom_path}": { + "get": { + "summary": "get public app by custom path", + "operationId": "getPublicAppByCustomPath", + "tags": [ + "app" + ], + "parameters": [ + { + "$ref": "#/components/parameters/CustomPath" + } + ], + "responses": { + "200": { + "description": "app details", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AppWithLastVersion" + }, + { + "type": "object", + "properties": { + "workspace_id": { + "type": "string" + } + } + } + ] + } + } + } + } + } + } + }, "/scripts/hub/get/{path}": { "get": { "summary": "get hub script content by path", @@ -6289,6 +7056,24 @@ "tags": [ "worker" ], + "parameters": [ + { + "name": "workspace", + "in": "query", + "schema": { + "type": "string" + }, + "required": false + }, + { + "name": "show_workspace_restriction", + "in": "query", + "schema": { + "type": "boolean" + }, + "required": false + } + ], "responses": { "200": { "description": "list of custom tags", @@ -6440,7 +7225,7 @@ }, "/w/{workspace}/scripts/delete/p/{path}": { "post": { - "summary": "delete all scripts at a given path (require admin)", + "summary": "delete script at a given path (require admin)", "operationId": "deleteScriptByPath", "tags": [ "script" @@ -8267,6 +9052,9 @@ }, "deployment_message": { "type": "string" + }, + "custom_path": { + "type": "string" } }, "required": [ @@ -8358,6 +9146,35 @@ } } }, + "/w/{workspace}/apps/get/lite/{path}": { + "get": { + "summary": "get app lite by path", + "operationId": "getAppLiteByPath", + "tags": [ + "app" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/ScriptPath" + } + ], + "responses": { + "200": { + "description": "app lite details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AppWithLastVersion" + } + } + } + } + } + } + }, "/w/{workspace}/apps/get/draft/{path}": { "get": { "summary": "get app by path with draft", @@ -8808,6 +9625,9 @@ }, "deployment_message": { "type": "string" + }, + "custom_path": { + "type": "string" } } } @@ -8828,6 +9648,35 @@ } } }, + "/w/{workspace}/apps/custom_path_exists/{custom_path}": { + "get": { + "summary": "check if custom path exists", + "operationId": "customPathExists", + "tags": [ + "app" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/CustomPath" + } + ], + "responses": { + "200": { + "description": "custom path exists", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, "/w/{workspace}/apps_u/execute_component/{path}": { "post": { "summary": "executeComponent", @@ -8857,6 +9706,9 @@ "path": { "type": "string" }, + "version": { + "type": "integer" + }, "args": {}, "raw_code": { "type": "object", @@ -8882,6 +9734,9 @@ "language" ] }, + "id": { + "type": "integer" + }, "force_viewer_static_fields": { "type": "object" }, @@ -9587,6 +10442,60 @@ } } }, + "/w/{workspace}/jobs/completed/count_jobs": { + "get": { + "summary": "count number of completed jobs with filter", + "operationId": "countCompletedJobs", + "tags": [ + "job" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "name": "completed_after_s_ago", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "success", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "tags", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "all_workspaces", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Count of completed jobs", + "content": { + "application/json": { + "schema": { + "type": "integer" + } + } + } + } + } + } + }, "/w/{workspace}/jobs/queue/list_filtered_uuids": { "get": { "summary": "get the ids of all jobs matching the given filters", @@ -10728,6 +11637,158 @@ } } }, + "/w/{workspace}/jobs/slack_approval/{id}": { + "get": { + "summary": "generate interactive slack approval for suspended job", + "operationId": "getSlackApprovalPayload", + "tags": [ + "job" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/JobId" + }, + { + "name": "approver", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "message", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "slack_resource_path", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "channel_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "flow_step_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "default_args_json", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "dynamic_enums_json", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Interactive slack approval message sent successfully" + } + } + } + }, + "/w/{workspace}/jobs/teams_approval/{id}": { + "get": { + "summary": "generate interactive teams approval for suspended job", + "operationId": "getTeamsApprovalPayload", + "tags": [ + "job" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/JobId" + }, + { + "name": "approver", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "message", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "slack_resource_path", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "channel_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "flow_step_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "default_args_json", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "dynamic_enums_json", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Interactive slack approval message sent successfully" + } + } + } + }, "/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}": { "get": { "summary": "resume a job for a suspended flow", @@ -11172,6 +12233,9 @@ }, "timezone": { "type": "string" + }, + "cron_version": { + "type": "string" } }, "required": [ @@ -11823,10 +12887,12 @@ "delete", "patch" ] + }, + "trigger_path": { + "type": "string" } }, "required": [ - "kind", "route_path", "http_method" ] @@ -12118,6 +13184,1347 @@ } } }, + "/w/{workspace}/websocket_triggers/test": { + "post": { + "summary": "test websocket connection", + "operationId": "testWebsocketConnection", + "tags": [ + "websocket_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "test websocket connection", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "url_runnable_args": { + "$ref": "#/components/schemas/ScriptArgs" + }, + "can_return_message": { + "type": "boolean" + } + }, + "required": [ + "url", + "can_return_message" + ] + } + } + } + }, + "responses": { + "200": { + "description": "successfuly connected to websocket", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/kafka_triggers/create": { + "post": { + "summary": "create kafka trigger", + "operationId": "createKafkaTrigger", + "tags": [ + "kafka_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "new kafka trigger", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewKafkaTrigger" + } + } + } + }, + "responses": { + "201": { + "description": "kafka trigger created", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/kafka_triggers/update/{path}": { + "post": { + "summary": "update kafka trigger", + "operationId": "updateKafkaTrigger", + "tags": [ + "kafka_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "requestBody": { + "description": "updated trigger", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditKafkaTrigger" + } + } + } + }, + "responses": { + "200": { + "description": "kafka trigger updated", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/kafka_triggers/delete/{path}": { + "delete": { + "summary": "delete kafka trigger", + "operationId": "deleteKafkaTrigger", + "tags": [ + "kafka_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "kafka trigger deleted", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/kafka_triggers/get/{path}": { + "get": { + "summary": "get kafka trigger", + "operationId": "getKafkaTrigger", + "tags": [ + "kafka_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "kafka trigger deleted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KafkaTrigger" + } + } + } + } + } + } + }, + "/w/{workspace}/kafka_triggers/list": { + "get": { + "summary": "list kafka triggers", + "operationId": "listKafkaTriggers", + "tags": [ + "kafka_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId", + "required": true + }, + { + "$ref": "#/components/parameters/Page" + }, + { + "$ref": "#/components/parameters/PerPage" + }, + { + "name": "path", + "description": "filter by path", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "is_flow", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "path_start", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "kafka trigger list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/KafkaTrigger" + } + } + } + } + } + } + } + }, + "/w/{workspace}/kafka_triggers/exists/{path}": { + "get": { + "summary": "does kafka trigger exists", + "operationId": "existsKafkaTrigger", + "tags": [ + "kafka_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "kafka trigger exists", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, + "/w/{workspace}/kafka_triggers/setenabled/{path}": { + "post": { + "summary": "set enabled kafka trigger", + "operationId": "setKafkaTriggerEnabled", + "tags": [ + "kafka_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "requestBody": { + "description": "updated kafka trigger enable", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + }, + "required": [ + "enabled" + ] + } + } + } + }, + "responses": { + "200": { + "description": "kafka trigger enabled set", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/kafka_triggers/test": { + "post": { + "summary": "test kafka connection", + "operationId": "testKafkaConnection", + "tags": [ + "kafka_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "test kafka connection", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "connection": { + "type": "object" + } + }, + "required": [ + "connection" + ] + } + } + } + }, + "responses": { + "200": { + "description": "successfuly connected to kafka brokers", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/nats_triggers/create": { + "post": { + "summary": "create nats trigger", + "operationId": "createNatsTrigger", + "tags": [ + "nats_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "new nats trigger", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewNatsTrigger" + } + } + } + }, + "responses": { + "201": { + "description": "nats trigger created", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/nats_triggers/update/{path}": { + "post": { + "summary": "update nats trigger", + "operationId": "updateNatsTrigger", + "tags": [ + "nats_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "requestBody": { + "description": "updated trigger", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditNatsTrigger" + } + } + } + }, + "responses": { + "200": { + "description": "nats trigger updated", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/nats_triggers/delete/{path}": { + "delete": { + "summary": "delete nats trigger", + "operationId": "deleteNatsTrigger", + "tags": [ + "nats_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "nats trigger deleted", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/nats_triggers/get/{path}": { + "get": { + "summary": "get nats trigger", + "operationId": "getNatsTrigger", + "tags": [ + "nats_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "nats trigger deleted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NatsTrigger" + } + } + } + } + } + } + }, + "/w/{workspace}/nats_triggers/list": { + "get": { + "summary": "list nats triggers", + "operationId": "listNatsTriggers", + "tags": [ + "nats_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId", + "required": true + }, + { + "$ref": "#/components/parameters/Page" + }, + { + "$ref": "#/components/parameters/PerPage" + }, + { + "name": "path", + "description": "filter by path", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "is_flow", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "path_start", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "nats trigger list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NatsTrigger" + } + } + } + } + } + } + } + }, + "/w/{workspace}/nats_triggers/exists/{path}": { + "get": { + "summary": "does nats trigger exists", + "operationId": "existsNatsTrigger", + "tags": [ + "nats_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "nats trigger exists", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, + "/w/{workspace}/nats_triggers/setenabled/{path}": { + "post": { + "summary": "set enabled nats trigger", + "operationId": "setNatsTriggerEnabled", + "tags": [ + "nats_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "requestBody": { + "description": "updated nats trigger enable", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + }, + "required": [ + "enabled" + ] + } + } + } + }, + "responses": { + "200": { + "description": "nats trigger enabled set", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/nats_triggers/test": { + "post": { + "summary": "test NATS connection", + "operationId": "testNatsConnection", + "tags": [ + "nats_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "test nats connection", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "connection": { + "type": "object" + } + }, + "required": [ + "connection" + ] + } + } + } + }, + "responses": { + "200": { + "description": "successfuly connected to NATS servers", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/is_valid_postgres_configuration/{path}": { + "get": { + "summary": "check if postgres configuration is set to logical", + "operationId": "isValidPostgresConfiguration", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "boolean that indicates if postgres is set to logical level or not", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/create_template_script": { + "post": { + "summary": "create template script", + "operationId": "createTemplateScript", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "template script", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TemplateScript" + } + } + } + }, + "responses": { + "200": { + "description": "custom id to retrieve template script", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/get_template_script/{id}": { + "get": { + "summary": "get template script", + "operationId": "getTemplateScript", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Id" + } + ], + "responses": { + "200": { + "description": "template script", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/slot/list/{path}": { + "get": { + "summary": "list postgres replication slot", + "operationId": "listPostgresReplicationSlot", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "list postgres slot", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SlotList" + } + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/slot/create/{path}": { + "post": { + "summary": "create replication slot for postgres", + "operationId": "createPostgresReplicationSlot", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "requestBody": { + "description": "new slot for postgres", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Slot" + } + } + } + }, + "responses": { + "201": { + "description": "slot created", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/slot/delete/{path}": { + "delete": { + "summary": "delete postgres replication slot", + "operationId": "deletePostgresReplicationSlot", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "requestBody": { + "description": "replication slot of postgres", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Slot" + } + } + } + }, + "responses": { + "200": { + "description": "postgres replication slot deleted", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/publication/list/{path}": { + "get": { + "summary": "list postgres publication", + "operationId": "listPostgresPublication", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "database publication list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/publication/get/{publication}/{path}": { + "get": { + "summary": "get postgres publication", + "operationId": "getPostgresPublication", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + }, + { + "$ref": "#/components/parameters/PublicationName" + } + ], + "responses": { + "200": { + "description": "postgres publication get", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicationData" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/publication/create/{publication}/{path}": { + "post": { + "summary": "create publication for postgres", + "operationId": "createPostgresPublication", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + }, + { + "$ref": "#/components/parameters/PublicationName" + } + ], + "requestBody": { + "description": "new publication for postgres", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicationData" + } + } + } + }, + "responses": { + "201": { + "description": "publication created", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/publication/update/{publication}/{path}": { + "post": { + "summary": "update publication for postgres", + "operationId": "updatePostgresPublication", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + }, + { + "$ref": "#/components/parameters/PublicationName" + } + ], + "requestBody": { + "description": "update publication for postgres", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicationData" + } + } + } + }, + "responses": { + "201": { + "description": "publication updated", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/publication/delete/{publication}/{path}": { + "delete": { + "summary": "delete postgres publication", + "operationId": "deletePostgresPublication", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + }, + { + "$ref": "#/components/parameters/PublicationName" + } + ], + "responses": { + "200": { + "description": "postgres publication deleted", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/create": { + "post": { + "summary": "create postgres trigger", + "operationId": "createPostgresTrigger", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "requestBody": { + "description": "new postgres trigger", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewPostgresTrigger" + } + } + } + }, + "responses": { + "201": { + "description": "postgres trigger created", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/update/{path}": { + "post": { + "summary": "update postgres trigger", + "operationId": "updatePostgresTrigger", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "requestBody": { + "description": "updated trigger", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditPostgresTrigger" + } + } + } + }, + "responses": { + "200": { + "description": "postgres trigger updated", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/delete/{path}": { + "delete": { + "summary": "delete postgres trigger", + "operationId": "deletePostgresTrigger", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "postgres trigger deleted", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/get/{path}": { + "get": { + "summary": "get postgres trigger", + "operationId": "getPostgresTrigger", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "get postgres trigger", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostgresTrigger" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/list": { + "get": { + "summary": "list postgres triggers", + "operationId": "listPostgresTriggers", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId", + "required": true + }, + { + "$ref": "#/components/parameters/Page" + }, + { + "$ref": "#/components/parameters/PerPage" + }, + { + "name": "path", + "description": "filter by path", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "is_flow", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "path_start", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "postgres trigger list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostgresTrigger" + } + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/exists/{path}": { + "get": { + "summary": "does postgres trigger exists", + "operationId": "existsPostgresTrigger", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "postgres trigger exists", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, + "/w/{workspace}/postgres_triggers/setenabled/{path}": { + "post": { + "summary": "set enabled postgres trigger", + "operationId": "setPostgresTriggerEnabled", + "tags": [ + "postgres_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "requestBody": { + "description": "updated postgres trigger enable", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + }, + "required": [ + "enabled" + ] + } + } + } + }, + "responses": { + "200": { + "description": "postgres trigger enabled set", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/groups/list": { "get": { "summary": "list instance groups", @@ -13498,7 +15905,10 @@ "app", "raw_app", "http_trigger", - "websocket_trigger" + "websocket_trigger", + "kafka_trigger", + "nats_trigger", + "postgres_trigger" ] } } @@ -13551,7 +15961,10 @@ "app", "raw_app", "http_trigger", - "websocket_trigger" + "websocket_trigger", + "kafka_trigger", + "nats_trigger", + "postgres_trigger" ] } } @@ -13623,7 +16036,10 @@ "app", "raw_app", "http_trigger", - "websocket_trigger" + "websocket_trigger", + "kafka_trigger", + "nats_trigger", + "postgres_trigger" ] } } @@ -13661,32 +16077,59 @@ } } }, - "/w/{workspace}/capture_u/{path}": { + "/w/{workspace}/capture/set_config": { "post": { - "summary": "update flow preview capture", - "operationId": "updateCapture", + "summary": "set capture config", + "operationId": "setCaptureConfig", "tags": [ "capture" ], "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" - }, - { - "$ref": "#/components/parameters/Path" } ], + "requestBody": { + "description": "capture config", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "trigger_kind": { + "$ref": "#/components/schemas/CaptureTriggerKind" + }, + "path": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + }, + "trigger_config": { + "type": "object" + } + }, + "required": [ + "trigger_kind", + "path", + "is_flow" + ] + } + } + } + }, "responses": { - "204": { - "description": "flow preview captured" + "200": { + "description": "capture config set" } } } }, - "/w/{workspace}/capture/{path}": { - "put": { - "summary": "create flow preview capture", - "operationId": "createCapture", + "/w/{workspace}/capture/ping_config/{trigger_kind}/{runnable_kind}/{path}": { + "post": { + "summary": "ping capture config", + "operationId": "pingCaptureConfig", "tags": [ "capture" ], @@ -13694,18 +16137,114 @@ { "$ref": "#/components/parameters/WorkspaceId" }, + { + "name": "trigger_kind", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/CaptureTriggerKind" + } + }, + { + "$ref": "#/components/parameters/RunnableKind" + }, { "$ref": "#/components/parameters/Path" } ], "responses": { - "201": { - "description": "flow preview capture created" + "200": { + "description": "capture config pinged" } } - }, + } + }, + "/w/{workspace}/capture/get_configs/{runnable_kind}/{path}": { "get": { - "summary": "get flow preview capture", + "summary": "get capture configs for a script or flow", + "operationId": "getCaptureConfigs", + "tags": [ + "capture" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/RunnableKind" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "capture configs for a script or flow", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CaptureConfig" + } + } + } + } + } + } + } + }, + "/w/{workspace}/capture/list/{runnable_kind}/{path}": { + "get": { + "summary": "list captures for a script or flow", + "operationId": "listCaptures", + "tags": [ + "capture" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/RunnableKind" + }, + { + "$ref": "#/components/parameters/Path" + }, + { + "name": "trigger_kind", + "in": "query", + "schema": { + "$ref": "#/components/schemas/CaptureTriggerKind" + } + }, + { + "$ref": "#/components/parameters/Page" + }, + { + "$ref": "#/components/parameters/PerPage" + } + ], + "responses": { + "200": { + "description": "list of captures for a script or flow", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Capture" + } + } + } + } + } + } + } + }, + "/w/{workspace}/capture/{id}": { + "get": { + "summary": "get a capture", "operationId": "getCapture", "tags": [ "capture" @@ -13715,20 +16254,49 @@ "$ref": "#/components/parameters/WorkspaceId" }, { - "$ref": "#/components/parameters/Path" + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } } ], "responses": { "200": { - "description": "captured flow preview", + "description": "capture", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/Capture" + } } } + } + } + }, + "delete": { + "summary": "delete a capture", + "operationId": "deleteCapture", + "tags": [ + "capture" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" }, - "404": { - "description": "capture does not exist for this flow" + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "capture deleted" } } } @@ -13839,6 +16407,13 @@ }, { "$ref": "#/components/parameters/PerPage" + }, + { + "name": "include_preview", + "in": "query", + "schema": { + "type": "boolean" + } } ], "responses": { @@ -14142,6 +16717,9 @@ "properties": { "connection_settings_str": { "type": "string" + }, + "azure_container_path": { + "type": "string" } }, "required": [ @@ -15737,14 +18315,6 @@ "type": "string" } }, - { - "name": "hosts", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "min_ts", "in": "query", @@ -15790,6 +18360,41 @@ } } } + }, + "/srch/index/delete/{idx_name}": { + "delete": { + "summary": "Restart container and delete the index to recreate it.", + "operationId": "clearIndex", + "tags": [ + "indexSearch" + ], + "parameters": [ + { + "name": "idx_name", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "JobIndex", + "ServiceLogIndex" + ] + } + } + ], + "responses": { + "200": { + "description": "idx to be deleted and container restarting", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } } }, "components": { @@ -15805,6 +18410,14 @@ } }, "parameters": { + "Id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, "Key": { "name": "key", "in": "path", @@ -15821,6 +18434,14 @@ "type": "string" } }, + "PublicationName": { + "name": "publication", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, "VersionId": { "name": "version", "in": "path", @@ -15886,6 +18507,14 @@ "type": "string" } }, + "CustomPath": { + "name": "custom_path", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, "PathId": { "name": "id", "in": "path", @@ -16259,17 +18888,41 @@ "schema": { "type": "string" } + }, + "RunnableKind": { + "name": "runnable_kind", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "script", + "flow" + ] + } } }, "schemas": { - "AiResource": { + "AIProvider": { + "type": "string", + "enum": [ + "openai", + "anthropic", + "mistral", + "deepseek", + "groq", + "openrouter", + "customai" + ] + }, + "AIResource": { "type": "object", "properties": { "path": { "type": "string" }, "provider": { - "type": "string" + "$ref": "#/components/schemas/AIProvider" } }, "required": [ @@ -16337,25 +18990,7 @@ "type": "string" }, "language": { - "type": "string", - "enum": [ - "python3", - "deno", - "go", - "bash", - "powershell", - "postgresql", - "mysql", - "bigquery", - "snowflake", - "mssql", - "graphql", - "nativets", - "bun", - "php", - "rust", - "ansible" - ] + "$ref": "#/components/schemas/ScriptLang" }, "kind": { "type": "string", @@ -16364,7 +18999,8 @@ "failure", "trigger", "command", - "approval" + "approval", + "preprocessor" ] }, "starred": { @@ -16426,6 +19062,9 @@ }, "has_preprocessor": { "type": "boolean" + }, + "on_behalf_of_email": { + "type": "string" } }, "required": [ @@ -16475,25 +19114,7 @@ "type": "string" }, "language": { - "type": "string", - "enum": [ - "python3", - "deno", - "go", - "bash", - "powershell", - "postgresql", - "mysql", - "bigquery", - "snowflake", - "mssql", - "graphql", - "nativets", - "bun", - "php", - "rust", - "ansible" - ] + "$ref": "#/components/schemas/ScriptLang" }, "kind": { "type": "string", @@ -16502,7 +19123,8 @@ "failure", "trigger", "command", - "approval" + "approval", + "preprocessor" ] }, "tag": { @@ -16561,6 +19183,9 @@ }, "has_preprocessor": { "type": "boolean" + }, + "on_behalf_of_email": { + "type": "string" } }, "required": [ @@ -16758,7 +19383,10 @@ "script_hub", "identity", "deploymentcallback", - "singlescriptflow" + "singlescriptflow", + "flowscript", + "flownode", + "appscript" ] }, "schedule_path": { @@ -16778,25 +19406,7 @@ "type": "boolean" }, "language": { - "type": "string", - "enum": [ - "python3", - "deno", - "go", - "bash", - "powershell", - "postgresql", - "mysql", - "bigquery", - "snowflake", - "mssql", - "graphql", - "nativets", - "bun", - "php", - "rust", - "ansible" - ] + "$ref": "#/components/schemas/ScriptLang" }, "email": { "type": "string" @@ -16821,6 +19431,9 @@ }, "suspend": { "type": "number" + }, + "preprocessed": { + "type": "boolean" } }, "required": [ @@ -16907,7 +19520,10 @@ "script_hub", "identity", "deploymentcallback", - "singlescriptflow" + "singlescriptflow", + "flowscript", + "flownode", + "appscript" ] }, "schedule_path": { @@ -16927,25 +19543,7 @@ "type": "boolean" }, "language": { - "type": "string", - "enum": [ - "python3", - "deno", - "go", - "bash", - "powershell", - "postgresql", - "mysql", - "bigquery", - "snowflake", - "mssql", - "graphql", - "nativets", - "bun", - "php", - "rust", - "ansible" - ] + "$ref": "#/components/schemas/ScriptLang" }, "is_skipped": { "type": "boolean" @@ -16976,6 +19574,9 @@ }, "aggregate_wait_time_ms": { "type": "number" + }, + "preprocessed": { + "type": "boolean" } }, "required": [ @@ -17065,6 +19666,9 @@ "is_admin": { "type": "boolean" }, + "name": { + "type": "string" + }, "is_super_admin": { "type": "boolean" }, @@ -17670,6 +20274,29 @@ "has_preprocessor" ] }, + "ScriptLang": { + "type": "string", + "enum": [ + "python3", + "deno", + "go", + "bash", + "powershell", + "postgresql", + "mysql", + "bigquery", + "snowflake", + "mssql", + "oracledb", + "graphql", + "nativets", + "bun", + "php", + "rust", + "ansible", + "csharp" + ] + }, "Preview": { "type": "object", "properties": { @@ -17683,25 +20310,7 @@ "$ref": "#/components/schemas/ScriptArgs" }, "language": { - "type": "string", - "enum": [ - "python3", - "deno", - "go", - "bash", - "powershell", - "postgresql", - "mysql", - "bigquery", - "snowflake", - "mssql", - "graphql", - "nativets", - "bun", - "php", - "rust", - "ansible" - ] + "$ref": "#/components/schemas/ScriptLang" }, "tag": { "type": "string" @@ -18013,6 +20622,9 @@ "paused_until": { "type": "string", "format": "date-time" + }, + "cron_version": { + "type": "string" } }, "required": [ @@ -18131,6 +20743,9 @@ "paused_until": { "type": "string", "format": "date-time" + }, + "cron_version": { + "type": "string" } }, "required": [ @@ -18199,6 +20814,9 @@ "paused_until": { "type": "string", "format": "date-time" + }, + "cron_version": { + "type": "string" } }, "required": [ @@ -18209,10 +20827,19 @@ "args" ] }, - "HttpTrigger": { + "TriggerExtraProperty": { "type": "object", "properties": { - "path": { + "email": { + "type": "string" + }, + "extra_perms": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "workspace_id": { "type": "string" }, "edited_by": { @@ -18221,6 +20848,26 @@ "edited_at": { "type": "string", "format": "date-time" + } + }, + "required": [ + "email", + "extra_perms", + "workspace_id", + "edited_by", + "edited_at" + ] + }, + "HttpTrigger": { + "allOf": [ + { + "$ref": "#/components/schemas/TriggerExtraProperty" + } + ], + "type": "object", + "properties": { + "path": { + "type": "string" }, "script_path": { "type": "string" @@ -18248,18 +20895,6 @@ "is_flow": { "type": "boolean" }, - "extra_perms": { - "type": "object", - "additionalProperties": { - "type": "boolean" - } - }, - "email": { - "type": "string" - }, - "workspace_id": { - "type": "string" - }, "http_method": { "type": "string", "enum": [ @@ -18275,6 +20910,9 @@ }, "requires_auth": { "type": "boolean" + }, + "is_static_website": { + "type": "boolean" } }, "required": [ @@ -18289,7 +20927,8 @@ "workspace_id", "is_async", "requires_auth", - "http_method" + "http_method", + "is_static_website" ] }, "NewHttpTrigger": { @@ -18339,6 +20978,9 @@ }, "requires_auth": { "type": "boolean" + }, + "is_static_website": { + "type": "boolean" } }, "required": [ @@ -18348,7 +20990,8 @@ "is_flow", "is_async", "requires_auth", - "http_method" + "http_method", + "is_static_website" ] }, "EditHttpTrigger": { @@ -18398,6 +21041,9 @@ }, "requires_auth": { "type": "boolean" + }, + "is_static_website": { + "type": "boolean" } }, "required": [ @@ -18407,7 +21053,8 @@ "kind", "is_async", "requires_auth", - "http_method" + "http_method", + "is_static_website" ] }, "TriggersCount": { @@ -18435,22 +21082,29 @@ }, "websocket_count": { "type": "number" + }, + "postgres_count": { + "type": "number" + }, + "kafka_count": { + "type": "number" + }, + "nats_count": { + "type": "number" } } }, "WebsocketTrigger": { + "allOf": [ + { + "$ref": "#/components/schemas/TriggerExtraProperty" + } + ], "type": "object", "properties": { "path": { "type": "string" }, - "edited_by": { - "type": "string" - }, - "edited_at": { - "type": "string", - "format": "date-time" - }, "script_path": { "type": "string" }, @@ -18460,18 +21114,6 @@ "is_flow": { "type": "boolean" }, - "extra_perms": { - "type": "object", - "additionalProperties": { - "type": "boolean" - } - }, - "email": { - "type": "string" - }, - "workspace_id": { - "type": "string" - }, "server_id": { "type": "string" }, @@ -18509,6 +21151,9 @@ }, "url_runnable_args": { "$ref": "#/components/schemas/ScriptArgs" + }, + "can_return_message": { + "type": "boolean" } }, "required": [ @@ -18523,8 +21168,7 @@ "workspace_id", "enabled", "filters", - "initial_messages", - "url_runnable_args" + "can_return_message" ] }, "NewWebsocketTrigger": { @@ -18569,6 +21213,9 @@ }, "url_runnable_args": { "$ref": "#/components/schemas/ScriptArgs" + }, + "can_return_message": { + "type": "boolean" } }, "required": [ @@ -18577,8 +21224,7 @@ "url", "is_flow", "filters", - "initial_messages", - "url_runnable_args" + "can_return_message" ] }, "EditWebsocketTrigger": { @@ -18620,6 +21266,9 @@ }, "url_runnable_args": { "$ref": "#/components/schemas/ScriptArgs" + }, + "can_return_message": { + "type": "boolean" } }, "required": [ @@ -18628,8 +21277,7 @@ "url", "is_flow", "filters", - "initial_messages", - "url_runnable_args" + "can_return_message" ] }, "WebsocketTriggerInitialMessage": { @@ -18674,6 +21322,539 @@ } ] }, + "Slot": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "SlotList": { + "type": "object", + "properties": { + "slot_name": { + "type": "string" + }, + "active": { + "type": "boolean" + } + } + }, + "PublicationData": { + "type": "object", + "properties": { + "table_to_track": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Relations" + } + }, + "transaction_to_track": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "transaction_to_track" + ] + }, + "TableToTrack": { + "type": "array", + "items": { + "type": "object", + "properties": { + "table_name": { + "type": "string" + }, + "columns_name": { + "type": "array", + "items": { + "type": "string" + } + }, + "where_clause": { + "type": "string" + } + }, + "required": [ + "table_name" + ] + } + }, + "Relations": { + "type": "object", + "properties": { + "schema_name": { + "type": "string" + }, + "table_to_track": { + "$ref": "#/components/schemas/TableToTrack" + } + }, + "required": [ + "schema_name", + "table_to_track" + ] + }, + "Language": { + "type": "string", + "enum": [ + "Typescript" + ] + }, + "TemplateScript": { + "type": "object", + "properties": { + "postgres_resource_path": { + "type": "string" + }, + "relations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Relations" + } + }, + "language": { + "$ref": "#/components/schemas/Language" + } + }, + "required": [ + "postgres_resource_path", + "relations", + "language" + ] + }, + "PostgresTrigger": { + "allOf": [ + { + "$ref": "#/components/schemas/TriggerExtraProperty" + } + ], + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "script_path": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "postgres_resource_path": { + "type": "string" + }, + "publication_name": { + "type": "string" + }, + "server_id": { + "type": "string" + }, + "replication_slot_name": { + "type": "string" + }, + "error": { + "type": "string" + }, + "last_server_ping": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "path", + "script_path", + "is_flow", + "enabled", + "postgres_resource_path", + "replication_slot_name", + "publication_name" + ] + }, + "NewPostgresTrigger": { + "type": "object", + "properties": { + "replication_slot_name": { + "type": "string" + }, + "publication_name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "script_path": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "postgres_resource_path": { + "type": "string" + }, + "publication": { + "$ref": "#/components/schemas/PublicationData" + } + }, + "required": [ + "path", + "script_path", + "is_flow", + "enabled", + "postgres_resource_path" + ] + }, + "EditPostgresTrigger": { + "type": "object", + "properties": { + "replication_slot_name": { + "type": "string" + }, + "publication_name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "script_path": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "postgres_resource_path": { + "type": "string" + }, + "publication": { + "$ref": "#/components/schemas/PublicationData" + } + }, + "required": [ + "path", + "script_path", + "is_flow", + "enabled", + "postgres_resource_path", + "publication_name", + "replication_slot_name" + ] + }, + "KafkaTrigger": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "edited_by": { + "type": "string" + }, + "edited_at": { + "type": "string", + "format": "date-time" + }, + "script_path": { + "type": "string" + }, + "kafka_resource_path": { + "type": "string" + }, + "group_id": { + "type": "string" + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + }, + "is_flow": { + "type": "boolean" + }, + "extra_perms": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "email": { + "type": "string" + }, + "workspace_id": { + "type": "string" + }, + "server_id": { + "type": "string" + }, + "last_server_ping": { + "type": "string", + "format": "date-time" + }, + "error": { + "type": "string" + }, + "enabled": { + "type": "boolean" + } + }, + "required": [ + "path", + "edited_by", + "edited_at", + "script_path", + "kafka_resource_path", + "group_id", + "topics", + "extra_perms", + "is_flow", + "email", + "workspace_id", + "enabled" + ] + }, + "NewKafkaTrigger": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "script_path": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + }, + "kafka_resource_path": { + "type": "string" + }, + "group_id": { + "type": "string" + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + } + }, + "required": [ + "path", + "script_path", + "is_flow", + "kafka_resource_path", + "group_id", + "topics" + ] + }, + "EditKafkaTrigger": { + "type": "object", + "properties": { + "kafka_resource_path": { + "type": "string" + }, + "group_id": { + "type": "string" + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + }, + "path": { + "type": "string" + }, + "script_path": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + } + }, + "required": [ + "path", + "script_path", + "kafka_resource_path", + "group_id", + "topics", + "is_flow" + ] + }, + "NatsTrigger": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "edited_by": { + "type": "string" + }, + "edited_at": { + "type": "string", + "format": "date-time" + }, + "script_path": { + "type": "string" + }, + "nats_resource_path": { + "type": "string" + }, + "use_jetstream": { + "type": "boolean" + }, + "stream_name": { + "type": "string" + }, + "consumer_name": { + "type": "string" + }, + "subjects": { + "type": "array", + "items": { + "type": "string" + } + }, + "is_flow": { + "type": "boolean" + }, + "extra_perms": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "email": { + "type": "string" + }, + "workspace_id": { + "type": "string" + }, + "server_id": { + "type": "string" + }, + "last_server_ping": { + "type": "string", + "format": "date-time" + }, + "error": { + "type": "string" + }, + "enabled": { + "type": "boolean" + } + }, + "required": [ + "path", + "edited_by", + "edited_at", + "script_path", + "nats_resource_path", + "use_jetstream", + "subjects", + "extra_perms", + "is_flow", + "email", + "workspace_id", + "enabled" + ] + }, + "NewNatsTrigger": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "script_path": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + }, + "nats_resource_path": { + "type": "string" + }, + "use_jetstream": { + "type": "boolean" + }, + "stream_name": { + "type": "string" + }, + "consumer_name": { + "type": "string" + }, + "subjects": { + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + } + }, + "required": [ + "path", + "script_path", + "is_flow", + "nats_resource_path", + "use_jetstream", + "subjects" + ] + }, + "EditNatsTrigger": { + "type": "object", + "properties": { + "nats_resource_path": { + "type": "string" + }, + "use_jetstream": { + "type": "boolean" + }, + "stream_name": { + "type": "string" + }, + "consumer_name": { + "type": "string" + }, + "subjects": { + "type": "array", + "items": { + "type": "string" + } + }, + "path": { + "type": "string" + }, + "script_path": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + } + }, + "required": [ + "path", + "script_path", + "nats_resource_path", + "use_jetstream", + "subjects", + "is_flow" + ] + }, "Group": { "type": "object", "properties": { @@ -18850,12 +22031,19 @@ }, "username": { "type": "string" + }, + "color": { + "type": "string" + }, + "operator_settings": { + "$ref": "#/components/schemas/OperatorSettings" } }, "required": [ "id", "name", - "username" + "username", + "color" ] } } @@ -18876,6 +22064,9 @@ }, "username": { "type": "string" + }, + "color": { + "type": "string" } }, "required": [ @@ -18897,6 +22088,9 @@ }, "domain": { "type": "string" + }, + "color": { + "type": "string" } }, "required": [ @@ -18944,6 +22138,9 @@ "super_admin": { "type": "boolean" }, + "devops": { + "type": "boolean" + }, "verified": { "type": "boolean" }, @@ -19028,6 +22225,9 @@ }, "visible_to_runner_only": { "type": "boolean" + }, + "on_behalf_of_email": { + "type": "string" } }, "required": [ @@ -19066,6 +22266,9 @@ }, "visible_to_runner_only": { "type": "boolean" + }, + "on_behalf_of_email": { + "type": "string" } }, "required": [ @@ -19287,6 +22490,9 @@ "additionalProperties": { "type": "boolean" } + }, + "custom_path": { + "type": "string" } }, "required": [ @@ -19775,25 +22981,7 @@ "type": "string" }, "language": { - "type": "string", - "enum": [ - "python3", - "deno", - "go", - "bash", - "powershell", - "postgresql", - "mysql", - "bigquery", - "snowflake", - "mssql", - "graphql", - "nativets", - "bun", - "php", - "rust", - "ansible" - ] + "$ref": "#/components/schemas/ScriptLang" } }, "required": [ @@ -20000,6 +23188,175 @@ "type": "boolean", "nullable": true, "description": "Acknowledgment status of the alert, can be true, false, or null if not set" + }, + "workspace_id": { + "type": "string", + "nullable": true, + "description": "Workspace id if the alert is in the scope of a workspace" + } + } + }, + "CaptureTriggerKind": { + "type": "string", + "enum": [ + "webhook", + "http", + "websocket", + "kafka", + "email", + "nats" + ] + }, + "Capture": { + "type": "object", + "properties": { + "trigger_kind": { + "$ref": "#/components/schemas/CaptureTriggerKind" + }, + "payload": {}, + "trigger_extra": {}, + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "trigger_kind", + "payload", + "id", + "created_at" + ] + }, + "CaptureConfig": { + "type": "object", + "properties": { + "trigger_config": {}, + "trigger_kind": { + "$ref": "#/components/schemas/CaptureTriggerKind" + }, + "error": { + "type": "string" + }, + "last_server_ping": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "trigger_kind" + ] + }, + "OperatorSettings": { + "nullable": true, + "type": "object", + "required": [ + "runs", + "schedules", + "resources", + "variables", + "triggers", + "audit_logs", + "groups", + "folders", + "workers" + ], + "properties": { + "runs": { + "type": "boolean", + "description": "Whether operators can view runs" + }, + "schedules": { + "type": "boolean", + "description": "Whether operators can view schedules" + }, + "resources": { + "type": "boolean", + "description": "Whether operators can view resources" + }, + "variables": { + "type": "boolean", + "description": "Whether operators can view variables" + }, + "audit_logs": { + "type": "boolean", + "description": "Whether operators can view audit logs" + }, + "triggers": { + "type": "boolean", + "description": "Whether operators can view triggers" + }, + "groups": { + "type": "boolean", + "description": "Whether operators can view groups page" + }, + "folders": { + "type": "boolean", + "description": "Whether operators can view folders page" + }, + "workers": { + "type": "boolean", + "description": "Whether operators can view workers page" + } + } + }, + "TeamInfo": { + "type": "object", + "required": [ + "team_id", + "team_name", + "channels" + ], + "properties": { + "team_id": { + "type": "string", + "description": "The unique identifier of the Microsoft Teams team", + "example": "19:abc123def456@thread.tacv2" + }, + "team_name": { + "type": "string", + "description": "The display name of the Microsoft Teams team", + "example": "Engineering Team" + }, + "channels": { + "type": "array", + "description": "List of channels within the team", + "items": { + "$ref": "#/components/schemas/ChannelInfo" + } + } + } + }, + "ChannelInfo": { + "type": "object", + "required": [ + "channel_id", + "channel_name", + "tenant_id", + "service_url" + ], + "properties": { + "channel_id": { + "type": "string", + "description": "The unique identifier of the channel", + "example": "19:channel123@thread.tacv2" + }, + "channel_name": { + "type": "string", + "description": "The display name of the channel", + "example": "General" + }, + "tenant_id": { + "type": "string", + "description": "The Microsoft Teams tenant identifier", + "example": "12345678-1234-1234-1234-123456789012" + }, + "service_url": { + "type": "string", + "description": "The service URL for the channel", + "example": "https://smba.trafficmanager.net/amer/12345678-1234-1234-1234-123456789012/" } } }, @@ -20080,6 +23437,7 @@ "bigquery", "snowflake", "mssql", + "oracledb", "graphql", "nativets", "php" diff --git a/backend/windmill-api/openapi-deref.yaml b/backend/windmill-api/openapi-deref.yaml index c8893f824c..3169141cdf 100644 --- a/backend/windmill-api/openapi-deref.yaml +++ b/backend/windmill-api/openapi-deref.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - version: 1.423.2 + version: 1.458.1 title: Windmill API contact: name: Windmill Team @@ -87,7 +87,7 @@ paths: - name: id in: path required: true - schema: &ref_30 + schema: &ref_34 type: integer responses: '200': @@ -233,24 +233,24 @@ paths: - name: before description: filter on started before (inclusive) timestamp in: query - schema: &ref_120 + schema: &ref_147 type: string format: date-time - name: after description: filter on created after (exclusive) timestamp in: query - schema: &ref_121 + schema: &ref_148 type: string format: date-time - name: username description: filter on exact username of user in: query - schema: &ref_130 + schema: &ref_158 type: string - name: operation description: filter on exact or prefix name of operation in: query - schema: &ref_131 + schema: &ref_159 type: string - name: operations in: query @@ -265,12 +265,12 @@ paths: - name: resource description: filter on exact or prefix name of resource in: query - schema: &ref_132 + schema: &ref_160 type: string - name: action_kind description: filter on type of operation in: query - schema: &ref_133 + schema: &ref_161 type: string enum: - Create @@ -302,12 +302,12 @@ paths: application/json: schema: type: object - properties: &ref_145 + properties: &ref_173 email: type: string password: type: string - required: &ref_146 + required: &ref_174 - email - password responses: @@ -375,6 +375,8 @@ paths: type: string is_admin: type: boolean + name: + type: string is_super_admin: type: boolean created_at: @@ -430,7 +432,7 @@ paths: application/json: schema: type: object - properties: &ref_147 + properties: &ref_175 is_admin: type: boolean operator: @@ -458,7 +460,7 @@ paths: - name: path in: path required: true - schema: &ref_23 + schema: &ref_26 type: string responses: '200': @@ -611,6 +613,8 @@ paths: properties: is_super_admin: type: boolean + is_devops: + type: boolean name: type: string responses: @@ -816,6 +820,8 @@ paths: type: string domain: type: string + color: + type: string required: &ref_8 - id - name @@ -846,7 +852,7 @@ paths: application/json: schema: type: object - properties: &ref_185 + properties: &ref_230 email: type: string workspaces: @@ -860,11 +866,55 @@ paths: type: string username: type: string + color: + type: string + operator_settings: + nullable: true + type: object + required: &ref_12 + - runs + - schedules + - resources + - variables + - triggers + - audit_logs + - groups + - folders + - workers + properties: &ref_13 + runs: + type: boolean + description: Whether operators can view runs + schedules: + type: boolean + description: Whether operators can view schedules + resources: + type: boolean + description: Whether operators can view resources + variables: + type: boolean + description: Whether operators can view variables + audit_logs: + type: boolean + description: Whether operators can view audit logs + triggers: + type: boolean + description: Whether operators can view triggers + groups: + type: boolean + description: Whether operators can view groups page + folders: + type: boolean + description: Whether operators can view folders page + workers: + type: boolean + description: Whether operators can view workers page required: - id - name - username - required: &ref_186 + - color + required: &ref_231 - email - workspaces /workspaces/list_as_superadmin: @@ -906,14 +956,16 @@ paths: application/json: schema: type: object - properties: &ref_187 + properties: &ref_232 id: type: string name: type: string username: type: string - required: &ref_188 + color: + type: string + required: &ref_233 - id - name responses: @@ -1143,29 +1195,46 @@ paths: content: application/json: schema: - type: array - items: - type: object - properties: &ref_230 - id: - type: integer - description: Unique identifier for the alert - alert_type: - type: string - description: Type of alert (e.g., critical_error) - message: - type: string - description: The message content of the alert - created_at: - type: string - format: date-time - description: Time when the alert was created - acknowledged: - type: boolean - nullable: true - description: >- - Acknowledgment status of the alert, can be true, false, - or null if not set + type: object + properties: + alerts: + type: array + items: + type: object + properties: &ref_29 + id: + type: integer + description: Unique identifier for the alert + alert_type: + type: string + description: Type of alert (e.g., critical_error) + message: + type: string + description: The message content of the alert + created_at: + type: string + format: date-time + description: Time when the alert was created + acknowledged: + type: boolean + nullable: true + description: >- + Acknowledgment status of the alert, can be true, + false, or null if not set + workspace_id: + type: string + nullable: true + description: >- + Workspace id if the alert is in the scope of a + workspace + total_rows: + type: integer + description: Total number of rows matching the query. + example: 100 + total_pages: + type: integer + description: Total number of pages based on the page size. + example: 10 /settings/critical_alerts/{id}/acknowledge: post: summary: Acknowledge a critical alert @@ -1356,12 +1425,12 @@ paths: type: array items: type: object - properties: &ref_223 + properties: &ref_268 name: type: string value: type: object - required: &ref_224 + required: &ref_269 - name - value /users/email: @@ -1383,9 +1452,15 @@ paths: operationId: refreshUserToken tags: - user + parameters: + - name: if_expiring_in_less_than_s + in: query + required: false + schema: + type: integer responses: '200': - description: free usage + description: new token content: text/plain: schema: @@ -1502,7 +1577,7 @@ paths: application/json: schema: type: object - properties: &ref_12 + properties: &ref_14 email: type: string login_type: @@ -1512,6 +1587,8 @@ paths: - github super_admin: type: boolean + devops: + type: boolean verified: type: boolean name: @@ -1522,7 +1599,7 @@ paths: type: string operator_only: type: boolean - required: &ref_13 + required: &ref_15 - email - login_type - super_admin @@ -1542,7 +1619,7 @@ paths: type: array items: type: object - properties: &ref_14 + properties: &ref_16 workspace_id: type: string email: @@ -1551,7 +1628,7 @@ paths: type: boolean operator: type: boolean - required: &ref_15 + required: &ref_17 - workspace_id - email - is_admin @@ -1886,6 +1963,32 @@ paths: text/plain: schema: type: string + /w/{workspace}/workspaces/change_workspace_color: + post: + summary: change workspace id + operationId: changeWorkspaceColor + tags: + - workspace + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + content: + application/json: + schema: + type: object + properties: + color: + type: string + responses: + '200': + description: status + content: + text/plain: + schema: + type: string /w/{workspace}/users/whois/{username}: get: summary: whois @@ -1911,6 +2014,36 @@ paths: type: object properties: *ref_10 required: *ref_11 + /w/{workspace}/workspaces/operator_settings: + post: + operationId: updateOperatorSettings + summary: Update operator settings for a workspace + description: >- + Updates the operator settings for a specific workspace. Requires + workspace admin privileges. + tags: + - workspace + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + required: true + content: + application/json: + schema: + nullable: true + type: object + required: *ref_12 + properties: *ref_13 + responses: + '200': + description: Operator settings updated successfully + content: + text/plain: + schema: + type: string /users/exists/{email}: get: summary: exists email @@ -1959,8 +2092,8 @@ paths: type: array items: type: object - properties: *ref_12 - required: *ref_13 + properties: *ref_14 + required: *ref_15 /w/{workspace}/workspaces/list_pending_invites: get: summary: list pending invites for a workspace @@ -1981,8 +2114,8 @@ paths: type: array items: type: object - properties: *ref_14 - required: *ref_15 + properties: *ref_16 + required: *ref_17 /w/{workspace}/workspaces/get_settings: get: summary: get settings @@ -2010,6 +2143,12 @@ paths: type: string slack_command_script: type: string + teams_team_id: + type: string + teams_command_script: + type: string + teams_team_name: + type: string auto_invite_domain: type: string auto_invite_operator: @@ -2028,26 +2167,38 @@ paths: type: string ai_resource: type: object - properties: &ref_16 + properties: &ref_18 path: type: string provider: type: string - required: &ref_17 + enum: &ref_20 + - openai + - anthropic + - mistral + - deepseek + - groq + - openrouter + - customai + required: &ref_19 - path - provider - code_completion_enabled: - type: boolean + code_completion_model: + type: string + ai_models: + type: array + items: + type: string error_handler: type: string error_handler_extra_args: type: object - additionalProperties: &ref_18 {} + additionalProperties: &ref_21 {} error_handler_muted_on_cancel: type: boolean large_file_storage: type: object - properties: &ref_19 + properties: &ref_22 type: type: string enum: @@ -2081,7 +2232,7 @@ paths: type: boolean git_sync: type: object - properties: &ref_20 + properties: &ref_23 include_path: type: array items: @@ -2106,7 +2257,7 @@ paths: type: array items: type: object - properties: &ref_207 + properties: &ref_252 script_path: type: string git_repo_resource_path: @@ -2131,12 +2282,12 @@ paths: - schedule - user - group - required: &ref_208 + required: &ref_253 - script_path - git_repo_resource_path deploy_ui: type: object - properties: &ref_21 + properties: &ref_24 include_path: type: array items: @@ -2156,7 +2307,7 @@ paths: type: string default_scripts: type: object - properties: &ref_22 + properties: &ref_25 order: type: array items: @@ -2168,8 +2319,17 @@ paths: default_script_content: additionalProperties: type: string + mute_critical_alerts: + type: boolean + color: + type: string + operator_settings: + nullable: true + type: object + required: *ref_12 + properties: *ref_13 required: - - code_completion_enabled + - ai_models - automatic_billing - error_handler_muted_on_cancel /w/{workspace}/workspaces/get_deploy_to: @@ -2238,9 +2398,12 @@ paths: type: number automatic_billing: type: boolean + owner: + type: string required: - premium - automatic_billing + - owner /w/{workspace}/workspaces/set_automatic_billing: post: summary: set automatic billing @@ -2273,6 +2436,57 @@ paths: text/plain: schema: type: string + /w/{workspace}/workspaces/threshold_alert: + get: + summary: get threshold alert info + operationId: getThresholdAlert + tags: + - workspace + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + responses: + '200': + description: status + content: + application/json: + schema: + type: object + properties: + threshold_alert_amount: + type: number + last_alert_sent: + type: string + format: date-time + post: + summary: set threshold alert info + operationId: setThresholdAlert + tags: + - workspace + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: threshold alert info + required: true + content: + application/json: + schema: + type: object + properties: + threshold_alert_amount: + type: number + responses: + '200': + description: status + content: + text/plain: + schema: + type: string /w/{workspace}/workspaces/edit_slack_command: post: summary: edit slack command @@ -2301,6 +2515,118 @@ paths: text/plain: schema: type: string + /w/{workspace}/workspaces/edit_teams_command: + post: + summary: edit teams command + operationId: editTeamsCommand + tags: + - workspace + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: WorkspaceInvite + required: true + content: + application/json: + schema: + type: object + properties: + slack_command_script: + type: string + responses: + '200': + description: status + content: + text/plain: + schema: + type: string + /w/{workspace}/workspaces/available_teams_ids: + get: + summary: list available teams ids + operationId: listAvailableTeamsIds + tags: + - workspace + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + responses: + '200': + description: status + content: + application/json: + schema: + type: array + items: + type: object + properties: + team_name: + type: string + team_id: + type: string + /w/{workspace}/workspaces/available_teams_channels: + get: + summary: list available teams channels + operationId: listAvailableTeamsChannels + tags: + - workspace + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + responses: + '200': + description: status + content: + application/json: + schema: + type: array + items: + type: object + properties: + channel_name: + type: string + channel_id: + type: string + service_url: + type: string + tenant_id: + type: string + /w/{workspace}/workspaces/connect_teams: + post: + summary: connect teams + operationId: connectTeams + tags: + - workspace + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: connect teams + required: true + content: + application/json: + schema: + type: object + properties: + team_id: + type: string + team_name: + type: string + responses: + '200': + description: status + content: + text/plain: + schema: + type: string /w/{workspace}/workspaces/run_slack_message_test_job: post: summary: run a job that sends a message to Slack @@ -2336,6 +2662,41 @@ paths: properties: job_uuid: type: string + /w/{workspace}/workspaces/run_teams_message_test_job: + post: + summary: run a job that sends a message to Teams + operationId: runTeamsMessageTestJob + tags: + - workspace + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: path to hub script to run and its corresponding args + required: true + content: + application/json: + schema: + type: object + properties: + hub_script_path: + type: string + channel: + type: string + test_msg: + type: string + responses: + '200': + description: status + content: + text/json: + schema: + type: object + properties: + job_uuid: + type: string /w/{workspace}/workspaces/edit_deploy_to: post: summary: edit deploy to @@ -2442,14 +2803,18 @@ paths: schema: type: object required: - - code_completion_enabled + - ai_models properties: ai_resource: type: object - properties: *ref_16 - required: *ref_17 - code_completion_enabled: - type: boolean + properties: *ref_18 + required: *ref_19 + code_completion_model: + type: string + ai_models: + type: array + items: + type: string responses: '200': description: status @@ -2478,14 +2843,18 @@ paths: properties: ai_provider: type: string + enum: *ref_20 exists_ai_resource: type: boolean - code_completion_enabled: - type: boolean + code_completion_model: + type: string + ai_models: + type: array + items: + type: string required: - - ai_provider - exists_ai_resource - - code_completion_enabled + - ai_models /w/{workspace}/workspaces/edit_error_handler: post: summary: edit error handler @@ -2509,7 +2878,7 @@ paths: type: string error_handler_extra_args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 error_handler_muted_on_cancel: type: boolean responses: @@ -2540,7 +2909,7 @@ paths: properties: large_file_storage: type: object - properties: *ref_19 + properties: *ref_22 responses: '200': description: status @@ -2568,7 +2937,7 @@ paths: properties: git_sync_settings: type: object - properties: *ref_20 + properties: *ref_23 responses: '200': description: status @@ -2596,7 +2965,7 @@ paths: properties: deploy_ui_settings: type: object - properties: *ref_21 + properties: *ref_24 responses: '200': description: status @@ -2648,7 +3017,7 @@ paths: application/json: schema: type: object - properties: *ref_22 + properties: *ref_25 responses: '200': description: status @@ -2673,7 +3042,7 @@ paths: application/json: schema: type: object - properties: *ref_22 + properties: *ref_25 /w/{workspace}/workspaces/set_environment_variable: post: summary: set environment variable @@ -2799,7 +3168,7 @@ paths: application/json: schema: type: object - properties: *ref_19 + properties: *ref_22 /w/{workspace}/workspaces/usage: get: summary: get usage @@ -2841,9 +3210,18 @@ paths: type: boolean websocket_used: type: boolean + kafka_used: + type: boolean + nats_used: + type: boolean + postgres_used: + type: boolean required: - http_routes_used - websocket_used + - kafka_used + - nats_used + - postgres_used /w/{workspace}/users/list: get: summary: list users @@ -2886,7 +3264,7 @@ paths: type: array items: type: object - properties: &ref_144 + properties: &ref_172 email: type: string executions: @@ -2947,7 +3325,7 @@ paths: application/json: schema: type: object - properties: &ref_148 + properties: &ref_176 label: type: string expiration: @@ -2979,7 +3357,7 @@ paths: application/json: schema: type: object - properties: &ref_149 + properties: &ref_177 label: type: string expiration: @@ -2989,7 +3367,7 @@ paths: type: string workspace_id: type: string - required: &ref_150 + required: &ref_178 - impersonate_email responses: '201': @@ -3045,7 +3423,7 @@ paths: type: array items: type: object - properties: &ref_40 + properties: &ref_45 label: type: string expiration: @@ -3065,7 +3443,7 @@ paths: type: string email: type: string - required: &ref_41 + required: &ref_46 - token_prefix - created_at - last_used_at @@ -3114,7 +3492,7 @@ paths: application/json: schema: type: object - properties: &ref_153 + properties: &ref_181 path: type: string value: @@ -3130,7 +3508,7 @@ paths: expires_at: type: string format: date-time - required: &ref_154 + required: &ref_182 - path - value - is_secret @@ -3181,7 +3559,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: variable deleted @@ -3203,7 +3581,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 - name: already_encrypted in: query schema: @@ -3215,7 +3593,7 @@ paths: application/json: schema: type: object - properties: &ref_155 + properties: &ref_183 path: type: string value: @@ -3245,7 +3623,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 - name: decrypt_secret description: | ask to decrypt secret if this variable is secret @@ -3267,7 +3645,7 @@ paths: application/json: schema: type: object - properties: &ref_24 + properties: &ref_27 workspace_id: type: string path: @@ -3297,7 +3675,7 @@ paths: expires_at: type: string format: date-time - required: &ref_25 + required: &ref_28 - workspace_id - path - is_secret @@ -3316,7 +3694,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: variable @@ -3338,7 +3716,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: variable @@ -3378,8 +3756,8 @@ paths: type: array items: type: object - properties: *ref_24 - required: *ref_25 + properties: *ref_27 + required: *ref_28 /w/{workspace}/variables/list_contextual: get: summary: list contextual variables @@ -3400,7 +3778,7 @@ paths: type: array items: type: object - properties: &ref_151 + properties: &ref_179 name: type: string value: @@ -3409,11 +3787,141 @@ paths: type: string is_custom: type: boolean - required: &ref_152 + required: &ref_180 - name - value - description - is_custom + /w/{workspace}/workspaces/critical_alerts: + get: + summary: Get all critical alerts for this workspace + operationId: workspaceGetCriticalAlerts + tags: + - setting + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - in: query + name: page + schema: + type: integer + default: 1 + description: The page number to retrieve (minimum value is 1) + - in: query + name: page_size + schema: + type: integer + default: 10 + maximum: 100 + description: Number of alerts per page (maximum is 100) + - in: query + name: acknowledged + schema: + type: boolean + nullable: true + description: >- + Filter by acknowledgment status; true for acknowledged, false for + unacknowledged, and omit for all alerts + responses: + '200': + description: Successfully retrieved all critical alerts + content: + application/json: + schema: + type: object + properties: + alerts: + type: array + items: + type: object + properties: *ref_29 + total_rows: + type: integer + description: Total number of rows matching the query. + example: 100 + total_pages: + type: integer + description: Total number of pages based on the page size. + example: 10 + /w/{workspace}/workspaces/critical_alerts/{id}/acknowledge: + post: + summary: Acknowledge a critical alert for this workspace + operationId: workspaceAcknowledgeCriticalAlert + tags: + - setting + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - in: path + name: id + required: true + schema: + type: integer + description: The ID of the critical alert to acknowledge + responses: + '200': + description: Successfully acknowledged the critical alert + content: + application/json: + schema: + type: string + example: Critical alert acknowledged + /w/{workspace}/workspaces/critical_alerts/acknowledge_all: + post: + summary: Acknowledge all unacknowledged critical alerts for this workspace + operationId: workspaceAcknowledgeAllCriticalAlerts + tags: + - setting + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + responses: + '200': + description: Successfully acknowledged all unacknowledged critical alerts. + content: + application/json: + schema: + type: string + example: All unacknowledged critical alerts acknowledged + /w/{workspace}/workspaces/critical_alerts/mute: + post: + summary: Mute critical alert UI for this workspace + operationId: workspaceMuteCriticalAlertsUI + tags: + - setting + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: Boolean flag to mute critical alerts. + required: true + content: + application/json: + schema: + type: object + properties: + mute_critical_alerts: + type: boolean + description: Whether critical alerts should be muted. + example: true + responses: + '200': + description: Successfully updated mute critical alert settings. + content: + application/json: + schema: + type: string + example: >- + Updated mute critical alert UI settings for workspace: + workspace_id /oauth/login_callback/{client_name}: post: security: [] @@ -3425,7 +3933,7 @@ paths: - name: client_name in: path required: true - schema: &ref_26 + schema: &ref_30 type: string requestBody: description: Partially filled script @@ -3526,7 +4034,7 @@ paths: - name: client_name in: path required: true - schema: *ref_26 + schema: *ref_30 requestBody: description: code endpoint required: true @@ -3549,7 +4057,7 @@ paths: application/json: schema: type: object - properties: &ref_200 + properties: &ref_245 access_token: type: string expires_in: @@ -3560,7 +4068,7 @@ paths: type: array items: type: string - required: &ref_201 + required: &ref_246 - access_token /w/{workspace}/oauth/create_account: post: @@ -3611,7 +4119,7 @@ paths: - name: id in: path required: true - schema: &ref_27 + schema: &ref_31 type: integer requestBody: description: variable path @@ -3646,7 +4154,7 @@ paths: - name: id in: path required: true - schema: *ref_27 + schema: *ref_31 responses: '200': description: disconnected client @@ -3672,6 +4180,24 @@ paths: text/plain: schema: type: string + /w/{workspace}/oauth/disconnect_teams: + post: + summary: disconnect teams + operationId: disconnectTeams + tags: + - oauth + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + responses: + '200': + description: disconnected teams + content: + text/plain: + schema: + type: string /oauth/list_logins: get: summary: list oauth logins @@ -3743,6 +4269,95 @@ paths: type: array items: type: string + /teams/sync: + post: + operationId: syncTeams + summary: synchronize Microsoft Teams information (teams/channels) + tags: + - teams + responses: + '200': + description: Teams information successfully synchronized + content: + application/json: + schema: + type: array + items: + type: object + required: &ref_277 + - team_id + - team_name + - channels + properties: &ref_278 + team_id: + type: string + description: The unique identifier of the Microsoft Teams team + example: 19:abc123def456@thread.tacv2 + team_name: + type: string + description: The display name of the Microsoft Teams team + example: Engineering Team + channels: + type: array + description: List of channels within the team + items: + type: object + required: &ref_279 + - channel_id + - channel_name + - tenant_id + - service_url + properties: &ref_280 + channel_id: + type: string + description: The unique identifier of the channel + example: 19:channel123@thread.tacv2 + channel_name: + type: string + description: The display name of the channel + example: General + tenant_id: + type: string + description: The Microsoft Teams tenant identifier + example: 12345678-1234-1234-1234-123456789012 + service_url: + type: string + description: The service URL for the channel + example: >- + https://smba.trafficmanager.net/amer/12345678-1234-1234-1234-123456789012/ + /teams/activities: + post: + summary: send update to Microsoft Teams activity + description: Respond to a Microsoft Teams activity after a workspace command is run + operationId: sendMessageToConversation + tags: + - teams + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - conversation_id + - text + properties: + conversation_id: + type: string + description: The ID of the Teams conversation/activity + success: + type: boolean + description: Used for styling the card conditionally + default: true + text: + type: string + description: The message text to be sent in the Teams card + card_block: + type: object + description: The card block to be sent in the Teams card + responses: + '200': + description: Activity processed successfully /w/{workspace}/resources/create: post: summary: create resource @@ -3765,7 +4380,7 @@ paths: application/json: schema: type: object - properties: &ref_162 + properties: &ref_190 path: type: string value: {} @@ -3773,7 +4388,7 @@ paths: type: string resource_type: type: string - required: &ref_163 + required: &ref_191 - path - value - resource_type @@ -3798,7 +4413,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: resource deleted @@ -3820,7 +4435,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 requestBody: description: updated resource required: true @@ -3828,7 +4443,7 @@ paths: application/json: schema: type: object - properties: &ref_164 + properties: &ref_192 path: type: string description: @@ -3855,7 +4470,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 requestBody: description: updated resource required: true @@ -3886,7 +4501,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: resource @@ -3894,7 +4509,7 @@ paths: application/json: schema: type: object - properties: &ref_165 + properties: &ref_193 workspace_id: type: string path: @@ -3915,7 +4530,7 @@ paths: edited_at: type: string format: date-time - required: &ref_166 + required: &ref_194 - path - resource_type - is_oauth @@ -3933,7 +4548,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 - name: job_id description: job id in: query @@ -3960,7 +4575,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: resource value @@ -3981,7 +4596,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: does resource exists @@ -4031,7 +4646,7 @@ paths: type: array items: type: object - properties: &ref_167 + properties: &ref_195 workspace_id: type: string path: @@ -4062,7 +4677,7 @@ paths: edited_at: type: string format: date-time - required: &ref_168 + required: &ref_196 - path - resource_type - is_oauth @@ -4109,7 +4724,7 @@ paths: - name: name in: path required: true - schema: &ref_103 + schema: &ref_126 type: string responses: '200': @@ -4146,7 +4761,7 @@ paths: application/json: schema: type: object - properties: &ref_28 + properties: &ref_32 workspace_id: type: string name: @@ -4161,7 +4776,7 @@ paths: format: date-time format_extension: type: string - required: &ref_29 + required: &ref_33 - name responses: '201': @@ -4201,7 +4816,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: resource_type deleted @@ -4223,7 +4838,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 requestBody: description: updated resource_type required: true @@ -4231,7 +4846,7 @@ paths: application/json: schema: type: object - properties: &ref_169 + properties: &ref_197 schema: {} description: type: string @@ -4256,7 +4871,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: resource_type deleted @@ -4264,8 +4879,8 @@ paths: application/json: schema: type: object - properties: *ref_28 - required: *ref_29 + properties: *ref_32 + required: *ref_33 /w/{workspace}/resources/type/exists/{path}: get: summary: does resource_type exists @@ -4280,7 +4895,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: does resource_type exist @@ -4308,8 +4923,8 @@ paths: type: array items: type: object - properties: *ref_28 - required: *ref_29 + properties: *ref_32 + required: *ref_33 /w/{workspace}/resources/type/listnames: get: summary: list resource_types names @@ -4448,7 +5063,7 @@ paths: - name: id in: path required: true - schema: *ref_30 + schema: *ref_34 responses: '200': description: flow @@ -4459,51 +5074,51 @@ paths: properties: flow: type: object - properties: &ref_54 + properties: &ref_59 summary: type: string description: type: string value: type: object - properties: &ref_66 + properties: &ref_72 modules: type: array items: type: object - properties: &ref_33 + properties: &ref_37 id: type: string value: - oneOf: &ref_251 + oneOf: &ref_301 - type: object - properties: &ref_235 + properties: &ref_285 input_transforms: type: object additionalProperties: - oneOf: &ref_31 + oneOf: &ref_35 - type: object - properties: &ref_231 + properties: &ref_281 value: {} type: type: string enum: - javascript - required: &ref_232 + required: &ref_282 - expr - type - type: object - properties: &ref_233 + properties: &ref_283 expr: type: string type: type: string enum: - javascript - required: &ref_234 + required: &ref_284 - expr - type - discriminator: &ref_32 + discriminator: &ref_36 propertyName: type mapping: static: '#/components/schemas/StaticTransform' @@ -4524,6 +5139,7 @@ paths: - bigquery - snowflake - mssql + - oracledb - graphql - nativets - php @@ -4545,18 +5161,18 @@ paths: type: string is_trigger: type: boolean - required: &ref_236 + required: &ref_286 - type - content - language - input_transforms - type: object - properties: &ref_237 + properties: &ref_287 input_transforms: type: object additionalProperties: - oneOf: *ref_31 - discriminator: *ref_32 + oneOf: *ref_35 + discriminator: *ref_36 path: type: string hash: @@ -4569,40 +5185,40 @@ paths: type: string is_trigger: type: boolean - required: &ref_238 + required: &ref_288 - type - path - input_transforms - type: object - properties: &ref_239 + properties: &ref_289 input_transforms: type: object additionalProperties: - oneOf: *ref_31 - discriminator: *ref_32 + oneOf: *ref_35 + discriminator: *ref_36 path: type: string type: type: string enum: - flow - required: &ref_240 + required: &ref_290 - type - path - input_transforms - type: object - properties: &ref_241 + properties: &ref_291 modules: type: array items: type: object - properties: *ref_33 - required: &ref_34 + properties: *ref_37 + required: &ref_38 - value - id iterator: - oneOf: *ref_31 - discriminator: *ref_32 + oneOf: *ref_35 + discriminator: *ref_36 skip_failures: type: boolean type: @@ -4613,19 +5229,19 @@ paths: type: boolean parallelism: type: integer - required: &ref_242 + required: &ref_292 - modules - iterator - skip_failures - type - type: object - properties: &ref_243 + properties: &ref_293 modules: type: array items: type: object - properties: *ref_33 - required: *ref_34 + properties: *ref_37 + required: *ref_38 skip_failures: type: boolean type: @@ -4636,12 +5252,12 @@ paths: type: boolean parallelism: type: integer - required: &ref_244 + required: &ref_294 - modules - skip_failures - type - type: object - properties: &ref_245 + properties: &ref_295 branches: type: array items: @@ -4655,8 +5271,8 @@ paths: type: array items: type: object - properties: *ref_33 - required: *ref_34 + properties: *ref_37 + required: *ref_38 required: - modules - expr @@ -4664,20 +5280,20 @@ paths: type: array items: type: object - properties: *ref_33 - required: *ref_34 + properties: *ref_37 + required: *ref_38 required: - modules type: type: string enum: - branchone - required: &ref_246 + required: &ref_296 - branches - default - type - type: object - properties: &ref_247 + properties: &ref_297 branches: type: array items: @@ -4691,8 +5307,8 @@ paths: type: array items: type: object - properties: *ref_33 - required: *ref_34 + properties: *ref_37 + required: *ref_38 required: - modules - expr @@ -4702,20 +5318,20 @@ paths: - branchall parallel: type: boolean - required: &ref_248 + required: &ref_298 - branches - type - type: object - properties: &ref_249 + properties: &ref_299 type: type: string enum: - identity flow: type: boolean - required: &ref_250 + required: &ref_300 - type - discriminator: &ref_252 + discriminator: &ref_302 propertyName: type mapping: rawscript: '#/components/schemas/RawScript' @@ -4752,8 +5368,8 @@ paths: required: - expr sleep: - oneOf: *ref_31 - discriminator: *ref_32 + oneOf: *ref_35 + discriminator: *ref_36 cache_ttl: type: number timeout: @@ -4783,8 +5399,8 @@ paths: user_auth_required: type: boolean user_groups_required: - oneOf: *ref_31 - discriminator: *ref_32 + oneOf: *ref_35 + discriminator: *ref_36 self_approval_disabled: type: boolean hide_cancel: @@ -4797,7 +5413,7 @@ paths: type: boolean retry: type: object - properties: &ref_95 + properties: &ref_101 constant: type: object properties: @@ -4818,15 +5434,15 @@ paths: type: integer minimum: 0 maximum: 100 - required: *ref_34 + required: *ref_38 failure_module: type: object - properties: *ref_33 - required: *ref_34 + properties: *ref_37 + required: *ref_38 preprocessor_module: type: object - properties: *ref_33 - required: *ref_34 + properties: *ref_37 + required: *ref_38 same_worker: type: boolean concurrent_limit: @@ -4843,11 +5459,11 @@ paths: type: number early_return: type: string - required: &ref_67 + required: &ref_73 - modules schema: type: object - required: &ref_55 + required: &ref_60 - summary - value /apps/hub/list: @@ -4900,7 +5516,7 @@ paths: - name: id in: path required: true - schema: *ref_30 + schema: *ref_34 responses: '200': description: app @@ -4920,6 +5536,99 @@ paths: - value required: - app + /apps_u/public_app_by_custom_path/{custom_path}: + get: + summary: get public app by custom path + operationId: getPublicAppByCustomPath + tags: + - app + parameters: + - name: custom_path + in: path + required: true + schema: &ref_71 + type: string + responses: + '200': + description: app details + content: + application/json: + schema: + allOf: + - type: object + properties: &ref_67 + id: + type: integer + workspace_id: + type: string + path: + type: string + summary: + type: string + versions: + type: array + items: + type: integer + created_by: + type: string + created_at: + type: string + format: date-time + value: + type: object + policy: + type: object + properties: &ref_66 + triggerables: + type: object + additionalProperties: + type: object + triggerables_v2: + type: object + additionalProperties: + type: object + s3_inputs: + type: array + items: + type: object + execution_mode: + type: string + enum: + - viewer + - publisher + - anonymous + on_behalf_of: + type: string + on_behalf_of_email: + type: string + execution_mode: + type: string + enum: + - viewer + - publisher + - anonymous + extra_perms: + type: object + additionalProperties: + type: boolean + custom_path: + type: string + required: &ref_68 + - id + - workspace_id + - path + - summary + - versions + - created_by + - created_at + - value + - policy + - execution_mode + - extra_perms + - type: object + properties: + workspace_id: + type: string /scripts/hub/get/{path}: get: summary: get hub script content by path @@ -4930,7 +5639,7 @@ paths: - name: path in: path required: true - schema: &ref_35 + schema: &ref_39 type: string responses: '200': @@ -4949,7 +5658,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: script details @@ -5020,7 +5729,7 @@ paths: type: number kind: name: kind - schema: &ref_36 + schema: &ref_40 type: string enum: - script @@ -5093,7 +5802,7 @@ paths: type: string kind: name: kind - schema: *ref_36 + schema: *ref_40 score: type: number required: @@ -5154,12 +5863,12 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: &ref_52 + schema: &ref_57 type: boolean - name: created_by description: mask to filter exact matching user creator in: query - schema: &ref_53 + schema: &ref_58 type: string - name: path_start description: mask to filter matching starting path @@ -5273,7 +5982,7 @@ paths: type: array items: type: object - properties: &ref_37 + properties: &ref_42 workspace_id: type: string hash: @@ -5316,7 +6025,7 @@ paths: type: string language: type: string - enum: + enum: &ref_41 - python3 - deno - go @@ -5327,12 +6036,14 @@ paths: - bigquery - snowflake - mssql + - oracledb - graphql - nativets - bun - php - rust - ansible + - csharp kind: type: string enum: @@ -5341,6 +6052,7 @@ paths: - trigger - command - approval + - preprocessor starred: type: boolean tag: @@ -5381,7 +6093,9 @@ paths: type: string has_preprocessor: type: boolean - required: &ref_38 + on_behalf_of_email: + type: string + required: &ref_43 - hash - path - summary @@ -5479,7 +6193,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: draft deleted @@ -5505,7 +6219,7 @@ paths: application/json: schema: type: object - properties: &ref_42 + properties: &ref_47 path: type: string parent_hash: @@ -5524,23 +6238,7 @@ paths: type: string language: type: string - enum: - - python3 - - deno - - go - - bash - - powershell - - postgresql - - mysql - - bigquery - - snowflake - - mssql - - graphql - - nativets - - bun - - php - - rust - - ansible + enum: *ref_41 kind: type: string enum: @@ -5549,6 +6247,7 @@ paths: - trigger - command - approval + - preprocessor tag: type: string draft_only: @@ -5587,7 +6286,9 @@ paths: type: string has_preprocessor: type: boolean - required: &ref_43 + on_behalf_of_email: + type: string + required: &ref_48 - path - summary - description @@ -5614,7 +6315,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 requestBody: description: Workspace error handler enabled required: true @@ -5640,6 +6341,17 @@ paths: operationId: getCustomTags tags: - worker + parameters: + - name: workspace + in: query + schema: + type: string + required: false + - name: show_workspace_restriction + in: query + schema: + type: boolean + required: false responses: '200': description: list of custom tags @@ -5691,7 +6403,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: script archived @@ -5713,7 +6425,7 @@ paths: - name: hash in: path required: true - schema: &ref_39 + schema: &ref_44 type: string responses: '200': @@ -5722,8 +6434,8 @@ paths: application/json: schema: type: object - properties: *ref_37 - required: *ref_38 + properties: *ref_42 + required: *ref_43 /w/{workspace}/scripts/delete/h/{hash}: post: summary: delete script by hash (erase content but keep hash, require admin) @@ -5738,7 +6450,7 @@ paths: - name: hash in: path required: true - schema: *ref_39 + schema: *ref_44 responses: '200': description: script details @@ -5746,11 +6458,11 @@ paths: application/json: schema: type: object - properties: *ref_37 - required: *ref_38 + properties: *ref_42 + required: *ref_43 /w/{workspace}/scripts/delete/p/{path}: post: - summary: delete all scripts at a given path (require admin) + summary: delete script at a given path (require admin) operationId: deleteScriptByPath tags: - script @@ -5762,7 +6474,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: script path @@ -5784,7 +6496,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 - name: with_starred_info in: query schema: @@ -5796,8 +6508,8 @@ paths: application/json: schema: type: object - properties: *ref_37 - required: *ref_38 + properties: *ref_42 + required: *ref_43 /w/{workspace}/scripts/get_triggers_count/{path}: get: summary: get triggers count of script @@ -5812,7 +6524,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: triggers count @@ -5820,7 +6532,7 @@ paths: application/json: schema: type: object - properties: &ref_59 + properties: &ref_64 primary_schedule: type: object properties: @@ -5836,6 +6548,12 @@ paths: type: number websocket_count: type: number + postgres_count: + type: number + kafka_count: + type: number + nats_count: + type: number /w/{workspace}/scripts/list_tokens/{path}: get: summary: get tokens with script scope @@ -5850,7 +6568,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: tokens list @@ -5860,8 +6578,8 @@ paths: type: array items: type: object - properties: *ref_40 - required: *ref_41 + properties: *ref_45 + required: *ref_46 /w/{workspace}/scripts/get/draft/{path}: get: summary: get script by path with draft @@ -5876,23 +6594,23 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: script details content: application/json: schema: - allOf: &ref_137 + allOf: &ref_165 - type: object - properties: *ref_42 - required: *ref_43 + properties: *ref_47 + required: *ref_48 - type: object properties: draft: type: object - properties: *ref_42 - required: *ref_43 + properties: *ref_47 + required: *ref_48 hash: type: string required: @@ -5911,7 +6629,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: script history @@ -5921,12 +6639,12 @@ paths: type: array items: type: object - properties: &ref_44 + properties: &ref_49 script_hash: type: string deployment_msg: type: string - required: &ref_45 + required: &ref_50 - script_hash /w/{workspace}/scripts/get_latest_version/{path}: get: @@ -5940,7 +6658,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 tags: - script responses: @@ -5951,8 +6669,8 @@ paths: required: false schema: type: object - properties: *ref_44 - required: *ref_45 + properties: *ref_49 + required: *ref_50 /w/{workspace}/scripts/history_update/h/{hash}/p/{path}: post: summary: update history of a script @@ -5967,11 +6685,11 @@ paths: - name: hash in: path required: true - schema: *ref_39 + schema: *ref_44 - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 requestBody: description: Script deployment message required: true @@ -6003,7 +6721,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: script content @@ -6027,12 +6745,12 @@ paths: - name: token in: path required: true - schema: &ref_126 + schema: &ref_154 type: string - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: script content @@ -6054,7 +6772,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: does it exists @@ -6076,7 +6794,7 @@ paths: - name: hash in: path required: true - schema: *ref_39 + schema: *ref_44 - name: with_starred_info in: query schema: @@ -6088,8 +6806,8 @@ paths: application/json: schema: type: object - properties: *ref_37 - required: *ref_38 + properties: *ref_42 + required: *ref_43 /w/{workspace}/scripts/raw/h/{path}: get: summary: raw script by hash @@ -6104,7 +6822,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: script content @@ -6126,7 +6844,7 @@ paths: - name: hash in: path required: true - schema: *ref_39 + schema: *ref_44 responses: '200': description: script details @@ -6153,7 +6871,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 - name: scheduled_for description: when to schedule this job (leave empty for immediate run) in: query @@ -6175,20 +6893,20 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: &ref_46 + schema: &ref_51 type: string format: uuid - name: tag description: Override the tag to use in: query - schema: &ref_48 + schema: &ref_53 type: string - name: cache_ttl description: >- Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl in: query - schema: &ref_49 + schema: &ref_54 type: string - name: job_id description: >- @@ -6197,7 +6915,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: &ref_47 + schema: &ref_52 type: string format: uuid - name: invisible_to_owner @@ -6212,7 +6930,7 @@ paths: application/json: schema: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 responses: '201': description: job created @@ -6235,13 +6953,13 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6249,7 +6967,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6258,14 +6976,14 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: &ref_50 + schema: &ref_55 type: string - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: &ref_51 + schema: &ref_56 type: string requestBody: description: script args @@ -6274,7 +6992,7 @@ paths: application/json: schema: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 responses: '200': description: job result @@ -6295,23 +7013,23 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: tag description: Override the tag to use in: query - schema: *ref_48 + schema: *ref_53 - name: cache_ttl description: >- Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl in: query - schema: *ref_49 + schema: *ref_54 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6319,7 +7037,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6328,13 +7046,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_50 + schema: *ref_55 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_51 + schema: *ref_56 requestBody: description: script args required: true @@ -6342,7 +7060,7 @@ paths: application/json: schema: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 responses: '200': description: job result @@ -6362,23 +7080,23 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: tag description: Override the tag to use in: query - schema: *ref_48 + schema: *ref_53 - name: cache_ttl description: >- Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl in: query - schema: *ref_49 + schema: *ref_54 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6386,7 +7104,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6395,13 +7113,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_50 + schema: *ref_55 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_51 + schema: *ref_56 - name: payload description: > The base64 encoded payload that has been encoded as a JSON. e.g how @@ -6409,7 +7127,7 @@ paths: `encodeURIComponent(btoa(JSON.stringify({a: 2})))` in: query - schema: &ref_94 + schema: &ref_100 type: string responses: '200': @@ -6431,7 +7149,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6440,13 +7158,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_50 + schema: *ref_55 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_51 + schema: *ref_56 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6454,7 +7172,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 requestBody: description: script args required: true @@ -6462,7 +7180,7 @@ paths: application/json: schema: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 responses: '200': description: job result @@ -6483,7 +7201,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6492,13 +7210,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_50 + schema: *ref_55 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_51 + schema: *ref_56 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6506,7 +7224,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 requestBody: description: script args required: true @@ -6514,7 +7232,7 @@ paths: application/json: schema: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 responses: '200': description: job result @@ -6617,11 +7335,11 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_52 + schema: *ref_57 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_53 + schema: *ref_58 - name: path_start description: mask to filter matching starting path in: query @@ -6675,12 +7393,12 @@ paths: type: array items: allOf: - - allOf: &ref_58 + - allOf: &ref_63 - type: object - properties: *ref_54 - required: *ref_55 + properties: *ref_59 + required: *ref_60 - type: object - properties: &ref_190 + properties: &ref_235 workspace_id: type: string path: @@ -6694,7 +7412,7 @@ paths: type: boolean extra_perms: type: object - additionalProperties: &ref_189 + additionalProperties: &ref_234 type: boolean starred: type: boolean @@ -6712,7 +7430,9 @@ paths: type: number visible_to_runner_only: type: boolean - required: &ref_191 + on_behalf_of_email: + type: string + required: &ref_236 - path - edited_by - edited_at @@ -6736,7 +7456,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 tags: - flow responses: @@ -6748,7 +7468,7 @@ paths: type: array items: type: object - properties: &ref_56 + properties: &ref_61 id: type: integer created_at: @@ -6756,7 +7476,7 @@ paths: format: date-time deployment_msg: type: string - required: &ref_57 + required: &ref_62 - id - created_at /w/{workspace}/flows/get_latest_version/{path}: @@ -6771,7 +7491,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 tags: - flow responses: @@ -6782,8 +7502,8 @@ paths: required: false schema: type: object - properties: *ref_56 - required: *ref_57 + properties: *ref_61 + required: *ref_62 /w/{workspace}/flows/get/v/{version}/p/{path}: get: summary: get flow version @@ -6802,7 +7522,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 tags: - flow responses: @@ -6811,7 +7531,7 @@ paths: content: application/json: schema: - allOf: *ref_58 + allOf: *ref_63 /w/{workspace}/flows/history_update/v/{version}/p/{path}: post: summary: update flow history @@ -6830,7 +7550,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 requestBody: description: Flow deployment message required: true @@ -6866,7 +7586,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 - name: with_starred_info in: query schema: @@ -6877,7 +7597,7 @@ paths: content: application/json: schema: - allOf: *ref_58 + allOf: *ref_63 /w/{workspace}/flows/get_triggers_count/{path}: get: summary: get triggers count of flow @@ -6892,7 +7612,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: triggers count @@ -6900,7 +7620,7 @@ paths: application/json: schema: type: object - properties: *ref_59 + properties: *ref_64 /w/{workspace}/flows/list_tokens/{path}: get: summary: get tokens with flow scope @@ -6915,7 +7635,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: tokens list @@ -6925,8 +7645,8 @@ paths: type: array items: type: object - properties: *ref_40 - required: *ref_41 + properties: *ref_45 + required: *ref_46 /w/{workspace}/flows/toggle_workspace_error_handler/{path}: post: summary: Toggle ON and OFF the workspace error handler for a given flow @@ -6941,7 +7661,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 requestBody: description: Workspace error handler enabled required: true @@ -6973,7 +7693,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: flow details with draft @@ -6981,11 +7701,11 @@ paths: application/json: schema: allOf: - - allOf: *ref_58 + - allOf: *ref_63 - type: object properties: draft: - allOf: *ref_58 + allOf: *ref_63 /w/{workspace}/flows/exists/{path}: get: summary: exists flow by path @@ -7000,7 +7720,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: flow details @@ -7026,10 +7746,10 @@ paths: application/json: schema: allOf: - - allOf: &ref_60 + - allOf: &ref_65 - type: object - properties: *ref_54 - required: *ref_55 + properties: *ref_59 + required: *ref_60 - type: object properties: path: @@ -7046,6 +7766,8 @@ paths: type: number visible_to_runner_only: type: boolean + on_behalf_of_email: + type: string required: - path - type: object @@ -7075,7 +7797,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 requestBody: description: Partially filled flow required: true @@ -7083,7 +7805,7 @@ paths: application/json: schema: allOf: - - allOf: *ref_60 + - allOf: *ref_65 - type: object properties: deployment_message: @@ -7109,7 +7831,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 requestBody: description: archiveFlow required: true @@ -7141,7 +7863,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: flow delete @@ -7171,11 +7893,11 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_52 + schema: *ref_57 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_53 + schema: *ref_58 - name: path_start description: mask to filter matching starting path in: query @@ -7202,7 +7924,7 @@ paths: type: array items: type: object - properties: &ref_197 + properties: &ref_242 workspace_id: type: string path: @@ -7220,7 +7942,7 @@ paths: edited_at: type: string format: date-time - required: &ref_198 + required: &ref_243 - workspace_id - path - summary @@ -7241,7 +7963,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: app exists @@ -7263,12 +7985,12 @@ paths: - name: version in: path required: true - schema: &ref_125 + schema: &ref_153 type: number - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: app details @@ -7325,11 +8047,11 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_52 + schema: *ref_57 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_53 + schema: *ref_58 - name: path_start description: mask to filter matching starting path in: query @@ -7370,7 +8092,7 @@ paths: type: array items: type: object - properties: &ref_195 + properties: &ref_240 id: type: integer workspace_id: @@ -7396,7 +8118,7 @@ paths: - viewer - publisher - anonymous - required: &ref_196 + required: &ref_241 - id - workspace_id - path @@ -7431,33 +8153,13 @@ paths: type: string policy: type: object - properties: &ref_61 - triggerables: - type: object - additionalProperties: - type: object - triggerables_v2: - type: object - additionalProperties: - type: object - s3_inputs: - type: array - items: - type: object - execution_mode: - type: string - enum: - - viewer - - publisher - - anonymous - on_behalf_of: - type: string - on_behalf_of_email: - type: string + properties: *ref_66 draft_only: type: boolean deployment_message: type: string + custom_path: + type: string required: - path - value @@ -7484,7 +8186,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: app exists @@ -7506,7 +8208,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 - name: with_starred_info in: query schema: @@ -7518,51 +8220,32 @@ paths: application/json: schema: type: object - properties: &ref_62 - id: - type: integer - workspace_id: - type: string - path: - type: string - summary: - type: string - versions: - type: array - items: - type: integer - created_by: - type: string - created_at: - type: string - format: date-time - value: - type: object - policy: - type: object - properties: *ref_61 - execution_mode: - type: string - enum: - - viewer - - publisher - - anonymous - extra_perms: - type: object - additionalProperties: - type: boolean - required: &ref_63 - - id - - workspace_id - - path - - summary - - versions - - created_by - - created_at - - value - - policy - - execution_mode - - extra_perms + properties: *ref_67 + required: *ref_68 + /w/{workspace}/apps/get/lite/{path}: + get: + summary: get app lite by path + operationId: getAppLiteByPath + tags: + - app + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_39 + responses: + '200': + description: app lite details + content: + application/json: + schema: + type: object + properties: *ref_67 + required: *ref_68 /w/{workspace}/apps/get/draft/{path}: get: summary: get app by path with draft @@ -7577,17 +8260,17 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: app details with draft content: application/json: schema: - allOf: &ref_199 + allOf: &ref_244 - type: object - properties: *ref_62 - required: *ref_63 + properties: *ref_67 + required: *ref_68 - type: object properties: draft_only: @@ -7607,7 +8290,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 responses: '200': description: app history @@ -7617,12 +8300,12 @@ paths: type: array items: type: object - properties: &ref_64 + properties: &ref_69 version: type: integer deployment_msg: type: string - required: &ref_65 + required: &ref_70 - version /w/{workspace}/apps/get_latest_version/{path}: get: @@ -7636,7 +8319,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 tags: - app responses: @@ -7647,8 +8330,8 @@ paths: required: false schema: type: object - properties: *ref_64 - required: *ref_65 + properties: *ref_69 + required: *ref_70 /w/{workspace}/apps/history_update/a/{id}/v/{version}: post: summary: update app history @@ -7663,11 +8346,11 @@ paths: - name: id in: path required: true - schema: *ref_30 + schema: *ref_34 - name: version in: path required: true - schema: &ref_127 + schema: &ref_155 type: integer requestBody: description: App deployment message @@ -7700,7 +8383,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: app details @@ -7708,8 +8391,8 @@ paths: application/json: schema: type: object - properties: *ref_62 - required: *ref_63 + properties: *ref_67 + required: *ref_68 /w/{workspace}/apps_u/public_resource/{path}: get: summary: get public resource @@ -7724,7 +8407,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: resource value @@ -7745,7 +8428,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: app secret @@ -7767,7 +8450,7 @@ paths: - name: id in: path required: true - schema: *ref_30 + schema: *ref_34 responses: '200': description: app details @@ -7775,8 +8458,8 @@ paths: application/json: schema: type: object - properties: *ref_62 - required: *ref_63 + properties: *ref_67 + required: *ref_68 /w/{workspace}/raw_apps/create: post: summary: create raw app @@ -7827,7 +8510,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 requestBody: description: updateraw app required: true @@ -7863,7 +8546,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: app deleted @@ -7885,7 +8568,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: app deleted @@ -7907,7 +8590,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 requestBody: description: update app required: true @@ -7923,9 +8606,11 @@ paths: value: {} policy: type: object - properties: *ref_61 + properties: *ref_66 deployment_message: type: string + custom_path: + type: string responses: '200': description: app updated @@ -7933,6 +8618,28 @@ paths: text/plain: schema: type: string + /w/{workspace}/apps/custom_path_exists/{custom_path}: + get: + summary: check if custom path exists + operationId: customPathExists + tags: + - app + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: custom_path + in: path + required: true + schema: *ref_71 + responses: + '200': + description: custom path exists + content: + application/json: + schema: + type: boolean /w/{workspace}/apps_u/execute_component/{path}: post: summary: executeComponent @@ -7947,7 +8654,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 requestBody: description: update app required: true @@ -7960,6 +8667,8 @@ paths: type: string path: type: string + version: + type: integer args: {} raw_code: type: object @@ -7977,6 +8686,8 @@ paths: required: - content - language + id: + type: integer force_viewer_static_fields: type: object force_viewer_one_of_fields: @@ -8009,7 +8720,7 @@ paths: - name: path in: path required: true - schema: *ref_35 + schema: *ref_39 - name: scheduled_for description: when to schedule this job (leave empty for immediate run) in: query @@ -8031,11 +8742,11 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: tag description: Override the tag to use in: query - schema: *ref_48 + schema: *ref_53 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -8043,7 +8754,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -8052,7 +8763,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_50 + schema: *ref_55 - name: invisible_to_owner description: make the run invisible to the the flow owner (default false) in: query @@ -8065,7 +8776,7 @@ paths: application/json: schema: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 responses: '201': description: job created @@ -8088,7 +8799,7 @@ paths: - name: id in: path required: true - schema: &ref_91 + schema: &ref_97 type: string format: uuid - name: step_id @@ -8121,11 +8832,11 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: tag description: Override the tag to use in: query - schema: *ref_48 + schema: *ref_53 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -8133,7 +8844,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -8142,7 +8853,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_50 + schema: *ref_55 - name: invisible_to_owner description: make the run invisible to the the flow owner (default false) in: query @@ -8155,7 +8866,7 @@ paths: application/json: schema: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 responses: '201': description: job created @@ -8178,7 +8889,7 @@ paths: - name: hash in: path required: true - schema: *ref_39 + schema: *ref_44 - name: scheduled_for description: when to schedule this job (leave empty for immediate run) in: query @@ -8200,17 +8911,17 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: tag description: Override the tag to use in: query - schema: *ref_48 + schema: *ref_53 - name: cache_ttl description: >- Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl in: query - schema: *ref_49 + schema: *ref_54 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -8218,7 +8929,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -8227,7 +8938,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_50 + schema: *ref_55 - name: invisible_to_owner description: make the run invisible to the the script owner (default false) in: query @@ -8267,7 +8978,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_50 + schema: *ref_55 - name: invisible_to_owner description: make the run invisible to the the script owner (default false) in: query @@ -8280,7 +8991,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 requestBody: description: preview required: true @@ -8288,33 +8999,17 @@ paths: application/json: schema: type: object - properties: &ref_156 + properties: &ref_184 content: type: string path: type: string args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 language: type: string - enum: - - python3 - - deno - - go - - bash - - powershell - - postgresql - - mysql - - bigquery - - snowflake - - mssql - - graphql - - nativets - - bun - - php - - rust - - ansible + enum: *ref_41 tag: type: string kind: @@ -8327,7 +9022,7 @@ paths: type: boolean lock: type: string - required: &ref_157 + required: &ref_185 - args responses: '201': @@ -8365,11 +9060,11 @@ paths: application/json: schema: type: object - properties: &ref_158 + properties: &ref_186 args: type: object - additionalProperties: *ref_18 - required: &ref_159 + additionalProperties: *ref_21 + required: &ref_187 - args responses: '201': @@ -8402,31 +9097,15 @@ paths: type: array items: type: object - properties: &ref_217 + properties: &ref_262 raw_code: type: string path: type: string language: type: string - enum: - - python3 - - deno - - go - - bash - - powershell - - postgresql - - mysql - - bigquery - - snowflake - - mssql - - graphql - - nativets - - bun - - php - - rust - - ansible - required: &ref_218 + enum: *ref_41 + required: &ref_263 - raw_code - path - language @@ -8466,7 +9145,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_50 + schema: *ref_55 - name: invisible_to_owner description: make the run invisible to the the script owner (default false) in: query @@ -8479,7 +9158,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 requestBody: description: preview required: true @@ -8487,21 +9166,21 @@ paths: application/json: schema: type: object - properties: &ref_192 + properties: &ref_237 value: type: object - properties: *ref_66 - required: *ref_67 + properties: *ref_72 + required: *ref_73 path: type: string args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 tag: type: string restarted_from: type: object - properties: &ref_194 + properties: &ref_239 flow_job_id: type: string format: uuid @@ -8509,7 +9188,7 @@ paths: type: string branch_or_iteration_n: type: integer - required: &ref_193 + required: &ref_238 - value - content - args @@ -8535,94 +9214,94 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_52 + schema: *ref_57 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_53 + schema: *ref_58 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: script_path_exact description: mask to filter exact matching path in: query - schema: &ref_70 + schema: &ref_76 type: string - name: script_path_start description: mask to filter matching starting path in: query - schema: &ref_71 + schema: &ref_77 type: string - name: schedule_path description: mask to filter by schedule path in: query - schema: &ref_72 + schema: &ref_78 type: string - name: script_hash description: mask to filter exact matching path in: query - schema: &ref_73 + schema: &ref_79 type: string - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: &ref_74 + schema: &ref_80 type: string format: date-time - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: &ref_75 + schema: &ref_81 type: string format: date-time - name: success description: filter on successful jobs in: query - schema: &ref_76 + schema: &ref_82 type: boolean - name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: &ref_77 + schema: &ref_83 type: boolean - name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: &ref_78 + schema: &ref_84 type: string - name: suspended description: filter on suspended jobs in: query - schema: &ref_79 + schema: &ref_85 type: boolean - name: running description: filter on running jobs in: query - schema: &ref_80 + schema: &ref_86 type: boolean - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: &ref_81 + schema: &ref_87 type: string - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: &ref_82 + schema: &ref_88 type: string - name: tag description: filter on jobs with a given tag/worker group in: query - schema: &ref_83 + schema: &ref_89 type: string - name: page description: which page to return (start at 1, default 1) @@ -8653,7 +9332,7 @@ paths: type: array items: type: object - properties: &ref_89 + properties: &ref_95 workspace_id: type: string id: @@ -8681,7 +9360,7 @@ paths: type: string args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 logs: type: string raw_code: @@ -8723,14 +9402,14 @@ paths: by extension its DT_TOKEN. flow_status: type: object - properties: &ref_84 + properties: &ref_90 step: type: integer modules: type: array items: type: object - properties: &ref_68 + properties: &ref_74 type: type: string enum: @@ -8807,20 +9486,20 @@ paths: format: uuid skipped: type: boolean - required: &ref_69 + required: &ref_75 - type user_states: additionalProperties: true preprocessor_module: allOf: - type: object - properties: *ref_68 - required: *ref_69 + properties: *ref_74 + required: *ref_75 failure_module: allOf: - type: object - properties: *ref_68 - required: *ref_69 + properties: *ref_74 + required: *ref_75 - type: object properties: parent_module: @@ -8835,35 +9514,19 @@ paths: items: type: string format: uuid - required: &ref_85 + required: &ref_91 - step - modules - failure_module raw_flow: type: object - properties: *ref_66 - required: *ref_67 + properties: *ref_72 + required: *ref_73 is_flow_step: type: boolean language: type: string - enum: - - python3 - - deno - - go - - bash - - powershell - - postgresql - - mysql - - bigquery - - snowflake - - mssql - - graphql - - nativets - - bun - - php - - rust - - ansible + enum: *ref_41 email: type: string visible_to_owner: @@ -8880,7 +9543,9 @@ paths: type: number suspend: type: number - required: &ref_90 + preprocessed: + type: boolean + required: &ref_96 - id - running - canceled @@ -8945,6 +9610,40 @@ paths: type: integer required: - database_length + /w/{workspace}/jobs/completed/count_jobs: + get: + summary: count number of completed jobs with filter + operationId: countCompletedJobs + tags: + - job + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: completed_after_s_ago + in: query + schema: + type: integer + - name: success + in: query + schema: + type: boolean + - name: tags + in: query + schema: + type: string + - name: all_workspaces + in: query + schema: + type: boolean + responses: + '200': + description: Count of completed jobs + content: + application/json: + schema: + type: integer /w/{workspace}/jobs/queue/list_filtered_uuids: get: summary: get the ids of all jobs matching the given filters @@ -8959,79 +9658,79 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_52 + schema: *ref_57 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_53 + schema: *ref_58 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_70 + schema: *ref_76 - name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_71 + schema: *ref_77 - name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_72 + schema: *ref_78 - name: script_hash description: mask to filter exact matching path in: query - schema: *ref_73 + schema: *ref_79 - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_74 + schema: *ref_80 - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_75 + schema: *ref_81 - name: success description: filter on successful jobs in: query - schema: *ref_76 + schema: *ref_82 - name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: *ref_77 + schema: *ref_83 - name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_78 + schema: *ref_84 - name: suspended description: filter on suspended jobs in: query - schema: *ref_79 + schema: *ref_85 - name: running description: filter on running jobs in: query - schema: *ref_80 + schema: *ref_86 - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_81 + schema: *ref_87 - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_82 + schema: *ref_88 - name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_83 + schema: *ref_89 - name: page description: which page to return (start at 1, default 1) in: query @@ -9109,75 +9808,75 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_52 + schema: *ref_57 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_53 + schema: *ref_58 - name: label description: >- mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') in: query - schema: &ref_86 + schema: &ref_92 type: string - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_70 + schema: *ref_76 - name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_71 + schema: *ref_77 - name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_72 + schema: *ref_78 - name: script_hash description: mask to filter exact matching path in: query - schema: *ref_73 + schema: *ref_79 - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_74 + schema: *ref_80 - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_75 + schema: *ref_81 - name: success description: filter on successful jobs in: query - schema: *ref_76 + schema: *ref_82 - name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_78 + schema: *ref_84 - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_81 + schema: *ref_87 - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_82 + schema: *ref_88 - name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_83 + schema: *ref_89 - name: page description: which page to return (start at 1, default 1) in: query @@ -9215,7 +9914,7 @@ paths: type: array items: type: object - properties: &ref_87 + properties: &ref_93 workspace_id: type: string id: @@ -9242,7 +9941,7 @@ paths: type: string args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 result: {} logs: type: string @@ -9284,33 +9983,17 @@ paths: by extension its DT_TOKEN. flow_status: type: object - properties: *ref_84 - required: *ref_85 + properties: *ref_90 + required: *ref_91 raw_flow: type: object - properties: *ref_66 - required: *ref_67 + properties: *ref_72 + required: *ref_73 is_flow_step: type: boolean language: type: string - enum: - - python3 - - deno - - go - - bash - - powershell - - postgresql - - mysql - - bigquery - - snowflake - - mssql - - graphql - - nativets - - bun - - php - - rust - - ansible + enum: *ref_41 is_skipped: type: boolean email: @@ -9331,7 +10014,9 @@ paths: type: number aggregate_wait_time_ms: type: number - required: &ref_88 + preprocessed: + type: boolean + required: &ref_94 - id - created_by - duration_ms @@ -9360,54 +10045,54 @@ paths: - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_53 + schema: *ref_58 - name: label description: >- mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') in: query - schema: *ref_86 + schema: *ref_92 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_70 + schema: *ref_76 - name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_71 + schema: *ref_77 - name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_72 + schema: *ref_78 - name: script_hash description: mask to filter exact matching path in: query - schema: *ref_73 + schema: *ref_79 - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_74 + schema: *ref_80 - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_75 + schema: *ref_81 - name: created_before description: filter on created before (inclusive) timestamp in: query - schema: &ref_128 + schema: &ref_156 type: string format: date-time - name: created_after description: filter on created after (exclusive) timestamp in: query - schema: &ref_129 + schema: &ref_157 type: string format: date-time - name: created_or_started_before @@ -9415,23 +10100,23 @@ paths: filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp in: query - schema: &ref_122 + schema: &ref_149 type: string format: date-time - name: running description: filter on running jobs in: query - schema: *ref_80 + schema: *ref_86 - name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: *ref_77 + schema: *ref_83 - name: created_or_started_after description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp in: query - schema: &ref_123 + schema: &ref_150 type: string format: date-time - name: created_or_started_after_completed_jobs @@ -9440,7 +10125,7 @@ paths: otherwise after (exclusive) timestamp but only for the completed jobs in: query - schema: &ref_124 + schema: &ref_151 type: string format: date-time - name: job_kinds @@ -9448,27 +10133,27 @@ paths: filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_78 + schema: *ref_84 - name: suspended description: filter on suspended jobs in: query - schema: *ref_79 + schema: *ref_85 - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_81 + schema: *ref_87 - name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_83 + schema: *ref_89 - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_82 + schema: *ref_88 - name: page description: which page to return (start at 1, default 1) in: query @@ -9517,11 +10202,11 @@ paths: schema: type: array items: - oneOf: &ref_92 + oneOf: &ref_98 - allOf: - type: object - properties: *ref_87 - required: *ref_88 + properties: *ref_93 + required: *ref_94 - type: object properties: type: @@ -9530,15 +10215,15 @@ paths: - CompletedJob - allOf: - type: object - properties: *ref_89 - required: *ref_90 + properties: *ref_95 + required: *ref_96 - type: object properties: type: type: string enum: - QueuedJob - discriminator: &ref_93 + discriminator: &ref_99 propertyName: type /jobs/db_clock: get: @@ -9605,7 +10290,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: no_logs in: query schema: @@ -9616,8 +10301,8 @@ paths: content: application/json: schema: - oneOf: *ref_92 - discriminator: *ref_93 + oneOf: *ref_98 + discriminator: *ref_99 /w/{workspace}/jobs_u/get_root_job_id/{id}: get: summary: get root job id @@ -9632,7 +10317,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 responses: '200': description: get root job id @@ -9654,7 +10339,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 responses: '200': description: job details @@ -9676,7 +10361,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 responses: '200': description: job args @@ -9697,7 +10382,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: running in: query schema: @@ -9732,9 +10417,9 @@ paths: type: integer flow_status: type: object - additionalProperties: &ref_160 + additionalProperties: &ref_188 type: object - properties: &ref_161 + properties: &ref_189 scheduled_for: type: string format: date-time @@ -9781,7 +10466,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 responses: '200': description: flow debug info details @@ -9802,7 +10487,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 responses: '200': description: job details @@ -9810,8 +10495,8 @@ paths: application/json: schema: type: object - properties: *ref_87 - required: *ref_88 + properties: *ref_93 + required: *ref_94 /w/{workspace}/jobs_u/completed/get_result/{id}: get: summary: get completed job result @@ -9826,7 +10511,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: suspended_job in: query schema: @@ -9863,10 +10548,10 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: get_started in: query - schema: &ref_135 + schema: &ref_163 type: boolean responses: '200': @@ -9900,7 +10585,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 responses: '200': description: job details @@ -9908,8 +10593,8 @@ paths: application/json: schema: type: object - properties: *ref_87 - required: *ref_88 + properties: *ref_93 + required: *ref_94 /w/{workspace}/jobs_u/queue/cancel/{id}: post: summary: cancel queued or running job @@ -9924,7 +10609,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 requestBody: description: reason required: true @@ -9956,7 +10641,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 requestBody: description: reason required: true @@ -9988,7 +10673,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 requestBody: description: reason required: true @@ -10020,7 +10705,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: resume_id in: path required: true @@ -10051,7 +10736,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: resume_id in: path required: true @@ -10079,6 +10764,108 @@ paths: - approvalPage - resume - cancel + /w/{workspace}/jobs/slack_approval/{id}: + get: + summary: generate interactive slack approval for suspended job + operationId: getSlackApprovalPayload + tags: + - job + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: id + in: path + required: true + schema: *ref_97 + - name: approver + in: query + schema: + type: string + - name: message + in: query + schema: + type: string + - name: slack_resource_path + in: query + required: true + schema: + type: string + - name: channel_id + in: query + required: true + schema: + type: string + - name: flow_step_id + in: query + required: true + schema: + type: string + - name: default_args_json + in: query + required: false + schema: + type: string + - name: dynamic_enums_json + in: query + required: false + schema: + type: string + responses: + '200': + description: Interactive slack approval message sent successfully + /w/{workspace}/jobs/teams_approval/{id}: + get: + summary: generate interactive teams approval for suspended job + operationId: getTeamsApprovalPayload + tags: + - job + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: id + in: path + required: true + schema: *ref_97 + - name: approver + in: query + schema: + type: string + - name: message + in: query + schema: + type: string + - name: slack_resource_path + in: query + required: true + schema: + type: string + - name: channel_id + in: query + required: true + schema: + type: string + - name: flow_step_id + in: query + required: true + schema: + type: string + - name: default_args_json + in: query + required: false + schema: + type: string + - name: dynamic_enums_json + in: query + required: false + schema: + type: string + responses: + '200': + description: Interactive slack approval message sent successfully /w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}: get: summary: resume a job for a suspended flow @@ -10093,7 +10880,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: payload description: > The base64 encoded payload that has been encoded as a JSON. e.g how @@ -10101,7 +10888,7 @@ paths: `encodeURIComponent(btoa(JSON.stringify({a: 2})))` in: query - schema: *ref_94 + schema: *ref_100 - name: resume_id in: path required: true @@ -10136,7 +10923,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: resume_id in: path required: true @@ -10178,7 +10965,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: key in: path required: true @@ -10210,7 +10997,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: key in: path required: true @@ -10236,7 +11023,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 requestBody: required: true content: @@ -10264,7 +11051,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: resume_id in: path required: true @@ -10299,7 +11086,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: resume_id in: path required: true @@ -10341,7 +11128,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 - name: resume_id in: path required: true @@ -10365,8 +11152,8 @@ paths: type: object properties: job: - oneOf: *ref_92 - discriminator: *ref_93 + oneOf: *ref_98 + discriminator: *ref_99 approvers: type: array items: @@ -10400,6 +11187,8 @@ paths: type: string timezone: type: string + cron_version: + type: string required: - schedule - timezone @@ -10431,7 +11220,7 @@ paths: application/json: schema: type: object - properties: &ref_171 + properties: &ref_199 path: type: string schedule: @@ -10444,7 +11233,7 @@ paths: type: boolean args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 enabled: type: boolean on_failure: @@ -10455,24 +11244,24 @@ paths: type: boolean on_failure_extra_args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 on_recovery: type: string on_recovery_times: type: number on_recovery_extra_args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 on_success: type: string on_success_extra_args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 ws_error_handler_muted: type: boolean retry: type: object - properties: *ref_95 + properties: *ref_101 no_flow_overlap: type: boolean summary: @@ -10482,7 +11271,9 @@ paths: paused_until: type: string format: date-time - required: &ref_172 + cron_version: + type: string + required: &ref_200 - path - schedule - timezone @@ -10510,7 +11301,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 requestBody: description: updated schedule required: true @@ -10518,14 +11309,14 @@ paths: application/json: schema: type: object - properties: &ref_173 + properties: &ref_201 schedule: type: string timezone: type: string args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 on_failure: type: string on_failure_times: @@ -10534,24 +11325,24 @@ paths: type: boolean on_failure_extra_args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 on_recovery: type: string on_recovery_times: type: number on_recovery_extra_args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 on_success: type: string on_success_extra_args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 ws_error_handler_muted: type: boolean retry: type: object - properties: *ref_95 + properties: *ref_101 no_flow_overlap: type: boolean summary: @@ -10561,7 +11352,9 @@ paths: paused_until: type: string format: date-time - required: &ref_174 + cron_version: + type: string + required: &ref_202 - schedule - timezone - script_path @@ -10588,7 +11381,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 requestBody: description: updated schedule enable required: true @@ -10622,7 +11415,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: schedule deleted @@ -10644,7 +11437,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: schedule deleted @@ -10652,7 +11445,7 @@ paths: application/json: schema: type: object - properties: &ref_96 + properties: &ref_102 path: type: string edited_by: @@ -10672,7 +11465,7 @@ paths: type: boolean args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 extra_perms: type: object additionalProperties: @@ -10689,24 +11482,24 @@ paths: type: boolean on_failure_extra_args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 on_recovery: type: string on_recovery_times: type: number on_recovery_extra_args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 on_success: type: string on_success_extra_args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 ws_error_handler_muted: type: boolean retry: type: object - properties: *ref_95 + properties: *ref_101 summary: type: string no_flow_overlap: @@ -10716,7 +11509,9 @@ paths: paused_until: type: string format: date-time - required: &ref_97 + cron_version: + type: string + required: &ref_103 - path - edited_by - edited_at @@ -10741,7 +11536,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: schedule exists @@ -10773,7 +11568,7 @@ paths: filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_81 + schema: *ref_87 - name: path description: filter by path in: query @@ -10796,8 +11591,8 @@ paths: type: array items: type: object - properties: *ref_96 - required: *ref_97 + properties: *ref_102 + required: *ref_103 /w/{workspace}/schedules/list_with_jobs: get: summary: list schedules with last 20 jobs @@ -10825,10 +11620,10 @@ paths: schema: type: array items: - allOf: &ref_170 + allOf: &ref_198 - type: object - properties: *ref_96 - required: *ref_97 + properties: *ref_102 + required: *ref_103 - type: object properties: jobs: @@ -10907,7 +11702,7 @@ paths: application/json: schema: type: object - properties: &ref_175 + properties: &ref_203 path: type: string script_path: @@ -10939,7 +11734,9 @@ paths: type: boolean requires_auth: type: boolean - required: &ref_176 + is_static_website: + type: boolean + required: &ref_204 - path - script_path - route_path @@ -10947,6 +11744,7 @@ paths: - is_async - requires_auth - http_method + - is_static_website responses: '201': description: http trigger created @@ -10968,7 +11766,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 requestBody: description: updated trigger required: true @@ -10976,7 +11774,7 @@ paths: application/json: schema: type: object - properties: &ref_177 + properties: &ref_205 path: type: string script_path: @@ -11008,7 +11806,9 @@ paths: type: boolean requires_auth: type: boolean - required: &ref_178 + is_static_website: + type: boolean + required: &ref_206 - path - script_path - is_flow @@ -11016,6 +11816,7 @@ paths: - is_async - requires_auth - http_method + - is_static_website responses: '200': description: http trigger updated @@ -11037,7 +11838,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: http trigger deleted @@ -11059,22 +11860,39 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: http trigger deleted content: application/json: schema: + allOf: &ref_104 + - type: object + properties: &ref_108 + email: + type: string + extra_perms: + type: object + additionalProperties: + type: boolean + workspace_id: + type: string + edited_by: + type: string + edited_at: + type: string + format: date-time + required: &ref_109 + - email + - extra_perms + - workspace_id + - edited_by + - edited_at type: object - properties: &ref_98 + properties: &ref_105 path: type: string - edited_by: - type: string - edited_at: - type: string - format: date-time script_path: type: string route_path: @@ -11092,14 +11910,6 @@ paths: - s3 is_flow: type: boolean - extra_perms: - type: object - additionalProperties: - type: boolean - email: - type: string - workspace_id: - type: string http_method: type: string enum: @@ -11112,7 +11922,9 @@ paths: type: boolean requires_auth: type: boolean - required: &ref_99 + is_static_website: + type: boolean + required: &ref_106 - path - edited_by - edited_at @@ -11125,6 +11937,7 @@ paths: - is_async - requires_auth - http_method + - is_static_website /w/{workspace}/http_triggers/list: get: summary: list http triggers @@ -11165,9 +11978,10 @@ paths: schema: type: array items: + allOf: *ref_104 type: object - properties: *ref_98 - required: *ref_99 + properties: *ref_105 + required: *ref_106 /w/{workspace}/http_triggers/exists/{path}: get: summary: does http trigger exists @@ -11182,7 +11996,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: http trigger exists @@ -11219,8 +12033,9 @@ paths: - put - delete - patch + trigger_path: + type: string required: - - kind - route_path - http_method responses: @@ -11248,7 +12063,7 @@ paths: application/json: schema: type: object - properties: &ref_179 + properties: &ref_207 path: type: string script_path: @@ -11273,7 +12088,7 @@ paths: initial_messages: type: array items: - anyOf: &ref_100 + anyOf: &ref_107 - type: object properties: raw_message: @@ -11289,7 +12104,7 @@ paths: type: string args: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 is_flow: type: boolean required: @@ -11300,15 +12115,16 @@ paths: - runnable_result url_runnable_args: type: object - additionalProperties: *ref_18 - required: &ref_180 + additionalProperties: *ref_21 + can_return_message: + type: boolean + required: &ref_208 - path - script_path - url - is_flow - filters - - initial_messages - - url_runnable_args + - can_return_message responses: '201': description: websocket trigger created @@ -11330,7 +12146,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 requestBody: description: updated trigger required: true @@ -11338,7 +12154,7 @@ paths: application/json: schema: type: object - properties: &ref_181 + properties: &ref_209 url: type: string path: @@ -11361,18 +12177,19 @@ paths: initial_messages: type: array items: - anyOf: *ref_100 + anyOf: *ref_107 url_runnable_args: type: object - additionalProperties: *ref_18 - required: &ref_182 + additionalProperties: *ref_21 + can_return_message: + type: boolean + required: &ref_210 - path - script_path - url - is_flow - filters - - initial_messages - - url_runnable_args + - can_return_message responses: '200': description: websocket trigger updated @@ -11394,7 +12211,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: websocket trigger deleted @@ -11416,36 +12233,27 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: websocket trigger deleted content: application/json: schema: + allOf: &ref_110 + - type: object + properties: *ref_108 + required: *ref_109 type: object - properties: &ref_101 + properties: &ref_111 path: type: string - edited_by: - type: string - edited_at: - type: string - format: date-time script_path: type: string url: type: string is_flow: type: boolean - extra_perms: - type: object - additionalProperties: - type: boolean - email: - type: string - workspace_id: - type: string server_id: type: string last_server_ping: @@ -11469,11 +12277,13 @@ paths: initial_messages: type: array items: - anyOf: *ref_100 + anyOf: *ref_107 url_runnable_args: type: object - additionalProperties: *ref_18 - required: &ref_102 + additionalProperties: *ref_21 + can_return_message: + type: boolean + required: &ref_112 - path - edited_by - edited_at @@ -11485,8 +12295,7 @@ paths: - workspace_id - enabled - filters - - initial_messages - - url_runnable_args + - can_return_message /w/{workspace}/websocket_triggers/list: get: summary: list websocket triggers @@ -11527,9 +12336,10 @@ paths: schema: type: array items: + allOf: *ref_110 type: object - properties: *ref_101 - required: *ref_102 + properties: *ref_111 + required: *ref_112 /w/{workspace}/websocket_triggers/exists/{path}: get: summary: does websocket trigger exists @@ -11544,7 +12354,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: websocket trigger exists @@ -11566,7 +12376,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 requestBody: description: updated websocket trigger enable required: true @@ -11586,6 +12396,1341 @@ paths: text/plain: schema: type: string + /w/{workspace}/websocket_triggers/test: + post: + summary: test websocket connection + operationId: testWebsocketConnection + tags: + - websocket_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: test websocket connection + required: true + content: + application/json: + schema: + type: object + properties: + url: + type: string + url_runnable_args: + type: object + additionalProperties: *ref_21 + can_return_message: + type: boolean + required: + - url + - can_return_message + responses: + '200': + description: successfuly connected to websocket + content: + text/plain: + schema: + type: string + /w/{workspace}/kafka_triggers/create: + post: + summary: create kafka trigger + operationId: createKafkaTrigger + tags: + - kafka_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: new kafka trigger + required: true + content: + application/json: + schema: + type: object + properties: &ref_220 + path: + type: string + script_path: + type: string + is_flow: + type: boolean + kafka_resource_path: + type: string + group_id: + type: string + topics: + type: array + items: + type: string + enabled: + type: boolean + required: &ref_221 + - path + - script_path + - is_flow + - kafka_resource_path + - group_id + - topics + responses: + '201': + description: kafka trigger created + content: + text/plain: + schema: + type: string + /w/{workspace}/kafka_triggers/update/{path}: + post: + summary: update kafka trigger + operationId: updateKafkaTrigger + tags: + - kafka_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + requestBody: + description: updated trigger + required: true + content: + application/json: + schema: + type: object + properties: &ref_222 + kafka_resource_path: + type: string + group_id: + type: string + topics: + type: array + items: + type: string + path: + type: string + script_path: + type: string + is_flow: + type: boolean + required: &ref_223 + - path + - script_path + - kafka_resource_path + - group_id + - topics + - is_flow + responses: + '200': + description: kafka trigger updated + content: + text/plain: + schema: + type: string + /w/{workspace}/kafka_triggers/delete/{path}: + delete: + summary: delete kafka trigger + operationId: deleteKafkaTrigger + tags: + - kafka_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: kafka trigger deleted + content: + text/plain: + schema: + type: string + /w/{workspace}/kafka_triggers/get/{path}: + get: + summary: get kafka trigger + operationId: getKafkaTrigger + tags: + - kafka_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: kafka trigger deleted + content: + application/json: + schema: + type: object + properties: &ref_113 + path: + type: string + edited_by: + type: string + edited_at: + type: string + format: date-time + script_path: + type: string + kafka_resource_path: + type: string + group_id: + type: string + topics: + type: array + items: + type: string + is_flow: + type: boolean + extra_perms: + type: object + additionalProperties: + type: boolean + email: + type: string + workspace_id: + type: string + server_id: + type: string + last_server_ping: + type: string + format: date-time + error: + type: string + enabled: + type: boolean + required: &ref_114 + - path + - edited_by + - edited_at + - script_path + - kafka_resource_path + - group_id + - topics + - extra_perms + - is_flow + - email + - workspace_id + - enabled + /w/{workspace}/kafka_triggers/list: + get: + summary: list kafka triggers + operationId: listKafkaTriggers + tags: + - kafka_trigger + parameters: + - required: true + name: workspace + in: path + schema: *ref_0 + - name: page + description: which page to return (start at 1, default 1) + in: query + schema: *ref_5 + - name: per_page + description: number of items to return for a given page (default 30, max 100) + in: query + schema: *ref_6 + - name: path + description: filter by path + in: query + schema: + type: string + - name: is_flow + in: query + schema: + type: boolean + - name: path_start + in: query + schema: + type: string + responses: + '200': + description: kafka trigger list + content: + application/json: + schema: + type: array + items: + type: object + properties: *ref_113 + required: *ref_114 + /w/{workspace}/kafka_triggers/exists/{path}: + get: + summary: does kafka trigger exists + operationId: existsKafkaTrigger + tags: + - kafka_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: kafka trigger exists + content: + application/json: + schema: + type: boolean + /w/{workspace}/kafka_triggers/setenabled/{path}: + post: + summary: set enabled kafka trigger + operationId: setKafkaTriggerEnabled + tags: + - kafka_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + requestBody: + description: updated kafka trigger enable + required: true + content: + application/json: + schema: + type: object + properties: + enabled: + type: boolean + required: + - enabled + responses: + '200': + description: kafka trigger enabled set + content: + text/plain: + schema: + type: string + /w/{workspace}/kafka_triggers/test: + post: + summary: test kafka connection + operationId: testKafkaConnection + tags: + - kafka_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: test kafka connection + required: true + content: + application/json: + schema: + type: object + properties: + connection: + type: object + required: + - connection + responses: + '200': + description: successfuly connected to kafka brokers + content: + text/plain: + schema: + type: string + /w/{workspace}/nats_triggers/create: + post: + summary: create nats trigger + operationId: createNatsTrigger + tags: + - nats_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: new nats trigger + required: true + content: + application/json: + schema: + type: object + properties: &ref_224 + path: + type: string + script_path: + type: string + is_flow: + type: boolean + nats_resource_path: + type: string + use_jetstream: + type: boolean + stream_name: + type: string + consumer_name: + type: string + subjects: + type: array + items: + type: string + enabled: + type: boolean + required: &ref_225 + - path + - script_path + - is_flow + - nats_resource_path + - use_jetstream + - subjects + responses: + '201': + description: nats trigger created + content: + text/plain: + schema: + type: string + /w/{workspace}/nats_triggers/update/{path}: + post: + summary: update nats trigger + operationId: updateNatsTrigger + tags: + - nats_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + requestBody: + description: updated trigger + required: true + content: + application/json: + schema: + type: object + properties: &ref_226 + nats_resource_path: + type: string + use_jetstream: + type: boolean + stream_name: + type: string + consumer_name: + type: string + subjects: + type: array + items: + type: string + path: + type: string + script_path: + type: string + is_flow: + type: boolean + required: &ref_227 + - path + - script_path + - nats_resource_path + - use_jetstream + - subjects + - is_flow + responses: + '200': + description: nats trigger updated + content: + text/plain: + schema: + type: string + /w/{workspace}/nats_triggers/delete/{path}: + delete: + summary: delete nats trigger + operationId: deleteNatsTrigger + tags: + - nats_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: nats trigger deleted + content: + text/plain: + schema: + type: string + /w/{workspace}/nats_triggers/get/{path}: + get: + summary: get nats trigger + operationId: getNatsTrigger + tags: + - nats_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: nats trigger deleted + content: + application/json: + schema: + type: object + properties: &ref_115 + path: + type: string + edited_by: + type: string + edited_at: + type: string + format: date-time + script_path: + type: string + nats_resource_path: + type: string + use_jetstream: + type: boolean + stream_name: + type: string + consumer_name: + type: string + subjects: + type: array + items: + type: string + is_flow: + type: boolean + extra_perms: + type: object + additionalProperties: + type: boolean + email: + type: string + workspace_id: + type: string + server_id: + type: string + last_server_ping: + type: string + format: date-time + error: + type: string + enabled: + type: boolean + required: &ref_116 + - path + - edited_by + - edited_at + - script_path + - nats_resource_path + - use_jetstream + - subjects + - extra_perms + - is_flow + - email + - workspace_id + - enabled + /w/{workspace}/nats_triggers/list: + get: + summary: list nats triggers + operationId: listNatsTriggers + tags: + - nats_trigger + parameters: + - required: true + name: workspace + in: path + schema: *ref_0 + - name: page + description: which page to return (start at 1, default 1) + in: query + schema: *ref_5 + - name: per_page + description: number of items to return for a given page (default 30, max 100) + in: query + schema: *ref_6 + - name: path + description: filter by path + in: query + schema: + type: string + - name: is_flow + in: query + schema: + type: boolean + - name: path_start + in: query + schema: + type: string + responses: + '200': + description: nats trigger list + content: + application/json: + schema: + type: array + items: + type: object + properties: *ref_115 + required: *ref_116 + /w/{workspace}/nats_triggers/exists/{path}: + get: + summary: does nats trigger exists + operationId: existsNatsTrigger + tags: + - nats_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: nats trigger exists + content: + application/json: + schema: + type: boolean + /w/{workspace}/nats_triggers/setenabled/{path}: + post: + summary: set enabled nats trigger + operationId: setNatsTriggerEnabled + tags: + - nats_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + requestBody: + description: updated nats trigger enable + required: true + content: + application/json: + schema: + type: object + properties: + enabled: + type: boolean + required: + - enabled + responses: + '200': + description: nats trigger enabled set + content: + text/plain: + schema: + type: string + /w/{workspace}/nats_triggers/test: + post: + summary: test NATS connection + operationId: testNatsConnection + tags: + - nats_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: test nats connection + required: true + content: + application/json: + schema: + type: object + properties: + connection: + type: object + required: + - connection + responses: + '200': + description: successfuly connected to NATS servers + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/is_valid_postgres_configuration/{path}: + get: + summary: check if postgres configuration is set to logical + operationId: isValidPostgresConfiguration + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: boolean that indicates if postgres is set to logical level or not + content: + application/json: + schema: + type: boolean + /w/{workspace}/postgres_triggers/create_template_script: + post: + summary: create template script + operationId: createTemplateScript + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: template script + required: true + content: + application/json: + schema: + type: object + properties: &ref_214 + postgres_resource_path: + type: string + relations: + type: array + items: + type: object + properties: &ref_118 + schema_name: + type: string + table_to_track: + type: array + items: &ref_212 + type: object + properties: + table_name: + type: string + columns_name: + type: array + items: + type: string + where_clause: + type: string + required: + - table_name + required: &ref_119 + - schema_name + - table_to_track + language: + type: string + enum: &ref_213 + - Typescript + required: &ref_215 + - postgres_resource_path + - relations + - language + responses: + '200': + description: custom id to retrieve template script + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/get_template_script/{id}: + get: + summary: get template script + operationId: getTemplateScript + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: id + in: path + required: true + schema: &ref_152 + type: string + responses: + '200': + description: template script + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/slot/list/{path}: + get: + summary: list postgres replication slot + operationId: listPostgresReplicationSlot + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: list postgres slot + content: + application/json: + schema: + type: array + items: + type: object + properties: &ref_211 + slot_name: + type: string + active: + type: boolean + /w/{workspace}/postgres_triggers/slot/create/{path}: + post: + summary: create replication slot for postgres + operationId: createPostgresReplicationSlot + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + requestBody: + description: new slot for postgres + required: true + content: + application/json: + schema: + type: object + properties: &ref_117 + name: + type: string + responses: + '201': + description: slot created + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/slot/delete/{path}: + delete: + summary: delete postgres replication slot + operationId: deletePostgresReplicationSlot + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + requestBody: + description: replication slot of postgres + required: true + content: + application/json: + schema: + type: object + properties: *ref_117 + responses: + '200': + description: postgres replication slot deleted + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/publication/list/{path}: + get: + summary: list postgres publication + operationId: listPostgresPublication + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: database publication list + content: + application/json: + schema: + type: array + items: + type: string + /w/{workspace}/postgres_triggers/publication/get/{publication}/{path}: + get: + summary: get postgres publication + operationId: getPostgresPublication + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + - name: publication + in: path + required: true + schema: &ref_120 + type: string + responses: + '200': + description: postgres publication get + content: + application/json: + schema: + type: object + properties: &ref_121 + table_to_track: + type: array + items: + type: object + properties: *ref_118 + required: *ref_119 + transaction_to_track: + type: array + items: + type: string + required: &ref_122 + - transaction_to_track + /w/{workspace}/postgres_triggers/publication/create/{publication}/{path}: + post: + summary: create publication for postgres + operationId: createPostgresPublication + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + - name: publication + in: path + required: true + schema: *ref_120 + requestBody: + description: new publication for postgres + required: true + content: + application/json: + schema: + type: object + properties: *ref_121 + required: *ref_122 + responses: + '201': + description: publication created + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/publication/update/{publication}/{path}: + post: + summary: update publication for postgres + operationId: updatePostgresPublication + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + - name: publication + in: path + required: true + schema: *ref_120 + requestBody: + description: update publication for postgres + required: true + content: + application/json: + schema: + type: object + properties: *ref_121 + required: *ref_122 + responses: + '201': + description: publication updated + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/publication/delete/{publication}/{path}: + delete: + summary: delete postgres publication + operationId: deletePostgresPublication + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + - name: publication + in: path + required: true + schema: *ref_120 + responses: + '200': + description: postgres publication deleted + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/create: + post: + summary: create postgres trigger + operationId: createPostgresTrigger + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + requestBody: + description: new postgres trigger + required: true + content: + application/json: + schema: + type: object + properties: &ref_216 + replication_slot_name: + type: string + publication_name: + type: string + path: + type: string + script_path: + type: string + is_flow: + type: boolean + enabled: + type: boolean + postgres_resource_path: + type: string + publication: + type: object + properties: *ref_121 + required: *ref_122 + required: &ref_217 + - path + - script_path + - is_flow + - enabled + - postgres_resource_path + responses: + '201': + description: postgres trigger created + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/update/{path}: + post: + summary: update postgres trigger + operationId: updatePostgresTrigger + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + requestBody: + description: updated trigger + required: true + content: + application/json: + schema: + type: object + properties: &ref_218 + replication_slot_name: + type: string + publication_name: + type: string + path: + type: string + script_path: + type: string + is_flow: + type: boolean + enabled: + type: boolean + postgres_resource_path: + type: string + publication: + type: object + properties: *ref_121 + required: *ref_122 + required: &ref_219 + - path + - script_path + - is_flow + - enabled + - postgres_resource_path + - publication_name + - replication_slot_name + responses: + '200': + description: postgres trigger updated + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/delete/{path}: + delete: + summary: delete postgres trigger + operationId: deletePostgresTrigger + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: postgres trigger deleted + content: + text/plain: + schema: + type: string + /w/{workspace}/postgres_triggers/get/{path}: + get: + summary: get postgres trigger + operationId: getPostgresTrigger + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: get postgres trigger + content: + application/json: + schema: + allOf: &ref_123 + - type: object + properties: *ref_108 + required: *ref_109 + type: object + properties: &ref_124 + path: + type: string + script_path: + type: string + is_flow: + type: boolean + enabled: + type: boolean + postgres_resource_path: + type: string + publication_name: + type: string + server_id: + type: string + replication_slot_name: + type: string + error: + type: string + last_server_ping: + type: string + format: date-time + required: &ref_125 + - path + - script_path + - is_flow + - enabled + - postgres_resource_path + - replication_slot_name + - publication_name + /w/{workspace}/postgres_triggers/list: + get: + summary: list postgres triggers + operationId: listPostgresTriggers + tags: + - postgres_trigger + parameters: + - required: true + name: workspace + in: path + schema: *ref_0 + - name: page + description: which page to return (start at 1, default 1) + in: query + schema: *ref_5 + - name: per_page + description: number of items to return for a given page (default 30, max 100) + in: query + schema: *ref_6 + - name: path + description: filter by path + in: query + schema: + type: string + - name: is_flow + in: query + schema: + type: boolean + - name: path_start + in: query + schema: + type: string + responses: + '200': + description: postgres trigger list + content: + application/json: + schema: + type: array + items: + allOf: *ref_123 + type: object + properties: *ref_124 + required: *ref_125 + /w/{workspace}/postgres_triggers/exists/{path}: + get: + summary: does postgres trigger exists + operationId: existsPostgresTrigger + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: postgres trigger exists + content: + application/json: + schema: + type: boolean + /w/{workspace}/postgres_triggers/setenabled/{path}: + post: + summary: set enabled postgres trigger + operationId: setPostgresTriggerEnabled + tags: + - postgres_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_26 + requestBody: + description: updated postgres trigger enable + required: true + content: + application/json: + schema: + type: object + properties: + enabled: + type: boolean + required: + - enabled + responses: + '200': + description: postgres trigger enabled set + content: + text/plain: + schema: + type: string /groups/list: get: summary: list instance groups @@ -11601,7 +13746,7 @@ paths: type: array items: type: object - properties: &ref_104 + properties: &ref_127 name: type: string summary: @@ -11610,7 +13755,7 @@ paths: type: array items: type: string - required: &ref_105 + required: &ref_128 - name /groups/get/{name}: get: @@ -11622,7 +13767,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 responses: '200': description: instance group @@ -11630,8 +13775,8 @@ paths: application/json: schema: type: object - properties: *ref_104 - required: *ref_105 + properties: *ref_127 + required: *ref_128 /groups/create: post: summary: create instance group @@ -11669,7 +13814,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 requestBody: description: update instance group required: true @@ -11699,7 +13844,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 responses: '200': description: instance group deleted @@ -11717,7 +13862,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 requestBody: description: user to add to instance group required: true @@ -11747,7 +13892,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 requestBody: description: user to remove from instance group required: true @@ -11782,7 +13927,7 @@ paths: type: array items: type: object - properties: &ref_106 + properties: &ref_129 name: type: string summary: @@ -11797,7 +13942,7 @@ paths: type: string external_id: type: string - required: &ref_107 + required: &ref_130 - name /groups/overwrite: post: @@ -11814,8 +13959,8 @@ paths: type: array items: type: object - properties: *ref_106 - required: *ref_107 + properties: *ref_129 + required: *ref_130 responses: '200': description: success message @@ -11851,7 +13996,7 @@ paths: type: array items: type: object - properties: &ref_108 + properties: &ref_131 name: type: string summary: @@ -11864,7 +14009,7 @@ paths: type: object additionalProperties: type: boolean - required: &ref_109 + required: &ref_132 - name /w/{workspace}/groups/listnames: get: @@ -11937,7 +14082,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 requestBody: description: updated group required: true @@ -11969,7 +14114,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 responses: '200': description: group deleted @@ -11991,7 +14136,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 responses: '200': description: group @@ -11999,8 +14144,8 @@ paths: application/json: schema: type: object - properties: *ref_108 - required: *ref_109 + properties: *ref_131 + required: *ref_132 /w/{workspace}/groups/adduser/{name}: post: summary: add user to group @@ -12015,7 +14160,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 requestBody: description: added user to group required: true @@ -12047,7 +14192,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 requestBody: description: added user to group required: true @@ -12093,7 +14238,7 @@ paths: type: array items: type: object - properties: &ref_110 + properties: &ref_133 name: type: string owners: @@ -12111,7 +14256,7 @@ paths: edited_at: type: string format: date-time - required: &ref_111 + required: &ref_134 - name - owners - extra_perms @@ -12193,7 +14338,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 requestBody: description: update folder required: true @@ -12232,7 +14377,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 responses: '200': description: folder deleted @@ -12254,7 +14399,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 responses: '200': description: folder @@ -12262,8 +14407,8 @@ paths: application/json: schema: type: object - properties: *ref_110 - required: *ref_111 + properties: *ref_133 + required: *ref_134 /w/{workspace}/folders/getusage/{name}: get: summary: get folder usage @@ -12278,7 +14423,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 responses: '200': description: folder @@ -12320,7 +14465,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 requestBody: description: owner user to folder required: true @@ -12354,7 +14499,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 requestBody: description: added owner to folder required: true @@ -12408,7 +14553,7 @@ paths: type: array items: type: object - properties: &ref_183 + properties: &ref_228 worker: type: string worker_instance: @@ -12450,7 +14595,7 @@ paths: type: number wm_memory_usage: type: number - required: &ref_184 + required: &ref_229 - worker - worker_instance - ping_at @@ -12558,7 +14703,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 responses: '200': description: a config @@ -12575,7 +14720,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 requestBody: description: worker group required: true @@ -12598,7 +14743,7 @@ paths: - name: name in: path required: true - schema: *ref_103 + schema: *ref_126 responses: '200': description: Delete config @@ -12621,12 +14766,12 @@ paths: type: array items: type: object - properties: &ref_225 + properties: &ref_270 name: type: string config: type: object - required: &ref_226 + required: &ref_271 - name /configs/list_autoscaling_events/{worker_group}: get: @@ -12649,7 +14794,7 @@ paths: type: array items: type: object - properties: &ref_229 + properties: &ref_274 id: type: integer format: int64 @@ -12678,7 +14823,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 - name: kind in: path required: true @@ -12696,6 +14841,9 @@ paths: - raw_app - http_trigger - websocket_trigger + - kafka_trigger + - nats_trigger + - postgres_trigger responses: '200': description: acls @@ -12719,7 +14867,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 - name: kind in: path required: true @@ -12737,6 +14885,9 @@ paths: - raw_app - http_trigger - websocket_trigger + - kafka_trigger + - nats_trigger + - postgres_trigger requestBody: description: acl to add required: true @@ -12772,7 +14923,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 - name: kind in: path required: true @@ -12790,6 +14941,9 @@ paths: - raw_app - http_trigger - websocket_trigger + - kafka_trigger + - nats_trigger + - postgres_trigger requestBody: description: acl to add required: true @@ -12809,10 +14963,10 @@ paths: text/plain: schema: type: string - /w/{workspace}/capture_u/{path}: + /w/{workspace}/capture/set_config: post: - summary: update flow preview capture - operationId: updateCapture + summary: set capture config + operationId: setCaptureConfig tags: - capture parameters: @@ -12820,17 +14974,40 @@ paths: in: path required: true schema: *ref_0 - - name: path - in: path - required: true - schema: *ref_23 + requestBody: + description: capture config + required: true + content: + application/json: + schema: + type: object + properties: + trigger_kind: + type: string + enum: &ref_135 + - webhook + - http + - websocket + - kafka + - email + - nats + path: + type: string + is_flow: + type: boolean + trigger_config: + type: object + required: + - trigger_kind + - path + - is_flow responses: - '204': - description: flow preview captured - /w/{workspace}/capture/{path}: - put: - summary: create flow preview capture - operationId: createCapture + '200': + description: capture config set + /w/{workspace}/capture/ping_config/{trigger_kind}/{runnable_kind}/{path}: + post: + summary: ping capture config + operationId: pingCaptureConfig tags: - capture parameters: @@ -12838,15 +15015,127 @@ paths: in: path required: true schema: *ref_0 + - name: trigger_kind + in: path + required: true + schema: + type: string + enum: *ref_135 + - name: runnable_kind + in: path + required: true + schema: &ref_136 + type: string + enum: + - script + - flow - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: - '201': - description: flow preview capture created + '200': + description: capture config pinged + /w/{workspace}/capture/get_configs/{runnable_kind}/{path}: get: - summary: get flow preview capture + summary: get capture configs for a script or flow + operationId: getCaptureConfigs + tags: + - capture + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: runnable_kind + in: path + required: true + schema: *ref_136 + - name: path + in: path + required: true + schema: *ref_26 + responses: + '200': + description: capture configs for a script or flow + content: + application/json: + schema: + type: array + items: + type: object + properties: &ref_275 + trigger_config: {} + trigger_kind: + type: string + enum: *ref_135 + error: + type: string + last_server_ping: + type: string + format: date-time + required: &ref_276 + - trigger_kind + /w/{workspace}/capture/list/{runnable_kind}/{path}: + get: + summary: list captures for a script or flow + operationId: listCaptures + tags: + - capture + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: runnable_kind + in: path + required: true + schema: *ref_136 + - name: path + in: path + required: true + schema: *ref_26 + - name: trigger_kind + in: query + schema: + type: string + enum: *ref_135 + - name: page + description: which page to return (start at 1, default 1) + in: query + schema: *ref_5 + - name: per_page + description: number of items to return for a given page (default 30, max 100) + in: query + schema: *ref_6 + responses: + '200': + description: list of captures for a script or flow + content: + application/json: + schema: + type: array + items: + type: object + properties: &ref_137 + trigger_kind: + type: string + enum: *ref_135 + payload: {} + trigger_extra: {} + id: + type: integer + created_at: + type: string + format: date-time + required: &ref_138 + - trigger_kind + - payload + - id + - created_at + /w/{workspace}/capture/{id}: + get: + summary: get a capture operationId: getCapture tags: - capture @@ -12855,18 +15144,38 @@ paths: in: path required: true schema: *ref_0 - - name: path + - name: id in: path required: true - schema: *ref_23 + schema: + type: integer responses: '200': - description: captured flow preview + description: capture content: application/json: - schema: {} - '404': - description: capture does not exist for this flow + schema: + type: object + properties: *ref_137 + required: *ref_138 + delete: + summary: delete a capture + operationId: deleteCapture + tags: + - capture + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: id + in: path + required: true + schema: + type: integer + responses: + '200': + description: capture deleted /w/{workspace}/favorites/star: post: summary: star item @@ -12938,13 +15247,13 @@ paths: schema: *ref_0 - name: runnable_id in: query - schema: &ref_112 + schema: &ref_139 type: string - name: runnable_type in: query - schema: &ref_113 + schema: &ref_140 type: string - enum: &ref_142 + enum: &ref_170 - ScriptHash - ScriptPath - FlowPath @@ -12956,6 +15265,10 @@ paths: description: number of items to return for a given page (default 30, max 100) in: query schema: *ref_6 + - name: include_preview + in: query + schema: + type: boolean responses: '200': description: Input history for completed jobs @@ -12965,7 +15278,7 @@ paths: type: array items: type: object - properties: &ref_114 + properties: &ref_141 id: type: string name: @@ -12979,7 +15292,7 @@ paths: type: boolean success: type: boolean - required: &ref_115 + required: &ref_142 - id - name - args @@ -13029,10 +15342,10 @@ paths: schema: *ref_0 - name: runnable_id in: query - schema: *ref_112 + schema: *ref_139 - name: runnable_type in: query - schema: *ref_113 + schema: *ref_140 - name: page description: which page to return (start at 1, default 1) in: query @@ -13050,8 +15363,8 @@ paths: type: array items: type: object - properties: *ref_114 - required: *ref_115 + properties: *ref_141 + required: *ref_142 /w/{workspace}/inputs/create: post: summary: Create an Input for future use in a script or flow @@ -13065,10 +15378,10 @@ paths: schema: *ref_0 - name: runnable_id in: query - schema: *ref_112 + schema: *ref_139 - name: runnable_type in: query - schema: *ref_113 + schema: *ref_140 requestBody: description: Input required: true @@ -13076,12 +15389,12 @@ paths: application/json: schema: type: object - properties: &ref_138 + properties: &ref_166 name: type: string args: type: object - required: &ref_139 + required: &ref_167 - name - args - created_by @@ -13111,14 +15424,14 @@ paths: application/json: schema: type: object - properties: &ref_140 + properties: &ref_168 id: type: string name: type: string is_public: type: boolean - required: &ref_141 + required: &ref_169 - id - name - is_public @@ -13144,7 +15457,7 @@ paths: - name: input in: path required: true - schema: &ref_134 + schema: &ref_162 type: string responses: '200': @@ -13177,7 +15490,7 @@ paths: properties: s3_resource: type: object - properties: &ref_116 + properties: &ref_143 bucket: type: string region: @@ -13192,7 +15505,7 @@ paths: type: string pathStyle: type: boolean - required: &ref_117 + required: &ref_144 - bucket - region - endPoint @@ -13243,6 +15556,8 @@ paths: properties: connection_settings_str: type: string + azure_container_path: + type: string required: - connection_settings_str /w/{workspace}/job_helpers/polars_connection_settings: @@ -13268,8 +15583,8 @@ paths: properties: s3_resource: type: object - properties: *ref_116 - required: *ref_117 + properties: *ref_143 + required: *ref_144 responses: '200': description: Connection settings @@ -13290,10 +15605,10 @@ paths: type: boolean client_kwargs: type: object - properties: &ref_118 + properties: &ref_145 region_name: type: string - required: &ref_119 + required: &ref_146 - region_name required: - endpoint_url @@ -13348,8 +15663,8 @@ paths: type: boolean client_kwargs: type: object - properties: *ref_118 - required: *ref_119 + properties: *ref_145 + required: *ref_146 required: - endpoint_url - use_ssl @@ -13407,8 +15722,8 @@ paths: application/json: schema: type: object - properties: *ref_116 - required: *ref_117 + properties: *ref_143 + required: *ref_144 /w/{workspace}/job_helpers/test_connection: get: summary: Test connection to the workspace object storage @@ -13472,10 +15787,10 @@ paths: type: array items: type: object - properties: &ref_202 + properties: &ref_247 s3: type: string - required: &ref_203 + required: &ref_248 - s3 restricted_access: type: boolean @@ -13508,7 +15823,7 @@ paths: application/json: schema: type: object - properties: &ref_204 + properties: &ref_249 mime_type: type: string size_in_bytes: @@ -13572,7 +15887,7 @@ paths: application/json: schema: type: object - properties: &ref_205 + properties: &ref_250 msg: type: string content: @@ -13584,7 +15899,7 @@ paths: - Csv - Parquet - Unknown - required: &ref_206 + required: &ref_251 - content_type /w/{workspace}/job_helpers/load_parquet_preview/{path}: get: @@ -13600,7 +15915,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 - name: offset in: query schema: @@ -13649,7 +15964,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 - name: search_col in: query schema: @@ -13686,7 +16001,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 - name: offset in: query schema: @@ -13930,7 +16245,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 requestBody: description: parameters for statistics retrieval required: true @@ -13959,46 +16274,46 @@ paths: type: array items: type: object - properties: &ref_209 + properties: &ref_254 id: type: string name: type: string - required: &ref_210 + required: &ref_255 - id scalar_metrics: type: array items: type: object - properties: &ref_211 + properties: &ref_256 metric_id: type: string value: type: number - required: &ref_212 + required: &ref_257 - id - value timeseries_metrics: type: array items: type: object - properties: &ref_213 + properties: &ref_258 metric_id: type: string values: type: array items: type: object - properties: &ref_215 + properties: &ref_260 timestamp: type: string format: date-time value: type: number - required: &ref_216 + required: &ref_261 - timestamp - value - required: &ref_214 + required: &ref_259 - id - values /w/{workspace}/job_metrics/set_progress/{id}: @@ -14015,7 +16330,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 requestBody: description: parameters for statistics retrieval required: true @@ -14049,7 +16364,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 responses: '200': description: job progress between 0 and 99 @@ -14067,11 +16382,11 @@ paths: - name: before description: filter on started before (inclusive) timestamp in: query - schema: *ref_120 + schema: *ref_147 - name: after description: filter on created after (exclusive) timestamp in: query - schema: *ref_121 + schema: *ref_148 - name: with_error in: query required: false @@ -14120,7 +16435,7 @@ paths: - name: path in: path required: true - schema: *ref_23 + schema: *ref_26 responses: '200': description: log stream @@ -14143,12 +16458,12 @@ paths: type: array items: type: object - properties: &ref_219 + properties: &ref_264 concurrency_key: type: string total_running: type: number - required: &ref_220 + required: &ref_265 - concurrency_key - total_running /concurrency_groups/prune/{concurrency_id}: @@ -14161,7 +16476,7 @@ paths: - name: concurrency_id in: path required: true - schema: &ref_136 + schema: &ref_164 type: string responses: '200': @@ -14181,7 +16496,7 @@ paths: - name: id in: path required: true - schema: *ref_91 + schema: *ref_97 responses: '200': description: concurrency key for given job @@ -14214,93 +16529,93 @@ paths: - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_53 + schema: *ref_58 - name: label description: >- mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') in: query - schema: *ref_86 + schema: *ref_92 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 - name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_70 + schema: *ref_76 - name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_71 + schema: *ref_77 - name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_72 + schema: *ref_78 - name: script_hash description: mask to filter exact matching path in: query - schema: *ref_73 + schema: *ref_79 - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_74 + schema: *ref_80 - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_75 + schema: *ref_81 - name: created_or_started_before description: >- filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp in: query - schema: *ref_122 + schema: *ref_149 - name: running description: filter on running jobs in: query - schema: *ref_80 + schema: *ref_86 - name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: *ref_77 + schema: *ref_83 - name: created_or_started_after description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp in: query - schema: *ref_123 + schema: *ref_150 - name: created_or_started_after_completed_jobs description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp but only for the completed jobs in: query - schema: *ref_124 + schema: *ref_151 - name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_78 + schema: *ref_84 - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_81 + schema: *ref_87 - name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_83 + schema: *ref_89 - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_82 + schema: *ref_88 - name: page description: which page to return (start at 1, default 1) in: query @@ -14348,17 +16663,17 @@ paths: application/json: schema: type: object - properties: &ref_221 + properties: &ref_266 jobs: type: array items: - oneOf: *ref_92 - discriminator: *ref_93 + oneOf: *ref_98 + discriminator: *ref_99 obscured_jobs: type: array items: type: object - properties: &ref_143 + properties: &ref_171 typ: type: string started_at: @@ -14371,7 +16686,7 @@ paths: Obscured jobs omitted for security because of too specific filtering type: boolean - required: &ref_222 + required: &ref_267 - jobs - obscured_jobs /srch/w/{workspace}/index/search/job: @@ -14413,7 +16728,7 @@ paths: type: array items: type: object - properties: &ref_227 + properties: &ref_272 dancer: type: string /srch/index/search/service_logs: @@ -14475,7 +16790,7 @@ paths: type: array items: type: object - properties: &ref_228 + properties: &ref_273 dancer: type: string /srch/index/search/count_service_logs: @@ -14490,11 +16805,6 @@ paths: required: true schema: type: string - - name: hosts - in: query - required: true - schema: - type: string - name: min_ts in: query required: false @@ -14525,6 +16835,28 @@ paths: count_per_host: description: count of log lines that matched the query per hostname type: object + /srch/index/delete/{idx_name}: + delete: + summary: Restart container and delete the index to recreate it. + operationId: clearIndex + tags: + - indexSearch + parameters: + - name: idx_name + in: path + required: true + schema: + type: string + enum: + - JobIndex + - ServiceLogIndex + responses: + '200': + description: idx to be deleted and container restarting + content: + text/plain: + schema: + type: string components: securitySchemes: bearerAuth: @@ -14535,6 +16867,11 @@ components: in: cookie name: token parameters: + Id: + name: id + in: path + required: true + schema: *ref_152 Key: name: key in: path @@ -14545,61 +16882,71 @@ components: in: path required: true schema: *ref_0 + PublicationName: + name: publication + in: path + required: true + schema: *ref_120 VersionId: name: version in: path required: true - schema: *ref_125 + schema: *ref_153 Token: name: token in: path required: true - schema: *ref_126 + schema: *ref_154 AccountId: name: id in: path required: true - schema: *ref_27 + schema: *ref_31 ClientName: name: client_name in: path required: true - schema: *ref_26 + schema: *ref_30 ScriptPath: name: path in: path required: true - schema: *ref_35 + schema: *ref_39 ScriptHash: name: hash in: path required: true - schema: *ref_39 + schema: *ref_44 JobId: name: id in: path required: true - schema: *ref_91 + schema: *ref_97 Path: name: path in: path required: true - schema: *ref_23 + schema: *ref_26 + CustomPath: + name: custom_path + in: path + required: true + schema: *ref_71 PathId: name: id in: path required: true - schema: *ref_30 + schema: *ref_34 PathVersion: name: version in: path required: true - schema: *ref_127 + schema: *ref_155 Name: name: name in: path required: true - schema: *ref_103 + schema: *ref_126 Page: name: page description: which page to return (start at 1, default 1) @@ -14614,12 +16961,12 @@ components: name: order_desc description: order by desc order (default true) in: query - schema: *ref_52 + schema: *ref_57 CreatedBy: name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_53 + schema: *ref_58 Label: name: label description: >- @@ -14627,26 +16974,26 @@ components: with as a result an object containing a string in the array at key 'wm_labels') in: query - schema: *ref_86 + schema: *ref_92 ParentJob: name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_46 + schema: *ref_51 WorkerTag: name: tag description: Override the tag to use in: query - schema: *ref_48 + schema: *ref_53 CacheTtl: name: cache_ttl description: >- Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl in: query - schema: *ref_49 + schema: *ref_54 NewJobId: name: job_id description: >- @@ -14654,7 +17001,7 @@ components: randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_47 + schema: *ref_52 IncludeHeader: name: include_header description: > @@ -14664,14 +17011,14 @@ components: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_50 + schema: *ref_55 QueueLimit: name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_51 + schema: *ref_56 Payload: name: payload description: > @@ -14680,253 +17027,261 @@ components: `encodeURIComponent(btoa(JSON.stringify({a: 2})))` in: query - schema: *ref_94 + schema: *ref_100 ScriptStartPath: name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_71 + schema: *ref_77 SchedulePath: name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_72 + schema: *ref_78 ScriptExactPath: name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_70 + schema: *ref_76 ScriptExactHash: name: script_hash description: mask to filter exact matching path in: query - schema: *ref_73 + schema: *ref_79 CreatedBefore: name: created_before description: filter on created before (inclusive) timestamp in: query - schema: *ref_128 + schema: *ref_156 CreatedAfter: name: created_after description: filter on created after (exclusive) timestamp in: query - schema: *ref_129 + schema: *ref_157 StartedBefore: name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_74 + schema: *ref_80 StartedAfter: name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_75 + schema: *ref_81 Before: name: before description: filter on started before (inclusive) timestamp in: query - schema: *ref_120 + schema: *ref_147 CreatedOrStartedAfter: name: created_or_started_after description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp in: query - schema: *ref_123 + schema: *ref_150 CreatedOrStartedAfterCompletedJob: name: created_or_started_after_completed_jobs description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp but only for the completed jobs in: query - schema: *ref_124 + schema: *ref_151 CreatedOrStartedBefore: name: created_or_started_before description: >- filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp in: query - schema: *ref_122 + schema: *ref_149 Success: name: success description: filter on successful jobs in: query - schema: *ref_76 + schema: *ref_82 ScheduledForBeforeNow: name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: *ref_77 + schema: *ref_83 Suspended: name: suspended description: filter on suspended jobs in: query - schema: *ref_79 + schema: *ref_85 Running: name: running description: filter on running jobs in: query - schema: *ref_80 + schema: *ref_86 ArgsFilter: name: args description: filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_81 + schema: *ref_87 Tag: name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_83 + schema: *ref_89 ResultFilter: name: result description: filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_82 + schema: *ref_88 After: name: after description: filter on created after (exclusive) timestamp in: query - schema: *ref_121 + schema: *ref_148 Username: name: username description: filter on exact username of user in: query - schema: *ref_130 + schema: *ref_158 Operation: name: operation description: filter on exact or prefix name of operation in: query - schema: *ref_131 + schema: *ref_159 ResourceName: name: resource description: filter on exact or prefix name of resource in: query - schema: *ref_132 + schema: *ref_160 ActionKind: name: action_kind description: filter on type of operation in: query - schema: *ref_133 + schema: *ref_161 JobKinds: name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_78 + schema: *ref_84 RunnableId: name: runnable_id in: query - schema: *ref_112 + schema: *ref_139 RunnableTypeQuery: name: runnable_type in: query - schema: *ref_113 + schema: *ref_140 InputId: name: input in: path required: true - schema: *ref_134 + schema: *ref_162 GetStarted: name: get_started in: query - schema: *ref_135 + schema: *ref_163 ConcurrencyId: name: concurrency_id in: path required: true + schema: *ref_164 + RunnableKind: + name: runnable_kind + in: path + required: true schema: *ref_136 schemas: - AiResource: + AIProvider: + type: string + enum: *ref_20 + AIResource: type: object - properties: *ref_16 - required: *ref_17 + properties: *ref_18 + required: *ref_19 Script: - type: object - properties: *ref_37 - required: *ref_38 - NewScript: type: object properties: *ref_42 required: *ref_43 + NewScript: + type: object + properties: *ref_47 + required: *ref_48 NewScriptWithDraft: - allOf: *ref_137 + allOf: *ref_165 ScriptHistory: type: object - properties: *ref_44 - required: *ref_45 + properties: *ref_49 + required: *ref_50 ScriptArgs: type: object - additionalProperties: *ref_18 + additionalProperties: *ref_21 Input: type: object - properties: *ref_114 - required: *ref_115 + properties: *ref_141 + required: *ref_142 CreateInput: type: object - properties: *ref_138 - required: *ref_139 + properties: *ref_166 + required: *ref_167 UpdateInput: type: object - properties: *ref_140 - required: *ref_141 + properties: *ref_168 + required: *ref_169 RunnableType: type: string - enum: *ref_142 + enum: *ref_170 QueuedJob: type: object - properties: *ref_89 - required: *ref_90 + properties: *ref_95 + required: *ref_96 CompletedJob: type: object - properties: *ref_87 - required: *ref_88 + properties: *ref_93 + required: *ref_94 ObscuredJob: type: object - properties: *ref_143 + properties: *ref_171 Job: - oneOf: *ref_92 - discriminator: *ref_93 + oneOf: *ref_98 + discriminator: *ref_99 User: type: object properties: *ref_10 required: *ref_11 UserUsage: type: object - properties: *ref_144 + properties: *ref_172 Login: type: object - properties: *ref_145 - required: *ref_146 + properties: *ref_173 + required: *ref_174 EditWorkspaceUser: type: object - properties: *ref_147 + properties: *ref_175 TruncatedToken: type: object - properties: *ref_40 - required: *ref_41 + properties: *ref_45 + required: *ref_46 NewToken: type: object - properties: *ref_148 + properties: *ref_176 NewTokenImpersonate: type: object - properties: *ref_149 - required: *ref_150 + properties: *ref_177 + required: *ref_178 ListableVariable: type: object - properties: *ref_24 - required: *ref_25 + properties: *ref_27 + required: *ref_28 ContextualVariable: type: object - properties: *ref_151 - required: *ref_152 + properties: *ref_179 + required: *ref_180 CreateVariable: type: object - properties: *ref_153 - required: *ref_154 + properties: *ref_181 + required: *ref_182 EditVariable: type: object - properties: *ref_155 + properties: *ref_183 AuditLog: type: object properties: *ref_1 @@ -15056,164 +17411,234 @@ components: - error - no_main_func - has_preprocessor + ScriptLang: + type: string + enum: *ref_41 Preview: type: object - properties: *ref_156 - required: *ref_157 + properties: *ref_184 + required: *ref_185 WorkflowTask: type: object - properties: *ref_158 - required: *ref_159 + properties: *ref_186 + required: *ref_187 WorkflowStatusRecord: type: object - additionalProperties: *ref_160 + additionalProperties: *ref_188 WorkflowStatus: type: object - properties: *ref_161 + properties: *ref_189 CreateResource: type: object - properties: *ref_162 - required: *ref_163 + properties: *ref_190 + required: *ref_191 EditResource: type: object - properties: *ref_164 + properties: *ref_192 Resource: type: object - properties: *ref_165 - required: *ref_166 + properties: *ref_193 + required: *ref_194 ListableResource: type: object - properties: *ref_167 - required: *ref_168 + properties: *ref_195 + required: *ref_196 ResourceType: type: object - properties: *ref_28 - required: *ref_29 + properties: *ref_32 + required: *ref_33 EditResourceType: type: object - properties: *ref_169 + properties: *ref_197 Schedule: type: object - properties: *ref_96 - required: *ref_97 + properties: *ref_102 + required: *ref_103 ScheduleWJobs: - allOf: *ref_170 + allOf: *ref_198 NewSchedule: type: object - properties: *ref_171 - required: *ref_172 + properties: *ref_199 + required: *ref_200 EditSchedule: type: object - properties: *ref_173 - required: *ref_174 - HttpTrigger: - type: object - properties: *ref_98 - required: *ref_99 - NewHttpTrigger: - type: object - properties: *ref_175 - required: *ref_176 - EditHttpTrigger: - type: object - properties: *ref_177 - required: *ref_178 - TriggersCount: - type: object - properties: *ref_59 - WebsocketTrigger: - type: object - properties: *ref_101 - required: *ref_102 - NewWebsocketTrigger: - type: object - properties: *ref_179 - required: *ref_180 - EditWebsocketTrigger: - type: object - properties: *ref_181 - required: *ref_182 - WebsocketTriggerInitialMessage: - anyOf: *ref_100 - Group: + properties: *ref_201 + required: *ref_202 + TriggerExtraProperty: type: object properties: *ref_108 required: *ref_109 + HttpTrigger: + allOf: *ref_104 + type: object + properties: *ref_105 + required: *ref_106 + NewHttpTrigger: + type: object + properties: *ref_203 + required: *ref_204 + EditHttpTrigger: + type: object + properties: *ref_205 + required: *ref_206 + TriggersCount: + type: object + properties: *ref_64 + WebsocketTrigger: + allOf: *ref_110 + type: object + properties: *ref_111 + required: *ref_112 + NewWebsocketTrigger: + type: object + properties: *ref_207 + required: *ref_208 + EditWebsocketTrigger: + type: object + properties: *ref_209 + required: *ref_210 + WebsocketTriggerInitialMessage: + anyOf: *ref_107 + Slot: + type: object + properties: *ref_117 + SlotList: + type: object + properties: *ref_211 + PublicationData: + type: object + properties: *ref_121 + required: *ref_122 + TableToTrack: + type: array + items: *ref_212 + Relations: + type: object + properties: *ref_118 + required: *ref_119 + Language: + type: string + enum: *ref_213 + TemplateScript: + type: object + properties: *ref_214 + required: *ref_215 + PostgresTrigger: + allOf: *ref_123 + type: object + properties: *ref_124 + required: *ref_125 + NewPostgresTrigger: + type: object + properties: *ref_216 + required: *ref_217 + EditPostgresTrigger: + type: object + properties: *ref_218 + required: *ref_219 + KafkaTrigger: + type: object + properties: *ref_113 + required: *ref_114 + NewKafkaTrigger: + type: object + properties: *ref_220 + required: *ref_221 + EditKafkaTrigger: + type: object + properties: *ref_222 + required: *ref_223 + NatsTrigger: + type: object + properties: *ref_115 + required: *ref_116 + NewNatsTrigger: + type: object + properties: *ref_224 + required: *ref_225 + EditNatsTrigger: + type: object + properties: *ref_226 + required: *ref_227 + Group: + type: object + properties: *ref_131 + required: *ref_132 InstanceGroup: type: object - properties: *ref_104 - required: *ref_105 + properties: *ref_127 + required: *ref_128 Folder: type: object - properties: *ref_110 - required: *ref_111 + properties: *ref_133 + required: *ref_134 WorkerPing: type: object - properties: *ref_183 - required: *ref_184 + properties: *ref_228 + required: *ref_229 UserWorkspaceList: type: object - properties: *ref_185 - required: *ref_186 + properties: *ref_230 + required: *ref_231 CreateWorkspace: type: object - properties: *ref_187 - required: *ref_188 + properties: *ref_232 + required: *ref_233 Workspace: type: object properties: *ref_7 required: *ref_8 WorkspaceInvite: type: object - properties: *ref_14 - required: *ref_15 + properties: *ref_16 + required: *ref_17 GlobalUserInfo: type: object - properties: *ref_12 - required: *ref_13 + properties: *ref_14 + required: *ref_15 Flow: - allOf: *ref_58 + allOf: *ref_63 ExtraPerms: type: object - additionalProperties: *ref_189 + additionalProperties: *ref_234 FlowMetadata: type: object - properties: *ref_190 - required: *ref_191 + properties: *ref_235 + required: *ref_236 OpenFlowWPath: - allOf: *ref_60 + allOf: *ref_65 FlowPreview: type: object - properties: *ref_192 - required: *ref_193 + properties: *ref_237 + required: *ref_238 RestartedFrom: type: object - properties: *ref_194 + properties: *ref_239 Policy: type: object - properties: *ref_61 + properties: *ref_66 ListableApp: type: object - properties: *ref_195 - required: *ref_196 + properties: *ref_240 + required: *ref_241 ListableRawApp: type: object - properties: *ref_197 - required: *ref_198 + properties: *ref_242 + required: *ref_243 AppWithLastVersion: type: object - properties: *ref_62 - required: *ref_63 + properties: *ref_67 + required: *ref_68 AppWithLastVersionWDraft: - allOf: *ref_199 + allOf: *ref_244 AppHistory: type: object - properties: *ref_64 - required: *ref_65 + properties: *ref_69 + required: *ref_70 FlowVersion: type: object - properties: *ref_56 - required: *ref_57 + properties: *ref_61 + required: *ref_62 SlackToken: type: object properties: @@ -15235,46 +17660,46 @@ components: - bot TokenResponse: type: object - properties: *ref_200 - required: *ref_201 + properties: *ref_245 + required: *ref_246 HubScriptKind: name: kind - schema: *ref_36 + schema: *ref_40 PolarsClientKwargs: type: object - properties: *ref_118 - required: *ref_119 + properties: *ref_145 + required: *ref_146 LargeFileStorage: type: object - properties: *ref_19 + properties: *ref_22 WindmillLargeFile: type: object - properties: *ref_202 - required: *ref_203 + properties: *ref_247 + required: *ref_248 WindmillFileMetadata: type: object - properties: *ref_204 + properties: *ref_249 WindmillFilePreview: type: object - properties: *ref_205 - required: *ref_206 + properties: *ref_250 + required: *ref_251 S3Resource: type: object - properties: *ref_116 - required: *ref_117 + properties: *ref_143 + required: *ref_144 WorkspaceGitSyncSettings: type: object - properties: *ref_20 + properties: *ref_23 WorkspaceDeployUISettings: type: object - properties: *ref_21 + properties: *ref_24 WorkspaceDefaultScripts: type: object - properties: *ref_22 + properties: *ref_25 GitRepositorySettings: type: object - properties: *ref_207 - required: *ref_208 + properties: *ref_252 + required: *ref_253 UploadFilePart: type: object properties: @@ -15287,126 +17712,150 @@ components: - tag MetricMetadata: type: object - properties: *ref_209 - required: *ref_210 + properties: *ref_254 + required: *ref_255 ScalarMetric: type: object - properties: *ref_211 - required: *ref_212 + properties: *ref_256 + required: *ref_257 TimeseriesMetric: type: object - properties: *ref_213 - required: *ref_214 + properties: *ref_258 + required: *ref_259 MetricDataPoint: type: object - properties: *ref_215 - required: *ref_216 + properties: *ref_260 + required: *ref_261 RawScriptForDependencies: type: object - properties: *ref_217 - required: *ref_218 + properties: *ref_262 + required: *ref_263 ConcurrencyGroup: type: object - properties: *ref_219 - required: *ref_220 + properties: *ref_264 + required: *ref_265 ExtendedJobs: type: object - properties: *ref_221 - required: *ref_222 + properties: *ref_266 + required: *ref_267 ExportedUser: type: object properties: *ref_3 required: *ref_4 GlobalSetting: type: object - properties: *ref_223 - required: *ref_224 + properties: *ref_268 + required: *ref_269 Config: type: object - properties: *ref_225 - required: *ref_226 + properties: *ref_270 + required: *ref_271 ExportedInstanceGroup: type: object - properties: *ref_106 - required: *ref_107 + properties: *ref_129 + required: *ref_130 JobSearchHit: type: object - properties: *ref_227 + properties: *ref_272 LogSearchHit: type: object - properties: *ref_228 + properties: *ref_273 AutoscalingEvent: type: object - properties: *ref_229 + properties: *ref_274 CriticalAlert: type: object - properties: *ref_230 + properties: *ref_29 + CaptureTriggerKind: + type: string + enum: *ref_135 + Capture: + type: object + properties: *ref_137 + required: *ref_138 + CaptureConfig: + type: object + properties: *ref_275 + required: *ref_276 + OperatorSettings: + nullable: true + type: object + required: *ref_12 + properties: *ref_13 + TeamInfo: + type: object + required: *ref_277 + properties: *ref_278 + ChannelInfo: + type: object + required: *ref_279 + properties: *ref_280 StaticTransform: type: object - properties: *ref_231 - required: *ref_232 + properties: *ref_281 + required: *ref_282 JavascriptTransform: type: object - properties: *ref_233 - required: *ref_234 + properties: *ref_283 + required: *ref_284 InputTransform: - oneOf: *ref_31 - discriminator: *ref_32 + oneOf: *ref_35 + discriminator: *ref_36 RawScript: type: object - properties: *ref_235 - required: *ref_236 + properties: *ref_285 + required: *ref_286 PathScript: type: object - properties: *ref_237 - required: *ref_238 + properties: *ref_287 + required: *ref_288 PathFlow: type: object - properties: *ref_239 - required: *ref_240 + properties: *ref_289 + required: *ref_290 FlowModule: type: object - properties: *ref_33 - required: *ref_34 + properties: *ref_37 + required: *ref_38 ForloopFlow: type: object - properties: *ref_241 - required: *ref_242 + properties: *ref_291 + required: *ref_292 WhileloopFlow: type: object - properties: *ref_243 - required: *ref_244 + properties: *ref_293 + required: *ref_294 BranchOne: type: object - properties: *ref_245 - required: *ref_246 + properties: *ref_295 + required: *ref_296 BranchAll: type: object - properties: *ref_247 - required: *ref_248 + properties: *ref_297 + required: *ref_298 Identity: type: object - properties: *ref_249 - required: *ref_250 + properties: *ref_299 + required: *ref_300 FlowModuleValue: - oneOf: *ref_251 - discriminator: *ref_252 + oneOf: *ref_301 + discriminator: *ref_302 Retry: type: object - properties: *ref_95 + properties: *ref_101 FlowValue: type: object - properties: *ref_66 - required: *ref_67 + properties: *ref_72 + required: *ref_73 OpenFlow: type: object - properties: *ref_54 - required: *ref_55 + properties: *ref_59 + required: *ref_60 FlowStatusModule: type: object - properties: *ref_68 - required: *ref_69 + properties: *ref_74 + required: *ref_75 FlowStatus: type: object - properties: *ref_84 - required: *ref_85 + properties: *ref_90 + required: *ref_91 diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index f3104db9af..47f4d9eaa3 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -7315,6 +7315,52 @@ paths: "200": description: Interactive slack approval message sent successfully + /w/{workspace}/jobs/teams_approval/{id}: + get: + summary: generate interactive teams approval for suspended job + operationId: getTeamsApprovalPayload + tags: + - job + parameters: + - $ref: "#/components/parameters/WorkspaceId" + - $ref: "#/components/parameters/JobId" + - name: approver + in: query + schema: + type: string + - name: message + in: query + schema: + type: string + - name: team_name + in: query + required: true + schema: + type: string + - name: channel_name + in: query + required: true + schema: + type: string + - name: flow_step_id + in: query + required: true + schema: + type: string + - name: default_args_json + in: query + required: false + schema: + type: string + - name: dynamic_enums_json + in: query + required: false + schema: + type: string + responses: + "200": + description: Interactive slack approval message sent successfully + /w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}: get: summary: resume a job for a suspended flow diff --git a/backend/windmill-api/src/approvals.rs b/backend/windmill-api/src/approvals.rs new file mode 100644 index 0000000000..4d873144a6 --- /dev/null +++ b/backend/windmill-api/src/approvals.rs @@ -0,0 +1,157 @@ +use serde::Deserialize; +use serde_json::value::RawValue; +use sqlx::types::Uuid; +use windmill_common::cache; +use windmill_common::db::DB; +use windmill_common::error::Error; + +use axum::extract::{Path, Query}; + +use crate::jobs::{get_resume_urls_internal, ResumeUrls}; +use windmill_common::{ + error::{self}, + jobs::JobKind, + scripts::ScriptHash, +}; + +#[derive(Debug, Deserialize)] +pub struct ResumeFormRow { + pub resume_form: Option, + pub hide_cancel: Option, +} + +#[derive(Deserialize)] +pub struct QueryApprover { + pub approver: Option, +} + +#[derive(Deserialize)] +pub struct QueryMessage { + pub message: Option, +} + +#[derive(Deserialize)] +pub struct QueryResourcePath { + pub slack_resource_path: String, +} + +#[derive(Deserialize)] +pub struct QueryChannelId { + pub channel_id: String, +} + +#[derive(Deserialize)] +pub struct QueryFlowStepId { + pub flow_step_id: String, +} + +#[derive(Deserialize, Debug)] +pub struct QueryDefaultArgsJson { + pub default_args_json: Option, +} + +#[derive(Deserialize, Debug)] +pub struct QueryDynamicEnumJson { + pub dynamic_enums_json: Option, +} + +#[derive(Debug)] +pub struct ApprovalFormDetails { + pub message_str: String, + pub urls: ResumeUrls, + pub schema: Option, +} + +pub async fn get_approval_form( + db: DB, + w_id: &str, + job_id: Uuid, + flow_step_id: Option<&str>, + resume_id: u32, + approver: Option<&str>, + message: Option<&str>, +) -> Result { + let res = get_resume_urls_internal( + axum::Extension(db.clone()), + Path((w_id.to_string(), job_id, resume_id)), + Query(QueryApprover { approver: approver.map(|a| a.to_string()) }), + ) + .await?; + + let urls = res.0; + + tracing::debug!("Job ID: {:?}", job_id); + + let (job_kind, script_hash, raw_flow, parent_job_id, created_at, created_by, script_path, args) = sqlx::query!( + "SELECT + v2_as_queue.job_kind AS \"job_kind!: JobKind\", + v2_as_queue.script_hash AS \"script_hash: ScriptHash\", + v2_as_queue.raw_flow AS \"raw_flow: sqlx::types::Json>\", + v2_as_completed_job.parent_job AS \"parent_job: Uuid\", + v2_as_completed_job.created_at AS \"created_at!: chrono::NaiveDateTime\", + v2_as_completed_job.created_by AS \"created_by!\", + v2_as_queue.script_path, + v2_as_queue.args AS \"args: sqlx::types::Json>\" + FROM v2_as_queue + JOIN v2_as_completed_job ON v2_as_completed_job.parent_job = v2_as_queue.id + WHERE v2_as_completed_job.id = $1 AND v2_as_completed_job.workspace_id = $2 + LIMIT 1", + job_id, + &w_id + ) + .fetch_optional(&db) + .await + .map_err(|e| error::Error::BadRequest(e.to_string()))? + .ok_or_else(|| error::Error::BadRequest("This workflow is no longer running and has either already timed out or been cancelled or completed.".to_string())) + .map(|r| (r.job_kind, r.script_hash, r.raw_flow, r.parent_job, r.created_at, r.created_by, r.script_path, r.args))?; + + let flow_data = match cache::job::fetch_flow(&db, job_kind, script_hash).await { + Ok(data) => data, + Err(_) => { + if let Some(parent_job_id) = parent_job_id.as_ref() { + cache::job::fetch_preview_flow(&db, parent_job_id, raw_flow).await? + } else { + return Err(error::Error::BadRequest( + "This workflow is no longer running and has either already timed out or been cancelled or completed.".to_string(), + )); + } + } + }; + + let flow_value = &flow_data.flow; + let flow_step_id = flow_step_id.unwrap_or(""); + let module = flow_value.modules.iter().find(|m| m.id == flow_step_id); + + tracing::debug!("Module: {:#?}", module); + + let schema = module.and_then(|module| { + module.suspend.as_ref().map(|suspend| ResumeFormRow { + resume_form: suspend.resume_form.clone(), + hide_cancel: suspend.hide_cancel, + }) + }); + + let args_str = args.map_or("None".to_string(), |a| a.get().to_string()); + let parent_job_id_str = parent_job_id.map_or("None".to_string(), |id| id.to_string()); + let script_path_str = script_path.as_deref().unwrap_or("None"); + + let created_at_formatted = created_at.format("%Y-%m-%d %H:%M:%S").to_string(); + + let mut message_str = format!( + "A workflow has been suspended and is waiting for approval:\n\n\ + *Created by*: {created_by}\n\ + *Created at*: {created_at_formatted}\n\ + *Script path*: {script_path_str}\n\ + *Args*: {args_str}\n\ + *Flow ID*: {parent_job_id_str}\n\n" + ); + + // Append custom message if provided + if let Some(msg) = message { + message_str.push_str(msg); + } + + tracing::debug!("Schema: {:#?}", schema); + + Ok(ApprovalFormDetails { message_str, urls, schema }) +} diff --git a/backend/windmill-api/src/jobs.rs b/backend/windmill-api/src/jobs.rs index 483db02920..774656d521 100644 --- a/backend/windmill-api/src/jobs.rs +++ b/backend/windmill-api/src/jobs.rs @@ -80,6 +80,8 @@ use windmill_common::{ }, }; +use crate::approvals::QueryApprover; + #[cfg(all(feature = "enterprise", feature = "parquet"))] use windmill_common::s3_helpers::OBJECT_STORE_CACHE_SETTINGS; #[cfg(feature = "prometheus")] @@ -2125,11 +2127,6 @@ pub struct SuspendedJobFlow { pub approvers: Vec, } -#[derive(Deserialize, Debug)] -pub struct QueryApprover { - pub approver: Option, -} - pub async fn get_suspended_job_flow( authed: Option, Extension(db): Extension, diff --git a/backend/windmill-api/src/lib.rs b/backend/windmill-api/src/lib.rs index b4c262b9eb..0afa15bc69 100644 --- a/backend/windmill-api/src/lib.rs +++ b/backend/windmill-api/src/lib.rs @@ -55,6 +55,8 @@ use windmill_common::{utils::GIT_VERSION, BASE_URL, INSTANCE_NAME}; use crate::scim_ee::has_scim_token; use windmill_common::error::AppError; +use crate::teams_approvals::request_teams_approval; + mod ai; mod apps; mod args; @@ -101,7 +103,9 @@ mod scim_ee; mod scripts; mod service_logs; mod settings; +mod approvals; mod slack_approvals; +mod teams_approvals; #[cfg(feature = "smtp")] mod smtp_server_ee; mod static_assets; @@ -494,6 +498,10 @@ pub async fn run_server( "/w/:workspace_id/jobs/slack_approval/:job_id", get(slack_approvals::request_slack_approval), ) + .route( + "/w/:workspace_id/jobs/teams_approval/:job_id", + get(request_teams_approval), + ) .nest( "/w/:workspace_id/resources_u", resources::public_service().layer(cors.clone()), diff --git a/backend/windmill-api/src/slack_approvals.rs b/backend/windmill-api/src/slack_approvals.rs index 652c7b1721..de65f7b28d 100644 --- a/backend/windmill-api/src/slack_approvals.rs +++ b/backend/windmill-api/src/slack_approvals.rs @@ -4,7 +4,7 @@ use axum::{ }; use hyper::StatusCode; use serde::{Deserialize, Serialize}; -use serde_json::value::{RawValue, Value}; +use serde_json::value::Value; use sqlx::types::Uuid; use std::{collections::HashMap, str::FromStr}; @@ -13,19 +13,18 @@ use regex::Regex; use reqwest::Client; use crate::db::{ApiAuthed, DB}; -use crate::jobs::{ - cancel_suspended_job, get_resume_urls_internal, resume_suspended_job, QueryApprover, - QueryOrBody, ResumeUrls, -}; +use crate::jobs::{cancel_suspended_job, resume_suspended_job, QueryOrBody, ResumeUrls}; use windmill_common::{ - cache, - error::{self, Error}, - jobs::JobKind, - scripts::ScriptHash, + error::Error, variables::{build_crypt, decrypt}, }; +use crate::approvals::{ + get_approval_form, ApprovalFormDetails, QueryApprover, QueryChannelId, QueryDefaultArgsJson, + QueryDynamicEnumJson, QueryFlowStepId, QueryMessage, QueryResourcePath, +}; + #[derive(Deserialize, Debug)] pub struct SlackFormData { payload: String, @@ -96,12 +95,6 @@ struct ResumeSchema { schema: Schema, } -#[derive(Debug, Deserialize)] -struct ResumeFormRow { - resume_form: Option, - hide_cancel: Option, -} - #[derive(Debug, Deserialize, Serialize)] struct Schema { order: Vec, @@ -133,36 +126,6 @@ struct ResumeFormField { nullable: Option, } -#[derive(Deserialize)] -pub struct QueryMessage { - message: Option, -} - -#[derive(Deserialize)] -pub struct QueryResourcePath { - slack_resource_path: String, -} - -#[derive(Deserialize)] -pub struct QueryChannelId { - channel_id: String, -} - -#[derive(Deserialize)] -pub struct QueryFlowStepId { - flow_step_id: String, -} - -#[derive(Deserialize, Debug)] -pub struct QueryDefaultArgsJson { - default_args_json: Option, -} - -#[derive(Deserialize, Debug)] -pub struct QueryDynamicEnumJson { - dynamic_enums_json: Option, -} - #[derive(Deserialize, Debug)] struct ModalActionValue { w_id: String, @@ -964,92 +927,17 @@ async fn get_modal_blocks( default_args_json: Option<&serde_json::Value>, dynamic_enums_json: Option<&serde_json::Value>, ) -> Result, Error> { - let res = get_resume_urls_internal( - axum::Extension(db.clone()), - Path((w_id.to_string(), job_id, resume_id)), - Query(QueryApprover { approver: approver.map(|a| a.to_string()) }), - ) - .await?; + let approval_details = + get_approval_form(db, w_id, job_id, flow_step_id, resume_id, approver, message).await?; - let urls = res.0; + let ApprovalFormDetails { mut message_str, urls, schema } = approval_details; - tracing::debug!("Job ID: {:?}", job_id); - - let (job_kind, script_hash, raw_flow, parent_job_id, created_at, created_by, script_path, args) = sqlx::query!( - "SELECT - v2_as_queue.job_kind AS \"job_kind!: JobKind\", - v2_as_queue.script_hash AS \"script_hash: ScriptHash\", - v2_as_queue.raw_flow AS \"raw_flow: sqlx::types::Json>\", - v2_as_completed_job.parent_job AS \"parent_job: Uuid\", - v2_as_completed_job.created_at AS \"created_at!: chrono::NaiveDateTime\", - v2_as_completed_job.created_by AS \"created_by!\", - v2_as_queue.script_path, - v2_as_queue.args AS \"args: sqlx::types::Json>\" - FROM v2_as_queue - JOIN v2_as_completed_job ON v2_as_completed_job.parent_job = v2_as_queue.id - WHERE v2_as_completed_job.id = $1 AND v2_as_completed_job.workspace_id = $2 - LIMIT 1", - job_id, - &w_id - ) - .fetch_optional(&db) - .await - .map_err(|e| error::Error::BadRequest(e.to_string()))? - .ok_or_else(|| error::Error::BadRequest("This workflow is no longer running and has either already timed out or been cancelled or completed.".to_string())) - .map(|r| (r.job_kind, r.script_hash, r.raw_flow, r.parent_job, r.created_at, r.created_by, r.script_path, r.args))?; - - let flow_data = match cache::job::fetch_flow(&db, job_kind, script_hash).await { - Ok(data) => data, - Err(_) => { - if let Some(parent_job_id) = parent_job_id.as_ref() { - cache::job::fetch_preview_flow(&db, parent_job_id, raw_flow).await? - } else { - return Err(error::Error::BadRequest( - "This workflow is no longer running and has either already timed out or been cancelled or completed.".to_string(), - )); - } - } - }; - - let flow_value = &flow_data.flow; - let flow_step_id = flow_step_id.unwrap_or(""); - let module = flow_value.modules.iter().find(|m| m.id == flow_step_id); - - tracing::debug!("Module: {:#?}", module); - - let schema = module.and_then(|module| { - module.suspend.as_ref().map(|suspend| ResumeFormRow { - resume_form: suspend.resume_form.clone(), - hide_cancel: suspend.hide_cancel, - }) - }); - - let args_str = args.map_or("None".to_string(), |a| a.get().to_string()); - let parent_job_id_str = parent_job_id.map_or("None".to_string(), |id| id.to_string()); - let script_path_str = script_path.as_deref().unwrap_or("None"); - - let created_at_formatted = created_at.format("%Y-%m-%d %H:%M:%S").to_string(); - - let mut message_str = format!( - "A workflow has been suspended and is waiting for approval:\n\n\ - *Created by*: {created_by}\n\ - *Created at*: {created_at_formatted}\n\ - *Script path*: {script_path_str}\n\ - *Args*: {args_str}\n\ - *Flow ID*: {parent_job_id_str}\n\n" - ); - - // Append custom message if provided - if let Some(msg) = message { - message_str.push_str(msg); - } - - tracing::debug!("Schema: {:#?}", schema); + // tracing::debug!("Approval Details: {:?}", approval_details); if let Some(resume_schema) = schema { let hide_cancel = resume_schema.hide_cancel.unwrap_or(false); - // if hide cancel is false add note to message + // If hide_cancel is false, add a note to the message if !hide_cancel { message_str.push_str("\n\n*NOTE*: closing this modal will cancel the workflow.\n\n"); } diff --git a/backend/windmill-api/src/teams_approvals.rs b/backend/windmill-api/src/teams_approvals.rs new file mode 100644 index 0000000000..b26f1151c9 --- /dev/null +++ b/backend/windmill-api/src/teams_approvals.rs @@ -0,0 +1,73 @@ +use crate::approvals::{ + get_approval_form, ApprovalFormDetails, QueryApprover, QueryDefaultArgsJson, QueryDynamicEnumJson, QueryFlowStepId, QueryMessage, ResumeFormRow, +}; +use crate::db::{ApiAuthed, DB}; +use axum::{ + extract::{Path, Query}, + Extension, +}; +use http::StatusCode; +use serde::Deserialize; +use uuid::Uuid; +use windmill_common::error::Error; +use windmill_common::teams_ee::get_global_teams_bot_token; + +#[derive(Deserialize)] +pub struct RequestTeamsApprovalPayload { + pub team_name: String, + pub channel_name: String, + pub message: String, + pub approver: String, + pub default_args_json: Option, + pub dynamic_enums_json: Option, +} + +#[derive(Deserialize)] +pub struct QueryTeamName { + pub team_name: String, +} + +#[derive(Deserialize)] +pub struct QueryChannelName { + pub channel_name: String, +} + +pub async fn request_teams_approval( + authed: ApiAuthed, + Extension(db): Extension, + Path((w_id, job_id)): Path<(String, Uuid)>, + Query(team_name): Query, + Query(channel_name): Query, + Query(approver): Query, + Query(message): Query, + Query(flow_step_id): Query, + Query(default_args_json): Query, + Query(dynamic_enums_json): Query, +) -> Result { + let teams_bot_token = get_global_teams_bot_token(&db).await?; + + let resume_id = rand::random::(); + + let approval_details = get_approval_form( + db, + w_id.as_str(), + job_id, + Some(flow_step_id.flow_step_id.as_str()), + resume_id, + approver.approver.as_deref(), + message.message.as_deref(), + ).await?; + + let ApprovalFormDetails { mut message_str, urls, schema } = approval_details; + + let blocks = transform_schemas( + message_str, + schema, + ); + + Ok(StatusCode::OK) +} + +fn transform_schemas(message_str: String, schema: Option) -> Vec { + vec![] +} diff --git a/frontend/src/lib/components/apps/utils.ts b/frontend/src/lib/components/apps/utils.ts index cb30aac94f..5e41d4ccfa 100644 --- a/frontend/src/lib/components/apps/utils.ts +++ b/frontend/src/lib/components/apps/utils.ts @@ -248,7 +248,7 @@ declare function setValue(id: string, value: any): void; */ declare function setSelectedIndex(id: string, index: number): void; -/** close a drawer or modal +/** open a drawer or modal * @param id component's id */ declare function open(id: string): void; diff --git a/typescript-client/build.jsr.sh b/typescript-client/build.jsr.sh index cdcd68f975..859c369e12 100755 --- a/typescript-client/build.jsr.sh +++ b/typescript-client/build.jsr.sh @@ -14,5 +14,5 @@ cp "${script_dirpath}/s3Types.ts" "${script_dirpath}/src/" echo "" >> "${script_dirpath}/src/index.ts" echo 'export type { S3Object, DenoS3LightClientSettings } from "./s3Types";' >> "${script_dirpath}/src/index.ts" echo "" >> "${script_dirpath}/src/index.ts" -echo 'export { type Base64, setClient, getVariable, setVariable, getResource, setResource, getResumeUrls, setState, getState, getIdToken, denoS3LightClientSettings, loadS3FileStream, loadS3File, writeS3File, task, runScript, runScriptAsync, runFlow, runFlowAsync, waitJob, getRootJobId, setFlowUserState, getFlowUserState, usernameToEmail, requestInteractiveSlackApproval} from "./client";' >> "${script_dirpath}/src/index.ts" +echo 'export { type Base64, setClient, getVariable, setVariable, getResource, setResource, getResumeUrls, setState, getState, getIdToken, denoS3LightClientSettings, loadS3FileStream, loadS3File, writeS3File, task, runScript, runScriptAsync, runFlow, runFlowAsync, waitJob, getRootJobId, setFlowUserState, getFlowUserState, usernameToEmail, requestInteractiveSlackApproval, requestInteractiveTeamsApproval} from "./client";' >> "${script_dirpath}/src/index.ts" diff --git a/typescript-client/build.sh b/typescript-client/build.sh index 6c80fb5677..908a4acd7e 100755 --- a/typescript-client/build.sh +++ b/typescript-client/build.sh @@ -39,4 +39,4 @@ cp "${script_dirpath}/s3Types.ts" "${script_dirpath}/src/" echo "" >> "${script_dirpath}/src/index.ts" echo 'export type { S3Object, DenoS3LightClientSettings } from "./s3Types";' >> "${script_dirpath}/src/index.ts" echo "" >> "${script_dirpath}/src/index.ts" -echo 'export { type Base64, setClient, getVariable, setVariable, getResource, setResource, getResumeUrls, setState, setProgress, getProgress, getState, getIdToken, denoS3LightClientSettings, loadS3FileStream, loadS3File, writeS3File, task, runScript, runScriptAsync, runFlow, runFlowAsync, waitJob, getRootJobId, setFlowUserState, getFlowUserState, usernameToEmail, requestInteractiveSlackApproval } from "./client";' >> "${script_dirpath}/src/index.ts" +echo 'export { type Base64, setClient, getVariable, setVariable, getResource, setResource, getResumeUrls, setState, setProgress, getProgress, getState, getIdToken, denoS3LightClientSettings, loadS3FileStream, loadS3File, writeS3File, task, runScript, runScriptAsync, runFlow, runFlowAsync, waitJob, getRootJobId, setFlowUserState, getFlowUserState, usernameToEmail, requestInteractiveSlackApproval, requestInteractiveTeamsApproval } from "./client";' >> "${script_dirpath}/src/index.ts" diff --git a/typescript-client/client.ts b/typescript-client/client.ts index 37fd4c9df6..1ef27a0a1b 100644 --- a/typescript-client/client.ts +++ b/typescript-client/client.ts @@ -892,6 +892,15 @@ interface SlackApprovalOptions { dynamicEnumsJson?: Record; } +interface TeamsApprovalOptions { + teamName: string; + channelName: string; + message?: string; + approver?: string; + defaultArgsJson?: Record; + dynamicEnumsJson?: Record; +} + /** * Sends an interactive approval request via Slack, allowing optional customization of the message, approver, and form fields. * @@ -984,6 +993,98 @@ export async function requestInteractiveSlackApproval({ }); } +/** + * Sends an interactive approval request via Teams, allowing optional customization of the message, approver, and form fields. + * + * **[Enterprise Edition Only]** To include form fields in the Teams approval request, go to **Advanced -> Suspend -> Form** + * and define a form. Learn more at [Windmill Documentation](https://www.windmill.dev/docs/flows/flow_approval#form). + * + * @param {Object} options - The configuration options for the Teams approval request. + * @param {string} options.teamName - The Teams team name where the approval request will be sent. + * @param {string} options.channelName - The Teams channel name where the approval request will be sent. + * @param {string} [options.message] - Optional custom message to include in the Teams approval request. + * @param {string} [options.approver] - Optional user ID or name of the approver for the request. + * @param {DefaultArgs} [options.defaultArgsJson] - Optional object defining or overriding the default arguments to a form field. + * @param {Enums} [options.dynamicEnumsJson] - Optional object overriding the enum default values of an enum form field. + * + * @returns {Promise} Resolves when the Teams approval request is successfully sent. + * + * @throws {Error} If the function is not called within a flow or flow preview. + * @throws {Error} If the `JobService.getTeamsApprovalPayload` call fails. + * + * **Usage Example:** + * ```typescript + * await requestInteractiveTeamsApproval({ + * teamName: "admins-teams", + * channelName: "admins-teams-channel", + * message: "Please approve this request", + * approver: "approver123", + * defaultArgsJson: { key1: "value1", key2: 42 }, + * dynamicEnumsJson: { foo: ["choice1", "choice2"], bar: ["optionA", "optionB"] }, + * }); + * ``` + * + * **Note:** This function requires execution within a Windmill flow or flow preview. + */ +export async function requestInteractiveTeamsApproval({ + teamName, + channelName, + message, + approver, + defaultArgsJson, + dynamicEnumsJson, +}: TeamsApprovalOptions): Promise { + const workspace = getWorkspace(); + const flowJobId = getEnv("WM_FLOW_JOB_ID"); + + if (!flowJobId) { + throw new Error( + "You can't use this function in a standalone script or flow step preview. Please use it in a flow or a flow preview." + ); + } + + const flowStepId = getEnv("WM_FLOW_STEP_ID"); + if (!flowStepId) { + throw new Error("This function can only be called as a flow step"); + } + + // Only include non-empty parameters + const params: { + approver?: string; + message?: string; + teamName: string; + channelName: string; + flowStepId: string; + defaultArgsJson?: string; + dynamicEnumsJson?: string; + } = { + teamName, + channelName, + flowStepId, + }; + + if (message) { + params.message = message; + } + if (approver) { + params.approver = approver; + } + + if (defaultArgsJson) { + params.defaultArgsJson = JSON.stringify(defaultArgsJson); + } + + if (dynamicEnumsJson) { + params.dynamicEnumsJson = JSON.stringify(dynamicEnumsJson); + } + + await JobService.getTeamsApprovalPayload({ + workspace, + ...params, + id: getEnv("WM_JOB_ID") ?? "NO_JOB_ID", + }); +} + async function getMockedApi(): Promise { if (mockedApi) { return mockedApi;