@aws-amplify/api-rest 4.0.1-console-preview.a1c533e.0 → 4.0.1-console-preview.23dc225.0

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.
Files changed (70) hide show
  1. package/lib/apis/common/handler.js +14 -3
  2. package/lib/apis/common/internalPost.js +1 -1
  3. package/lib/apis/index.d.ts +178 -0
  4. package/lib/apis/index.js +178 -0
  5. package/lib/apis/server.d.ts +125 -0
  6. package/lib/apis/server.js +125 -0
  7. package/lib/errors/CanceledError.d.ts +17 -0
  8. package/lib/errors/CanceledError.js +35 -0
  9. package/lib/errors/index.d.ts +1 -1
  10. package/lib/errors/index.js +4 -4
  11. package/lib/index.d.ts +1 -1
  12. package/lib/index.js +2 -2
  13. package/lib/server.d.ts +1 -1
  14. package/lib/server.js +2 -2
  15. package/lib/tsconfig.tsbuildinfo +1 -1
  16. package/lib/types/index.d.ts +1 -1
  17. package/lib/utils/createCancellableOperation.js +10 -15
  18. package/lib/utils/index.d.ts +0 -1
  19. package/lib/utils/index.js +0 -1
  20. package/lib/utils/resolveApiUrl.js +4 -3
  21. package/lib/utils/resolveCredentials.d.ts +1 -6
  22. package/lib-esm/apis/common/handler.js +14 -3
  23. package/lib-esm/apis/common/internalPost.js +1 -1
  24. package/lib-esm/apis/index.d.ts +178 -0
  25. package/lib-esm/apis/index.js +178 -0
  26. package/lib-esm/apis/server.d.ts +125 -0
  27. package/lib-esm/apis/server.js +125 -0
  28. package/lib-esm/errors/CanceledError.d.ts +17 -0
  29. package/lib-esm/errors/CanceledError.js +31 -0
  30. package/lib-esm/errors/index.d.ts +1 -1
  31. package/lib-esm/errors/index.js +1 -1
  32. package/lib-esm/index.d.ts +1 -1
  33. package/lib-esm/index.js +1 -1
  34. package/lib-esm/server.d.ts +1 -1
  35. package/lib-esm/server.js +1 -1
  36. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  37. package/lib-esm/types/index.d.ts +1 -1
  38. package/lib-esm/utils/createCancellableOperation.js +12 -17
  39. package/lib-esm/utils/index.d.ts +0 -1
  40. package/lib-esm/utils/index.js +0 -1
  41. package/lib-esm/utils/resolveApiUrl.js +4 -3
  42. package/lib-esm/utils/resolveCredentials.d.ts +1 -6
  43. package/package.json +5 -5
  44. package/src/apis/common/handler.ts +9 -2
  45. package/src/apis/common/internalPost.ts +1 -1
  46. package/src/apis/index.ts +179 -0
  47. package/src/apis/server.ts +126 -0
  48. package/src/errors/CanceledError.ts +33 -0
  49. package/src/errors/index.ts +1 -1
  50. package/src/index.ts +1 -1
  51. package/src/server.ts +1 -1
  52. package/src/types/index.ts +1 -1
  53. package/src/utils/createCancellableOperation.ts +5 -6
  54. package/src/utils/index.ts +0 -2
  55. package/src/utils/resolveApiUrl.ts +7 -3
  56. package/lib/errors/CancelledError.d.ts +0 -14
  57. package/lib/errors/CancelledError.js +0 -31
  58. package/lib/utils/polyfills/index.d.ts +0 -0
  59. package/lib/utils/polyfills/index.js +0 -4
  60. package/lib/utils/polyfills/index.native.d.ts +0 -1
  61. package/lib/utils/polyfills/index.native.js +0 -6
  62. package/lib-esm/errors/CancelledError.d.ts +0 -14
  63. package/lib-esm/errors/CancelledError.js +0 -27
  64. package/lib-esm/utils/polyfills/index.d.ts +0 -0
  65. package/lib-esm/utils/polyfills/index.js +0 -4
  66. package/lib-esm/utils/polyfills/index.native.d.ts +0 -1
  67. package/lib-esm/utils/polyfills/index.native.js +0 -4
  68. package/src/errors/CancelledError.ts +0 -26
  69. package/src/utils/polyfills/index.native.ts +0 -5
  70. package/src/utils/polyfills/index.ts +0 -4
