-
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): Add Repo Sync [TSI-1923] (#569)
- Loading branch information
Showing
15 changed files
with
1,048 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
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,45 @@ | ||
--- | ||
summary: Activate a Repo Sync | ||
description: |- | ||
Activate a deactivated Repo Sync. Active syncs can be used to import and export translations, | ||
and imports to Phrase are automatically triggered by pushes to the repository, if configured. | ||
operationId: repo_sync/activate | ||
tags: | ||
- Repo Syncs | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- "$ref": "../../parameters.yaml#/repo_sync_id" | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../../schemas/repo_sync.yaml#/repo_sync" | ||
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/accounts/ab12cd34/repo_syncs/45ef6789/activate"\ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X POST \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase repo_sync activate \ | ||
--repo_sync_id <repo_sync_id> \ | ||
--access_token <token> | ||
x-cli-version: '2.24' |
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,45 @@ | ||
--- | ||
summary: Deactivate a Repo Sync | ||
description: |- | ||
Deactivate an active Repo Sync. Import and export can't be performed on deactivated syncs | ||
and the pushes to the repository won't trigger the import to Phrase. | ||
operationId: repo_sync/deactivate | ||
tags: | ||
- Repo Syncs | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- "$ref": "../../parameters.yaml#/repo_sync_id" | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../../schemas/repo_sync.yaml#/repo_sync" | ||
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/accounts/ab12cd34/repo_syncs/45ef6789/deactivate"\ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X POST \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase repo_sync deactivate \ | ||
--repo_sync_id <repo_sync_id> \ | ||
--access_token <token> | ||
x-cli-version: '2.24' |
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,49 @@ | ||
summary: "Repository Syncs History" | ||
description: |- | ||
Get the history of a single Repo Sync. The history includes all imports and exports | ||
performed by the Repo Sync. | ||
operationId: repo_sync/events | ||
tags: | ||
- Repo Syncs | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- "$ref": "../../parameters.yaml#/repo_sync_id" | ||
responses: | ||
'200': | ||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
"$ref": "../../schemas/repo_sync_event.yaml#/repo_sync_event" | ||
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" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/56ef78/events"\ | ||
-u USERNAME_OR_ACCESS_TOKEN | ||
- lang: CLI v2 | ||
source: |- | ||
phrase repo_sync events \ | ||
--id <id> \ | ||
--account_id abcd1234 \ | ||
--access_token <token> | ||
x-cli-version: '2.24' |
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: Export to code repository | ||
description: |- | ||
> Beta: this feature will change in the future. | ||
Export translations from Phrase Strings to repository provider according to the | ||
.phrase.yml file within the code repository. | ||
*Export is done asynchronously and may take several seconds depending on the project size.* | ||
operationId: repo_sync/export | ||
tags: | ||
- Repo Syncs | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- "$ref": "../../parameters.yaml#/repo_sync_id" | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
title: repo_sync/export | ||
properties: | ||
message: | ||
type: string | ||
example: Export started | ||
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/accounts/ab12cd34/repo_syncs/45ef6789/export"\ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X POST \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase repo_sync export \ | ||
--repo_sync_id <repo_sync_id> \ | ||
--access_token <token> | ||
x-cli-version: '2.24' |
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: Import from code repository | ||
description: |- | ||
> Beta: this feature will change in the future. | ||
Import translations from repository provider to Phrase Strings according to the .phrase.yml file | ||
within the code repository. | ||
_Import is done asynchronously and may take several seconds depending on the project size._ | ||
operationId: repo_sync/import | ||
tags: | ||
- Repo Syncs | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- "$ref": "../../parameters.yaml#/repo_sync_id" | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
title: repo_sync/import | ||
properties: | ||
message: | ||
type: string | ||
example: Import started | ||
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/accounts/ab12cd34/repo_syncs/45ef6789/import"\ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X POST \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase repo_sync import \ | ||
--repo_sync_id <repo_sync_id> \ | ||
--access_token <token> | ||
x-cli-version: '2.24' |
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,46 @@ | ||
--- | ||
summary: Get Repo Syncs | ||
description: Lists all Repo Syncs from an account | ||
operationId: repo_sync/list | ||
tags: | ||
- Repo Syncs | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
"$ref": "../../schemas/repo_sync.yaml#/repo_sync" | ||
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" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs"\ | ||
-u USERNAME_OR_ACCESS_TOKEN | ||
- lang: CLI v2 | ||
source: |- | ||
phrase repo_sync list \ | ||
--account_id abcd1234 \ | ||
--access_token <token> | ||
x-cli-version: '2.24' |
Oops, something went wrong.