@aws-amplify/api-rest 2.0.40-unstable.1 → 2.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.40](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-rest@2.0.39...@aws-amplify/api-rest@2.0.40) (2022-05-12)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **@aws-amplify/api:** graphql API.cancel fix ([#9578](https://github.com/aws-amplify/amplify-js/issues/9578)) ([a9ae27f](https://github.com/aws-amplify/amplify-js/commit/a9ae27f65e1a782321c0be87556f92d2ee432352))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.0.39](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-rest@2.0.38...@aws-amplify/api-rest@2.0.39) (2022-05-03)
7
18
 
8
19
  **Note:** Version bump only for package @aws-amplify/api-rest
@@ -4426,6 +4426,16 @@ function () {
4426
4426
  RestAPIClass.prototype.cancel = function (request, message) {
4427
4427
  return this._api.cancel(request, message);
4428
4428
  };
4429
+ /**
4430
+ * Check if the request has a corresponding cancel token in the WeakMap.
4431
+ * @params request - The request promise
4432
+ * @return if the request has a corresponding cancel token.
4433
+ */
4434
+
4435
+
4436
+ RestAPIClass.prototype.hasCancelToken = function (request) {
4437
+ return this._api.hasCancelToken(request);
4438
+ };
4429
4439
  /**
4430
4440
  * Getting endpoint for API
4431
4441
  * @param {string} apiName - The name of the api
@@ -4991,9 +5001,20 @@ function () {
4991
5001
 
4992
5002
  if (source) {
4993
5003
  source.cancel(message);
5004
+ return true;
4994
5005
  }
4995
5006
 
4996
- return true;
5007
+ return false;
5008
+ };
5009
+ /**
5010
+ * Check if the request has a corresponding cancel token in the WeakMap.
5011
+ * @params request - The request promise
5012
+ * @return if the request has a corresponding cancel token.
5013
+ */
5014
+
5015
+
5016
+ RestClient.prototype.hasCancelToken = function (request) {
5017
+ return this._cancelTokenMap.has(request);
4997
5018
  };
4998
5019
  /**
4999
5020
  * Checks to see if an error thrown is from an api request cancellation