diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 23faa7b3fb..1d9fd7fc05 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -2004,6 +2004,33 @@ paths: 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: @@ -2066,6 +2093,40 @@ 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: + - $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: @@ -3381,7 +3442,7 @@ paths: post: summary: send update to Microsoft Teams activity description: Respond to a Microsoft Teams activity after a workspace command is run - operationId: updateActivity + operationId: sendMessageToConversation tags: - teams requestBody: @@ -3391,15 +3452,15 @@ paths: schema: type: object required: - - activity_id + - conversation_id - text properties: - activity_id: + conversation_id: type: string description: The ID of the Teams conversation/activity success: type: boolean - description: Indicates if the activity was successful and used for styling the card conditionally + description: Used for styling the card conditionally default: true text: type: string diff --git a/python-client/wmill/wmill/client.py b/python-client/wmill/wmill/client.py index cce02548e5..c81160887b 100644 --- a/python-client/wmill/wmill/client.py +++ b/python-client/wmill/wmill/client.py @@ -710,11 +710,11 @@ class Windmill: return self.get(f"/w/{self.workspace}/users/username_to_email/{username}").text - def update_teams_activity(self, activity_id: str, text: str, success: bool = True): + def send_teams_message(self, conversation_id: str, text: str, success: bool = True): """ - Send an update to a Microsoft Teams activity after a workspace command is run + Send a message to a Microsoft Teams conversation with conversation_id, where success is used to style the message """ - return self.post(f"/teams/activities", json={"activity_id": activity_id, "text": text, "success": success}) + return self.post(f"/teams/activities", json={"conversation_id": conversation_id, "text": text, "success": success}) def init_global_client(f): @@ -1076,8 +1076,8 @@ def request_interactive_slack_approval( ) @init_global_client -def update_teams_activity(activity_id: str, text: str, success: bool): - return _client.update_teams_activity(activity_id, text, success) +def send_teams_message(conversation_id: str, text: str, success: bool): + return _client.send_teams_message(conversation_id, text, success) @init_global_client def cancel_running() -> dict: