universal-mcp-applications 0.1.1__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.
Files changed (268) hide show
  1. universal_mcp/applications/ahrefs/README.md +51 -0
  2. universal_mcp/applications/ahrefs/__init__.py +1 -0
  3. universal_mcp/applications/ahrefs/app.py +2291 -0
  4. universal_mcp/applications/airtable/README.md +22 -0
  5. universal_mcp/applications/airtable/__init__.py +1 -0
  6. universal_mcp/applications/airtable/app.py +479 -0
  7. universal_mcp/applications/apollo/README.md +44 -0
  8. universal_mcp/applications/apollo/__init__.py +1 -0
  9. universal_mcp/applications/apollo/app.py +1847 -0
  10. universal_mcp/applications/asana/README.md +199 -0
  11. universal_mcp/applications/asana/__init__.py +1 -0
  12. universal_mcp/applications/asana/app.py +9509 -0
  13. universal_mcp/applications/aws-s3/README.md +0 -0
  14. universal_mcp/applications/aws-s3/__init__.py +1 -0
  15. universal_mcp/applications/aws-s3/app.py +552 -0
  16. universal_mcp/applications/bill/README.md +0 -0
  17. universal_mcp/applications/bill/__init__.py +1 -0
  18. universal_mcp/applications/bill/app.py +8705 -0
  19. universal_mcp/applications/box/README.md +307 -0
  20. universal_mcp/applications/box/__init__.py +1 -0
  21. universal_mcp/applications/box/app.py +15987 -0
  22. universal_mcp/applications/braze/README.md +106 -0
  23. universal_mcp/applications/braze/__init__.py +1 -0
  24. universal_mcp/applications/braze/app.py +4754 -0
  25. universal_mcp/applications/cal-com-v2/README.md +150 -0
  26. universal_mcp/applications/cal-com-v2/__init__.py +1 -0
  27. universal_mcp/applications/cal-com-v2/app.py +5541 -0
  28. universal_mcp/applications/calendly/README.md +53 -0
  29. universal_mcp/applications/calendly/__init__.py +1 -0
  30. universal_mcp/applications/calendly/app.py +1436 -0
  31. universal_mcp/applications/canva/README.md +43 -0
  32. universal_mcp/applications/canva/__init__.py +1 -0
  33. universal_mcp/applications/canva/app.py +941 -0
  34. universal_mcp/applications/clickup/README.md +135 -0
  35. universal_mcp/applications/clickup/__init__.py +1 -0
  36. universal_mcp/applications/clickup/app.py +5009 -0
  37. universal_mcp/applications/coda/README.md +108 -0
  38. universal_mcp/applications/coda/__init__.py +1 -0
  39. universal_mcp/applications/coda/app.py +3671 -0
  40. universal_mcp/applications/confluence/README.md +198 -0
  41. universal_mcp/applications/confluence/__init__.py +1 -0
  42. universal_mcp/applications/confluence/app.py +6273 -0
  43. universal_mcp/applications/contentful/README.md +17 -0
  44. universal_mcp/applications/contentful/__init__.py +1 -0
  45. universal_mcp/applications/contentful/app.py +364 -0
  46. universal_mcp/applications/crustdata/README.md +25 -0
  47. universal_mcp/applications/crustdata/__init__.py +1 -0
  48. universal_mcp/applications/crustdata/app.py +586 -0
  49. universal_mcp/applications/dialpad/README.md +202 -0
  50. universal_mcp/applications/dialpad/__init__.py +1 -0
  51. universal_mcp/applications/dialpad/app.py +5949 -0
  52. universal_mcp/applications/digitalocean/README.md +463 -0
  53. universal_mcp/applications/digitalocean/__init__.py +1 -0
  54. universal_mcp/applications/digitalocean/app.py +20835 -0
  55. universal_mcp/applications/domain-checker/README.md +13 -0
  56. universal_mcp/applications/domain-checker/__init__.py +1 -0
  57. universal_mcp/applications/domain-checker/app.py +265 -0
  58. universal_mcp/applications/e2b/README.md +12 -0
  59. universal_mcp/applications/e2b/__init__.py +1 -0
  60. universal_mcp/applications/e2b/app.py +187 -0
  61. universal_mcp/applications/elevenlabs/README.md +88 -0
  62. universal_mcp/applications/elevenlabs/__init__.py +1 -0
  63. universal_mcp/applications/elevenlabs/app.py +3235 -0
  64. universal_mcp/applications/exa/README.md +15 -0
  65. universal_mcp/applications/exa/__init__.py +1 -0
  66. universal_mcp/applications/exa/app.py +221 -0
  67. universal_mcp/applications/falai/README.md +17 -0
  68. universal_mcp/applications/falai/__init__.py +1 -0
  69. universal_mcp/applications/falai/app.py +331 -0
  70. universal_mcp/applications/figma/README.md +49 -0
  71. universal_mcp/applications/figma/__init__.py +1 -0
  72. universal_mcp/applications/figma/app.py +1090 -0
  73. universal_mcp/applications/firecrawl/README.md +20 -0
  74. universal_mcp/applications/firecrawl/__init__.py +1 -0
  75. universal_mcp/applications/firecrawl/app.py +514 -0
  76. universal_mcp/applications/fireflies/README.md +25 -0
  77. universal_mcp/applications/fireflies/__init__.py +1 -0
  78. universal_mcp/applications/fireflies/app.py +506 -0
  79. universal_mcp/applications/fpl/README.md +23 -0
  80. universal_mcp/applications/fpl/__init__.py +1 -0
  81. universal_mcp/applications/fpl/app.py +1327 -0
  82. universal_mcp/applications/fpl/utils/api.py +142 -0
  83. universal_mcp/applications/fpl/utils/fixtures.py +629 -0
  84. universal_mcp/applications/fpl/utils/helper.py +982 -0
  85. universal_mcp/applications/fpl/utils/league_utils.py +546 -0
  86. universal_mcp/applications/fpl/utils/position_utils.py +68 -0
  87. universal_mcp/applications/ghost-content/README.md +25 -0
  88. universal_mcp/applications/ghost-content/__init__.py +1 -0
  89. universal_mcp/applications/ghost-content/app.py +654 -0
  90. universal_mcp/applications/github/README.md +1049 -0
  91. universal_mcp/applications/github/__init__.py +1 -0
  92. universal_mcp/applications/github/app.py +50600 -0
  93. universal_mcp/applications/gong/README.md +63 -0
  94. universal_mcp/applications/gong/__init__.py +1 -0
  95. universal_mcp/applications/gong/app.py +2297 -0
  96. universal_mcp/applications/google-ads/README.md +0 -0
  97. universal_mcp/applications/google-ads/__init__.py +1 -0
  98. universal_mcp/applications/google-ads/app.py +23 -0
  99. universal_mcp/applications/google-calendar/README.md +21 -0
  100. universal_mcp/applications/google-calendar/__init__.py +1 -0
  101. universal_mcp/applications/google-calendar/app.py +574 -0
  102. universal_mcp/applications/google-docs/README.md +25 -0
  103. universal_mcp/applications/google-docs/__init__.py +1 -0
  104. universal_mcp/applications/google-docs/app.py +760 -0
  105. universal_mcp/applications/google-drive/README.md +68 -0
  106. universal_mcp/applications/google-drive/__init__.py +1 -0
  107. universal_mcp/applications/google-drive/app.py +4936 -0
  108. universal_mcp/applications/google-gemini/README.md +25 -0
  109. universal_mcp/applications/google-gemini/__init__.py +1 -0
  110. universal_mcp/applications/google-gemini/app.py +663 -0
  111. universal_mcp/applications/google-mail/README.md +31 -0
  112. universal_mcp/applications/google-mail/__init__.py +1 -0
  113. universal_mcp/applications/google-mail/app.py +1354 -0
  114. universal_mcp/applications/google-searchconsole/README.md +21 -0
  115. universal_mcp/applications/google-searchconsole/__init__.py +1 -0
  116. universal_mcp/applications/google-searchconsole/app.py +320 -0
  117. universal_mcp/applications/google-sheet/README.md +36 -0
  118. universal_mcp/applications/google-sheet/__init__.py +1 -0
  119. universal_mcp/applications/google-sheet/app.py +1941 -0
  120. universal_mcp/applications/hashnode/README.md +20 -0
  121. universal_mcp/applications/hashnode/__init__.py +1 -0
  122. universal_mcp/applications/hashnode/app.py +455 -0
  123. universal_mcp/applications/heygen/README.md +44 -0
  124. universal_mcp/applications/heygen/__init__.py +1 -0
  125. universal_mcp/applications/heygen/app.py +961 -0
  126. universal_mcp/applications/http-tools/README.md +16 -0
  127. universal_mcp/applications/http-tools/__init__.py +1 -0
  128. universal_mcp/applications/http-tools/app.py +153 -0
  129. universal_mcp/applications/hubspot/README.md +239 -0
  130. universal_mcp/applications/hubspot/__init__.py +1 -0
  131. universal_mcp/applications/hubspot/app.py +416 -0
  132. universal_mcp/applications/jira/README.md +600 -0
  133. universal_mcp/applications/jira/__init__.py +1 -0
  134. universal_mcp/applications/jira/app.py +28804 -0
  135. universal_mcp/applications/klaviyo/README.md +313 -0
  136. universal_mcp/applications/klaviyo/__init__.py +1 -0
  137. universal_mcp/applications/klaviyo/app.py +11236 -0
  138. universal_mcp/applications/linkedin/README.md +15 -0
  139. universal_mcp/applications/linkedin/__init__.py +1 -0
  140. universal_mcp/applications/linkedin/app.py +243 -0
  141. universal_mcp/applications/mailchimp/README.md +281 -0
  142. universal_mcp/applications/mailchimp/__init__.py +1 -0
  143. universal_mcp/applications/mailchimp/app.py +10937 -0
  144. universal_mcp/applications/markitdown/README.md +12 -0
  145. universal_mcp/applications/markitdown/__init__.py +1 -0
  146. universal_mcp/applications/markitdown/app.py +63 -0
  147. universal_mcp/applications/miro/README.md +151 -0
  148. universal_mcp/applications/miro/__init__.py +1 -0
  149. universal_mcp/applications/miro/app.py +5429 -0
  150. universal_mcp/applications/ms-teams/README.md +42 -0
  151. universal_mcp/applications/ms-teams/__init__.py +1 -0
  152. universal_mcp/applications/ms-teams/app.py +1823 -0
  153. universal_mcp/applications/neon/README.md +74 -0
  154. universal_mcp/applications/neon/__init__.py +1 -0
  155. universal_mcp/applications/neon/app.py +2018 -0
  156. universal_mcp/applications/notion/README.md +30 -0
  157. universal_mcp/applications/notion/__init__.py +1 -0
  158. universal_mcp/applications/notion/app.py +527 -0
  159. universal_mcp/applications/openai/README.md +22 -0
  160. universal_mcp/applications/openai/__init__.py +1 -0
  161. universal_mcp/applications/openai/app.py +759 -0
  162. universal_mcp/applications/outlook/README.md +20 -0
  163. universal_mcp/applications/outlook/__init__.py +1 -0
  164. universal_mcp/applications/outlook/app.py +444 -0
  165. universal_mcp/applications/perplexity/README.md +12 -0
  166. universal_mcp/applications/perplexity/__init__.py +1 -0
  167. universal_mcp/applications/perplexity/app.py +65 -0
  168. universal_mcp/applications/pipedrive/README.md +284 -0
  169. universal_mcp/applications/pipedrive/__init__.py +1 -0
  170. universal_mcp/applications/pipedrive/app.py +12924 -0
  171. universal_mcp/applications/posthog/README.md +132 -0
  172. universal_mcp/applications/posthog/__init__.py +1 -0
  173. universal_mcp/applications/posthog/app.py +7125 -0
  174. universal_mcp/applications/reddit/README.md +135 -0
  175. universal_mcp/applications/reddit/__init__.py +1 -0
  176. universal_mcp/applications/reddit/app.py +4652 -0
  177. universal_mcp/applications/replicate/README.md +18 -0
  178. universal_mcp/applications/replicate/__init__.py +1 -0
  179. universal_mcp/applications/replicate/app.py +495 -0
  180. universal_mcp/applications/resend/README.md +40 -0
  181. universal_mcp/applications/resend/__init__.py +1 -0
  182. universal_mcp/applications/resend/app.py +881 -0
  183. universal_mcp/applications/retell/README.md +21 -0
  184. universal_mcp/applications/retell/__init__.py +1 -0
  185. universal_mcp/applications/retell/app.py +333 -0
  186. universal_mcp/applications/rocketlane/README.md +70 -0
  187. universal_mcp/applications/rocketlane/__init__.py +1 -0
  188. universal_mcp/applications/rocketlane/app.py +4346 -0
  189. universal_mcp/applications/semanticscholar/README.md +25 -0
  190. universal_mcp/applications/semanticscholar/__init__.py +1 -0
  191. universal_mcp/applications/semanticscholar/app.py +482 -0
  192. universal_mcp/applications/semrush/README.md +44 -0
  193. universal_mcp/applications/semrush/__init__.py +1 -0
  194. universal_mcp/applications/semrush/app.py +2081 -0
  195. universal_mcp/applications/sendgrid/README.md +362 -0
  196. universal_mcp/applications/sendgrid/__init__.py +1 -0
  197. universal_mcp/applications/sendgrid/app.py +9752 -0
  198. universal_mcp/applications/sentry/README.md +186 -0
  199. universal_mcp/applications/sentry/__init__.py +1 -0
  200. universal_mcp/applications/sentry/app.py +7471 -0
  201. universal_mcp/applications/serpapi/README.md +14 -0
  202. universal_mcp/applications/serpapi/__init__.py +1 -0
  203. universal_mcp/applications/serpapi/app.py +293 -0
  204. universal_mcp/applications/sharepoint/README.md +0 -0
  205. universal_mcp/applications/sharepoint/__init__.py +1 -0
  206. universal_mcp/applications/sharepoint/app.py +215 -0
  207. universal_mcp/applications/shopify/README.md +321 -0
  208. universal_mcp/applications/shopify/__init__.py +1 -0
  209. universal_mcp/applications/shopify/app.py +15392 -0
  210. universal_mcp/applications/shortcut/README.md +128 -0
  211. universal_mcp/applications/shortcut/__init__.py +1 -0
  212. universal_mcp/applications/shortcut/app.py +4478 -0
  213. universal_mcp/applications/slack/README.md +0 -0
  214. universal_mcp/applications/slack/__init__.py +1 -0
  215. universal_mcp/applications/slack/app.py +570 -0
  216. universal_mcp/applications/spotify/README.md +91 -0
  217. universal_mcp/applications/spotify/__init__.py +1 -0
  218. universal_mcp/applications/spotify/app.py +2526 -0
  219. universal_mcp/applications/supabase/README.md +87 -0
  220. universal_mcp/applications/supabase/__init__.py +1 -0
  221. universal_mcp/applications/supabase/app.py +2970 -0
  222. universal_mcp/applications/tavily/README.md +12 -0
  223. universal_mcp/applications/tavily/__init__.py +1 -0
  224. universal_mcp/applications/tavily/app.py +51 -0
  225. universal_mcp/applications/trello/README.md +266 -0
  226. universal_mcp/applications/trello/__init__.py +1 -0
  227. universal_mcp/applications/trello/app.py +10875 -0
  228. universal_mcp/applications/twillo/README.md +0 -0
  229. universal_mcp/applications/twillo/__init__.py +1 -0
  230. universal_mcp/applications/twillo/app.py +269 -0
  231. universal_mcp/applications/twitter/README.md +100 -0
  232. universal_mcp/applications/twitter/__init__.py +1 -0
  233. universal_mcp/applications/twitter/api_segments/__init__.py +0 -0
  234. universal_mcp/applications/twitter/api_segments/api_segment_base.py +51 -0
  235. universal_mcp/applications/twitter/api_segments/compliance_api.py +122 -0
  236. universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +255 -0
  237. universal_mcp/applications/twitter/api_segments/dm_events_api.py +140 -0
  238. universal_mcp/applications/twitter/api_segments/likes_api.py +159 -0
  239. universal_mcp/applications/twitter/api_segments/lists_api.py +395 -0
  240. universal_mcp/applications/twitter/api_segments/openapi_json_api.py +34 -0
  241. universal_mcp/applications/twitter/api_segments/spaces_api.py +309 -0
  242. universal_mcp/applications/twitter/api_segments/trends_api.py +40 -0
  243. universal_mcp/applications/twitter/api_segments/tweets_api.py +1403 -0
  244. universal_mcp/applications/twitter/api_segments/usage_api.py +40 -0
  245. universal_mcp/applications/twitter/api_segments/users_api.py +1498 -0
  246. universal_mcp/applications/twitter/app.py +46 -0
  247. universal_mcp/applications/unipile/README.md +28 -0
  248. universal_mcp/applications/unipile/__init__.py +1 -0
  249. universal_mcp/applications/unipile/app.py +829 -0
  250. universal_mcp/applications/whatsapp/README.md +23 -0
  251. universal_mcp/applications/whatsapp/__init__.py +1 -0
  252. universal_mcp/applications/whatsapp/app.py +595 -0
  253. universal_mcp/applications/whatsapp-business/README.md +34 -0
  254. universal_mcp/applications/whatsapp-business/__init__.py +1 -0
  255. universal_mcp/applications/whatsapp-business/app.py +1065 -0
  256. universal_mcp/applications/wrike/README.md +46 -0
  257. universal_mcp/applications/wrike/__init__.py +1 -0
  258. universal_mcp/applications/wrike/app.py +1583 -0
  259. universal_mcp/applications/youtube/README.md +57 -0
  260. universal_mcp/applications/youtube/__init__.py +1 -0
  261. universal_mcp/applications/youtube/app.py +1696 -0
  262. universal_mcp/applications/zenquotes/README.md +12 -0
  263. universal_mcp/applications/zenquotes/__init__.py +1 -0
  264. universal_mcp/applications/zenquotes/app.py +31 -0
  265. universal_mcp_applications-0.1.1.dist-info/METADATA +172 -0
  266. universal_mcp_applications-0.1.1.dist-info/RECORD +268 -0
  267. universal_mcp_applications-0.1.1.dist-info/WHEEL +4 -0
  268. universal_mcp_applications-0.1.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,1090 @@
