diff --git a/doc/compiled.json b/doc/compiled.json index 60b384e1..2fee5c59 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -56,6 +56,10 @@ "name": "Branches", "description": "### Branch creation\n\nBranches will be created asynchronously. State of branch creation is returned as state.\n\n#### Available States\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
StateDescription
initializedData received.
processingBranch is currently creating.
successBranch was created successfully
errorBranch creation failed.
\n
\n" }, + { + "name": "Checks", + "description": "**Note:** The Checks API is still in development and might change in subsequent releases.\n\nThe Checks API lets you list the check issues detected in a project and dismiss issues that should no longer appear on the list of active check issues.\n\n#### Available States\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
StateDescription
activeThe issue is unresolved and not dismissed.
solvedThe issue has been resolved.
dismissedThe issue has been dismissed by a user.
\n
\n" + }, { "name": "Comments" }, @@ -255,6 +259,7 @@ { "name": "Quality", "tags": [ + "Checks", "Glossaries", "Glossary Terms", "Glossary Term Translations" @@ -483,6 +488,92 @@ "updated_at": "2015-01-28T09:52:53Z" } }, + "check_issue": { + "type": "object", + "title": "check_issue", + "properties": { + "id": { + "type": "string" + }, + "check_name": { + "description": "Identifier of the check that reported this issue. One of: `translation_content_length`, `translation_placeholder_usage`, `translation_glossary_usage`.", + "type": "string", + "enum": [ + "translation_content_length", + "translation_placeholder_usage", + "translation_glossary_usage" + ] + }, + "state": { + "description": "Current state of the check issue. One of: `active`, `solved`, `dismissed`.", + "type": "string", + "enum": [ + "active", + "solved", + "dismissed" + ] + }, + "description": { + "description": "Human-readable description of the reported issue, always in English. This message is intended for display only. Its wording may change at any time and it should not be parsed or relied upon programmatically.", + "type": "string" + }, + "dismissed_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "solved_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "translation": { + "$ref": "#/components/schemas/translation" + } + }, + "example": { + "id": "abcd1234cdef1234abcd1234cdef1234", + "check_name": "translation_placeholder_usage", + "state": "active", + "description": "The translation contains invalid placeholders. (missing: %{count})", + "dismissed_at": null, + "solved_at": null, + "created_at": "2015-01-28T09:52:53Z", + "updated_at": "2015-01-28T09:52:53Z", + "translation": { + "id": "abcd1234cdef1234abcd1234cdef1234", + "content": "My translation", + "unverified": false, + "excluded": false, + "plural_suffix": "", + "key": { + "id": "abcd1234cdef1234abcd1234cdef1234", + "name": "home.index.headline", + "plural": false, + "use_ordinal_rules": false + }, + "locale": { + "id": "abcd1234cdef1234abcd1234cdef1234", + "name": "de", + "code": "de-DE" + }, + "placeholders": [ + "%{count}" + ], + "state": "translated", + "created_at": "2015-01-28T09:52:53Z", + "updated_at": "2015-01-28T09:52:53Z" + } + } + }, "branch_comparison": { "type": "object", "title": "branch_comparison", @@ -23435,6 +23526,219 @@ "x-cli-version": "2.5" } }, + "/projects/{project_id}/checks/issues": { + "get": { + "summary": "List check issues", + "description": "**Note:** The Checks API is still in development and might change in subsequent releases.\n\nList check issues for the given project. Results can be filtered by locale, check name, and state.", + "operationId": "check_issues/list", + "tags": [ + "Checks" + ], + "parameters": [ + { + "$ref": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "description": "Filter by state of the check issue. Can be one of: `active`, `solved`, `dismissed`, `all`. Defaults to `active`.", + "name": "state", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "active", + "enum": [ + "active", + "solved", + "dismissed", + "all" + ] + }, + "example": "active" + }, + { + "description": "Filter by one or more locale IDs.", + "name": "locale_ids", + "in": "query", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "abcd1234cdef1234abcd1234cdef1234" + ] + } + }, + { + "description": "Filter by one or more check names. Valid values are:\n\n- `translation_content_length` — the translation exceeds the maximum character limit configured for the key.\n- `translation_placeholder_usage` — the translation is missing placeholders present in the source, or contains unexpected ones.\n- `translation_glossary_usage` — the translation does not follow the glossary term translations.", + "name": "check_names", + "in": "query", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "translation_content_length", + "translation_placeholder_usage", + "translation_glossary_usage" + ] + }, + "example": [ + "translation_placeholder_usage" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/check_issue" + } + } + } + }, + "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" + }, + "Pagination": { + "$ref": "#/components/headers/Pagination" + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403", + "description": "Forbidden. Returned when the access token lacks the `read` scope or when the requesting user is not allowed to view check issues in this project." + }, + "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/checks/issues\" \\\n -u USERNAME_OR_ACCESS_TOKEN" + }, + { + "lang": "CLI v2", + "source": "phrase check_issues list \\\n--project_id \\\n--access_token " + } + ] + } + }, + "/projects/{project_id}/checks/issues/{id}/dismiss": { + "patch": { + "summary": "Dismiss a check issue", + "description": "**Note:** The Checks API is still in development and might change in subsequent releases.\n\nMark a check issue as dismissed so it no longer appears on the list of active check issues.", + "operationId": "check_issue/dismiss", + "tags": [ + "Checks" + ], + "parameters": [ + { + "$ref": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "name": "id", + "in": "path", + "required": true, + "description": "Check Issue ID", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/check_issue" + } + } + }, + "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" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403", + "description": "Forbidden. Returned when the access token lacks the `write` scope or when the requesting user is not allowed to dismiss check issues in this project." + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + } + }, + "x-code-samples": [ + { + "lang": "Curl", + "source": "curl \"https://api.phrase.com/v2/projects/:project_id/checks/issues/:id/dismiss\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X PATCH" + }, + { + "lang": "CLI v2", + "source": "phrase check_issues dismiss \\\n--project_id \\\n--id \\\n--access_token " + } + ] + } + }, "/projects/{project_id}/keys": { "get": { "summary": "List keys", diff --git a/main.yaml b/main.yaml index 7c272847..3d2e1406 100644 --- a/main.yaml +++ b/main.yaml @@ -113,6 +113,38 @@ tags: + - name: Checks + description: | + **Note:** The Checks API is still in development and might change in subsequent releases. + + The Checks API lets you list the check issues detected in a project and dismiss issues that should no longer appear on the list of active check issues. + + #### Available States + +
+ + + + + + + + + + + + + + + + + + + + + +
StateDescription
activeThe issue is unresolved and not dismissed.
solvedThe issue has been resolved.
dismissedThe issue has been dismissed by a user.
+
- name: Comments - name: Comment Reactions - name: Comment Replies @@ -300,6 +332,7 @@ x-tagGroups: - Branches - name: Quality tags: + - Checks - Glossaries - Glossary Terms - Glossary Term Translations diff --git a/paths.yaml b/paths.yaml index 8cd0e974..c9db0a7b 100644 --- a/paths.yaml +++ b/paths.yaml @@ -480,6 +480,12 @@ "$ref": "./paths/blacklisted_keys/update.yaml" delete: "$ref": "./paths/blacklisted_keys/destroy.yaml" +"/projects/{project_id}/checks/issues": + get: + "$ref": "./paths/checks/index.yaml" +"/projects/{project_id}/checks/issues/{id}/dismiss": + patch: + "$ref": "./paths/checks/dismiss.yaml" "/projects/{project_id}/keys": get: "$ref": "./paths/keys/index.yaml" diff --git a/paths/checks/dismiss.yaml b/paths/checks/dismiss.yaml new file mode 100644 index 00000000..e71b671a --- /dev/null +++ b/paths/checks/dismiss.yaml @@ -0,0 +1,57 @@ +--- +summary: Dismiss a check issue +description: |- + **Note:** The Checks API is still in development and might change in subsequent releases. + + Mark a check issue as dismissed so it no longer appears on the list of active check issues. +operationId: check_issue/dismiss +tags: +- Checks +parameters: +- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" +- "$ref": "../../parameters.yaml#/project_id" +- name: id + in: path + required: true + description: Check Issue ID + schema: + type: string +responses: + '200': + description: OK + content: + application/json: + schema: + "$ref": "../../schemas/check_issue.yaml#/check_issue" + 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" + '401': + "$ref": "../../responses.yaml#/401" + '403': + "$ref": "../../responses.yaml#/403" + description: Forbidden. Returned when the access token lacks the `write` scope or when the requesting user is not allowed to dismiss check issues in this project. + '422': + "$ref": "../../responses.yaml#/422" + '429': + "$ref": "../../responses.yaml#/429" +x-code-samples: +- lang: Curl + source: |- + curl "https://api.phrase.com/v2/projects/:project_id/checks/issues/:id/dismiss" \ + -u USERNAME_OR_ACCESS_TOKEN \ + -X PATCH +- lang: CLI v2 + source: |- + phrase check_issues dismiss \ + --project_id \ + --id \ + --access_token diff --git a/paths/checks/index.yaml b/paths/checks/index.yaml new file mode 100644 index 00000000..6dbb09f3 --- /dev/null +++ b/paths/checks/index.yaml @@ -0,0 +1,97 @@ +--- +summary: List check issues +description: |- + **Note:** The Checks API is still in development and might change in subsequent releases. + + List check issues for the given project. Results can be filtered by locale, check name, and state. +operationId: check_issues/list +tags: +- Checks +parameters: +- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" +- "$ref": "../../parameters.yaml#/project_id" +- "$ref": "../../parameters.yaml#/page" +- "$ref": "../../parameters.yaml#/per_page" +- description: 'Filter by state of the check issue. Can be one of: `active`, `solved`, `dismissed`, `all`. Defaults to `active`.' + name: state + in: query + required: false + schema: + type: string + default: active + enum: + - active + - solved + - dismissed + - all + example: active +- description: Filter by one or more locale IDs. + name: locale_ids + in: query + required: false + schema: + type: array + items: + type: string + example: + - abcd1234cdef1234abcd1234cdef1234 +- description: |- + Filter by one or more check names. Valid values are: + + - `translation_content_length` — the translation exceeds the maximum character limit configured for the key. + - `translation_placeholder_usage` — the translation is missing placeholders present in the source, or contains unexpected ones. + - `translation_glossary_usage` — the translation does not follow the glossary term translations. + name: check_names + in: query + required: false + schema: + type: array + items: + type: string + enum: + - translation_content_length + - translation_placeholder_usage + - translation_glossary_usage + example: + - translation_placeholder_usage +responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + "$ref": "../../schemas/check_issue.yaml#/check_issue" + 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" + Pagination: + "$ref": "../../headers.yaml#/Pagination" + '400': + "$ref": "../../responses.yaml#/400" + '404': + "$ref": "../../responses.yaml#/404" + '401': + "$ref": "../../responses.yaml#/401" + '403': + "$ref": "../../responses.yaml#/403" + description: Forbidden. Returned when the access token lacks the `read` scope or when the requesting user is not allowed to view check issues in this project. + '429': + "$ref": "../../responses.yaml#/429" +x-code-samples: +- lang: Curl + source: |- + curl "https://api.phrase.com/v2/projects/:project_id/checks/issues" \ + -u USERNAME_OR_ACCESS_TOKEN +- lang: CLI v2 + source: |- + phrase check_issues list \ + --project_id \ + --access_token diff --git a/schemas.yaml b/schemas.yaml index a1584bf0..0cf3d116 100644 --- a/schemas.yaml +++ b/schemas.yaml @@ -6,6 +6,8 @@ schemas: "$ref": schemas/authorization_with_token.yaml#/authorization_with_token blacklisted_key: "$ref": schemas/blacklisted_key.yaml#/blacklisted_key + check_issue: + "$ref": schemas/check_issue.yaml#/check_issue branch_comparison: "$ref": schemas/branch_comparison.yaml#/branch_comparison branch_comparison_diff: diff --git a/schemas/check_issue.yaml b/schemas/check_issue.yaml new file mode 100644 index 00000000..7a273e68 --- /dev/null +++ b/schemas/check_issue.yaml @@ -0,0 +1,69 @@ +--- +check_issue: + type: object + title: check_issue + properties: + id: + type: string + check_name: + description: 'Identifier of the check that reported this issue. One of: `translation_content_length`, `translation_placeholder_usage`, `translation_glossary_usage`.' + type: string + enum: + - translation_content_length + - translation_placeholder_usage + - translation_glossary_usage + state: + description: 'Current state of the check issue. One of: `active`, `solved`, `dismissed`.' + type: string + enum: + - active + - solved + - dismissed + description: + description: Human-readable description of the reported issue, always in English. This message is intended for display only. Its wording may change at any time and it should not be parsed or relied upon programmatically. + type: string + dismissed_at: + type: string + format: date-time + nullable: true + solved_at: + type: string + format: date-time + nullable: true + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + translation: + "$ref": "./translation.yaml#/translation" + example: + id: abcd1234cdef1234abcd1234cdef1234 + check_name: translation_placeholder_usage + state: active + description: 'The translation contains invalid placeholders. (missing: %{count})' + dismissed_at: null + solved_at: null + created_at: '2015-01-28T09:52:53Z' + updated_at: '2015-01-28T09:52:53Z' + translation: + id: abcd1234cdef1234abcd1234cdef1234 + content: My translation + unverified: false + excluded: false + plural_suffix: '' + key: + id: abcd1234cdef1234abcd1234cdef1234 + name: home.index.headline + plural: false + use_ordinal_rules: false + locale: + id: abcd1234cdef1234abcd1234cdef1234 + name: de + code: de-DE + placeholders: + - "%{count}" + state: translated + created_at: '2015-01-28T09:52:53Z' + updated_at: '2015-01-28T09:52:53Z'