@aws-amplify/api-rest 4.0.1-unstable.cfbde4c.0 → 4.0.1

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 (156) hide show
  1. package/{lib → dist/cjs}/apis/common/handler.js +3 -1
  2. package/dist/cjs/apis/common/handler.js.map +1 -0
  3. package/{lib → dist/cjs}/apis/common/internalPost.js +3 -1
  4. package/dist/cjs/apis/common/internalPost.js.map +1 -0
  5. package/{lib → dist/cjs}/apis/common/publicApis.js +3 -1
  6. package/dist/cjs/apis/common/publicApis.js.map +1 -0
  7. package/{lib → dist/cjs}/apis/index.js +3 -1
  8. package/dist/cjs/apis/index.js.map +1 -0
  9. package/{lib → dist/cjs}/apis/server.js +3 -1
  10. package/dist/cjs/apis/server.js.map +1 -0
  11. package/{lib → dist/cjs}/errors/CanceledError.js +3 -1
  12. package/dist/cjs/errors/CanceledError.js.map +1 -0
  13. package/{lib → dist/cjs}/errors/RestApiError.js +3 -1
  14. package/dist/cjs/errors/RestApiError.js.map +1 -0
  15. package/{lib → dist/cjs}/errors/assertValidatonError.js +3 -1
  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 +3 -1
  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 +3 -1
  24. package/dist/cjs/internals/index.js.map +1 -0
  25. package/{lib → dist/cjs}/internals/server.js +3 -1
  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/{lib → dist/cjs}/utils/createCancellableOperation.js +4 -2
  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 +3 -1
  38. package/dist/cjs/utils/logger.js.map +1 -0
  39. package/{lib → dist/cjs}/utils/normalizeHeaders.js +3 -1
  40. package/dist/cjs/utils/normalizeHeaders.js.map +1 -0
  41. package/{lib → dist/cjs}/utils/parseSigningInfo.js +3 -1
  42. package/dist/cjs/utils/parseSigningInfo.js.map +1 -0
  43. package/{lib → dist/cjs}/utils/resolveApiUrl.js +3 -1
  44. package/dist/cjs/utils/resolveApiUrl.js.map +1 -0
  45. package/{lib → dist/cjs}/utils/resolveCredentials.js +3 -1
  46. package/dist/cjs/utils/resolveCredentials.js.map +1 -0
  47. package/{lib → dist/cjs}/utils/serviceError.js +3 -1
  48. package/dist/cjs/utils/serviceError.js.map +1 -0
  49. package/{lib-esm/apis/common/handler.js → dist/esm/apis/common/handler.mjs} +13 -4
  50. package/dist/esm/apis/common/handler.mjs.map +1 -0
  51. package/{lib-esm/apis/common/internalPost.js → dist/esm/apis/common/internalPost.mjs} +13 -5
  52. package/dist/esm/apis/common/internalPost.mjs.map +1 -0
  53. package/{lib-esm/apis/common/publicApis.js → dist/esm/apis/common/publicApis.mjs} +18 -8
  54. package/dist/esm/apis/common/publicApis.mjs.map +1 -0
  55. package/{lib-esm/apis/index.js → dist/esm/apis/index.mjs} +12 -8
  56. package/dist/esm/apis/index.mjs.map +1 -0
  57. package/{lib-esm/apis/server.js → dist/esm/apis/server.mjs} +12 -8
  58. package/dist/esm/apis/server.mjs.map +1 -0
  59. package/{lib-esm/errors/CanceledError.js → dist/esm/errors/CanceledError.mjs} +7 -3
  60. package/dist/esm/errors/CanceledError.mjs.map +1 -0
  61. package/{lib-esm/errors/RestApiError.js → dist/esm/errors/RestApiError.mjs} +6 -2
  62. package/dist/esm/errors/RestApiError.mjs.map +1 -0
  63. package/{lib-esm/errors/assertValidatonError.js → dist/esm/errors/assertValidatonError.mjs} +7 -3
  64. package/dist/esm/errors/assertValidatonError.mjs.map +1 -0
  65. package/dist/esm/errors/index.mjs +5 -0
  66. package/dist/esm/errors/index.mjs.map +1 -0
  67. package/{lib-esm/errors/validation.js → dist/esm/errors/validation.mjs} +5 -2
  68. package/dist/esm/errors/validation.mjs.map +1 -0
  69. package/dist/esm/index.mjs +3 -0
  70. package/dist/esm/index.mjs.map +1 -0
  71. package/{lib-esm/internals/index.js → dist/esm/internals/index.mjs} +9 -5
  72. package/dist/esm/internals/index.mjs.map +1 -0
  73. package/{lib-esm/internals/server.js → dist/esm/internals/server.mjs} +9 -5
  74. package/dist/esm/internals/server.mjs.map +1 -0
  75. package/dist/esm/server.mjs +3 -0
  76. package/dist/esm/server.mjs.map +1 -0
  77. package/dist/esm/types/index.mjs +2 -0
  78. package/dist/esm/types/index.mjs.map +1 -0
  79. package/dist/esm/utils/constants.mjs +13 -0
  80. package/dist/esm/utils/constants.mjs.map +1 -0
  81. package/{lib-esm/utils/createCancellableOperation.js → dist/esm/utils/createCancellableOperation.mjs} +11 -5
  82. package/dist/esm/utils/createCancellableOperation.mjs.map +1 -0
  83. package/dist/esm/utils/index.mjs +7 -0
  84. package/dist/esm/utils/index.mjs.map +1 -0
  85. package/{lib-esm/utils/logger.js → dist/esm/utils/logger.mjs} +6 -2
  86. package/dist/esm/utils/logger.mjs.map +1 -0
  87. package/{lib-esm/utils/normalizeHeaders.js → dist/esm/utils/normalizeHeaders.mjs} +4 -1
  88. package/dist/esm/utils/normalizeHeaders.mjs.map +1 -0
  89. package/{lib-esm/utils/parseSigningInfo.js → dist/esm/utils/parseSigningInfo.mjs} +6 -2
  90. package/dist/esm/utils/parseSigningInfo.mjs.map +1 -0
  91. package/{lib-esm/utils/resolveApiUrl.js → dist/esm/utils/resolveApiUrl.mjs} +9 -3
  92. package/dist/esm/utils/resolveApiUrl.mjs.map +1 -0
  93. package/{lib → dist/esm}/utils/resolveCredentials.d.ts +1 -1
  94. package/{lib-esm/utils/resolveCredentials.js → dist/esm/utils/resolveCredentials.mjs} +8 -2
  95. package/dist/esm/utils/resolveCredentials.mjs.map +1 -0
  96. package/{lib-esm/utils/serviceError.js → dist/esm/utils/serviceError.mjs} +9 -4
  97. package/dist/esm/utils/serviceError.mjs.map +1 -0
  98. package/internals/package.json +4 -4
  99. package/internals/server/package.json +3 -4
  100. package/package.json +145 -113
  101. package/server/package.json +3 -4
  102. package/lib/apis/common/handler.d.ts +0 -27
  103. package/lib/apis/common/internalPost.d.ts +0 -16
  104. package/lib/apis/common/publicApis.d.ts +0 -8
  105. package/lib/apis/index.d.ts +0 -203
  106. package/lib/apis/server.d.ts +0 -151
  107. package/lib/errors/CanceledError.d.ts +0 -17
  108. package/lib/errors/RestApiError.d.ts +0 -4
  109. package/lib/errors/assertValidatonError.d.ts +0 -5
  110. package/lib/errors/index.d.ts +0 -4
  111. package/lib/errors/validation.d.ts +0 -6
  112. package/lib/index.d.ts +0 -2
  113. package/lib/internals/index.d.ts +0 -19
  114. package/lib/internals/server.d.ts +0 -20
  115. package/lib/server.d.ts +0 -2
  116. package/lib/tsconfig.tsbuildinfo +0 -1
  117. package/lib/types/index.d.ts +0 -103
  118. package/lib/utils/constants.d.ts +0 -8
  119. package/lib/utils/createCancellableOperation.d.ts +0 -12
  120. package/lib/utils/index.d.ts +0 -6
  121. package/lib/utils/logger.d.ts +0 -2
  122. package/lib/utils/normalizeHeaders.d.ts +0 -1
  123. package/lib/utils/parseSigningInfo.d.ts +0 -14
  124. package/lib/utils/resolveApiUrl.d.ts +0 -12
  125. package/lib/utils/serviceError.d.ts +0 -10
  126. package/lib-esm/errors/index.js +0 -6
  127. package/lib-esm/index.js +0 -4
  128. package/lib-esm/server.js +0 -4
  129. package/lib-esm/tsconfig.tsbuildinfo +0 -1
  130. package/lib-esm/types/index.js +0 -1
  131. package/lib-esm/utils/constants.js +0 -10
  132. package/lib-esm/utils/index.js +0 -8
  133. package/lib-esm/utils/resolveCredentials.d.ts +0 -5
  134. /package/{lib-esm → dist/esm}/apis/common/handler.d.ts +0 -0
  135. /package/{lib-esm → dist/esm}/apis/common/internalPost.d.ts +0 -0
  136. /package/{lib-esm → dist/esm}/apis/common/publicApis.d.ts +0 -0
  137. /package/{lib-esm → dist/esm}/apis/index.d.ts +0 -0
  138. /package/{lib-esm → dist/esm}/apis/server.d.ts +0 -0
  139. /package/{lib-esm → dist/esm}/errors/CanceledError.d.ts +0 -0
  140. /package/{lib-esm → dist/esm}/errors/RestApiError.d.ts +0 -0
  141. /package/{lib-esm → dist/esm}/errors/assertValidatonError.d.ts +0 -0
  142. /package/{lib-esm → dist/esm}/errors/index.d.ts +0 -0
  143. /package/{lib-esm → dist/esm}/errors/validation.d.ts +0 -0
  144. /package/{lib-esm → dist/esm}/index.d.ts +0 -0
  145. /package/{lib-esm → dist/esm}/internals/index.d.ts +0 -0
  146. /package/{lib-esm → dist/esm}/internals/server.d.ts +0 -0
  147. /package/{lib-esm → dist/esm}/server.d.ts +0 -0
  148. /package/{lib-esm → dist/esm}/types/index.d.ts +0 -0
  149. /package/{lib-esm → dist/esm}/utils/constants.d.ts +0 -0
  150. /package/{lib-esm → dist/esm}/utils/createCancellableOperation.d.ts +0 -0
  151. /package/{lib-esm → dist/esm}/utils/index.d.ts +0 -0
  152. /package/{lib-esm → dist/esm}/utils/logger.d.ts +0 -0
  153. /package/{lib-esm → dist/esm}/utils/normalizeHeaders.d.ts +0 -0
  154. /package/{lib-esm → dist/esm}/utils/parseSigningInfo.d.ts +0 -0
  155. /package/{lib-esm → dist/esm}/utils/resolveApiUrl.d.ts +0 -0
  156. /package/{lib-esm → dist/esm}/utils/serviceError.d.ts +0 -0
