@aws-amplify/api-rest 4.0.1-console-preview.d745d43.0 → 4.0.1-mjs-test.6f5dab7.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 (174) hide show
  1. package/dist/cjs/apis/common/handler.js +75 -0
  2. package/dist/cjs/apis/common/handler.js.map +1 -0
  3. package/{lib → dist/cjs}/apis/common/internalPost.js +21 -19
  4. package/dist/cjs/apis/common/internalPost.js.map +1 -0
  5. package/dist/cjs/apis/common/publicApis.js +46 -0
  6. package/dist/cjs/apis/common/publicApis.js.map +1 -0
  7. package/{lib → dist/cjs}/apis/index.js +11 -17
  8. package/dist/cjs/apis/index.js.map +1 -0
  9. package/{lib → dist/cjs}/apis/server.js +11 -21
  10. package/dist/cjs/apis/server.js.map +1 -0
  11. package/{lib → dist/cjs}/errors/CanceledError.js +15 -16
  12. package/dist/cjs/errors/CanceledError.js.map +1 -0
  13. package/dist/cjs/errors/RestApiError.js +17 -0
  14. package/dist/cjs/errors/RestApiError.js.map +1 -0
  15. package/{lib → dist/cjs}/errors/assertValidatonError.js +7 -5
  16. package/dist/cjs/errors/assertValidatonError.js.map +1 -0
  17. package/{lib → dist/cjs}/errors/index.js +3 -1
  18. package/dist/cjs/errors/index.js.map +1 -0
  19. package/{lib → dist/cjs}/errors/validation.js +7 -6
  20. package/dist/cjs/errors/validation.js.map +1 -0
  21. package/{lib → dist/cjs}/index.js +3 -1
  22. package/dist/cjs/index.js.map +1 -0
  23. package/{lib → dist/cjs}/internals/index.js +6 -4
  24. package/dist/cjs/internals/index.js.map +1 -0
  25. package/{lib → dist/cjs}/internals/server.js +6 -4
  26. package/dist/cjs/internals/server.js.map +1 -0
  27. package/{lib → dist/cjs}/server.js +3 -1
  28. package/dist/cjs/server.js.map +1 -0
  29. package/{lib → dist/cjs}/types/index.js +3 -1
  30. package/dist/cjs/types/index.js.map +1 -0
  31. package/{lib → dist/cjs}/utils/constants.js +3 -1
  32. package/dist/cjs/utils/constants.js.map +1 -0
  33. package/dist/cjs/utils/createCancellableOperation.js +65 -0
  34. package/dist/cjs/utils/createCancellableOperation.js.map +1 -0
  35. package/{lib → dist/cjs}/utils/index.js +3 -1
  36. package/dist/cjs/utils/index.js.map +1 -0
  37. package/{lib → dist/cjs}/utils/logger.js +4 -2
  38. package/dist/cjs/utils/logger.js.map +1 -0
  39. package/{lib → dist/cjs}/utils/normalizeHeaders.js +6 -4
  40. package/dist/cjs/utils/normalizeHeaders.js.map +1 -0
  41. package/dist/cjs/utils/parseSigningInfo.js +43 -0
  42. package/dist/cjs/utils/parseSigningInfo.js.map +1 -0
  43. package/dist/cjs/utils/resolveApiUrl.js +42 -0
  44. package/dist/cjs/utils/resolveApiUrl.js.map +1 -0
  45. package/dist/cjs/utils/resolveCredentials.js +17 -0
  46. package/dist/cjs/utils/resolveCredentials.js.map +1 -0
  47. package/dist/cjs/utils/serviceError.js +32 -0
  48. package/dist/cjs/utils/serviceError.js.map +1 -0
  49. package/{lib-esm → dist/esm}/apis/common/handler.d.ts +1 -5
  50. package/dist/esm/apis/common/handler.mjs +78 -0
  51. package/dist/esm/apis/common/handler.mjs.map +1 -0
  52. package/{lib-esm/apis/common/internalPost.js → dist/esm/apis/common/internalPost.mjs} +26 -18
  53. package/dist/esm/apis/common/internalPost.mjs.map +1 -0
  54. package/dist/esm/apis/common/publicApis.mjs +45 -0
  55. package/dist/esm/apis/common/publicApis.mjs.map +1 -0
  56. package/{lib-esm/apis/index.js → dist/esm/apis/index.mjs} +12 -16
  57. package/dist/esm/apis/index.mjs.map +1 -0
  58. package/{lib-esm/apis/server.js → dist/esm/apis/server.mjs} +12 -20
  59. package/dist/esm/apis/server.mjs.map +1 -0
  60. package/dist/esm/errors/CanceledError.mjs +31 -0
  61. package/dist/esm/errors/CanceledError.mjs.map +1 -0
  62. package/dist/esm/errors/RestApiError.mjs +15 -0
  63. package/dist/esm/errors/RestApiError.mjs.map +1 -0
  64. package/dist/esm/errors/assertValidatonError.mjs +17 -0
  65. package/dist/esm/errors/assertValidatonError.mjs.map +1 -0
  66. package/dist/esm/errors/index.mjs +5 -0
  67. package/dist/esm/errors/index.mjs.map +1 -0
  68. package/{lib-esm/errors/validation.js → dist/esm/errors/validation.mjs} +8 -6
  69. package/dist/esm/errors/validation.mjs.map +1 -0
  70. package/dist/esm/index.mjs +3 -0
  71. package/dist/esm/index.mjs.map +1 -0
  72. package/{lib-esm/internals/index.js → dist/esm/internals/index.mjs} +9 -5
  73. package/dist/esm/internals/index.mjs.map +1 -0
  74. package/{lib-esm/internals/server.js → dist/esm/internals/server.mjs} +9 -5
  75. package/dist/esm/internals/server.mjs.map +1 -0
  76. package/dist/esm/server.mjs +3 -0
  77. package/dist/esm/server.mjs.map +1 -0
  78. package/dist/esm/types/index.mjs +2 -0
  79. package/dist/esm/types/index.mjs.map +1 -0
  80. package/dist/esm/utils/constants.mjs +13 -0
  81. package/dist/esm/utils/constants.mjs.map +1 -0
  82. package/dist/esm/utils/createCancellableOperation.mjs +65 -0
  83. package/dist/esm/utils/createCancellableOperation.mjs.map +1 -0
  84. package/dist/esm/utils/index.mjs +7 -0
  85. package/dist/esm/utils/index.mjs.map +1 -0
  86. package/{lib-esm/utils/logger.js → dist/esm/utils/logger.mjs} +6 -2
  87. package/dist/esm/utils/logger.mjs.map +1 -0
  88. package/{lib-esm/utils/normalizeHeaders.js → dist/esm/utils/normalizeHeaders.mjs} +6 -3
  89. package/dist/esm/utils/normalizeHeaders.mjs.map +1 -0
  90. package/dist/esm/utils/parseSigningInfo.mjs +41 -0
  91. package/dist/esm/utils/parseSigningInfo.mjs.map +1 -0
  92. package/dist/esm/utils/resolveApiUrl.mjs +42 -0
  93. package/dist/esm/utils/resolveApiUrl.mjs.map +1 -0
  94. package/{lib → dist/esm}/utils/resolveCredentials.d.ts +1 -1
  95. package/dist/esm/utils/resolveCredentials.mjs +17 -0
  96. package/dist/esm/utils/resolveCredentials.mjs.map +1 -0
  97. package/dist/esm/utils/serviceError.mjs +30 -0
  98. package/dist/esm/utils/serviceError.mjs.map +1 -0
  99. package/internals/package.json +4 -4
  100. package/internals/server/package.json +3 -4
  101. package/package.json +63 -26
  102. package/server/package.json +3 -4
  103. package/lib/apis/common/handler.d.ts +0 -31
  104. package/lib/apis/common/handler.js +0 -79
  105. package/lib/apis/common/internalPost.d.ts +0 -16
  106. package/lib/apis/common/publicApis.d.ts +0 -8
  107. package/lib/apis/common/publicApis.js +0 -50
  108. package/lib/apis/index.d.ts +0 -203
  109. package/lib/apis/server.d.ts +0 -151
  110. package/lib/errors/CanceledError.d.ts +0 -17
  111. package/lib/errors/RestApiError.d.ts +0 -4
  112. package/lib/errors/RestApiError.js +0 -19
  113. package/lib/errors/assertValidatonError.d.ts +0 -5
  114. package/lib/errors/index.d.ts +0 -4
  115. package/lib/errors/validation.d.ts +0 -6
  116. package/lib/index.d.ts +0 -2
  117. package/lib/internals/index.d.ts +0 -19
  118. package/lib/internals/server.d.ts +0 -20
  119. package/lib/server.d.ts +0 -2
  120. package/lib/tsconfig.tsbuildinfo +0 -1
  121. package/lib/types/index.d.ts +0 -103
  122. package/lib/utils/constants.d.ts +0 -8
  123. package/lib/utils/createCancellableOperation.d.ts +0 -12
  124. package/lib/utils/createCancellableOperation.js +0 -70
  125. package/lib/utils/index.d.ts +0 -6
  126. package/lib/utils/logger.d.ts +0 -2
  127. package/lib/utils/normalizeHeaders.d.ts +0 -1
  128. package/lib/utils/parseSigningInfo.d.ts +0 -14
  129. package/lib/utils/parseSigningInfo.js +0 -42
  130. package/lib/utils/resolveApiUrl.d.ts +0 -12
  131. package/lib/utils/resolveApiUrl.js +0 -39
  132. package/lib/utils/resolveCredentials.js +0 -23
  133. package/lib/utils/serviceError.d.ts +0 -10
  134. package/lib/utils/serviceError.js +0 -38
  135. package/lib-esm/apis/common/handler.js +0 -75
  136. package/lib-esm/apis/common/publicApis.js +0 -41
  137. package/lib-esm/errors/CanceledError.js +0 -31
  138. package/lib-esm/errors/RestApiError.js +0 -16
  139. package/lib-esm/errors/assertValidatonError.js +0 -13
  140. package/lib-esm/errors/index.js +0 -6
  141. package/lib-esm/index.js +0 -4
  142. package/lib-esm/server.js +0 -4
  143. package/lib-esm/tsconfig.tsbuildinfo +0 -1
  144. package/lib-esm/types/index.js +0 -1
  145. package/lib-esm/utils/constants.js +0 -10
  146. package/lib-esm/utils/createCancellableOperation.js +0 -66
  147. package/lib-esm/utils/index.js +0 -8
  148. package/lib-esm/utils/parseSigningInfo.js +0 -38
  149. package/lib-esm/utils/resolveApiUrl.js +0 -35
  150. package/lib-esm/utils/resolveCredentials.d.ts +0 -5
  151. package/lib-esm/utils/resolveCredentials.js +0 -19
  152. package/lib-esm/utils/serviceError.js +0 -33
  153. /package/{lib-esm → dist/esm}/apis/common/internalPost.d.ts +0 -0
  154. /package/{lib-esm → dist/esm}/apis/common/publicApis.d.ts +0 -0
  155. /package/{lib-esm → dist/esm}/apis/index.d.ts +0 -0
  156. /package/{lib-esm → dist/esm}/apis/server.d.ts +0 -0
  157. /package/{lib-esm → dist/esm}/errors/CanceledError.d.ts +0 -0
  158. /package/{lib-esm → dist/esm}/errors/RestApiError.d.ts +0 -0
  159. /package/{lib-esm → dist/esm}/errors/assertValidatonError.d.ts +0 -0
  160. /package/{lib-esm → dist/esm}/errors/index.d.ts +0 -0
  161. /package/{lib-esm → dist/esm}/errors/validation.d.ts +0 -0
  162. /package/{lib-esm → dist/esm}/index.d.ts +0 -0
  163. /package/{lib-esm → dist/esm}/internals/index.d.ts +0 -0
  164. /package/{lib-esm → dist/esm}/internals/server.d.ts +0 -0
  165. /package/{lib-esm → dist/esm}/server.d.ts +0 -0
  166. /package/{lib-esm → dist/esm}/types/index.d.ts +0 -0
  167. /package/{lib-esm → dist/esm}/utils/constants.d.ts +0 -0
  168. /package/{lib-esm → dist/esm}/utils/createCancellableOperation.d.ts +0 -0
  169. /package/{lib-esm → dist/esm}/utils/index.d.ts +0 -0
  170. /package/{lib-esm → dist/esm}/utils/logger.d.ts +0 -0
  171. /package/{lib-esm → dist/esm}/utils/normalizeHeaders.d.ts +0 -0
  172. /package/{lib-esm → dist/esm}/utils/parseSigningInfo.d.ts +0 -0
  173. /package/{lib-esm → dist/esm}/utils/resolveApiUrl.d.ts +0 -0
  174. /package/{lib-esm → dist/esm}/utils/serviceError.d.ts +0 -0