1
+ from typing import Any
2
+
3
+ from universal_mcp.applications.application import APIApplication
4
+ from universal_mcp.integrations import Integration
5
+
6
+
7
+ class FigmaApp(APIApplication):
8
+ def __init__(self, integration: Integration = None, **kwargs) -> None:
9
+ super().__init__(name="figma", integration=integration, **kwargs)
10
+ self.base_url = "https://api.figma.com"
11
+
12
+ def get_file(
13
+ self,
14
+ file_key,
15
+ version=None,
16
+ ids=None,
17
+ depth=None,
18
+ geometry=None,
19
+ plugin_data=None,
20
+ branch_data=None,
21
+ ) -> dict[str, Any]:
22
+ """
23
+ Retrieves a specified file's data (including versions, geometry, and plugin information) from the API using a unique file identifier.
24
+
25
+ Args:
26
+ file_key (string): file_key
27
+ version (string): A specific version ID to get. Omitting this will get the current version of the file.
28
+ ids (string): Comma separated list of nodes that you care about in the document. If specified, only a subset of the document will be returned corresponding to the nodes listed, their children, and everything between the root node and the listed nodes. Note: There may be other nodes included in the returned JSON that are outside the ancestor chains of the desired nodes. The response may also include dependencies of anything in the nodes' subtrees. For example, if a node subtree contains an instance of a local component that lives elsewhere in that file, that component and its ancestor chain will also be included. For historical reasons, top-level canvas nodes are always returned, regardless of whether they are listed in the `ids` parameter. This quirk may be removed in a future version of the API.
29
+ depth (number): Positive integer representing how deep into the document tree to traverse. For example, setting this to 1 returns only Pages, setting it to 2 returns Pages and all top level objects on each page. Not setting this parameter returns all nodes.
30
+ geometry (string): Set to "paths" to export vector data.
31
+ plugin_data (string): A comma separated list of plugin IDs and/or the string "shared". Any data present in the document written by those plugins will be included in the result in the `pluginData` and `sharedPluginData` properties.
32
+ branch_data (boolean): Returns branch metadata for the requested file. If the file is a branch, the main file's key will be included in the returned response. If the file has branches, their metadata will be included in the returned response. Default: false.
33
+
34
+ Returns:
35
+ dict[str, Any]: Response from the GET /v1/files/{file_key} endpoint.
36
+
37
+ Tags:
38
+ Files, important
39
+ """
40
+ if file_key is None:
41
+ raise ValueError("Missing required parameter 'file_key'")
42
+ url = f"{self.base_url}/v1/files/{file_key}"
43
+ query_params = {
44
+ k: v
45
+ for k, v in [
46
+ ("version", version),
47
+ ("ids", ids),
48
+ ("depth", depth),
49
+ ("geometry", geometry),
50
+ ("plugin_data", plugin_data),
51
+ ("branch_data", branch_data),
52
+ ]
53
+ if v is not None
54
+ }
55
+ response = self._get(url, params=query_params)
56
+ response.raise_for_status()
57
+ return response.json()
58
+
59
+ def get_file_nodes(
60
+ self, file_key, ids, version=None, depth=None, geometry=None, plugin_data=None
61
+ ) -> dict[str, Any]:
62
+ """
63
+ Retrieves nodes related to a file identified by the "file_key" using the specified query parameters for filtering by "ids", "version", "depth", "geometry", and "plugin_data".
64
+
65
+ Args:
66
+ file_key (string): file_key
67
+ ids (string): A comma separated list of node IDs to retrieve and convert.
68
+ version (string): A specific version ID to get. Omitting this will get the current version of the file.
69
+ depth (number): Positive integer representing how deep into the node tree to traverse. For example, setting this to 1 will return only the children directly underneath the desired nodes. Not setting this parameter returns all nodes. Note: this parameter behaves differently from the same parameter in the `GET /v1/files/:key` endpoint. In this endpoint, the depth will be counted starting from the desired node rather than the document root node.
70
+ geometry (string): Set to "paths" to export vector data.
71
+ plugin_data (string): A comma separated list of plugin IDs and/or the string "shared". Any data present in the document written by those plugins will be included in the result in the `pluginData` and `sharedPluginData` properties.
72
+
73
+ Returns:
74
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/nodes endpoint.
75
+
76
+ Tags:
77
+ Files, important
78
+ """
79
+ if file_key is None:
80
+ raise ValueError("Missing required parameter 'file_key'")
81
+ url = f"{self.base_url}/v1/files/{file_key}/nodes"
82
+ query_params = {
83
+ k: v
84
+ for k, v in [
85
+ ("ids", ids),
86
+ ("version", version),
87
+ ("depth", depth),
88
+ ("geometry", geometry),
89
+ ("plugin_data", plugin_data),
90
+ ]
91
+ if v is not None
92
+ }
93
+ response = self._get(url, params=query_params)
94
+ response.raise_for_status()
95
+ return response.json()
96
+
97
+ def get_images(
98
+ self,
99
+ file_key,
100
+ ids,
101
+ version=None,
102
+ scale=None,
103
+ format=None,
104
+ svg_outline_text=None,
105
+ svg_include_id=None,
106
+ svg_include_node_id=None,
107
+ svg_simplify_stroke=None,
108
+ contents_only=None,
109
+ use_absolute_bounds=None,
110
+ ) -> dict[str, Any]:
111
+ """
112
+ Retrieves an image specified by the `file_key` using the GET method, allowing optional query parameters for customization such as formatting, scaling, and SVG options.
113
+
114
+ Args:
115
+ file_key (string): file_key
116
+ ids (string): A comma separated list of node IDs to render.
117
+ version (string): A specific version ID to get. Omitting this will get the current version of the file.
118
+ scale (number): A number between 0.01 and 4, the image scaling factor.
119
+ format (string): A string enum for the image output format.
120
+ svg_outline_text (boolean): Whether text elements are rendered as outlines (vector paths) or as `<text>` elements in SVGs. Rendering text elements as outlines guarantees that the text looks exactly the same in the SVG as it does in the browser/inside Figma. Exporting as `<text>` allows text to be selectable inside SVGs and generally makes the SVG easier to read. However, this relies on the browser's rendering engine which can vary between browsers and/or operating systems. As such, visual accuracy is not guaranteed as the result could look different than in Figma.
121
+ svg_include_id (boolean): Whether to include id attributes for all SVG elements. Adds the layer name to the `id` attribute of an svg element.
122
+ svg_include_node_id (boolean): Whether to include node id attributes for all SVG elements. Adds the node id to a `data-node-id` attribute of an svg element.
123
+ svg_simplify_stroke (boolean): Whether to simplify inside/outside strokes and use stroke attribute if possible instead of `<mask>`.
124
+ contents_only (boolean): Whether content that overlaps the node should be excluded from rendering. Passing false (i.e., rendering overlaps) may increase processing time, since more of the document must be included in rendering.
125
+ use_absolute_bounds (boolean): Use the full dimensions of the node regardless of whether or not it is cropped or the space around it is empty. Use this to export text nodes without cropping.
126
+
127
+ Returns:
128
+ dict[str, Any]: Response from the GET /v1/images/{file_key} endpoint.
129
+
130
+ Tags:
131
+ Files, important
132
+ """
133
+ if file_key is None:
134
+ raise ValueError("Missing required parameter 'file_key'")
135
+ url = f"{self.base_url}/v1/images/{file_key}"
136
+ query_params = {
137
+ k: v
138
+ for k, v in [
139
+ ("ids", ids),
140
+ ("version", version),
141
+ ("scale", scale),
142
+ ("format", format),
143
+ ("svg_outline_text", svg_outline_text),
144
+ ("svg_include_id", svg_include_id),
145
+ ("svg_include_node_id", svg_include_node_id),
146
+ ("svg_simplify_stroke", svg_simplify_stroke),
147
+ ("contents_only", contents_only),
148
+ ("use_absolute_bounds", use_absolute_bounds),
149
+ ]
150
+ if v is not None
151
+ }
152
+ response = self._get(url, params=query_params)
153
+ response.raise_for_status()
154
+ return response.json()
155
+
156
+ def get_image_fills(self, file_key) -> dict[str, Any]:
157
+ """
158
+ Retrieves images associated with a file identified by the `{file_key}` using the `/v1/files/{file_key}/images` API endpoint.
159
+
160
+ Args:
161
+ file_key (string): file_key
162
+
163
+ Returns:
164
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/images endpoint.
165
+
166
+ Tags:
167
+ Files
168
+ """
169
+ if file_key is None:
170
+ raise ValueError("Missing required parameter 'file_key'")
171
+ url = f"{self.base_url}/v1/files/{file_key}/images"
172
+ query_params = {}
173
+ response = self._get(url, params=query_params)
174
+ response.raise_for_status()
175
+ return response.json()
176
+
177
+ def get_team_projects(self, team_id) -> dict[str, Any]:
178
+ """
179
+ Retrieves a list of projects associated with a specific team identified by the team_id parameter.
180
+
181
+ Args:
182
+ team_id (string): team_id
183
+
184
+ Returns:
185
+ dict[str, Any]: Response from the GET /v1/teams/{team_id}/projects endpoint.
186
+
187
+ Tags:
188
+ Projects
189
+ """
190
+ if team_id is None:
191
+ raise ValueError("Missing required parameter 'team_id'")
192
+ url = f"{self.base_url}/v1/teams/{team_id}/projects"
193
+ query_params = {}
194
+ response = self._get(url, params=query_params)
195
+ response.raise_for_status()
196
+ return response.json()
197
+
198
+ def get_project_files(self, project_id, branch_data=None) -> dict[str, Any]:
199
+ """
200
+ Retrieves files from a specified project, optionally including branch data, using the provided project identifier.
201
+
202
+ Args:
203
+ project_id (string): project_id
204
+ branch_data (boolean): Returns branch metadata in the response for each main file with a branch inside the project.
205
+
206
+ Returns:
207
+ dict[str, Any]: Response from the GET /v1/projects/{project_id}/files endpoint.
208
+
209
+ Tags:
210
+ Projects
211
+ """
212
+ if project_id is None:
213
+ raise ValueError("Missing required parameter 'project_id'")
214
+ url = f"{self.base_url}/v1/projects/{project_id}/files"
215
+ query_params = {
216
+ k: v for k, v in [("branch_data", branch_data)] if v is not None
217
+ }
218
+ response = self._get(url, params=query_params)
219
+ response.raise_for_status()
220
+ return response.json()
221
+
222
+ def get_file_versions(
223
+ self, file_key, page_size=None, before=None, after=None
224
+ ) -> dict[str, Any]:
225
+ """
226
+ Retrieves a list of file versions using the "GET" method, filtering by file key and optional query parameters for pagination and sorting.
227
+
228
+ Args:
229
+ file_key (string): file_key
230
+ page_size (number): The number of items returned in a page of the response. If not included, `page_size` is `30`.
231
+ before (number): A version ID for one of the versions in the history. Gets versions before this ID. Used for paginating. If the response is not paginated, this link returns the same data in the current response.
232
+ after (number): A version ID for one of the versions in the history. Gets versions after this ID. Used for paginating. If the response is not paginated, this property is not included.
233
+
234
+ Returns:
235
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/versions endpoint.
236
+
237
+ Tags:
238
+ Files
239
+ """
240
+ if file_key is None:
241
+ raise ValueError("Missing required parameter 'file_key'")
242
+ url = f"{self.base_url}/v1/files/{file_key}/versions"
243
+ query_params = {
244
+ k: v
245
+ for k, v in [("page_size", page_size), ("before", before), ("after", after)]
246
+ if v is not None
247
+ }
248
+ response = self._get(url, params=query_params)
249
+ response.raise_for_status()
250
+ return response.json()
251
+
252
+ def get_comments(self, file_key, as_md=None) -> dict[str, Any]:
253
+ """
254
+ Retrieves comments associated with a specified file and optionally returns them in Markdown format based on the query parameter.
255
+
256
+ Args:
257
+ file_key (string): file_key
258
+ as_md (boolean): If enabled, will return comments as their markdown equivalents when applicable.
259
+
260
+ Returns:
261
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/comments endpoint.
262
+
263
+ Tags:
264
+ Comments
265
+ """
266
+ if file_key is None:
267
+ raise ValueError("Missing required parameter 'file_key'")
268
+ url = f"{self.base_url}/v1/files/{file_key}/comments"
269
+ query_params = {k: v for k, v in [("as_md", as_md)] if v is not None}
270
+ response = self._get(url, params=query_params)
271
+ response.raise_for_status()
272
+ return response.json()
273
+
274
+ def post_comment(
275
+ self, file_key, message, comment_id=None, client_meta=None
276
+ ) -> dict[str, Any]:
277
+ """
278
+ Creates a new comment on a file specified by the file_key and returns an appropriate status code.
279
+
280
+ Args:
281
+ file_key (string): file_key
282
+ message (string): The text contents of the comment to post.
283
+ comment_id (string): The ID of the comment to reply to, if any. This must be a root comment. You cannot reply to other replies (a comment that has a parent_id).
284
+ client_meta (string): The position where to place the comment.
285
+
286
+ Returns:
287
+ dict[str, Any]: Response from the POST /v1/files/{file_key}/comments endpoint.
288
+
289
+ Tags:
290
+ Comments
291
+ """
292
+ if file_key is None:
293
+ raise ValueError("Missing required parameter 'file_key'")
294
+ request_body = {
295
+ "message": message,
296
+ "comment_id": comment_id,
297
+ "client_meta": client_meta,
298
+ }
299
+ request_body = {k: v for k, v in request_body.items() if v is not None}
300
+ url = f"{self.base_url}/v1/files/{file_key}/comments"
301
+ query_params = {}
302
+ response = self._post(url, data=request_body, params=query_params)
303
+ response.raise_for_status()
304
+ return response.json()
305
+
306
+ def delete_comment(self, file_key, comment_id) -> dict[str, Any]:
307
+ """
308
+ Deletes a specified comment from a file identified by its file key and comment ID.
309
+
310
+ Args:
311
+ file_key (string): file_key
312
+ comment_id (string): comment_id
313
+
314
+ Returns:
315
+ dict[str, Any]: Response from the DELETE /v1/files/{file_key}/comments/{comment_id} endpoint.
316
+
317
+ Tags:
318
+ Comments
319
+ """
320
+ if file_key is None:
321
+ raise ValueError("Missing required parameter 'file_key'")
322
+ if comment_id is None:
323
+ raise ValueError("Missing required parameter 'comment_id'")
324
+ url = f"{self.base_url}/v1/files/{file_key}/comments/{comment_id}"
325
+ query_params = {}
326
+ response = self._delete(url, params=query_params)
327
+ response.raise_for_status()
328
+ return response.json()
329
+
330
+ def get_comment_reactions(
331
+ self, file_key, comment_id, cursor=None
332
+ ) -> dict[str, Any]:
333
+ """
334
+ Retrieves reactions for a specific comment in a file using the provided file key and comment ID.
335
+
336
+ Args:
337
+ file_key (string): file_key
338
+ comment_id (string): comment_id
339
+ cursor (string): Cursor for pagination, retrieved from the response of the previous call.
340
+
341
+ Returns:
342
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/comments/{comment_id}/reactions endpoint.
343
+
344
+ Tags:
345
+ Comment Reactions
346
+ """
347
+ if file_key is None:
348
+ raise ValueError("Missing required parameter 'file_key'")
349
+ if comment_id is None:
350
+ raise ValueError("Missing required parameter 'comment_id'")
351
+ url = f"{self.base_url}/v1/files/{file_key}/comments/{comment_id}/reactions"
352
+ query_params = {k: v for k, v in [("cursor", cursor)] if v is not None}
353
+ response = self._get(url, params=query_params)
354
+ response.raise_for_status()
355
+ return response.json()
356
+
357
+ def post_comment_reaction(self, file_key, comment_id, emoji) -> dict[str, Any]:
358
+ """
359
+ Adds a reaction to a specific comment on a file identified by the file key and comment ID using the "POST" method at the "/v1/files/{file_key}/comments/{comment_id}/reactions" endpoint.
360
+
361
+ Args:
362
+ file_key (string): file_key
363
+ comment_id (string): comment_id
364
+ emoji (string): The emoji type of reaction as shortcode (e.g. `:heart:`, `:+1::skin-tone-2:`). The list of accepted emoji shortcodes can be found in [this file](https://raw.githubusercontent.com/missive/emoji-mart/main/packages/emoji-mart-data/sets/14/native.json) under the top-level emojis and aliases fields, with optional skin tone modifiers when applicable.
365
+
366
+ Returns:
367
+ dict[str, Any]: Response from the POST /v1/files/{file_key}/comments/{comment_id}/reactions endpoint.
368
+
369
+ Tags:
370
+ Comment Reactions
371
+ """
372
+ if file_key is None:
373
+ raise ValueError("Missing required parameter 'file_key'")
374
+ if comment_id is None:
375
+ raise ValueError("Missing required parameter 'comment_id'")
376
+ request_body = {
377
+ "emoji": emoji,
378
+ }
379
+ request_body = {k: v for k, v in request_body.items() if v is not None}
380
+ url = f"{self.base_url}/v1/files/{file_key}/comments/{comment_id}/reactions"
381
+ query_params = {}
382
+ response = self._post(url, data=request_body, params=query_params)
383
+ response.raise_for_status()
384
+ return response.json()
385
+
386
+ def delete_comment_reaction(self, file_key, comment_id, emoji) -> dict[str, Any]:
387
+ """
388
+ Removes a reaction emoji from a comment on a file using the specified emoji parameter.
389
+
390
+ Args:
391
+ file_key (string): file_key
392
+ comment_id (string): comment_id
393
+ emoji (string): Specifies the emoji identifier to be removed from the comment reaction.
394
+
395
+ Returns:
396
+ dict[str, Any]: Response from the DELETE /v1/files/{file_key}/comments/{comment_id}/reactions endpoint.
397
+
398
+ Tags:
399
+ Comment Reactions
400
+ """
401
+ if file_key is None:
402
+ raise ValueError("Missing required parameter 'file_key'")
403
+ if comment_id is None:
404
+ raise ValueError("Missing required parameter 'comment_id'")
405
+ url = f"{self.base_url}/v1/files/{file_key}/comments/{comment_id}/reactions"
406
+ query_params = {k: v for k, v in [("emoji", emoji)] if v is not None}
407
+ response = self._delete(url, params=query_params)
408
+ response.raise_for_status()
409
+ return response.json()
410
+
411
+ def get_me(self) -> Any:
412
+ """
413
+ Retrieves the authenticated user's profile data.
414
+
415
+ Returns:
416
+ Any: Response from the GET /v1/me endpoint.
417
+
418
+ Tags:
419
+ Users, important
420
+ """
421
+ url = f"{self.base_url}/v1/me"
422
+ query_params = {}
423
+ response = self._get(url, params=query_params)
424
+ response.raise_for_status()
425
+ return response.json()
426
+
427
+ def get_team_components(
428
+ self, team_id, page_size=None, after=None, before=None
429
+ ) -> dict[str, Any]:
430
+ """
431
+ Retrieves a list of components for a specified team with pagination support using page_size, after, and before parameters.
432
+
433
+ Args:
434
+ team_id (string): team_id
435
+ page_size (number): Number of items to return in a paged list of results. Defaults to 30.
436
+ after (number): Cursor indicating which id after which to start retrieving components for. Exclusive with before. The cursor value is an internally tracked integer that doesn't correspond to any Ids.
437
+ before (number): Cursor indicating which id before which to start retrieving components for. Exclusive with after. The cursor value is an internally tracked integer that doesn't correspond to any Ids.
438
+
439
+ Returns:
440
+ dict[str, Any]: Response from the GET /v1/teams/{team_id}/components endpoint.
441
+
442
+ Tags:
443
+ Components
444
+ """
445
+ if team_id is None:
446
+ raise ValueError("Missing required parameter 'team_id'")
447
+ url = f"{self.base_url}/v1/teams/{team_id}/components"
448
+ query_params = {
449
+ k: v
450
+ for k, v in [("page_size", page_size), ("after", after), ("before", before)]
451
+ if v is not None
452
+ }
453
+ response = self._get(url, params=query_params)
454
+ response.raise_for_status()
455
+ return response.json()
456
+
457
+ def get_file_components(self, file_key) -> dict[str, Any]:
458
+ """
459
+ Retrieves a list of components associated with a file identified by the specified file key using the API endpoint "/v1/files/{file_key}/components".
460
+
461
+ Args:
462
+ file_key (string): file_key
463
+
464
+ Returns:
465
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/components endpoint.
466
+
467
+ Tags:
468
+ Components
469
+ """
470
+ if file_key is None:
471
+ raise ValueError("Missing required parameter 'file_key'")
472
+ url = f"{self.base_url}/v1/files/{file_key}/components"
473
+ query_params = {}
474
+ response = self._get(url, params=query_params)
475
+ response.raise_for_status()
476
+ return response.json()
477
+
478
+ def get_component(self, key) -> dict[str, Any]:
479
+ """
480
+ Retrieves component information for a specific key using the API endpoint at "/v1/components/{key}" with the GET method.
481
+
482
+ Args:
483
+ key (string): key
484
+
485
+ Returns:
486
+ dict[str, Any]: Response from the GET /v1/components/{key} endpoint.
487
+
488
+ Tags:
489
+ Components
490
+ """
491
+ if key is None:
492
+ raise ValueError("Missing required parameter 'key'")
493
+ url = f"{self.base_url}/v1/components/{key}"
494
+ query_params = {}
495
+ response = self._get(url, params=query_params)
496
+ response.raise_for_status()
497
+ return response.json()
498
+
499
+ def get_team_component_sets(
500
+ self, team_id, page_size=None, after=None, before=None
501
+ ) -> dict[str, Any]:
502
+ """
503
+ Retrieves a paginated list of component sets associated with a specific team ID, supporting pagination via page size, after, and before query parameters.
504
+
505
+ Args:
506
+ team_id (string): team_id
507
+ page_size (number): Number of items to return in a paged list of results. Defaults to 30.
508
+ after (number): Cursor indicating which id after which to start retrieving component sets for. Exclusive with before. The cursor value is an internally tracked integer that doesn't correspond to any Ids.
509
+ before (number): Cursor indicating which id before which to start retrieving component sets for. Exclusive with after. The cursor value is an internally tracked integer that doesn't correspond to any Ids.
510
+
511
+ Returns:
512
+ dict[str, Any]: Response from the GET /v1/teams/{team_id}/component_sets endpoint.
513
+
514
+ Tags:
515
+ Component Sets
516
+ """
517
+ if team_id is None:
518
+ raise ValueError("Missing required parameter 'team_id'")
519
+ url = f"{self.base_url}/v1/teams/{team_id}/component_sets"
520
+ query_params = {
521
+ k: v
522
+ for k, v in [("page_size", page_size), ("after", after), ("before", before)]
523
+ if v is not None
524
+ }
525
+ response = self._get(url, params=query_params)
526
+ response.raise_for_status()
527
+ return response.json()
528
+
529
+ def get_file_component_sets(self, file_key) -> dict[str, Any]:
530
+ """
531
+ Retrieves the component sets associated with a file identified by a specific file key using the "GET" method at the "/v1/files/{file_key}/component_sets" endpoint.
532
+
533
+ Args:
534
+ file_key (string): file_key
535
+
536
+ Returns:
537
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/component_sets endpoint.
538
+
539
+ Tags:
540
+ Component Sets
541
+ """
542
+ if file_key is None:
543
+ raise ValueError("Missing required parameter 'file_key'")
544
+ url = f"{self.base_url}/v1/files/{file_key}/component_sets"
545
+ query_params = {}
546
+ response = self._get(url, params=query_params)
547
+ response.raise_for_status()
548
+ return response.json()
549
+
550
+ def get_component_set(self, key) -> dict[str, Any]:
551
+ """
552
+ Retrieves a component set by its unique key identifier and returns the associated component data.
553
+
554
+ Args:
555
+ key (string): key
556
+
557
+ Returns:
558
+ dict[str, Any]: Response from the GET /v1/component_sets/{key} endpoint.
559
+
560
+ Tags:
561
+ Component Sets
562
+ """
563
+ if key is None:
564
+ raise ValueError("Missing required parameter 'key'")
565
+ url = f"{self.base_url}/v1/component_sets/{key}"
566
+ query_params = {}
567
+ response = self._get(url, params=query_params)
568
+ response.raise_for_status()
569
+ return response.json()
570
+
571
+ def get_team_styles(
572
+ self, team_id, page_size=None, after=None, before=None
573
+ ) -> dict[str, Any]:
574
+ """
575
+ Retrieves paginated style resources associated with a specific team using query parameters for pagination control.
576
+
577
+ Args:
578
+ team_id (string): team_id
579
+ page_size (number): Number of items to return in a paged list of results. Defaults to 30.
580
+ after (number): Cursor indicating which id after which to start retrieving styles for. Exclusive with before. The cursor value is an internally tracked integer that doesn't correspond to any Ids.
581
+ before (number): Cursor indicating which id before which to start retrieving styles for. Exclusive with after. The cursor value is an internally tracked integer that doesn't correspond to any Ids.
582
+
583
+ Returns:
584
+ dict[str, Any]: Response from the GET /v1/teams/{team_id}/styles endpoint.
585
+
586
+ Tags:
587
+ Styles
588
+ """
589
+ if team_id is None:
590
+ raise ValueError("Missing required parameter 'team_id'")
591
+ url = f"{self.base_url}/v1/teams/{team_id}/styles"
592
+ query_params = {
593
+ k: v
594
+ for k, v in [("page_size", page_size), ("after", after), ("before", before)]
595
+ if v is not None
596
+ }
597
+ response = self._get(url, params=query_params)
598
+ response.raise_for_status()
599
+ return response.json()
600
+
601
+ def get_file_styles(self, file_key) -> dict[str, Any]:
602
+ """
603
+ Retrieves styles information for a specific file identified by the file key using the API endpoint "/v1/files/{file_key}/styles" with the GET method.
604
+
605
+ Args:
606
+ file_key (string): file_key
607
+
608
+ Returns:
609
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/styles endpoint.
610
+
611
+ Tags:
612
+ Styles
613
+ """
614
+ if file_key is None:
615
+ raise ValueError("Missing required parameter 'file_key'")
616
+ url = f"{self.base_url}/v1/files/{file_key}/styles"
617
+ query_params = {}
618
+ response = self._get(url, params=query_params)
619
+ response.raise_for_status()
620
+ return response.json()
621
+
622
+ def get_style(self, key) -> dict[str, Any]:
623
+ """
624
+ Retrieves a style object associated with the specified key using the "GET" method at the "/v1/styles/{key}" endpoint.
625
+
626
+ Args:
627
+ key (string): key
628
+
629
+ Returns:
630
+ dict[str, Any]: Response from the GET /v1/styles/{key} endpoint.
631
+
632
+ Tags:
633
+ Styles
634
+ """
635
+ if key is None:
636
+ raise ValueError("Missing required parameter 'key'")
637
+ url = f"{self.base_url}/v1/styles/{key}"
638
+ query_params = {}
639
+ response = self._get(url, params=query_params)
640
+ response.raise_for_status()
641
+ return response.json()
642
+
643
+ def post_webhook(
644
+ self, event_type, team_id, endpoint, passcode, status=None, description=None
645
+ ) -> dict[str, Any]:
646
+ """
647
+ Registers a new webhook to receive HTTP callbacks for specified events, returning success or error status codes.
648
+
649
+ Args:
650
+ event_type (string): An enum representing the possible events that a webhook can subscribe to
651
+ team_id (string): Team id to receive updates about
652
+ endpoint (string): The HTTP endpoint that will receive a POST request when the event triggers. Max length 2048 characters.
653
+ passcode (string): String that will be passed back to your webhook endpoint to verify that it is being called by Figma. Max length 100 characters.
654
+ status (string): An enum representing the possible statuses you can set a webhook to:
655
+ - `ACTIVE`: The webhook is healthy and receive all events
656
+ - `PAUSED`: The webhook is paused and will not receive any events
657
+ description (string): User provided description or name for the webhook. Max length 150 characters.
658
+
659
+ Returns:
660
+ dict[str, Any]: Response from the POST /v2/webhooks endpoint.
661
+
662
+ Tags:
663
+ Webhooks
664
+ """
665
+ request_body = {
666
+ "event_type": event_type,
667
+ "team_id": team_id,
668
+ "endpoint": endpoint,
669
+ "passcode": passcode,
670
+ "status": status,
671
+ "description": description,
672
+ }
673
+ request_body = {k: v for k, v in request_body.items() if v is not None}
674
+ url = f"{self.base_url}/v2/webhooks"
675
+ query_params = {}
676
+ response = self._post(url, data=request_body, params=query_params)
677
+ response.raise_for_status()
678
+ return response.json()
679
+
680
+ def get_webhook(self, webhook_id) -> dict[str, Any]:
681
+ """
682
+ Retrieves information about a specific webhook by its ID using the "GET" method at the path "/v2/webhooks/{webhook_id}".
683
+
684
+ Args:
685
+ webhook_id (string): webhook_id
686
+
687
+ Returns:
688
+ dict[str, Any]: Response from the GET /v2/webhooks/{webhook_id} endpoint.
689
+
690
+ Tags:
691
+ Webhooks
692
+ """
693
+ if webhook_id is None:
694
+ raise ValueError("Missing required parameter 'webhook_id'")
695
+ url = f"{self.base_url}/v2/webhooks/{webhook_id}"
696
+ query_params = {}
697
+ response = self._get(url, params=query_params)
698
+ response.raise_for_status()
699
+ return response.json()
700
+
701
+ def put_webhook(
702
+ self, webhook_id, event_type, endpoint, passcode, status=None, description=None
703
+ ) -> dict[str, Any]:
704
+ """
705
+ Updates an existing webhook's configuration using the provided webhook ID and returns an HTTP status code indicating success or failure.
706
+
707
+ Args:
708
+ webhook_id (string): webhook_id
709
+ event_type (string): An enum representing the possible events that a webhook can subscribe to
710
+ endpoint (string): The HTTP endpoint that will receive a POST request when the event triggers. Max length 2048 characters.
711
+ passcode (string): String that will be passed back to your webhook endpoint to verify that it is being called by Figma. Max length 100 characters.
712
+ status (string): An enum representing the possible statuses you can set a webhook to:
713
+ - `ACTIVE`: The webhook is healthy and receive all events
714
+ - `PAUSED`: The webhook is paused and will not receive any events
715
+ description (string): User provided description or name for the webhook. Max length 150 characters.
716
+
717
+ Returns:
718
+ dict[str, Any]: Response from the PUT /v2/webhooks/{webhook_id} endpoint.
719
+
720
+ Tags:
721
+ Webhooks
722
+ """
723
+ if webhook_id is None:
724
+ raise ValueError("Missing required parameter 'webhook_id'")
725
+ request_body = {
726
+ "event_type": event_type,
727
+ "endpoint": endpoint,
728
+ "passcode": passcode,
729
+ "status": status,
730
+ "description": description,
731
+ }
732
+ request_body = {k: v for k, v in request_body.items() if v is not None}
733
+ url = f"{self.base_url}/v2/webhooks/{webhook_id}"
734
+ query_params = {}
735
+ response = self._put(url, data=request_body, params=query_params)
736
+ response.raise_for_status()
737
+ return response.json()
738
+
739
+ def delete_webhook(self, webhook_id) -> dict[str, Any]:
740
+ """
741
+ Deletes a webhook identified by its `webhook_id`, permanently removing it to manage and optimize webhook configurations.
742
+
743
+ Args:
744
+ webhook_id (string): webhook_id
745
+
746
+ Returns:
747
+ dict[str, Any]: Response from the DELETE /v2/webhooks/{webhook_id} endpoint.
748
+
749
+ Tags:
750
+ Webhooks
751
+ """
752
+ if webhook_id is None:
753
+ raise ValueError("Missing required parameter 'webhook_id'")
754
+ url = f"{self.base_url}/v2/webhooks/{webhook_id}"
755
+ query_params = {}
756
+ response = self._delete(url, params=query_params)
757
+ response.raise_for_status()
758
+ return response.json()
759
+
760
+ def get_team_webhooks(self, team_id) -> dict[str, Any]:
761
+ """
762
+ Retrieves a list of webhooks for a specified team using the "GET" method, with the team identified by the `team_id` path parameter.
763
+
764
+ Args:
765
+ team_id (string): team_id
766
+
767
+ Returns:
768
+ dict[str, Any]: Response from the GET /v2/teams/{team_id}/webhooks endpoint.
769
+
770
+ Tags:
771
+ Webhooks
772
+ """
773
+ if team_id is None:
774
+ raise ValueError("Missing required parameter 'team_id'")
775
+ url = f"{self.base_url}/v2/teams/{team_id}/webhooks"
776
+ query_params = {}
777
+ response = self._get(url, params=query_params)
778
+ response.raise_for_status()
779
+ return response.json()
780
+
781
+ def get_webhook_requests(self, webhook_id) -> dict[str, Any]:
782
+ """
783
+ Retrieves a list of requests for a specific webhook identified by `{webhook_id}` using the "GET" method.
784
+
785
+ Args:
786
+ webhook_id (string): webhook_id
787
+
788
+ Returns:
789
+ dict[str, Any]: Response from the GET /v2/webhooks/{webhook_id}/requests endpoint.
790
+
791
+ Tags:
792
+ Webhooks
793
+ """
794
+ if webhook_id is None:
795
+ raise ValueError("Missing required parameter 'webhook_id'")
796
+ url = f"{self.base_url}/v2/webhooks/{webhook_id}/requests"
797
+ query_params = {}
798
+ response = self._get(url, params=query_params)
799
+ response.raise_for_status()
800
+ return response.json()
801
+
802
+ def get_activity_logs(
803
+ self, events=None, start_time=None, end_time=None, limit=None, order=None
804
+ ) -> dict[str, Any]:
805
+ """
806
+ Retrieves a list of activity logs filtered by specified events, time range, and other parameters, returning the results in a specified order with a limited number of entries.
807
+
808
+ Args:
809
+ events (string): Event type(s) to include in the response. Can have multiple values separated by comma. All events are returned by default.
810
+ start_time (number): Unix timestamp of the least recent event to include. This param defaults to one year ago if unspecified. Events prior to one year ago are not available.
811
+ end_time (number): Unix timestamp of the most recent event to include. This param defaults to the current timestamp if unspecified.
812
+ limit (number): Maximum number of events to return. This param defaults to 1000 if unspecified.
813
+ order (string): Event order by timestamp. This param can be either "asc" (default) or "desc".
814
+
815
+ Returns:
816
+ dict[str, Any]: Response from the GET /v1/activity_logs endpoint.
817
+
818
+ Tags:
819
+ Activity Logs
820
+ """
821
+ url = f"{self.base_url}/v1/activity_logs"
822
+ query_params = {
823
+ k: v
824
+ for k, v in [
825
+ ("events", events),
826
+ ("start_time", start_time),
827
+ ("end_time", end_time),
828
+ ("limit", limit),
829
+ ("order", order),
830
+ ]
831
+ if v is not None
832
+ }
833
+ response = self._get(url, params=query_params)
834
+ response.raise_for_status()
835
+ return response.json()
836
+
837
+ def get_payments(
838
+ self,
839
+ plugin_payment_token=None,
840
+ user_id=None,
841
+ community_file_id=None,
842
+ plugin_id=None,
843
+ widget_id=None,
844
+ ) -> dict[str, Any]:
845
+ """
846
+ Retrieves payment information based on specified parameters, including plugin payment token, user ID, community file ID, plugin ID, and widget ID, using the "/v1/payments" API endpoint with a GET request.
847
+
848
+ Args:
849
+ plugin_payment_token (string): Short-lived token returned from "getPluginPaymentTokenAsync" in the plugin payments API and used to authenticate to this endpoint. Read more about generating this token through "Calling the Payments REST API from a plugin or widget" below.
850
+ user_id (number): The ID of the user to query payment information about. You can get the user ID by having the user OAuth2 to the Figma REST API.
851
+ community_file_id (number): The ID of the Community file to query a user's payment information on. You can get the Community file ID from the file's Community page (look for the number after "file/" in the URL). Provide exactly one of "community_file_id", "plugin_id", or "widget_id".
852
+ plugin_id (number): The ID of the plugin to query a user's payment information on. You can get the plugin ID from the plugin's manifest, or from the plugin's Community page (look for the number after "plugin/" in the URL). Provide exactly one of "community_file_id", "plugin_id", or "widget_id".
853
+ widget_id (number): The ID of the widget to query a user's payment information on. You can get the widget ID from the widget's manifest, or from the widget's Community page (look for the number after "widget/" in the URL). Provide exactly one of "community_file_id", "plugin_id", or "widget_id".
854
+
855
+ Returns:
856
+ dict[str, Any]: Response from the GET /v1/payments endpoint.
857
+
858
+ Tags:
859
+ Payments
860
+ """
861
+ url = f"{self.base_url}/v1/payments"
862
+ query_params = {
863
+ k: v
864
+ for k, v in [
865
+ ("plugin_payment_token", plugin_payment_token),
866
+ ("user_id", user_id),
867
+ ("community_file_id", community_file_id),
868
+ ("plugin_id", plugin_id),
869
+ ("widget_id", widget_id),
870
+ ]
871
+ if v is not None
872
+ }
873
+ response = self._get(url, params=query_params)
874
+ response.raise_for_status()
875
+ return response.json()
876
+
877
+ def get_local_variables(self, file_key) -> dict[str, Any]:
878
+ """
879
+ Retrieves local variables for a file specified by the "file_key" using the "GET" method.
880
+
881
+ Args:
882
+ file_key (string): file_key
883
+
884
+ Returns:
885
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/variables/local endpoint.
886
+
887
+ Tags:
888
+ Variables
889
+ """
890
+ if file_key is None:
891
+ raise ValueError("Missing required parameter 'file_key'")
892
+ url = f"{self.base_url}/v1/files/{file_key}/variables/local"
893
+ query_params = {}
894
+ response = self._get(url, params=query_params)
895
+ response.raise_for_status()
896
+ return response.json()
897
+
898
+ def get_published_variables(self, file_key) -> dict[str, Any]:
899
+ """
900
+ Retrieves the published variables for a file identified by the `{file_key}` using the `GET` method.
901
+
902
+ Args:
903
+ file_key (string): file_key
904
+
905
+ Returns:
906
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/variables/published endpoint.
907
+
908
+ Tags:
909
+ Variables
910
+ """
911
+ if file_key is None:
912
+ raise ValueError("Missing required parameter 'file_key'")
913
+ url = f"{self.base_url}/v1/files/{file_key}/variables/published"
914
+ query_params = {}
915
+ response = self._get(url, params=query_params)
916
+ response.raise_for_status()
917
+ return response.json()
918
+
919
+ def post_variables(
920
+ self,
921
+ file_key,
922
+ variableCollections=None,
923
+ variableModes=None,
924
+ variables=None,
925
+ variableModeValues=None,
926
+ ) -> dict[str, Any]:
927
+ """
928
+ Creates variables for a specific file identified by its file_key and returns an appropriate status code based on the operation's outcome.
929
+
930
+ Args:
931
+ file_key (string): file_key
932
+ variableCollections (array): For creating, updating, and deleting variable collections.
933
+ variableModes (array): For creating, updating, and deleting modes within variable collections.
934
+ variables (array): For creating, updating, and deleting variables.
935
+ variableModeValues (array): For setting a specific value, given a variable and a mode.
936
+
937
+ Returns:
938
+ dict[str, Any]: Response from the POST /v1/files/{file_key}/variables endpoint.
939
+
940
+ Tags:
941
+ Variables
942
+ """
943
+ if file_key is None:
944
+ raise ValueError("Missing required parameter 'file_key'")
945
+ request_body = {
946
+ "variableCollections": variableCollections,
947
+ "variableModes": variableModes,
948
+ "variables": variables,
949
+ "variableModeValues": variableModeValues,
950
+ }
951
+ request_body = {k: v for k, v in request_body.items() if v is not None}
952
+ url = f"{self.base_url}/v1/files/{file_key}/variables"
953
+ query_params = {}
954
+ response = self._post(url, data=request_body, params=query_params)
955
+ response.raise_for_status()
956
+ return response.json()
957
+
958
+ def get_dev_resources(self, file_key, node_ids=None) -> dict[str, Any]:
959
+ """
960
+ Retrieves development resources associated with a specific file, identified by its file_key, with optional filtering by node IDs.
961
+
962
+ Args:
963
+ file_key (string): file_key
964
+ node_ids (string): Comma separated list of nodes that you care about in the document. If specified, only dev resources attached to these nodes will be returned. If not specified, all dev resources in the file will be returned.
965
+
966
+ Returns:
967
+ dict[str, Any]: Response from the GET /v1/files/{file_key}/dev_resources endpoint.
968
+
969
+ Tags:
970
+ Dev Resources
971
+ """
972
+ if file_key is None:
973
+ raise ValueError("Missing required parameter 'file_key'")
974
+ url = f"{self.base_url}/v1/files/{file_key}/dev_resources"
975
+ query_params = {k: v for k, v in [("node_ids", node_ids)] if v is not None}
976
+ response = self._get(url, params=query_params)
977
+ response.raise_for_status()
978
+ return response.json()
979
+
980
+ def post_dev_resources(self, dev_resources) -> dict[str, Any]:
981
+ """
982
+ Creates developer resources via the API and returns a status response.
983
+
984
+ Args:
985
+ dev_resources (array): An array of dev resources.
986
+
987
+ Returns:
988
+ dict[str, Any]: Response from the POST /v1/dev_resources endpoint.
989
+
990
+ Tags:
991
+ Dev Resources
992
+ """
993
+ request_body = {
994
+ "dev_resources": dev_resources,
995
+ }
996
+ request_body = {k: v for k, v in request_body.items() if v is not None}
997
+ url = f"{self.base_url}/v1/dev_resources"
998
+ query_params = {}
999
+ response = self._post(url, data=request_body, params=query_params)
1000
+ response.raise_for_status()
1001
+ return response.json()
1002
+
1003
+ def put_dev_resources(self, dev_resources) -> dict[str, Any]:
1004
+ """
1005
+ Replaces a specific developer resource at the specified path with updated data, returning a status code for success or error conditions.
1006
+
1007
+ Args:
1008
+ dev_resources (array): An array of dev resources.
1009
+
1010
+ Returns:
1011
+ dict[str, Any]: Response from the PUT /v1/dev_resources endpoint.
1012
+
1013
+ Tags:
1014
+ Dev Resources
1015
+ """
1016
+ request_body = {
1017
+ "dev_resources": dev_resources,
1018
+ }
1019
+ request_body = {k: v for k, v in request_body.items() if v is not None}
1020
+ url = f"{self.base_url}/v1/dev_resources"
1021
+ query_params = {}
1022
+ response = self._put(url, data=request_body, params=query_params)
1023
+ response.raise_for_status()
1024
+ return response.json()
1025
+
1026
+ def delete_dev_resource(self, file_key, dev_resource_id) -> Any:
1027
+ """
1028
+ Deletes a specific development resource associated with a file using the provided file key and development resource ID.
1029
+
1030
+ Args:
1031
+ file_key (string): file_key
1032
+ dev_resource_id (string): dev_resource_id
1033
+
1034
+ Returns:
1035
+ Any: Response from the DELETE /v1/files/{file_key}/dev_resources/{dev_resource_id} endpoint.
1036
+
1037
+ Tags:
1038
+ Dev Resources
1039
+ """
1040
+ if file_key is None:
1041
+ raise ValueError("Missing required parameter 'file_key'")
1042
+ if dev_resource_id is None:
1043
+ raise ValueError("Missing required parameter 'dev_resource_id'")
1044
+ url = f"{self.base_url}/v1/files/{file_key}/dev_resources/{dev_resource_id}"
1045
+ query_params = {}
1046
+ response = self._delete(url, params=query_params)
1047
+ response.raise_for_status()
1048
+ return response.json()
1049
+
1050
+ def list_tools(self):
1051
+ return [
1052
+ self.get_file,
1053
+ self.get_file_nodes,
1054
+ self.get_images,
1055
+ self.get_image_fills,
1056
+ self.get_team_projects,
1057
+ self.get_project_files,
1058
+ self.get_file_versions,
1059
+ self.get_comments,
1060
+ self.post_comment,
1061
+ self.delete_comment,
1062
+ self.get_comment_reactions,
1063
+ self.post_comment_reaction,
1064
+ self.delete_comment_reaction,
1065
+ self.get_me,
1066
+ self.get_team_components,
1067
+ self.get_file_components,
1068
+ self.get_component,
1069
+ self.get_team_component_sets,
1070
+ self.get_file_component_sets,
1071
+ self.get_component_set,
1072
+ self.get_team_styles,
1073
+ self.get_file_styles,
1074
+ self.get_style,
1075
+ self.post_webhook,
1076
+ self.get_webhook,
1077
+ self.put_webhook,
1078
+ self.delete_webhook,
1079
+ self.get_team_webhooks,
1080
+ self.get_webhook_requests,
1081
+ self.get_activity_logs,
1082
+ self.get_payments,
1083
+ self.get_local_variables,
1084
+ self.get_published_variables,
1085
+ self.post_variables,
1086
+ self.get_dev_resources,
1087
+ self.post_dev_resources,
1088
+ self.put_dev_resources,
1089
+ self.delete_dev_resource,
1090
+ ]