-
Notifications
You must be signed in to change notification settings - Fork 7
feat(API): creating upload batches #SCD-687 #1022
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
08e1ed9
feat(API): creating upload batches #SCD-687
jablan 54c8be1
revert npm updates until we solve licensing
jablan 70ef4c6
review suggestions
jablan 08657a5
cli version not needed anymore
jablan d397f87
cli version not needed anymore
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
This file contains hidden or 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 hidden or 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 hidden or 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,83 @@ | ||
| summary: Create upload batch | ||
| description: | | ||
| Groups multiple file uploads into a single batch. Optionally, launches the deletion of unmentioned translation keys | ||
| after all uploads in the batch are completed. | ||
| operationId: upload_batches/create | ||
| tags: | ||
| - Upload Batches | ||
| parameters: | ||
| - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
| - "$ref": "../../parameters.yaml#/project_id" | ||
| requestBody: | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| title: upload_batches/create/parameters | ||
| required: | ||
| - upload_ids | ||
| properties: | ||
| branch: | ||
| description: specify the branch to use | ||
| type: string | ||
| example: my-feature-branch | ||
| delete_unmentioned_keys: | ||
| description: If set to true, after all uploads in the batch are completed, translation keys that were not mentioned in any of the uploaded files will be deleted. | ||
| type: boolean | ||
| example: true | ||
| upload_ids: | ||
| description: Array of upload IDs to include in the batch | ||
| type: array | ||
| items: | ||
| type: string | ||
| example: | ||
| - abcd1234cdef1234abcd1234cdef1234 | ||
| - bcde2345defg2345bcde2345defg2345 | ||
| responses: | ||
| '201': | ||
| description: Created | ||
| content: | ||
| application/json: | ||
| schema: | ||
| "$ref": "../../schemas/upload_batch.yaml#/upload_batch" | ||
| 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/upload_batches" \ | ||
| -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "branch": "my-feature-branch", | ||
| "delete_unmentioned_keys": true, | ||
| "upload_ids": [ | ||
| "abcd1234cdef1234abcd1234cdef1234", | ||
| "bcde2345defg2345bcde2345defg2345" | ||
| ] | ||
| }' \ | ||
| -u <token>: | ||
| - lang: CLI v2 | ||
| source: |- | ||
| phrase upload_batches create --project-id :project_id \ | ||
| --data '{ | ||
| "branch": "my-feature-branch", | ||
| "delete_unmentioned_keys": true, | ||
| "upload_ids": [ | ||
| "abcd1234cdef1234abcd1234cdef1234", | ||
| "bcde2345defg2345bcde2345defg2345" | ||
| ] | ||
| }' \ | ||
| --access_token <token> |
This file contains hidden or 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,31 @@ | ||
| --- | ||
| upload_batch: | ||
| type: object | ||
| title: upload_batch | ||
| properties: | ||
| state: | ||
| type: string | ||
| description: Processing state of the upload batch | ||
| enum: | ||
| - started | ||
| - done | ||
| delete_unmentioned_keys: | ||
| type: boolean | ||
| description: Indicates whether unmentioned keys will be deleted after processing all uploads in the batch | ||
| created_at: | ||
| type: string | ||
| format: date-time | ||
| updated_at: | ||
| type: string | ||
| format: date-time | ||
| project: | ||
| type: object | ||
| "$ref": "./project_short.yaml#/project_short" | ||
| user: | ||
| type: object | ||
| "$ref": "./user_preview.yaml#/user_preview" | ||
| uploads: | ||
| type: array | ||
| items: | ||
| type: object | ||
| "$ref": "./upload.yaml#/upload" | ||
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.