Skip to content
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 (@aws-amplify/api): Added support for timeout in the init parameters supplied to API #3473

Merged
merged 9 commits into from Jul 12, 2019

Conversation

luisvsm
Copy link
Contributor

@luisvsm luisvsm commented Jun 17, 2019

Fixes #368

Description of changes:

  • Added support for timeout in the init parameters supplied to API.[get/post/put/patch/del/head] requests
  • Set default timeout to 0 in line with Axios's default timeout.

Usage example:

let params = {
   timeout: 2500 // OPTIONAL
};
API.get('apiName, '/path', params);

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

- Added support for timeout in the init parameters supplied to API.[get/post/put/patch/del/head] requests
- Set default timeout to 0 in line with Axios's default timeout.
@luisvsm luisvsm marked this pull request as ready for review June 17, 2019 08:32
@luisvsm
Copy link
Contributor Author

luisvsm commented Jun 17, 2019

Sorry about spreading the pull request over multiple commits, I ran into some issues running tests on my workstation so was unable to test locally.

Copy link
Contributor

@manueliglesias manueliglesias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @luisvsm

LGTM 👍 🎉

@manueliglesias manueliglesias changed the title feat (@aws-amplify/api): feat (@aws-amplify/api): Added support for timeout in the init parameters supplied to API Jul 12, 2019
@manueliglesias manueliglesias merged commit dbd0454 into aws-amplify:master Jul 12, 2019
@zcgit
Copy link

zcgit commented Jul 16, 2019

how about supporting interceptors in the init parameters?

manueliglesias pushed a commit that referenced this pull request Jul 18, 2019
* fix: allow SSE to be passed in global configure of storage

* fix: allow SSE to be passed in global configure of storage

* update messaging

* update messaging

* Adjust storage configure to look at a list in order to verify to add to storage

* add es2017 to tsconfig in storage

* Allow customers to add a custom state to federatedSignIn method (#3588)

* Update auth state

* Remove unneeded comments

* updating `isCustomStatePresent` to `combinedState`

* Updating naming conventions

* chore(release): Publish [ci skip]

 - @aws-amplify/api@1.0.38-unstable.0
 - @aws-amplify/auth@1.2.27-unstable.0
 - aws-amplify-angular@3.0.6-unstable.0
 - aws-amplify@1.1.31-unstable.0

* add new method to check the an string array, adjust isInStorageArrayKeys to use some

* feat (@aws-amplify/api): Added support for timeout in the init parameters supplied to API(#3473)

* feat (@aws-amplify/api):
- Added support for timeout in the init parameters supplied to API.[get/post/put/patch/del/head] requests
- Set default timeout to 0 in line with Axios's default timeout.

* Added a new test for the timeout parameter
Updated existing tests with the new timeout parameter

* Having another go at using an appropriate test

* timeout had a type. I'll get this eventually!

* Removed the expectedParams.url component that was relevant to the copied test and accidentally left in.

* chore: Fix versions [ci skip]

* Use specific Cypress spec file (#3630)

* Use specific spec for cypress tests

* Remove cypress branch exception

* chore(release): Publish [ci skip]

 - @aws-amplify/api@1.0.38-unstable.1
 - aws-amplify-angular@3.0.6-unstable.2
 - aws-amplify@1.1.31-unstable.2
 - @aws-amplify/storage@1.0.32-unstable.1

* fix(@aws-amplify/auth, aws-amplify-react-native): Fix OAuth flow in react native (#3633)

Fixes #3399
Closes #3576
Fixes #3247
Fixes #3592
Fixes #3210

* chore(release): Publish [ci skip]

 - @aws-amplify/api@1.0.38-unstable.2
 - @aws-amplify/auth@1.2.27-unstable.1
 - aws-amplify@1.1.31-unstable.3

* fix(@aws-amplify/ui): Fix the issue that window is not defined in @aws-amplify/ui in NodeJS (#3512)

* remove youtube-iframe and move the impl into MediaAutoTrack
* remove empty lines
* fix unit tests
* add globalTarget to webpack config
* change globalObject back to this

* chore(release): Publish [ci skip]

 - @aws-amplify/ui@1.0.21-unstable.0
 - aws-amplify-angular@3.0.6-unstable.3
 - aws-amplify@1.1.31-unstable.4

* fix(@aws-amplify/analytics): use startsWith to filter the updateEndpoint error message (#3589)

* fix(@aws-amplify/analytics): use startsWith to filter the updateEndpoint error message

* minor change

* fix unit tests

* chore(release): Publish [ci skip]

 - @aws-amplify/analytics@1.2.19-unstable.0
 - aws-amplify@1.1.31-unstable.5

* chore: Improve tooling for dev/test/deploy (#3513)

* Remove package-lock.json

* Remove pre-commit package

* Add husky

* Add --passWithNoTests to jest pkgs without tests

* Add/rename link-all/unlink-all scripts

* Remove linting from test

* Remove test script from package with no tests

* Fix credentials tests, use empty credentials

* Add test script for amazon-cognito-identity-js (passWithNoTests)

* Remove deprecated jest config mapCoverage

* Use lerna run instead of lerna exec

* Link and unlink in parallel

* Upgrade lerna

* Add test script, remove typescript formatter

* Remove old prettier

* code review comments

* Add missing .snap files

* Debug circleci

* Show diff when publishing

* Update lockfile to match circleci yarn version

* fix(@aws-amplify/core): Sort query strings by key when signing (#3583)

* fix(@aws-amplify/core): Sort query strings by key when signing

* Fix for multiple parameters with the same key

* fixes #3654 and bug in react url search params check (#3667)

* fixes #3654 and bug in react url search params check

* adds react fix to commit

* Publish

 - amazon-cognito-identity-js@3.0.14-unstable.0
 - @aws-amplify/ui@1.0.22-unstable.0
 - @aws-amplify/analytics@1.2.20-unstable.0
 - @aws-amplify/api@1.0.39-unstable.0
 - @aws-amplify/auth@1.2.28-unstable.0
 - aws-amplify-angular@3.0.7-unstable.0
 - aws-amplify-react-native@2.1.15-unstable.0
 - aws-amplify-react@2.3.11-unstable.0
 - aws-amplify@1.1.32-unstable.0
 - @aws-amplify/cache@1.0.29-unstable.0
 - @aws-amplify/core@1.0.29-unstable.0
 - @aws-amplify/interactions@1.0.32-unstable.0
 - @aws-amplify/pubsub@1.0.30-unstable.0
 - @aws-amplify/pushnotification@1.0.29-unstable.0
 - @aws-amplify/storage@1.0.33-unstable.0
 - @aws-amplify/xr@0.1.19-unstable.0

* Remove pager usage when git diffing in circleci

Update yarn.lock

* fix(@aws-amplify/core): Preserve port when created signed url (#3678)
computationalcore pushed a commit to computationalcore/amplify-js that referenced this pull request Feb 4, 2020
* fix: allow SSE to be passed in global configure of storage

* fix: allow SSE to be passed in global configure of storage

* update messaging

* update messaging

* Adjust storage configure to look at a list in order to verify to add to storage

* add es2017 to tsconfig in storage

* Allow customers to add a custom state to federatedSignIn method (aws-amplify#3588)

* Update auth state

* Remove unneeded comments

* updating `isCustomStatePresent` to `combinedState`

* Updating naming conventions

* chore(release): Publish [ci skip]

 - @aws-amplify/api@1.0.38-unstable.0
 - @aws-amplify/auth@1.2.27-unstable.0
 - aws-amplify-angular@3.0.6-unstable.0
 - aws-amplify@1.1.31-unstable.0

* add new method to check the an string array, adjust isInStorageArrayKeys to use some

* feat (@aws-amplify/api): Added support for timeout in the init parameters supplied to API(aws-amplify#3473)

* feat (@aws-amplify/api):
- Added support for timeout in the init parameters supplied to API.[get/post/put/patch/del/head] requests
- Set default timeout to 0 in line with Axios's default timeout.

* Added a new test for the timeout parameter
Updated existing tests with the new timeout parameter

* Having another go at using an appropriate test

* timeout had a type. I'll get this eventually!

* Removed the expectedParams.url component that was relevant to the copied test and accidentally left in.

* chore: Fix versions [ci skip]

* Use specific Cypress spec file (aws-amplify#3630)

* Use specific spec for cypress tests

* Remove cypress branch exception

* chore(release): Publish [ci skip]

 - @aws-amplify/api@1.0.38-unstable.1
 - aws-amplify-angular@3.0.6-unstable.2
 - aws-amplify@1.1.31-unstable.2
 - @aws-amplify/storage@1.0.32-unstable.1

* fix(@aws-amplify/auth, aws-amplify-react-native): Fix OAuth flow in react native (aws-amplify#3633)

Fixes aws-amplify#3399
Closes aws-amplify#3576
Fixes aws-amplify#3247
Fixes aws-amplify#3592
Fixes aws-amplify#3210

* chore(release): Publish [ci skip]

 - @aws-amplify/api@1.0.38-unstable.2
 - @aws-amplify/auth@1.2.27-unstable.1
 - aws-amplify@1.1.31-unstable.3

* fix(@aws-amplify/ui): Fix the issue that window is not defined in @aws-amplify/ui in NodeJS (aws-amplify#3512)

* remove youtube-iframe and move the impl into MediaAutoTrack
* remove empty lines
* fix unit tests
* add globalTarget to webpack config
* change globalObject back to this

* chore(release): Publish [ci skip]

 - @aws-amplify/ui@1.0.21-unstable.0
 - aws-amplify-angular@3.0.6-unstable.3
 - aws-amplify@1.1.31-unstable.4

* fix(@aws-amplify/analytics): use startsWith to filter the updateEndpoint error message (aws-amplify#3589)

* fix(@aws-amplify/analytics): use startsWith to filter the updateEndpoint error message

* minor change

* fix unit tests

* chore(release): Publish [ci skip]

 - @aws-amplify/analytics@1.2.19-unstable.0
 - aws-amplify@1.1.31-unstable.5

* chore: Improve tooling for dev/test/deploy (aws-amplify#3513)

* Remove package-lock.json

* Remove pre-commit package

* Add husky

* Add --passWithNoTests to jest pkgs without tests

* Add/rename link-all/unlink-all scripts

* Remove linting from test

* Remove test script from package with no tests

* Fix credentials tests, use empty credentials

* Add test script for amazon-cognito-identity-js (passWithNoTests)

* Remove deprecated jest config mapCoverage

* Use lerna run instead of lerna exec

* Link and unlink in parallel

* Upgrade lerna

* Add test script, remove typescript formatter

* Remove old prettier

* code review comments

* Add missing .snap files

* Debug circleci

* Show diff when publishing

* Update lockfile to match circleci yarn version

* fix(@aws-amplify/core): Sort query strings by key when signing (aws-amplify#3583)

* fix(@aws-amplify/core): Sort query strings by key when signing

* Fix for multiple parameters with the same key

* fixes aws-amplify#3654 and bug in react url search params check (aws-amplify#3667)

* fixes aws-amplify#3654 and bug in react url search params check

* adds react fix to commit

* Publish

 - amazon-cognito-identity-js@3.0.14-unstable.0
 - @aws-amplify/ui@1.0.22-unstable.0
 - @aws-amplify/analytics@1.2.20-unstable.0
 - @aws-amplify/api@1.0.39-unstable.0
 - @aws-amplify/auth@1.2.28-unstable.0
 - aws-amplify-angular@3.0.7-unstable.0
 - aws-amplify-react-native@2.1.15-unstable.0
 - aws-amplify-react@2.3.11-unstable.0
 - aws-amplify@1.1.32-unstable.0
 - @aws-amplify/cache@1.0.29-unstable.0
 - @aws-amplify/core@1.0.29-unstable.0
 - @aws-amplify/interactions@1.0.32-unstable.0
 - @aws-amplify/pubsub@1.0.30-unstable.0
 - @aws-amplify/pushnotification@1.0.29-unstable.0
 - @aws-amplify/storage@1.0.33-unstable.0
 - @aws-amplify/xr@0.1.19-unstable.0

* Remove pager usage when git diffing in circleci

Update yarn.lock

* fix(@aws-amplify/core): Preserve port when created signed url (aws-amplify#3678)
rasfra pushed a commit to epidemicsound/amplify-js that referenced this pull request Mar 11, 2020
* fix: allow SSE to be passed in global configure of storage

* fix: allow SSE to be passed in global configure of storage

* update messaging

* update messaging

* Adjust storage configure to look at a list in order to verify to add to storage

* add es2017 to tsconfig in storage

* Allow customers to add a custom state to federatedSignIn method (aws-amplify#3588)

* Update auth state

* Remove unneeded comments

* updating `isCustomStatePresent` to `combinedState`

* Updating naming conventions

* chore(release): Publish [ci skip]

 - @aws-amplify/api@1.0.38-unstable.0
 - @aws-amplify/auth@1.2.27-unstable.0
 - aws-amplify-angular@3.0.6-unstable.0
 - aws-amplify@1.1.31-unstable.0

* add new method to check the an string array, adjust isInStorageArrayKeys to use some

* feat (@aws-amplify/api): Added support for timeout in the init parameters supplied to API(aws-amplify#3473)

* feat (@aws-amplify/api):
- Added support for timeout in the init parameters supplied to API.[get/post/put/patch/del/head] requests
- Set default timeout to 0 in line with Axios's default timeout.

* Added a new test for the timeout parameter
Updated existing tests with the new timeout parameter

* Having another go at using an appropriate test

* timeout had a type. I'll get this eventually!

* Removed the expectedParams.url component that was relevant to the copied test and accidentally left in.

* chore: Fix versions [ci skip]

* Use specific Cypress spec file (aws-amplify#3630)

* Use specific spec for cypress tests

* Remove cypress branch exception

* chore(release): Publish [ci skip]

 - @aws-amplify/api@1.0.38-unstable.1
 - aws-amplify-angular@3.0.6-unstable.2
 - aws-amplify@1.1.31-unstable.2
 - @aws-amplify/storage@1.0.32-unstable.1

* fix(@aws-amplify/auth, aws-amplify-react-native): Fix OAuth flow in react native (aws-amplify#3633)

Fixes aws-amplify#3399
Closes aws-amplify#3576
Fixes aws-amplify#3247
Fixes aws-amplify#3592
Fixes aws-amplify#3210

* chore(release): Publish [ci skip]

 - @aws-amplify/api@1.0.38-unstable.2
 - @aws-amplify/auth@1.2.27-unstable.1
 - aws-amplify@1.1.31-unstable.3

* fix(@aws-amplify/ui): Fix the issue that window is not defined in @aws-amplify/ui in NodeJS (aws-amplify#3512)

* remove youtube-iframe and move the impl into MediaAutoTrack
* remove empty lines
* fix unit tests
* add globalTarget to webpack config
* change globalObject back to this

* chore(release): Publish [ci skip]

 - @aws-amplify/ui@1.0.21-unstable.0
 - aws-amplify-angular@3.0.6-unstable.3
 - aws-amplify@1.1.31-unstable.4

* fix(@aws-amplify/analytics): use startsWith to filter the updateEndpoint error message (aws-amplify#3589)

* fix(@aws-amplify/analytics): use startsWith to filter the updateEndpoint error message

* minor change

* fix unit tests

* chore(release): Publish [ci skip]

 - @aws-amplify/analytics@1.2.19-unstable.0
 - aws-amplify@1.1.31-unstable.5

* chore: Improve tooling for dev/test/deploy (aws-amplify#3513)

* Remove package-lock.json

* Remove pre-commit package

* Add husky

* Add --passWithNoTests to jest pkgs without tests

* Add/rename link-all/unlink-all scripts

* Remove linting from test

* Remove test script from package with no tests

* Fix credentials tests, use empty credentials

* Add test script for amazon-cognito-identity-js (passWithNoTests)

* Remove deprecated jest config mapCoverage

* Use lerna run instead of lerna exec

* Link and unlink in parallel

* Upgrade lerna

* Add test script, remove typescript formatter

* Remove old prettier

* code review comments

* Add missing .snap files

* Debug circleci

* Show diff when publishing

* Update lockfile to match circleci yarn version

* fix(@aws-amplify/core): Sort query strings by key when signing (aws-amplify#3583)

* fix(@aws-amplify/core): Sort query strings by key when signing

* Fix for multiple parameters with the same key

* fixes aws-amplify#3654 and bug in react url search params check (aws-amplify#3667)

* fixes aws-amplify#3654 and bug in react url search params check

* adds react fix to commit

* Publish

 - amazon-cognito-identity-js@3.0.14-unstable.0
 - @aws-amplify/ui@1.0.22-unstable.0
 - @aws-amplify/analytics@1.2.20-unstable.0
 - @aws-amplify/api@1.0.39-unstable.0
 - @aws-amplify/auth@1.2.28-unstable.0
 - aws-amplify-angular@3.0.7-unstable.0
 - aws-amplify-react-native@2.1.15-unstable.0
 - aws-amplify-react@2.3.11-unstable.0
 - aws-amplify@1.1.32-unstable.0
 - @aws-amplify/cache@1.0.29-unstable.0
 - @aws-amplify/core@1.0.29-unstable.0
 - @aws-amplify/interactions@1.0.32-unstable.0
 - @aws-amplify/pubsub@1.0.30-unstable.0
 - @aws-amplify/pushnotification@1.0.29-unstable.0
 - @aws-amplify/storage@1.0.33-unstable.0
 - @aws-amplify/xr@0.1.19-unstable.0

* Remove pager usage when git diffing in circleci

Update yarn.lock

* fix(@aws-amplify/core): Preserve port when created signed url (aws-amplify#3678)
@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http timeout configuration?
3 participants