@@ -1,4 +1,5 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.transferHandler = void 0;
4
5
  const aws_client_utils_1 = require("@aws-amplify/core/internals/aws-client-utils");
@@ -71,3 +72,4 @@ const transferHandler = async (amplify, options, signingServiceInfo) => {
71
72
  };
72
73
  exports.transferHandler = transferHandler;
73
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,CAAC,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG,OAAO,OAAO,EAAE,OAAO,EAAE,kBAAkB,KAAK;AACxE,IAAI,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;AACjF,IAAI,MAAM,YAAY,GAAG,IAAI;AAC7B,UAAU,IAAI,YAAY,QAAQ;AAClC,cAAc,IAAI;AAClB,cAAc,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC;AACxC,UAAU,SAAS,CAAC;AACpB,IAAI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WAAW;AAC1B,YAAY,WAAW;AACvB,YAAY,MAAM,EAAE,aAAa;AACjC,YAAY,OAAO,EAAE,cAAc;AACnC,SAAS,CAAC,CAAC;AACX,KAAK;AACL,SAAS;AACT,QAAQ,QAAQ,GAAG,MAAM,IAAI,kBAAkB,CAAC,sBAAsB,EAAE,OAAO,EAAE;AACjF,YAAY,GAAG,WAAW;AAC1B,SAAS,CAAC,CAAC;AACX,KAAK;AACL;AACA,IAAI,OAAO;AACX,QAAQ,UAAU,EAAE,QAAQ,CAAC,UAAU;AACvC,QAAQ,OAAO,EAAE,QAAQ,CAAC,OAAO;AACjC,QAAQ,IAAI,EAAE,QAAQ,CAAC,IAAI;AAC3B,KAAK,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC;AAC1C,MAAM,iBAAiB,GAAG,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,KAAK,CAAC,OAAO,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,kBAAkB;;"}
@@ -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 });
@@ -63,3 +64,4 @@ 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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AC,CAAC;AACnD,IAAI,IAAI,UAAU,EAAE;AACpB,QAAQ,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAClC,QAAQ,IAAI,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE;AAC7D;AACA;AACA,YAAY,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC;AAClD,SAAS;AACT,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AACF,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;AACxB;AACA;AACA;AACA,MAAM,4BAA4B,GAAG,CAAC,OAAO,EAAE,UAAU,KAAK;AAC9D,IAAI,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC5C,CAAC,CAAC;AACF,OAAO,CAAC,4BAA4B,GAAG,4BAA4B;;"}
@@ -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 });
@@ -42,3 +43,4 @@ const head = (amplify, input) => publicHandler(amplify, input, 'HEAD');
42
43
  exports.head = head;