@@ -0,0 +1,75 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.transferHandler = void 0;
5
+ const aws_client_utils_1 = require("@aws-amplify/core/internals/aws-client-utils");
6
+ const utils_1 = require("../../utils");
7
+ const normalizeHeaders_1 = require("../../utils/normalizeHeaders");
8
+ /**
9
+ * Make REST API call with best-effort IAM auth.
10
+ * @param amplify Amplify instance to to resolve credentials and tokens. Should use different instance in client-side
11
+ * and SSR
12
+ * @param options Options accepted from public API options when calling the handlers.
13
+ * @param signingServiceInfo Internal-only options enable IAM auth as well as to to overwrite the IAM signing service
14
+ * and region. If specified, and NONE of API Key header or Auth header is present, IAM auth will be used.
15
+ *
16
+ * @internal
17
+ */
18
+ const transferHandler = async (amplify, options, signingServiceInfo) => {
19
+ const { url, method, headers, body, withCredentials, abortSignal } = options;
20
+ const resolvedBody = body
21
+ ? body instanceof FormData
22
+ ? body
23
+ : JSON.stringify(body ?? '')
24
+ : undefined;
25
+ const resolvedHeaders = {
26
+ ...(0, normalizeHeaders_1.normalizeHeaders)(headers),
27
+ ...(resolvedBody
28
+ ? {
29
+ 'content-type': body instanceof FormData
30
+ ? 'multipart/form-data'
31
+ : 'application/json; charset=UTF-8',
32
+ }
33
+ : {}),
34
+ };
35
+ const request = {
36
+ url,
37
+ headers: resolvedHeaders,
38
+ method,
39
+ body: resolvedBody,
40
+ };
41
+ const baseOptions = {
42
+ retryDecider: (0, aws_client_utils_1.getRetryDecider)(utils_1.parseRestApiServiceError),
43
+ computeDelay: aws_client_utils_1.jitteredBackoff,
44
+ withCrossDomainCredentials: withCredentials,
45
+ abortSignal,
46
+ };
47
+ const isIamAuthApplicable = iamAuthApplicable(request, signingServiceInfo);
48
+ let response;
49
+ if (isIamAuthApplicable) {
50
+ const signingInfoFromUrl = (0, utils_1.parseSigningInfo)(url);
51
+ const signingService = signingServiceInfo?.service ?? signingInfoFromUrl.service;
52
+ const signingRegion = signingServiceInfo?.region ?? signingInfoFromUrl.region;
53
+ const credentials = await (0, utils_1.resolveCredentials)(amplify);
54
+ response = await (0, aws_client_utils_1.authenticatedHandler)(request, {
55
+ ...baseOptions,
56
+ credentials,
57
+ region: signingRegion,
58
+ service: signingService,
59
+ });
60
+ }
61
+ else {
62
+ response = await (0, aws_client_utils_1.unauthenticatedHandler)(request, {
63
+ ...baseOptions,
64
+ });
65
+ }
66
+ // Clean-up un-modeled properties from response.
67
+ return {
68
+ statusCode: response.statusCode,
69
+ headers: response.headers,
70
+ body: response.body,
71
+ };
72
+ };
73
+ exports.transferHandler = transferHandler;
74
+ const iamAuthApplicable = ({ headers }, signingServiceInfo) => !headers.authorization && !headers['x-api-key'] && !!signingServiceInfo;
75
+ //# sourceMappingURL=handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.js","sources":["../../../../src/apis/common/handler.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.transferHandler = void 0;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst utils_1 = require(\"../../utils\");\nconst normalizeHeaders_1 = require(\"../../utils/normalizeHeaders\");\n/**\n * Make REST API call with best-effort IAM auth.\n * @param amplify Amplify instance to to resolve credentials and tokens. Should use different instance in client-side\n * and SSR\n * @param options Options accepted from public API options when calling the handlers.\n * @param signingServiceInfo Internal-only options enable IAM auth as well as to to overwrite the IAM signing service\n * and region. If specified, and NONE of API Key header or Auth header is present, IAM auth will be used.\n *\n * @internal\n */\nconst transferHandler = async (amplify, options, signingServiceInfo) => {\n const { url, method, headers, body, withCredentials, abortSignal } = options;\n const resolvedBody = body\n ? body instanceof FormData\n ? body\n : JSON.stringify(body ?? '')\n : undefined;\n const resolvedHeaders = {\n ...(0, normalizeHeaders_1.normalizeHeaders)(headers),\n ...(resolvedBody\n ? {\n 'content-type': body instanceof FormData\n ? 'multipart/form-data'\n : 'application/json; charset=UTF-8',\n }\n : {}),\n };\n const request = {\n url,\n headers: resolvedHeaders,\n method,\n body: resolvedBody,\n };\n const baseOptions = {\n retryDecider: (0, aws_client_utils_1.getRetryDecider)(utils_1.parseRestApiServiceError),\n computeDelay: aws_client_utils_1.jitteredBackoff,\n withCrossDomainCredentials: withCredentials,\n abortSignal,\n };\n const isIamAuthApplicable = iamAuthApplicable(request, signingServiceInfo);\n let response;\n if (isIamAuthApplicable) {\n const signingInfoFromUrl = (0, utils_1.parseSigningInfo)(url);\n const signingService = signingServiceInfo?.service ?? signingInfoFromUrl.service;\n const signingRegion = signingServiceInfo?.region ?? signingInfoFromUrl.region;\n const credentials = await (0, utils_1.resolveCredentials)(amplify);\n response = await (0, aws_client_utils_1.authenticatedHandler)(request, {\n ...baseOptions,\n credentials,\n region: signingRegion,\n service: signingService,\n });\n }\n else {\n response = await (0, aws_client_utils_1.unauthenticatedHandler)(request, {\n ...baseOptions,\n });\n }\n // Clean-up un-modeled properties from response.\n return {\n statusCode: response.statusCode,\n headers: response.headers,\n body: response.body,\n };\n};\nexports.transferHandler = transferHandler;\nconst iamAuthApplicable = ({ headers }, signingServiceInfo) => !headers.authorization && !headers['x-api-key'] && !!signingServiceInfo;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,eAAe,GAAG,KAAK,CAAC,CAAC;AACjC,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC,CAAC;AACnF,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACvC,MAAM,kBAAkB,GAAG,OAAO,CAAC,8BAA8B,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ports, "__esModule", { value: true });
5
6
  exports.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;
