@utdk/figma 0.37.0-20260408.5-dev.646adf4

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/docs/styles.md ADDED
@@ -0,0 +1,114 @@
1
+ # Styles
2
+
3
+ Use these operations through the generated client (not direct HTTP calls).
4
+
5
+ Import path: `@utdk/figma`
6
+
7
+ ## Operations
8
+
9
+ ### `figma.getFileStyles`
10
+
11
+ - **HTTP**: `GET /v1/files/{file_key}/styles`
12
+ - **What it does**: Get file styles
13
+ - **OpenAPI operationId**: `getFileStyles`
14
+ - **Path params**: `file_key`
15
+ - **Query params**: None
16
+ - **Response codes**: `200`, `400`, `403`, `404`, `429`, `500`
17
+ - **Transport options**: None
18
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
19
+ - **TypeScript**: [Client interface](../types.ts)
20
+
21
+ **Inputs**
22
+
23
+ - Client input type: `{ file_key: string }`
24
+ - Client transport options: None
25
+
26
+ **Outputs**
27
+
28
+ - Client return type: `{ status: 200; error: false; meta: { styles: ({ key: string; file_key: string; node_id: string; style_type: "FILL" | "TEXT" | "EFFECT" | "GRID"; thumbnail_url?: string; name: string; description: string; created_at: str...`
29
+ - OpenAPI response codes: `200`, `400`, `403`, `404`, `429`, `500`
30
+
31
+ ```ts
32
+ import figma from "@utdk/figma";
33
+
34
+ type GetFileStylesInput = Parameters<typeof figma.getFileStyles> extends [infer T, ...unknown[]] ? T : undefined;
35
+ type GetFileStylesOutput = Awaited<ReturnType<typeof figma.getFileStyles>>;
36
+
37
+ const input: GetFileStylesInput = {} as { file_key: string };
38
+ const result: GetFileStylesOutput = await figma.getFileStyles(input);
39
+
40
+ // Result shape (from schema): { status: 200; error: false; meta: { styles: ({ key: string; file_key: string; node_id: string; style_type: "FILL" | "TEXT" | "EFFECT" | "GRID"; thumbnail_url?: string; name: string; description: string; created_at: str...
41
+ ```
42
+
43
+ ### `figma.getStyle`
44
+
45
+ - **HTTP**: `GET /v1/styles/{key}`
46
+ - **What it does**: Get style
47
+ - **OpenAPI operationId**: `getStyle`
48
+ - **Path params**: `key`
49
+ - **Query params**: None
50
+ - **Response codes**: `200`, `400`, `403`, `404`, `429`, `500`
51
+ - **Transport options**: None
52
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
53
+ - **TypeScript**: [Client interface](../types.ts)
54
+
55
+ **Inputs**
56
+
57
+ - Client input type: `{ key: string }`
58
+ - Client transport options: None
59
+
60
+ **Outputs**
61
+
62
+ - Client return type: `{ status: 200; error: false; meta: { key: string; file_key: string; node_id: string; style_type: "FILL" | "TEXT" | "EFFECT" | "GRID"; thumbnail_url?: string; name: string; description: string; created_at: string; update...`
63
+ - OpenAPI response codes: `200`, `400`, `403`, `404`, `429`, `500`
64
+
65
+ ```ts
66
+ import figma from "@utdk/figma";
67
+
68
+ type GetStyleInput = Parameters<typeof figma.getStyle> extends [infer T, ...unknown[]] ? T : undefined;
69
+ type GetStyleOutput = Awaited<ReturnType<typeof figma.getStyle>>;
70
+
71
+ const input: GetStyleInput = {} as { key: string };
72
+ const result: GetStyleOutput = await figma.getStyle(input);
73
+
74
+ // Result shape (from schema): { status: 200; error: false; meta: { key: string; file_key: string; node_id: string; style_type: "FILL" | "TEXT" | "EFFECT" | "GRID"; thumbnail_url?: string; name: string; description: string; created_at: string; update...
75
+ ```
76
+
77
+ ### `figma.getTeamStyles`
78
+
79
+ - **HTTP**: `GET /v1/teams/{team_id}/styles`
80
+ - **What it does**: Get team styles
81
+ - **OpenAPI operationId**: `getTeamStyles`
82
+ - **Path params**: `team_id`
83
+ - **Query params**: `page_size`, `after`, `before`
84
+ - **Response codes**: `200`, `400`, `403`, `404`, `429`, `500`
85
+ - **Transport options**: None
86
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
87
+ - **TypeScript**: [Client interface](../types.ts)
88
+
89
+ **Inputs**
90
+
91
+ - Client input type: `{ team_id: string; page_size?: number; after?: number; before?: number }`
92
+ - Client transport options: None
93
+
94
+ **Outputs**
95
+
96
+ - Client return type: `{ status: 200; error: false; meta: { styles: ({ key: string; file_key: string; node_id: string; style_type: "FILL" | "TEXT" | "EFFECT" | "GRID"; thumbnail_url?: string; name: string; description: string; created_at: str...`
97
+ - OpenAPI response codes: `200`, `400`, `403`, `404`, `429`, `500`
98
+
99
+ ```ts
100
+ import figma from "@utdk/figma";
101
+
102
+ type GetTeamStylesInput = Parameters<typeof figma.getTeamStyles> extends [infer T, ...unknown[]] ? T : undefined;
103
+ type GetTeamStylesOutput = Awaited<ReturnType<typeof figma.getTeamStyles>>;
104
+
105
+ const input: GetTeamStylesInput = {} as { team_id: string; page_size?: number; after?: number; before?: number };
106
+ const result: GetTeamStylesOutput = await figma.getTeamStyles(input);
107
+
108
+ // Result shape (from schema): { status: 200; error: false; meta: { styles: ({ key: string; file_key: string; node_id: string; style_type: "FILL" | "TEXT" | "EFFECT" | "GRID"; thumbnail_url?: string; name: string; description: string; created_at: str...
109
+ ```
110
+
111
+
112
+ <!-- prompt-hash:
113
+ 8c3694991a4c289225f05a4e8f1e098cc74d085a088d7dffd82f00d93797b7f8
114
+ -->
package/docs/users.md ADDED
@@ -0,0 +1,45 @@
1
+ # Users
2
+
3
+ Use these operations through the generated client (not direct HTTP calls).
4
+
5
+ Import path: `@utdk/figma`
6
+
7
+ ## Operations
8
+
9
+ ### `figma.getMe`
10
+
11
+ - **HTTP**: `GET /v1/me`
12
+ - **What it does**: Get current user
13
+ - **OpenAPI operationId**: `getMe`
14
+ - **Path params**: None
15
+ - **Query params**: None
16
+ - **Response codes**: `200`, `403`, `429`, `500`
17
+ - **Transport options**: None
18
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
19
+ - **TypeScript**: [Client interface](../types.ts)
20
+
21
+ **Inputs**
22
+
23
+ - Client input type: `{ [key: string]: unknown }`
24
+ - Client transport options: None
25
+
26
+ **Outputs**
27
+
28
+ - Client return type: `{ [key: string]: unknown }`
29
+ - OpenAPI response codes: `200`, `403`, `429`, `500`
30
+
31
+ ```ts
32
+ import figma from "@utdk/figma";
33
+
34
+ type GetMeInput = Parameters<typeof figma.getMe> extends [infer T, ...unknown[]] ? T : undefined;
35
+ type GetMeOutput = Awaited<ReturnType<typeof figma.getMe>>;
36
+
37
+ const result: GetMeOutput = await figma.getMe();
38
+
39
+ // Result shape (from schema): { [key: string]: unknown }
40
+ ```
41
+
42
+
43
+ <!-- prompt-hash:
44
+ 8c3694991a4c289225f05a4e8f1e098cc74d085a088d7dffd82f00d93797b7f8
45
+ -->
@@ -0,0 +1,114 @@
1
+ # Variables
2
+
3
+ Use these operations through the generated client (not direct HTTP calls).
4
+
5
+ Import path: `@utdk/figma`
6
+
7
+ ## Operations
8
+
9
+ ### `figma.postVariables`
10
+
11
+ - **HTTP**: `POST /v1/files/{file_key}/variables`
12
+ - **What it does**: Create/modify/delete variables
13
+ - **OpenAPI operationId**: `postVariables`
14
+ - **Path params**: `file_key`
15
+ - **Query params**: None
16
+ - **Response codes**: `200`, `400`, `401`, `403`, `404`, `429`, `500`
17
+ - **Transport options**: None
18
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
19
+ - **TypeScript**: [Client interface](../types.ts)
20
+
21
+ **Inputs**
22
+
23
+ - Client input type: `{ variableCollections?: ({ action: "CREATE"; id?: string; name: string; initialModeId?: string; hiddenFromPublishing?: boolean; parentVariableCollectionId?: string; initialModeIdToParentModeIdMapping?: { [key: string]: string | undefined } } | { action: "UPDATE"; id: string; name?: string; hiddenFromPublishing?: boolean } | { action: "DELETE"; id: string })[]; variableModes?: ({ action: "CREATE"; id?: string; name: string; variableCollectionId: string } | { action: "UPDATE"; id: string; name?: string; variableCollectionId: string } | { action: "DELETE"; id: string })[]; variables?: ({ action: "CREATE"; id?: string; name: string; variableCollectionId: string; resolvedType: "BOOLEAN" | "FLOAT" | "STRING" | "COLOR"; description?: string; hiddenFromPublishing?: boolean; scopes?: ("ALL_SCOPES" | "TEXT_CONTENT" | "CORNER_RADIUS" | "WIDTH_HEIGHT" | "GAP" | "ALL_FILLS" | "FRAME_FILL" | "SHAPE_FILL" | "TEXT_FILL" | "STROKE_COLOR" | "STROKE_FLOAT" | "EFFECT_FLOAT" | "EFFECT_COLOR" | "OPACITY" | "FONT_FAMILY" | "FONT_STYLE" | "FONT_WEIGHT" | "FONT_SIZE" | "LINE_HEIGHT" | "LETTER_SPACING" | "PARAGRAPH_SPACING" | "PARAGRAPH_INDENT" | "FONT_VARIATIONS")[]; codeSyntax?: { WEB?: string; ANDROID?: string; iOS?: string } } | { action: "UPDATE"; id: string; name?: string; description?: string; hiddenFromPublishing?: boolean; scopes?: ("ALL_SCOPES" | "TEXT_CONTENT" | "CORNER_RADIUS" | "WIDTH_HEIGHT" | "GAP" | "ALL_FILLS" | "FRAME_FILL" | "SHAPE_FILL" | "TEXT_FILL" | "STROKE_COLOR" | "STROKE_FLOAT" | "EFFECT_FLOAT" | "EFFECT_COLOR" | "OPACITY" | "FONT_FAMILY" | "FONT_STYLE" | "FONT_WEIGHT" | "FONT_SIZE" | "LINE_HEIGHT" | "LETTER_SPACING" | "PARAGRAPH_SPACING" | "PARAGRAPH_INDENT" | "FONT_VARIATIONS")[]; codeSyntax?: { WEB?: string; ANDROID?: string; iOS?: string } } | { action: "DELETE"; id: string })[]; variableModeValues?: ({ variableId: string; modeId: string; value: boolean | number | string | { r: number; g: number; b: number } | { r: number; g: number; b: number; a: number } | { type: "VARIABLE_ALIAS"; id: string } | null })[]; file_key: string }`
24
+ - Client transport options: None
25
+
26
+ **Outputs**
27
+
28
+ - Client return type: `{ status: 200; error: false; meta: { tempIdToRealId: { [key: string]: string | undefined } } }`
29
+ - OpenAPI response codes: `200`, `400`, `401`, `403`, `404`, `429`, `500`
30
+
31
+ ```ts
32
+ import figma from "@utdk/figma";
33
+
34
+ type PostVariablesInput = Parameters<typeof figma.postVariables> extends [infer T, ...unknown[]] ? T : undefined;
35
+ type PostVariablesOutput = Awaited<ReturnType<typeof figma.postVariables>>;
36
+
37
+ const input: PostVariablesInput = {} as { variableCollections?: ({ action: "CREATE"; id?: string; name: string; initialModeId?: string; hiddenFromPublishing?: boolean; parentVariableCollectionId?: string; initialModeIdToParentModeIdMapping?: { [key: string]: string | undefined } } | { action: "UPDATE"; id: string; name?: string; hiddenFromPublishing?: boolean } | { action: "DELETE"; id: string })[]; variableModes?: ({ action: "CREATE"; id?: string; name: string; variableCollectionId: string } | { action: "UPDATE"; id: string; name?: string; variableCollectionId: string } | { action: "DELETE"; id: string })[]; variables?: ({ action: "CREATE"; id?: string; name: string; variableCollectionId: string; resolvedType: "BOOLEAN" | "FLOAT" | "STRING" | "COLOR"; description?: string; hiddenFromPublishing?: boolean; scopes?: ("ALL_SCOPES" | "TEXT_CONTENT" | "CORNER_RADIUS" | "WIDTH_HEIGHT" | "GAP" | "ALL_FILLS" | "FRAME_FILL" | "SHAPE_FILL" | "TEXT_FILL" | "STROKE_COLOR" | "STROKE_FLOAT" | "EFFECT_FLOAT" | "EFFECT_COLOR" | "OPACITY" | "FONT_FAMILY" | "FONT_STYLE" | "FONT_WEIGHT" | "FONT_SIZE" | "LINE_HEIGHT" | "LETTER_SPACING" | "PARAGRAPH_SPACING" | "PARAGRAPH_INDENT" | "FONT_VARIATIONS")[]; codeSyntax?: { WEB?: string; ANDROID?: string; iOS?: string } } | { action: "UPDATE"; id: string; name?: string; description?: string; hiddenFromPublishing?: boolean; scopes?: ("ALL_SCOPES" | "TEXT_CONTENT" | "CORNER_RADIUS" | "WIDTH_HEIGHT" | "GAP" | "ALL_FILLS" | "FRAME_FILL" | "SHAPE_FILL" | "TEXT_FILL" | "STROKE_COLOR" | "STROKE_FLOAT" | "EFFECT_FLOAT" | "EFFECT_COLOR" | "OPACITY" | "FONT_FAMILY" | "FONT_STYLE" | "FONT_WEIGHT" | "FONT_SIZE" | "LINE_HEIGHT" | "LETTER_SPACING" | "PARAGRAPH_SPACING" | "PARAGRAPH_INDENT" | "FONT_VARIATIONS")[]; codeSyntax?: { WEB?: string; ANDROID?: string; iOS?: string } } | { action: "DELETE"; id: string })[]; variableModeValues?: ({ variableId: string; modeId: string; value: boolean | number | string | { r: number; g: number; b: number } | { r: number; g: number; b: number; a: number } | { type: "VARIABLE_ALIAS"; id: string } | null })[]; file_key: string };
38
+ const result: PostVariablesOutput = await figma.postVariables(input);
39
+
40
+ // Result shape (from schema): { status: 200; error: false; meta: { tempIdToRealId: { [key: string]: string | undefined } } }
41
+ ```
42
+
43
+ ### `figma.getLocalVariables`
44
+
45
+ - **HTTP**: `GET /v1/files/{file_key}/variables/local`
46
+ - **What it does**: Get local variables
47
+ - **OpenAPI operationId**: `getLocalVariables`
48
+ - **Path params**: `file_key`
49
+ - **Query params**: None
50
+ - **Response codes**: `200`, `401`, `403`, `404`, `429`, `500`
51
+ - **Transport options**: None
52
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
53
+ - **TypeScript**: [Client interface](../types.ts)
54
+
55
+ **Inputs**
56
+
57
+ - Client input type: `{ file_key: string }`
58
+ - Client transport options: None
59
+
60
+ **Outputs**
61
+
62
+ - Client return type: `{ status: 200; error: false; meta: { variables: { [key: string]: { id: string; name: string; key: string; variableCollectionId: string; resolvedType: "BOOLEAN" | "FLOAT" | "STRING" | "COLOR"; valuesByMode: { [key: strin...`
63
+ - OpenAPI response codes: `200`, `401`, `403`, `404`, `429`, `500`
64
+
65
+ ```ts
66
+ import figma from "@utdk/figma";
67
+
68
+ type GetLocalVariablesInput = Parameters<typeof figma.getLocalVariables> extends [infer T, ...unknown[]] ? T : undefined;
69
+ type GetLocalVariablesOutput = Awaited<ReturnType<typeof figma.getLocalVariables>>;
70
+
71
+ const input: GetLocalVariablesInput = {} as { file_key: string };
72
+ const result: GetLocalVariablesOutput = await figma.getLocalVariables(input);
73
+
74
+ // Result shape (from schema): { status: 200; error: false; meta: { variables: { [key: string]: { id: string; name: string; key: string; variableCollectionId: string; resolvedType: "BOOLEAN" | "FLOAT" | "STRING" | "COLOR"; valuesByMode: { [key: strin...
75
+ ```
76
+
77
+ ### `figma.getPublishedVariables`
78
+
79
+ - **HTTP**: `GET /v1/files/{file_key}/variables/published`
80
+ - **What it does**: Get published variables
81
+ - **OpenAPI operationId**: `getPublishedVariables`
82
+ - **Path params**: `file_key`
83
+ - **Query params**: None
84
+ - **Response codes**: `200`, `401`, `403`, `404`, `429`, `500`
85
+ - **Transport options**: None
86
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
87
+ - **TypeScript**: [Client interface](../types.ts)
88
+
89
+ **Inputs**
90
+
91
+ - Client input type: `{ file_key: string }`
92
+ - Client transport options: None
93
+
94
+ **Outputs**
95
+
96
+ - Client return type: `{ status: 200; error: false; meta: { variables: { [key: string]: { id: string; subscribed_id: string; name: string; key: string; variableCollectionId: string; resolvedDataType: "BOOLEAN" | "FLOAT" | "STRING" | "COLOR"; ...`
97
+ - OpenAPI response codes: `200`, `401`, `403`, `404`, `429`, `500`
98
+
99
+ ```ts
100
+ import figma from "@utdk/figma";
101
+
102
+ type GetPublishedVariablesInput = Parameters<typeof figma.getPublishedVariables> extends [infer T, ...unknown[]] ? T : undefined;
103
+ type GetPublishedVariablesOutput = Awaited<ReturnType<typeof figma.getPublishedVariables>>;
104
+
105
+ const input: GetPublishedVariablesInput = {} as { file_key: string };
106
+ const result: GetPublishedVariablesOutput = await figma.getPublishedVariables(input);
107
+
108
+ // Result shape (from schema): { status: 200; error: false; meta: { variables: { [key: string]: { id: string; subscribed_id: string; name: string; key: string; variableCollectionId: string; resolvedDataType: "BOOLEAN" | "FLOAT" | "STRING" | "COLOR"; ...
109
+ ```
110
+
111
+
112
+ <!-- prompt-hash:
113
+ 8c3694991a4c289225f05a4e8f1e098cc74d085a088d7dffd82f00d93797b7f8
114
+ -->
@@ -0,0 +1,250 @@
1
+ # Webhooks
2
+
3
+ Use these operations through the generated client (not direct HTTP calls).
4
+
5
+ Import path: `@utdk/figma`
6
+
7
+ ## Operations
8
+
9
+ ### `figma.getTeamWebhooks`
10
+
11
+ - **HTTP**: `GET /v2/teams/{team_id}/webhooks`
12
+ - **What it does**: [Deprecated] Get team webhooks
13
+ - **OpenAPI operationId**: `getTeamWebhooks`
14
+ - **Path params**: `team_id`
15
+ - **Query params**: None
16
+ - **Response codes**: `200`, `403`, `404`, `429`, `500`
17
+ - **Transport options**: None
18
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
19
+ - **TypeScript**: [Client interface](../types.ts)
20
+
21
+ **Inputs**
22
+
23
+ - Client input type: `{ team_id: string }`
24
+ - Client transport options: None
25
+
26
+ **Outputs**
27
+
28
+ - Client return type: `{ webhooks: ({ id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string...`
29
+ - OpenAPI response codes: `200`, `403`, `404`, `429`, `500`
30
+
31
+ ```ts
32
+ import figma from "@utdk/figma";
33
+
34
+ type GetTeamWebhooksInput = Parameters<typeof figma.getTeamWebhooks> extends [infer T, ...unknown[]] ? T : undefined;
35
+ type GetTeamWebhooksOutput = Awaited<ReturnType<typeof figma.getTeamWebhooks>>;
36
+
37
+ const input: GetTeamWebhooksInput = {} as { team_id: string };
38
+ const result: GetTeamWebhooksOutput = await figma.getTeamWebhooks(input);
39
+
40
+ // Result shape (from schema): { webhooks: ({ id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string...
41
+ ```
42
+
43
+ ### `figma.getWebhooks`
44
+
45
+ - **HTTP**: `GET /v2/webhooks`
46
+ - **What it does**: Get webhooks by context or plan
47
+ - **OpenAPI operationId**: `getWebhooks`
48
+ - **Path params**: None
49
+ - **Query params**: `context`, `context_id`, `plan_api_id`, `cursor`
50
+ - **Response codes**: `200`, `400`, `403`
51
+ - **Transport options**: None
52
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
53
+ - **TypeScript**: [Client interface](../types.ts)
54
+
55
+ **Inputs**
56
+
57
+ - Client input type: `{ context?: string; context_id?: string; plan_api_id?: string; cursor?: string }`
58
+ - Client transport options: None
59
+
60
+ **Outputs**
61
+
62
+ - Client return type: `{ webhooks: ({ id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string...`
63
+ - OpenAPI response codes: `200`, `400`, `403`
64
+
65
+ ```ts
66
+ import figma from "@utdk/figma";
67
+
68
+ type GetWebhooksInput = Parameters<typeof figma.getWebhooks> extends [infer T, ...unknown[]] ? T : undefined;
69
+ type GetWebhooksOutput = Awaited<ReturnType<typeof figma.getWebhooks>>;
70
+
71
+ const input: GetWebhooksInput = {} as { context?: string; context_id?: string; plan_api_id?: string; cursor?: string };
72
+ const result: GetWebhooksOutput = await figma.getWebhooks(input);
73
+
74
+ // Result shape (from schema): { webhooks: ({ id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string...
75
+ ```
76
+
77
+ ### `figma.postWebhook`
78
+
79
+ - **HTTP**: `POST /v2/webhooks`
80
+ - **What it does**: Create a webhook
81
+ - **OpenAPI operationId**: `postWebhook`
82
+ - **Path params**: None
83
+ - **Query params**: None
84
+ - **Response codes**: `200`, `400`, `403`, `429`, `500`
85
+ - **Transport options**: None
86
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
87
+ - **TypeScript**: [Client interface](../types.ts)
88
+
89
+ **Inputs**
90
+
91
+ - Client input type: `{ event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id?: string; context: string; context_id: string; endpoint: string; passcode: string; status?: "ACTIVE" | "PAUSED"; description?: string }`
92
+ - Client transport options: None
93
+
94
+ **Outputs**
95
+
96
+ - Client return type: `{ id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string; plan_api_id...`
97
+ - OpenAPI response codes: `200`, `400`, `403`, `429`, `500`
98
+
99
+ ```ts
100
+ import figma from "@utdk/figma";
101
+
102
+ type PostWebhookInput = Parameters<typeof figma.postWebhook> extends [infer T, ...unknown[]] ? T : undefined;
103
+ type PostWebhookOutput = Awaited<ReturnType<typeof figma.postWebhook>>;
104
+
105
+ const input: PostWebhookInput = {} as { event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id?: string; context: string; context_id: string; endpoint: string; passcode: string; status?: "ACTIVE" | "PAUSED"; description?: string };
106
+ const result: PostWebhookOutput = await figma.postWebhook(input);
107
+
108
+ // Result shape (from schema): { id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string; plan_api_id...
109
+ ```
110
+
111
+ ### `figma.deleteWebhook`
112
+
113
+ - **HTTP**: `DELETE /v2/webhooks/{webhook_id}`
114
+ - **What it does**: Delete a webhook
115
+ - **OpenAPI operationId**: `deleteWebhook`
116
+ - **Path params**: `webhook_id`
117
+ - **Query params**: None
118
+ - **Response codes**: `200`, `400`, `403`, `404`, `429`, `500`
119
+ - **Transport options**: None
120
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
121
+ - **TypeScript**: [Client interface](../types.ts)
122
+
123
+ **Inputs**
124
+
125
+ - Client input type: `{ webhook_id: string }`
126
+ - Client transport options: None
127
+
128
+ **Outputs**
129
+
130
+ - Client return type: `{ id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string; plan_api_id...`
131
+ - OpenAPI response codes: `200`, `400`, `403`, `404`, `429`, `500`
132
+
133
+ ```ts
134
+ import figma from "@utdk/figma";
135
+
136
+ type DeleteWebhookInput = Parameters<typeof figma.deleteWebhook> extends [infer T, ...unknown[]] ? T : undefined;
137
+ type DeleteWebhookOutput = Awaited<ReturnType<typeof figma.deleteWebhook>>;
138
+
139
+ const input: DeleteWebhookInput = {} as { webhook_id: string };
140
+ const result: DeleteWebhookOutput = await figma.deleteWebhook(input);
141
+
142
+ // Result shape (from schema): { id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string; plan_api_id...
143
+ ```
144
+
145
+ ### `figma.getWebhook`
146
+
147
+ - **HTTP**: `GET /v2/webhooks/{webhook_id}`
148
+ - **What it does**: Get a webhook
149
+ - **OpenAPI operationId**: `getWebhook`
150
+ - **Path params**: `webhook_id`
151
+ - **Query params**: None
152
+ - **Response codes**: `200`, `400`, `403`, `404`, `429`, `500`
153
+ - **Transport options**: None
154
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
155
+ - **TypeScript**: [Client interface](../types.ts)
156
+
157
+ **Inputs**
158
+
159
+ - Client input type: `{ webhook_id: string }`
160
+ - Client transport options: None
161
+
162
+ **Outputs**
163
+
164
+ - Client return type: `{ id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string; plan_api_id...`
165
+ - OpenAPI response codes: `200`, `400`, `403`, `404`, `429`, `500`
166
+
167
+ ```ts
168
+ import figma from "@utdk/figma";
169
+
170
+ type GetWebhookInput = Parameters<typeof figma.getWebhook> extends [infer T, ...unknown[]] ? T : undefined;
171
+ type GetWebhookOutput = Awaited<ReturnType<typeof figma.getWebhook>>;
172
+
173
+ const input: GetWebhookInput = {} as { webhook_id: string };
174
+ const result: GetWebhookOutput = await figma.getWebhook(input);
175
+
176
+ // Result shape (from schema): { id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string; plan_api_id...
177
+ ```
178
+
179
+ ### `figma.putWebhook`
180
+
181
+ - **HTTP**: `PUT /v2/webhooks/{webhook_id}`
182
+ - **What it does**: Update a webhook
183
+ - **OpenAPI operationId**: `putWebhook`
184
+ - **Path params**: `webhook_id`
185
+ - **Query params**: None
186
+ - **Response codes**: `200`, `400`, `403`, `404`, `429`, `500`
187
+ - **Transport options**: None
188
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
189
+ - **TypeScript**: [Client interface](../types.ts)
190
+
191
+ **Inputs**
192
+
193
+ - Client input type: `{ event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; endpoint: string; passcode: string; status?: "ACTIVE" | "PAUSED"; description?: string; webhook_id: string }`
194
+ - Client transport options: None
195
+
196
+ **Outputs**
197
+
198
+ - Client return type: `{ id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string; plan_api_id...`
199
+ - OpenAPI response codes: `200`, `400`, `403`, `404`, `429`, `500`
200
+
201
+ ```ts
202
+ import figma from "@utdk/figma";
203
+
204
+ type PutWebhookInput = Parameters<typeof figma.putWebhook> extends [infer T, ...unknown[]] ? T : undefined;
205
+ type PutWebhookOutput = Awaited<ReturnType<typeof figma.putWebhook>>;
206
+
207
+ const input: PutWebhookInput = {} as { event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; endpoint: string; passcode: string; status?: "ACTIVE" | "PAUSED"; description?: string; webhook_id: string };
208
+ const result: PutWebhookOutput = await figma.putWebhook(input);
209
+
210
+ // Result shape (from schema): { id: string; event_type: "PING" | "FILE_UPDATE" | "FILE_VERSION_UPDATE" | "FILE_DELETE" | "LIBRARY_PUBLISH" | "FILE_COMMENT" | "DEV_MODE_STATUS_UPDATE"; team_id: string; context: string; context_id: string; plan_api_id...
211
+ ```
212
+
213
+ ### `figma.getWebhookRequests`
214
+
215
+ - **HTTP**: `GET /v2/webhooks/{webhook_id}/requests`
216
+ - **What it does**: Get webhook requests
217
+ - **OpenAPI operationId**: `getWebhookRequests`
218
+ - **Path params**: `webhook_id`
219
+ - **Query params**: None
220
+ - **Response codes**: `200`, `400`, `403`, `404`, `429`, `500`
221
+ - **Transport options**: None
222
+ - **Source**: [OpenAPI reference](https://www.figma.com/developers/api)
223
+ - **TypeScript**: [Client interface](../types.ts)
224
+
225
+ **Inputs**
226
+
227
+ - Client input type: `{ webhook_id: string }`
228
+ - Client transport options: None
229
+
230
+ **Outputs**
231
+
232
+ - Client return type: `{ requests: ({ webhook_id: string; request_info: { id: string; endpoint: string; payload: { [key: string]: unknown }; sent_at: string }; response_info: { [key: string]: unknown } | null; error_msg: string | null })[] }`
233
+ - OpenAPI response codes: `200`, `400`, `403`, `404`, `429`, `500`
234
+
235
+ ```ts
236
+ import figma from "@utdk/figma";
237
+
238
+ type GetWebhookRequestsInput = Parameters<typeof figma.getWebhookRequests> extends [infer T, ...unknown[]] ? T : undefined;
239
+ type GetWebhookRequestsOutput = Awaited<ReturnType<typeof figma.getWebhookRequests>>;
240
+
241
+ const input: GetWebhookRequestsInput = {} as { webhook_id: string };
242
+ const result: GetWebhookRequestsOutput = await figma.getWebhookRequests(input);
243
+
244
+ // Result shape (from schema): { requests: ({ webhook_id: string; request_info: { id: string; endpoint: string; payload: { [key: string]: unknown }; sent_at: string }; response_info: { [key: string]: unknown } | null; error_msg: string | null })[] }
245
+ ```
246
+
247
+
248
+ <!-- prompt-hash:
249
+ 8c3694991a4c289225f05a4e8f1e098cc74d085a088d7dffd82f00d93797b7f8
250
+ -->
package/index.ts ADDED
@@ -0,0 +1,22 @@
1
+ import type { CreateClientOptions } from "../client.js";
2
+ import { createClient, createLazyClient } from "../client.js";
3
+ import type { FigmaClient } from "./types.js";
4
+ import { toolMetadata } from "./metadata.js";
5
+ import openApiDocument from "./openapi.json" with { type: "json" };
6
+
7
+ export * from "./types.js";
8
+
9
+ export function createFigmaClient(
10
+ options: Omit<CreateClientOptions, "name" | "openApiDocument" | "toolMetadata"> = {},
11
+ ): Promise<FigmaClient> {
12
+ return createClient<FigmaClient>({
13
+ ...options,
14
+ name: "figma",
15
+ openApiDocument,
16
+ toolMetadata,
17
+ });
18
+ }
19
+
20
+ const defaultClient = createLazyClient(() => createFigmaClient());
21
+
22
+ export default defaultClient;