43
44
  const patch = (amplify, input) => publicHandler(amplify, input, 'PATCH');
44
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,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,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACvC,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACvC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,EA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AO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACrE,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClB,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACvE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACrE,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClB,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACxE,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClB,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACvE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACzE,OAAO,CAAC,KAAK,GAAG,KAAK;;"}
@@ -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 });
@@ -213,3 +214,4 @@ exports.head = head;
213
214
  */
214
215
  const patch = (input) => (0, publicApis_1.patch)(core_1.Amplify, input);
215
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,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 });
@@ -160,3 +161,4 @@ exports.head = head;
160
161
  */
161
162
  const patch = (contextSpec, input) => (0, publicApis_1.patch)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);
162
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;AACA;AACA;AACA,MAAM,GAAG,GAAG,CAAC,WAAW,EAAE,KAAK,KAAK,IAAI,YAAY,CAAC,GAAG,EAAE,IAAI,cAAc,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACnI,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,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,GAAG,GAAG,CAAC,WAAW,EAAE,KAAK,KAAK,IAAI,YAAY,CAAC,GAAG,EAAE,IAAI,cAAc,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACnI,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,MAAM,GAAG,GAAG,CAAC,WAAW,EAAE,KAAK,KAAK,IAAI,YAAY,CAAC,GAAG,EAAE,IAAI,cAAc,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACnI,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,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,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 });
@@ -30,3 +31,4 @@ exports.CanceledError = CanceledError;
30
31
  */
31
32
  const isCancelError = (error) => !!error && error instanceof CanceledError;
32
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;;"}
@@ -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 @@ class RestApiError extends utils_1.AmplifyError {
13
14
  }
14
15
  }
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,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 });
@@ -15,3 +16,4 @@ function assertValidationError(assertion, name) {
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,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 });
@@ -17,3 +18,4 @@ exports.validationErrorMap = {
17
18
  recoverySuggestion: 'Check if the API name matches the one in your configuration or `aws-exports.js`',
18
19
  },
