figma-console-mcp 1.28.1 β 1.29.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.
- package/README.md +17 -9
- package/dist/cloudflare/core/config.js +0 -8
- package/dist/cloudflare/core/console-monitor.js +3 -3
- package/dist/cloudflare/core/design-system-tools.js +1 -1
- package/dist/cloudflare/core/diagnose-tool.js +96 -0
- package/dist/cloudflare/core/figma-api.js +19 -0
- package/dist/cloudflare/core/figma-tools.js +69 -229
- package/dist/cloudflare/core/identity.js +96 -0
- package/dist/cloudflare/core/library-tools.js +580 -0
- package/dist/cloudflare/core/tokens/alias-resolver.js +135 -0
- package/dist/cloudflare/core/tokens/config.js +284 -0
- package/dist/cloudflare/core/tokens/figma-converter.js +195 -0
- package/dist/cloudflare/core/tokens/formatters/css-vars.js +329 -0
- package/dist/cloudflare/core/tokens/formatters/dtcg.js +300 -0
- package/dist/cloudflare/core/tokens/formatters/index.js +45 -0
- package/dist/cloudflare/core/tokens/formatters/json.js +187 -0
- package/dist/cloudflare/core/tokens/formatters/less.js +4 -0
- package/dist/cloudflare/core/tokens/formatters/scss.js +252 -0
- package/dist/cloudflare/core/tokens/formatters/stubs.js +13 -0
- package/dist/cloudflare/core/tokens/formatters/style-dictionary-v3.js +207 -0
- package/dist/cloudflare/core/tokens/formatters/tailwind-v3.js +237 -0
- package/dist/cloudflare/core/tokens/formatters/tailwind-v4.js +330 -0
- package/dist/cloudflare/core/tokens/formatters/tokens-studio.js +250 -0
- package/dist/cloudflare/core/tokens/formatters/ts-module.js +198 -0
- package/dist/cloudflare/core/tokens/index.js +15 -0
- package/dist/cloudflare/core/tokens/parsers/css-vars.js +4 -0
- package/dist/cloudflare/core/tokens/parsers/dtcg.js +253 -0
- package/dist/cloudflare/core/tokens/parsers/index.js +138 -0
- package/dist/cloudflare/core/tokens/parsers/json.js +7 -0
- package/dist/cloudflare/core/tokens/parsers/scss.js +4 -0
- package/dist/cloudflare/core/tokens/parsers/stubs.js +20 -0
- package/dist/cloudflare/core/tokens/parsers/style-dictionary-v3.js +4 -0
- package/dist/cloudflare/core/tokens/parsers/tailwind-v3.js +4 -0
- package/dist/cloudflare/core/tokens/parsers/tailwind-v4.js +4 -0
- package/dist/cloudflare/core/tokens/parsers/tokens-studio.js +4 -0
- package/dist/cloudflare/core/tokens/schemas.js +148 -0
- package/dist/cloudflare/core/tokens/transforms/color.js +12 -0
- package/dist/cloudflare/core/tokens/transforms/index.js +29 -0
- package/dist/cloudflare/core/tokens/transforms/size.js +7 -0
- package/dist/cloudflare/core/tokens/types.js +18 -0
- package/dist/cloudflare/core/tokens-tools.js +859 -0
- package/dist/cloudflare/core/version-tools.js +151 -7
- package/dist/cloudflare/core/websocket-server.js +77 -55
- package/dist/cloudflare/index.js +45 -26
- package/dist/core/design-system-tools.d.ts +51 -1
- package/dist/core/design-system-tools.d.ts.map +1 -1
- package/dist/core/design-system-tools.js +20 -10
- package/dist/core/design-system-tools.js.map +1 -1
- package/dist/core/figma-api.d.ts +15 -0
- package/dist/core/figma-api.d.ts.map +1 -1
- package/dist/core/figma-api.js +19 -0
- package/dist/core/figma-api.js.map +1 -1
- package/dist/core/library-tools.d.ts +17 -0
- package/dist/core/library-tools.d.ts.map +1 -0
- package/dist/core/library-tools.js +581 -0
- package/dist/core/library-tools.js.map +1 -0
- package/dist/core/tokens-tools.js +1 -1
- package/dist/core/variable-resolver.d.ts +45 -0
- package/dist/core/variable-resolver.d.ts.map +1 -0
- package/dist/core/variable-resolver.js +86 -0
- package/dist/core/variable-resolver.js.map +1 -0
- package/dist/local.d.ts.map +1 -1
- package/dist/local.js +8 -1
- package/dist/local.js.map +1 -1
- package/figma-desktop-bridge/code.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **Your design system as an API.** Model Context Protocol server that bridges design and developmentβgiving AI assistants complete access to Figma for **extraction**, **creation**, **debugging**, and **bidirectional token sync**.
|
|
10
10
|
|
|
11
|
-
> **π
|
|
11
|
+
> **π Shared Library Inspection (v1.29.0, patched v1.29.1):** Three new tools fill the gap between "I see a component key in search results" and "I can actually use it." `figma_get_library_component_by_key` resolves any component key to full property definitions + variant keys + visual specs β without needing the source library file's URL. `figma_get_library_variables` lists every variable from your subscribed libraries (no Enterprise plan required β uses the Plugin API path that works on Pro and Org). `figma_import_library_variable` brings a library token into the current file so it can be bound to nodes alongside the file's own variables. Works on every Figma plan. 106 tools total. **Patched v1.29.1:** `figma_get_design_system_kit` now reads variables on any plan via the bridge too β no more 403 for non-Enterprise users. [See what's new β](CHANGELOG.md#1291---2026-05-30)
|
|
12
12
|
|
|
13
13
|
## What is this?
|
|
14
14
|
|
|
@@ -55,9 +55,9 @@ Figma Console MCP connects AI assistants (like Claude) to Figma, enabling:
|
|
|
55
55
|
| Real-time monitoring (console, selection) | β
| β | β |
|
|
56
56
|
| Desktop Bridge plugin | β
| β
| β |
|
|
57
57
|
| Requires Node.js | Yes | **No** | No |
|
|
58
|
-
| **Total tools available** | **
|
|
58
|
+
| **Total tools available** | **106** | **95** | **9** |
|
|
59
59
|
|
|
60
|
-
> **Bottom line:** Remote SSE is **read-only** with ~38% of the tools. **Cloud Mode** unlocks write access from web AI clients without Node.js. NPX/Local Git gives the full
|
|
60
|
+
> **Bottom line:** Remote SSE is **read-only** with ~38% of the tools. **Cloud Mode** unlocks write access from web AI clients without Node.js. NPX/Local Git gives the full 106 tools with real-time monitoring.
|
|
61
61
|
|
|
62
62
|
---
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@ Figma Console MCP connects AI assistants (like Claude) to Figma, enabling:
|
|
|
65
65
|
|
|
66
66
|
**Best for:** Designers who want full AI-assisted design capabilities.
|
|
67
67
|
|
|
68
|
-
**What you get:** All
|
|
68
|
+
**What you get:** All 106 tools including design creation, variable management, and component instantiation.
|
|
69
69
|
|
|
70
70
|
#### Prerequisites
|
|
71
71
|
|
|
@@ -162,7 +162,7 @@ Create a simple frame with a blue background
|
|
|
162
162
|
|
|
163
163
|
**Best for:** Developers who want to modify source code or contribute to the project.
|
|
164
164
|
|
|
165
|
-
**What you get:** Same
|
|
165
|
+
**What you get:** Same 106 tools as NPX, plus full source code access.
|
|
166
166
|
|
|
167
167
|
#### Quick Setup
|
|
168
168
|
|
|
@@ -308,7 +308,7 @@ AI Client β Cloud MCP Server β Durable Object Relay β Desktop Bridge Plugi
|
|
|
308
308
|
| Feature | NPX (Recommended) | Cloud Mode | Local Git | Remote SSE |
|
|
309
309
|
|---------|-------------------|------------|-----------|------------|
|
|
310
310
|
| **Setup time** | ~10 minutes | ~5 minutes | ~15 minutes | ~2 minutes |
|
|
311
|
-
| **Total tools** | **
|
|
311
|
+
| **Total tools** | **106** | **95** | **106** | **9** (read-only) |
|
|
312
312
|
| **Design creation** | β
| β
| β
| β |
|
|
313
313
|
| **Variable management** | β
| β
| β
| β |
|
|
314
314
|
| **Component instantiation** | β
| β
| β
| β |
|
|
@@ -323,7 +323,7 @@ AI Client β Cloud MCP Server β Durable Object Relay β Desktop Bridge Plugi
|
|
|
323
323
|
| **Automatic updates** | β
(`@latest`) | β
| Manual (`git pull`) | β
|
|
|
324
324
|
| **Source code access** | β | β | β
| β |
|
|
325
325
|
|
|
326
|
-
> **Key insight:** Remote SSE is read-only. Cloud Mode adds write access for web AI clients without Node.js. NPX/Local Git give the full
|
|
326
|
+
> **Key insight:** Remote SSE is read-only. Cloud Mode adds write access for web AI clients without Node.js. NPX/Local Git give the full 106 tools.
|
|
327
327
|
|
|
328
328
|
**π [Complete Feature Comparison](docs/mode-comparison.md)**
|
|
329
329
|
|
|
@@ -401,6 +401,12 @@ When you first use design system tools:
|
|
|
401
401
|
- `figma_get_file_data` - Full file structure
|
|
402
402
|
- `figma_get_file_for_plugin` - Optimized file data
|
|
403
403
|
|
|
404
|
+
### π Shared Library Inspection
|
|
405
|
+
- `figma_get_library_component_by_key` - **Resolve any component key to full properties + variants + visual specs** β without needing the source library file's URL. Works for both COMPONENT_SET and standalone COMPONENT keys. Adaptive compression at >500KB.
|
|
406
|
+
- `figma_get_library_components` - Discover all components in a library file (requires library file URL/key)
|
|
407
|
+
- `figma_get_library_variables` - List every variable from team libraries the current file has subscribed. **Works on every Figma plan** β uses the Plugin API path, not the Enterprise-only REST endpoint. Filter by `libraryName`, `collectionName`, or `resolvedType`.
|
|
408
|
+
- `figma_import_library_variable` - Import a library variable into the current file. Returns a local `id` ready to pass to `figma_set_fills` / `figma_update_variable` / any variable-binding tool.
|
|
409
|
+
|
|
404
410
|
### βοΈ Cloud Relay
|
|
405
411
|
- `figma_pair_plugin` - Generate a pairing code to connect a Desktop Bridge plugin via the cloud relay
|
|
406
412
|
|
|
@@ -663,7 +669,7 @@ The **Figma Desktop Bridge** plugin is the recommended way to connect Figma to t
|
|
|
663
669
|
- The MCP server communicates via **WebSocket** through the Desktop Bridge plugin
|
|
664
670
|
- The server tries port 9223 first, then automatically falls back through ports 9224β9232 if needed
|
|
665
671
|
- The plugin scans all ports in the range and connects to every active server it finds
|
|
666
|
-
- All
|
|
672
|
+
- All 106 tools work through the WebSocket transport
|
|
667
673
|
|
|
668
674
|
**Multiple files:** The WebSocket server supports multiple simultaneous plugin connections β one per open Figma file. Each connection is tracked by file key with independent state (selection, document changes, console logs).
|
|
669
675
|
|
|
@@ -802,9 +808,11 @@ The architecture supports adding new apps with minimal boilerplate β each app
|
|
|
802
808
|
|
|
803
809
|
## π€οΈ Roadmap
|
|
804
810
|
|
|
805
|
-
**Current Status:** v1.
|
|
811
|
+
**Current Status:** v1.29.1 (Stable) - Production-ready with shared-library inspection (key-based component resolution + library variable read/import without Enterprise plan), 10-format token export pipeline (DTCG, CSS, Tailwind v4, Tailwind v3, SCSS, TS module, JSON flat/nested, Style Dictionary v3, Tokens Studio), bidirectional Figmaβcode token sync, version history & time-series awareness, FigJam + Slides support, Cloud Write Relay, Design System Kit, WebSocket-only connectivity, smart multi-file tracking, **106 tools** (Local) / **95 tools** (Cloud) / **9 tools** (Remote read-only), Comments API, cross-MCP identity disambiguation, and MCP Apps.
|
|
806
812
|
|
|
807
813
|
**Recent Releases:**
|
|
814
|
+
- [x] **v1.29.1** - Bug fix: `figma_get_design_system_kit` now resolves variables bridge-first (Desktop Bridge / cloud relay β REST fallback) instead of calling the Enterprise-only Variables REST API directly. Non-Enterprise users no longer hit a 403 on the kit's token section when a bridge is connected, and a REST 403 now points the caller back to the bridge instead of dead-ending. 7 new tests, 1185 total passing. No new tools; plugin re-import not required.
|
|
815
|
+
- [x] **v1.29.0** - Shared library inspection: three new tools close the gap between "I have a component key" and "I can actually use it." `figma_get_library_component_by_key` resolves any 40-char component key to full `componentPropertyDefinitions` + variants (with their published keys) + per-variant visual specs β without needing the source library file's URL. `figma_get_library_variables` lists library tokens via Plugin API (works on every Figma plan; the REST equivalent is Enterprise-only). `figma_import_library_variable` imports a library token to the current file so it can be bound to nodes. 27 new tests, 1178 total passing. Plugin re-import optional.
|
|
808
816
|
- [x] **v1.28.1** - Bug fix patch surfacing from live-fire testing of the v1.28.0 formatters against multi-tier semantic-token design systems. Fixes: Tailwind v3 emitted empty `module.exports` for alias-only sets (now resolves alias chains to literal values); TypeScript module + JSON flat + JSON nested formatters emitted `"{alias.path}"` strings as literal values (now resolves); Tailwind v4 namespace-prefix doubling (`--color-theme-color-X` is now `--color-theme-X`). Adds `resolveAliasChain` public helper. 1151 tests still passing.
|
|
809
817
|
- [x] **v1.28.0** - Full formatter coverage for `figma_export_tokens`. Seven new output formats: Tailwind v4 `@theme inline`, Tailwind v3 config, SCSS variables, TypeScript module, JSON flat/nested, Style Dictionary v3, Tokens Studio multi-file. Combined with DTCG + CSS variables, ships **10 fully-implemented output formats** with zero third-party build-tool dependencies. Tool description updated, docs/tools.md table all-green. 22 new Jest tests, 1151 total passing.
|
|
810
818
|
- [x] **v1.27.1** - Documentation patch. No code behavior changes. Sweeps stale "Phase 1 ships with DTCG only" claims across tool descriptions, error messages, and internal comments after CSS variables formatter and the apply phase shipped during the v1.27.0 dev cycle. Refreshes README banner + capability bullets + roadmap. Adds `Phase 3.5: Stale-Content Audit` to the release runbook so future releases get a strict pre-publish grep sweep across banners, tool descriptions, error messages, source comments, and tool-count consistency.
|
|
@@ -48,10 +48,6 @@ const DEFAULT_CONFIG = {
|
|
|
48
48
|
quality: 90,
|
|
49
49
|
storePath: join(process.env.TMPDIR || '/tmp', 'figma-console-mcp', 'screenshots'),
|
|
50
50
|
},
|
|
51
|
-
local: {
|
|
52
|
-
debugHost: process.env.FIGMA_DEBUG_HOST || 'localhost',
|
|
53
|
-
debugPort: parseInt(process.env.FIGMA_DEBUG_PORT || '9222', 10),
|
|
54
|
-
},
|
|
55
51
|
};
|
|
56
52
|
/**
|
|
57
53
|
* Possible config file locations (checked in order)
|
|
@@ -111,10 +107,6 @@ function mergeConfig(defaults, overrides) {
|
|
|
111
107
|
...defaults.screenshots,
|
|
112
108
|
...(overrides.screenshots || {}),
|
|
113
109
|
},
|
|
114
|
-
local: {
|
|
115
|
-
...defaults.local,
|
|
116
|
-
...(overrides.local || {}),
|
|
117
|
-
},
|
|
118
110
|
};
|
|
119
111
|
}
|
|
120
112
|
/**
|
|
@@ -14,14 +14,14 @@ export class ConsoleMonitor {
|
|
|
14
14
|
constructor(config) {
|
|
15
15
|
this.logs = [];
|
|
16
16
|
this.isMonitoring = false;
|
|
17
|
-
this.page = null; //
|
|
17
|
+
this.page = null; // @cloudflare/puppeteer Page (this class is cloud-mode-only after Phase 3).
|
|
18
18
|
this.workers = new Set();
|
|
19
19
|
this.lastUrl = ''; // Track the last URL to detect real navigations vs hash changes
|
|
20
20
|
this.config = config;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Start monitoring console logs on a page
|
|
24
|
-
* Accepts
|
|
23
|
+
* Start monitoring console logs on a page.
|
|
24
|
+
* Accepts the @cloudflare/puppeteer Page type (cloud mode only).
|
|
25
25
|
*/
|
|
26
26
|
async startMonitoring(page) {
|
|
27
27
|
if (this.isMonitoring && this.page === page) {
|
|
@@ -42,7 +42,7 @@ function rgbaToHex(color) {
|
|
|
42
42
|
* Extract a compact visual specification from a Figma node.
|
|
43
43
|
* Captures the essential CSS-equivalent properties an AI needs to reproduce the component.
|
|
44
44
|
*/
|
|
45
|
-
function extractVisualSpec(node) {
|
|
45
|
+
export function extractVisualSpec(node) {
|
|
46
46
|
if (!node)
|
|
47
47
|
return undefined;
|
|
48
48
|
const spec = {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* figma_diagnose β a designer-readable health check for figma-console-mcp.
|
|
3
|
+
*
|
|
4
|
+
* This is the one tool to point a confused user at. It self-identifies the
|
|
5
|
+
* server, reports the transport / plugin / token state in plain language,
|
|
6
|
+
* and explicitly disclaims any token or OAuth error a user might be seeing
|
|
7
|
+
* in chat (those typically come from a different MCP). The response is
|
|
8
|
+
* structured so an LLM is likely to surface the `report` field verbatim.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { MCP_NAME, withIdentity } from "./identity.js";
|
|
12
|
+
function buildReport(opts) {
|
|
13
|
+
const lines = [];
|
|
14
|
+
lines.push(`# ${MCP_NAME} diagnostic`);
|
|
15
|
+
lines.push("");
|
|
16
|
+
lines.push(`Server version: ${opts.getServerVersion()}`);
|
|
17
|
+
lines.push(`Mode: ${opts.mode === "local" ? "Local (stdio + WebSocket plugin bridge)" : "Cloud (Cloudflare Workers)"}`);
|
|
18
|
+
lines.push("");
|
|
19
|
+
const plugin = opts.getPluginState?.();
|
|
20
|
+
lines.push("## Plugin connection");
|
|
21
|
+
if (!plugin) {
|
|
22
|
+
lines.push("- No WebSocket server (cloud mode runs without a local plugin bridge unless paired).");
|
|
23
|
+
}
|
|
24
|
+
else if (plugin.connected) {
|
|
25
|
+
const portInfo = plugin.portFallbackFrom && plugin.port && plugin.port !== plugin.portFallbackFrom
|
|
26
|
+
? `port ${plugin.port} (fallback from ${plugin.portFallbackFrom})`
|
|
27
|
+
: plugin.port
|
|
28
|
+
? `port ${plugin.port}`
|
|
29
|
+
: "connected";
|
|
30
|
+
lines.push(`- β
Desktop Bridge plugin connected on ${portInfo}.`);
|
|
31
|
+
if (plugin.fileName) {
|
|
32
|
+
lines.push(`- Active file: **${plugin.fileName}**${plugin.currentPage ? ` (page: ${plugin.currentPage})` : ""}.`);
|
|
33
|
+
}
|
|
34
|
+
if (plugin.editorType && plugin.editorType !== "figma") {
|
|
35
|
+
lines.push(`- Editor type: ${plugin.editorType}.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
lines.push(`- β οΈ Desktop Bridge plugin not connected${plugin.port ? ` (server is listening on port ${plugin.port})` : ""}.`);
|
|
40
|
+
lines.push("- To fix: open the Figma Desktop Bridge plugin in Figma Desktop. If it was already running, close and reopen it once.");
|
|
41
|
+
}
|
|
42
|
+
lines.push("");
|
|
43
|
+
const token = opts.getTokenState?.();
|
|
44
|
+
lines.push("## REST API token");
|
|
45
|
+
if (!token) {
|
|
46
|
+
lines.push("- Token state not available in this mode.");
|
|
47
|
+
}
|
|
48
|
+
else if (token.hasToken) {
|
|
49
|
+
lines.push(`- β
Figma access token detected (source: ${token.source ?? "unknown"}). REST-based tools should work.`);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
lines.push("- β οΈ No Figma access token detected. Plugin-based tools still work; REST-only tools (file data, version history, image rendering) will return an auth error.");
|
|
53
|
+
if (opts.mode === "local") {
|
|
54
|
+
lines.push("- To enable REST tools: set FIGMA_ACCESS_TOKEN in your MCP client config. Generate a token at https://www.figma.com/developers/api#access-tokens.");
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
lines.push("- To enable REST tools: authenticate via your MCP client's OAuth flow or pass a Figma personal access token (figd_...) as a Bearer token.");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
lines.push("");
|
|
61
|
+
lines.push("## If you're seeing token / OAuth errors in chat");
|
|
62
|
+
lines.push(`If you see messages like "API token has expired" or "Bearer token has expired" and the response above does NOT show a token problem, the error is most likely coming from a **different MCP server**, not from ${MCP_NAME}.`);
|
|
63
|
+
lines.push("");
|
|
64
|
+
lines.push("Common cause: Figma's native MCP (often listed as just `Figma` in your MCP client) is also installed and its OAuth session expired. Check your MCP client's server list. Errors from those servers are not produced by figma-console-mcp.");
|
|
65
|
+
lines.push("");
|
|
66
|
+
return lines.join("\n");
|
|
67
|
+
}
|
|
68
|
+
export function registerDiagnoseTool(server, options) {
|
|
69
|
+
server.tool("figma_diagnose", `Designer-readable health check for ${MCP_NAME}. Use this when something seems wrong β it self-identifies the server, reports plugin connection / file / token status in plain language, and disambiguates errors that may be coming from a different Figma-related MCP server. Recommended as the first step when a user reports a "token expired" or "plugin disconnected" issue.`, {
|
|
70
|
+
verbose: z
|
|
71
|
+
.boolean()
|
|
72
|
+
.optional()
|
|
73
|
+
.default(false)
|
|
74
|
+
.describe("Include the raw structured state alongside the human-readable report."),
|
|
75
|
+
}, async ({ verbose }) => {
|
|
76
|
+
const report = buildReport(options);
|
|
77
|
+
const details = verbose
|
|
78
|
+
? {
|
|
79
|
+
plugin: options.getPluginState?.() ?? null,
|
|
80
|
+
token: options.getTokenState?.() ?? null,
|
|
81
|
+
}
|
|
82
|
+
: undefined;
|
|
83
|
+
const payload = withIdentity({
|
|
84
|
+
report,
|
|
85
|
+
...(details ? { details } : {}),
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
content: [
|
|
89
|
+
{
|
|
90
|
+
type: "text",
|
|
91
|
+
text: JSON.stringify(payload),
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
}
|
|
@@ -242,6 +242,25 @@ export class FigmaAPI {
|
|
|
242
242
|
async getComponentSets(fileKey) {
|
|
243
243
|
return this.request(`/files/${fileKey}/component_sets`);
|
|
244
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* GET /v1/components/:key
|
|
247
|
+
* Get metadata for a single published component by its key.
|
|
248
|
+
* Returns { status, error, meta: PublishedComponent } where meta includes
|
|
249
|
+
* file_key, node_id, name, description, containing_frame, user, etc.
|
|
250
|
+
* Use this to resolve a componentKey (from search results) to its source file.
|
|
251
|
+
*/
|
|
252
|
+
async getComponentByKey(key) {
|
|
253
|
+
return this.request(`/components/${key}`);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* GET /v1/component_sets/:key
|
|
257
|
+
* Get metadata for a single published component set (variant container) by its key.
|
|
258
|
+
* Returns { status, error, meta: PublishedComponentSet } with the same fields
|
|
259
|
+
* as getComponentByKey. The node_id points to the parent COMPONENT_SET node.
|
|
260
|
+
*/
|
|
261
|
+
async getComponentSetByKey(key) {
|
|
262
|
+
return this.request(`/component_sets/${key}`);
|
|
263
|
+
}
|
|
245
264
|
/**
|
|
246
265
|
* GET /v1/images/:file_key
|
|
247
266
|
* Renders images for specified nodes
|