-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/addons-api
# Conflicts: # packages/upload-client/src/index.ts
- Loading branch information
Showing
38 changed files
with
470 additions
and
219 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
12 changes: 12 additions & 0 deletions
12
packages/api-client-utils/src/UploadcareNetworkError.test.ts
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,12 @@ | ||
import { UploadcareNetworkError } from './UploadcareNetworkError' | ||
|
||
describe('UploadcareNetworkError', () => { | ||
it('should work', () => { | ||
const progressEvent = new Event('ProgressEvent') as ProgressEvent | ||
const error = new UploadcareNetworkError(progressEvent) | ||
expect(error.name).toBe('UploadcareNetworkError') | ||
expect(error.message).toBe('Network error') | ||
expect(error instanceof UploadcareNetworkError).toBeTruthy() | ||
expect(error.originalProgressEvent).toBe(progressEvent) | ||
}) | ||
}) |
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,13 @@ | ||
export class UploadcareNetworkError extends Error { | ||
originalProgressEvent: ProgressEvent | ||
|
||
constructor(progressEvent: ProgressEvent) { | ||
super() | ||
|
||
this.name = 'UploadcareNetworkError' | ||
this.message = 'Network error' | ||
Object.setPrototypeOf(this, UploadcareNetworkError.prototype) | ||
|
||
this.originalProgressEvent = progressEvent | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export default '4.3.1' | ||
export default '5.0.0' |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export default '4.3.1' | ||
export default '5.0.0' |
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 |
---|---|---|
|
@@ -364,6 +364,19 @@ Sets the maximum number of attempts to retry throttled requests. | |
Defaults to `1`. | ||
#### `retryNetworkErrorMaxTimes: number` | ||
Sets the maximum number of attempts to retry requests that failed with a network error. | ||
Defaults to `3`. | ||
The delay between attempts equals attempt number, i.e. | ||
- first attempt - 1 second delay | ||
- second attempt - 2 seconds delay | ||
- third attempt - 3 seconds delay | ||
- ... | ||
#### `multipartChunkSize: number` | ||
This option is only applicable when handling local files. | ||
|
@@ -411,7 +424,7 @@ Metadata is additional, arbitrary data, associated with uploaded file. | |
Non-string values will be converted to `string`. `undefined` values will be ignored. | ||
See [REST API reference][uc-docs-metadata] for details. | ||
See [docs][uc-file-metadata] and [REST API][uc-docs-metadata] for details. | ||
## Testing | ||
|
@@ -476,3 +489,4 @@ request at [[email protected]][uc-email-hello]. | |
[build-url]: https://github.com/uploadcare/uploadcare-js-api-clients/actions/workflows/checks.yml | ||
[uc-docs-upload-api]: https://uploadcare.com/docs/api_reference/upload/?utm_source=github&utm_campaign=uploadcare-js-api-clients | ||
[uc-docs-metadata]: https://uploadcare.com/api-refs/rest-api/v0.7.0/#tag/File-Metadata | ||
[uc-file-metadata]: https://uploadcare.com/docs/file-metadata/ |
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
Oops, something went wrong.