19
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, get: function () { return apis_1.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,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AACvH,IAAI,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACxD,M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
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;
4
5
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -28,3 +29,4 @@ exports.post = post;
28
29
  var internalPost_2 = require("../apis/common/internalPost");
29
30
  Object.defineProperty(exports, "cancel", { enumerable: true, get: function () { return internalPost_2.cancel; } });
30
31
  Object.defineProperty(exports, "updateRequestToBeCancellable", { enumerable: true, get: function () { return internalPost_2.updateRequestToBeCancellable; } });
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/internals/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst core_1 = require(\"@aws-amplify/core\");\nconst internalPost_1 = require(\"../apis/common/internalPost\");\n/**\n * Internal-only REST POST handler to send GraphQL request to given endpoint. By default, it will use IAM to authorize\n * the request. In some auth modes, the IAM auth has to be disabled. Here's how to set up the request auth correctly:\n * * If auth mode is 'iam', you MUST NOT set 'authorization' header and 'x-api-key' header, since it would disable IAM\n * auth. You MUST also set 'input.options.signingServiceInfo' option.\n * * The including 'input.options.signingServiceInfo.service' and 'input.options.signingServiceInfo.region' are\n * optional. If omitted, the signing service and region will be inferred from url.\n * * If auth mode is 'none', you MUST NOT set 'options.signingServiceInfo' option.\n * * If auth mode is 'apiKey', you MUST set 'x-api-key' custom header.\n * * If auth mode is 'oidc' or 'lambda' or 'userPool', you MUST set 'authorization' header.\n *\n * To make the internal post cancellable, you must also call `updateRequestToBeCancellable()` with the promise from\n * internal post call and the abort controller supplied to the internal post call.\n *\n * @internal\n */\nconst post = (input) => {\n return (0, internalPost_1.post)(core_1.Amplify, input);\n};\nexports.post = post;\nvar internalPost_2 = require(\"../apis/common/internalPost\");\nObject.defineProperty(exports, \"cancel\", { enumerable: true, get: function () { return internalPost_2.cancel; } });\nObject.defineProperty(exports, \"updateRequestToBeCancellable\", { enumerable: true, get: function () { return internalPost_2.updateRequestToBeCancellable; } });\n"],"names":[],"mappings":";;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;AACA;AACA,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI,GAAG,CAAC,KAAK,KAAK;AACxB,IAAI,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC,CAAC;AACF,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB,IAAI,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC5D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AACnH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,4BAA4B,CAAC,EAAE,EAAE,CAAC;;"}
@@ -1,4 +1,5 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;
4
5
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -28,3 +29,4 @@ exports.post = post;
28
29
  var internalPost_2 = require("../apis/common/internalPost");
29
30
  Object.defineProperty(exports, "cancel", { enumerable: true, get: function () { return internalPost_2.cancel; } });
30
31
  Object.defineProperty(exports, "updateRequestToBeCancellable", { enumerable: true, get: function () { return internalPost_2.updateRequestToBeCancellable; } });
32
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sources":["../../../src/internals/server.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst adapter_core_1 = require(\"@aws-amplify/core/internals/adapter-core\");\nconst internalPost_1 = require(\"../apis/common/internalPost\");\n/**\n * Internal-only REST POST handler to send GraphQL request to given endpoint. By default, it will use IAM to authorize\n * the request. In some auth modes, the IAM auth has to be disabled. Here's how to set up the request auth correctly:\n * * If auth mode is 'iam', you MUST NOT set 'authorization' header and 'x-api-key' header, since it would disable IAM\n * auth. You MUST also set 'input.options.signingServiceInfo' option.\n * * The including 'input.options.signingServiceInfo.service' and 'input.options.signingServiceInfo.region' are\n * optional. If omitted, the signing service and region will be inferred from url.\n * * If auth mode is 'none', you MUST NOT set 'options.signingServiceInfo' option.\n * * If auth mode is 'apiKey', you MUST set 'x-api-key' custom header.\n * * If auth mode is 'oidc' or 'lambda' or 'userPool', you MUST set 'authorization' header.\n *\n * To make the internal post cancellable, you must also call `updateRequestToBeCancellable()` with the promise from\n * internal post call and the abort controller supplied to the internal post call.\n *\n * @internal\n */\nconst post = (contextSpec, input) => {\n return (0, internalPost_1.post)((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify, input);\n};\nexports.post = post;\nvar internalPost_2 = require(\"../apis/common/internalPost\");\nObject.defineProperty(exports, \"cancel\", { enumerable: true, get: function () { return internalPost_2.cancel; } });\nObject.defineProperty(exports, \"updateRequestToBeCancellable\", { enumerable: true, get: function () { return internalPost_2.updateRequestToBeCancellable; } });\n"],"names":[],"mappings":";;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;AACA;AACA,MAAM,cAAc,GAAG,OAAO,CAAC,0CAA0C,CAAC,CAAC;AAC3E,MAAM,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,KAAK;AACrC,IAAI,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,cAAc,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7G,CAAC,CAAC;AACF,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB,IAAI,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC5D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AACnH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,4BAA4B,CAAC,EAAE,EAAE,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 server_1.del; } });
13
14
  Object.defineProperty(exports, "head", { enumerable: true, get: function () { return server_1.head; } });
14
15
  Object.defineProperty(exports, "patch", { enumerable: true, get: function () { return server_1.patch; } });
