universal-mcp-applications 0.1.30rc2__py3-none-any.whl → 0.1.36rc2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- universal_mcp/applications/ahrefs/app.py +52 -198
- universal_mcp/applications/airtable/app.py +23 -122
- universal_mcp/applications/apollo/app.py +111 -464
- universal_mcp/applications/asana/app.py +417 -1567
- universal_mcp/applications/aws_s3/app.py +36 -103
- universal_mcp/applications/bill/app.py +546 -1957
- universal_mcp/applications/box/app.py +1068 -3981
- universal_mcp/applications/braze/app.py +364 -1430
- universal_mcp/applications/browser_use/app.py +2 -8
- universal_mcp/applications/cal_com_v2/app.py +207 -625
- universal_mcp/applications/calendly/app.py +61 -200
- universal_mcp/applications/canva/app.py +45 -110
- universal_mcp/applications/clickup/app.py +207 -674
- universal_mcp/applications/coda/app.py +146 -426
- universal_mcp/applications/confluence/app.py +310 -1098
- universal_mcp/applications/contentful/app.py +36 -151
- universal_mcp/applications/crustdata/app.py +28 -107
- universal_mcp/applications/dialpad/app.py +283 -756
- universal_mcp/applications/digitalocean/app.py +1766 -5777
- universal_mcp/applications/domain_checker/app.py +3 -54
- universal_mcp/applications/e2b/app.py +14 -64
- universal_mcp/applications/elevenlabs/app.py +9 -47
- universal_mcp/applications/exa/app.py +6 -17
- universal_mcp/applications/falai/app.py +24 -101
- universal_mcp/applications/figma/app.py +53 -137
- universal_mcp/applications/file_system/app.py +2 -13
- universal_mcp/applications/firecrawl/app.py +51 -152
- universal_mcp/applications/fireflies/app.py +59 -281
- universal_mcp/applications/fpl/app.py +91 -528
- universal_mcp/applications/fpl/utils/fixtures.py +15 -49
- universal_mcp/applications/fpl/utils/helper.py +25 -89
- universal_mcp/applications/fpl/utils/league_utils.py +20 -64
- universal_mcp/applications/ghost_content/app.py +52 -161
- universal_mcp/applications/github/app.py +19 -56
- universal_mcp/applications/gong/app.py +88 -248
- universal_mcp/applications/google_calendar/app.py +16 -68
- universal_mcp/applications/google_docs/app.py +88 -188
- universal_mcp/applications/google_drive/app.py +141 -463
- universal_mcp/applications/google_gemini/app.py +12 -64
- universal_mcp/applications/google_mail/app.py +28 -157
- universal_mcp/applications/google_searchconsole/app.py +15 -48
- universal_mcp/applications/google_sheet/app.py +103 -580
- universal_mcp/applications/google_sheet/helper.py +10 -37
- universal_mcp/applications/hashnode/app.py +57 -269
- universal_mcp/applications/heygen/app.py +44 -122
- universal_mcp/applications/http_tools/app.py +10 -32
- universal_mcp/applications/hubspot/api_segments/crm_api.py +460 -1573
- universal_mcp/applications/hubspot/api_segments/marketing_api.py +74 -262
- universal_mcp/applications/hubspot/app.py +23 -87
- universal_mcp/applications/jira/app.py +2071 -7986
- universal_mcp/applications/klaviyo/app.py +494 -1376
- universal_mcp/applications/linkedin/README.md +9 -2
- universal_mcp/applications/linkedin/app.py +392 -212
- universal_mcp/applications/mailchimp/app.py +450 -1605
- universal_mcp/applications/markitdown/app.py +8 -20
- universal_mcp/applications/miro/app.py +217 -699
- universal_mcp/applications/ms_teams/app.py +64 -186
- universal_mcp/applications/neon/app.py +86 -192
- universal_mcp/applications/notion/app.py +21 -36
- universal_mcp/applications/onedrive/app.py +16 -38
- universal_mcp/applications/openai/app.py +42 -165
- universal_mcp/applications/outlook/app.py +24 -84
- universal_mcp/applications/perplexity/app.py +4 -19
- universal_mcp/applications/pipedrive/app.py +832 -3142
- universal_mcp/applications/posthog/app.py +163 -432
- universal_mcp/applications/reddit/app.py +40 -139
- universal_mcp/applications/resend/app.py +41 -107
- universal_mcp/applications/retell/app.py +14 -41
- universal_mcp/applications/rocketlane/app.py +221 -934
- universal_mcp/applications/scraper/README.md +7 -4
- universal_mcp/applications/scraper/app.py +216 -102
- universal_mcp/applications/semanticscholar/app.py +22 -64
- universal_mcp/applications/semrush/app.py +43 -77
- universal_mcp/applications/sendgrid/app.py +512 -1262
- universal_mcp/applications/sentry/app.py +271 -906
- universal_mcp/applications/serpapi/app.py +40 -143
- universal_mcp/applications/sharepoint/app.py +17 -39
- universal_mcp/applications/shopify/app.py +1551 -4287
- universal_mcp/applications/shortcut/app.py +155 -417
- universal_mcp/applications/slack/app.py +50 -101
- universal_mcp/applications/spotify/app.py +126 -325
- universal_mcp/applications/supabase/app.py +104 -213
- universal_mcp/applications/tavily/app.py +1 -1
- universal_mcp/applications/trello/app.py +693 -2656
- universal_mcp/applications/twilio/app.py +14 -50
- universal_mcp/applications/twitter/api_segments/compliance_api.py +4 -14
- universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +6 -18
- universal_mcp/applications/twitter/api_segments/likes_api.py +1 -3
- universal_mcp/applications/twitter/api_segments/lists_api.py +5 -15
- universal_mcp/applications/twitter/api_segments/trends_api.py +1 -3
- universal_mcp/applications/twitter/api_segments/tweets_api.py +9 -31
- universal_mcp/applications/twitter/api_segments/usage_api.py +1 -5
- universal_mcp/applications/twitter/api_segments/users_api.py +14 -42
- universal_mcp/applications/whatsapp/app.py +35 -186
- universal_mcp/applications/whatsapp/audio.py +2 -6
- universal_mcp/applications/whatsapp/whatsapp.py +17 -51
- universal_mcp/applications/whatsapp_business/app.py +70 -283
- universal_mcp/applications/wrike/app.py +45 -118
- universal_mcp/applications/yahoo_finance/app.py +19 -65
- universal_mcp/applications/youtube/app.py +75 -261
- universal_mcp/applications/zenquotes/app.py +2 -2
- {universal_mcp_applications-0.1.30rc2.dist-info → universal_mcp_applications-0.1.36rc2.dist-info}/METADATA +2 -2
- {universal_mcp_applications-0.1.30rc2.dist-info → universal_mcp_applications-0.1.36rc2.dist-info}/RECORD +105 -105
- {universal_mcp_applications-0.1.30rc2.dist-info → universal_mcp_applications-0.1.36rc2.dist-info}/WHEEL +0 -0
- {universal_mcp_applications-0.1.30rc2.dist-info → universal_mcp_applications-0.1.36rc2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from typing import Any
|
|
2
|
-
|
|
3
2
|
from universal_mcp.applications.application import APIApplication
|
|
4
3
|
from universal_mcp.integrations import Integration
|
|
5
4
|
|
|
@@ -11,20 +10,10 @@ class HeygenApp(APIApplication):
|
|
|
11
10
|
|
|
12
11
|
def _get_headers(self) -> dict[str, Any]:
|
|
13
12
|
credentials = self.integration.get_credentials()
|
|
14
|
-
api_key = (
|
|
15
|
-
|
|
16
|
-
or credentials.get("API_KEY")
|
|
17
|
-
or credentials.get("apiKey")
|
|
18
|
-
)
|
|
19
|
-
return {
|
|
20
|
-
"x-api-key": f"{api_key}",
|
|
21
|
-
"Content-Type": "application/json",
|
|
22
|
-
"Accept": "application/json",
|
|
23
|
-
}
|
|
13
|
+
api_key = credentials.get("api_key") or credentials.get("API_KEY") or credentials.get("apiKey")
|
|
14
|
+
return {"x-api-key": f"{api_key}", "Content-Type": "application/json", "Accept": "application/json"}
|
|
24
15
|
|
|
25
|
-
def get_v1_voice_list(
|
|
26
|
-
self,
|
|
27
|
-
) -> Any:
|
|
16
|
+
async def get_v1_voice_list(self) -> Any:
|
|
28
17
|
"""
|
|
29
18
|
Retrieves the list of available voices from the v1 voice API endpoint.
|
|
30
19
|
|
|
@@ -46,9 +35,7 @@ class HeygenApp(APIApplication):
|
|
|
46
35
|
response.raise_for_status()
|
|
47
36
|
return response.json()
|
|
48
37
|
|
|
49
|
-
def get_v1_avatar_list(
|
|
50
|
-
self,
|
|
51
|
-
) -> Any:
|
|
38
|
+
async def get_v1_avatar_list(self) -> Any:
|
|
52
39
|
"""
|
|
53
40
|
Retrieves a list of available avatars from the v1 API endpoint.
|
|
54
41
|
|
|
@@ -70,9 +57,7 @@ class HeygenApp(APIApplication):
|
|
|
70
57
|
response.raise_for_status()
|
|
71
58
|
return response.json()
|
|
72
59
|
|
|
73
|
-
def get_v2_voices(
|
|
74
|
-
self,
|
|
75
|
-
) -> Any:
|
|
60
|
+
async def get_v2_voices(self) -> Any:
|
|
76
61
|
"""
|
|
77
62
|
Retrieves the list of available v2 voices from the API endpoint.
|
|
78
63
|
|
|
@@ -94,9 +79,7 @@ class HeygenApp(APIApplication):
|
|
|
94
79
|
response.raise_for_status()
|
|
95
80
|
return response.json()
|
|
96
81
|
|
|
97
|
-
def get_v2_avatars(
|
|
98
|
-
self,
|
|
99
|
-
) -> Any:
|
|
82
|
+
async def get_v2_avatars(self) -> Any:
|
|
100
83
|
"""
|
|
101
84
|
Retrieves a list of avatar objects from the /v2/avatars API endpoint.
|
|
102
85
|
|
|
@@ -118,9 +101,7 @@ class HeygenApp(APIApplication):
|
|
|
118
101
|
response.raise_for_status()
|
|
119
102
|
return response.json()
|
|
120
103
|
|
|
121
|
-
def get_v1_video_list(
|
|
122
|
-
self,
|
|
123
|
-
) -> Any:
|
|
104
|
+
async def get_v1_video_list(self) -> Any:
|
|
124
105
|
"""
|
|
125
106
|
Retrieves a list of videos from the v1 API endpoint.
|
|
126
107
|
|
|
@@ -142,15 +123,7 @@ class HeygenApp(APIApplication):
|
|
|
142
123
|
response.raise_for_status()
|
|
143
124
|
return response.json()
|
|
144
125
|
|
|
145
|
-
def post_v2_video_generate(
|
|
146
|
-
self,
|
|
147
|
-
video_inputs,
|
|
148
|
-
title=None,
|
|
149
|
-
test=None,
|
|
150
|
-
callback_id=None,
|
|
151
|
-
dimension=None,
|
|
152
|
-
aspect_ratio=None,
|
|
153
|
-
) -> Any:
|
|
126
|
+
async def post_v2_video_generate(self, video_inputs, title=None, test=None, callback_id=None, dimension=None, aspect_ratio=None) -> Any:
|
|
154
127
|
"""
|
|
155
128
|
Submits a request to generate a video using specified input parameters via the v2 video generate API endpoint.
|
|
156
129
|
|
|
@@ -189,7 +162,7 @@ class HeygenApp(APIApplication):
|
|
|
189
162
|
response.raise_for_status()
|
|
190
163
|
return response.json()
|
|
191
164
|
|
|
192
|
-
def delete_v1_video(self, video_id=None) -> Any:
|
|
165
|
+
async def delete_v1_video(self, video_id=None) -> Any:
|
|
193
166
|
"""
|
|
194
167
|
Deletes a video using the v1 API endpoint with the specified video ID.
|
|
195
168
|
|
|
@@ -211,9 +184,7 @@ class HeygenApp(APIApplication):
|
|
|
211
184
|
response.raise_for_status()
|
|
212
185
|
return response.json()
|
|
213
186
|
|
|
214
|
-
def get_v2_templates(
|
|
215
|
-
self,
|
|
216
|
-
) -> Any:
|
|
187
|
+
async def get_v2_templates(self) -> Any:
|
|
217
188
|
"""
|
|
218
189
|
Retrieves the list of v2 templates from the API endpoint.
|
|
219
190
|
|
|
@@ -235,7 +206,7 @@ class HeygenApp(APIApplication):
|
|
|
235
206
|
response.raise_for_status()
|
|
236
207
|
return response.json()
|
|
237
208
|
|
|
238
|
-
def get_v2_template_by_id(self, id) -> Any:
|
|
209
|
+
async def get_v2_template_by_id(self, id) -> Any:
|
|
239
210
|
"""
|
|
240
211
|
Retrieves a v2 template resource by its unique identifier.
|
|
241
212
|
|
|
@@ -260,9 +231,7 @@ class HeygenApp(APIApplication):
|
|
|
260
231
|
response.raise_for_status()
|
|
261
232
|
return response.json()
|
|
262
233
|
|
|
263
|
-
def post_v2_template_generate_by_id(
|
|
264
|
-
self, id, title, variables, test=None, caption=None, dimension=None
|
|
265
|
-
) -> Any:
|
|
234
|
+
async def post_v2_template_generate_by_id(self, id, title, variables, test=None, caption=None, dimension=None) -> Any:
|
|
266
235
|
"""
|
|
267
236
|
Generates content from a template specified by ID using the provided title and variables, and returns the generation result.
|
|
268
237
|
|
|
@@ -290,13 +259,7 @@ class HeygenApp(APIApplication):
|
|
|
290
259
|
raise ValueError("Missing required parameter 'title'")
|
|
291
260
|
if variables is None:
|
|
292
261
|
raise ValueError("Missing required parameter 'variables'")
|
|
293
|
-
request_body = {
|
|
294
|
-
"title": title,
|
|
295
|
-
"variables": variables,
|
|
296
|
-
"test": test,
|
|
297
|
-
"caption": caption,
|
|
298
|
-
"dimension": dimension,
|
|
299
|
-
}
|
|
262
|
+
request_body = {"title": title, "variables": variables, "test": test, "caption": caption, "dimension": dimension}
|
|
300
263
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
301
264
|
url = f"{self.base_url}/v2/template/{id}/generate"
|
|
302
265
|
query_params = {}
|
|
@@ -304,9 +267,7 @@ class HeygenApp(APIApplication):
|
|
|
304
267
|
response.raise_for_status()
|
|
305
268
|
return response.json()
|
|
306
269
|
|
|
307
|
-
def get_v2_video_translate_target_languages(
|
|
308
|
-
self,
|
|
309
|
-
) -> Any:
|
|
270
|
+
async def get_v2_video_translate_target_languages(self) -> Any:
|
|
310
271
|
"""
|
|
311
272
|
Retrieves the list of supported target languages for video translation via the v2 API.
|
|
312
273
|
|
|
@@ -328,14 +289,7 @@ class HeygenApp(APIApplication):
|
|
|
328
289
|
response.raise_for_status()
|
|
329
290
|
return response.json()
|
|
330
291
|
|
|
331
|
-
def post_v2_video_translate(
|
|
332
|
-
self,
|
|
333
|
-
video_url,
|
|
334
|
-
output_language,
|
|
335
|
-
title=None,
|
|
336
|
-
translate_audio_only=None,
|
|
337
|
-
speaker_num=None,
|
|
338
|
-
) -> Any:
|
|
292
|
+
async def post_v2_video_translate(self, video_url, output_language, title=None, translate_audio_only=None, speaker_num=None) -> Any:
|
|
339
293
|
"""
|
|
340
294
|
Submits a video translation request and returns the API response as JSON.
|
|
341
295
|
|
|
@@ -374,7 +328,7 @@ class HeygenApp(APIApplication):
|
|
|
374
328
|
response.raise_for_status()
|
|
375
329
|
return response.json()
|
|
376
330
|
|
|
377
|
-
def get_v2_video_translate_status_by_id(self, id) -> Any:
|
|
331
|
+
async def get_v2_video_translate_status_by_id(self, id) -> Any:
|
|
378
332
|
"""
|
|
379
333
|
Retrieves the status of a video translation job by its unique identifier.
|
|
380
334
|
|
|
@@ -399,7 +353,7 @@ class HeygenApp(APIApplication):
|
|
|
399
353
|
response.raise_for_status()
|
|
400
354
|
return response.json()
|
|
401
355
|
|
|
402
|
-
def post_streaming_new(self, quality=None) -> Any:
|
|
356
|
+
async def post_streaming_new(self, quality=None) -> Any:
|
|
403
357
|
"""
|
|
404
358
|
Initiates a new streaming session with optional quality parameter and returns the server's JSON response.
|
|
405
359
|
|
|
@@ -415,9 +369,7 @@ class HeygenApp(APIApplication):
|
|
|
415
369
|
Tags:
|
|
416
370
|
post, streaming, async-job, start, api
|
|
417
371
|
"""
|
|
418
|
-
request_body = {
|
|
419
|
-
"quality": quality,
|
|
420
|
-
}
|
|
372
|
+
request_body = {"quality": quality}
|
|
421
373
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
422
374
|
url = f"{self.base_url}/v1/streaming.new"
|
|
423
375
|
query_params = {}
|
|
@@ -425,9 +377,7 @@ class HeygenApp(APIApplication):
|
|
|
425
377
|
response.raise_for_status()
|
|
426
378
|
return response.json()
|
|
427
379
|
|
|
428
|
-
def get_streaming_list(
|
|
429
|
-
self,
|
|
430
|
-
) -> Any:
|
|
380
|
+
async def get_streaming_list(self) -> Any:
|
|
431
381
|
"""
|
|
432
382
|
Retrieves the list of available streaming resources from the remote API.
|
|
433
383
|
|
|
@@ -449,7 +399,7 @@ class HeygenApp(APIApplication):
|
|
|
449
399
|
response.raise_for_status()
|
|
450
400
|
return response.json()
|
|
451
401
|
|
|
452
|
-
def post_streaming_ice(self, session_id, candidate) -> Any:
|
|
402
|
+
async def post_streaming_ice(self, session_id, candidate) -> Any:
|
|
453
403
|
"""
|
|
454
404
|
Sends an ICE candidate for a streaming session to the server and returns the JSON response.
|
|
455
405
|
|
|
@@ -471,10 +421,7 @@ class HeygenApp(APIApplication):
|
|
|
471
421
|
raise ValueError("Missing required parameter 'session_id'")
|
|
472
422
|
if candidate is None:
|
|
473
423
|
raise ValueError("Missing required parameter 'candidate'")
|
|
474
|
-
request_body = {
|
|
475
|
-
"session_id": session_id,
|
|
476
|
-
"candidate": candidate,
|
|
477
|
-
}
|
|
424
|
+
request_body = {"session_id": session_id, "candidate": candidate}
|
|
478
425
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
479
426
|
url = f"{self.base_url}/v1/streaming.ice"
|
|
480
427
|
query_params = {}
|
|
@@ -482,7 +429,7 @@ class HeygenApp(APIApplication):
|
|
|
482
429
|
response.raise_for_status()
|
|
483
430
|
return response.json()
|
|
484
431
|
|
|
485
|
-
def post_streaming_task(self, session_id, text) -> Any:
|
|
432
|
+
async def post_streaming_task(self, session_id, text) -> Any:
|
|
486
433
|
"""
|
|
487
434
|
Submits a streaming task for the specified session and text input, returning the response from the remote API.
|
|
488
435
|
|
|
@@ -504,10 +451,7 @@ class HeygenApp(APIApplication):
|
|
|
504
451
|
raise ValueError("Missing required parameter 'session_id'")
|
|
505
452
|
if text is None:
|
|
506
453
|
raise ValueError("Missing required parameter 'text'")
|
|
507
|
-
request_body = {
|
|
508
|
-
"session_id": session_id,
|
|
509
|
-
"text": text,
|
|
510
|
-
}
|
|
454
|
+
request_body = {"session_id": session_id, "text": text}
|
|
511
455
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
512
456
|
url = f"{self.base_url}/v1/streaming.task"
|
|
513
457
|
query_params = {}
|
|
@@ -515,7 +459,7 @@ class HeygenApp(APIApplication):
|
|
|
515
459
|
response.raise_for_status()
|
|
516
460
|
return response.json()
|
|
517
461
|
|
|
518
|
-
def post_streaming_stop(self, session_id) -> Any:
|
|
462
|
+
async def post_streaming_stop(self, session_id) -> Any:
|
|
519
463
|
"""
|
|
520
464
|
Stops an ongoing streaming session by sending a stop request for the specified session ID.
|
|
521
465
|
|
|
@@ -534,9 +478,7 @@ class HeygenApp(APIApplication):
|
|
|
534
478
|
"""
|
|
535
479
|
if session_id is None:
|
|
536
480
|
raise ValueError("Missing required parameter 'session_id'")
|
|
537
|
-
request_body = {
|
|
538
|
-
"session_id": session_id,
|
|
539
|
-
}
|
|
481
|
+
request_body = {"session_id": session_id}
|
|
540
482
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
541
483
|
url = f"{self.base_url}/v1/streaming.stop"
|
|
542
484
|
query_params = {}
|
|
@@ -544,7 +486,7 @@ class HeygenApp(APIApplication):
|
|
|
544
486
|
response.raise_for_status()
|
|
545
487
|
return response.json()
|
|
546
488
|
|
|
547
|
-
def post_streaming_interrupt(self, session_id) -> Any:
|
|
489
|
+
async def post_streaming_interrupt(self, session_id) -> Any:
|
|
548
490
|
"""
|
|
549
491
|
Sends a request to interrupt an active streaming session identified by the given session ID.
|
|
550
492
|
|
|
@@ -563,9 +505,7 @@ class HeygenApp(APIApplication):
|
|
|
563
505
|
"""
|
|
564
506
|
if session_id is None:
|
|
565
507
|
raise ValueError("Missing required parameter 'session_id'")
|
|
566
|
-
request_body = {
|
|
567
|
-
"session_id": session_id,
|
|
568
|
-
}
|
|
508
|
+
request_body = {"session_id": session_id}
|
|
569
509
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
570
510
|
url = f"{self.base_url}/v1/streaming.interrupt"
|
|
571
511
|
query_params = {}
|
|
@@ -573,7 +513,7 @@ class HeygenApp(APIApplication):
|
|
|
573
513
|
response.raise_for_status()
|
|
574
514
|
return response.json()
|
|
575
515
|
|
|
576
|
-
def post_streaming_create_token(self, expiry=None) -> Any:
|
|
516
|
+
async def post_streaming_create_token(self, expiry=None) -> Any:
|
|
577
517
|
"""
|
|
578
518
|
Creates a new streaming token with an optional expiry time by sending a POST request to the streaming token API endpoint.
|
|
579
519
|
|
|
@@ -589,9 +529,7 @@ class HeygenApp(APIApplication):
|
|
|
589
529
|
Tags:
|
|
590
530
|
create, streaming, token, api
|
|
591
531
|
"""
|
|
592
|
-
request_body = {
|
|
593
|
-
"expiry": expiry,
|
|
594
|
-
}
|
|
532
|
+
request_body = {"expiry": expiry}
|
|
595
533
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
596
534
|
url = f"{self.base_url}/v1/streaming.create_token"
|
|
597
535
|
query_params = {}
|
|
@@ -599,9 +537,7 @@ class HeygenApp(APIApplication):
|
|
|
599
537
|
response.raise_for_status()
|
|
600
538
|
return response.json()
|
|
601
539
|
|
|
602
|
-
def get_streaming_avatar_list(
|
|
603
|
-
self,
|
|
604
|
-
) -> Any:
|
|
540
|
+
async def get_streaming_avatar_list(self) -> Any:
|
|
605
541
|
"""
|
|
606
542
|
Retrieves a list of available streaming avatars from the API endpoint.
|
|
607
543
|
|
|
@@ -623,9 +559,7 @@ class HeygenApp(APIApplication):
|
|
|
623
559
|
response.raise_for_status()
|
|
624
560
|
return response.json()
|
|
625
561
|
|
|
626
|
-
def get_v1_webhook_list(
|
|
627
|
-
self,
|
|
628
|
-
) -> Any:
|
|
562
|
+
async def get_v1_webhook_list(self) -> Any:
|
|
629
563
|
"""
|
|
630
564
|
Retrieves a list of all registered webhooks via the v1 API endpoint.
|
|
631
565
|
|
|
@@ -647,7 +581,7 @@ class HeygenApp(APIApplication):
|
|
|
647
581
|
response.raise_for_status()
|
|
648
582
|
return response.json()
|
|
649
583
|
|
|
650
|
-
def post_v1_webhook_endpoint_add(self, url, events) -> Any:
|
|
584
|
+
async def post_v1_webhook_endpoint_add(self, url, events) -> Any:
|
|
651
585
|
"""
|
|
652
586
|
Registers a new webhook endpoint with the specified URL and events.
|
|
653
587
|
|
|
@@ -669,10 +603,7 @@ class HeygenApp(APIApplication):
|
|
|
669
603
|
raise ValueError("Missing required parameter 'url'")
|
|
670
604
|
if events is None:
|
|
671
605
|
raise ValueError("Missing required parameter 'events'")
|
|
672
|
-
request_body = {
|
|
673
|
-
"url": url,
|
|
674
|
-
"events": events,
|
|
675
|
-
}
|
|
606
|
+
request_body = {"url": url, "events": events}
|
|
676
607
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
677
608
|
url = f"{self.base_url}/v1/webhook/endpoint.add"
|
|
678
609
|
query_params = {}
|
|
@@ -680,7 +611,7 @@ class HeygenApp(APIApplication):
|
|
|
680
611
|
response.raise_for_status()
|
|
681
612
|
return response.json()
|
|
682
613
|
|
|
683
|
-
def delete_v1_webhook_endpoint_by_id(self, endpoint_id) -> Any:
|
|
614
|
+
async def delete_v1_webhook_endpoint_by_id(self, endpoint_id) -> Any:
|
|
684
615
|
"""
|
|
685
616
|
Deletes a webhook endpoint identified by its ID via a DELETE request to the v1 API.
|
|
686
617
|
|
|
@@ -705,9 +636,7 @@ class HeygenApp(APIApplication):
|
|
|
705
636
|
response.raise_for_status()
|
|
706
637
|
return response.json()
|
|
707
638
|
|
|
708
|
-
def get_v1_webhook_endpoint_list(
|
|
709
|
-
self,
|
|
710
|
-
) -> Any:
|
|
639
|
+
async def get_v1_webhook_endpoint_list(self) -> Any:
|
|
711
640
|
"""
|
|
712
641
|
Retrieves a list of webhook endpoints from the v1 API.
|
|
713
642
|
|
|
@@ -729,9 +658,7 @@ class HeygenApp(APIApplication):
|
|
|
729
658
|
response.raise_for_status()
|
|
730
659
|
return response.json()
|
|
731
660
|
|
|
732
|
-
def get_v1_talking_photo_list(
|
|
733
|
-
self,
|
|
734
|
-
) -> Any:
|
|
661
|
+
async def get_v1_talking_photo_list(self) -> Any:
|
|
735
662
|
"""
|
|
736
663
|
Retrieves the list of talking photos from the v1 API endpoint.
|
|
737
664
|
|
|
@@ -753,7 +680,7 @@ class HeygenApp(APIApplication):
|
|
|
753
680
|
response.raise_for_status()
|
|
754
681
|
return response.json()
|
|
755
682
|
|
|
756
|
-
def delete_v2_talking_photo_by_id(self, id) -> Any:
|
|
683
|
+
async def delete_v2_talking_photo_by_id(self, id) -> Any:
|
|
757
684
|
"""
|
|
758
685
|
Deletes a v2 talking photo resource identified by its unique ID.
|
|
759
686
|
|
|
@@ -778,7 +705,7 @@ class HeygenApp(APIApplication):
|
|
|
778
705
|
response.raise_for_status()
|
|
779
706
|
return response.json()
|
|
780
707
|
|
|
781
|
-
def post_personalized_video_add_contact(self, project_id, variables_list) -> Any:
|
|
708
|
+
async def post_personalized_video_add_contact(self, project_id, variables_list) -> Any:
|
|
782
709
|
"""
|
|
783
710
|
Adds a new contact to a personalized video project by sending the contact variables to the server.
|
|
784
711
|
|
|
@@ -800,10 +727,7 @@ class HeygenApp(APIApplication):
|
|
|
800
727
|
raise ValueError("Missing required parameter 'project_id'")
|
|
801
728
|
if variables_list is None:
|
|
802
729
|
raise ValueError("Missing required parameter 'variables_list'")
|
|
803
|
-
request_body = {
|
|
804
|
-
"project_id": project_id,
|
|
805
|
-
"variables_list": variables_list,
|
|
806
|
-
}
|
|
730
|
+
request_body = {"project_id": project_id, "variables_list": variables_list}
|
|
807
731
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
808
732
|
url = f"{self.base_url}/v1/personalized_video/add_contact"
|
|
809
733
|
query_params = {}
|
|
@@ -811,7 +735,7 @@ class HeygenApp(APIApplication):
|
|
|
811
735
|
response.raise_for_status()
|
|
812
736
|
return response.json()
|
|
813
737
|
|
|
814
|
-
def get_personalized_video_audience_detail(self, id=None) -> Any:
|
|
738
|
+
async def get_personalized_video_audience_detail(self, id=None) -> Any:
|
|
815
739
|
"""
|
|
816
740
|
Retrieves detailed information about a personalized video audience by ID.
|
|
817
741
|
|
|
@@ -833,7 +757,7 @@ class HeygenApp(APIApplication):
|
|
|
833
757
|
response.raise_for_status()
|
|
834
758
|
return response.json()
|
|
835
759
|
|
|
836
|
-
def get_personalized_video_project_detail(self, id=None) -> Any:
|
|
760
|
+
async def get_personalized_video_project_detail(self, id=None) -> Any:
|
|
837
761
|
"""
|
|
838
762
|
Retrieves the details of a personalized video project by its unique identifier.
|
|
839
763
|
|
|
@@ -855,9 +779,7 @@ class HeygenApp(APIApplication):
|
|
|
855
779
|
response.raise_for_status()
|
|
856
780
|
return response.json()
|
|
857
781
|
|
|
858
|
-
def get_v2_user_remaining_quota(
|
|
859
|
-
self,
|
|
860
|
-
) -> Any:
|
|
782
|
+
async def get_v2_user_remaining_quota(self) -> Any:
|
|
861
783
|
"""
|
|
862
784
|
Retrieves the current remaining quota information for the user from the v2 API endpoint.
|
|
863
785
|
|
|
@@ -879,7 +801,7 @@ class HeygenApp(APIApplication):
|
|
|
879
801
|
response.raise_for_status()
|
|
880
802
|
return response.json()
|
|
881
803
|
|
|
882
|
-
def post_v1_asset_upload(self, request_body=None) -> Any:
|
|
804
|
+
async def post_v1_asset_upload(self, request_body=None) -> Any:
|
|
883
805
|
"""
|
|
884
806
|
Uploads an asset to the server using a POST request to the '/v1/asset' endpoint.
|
|
885
807
|
|
|
@@ -901,7 +823,7 @@ class HeygenApp(APIApplication):
|
|
|
901
823
|
response.raise_for_status()
|
|
902
824
|
return response.json()
|
|
903
825
|
|
|
904
|
-
def get_v1_video_status(self, video_id=None) -> Any:
|
|
826
|
+
async def get_v1_video_status(self, video_id=None) -> Any:
|
|
905
827
|
"""
|
|
906
828
|
Retrieves the status of a video by making a GET request to the v1 video_status endpoint.
|
|
907
829
|
|
|
@@ -24,18 +24,10 @@ class HttpToolsApp(APIApplication):
|
|
|
24
24
|
try:
|
|
25
25
|
return response.json()
|
|
26
26
|
except Exception:
|
|
27
|
-
logger.warning(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"text": response.text,
|
|
32
|
-
"status_code": response.status_code,
|
|
33
|
-
"headers": dict(response.headers),
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
def http_get(
|
|
37
|
-
self, url: str, headers: dict | None = None, query_params: dict | None = None
|
|
38
|
-
):
|
|
27
|
+
logger.warning(f"Response is not JSON, returning text. Content-Type: {response.headers.get('content-type')}")
|
|
28
|
+
return {"text": response.text, "status_code": response.status_code, "headers": dict(response.headers)}
|
|
29
|
+
|
|
30
|
+
async def http_get(self, url: str, headers: dict | None = None, query_params: dict | None = None):
|
|
39
31
|
"""
|
|
40
32
|
Executes an HTTP GET request to a given URL with optional headers and query parameters. It handles HTTP errors by raising an exception and processes the response, returning parsed JSON or a dictionary with the raw text and status details if JSON is unavailable.
|
|
41
33
|
|
|
@@ -49,16 +41,12 @@ class HttpToolsApp(APIApplication):
|
|
|
49
41
|
Tags:
|
|
50
42
|
get, important
|
|
51
43
|
"""
|
|
52
|
-
logger.debug(
|
|
53
|
-
f"GET request to {url} with headers {headers} and query params {query_params}"
|
|
54
|
-
)
|
|
44
|
+
logger.debug(f"GET request to {url} with headers {headers} and query params {query_params}")
|
|
55
45
|
response = httpx.get(url, params=query_params, headers=headers)
|
|
56
46
|
response.raise_for_status()
|
|
57
47
|
return self._handle_response(response)
|
|
58
48
|
|
|
59
|
-
def http_post(
|
|
60
|
-
self, url: str, headers: dict | None = None, body: dict | None = None
|
|
61
|
-
):
|
|
49
|
+
async def http_post(self, url: str, headers: dict | None = None, body: dict | None = None):
|
|
62
50
|
"""
|
|
63
51
|
Sends an HTTP POST request to a URL with an optional JSON body and headers. It returns the parsed JSON response or raw text if parsing fails and raises an exception for HTTP errors. It is used for creating new resources, unlike http_get which retrieves data.
|
|
64
52
|
|
|
@@ -77,7 +65,7 @@ class HttpToolsApp(APIApplication):
|
|
|
77
65
|
response.raise_for_status()
|
|
78
66
|
return self._handle_response(response)
|
|
79
67
|
|
|
80
|
-
def http_put(self, url: str, headers: dict | None = None, body: dict | None = None):
|
|
68
|
+
async def http_put(self, url: str, headers: dict | None = None, body: dict | None = None):
|
|
81
69
|
"""
|
|
82
70
|
Performs an HTTP PUT request to update or replace a resource at a specified URL. It accepts an optional JSON body and headers, raises an exception for error responses, and returns the parsed JSON response or a dictionary with the raw text and status details.
|
|
83
71
|
|
|
@@ -96,9 +84,7 @@ class HttpToolsApp(APIApplication):
|
|
|
96
84
|
response.raise_for_status()
|
|
97
85
|
return self._handle_response(response)
|
|
98
86
|
|
|
99
|
-
def http_delete(
|
|
100
|
-
self, url: str, headers: dict | None = None, body: dict | None = None
|
|
101
|
-
):
|
|
87
|
+
async def http_delete(self, url: str, headers: dict | None = None, body: dict | None = None):
|
|
102
88
|
"""
|
|
103
89
|
Sends an HTTP DELETE request to a URL with optional headers and a JSON body. Raises an exception for HTTP error statuses and returns the parsed JSON response. If the response isn't JSON, it returns the text content, status code, and headers.
|
|
104
90
|
|
|
@@ -117,9 +103,7 @@ class HttpToolsApp(APIApplication):
|
|
|
117
103
|
response.raise_for_status()
|
|
118
104
|
return self._handle_response(response)
|
|
119
105
|
|
|
120
|
-
def http_patch(
|
|
121
|
-
self, url: str, headers: dict | None = None, body: dict | None = None
|
|
122
|
-
):
|
|
106
|
+
async def http_patch(self, url: str, headers: dict | None = None, body: dict | None = None):
|
|
123
107
|
"""
|
|
124
108
|
Sends an HTTP PATCH request to apply partial modifications to a resource at a given URL. It accepts optional headers and a JSON body. It returns the parsed JSON response, or the raw text with status details if the response is not valid JSON.
|
|
125
109
|
|
|
@@ -144,10 +128,4 @@ class HttpToolsApp(APIApplication):
|
|
|
144
128
|
Tags:
|
|
145
129
|
list, important
|
|
146
130
|
"""
|
|
147
|
-
return [
|
|
148
|
-
self.http_get,
|
|
149
|
-
self.http_post,
|
|
150
|
-
self.http_put,
|
|
151
|
-
self.http_delete,
|
|
152
|
-
self.http_patch,
|
|
153
|
-
]
|
|
131
|
+
return [self.http_get, self.http_post, self.http_put, self.http_delete, self.http_patch]
|