@tool-bridge/server 0.21.1 → 0.22.1

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 (178) hide show
  1. package/dist/admin.js +170 -0
  2. package/dist/airtable-ML2GIGCH.js +790 -0
  3. package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FGYQAF2A.js} +12 -11
  4. package/dist/{amap-VOX4T2AW.js → amap-G7V65NGK.js} +221 -220
  5. package/dist/anthropic-6ZK24TBB.js +203 -0
  6. package/dist/apify-VDGYHP6W.js +248 -0
  7. package/dist/brave_search-TAATLZOS.js +302 -0
  8. package/dist/chunk-2IAI3XQM.js +302 -0
  9. package/dist/chunk-7ISGFRC6.js +161 -0
  10. package/dist/{chunk-E6JCVKW6.js → chunk-BNMLA2RC.js} +3 -3
  11. package/dist/chunk-HA4BGL6C.js +8429 -0
  12. package/dist/{chunk-KMTT3I6D.js → chunk-RMAWSG7E.js} +19172 -25717
  13. package/dist/{chunk-XYBU3WZH.js → chunk-RTW5VRTK.js} +3 -3
  14. package/dist/chunk-U7PTOA3U.js +7320 -0
  15. package/dist/chunk-UY6ANCOY.js +378 -0
  16. package/dist/{chunk-ATK45BXV.js → chunk-X7ZUTKHR.js} +4 -2
  17. package/dist/circleci-BQ2UWXL2.js +389 -0
  18. package/dist/clerk-2JYWQNOI.js +1019 -0
  19. package/dist/cohere-6MI7AQM4.js +185 -0
  20. package/dist/{confluence-B3EWPZVE.js → confluence-6Y6GDETF.js} +105 -104
  21. package/dist/{convertapi-EUWSQYPF.js → convertapi-HBZCSWOX.js} +32 -31
  22. package/dist/{currencyapi-KVTIK3GL.js → currencyapi-337U5TGI.js} +71 -71
  23. package/dist/deepseek-OSPASO7O.js +210 -0
  24. package/dist/docker_hub-3ATQOY5L.js +933 -0
  25. package/dist/dropbox-LSA4GM2Y.js +1305 -0
  26. package/dist/dub-VZPJSPI6.js +680 -0
  27. package/dist/e2b-6SDYQZL2.js +278 -0
  28. package/dist/exa-B6EUYDVP.js +332 -0
  29. package/dist/{fal_ai-23E7JPNT.js → fal_ai-K4Q27IME.js} +81 -80
  30. package/dist/{feishu-7QRIDUV6.js → feishu-4TKXG4SU.js} +528 -572
  31. package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-7CTEAKRB.js} +57 -53
  32. package/dist/figma-OUKSZLD5.js +777 -0
  33. package/dist/firehydrant-7MOYL7QH.js +563 -0
  34. package/dist/{fixer-BWON27UO.js → fixer-H2BV2NO4.js} +34 -33
  35. package/dist/fly-PXKY6PNH.js +469 -0
  36. package/dist/{front-QCGXYEDJ.js → front-UZYIV5DW.js} +104 -104
  37. package/dist/geocodio-NSYO7TFP.js +213 -0
  38. package/dist/ghost-QBKKQQMF.js +338 -0
  39. package/dist/github-ENLSJ4CL.js +5421 -0
  40. package/dist/gmail-KQSDEB47.js +1887 -0
  41. package/dist/googlecalendar-5YCX4SZF.js +2524 -0
  42. package/dist/{googledocs-BUHL4J2H.js → googledocs-SSWIVFKA.js} +341 -340
  43. package/dist/{grafana-GLU2DWF2.js → grafana-TF2LXDQA.js} +221 -220
  44. package/dist/graphhopper-CURBVHYK.js +325 -0
  45. package/dist/index.d.ts +1132 -332
  46. package/dist/index.js +31 -14
  47. package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-YNVMTZEM.js} +28 -27
  48. package/dist/ipgeolocation_io-NAU7VJ4J.js +315 -0
  49. package/dist/ipqualityscore-OT63L4TI.js +279 -0
  50. package/dist/{jina_ai-EFBHTBXL.js → jina_ai-6WBMBGWM.js} +23 -23
  51. package/dist/{jira-HQSHAA5K.js → jira-DVDVTHNO.js} +118 -117
  52. package/dist/langsmith-IM5N4YAU.js +593 -0
  53. package/dist/lemlist-277SHUQF.js +289 -0
  54. package/dist/{linear-K7RYFYAD.js → linear-AEPH7B5V.js} +327 -326
  55. package/dist/logsnag-VEWRAGBG.js +150 -0
  56. package/dist/main.js +57 -280
  57. package/dist/{mattermost-S2BRCWLQ.js → mattermost-Q3A2BIZA.js} +59 -58
  58. package/dist/mem0-AXS7GZGI.js +544 -0
  59. package/dist/memos-7TXG4ZTU.js +744 -0
  60. package/dist/{metabase-MMSEPCOF.js → metabase-NSVACWQM.js} +90 -89
  61. package/dist/mistral_ai-YZ52RGD4.js +1196 -0
  62. package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-XLLL6FVL.js} +94 -93
  63. package/dist/ngrok-4O4W3WZW.js +356 -0
  64. package/dist/{notes-PFMKRO33.js → notes-YTB3TJOO.js} +11 -9
  65. package/dist/notion-4W4O7J7V.js +940 -0
  66. package/dist/open_exchange_rates-23QJXVO5.js +215 -0
  67. package/dist/openai-ZS7GLSLH.js +800 -0
  68. package/dist/opengraph_io-PMVH7OYI.js +362 -0
  69. package/dist/openrouter-ONRGFNB6.js +441 -0
  70. package/dist/outline-UCUYZZ7J.js +599 -0
  71. package/dist/paddle-35HTKTUL.js +454 -0
  72. package/dist/perplexity-NVOBYN24.js +220 -0
  73. package/dist/pinecone-55CJY73C.js +571 -0
  74. package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-WMCAKS72.js} +99 -98
  75. package/dist/polar-SM4ZM53B.js +395 -0
  76. package/dist/posthog-NWCXVXNJ.js +3464 -0
  77. package/dist/postmark-QJV5PHUQ.js +427 -0
  78. package/dist/{prerender-MENYM2TY.js → prerender-2W7UT4SC.js} +31 -30
  79. package/dist/{pubmed-GOXUVVH5.js → pubmed-VVV7XYLU.js} +239 -238
  80. package/dist/{railway-V2SID4WV.js → railway-KGI57S3O.js} +118 -117
  81. package/dist/readwise-AGHTQB42.js +470 -0
  82. package/dist/render-O4HBROCK.js +461 -0
  83. package/dist/{replicate-756MXPYX.js → replicate-KWBOMX7D.js} +81 -80
  84. package/dist/{resend-ZKH3BTBI.js → resend-DRH6Y6I4.js} +20 -16
  85. package/dist/rootly-XGCUDW6X.js +336 -0
  86. package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-OIQ3OY6L.js} +62 -61
  87. package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-OCZO4FHX.js} +56 -56
  88. package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-CUNGFZOC.js} +16 -16
  89. package/dist/semantic_scholar-3UJRLKES.js +611 -0
  90. package/dist/{sentry-546MNDJG.js → sentry-5BWVZFJV.js} +208 -207
  91. package/dist/{shodan-C3OON3Z3.js → shodan-HI37CTEW.js} +62 -61
  92. package/dist/shopify-LJ2EV2HH.js +610 -0
  93. package/dist/stripe-3LHMV55K.js +585 -0
  94. package/dist/{supabase-U2SL4D63.js → supabase-H2KPX3Q2.js} +245 -244
  95. package/dist/tavily-FBEWGH3Z.js +326 -0
  96. package/dist/telegram-MYYO3JND.js +1767 -0
  97. package/dist/{telnyx-CXQ4EZUX.js → telnyx-H4ALEGAX.js} +57 -56
  98. package/dist/todoist-OBWICA5Q.js +664 -0
  99. package/dist/trello-GUFUJRWO.js +1080 -0
  100. package/dist/turso-NIAK4UMS.js +416 -0
  101. package/dist/{twilio-4PDBJKWX.js → twilio-K6SLK2CX.js} +70 -69
  102. package/dist/umami-42RS2EPS.js +389 -0
  103. package/dist/unsplash-V7TOTETT.js +351 -0
  104. package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-AWQMB6Y3.js} +51 -50
  105. package/dist/uptimerobot-AZC2DHOT.js +483 -0
  106. package/dist/v2ex-4TVRNMLS.js +667 -0
  107. package/dist/vercel-DPHTJ3XR.js +1076 -0
  108. package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-XAG7IXBW.js} +36 -35
  109. package/dist/wordpress-KMPKVGUX.js +812 -0
  110. package/dist/workos-PKB2YR7S.js +664 -0
  111. package/dist/zhihu-Y4H4XYPB.js +254 -0
  112. package/package.json +18 -9
  113. package/dist/airtable-LLZDFN7M.js +0 -789
  114. package/dist/anthropic-G23NN3X5.js +0 -202
  115. package/dist/apify-Y3SS734K.js +0 -247
  116. package/dist/brave_search-ZC7OAPSZ.js +0 -301
  117. package/dist/chunk-R6P4XAE5.js +0 -248
  118. package/dist/chunk-U7B6DS2O.js +0 -977
  119. package/dist/chunk-UZM2RXZH.js +0 -23436
  120. package/dist/circleci-3BAX5FCG.js +0 -388
  121. package/dist/clerk-6LEM6TNU.js +0 -1019
  122. package/dist/cloudflare_dns-KINYTJUD.js +0 -588
  123. package/dist/cohere-XCJ5AJ6B.js +0 -185
  124. package/dist/deepseek-PC5YGNC5.js +0 -209
  125. package/dist/docker_hub-C3MA5FU6.js +0 -932
  126. package/dist/dropbox-XBV7Z2IR.js +0 -1304
  127. package/dist/dub-LDOFG3HC.js +0 -679
  128. package/dist/e2b-JMCPSVBW.js +0 -277
  129. package/dist/exa-RAK7O7RD.js +0 -331
  130. package/dist/figma-E6IX5DTH.js +0 -773
  131. package/dist/firehydrant-ZBLPQREE.js +0 -562
  132. package/dist/fly-ZH3HFCZJ.js +0 -468
  133. package/dist/geocodio-YGNI7DA4.js +0 -212
  134. package/dist/ghost-EVSGKH2Q.js +0 -337
  135. package/dist/github-MA2BGRCJ.js +0 -5420
  136. package/dist/gmail-E5E6AADE.js +0 -1886
  137. package/dist/googlecalendar-BTLFPXTD.js +0 -2523
  138. package/dist/graphhopper-WSMB3TCD.js +0 -324
  139. package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
  140. package/dist/ipqualityscore-BHJXVTJT.js +0 -277
  141. package/dist/langsmith-5W6SCT6F.js +0 -592
  142. package/dist/lemlist-HJWH6UMK.js +0 -288
  143. package/dist/logsnag-4KFOHL37.js +0 -150
  144. package/dist/mem0-CAW43CIC.js +0 -543
  145. package/dist/memos-TWEGPKFM.js +0 -740
  146. package/dist/mistral_ai-64BGZQHP.js +0 -1195
  147. package/dist/ngrok-GQCUGZKJ.js +0 -356
  148. package/dist/notion-DQWZWP4N.js +0 -936
  149. package/dist/open_exchange_rates-QMMD735E.js +0 -214
  150. package/dist/openai-W6PX32NZ.js +0 -799
  151. package/dist/opengraph_io-HNDBXYNW.js +0 -361
  152. package/dist/openrouter-JJYMEAUL.js +0 -437
  153. package/dist/outline-MCBNQZYY.js +0 -595
  154. package/dist/paddle-D2SKLUDN.js +0 -453
  155. package/dist/perplexity-XIFMKUAE.js +0 -219
  156. package/dist/pinecone-HUFTALV2.js +0 -570
  157. package/dist/polar-TYTOMOSR.js +0 -394
  158. package/dist/posthog-43JAR3VW.js +0 -3463
  159. package/dist/postmark-KL2QJYSG.js +0 -426
  160. package/dist/readwise-CI4GIMMJ.js +0 -469
  161. package/dist/render-SUBJ6YRZ.js +0 -460
  162. package/dist/rootly-CD2LJHPI.js +0 -336
  163. package/dist/semantic_scholar-T4A252KW.js +0 -610
  164. package/dist/shopify-Y2HN2MCQ.js +0 -609
  165. package/dist/stripe-VE3CD3AY.js +0 -584
  166. package/dist/tavily-KCZHK6HE.js +0 -326
  167. package/dist/telegram-3URFBCMY.js +0 -1766
  168. package/dist/todoist-HNPWNYTD.js +0 -663
  169. package/dist/trello-3W2MIXRP.js +0 -1079
  170. package/dist/turso-2EQF7C2Z.js +0 -415
  171. package/dist/umami-5REN7TGP.js +0 -388
  172. package/dist/unsplash-EIXL424F.js +0 -350
  173. package/dist/uptimerobot-KNJ3EYLY.js +0 -482
  174. package/dist/v2ex-RHJ234PZ.js +0 -666
  175. package/dist/vercel-AS6NCIC7.js +0 -1075
  176. package/dist/wordpress-KNDAAUV7.js +0 -811
  177. package/dist/workos-R6UITSJ7.js +0 -663
  178. package/dist/zhihu-AGK4HILK.js +0 -253