16
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sources":["../../src/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 = exports.isCancelError = void 0;\nvar CanceledError_1 = require(\"./errors/CanceledError\");\nObject.defineProperty(exports, \"isCancelError\", { enumerable: true, get: function () { return CanceledError_1.isCancelError; } });\nvar server_1 = require(\"./apis/server\");\nObject.defineProperty(exports, \"get\", { enumerable: true, get: function () { return server_1.get; } });\nObject.defineProperty(exports, \"post\", { enumerable: true, get: function () { return server_1.post; } });\nObject.defineProperty(exports, \"put\", { enumerable: true, get: function () { return server_1.put; } });\nObject.defineProperty(exports, \"del\", { enumerable: true, get: function () { return server_1.del; } });\nObject.defineProperty(exports, \"head\", { enumerable: true, get: function () { return server_1.head; } });\nObject.defineProperty(exports, \"patch\", { enumerable: true, get: function () { return server_1.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,C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AO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;;"}
@@ -1,2 +1,4 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/types/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,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 });
@@ -11,3 +12,4 @@ exports.DEFAULT_IAM_SIGNING_REGION = 'us-east-1';
11
12
  * @see {@link https://docs.aws.amazon.com/general/latest/gr/apigateway.html#apigateway_region_data_plane}
12
13
  */
13
14
  exports.APIG_HOSTNAME_PATTERN = /^.+\.([a-z0-9-]+)\.([a-z0-9-]+)\.amazonaws\.com/;
15
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../src/utils/constants.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.APIG_HOSTNAME_PATTERN = exports.DEFAULT_IAM_SIGNING_REGION = exports.DEFAULT_APPSYNC_API_SERVICE = exports.DEFAULT_REST_IAM_SIGNING_SERVICE = void 0;\nexports.DEFAULT_REST_IAM_SIGNING_SERVICE = 'execute-api';\nexports.DEFAULT_APPSYNC_API_SERVICE = 'appsync-api';\nexports.DEFAULT_IAM_SIGNING_REGION = 'us-east-1';\n/**\n * The REST endpoints generated by API Gateway\n * @see {@link https://docs.aws.amazon.com/general/latest/gr/apigateway.html#apigateway_region_data_plane}\n */\nexports.APIG_HOSTNAME_PATTERN = /^.+\\.([a-z0-9-]+)\\.([a-z0-9-]+)\\.amazonaws\\.com/;\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,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC,gCAAgC,GAAG,KAAK,CAAC,CAAC;AAC7J,OAAO,CAAC,gCAAgC,GAAG,aAAa,CAAC;AACzD,OAAO,CAAC,2BAA2B,GAAG,aAAa,CAAC;AACpD,OAAO,CAAC,0BAA0B,GAAG,WAAW,CAAC;AACjD;AACA;AACA;AACA;AACA,OAAO,CAAC,qBAAqB,GAAG,iDAAiD;;"}
@@ -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 });
@@ -41,7 +42,7 @@ function createCancellableOperation(handler, abortController) {
41
42
  throw error;
42
43
  }
43
44
  };
44
- if (isInternalPost(handler)) {
45
+ if (isInternalPost()) {
45
46
  return job();
46
47
  }
47
48
  else {
@@ -61,3 +62,4 @@ function createCancellableOperation(handler, abortController) {
61
62
  }
62
63
  }
63
64
  exports.createCancellableOperation = createCancellableOperation;
65
+ //# sourceMappingURL=createCancellableOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCancellableOperation.js","sources":["../../../src/utils/createCancellableOperation.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.createCancellableOperation = void 0;\nconst errors_1 = require(\"../errors\");\nconst serviceError_1 = require(\"./serviceError\");\nconst logger_1 = require(\"./logger\");\n/**\n * @internal\n */\nfunction createCancellableOperation(handler, abortController) {\n const isInternalPost = (handler) => !!abortController;\n // For creating a cancellable operation for public REST APIs, we need to create an AbortController\n // internally. Whereas for internal POST APIs, we need to accept in the AbortController from the\n // callers.\n const publicApisAbortController = new AbortController();\n const publicApisAbortSignal = publicApisAbortController.signal;\n const internalPostAbortSignal = abortController?.signal;\n const job = async () => {\n try {\n const response = await (isInternalPost(handler)\n ? handler()\n : handler(publicApisAbortSignal));\n if (response.statusCode >= 300) {\n throw await (0, serviceError_1.parseRestApiServiceError)(response);\n }\n return response;\n }\n catch (error) {\n const abortSignal = internalPostAbortSignal ?? publicApisAbortSignal;\n if (error.name === 'AbortError' || abortSignal?.aborted === true) {\n const canceledError = new errors_1.CanceledError({\n ...(abortSignal.reason ? { message: abortSignal.reason } : undefined),\n underlyingError: error,\n });\n logger_1.logger.debug(error);\n throw canceledError;\n }\n logger_1.logger.debug(error);\n throw error;\n }\n };\n if (isInternalPost(handler)) {\n return job();\n }\n else {\n const cancel = (abortMessage) => {\n if (publicApisAbortSignal.aborted === true) {\n return;\n }\n publicApisAbortController.abort(abortMessage);\n // Abort reason is not widely support enough across runtimes and and browsers, so we set it\n // if it is not already set.\n if (abortMessage && publicApisAbortSignal.reason !== abortMessage) {\n publicApisAbortSignal['reason'] =\n abortMessage;\n }\n };\n return { response: job(), cancel };\n }\n}\nexports.createCancellableOperation = createCancellableOperation;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,0BAA0B,GAAG,KAAK,CAAC,CAAC;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AG,SAAS,CAAC;AACzF,oBAAoB,eAAe,EAAE,KAAK;AAC1C,iBAAiB,CAAC,CAAC;AACnB,gBAAgB,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7C,gBAAgB,MAAM,aAAa,CAAC;AACpC,aAAa;AACb,YAAY,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACzC,YAAY,MAAM,KAAK,CAAC;AACxB,SAAS;AACT,KAAK,CAAC;AACN,IAAI,IAAI,cAAc,CAAQ,CAAC,EAAE;AACjC,QAAQ,OAAO,GAAG,EAAE,CAAC;AACrB,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,MAAM,GAAG,CAAC,YAAY,KAAK;AACzC,YAAY,IAAI,qBAAqB,CAAC,OAAO,KAAK,IAAI,EAAE;AACxD,gBAAgB,OAAO;AACvB,aAAa;AACb,YAAY,yBAAyB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAC1D;AACA;AACA,YAAY,IAAI,YAAY,IAAI,qBAAqB,CAAC,MAAM,KAAK,YAAY,EAAE;AAC/E,gBAAgB,qBAAqB,CAAC,QAAQ,CAAC;AAC/C,oBAAoB,YAAY,CAAC;AACjC,aAAa;AACb,SAAS,CAAC;AACV,QAAQ,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC;AAC3C,KAAK;AACL,CAAC;AACD,OAAO,CAAC,0BAA0B,GAAG,0BAA0B;;"}
@@ -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 });
@@ -15,3 +16,4 @@ var resolveApiUrl_1 = require("./resolveApiUrl");
15
16
  Object.defineProperty(exports, "resolveApiUrl", { enumerable: true, get: function () { return resolveApiUrl_1.resolveApiUrl; } });
