From 970e612fda620ca882a221ef541036b8d200b675 Mon Sep 17 00:00:00 2001 From: Mikko Karkee Date: Fri, 13 Oct 2023 10:47:06 +0300 Subject: [PATCH] feat(API): Implement figma attachments endpoints (#415) * feat: Implement figma attachments endpoints * CR --- doc/compiled.json | 544 +++++++++++++++++++++++ parameters.yaml | 7 + paths.yaml | 19 +- paths/figma_attachment_keys/create.yaml | 44 ++ paths/figma_attachment_keys/destroy.yaml | 43 ++ paths/figma_attachments/create.yaml | 66 +++ paths/figma_attachments/destroy.yaml | 41 ++ paths/figma_attachments/index.yaml | 54 +++ paths/figma_attachments/show.yaml | 50 +++ paths/figma_attachments/update.yaml | 68 +++ schemas.yaml | 2 + schemas/figma_attachment.yaml | 20 + 12 files changed, 957 insertions(+), 1 deletion(-) create mode 100644 paths/figma_attachment_keys/create.yaml create mode 100644 paths/figma_attachment_keys/destroy.yaml create mode 100644 paths/figma_attachments/create.yaml create mode 100644 paths/figma_attachments/destroy.yaml create mode 100644 paths/figma_attachments/index.yaml create mode 100644 paths/figma_attachments/show.yaml create mode 100644 paths/figma_attachments/update.yaml create mode 100644 schemas/figma_attachment.yaml diff --git a/doc/compiled.json b/doc/compiled.json index fb9fe603..eae9e170 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -1180,6 +1180,32 @@ ] } }, + "figma_attachment": { + "type": "object", + "title": "figma_attachment", + "properties": { + "id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "example": { + "id": "626ea67628690c73ac86ac81eec2d185", + "url": "https://figma.com/file/something", + "created_at": "2017-01-28T09:52:53Z", + "updated_at": "2017-01-28T09:52:53Z" + } + }, "glossary": { "type": "object", "title": "glossary", @@ -4074,6 +4100,15 @@ "type": "string" } }, + "figma_attachment_id": { + "in": "path", + "name": "figma_attachment_id", + "description": "Figma attachment ID", + "required": true, + "schema": { + "type": "string" + } + }, "job_id": { "in": "path", "name": "job_id", @@ -4713,6 +4748,515 @@ "x-cli-version": "2.5" } }, + "/projects/{project_id}/figma_attachments": { + "get": { + "summary": "List Figma attachments", + "description": "List all Figma attachments for the given project", + "operationId": "figma_attachments/list", + "tags": [ + "Figma attachments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/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": "#/components/schemas/figma_attachment" + } + } + } + }, + "headers": { + "X-Rate-Limit-Limit": { + "$ref": "#/components/headers/X-Rate-Limit-Limit" + }, + "X-Rate-Limit-Remaining": { + "$ref": "#/components/headers/X-Rate-Limit-Remaining" + }, + "X-Rate-Limit-Reset": { + "$ref": "#/components/headers/X-Rate-Limit-Reset" + }, + "Link": { + "$ref": "#/components/headers/Link" + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "429": { + "$ref": "#/components/responses/429" + } + }, + "x-code-samples": [ + { + "lang": "Curl", + "source": "curl \"https://api.phrase.com/v2/projects/:project_id/figma_attachments?branch=my-feature-branch\" \\\n -X GET \\\n -u USERNAME_OR_ACCESS_TOKEN" + }, + { + "lang": "CLI v2", + "source": "phrase figma_attachments list \\\n--project_id \\\n--branch my-feature-branch \\\n--access_token " + } + ], + "x-cli-version": "2.13" + }, + "post": { + "summary": "Create a Figma attachment", + "description": "Create a new Figma attachment.", + "operationId": "figma_attachment/create", + "tags": [ + "Figma attachments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/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": "#/components/schemas/figma_attachment" + } + } + }, + "headers": { + "X-Rate-Limit-Limit": { + "$ref": "#/components/headers/X-Rate-Limit-Limit" + }, + "X-Rate-Limit-Remaining": { + "$ref": "#/components/headers/X-Rate-Limit-Remaining" + }, + "X-Rate-Limit-Reset": { + "$ref": "#/components/headers/X-Rate-Limit-Reset" + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "429": { + "$ref": "#/components/responses/429" + } + }, + "x-code-samples": [ + { + "lang": "Curl", + "source": "curl \"https://api.phrase.com/v2/projects/:project_id/figma_attachments\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -F branch=my-feature-branch \\\n -F url=https://figma.com/file/xxxxx/sample \\" + }, + { + "lang": "CLI v2", + "source": "phrase figma_attachment create \\\n--project_id \\\n--data '{\"branch\":\"my-feature-branch\", \"url\":\"https://figma.com/file/xxxxx/sample\"}' \\\n--access_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" + } + }, + "/projects/{project_id}/figma_attachments/{id}": { + "get": { + "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": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "$ref": "#/components/parameters/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": "#/components/schemas/figma_attachment" + } + } + }, + "headers": { + "X-Rate-Limit-Limit": { + "$ref": "#/components/headers/X-Rate-Limit-Limit" + }, + "X-Rate-Limit-Remaining": { + "$ref": "#/components/headers/X-Rate-Limit-Remaining" + }, + "X-Rate-Limit-Reset": { + "$ref": "#/components/headers/X-Rate-Limit-Reset" + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "429": { + "$ref": "#/components/responses/429" + } + }, + "x-code-samples": [ + { + "lang": "Curl", + "source": "curl \"https://api.phrase.com/v2/projects/:project_id/figma_attachments/:id?branch=my-feature-branch\" \\\n -X GET \\\n -u USERNAME_OR_ACCESS_TOKEN" + }, + { + "lang": "CLI v2", + "source": "phrase figma_attachment show \\\n--project_id \\\n--id \\\n--branch my-feature-branch \\\n--access_token " + } + ], + "x-cli-version": "2.13" + }, + "patch": { + "summary": "Update a Figma attachment", + "description": "Update an existing Figma attachment.", + "operationId": "figma_attachment/update", + "tags": [ + "Figma attachments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "$ref": "#/components/parameters/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": "#/components/schemas/figma_attachment" + } + } + }, + "headers": { + "X-Rate-Limit-Limit": { + "$ref": "#/components/headers/X-Rate-Limit-Limit" + }, + "X-Rate-Limit-Remaining": { + "$ref": "#/components/headers/X-Rate-Limit-Remaining" + }, + "X-Rate-Limit-Reset": { + "$ref": "#/components/headers/X-Rate-Limit-Reset" + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "429": { + "$ref": "#/components/responses/429" + } + }, + "x-code-samples": [ + { + "lang": "Curl", + "source": "curl \"https://api.phrase.com/v2/projects/:project_id/figma_attachments/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X PATCH \\\n -F branch=my-feature-branch \\\n -F url=https://figma.com/file/xxxxx/sample \\" + }, + { + "lang": "CLI v2", + "source": "phrase figma_attachment update \\\n--project_id \\\n--id \\\n--data '{\"branch\":\"my-feature-branch\", \"url\":\"https://figma.com/file/xxxxx/sample\" }' \\\n--access_token " + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "figma_attachment/update/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" + }, + "delete": { + "summary": "Delete a Figma attachment", + "description": "Delete an existing Figma attachment.", + "operationId": "figma_attachment/delete", + "tags": [ + "Figma attachments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "$ref": "#/components/parameters/id" + }, + { + "description": "specify the branch to use", + "example": "my-feature-branch", + "name": "branch", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/204" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "429": { + "$ref": "#/components/responses/429" + } + }, + "x-code-samples": [ + { + "lang": "Curl", + "source": "curl \"https://api.phrase.com/v2/projects/:project_id/figma_attachments/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X DELETE \\\n -d '{\"branch\":\"my-feature-branch\"}' \\\n -H 'Content-Type: application/json'" + }, + { + "lang": "CLI v2", + "source": "phrase figma_attachment delete \\\n--project_id \\\n--id \\\n--branch my-feature-branch \\\n--access_token " + } + ], + "x-cli-version": "2.13" + } + }, + "/projects/{project_id}/figma_attachments/{figma_attachment_id}/keys": { + "post": { + "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": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "$ref": "#/components/parameters/figma_attachment_id" + }, + { + "$ref": "#/components/parameters/id" + }, + { + "description": "specify the branch to use", + "example": "my-feature-branch", + "name": "branch", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/204" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "429": { + "$ref": "#/components/responses/429" + } + }, + "x-code-samples": [ + { + "lang": "Curl", + "source": "curl \"https://api.phrase.com/v2/projects/:project_id/figma_attachments/:figma_attachment_id/keys\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -F branch=my-feature-branch \\\n -F id=key_id \\\n -H 'Content-Type: application/json'" + }, + { + "lang": "CLI v2", + "source": "phrase figma_attachment attach_to_key \\\n--project_id \\\n--figma_attachment_id \\\n--id \\\n--branch my-feature-branch \\\n--access_token " + } + ], + "x-cli-version": "2.13" + } + }, + "/projects/{project_id}/figma_attachments/{figma_attachment_id}/keys/{id}": { + "delete": { + "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": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "$ref": "#/components/parameters/figma_attachment_id" + }, + { + "$ref": "#/components/parameters/id" + }, + { + "description": "specify the branch to use", + "example": "my-feature-branch", + "name": "branch", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/204" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "429": { + "$ref": "#/components/responses/429" + } + }, + "x-code-samples": [ + { + "lang": "Curl", + "source": "curl \"https://api.phrase.com/v2/projects/:project_id/figma_attachments/:figma_attachment_id/keys/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X DELETE \\\n -F branch=my-feature-branch \\\n -H 'Content-Type: application/json'" + }, + { + "lang": "CLI v2", + "source": "phrase figma_attachment detach_from_key \\\n--project_id \\\n--figma_attachment_id \\\n--id \\\n--branch my-feature-branch \\\n--access_token " + } + ], + "x-cli-version": "2.13" + } + }, "/projects/{project_id}/styleguides": { "get": { "summary": "List style guides", diff --git a/parameters.yaml b/parameters.yaml index 15efc833..d810a1ce 100644 --- a/parameters.yaml +++ b/parameters.yaml @@ -66,6 +66,13 @@ key_id: required: true schema: type: string +figma_attachment_id: + in: path + name: figma_attachment_id + description: Figma attachment ID + required: true + schema: + type: string job_id: in: path name: job_id diff --git a/paths.yaml b/paths.yaml index 2ee34e9f..86952429 100644 --- a/paths.yaml +++ b/paths.yaml @@ -1,5 +1,4 @@ --- - "/icu/skeleton": post: "$ref": "./paths/icu/skeleton.yaml" @@ -12,6 +11,24 @@ "/projects/{project_id}/documents/{id}": delete: "$ref": "./paths/documents/destroy.yaml" +"/projects/{project_id}/figma_attachments": + get: + "$ref": "./paths/figma_attachments/index.yaml" + post: + "$ref": "./paths/figma_attachments/create.yaml" +"/projects/{project_id}/figma_attachments/{id}": + get: + "$ref": "./paths/figma_attachments/show.yaml" + patch: + "$ref": "./paths/figma_attachments/update.yaml" + delete: + "$ref": "./paths/figma_attachments/destroy.yaml" +"/projects/{project_id}/figma_attachments/{figma_attachment_id}/keys": + post: + "$ref": "./paths/figma_attachment_keys/create.yaml" +"/projects/{project_id}/figma_attachments/{figma_attachment_id}/keys/{id}": + delete: + "$ref": "./paths/figma_attachment_keys/destroy.yaml" "/projects/{project_id}/styleguides": get: "$ref": "./paths/styleguides/index.yaml" diff --git a/paths/figma_attachment_keys/create.yaml b/paths/figma_attachment_keys/create.yaml new file mode 100644 index 00000000..b2d3e054 --- /dev/null +++ b/paths/figma_attachment_keys/create.yaml @@ -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 \ + --figma_attachment_id \ + --id \ + --branch my-feature-branch \ + --access_token +x-cli-version: "2.13" diff --git a/paths/figma_attachment_keys/destroy.yaml b/paths/figma_attachment_keys/destroy.yaml new file mode 100644 index 00000000..98961b0b --- /dev/null +++ b/paths/figma_attachment_keys/destroy.yaml @@ -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 \ + --figma_attachment_id \ + --id \ + --branch my-feature-branch \ + --access_token +x-cli-version: "2.13" diff --git a/paths/figma_attachments/create.yaml b/paths/figma_attachments/create.yaml new file mode 100644 index 00000000..1bc37216 --- /dev/null +++ b/paths/figma_attachments/create.yaml @@ -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 \ + --data '{"branch":"my-feature-branch", "url":"https://figma.com/file/xxxxx/sample"}' \ + --access_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" diff --git a/paths/figma_attachments/destroy.yaml b/paths/figma_attachments/destroy.yaml new file mode 100644 index 00000000..8f6d18e5 --- /dev/null +++ b/paths/figma_attachments/destroy.yaml @@ -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 \ + --id \ + --branch my-feature-branch \ + --access_token +x-cli-version: "2.13" diff --git a/paths/figma_attachments/index.yaml b/paths/figma_attachments/index.yaml new file mode 100644 index 00000000..7d2155ad --- /dev/null +++ b/paths/figma_attachments/index.yaml @@ -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 \ + --branch my-feature-branch \ + --access_token +x-cli-version: "2.13" diff --git a/paths/figma_attachments/show.yaml b/paths/figma_attachments/show.yaml new file mode 100644 index 00000000..a44c2b3b --- /dev/null +++ b/paths/figma_attachments/show.yaml @@ -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 \ + --id \ + --branch my-feature-branch \ + --access_token +x-cli-version: "2.13" diff --git a/paths/figma_attachments/update.yaml b/paths/figma_attachments/update.yaml new file mode 100644 index 00000000..3fd8bf54 --- /dev/null +++ b/paths/figma_attachments/update.yaml @@ -0,0 +1,68 @@ +--- +summary: Update a Figma attachment +description: Update an existing Figma attachment. +operationId: figma_attachment/update +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" \ + -u USERNAME_OR_ACCESS_TOKEN \ + -X PATCH \ + -F branch=my-feature-branch \ + -F url=https://figma.com/file/xxxxx/sample \ + - lang: CLI v2 + source: |- + phrase figma_attachment update \ + --project_id \ + --id \ + --data '{"branch":"my-feature-branch", "url":"https://figma.com/file/xxxxx/sample" }' \ + --access_token +requestBody: + required: true + content: + application/json: + schema: + type: object + title: figma_attachment/update/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" diff --git a/schemas.yaml b/schemas.yaml index 57219cc2..5f0155f9 100644 --- a/schemas.yaml +++ b/schemas.yaml @@ -34,6 +34,8 @@ schemas: "$ref": schemas/member_project_detail.yaml#/member_project_detail invitation: "$ref": schemas/invitation.yaml#/invitation + figma_attachment: + "$ref": schemas/figma_attachment.yaml#/figma_attachment glossary: "$ref": schemas/glossary.yaml#/glossary glossary_term: diff --git a/schemas/figma_attachment.yaml b/schemas/figma_attachment.yaml new file mode 100644 index 00000000..038cfb33 --- /dev/null +++ b/schemas/figma_attachment.yaml @@ -0,0 +1,20 @@ +--- +figma_attachment: + type: object + title: figma_attachment + properties: + id: + type: string + url: + type: string + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + example: + id: 626ea67628690c73ac86ac81eec2d185 + url: https://figma.com/file/something + created_at: "2017-01-28T09:52:53Z" + updated_at: "2017-01-28T09:52:53Z"