@aws-amplify/api-rest 4.1.9-unstable.e5a8569.0 → 4.2.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.
@@ -1 +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 utils_1 = require(\"../../utils\");\nconst isIamAuthApplicable_1 = require(\"../../utils/isIamAuthApplicable\");\nconst transferHandler_1 = require(\"./transferHandler\");\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 *\n * 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 * @param amplify the AmplifyClassV6 instance - it may be the singleton used on Web, or an instance created within\n * a context created by `runWithAmplifyServerContext`\n * @param postInput an object of {@link InternalPostInput}\n * @param postInput.url The URL that the POST request sends to\n * @param postInput.options Options of the POST request\n * @param postInput.abortController The abort controller used to cancel the POST request\n * @returns a {@link RestApiResponse}\n *\n * @throws an {@link AmplifyError} with `Network Error` as the `message` when the external resource is unreachable due to one\n * of the following reasons:\n * 1. no network connection\n * 2. CORS error\n * @throws a {@link CanceledError} when the ongoing POST request get cancelled\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, transferHandler_1.transferHandler)(amplify, {\n url,\n method: 'POST',\n ...options,\n abortSignal: controller.signal,\n retryStrategy: {\n strategy: 'jittered-exponential-backoff',\n },\n }, isIamAuthApplicable_1.isIamAuthApplicableForGraphQL, 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,MAA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AAC,MAAM;AAC9D,QAAQ,cAAc,CAAC,MAAM,CAAC,mBAAmB,CAAC;AAClD,KAAK,CAAC;AACN,IAAI,OAAO,mBAAmB;AAC9B,CAAC;AACD,OAAO,CAAC,IAAI,GAAG,IAAI;AACnB;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK;AACrC,IAAI,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC;AAClD,IAAI,IAAI,UAAU,EAAE;AACpB,QAAQ,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC;AACjC,QAAQ,IAAI,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE;AAC7D;AACA;AACA,YAAY,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO;AAC9C;AACA,QAAQ,OAAO,IAAI;AACnB;AACA,IAAI,OAAO,KAAK;AAChB,CAAC;AACD,OAAO,CAAC,MAAM,GAAG,MAAM;AACvB;AACA;AACA;AACA,MAAM,4BAA4B,GAAG,CAAC,OAAO,EAAE,UAAU,KAAK;AAC9D,IAAI,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC;AAC3C,CAAC;AACD,OAAO,CAAC,4BAA4B,GAAG,4BAA4B;;"}
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 utils_1 = require(\"../../utils\");\nconst isIamAuthApplicable_1 = require(\"../../utils/isIamAuthApplicable\");\nconst transferHandler_1 = require(\"./transferHandler\");\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 *\n * 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 * @param amplify the AmplifyClassV6 instance - it may be the singleton used on Web, or an instance created within\n * a context created by `runWithAmplifyServerContext`\n * @param postInput an object of {@link InternalPostInput}\n * @param postInput.url The URL that the POST request sends to\n * @param postInput.options Options of the POST request\n * @param postInput.abortController The abort controller used to cancel the POST request\n * @returns a {@link RestApiResponse}\n *\n * @throws an {@link AmplifyError} with `Network Error` as the `message` when the external resource is unreachable due to one\n * of the following reasons:\n * 1. no network connection\n * 2. CORS error\n * @throws a {@link CanceledError} when the ongoing POST request get cancelled\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, transferHandler_1.transferHandler)(amplify, {\n url,\n method: 'POST',\n ...options,\n abortSignal: controller.signal,\n retryStrategy: {\n strategy: 'jittered-exponential-backoff',\n },\n }, isIamAuthApplicable_1.isIamAuthApplicableForGraphQL, 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;AAC7D,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM;AAC7E,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,qBAAqB,GAAG,OAAO,CAAC,iCAAiC,CAAC;AACxE,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,IAAI,OAAO,EAAE;AACpC;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;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QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,OAAO,KAAK;AAChB,CAAC;AACD,OAAO,CAAC,MAAM,GAAG,MAAM;AACvB;AACA;AACA;AACA,MAAM,4BAA4B,GAAG,CAAC,OAAO,EAAE,UAAU,KAAK;AAC9D,IAAI,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC;AAC3C,CAAC;AACD,OAAO,CAAC,4BAA4B,GAAG,4BAA4B;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"transferHandler.js","sources":["../../../../src/apis/common/transferHandler.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 resolveHeaders_1 = require(\"../../utils/resolveHeaders\");\nconst authenticatedHandler_1 = require(\"./baseHandlers/authenticatedHandler\");\nconst unauthenticatedHandler_1 = require(\"./baseHandlers/unauthenticatedHandler\");\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 * @param iamAuthApplicable Callback function that is used to determine if IAM Auth should be used or not.\n *\n * @internal\n */\nconst transferHandler = async (amplify, options, iamAuthApplicable, signingServiceInfo) => {\n const { url, method, headers, body, withCredentials, abortSignal, retryStrategy, } = options;\n const resolvedBody = body\n ? body instanceof FormData\n ? body\n : JSON.stringify(body ?? '')\n : undefined;\n const resolvedHeaders = (0, resolveHeaders_1.resolveHeaders)(headers, body);\n const request = {\n url,\n headers: resolvedHeaders,\n method,\n body: resolvedBody,\n };\n const baseOptions = {\n retryDecider: getRetryDeciderFromStrategy(retryStrategy ?? amplify?.libraryOptions?.API?.REST?.retryStrategy),\n computeDelay: aws_client_utils_1.jitteredBackoff,\n withCrossDomainCredentials: withCredentials,\n abortSignal,\n };\n const isIamAuthApplicable = iamAuthApplicable(request, signingServiceInfo);\n let response;\n const credentials = await resolveCredentials(amplify);\n if (isIamAuthApplicable && credentials) {\n const signingInfoFromUrl = (0, utils_1.parseSigningInfo)(url);\n const signingService = signingServiceInfo?.service ?? signingInfoFromUrl.service;\n const signingRegion = signingServiceInfo?.region ?? signingInfoFromUrl.region;\n response = await (0, authenticatedHandler_1.authenticatedHandler)(request, {\n ...baseOptions,\n credentials,\n region: signingRegion,\n service: signingService,\n });\n }\n else {\n response = await (0, unauthenticatedHandler_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 getRetryDeciderFromStrategy = (retryStrategy) => {\n const strategy = retryStrategy?.strategy;\n if (strategy === 'no-retry') {\n return () => Promise.resolve({ retryable: false });\n }\n return (0, aws_client_utils_1.getRetryDecider)(utils_1.parseRestApiServiceError);\n};\nconst resolveCredentials = async (amplify) => {\n try {\n const { credentials } = await amplify.Auth.fetchAuthSession();\n if (credentials) {\n return credentials;\n }\n }\n catch (e) {\n utils_1.logger.debug('No credentials available, the request will be unsigned.');\n }\n return null;\n};\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC;AAClF,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,gBAAgB,GAAG,OAAO,CAAC,4BAA4B,CAAC;AAC9D,MAAM,sBAAsB,GAAG,OAAO,CAAC,qCAAqC,CAAC;AAC7E,MAAM,wBAAwB,GAAG,OAAO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d,QAAQ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,yDAAyD,CAAC;AACvF;AACA,IAAI,OAAO,IAAI;AACf,CAAC;;"}
1
+ {"version":3,"file":"transferHandler.js","sources":["../../../../src/apis/common/transferHandler.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 resolveHeaders_1 = require(\"../../utils/resolveHeaders\");\nconst authenticatedHandler_1 = require(\"./baseHandlers/authenticatedHandler\");\nconst unauthenticatedHandler_1 = require(\"./baseHandlers/unauthenticatedHandler\");\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 * @param iamAuthApplicable Callback function that is used to determine if IAM Auth should be used or not.\n *\n * @internal\n */\nconst transferHandler = async (amplify, options, iamAuthApplicable, signingServiceInfo) => {\n const { url, method, headers, body, withCredentials, abortSignal, retryStrategy, } = options;\n const resolvedBody = body\n ? body instanceof FormData\n ? body\n : JSON.stringify(body ?? '')\n : undefined;\n const resolvedHeaders = (0, resolveHeaders_1.resolveHeaders)(headers, body);\n const request = {\n url,\n headers: resolvedHeaders,\n method,\n body: resolvedBody,\n };\n const baseOptions = {\n retryDecider: getRetryDeciderFromStrategy(retryStrategy ?? amplify?.libraryOptions?.API?.REST?.retryStrategy),\n computeDelay: aws_client_utils_1.jitteredBackoff,\n withCrossDomainCredentials: withCredentials,\n abortSignal,\n };\n const isIamAuthApplicable = iamAuthApplicable(request, signingServiceInfo);\n let response;\n const credentials = await resolveCredentials(amplify);\n if (isIamAuthApplicable && credentials) {\n const signingInfoFromUrl = (0, utils_1.parseSigningInfo)(url);\n const signingService = signingServiceInfo?.service ?? signingInfoFromUrl.service;\n const signingRegion = signingServiceInfo?.region ?? signingInfoFromUrl.region;\n response = await (0, authenticatedHandler_1.authenticatedHandler)(request, {\n ...baseOptions,\n credentials,\n region: signingRegion,\n service: signingService,\n });\n }\n else {\n response = await (0, unauthenticatedHandler_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 getRetryDeciderFromStrategy = (retryStrategy) => {\n const strategy = retryStrategy?.strategy;\n if (strategy === 'no-retry') {\n return () => Promise.resolve({ retryable: false });\n }\n return (0, aws_client_utils_1.getRetryDecider)(utils_1.parseRestApiServiceError);\n};\nconst resolveCredentials = async (amplify) => {\n try {\n const { credentials } = await amplify.Auth.fetchAuthSession();\n if (credentials) {\n return credentials;\n }\n }\n catch (e) {\n utils_1.logger.debug('No credentials available, the request will be unsigned.');\n }\n return null;\n};\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC;AAClF,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,gBAAgB,GAAG,OAAO,CAAC,4BAA4B,CAAC;AAC9D,MAAM,sBAAsB,GAAG,OAAO,CAAC,qCAAqC,CAAC;AAC7E,MAAM,wBAAwB,GAAG,OAAO,CAAC,uCAAuC,CAAC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG,OAAO,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,KAAK;AAC3F,IAAI,MAAM,EAAE,GAAG,EAAE,MAAM,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/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 *\n * @param {unknown} error The unknown exception to be checked.\n * @returns - A boolean indicating if the error was from an upload cancellation\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;AAC7D,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM;AACtD,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD;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;AACV;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,aAAa;AACxC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC;AAC5D;AACA;AACA,OAAO,CAAC,aAAa,GAAG,aAAa;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,KAAK,YAAY,aAAa;AAC1E,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
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 *\n * @param {unknown} error The unknown exception to be checked.\n * @returns - A boolean indicating if the error was from an upload cancellation\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;AAC7D,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM;AACtD,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD;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;AACV;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,aAAa;AACxC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC;AAC5D,IAAI;AACJ;AACA,OAAO,CAAC,aAAa,GAAG,aAAa;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,KAAK,YAAY,aAAa;AAC1E,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
@@ -1 +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.ApiError {\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;AAC7D,OAAO,CAAC,YAAY,GAAG,MAAM;AAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,YAAY,SAAS,OAAO,CAAC,QAAQ,CAAC;AAC5C,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC,MAAM,CAAC;AACrB;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,YAAY;AACvC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC;AAC3D;AACA;AACA,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
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.ApiError {\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;AAC7D,OAAO,CAAC,YAAY,GAAG,MAAM;AAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,YAAY,SAAS,OAAO,CAAC,QAAQ,CAAC;AAC5C,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC,MAAM,CAAC;AACrB;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,YAAY;AACvC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC;AAC3D,IAAI;AACJ;AACA,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
@@ -1 +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 = assertValidationError;\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}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,qBAAqB,GAAG,qBAAqB;AACrD,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC5C;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;AACjF,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,cAAc,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACpF;AACA;;"}
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 = assertValidationError;\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}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,qBAAqB,GAAG,qBAAqB;AACrD,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC5C;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;AACjF,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,cAAc,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACpF,IAAI;AACJ;;"}
@@ -1 +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;AAC7D,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM;AAC/K,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,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;AACjI,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;AACjI,IAAI,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAC9C,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;AAC9H,IAAI,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AAC9D,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;AACxJ,IAAI,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC1C,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;AACxJ,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
+ {"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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AC,CAAC,EAAE,CAAC;AACxJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +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;AAC7D,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,MAAM;AACtH,IAAI,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACvD,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;AACjI,IAAI,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAC9B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACpG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AACtG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACpG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACpG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AACtG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;;"}
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;AAC7D,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,MAAM;AACtH,IAAI,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACvD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACjI,IAAI,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAC9B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACpG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACtG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACpG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACpG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACtG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/internals/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.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;\nvar internalPost_1 = require(\"../apis/common/internalPost\");\nObject.defineProperty(exports, \"post\", { enumerable: true, get: function () { return internalPost_1.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;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM;AAC7E,IAAI,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AAC9G,IAAI,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC3D,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;AAClH,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
+ {"version":3,"file":"index.js","sources":["../../../src/internals/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.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;\nvar internalPost_1 = require(\"../apis/common/internalPost\");\nObject.defineProperty(exports, \"post\", { enumerable: true, get: function () { return internalPost_1.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;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM;AAC7E,IAAI,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9G,IAAI,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AAClH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +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;AAC7D,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM;AAC7E;AACA;AACA,MAAM,cAAc,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC1E,MAAM,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC7D;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;AAC5G,CAAC;AACD,OAAO,CAAC,IAAI,GAAG,IAAI;AACnB,IAAI,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC3D,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;AAClH,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
+ {"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;AAC7D,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM;AAC7E;AACA;AACA,MAAM,cAAc,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC1E,MAAM,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC7D;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;AAC5G,CAAC;AACD,OAAO,CAAC,IAAI,GAAG,IAAI;AACnB,IAAI,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AAClH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +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;AAC7D,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,MAAM;AACtH,IAAI,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACvD,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;AACjI,IAAI,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC;AACvC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACtG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AACxG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACtG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACtG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AACxG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;;"}
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;AAC7D,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,MAAM;AACtH,IAAI,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACvD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACjI,IAAI,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC;AACvC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACtG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACxG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACtG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACtG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACxG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +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 = createCancellableOperation;\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 = (targetHandler) => !!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 let abortReason;\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 const message = abortReason ?? abortSignal.reason;\n if (error.name === 'AbortError' || abortSignal?.aborted === true) {\n const canceledError = new errors_1.CanceledError({\n ...(message && { message }),\n underlyingError: error,\n recoverySuggestion: 'The API request was explicitly canceled. If this is not intended, validate if you called the `cancel()` function on the API request erroneously.',\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 // If abort reason is not supported, set a scoped reasons instead. The reason property inside an\n // AbortSignal is a readonly property and trying to set it would throw an error.\n if (abortMessage && publicApisAbortSignal.reason !== abortMessage) {\n abortReason = abortMessage;\n }\n };\n return { response: job(), cancel };\n }\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,0BAA0B,GAAG,0BAA0B;AAC/D,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AACpC;AACA;AACA;AACA,SAAS,0BAA0B,CAAC,OAAO,EAAE,eAAe,EAAE;AAC9D,IAAI,MAAM,cAAc,GAAG,CAAC,aAAa,KAAK,CAAC,CAAC,eAAe;AAC/D;AACA;AACA;AACA,IAAI,MAAM,yBAAyB,GAAG,IAAI,eAAe,EAAE;A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QAAQ,MAAM,MAAM,GAAG,CAAC,YAAY,KAAK;AACzC,YAAY,IAAI,qBAAqB,CAAC,OAAO,KAAK,IAAI,EAAE;AACxD,gBAAgB;AAChB;AACA,YAAY,yBAAyB,CAAC,KAAK,CAAC,YAAY,CAAC;AACzD;AACA;AACA,YAAY,IAAI,YAAY,IAAI,qBAAqB,CAAC,MAAM,KAAK,YAAY,EAAE;AAC/E,gBAAgB,WAAW,GAAG,YAAY;AAC1C;AACA,SAAS;AACT,QAAQ,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE;AAC1C;AACA;;"}
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 = createCancellableOperation;\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 = (targetHandler) => !!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 let abortReason;\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 const message = abortReason ?? abortSignal.reason;\n if (error.name === 'AbortError' || abortSignal?.aborted === true) {\n const canceledError = new errors_1.CanceledError({\n ...(message && { message }),\n underlyingError: error,\n recoverySuggestion: 'The API request was explicitly canceled. If this is not intended, validate if you called the `cancel()` function on the API request erroneously.',\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 // If abort reason is not supported, set a scoped reasons instead. The reason property inside an\n // AbortSignal is a readonly property and trying to set it would throw an error.\n if (abortMessage && publicApisAbortSignal.reason !== abortMessage) {\n abortReason = abortMessage;\n }\n };\n return { response: job(), cancel };\n }\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,0BAA0B,GAAG,0BAA0B;AAC/D,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AACpC;AACA;AACA;AACA,SAAS,0BAA0B,CAAC,OAAO,EAAE,eAAe,EAAE;AAC9D,IAAI,MAAM,cAAc,GAAG,CAAC,aAAa,KAAK,CAAC,CAAC,eAAe;AAC/D;AACA;AACA;AACA,IAAI,MAAM,yBAAyB,GAAG,IAAI,eAAe,EAAE;AAC3D,IAAI,MAAM,qBAAqB,GAAG,yBAAyB,CAAC,MAAM;AAClE,IAAI,MAAM,uBAAuB,GAAG,eAAe,EAAE,MAAM;AAC3D,IAAI,IAAI,WAAW;AACnB,IAAI,MAAM,GAAG,GAAG,YAAY;AAC5B,QAAQ,IAAI;AACZ,YAAY,MAAM,QAAQ,GAAG,OAAO,cAAc,CAAC,OAAO;AAC1D,kBAAkB,OAAO;AACzB,kBAAkB,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACjD,YAAY,IAAI,QAAQ,CAAC,UAAU,IAAI,GA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,CAAC;AACT,QAAQ,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE;AAC1C,IAAI;AACJ;;"}
@@ -1 +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.createCancellableOperation = void 0;\nvar createCancellableOperation_1 = require(\"./createCancellableOperation\");\nObject.defineProperty(exports, \"createCancellableOperation\", { enumerable: true, get: function () { return createCancellableOperation_1.createCancellableOperation; } });\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;AAC7D,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,0BAA0B,GAAG,MAAM;AAClJ,IAAI,4BAA4B,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC1E,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,4BAA4B,CAAC,0BAA0B,CAAC,EAAE,EAAE,CAAC;AACxK,IAAI,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;AACtD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC;AAC1I,IAAI,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAC9C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,0BAA0B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,wBAAwB,CAAC,EAAE,EAAE,CAAC;AACtJ,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,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;AACjI,IAAI,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AAClC,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
+ {"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.createCancellableOperation = void 0;\nvar createCancellableOperation_1 = require(\"./createCancellableOperation\");\nObject.defineProperty(exports, \"createCancellableOperation\", { enumerable: true, get: function () { return createCancellableOperation_1.createCancellableOperation; } });\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;AAC7D,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,0BAA0B,GAAG,MAAM;AAClJ,IAAI,4BAA4B,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC1E,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,4BAA4B,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;AACxK,IAAI,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;AACtD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1I,IAAI,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAC9C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,0BAA0B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,CAAC;AACtJ,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACjI,IAAI,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AAClC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +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;AAC7D,OAAO,CAAC,gBAAgB,GAAG,MAAM;AACjC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C;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;AACV,IAAI,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG;AAC5B,IAAI,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AACtF,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;AACT;AACA,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;AACT;AACA,SAAS;AACT,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,cAAc;AACnC,YAAY,MAAM,EAAE,aAAa;AACjC,SAAS;AACT;AACA,CAAC;AACD,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
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,M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iUrl.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;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC;AACA;AACA;AACA;AACA;AACA;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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;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,QAAQ,GAAG,OAAO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G,SAAS,CAAC;AACV,IAAI;AACJ,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveHeaders.js","sources":["../../../src/utils/resolveHeaders.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.resolveHeaders = void 0;\nconst resolveHeaders = (headers, body) => {\n const normalizedHeaders = {};\n for (const key in headers) {\n normalizedHeaders[key.toLowerCase()] = headers[key];\n }\n if (body) {\n normalizedHeaders['content-type'] = 'application/json; charset=UTF-8';\n if (body instanceof FormData) {\n /**\n * If body is a FormData we should not allow setting content-type.\n * It's because runtime HTTP handlers(xhr, fetch, undici, node-fetch,\n * etc.) will modify the content-type value when setting multipart\n * boundary.\n */\n delete normalizedHeaders['content-type'];\n }\n }\n return normalizedHeaders;\n};\nexports.resolveHeaders = resolveHeaders;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,IAAI,KAAK;AAC1C,IAAI,MAAM,iBAAiB,GAAG,EAAE;AAChC,IAAI,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;AAC/B,QAAQ,iBAAiB,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;AAC3D;AACA,IAAI,IAAI,IAAI,EAAE;AACd,QAAQ,iBAAiB,CAAC,cAAc,CAAC,GAAG,iCAAiC;AAC7E,QAAQ,IAAI,IAAI,YAAY,QAAQ,EAAE;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO,iBAAiB,CAAC,cAAc,CAAC;AACpD;AACA;AACA,IAAI,OAAO,iBAAiB;AAC5B,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
1
+ {"version":3,"file":"resolveHeaders.js","sources":["../../../src/utils/resolveHeaders.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.resolveHeaders = void 0;\nconst resolveHeaders = (headers, body) => {\n const normalizedHeaders = {};\n for (const key in headers) {\n normalizedHeaders[key.toLowerCase()] = headers[key];\n }\n if (body) {\n normalizedHeaders['content-type'] = 'application/json; charset=UTF-8';\n if (body instanceof FormData) {\n /**\n * If body is a FormData we should not allow setting content-type.\n * It's because runtime HTTP handlers(xhr, fetch, undici, node-fetch,\n * etc.) will modify the content-type value when setting multipart\n * boundary.\n */\n delete normalizedHeaders['content-type'];\n }\n }\n return normalizedHeaders;\n};\nexports.resolveHeaders = resolveHeaders;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,IAAI,KAAK;AAC1C,IAAI,MAAM,iBAAiB,GAAG,EAAE;AAChC,IAAI,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;AAC/B,QAAQ,iBAAiB,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;AAC3D,IAAI;AACJ,IAAI,IAAI,IAAI,EAAE;AACd,QAAQ,iBAAiB,CAAC,cAAc,CAAC,GAAG,iCAAiC;AAC7E,QAAQ,IAAI,IAAI,YAAY,QAAQ,EAAE;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO,iBAAiB,CAAC,cAAc,CAAC;AACpD,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,iBAAiB;AAC5B,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"serviceError.js","sources":["../../../src/utils/serviceError.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseRestApiServiceError = void 0;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst errors_1 = require(\"../errors\");\n/**\n * Parses both AWS and non-AWS error responses coming from the users' backend code.\n * * AWS errors generated by the AWS services(e.g. API Gateway, Bedrock). They can be Signature errors,\n * ClockSkew errors, etc. These responses will be parsed to errors with proper name and message from the AWS\n * services.\n * * non-AWS errors thrown by the user code. They can contain any headers or body. Users need to access the\n * error.response to get the headers and body and parse them accordingly. The JS error name and message will\n * be `UnknownError` and `Unknown error` respectively.\n */\nconst parseRestApiServiceError = async (response) => {\n if (!response) {\n // Response is not considered an error.\n return;\n }\n const parsedAwsError = await (0, aws_client_utils_1.parseJsonError)(stubErrorResponse(response));\n if (!parsedAwsError) {\n // Response is not considered an error.\n }\n else {\n const bodyText = await response.body?.text();\n return buildRestApiError(parsedAwsError, {\n statusCode: response.statusCode,\n headers: response.headers,\n body: bodyText,\n });\n }\n};\nexports.parseRestApiServiceError = parseRestApiServiceError;\n/**\n * The response object needs to be stub here because the parseAwsJsonError assumes the response body to be valid JSON.\n * Although this is true for AWS services, it is not true for responses from user's code. Once the response body is\n * unwrapped as JSON(and fail), it cannot be read as text again. Therefore, we need to stub the response body here to\n * make sure we can read the error response body as a JSON, and may fall back to read as text if it is not a valid JSON.\n */\nconst stubErrorResponse = (response) => {\n let bodyTextPromise;\n const bodyProxy = new Proxy(response.body, {\n get(target, prop, receiver) {\n if (prop === 'json') {\n // For potential AWS errors, error parser will try to parse the body as JSON first.\n return async () => {\n if (!bodyTextPromise) {\n bodyTextPromise = target.text();\n }\n try {\n return JSON.parse(await bodyTextPromise);\n }\n catch (error) {\n // If response body is not a valid JSON, we stub it to be an empty object and eventually parsed\n // as an unknown error\n return {};\n }\n };\n }\n else if (prop === 'text') {\n // For non-AWS errors, users can access the body as a string as a fallback.\n return async () => {\n if (!bodyTextPromise) {\n bodyTextPromise = target.text();\n }\n return bodyTextPromise;\n };\n }\n else {\n return Reflect.get(target, prop, receiver);\n }\n },\n });\n const responseProxy = new Proxy(response, {\n get(target, prop, receiver) {\n if (prop === 'body') {\n return bodyProxy;\n }\n else {\n return Reflect.get(target, prop, receiver);\n }\n },\n });\n return responseProxy;\n};\n/**\n * Utility to create a new RestApiError from a service error.\n */\nconst buildRestApiError = (error, response) => {\n const restApiError = new errors_1.RestApiError({\n name: error?.name,\n message: error.message,\n underlyingError: error,\n response,\n });\n // $metadata is only required for backwards compatibility.\n return Object.assign(restApiError, { $metadata: error.$metadata });\n};\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,wBAAwB,GAAG,MAAM;AACzC,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC;AAClF,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,wBAAwB,GAAG,OAAO,QAAQ,KAAK;AACrD,IAAI,IAAI,CAAC,QAAQ,EAAE;AACnB;AACA,QAAQ;AACR;AACA,IAAI,MAAM,cAAc,GAAG,MAAM,IAAI,kBAAkB,CAAC,cAAc,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACpG,IAAI,IAAI,CAAC,cAAc,EAAE;AAGzB,SAAS;AACT,QAAQ,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE;AACpD,QAAQ,OAAO,iBAAiB,CAAC,cAAc,EAAE;AACjD,YAAY,UAAU,EAAE,QAAQ,CAAC,UAAU;A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KAAK,MAAM,EAAE;AACjC,gBAAgB,OAAO,SAAS;AAChC;AACA,iBAAiB;AACjB,gBAAgB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC;AAC1D;AACA,SAAS;AACT,KAAK,CAAC;AACN,IAAI,OAAO,aAAa;AACxB,CAAC;AACD;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AAC/C,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,QAAQ,QAAQ;AAChB,KAAK,CAAC;AACN;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;AACtE,CAAC;;"}
1
+ {"version":3,"file":"serviceError.js","sources":["../../../src/utils/serviceError.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseRestApiServiceError = void 0;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst errors_1 = require(\"../errors\");\n/**\n * Parses both AWS and non-AWS error responses coming from the users' backend code.\n * * AWS errors generated by the AWS services(e.g. API Gateway, Bedrock). They can be Signature errors,\n * ClockSkew errors, etc. These responses will be parsed to errors with proper name and message from the AWS\n * services.\n * * non-AWS errors thrown by the user code. They can contain any headers or body. Users need to access the\n * error.response to get the headers and body and parse them accordingly. The JS error name and message will\n * be `UnknownError` and `Unknown error` respectively.\n */\nconst parseRestApiServiceError = async (response) => {\n if (!response) {\n // Response is not considered an error.\n return;\n }\n const parsedAwsError = await (0, aws_client_utils_1.parseJsonError)(stubErrorResponse(response));\n if (!parsedAwsError) {\n // Response is not considered an error.\n }\n else {\n const bodyText = await response.body?.text();\n return buildRestApiError(parsedAwsError, {\n statusCode: response.statusCode,\n headers: response.headers,\n body: bodyText,\n });\n }\n};\nexports.parseRestApiServiceError = parseRestApiServiceError;\n/**\n * The response object needs to be stub here because the parseAwsJsonError assumes the response body to be valid JSON.\n * Although this is true for AWS services, it is not true for responses from user's code. Once the response body is\n * unwrapped as JSON(and fail), it cannot be read as text again. Therefore, we need to stub the response body here to\n * make sure we can read the error response body as a JSON, and may fall back to read as text if it is not a valid JSON.\n */\nconst stubErrorResponse = (response) => {\n let bodyTextPromise;\n const bodyProxy = new Proxy(response.body, {\n get(target, prop, receiver) {\n if (prop === 'json') {\n // For potential AWS errors, error parser will try to parse the body as JSON first.\n return async () => {\n if (!bodyTextPromise) {\n bodyTextPromise = target.text();\n }\n try {\n return JSON.parse(await bodyTextPromise);\n }\n catch (error) {\n // If response body is not a valid JSON, we stub it to be an empty object and eventually parsed\n // as an unknown error\n return {};\n }\n };\n }\n else if (prop === 'text') {\n // For non-AWS errors, users can access the body as a string as a fallback.\n return async () => {\n if (!bodyTextPromise) {\n bodyTextPromise = target.text();\n }\n return bodyTextPromise;\n };\n }\n else {\n return Reflect.get(target, prop, receiver);\n }\n },\n });\n const responseProxy = new Proxy(response, {\n get(target, prop, receiver) {\n if (prop === 'body') {\n return bodyProxy;\n }\n else {\n return Reflect.get(target, prop, receiver);\n }\n },\n });\n return responseProxy;\n};\n/**\n * Utility to create a new RestApiError from a service error.\n */\nconst buildRestApiError = (error, response) => {\n const restApiError = new errors_1.RestApiError({\n name: error?.name,\n message: error.message,\n underlyingError: error,\n response,\n });\n // $metadata is only required for backwards compatibility.\n return Object.assign(restApiError, { $metadata: error.$metadata });\n};\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,wBAAwB,GAAG,MAAM;AACzC,MAAM,kBAAkB,GAAG,OAA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AE,KAAK,CAAC,SAAS,EAAE,CAAC;AACtE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"internalPost.mjs","sources":["../../../../src/apis/common/internalPost.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createCancellableOperation } from '../../utils';\nimport { isIamAuthApplicableForGraphQL } from '../../utils/isIamAuthApplicable';\nimport { transferHandler } from './transferHandler';\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 *\n * 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 * @param amplify the AmplifyClassV6 instance - it may be the singleton used on Web, or an instance created within\n * a context created by `runWithAmplifyServerContext`\n * @param postInput an object of {@link InternalPostInput}\n * @param postInput.url The URL that the POST request sends to\n * @param postInput.options Options of the POST request\n * @param postInput.abortController The abort controller used to cancel the POST request\n * @returns a {@link RestApiResponse}\n *\n * @throws an {@link AmplifyError} with `Network Error` as the `message` when the external resource is unreachable due to one\n * of the following reasons:\n * 1. no network connection\n * 2. CORS error\n * @throws a {@link CanceledError} when the ongoing POST request get cancelled\n */\nexport const post = (amplify, { url, options, abortController }) => {\n const controller = abortController ?? new AbortController();\n const responsePromise = createCancellableOperation(async () => {\n const response = transferHandler(amplify, {\n url,\n method: 'POST',\n ...options,\n abortSignal: controller.signal,\n retryStrategy: {\n strategy: 'jittered-exponential-backoff',\n },\n }, isIamAuthApplicableForGraphQL, options?.signingServiceInfo);\n return response;\n }, controller);\n const responseWithCleanUp = responsePromise.finally(() => {\n cancelTokenMap.delete(responseWithCleanUp);\n });\n return responseWithCleanUp;\n};\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 */\nexport const 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};\n/**\n * MUST be used to make a promise including internal `post` API call cancellable.\n */\nexport const updateRequestToBeCancellable = (promise, controller) => {\n cancelTokenMap.set(promise, controller);\n};\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,IAAI,OAAO,EAAE;AACpC;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;AACY,MAAC,IAAI,GAAG,CAA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G,CAAC,OAAO,EAAE,UAAU,CAAC;AAC3C;;;;"}
1
+ {"version":3,"file":"internalPost.mjs","sources":["../../../../src/apis/common/internalPost.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createCancellableOperation } from '../../utils';\nimport { isIamAuthApplicableForGraphQL } from '../../utils/isIamAuthApplicable';\nimport { transferHandler } from './transferHandler';\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 *\n * 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 * @param amplify the AmplifyClassV6 instance - it may be the singleton used on Web, or an instance created within\n * a context created by `runWithAmplifyServerContext`\n * @param postInput an object of {@link InternalPostInput}\n * @param postInput.url The URL that the POST request sends to\n * @param postInput.options Options of the POST request\n * @param postInput.abortController The abort controller used to cancel the POST request\n * @returns a {@link RestApiResponse}\n *\n * @throws an {@link AmplifyError} with `Network Error` as the `message` when the external resource is unreachable due to one\n * of the following reasons:\n * 1. no network connection\n * 2. CORS error\n * @throws a {@link CanceledError} when the ongoing POST request get cancelled\n */\nexport const post = (amplify, { url, options, abortController }) => {\n const controller = abortController ?? new AbortController();\n const responsePromise = createCancellableOperation(async () => {\n const response = transferHandler(amplify, {\n url,\n method: 'POST',\n ...options,\n abortSignal: controller.signal,\n retryStrategy: {\n strategy: 'jittered-exponential-backoff',\n },\n }, isIamAuthApplicableForGraphQL, options?.signingServiceInfo);\n return response;\n }, controller);\n const responseWithCleanUp = responsePromise.finally(() => {\n cancelTokenMap.delete(responseWithCleanUp);\n });\n return responseWithCleanUp;\n};\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 */\nexport const 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};\n/**\n * MUST be used to make a promise including internal `post` API call cancellable.\n */\nexport const updateRequestToBeCancellable = (promise, controller) => {\n cancelTokenMap.set(promise, controller);\n};\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,IAAI,OAAO,EAAE;AACpC;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;AACY,MAAC,IAAI,GAAG,CAAC,OAAO,EAAE,EA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CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC;AAC3C;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"transferHandler.mjs","sources":["../../../../src/apis/common/transferHandler.ts"],"sourcesContent":["import { getRetryDecider, jitteredBackoff, } from '@aws-amplify/core/internals/aws-client-utils';\nimport { logger, parseRestApiServiceError, parseSigningInfo, } from '../../utils';\nimport { resolveHeaders } from '../../utils/resolveHeaders';\nimport { authenticatedHandler } from './baseHandlers/authenticatedHandler';\nimport { unauthenticatedHandler } from './baseHandlers/unauthenticatedHandler';\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 * @param iamAuthApplicable Callback function that is used to determine if IAM Auth should be used or not.\n *\n * @internal\n */\nexport const transferHandler = async (amplify, options, iamAuthApplicable, signingServiceInfo) => {\n const { url, method, headers, body, withCredentials, abortSignal, retryStrategy, } = options;\n const resolvedBody = body\n ? body instanceof FormData\n ? body\n : JSON.stringify(body ?? '')\n : undefined;\n const resolvedHeaders = resolveHeaders(headers, body);\n const request = {\n url,\n headers: resolvedHeaders,\n method,\n body: resolvedBody,\n };\n const baseOptions = {\n retryDecider: getRetryDeciderFromStrategy(retryStrategy ?? amplify?.libraryOptions?.API?.REST?.retryStrategy),\n computeDelay: jitteredBackoff,\n withCrossDomainCredentials: withCredentials,\n abortSignal,\n };\n const isIamAuthApplicable = iamAuthApplicable(request, signingServiceInfo);\n let response;\n const credentials = await resolveCredentials(amplify);\n if (isIamAuthApplicable && credentials) {\n const signingInfoFromUrl = parseSigningInfo(url);\n const signingService = signingServiceInfo?.service ?? signingInfoFromUrl.service;\n const signingRegion = signingServiceInfo?.region ?? signingInfoFromUrl.region;\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 getRetryDeciderFromStrategy = (retryStrategy) => {\n const strategy = retryStrategy?.strategy;\n if (strategy === 'no-retry') {\n return () => Promise.resolve({ retryable: false });\n }\n return getRetryDecider(parseRestApiServiceError);\n};\nconst resolveCredentials = async (amplify) => {\n try {\n const { credentials } = await amplify.Auth.fetchAuthSession();\n if (credentials) {\n return credentials;\n }\n }\n catch (e) {\n logger.debug('No credentials available, the request will be unsigned.');\n }\n return null;\n};\n"],"names":[],"mappings":";;;;;;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,eAAe,GAAG,OAAO,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,KAAK;AAClG,IAAI,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,GAAG,GAAG,OAAO;AAChG,IAAI,MAAM,YAAY,GAAG;AACzB,UAAU,IAAI,YAAY;AAC1B,cAAc;AACd,cAAc,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE;AACvC,UAAU,SAAS;AACnB,IAAI,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC;AACzD,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,GAAG;AACX,QAAQ,OAAO,EAAE,eAAe;AAChC,QAAQ,MAAM;AACd,QAAQ,IAAI,EAAE,YAAY;AAC1B,KAAK;AACL,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,YAAY,EAAE,2BAA2B,CAAC,aAAa,IAAI,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC;AACrH,QAAQ,YAAY,EAAE,eAAe;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AAC;AACpD,CAAC;AACD,MAAM,kBAAkB,GAAG,OAAO,OAAO,KAAK;AAC9C,IAAI,IAAI;AACR,QAAQ,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;AACrE,QAAQ,IAAI,WAAW,EAAE;AACzB,YAAY,OAAO,WAAW;AAC9B;AACA;AACA,IAAI,OAAO,CAAC,EAAE;AACd,QAAQ,MAAM,CAAC,KAAK,CAAC,yDAAyD,CAAC;AAC/E;AACA,IAAI,OAAO,IAAI;AACf,CAAC;;;;"}
1
+ {"version":3,"file":"transferHandler.mjs","sources":["../../../../src/apis/common/transferHandler.ts"],"sourcesContent":["import { getRetryDecider, jitteredBackoff, } from '@aws-amplify/core/internals/aws-client-utils';\nimport { logger, parseRestApiServiceError, parseSigningInfo, } from '../../utils';\nimport { resolveHeaders } from '../../utils/resolveHeaders';\nimport { authenticatedHandler } from './baseHandlers/authenticatedHandler';\nimport { unauthenticatedHandler } from './baseHandlers/unauthenticatedHandler';\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 * @param iamAuthApplicable Callback function that is used to determine if IAM Auth should be used or not.\n *\n * @internal\n */\nexport const transferHandler = async (amplify, options, iamAuthApplicable, signingServiceInfo) => {\n const { url, method, headers, body, withCredentials, abortSignal, retryStrategy, } = options;\n const resolvedBody = body\n ? body instanceof FormData\n ? body\n : JSON.stringify(body ?? '')\n : undefined;\n const resolvedHeaders = resolveHeaders(headers, body);\n const request = {\n url,\n headers: resolvedHeaders,\n method,\n body: resolvedBody,\n };\n const baseOptions = {\n retryDecider: getRetryDeciderFromStrategy(retryStrategy ?? amplify?.libraryOptions?.API?.REST?.retryStrategy),\n computeDelay: jitteredBackoff,\n withCrossDomainCredentials: withCredentials,\n abortSignal,\n };\n const isIamAuthApplicable = iamAuthApplicable(request, signingServiceInfo);\n let response;\n const credentials = await resolveCredentials(amplify);\n if (isIamAuthApplicable && credentials) {\n const signingInfoFromUrl = parseSigningInfo(url);\n const signingService = signingServiceInfo?.service ?? signingInfoFromUrl.service;\n const signingRegion = signingServiceInfo?.region ?? signingInfoFromUrl.region;\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 getRetryDeciderFromStrategy = (retryStrategy) => {\n const strategy = retryStrategy?.strategy;\n if (strategy === 'no-retry') {\n return () => Promise.resolve({ retryable: false });\n }\n return getRetryDecider(parseRestApiServiceError);\n};\nconst resolveCredentials = async (amplify) => {\n try {\n const { credentials } = await amplify.Auth.fetchAuthSession();\n if (credentials) {\n return credentials;\n }\n }\n catch (e) {\n logger.debug('No credentials available, the request will be unsigned.');\n }\n return null;\n};\n"],"names":[],"mappings":";;;;;;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,eAAe,GAAG,OAAO,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,KAAK;AAClG,IAAI,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,GAAG,GAAG,OAAO;AAChG,IAAI,MAAM,YAAY,GAAG;AACzB,UAAU,IAAI,YAAY;AAC1B,cAAc;AACd,cAAc,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE;AACvC,UAAU,SAAS;AACnB,IAAI,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC;AACzD,IAAI,MAAM,OAAO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AAQ,CAAC,IAAI;AAC3B,KAAK;AACL;AACA,MAAM,2BAA2B,GAAG,CAAC,aAAa,KAAK;AACvD,IAAI,MAAM,QAAQ,GAAG,aAAa,EAAE,QAAQ;AAC5C,IAAI,IAAI,QAAQ,KAAK,UAAU,EAAE;AACjC,QAAQ,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAC1D,IAAI;AACJ,IAAI,OAAO,eAAe,CAAC,wBAAwB,CAAC;AACpD,CAAC;AACD,MAAM,kBAAkB,GAAG,OAAO,OAAO,KAAK;AAC9C,IAAI,IAAI;AACR,QAAQ,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;AACrE,QAAQ,IAAI,WAAW,EAAE;AACzB,YAAY,OAAO,WAAW;AAC9B,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,CAAC,EAAE;AACd,QAAQ,MAAM,CAAC,KAAK,CAAC,yDAAyD,CAAC;AAC/E,IAAI;AACJ,IAAI,OAAO,IAAI;AACf,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CanceledError.mjs","sources":["../../../src/errors/CanceledError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RestApiError } from './RestApiError';\n/**\n * Internal-only class for CanceledError.\n *\n * @internal\n */\nexport class CanceledError extends 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}\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 *\n * @param {unknown} error The unknown exception to be checked.\n * @returns - A boolean indicating if the error was from an upload cancellation\n */\nexport const isCancelError = (error) => !!error && error instanceof CanceledError;\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAa,SAAS,YAAY,CAAC;AAChD,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;AACV;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,aAAa;AACxC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,KAAK,YAAY;;;;"}
1
+ {"version":3,"file":"CanceledError.mjs","sources":["../../../src/errors/CanceledError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RestApiError } from './RestApiError';\n/**\n * Internal-only class for CanceledError.\n *\n * @internal\n */\nexport class CanceledError extends 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}\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 *\n * @param {unknown} error The unknown exception to be checked.\n * @returns - A boolean indicating if the error was from an upload cancellation\n */\nexport const isCancelError = (error) => !!error && error instanceof CanceledError;\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAa,SAAS,YAAY,CAAC;AAChD,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;AACV;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,aAAa;AACxC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC;AAC5D,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,KAAK,YAAY;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RestApiError.mjs","sources":["../../../src/errors/RestApiError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ApiError } from '@aws-amplify/core/internals/utils';\nexport class RestApiError extends ApiError {\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}\n"],"names":[],"mappings":";;AAAA;AACA;AAEO,MAAM,YAAY,SAAS,QAAQ,CAAC;AAC3C,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC,MAAM,CAAC;AACrB;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,YAAY;AACvC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC;AAC3D;AACA;;;;"}
1
+ {"version":3,"file":"RestApiError.mjs","sources":["../../../src/errors/RestApiError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ApiError } from '@aws-amplify/core/internals/utils';\nexport class RestApiError extends ApiError {\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}\n"],"names":[],"mappings":";;AAAA;AACA;AAEO,MAAM,YAAY,SAAS,QAAQ,CAAC;AAC3C,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC,MAAM,CAAC;AACrB;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,YAAY;AACvC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC;AAC3D,IAAI;AACJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"assertValidatonError.mjs","sources":["../../../src/errors/assertValidatonError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RestApiError } from './RestApiError';\nimport { validationErrorMap } from './validation';\n/**\n * @internal\n */\nexport function assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = validationErrorMap[name];\n if (!assertion) {\n throw new RestApiError({ name, message, recoverySuggestion });\n }\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACO,SAAS,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE;AACvD,IAAI,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC;AACpE,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACrE;AACA;;;;"}
1
+ {"version":3,"file":"assertValidatonError.mjs","sources":["../../../src/errors/assertValidatonError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RestApiError } from './RestApiError';\nimport { validationErrorMap } from './validation';\n/**\n * @internal\n */\nexport function assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = validationErrorMap[name];\n if (!assertion) {\n throw new RestApiError({ name, message, recoverySuggestion });\n }\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACO,SAAS,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE;AACvD,IAAI,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC;AACpE,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACrE,IAAI;AACJ;;;;"}
@@ -3,13 +3,13 @@ export type GetInput = ApiInput<RestApiOptionsBase>;
3
3
  export type PostInput = ApiInput<RestApiOptionsBase>;
4
4
  export type PutInput = ApiInput<RestApiOptionsBase>;
5
5
  export type PatchInput = ApiInput<RestApiOptionsBase>;
6
- export type DeleteInput = ApiInput<Omit<RestApiOptionsBase, 'body'>>;
6
+ export type DeleteInput = ApiInput<RestApiOptionsBase>;
7
7
  export type HeadInput = ApiInput<Omit<RestApiOptionsBase, 'body'>>;
8
8
  export type GetOperation = Operation<RestApiResponse>;
9
9
  export type PostOperation = Operation<RestApiResponse>;
10
10
  export type PutOperation = Operation<RestApiResponse>;
11
11
  export type PatchOperation = Operation<RestApiResponse>;
12
- export type DeleteOperation = Operation<Omit<RestApiResponse, 'body'>>;
12
+ export type DeleteOperation = Operation<RestApiResponse>;
13
13
  export type HeadOperation = Operation<Omit<RestApiResponse, 'body'>>;
14
14
  /**
15
15
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"createCancellableOperation.mjs","sources":["../../../src/utils/createCancellableOperation.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CanceledError } from '../errors';\nimport { parseRestApiServiceError } from './serviceError';\nimport { logger } from './logger';\n/**\n * @internal\n */\nexport function createCancellableOperation(handler, abortController) {\n const isInternalPost = (targetHandler) => !!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 let abortReason;\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 parseRestApiServiceError(response);\n }\n return response;\n }\n catch (error) {\n const abortSignal = internalPostAbortSignal ?? publicApisAbortSignal;\n const message = abortReason ?? abortSignal.reason;\n if (error.name === 'AbortError' || abortSignal?.aborted === true) {\n const canceledError = new CanceledError({\n ...(message && { message }),\n underlyingError: error,\n recoverySuggestion: 'The API request was explicitly canceled. If this is not intended, validate if you called the `cancel()` function on the API request erroneously.',\n });\n logger.debug(error);\n throw canceledError;\n }\n 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 // If abort reason is not supported, set a scoped reasons instead. The reason property inside an\n // AbortSignal is a readonly property and trying to set it would throw an error.\n if (abortMessage && publicApisAbortSignal.reason !== abortMessage) {\n abortReason = abortMessage;\n }\n };\n return { response: job(), cancel };\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;AACA;AAIA;AACA;AACA;AACO,SAAS,0BAA0B,CAAC,OAAO,EAAE,eAAe,EAAE;AACrE,IAAI,MAAM,cAAc,GAAG,CAAC,aAAa,KAAK,CAAC,CAAC,eAAe;AAC/D;AACA;AACA;AACA,IAAI,MAAM,yBAAyB,GAAG,IAAI,eAAe,EAAE;AAC3D,IAAI,MAAM,qBAAqB,GAAG,yBAAyB,CA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B;AAChB;AACA,YAAY,yBAAyB,CAAC,KAAK,CAAC,YAAY,CAAC;AACzD;AACA;AACA,YAAY,IAAI,YAAY,IAAI,qBAAqB,CAAC,MAAM,KAAK,YAAY,EAAE;AAC/E,gBAAgB,WAAW,GAAG,YAAY;AAC1C;AACA,SAAS;AACT,QAAQ,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE;AAC1C;AACA;;;;"}
1
+ {"version":3,"file":"createCancellableOperation.mjs","sources":["../../../src/utils/createCancellableOperation.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CanceledError } from '../errors';\nimport { parseRestApiServiceError } from './serviceError';\nimport { logger } from './logger';\n/**\n * @internal\n */\nexport function createCancellableOperation(handler, abortController) {\n const isInternalPost = (targetHandler) => !!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 let abortReason;\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 parseRestApiServiceError(response);\n }\n return response;\n }\n catch (error) {\n const abortSignal = internalPostAbortSignal ?? publicApisAbortSignal;\n const message = abortReason ?? abortSignal.reason;\n if (error.name === 'AbortError' || abortSignal?.aborted === true) {\n const canceledError = new CanceledError({\n ...(message && { message }),\n underlyingError: error,\n recoverySuggestion: 'The API request was explicitly canceled. If this is not intended, validate if you called the `cancel()` function on the API request erroneously.',\n });\n logger.debug(error);\n throw canceledError;\n }\n 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 // If abort reason is not supported, set a scoped reasons instead. The reason property inside an\n // AbortSignal is a readonly property and trying to set it would throw an error.\n if (abortMessage && publicApisAbortSignal.reason !== abortMessage) {\n abortReason = abortMessage;\n }\n };\n return { response: job(), cancel };\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;AACA;AAIA;AACA;AACA;AACO,SAAS,0BAA0B,CAAC,OAAO,EAAE,eAAe,EAAE;AACrE,IAAI,MAAM,cAAc,GAAG,CAAC,aAAa,KAAK,CAAC,CAAC,eAAe;AAC/D;AACA;AACA;AACA,IAAI,MAAM,yBAAyB,GAAG,IAAI,eAAe,EAAE;AAC3D,IAAI,MAAM,qBAAqB,GAAG,yBAAyB,CAAC,MAAM;AAClE,IAAI,MAAM,uBAAuB,GAAG,eAAe,EAAE,MAAM;AAC3D,IAAI,IAAI,WAAW;AACnB,IAAI,MAAM,GAAG,GAAG,YAAY;AAC5B,QAAQ,IAAI;AACZ,YAAY,MAAM,QAAQ,GAAG,OAAO,cAAc,CAAC,OAAO;AAC1D,kBAAkB,OAAO;AACzB,kBAAkB,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACjD,YAAY,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AAC5C,gBAAgB,MAAM,MAAM,wBAAwB,CAAC,QAAQ,CAAC;AAC9D,YAAY;AACZ,YAAY,OAAO,QAAQ;AAC3B,QAAQ;AACR,QAAQ,OAAO,KAAK,EAAE;AACtB,YAAY,MAAM,WAAW,GAAG,uBAAuB,IAAI,qBAAqB;AAChF,YAAY,MAAM,OAAO,GAAG,WAAW,IAAI,WAAW,CAAC,MAAM;AAC7D,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,WAAW,EAAE,OAAO,KAAK,IAAI,EAAE;AAC9E,gBAAgB,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC;AACxD,oBAAoB,IAAI,OAAO,IAAI,EAAE,OAAO,EAAE,CAAC;AAC/C,oBAAoB,eAAe,EAAE,KAAK;AAC1C,oBAAoB,kBAAkB,EAAE,kJAAkJ;AAC1L,iBAAiB,CAAC;AAClB,gBAAgB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;AACnC,gBAAgB,MAAM,aAAa;AACnC,YAAY;AACZ,YAAY,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;AAC/B,YAAY,MAAM,KAAK;AACvB,QAAQ;AACR,IAAI,CAAC;AACL,IAAI,IAAI,cAAc,CAAQ,CAAC,EAAE;AACjC,QAAQ,OAAO,GAAG,EAAE;AACpB,IAAI;AACJ,SAAS;AACT,QAAQ,MAAM,MAAM,GAAG,CAAC,YAAY,KAAK;AACzC,YAAY,IAAI,qBAAqB,CAAC,OAAO,KAAK,IAAI,EAAE;AACxD,gBAAgB;AAChB,YAAY;AACZ,YAAY,yBAAyB,CAAC,KAAK,CAAC,YAAY,CAAC;AACzD;AACA;AACA,YAAY,IAAI,YAAY,IAAI,qBAAqB,CAAC,MAAM,KAAK,YAAY,EAAE;AAC/E,gBAAgB,WAAW,GAAG,YAAY;AAC1C,YAAY;AACZ,QAAQ,CAAC;AACT,QAAQ,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE;AAC1C,IAAI;AACJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"parseSigningInfo.mjs","sources":["../../../src/utils/parseSigningInfo.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { APIG_HOSTNAME_PATTERN, DEFAULT_IAM_SIGNING_REGION, DEFAULT_REST_IAM_SIGNING_SERVICE, } from './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 */\nexport const parseSigningInfo = (url, restApiOptions) => {\n const { service: signingService = DEFAULT_REST_IAM_SIGNING_SERVICE, region: signingRegion = DEFAULT_IAM_SIGNING_REGION, } = restApiOptions?.amplify.getConfig()?.API?.REST?.[restApiOptions?.apiName] ??\n {};\n const { hostname } = url;\n const [, service, region] = APIG_HOSTNAME_PATTERN.exec(hostname) ?? [];\n if (service === 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};\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,gBAAgB,GAAG,CAAC,GAAG,EAAE,cAAc,KAAK;AACzD,IAAI,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,gCAAgC,EAAE,MAAM,EAAE,aAAa,GAAG,0BAA0B,GAAG,GAAG,cAAc,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,IAAI,GAAG,cAAc,EAAE,OAAO,CAAC;AACzM,QAAQ,EAAE;AACV,IAAI,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG;AAC5B,IAAI,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC,GAAG,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AAC1E,IAAI,IAAI,OAAO,KAAK,gCAAgC,EAAE;AACtD;AACA;AACA,QAAQ,OAAO;AACf,YAAY,OAAO;AACnB,YAAY,MAAM,EAAE,MAAM,IAAI,aAAa;AAC3C,SAAS;AACT;AACA,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;AACT;AACA,SAAS;AACT,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,cAAc;AACnC,YAAY,MAAM,EAAE,aAAa;AACjC,SAAS;AACT;AACA;;;;"}
1
+ {"version":3,"file":"parseSigningInfo.mjs","sources":["../../../src/utils/parseSigningInfo.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { APIG_HOSTNAME_PATTERN, DEFAULT_IAM_SIGNING_REGION, DEFAULT_REST_IAM_SIGNING_SERVICE, } from './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 */\nexport const parseSigningInfo = (url, restApiOptions) => {\n const { service: signingService = DEFAULT_REST_IAM_SIGNING_SERVICE, region: signingRegion = DEFAULT_IAM_SIGNING_REGION, } = restApiOptions?.amplify.getConfig()?.API?.REST?.[restApiOptions?.apiName] ??\n {};\n const { hostname } = url;\n const [, service, region] = APIG_HOSTNAME_PATTERN.exec(hostname) ?? [];\n if (service === 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};\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,gBAAgB,GAAG,CAAC,GAAG,EAAE,cAAc,KAAK;AACzD,IAAI,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,gCAAgC,EAAE,MAAM,EAAE,aAAa,GAAG,0BAA0B,GAAG,GAAG,cAAc,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,IAAI,GAAG,cAAc,EAAE,OAAO,CAAC;AACzM,QAAQ,EAAE;AACV,IAAI,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG;AAC5B,IAAI,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC,GAAG,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AAC1E,IAAI,IAAI,OAAO,KAAK,gCAAgC,EAAE;AACtD;AACA;AACA,QAAQ,OAAO;AACf,YAAY,OAAO;AACnB,YAAY,MAAM,EAAE,MAAM,IAAI,aAAa;AAC3C,SAAS;AACT,IAAI;AACJ,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;AACT,IAAI;AACJ,SAAS;AACT,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,cAAc;AACnC,YAAY,MAAM,EAAE,aAAa;AACjC,SAAS;AACT,IAAI;AACJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveApiUrl.mjs","sources":["../../../src/utils/resolveApiUrl.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyUrl, AmplifyUrlSearchParams, } from '@aws-amplify/core/internals/utils';\nimport { RestApiError, RestApiValidationErrorCode, assertValidationError, validationErrorMap, } from '../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 */\nexport const resolveApiUrl = (amplify, apiName, path, queryParams) => {\n const urlStr = amplify.getConfig()?.API?.REST?.[apiName]?.endpoint;\n assertValidationError(!!urlStr, RestApiValidationErrorCode.InvalidApiName);\n try {\n const url = new AmplifyUrl(urlStr + path);\n if (queryParams) {\n const mergedQueryParams = new AmplifyUrlSearchParams(url.searchParams);\n Object.entries(queryParams).forEach(([key, value]) => {\n mergedQueryParams.set(key, value);\n });\n url.search = new AmplifyUrlSearchParams(mergedQueryParams).toString();\n }\n return url;\n }\n catch (error) {\n throw new RestApiError({\n name: RestApiValidationErrorCode.InvalidApiName,\n ...validationErrorMap[RestApiValidationErrorCode.InvalidApiName],\n recoverySuggestion: `Please make sure the REST endpoint URL is a valid URL string. Got ${urlStr}`,\n });\n }\n};\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,KAAK;AACtE,IAAI,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,EAAE,QAAQ;AACtE,IAAI,qBAAqB,CAAC,CAAC,CAAC,MAAM,EAAE,0BAA0B,CAAC,cAAc,CAAC;AAC9E,IAAI,IAAI;AACR,QAAQ,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC;AACjD,QAAQ,IAAI,WAAW,EAAE;AACzB,YAAY,MAAM,iBAAiB,GAAG,IAAI,sBAAsB,CAAC,GAAG,CAAC,YAAY,CAAC;AAClF,YAAY,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AAClE,gBAAgB,iBAAiB,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;AACjD,aAAa,CAAC;AACd,YAAY,GAAG,CAAC,MAAM,GAAG,IAAI,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;AACjF;AACA,QAAQ,OAAO,GAAG;AAClB;AACA,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,MAAM,IAAI,YAAY,CAAC;AAC/B,YAAY,IAAI,EAAE,0BAA0B,CAAC,cAAc;AAC3D,YAAY,GAAG,kBAAkB,CAAC,0BAA0B,CAAC,cAAc,CAAC;AAC5E,YAAY,kBAAkB,EAAE,CAAC,kEAAkE,EAAE,MAAM,CAAC,CAAC;AAC7G,SAAS,CAAC;AACV;AACA;;;;"}
1
+ {"version":3,"file":"resolveApiUrl.mjs","sources":["../../../src/utils/resolveApiUrl.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyUrl, AmplifyUrlSearchParams, } from '@aws-amplify/core/internals/utils';\nimport { RestApiError, RestApiValidationErrorCode, assertValidationError, validationErrorMap, } from '../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 */\nexport const resolveApiUrl = (amplify, apiName, path, queryParams) => {\n const urlStr = amplify.getConfig()?.API?.REST?.[apiName]?.endpoint;\n assertValidationError(!!urlStr, RestApiValidationErrorCode.InvalidApiName);\n try {\n const url = new AmplifyUrl(urlStr + path);\n if (queryParams) {\n const mergedQueryParams = new AmplifyUrlSearchParams(url.searchParams);\n Object.entries(queryParams).forEach(([key, value]) => {\n mergedQueryParams.set(key, value);\n });\n url.search = new AmplifyUrlSearchParams(mergedQueryParams).toString();\n }\n return url;\n }\n catch (error) {\n throw new RestApiError({\n name: RestApiValidationErrorCode.InvalidApiName,\n ...validationErrorMap[RestApiValidationErrorCode.InvalidApiName],\n recoverySuggestion: `Please make sure the REST endpoint URL is a valid URL string. Got ${urlStr}`,\n });\n }\n};\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAGA;AAC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ates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const resolveHeaders = (headers, body) => {\n const normalizedHeaders = {};\n for (const key in headers) {\n normalizedHeaders[key.toLowerCase()] = headers[key];\n }\n if (body) {\n normalizedHeaders['content-type'] = 'application/json; charset=UTF-8';\n if (body instanceof FormData) {\n /**\n * If body is a FormData we should not allow setting content-type.\n * It's because runtime HTTP handlers(xhr, fetch, undici, node-fetch,\n * etc.) will modify the content-type value when setting multipart\n * boundary.\n */\n delete normalizedHeaders['content-type'];\n }\n }\n return normalizedHeaders;\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,cAAc,GAAG,CAAC,OAAO,EAAE,IAAI,KAAK;AACjD,IAAI,MAAM,iBAAiB,GAAG,EAAE;AAChC,IAAI,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;AAC/B,QAAQ,iBAAiB,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;AAC3D;AACA,IAAI,IAAI,IAAI,EAAE;AACd,QAAQ,iBAAiB,CAAC,cAAc,CAAC,GAAG,iCAAiC;AAC7E,QAAQ,IAAI,IAAI,YAAY,QAAQ,EAAE;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO,iBAAiB,CAAC,cAAc,CAAC;AACpD;AACA;AACA,IAAI,OAAO,iBAAiB;AAC5B;;;;"}
1
+ {"version":3,"file":"resolveHeaders.mjs","sources":["../../../src/utils/resolveHeaders.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const resolveHeaders = (headers, body) => {\n const normalizedHeaders = {};\n for (const key in headers) {\n normalizedHeaders[key.toLowerCase()] = headers[key];\n }\n if (body) {\n normalizedHeaders['content-type'] = 'application/json; charset=UTF-8';\n if (body instanceof FormData) {\n /**\n * If body is a FormData we should not allow setting content-type.\n * It's because runtime HTTP handlers(xhr, fetch, undici, node-fetch,\n * etc.) will modify the content-type value when setting multipart\n * boundary.\n */\n delete normalizedHeaders['content-type'];\n }\n }\n return normalizedHeaders;\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,cAAc,GAAG,CAAC,OAAO,EAAE,IAAI,KAAK;AACjD,IAAI,MAAM,iBAAiB,GAAG,EAAE;AAChC,IAAI,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;AAC/B,QAAQ,iBAAiB,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;AAC3D,IAAI;AACJ,IAAI,IAAI,IAAI,EAAE;AACd,QAAQ,iBAAiB,CAAC,cAAc,CAAC,GAAG,iCAAiC;AAC7E,QAAQ,IAAI,IAAI,YAAY,QAAQ,EAAE;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO,iBAAiB,CAAC,cAAc,CAAC;AACpD,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,iBAAiB;AAC5B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"serviceError.mjs","sources":["../../../src/utils/serviceError.ts"],"sourcesContent":["import { parseJsonError as parseAwsJsonError, } from '@aws-amplify/core/internals/aws-client-utils';\nimport { RestApiError } from '../errors';\n/**\n * Parses both AWS and non-AWS error responses coming from the users' backend code.\n * * AWS errors generated by the AWS services(e.g. API Gateway, Bedrock). They can be Signature errors,\n * ClockSkew errors, etc. These responses will be parsed to errors with proper name and message from the AWS\n * services.\n * * non-AWS errors thrown by the user code. They can contain any headers or body. Users need to access the\n * error.response to get the headers and body and parse them accordingly. The JS error name and message will\n * be `UnknownError` and `Unknown error` respectively.\n */\nexport const parseRestApiServiceError = async (response) => {\n if (!response) {\n // Response is not considered an error.\n return;\n }\n const parsedAwsError = await parseAwsJsonError(stubErrorResponse(response));\n if (!parsedAwsError) {\n // Response is not considered an error.\n }\n else {\n const bodyText = await response.body?.text();\n return buildRestApiError(parsedAwsError, {\n statusCode: response.statusCode,\n headers: response.headers,\n body: bodyText,\n });\n }\n};\n/**\n * The response object needs to be stub here because the parseAwsJsonError assumes the response body to be valid JSON.\n * Although this is true for AWS services, it is not true for responses from user's code. Once the response body is\n * unwrapped as JSON(and fail), it cannot be read as text again. Therefore, we need to stub the response body here to\n * make sure we can read the error response body as a JSON, and may fall back to read as text if it is not a valid JSON.\n */\nconst stubErrorResponse = (response) => {\n let bodyTextPromise;\n const bodyProxy = new Proxy(response.body, {\n get(target, prop, receiver) {\n if (prop === 'json') {\n // For potential AWS errors, error parser will try to parse the body as JSON first.\n return async () => {\n if (!bodyTextPromise) {\n bodyTextPromise = target.text();\n }\n try {\n return JSON.parse(await bodyTextPromise);\n }\n catch (error) {\n // If response body is not a valid JSON, we stub it to be an empty object and eventually parsed\n // as an unknown error\n return {};\n }\n };\n }\n else if (prop === 'text') {\n // For non-AWS errors, users can access the body as a string as a fallback.\n return async () => {\n if (!bodyTextPromise) {\n bodyTextPromise = target.text();\n }\n return bodyTextPromise;\n };\n }\n else {\n return Reflect.get(target, prop, receiver);\n }\n },\n });\n const responseProxy = new Proxy(response, {\n get(target, prop, receiver) {\n if (prop === 'body') {\n return bodyProxy;\n }\n else {\n return Reflect.get(target, prop, receiver);\n }\n },\n });\n return responseProxy;\n};\n/**\n * Utility to create a new RestApiError from a service error.\n */\nconst buildRestApiError = (error, response) => {\n const restApiError = new RestApiError({\n name: error?.name,\n message: error.message,\n underlyingError: error,\n response,\n });\n // $metadata is only required for backwards compatibility.\n return Object.assign(restApiError, { $metadata: error.$metadata });\n};\n"],"names":["parseAwsJsonError"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,wBAAwB,GAAG,OAAO,QAAQ,KAAK;AAC5D,IAAI,IAAI,CAAC,QAAQ,EAAE;AACnB;AACA,QAAQ;AACR;AACA,IAAI,MAAM,cAAc,GAAG,MAAMA,cAAiB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAC/E,IAAI,IAAI,CAA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,IAAI,MAAM,aAAa,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE;AAC9C,QAAQ,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;AACpC,YAAY,IAAI,IAAI,KAAK,MAAM,EAAE;AACjC,gBAAgB,OAAO,SAAS;AAChC;AACA,iBAAiB;AACjB,gBAAgB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC;AAC1D;AACA,SAAS;AACT,KAAK,CAAC;AACN,IAAI,OAAO,aAAa;AACxB,CAAC;AACD;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AAC/C,IAAI,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC;AAC1C,QAAQ,IAAI,EAAE,KAAK,EAAE,IAAI;AACzB,QAAQ,OAAO,EAAE,KAAK,CAAC,OAAO;AAC9B,QAAQ,eAAe,EAAE,KAAK;AAC9B,QAAQ,QAAQ;AAChB,KAAK,CAAC;AACN;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;AACtE,CAAC;;;;"}
1
+ {"version":3,"file":"serviceError.mjs","sources":["../../../src/utils/serviceError.ts"],"sourcesContent":["import { parseJsonError as parseAwsJsonError, } from '@aws-amplify/core/internals/aws-client-utils';\nimport { RestApiError } from '../errors';\n/**\n * Parses both AWS and non-AWS error responses coming from the users' backend code.\n * * AWS errors generated by the AWS services(e.g. API Gateway, Bedrock). They can be Signature errors,\n * ClockSkew errors, etc. These responses will be parsed to errors with proper name and message from the AWS\n * services.\n * * non-AWS errors thrown by the user code. They can contain any headers or body. Users need to access the\n * error.response to get the headers and body and parse them accordingly. The JS error name and message will\n * be `UnknownError` and `Unknown error` respectively.\n */\nexport const parseRestApiServiceError = async (response) => {\n if (!response) {\n // Response is not considered an error.\n return;\n }\n const parsedAwsError = await parseAwsJsonError(stubErrorResponse(response));\n if (!parsedAwsError) {\n // Response is not considered an error.\n }\n else {\n const bodyText = await response.body?.text();\n return buildRestApiError(parsedAwsError, {\n statusCode: response.statusCode,\n headers: response.headers,\n body: bodyText,\n });\n }\n};\n/**\n * The response object needs to be stub here because the parseAwsJsonError assumes the response body to be valid JSON.\n * Although this is true for AWS services, it is not true for responses from user's code. Once the response body is\n * unwrapped as JSON(and fail), it cannot be read as text again. Therefore, we need to stub the response body here to\n * make sure we can read the error response body as a JSON, and may fall back to read as text if it is not a valid JSON.\n */\nconst stubErrorResponse = (response) => {\n let bodyTextPromise;\n const bodyProxy = new Proxy(response.body, {\n get(target, prop, receiver) {\n if (prop === 'json') {\n // For potential AWS errors, error parser will try to parse the body as JSON first.\n return async () => {\n if (!bodyTextPromise) {\n bodyTextPromise = target.text();\n }\n try {\n return JSON.parse(await bodyTextPromise);\n }\n catch (error) {\n // If response body is not a valid JSON, we stub it to be an empty object and eventually parsed\n // as an unknown error\n return {};\n }\n };\n }\n else if (prop === 'text') {\n // For non-AWS errors, users can access the body as a string as a fallback.\n return async () => {\n if (!bodyTextPromise) {\n bodyTextPromise = target.text();\n }\n return bodyTextPromise;\n };\n }\n else {\n return Reflect.get(target, prop, receiver);\n }\n },\n });\n const responseProxy = new Proxy(response, {\n get(target, prop, receiver) {\n if (prop === 'body') {\n return bodyProxy;\n }\n else {\n return Reflect.get(target, prop, receiver);\n }\n },\n });\n return responseProxy;\n};\n/**\n * Utility to create a new RestApiError from a service error.\n */\nconst buildRestApiError = (error, response) => {\n const restApiError = new RestApiError({\n name: error?.name,\n message: error.message,\n underlyingError: error,\n response,\n });\n // $metadata is only required for backwards compatibility.\n return Object.assign(restApiError, { $metadata: error.$metadata });\n};\n"],"names":["parseAwsJsonError"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,wBAAwB,GAAG,OAAO,QAAQ,KAAK;AAC5D,IAAI,IAAI,CAAC,QAAQ,E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AE;AACvD,oBAAoB;AACpB,oBAAoB,OAAO,eAAe;AAC1C,gBAAgB,CAAC;AACjB,YAAY;AACZ,iBAAiB;AACjB,gBAAgB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC;AAC1D,YAAY;AACZ,QAAQ,CAAC;AACT,KAAK,CAAC;AACN,IAAI,MAAM,aAAa,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE;AAC9C,QAAQ,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;AACpC,YAAY,IAAI,IAAI,KAAK,MAAM,EAAE;AACjC,gBAAgB,OAAO,SAAS;AAChC,YAAY;AACZ,iBAAiB;AACjB,gBAAgB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC;AAC1D,YAAY;AACZ,QAAQ,CAAC;AACT,KAAK,CAAC;AACN,IAAI,OAAO,aAAa;AACxB,CAAC;AACD;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AAC/C,IAAI,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC;AAC1C,QAAQ,IAAI,EAAE,KAAK,EAAE,IAAI;AACzB,QAAQ,OAAO,EAAE,KAAK,CAAC,OAAO;AAC9B,QAAQ,eAAe,EAAE,KAAK;AAC9B,QAAQ,QAAQ;AAChB,KAAK,CAAC;AACN;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;AACtE,CAAC;;;;"}
package/package.json CHANGED
@@ -1,95 +1,95 @@
1
1
  {
2
- "name": "@aws-amplify/api-rest",
3
- "private": false,
4
- "version": "4.1.9-unstable.e5a8569.0+e5a8569",
5
- "description": "Api-rest category of aws-amplify",
6
- "main": "./dist/cjs/index.js",
7
- "module": "./dist/esm/index.mjs",
8
- "typings": "./dist/esm/index.d.ts",
9
- "react-native": "./dist/cjs/index.js",
10
- "publishConfig": {
11
- "access": "public"
12
- },
13
- "scripts": {
14
- "test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
15
- "test:watch": "jest -w 1 --watch",
16
- "build-with-test": "npm test && npm build",
17
- "build:umd": "webpack && webpack --config ./webpack.config.dev.js",
18
- "build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
19
- "build:watch": "npm run build:esm-cjs -- --watch",
20
- "build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
21
- "clean": "npm run clean:size && rimraf dist lib lib-esm",
22
- "clean:size": "rimraf dual-publish-tmp tmp*",
23
- "format": "echo \"Not implemented\"",
24
- "lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
25
- "lint:fix": "eslint '**/*.{ts,tsx}' --fix",
26
- "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 70.0"
27
- },
28
- "exports": {
29
- ".": {
30
- "react-native": "./dist/cjs/index.js",
31
- "types": "./dist/esm/index.d.ts",
32
- "import": "./dist/esm/index.mjs",
33
- "require": "./dist/cjs/index.js"
34
- },
35
- "./server": {
36
- "types": "./dist/esm/server.d.ts",
37
- "import": "./dist/esm/server.mjs",
38
- "require": "./dist/cjs/server.js"
39
- },
40
- "./internals": {
41
- "react-native": "./dist/cjs/internals/index.js",
42
- "types": "./dist/esm/internals/index.d.ts",
43
- "import": "./dist/esm/internals/index.mjs",
44
- "require": "./dist/cjs/internals/index.js"
45
- },
46
- "./internals/server": {
47
- "types": "./dist/esm/internals/server.d.ts",
48
- "import": "./dist/esm/internals/server.mjs",
49
- "require": "./dist/cjs/internals/server.js"
50
- },
51
- "./package.json": "./package.json"
52
- },
53
- "typesVersions": {
54
- ">=4.2": {
55
- "server": [
56
- "./dist/esm/server.d.ts"
57
- ],
58
- "internals": [
59
- "./dist/esm/internals/index.d.ts"
60
- ],
61
- "internals/server": [
62
- "./dist/esm/internals/server.d.ts"
63
- ]
64
- }
65
- },
66
- "repository": {
67
- "type": "git",
68
- "url": "https://github.com/aws-amplify/amplify-js.git"
69
- },
70
- "author": "Amazon Web Services",
71
- "license": "Apache-2.0",
72
- "bugs": {
73
- "url": "https://github.com/aws/aws-amplify/issues"
74
- },
75
- "homepage": "https://aws-amplify.github.io/",
76
- "files": [
77
- "dist/cjs",
78
- "dist/esm",
79
- "src",
80
- "internals",
81
- "server"
82
- ],
83
- "dependencies": {
84
- "tslib": "^2.5.0"
85
- },
86
- "peerDependencies": {
87
- "@aws-amplify/core": "6.12.4-unstable.e5a8569.0+e5a8569"
88
- },
89
- "devDependencies": {
90
- "@aws-amplify/core": "6.12.4-unstable.e5a8569.0+e5a8569",
91
- "@aws-amplify/react-native": "1.1.11-unstable.e5a8569.0+e5a8569",
92
- "@aws-sdk/types": "3.387.0"
93
- },
94
- "gitHead": "e5a85697101735c21548e397832fab12d001a5dc"
2
+ "name": "@aws-amplify/api-rest",
3
+ "private": false,
4
+ "version": "4.2.0",
5
+ "description": "Api-rest category of aws-amplify",
6
+ "main": "./dist/cjs/index.js",
7
+ "module": "./dist/esm/index.mjs",
8
+ "typings": "./dist/esm/index.d.ts",
9
+ "react-native": "./dist/cjs/index.js",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "scripts": {
14
+ "test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
15
+ "test:watch": "jest -w 1 --watch",
16
+ "build-with-test": "npm test && npm build",
17
+ "build:umd": "webpack && webpack --config ./webpack.config.dev.js",
18
+ "build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
19
+ "build:watch": "npm run build:esm-cjs -- --watch",
20
+ "build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
21
+ "clean": "npm run clean:size && rimraf dist lib lib-esm",
22
+ "clean:size": "rimraf dual-publish-tmp tmp*",
23
+ "format": "echo \"Not implemented\"",
24
+ "lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
25
+ "lint:fix": "eslint '**/*.{ts,tsx}' --fix",
26
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 70.0"
27
+ },
28
+ "exports": {
29
+ ".": {
30
+ "react-native": "./dist/cjs/index.js",
31
+ "types": "./dist/esm/index.d.ts",
32
+ "import": "./dist/esm/index.mjs",
33
+ "require": "./dist/cjs/index.js"
34
+ },
35
+ "./server": {
36
+ "types": "./dist/esm/server.d.ts",
37
+ "import": "./dist/esm/server.mjs",
38
+ "require": "./dist/cjs/server.js"
39
+ },
40
+ "./internals": {
41
+ "react-native": "./dist/cjs/internals/index.js",
42
+ "types": "./dist/esm/internals/index.d.ts",
43
+ "import": "./dist/esm/internals/index.mjs",
44
+ "require": "./dist/cjs/internals/index.js"
45
+ },
46
+ "./internals/server": {
47
+ "types": "./dist/esm/internals/server.d.ts",
48
+ "import": "./dist/esm/internals/server.mjs",
49
+ "require": "./dist/cjs/internals/server.js"
50
+ },
51
+ "./package.json": "./package.json"
52
+ },
53
+ "typesVersions": {
54
+ ">=4.2": {
55
+ "server": [
56
+ "./dist/esm/server.d.ts"
57
+ ],
58
+ "internals": [
59
+ "./dist/esm/internals/index.d.ts"
60
+ ],
61
+ "internals/server": [
62
+ "./dist/esm/internals/server.d.ts"
63
+ ]
64
+ }
65
+ },
66
+ "repository": {
67
+ "type": "git",
68
+ "url": "https://github.com/aws-amplify/amplify-js.git"
69
+ },
70
+ "author": "Amazon Web Services",
71
+ "license": "Apache-2.0",
72
+ "bugs": {
73
+ "url": "https://github.com/aws/aws-amplify/issues"
74
+ },
75
+ "homepage": "https://aws-amplify.github.io/",
76
+ "files": [
77
+ "dist/cjs",
78
+ "dist/esm",
79
+ "src",
80
+ "internals",
81
+ "server"
82
+ ],
83
+ "dependencies": {
84
+ "tslib": "^2.5.0"
85
+ },
86
+ "peerDependencies": {
87
+ "@aws-amplify/core": "^6.1.0"
88
+ },
89
+ "devDependencies": {
90
+ "@aws-amplify/core": "6.13.0",
91
+ "@aws-amplify/react-native": "1.1.10",
92
+ "@aws-sdk/types": "3.387.0"
93
+ },
94
+ "gitHead": "4c55a0bc68f5ea90c93e50c652964c74393e847a"
95
95
  }
@@ -6,14 +6,14 @@ export type GetInput = ApiInput<RestApiOptionsBase>;
6
6
  export type PostInput = ApiInput<RestApiOptionsBase>;
7
7
  export type PutInput = ApiInput<RestApiOptionsBase>;
8
8
  export type PatchInput = ApiInput<RestApiOptionsBase>;
9
- export type DeleteInput = ApiInput<Omit<RestApiOptionsBase, 'body'>>;
9
+ export type DeleteInput = ApiInput<RestApiOptionsBase>;
10
10
  export type HeadInput = ApiInput<Omit<RestApiOptionsBase, 'body'>>;
11
11
 
12
12
  export type GetOperation = Operation<RestApiResponse>;
13
13
  export type PostOperation = Operation<RestApiResponse>;
14
14
  export type PutOperation = Operation<RestApiResponse>;
15
15
  export type PatchOperation = Operation<RestApiResponse>;
16
- export type DeleteOperation = Operation<Omit<RestApiResponse, 'body'>>;
16
+ export type DeleteOperation = Operation<RestApiResponse>;
17
17
  export type HeadOperation = Operation<Omit<RestApiResponse, 'body'>>;
18
18
 
19
19
  /**