6
- var tslib_1 = require("tslib");
7
- var handler_1 = require("./handler");
8
- var utils_1 = require("../../utils");
7
+ const handler_1 = require("./handler");
8
+ const utils_1 = require("../../utils");
9
9
  /**
10
10
  * This weak map provides functionality to cancel a request given the promise containing the `post` request.
11
11
  *
@@ -17,21 +17,22 @@ var utils_1 = require("../../utils");
17
17
  * 6. GraphQL POST request will be rejected with the error message provided during cancel.
18
18
  * 7. Caller can check if the error is because of cancelling by calling `isCancelError(error)`.
19
19
  */
20
- var cancelTokenMap = new WeakMap();
20
+ const cancelTokenMap = new WeakMap();
21
21
  /**
22
22
  * @internal
23
23
  */
24
- var post = function (amplify, _a) {
25
- var url = _a.url, options = _a.options, abortController = _a.abortController;
26
- var controller = abortController !== null && abortController !== void 0 ? abortController : new AbortController();
27
- var responsePromise = (0, utils_1.createCancellableOperation)(function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
28
- var response;
29
- return tslib_1.__generator(this, function (_a) {
30
- response = (0, handler_1.transferHandler)(amplify, tslib_1.__assign(tslib_1.__assign({ url: url, method: 'POST' }, options), { abortSignal: controller.signal }), options === null || options === void 0 ? void 0 : options.signingServiceInfo);
31
- return [2 /*return*/, response];
32
- });
33
- }); }, controller);
34
- var responseWithCleanUp = responsePromise.finally(function () {
24
+ const post = (amplify, { url, options, abortController }) => {
25
+ const controller = abortController ?? new AbortController();
26
+ const responsePromise = (0, utils_1.createCancellableOperation)(async () => {
27
+ const response = (0, handler_1.transferHandler)(amplify, {
28
+ url,
29
+ method: 'POST',
30
+ ...options,
31
+ abortSignal: controller.signal,
32
+ }, options?.signingServiceInfo);
33
+ return response;
34
+ }, controller);
35
+ const responseWithCleanUp = responsePromise.finally(() => {
35
36
  cancelTokenMap.delete(responseWithCleanUp);
36
37
  });
37
38
  return responseWithCleanUp;
@@ -42,8 +43,8 @@ exports.post = post;
42
43
  * If the request is already completed, this function does nothing.
43
44
  * It MUST be used after `updateRequestToBeCancellable` is called.
44
45
  */
45
- var cancel = function (promise, message) {
46
- var controller = cancelTokenMap.get(promise);
46
+ const cancel = (promise, message) => {
47
+ const controller = cancelTokenMap.get(promise);
47
48
  if (controller) {
48
49
  controller.abort(message);
49
50
  if (message && controller.signal.reason !== message) {
@@ -59,7 +60,8 @@ exports.cancel = cancel;
59
60
  /**
60
61
  * MUST be used to make a promise including internal `post` API call cancellable.
61
62
  */
62
- var updateRequestToBeCancellable = function (promise, controller) {
63
+ const updateRequestToBeCancellable = (promise, controller) => {
63
64
  cancelTokenMap.set(promise, controller);
64
65
  };
65
66
  exports.updateRequestToBeCancellable = updateRequestToBeCancellable;
67
+ //# sourceMappingURL=internalPost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internalPost.js","sources":["../../../../src/apis/common/internalPost.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;\nconst handler_1 = require(\"./handler\");\nconst utils_1 = require(\"../../utils\");\n/**\n * This weak map provides functionality to cancel a request given the promise containing the `post` request.\n *\n * 1. For every GraphQL POST request, an abort controller is created and supplied to the request.\n * 2. The promise fulfilled by GraphGL POST request is then mapped to that abort controller.\n * 3. The promise is returned to the external caller.\n * 4. The caller can either wait for the promise to fulfill or call `cancel(promise)` to cancel the request.\n * 5. If `cancel(promise)` is called, then the corresponding abort controller is retrieved from the map below.\n * 6. GraphQL POST request will be rejected with the error message provided during cancel.\n * 7. Caller can check if the error is because of cancelling by calling `isCancelError(error)`.\n */\nconst cancelTokenMap = new WeakMap();\n/**\n * @internal\n */\nconst post = (amplify, { url, options, abortController }) => {\n const controller = abortController ?? new AbortController();\n const responsePromise = (0, utils_1.createCancellableOperation)(async () => {\n const response = (0, handler_1.transferHandler)(amplify, {\n url,\n method: 'POST',\n ...options,\n abortSignal: controller.signal,\n }, options?.signingServiceInfo);\n return response;\n }, controller);\n const responseWithCleanUp = responsePromise.finally(() => {\n cancelTokenMap.delete(responseWithCleanUp);\n });\n return responseWithCleanUp;\n};\nexports.post = post;\n/**\n * Cancels a request given the promise returned by `post`.\n * If the request is already completed, this function does nothing.\n * It MUST be used after `updateRequestToBeCancellable` is called.\n */\nconst cancel = (promise, message) => {\n const controller = cancelTokenMap.get(promise);\n if (controller) {\n controller.abort(message);\n if (message && controller.signal.reason !== message) {\n // In runtimes where `AbortSignal.reason` is not supported, we track the reason ourselves.\n // @ts-expect-error reason is read-only property.\n controller.signal['reason'] = message;\n }\n return true;\n }\n return false;\n};\nexports.cancel = cancel;\n/**\n * MUST be used to make a promise including internal `post` API call cancellable.\n */\nconst updateRequestToBeCancellable = (promise, controller) => {\n cancelTokenMap.set(promise, controller);\n};\nexports.updateRequestToBeCancellable = updateRequestToBeCancellable;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;AAC9E,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACvC,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,IAAI,OAAO,EAAE,CAAC;AACrC;AACA;AACA;AACA,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK;AAC7D,IAAI,MAAM,UAAU,GAAG,eAAe,IAAI,IAAI,eAAe,EAAE,CAAC;AAChE,IAAI,MAAM,eAAe,GAAG,IAAI,OAAO,CA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CAAC,CAAC;AAC5C,CAAC,CAAC;AACF,OAAO,CAAC,4BAA4B,GAAG,4BAA4B;;"}
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.patch = exports.head = exports.del = exports.put = exports.post = exports.get = void 0;
7
+ const utils_1 = require("../../utils");
8
+ const handler_1 = require("./handler");
9
+ const publicHandler = (amplify, options, method) => (0, utils_1.createCancellableOperation)(async (abortSignal) => {
10
+ const { apiName, options: apiOptions = {}, path: apiPath } = options;
11
+ const url = (0, utils_1.resolveApiUrl)(amplify, apiName, apiPath, apiOptions?.queryParams);
12
+ const libraryOptionsHeaders = await amplify.libraryOptions?.API?.REST?.headers?.({
13
+ apiName,
14
+ });
15
+ const { headers: invocationHeaders = {} } = apiOptions;
16
+ const headers = {
17
+ // custom headers from invocation options should precede library options
18
+ ...libraryOptionsHeaders,
19
+ ...invocationHeaders,
20
+ };
21
+ const signingServiceInfo = (0, utils_1.parseSigningInfo)(url, {
22
+ amplify,
23
+ apiName,
24
+ });
25
+ utils_1.logger.debug(method, url, headers, `IAM signing options: ${JSON.stringify(signingServiceInfo)}`);
26
+ return (0, handler_1.transferHandler)(amplify, {
27
+ ...apiOptions,
28
+ url,
29
+ method,
30
+ headers,
31
+ abortSignal,
32
+ }, signingServiceInfo);
33
+ });
34
+ const get = (amplify, input) => publicHandler(amplify, input, 'GET');
35
+ exports.get = get;
36
+ const post = (amplify, input) => publicHandler(amplify, input, 'POST');
37
+ exports.post = post;
38
+ const put = (amplify, input) => publicHandler(amplify, input, 'PUT');
39
+ exports.put = put;
40
+ const del = (amplify, input) => publicHandler(amplify, input, 'DELETE');
41
+ exports.del = del;
42
+ const head = (amplify, input) => publicHandler(amplify, input, 'HEAD');
43
+ exports.head = head;
44
+ const patch = (amplify, input) => publicHandler(amplify, input, 'PATCH');
45
+ exports.patch = patch;
46
+ //# sourceMappingURL=publicApis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publicApis.js","sources":["../../../../src/apis/common/publicApis.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.patch = exports.head = exports.del = exports.put = exports.post = exports.get = void 0;\nconst utils_1 = require(\"../../utils\");\nconst handler_1 = require(\"./handler\");\nconst publicHandler = (amplify, options, method) => (0, utils_1.createCancellableOperation)(async (abortSignal) => {\n const { apiName, options: apiOptions = {}, path: apiPath } = options;\n const url = (0, utils_1.resolveApiUrl)(amplify, apiName, apiPath, apiOptions?.queryParams);\n const libraryOptionsHeaders = await amplify.libraryOptions?.API?.REST?.headers?.({\n apiName,\n });\n const { headers: invocationHeaders = {} } = apiOptions;\n const headers = {\n // custom headers from invocation options should precede library options\n ...libraryOptionsHeaders,\n ...invocationHeaders,\n };\n const signingServiceInfo = (0, utils_1.parseSigningInfo)(url, {\n amplify,\n apiName,\n });\n utils_1.logger.debug(method, url, headers, `IAM signing options: ${JSON.stringify(signingServiceInfo)}`);\n return (0, handler_1.transferHandler)(amplify, {\n ...apiOptions,\n url,\n method,\n headers,\n abortSignal,\n }, signingServiceInfo);\n});\nconst get = (amplify, input) => publicHandler(amplify, input, 'GET');\nexports.get = get;\nconst post = (amplify, input) => publicHandler(amplify, input, 'POST');\nexports.post = post;\nconst put = (amplify, input) => publicHandler(amplify, input, 'PUT');\nexports.put = put;\nconst del = (amplify, input) => publicHandler(amplify, input, 'DELETE');\nexports.del = del;\nconst head = (amplify, input) => publicHandler(amplify, input, 'HEAD');\nexports.head = head;\nconst patch = (amplify, input) => publicHandler(amplify, input, 'PATCH');\nexports.patch = patch;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAA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
2
+
2
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
4
  // SPDX-License-Identifier: Apache-2.0
4
5
  Object.defineProperty(exports, "__esModule", { value: true });
5
6
  exports.patch = exports.head = exports.del = exports.put = exports.post = exports.get = void 0;
6
- var core_1 = require("@aws-amplify/core");
7
- var publicApis_1 = require("./common/publicApis");
7
+ const core_1 = require("@aws-amplify/core");
8
+ const publicApis_1 = require("./common/publicApis");
8
9
  /**
9
10
  * GET HTTP request
10
11
  * @param {GetInput} input - Input for GET operation
@@ -44,7 +45,7 @@ var publicApis_1 = require("./common/publicApis");
44
45
  * }
45
46
  * ```
46
47
  */
47
- var get = function (input) { return (0, publicApis_1.get)(core_1.Amplify, input); };
48
+ const get = (input) => (0, publicApis_1.get)(core_1.Amplify, input);
48
49
  exports.get = get;
49
50
  /**
50
51
  * POST HTTP request
@@ -85,9 +86,7 @@ exports.get = get;
85
86
  * }
86
87
  * ```
87
88
  */
88
- var post = function (input) {
89
- return (0, publicApis_1.post)(core_1.Amplify, input);
90
- };
89
+ const post = (input) => (0, publicApis_1.post)(core_1.Amplify, input);
91
90
  exports.post = post;
92
91
  /**
93
92
  * PUT HTTP request
@@ -127,7 +126,7 @@ exports.post = post;
127
126
  * }
128
127
  * ```
129
128
  */
130
- var put = function (input) { return (0, publicApis_1.put)(core_1.Amplify, input); };
129
+ const put = (input) => (0, publicApis_1.put)(core_1.Amplify, input);
131
130
  exports.put = put;
132
131
  /**
133
132
  * DELETE HTTP request
@@ -149,9 +148,7 @@ exports.put = put;
149
148
  * }).response;
150
149
  * ```
151
150
  */
152
- var del = function (input) {
153
- return (0, publicApis_1.del)(core_1.Amplify, input);
154
- };
151
+ const del = (input) => (0, publicApis_1.del)(core_1.Amplify, input);
155
152
  exports.del = del;
156
153
  /**
157
154
  * HEAD HTTP request
@@ -174,9 +171,7 @@ exports.del = del;
174
171
  * ```
175
172
  *
176
173
  */
177
- var head = function (input) {
178
- return (0, publicApis_1.head)(core_1.Amplify, input);
179
- };
174
+ const head = (input) => (0, publicApis_1.head)(core_1.Amplify, input);
180
175
  exports.head = head;
181
176
  /**
182
177
  * PATCH HTTP request
@@ -217,7 +212,6 @@ exports.head = head;
217
212
  * }
218
213
  * ```
219
214
  */
220
- var patch = function (input) {
221
- return (0, publicApis_1.patch)(core_1.Amplify, input);
222
- };
215
+ const patch = (input) => (0, publicApis_1.patch)(core_1.Amplify, input);
223
216
  exports.patch = patch;
217
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/apis/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.patch = exports.head = exports.del = exports.put = exports.post = exports.get = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst publicApis_1 = require(\"./common/publicApis\");\n/**\n * GET HTTP request\n * @param {GetInput} input - Input for GET operation\n * @returns {GetOperation} Operation for GET request\n * @throws - {@link RestApiError}\n * @example\n * Send a GET request\n * ```js\n * import { get, isCancelError } from '@aws-amplify/api';\n *\n * const { body } = await get({\n * apiName,\n * path,\n * options: {\n * headers, // Optional, A map of custom header key/values\n * body, // Optional, JSON object or FormData\n * queryParams, // Optional, A map of query strings\n * }\n * }).response;\n * const data = await body.json();\n * ```\n * @example\n * Cancel a GET request\n *\n * ```js\n * import { get, isCancelError } from '@aws-amplify/api';\n *\n * const { response, cancel } = get({apiName, path, options});\n * cancel(message);\n * try {\n * await response;\n * } cache (e) {\n * if (isCancelError(e)) {\n * // handle request cancellation\n * }\n * //...\n * }\n * ```\n */\nconst get = (input) => (0, publicApis_1.get)(core_1.Amplify, input);\nexports.get = get;\n/**\n * POST HTTP request\n * @param {PostInput} input - Input for POST operation\n * @returns {PostOperation} Operation for POST request\n * @throws - {@link RestApiError}\n * @example\n * Send a POST request\n * ```js\n * import { post, isCancelError } from '@aws-amplify/api';\n *\n * const { body } = await post({\n * apiName,\n * path,\n * options: {\n * headers, // Optional, A map of custom header key/values\n * body, // Optional, JSON object or FormData\n * queryParams, // Optional, A map of query strings\n * }\n * }).response;\n * const data = await body.json();\n * ```\n * @example\n * Cancel a POST request\n *\n * ```js\n * import { post, isCancelError } from '@aws-amplify/api';\n *\n * const { response, cancel } = post({apiName, path, options});\n * cancel(message);\n * try {\n * await response;\n * } cache (e) {\n * if (isCancelError(e)) {\n * // handle request cancellation\n * }\n * //...\n * }\n * ```\n */\nconst post = (input) => (0, publicApis_1.post)(core_1.Amplify, input);\nexports.post = post;\n/**\n * PUT HTTP request\n * @param {PutInput} input - Input for PUT operation\n * @returns {PutOperation} Operation for PUT request\n * @throws - {@link RestApiError}\n * @example\n * Send a PUT request\n * ```js\n * import { put, isCancelError } from '@aws-amplify/api';\n *\n * const { body } = await put({\n * apiName,\n * path,\n * options: {\n * headers, // Optional, A map of custom header key/values\n * body, // Optional, JSON object or FormData\n * queryParams, // Optional, A map of query strings\n * }\n * }).response;\n * const data = await body.json();\n * ```\n * @example\n * Cancel a PUT request\n * ```js\n * import { put, isCancelError } from '@aws-amplify/api';\n *\n * const { response, cancel } = put({apiName, path, options});\n * cancel(message);\n * try {\n * await response;\n * } cache (e) {\n * if (isCancelError(e)) {\n * // handle request cancellation\n * }\n * //...\n * }\n * ```\n */\nconst put = (input) => (0, publicApis_1.put)(core_1.Amplify, input);\nexports.put = put;\n/**\n * DELETE HTTP request\n * @param {DeleteInput} input - Input for DELETE operation\n * @returns {DeleteOperation} Operation for DELETE request\n * @throws - {@link RestApiError}\n * @example\n * Send a DELETE request\n * ```js\n * import { del } from '@aws-amplify/api';\n *\n * const { statusCode } = await del({\n * apiName,\n * path,\n * options: {\n * headers, // Optional, A map of custom header key/values\n * queryParams, // Optional, A map of query strings\n * }\n * }).response;\n * ```\n */\nconst del = (input) => (0, publicApis_1.del)(core_1.Amplify, input);\nexports.del = del;\n/**\n * HEAD HTTP request\n * @param {HeadInput} input - Input for HEAD operation\n * @returns {HeadOperation} Operation for HEAD request\n * @throws - {@link RestApiError}\n * @example\n * Send a HEAD request\n * ```js\n * import { head, isCancelError } from '@aws-amplify/api';\n *\n * const { headers, statusCode } = await head({\n * apiName,\n * path,\n * options: {\n * headers, // Optional, A map of custom header key/values\n * queryParams, // Optional, A map of query strings\n * }\n * }),response;\n * ```\n *\n */\nconst head = (input) => (0, publicApis_1.head)(core_1.Amplify, input);\nexports.head = head;\n/**\n * PATCH HTTP request\n * @param {PatchInput} input - Input for PATCH operation\n * @returns {PatchOperation} Operation for PATCH request\n * @throws - {@link RestApiError}\n * @example\n * Send a PATCH request\n * ```js\n * import { patch } from '@aws-amplify/api';\n *\n * const { body } = await patch({\n * apiName,\n * path,\n * options: {\n * headers, // Optional, A map of custom header key/values\n * body, // Optional, JSON object or FormData\n * queryParams, // Optional, A map of query strings\n * }\n * }).response;\n * const data = await body.json();\n * ```\n *\n * @example\n * Cancel a PATCH request\n * ```js\n * import { patch, isCancelError } from '@aws-amplify/api';\n *\n * const { response, cancel } = patch({apiName, path, options});\n * cancel(message);\n * try {\n * await response;\n * } cache (e) {\n * if (isCancelError(e)) {\n * // handle request cancellation\n * }\n * //...\n * }\n * ```\n */\nconst patch = (input) => (0, publicApis_1.patch)(core_1.Amplify, input);\nexports.patch = patch;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC;AAC/F,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,GAAG,GAAG,CAAC,KAAK,KAAK,IAAI,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACpE,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI,GAAG,CAAC,KAAK,KAAK,IAAI,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACtE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,GAAG,GAAG,CAAC,KAAK,KAAK,IAAI,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACpE,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,GAAG,GAAG,CAAC,KAAK,KAAK,IAAI,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACpE,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI,GAAG,CAAC,KAAK,KAAK,IAAI,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACtE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,KAAK,GAAG,CAAC,KAAK,KAAK,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACxE,OAAO,CAAC,KAAK,GAAG,KAAK;;"}
@@ -1,10 +1,11 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
4
  // SPDX-License-Identifier: Apache-2.0
4
5
  Object.defineProperty(exports, "__esModule", { value: true });
5
6
  exports.patch = exports.head = exports.del = exports.put = exports.post = exports.get = void 0;
6
- var adapter_core_1 = require("@aws-amplify/core/internals/adapter-core");
7
- var publicApis_1 = require("./common/publicApis");
7
+ const adapter_core_1 = require("@aws-amplify/core/internals/adapter-core");
8
+ const publicApis_1 = require("./common/publicApis");
8
9
  /**
9
10
  * GET HTTP request (server-side)
10
11
  * @param {AmplifyServer.ContextSpec} contextSpec - The context spec used to get the Amplify server context.
@@ -30,9 +31,7 @@ var publicApis_1 = require("./common/publicApis");
30
31
  * ```
31
32
  * @see {@link clientGet}
32
33
  */
33
- var get = function (contextSpec, input) {
34
- return (0, publicApis_1.get)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
35
- };
34
+ const get = (contextSpec, input) => (0, publicApis_1.get)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
36
35
  exports.get = get;
37
36
  /**
38
37
  * POST HTTP request (server-side)
@@ -58,9 +57,7 @@ exports.get = get;
58
57
  * });
59
58
  * ```
60
59
  */
61
- var post = function (contextSpec, input) {
62
- return (0, publicApis_1.post)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
63
- };
60
+ const post = (contextSpec, input) => (0, publicApis_1.post)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
64
61
  exports.post = post;
65
62
  /**
66
63
  * PUT HTTP request (server-side)
@@ -86,9 +83,7 @@ exports.post = post;
86
83
  * });
87
84
  * ```
88
85
  */
89
- var put = function (contextSpec, input) {
90
- return (0, publicApis_1.put)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
91
- };
86
+ const put = (contextSpec, input) => (0, publicApis_1.put)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
92
87
  exports.put = put;
93
88
  /**
94
89
  * DELETE HTTP request (server-side)
@@ -113,9 +108,7 @@ exports.put = put;
113
108
  * });
114
109
  * ```
115
110
  */
116
- var del = function (contextSpec, input) {
117
- return (0, publicApis_1.del)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
118
- };
111
+ const del = (contextSpec, input) => (0, publicApis_1.del)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
119
112
  exports.del = del;
120
113
  /**
121
114
  * HEAD HTTP request (server-side)
@@ -140,9 +133,7 @@ exports.del = del;
140
133
  * });
141
134
  * ```
142
135
  */
143
- var head = function (contextSpec, input) {
144
- return (0, publicApis_1.head)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
145
- };
136
+ const head = (contextSpec, input) => (0, publicApis_1.head)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
146
137
  exports.head = head;
147
138
  /**
148
139
  * PATCH HTTP request (server-side)
@@ -168,7 +159,6 @@ exports.head = head;
168
159
  * });
169
160
  * ```
170
161
  */
171
- var patch = function (contextSpec, input) {
172
- return (0, publicApis_1.patch)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
173
- };
162
+ const patch = (contextSpec, input) => (0, publicApis_1.patch)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
174
163
  exports.patch = patch;
164
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sources":["../../../src/apis/server.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.patch = exports.head = exports.del = exports.put = exports.post = exports.get = void 0;\nconst adapter_core_1 = require(\"@aws-amplify/core/internals/adapter-core\");\nconst publicApis_1 = require(\"./common/publicApis\");\n/**\n * GET HTTP request (server-side)\n * @param {AmplifyServer.ContextSpec} contextSpec - The context spec used to get the Amplify server context.\n * @param {GetInput} input - Input for GET operation.\n * @throws - {@link RestApiError}\n * @example\n * Send a GET request\n * ```js\n * import { get } from 'aws-amplify/api/server';\n * //...\n * const restApiResponse = await runWithAmplifyServerContext({\n * nextServerContext: { request, response },\n * operation: async (contextSpec) => {\n * try {\n * const { body } = await get(contextSpec, input).response;\n * return await body.json();\n * } catch (error) {\n * console.log(error);\n * return false;\n * }\n * },\n * });\n * ```\n * @see {@link clientGet}\n */\nconst get = (contextSpec, input) => (0, publicApis_1.get)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);\nexports.get = get;\n/**\n * POST HTTP request (server-side)\n * @param {AmplifyServer.ContextSpec} contextSpec - The context spec used to get the Amplify server context.\n * @param {PostInput} input - Input for POST operation.\n * @throws - {@link RestApiError}\n * @example\n * Send a POST request\n * ```js\n * import { post } from 'aws-amplify/api/server';\n * //...\n * const restApiResponse = await runWithAmplifyServerContext({\n * nextServerContext: { request, response },\n * operation: async (contextSpec) => {\n * try {\n * const { body } = await post(contextSpec, input).response;\n * return await body.json();\n * } catch (error) {\n * console.log(error);\n * return false;\n * }\n * },\n * });\n * ```\n */\nconst post = (contextSpec, input) => (0, publicApis_1.post)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);\nexports.post = post;\n/**\n * PUT HTTP request (server-side)\n * @param {AmplifyServer.ContextSpec} contextSpec - The context spec used to get the Amplify server context.\n * @param {PutInput} input - Input for PUT operation.\n * @throws - {@link RestApiError}\n * @example\n * Send a PUT request\n * ```js\n * import { put } from 'aws-amplify/api/server';\n * //...\n * const restApiResponse = await runWithAmplifyServerContext({\n * nextServerContext: { request, response },\n * operation: async (contextSpec) => {\n * try {\n * const { body } = await put(contextSpec, input).response;\n * return await body.json();\n * } catch (error) {\n * console.log(error);\n * return false;\n * }\n * },\n * });\n * ```\n */\nconst put = (contextSpec, input) => (0, publicApis_1.put)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);\nexports.put = put;\n/**\n * DELETE HTTP request (server-side)\n * @param {AmplifyServer.ContextSpec} contextSpec - The context spec used to get the Amplify server context.\n * @param {DeleteInput} input - Input for DELETE operation.\n * @throws - {@link RestApiError}\n * @example\n * Send a DELETE request\n * ```js\n * import { del } from 'aws-amplify/api/server';\n * //...\n * const restApiResponse = await runWithAmplifyServerContext({\n * nextServerContext: { request, response },\n * operation: async (contextSpec) => {\n * try {\n * const { headers } = await del(contextSpec, input).response;\n * } catch (error) {\n * console.log(error);\n * return false;\n * }\n * },\n * });\n * ```\n */\nconst del = (contextSpec, input) => (0, publicApis_1.del)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);\nexports.del = del;\n/**\n * HEAD HTTP request (server-side)\n * @param {AmplifyServer.ContextSpec} contextSpec - The context spec used to get the Amplify server context.\n * @param {HeadInput} input - Input for HEAD operation.\n * @throws - {@link RestApiError}\n * @example\n * Send a HEAD request\n * ```js\n * import { head } from 'aws-amplify/api/server';\n * //...\n * const restApiResponse = await runWithAmplifyServerContext({\n * nextServerContext: { request, response },\n * operation: async (contextSpec) => {\n * try {\n * const { headers } = await head(contextSpec, input).response;\n * } catch (error) {\n * console.log(error);\n * return false;\n * }\n * },\n * });\n * ```\n */\nconst head = (contextSpec, input) => (0, publicApis_1.head)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);\nexports.head = head;\n/**\n * PATCH HTTP request (server-side)\n * @param {AmplifyServer.ContextSpec} contextSpec - The context spec used to get the Amplify server context.\n * @param {PatchInput} input - Input for PATCH operation.\n * @throws - {@link RestApiError}\n * @example\n * Send a PATCH request\n * ```js\n * import { patch } from 'aws-amplify/api/server';\n * //...\n * const restApiResponse = await runWithAmplifyServerContext({\n * nextServerContext: { request, response },\n * operation: async (contextSpec) => {\n * try {\n * const { body } = await patch(contextSpec, input).response;\n * return await body.json();\n * } catch (error) {\n * console.log(error);\n * return false;\n * }\n * },\n * });\n * ```\n */\nconst patch = (contextSpec, input) => (0, publicApis_1.patch)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);\nexports.patch = patch;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC;AAC/F,MAAM,cAAc,GAAG,OAAO,CAAC,0CAA0C,CAAC,CAAC;AAC3E,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,KAAK,IAAI,YAAY,CAAC,IAAI,EAAE,IAAI,cAAc,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACrI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,KAAK,GAAG,CAAC,WAAW,EAAE,KAAK,KAAK,IAAI,YAAY,CAAC,KAAK,EAAE,IAAI,cAAc,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACvI,OAAO,CAAC,KAAK,GAAG,KAAK;;"}
@@ -1,27 +1,27 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
4
  // SPDX-License-Identifier: Apache-2.0
4
5
  Object.defineProperty(exports, "__esModule", { value: true });
5
6
  exports.isCancelError = exports.CanceledError = void 0;
6
- var tslib_1 = require("tslib");
7
- var RestApiError_1 = require("./RestApiError");
7
+ const RestApiError_1 = require("./RestApiError");
8
8
  /**
9
9
  * Internal-only class for CanceledError.
10
10
  *
11
11
  * @internal
12
12
  */
13
- var CanceledError = /** @class */ (function (_super) {
14
- tslib_1.__extends(CanceledError, _super);
15
- function CanceledError(params) {
16
- if (params === void 0) { params = {}; }
17
- var _this = _super.call(this, tslib_1.__assign({ name: 'CanceledError', message: 'Request is canceled by user' }, params)) || this;
13
+ class CanceledError extends RestApiError_1.RestApiError {
14
+ constructor(params = {}) {
15
+ super({
16
+ name: 'CanceledError',
17
+ message: 'Request is canceled by user',
18
+ ...params,
19
+ });
18
20
  // TODO: Delete the following 2 lines after we change the build target to >= es2015
19
- _this.constructor = CanceledError;
20
- Object.setPrototypeOf(_this, CanceledError.prototype);
21
- return _this;
21
+ this.constructor = CanceledError;
22
+ Object.setPrototypeOf(this, CanceledError.prototype);
22
23
  }
23
- return CanceledError;
24
- }(RestApiError_1.RestApiError));
24
+ }
25
25
  exports.CanceledError = CanceledError;
26
26
  /**
27
27
  * Check if an error is caused by user calling `cancel()` in REST API.
@@ -29,7 +29,6 @@ exports.CanceledError = CanceledError;
29
29
  * @note This function works **ONLY** for errors thrown by REST API. For GraphQL APIs, use `client.isCancelError(error)`
30
30
  * instead. `client` is generated from `generateClient()` API from `aws-amplify/api`.
31
31
  */
32
- var isCancelError = function (error) {
33
- return !!error && error instanceof CanceledError;
34
- };
32
+ const isCancelError = (error) => !!error && error instanceof CanceledError;
35
33
  exports.isCancelError = isCancelError;
34
+ //# sourceMappingURL=CanceledError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanceledError.js","sources":["../../../src/errors/CanceledError.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isCancelError = exports.CanceledError = void 0;\nconst RestApiError_1 = require(\"./RestApiError\");\n/**\n * Internal-only class for CanceledError.\n *\n * @internal\n */\nclass CanceledError extends RestApiError_1.RestApiError {\n constructor(params = {}) {\n super({\n name: 'CanceledError',\n message: 'Request is canceled by user',\n ...params,\n });\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = CanceledError;\n Object.setPrototypeOf(this, CanceledError.prototype);\n }\n}\nexports.CanceledError = CanceledError;\n/**\n * Check if an error is caused by user calling `cancel()` in REST API.\n *\n * @note This function works **ONLY** for errors thrown by REST API. For GraphQL APIs, use `client.isCancelError(error)`\n * instead. `client` is generated from `generateClient()` API from `aws-amplify/api`.\n */\nconst isCancelError = (error) => !!error && error instanceof CanceledError;\nexports.isCancelError = isCancelError;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AACvD,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,SAAS,cAAc,CAAC,YAAY,CAAC;AACxD,IAAI,WAAW,CAAC,MAAM,GAAG,EAAE,EAAE;AAC7B,QAAQ,KAAK,CAAC;AACd,YAAY,IAAI,EAAE,eAAe;AACjC,YAAY,OAAO,EAAE,6BAA6B;AAClD,YAAY,GAAG,MAAM;AACrB,SAAS,CAAC,CAAC;AACX;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,aAAa,CAAC;AACzC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;AAC7D,KAAK;AACL,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa,CAAC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,KAAK,YAAY,aAAa,CAAC;AAC3E,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RestApiError = void 0;
7
+ const utils_1 = require("@aws-amplify/core/internals/utils");
8
+ class RestApiError extends utils_1.AmplifyError {
9
+ constructor(params) {
10
+ super(params);
11
+ // TODO: Delete the following 2 lines after we change the build target to >= es2015
12
+ this.constructor = RestApiError;
13
+ Object.setPrototypeOf(this, RestApiError.prototype);
14
+ }
15
+ }
16
+ exports.RestApiError = RestApiError;
17
+ //# sourceMappingURL=RestApiError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RestApiError.js","sources":["../../../src/errors/RestApiError.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RestApiError = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nclass RestApiError extends utils_1.AmplifyError {\n constructor(params) {\n super(params);\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = RestApiError;\n Object.setPrototypeOf(this, RestApiError.prototype);\n }\n}\nexports.RestApiError = RestApiError;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC;AAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D,MAAM,YAAY,SAAS,OAAO,CAAC,YAAY,CAAC;AAChD,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC,MAAM,CAAC,CAAC;AACtB;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC;AACxC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;AAC5D,KAAK;AACL,CAAC;AACD,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
@@ -1,17 +1,19 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
4
  // SPDX-License-Identifier: Apache-2.0
4
5
  Object.defineProperty(exports, "__esModule", { value: true });
5
6
  exports.assertValidationError = void 0;
6
- var RestApiError_1 = require("./RestApiError");
7
- var validation_1 = require("./validation");
7
+ const RestApiError_1 = require("./RestApiError");
8
+ const validation_1 = require("./validation");
8
9
  /**
9
10
  * @internal
10
11
  */
11
12
  function assertValidationError(assertion, name) {
12
- var _a = validation_1.validationErrorMap[name], message = _a.message, recoverySuggestion = _a.recoverySuggestion;
13
+ const { message, recoverySuggestion } = validation_1.validationErrorMap[name];
13
14
  if (!assertion) {
14
- throw new RestApiError_1.RestApiError({ name: name, message: message, recoverySuggestion: recoverySuggestion });
15
+ throw new RestApiError_1.RestApiError({ name, message, recoverySuggestion });
15
16
  }
16
17
  }
17
18
  exports.assertValidationError = assertValidationError;
19
+ //# sourceMappingURL=assertValidatonError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertValidatonError.js","sources":["../../../src/errors/assertValidatonError.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assertValidationError = void 0;\nconst RestApiError_1 = require(\"./RestApiError\");\nconst validation_1 = require(\"./validation\");\n/**\n * @internal\n */\nfunction assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = validation_1.validationErrorMap[name];\n if (!assertion) {\n throw new RestApiError_1.RestApiError({ name, message, recoverySuggestion });\n }\n}\nexports.assertValidationError = assertValidationError;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,qBAAqB,GAAG,KAAK,CAAC,CAAC;AACvC,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACjD,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC7C;AACA;AACA;AACA,SAAS,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE;AAChD,IAAI,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAClF,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,cAAc,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAC;AACrF,KAAK;AACL,CAAC;AACD,OAAO,CAAC,qBAAqB,GAAG,qBAAqB;;"}
@@ -1,4 +1,5 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
4
  // SPDX-License-Identifier: Apache-2.0
4
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -13,3 +14,4 @@ Object.defineProperty(exports, "assertValidationError", { enumerable: true, get:
13
14
  var validation_1 = require("./validation");
14
15
  Object.defineProperty(exports, "RestApiValidationErrorCode", { enumerable: true, get: function () { return validation_1.RestApiValidationErrorCode; } });
15
16
  Object.defineProperty(exports, "validationErrorMap", { enumerable: true, get: function () { return validation_1.validationErrorMap; } });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/errors/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validationErrorMap = exports.RestApiValidationErrorCode = exports.assertValidationError = exports.RestApiError = exports.isCancelError = exports.CanceledError = void 0;\nvar CanceledError_1 = require(\"./CanceledError\");\nObject.defineProperty(exports, \"CanceledError\", { enumerable: true, get: function () { return CanceledError_1.CanceledError; } });\nObject.defineProperty(exports, \"isCancelError\", { enumerable: true, get: function () { return CanceledError_1.isCancelError; } });\nvar RestApiError_1 = require(\"./RestApiError\");\nObject.defineProperty(exports, \"RestApiError\", { enumerable: true, get: function () { return RestApiError_1.RestApiError; } });\nvar assertValidatonError_1 = require(\"./assertValidatonError\");\nObject.defineProperty(exports, \"assertValidationError\", { enumerable: true, get: function () { return assertValidatonError_1.assertValidationError; } });\nvar validation_1 = require(\"./validation\");\nObject.defineProperty(exports, \"RestApiValidationErrorCode\", { enumerable: true, get: function () { return validation_1.RestApiValidationErrorCode; } });\nObject.defineProperty(exports, \"validationErrorMap\", { enumerable: true, get: function () { return validation_1.validationErrorMap; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAChL,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACjD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC;AAClI,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC;AAClI,IAAI,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC/C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;AAC/H,IAAI,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAC/D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,uBAAuB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,sBAAsB,CAAC,qBAAqB,CAAC,EAAE,EAAE,CAAC,CAAC;AACzJ,IAAI,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC3C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,0BAA0B,CAAC,EAAE,EAAE,CAAC,CAAC;AACzJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC;;"}
@@ -1,7 +1,7 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
4
  // SPDX-License-Identifier: Apache-2.0
4
- var _a;
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.validationErrorMap = exports.RestApiValidationErrorCode = void 0;
7
7
  var RestApiValidationErrorCode;
@@ -9,12 +9,13 @@ var RestApiValidationErrorCode;
9
9
  RestApiValidationErrorCode["NoCredentials"] = "NoCredentials";
10
10
  RestApiValidationErrorCode["InvalidApiName"] = "InvalidApiName";
11
11
  })(RestApiValidationErrorCode = exports.RestApiValidationErrorCode || (exports.RestApiValidationErrorCode = {}));
12
- exports.validationErrorMap = (_a = {},
13
- _a[RestApiValidationErrorCode.NoCredentials] = {
12
+ exports.validationErrorMap = {
13
+ [RestApiValidationErrorCode.NoCredentials]: {
14
14
  message: 'Credentials should not be empty.',
15
15
  },
16
- _a[RestApiValidationErrorCode.InvalidApiName] = {
16
+ [RestApiValidationErrorCode.InvalidApiName]: {
17
17
  message: 'API name is invalid.',
18
18
  recoverySuggestion: 'Check if the API name matches the one in your configuration or `aws-exports.js`',
19
19
  },
20
- _a);
20
+ };
21
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sources":["../../../src/errors/validation.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validationErrorMap = exports.RestApiValidationErrorCode = void 0;\nvar RestApiValidationErrorCode;\n(function (RestApiValidationErrorCode) {\n RestApiValidationErrorCode[\"NoCredentials\"] = \"NoCredentials\";\n RestApiValidationErrorCode[\"InvalidApiName\"] = \"InvalidApiName\";\n})(RestApiValidationErrorCode = exports.RestApiValidationErrorCode || (exports.RestApiValidationErrorCode = {}));\nexports.validationErrorMap = {\n [RestApiValidationErrorCode.NoCredentials]: {\n message: 'Credentials should not be empty.',\n },\n [RestApiValidationErrorCode.InvalidApiName]: {\n message: 'API name is invalid.',\n recoverySuggestion: 'Check if the API name matches the one in your configuration or `aws-exports.js`',\n },\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,0BAA0B,GAAG,KAAK,CAAC,CAAC;AACzE,IAAI,0BAA0B,CAAC;AAC/B,CAAC,UAAU,0BAA0B,EAAE;AACvC,IAAI,0BAA0B,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;AAClE,IAAI,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;AACpE,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,KAAK,OAAO,CAAC,0BAA0B,GAAG,EAAE,CAAC,CAAC,CAAC;AACjH,OAAO,CAAC,kBAAkB,GAAG;AAC7B,IAAI,CAAC,0BAA0B,CAAC,aAAa,GAAG;AAChD,QAAQ,OAAO,EAAE,kCAAkC;AACnD,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,cAAc,GAAG;AACjD,QAAQ,OAAO,EAAE,sBAAsB;AACvC,QAAQ,kBAAkB,EAAE,iFAAiF;AAC7G,KAAK;AACL,CAAC;;"}
@@ -1,4 +1,5 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
4
  // SPDX-License-Identifier: Apache-2.0
4
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -12,3 +13,4 @@ Object.defineProperty(exports, "put", { enumerable: true, get: function () { ret
12
13
  Object.defineProperty(exports, "del", { enumerable: true, get: function () { return apis_1.del; } });
13
14
  Object.defineProperty(exports, "head", { enumerable: true, get: function () { return apis_1.head; } });
14
15
  Object.defineProperty(exports, "patch", { enumerable: true, get: function () { return apis_1.patch; } });
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.patch = exports.head = exports.del = exports.put = exports.post = exports.get = exports.isCancelError = void 0;\nvar CanceledError_1 = require(\"./errors/CanceledError\");\nObject.defineProperty(exports, \"isCancelError\", { enumerable: true, get: function () { return CanceledError_1.isCancelError; } });\nvar apis_1 = require(\"./apis\");\nObject.defineProperty(exports, \"get\", { enumerable: true, get: function () { return apis_1.get; } });\nObject.defineProperty(exports, \"post\", { enumerable: true, get: function () { return apis_1.post; } });\nObject.defineProperty(exports, \"put\", { enumerable: true, get: function () { return apis_1.put; } });\nObject.defineProperty(exports, \"del\", { enumerable: true, get: function () { return apis_1.del; } });\nObject.defineProperty(exports, \"head\", { enumerable: true, get: function () { return apis_1.head; } });\nObject.defineProperty(exports, \"patch\", { enumerable: true,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