-
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): Add Repo Sync [TSI-1923] #569
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cb0cfd9
feat(API): Add Repo Sync [TSI-1923]
jablan 63ec137
ignore schema name warning
jablan a3edd7e
revert lint change
jablan f9f19a1
add to schemas.yaml
jablan 5ff57d8
remove beta tag
jablan 252d1ce
add compiled.json
jablan 5de3663
add beta to export and import
jablan 3279280
more complete repo event
jablan 0c1ceb2
review suggestions
jablan 2288046
add compiled.json
jablan 50a88d6
index to list
jablan 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
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 index \ | ||
--account_id abcd1234 \ | ||
--access_token <token> | ||
x-cli-version: '2.24' |
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.
should be
list
😅