figma-inspect-cli 0.1.0

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 (430) hide show
  1. package/README.md +156 -0
  2. package/dist/bin/figma-inspect.d.ts +3 -0
  3. package/dist/bin/figma-inspect.d.ts.map +1 -0
  4. package/dist/bin/figma-inspect.js +19 -0
  5. package/dist/bin/figma-inspect.js.map +1 -0
  6. package/dist/cli/errors.d.ts +3 -0
  7. package/dist/cli/errors.d.ts.map +1 -0
  8. package/dist/cli/errors.js +3 -0
  9. package/dist/cli/errors.js.map +1 -0
  10. package/dist/cli/export-component-set.d.ts +21 -0
  11. package/dist/cli/export-component-set.d.ts.map +1 -0
  12. package/dist/cli/export-component-set.js +173 -0
  13. package/dist/cli/export-component-set.js.map +1 -0
  14. package/dist/cli/export-contract.d.ts +20 -0
  15. package/dist/cli/export-contract.d.ts.map +1 -0
  16. package/dist/cli/export-contract.js +48 -0
  17. package/dist/cli/export-contract.js.map +1 -0
  18. package/dist/cli/export-node-contract.d.ts +17 -0
  19. package/dist/cli/export-node-contract.d.ts.map +1 -0
  20. package/dist/cli/export-node-contract.js +93 -0
  21. package/dist/cli/export-node-contract.js.map +1 -0
  22. package/dist/cli/export-result.d.ts +17 -0
  23. package/dist/cli/export-result.d.ts.map +1 -0
  24. package/dist/cli/export-result.js +22 -0
  25. package/dist/cli/export-result.js.map +1 -0
  26. package/dist/cli/export-team-index.d.ts +18 -0
  27. package/dist/cli/export-team-index.d.ts.map +1 -0
  28. package/dist/cli/export-team-index.js +121 -0
  29. package/dist/cli/export-team-index.js.map +1 -0
  30. package/dist/cli/index.d.ts +3 -0
  31. package/dist/cli/index.d.ts.map +1 -0
  32. package/dist/cli/index.js +3 -0
  33. package/dist/cli/index.js.map +1 -0
  34. package/dist/cli/output.d.ts +13 -0
  35. package/dist/cli/output.d.ts.map +1 -0
  36. package/dist/cli/output.js +26 -0
  37. package/dist/cli/output.js.map +1 -0
  38. package/dist/cli/parse-args.d.ts +3 -0
  39. package/dist/cli/parse-args.d.ts.map +1 -0
  40. package/dist/cli/parse-args.js +790 -0
  41. package/dist/cli/parse-args.js.map +1 -0
  42. package/dist/cli/run-cli.d.ts +3 -0
  43. package/dist/cli/run-cli.d.ts.map +1 -0
  44. package/dist/cli/run-cli.js +416 -0
  45. package/dist/cli/run-cli.js.map +1 -0
  46. package/dist/cli/types.d.ts +114 -0
  47. package/dist/cli/types.d.ts.map +1 -0
  48. package/dist/cli/types.js +2 -0
  49. package/dist/cli/types.js.map +1 -0
  50. package/dist/cli/usage.d.ts +2 -0
  51. package/dist/cli/usage.d.ts.map +1 -0
  52. package/dist/cli/usage.js +75 -0
  53. package/dist/cli/usage.js.map +1 -0
  54. package/dist/figma-api/cache/cached-request.d.ts +8 -0
  55. package/dist/figma-api/cache/cached-request.d.ts.map +1 -0
  56. package/dist/figma-api/cache/cached-request.js +100 -0
  57. package/dist/figma-api/cache/cached-request.js.map +1 -0
  58. package/dist/figma-api/cache/constants.d.ts +5 -0
  59. package/dist/figma-api/cache/constants.d.ts.map +1 -0
  60. package/dist/figma-api/cache/constants.js +5 -0
  61. package/dist/figma-api/cache/constants.js.map +1 -0
  62. package/dist/figma-api/cache/extract-metadata.d.ts +3 -0
  63. package/dist/figma-api/cache/extract-metadata.d.ts.map +1 -0
  64. package/dist/figma-api/cache/extract-metadata.js +13 -0
  65. package/dist/figma-api/cache/extract-metadata.js.map +1 -0
  66. package/dist/figma-api/cache/index.d.ts +3 -0
  67. package/dist/figma-api/cache/index.d.ts.map +1 -0
  68. package/dist/figma-api/cache/index.js +3 -0
  69. package/dist/figma-api/cache/index.js.map +1 -0
  70. package/dist/figma-api/cache/store.d.ts +10 -0
  71. package/dist/figma-api/cache/store.d.ts.map +1 -0
  72. package/dist/figma-api/cache/store.js +53 -0
  73. package/dist/figma-api/cache/store.js.map +1 -0
  74. package/dist/figma-api/cache/types.d.ts +20 -0
  75. package/dist/figma-api/cache/types.d.ts.map +1 -0
  76. package/dist/figma-api/cache/types.js +2 -0
  77. package/dist/figma-api/cache/types.js.map +1 -0
  78. package/dist/figma-api/cache/url.d.ts +5 -0
  79. package/dist/figma-api/cache/url.d.ts.map +1 -0
  80. package/dist/figma-api/cache/url.js +20 -0
  81. package/dist/figma-api/cache/url.js.map +1 -0
  82. package/dist/figma-api/constants.d.ts +2 -0
  83. package/dist/figma-api/constants.d.ts.map +1 -0
  84. package/dist/figma-api/constants.js +2 -0
  85. package/dist/figma-api/constants.js.map +1 -0
  86. package/dist/figma-api/fetch-with-retry.d.ts +2 -0
  87. package/dist/figma-api/fetch-with-retry.d.ts.map +1 -0
  88. package/dist/figma-api/fetch-with-retry.js +48 -0
  89. package/dist/figma-api/fetch-with-retry.js.map +1 -0
  90. package/dist/figma-api/figma-api-error.d.ts +4 -0
  91. package/dist/figma-api/figma-api-error.d.ts.map +1 -0
  92. package/dist/figma-api/figma-api-error.js +7 -0
  93. package/dist/figma-api/figma-api-error.js.map +1 -0
  94. package/dist/figma-api/figma-request.d.ts +2 -0
  95. package/dist/figma-api/figma-request.d.ts.map +1 -0
  96. package/dist/figma-api/figma-request.js +21 -0
  97. package/dist/figma-api/figma-request.js.map +1 -0
  98. package/dist/figma-api/format-figma-error.d.ts +2 -0
  99. package/dist/figma-api/format-figma-error.d.ts.map +1 -0
  100. package/dist/figma-api/format-figma-error.js +24 -0
  101. package/dist/figma-api/format-figma-error.js.map +1 -0
  102. package/dist/figma-api/get-component-set.d.ts +4 -0
  103. package/dist/figma-api/get-component-set.d.ts.map +1 -0
  104. package/dist/figma-api/get-component-set.js +8 -0
  105. package/dist/figma-api/get-component-set.js.map +1 -0
  106. package/dist/figma-api/get-file-images.d.ts +4 -0
  107. package/dist/figma-api/get-file-images.d.ts.map +1 -0
  108. package/dist/figma-api/get-file-images.js +45 -0
  109. package/dist/figma-api/get-file-images.js.map +1 -0
  110. package/dist/figma-api/get-file-node.d.ts +3 -0
  111. package/dist/figma-api/get-file-node.d.ts.map +1 -0
  112. package/dist/figma-api/get-file-node.js +8 -0
  113. package/dist/figma-api/get-file-node.js.map +1 -0
  114. package/dist/figma-api/get-file.d.ts +3 -0
  115. package/dist/figma-api/get-file.d.ts.map +1 -0
  116. package/dist/figma-api/get-file.js +6 -0
  117. package/dist/figma-api/get-file.js.map +1 -0
  118. package/dist/figma-api/index.d.ts +11 -0
  119. package/dist/figma-api/index.d.ts.map +1 -0
  120. package/dist/figma-api/index.js +11 -0
  121. package/dist/figma-api/index.js.map +1 -0
  122. package/dist/figma-api/list-file-component-sets.d.ts +4 -0
  123. package/dist/figma-api/list-file-component-sets.d.ts.map +1 -0
  124. package/dist/figma-api/list-file-component-sets.js +8 -0
  125. package/dist/figma-api/list-file-component-sets.js.map +1 -0
  126. package/dist/figma-api/list-file-components.d.ts +5 -0
  127. package/dist/figma-api/list-file-components.d.ts.map +1 -0
  128. package/dist/figma-api/list-file-components.js +13 -0
  129. package/dist/figma-api/list-file-components.js.map +1 -0
  130. package/dist/figma-api/list-file-pages.d.ts +4 -0
  131. package/dist/figma-api/list-file-pages.d.ts.map +1 -0
  132. package/dist/figma-api/list-file-pages.js +10 -0
  133. package/dist/figma-api/list-file-pages.js.map +1 -0
  134. package/dist/figma-api/list-project-files.d.ts +4 -0
  135. package/dist/figma-api/list-project-files.d.ts.map +1 -0
  136. package/dist/figma-api/list-project-files.js +8 -0
  137. package/dist/figma-api/list-project-files.js.map +1 -0
  138. package/dist/figma-api/list-team-component-sets.d.ts +4 -0
  139. package/dist/figma-api/list-team-component-sets.d.ts.map +1 -0
  140. package/dist/figma-api/list-team-component-sets.js +19 -0
  141. package/dist/figma-api/list-team-component-sets.js.map +1 -0
  142. package/dist/figma-api/list-team-project-files.d.ts +4 -0
  143. package/dist/figma-api/list-team-project-files.d.ts.map +1 -0
  144. package/dist/figma-api/list-team-project-files.js +19 -0
  145. package/dist/figma-api/list-team-project-files.js.map +1 -0
  146. package/dist/figma-api/list-team-projects.d.ts +4 -0
  147. package/dist/figma-api/list-team-projects.d.ts.map +1 -0
  148. package/dist/figma-api/list-team-projects.js +8 -0
  149. package/dist/figma-api/list-team-projects.js.map +1 -0
  150. package/dist/figma-api/schemas.d.ts +95 -0
  151. package/dist/figma-api/schemas.d.ts.map +1 -0
  152. package/dist/figma-api/schemas.js +154 -0
  153. package/dist/figma-api/schemas.js.map +1 -0
  154. package/dist/figma-api/types.d.ts +60 -0
  155. package/dist/figma-api/types.d.ts.map +1 -0
  156. package/dist/figma-api/types.js +2 -0
  157. package/dist/figma-api/types.js.map +1 -0
  158. package/dist/inspect/component-set-context.d.ts +11 -0
  159. package/dist/inspect/component-set-context.d.ts.map +1 -0
  160. package/dist/inspect/component-set-context.js +71 -0
  161. package/dist/inspect/component-set-context.js.map +1 -0
  162. package/dist/inspect/component-set-lookup.d.ts +6 -0
  163. package/dist/inspect/component-set-lookup.d.ts.map +1 -0
  164. package/dist/inspect/component-set-lookup.js +40 -0
  165. package/dist/inspect/component-set-lookup.js.map +1 -0
  166. package/dist/inspect/component-set-pseudocode/asset-backed-contract.d.ts +3 -0
  167. package/dist/inspect/component-set-pseudocode/asset-backed-contract.d.ts.map +1 -0
  168. package/dist/inspect/component-set-pseudocode/asset-backed-contract.js +34 -0
  169. package/dist/inspect/component-set-pseudocode/asset-backed-contract.js.map +1 -0
  170. package/dist/inspect/component-set-pseudocode/assets-contract.d.ts +9 -0
  171. package/dist/inspect/component-set-pseudocode/assets-contract.d.ts.map +1 -0
  172. package/dist/inspect/component-set-pseudocode/assets-contract.js +4 -0
  173. package/dist/inspect/component-set-pseudocode/assets-contract.js.map +1 -0
  174. package/dist/inspect/component-set-pseudocode/baseline-contract.d.ts +17 -0
  175. package/dist/inspect/component-set-pseudocode/baseline-contract.d.ts.map +1 -0
  176. package/dist/inspect/component-set-pseudocode/baseline-contract.js +67 -0
  177. package/dist/inspect/component-set-pseudocode/baseline-contract.js.map +1 -0
  178. package/dist/inspect/component-set-pseudocode/build-pseudocode.d.ts +24 -0
  179. package/dist/inspect/component-set-pseudocode/build-pseudocode.d.ts.map +1 -0
  180. package/dist/inspect/component-set-pseudocode/build-pseudocode.js +83 -0
  181. package/dist/inspect/component-set-pseudocode/build-pseudocode.js.map +1 -0
  182. package/dist/inspect/component-set-pseudocode/index.d.ts +2 -0
  183. package/dist/inspect/component-set-pseudocode/index.d.ts.map +1 -0
  184. package/dist/inspect/component-set-pseudocode/index.js +2 -0
  185. package/dist/inspect/component-set-pseudocode/index.js.map +1 -0
  186. package/dist/inspect/component-set-pseudocode/infer.d.ts +4 -0
  187. package/dist/inspect/component-set-pseudocode/infer.d.ts.map +1 -0
  188. package/dist/inspect/component-set-pseudocode/infer.js +426 -0
  189. package/dist/inspect/component-set-pseudocode/infer.js.map +1 -0
  190. package/dist/inspect/component-set-pseudocode/meta-contract.d.ts +27 -0
  191. package/dist/inspect/component-set-pseudocode/meta-contract.d.ts.map +1 -0
  192. package/dist/inspect/component-set-pseudocode/meta-contract.js +136 -0
  193. package/dist/inspect/component-set-pseudocode/meta-contract.js.map +1 -0
  194. package/dist/inspect/component-set-pseudocode/slim-node-guards.d.ts +14 -0
  195. package/dist/inspect/component-set-pseudocode/slim-node-guards.d.ts.map +1 -0
  196. package/dist/inspect/component-set-pseudocode/slim-node-guards.js +28 -0
  197. package/dist/inspect/component-set-pseudocode/slim-node-guards.js.map +1 -0
  198. package/dist/inspect/component-set-pseudocode/structure-contract.d.ts +71 -0
  199. package/dist/inspect/component-set-pseudocode/structure-contract.d.ts.map +1 -0
  200. package/dist/inspect/component-set-pseudocode/structure-contract.js +281 -0
  201. package/dist/inspect/component-set-pseudocode/structure-contract.js.map +1 -0
  202. package/dist/inspect/component-set-pseudocode/structure-dsl.d.ts +3 -0
  203. package/dist/inspect/component-set-pseudocode/structure-dsl.d.ts.map +1 -0
  204. package/dist/inspect/component-set-pseudocode/structure-dsl.js +170 -0
  205. package/dist/inspect/component-set-pseudocode/structure-dsl.js.map +1 -0
  206. package/dist/inspect/component-set-pseudocode/types.d.ts +44 -0
  207. package/dist/inspect/component-set-pseudocode/types.d.ts.map +1 -0
  208. package/dist/inspect/component-set-pseudocode/types.js +2 -0
  209. package/dist/inspect/component-set-pseudocode/types.js.map +1 -0
  210. package/dist/inspect/component-set-pseudocode/universal.d.ts +14 -0
  211. package/dist/inspect/component-set-pseudocode/universal.d.ts.map +1 -0
  212. package/dist/inspect/component-set-pseudocode/universal.js +393 -0
  213. package/dist/inspect/component-set-pseudocode/universal.js.map +1 -0
  214. package/dist/inspect/component-set-spec/bound-variables.d.ts +14 -0
  215. package/dist/inspect/component-set-spec/bound-variables.d.ts.map +1 -0
  216. package/dist/inspect/component-set-spec/bound-variables.js +53 -0
  217. package/dist/inspect/component-set-spec/bound-variables.js.map +1 -0
  218. package/dist/inspect/component-set-spec/build-spec.d.ts +9 -0
  219. package/dist/inspect/component-set-spec/build-spec.d.ts.map +1 -0
  220. package/dist/inspect/component-set-spec/build-spec.js +102 -0
  221. package/dist/inspect/component-set-spec/build-spec.js.map +1 -0
  222. package/dist/inspect/component-set-spec/compact-spec.d.ts +3 -0
  223. package/dist/inspect/component-set-spec/compact-spec.d.ts.map +1 -0
  224. package/dist/inspect/component-set-spec/compact-spec.js +357 -0
  225. package/dist/inspect/component-set-spec/compact-spec.js.map +1 -0
  226. package/dist/inspect/component-set-spec/extract-slots.d.ts +5 -0
  227. package/dist/inspect/component-set-spec/extract-slots.d.ts.map +1 -0
  228. package/dist/inspect/component-set-spec/extract-slots.js +57 -0
  229. package/dist/inspect/component-set-spec/extract-slots.js.map +1 -0
  230. package/dist/inspect/component-set-spec/figma-node.d.ts +9 -0
  231. package/dist/inspect/component-set-spec/figma-node.d.ts.map +1 -0
  232. package/dist/inspect/component-set-spec/figma-node.js +31 -0
  233. package/dist/inspect/component-set-spec/figma-node.js.map +1 -0
  234. package/dist/inspect/component-set-spec/index.d.ts +2 -0
  235. package/dist/inspect/component-set-spec/index.d.ts.map +1 -0
  236. package/dist/inspect/component-set-spec/index.js +2 -0
  237. package/dist/inspect/component-set-spec/index.js.map +1 -0
  238. package/dist/inspect/component-set-spec/parse-props.d.ts +9 -0
  239. package/dist/inspect/component-set-spec/parse-props.d.ts.map +1 -0
  240. package/dist/inspect/component-set-spec/parse-props.js +96 -0
  241. package/dist/inspect/component-set-spec/parse-props.js.map +1 -0
  242. package/dist/inspect/component-set-spec/prop-name.d.ts +5 -0
  243. package/dist/inspect/component-set-spec/prop-name.d.ts.map +1 -0
  244. package/dist/inspect/component-set-spec/prop-name.js +26 -0
  245. package/dist/inspect/component-set-spec/prop-name.js.map +1 -0
  246. package/dist/inspect/component-set-spec/resolve-tokens.d.ts +4 -0
  247. package/dist/inspect/component-set-spec/resolve-tokens.d.ts.map +1 -0
  248. package/dist/inspect/component-set-spec/resolve-tokens.js +42 -0
  249. package/dist/inspect/component-set-spec/resolve-tokens.js.map +1 -0
  250. package/dist/inspect/component-set-spec/slim-context.d.ts +6 -0
  251. package/dist/inspect/component-set-spec/slim-context.d.ts.map +1 -0
  252. package/dist/inspect/component-set-spec/slim-context.js +2 -0
  253. package/dist/inspect/component-set-spec/slim-context.js.map +1 -0
  254. package/dist/inspect/component-set-spec/slim-node.d.ts +5 -0
  255. package/dist/inspect/component-set-spec/slim-node.d.ts.map +1 -0
  256. package/dist/inspect/component-set-spec/slim-node.js +393 -0
  257. package/dist/inspect/component-set-spec/slim-node.js.map +1 -0
  258. package/dist/inspect/component-set-spec/slim-text-export.d.ts +8 -0
  259. package/dist/inspect/component-set-spec/slim-text-export.d.ts.map +1 -0
  260. package/dist/inspect/component-set-spec/slim-text-export.js +74 -0
  261. package/dist/inspect/component-set-spec/slim-text-export.js.map +1 -0
  262. package/dist/inspect/component-set-spec/team-component-registry.d.ts +19 -0
  263. package/dist/inspect/component-set-spec/team-component-registry.d.ts.map +1 -0
  264. package/dist/inspect/component-set-spec/team-component-registry.js +96 -0
  265. package/dist/inspect/component-set-spec/team-component-registry.js.map +1 -0
  266. package/dist/inspect/component-set-spec/types.d.ts +127 -0
  267. package/dist/inspect/component-set-spec/types.d.ts.map +1 -0
  268. package/dist/inspect/component-set-spec/types.js +2 -0
  269. package/dist/inspect/component-set-spec/types.js.map +1 -0
  270. package/dist/inspect/component-set-spec/variable-registry.d.ts +8 -0
  271. package/dist/inspect/component-set-spec/variable-registry.d.ts.map +1 -0
  272. package/dist/inspect/component-set-spec/variable-registry.js +74 -0
  273. package/dist/inspect/component-set-spec/variable-registry.js.map +1 -0
  274. package/dist/inspect/component-set-spec/variant-axes.d.ts +2 -0
  275. package/dist/inspect/component-set-spec/variant-axes.d.ts.map +1 -0
  276. package/dist/inspect/component-set-spec/variant-axes.js +14 -0
  277. package/dist/inspect/component-set-spec/variant-axes.js.map +1 -0
  278. package/dist/inspect/contract/contract-format.d.ts +5 -0
  279. package/dist/inspect/contract/contract-format.d.ts.map +1 -0
  280. package/dist/inspect/contract/contract-format.js +26 -0
  281. package/dist/inspect/contract/contract-format.js.map +1 -0
  282. package/dist/inspect/contract/contract-lock.d.ts +75 -0
  283. package/dist/inspect/contract/contract-lock.d.ts.map +1 -0
  284. package/dist/inspect/contract/contract-lock.js +326 -0
  285. package/dist/inspect/contract/contract-lock.js.map +1 -0
  286. package/dist/inspect/contract/contract-schema.d.ts +51 -0
  287. package/dist/inspect/contract/contract-schema.d.ts.map +1 -0
  288. package/dist/inspect/contract/contract-schema.js +130 -0
  289. package/dist/inspect/contract/contract-schema.js.map +1 -0
  290. package/dist/inspect/contract/fingerprint.d.ts +9 -0
  291. package/dist/inspect/contract/fingerprint.d.ts.map +1 -0
  292. package/dist/inspect/contract/fingerprint.js +301 -0
  293. package/dist/inspect/contract/fingerprint.js.map +1 -0
  294. package/dist/inspect/contract/lock-metadata.d.ts +30 -0
  295. package/dist/inspect/contract/lock-metadata.d.ts.map +1 -0
  296. package/dist/inspect/contract/lock-metadata.js +101 -0
  297. package/dist/inspect/contract/lock-metadata.js.map +1 -0
  298. package/dist/inspect/contract/stable-stringify.d.ts +2 -0
  299. package/dist/inspect/contract/stable-stringify.d.ts.map +1 -0
  300. package/dist/inspect/contract/stable-stringify.js +14 -0
  301. package/dist/inspect/contract/stable-stringify.js.map +1 -0
  302. package/dist/inspect/contract/verify-component-contract.d.ts +19 -0
  303. package/dist/inspect/contract/verify-component-contract.d.ts.map +1 -0
  304. package/dist/inspect/contract/verify-component-contract.js +126 -0
  305. package/dist/inspect/contract/verify-component-contract.js.map +1 -0
  306. package/dist/inspect/errors.d.ts +4 -0
  307. package/dist/inspect/errors.d.ts.map +1 -0
  308. package/dist/inspect/errors.js +7 -0
  309. package/dist/inspect/errors.js.map +1 -0
  310. package/dist/inspect/export/assert-asset-exportable.d.ts +3 -0
  311. package/dist/inspect/export/assert-asset-exportable.d.ts.map +1 -0
  312. package/dist/inspect/export/assert-asset-exportable.js +45 -0
  313. package/dist/inspect/export/assert-asset-exportable.js.map +1 -0
  314. package/dist/inspect/export/export-nested-assets.d.ts +94 -0
  315. package/dist/inspect/export/export-nested-assets.d.ts.map +1 -0
  316. package/dist/inspect/export/export-nested-assets.js +333 -0
  317. package/dist/inspect/export/export-nested-assets.js.map +1 -0
  318. package/dist/inspect/export/export-node-preview.d.ts +24 -0
  319. package/dist/inspect/export/export-node-preview.d.ts.map +1 -0
  320. package/dist/inspect/export/export-node-preview.js +34 -0
  321. package/dist/inspect/export/export-node-preview.js.map +1 -0
  322. package/dist/inspect/export/export-variant-assets.d.ts +18 -0
  323. package/dist/inspect/export/export-variant-assets.d.ts.map +1 -0
  324. package/dist/inspect/export/export-variant-assets.js +127 -0
  325. package/dist/inspect/export/export-variant-assets.js.map +1 -0
  326. package/dist/inspect/export/normalize-exported-svg.d.ts +2 -0
  327. package/dist/inspect/export/normalize-exported-svg.d.ts.map +1 -0
  328. package/dist/inspect/export/normalize-exported-svg.js +15 -0
  329. package/dist/inspect/export/normalize-exported-svg.js.map +1 -0
  330. package/dist/inspect/export/rendered-image-bytes.d.ts +4 -0
  331. package/dist/inspect/export/rendered-image-bytes.d.ts.map +1 -0
  332. package/dist/inspect/export/rendered-image-bytes.js +24 -0
  333. package/dist/inspect/export/rendered-image-bytes.js.map +1 -0
  334. package/dist/inspect/export-contract-target.d.ts +7 -0
  335. package/dist/inspect/export-contract-target.d.ts.map +1 -0
  336. package/dist/inspect/export-contract-target.js +33 -0
  337. package/dist/inspect/export-contract-target.js.map +1 -0
  338. package/dist/inspect/fetch-file-entry.d.ts +4 -0
  339. package/dist/inspect/fetch-file-entry.d.ts.map +1 -0
  340. package/dist/inspect/fetch-file-entry.js +7 -0
  341. package/dist/inspect/fetch-file-entry.js.map +1 -0
  342. package/dist/inspect/fetch-file-node-entry.d.ts +4 -0
  343. package/dist/inspect/fetch-file-node-entry.d.ts.map +1 -0
  344. package/dist/inspect/fetch-file-node-entry.js +7 -0
  345. package/dist/inspect/fetch-file-node-entry.js.map +1 -0
  346. package/dist/inspect/figma-node-url.d.ts +3 -0
  347. package/dist/inspect/figma-node-url.d.ts.map +1 -0
  348. package/dist/inspect/figma-node-url.js +30 -0
  349. package/dist/inspect/figma-node-url.js.map +1 -0
  350. package/dist/inspect/get-node-component-set.d.ts +5 -0
  351. package/dist/inspect/get-node-component-set.d.ts.map +1 -0
  352. package/dist/inspect/get-node-component-set.js +10 -0
  353. package/dist/inspect/get-node-component-set.js.map +1 -0
  354. package/dist/inspect/index.d.ts +17 -0
  355. package/dist/inspect/index.d.ts.map +1 -0
  356. package/dist/inspect/index.js +17 -0
  357. package/dist/inspect/index.js.map +1 -0
  358. package/dist/inspect/list-all-component-sets.d.ts +3 -0
  359. package/dist/inspect/list-all-component-sets.d.ts.map +1 -0
  360. package/dist/inspect/list-all-component-sets.js +27 -0
  361. package/dist/inspect/list-all-component-sets.js.map +1 -0
  362. package/dist/inspect/list-component-set-properties.d.ts +4 -0
  363. package/dist/inspect/list-component-set-properties.d.ts.map +1 -0
  364. package/dist/inspect/list-component-set-properties.js +73 -0
  365. package/dist/inspect/list-component-set-properties.js.map +1 -0
  366. package/dist/inspect/node-contract/build-node-contract.d.ts +12 -0
  367. package/dist/inspect/node-contract/build-node-contract.d.ts.map +1 -0
  368. package/dist/inspect/node-contract/build-node-contract.js +212 -0
  369. package/dist/inspect/node-contract/build-node-contract.js.map +1 -0
  370. package/dist/inspect/node-contract/dependencies.d.ts +5 -0
  371. package/dist/inspect/node-contract/dependencies.d.ts.map +1 -0
  372. package/dist/inspect/node-contract/dependencies.js +84 -0
  373. package/dist/inspect/node-contract/dependencies.js.map +1 -0
  374. package/dist/inspect/node-contract/index.d.ts +6 -0
  375. package/dist/inspect/node-contract/index.d.ts.map +1 -0
  376. package/dist/inspect/node-contract/index.js +6 -0
  377. package/dist/inspect/node-contract/index.js.map +1 -0
  378. package/dist/inspect/node-contract/node-kind.d.ts +9 -0
  379. package/dist/inspect/node-contract/node-kind.d.ts.map +1 -0
  380. package/dist/inspect/node-contract/node-kind.js +31 -0
  381. package/dist/inspect/node-contract/node-kind.js.map +1 -0
  382. package/dist/inspect/node-contract/node-lock.d.ts +6 -0
  383. package/dist/inspect/node-contract/node-lock.d.ts.map +1 -0
  384. package/dist/inspect/node-contract/node-lock.js +181 -0
  385. package/dist/inspect/node-contract/node-lock.js.map +1 -0
  386. package/dist/inspect/node-contract/node-schema.d.ts +14 -0
  387. package/dist/inspect/node-contract/node-schema.d.ts.map +1 -0
  388. package/dist/inspect/node-contract/node-schema.js +137 -0
  389. package/dist/inspect/node-contract/node-schema.js.map +1 -0
  390. package/dist/inspect/node-contract/paths.d.ts +10 -0
  391. package/dist/inspect/node-contract/paths.d.ts.map +1 -0
  392. package/dist/inspect/node-contract/paths.js +29 -0
  393. package/dist/inspect/node-contract/paths.js.map +1 -0
  394. package/dist/inspect/node-contract/tokens.d.ts +4 -0
  395. package/dist/inspect/node-contract/tokens.d.ts.map +1 -0
  396. package/dist/inspect/node-contract/tokens.js +30 -0
  397. package/dist/inspect/node-contract/tokens.js.map +1 -0
  398. package/dist/inspect/node-contract/types.d.ts +84 -0
  399. package/dist/inspect/node-contract/types.d.ts.map +1 -0
  400. package/dist/inspect/node-contract/types.js +2 -0
  401. package/dist/inspect/node-contract/types.js.map +1 -0
  402. package/dist/inspect/node-contract/verify-node-contract.d.ts +20 -0
  403. package/dist/inspect/node-contract/verify-node-contract.d.ts.map +1 -0
  404. package/dist/inspect/node-contract/verify-node-contract.js +131 -0
  405. package/dist/inspect/node-contract/verify-node-contract.js.map +1 -0
  406. package/dist/inspect/resolve-team-component-set.d.ts +14 -0
  407. package/dist/inspect/resolve-team-component-set.d.ts.map +1 -0
  408. package/dist/inspect/resolve-team-component-set.js +77 -0
  409. package/dist/inspect/resolve-team-component-set.js.map +1 -0
  410. package/dist/inspect/schemas.d.ts +37 -0
  411. package/dist/inspect/schemas.d.ts.map +1 -0
  412. package/dist/inspect/schemas.js +79 -0
  413. package/dist/inspect/schemas.js.map +1 -0
  414. package/dist/inspect/team-index.d.ts +76 -0
  415. package/dist/inspect/team-index.d.ts.map +1 -0
  416. package/dist/inspect/team-index.js +361 -0
  417. package/dist/inspect/team-index.js.map +1 -0
  418. package/dist/inspect/types.d.ts +46 -0
  419. package/dist/inspect/types.d.ts.map +1 -0
  420. package/dist/inspect/types.js +2 -0
  421. package/dist/inspect/types.js.map +1 -0
  422. package/dist/test/fixtures.d.ts +3 -0
  423. package/dist/test/fixtures.d.ts.map +1 -0
  424. package/dist/test/fixtures.js +6 -0
  425. package/dist/test/fixtures.js.map +1 -0
  426. package/dist/zod/parse-valid-entries.d.ts +4 -0
  427. package/dist/zod/parse-valid-entries.d.ts.map +1 -0
  428. package/dist/zod/parse-valid-entries.js +20 -0
  429. package/dist/zod/parse-valid-entries.js.map +1 -0
  430. package/package.json +39 -0