@@ -1,773 +0,0 @@
1
- import {
2
- createAuthedClient
3
- } from "./chunk-XYBU3WZH.js";
4
- import "./chunk-E6JCVKW6.js";
5
- import {
6
- asJsonObject,
7
- compactDefined,
8
- trimmedText
9
- } from "./chunk-JXHMDBAY.js";
10
- import {
11
- createProviderPlugin
12
- } from "./chunk-ATK45BXV.js";
13
- import "./chunk-U7B6DS2O.js";
14
- import {
15
- TBError,
16
- external_exports
17
- } from "./chunk-UZM2RXZH.js";
18
- import "./chunk-U67V476Y.js";
19
-
20
- // ../plugins/src/figma/api.ts
21
- var SERVICE = "figma";
22
- var API_BASE = "https://api.figma.com";
23
- var http = createAuthedClient({
24
- baseUrl: API_BASE,
25
- service: SERVICE,
26
- auth: { kind: "header", name: "x-figma-token" },
27
- headers: { accept: "application/json" },
28
- // Figma 的错误消息散在六个位置,按上游的顺序找。payload 是纯文本时它本身就是消息。
29
- errorMessage: {
30
- keys: ["message", "err", "error", "status", "error.message", "error.detail"],
31
- fallback: (status) => `Figma \u8FD4\u56DE HTTP ${status}`
32
- },
33
- mapTransportError: () => new TBError("unavailable", "Figma \u8BF7\u6C42\u5931\u8D25", { retryable: true })
34
- });
35
- function requireInput(value, field) {
36
- const result = trimmedText(value);
37
- if (result === void 0) throw new TBError("invalid_argument", `${field} \u4E0D\u80FD\u662F\u7A7A\u767D`);
38
- return result;
39
- }
40
- function joinIds(value) {
41
- if (value === void 0) return void 0;
42
- const joined = value.map((item) => item.trim()).filter((item) => item !== "").join(",");
43
- return joined === "" ? void 0 : joined;
44
- }
45
- function requireIds(value, field) {
46
- const joined = joinIds(value);
47
- if (joined === void 0) throw new TBError("invalid_argument", `${field} \u81F3\u5C11\u8981\u6709\u4E00\u4E2A\u975E\u7A7A\u9879`);
48
- return joined;
49
- }
50
- function requireRecord(value, label) {
51
- const result = asJsonObject(value);
52
- if (result === void 0) throw new TBError("unavailable", `${label}\u4E0D\u662F\u5BF9\u8C61`, { retryable: true });
53
- return result;
54
- }
55
- function requireArray(value, label) {
56
- if (!Array.isArray(value)) throw new TBError("unavailable", `${label}\u4E0D\u662F\u6570\u7EC4`, { retryable: true });
57
- return value;
58
- }
59
- async function request(ctx, input) {
60
- const hasBody = input.body !== void 0;
61
- const { data } = await http.request(ctx, {
62
- path: input.path,
63
- method: input.method ?? "GET",
64
- query: Object.entries(input.query ?? {}),
65
- ...hasBody ? { json: input.body } : {},
66
- // Figma 的错误消息有时是纯文本;成功响应也保留旧实现的原文 payload 语义。
67
- invalidJson: "text"
68
- });
69
- return data ?? null;
70
- }
71
- function fileQuery(input) {
72
- return compactDefined({
73
- version: trimmedText(input.version),
74
- ids: joinIds(input.nodeIds),
75
- depth: input.depth,
76
- geometry: trimmedText(input.geometry),
77
- plugin_data: joinIds(input.pluginData),
78
- branch_data: input.branchData
79
- });
80
- }
81
- async function libraryItems(ctx, path, itemField) {
82
- const raw = requireRecord(await request(ctx, { path }), "Figma \u5E93\u5217\u8868\u54CD\u5E94");
83
- const meta = requireRecord(raw.meta, "Figma \u5E93\u5217\u8868\u7684 meta");
84
- return {
85
- items: requireArray(meta[itemField], `Figma ${itemField} \u5217\u8868`),
86
- // 上游把游标放在 meta.cursor;没有就给空对象,免得消费者要区分"没有"与"没分页"。
87
- pagination: asJsonObject(meta.cursor) ?? {},
88
- raw
89
- };
90
- }
91
- async function libraryItem(ctx, path) {
92
- const raw = requireRecord(await request(ctx, { path }), "Figma \u5E93\u6761\u76EE\u54CD\u5E94");
93
- return {
94
- item: requireRecord(raw.meta, "Figma \u5E93\u6761\u76EE\u7684 meta"),
95
- raw
96
- };
97
- }
98
- function devResourceMutation(payload, field) {
99
- const raw = requireRecord(payload, "Figma dev resource \u53D8\u66F4\u54CD\u5E94");
100
- const links = requireArray(raw[field], `Figma ${field}`);
101
- return {
102
- linksCreated: field === "links_created" ? links : [],
103
- linksUpdated: field === "links_updated" ? links : [],
104
- // errors 不是数组就当没有:上游对这一项容忍,它是附带信息不是主结果。
105
- errors: Array.isArray(raw.errors) ? raw.errors : [],
106
- raw
107
- };
108
- }
109
- function filePath(fileKey, suffix = "") {
110
- return `/v1/files/${encodeURIComponent(requireInput(fileKey, "fileKey"))}${suffix}`;
111
- }
112
- function commentPath(fileKey, commentId, suffix = "") {
113
- return `${filePath(fileKey, "/comments")}/${encodeURIComponent(requireInput(commentId, "commentId"))}${suffix}`;
114
- }
115
- async function getCurrentUser(_input, ctx) {
116
- return { user: requireRecord(await request(ctx, { path: "/v1/me" }), "Figma \u5F53\u524D\u7528\u6237\u54CD\u5E94") };
117
- }
118
- async function getFileMetadata(input, ctx) {
119
- const payload = await request(ctx, { path: filePath(input.fileKey, "/meta") });
120
- return { metadata: requireRecord(payload, "Figma \u6587\u4EF6\u5143\u6570\u636E\u54CD\u5E94") };
121
- }
122
- async function getFile(input, ctx) {
123
- const payload = await request(ctx, { path: filePath(input.fileKey), query: fileQuery(input) });
124
- return { file: requireRecord(payload, "Figma \u6587\u4EF6\u54CD\u5E94") };
125
- }
126
- async function getFileNodes(input, ctx) {
127
- const raw = requireRecord(
128
- await request(ctx, {
129
- path: filePath(input.fileKey, "/nodes"),
130
- query: { ...fileQuery(input), ids: requireIds(input.nodeIds, "nodeIds") }
131
- }),
132
- "Figma \u8282\u70B9\u54CD\u5E94"
133
- );
134
- return {
135
- nodes: requireRecord(raw.nodes, "Figma \u8282\u70B9\u8868"),
136
- raw
137
- };
138
- }
139
- async function renderImages(input, ctx) {
140
- const raw = requireRecord(
141
- await request(ctx, {
142
- path: `/v1/images/${encodeURIComponent(requireInput(input.fileKey, "fileKey"))}`,
143
- query: compactDefined({
144
- ids: requireIds(input.nodeIds, "nodeIds"),
145
- version: trimmedText(input.version),
146
- scale: input.scale,
147
- format: trimmedText(input.format),
148
- svg_include_id: input.svgIncludeId,
149
- svg_simplify_stroke: input.svgSimplifyStroke,
150
- use_absolute_bounds: input.useAbsoluteBounds
151
- })
152
- }),
153
- "Figma \u6E32\u67D3\u54CD\u5E94"
154
- );
155
- return {
156
- images: requireRecord(raw.images, "Figma \u6E32\u67D3\u7ED3\u679C\u8868"),
157
- // err 总是给出来:渲染是"部分成功"的接口,消费者要能一眼看到有没有出错。
158
- err: raw.err === null ? null : trimmedText(raw.err) ?? null,
159
- raw
160
- };
161
- }
162
- async function getImageFills(input, ctx) {
163
- const raw = requireRecord(await request(ctx, { path: filePath(input.fileKey, "/images") }), "Figma \u56FE\u7247\u586B\u5145\u54CD\u5E94");
164
- const meta = requireRecord(raw.meta, "Figma \u56FE\u7247\u586B\u5145\u7684 meta");
165
- return {
166
- images: requireRecord(meta.images, "Figma \u56FE\u7247\u586B\u5145\u8868"),
167
- raw
168
- };
169
- }
170
- async function listFileVersions(input, ctx) {
171
- const raw = requireRecord(
172
- await request(ctx, {
173
- path: filePath(input.fileKey, "/versions"),
174
- query: compactDefined({
175
- page_size: input.pageSize,
176
- before: trimmedText(input.before),
177
- after: trimmedText(input.after)
178
- })
179
- }),
180
- "Figma \u7248\u672C\u5217\u8868\u54CD\u5E94"
181
- );
182
- return {
183
- versions: requireArray(raw.versions, "Figma \u7248\u672C\u5217\u8868"),
184
- pagination: asJsonObject(raw.pagination) ?? {},
185
- raw
186
- };
187
- }
188
- async function listComments(input, ctx) {
189
- const raw = requireRecord(await request(ctx, { path: filePath(input.fileKey, "/comments") }), "Figma \u8BC4\u8BBA\u54CD\u5E94");
190
- return {
191
- comments: requireArray(raw.comments, "Figma \u8BC4\u8BBA\u5217\u8868"),
192
- raw
193
- };
194
- }
195
- async function postComment(input, ctx) {
196
- const payload = await request(ctx, {
197
- method: "POST",
198
- path: filePath(input.fileKey, "/comments"),
199
- body: compactDefined({
200
- message: requireInput(input.message, "message"),
201
- client_meta: asJsonObject(input.clientMeta),
202
- comment_id: trimmedText(input.commentId)
203
- })
204
- });
205
- return { comment: requireRecord(payload, "Figma \u8BC4\u8BBA\u54CD\u5E94") };
206
- }
207
- async function deleteComment(input, ctx) {
208
- await request(ctx, { method: "DELETE", path: commentPath(input.fileKey, input.commentId) });
209
- return { deleted: true };
210
- }
211
- async function listCommentReactions(input, ctx) {
212
- const raw = requireRecord(
213
- await request(ctx, {
214
- path: commentPath(input.fileKey, input.commentId, "/reactions"),
215
- query: compactDefined({ cursor: trimmedText(input.cursor) })
216
- }),
217
- "Figma \u8BC4\u8BBA\u8868\u60C5\u54CD\u5E94"
218
- );
219
- return {
220
- reactions: requireArray(raw.reactions, "Figma \u8BC4\u8BBA\u8868\u60C5\u5217\u8868"),
221
- pagination: asJsonObject(raw.pagination) ?? {},
222
- raw
223
- };
224
- }
225
- async function postCommentReaction(input, ctx) {
226
- await request(ctx, {
227
- method: "POST",
228
- path: commentPath(input.fileKey, input.commentId, "/reactions"),
229
- body: { emoji: requireInput(input.emoji, "emoji") }
230
- });
231
- return { posted: true };
232
- }
233
- async function deleteCommentReaction(input, ctx) {
234
- await request(ctx, {
235
- method: "DELETE",
236
- path: commentPath(input.fileKey, input.commentId, "/reactions"),
237
- // 删表情靠 query 指定是哪一个,不是请求体 —— 上游 API 如此。
238
- query: { emoji: requireInput(input.emoji, "emoji") }
239
- });
240
- return { deleted: true };
241
- }
242
- async function listTeamProjects(input, ctx) {
243
- const raw = requireRecord(
244
- await request(ctx, { path: `/v1/teams/${encodeURIComponent(requireInput(input.teamId, "teamId"))}/projects` }),
245
- "Figma \u56E2\u961F\u9879\u76EE\u54CD\u5E94"
246
- );
247
- return {
248
- projects: requireArray(raw.projects, "Figma \u9879\u76EE\u5217\u8868"),
249
- raw
250
- };
251
- }
252
- async function getProjectMetadata(input, ctx) {
253
- const payload = await request(ctx, {
254
- path: `/v1/projects/${encodeURIComponent(requireInput(input.projectId, "projectId"))}/meta`
255
- });
256
- return { metadata: requireRecord(payload, "Figma \u9879\u76EE\u5143\u6570\u636E\u54CD\u5E94") };
257
- }
258
- async function listProjectFiles(input, ctx) {
259
- const raw = requireRecord(
260
- await request(ctx, {
261
- path: `/v1/projects/${encodeURIComponent(requireInput(input.projectId, "projectId"))}/files`,
262
- query: compactDefined({ branch_data: input.branchData })
263
- }),
264
- "Figma \u9879\u76EE\u6587\u4EF6\u54CD\u5E94"
265
- );
266
- return {
267
- files: requireArray(raw.files, "Figma \u9879\u76EE\u6587\u4EF6\u5217\u8868"),
268
- raw
269
- };
270
- }
271
- async function listFileComponents(input, ctx) {
272
- return libraryItems(ctx, filePath(input.fileKey, "/components"), "components");
273
- }
274
- async function listFileComponentSets(input, ctx) {
275
- return libraryItems(ctx, filePath(input.fileKey, "/component_sets"), "component_sets");
276
- }
277
- async function listFileStyles(input, ctx) {
278
- return libraryItems(ctx, filePath(input.fileKey, "/styles"), "styles");
279
- }
280
- async function getComponent(input, ctx) {
281
- return libraryItem(ctx, `/v1/components/${encodeURIComponent(requireInput(input.key, "key"))}`);
282
- }
283
- async function getComponentSet(input, ctx) {
284
- return libraryItem(ctx, `/v1/component_sets/${encodeURIComponent(requireInput(input.key, "key"))}`);
285
- }
286
- async function getStyle(input, ctx) {
287
- return libraryItem(ctx, `/v1/styles/${encodeURIComponent(requireInput(input.key, "key"))}`);
288
- }
289
- async function getDevResources(input, ctx) {
290
- const raw = requireRecord(
291
- await request(ctx, {
292
- path: filePath(input.fileKey, "/dev_resources"),
293
- query: compactDefined({ node_ids: joinIds(input.nodeIds) })
294
- }),
295
- "Figma dev resource \u54CD\u5E94"
296
- );
297
- return {
298
- devResources: requireArray(raw.dev_resources, "Figma dev resource \u5217\u8868"),
299
- raw
300
- };
301
- }
302
- async function createDevResources(input, ctx) {
303
- const payload = await request(ctx, {
304
- method: "POST",
305
- // 建 dev resource 不在文件路径下:每条自带 file_key,一次可以跨文件建。
306
- path: "/v1/dev_resources",
307
- body: {
308
- dev_resources: input.devResources.map((resource) => ({
309
- name: requireInput(resource.name, "name"),
310
- url: requireInput(resource.url, "url"),
311
- file_key: requireInput(resource.fileKey, "fileKey"),
312
- node_id: requireInput(resource.nodeId, "nodeId")
313
- }))
314
- }
315
- });
316
- return devResourceMutation(payload, "links_created");
317
- }
318
- async function updateDevResources(input, ctx) {
319
- const payload = await request(ctx, {
320
- method: "PUT",
321
- path: "/v1/dev_resources",
322
- body: {
323
- dev_resources: input.devResources.map((resource) => compactDefined({
324
- id: requireInput(resource.id, "id"),
325
- name: trimmedText(resource.name),
326
- url: trimmedText(resource.url)
327
- }))
328
- }
329
- });
330
- return devResourceMutation(payload, "links_updated");
331
- }
332
- async function deleteDevResource(input, ctx) {
333
- await request(ctx, {
334
- method: "DELETE",
335
- path: `${filePath(input.fileKey, "/dev_resources")}/${encodeURIComponent(requireInput(input.devResourceId, "devResourceId"))}`
336
- });
337
- return { deleted: true };
338
- }
339
-
340
- // ../plugins/src/figma/schema.handwritten.ts
341
- var rawObject = external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.");
342
- var rawArray = external_exports.array(rawObject).describe("The raw JSON array returned by the Figma API.");
343
- var updateDevResourcesInput = external_exports.strictObject({
344
- devResources: external_exports.array(
345
- external_exports.strictObject({
346
- id: external_exports.string().min(1).describe("The unique Figma dev resource ID."),
347
- name: external_exports.string().min(1).describe("The new display name for the dev resource.").optional(),
348
- url: external_exports.url().describe("The new URL for the dev resource.").optional()
349
- }).refine(
350
- (resource) => resource.name !== void 0 || resource.url !== void 0,
351
- { message: "at least one of name or url is required", path: ["name"] }
352
- ).describe("A Figma dev resource update. Include at least one of name or url.")
353
- ).min(1).describe("The dev resources to update.")
354
- }).describe("Input parameters for updating Figma dev resources.");
355
- var updateDevResourcesOutput = external_exports.strictObject({
356
- linksCreated: rawArray,
357
- linksUpdated: rawArray,
358
- errors: rawArray,
359
- raw: rawObject
360
- }).describe("The result of creating or updating Figma dev resources.");
361
-
362
- // ../plugins/src/figma/schema.ts
363
- var getCurrentUserInput = external_exports.strictObject({}).describe("No input is required to get the current Figma user.");
364
- var getCurrentUserOutput = external_exports.strictObject({
365
- user: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
366
- }).describe("The current Figma user returned by the connector.");
367
- var getFileMetadataInput = external_exports.strictObject({
368
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL.")
369
- }).describe("Input parameters for reading Figma file metadata.");
370
- var getFileMetadataOutput = external_exports.strictObject({
371
- metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
372
- }).describe("Figma file metadata returned by the connector.");
373
- var getFileInput = external_exports.strictObject({
374
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL."),
375
- version: external_exports.string().min(1).describe("A specific Figma file version ID to read.").optional(),
376
- nodeIds: external_exports.array(external_exports.string().min(1).describe("A Figma node ID.")).min(1).describe("Figma node IDs to fetch or render, for example `1:2` or `123:456`.").optional(),
377
- depth: external_exports.int().min(1).describe("The maximum depth of the document tree to return from Figma.").optional(),
378
- geometry: external_exports.enum(["paths"]).describe("Whether Figma should include vector path geometry.").optional(),
379
- pluginData: external_exports.array(external_exports.string().min(1).describe("A Figma plugin ID.")).min(1).describe("Plugin IDs whose plugin data Figma should include.").optional(),
380
- branchData: external_exports.boolean().describe("Whether Figma should include branch metadata in the response.").optional()
381
- }).describe("Input parameters for reading a Figma file document.");
382
- var getFileOutput = external_exports.strictObject({
383
- file: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
384
- }).describe("Figma file JSON returned by the connector.");
385
- var getFileNodesInput = external_exports.strictObject({
386
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL."),
387
- nodeIds: external_exports.array(external_exports.string().min(1).describe("A Figma node ID.")).min(1).describe("Figma node IDs to fetch or render, for example `1:2` or `123:456`."),
388
- version: external_exports.string().min(1).describe("A specific Figma file version ID to read.").optional(),
389
- depth: external_exports.int().min(1).describe("The maximum depth of the document tree to return from Figma.").optional(),
390
- geometry: external_exports.enum(["paths"]).describe("Whether Figma should include vector path geometry.").optional(),
391
- pluginData: external_exports.array(external_exports.string().min(1).describe("A Figma plugin ID.")).min(1).describe("Plugin IDs whose plugin data Figma should include.").optional()
392
- }).describe("Input parameters for reading selected Figma nodes.");
393
- var getFileNodesOutput = external_exports.strictObject({
394
- nodes: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("Figma nodes keyed by node ID."),
395
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
396
- }).describe("Figma node JSON returned by the connector.");
397
- var renderImagesInput = external_exports.strictObject({
398
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL."),
399
- nodeIds: external_exports.array(external_exports.string().min(1).describe("A Figma node ID.")).min(1).describe("Figma node IDs to fetch or render, for example `1:2` or `123:456`."),
400
- version: external_exports.string().min(1).describe("A specific Figma file version ID to read.").optional(),
401
- scale: external_exports.number().min(0.01).max(4).describe("The image scale factor supported by Figma.").optional(),
402
- format: external_exports.enum(["jpg", "png", "svg", "pdf"]).describe("The image format Figma should render.").optional(),
403
- svgIncludeId: external_exports.boolean().describe("Whether SVG exports should include Figma node IDs.").optional(),
404
- svgSimplifyStroke: external_exports.boolean().describe("Whether SVG exports should simplify inside and outside strokes.").optional(),
405
- useAbsoluteBounds: external_exports.boolean().describe("Whether Figma should use full node bounds when rendering.").optional()
406
- }).describe("Input parameters for rendering Figma file nodes.");
407
- var renderImagesOutput = external_exports.strictObject({
408
- images: external_exports.record(external_exports.string(), external_exports.string().describe("The rendered image URL for a Figma node.").nullable()).describe("Rendered image URLs keyed by node ID. Missing or failed renders may be null."),
409
- err: external_exports.string().describe("The image rendering error returned by Figma.").nullable(),
410
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
411
- }).describe("Figma image rendering URLs returned by the connector.");
412
- var getImageFillsInput = external_exports.strictObject({
413
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL.")
414
- }).describe("Input parameters for reading Figma image fill URLs.");
415
- var getImageFillsOutput = external_exports.strictObject({
416
- images: external_exports.record(external_exports.string(), external_exports.string().describe("The temporary image fill URL.")).describe("Image fill URLs keyed by Figma image reference."),
417
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
418
- }).describe("Figma image fill URLs returned by the connector.");
419
- var listFileVersionsInput = external_exports.strictObject({
420
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL."),
421
- pageSize: external_exports.int().min(1).describe("The maximum number of versions to request from Figma.").optional(),
422
- before: external_exports.string().min(1).describe("A pagination cursor requesting versions before this cursor.").optional(),
423
- after: external_exports.string().min(1).describe("A pagination cursor requesting versions after this cursor.").optional()
424
- }).describe("Input parameters for listing Figma file versions.");
425
- var listFileVersionsOutput = external_exports.strictObject({
426
- versions: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The Figma file versions."),
427
- pagination: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API."),
428
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
429
- }).describe("Figma file versions returned by the connector.");
430
- var listCommentsInput = external_exports.strictObject({
431
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL.")
432
- }).describe("Input parameters for listing Figma comments.");
433
- var listCommentsOutput = external_exports.strictObject({
434
- comments: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The comments returned by Figma."),
435
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
436
- }).describe("Figma comments returned by the connector.");
437
- var postCommentInput = external_exports.strictObject({
438
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL."),
439
- message: external_exports.string().min(1).describe("The comment message to post."),
440
- clientMeta: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.").optional(),
441
- commentId: external_exports.string().min(1).describe("An optional parent comment ID to reply to.").optional()
442
- }).describe("Input parameters for posting a Figma comment.");
443
- var postCommentOutput = external_exports.strictObject({
444
- comment: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
445
- }).describe("A Figma comment result returned by the connector.");
446
- var deleteCommentInput = external_exports.strictObject({
447
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL."),
448
- commentId: external_exports.string().min(1).describe("The Figma comment ID.")
449
- }).describe("Input parameters for deleting a Figma comment.");
450
- var deleteCommentOutput = external_exports.strictObject({
451
- deleted: external_exports.boolean().describe("Whether the delete request completed successfully.")
452
- }).describe("The result of deleting a Figma comment.");
453
- var listCommentReactionsInput = external_exports.strictObject({
454
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL."),
455
- commentId: external_exports.string().min(1).describe("The Figma comment ID."),
456
- cursor: external_exports.string().min(1).describe("A pagination cursor returned by Figma.").optional()
457
- }).describe("Input parameters for listing Figma comment reactions.");
458
- var listCommentReactionsOutput = external_exports.strictObject({
459
- reactions: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The raw JSON array returned by the Figma API."),
460
- pagination: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API."),
461
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
462
- }).describe("Figma comment reactions returned by the connector.");
463
- var postCommentReactionInput = external_exports.strictObject({
464
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL."),
465
- commentId: external_exports.string().min(1).describe("The Figma comment ID."),
466
- emoji: external_exports.string().min(1).describe("The emoji reaction shortcode to add or delete.")
467
- }).describe("Input parameters for adding a Figma comment reaction.");
468
- var postCommentReactionOutput = external_exports.strictObject({
469
- posted: external_exports.boolean().describe("Whether the reaction request completed successfully.")
470
- }).describe("A Figma comment reaction result.");
471
- var deleteCommentReactionInput = external_exports.strictObject({
472
- fileKey: external_exports.string().min(1).describe("The Figma file key or branch key from a Figma file URL."),
473
- commentId: external_exports.string().min(1).describe("The Figma comment ID."),
474
- emoji: external_exports.string().min(1).describe("The emoji reaction shortcode to add or delete.")
475
- }).describe("Input parameters for deleting a Figma comment reaction.");
476
- var deleteCommentReactionOutput = external_exports.strictObject({
477
- deleted: external_exports.boolean().describe("Whether the delete request completed successfully.")
478
- }).describe("The result of deleting a Figma comment reaction.");
479
- var listTeamProjectsInput = external_exports.strictObject({
480
- teamId: external_exports.string().min(1).describe("The Figma team ID from a Figma team URL.")
481
- }).describe("Input parameters for listing Figma team projects.");
482
- var listTeamProjectsOutput = external_exports.strictObject({
483
- projects: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The raw JSON array returned by the Figma API."),
484
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
485
- }).describe("Figma projects returned by the connector.");
486
- var getProjectMetadataInput = external_exports.strictObject({
487
- projectId: external_exports.string().min(1).describe("The Figma project ID.")
488
- }).describe("Input parameters for reading Figma project metadata.");
489
- var getProjectMetadataOutput = external_exports.strictObject({
490
- metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
491
- }).describe("Figma project metadata returned by the connector.");
492
- var listProjectFilesInput = external_exports.strictObject({
493
- projectId: external_exports.string().min(1).describe("The Figma project ID."),
494
- branchData: external_exports.boolean().describe("Whether Figma should include branch metadata for files.").optional()
495
- }).describe("Input parameters for listing Figma project files.");
496
- var listProjectFilesOutput = external_exports.strictObject({
497
- files: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The raw JSON array returned by the Figma API."),
498
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
499
- }).describe("Figma project files returned by the connector.");
500
- var listFileComponentsInput = external_exports.strictObject({
501
- fileKey: external_exports.string().min(1).describe("The main Figma file key from a Figma file URL.")
502
- }).describe("Input parameters for listing Figma file components.");
503
- var listFileComponentsOutput = external_exports.strictObject({
504
- items: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The raw JSON array returned by the Figma API."),
505
- pagination: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API."),
506
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
507
- }).describe("Figma library items returned by the connector.");
508
- var listFileComponentSetsInput = external_exports.strictObject({
509
- fileKey: external_exports.string().min(1).describe("The main Figma file key from a Figma file URL.")
510
- }).describe("Input parameters for listing Figma file component sets.");
511
- var listFileComponentSetsOutput = external_exports.strictObject({
512
- items: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The raw JSON array returned by the Figma API."),
513
- pagination: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API."),
514
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
515
- }).describe("Figma library items returned by the connector.");
516
- var listFileStylesInput = external_exports.strictObject({
517
- fileKey: external_exports.string().min(1).describe("The main Figma file key from a Figma file URL.")
518
- }).describe("Input parameters for listing Figma file styles.");
519
- var listFileStylesOutput = external_exports.strictObject({
520
- items: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The raw JSON array returned by the Figma API."),
521
- pagination: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API."),
522
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
523
- }).describe("Figma library items returned by the connector.");
524
- var getComponentInput = external_exports.strictObject({
525
- key: external_exports.string().min(1).describe("The unique Figma library asset key.")
526
- }).describe("Input parameters for reading a Figma component.");
527
- var getComponentOutput = external_exports.strictObject({
528
- item: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API."),
529
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
530
- }).describe("A Figma library item returned by the connector.");
531
- var getComponentSetInput = external_exports.strictObject({
532
- key: external_exports.string().min(1).describe("The unique Figma library asset key.")
533
- }).describe("Input parameters for reading a Figma component set.");
534
- var getComponentSetOutput = external_exports.strictObject({
535
- item: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API."),
536
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
537
- }).describe("A Figma library item returned by the connector.");
538
- var getStyleInput = external_exports.strictObject({
539
- key: external_exports.string().min(1).describe("The unique Figma library asset key.")
540
- }).describe("Input parameters for reading a Figma style.");
541
- var getStyleOutput = external_exports.strictObject({
542
- item: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API."),
543
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
544
- }).describe("A Figma library item returned by the connector.");
545
- var getDevResourcesInput = external_exports.strictObject({
546
- fileKey: external_exports.string().min(1).describe("The main Figma file key from a Figma file URL."),
547
- nodeIds: external_exports.array(external_exports.string().min(1).describe("A Figma node ID.")).min(1).describe("Figma node IDs to fetch or render, for example `1:2` or `123:456`.").optional()
548
- }).describe("Input parameters for reading Figma dev resources.");
549
- var getDevResourcesOutput = external_exports.strictObject({
550
- devResources: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The raw JSON array returned by the Figma API."),
551
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
552
- }).describe("Figma dev resources returned by the connector.");
553
- var createDevResourcesInput = external_exports.strictObject({
554
- devResources: external_exports.array(external_exports.strictObject({
555
- name: external_exports.string().min(1).describe("The display name for the dev resource."),
556
- url: external_exports.url().describe("The URL of the dev resource."),
557
- fileKey: external_exports.string().min(1).describe("The main Figma file key from a Figma file URL."),
558
- nodeId: external_exports.string().min(1).describe("The Figma node ID to attach the dev resource to.")
559
- }).describe("A Figma dev resource to create.")).min(1).describe("The dev resources to create.")
560
- }).describe("Input parameters for creating Figma dev resources.");
561
- var createDevResourcesOutput = external_exports.strictObject({
562
- linksCreated: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The raw JSON array returned by the Figma API."),
563
- linksUpdated: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The raw JSON array returned by the Figma API."),
564
- errors: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")).describe("The raw JSON array returned by the Figma API."),
565
- raw: external_exports.record(external_exports.string(), external_exports.unknown().describe("A raw Figma API value.")).describe("The raw JSON object returned by the Figma API.")
566
- }).describe("The result of creating or updating Figma dev resources.");
567
- var deleteDevResourceInput = external_exports.strictObject({
568
- fileKey: external_exports.string().min(1).describe("The main Figma file key from a Figma file URL."),
569
- devResourceId: external_exports.string().min(1).describe("The Figma dev resource ID to delete.")
570
- }).describe("Input parameters for deleting a Figma dev resource.");
571
- var deleteDevResourceOutput = external_exports.strictObject({
572
- deleted: external_exports.boolean().describe("Whether the delete request completed successfully.")
573
- }).describe("The result of deleting a Figma dev resource.");
574
- var figmaActions = {
575
- get_current_user: {
576
- description: "Get the current Figma user associated with the credential.",
577
- effect: "read",
578
- inputSchema: getCurrentUserInput,
579
- outputSchema: external_exports.toJSONSchema(getCurrentUserOutput, { io: "output", unrepresentable: "any" })
580
- },
581
- get_file_metadata: {
582
- description: "Get lightweight metadata for a Figma file without fetching its full document.",
583
- effect: "read",
584
- inputSchema: getFileMetadataInput,
585
- outputSchema: external_exports.toJSONSchema(getFileMetadataOutput, { io: "output", unrepresentable: "any" })
586
- },
587
- get_file: {
588
- description: "Get the JSON document for a Figma file or branch.",
589
- effect: "read",
590
- inputSchema: getFileInput,
591
- outputSchema: external_exports.toJSONSchema(getFileOutput, { io: "output", unrepresentable: "any" })
592
- },
593
- get_file_nodes: {
594
- description: "Get JSON for selected node IDs from a Figma file or branch.",
595
- effect: "read",
596
- inputSchema: getFileNodesInput,
597
- outputSchema: external_exports.toJSONSchema(getFileNodesOutput, { io: "output", unrepresentable: "any" })
598
- },
599
- render_images: {
600
- description: "Render selected Figma file nodes and return temporary image URLs.",
601
- effect: "write",
602
- inputSchema: renderImagesInput,
603
- outputSchema: external_exports.toJSONSchema(renderImagesOutput, { io: "output", unrepresentable: "any" })
604
- },
605
- get_image_fills: {
606
- description: "Get temporary download URLs for image fills used in a Figma file.",
607
- effect: "read",
608
- inputSchema: getImageFillsInput,
609
- outputSchema: external_exports.toJSONSchema(getImageFillsOutput, { io: "output", unrepresentable: "any" })
610
- },
611
- list_file_versions: {
612
- description: "List version history records for a Figma file.",
613
- effect: "read",
614
- inputSchema: listFileVersionsInput,
615
- outputSchema: external_exports.toJSONSchema(listFileVersionsOutput, { io: "output", unrepresentable: "any" })
616
- },
617
- list_comments: {
618
- description: "List comments on a Figma file or branch.",
619
- effect: "read",
620
- inputSchema: listCommentsInput,
621
- outputSchema: external_exports.toJSONSchema(listCommentsOutput, { io: "output", unrepresentable: "any" })
622
- },
623
- post_comment: {
624
- description: "Post a comment on a Figma file or branch.",
625
- effect: "write",
626
- inputSchema: postCommentInput,
627
- outputSchema: external_exports.toJSONSchema(postCommentOutput, { io: "output", unrepresentable: "any" })
628
- },
629
- delete_comment: {
630
- description: "Delete a Figma comment created by the authenticated user.",
631
- effect: "destructive",
632
- inputSchema: deleteCommentInput,
633
- outputSchema: external_exports.toJSONSchema(deleteCommentOutput, { io: "output", unrepresentable: "any" })
634
- },
635
- list_comment_reactions: {
636
- description: "List emoji reactions on a Figma file comment.",
637
- effect: "read",
638
- inputSchema: listCommentReactionsInput,
639
- outputSchema: external_exports.toJSONSchema(listCommentReactionsOutput, { io: "output", unrepresentable: "any" })
640
- },
641
- post_comment_reaction: {
642
- description: "Add an emoji reaction to a Figma file comment.",
643
- effect: "write",
644
- inputSchema: postCommentReactionInput,
645
- outputSchema: external_exports.toJSONSchema(postCommentReactionOutput, { io: "output", unrepresentable: "any" })
646
- },
647
- delete_comment_reaction: {
648
- description: "Delete an emoji reaction created by the authenticated user.",
649
- effect: "destructive",
650
- inputSchema: deleteCommentReactionInput,
651
- outputSchema: external_exports.toJSONSchema(deleteCommentReactionOutput, { io: "output", unrepresentable: "any" })
652
- },
653
- list_team_projects: {
654
- description: "List projects visible to the authenticated user in a Figma team.",
655
- effect: "read",
656
- inputSchema: listTeamProjectsInput,
657
- outputSchema: external_exports.toJSONSchema(listTeamProjectsOutput, { io: "output", unrepresentable: "any" })
658
- },
659
- get_project_metadata: {
660
- description: "Get metadata for a Figma project.",
661
- effect: "read",
662
- inputSchema: getProjectMetadataInput,
663
- outputSchema: external_exports.toJSONSchema(getProjectMetadataOutput, { io: "output", unrepresentable: "any" })
664
- },
665
- list_project_files: {
666
- description: "List files in a Figma project.",
667
- effect: "read",
668
- inputSchema: listProjectFilesInput,
669
- outputSchema: external_exports.toJSONSchema(listProjectFilesOutput, { io: "output", unrepresentable: "any" })
670
- },
671
- list_file_components: {
672
- description: "List published components in a Figma main file library.",
673
- effect: "read",
674
- inputSchema: listFileComponentsInput,
675
- outputSchema: external_exports.toJSONSchema(listFileComponentsOutput, { io: "output", unrepresentable: "any" })
676
- },
677
- list_file_component_sets: {
678
- description: "List published component sets in a Figma main file library.",
679
- effect: "read",
680
- inputSchema: listFileComponentSetsInput,
681
- outputSchema: external_exports.toJSONSchema(listFileComponentSetsOutput, { io: "output", unrepresentable: "any" })
682
- },
683
- list_file_styles: {
684
- description: "List published styles in a Figma main file library.",
685
- effect: "read",
686
- inputSchema: listFileStylesInput,
687
- outputSchema: external_exports.toJSONSchema(listFileStylesOutput, { io: "output", unrepresentable: "any" })
688
- },
689
- get_component: {
690
- description: "Get metadata for a published Figma component by key.",
691
- effect: "read",
692
- inputSchema: getComponentInput,
693
- outputSchema: external_exports.toJSONSchema(getComponentOutput, { io: "output", unrepresentable: "any" })
694
- },
695
- get_component_set: {
696
- description: "Get metadata for a published Figma component set by key.",
697
- effect: "read",
698
- inputSchema: getComponentSetInput,
699
- outputSchema: external_exports.toJSONSchema(getComponentSetOutput, { io: "output", unrepresentable: "any" })
700
- },
701
- get_style: {
702
- description: "Get metadata for a published Figma style by key.",
703
- effect: "read",
704
- inputSchema: getStyleInput,
705
- outputSchema: external_exports.toJSONSchema(getStyleOutput, { io: "output", unrepresentable: "any" })
706
- },
707
- get_dev_resources: {
708
- description: "Get dev resources attached to a Figma main file.",
709
- effect: "read",
710
- inputSchema: getDevResourcesInput,
711
- outputSchema: external_exports.toJSONSchema(getDevResourcesOutput, { io: "output", unrepresentable: "any" })
712
- },
713
- create_dev_resources: {
714
- description: "Create dev resources and attach them to Figma file nodes.",
715
- effect: "write",
716
- inputSchema: createDevResourcesInput,
717
- outputSchema: external_exports.toJSONSchema(createDevResourcesOutput, { io: "output", unrepresentable: "any" })
718
- },
719
- update_dev_resources: {
720
- description: "Update existing Figma dev resources.",
721
- effect: "write",
722
- inputSchema: updateDevResourcesInput,
723
- outputSchema: external_exports.toJSONSchema(updateDevResourcesOutput, { io: "output", unrepresentable: "any" })
724
- },
725
- delete_dev_resource: {
726
- description: "Delete a Figma dev resource from a main file.",
727
- effect: "destructive",
728
- inputSchema: deleteDevResourceInput,
729
- outputSchema: external_exports.toJSONSchema(deleteDevResourceOutput, { io: "output", unrepresentable: "any" })
730
- }
731
- };
732
-
733
- // ../plugins/src/figma/index.ts
734
- function createFigmaPlugin() {
735
- return createProviderPlugin({
736
- description: "Figma",
737
- actions: figmaActions,
738
- credentialProbe: "get_current_user",
739
- handlers: {
740
- get_current_user: getCurrentUser,
741
- get_file_metadata: getFileMetadata,
742
- get_file: getFile,
743
- get_file_nodes: getFileNodes,
744
- render_images: renderImages,
745
- get_image_fills: getImageFills,
746
- list_file_versions: listFileVersions,
747
- list_comments: listComments,
748
- post_comment: postComment,
749
- delete_comment: deleteComment,
750
- list_comment_reactions: listCommentReactions,
751
- post_comment_reaction: postCommentReaction,
752
- delete_comment_reaction: deleteCommentReaction,
753
- list_team_projects: listTeamProjects,
754
- get_project_metadata: getProjectMetadata,
755
- list_project_files: listProjectFiles,
756
- list_file_components: listFileComponents,
757
- list_file_component_sets: listFileComponentSets,
758
- list_file_styles: listFileStyles,
759
- get_component: getComponent,
760
- get_component_set: getComponentSet,
761
- get_style: getStyle,
762
- get_dev_resources: getDevResources,
763
- create_dev_resources: createDevResources,
764
- update_dev_resources: updateDevResources,
765
- delete_dev_resource: deleteDevResource
766
- }
767
- });
768
- }
769
- var figma_default = createFigmaPlugin();
770
- export {
771
- createFigmaPlugin,
772
- figma_default as default
773
- };