-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(API): Implement figma attachments endpoints (#415)
* feat: Implement figma attachments endpoints * CR
- Loading branch information
1 parent
b27c83f
commit 970e612
Showing
12 changed files
with
957 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
summary: Attach the Figma attachment to a key | ||
description: Attach the Figma attachment to a key | ||
operationId: figma_attachment/attach_to_key | ||
tags: | ||
- Key's Figma attachments | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/figma_attachment_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
"204": | ||
"$ref": "../../responses.yaml#/204" | ||
"400": | ||
"$ref": "../../responses.yaml#/400" | ||
"404": | ||
"$ref": "../../responses.yaml#/404" | ||
"429": | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/figma_attachments/:figma_attachment_id/keys" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X POST \ | ||
-F branch=my-feature-branch \ | ||
-F id=key_id \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase figma_attachment attach_to_key \ | ||
--project_id <project_id> \ | ||
--figma_attachment_id <figma_attachment_id> \ | ||
--id <id> \ | ||
--branch my-feature-branch \ | ||
--access_token <token> | ||
x-cli-version: "2.13" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
summary: Detach the Figma attachment from a key | ||
description: Detach the Figma attachment from a key | ||
operationId: figma_attachment/detach_from_key | ||
tags: | ||
- Key's Figma attachments | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/figma_attachment_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
"204": | ||
"$ref": "../../responses.yaml#/204" | ||
"400": | ||
"$ref": "../../responses.yaml#/400" | ||
"404": | ||
"$ref": "../../responses.yaml#/404" | ||
"429": | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/figma_attachments/:figma_attachment_id/keys/:id" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X DELETE \ | ||
-F branch=my-feature-branch \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase figma_attachment detach_from_key \ | ||
--project_id <project_id> \ | ||
--figma_attachment_id <figma_attachment_id> \ | ||
--id <id> \ | ||
--branch my-feature-branch \ | ||
--access_token <token> | ||
x-cli-version: "2.13" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
summary: Create a Figma attachment | ||
description: Create a new Figma attachment. | ||
operationId: figma_attachment/create | ||
tags: | ||
- Figma attachments | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
"201": | ||
description: Created | ||
content: | ||
application/json: | ||
schema: | ||
"$ref": "../../schemas/figma_attachment.yaml#/figma_attachment" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
"400": | ||
"$ref": "../../responses.yaml#/400" | ||
"404": | ||
"$ref": "../../responses.yaml#/404" | ||
"429": | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/figma_attachments" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X POST \ | ||
-F branch=my-feature-branch \ | ||
-F url=https://figma.com/file/xxxxx/sample \ | ||
- lang: CLI v2 | ||
source: |- | ||
phrase figma_attachment create \ | ||
--project_id <project_id> \ | ||
--data '{"branch":"my-feature-branch", "url":"https://figma.com/file/xxxxx/sample"}' \ | ||
--access_token <token> | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
title: figma_attachment/create/parameters | ||
properties: | ||
branch: | ||
description: specify the branch to use | ||
type: string | ||
example: my-feature-branch | ||
url: | ||
description: Figma file url | ||
type: string | ||
example: https://figma.com/file/xxxxx/sample | ||
x-cli-version: "2.13" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
summary: Delete a Figma attachment | ||
description: Delete an existing Figma attachment. | ||
operationId: figma_attachment/delete | ||
tags: | ||
- Figma attachments | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
"204": | ||
"$ref": "../../responses.yaml#/204" | ||
"400": | ||
"$ref": "../../responses.yaml#/400" | ||
"404": | ||
"$ref": "../../responses.yaml#/404" | ||
"429": | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/figma_attachments/:id" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X DELETE \ | ||
-d '{"branch":"my-feature-branch"}' \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase figma_attachment delete \ | ||
--project_id <project_id> \ | ||
--id <id> \ | ||
--branch my-feature-branch \ | ||
--access_token <token> | ||
x-cli-version: "2.13" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
summary: List Figma attachments | ||
description: List all Figma attachments for the given project | ||
operationId: figma_attachments/list | ||
tags: | ||
- Figma attachments | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/page" | ||
- "$ref": "../../parameters.yaml#/per_page" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
"$ref": "../../schemas/figma_attachment.yaml#/figma_attachment" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
Link: | ||
"$ref": "../../headers.yaml#/Link" | ||
"400": | ||
"$ref": "../../responses.yaml#/400" | ||
"404": | ||
"$ref": "../../responses.yaml#/404" | ||
"429": | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/figma_attachments?branch=my-feature-branch" \ | ||
-X GET \ | ||
-u USERNAME_OR_ACCESS_TOKEN | ||
- lang: CLI v2 | ||
source: |- | ||
phrase figma_attachments list \ | ||
--project_id <project_id> \ | ||
--branch my-feature-branch \ | ||
--access_token <token> | ||
x-cli-version: "2.13" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
summary: Get a single Figma attachment | ||
description: Get details on a single Figma attachment for a given project. | ||
operationId: figma_attachment/show | ||
tags: | ||
- Figma attachments | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
"$ref": "../../schemas/figma_attachment.yaml#/figma_attachment" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
"400": | ||
"$ref": "../../responses.yaml#/400" | ||
"404": | ||
"$ref": "../../responses.yaml#/404" | ||
"429": | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/figma_attachments/:id?branch=my-feature-branch" \ | ||
-X GET \ | ||
-u USERNAME_OR_ACCESS_TOKEN | ||
- lang: CLI v2 | ||
source: |- | ||
phrase figma_attachment show \ | ||
--project_id <project_id> \ | ||
--id <id> \ | ||
--branch my-feature-branch \ | ||
--access_token <token> | ||
x-cli-version: "2.13" |
Oops, something went wrong.