backend and clients

This commit is contained in:
Alexander Petric
2025-01-29 14:28:37 -05:00
parent 31f61ab7a2
commit 3f042a9d50
6 changed files with 50 additions and 0 deletions
+11
View File
@@ -708,6 +708,13 @@ class Windmill:
Indeed, in the viewer context WM_USERNAME is set to the username of the viewer but WM_EMAIL is set to the email of the creator of the app.
"""
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):
"""
Send an update to a Microsoft Teams activity after a workspace command is run
"""
return self.post(f"/teams/activities", json={"activity_id": activity_id, "text": text, "success": success})
def init_global_client(f):
@@ -1068,6 +1075,10 @@ def request_interactive_slack_approval(
dynamic_enums_json=dynamic_enums_json,
)
@init_global_client
def update_teams_activity(activity_id: str, text: str, success: bool):
return _client.update_teams_activity(activity_id, text, success)
@init_global_client
def cancel_running() -> dict:
"""Cancel currently running executions of the same script."""