16
17
  var logger_1 = require("./logger");
17
18
  Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/utils/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.logger = exports.resolveApiUrl = exports.parseRestApiServiceError = exports.parseSigningInfo = exports.resolveCredentials = exports.createCancellableOperation = void 0;\nvar createCancellableOperation_1 = require(\"./createCancellableOperation\");\nObject.defineProperty(exports, \"createCancellableOperation\", { enumerable: true, get: function () { return createCancellableOperation_1.createCancellableOperation; } });\nvar resolveCredentials_1 = require(\"./resolveCredentials\");\nObject.defineProperty(exports, \"resolveCredentials\", { enumerable: true, get: function () { return resolveCredentials_1.resolveCredentials; } });\nvar parseSigningInfo_1 = require(\"./parseSigningInfo\");\nObject.defineProperty(exports, \"parseSigningInfo\", { enumerable: true, get: function () { return parseSigningInfo_1.parseSigningInfo; } });\nvar serviceError_1 = require(\"./serviceError\");\nObject.defineProperty(exports, \"parseRestApiServiceError\", { enumerable: true, get: function () { return serviceError_1.parseRestApiServiceError; } });\nvar resolveApiUrl_1 = require(\"./resolveApiUrl\");\nObject.defineProperty(exports, \"resolveApiUrl\", { enumerable: true, get: function () { return resolveApiUrl_1.resolveApiUrl; } });\nvar logger_1 = require(\"./logger\");\nObject.defineProperty(exports, \"logger\", { enumerable: true, get: function () { return logger_1.logger; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,G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C,CAAC;AACnC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;;"}
@@ -1,7 +1,9 @@
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.logger = void 0;
6
7
  const core_1 = require("@aws-amplify/core");
7
8
  exports.logger = new core_1.ConsoleLogger('RestApis');
9
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sources":["../../../src/utils/logger.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.logger = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nexports.logger = new core_1.ConsoleLogger('RestApis');\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;AACxB,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,OAAO,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,UAAU,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 });
@@ -11,3 +12,4 @@ const normalizeHeaders = (headers) => {
11
12
  return normalizedHeaders;
12
13
  };
13
14
  exports.normalizeHeaders = normalizeHeaders;
15
+ //# sourceMappingURL=normalizeHeaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeHeaders.js","sources":["../../../src/utils/normalizeHeaders.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.normalizeHeaders = void 0;\nconst normalizeHeaders = (headers) => {\n const normalizedHeaders = {};\n for (const key in headers) {\n normalizedHeaders[key.toLowerCase()] = headers[key];\n }\n return normalizedHeaders;\n};\nexports.normalizeHeaders = normalizeHeaders;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AAClC,MAAM,gBAAgB,GAAG,CAAC,OAAO,KAAK;AACtC,IAAI,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACjC,IAAI,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;AAC/B,QAAQ,iBAAiB,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;AAC5D,KAAK;AACL,IAAI,OAAO,iBAAiB,CAAC;AAC7B,CAAC,CAAC;AACF,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
@@ -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 });
@@ -39,3 +40,4 @@ const parseSigningInfo = (url, restApiOptions) => {
39
40
  }
40
41
  };
41
42
  exports.parseSigningInfo = parseSigningInfo;
43
+ //# sourceMappingURL=parseSigningInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseSigningInfo.js","sources":["../../../src/utils/parseSigningInfo.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.parseSigningInfo = void 0;\nconst constants_1 = require(\"./constants\");\n/**\n * Infer the signing service and region from the given URL, and for REST API only, from the Amplify configuration.\n * It supports raw API Gateway endpoint and AppSync endpoint.\n *\n * @internal\n */\nconst parseSigningInfo = (url, restApiOptions) => {\n const { service: signingService = constants_1.DEFAULT_REST_IAM_SIGNING_SERVICE, region: signingRegion = constants_1.DEFAULT_IAM_SIGNING_REGION, } = restApiOptions?.amplify.getConfig()?.API?.REST?.[restApiOptions?.apiName] ??\n {};\n const { hostname } = url;\n const [, service, region] = constants_1.APIG_HOSTNAME_PATTERN.exec(hostname) ?? [];\n if (service === constants_1.DEFAULT_REST_IAM_SIGNING_SERVICE) {\n // The configured endpoint is an API Gateway endpoint\n // @see: https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-call-api.html\n return {\n service,\n region: region ?? signingRegion,\n };\n }\n else if (service === 'appsync-api') {\n // AppSync endpoint is internally supported because GraphQL operation will send request using POST handler.\n // example: https://xxxx.appsync-api.us-east-1.amazonaws.com/graphql\n return {\n service: 'appsync',\n region: region ?? signingRegion,\n };\n }\n else {\n return {\n service: signingService,\n region: signingRegion,\n };\n }\n};\nexports.parseSigningInfo = parseSigningInfo;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AAClC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,cAAc,KAAK;AAClD,IAAI,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,WAAW,CAAC,gCAAgC,EAAE,MAAM,EAAE,aAAa,GAAG,WAAW,CAAC,0BAA0B,GAAG,GAAG,cAAc,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,IAAI,GAAG,cAAc,EAAE,OAAO,CAAC;AACjO,QAAQ,EAAE,CAAC;AACX,IAAI,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;AAC7B,IAAI,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AACvF,IAAI,IAAI,OAAO,KAAK,WAAW,CAAC,gCAAgC,EAAE;AAClE;AACA;AACA,QAAQ,OAAO;AACf,YAAY,OAAO;AACnB,YAAY,MAAM,EAAE,MAAM,IAAI,aAAa;AAC3C,SAAS,CAAC;AACV,KAAK;AACL,SAAS,IAAI,OAAO,KAAK,aAAa,EAAE;AACxC;AACA;AACA,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,SAAS;AAC9B,YAAY,MAAM,EAAE,MAAM,IAAI,aAAa;AAC3C,SAAS,CAAC;AACV,KAAK;AACL,SAAS;AACT,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,cAAc;AACnC,YAAY,MAAM,EAAE,aAAa;AACjC,SAAS,CAAC;AACV,KAAK;AACL,CAAC,CAAC;AACF,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
@@ -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 });
@@ -38,3 +39,4 @@ const resolveApiUrl = (amplify, apiName, path, queryParams) => {
38
39
  }
