From 5e3b29942a1e54745e17cce642403cc6bffa6bf8 Mon Sep 17 00:00:00 2001 From: Sven Dunemann Date: Tue, 2 Dec 2025 07:41:36 +0100 Subject: [PATCH] feat(API): Add only_content_updates on translations versions --- README.md | 6 +++--- clients/cli/go.sum | 4 ++-- doc/compiled.json | 15 ++++++++++++--- paths/versions/index.yaml | 11 +++++++++-- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9aa602fe3..d1ef3a532 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ You added an endpoint in Phrase Strings. In this project you do the following: 2. Add new endpoints to `/paths/` directory and reference it in `paths.yaml` 3. `npm start` to re-build the clients 4. Open a PR with an informative title (e.g. `feat(API): Add an API endpoint for cat pics`) -5. Merge automated documentation PR [(details)](#documentation-sync) ## Workflow @@ -64,9 +63,10 @@ This includes: 1. Pulling the most recent schema from this repository, 2. Regenerating the documentation site, -3. Deploying the updated docs. +3. Merging the `developer-hub` PR, +4. Deploying the updated docs. -The last step in bringing your changes live is to merge in the automatically generated PR to `developer-hub`. This requires `write` permissions, so look to see who has merged previous PRs for who to ping to get something merged. +The generated PR in `developer-hub` will be automatically merged if tests passes. Please ensure that the changes got merged. Only then they will be live & visible on our public API documentation. This setup ensures that the public API documentation always reflects the current OpenAPI spec. diff --git a/clients/cli/go.sum b/clients/cli/go.sum index f41e9ed55..7dc8004af 100644 --- a/clients/cli/go.sum +++ b/clients/cli/go.sum @@ -215,8 +215,8 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/phrase/phrase-go/v4 v4.9.0 h1:V+MWmNrxwrYNtmoY41dgrdWT902Er2hcohtQcpVvWmw= -github.com/phrase/phrase-go/v4 v4.9.0/go.mod h1:4XplKvrbHS2LDaXfFp9xrVDtO5xk2WHFm0htutwwd8c= +github.com/phrase/phrase-go/v4 v4.14.1 h1:ehFMnZI+NUWSDFCNhNot6Uk4e2EwCnyGLG3fEagVijk= +github.com/phrase/phrase-go/v4 v4.14.1/go.mod h1:4XplKvrbHS2LDaXfFp9xrVDtO5xk2WHFm0htutwwd8c= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/doc/compiled.json b/doc/compiled.json index f30b9b880..48bd4c875 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -15056,6 +15056,15 @@ "schema": { "type": "string" } + }, + { + "description": "Indicates whether only content updates should be returned", + "example": true, + "name": "only_content_updates", + "in": "query", + "schema": { + "type": "boolean" + } } ], "responses": { @@ -15066,7 +15075,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/translation_version" + "$ref": "#/components/schemas/translation_version_with_user" } } } @@ -15102,11 +15111,11 @@ "x-code-samples": [ { "lang": "Curl", - "source": "curl \"https://api.phrase.com/v2/projects/:project_id/translations/:translation_id/versions?branch=my-feature-branch\" \\\n -u USERNAME_OR_ACCESS_TOKEN" + "source": "curl \"https://api.phrase.com/v2/projects/:project_id/translations/:translation_id/versions?branch=my-feature-branch&only_content_updates=true\" \\\n -u USERNAME_OR_ACCESS_TOKEN" }, { "lang": "CLI v2", - "source": "phrase versions list \\\n--project_id \\\n--translation_id \\\n--branch my-feature-branch \\\n--access_token " + "source": "phrase versions list \\\n--project_id \\\n--translation_id \\\n--branch my-feature-branch \\\n--only_content_updates true \\\n--access_token " } ], "x-cli-version": "2.5" diff --git a/paths/versions/index.yaml b/paths/versions/index.yaml index 7f38e00b3..e4b76132b 100644 --- a/paths/versions/index.yaml +++ b/paths/versions/index.yaml @@ -16,6 +16,12 @@ parameters: in: query schema: type: string +- description: Indicates whether only content updates should be returned + example: true + name: only_content_updates + in: query + schema: + type: boolean responses: '200': description: OK @@ -24,7 +30,7 @@ responses: schema: type: array items: - "$ref": "../../schemas/translation_version.yaml#/translation_version" + "$ref": "../../schemas/translation_version_with_user.yaml#/translation_version_with_user" headers: X-Rate-Limit-Limit: "$ref": "../../headers.yaml#/X-Rate-Limit-Limit" @@ -45,7 +51,7 @@ responses: x-code-samples: - lang: Curl source: |- - curl "https://api.phrase.com/v2/projects/:project_id/translations/:translation_id/versions?branch=my-feature-branch" \ + curl "https://api.phrase.com/v2/projects/:project_id/translations/:translation_id/versions?branch=my-feature-branch&only_content_updates=true" \ -u USERNAME_OR_ACCESS_TOKEN - lang: CLI v2 source: |- @@ -53,5 +59,6 @@ x-code-samples: --project_id \ --translation_id \ --branch my-feature-branch \ + --only_content_updates true \ --access_token x-cli-version: '2.5'