@@ -0,0 +1,24 @@
1
+ async function readErrorBody(response) {
2
+ const contentType = response.headers.get("content-type") ?? "";
3
+ if (contentType.includes("application/json")) {
4
+ const payload = await response.json().catch(() => undefined);
5
+ if (!payload || typeof payload !== "object") {
6
+ return "";
7
+ }
8
+ const record = payload;
9
+ if (typeof record.message === "string") {
10
+ return record.message;
11
+ }
12
+ if (typeof record.err === "string") {
13
+ return record.err;
14
+ }
15
+ return JSON.stringify(payload);
16
+ }
17
+ return response.text().catch(() => "");
18
+ }
19
+ export async function formatFigmaError(response) {
20
+ const body = await readErrorBody(response);
21
+ const detail = body ? `: ${body}` : "";
22
+ return `Figma API request failed (${response.status} ${response.statusText})${detail}`;
23
+ }
24
+ //# sourceMappingURL=format-figma-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-figma-error.js","sourceRoot":"","sources":["../../src/figma-api/format-figma-error.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,aAAa,CAAC,QAAkB;IAC7C,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAE/D,IAAI,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAY,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACtE,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC5C,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,MAAM,GAAG,OAAkC,CAAC;QAClD,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACvC,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC;QACD,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,MAAM,CAAC,GAAG,CAAC;QACpB,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAkB;IACvD,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACvC,OAAO,6BAA6B,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,IAAI,MAAM,EAAE,CAAC;AACzF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { parseComponentSetMetadataResponse } from "./schemas.js";
2
+ import type { GetComponentSetOptions } from "./types.js";
3
+ export declare function getComponentSetByKey({ token, componentSetKey, fetchImpl, }: GetComponentSetOptions): Promise<ReturnType<typeof parseComponentSetMetadataResponse>>;
4
+ //# sourceMappingURL=get-component-set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-component-set.d.ts","sourceRoot":"","sources":["../../src/figma-api/get-component-set.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,wBAAsB,oBAAoB,CAAC,EACzC,KAAK,EACL,eAAe,EACf,SAAiB,GAClB,EAAE,sBAAsB,GAAG,OAAO,CACjC,UAAU,CAAC,OAAO,iCAAiC,CAAC,CACrD,CAQA"}
@@ -0,0 +1,8 @@
1
+ import { FIGMA_API_BASE_URL } from "./constants.js";
2
+ import { figmaRequest } from "./figma-request.js";
3
+ import { parseComponentSetMetadataResponse } from "./schemas.js";
4
+ export async function getComponentSetByKey({ token, componentSetKey, fetchImpl = fetch, }) {
5
+ const payload = await figmaRequest(`${FIGMA_API_BASE_URL}/component_sets/${encodeURIComponent(componentSetKey)}`, token, fetchImpl);
6
+ return parseComponentSetMetadataResponse(payload);
7
+ }
8
+ //# sourceMappingURL=get-component-set.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-component-set.js","sourceRoot":"","sources":["../../src/figma-api/get-component-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAC;AAGjE,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,KAAK,EACL,eAAe,EACf,SAAS,GAAG,KAAK,GACM;IAGvB,MAAM,OAAO,GAAG,MAAM,YAAY,CAChC,GAAG,kBAAkB,mBAAmB,kBAAkB,CAAC,eAAe,CAAC,EAAE,EAC7E,KAAK,EACL,SAAS,CACV,CAAC;IAEF,OAAO,iCAAiC,CAAC,OAAO,CAAC,CAAC;AACpD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { GetFileImagesOptions } from "./types.js";
2
+ export declare function getFileImageUrls({ token, fileKey, nodeIds, format, scale, fetchImpl, }: GetFileImagesOptions): Promise<Record<string, string>>;
3
+ export declare function downloadRenderedImage(imageUrl: string, fetchImpl?: typeof fetch): Promise<Uint8Array>;
4
+ //# sourceMappingURL=get-file-images.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-file-images.d.ts","sourceRoot":"","sources":["../../src/figma-api/get-file-images.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAYvD,wBAAsB,gBAAgB,CAAC,EACrC,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,SAAiB,GAClB,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAiCxD;AAED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,CAAC,UAAU,CAAC,CASrB"}
@@ -0,0 +1,45 @@
1
+ import { FIGMA_API_BASE_URL } from "./constants.js";
2
+ import { FigmaApiError } from "./figma-api-error.js";
3
+ import { figmaRequest } from "./figma-request.js";
4
+ import { parseFileImagesResponse } from "./schemas.js";
5
+ const IMAGE_ID_BATCH_SIZE = 50;
6
+ function chunk(values, size) {
7
+ const batches = [];
8
+ for (let index = 0; index < values.length; index += size) {
9
+ batches.push(values.slice(index, index + size));
10
+ }
11
+ return batches;
12
+ }
13
+ export async function getFileImageUrls({ token, fileKey, nodeIds, format, scale, fetchImpl = fetch, }) {
14
+ const normalizedIds = [...new Set(nodeIds.map((nodeId) => String(nodeId)))];
15
+ if (normalizedIds.length === 0) {
16
+ return {};
17
+ }
18
+ const imageUrls = {};
19
+ for (const batch of chunk(normalizedIds, IMAGE_ID_BATCH_SIZE)) {
20
+ const url = new URL(`${FIGMA_API_BASE_URL}/images/${encodeURIComponent(fileKey)}`);
21
+ url.searchParams.set("ids", batch.join(","));
22
+ url.searchParams.set("format", format);
23
+ if (format === "png" && scale !== undefined) {
24
+ url.searchParams.set("scale", String(scale));
25
+ }
26
+ const payload = await figmaRequest(url, token, fetchImpl);
27
+ const parsed = parseFileImagesResponse(payload);
28
+ for (const nodeId of batch) {
29
+ const imageUrl = parsed.images[nodeId];
30
+ if (!imageUrl) {
31
+ throw new FigmaApiError(`Figma image export returned no URL for node ${nodeId}.`);
32
+ }
33
+ imageUrls[nodeId] = imageUrl;
34
+ }
35
+ }
36
+ return imageUrls;
37
+ }
38
+ export async function downloadRenderedImage(imageUrl, fetchImpl = fetch) {
39
+ const response = await fetchImpl(imageUrl);
40
+ if (!response.ok) {
41
+ throw new FigmaApiError(`Rendered asset download failed: ${response.status} ${response.statusText}.`);
42
+ }
43
+ return new Uint8Array(await response.arrayBuffer());
44
+ }
45
+ //# sourceMappingURL=get-file-images.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-file-images.js","sourceRoot":"","sources":["../../src/figma-api/get-file-images.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGvD,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B,SAAS,KAAK,CAAI,MAAW,EAAE,IAAY;IACzC,MAAM,OAAO,GAAU,EAAE,CAAC;IAC1B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,SAAS,GAAG,KAAK,GACI;IACrB,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,SAAS,GAA2B,EAAE,CAAC;IAE7C,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,aAAa,EAAE,mBAAmB,CAAC,EAAE,CAAC;QAC9D,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,GAAG,kBAAkB,WAAW,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAC9D,CAAC;QACF,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACvC,IAAI,MAAM,KAAK,KAAK,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAC5C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/C,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC1D,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAEhD,KAAK,MAAM,MAAM,IAAI,KAAK,EAAE,CAAC;YAC3B,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,aAAa,CACrB,+CAA+C,MAAM,GAAG,CACzD,CAAC;YACJ,CAAC;YACD,SAAS,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,QAAgB,EAChB,YAA0B,KAAK;IAE/B,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC3C,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,aAAa,CACrB,mCAAmC,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,GAAG,CAC7E,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { GetFileNodeOptions } from "./types.js";
2
+ export declare function getFileNode({ token, fileKey, nodeId, fetchImpl, }: GetFileNodeOptions): Promise<unknown>;
3
+ //# sourceMappingURL=get-file-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-file-node.d.ts","sourceRoot":"","sources":["../../src/figma-api/get-file-node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,wBAAsB,WAAW,CAAC,EAChC,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAiB,GAClB,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAOvC"}
@@ -0,0 +1,8 @@
1
+ import { FIGMA_API_BASE_URL } from "./constants.js";
2
+ import { figmaRequest } from "./figma-request.js";
3
+ export async function getFileNode({ token, fileKey, nodeId, fetchImpl = fetch, }) {
4
+ const url = new URL(`${FIGMA_API_BASE_URL}/files/${encodeURIComponent(fileKey)}/nodes`);
5
+ url.searchParams.set("ids", nodeId);
6
+ return figmaRequest(url, token, fetchImpl);
7
+ }
8
+ //# sourceMappingURL=get-file-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-file-node.js","sourceRoot":"","sources":["../../src/figma-api/get-file-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAChC,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,GAAG,KAAK,GACE;IACnB,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,GAAG,kBAAkB,UAAU,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CACnE,CAAC;IACF,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEpC,OAAO,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { GetFileOptions } from "./types.js";
2
+ export declare function getFile({ token, fileKey, fetchImpl, }: GetFileOptions): Promise<unknown>;
3
+ //# sourceMappingURL=get-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-file.d.ts","sourceRoot":"","sources":["../../src/figma-api/get-file.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,wBAAsB,OAAO,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,SAAiB,GAClB,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAMnC"}
@@ -0,0 +1,6 @@
1
+ import { FIGMA_API_BASE_URL } from "./constants.js";
2
+ import { figmaRequest } from "./figma-request.js";
3
+ export async function getFile({ token, fileKey, fetchImpl = fetch, }) {
4
+ return figmaRequest(`${FIGMA_API_BASE_URL}/files/${encodeURIComponent(fileKey)}`, token, fetchImpl);
5
+ }
6
+ //# sourceMappingURL=get-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-file.js","sourceRoot":"","sources":["../../src/figma-api/get-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,SAAS,GAAG,KAAK,GACF;IACf,OAAO,YAAY,CACjB,GAAG,kBAAkB,UAAU,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAC5D,KAAK,EACL,SAAS,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ export { FigmaApiError } from "./figma-api-error.js";
2
+ export { getComponentSetByKey } from "./get-component-set.js";
3
+ export { getFileNode } from "./get-file-node.js";
4
+ export { listFileComponentSets } from "./list-file-component-sets.js";
5
+ export { filterFileComponentsForComponentSet, listFileComponents, } from "./list-file-components.js";
6
+ export { listFilePages } from "./list-file-pages.js";
7
+ export { listProjectFiles } from "./list-project-files.js";
8
+ export { listTeamComponentSets } from "./list-team-component-sets.js";
9
+ export { listTeamProjectFiles } from "./list-team-project-files.js";
10
+ export { listTeamProjects } from "./list-team-projects.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/figma-api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,mCAAmC,EACnC,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export { FigmaApiError } from "./figma-api-error.js";
2
+ export { getComponentSetByKey } from "./get-component-set.js";
3
+ export { getFileNode } from "./get-file-node.js";
4
+ export { listFileComponentSets } from "./list-file-component-sets.js";
5
+ export { filterFileComponentsForComponentSet, listFileComponents, } from "./list-file-components.js";
6
+ export { listFilePages } from "./list-file-pages.js";
7
+ export { listProjectFiles } from "./list-project-files.js";
8
+ export { listTeamComponentSets } from "./list-team-component-sets.js";
9
+ export { listTeamProjectFiles } from "./list-team-project-files.js";
10
+ export { listTeamProjects } from "./list-team-projects.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/figma-api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,mCAAmC,EACnC,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type FigmaPublishedComponentSet } from "./schemas.js";
2
+ import type { ListFileComponentSetsOptions } from "./types.js";
3
+ export declare function listFileComponentSets({ token, fileKey, fetchImpl, }: ListFileComponentSetsOptions): Promise<FigmaPublishedComponentSet[]>;
4
+ //# sourceMappingURL=list-file-component-sets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-file-component-sets.d.ts","sourceRoot":"","sources":["../../src/figma-api/list-file-component-sets.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE/D,wBAAsB,qBAAqB,CAAC,EAC1C,KAAK,EACL,OAAO,EACP,SAAiB,GAClB,EAAE,4BAA4B,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAQtE"}
@@ -0,0 +1,8 @@
1
+ import { FIGMA_API_BASE_URL } from "./constants.js";
2
+ import { figmaRequest } from "./figma-request.js";
3
+ import { parseFileComponentSetsResponse, } from "./schemas.js";
4
+ export async function listFileComponentSets({ token, fileKey, fetchImpl = fetch, }) {
5
+ const payload = await figmaRequest(`${FIGMA_API_BASE_URL}/files/${encodeURIComponent(fileKey)}/component_sets`, token, fetchImpl);
6
+ return parseFileComponentSetsResponse(payload);
7
+ }
8
+ //# sourceMappingURL=list-file-component-sets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-file-component-sets.js","sourceRoot":"","sources":["../../src/figma-api/list-file-component-sets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAEL,8BAA8B,GAC/B,MAAM,cAAc,CAAC;AAGtB,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,KAAK,EACL,OAAO,EACP,SAAS,GAAG,KAAK,GACY;IAC7B,MAAM,OAAO,GAAG,MAAM,YAAY,CAChC,GAAG,kBAAkB,UAAU,kBAAkB,CAAC,OAAO,CAAC,iBAAiB,EAC3E,KAAK,EACL,SAAS,CACV,CAAC;IAEF,OAAO,8BAA8B,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type FigmaFileComponent } from "./schemas.js";
2
+ import type { ListFileComponentsOptions } from "./types.js";
3
+ export declare function listFileComponents({ token, fileKey, fetchImpl, }: ListFileComponentsOptions): Promise<FigmaFileComponent[]>;
4
+ export declare function filterFileComponentsForComponentSet(components: FigmaFileComponent[], componentSetNodeId: string): FigmaFileComponent[];
5
+ //# sourceMappingURL=list-file-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-file-components.d.ts","sourceRoot":"","sources":["../../src/figma-api/list-file-components.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,wBAAsB,kBAAkB,CAAC,EACvC,KAAK,EACL,OAAO,EACP,SAAiB,GAClB,EAAE,yBAAyB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAQ3D;AAED,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,kBAAkB,EAAE,EAChC,kBAAkB,EAAE,MAAM,GACzB,kBAAkB,EAAE,CAOtB"}
@@ -0,0 +1,13 @@
1
+ import { FIGMA_API_BASE_URL } from "./constants.js";
2
+ import { figmaRequest } from "./figma-request.js";
3
+ import { parseFileComponentsResponse, } from "./schemas.js";
4
+ export async function listFileComponents({ token, fileKey, fetchImpl = fetch, }) {
5
+ const payload = await figmaRequest(`${FIGMA_API_BASE_URL}/files/${encodeURIComponent(fileKey)}/components`, token, fetchImpl);
6
+ return parseFileComponentsResponse(payload);
7
+ }
8
+ export function filterFileComponentsForComponentSet(components, componentSetNodeId) {
9
+ return components
10
+ .filter((component) => component.containing_component_set_node_id === componentSetNodeId)
11
+ .sort((left, right) => left.name.localeCompare(right.name));
12
+ }
13
+ //# sourceMappingURL=list-file-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-file-components.js","sourceRoot":"","sources":["../../src/figma-api/list-file-components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAEL,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AAGtB,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EACvC,KAAK,EACL,OAAO,EACP,SAAS,GAAG,KAAK,GACS;IAC1B,MAAM,OAAO,GAAG,MAAM,YAAY,CAChC,GAAG,kBAAkB,UAAU,kBAAkB,CAAC,OAAO,CAAC,aAAa,EACvE,KAAK,EACL,SAAS,CACV,CAAC;IAEF,OAAO,2BAA2B,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,mCAAmC,CACjD,UAAgC,EAChC,kBAA0B;IAE1B,OAAO,UAAU;SACd,MAAM,CACL,CAAC,SAAS,EAAE,EAAE,CACZ,SAAS,CAAC,gCAAgC,KAAK,kBAAkB,CACpE;SACA,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type FigmaPage } from "./schemas.js";
2
+ import type { ListFilePagesOptions } from "./types.js";
3
+ export declare function listFilePages({ token, fileKey, fetchImpl, }: ListFilePagesOptions): Promise<FigmaPage[]>;
4
+ //# sourceMappingURL=list-file-pages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-file-pages.d.ts","sourceRoot":"","sources":["../../src/figma-api/list-file-pages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA0B,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,wBAAsB,aAAa,CAAC,EAClC,KAAK,EACL,OAAO,EACP,SAAiB,GAClB,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAQ7C"}
@@ -0,0 +1,10 @@
1
+ import { FIGMA_API_BASE_URL } from "./constants.js";
2
+ import { figmaRequest } from "./figma-request.js";
3
+ import { parseFilePagesResponse } from "./schemas.js";
4
+ export async function listFilePages({ token, fileKey, fetchImpl = fetch, }) {
5
+ const url = new URL(`${FIGMA_API_BASE_URL}/files/${encodeURIComponent(fileKey)}`);
6
+ url.searchParams.set("depth", "1");
7
+ const payload = await figmaRequest(url, token, fetchImpl);
8
+ return parseFilePagesResponse(payload);
9
+ }
10
+ //# sourceMappingURL=list-file-pages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-file-pages.js","sourceRoot":"","sources":["../../src/figma-api/list-file-pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAkB,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGtE,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAClC,KAAK,EACL,OAAO,EACP,SAAS,GAAG,KAAK,GACI;IACrB,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,GAAG,kBAAkB,UAAU,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAC7D,CAAC;IACF,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAEnC,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAC1D,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type FigmaFile } from "./schemas.js";
2
+ import type { ListProjectFilesOptions } from "./types.js";
3
+ export declare function listProjectFiles({ token, projectId, fetchImpl, }: ListProjectFilesOptions): Promise<FigmaFile[]>;
4
+ //# sourceMappingURL=list-project-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-project-files.d.ts","sourceRoot":"","sources":["../../src/figma-api/list-project-files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,wBAAsB,gBAAgB,CAAC,EACrC,KAAK,EACL,SAAS,EACT,SAAiB,GAClB,EAAE,uBAAuB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAQhD"}
@@ -0,0 +1,8 @@
1
+ import { FIGMA_API_BASE_URL } from "./constants.js";
2
+ import { figmaRequest } from "./figma-request.js";
3
+ import { parseProjectFilesResponse } from "./schemas.js";
4
+ export async function listProjectFiles({ token, projectId, fetchImpl = fetch, }) {
5
+ const payload = await figmaRequest(`${FIGMA_API_BASE_URL}/projects/${encodeURIComponent(projectId)}/files`, token, fetchImpl);
6
+ return parseProjectFilesResponse(payload);
7
+ }
8
+ //# sourceMappingURL=list-project-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-project-files.js","sourceRoot":"","sources":["../../src/figma-api/list-project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAkB,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAGzE,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,KAAK,EACL,SAAS,EACT,SAAS,GAAG,KAAK,GACO;IACxB,MAAM,OAAO,GAAG,MAAM,YAAY,CAChC,GAAG,kBAAkB,aAAa,kBAAkB,CAAC,SAAS,CAAC,QAAQ,EACvE,KAAK,EACL,SAAS,CACV,CAAC;IAEF,OAAO,yBAAyB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type FigmaPublishedComponentSet } from "./schemas.js";
2
+ import type { ListTeamComponentSetsOptions } from "./types.js";
3
+ export declare function listTeamComponentSets({ token, teamId, fetchImpl, }: ListTeamComponentSetsOptions): Promise<FigmaPublishedComponentSet[]>;
4
+ //# sourceMappingURL=list-team-component-sets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-team-component-sets.d.ts","sourceRoot":"","sources":["../../src/figma-api/list-team-component-sets.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE/D,wBAAsB,qBAAqB,CAAC,EAC1C,KAAK,EACL,MAAM,EACN,SAAiB,GAClB,EAAE,4BAA4B,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAmBtE"}
@@ -0,0 +1,19 @@
1
+ import { FIGMA_API_BASE_URL } from "./constants.js";
2
+ import { figmaRequest } from "./figma-request.js";
3
+ import { parseTeamComponentSetsResponse, } from "./schemas.js";
4
+ export async function listTeamComponentSets({ token, teamId, fetchImpl = fetch, }) {
5
+ const componentSets = [];
6
+ let after;
7
+ do {
8
+ const url = new URL(`${FIGMA_API_BASE_URL}/teams/${encodeURIComponent(teamId)}/component_sets`);
9
+ if (after) {
10
+ url.searchParams.set("after", after);
11
+ }
12
+ const payload = await figmaRequest(url, token, fetchImpl);
13
+ const page = parseTeamComponentSetsResponse(payload);
14
+ componentSets.push(...page.componentSets);
15
+ after = page.cursorAfter;
16
+ } while (after);
17
+ return componentSets;
18
+ }
19
+ //# sourceMappingURL=list-team-component-sets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-team-component-sets.js","sourceRoot":"","sources":["../../src/figma-api/list-team-component-sets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAEL,8BAA8B,GAC/B,MAAM,cAAc,CAAC;AAGtB,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,KAAK,EACL,MAAM,EACN,SAAS,GAAG,KAAK,GACY;IAC7B,MAAM,aAAa,GAAiC,EAAE,CAAC;IACvD,IAAI,KAAyB,CAAC;IAE9B,GAAG,CAAC;QACF,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,GAAG,kBAAkB,UAAU,kBAAkB,CAAC,MAAM,CAAC,iBAAiB,CAC3E,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACvC,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC1D,MAAM,IAAI,GAAG,8BAA8B,CAAC,OAAO,CAAC,CAAC;QACrD,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1C,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC;IAC3B,CAAC,QAAQ,KAAK,EAAE;IAEhB,OAAO,aAAa,CAAC;AACvB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FigmaTeamProjectFile } from "./schemas.js";
2
+ import type { ListTeamProjectFilesOptions } from "./types.js";
3
+ export declare function listTeamProjectFiles({ token, teamId, fetchImpl, }: ListTeamProjectFilesOptions): Promise<FigmaTeamProjectFile[]>;
4
+ //# sourceMappingURL=list-team-project-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-team-project-files.d.ts","sourceRoot":"","sources":["../../src/figma-api/list-team-project-files.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE9D,wBAAsB,oBAAoB,CAAC,EACzC,KAAK,EACL,MAAM,EACN,SAAiB,GAClB,EAAE,2BAA2B,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAoB/D"}
@@ -0,0 +1,19 @@
1
+ import { listProjectFiles } from "./list-project-files.js";
2
+ import { listTeamProjects } from "./list-team-projects.js";
3
+ export async function listTeamProjectFiles({ token, teamId, fetchImpl = fetch, }) {
4
+ const projects = await listTeamProjects({ token, teamId, fetchImpl });
5
+ const fileLists = await Promise.all(projects.map(async (project) => {
6
+ const files = await listProjectFiles({
7
+ token,
8
+ projectId: project.id,
9
+ fetchImpl,
10
+ });
11
+ return files.map((file) => ({
12
+ ...file,
13
+ project_id: project.id,
14
+ project_name: project.name,
15
+ }));
16
+ }));
17
+ return fileLists.flat();
18
+ }
19
+ //# sourceMappingURL=list-team-project-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-team-project-files.js","sourceRoot":"","sources":["../../src/figma-api/list-team-project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI3D,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,KAAK,EACL,MAAM,EACN,SAAS,GAAG,KAAK,GACW;IAC5B,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAEtE,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QAC7B,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC;YACnC,KAAK;YACL,SAAS,EAAE,OAAO,CAAC,EAAE;YACrB,SAAS;SACV,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1B,GAAG,IAAI;YACP,UAAU,EAAE,OAAO,CAAC,EAAE;YACtB,YAAY,EAAE,OAAO,CAAC,IAAI;SAC3B,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type FigmaProject } from "./schemas.js";
2
+ import type { ListTeamProjectsOptions } from "./types.js";
3
+ export declare function listTeamProjects({ token, teamId, fetchImpl, }: ListTeamProjectsOptions): Promise<FigmaProject[]>;
4
+ //# sourceMappingURL=list-team-projects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-team-projects.d.ts","sourceRoot":"","sources":["../../src/figma-api/list-team-projects.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAA6B,MAAM,cAAc,CAAC;AAC5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,wBAAsB,gBAAgB,CAAC,EACrC,KAAK,EACL,MAAM,EACN,SAAiB,GAClB,EAAE,uBAAuB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAQnD"}
@@ -0,0 +1,8 @@
1
+ import { FIGMA_API_BASE_URL } from "./constants.js";
2
+ import { figmaRequest } from "./figma-request.js";
3
+ import { parseTeamProjectsResponse } from "./schemas.js";
4
+ export async function listTeamProjects({ token, teamId, fetchImpl = fetch, }) {
5
+ const payload = await figmaRequest(`${FIGMA_API_BASE_URL}/teams/${encodeURIComponent(teamId)}/projects`, token, fetchImpl);
6
+ return parseTeamProjectsResponse(payload);
7
+ }
8
+ //# sourceMappingURL=list-team-projects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-team-projects.js","sourceRoot":"","sources":["../../src/figma-api/list-team-projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAqB,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAG5E,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,KAAK,EACL,MAAM,EACN,SAAS,GAAG,KAAK,GACO;IACxB,MAAM,OAAO,GAAG,MAAM,YAAY,CAChC,GAAG,kBAAkB,UAAU,kBAAkB,CAAC,MAAM,CAAC,WAAW,EACpE,KAAK,EACL,SAAS,CACV,CAAC;IAEF,OAAO,yBAAyB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { z } from "zod";
2
+ declare const figmaProjectSchema: z.ZodObject<{
3
+ id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
4
+ name: z.ZodString;
5
+ file_count: z.ZodOptional<z.ZodNumber>;
6
+ }, z.core.$strip>;
7
+ declare const figmaFileSchema: z.ZodObject<{
8
+ key: z.ZodString;
9
+ name: z.ZodString;
10
+ last_modified: z.ZodString;
11
+ }, z.core.$strip>;
12
+ declare const figmaPageSchema: z.ZodPipe<z.ZodObject<{
13
+ type: z.ZodLiteral<"CANVAS">;
14
+ id: z.ZodString;
15
+ name: z.ZodString;
16
+ }, z.core.$strip>, z.ZodTransform<{
17
+ id: string;
18
+ name: string;
19
+ }, {
20
+ type: "CANVAS";
21
+ id: string;
22
+ name: string;
23
+ }>>;
24
+ export type FigmaProject = z.infer<typeof figmaProjectSchema>;
25
+ export type FigmaFile = z.infer<typeof figmaFileSchema>;
26
+ export type FigmaTeamProjectFile = FigmaFile & {
27
+ project_id: string;
28
+ project_name: string;
29
+ };
30
+ export type FigmaPage = z.infer<typeof figmaPageSchema>;
31
+ declare const publishedComponentSetSchema: z.ZodObject<{
32
+ key: z.ZodString;
33
+ file_key: z.ZodString;
34
+ node_id: z.ZodString;
35
+ name: z.ZodString;
36
+ updated_at: z.ZodOptional<z.ZodString>;
37
+ created_at: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strip>;
39
+ export type FigmaPublishedComponentSet = z.infer<typeof publishedComponentSetSchema>;
40
+ declare const componentSetMetadataSchema: z.ZodObject<{
41
+ key: z.ZodString;
42
+ file_key: z.ZodString;
43
+ node_id: z.ZodString;
44
+ name: z.ZodString;
45
+ updated_at: z.ZodString;
46
+ created_at: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>;
48
+ export type FigmaComponentSetMetadata = z.infer<typeof componentSetMetadataSchema>;
49
+ declare const fileComponentSchema: z.ZodPipe<z.ZodObject<{
50
+ key: z.ZodString;
51
+ file_key: z.ZodString;
52
+ node_id: z.ZodString;
53
+ name: z.ZodString;
54
+ updated_at: z.ZodString;
55
+ containing_frame: z.ZodOptional<z.ZodObject<{
56
+ containingComponentSet: z.ZodOptional<z.ZodObject<{
57
+ nodeId: z.ZodString;
58
+ }, z.core.$strip>>;
59
+ }, z.core.$strip>>;
60
+ }, z.core.$strip>, z.ZodTransform<{
61
+ key: string;
62
+ file_key: string;
63
+ node_id: string;
64
+ name: string;
65
+ updated_at: string;
66
+ containing_component_set_node_id: string | undefined;
67
+ }, {
68
+ key: string;
69
+ file_key: string;
70
+ node_id: string;
71
+ name: string;
72
+ updated_at: string;
73
+ containing_frame?: {
74
+ containingComponentSet?: {
75
+ nodeId: string;
76
+ } | undefined;
77
+ } | undefined;
78
+ }>>;
79
+ export type FigmaFileComponent = z.infer<typeof fileComponentSchema>;
80
+ export declare function parseTeamProjectsResponse(payload: unknown): FigmaProject[];
81
+ export declare function parseProjectFilesResponse(payload: unknown): FigmaFile[];
82
+ export declare function parseFilePagesResponse(payload: unknown): FigmaPage[];
83
+ export declare function parseTeamComponentSetsResponse(payload: unknown): {
84
+ componentSets: FigmaPublishedComponentSet[];
85
+ cursorAfter: string | undefined;
86
+ };
87
+ export declare function parseFileComponentSetsResponse(payload: unknown): FigmaPublishedComponentSet[];
88
+ export declare function parseFileImagesResponse(payload: unknown): {
89
+ images: Record<string, string>;
90
+ err?: string;
91
+ };
92
+ export declare function parseComponentSetMetadataResponse(payload: unknown): FigmaComponentSetMetadata;
93
+ export declare function parseFileComponentsResponse(payload: unknown): FigmaFileComponent[];
94
+ export {};
95
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/figma-api/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,QAAA,MAAM,kBAAkB;;;;iBAItB,CAAC;AAEH,QAAA,MAAM,eAAe;;;;iBAInB,CAAC;AAEH,QAAA,MAAM,eAAe;;;;;;;;;;;GAMyB,CAAC;AAE/C,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,QAAA,MAAM,2BAA2B;;;;;;;iBAO/B,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,2BAA2B,CACnC,CAAC;AAEF,QAAA,MAAM,0BAA0B;;;;;;;iBAO9B,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,0BAA0B,CAClC,CAAC;AAQF,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyBpB,CAAC;AAEN,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAsDrE,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,EAAE,CAM1E;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,CAMvE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,CAMpE;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,OAAO,GAAG;IAChE,aAAa,EAAE,0BAA0B,EAAE,CAAC;IAC5C,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,CAMA;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,OAAO,GACf,0BAA0B,EAAE,CAE9B;AAqBD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG;IACzD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAMA;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,OAAO,GACf,yBAAyB,CAM3B;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,GACf,kBAAkB,EAAE,CAMtB"}