39
40
  };
40
41
  exports.resolveApiUrl = resolveApiUrl;
42
+ //# sourceMappingURL=resolveApiUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveApiUrl.js","sources":["../../../src/utils/resolveApiUrl.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.resolveApiUrl = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst errors_1 = require(\"../errors\");\n/**\n * Resolve the REST API request URL by:\n * 1. Loading the REST API endpoint from the Amplify configuration with corresponding API name.\n * 2. Appending the path to the endpoint.\n * 3. Merge the query parameters from path and the queryParameter argument which is taken from the public REST API\n * options.\n * 4. Validating the resulting URL string.\n *\n * @internal\n */\nconst resolveApiUrl = (amplify, apiName, path, queryParams) => {\n const urlStr = amplify.getConfig()?.API?.REST?.[apiName]?.endpoint;\n (0, errors_1.assertValidationError)(!!urlStr, errors_1.RestApiValidationErrorCode.InvalidApiName);\n try {\n const url = new utils_1.AmplifyUrl(urlStr + path);\n if (queryParams) {\n const mergedQueryParams = new utils_1.AmplifyUrlSearchParams(url.searchParams);\n Object.entries(queryParams).forEach(([key, value]) => {\n mergedQueryParams.set(key, value);\n });\n url.search = new utils_1.AmplifyUrlSearchParams(mergedQueryParams).toString();\n }\n return url;\n }\n catch (error) {\n throw new errors_1.RestApiError({\n name: errors_1.RestApiValidationErrorCode.InvalidApiName,\n ...errors_1.validationErrorMap[errors_1.RestApiValidationErrorCode.InvalidApiName],\n recoverySuggestion: `Please make sure the REST endpoint URL is a valid URL string. Got ${urlStr}`,\n });\n }\n};\nexports.resolveApiUrl = resolveApiUrl;\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,KAAK,CAAC,CAAC;AAC/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,CAAC,kBAAkB,CAAC,QAAQ,CAAC,0BAA0B,CAAC,cAAc,CAAC;AAC9F,YAAY,kBAAkB,EAAE,CAAC,kEAAkE,EAAE,MAAM,CAAC,CAAC;AAC7G,SAAS,CAAC,CAAC;AACX,KAAK;AACL,CAAC,CAAC;AACF,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
@@ -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 @@ const resolveCredentials = async (amplify) => {
13
14
  return credentials;
14
15
  };
15
16
  exports.resolveCredentials = resolveCredentials;
17
+ //# sourceMappingURL=resolveCredentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveCredentials.js","sources":["../../../src/utils/resolveCredentials.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.resolveCredentials = void 0;\nconst errors_1 = require(\"../errors\");\n/**\n * @internal\n */\nconst resolveCredentials = async (amplify) => {\n const { credentials } = await amplify.Auth.fetchAuthSession();\n (0, errors_1.assertValidationError)(!!credentials && !!credentials.accessKeyId && !!credentials.secretAccessKey, errors_1.RestApiValidationErrorCode.NoCredentials);\n return credentials;\n};\nexports.resolveCredentials = resolveCredentials;\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,KAAK,CAAC,CAAC;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,OAAO,OAAO,KAAK;AAC9C,IAAI,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;AAClE,IAAI,IAAI,QAAQ,CAAC,qBAAqB,EAAE,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,CAAC,eAAe,EAAE,QAAQ,CAAC,0BAA0B,CAAC,aAAa,CAAC,CAAC;AACxK,IAAI,OAAO,WAAW,CAAC;AACvB,CAAC,CAAC;AACF,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
@@ -1,4 +1,5 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.parseRestApiServiceError = exports.buildRestApiServiceError = void 0;
4
5
  const aws_client_utils_1 = require("@aws-amplify/core/internals/aws-client-utils");
@@ -28,3 +29,4 @@ const parseRestApiServiceError = async (response) => {
28
29
  });
29
30
  };
30
31
  exports.parseRestApiServiceError = parseRestApiServiceError;
