-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(API): Implement figma attachments endpoints #415
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_key/create | ||
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_key create \ | ||
--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_key/delete | ||
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_key delete \ | ||
--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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be more logical to add these operations to
figma_attachments
(or perhapskeys
) instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted, not exactly sure if this is what you meant
CR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, but they'd also have to live on
paths/figma_attachments
IMOThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I guess the API PR has already been merged in phrase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the API PR is merged. Can we have two
create.yaml
/destroy.yaml
in the same folder? I could adjust this. On the API PR we agreed to not use custom named methods and instead went with second controller to have option for second create/destroy paths