@@ -1,31 +0,0 @@
1
- "use strict";
2
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- // SPDX-License-Identifier: Apache-2.0
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.isCancelError = exports.CancelledError = void 0;
6
- var tslib_1 = require("tslib");
7
- var RestApiError_1 = require("./RestApiError");
8
- /**
9
- * Internal-only class for CancelledError.
10
- *
11
- * @internal
12
- */
13
- var CancelledError = /** @class */ (function (_super) {
14
- tslib_1.__extends(CancelledError, _super);
15
- function CancelledError(params) {
16
- var _this = _super.call(this, params) || this;
17
- // TODO: Delete the following 2 lines after we change the build target to >= es2015
18
- _this.constructor = CancelledError;
19
- Object.setPrototypeOf(_this, CancelledError.prototype);
20
- return _this;
21
- }
22
- return CancelledError;
23
- }(RestApiError_1.RestApiError));
24
- exports.CancelledError = CancelledError;
25
- /**
26
- * Check if an error is caused by user calling `cancel()` REST API.
27
- */
28
- var isCancelError = function (error) {
29
- return !!error && error instanceof CancelledError;
30
- };
31
- exports.isCancelError = isCancelError;
File without changes
@@ -1,4 +0,0 @@
1
- "use strict";
2
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- // SPDX-License-Identifier: Apache-2.0
4
- // noop - polyfills not required on platform
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
- // SPDX-License-Identifier: Apache-2.0
5
- var react_native_1 = require("@aws-amplify/react-native");
6
- (0, react_native_1.loadUrlPolyfill)();
@@ -1,14 +0,0 @@
1
- import { AmplifyErrorParams } from '@aws-amplify/core/internals/utils';
2
- import { RestApiError } from './RestApiError';
3
- /**
4
- * Internal-only class for CancelledError.
5
- *
6
- * @internal
7
- */
8
- export declare class CancelledError extends RestApiError {
9
- constructor(params: AmplifyErrorParams);
10
- }
11
- /**
12
- * Check if an error is caused by user calling `cancel()` REST API.
13
- */
14
- export declare const isCancelError: (error: unknown) => boolean;
@@ -1,27 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { __extends } from "tslib";
4
- import { RestApiError } from './RestApiError';
5
- /**
6
- * Internal-only class for CancelledError.
7
- *
8
- * @internal
9
- */
10
- var CancelledError = /** @class */ (function (_super) {
11
- __extends(CancelledError, _super);
12
- function CancelledError(params) {
13
- var _this = _super.call(this, params) || this;
14
- // TODO: Delete the following 2 lines after we change the build target to >= es2015
15
- _this.constructor = CancelledError;
16
- Object.setPrototypeOf(_this, CancelledError.prototype);
17
- return _this;
18
- }
19
- return CancelledError;
20
- }(RestApiError));
21
- export { CancelledError };
22
- /**
23
- * Check if an error is caused by user calling `cancel()` REST API.
24
- */
25
- export var isCancelError = function (error) {
26
- return !!error && error instanceof CancelledError;
27
- };
File without changes
@@ -1,4 +0,0 @@
1
- "use strict";
2
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- // SPDX-License-Identifier: Apache-2.0
4
- // noop - polyfills not required on platform
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { loadUrlPolyfill } from '@aws-amplify/react-native';
4
- loadUrlPolyfill();
@@ -1,26 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import { AmplifyErrorParams } from '@aws-amplify/core/internals/utils';
5
- import { RestApiError } from './RestApiError';
6
-
7
- /**
8
- * Internal-only class for CancelledError.
9
- *
10
- * @internal
11
- */
12
- export class CancelledError extends RestApiError {
13
- constructor(params: AmplifyErrorParams) {
14
- super(params);
15
-
16
- // TODO: Delete the following 2 lines after we change the build target to >= es2015
17
- this.constructor = CancelledError;
18
- Object.setPrototypeOf(this, CancelledError.prototype);
19
- }
20
- }
21
-
22
- /**
23
- * Check if an error is caused by user calling `cancel()` REST API.
24
- */
25
- export const isCancelError = (error: unknown): boolean =>
26
- !!error && error instanceof CancelledError;
@@ -1,5 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { loadUrlPolyfill } from '@aws-amplify/react-native';
4
-
5
- loadUrlPolyfill();
@@ -1,4 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- // noop - polyfills not required on platform