32
+ //# sourceMappingURL=serviceError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceError.js","sources":["../../../src/utils/serviceError.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseRestApiServiceError = exports.buildRestApiServiceError = void 0;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst errors_1 = require(\"../errors\");\n/**\n * Internal-only method to create a new RestApiError from a service error.\n *\n * @internal\n */\nconst buildRestApiServiceError = (error) => {\n const restApiError = new errors_1.RestApiError({\n name: error?.name,\n message: error.message,\n underlyingError: error,\n });\n return restApiError;\n};\nexports.buildRestApiServiceError = buildRestApiServiceError;\nconst parseRestApiServiceError = async (response) => {\n const parsedError = await (0, aws_client_utils_1.parseJsonError)(response);\n if (!parsedError) {\n // Response is not an error.\n return;\n }\n return Object.assign((0, exports.buildRestApiServiceError)(parsedError), {\n $metadata: parsedError.$metadata,\n });\n};\nexports.parseRestApiServiceError = parseRestApiServiceError;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,GAAG,KAAK,CAAC,CAAC;AAC7E,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC,CAAC;AACnF,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC;AACA;AACA;AACA;AACA;AACA,MAAM,wBAAwB,GAAG,CAAC,KAAK,KAAK;AAC5C,IAAI,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,YAAY,CAAC;AACnD,QAAQ,IAAI,EAAE,KAAK,EAAE,IAAI;AACzB,QAAQ,OAAO,EAAE,KAAK,CAAC,OAAO;AAC9B,QAAQ,eAAe,EAAE,KAAK;AAC9B,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,YAAY,CAAC;AACxB,CAAC,CAAC;AACF,OAAO,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;AAC5D,MAAM,wBAAwB,GAAG,OAAO,QAAQ,KAAK;AACrD,IAAI,MAAM,WAAW,GAAG,MAAM,IAAI,kBAAkB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC/E,IAAI,IAAI,CAAC,WAAW,EAAE;AACtB;AACA,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,wBAAwB,EAAE,WAAW,CAAC,EAAE;AAC7E,QAAQ,SAAS,EAAE,WAAW,CAAC,SAAS;AACxC,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,OAAO,CAAC,wBAAwB,GAAG,wBAAwB;;"}
@@ -1,6 +1,12 @@
1
- import { unauthenticatedHandler, getRetryDecider, jitteredBackoff, authenticatedHandler, } from '@aws-amplify/core/internals/aws-client-utils';
2
- import { parseRestApiServiceError, parseSigningInfo, resolveCredentials, } from '../../utils';
3
- import { normalizeHeaders } from '../../utils/normalizeHeaders';
1
+ import { getRetryDecider, jitteredBackoff, authenticatedHandler, unauthenticatedHandler } from '@aws-amplify/core/internals/aws-client-utils';
2
+ import '@aws-amplify/core/internals/utils';
3
+ import '../../errors/validation.mjs';
4
+ import { parseRestApiServiceError } from '../../utils/serviceError.mjs';
5
+ import '../../utils/logger.mjs';
6
+ import { resolveCredentials } from '../../utils/resolveCredentials.mjs';
7
+ import { parseSigningInfo } from '../../utils/parseSigningInfo.mjs';
8
+ import { normalizeHeaders } from '../../utils/normalizeHeaders.mjs';
9
+
4
10
  /**
5
11
  * Make REST API call with best-effort IAM auth.
6
12
  * @param amplify Amplify instance to to resolve credentials and tokens. Should use different instance in client-side
@@ -11,7 +17,7 @@ import { normalizeHeaders } from '../../utils/normalizeHeaders';
11
17
  *
12
18
  * @internal
13
19
  */
14
- export const transferHandler = async (amplify, options, signingServiceInfo) => {
20
+ const transferHandler = async (amplify, options, signingServiceInfo) => {
15
21
  const { url, method, headers, body, withCredentials, abortSignal } = options;
16
22
  const resolvedBody = body
17
23
  ? body instanceof FormData
@@ -67,3 +73,6 @@ export const transferHandler = async (amplify, options, signingServiceInfo) => {
67
73
  };
68
74
  };
69
75
  const iamAuthApplicable = ({ headers }, signingServiceInfo) => !headers.authorization && !headers['x-api-key'] && !!signingServiceInfo;
76
+
77
+ export { transferHandler };
78
+ //# sourceMappingURL=handler.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.mjs","sources":["../../../../src/apis/common/handler.ts"],"sourcesContent":["import { unauthenticatedHandler, getRetryDecider, jitteredBackoff, authenticatedHandler, } from '@aws-amplify/core/internals/aws-client-utils';\nimport { parseRestApiServiceError, parseSigningInfo, resolveCredentials, } from '../../utils';\nimport { normalizeHeaders } from '../../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 */\nexport const 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 ...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: getRetryDecider(parseRestApiServiceError),\n computeDelay: jitteredBackoff,\n withCrossDomainCredentials: withCredentials,\n abortSignal,\n };\n const isIamAuthApplicable = iamAuthApplicable(request, signingServiceInfo);\n let response;\n if (isIamAuthApplicable) {\n const signingInfoFromUrl = parseSigningInfo(url);\n const signingService = signingServiceInfo?.service ?? signingInfoFromUrl.service;\n const signingRegion = signingServiceInfo?.region ?? signingInfoFromUrl.region;\n const credentials = await resolveCredentials(amplify);\n response = await authenticatedHandler(request, {\n ...baseOptions,\n credentials,\n region: signingRegion,\n service: signingService,\n });\n }\n else {\n response = await 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};\nconst iamAuthApplicable = ({ headers }, signingServiceInfo) => !headers.authorization && !headers['x-api-key'] && !!signingServiceInfo;\n"],"names":[],"mappings":";;;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,eAAe,GAAG,OAAO,OAAO,EAAE,OAAO,EAAE,kBAAkB,KAAK;AAC/E,IAAI,MAAM,EAAE,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