@aws-amplify/core 6.12.4-unstable.d6f1422.0 → 6.13.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.
- package/dist/cjs/BackgroundProcessManager/BackgroundManagerNotOpenError.js.map +1 -1
- package/dist/cjs/BackgroundProcessManager/BackgroundProcessManager.js.map +1 -1
- package/dist/cjs/BackgroundProcessManager/index.js.map +1 -1
- package/dist/cjs/Cache/StorageCache.js.map +1 -1
- package/dist/cjs/Cache/StorageCache.native.js.map +1 -1
- package/dist/cjs/Cache/StorageCacheCommon.js.map +1 -1
- package/dist/cjs/Cache/utils/CacheList.js.map +1 -1
- package/dist/cjs/Cache/utils/cacheHelpers.js.map +1 -1
- package/dist/cjs/Cache/utils/index.js.map +1 -1
- package/dist/cjs/Hub/index.js.map +1 -1
- package/dist/cjs/I18n/I18n.js.map +1 -1
- package/dist/cjs/I18n/index.js.map +1 -1
- package/dist/cjs/I18n/types.js.map +1 -1
- package/dist/cjs/Logger/ConsoleLogger.js.map +1 -1
- package/dist/cjs/Logger/index.js.map +1 -1
- package/dist/cjs/Mutex/Mutex.js.map +1 -1
- package/dist/cjs/Mutex/index.js.map +1 -1
- package/dist/cjs/Platform/customUserAgent.js.map +1 -1
- package/dist/cjs/Platform/detectFramework.js.map +1 -1
- package/dist/cjs/Platform/detection/React.js.map +1 -1
- package/dist/cjs/Platform/index.js.map +1 -1
- package/dist/cjs/Platform/version.js +1 -1
- package/dist/cjs/Platform/version.js.map +1 -1
- package/dist/cjs/Reachability/Reachability.js.map +1 -1
- package/dist/cjs/Reachability/Reachability.native.js.map +1 -1
- package/dist/cjs/Reachability/index.js.map +1 -1
- package/dist/cjs/ServiceWorker/ServiceWorker.js.map +1 -1
- package/dist/cjs/ServiceWorker/index.js.map +1 -1
- package/dist/cjs/Signer/DateUtils.js.map +1 -1
- package/dist/cjs/Signer/Signer.js.map +1 -1
- package/dist/cjs/Signer/index.js.map +1 -1
- package/dist/cjs/adapterCore/error/AmplifyServerContextError.js.map +1 -1
- package/dist/cjs/adapterCore/error/index.js.map +1 -1
- package/dist/cjs/adapterCore/index.js.map +1 -1
- package/dist/cjs/adapterCore/serverContext/index.js.map +1 -1
- package/dist/cjs/adapterCore/serverContext/serverContext.js.map +1 -1
- package/dist/cjs/adapterCore/serverContext/serverContextRegistry.js.map +1 -1
- package/dist/cjs/awsClients/pinpoint/base.js.map +1 -1
- package/dist/cjs/awsClients/pinpoint/getInAppMessages.js.map +1 -1
- package/dist/cjs/awsClients/pinpoint/index.js.map +1 -1
- package/dist/cjs/awsClients/pinpoint/putEvents.js.map +1 -1
- package/dist/cjs/awsClients/pinpoint/updateEndpoint.js.map +1 -1
- package/dist/cjs/clients/endpoints/getDnsSuffix.js.map +1 -1
- package/dist/cjs/clients/endpoints/index.js.map +1 -1
- package/dist/cjs/clients/handlers/fetch.js.map +1 -1
- package/dist/cjs/clients/index.js.map +1 -1
- package/dist/cjs/clients/internal/composeServiceApi.js.map +1 -1
- package/dist/cjs/clients/internal/composeTransferHandler.js.map +1 -1
- package/dist/cjs/clients/internal/index.js.map +1 -1
- package/dist/cjs/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.js.map +1 -1
- package/dist/cjs/clients/middleware/retry/amzSdkRequestHeaderMiddleware.js.map +1 -1
- package/dist/cjs/clients/middleware/retry/index.js.map +1 -1
- package/dist/cjs/clients/middleware/retry/retryMiddleware.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/index.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/middleware.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/signer/signatureV4/index.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/signer/signatureV4/presignUrl.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/signer/signatureV4/signRequest.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js.map +1 -1
- package/dist/cjs/clients/middleware/userAgent/index.js.map +1 -1
- package/dist/cjs/clients/middleware/userAgent/middleware.js.map +1 -1
- package/dist/cjs/clients/serde/index.js.map +1 -1
- package/dist/cjs/clients/serde/json.js.map +1 -1
- package/dist/cjs/clients/utils/memoization.js.map +1 -1
- package/dist/cjs/errors/APIError.js.map +1 -1
- package/dist/cjs/errors/AmplifyError.js.map +1 -1
- package/dist/cjs/errors/PlatformNotSupportedError.js.map +1 -1
- package/dist/cjs/errors/createAssertionFunction.js.map +1 -1
- package/dist/cjs/errors/index.js.map +1 -1
- package/dist/cjs/foundation/factories/middleware/index.js.map +1 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.js.map +1 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.js.map +1 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/handler/index.js.map +1 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/index.js.map +1 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/serde/index.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/libraryUtils.js.map +1 -1
- package/dist/cjs/parseAWSExports.js.map +1 -1
- package/dist/cjs/parseAmplifyOutputs.js.map +1 -1
- package/dist/cjs/providers/pinpoint/apis/index.js.map +1 -1
- package/dist/cjs/providers/pinpoint/apis/record.js.map +1 -1
- package/dist/cjs/providers/pinpoint/apis/updateEndpoint.js.map +1 -1
- package/dist/cjs/providers/pinpoint/index.js.map +1 -1
- package/dist/cjs/providers/pinpoint/types/index.js.map +1 -1
- package/dist/cjs/providers/pinpoint/utils/PinpointEventBuffer.js.map +1 -1
- package/dist/cjs/providers/pinpoint/utils/createEndpointId.js.map +1 -1
- package/dist/cjs/providers/pinpoint/utils/getEventBuffer.js.map +1 -1
- package/dist/cjs/providers/pinpoint/utils/index.js.map +1 -1
- package/dist/cjs/providers/pinpoint/utils/resolveEndpointId.js.map +1 -1
- package/dist/cjs/server.js.map +1 -1
- package/dist/cjs/singleton/Amplify.js.map +1 -1
- package/dist/cjs/singleton/Auth/index.js +2 -2
- package/dist/cjs/singleton/Auth/index.js.map +1 -1
- package/dist/cjs/singleton/Auth/utils/index.js.map +1 -1
- package/dist/cjs/singleton/apis/fetchAuthSession.js +2 -2
- package/dist/cjs/singleton/apis/fetchAuthSession.js.map +1 -1
- package/dist/cjs/singleton/index.js.map +1 -1
- package/dist/cjs/storage/CookieStorage.js.map +1 -1
- package/dist/cjs/storage/DefaultStorage.js.map +1 -1
- package/dist/cjs/storage/DefaultStorage.native.js.map +1 -1
- package/dist/cjs/storage/InMemoryStorage.js.map +1 -1
- package/dist/cjs/storage/KeyValueStorage.js.map +1 -1
- package/dist/cjs/storage/SessionStorage.js.map +1 -1
- package/dist/cjs/storage/SyncKeyValueStorage.js.map +1 -1
- package/dist/cjs/storage/SyncSessionStorage.js.map +1 -1
- package/dist/cjs/storage/index.js.map +1 -1
- package/dist/cjs/storage/utils.js.map +1 -1
- package/dist/cjs/utils/WordArray.js.map +1 -1
- package/dist/cjs/utils/convert/base64/base64Decoder.js.map +1 -1
- package/dist/cjs/utils/convert/base64/base64Encoder.js.map +1 -1
- package/dist/cjs/utils/convert/index.js.map +1 -1
- package/dist/cjs/utils/deDupeAsyncFunction.js.map +1 -1
- package/dist/cjs/utils/deepFreeze.js.map +1 -1
- package/dist/cjs/utils/deviceName/index.js.map +1 -1
- package/dist/cjs/utils/generateRandomString.js.map +1 -1
- package/dist/cjs/utils/getClientInfo/getClientInfo.ios.js.map +1 -1
- package/dist/cjs/utils/getClientInfo/getClientInfo.js.map +1 -1
- package/dist/cjs/utils/getClientInfo/index.js.map +1 -1
- package/dist/cjs/utils/globalHelpers/index.js.map +1 -1
- package/dist/cjs/utils/globalHelpers/index.native.js.map +1 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/isWebWorker.js.map +1 -1
- package/dist/cjs/utils/parseAmplifyConfig.js.map +1 -1
- package/dist/cjs/utils/queuedStorage/createQueuedStorage.js.map +1 -1
- package/dist/cjs/utils/queuedStorage/createQueuedStorage.native.js.map +1 -1
- package/dist/cjs/utils/queuedStorage/index.js.map +1 -1
- package/dist/cjs/utils/retry/NonRetryableError.js.map +1 -1
- package/dist/cjs/utils/retry/index.js.map +1 -1
- package/dist/cjs/utils/retry/jitteredBackoff.js.map +1 -1
- package/dist/cjs/utils/retry/retry.js.map +1 -1
- package/dist/cjs/utils/sessionListener/SessionListener.js.map +1 -1
- package/dist/cjs/utils/sessionListener/SessionListener.native.js.map +1 -1
- package/dist/cjs/utils/sessionListener/index.js.map +1 -1
- package/dist/esm/BackgroundProcessManager/BackgroundManagerNotOpenError.mjs.map +1 -1
- package/dist/esm/BackgroundProcessManager/BackgroundProcessManager.mjs.map +1 -1
- package/dist/esm/Cache/StorageCache.mjs.map +1 -1
- package/dist/esm/Cache/StorageCache.native.mjs.map +1 -1
- package/dist/esm/Cache/StorageCacheCommon.mjs.map +1 -1
- package/dist/esm/Cache/utils/CacheList.mjs.map +1 -1
- package/dist/esm/Cache/utils/cacheHelpers.mjs.map +1 -1
- package/dist/esm/Hub/index.mjs.map +1 -1
- package/dist/esm/I18n/I18n.mjs.map +1 -1
- package/dist/esm/I18n/index.mjs.map +1 -1
- package/dist/esm/I18n/types.mjs.map +1 -1
- package/dist/esm/Logger/ConsoleLogger.mjs.map +1 -1
- package/dist/esm/Mutex/Mutex.mjs.map +1 -1
- package/dist/esm/Platform/customUserAgent.mjs.map +1 -1
- package/dist/esm/Platform/detectFramework.mjs.map +1 -1
- package/dist/esm/Platform/detection/React.mjs.map +1 -1
- package/dist/esm/Platform/index.mjs.map +1 -1
- package/dist/esm/Platform/version.d.ts +1 -1
- package/dist/esm/Platform/version.mjs +1 -1
- package/dist/esm/Platform/version.mjs.map +1 -1
- package/dist/esm/Reachability/Reachability.mjs.map +1 -1
- package/dist/esm/Reachability/Reachability.native.mjs.map +1 -1
- package/dist/esm/ServiceWorker/ServiceWorker.mjs.map +1 -1
- package/dist/esm/Signer/DateUtils.mjs.map +1 -1
- package/dist/esm/Signer/Signer.mjs.map +1 -1
- package/dist/esm/adapterCore/error/AmplifyServerContextError.mjs.map +1 -1
- package/dist/esm/adapterCore/serverContext/serverContext.mjs.map +1 -1
- package/dist/esm/adapterCore/serverContext/serverContextRegistry.mjs.map +1 -1
- package/dist/esm/awsClients/pinpoint/base.mjs.map +1 -1
- package/dist/esm/awsClients/pinpoint/getInAppMessages.mjs.map +1 -1
- package/dist/esm/awsClients/pinpoint/putEvents.mjs.map +1 -1
- package/dist/esm/awsClients/pinpoint/updateEndpoint.mjs.map +1 -1
- package/dist/esm/clients/endpoints/getDnsSuffix.mjs.map +1 -1
- package/dist/esm/clients/handlers/fetch.mjs.map +1 -1
- package/dist/esm/clients/internal/composeServiceApi.mjs.map +1 -1
- package/dist/esm/clients/internal/composeTransferHandler.mjs.map +1 -1
- package/dist/esm/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.mjs.map +1 -1
- package/dist/esm/clients/middleware/retry/amzSdkRequestHeaderMiddleware.mjs.map +1 -1
- package/dist/esm/clients/middleware/retry/retryMiddleware.mjs.map +1 -1
- package/dist/esm/clients/middleware/signing/middleware.mjs.map +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/presignUrl.mjs.map +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/signRequest.mjs.map +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.mjs.map +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.mjs.map +1 -1
- package/dist/esm/clients/middleware/signing/utils/getUpdatedSystemClockOffset.mjs.map +1 -1
- package/dist/esm/clients/middleware/userAgent/middleware.mjs.map +1 -1
- package/dist/esm/clients/serde/json.mjs.map +1 -1
- package/dist/esm/clients/utils/memoization.mjs.map +1 -1
- package/dist/esm/errors/APIError.mjs.map +1 -1
- package/dist/esm/errors/AmplifyError.mjs.map +1 -1
- package/dist/esm/errors/PlatformNotSupportedError.mjs.map +1 -1
- package/dist/esm/errors/createAssertionFunction.mjs.map +1 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.mjs.map +1 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.mjs.map +1 -1
- package/dist/esm/parseAWSExports.mjs.map +1 -1
- package/dist/esm/parseAmplifyOutputs.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/apis/record.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/apis/updateEndpoint.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/utils/PinpointEventBuffer.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/utils/createEndpointId.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/utils/getEventBuffer.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/utils/resolveEndpointId.mjs.map +1 -1
- package/dist/esm/singleton/Amplify.mjs.map +1 -1
- package/dist/esm/singleton/Auth/index.d.ts +2 -2
- package/dist/esm/singleton/Auth/index.mjs +2 -2
- package/dist/esm/singleton/Auth/index.mjs.map +1 -1
- package/dist/esm/singleton/Auth/utils/index.mjs.map +1 -1
- package/dist/esm/singleton/apis/fetchAuthSession.d.ts +2 -2
- package/dist/esm/singleton/apis/fetchAuthSession.mjs +2 -2
- package/dist/esm/singleton/apis/fetchAuthSession.mjs.map +1 -1
- package/dist/esm/storage/CookieStorage.mjs.map +1 -1
- package/dist/esm/storage/DefaultStorage.mjs.map +1 -1
- package/dist/esm/storage/DefaultStorage.native.mjs.map +1 -1
- package/dist/esm/storage/InMemoryStorage.mjs.map +1 -1
- package/dist/esm/storage/KeyValueStorage.mjs.map +1 -1
- package/dist/esm/storage/SessionStorage.mjs.map +1 -1
- package/dist/esm/storage/SyncKeyValueStorage.mjs.map +1 -1
- package/dist/esm/storage/SyncSessionStorage.mjs.map +1 -1
- package/dist/esm/storage/utils.mjs.map +1 -1
- package/dist/esm/utils/WordArray.mjs.map +1 -1
- package/dist/esm/utils/convert/base64/base64Decoder.mjs.map +1 -1
- package/dist/esm/utils/convert/base64/base64Encoder.mjs.map +1 -1
- package/dist/esm/utils/deDupeAsyncFunction.mjs.map +1 -1
- package/dist/esm/utils/deepFreeze.mjs.map +1 -1
- package/dist/esm/utils/generateRandomString.mjs.map +1 -1
- package/dist/esm/utils/getClientInfo/getClientInfo.ios.mjs.map +1 -1
- package/dist/esm/utils/getClientInfo/getClientInfo.mjs.map +1 -1
- package/dist/esm/utils/globalHelpers/index.mjs.map +1 -1
- package/dist/esm/utils/globalHelpers/index.native.mjs.map +1 -1
- package/dist/esm/utils/isWebWorker.mjs.map +1 -1
- package/dist/esm/utils/parseAmplifyConfig.mjs.map +1 -1
- package/dist/esm/utils/queuedStorage/createQueuedStorage.mjs.map +1 -1
- package/dist/esm/utils/queuedStorage/createQueuedStorage.native.mjs.map +1 -1
- package/dist/esm/utils/retry/NonRetryableError.mjs.map +1 -1
- package/dist/esm/utils/retry/jitteredBackoff.mjs.map +1 -1
- package/dist/esm/utils/retry/retry.mjs.map +1 -1
- package/dist/esm/utils/sessionListener/SessionListener.mjs.map +1 -1
- package/dist/esm/utils/sessionListener/SessionListener.native.mjs.map +1 -1
- package/package.json +3 -3
- package/src/Platform/version.ts +1 -1
- package/src/singleton/Auth/index.ts +2 -2
- package/src/singleton/apis/fetchAuthSession.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customUserAgent.js","sources":["../../../src/Platform/customUserAgent.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.getCustomUserAgent = exports.setCustomUserAgent = void 0;\n// Maintains custom user-agent state set by external consumers.\nconst customUserAgentState = {};\n/**\n * Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to\n * clean up any custom state set with this API.\n *\n * @note\n * This API operates globally. Calling this API multiple times will result in the most recently set values for a\n * particular API being used.\n *\n * @note\n * This utility IS NOT compatible with SSR.\n *\n * @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.\n */\nconst setCustomUserAgent = (input) => {\n // Save custom user-agent state & increment reference counter\n // TODO Remove `any` when we upgrade to TypeScript 5.2, see: https://github.com/microsoft/TypeScript/issues/44373\n customUserAgentState[input.category] = input.apis.reduce((acc, api) => ({\n ...acc,\n [api]: {\n refCount: acc[api]?.refCount ? acc[api].refCount + 1 : 1,\n additionalDetails: input.additionalDetails,\n },\n }), customUserAgentState[input.category] ?? {});\n // Callback that cleans up state for APIs recorded by this call\n let cleanUpCallbackCalled = false;\n const cleanUpCallback = () => {\n // Only allow the cleanup callback to be called once\n if (cleanUpCallbackCalled) {\n return;\n }\n cleanUpCallbackCalled = true;\n input.apis.forEach(api => {\n const apiRefCount = customUserAgentState[input.category][api].refCount;\n if (apiRefCount > 1) {\n customUserAgentState[input.category][api].refCount = apiRefCount - 1;\n }\n else {\n delete customUserAgentState[input.category][api];\n // Clean up category if no more APIs set\n if (!Object.keys(customUserAgentState[input.category]).length) {\n delete customUserAgentState[input.category];\n }\n }\n });\n };\n return cleanUpCallback;\n};\nexports.setCustomUserAgent = setCustomUserAgent;\nconst getCustomUserAgent = (category, api) => customUserAgentState[category]?.[api]?.additionalDetails;\nexports.getCustomUserAgent = getCustomUserAgent;\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,kBAAkB,GAAG,MAAM;AAChE;AACA,MAAM,oBAAoB,GAAG,EAAE;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,CAAC,KAAK,KAAK;AACtC;AACA;AACA,IAAI,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,MAAM;AAC5E,QAAQ,GAAG,GAAG;AACd,QAAQ,CAAC,GAAG,GAAG;AACf,YAAY,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,GAAG,CAAC;AACpE,YAAY,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;AACtD,SAAS;AACT,KAAK,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AACnD;AACA,IAAI,IAAI,qBAAqB,GAAG,KAAK;AACrC,IAAI,MAAM,eAAe,GAAG,MAAM;AAClC;AACA,QAAQ,IAAI,qBAAqB,EAAE;AACnC,YAAY;AACZ;
|
|
1
|
+
{"version":3,"file":"customUserAgent.js","sources":["../../../src/Platform/customUserAgent.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.getCustomUserAgent = exports.setCustomUserAgent = void 0;\n// Maintains custom user-agent state set by external consumers.\nconst customUserAgentState = {};\n/**\n * Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to\n * clean up any custom state set with this API.\n *\n * @note\n * This API operates globally. Calling this API multiple times will result in the most recently set values for a\n * particular API being used.\n *\n * @note\n * This utility IS NOT compatible with SSR.\n *\n * @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.\n */\nconst setCustomUserAgent = (input) => {\n // Save custom user-agent state & increment reference counter\n // TODO Remove `any` when we upgrade to TypeScript 5.2, see: https://github.com/microsoft/TypeScript/issues/44373\n customUserAgentState[input.category] = input.apis.reduce((acc, api) => ({\n ...acc,\n [api]: {\n refCount: acc[api]?.refCount ? acc[api].refCount + 1 : 1,\n additionalDetails: input.additionalDetails,\n },\n }), customUserAgentState[input.category] ?? {});\n // Callback that cleans up state for APIs recorded by this call\n let cleanUpCallbackCalled = false;\n const cleanUpCallback = () => {\n // Only allow the cleanup callback to be called once\n if (cleanUpCallbackCalled) {\n return;\n }\n cleanUpCallbackCalled = true;\n input.apis.forEach(api => {\n const apiRefCount = customUserAgentState[input.category][api].refCount;\n if (apiRefCount > 1) {\n customUserAgentState[input.category][api].refCount = apiRefCount - 1;\n }\n else {\n delete customUserAgentState[input.category][api];\n // Clean up category if no more APIs set\n if (!Object.keys(customUserAgentState[input.category]).length) {\n delete customUserAgentState[input.category];\n }\n }\n });\n };\n return cleanUpCallback;\n};\nexports.setCustomUserAgent = setCustomUserAgent;\nconst getCustomUserAgent = (category, api) => customUserAgentState[category]?.[api]?.additionalDetails;\nexports.getCustomUserAgent = getCustomUserAgent;\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,kBAAkB,GAAG,MAAM;AAChE;AACA,MAAM,oBAAoB,GAAG,EAAE;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,CAAC,KAAK,KAAK;AACtC;AACA;AACA,IAAI,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,MAAM;AAC5E,QAAQ,GAAG,GAAG;AACd,QAAQ,CAAC,GAAG,GAAG;AACf,YAAY,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,GAAG,CAAC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tG,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectFramework.js","sources":["../../../src/Platform/detectFramework.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.observeFrameworkChanges = exports.detectFramework = exports.frameworkChangeObservers = void 0;\nexports.clearCache = clearCache;\nconst types_1 = require(\"./types\");\nconst detection_1 = require(\"./detection\");\n// We want to cache detection since the framework won't change\nlet frameworkCache;\nexports.frameworkChangeObservers = [];\n// Setup the detection reset tracking / timeout delays\nlet resetTriggered = false;\nconst SSR_RESET_TIMEOUT = 10; // ms\nconst WEB_RESET_TIMEOUT = 10; // ms\nconst PRIME_FRAMEWORK_DELAY = 1000; // ms\nconst detectFramework = () => {\n if (!frameworkCache) {\n frameworkCache = (0, detection_1.detect)();\n if (resetTriggered) {\n // The final run of detectFramework:\n // Starting from this point, the `frameworkCache` becomes \"final\".\n // So we don't need to notify the observers again so the observer\n // can be removed after the final notice.\n while (exports.frameworkChangeObservers.length) {\n exports.frameworkChangeObservers.pop()?.();\n }\n }\n else {\n // The first run of detectFramework:\n // Every time we update the cache, call each observer function\n exports.frameworkChangeObservers.forEach(fcn => {\n fcn();\n });\n }\n // Retry once for either Unknown type after a delay (explained below)\n resetTimeout(types_1.Framework.ServerSideUnknown, SSR_RESET_TIMEOUT);\n resetTimeout(types_1.Framework.WebUnknown, WEB_RESET_TIMEOUT);\n }\n return frameworkCache;\n};\nexports.detectFramework = detectFramework;\n/**\n * @internal Setup observer callback that will be called everytime the framework changes\n */\nconst observeFrameworkChanges = (fcn) => {\n // When the `frameworkCache` won't be updated again, we ignore all incoming\n // observers.\n if (resetTriggered) {\n return;\n }\n exports.frameworkChangeObservers.push(fcn);\n};\nexports.observeFrameworkChanges = observeFrameworkChanges;\nfunction clearCache() {\n frameworkCache = undefined;\n}\n// For a framework type and a delay amount, setup the event to re-detect\n// During the runtime boot, it is possible that framework detection will\n// be triggered before the framework has made modifications to the\n// global/window/etc needed for detection. When no framework is detected\n// we will reset and try again to ensure we don't use a cached\n// non-framework detection result for all requests.\nfunction resetTimeout(framework, delay) {\n if (frameworkCache === framework && !resetTriggered) {\n setTimeout(() => {\n clearCache();\n resetTriggered = true;\n setTimeout(exports.detectFramework, PRIME_FRAMEWORK_DELAY);\n }, delay);\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,uBAAuB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,wBAAwB,GAAG,MAAM;AACrG,OAAO,CAAC,UAAU,GAAG,UAAU;AAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C;AACA,IAAI,cAAc;AAClB,OAAO,CAAC,wBAAwB,GAAG,EAAE;AACrC;AACA,IAAI,cAAc,GAAG,KAAK;AAC1B,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,eAAe,GAAG,MAAM;AAC9B,IAAI,IAAI,CAAC,cAAc,EAAE;AACzB,QAAQ,cAAc,GAAG,IAAI,WAAW,CAAC,MAAM,GAAG;AAClD,QAAQ,IAAI,cAAc,EAAE;AAC5B;AACA;AACA;AACA;AACA,YAAY,OAAO,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE;AAC5D,gBAAgB,OAAO,CAAC,wBAAwB,CAAC,GAAG,EAAE,IAAI;AAC1D;
|
|
1
|
+
{"version":3,"file":"detectFramework.js","sources":["../../../src/Platform/detectFramework.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.observeFrameworkChanges = exports.detectFramework = exports.frameworkChangeObservers = void 0;\nexports.clearCache = clearCache;\nconst types_1 = require(\"./types\");\nconst detection_1 = require(\"./detection\");\n// We want to cache detection since the framework won't change\nlet frameworkCache;\nexports.frameworkChangeObservers = [];\n// Setup the detection reset tracking / timeout delays\nlet resetTriggered = false;\nconst SSR_RESET_TIMEOUT = 10; // ms\nconst WEB_RESET_TIMEOUT = 10; // ms\nconst PRIME_FRAMEWORK_DELAY = 1000; // ms\nconst detectFramework = () => {\n if (!frameworkCache) {\n frameworkCache = (0, detection_1.detect)();\n if (resetTriggered) {\n // The final run of detectFramework:\n // Starting from this point, the `frameworkCache` becomes \"final\".\n // So we don't need to notify the observers again so the observer\n // can be removed after the final notice.\n while (exports.frameworkChangeObservers.length) {\n exports.frameworkChangeObservers.pop()?.();\n }\n }\n else {\n // The first run of detectFramework:\n // Every time we update the cache, call each observer function\n exports.frameworkChangeObservers.forEach(fcn => {\n fcn();\n });\n }\n // Retry once for either Unknown type after a delay (explained below)\n resetTimeout(types_1.Framework.ServerSideUnknown, SSR_RESET_TIMEOUT);\n resetTimeout(types_1.Framework.WebUnknown, WEB_RESET_TIMEOUT);\n }\n return frameworkCache;\n};\nexports.detectFramework = detectFramework;\n/**\n * @internal Setup observer callback that will be called everytime the framework changes\n */\nconst observeFrameworkChanges = (fcn) => {\n // When the `frameworkCache` won't be updated again, we ignore all incoming\n // observers.\n if (resetTriggered) {\n return;\n }\n exports.frameworkChangeObservers.push(fcn);\n};\nexports.observeFrameworkChanges = observeFrameworkChanges;\nfunction clearCache() {\n frameworkCache = undefined;\n}\n// For a framework type and a delay amount, setup the event to re-detect\n// During the runtime boot, it is possible that framework detection will\n// be triggered before the framework has made modifications to the\n// global/window/etc needed for detection. When no framework is detected\n// we will reset and try again to ensure we don't use a cached\n// non-framework detection result for all requests.\nfunction resetTimeout(framework, delay) {\n if (frameworkCache === framework && !resetTriggered) {\n setTimeout(() => {\n clearCache();\n resetTriggered = true;\n setTimeout(exports.detectFramework, PRIME_FRAMEWORK_DELAY);\n }, delay);\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,uBAAuB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,wBAAwB,GAAG,MAAM;AACrG,OAAO,CAAC,UAAU,GAAG,UAAU;AAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C;AACA,IAAI,cAAc;AAClB,OAAO,CAAC,wBAAwB,GAAG,EAAE;AACrC;AACA,IAAI,cAAc,GAAG,KAAK;AAC1B,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,eAAe,GAAG,MAAM;AAC9B,IAAI,IAAI,CAAC,cAAc,EAAE;AACzB,QAAQ,cAAc,GAAG,IAAI,WAAW,CAAC,MAAM,GAAG;AAClD,QAAQ,IAAI,cAAc,EAAE;AAC5B;AACA;AACA;AACA;AACA,YAAY,OAAO,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE;AAC5D,gBAAgB,OAAO,CAAC,wBAAwB,CAAC,GAAG,EAAE,IAAI;AAC1D,YAAY;AACZ,QAAQ;AACR,aAAa;AACb;AACA;AACA,YAAY,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,GAAG,IAAI;AAC5D,gBAAgB,GAAG,EAAE;AACrB,YAAY,CAAC,CAAC;AACd,QAAQ;AACR;AACA,QAAQ,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;AAC5E,QAAQ,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,iBAAiB,CAAC;AACrE,IAAI;AACJ,IAAI,OAAO,cAAc;AACzB,CAAC;AACD,OAAO,CAAC,eAAe,GAAG,eAAe;AACzC;AACA;AACA;AACA,MAAM,uBAAuB,GAAG,CAAC,GAAG,KAAK;AACzC;AACA;AACA,IAAI,IAAI,cAAc,EAAE;AACxB,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC;AAC9C,CAAC;AACD,OAAO,CAAC,uBAAuB,GAAG,uBAAuB;AACzD,SAAS,UAAU,GAAG;AACtB,IAAI,cAAc,GAAG,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE;AACxC,IAAI,IAAI,cAAc,KAAK,SAAS,IAAI,CAAC,cAAc,EAAE;AACzD,QAAQ,UAAU,CAAC,MAAM;AACzB,YAAY,UAAU,EAAE;AACxB,YAAY,cAAc,GAAG,IAAI;AACjC,YAAY,UAAU,CAAC,OAAO,CAAC,eAAe,EAAE,qBAAqB,CAAC;AACtE,QAAQ,CAAC,EAAE,KAAK,CAAC;AACjB,IAAI;AACJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"React.js","sources":["../../../../src/Platform/detection/React.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.reactWebDetect = reactWebDetect;\nexports.reactSSRDetect = reactSSRDetect;\nconst helpers_1 = require(\"./helpers\");\n// Tested with react 18.2 - built using Vite\nfunction reactWebDetect() {\n const elementKeyPrefixedWithReact = (key) => {\n return key.startsWith('_react') || key.startsWith('__react');\n };\n const elementIsReactEnabled = (element) => {\n return Object.keys(element).find(elementKeyPrefixedWithReact);\n };\n const allElementsWithId = () => Array.from(document.querySelectorAll('[id]'));\n return (0, helpers_1.documentExists)() && allElementsWithId().some(elementIsReactEnabled);\n}\nfunction reactSSRDetect() {\n return ((0, helpers_1.processExists)() &&\n typeof process.env !== 'undefined' &&\n !!Object.keys(process.env).find(key => key.includes('react')));\n}\n// use the some\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,cAAc;AACvC,OAAO,CAAC,cAAc,GAAG,cAAc;AACvC,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;AACtC;AACA,SAAS,cAAc,GAAG;AAC1B,IAAI,MAAM,2BAA2B,GAAG,CAAC,GAAG,KAAK;AACjD,QAAQ,OAAO,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;AACpE,
|
|
1
|
+
{"version":3,"file":"React.js","sources":["../../../../src/Platform/detection/React.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.reactWebDetect = reactWebDetect;\nexports.reactSSRDetect = reactSSRDetect;\nconst helpers_1 = require(\"./helpers\");\n// Tested with react 18.2 - built using Vite\nfunction reactWebDetect() {\n const elementKeyPrefixedWithReact = (key) => {\n return key.startsWith('_react') || key.startsWith('__react');\n };\n const elementIsReactEnabled = (element) => {\n return Object.keys(element).find(elementKeyPrefixedWithReact);\n };\n const allElementsWithId = () => Array.from(document.querySelectorAll('[id]'));\n return (0, helpers_1.documentExists)() && allElementsWithId().some(elementIsReactEnabled);\n}\nfunction reactSSRDetect() {\n return ((0, helpers_1.processExists)() &&\n typeof process.env !== 'undefined' &&\n !!Object.keys(process.env).find(key => key.includes('react')));\n}\n// use the some\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,cAAc;AACvC,OAAO,CAAC,cAAc,GAAG,cAAc;AACvC,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;AACtC;AACA,SAAS,cAAc,GAAG;AAC1B,IAAI,MAAM,2BAA2B,GAAG,CAAC,GAAG,KAAK;AACjD,QAAQ,OAAO,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;AACpE,IAAI,CAAC;AACL,IAAI,MAAM,qBAAqB,GAAG,CAAC,OAAO,KAAK;AAC/C,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC;AACrE,IAAI,CAAC;AACL,IAAI,MAAM,iBAAiB,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACjF,IAAI,OAAO,IAAI,SAAS,CAAC,cAAc,GAAG,IAAI,iBAAiB,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC;AAC7F;AACA,SAAS,cAAc,GAAG;AAC1B,IAAI,QAAQ,IAAI,SAAS,CAAC,aAAa,GAAG;AAC1C,QAAQ,OAAO,OAAO,CAAC,GAAG,KAAK,WAAW;AAC1C,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACrE;AACA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/Platform/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.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.sanitizeAmplifyVersion = void 0;\nconst types_1 = require(\"./types\");\nconst version_1 = require(\"./version\");\nconst detectFramework_1 = require(\"./detectFramework\");\nconst customUserAgent_1 = require(\"./customUserAgent\");\nconst BASE_USER_AGENT = `aws-amplify`;\n/** Sanitize Amplify version string be removing special character + and character post the special character */\nconst sanitizeAmplifyVersion = (amplifyVersion) => amplifyVersion.replace(/\\+.*/, '');\nexports.sanitizeAmplifyVersion = sanitizeAmplifyVersion;\nclass PlatformBuilder {\n constructor() {\n this.userAgent = `${BASE_USER_AGENT}/${(0, exports.sanitizeAmplifyVersion)(version_1.version)}`;\n }\n get framework() {\n return (0, detectFramework_1.detectFramework)();\n }\n get isReactNative() {\n return (this.framework === types_1.Framework.ReactNative ||\n this.framework === types_1.Framework.Expo);\n }\n observeFrameworkChanges(fcn) {\n (0, detectFramework_1.observeFrameworkChanges)(fcn);\n }\n}\nexports.Platform = new PlatformBuilder();\nconst getAmplifyUserAgentObject = ({ category, action, } = {}) => {\n const userAgent = [\n [BASE_USER_AGENT, (0, exports.sanitizeAmplifyVersion)(version_1.version)],\n ];\n if (category) {\n userAgent.push([category, action]);\n }\n userAgent.push(['framework', (0, detectFramework_1.detectFramework)()]);\n if (category && action) {\n const customState = (0, customUserAgent_1.getCustomUserAgent)(category, action);\n if (customState) {\n customState.forEach(state => {\n userAgent.push(state);\n });\n }\n }\n return userAgent;\n};\nexports.getAmplifyUserAgentObject = getAmplifyUserAgentObject;\nconst getAmplifyUserAgent = (customUserAgentDetails) => {\n const userAgent = (0, exports.getAmplifyUserAgentObject)(customUserAgentDetails);\n const userAgentString = userAgent\n .map(([agentKey, agentValue]) => agentKey && agentValue ? `${agentKey}/${agentValue}` : agentKey)\n .join(' ');\n return userAgentString;\n};\nexports.getAmplifyUserAgent = getAmplifyUserAgent;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,sBAAsB,GAAG,MAAM;AAC5H,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;AACtC,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,eAAe,GAAG,CAAC,WAAW,CAAC;AACrC;AACA,MAAM,sBAAsB,GAAG,CAAC,cAAc,KAAK,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;AACrF,OAAO,CAAC,sBAAsB,GAAG,sBAAsB;AACvD,MAAM,eAAe,CAAC;AACtB,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,sBAAsB,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;AACvG;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/Platform/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.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.sanitizeAmplifyVersion = void 0;\nconst types_1 = require(\"./types\");\nconst version_1 = require(\"./version\");\nconst detectFramework_1 = require(\"./detectFramework\");\nconst customUserAgent_1 = require(\"./customUserAgent\");\nconst BASE_USER_AGENT = `aws-amplify`;\n/** Sanitize Amplify version string be removing special character + and character post the special character */\nconst sanitizeAmplifyVersion = (amplifyVersion) => amplifyVersion.replace(/\\+.*/, '');\nexports.sanitizeAmplifyVersion = sanitizeAmplifyVersion;\nclass PlatformBuilder {\n constructor() {\n this.userAgent = `${BASE_USER_AGENT}/${(0, exports.sanitizeAmplifyVersion)(version_1.version)}`;\n }\n get framework() {\n return (0, detectFramework_1.detectFramework)();\n }\n get isReactNative() {\n return (this.framework === types_1.Framework.ReactNative ||\n this.framework === types_1.Framework.Expo);\n }\n observeFrameworkChanges(fcn) {\n (0, detectFramework_1.observeFrameworkChanges)(fcn);\n }\n}\nexports.Platform = new PlatformBuilder();\nconst getAmplifyUserAgentObject = ({ category, action, } = {}) => {\n const userAgent = [\n [BASE_USER_AGENT, (0, exports.sanitizeAmplifyVersion)(version_1.version)],\n ];\n if (category) {\n userAgent.push([category, action]);\n }\n userAgent.push(['framework', (0, detectFramework_1.detectFramework)()]);\n if (category && action) {\n const customState = (0, customUserAgent_1.getCustomUserAgent)(category, action);\n if (customState) {\n customState.forEach(state => {\n userAgent.push(state);\n });\n }\n }\n return userAgent;\n};\nexports.getAmplifyUserAgentObject = getAmplifyUserAgentObject;\nconst getAmplifyUserAgent = (customUserAgentDetails) => {\n const userAgent = (0, exports.getAmplifyUserAgentObject)(customUserAgentDetails);\n const userAgentString = userAgent\n .map(([agentKey, agentValue]) => agentKey && agentValue ? `${agentKey}/${agentValue}` : agentKey)\n .join(' ');\n return userAgentString;\n};\nexports.getAmplifyUserAgent = getAmplifyUserAgent;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,sBAAsB,GAAG,MAAM;AAC5H,MAAM,OAAO,GAAG,OAAO,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QAAQ,EAAE;AAClB,QAAQ,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI;AACJ,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,IAAI,iBAAiB,CAAC,eAAe,GAAG,CAAC,CAAC;AAC3E,IAAI,IAAI,QAAQ,IAAI,MAAM,EAAE;AAC5B,QAAQ,MAAM,WAAW,GAAG,IAAI,iBAAiB,CAAC,kBAAkB,EAAE,QAAQ,EAAE,MAAM,CAAC;AACvF,QAAQ,IAAI,WAAW,EAAE;AACzB,YAAY,WAAW,CAAC,OAAO,CAAC,KAAK,IAAI;AACzC,gBAAgB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;AACrC,YAAY,CAAC,CAAC;AACd,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,SAAS;AACpB,CAAC;AACD,OAAO,CAAC,yBAAyB,GAAG,yBAAyB;AAC7D,MAAM,mBAAmB,GAAG,CAAC,sBAAsB,KAAK;AACxD,IAAI,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC,yBAAyB,EAAE,sBAAsB,CAAC;AACpF,IAAI,MAAM,eAAe,GAAG;AAC5B,SAAS,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,QAAQ,IAAI,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,QAAQ;AACxG,SAAS,IAAI,CAAC,GAAG,CAAC;AAClB,IAAI,OAAO,eAAe;AAC1B,CAAC;AACD,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.15.4
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.15.4';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,OAAO,GAAG,MAAM;AACxB;AACA,OAAO,CAAC,OAAO,GAAG,QAAQ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reachability.js","sources":["../../../src/Reachability/Reachability.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.Reachability = void 0;\nconst rxjs_1 = require(\"rxjs\");\nconst utils_1 = require(\"../utils\");\nclass Reachability {\n networkMonitor(_) {\n const globalObj = (0, utils_1.isWebWorker)()\n ? self\n : typeof window !== 'undefined' && window;\n if (!globalObj) {\n return (0, rxjs_1.from)([{ online: true }]);\n }\n return new rxjs_1.Observable(observer => {\n observer.next({ online: globalObj.navigator.onLine });\n const notifyOnline = () => {\n observer.next({ online: true });\n };\n const notifyOffline = () => {\n observer.next({ online: false });\n };\n globalObj.addEventListener('online', notifyOnline);\n globalObj.addEventListener('offline', notifyOffline);\n Reachability._observers.push(observer);\n return () => {\n globalObj.removeEventListener('online', notifyOnline);\n globalObj.removeEventListener('offline', notifyOffline);\n Reachability._observers = Reachability._observers.filter(_observer => _observer !== observer);\n };\n });\n }\n // expose observers to simulate offline mode for integration testing\n static _observerOverride(status) {\n for (const observer of this._observers) {\n if (observer.closed) {\n this._observers = this._observers.filter(_observer => _observer !== observer);\n continue;\n }\n observer?.next && observer.next(status);\n }\n }\n}\nexports.Reachability = Reachability;\nReachability._observers = [];\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,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,YAAY,CAAC;AACnB,IAAI,cAAc,CAAC,CAAC,EAAE;AACtB,QAAQ,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC,WAAW;AACjD,cAAc;AACd,cAAc,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM;AACrD,QAAQ,IAAI,CAAC,SAAS,EAAE;AACxB,YAAY,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AACvD;
|
|
1
|
+
{"version":3,"file":"Reachability.js","sources":["../../../src/Reachability/Reachability.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.Reachability = void 0;\nconst rxjs_1 = require(\"rxjs\");\nconst utils_1 = require(\"../utils\");\nclass Reachability {\n networkMonitor(_) {\n const globalObj = (0, utils_1.isWebWorker)()\n ? self\n : typeof window !== 'undefined' && window;\n if (!globalObj) {\n return (0, rxjs_1.from)([{ online: true }]);\n }\n return new rxjs_1.Observable(observer => {\n observer.next({ online: globalObj.navigator.onLine });\n const notifyOnline = () => {\n observer.next({ online: true });\n };\n const notifyOffline = () => {\n observer.next({ online: false });\n };\n globalObj.addEventListener('online', notifyOnline);\n globalObj.addEventListener('offline', notifyOffline);\n Reachability._observers.push(observer);\n return () => {\n globalObj.removeEventListener('online', notifyOnline);\n globalObj.removeEventListener('offline', notifyOffline);\n Reachability._observers = Reachability._observers.filter(_observer => _observer !== observer);\n };\n });\n }\n // expose observers to simulate offline mode for integration testing\n static _observerOverride(status) {\n for (const observer of this._observers) {\n if (observer.closed) {\n this._observers = this._observers.filter(_observer => _observer !== observer);\n continue;\n }\n observer?.next && observer.next(status);\n }\n }\n}\nexports.Reachability = Reachability;\nReachability._observers = [];\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,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,YAAY,CAAC;AACnB,IAAI,cAAc,CAAC,CAAC,EAAE;AACtB,QAAQ,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC,WAAW;AACjD,cAAc;AACd,cAAc,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM;AACrD,QAAQ,IAAI,CAAC,SAAS,EAAE;AACxB,YAAY,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AACvD,QAAQ;AACR,QAAQ,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,IAAI;AACjD,YAAY,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;AACjE,YAAY,MAAM,YAAY,GAAG,MAAM;AACvC,gBAAgB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC/C,YAAY,CAAC;AACb,YAAY,MAAM,aAAa,GAAG,MAAM;AACxC,gBAAgB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAChD,YAAY,CAAC;AACb,YAAY,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC;AAC9D,YAAY,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC;AAChE,YAAY,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC;AAClD,YAAY,OAAO,MAAM;AACzB,gBAAgB,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC;AACrE,gBAAgB,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC;AACvE,gBAAgB,YAAY,CAAC,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,QAAQ,CAAC;AAC7G,YAAY,CAAC;AACb,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;AACA,IAAI,OAAO,iBAAiB,CAAC,MAAM,EAAE;AACrC,QAAQ,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;AAChD,YAAY,IAAI,QAAQ,CAAC,MAAM,EAAE;AACjC,gBAAgB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,QAAQ,CAAC;AAC7F,gBAAgB;AAChB,YAAY;AACZ,YAAY,QAAQ,EAAE,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;AACnD,QAAQ;AACR,IAAI;AACJ;AACA,OAAO,CAAC,YAAY,GAAG,YAAY;AACnC,YAAY,CAAC,UAAU,GAAG,EAAE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reachability.native.js","sources":["../../../src/Reachability/Reachability.native.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Reachability = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst rxjs_1 = require(\"rxjs\");\nconst Logger_1 = require(\"../Logger\");\nconst logger = new Logger_1.ConsoleLogger('Reachability', 'DEBUG');\nclass Reachability {\n networkMonitor(netInfo) {\n /**\n * Here netinfo refers to @react-native-community/netinfo\n * This is needed in React Native to enable network detection\n * We do not import it in Core so that Apps that do not use DataStore\n * Do not need to install and link this dependency\n * When using Reachability in React Native, pass NetInfo as a param to networkMonitor\n */\n if (!(netInfo && netInfo.addEventListener)) {\n throw new Error('NetInfo must be passed to networkMonitor to enable reachability in React Native');\n }\n return new rxjs_1.Observable(observer => {\n logger.log('subscribing to reachability in React Native');\n const unsubscribe = netInfo.addEventListener(({ isInternetReachable }) => {\n // `isInternetReachable` can sometimes be `null` initially, so we want\n // to make sure it is a boolean first before sending it to the observer.\n if (typeof isInternetReachable === 'boolean') {\n const online = isInternetReachable;\n logger.log('Notifying reachability change', online);\n observer.next({ online });\n }\n });\n return () => {\n unsubscribe();\n };\n });\n }\n}\nexports.Reachability = Reachability;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,YAAY,GAAG,MAAM;AAC7B;AACA;AACA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAC9B,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,cAAc,EAAE,OAAO,CAAC;AAClE,MAAM,YAAY,CAAC;AACnB,IAAI,cAAc,CAAC,OAAO,EAAE;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,EAAE,OAAO,IAAI,OAAO,CAAC,gBAAgB,CAAC,EAAE;AACpD,YAAY,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC;AAC9G;
|
|
1
|
+
{"version":3,"file":"Reachability.native.js","sources":["../../../src/Reachability/Reachability.native.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Reachability = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst rxjs_1 = require(\"rxjs\");\nconst Logger_1 = require(\"../Logger\");\nconst logger = new Logger_1.ConsoleLogger('Reachability', 'DEBUG');\nclass Reachability {\n networkMonitor(netInfo) {\n /**\n * Here netinfo refers to @react-native-community/netinfo\n * This is needed in React Native to enable network detection\n * We do not import it in Core so that Apps that do not use DataStore\n * Do not need to install and link this dependency\n * When using Reachability in React Native, pass NetInfo as a param to networkMonitor\n */\n if (!(netInfo && netInfo.addEventListener)) {\n throw new Error('NetInfo must be passed to networkMonitor to enable reachability in React Native');\n }\n return new rxjs_1.Observable(observer => {\n logger.log('subscribing to reachability in React Native');\n const unsubscribe = netInfo.addEventListener(({ isInternetReachable }) => {\n // `isInternetReachable` can sometimes be `null` initially, so we want\n // to make sure it is a boolean first before sending it to the observer.\n if (typeof isInternetReachable === 'boolean') {\n const online = isInternetReachable;\n logger.log('Notifying reachability change', online);\n observer.next({ online });\n }\n });\n return () => {\n unsubscribe();\n };\n });\n }\n}\nexports.Reachability = Reachability;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,YAAY,GAAG,MAAM;AAC7B;AACA;AACA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAC9B,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,cAAc,EAAE,OAAO,CAAC;AAClE,MAAM,YAAY,CAAC;AACnB,IAAI,cAAc,CAAC,OAAO,EAAE;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,EAAE,OAAO,IAAI,OAAO,CAAC,gBAAgB,CAAC,EAAE;AACpD,YAAY,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC;AAC9G,QAAQ;AACR,QAAQ,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,IAAI;AACjD,YAAY,MAAM,CAAC,GAAG,CAAC,6CAA6C,CAAC;AACrE,YAAY,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK;AACtF;AACA;AACA,gBAAgB,IAAI,OAAO,mBAAmB,KAAK,SAAS,EAAE;AAC9D,oBAAoB,MAAM,MAAM,GAAG,mBAAmB;AACtD,oBAAoB,MAAM,CAAC,GAAG,CAAC,+BAA+B,EAAE,MAAM,CAAC;AACvE,oBAAoB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;AAC7C,gBAAgB;AAChB,YAAY,CAAC,CAAC;AACd,YAAY,OAAO,MAAM;AACzB,gBAAgB,WAAW,EAAE;AAC7B,YAAY,CAAC;AACb,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;AACA,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/Reachability/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.Reachability = void 0;\nvar Reachability_1 = require(\"./Reachability\");\nObject.defineProperty(exports, \"Reachability\", { enumerable: true, get: function () { return Reachability_1.Reachability; } });\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,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,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/Reachability/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.Reachability = void 0;\nvar Reachability_1 = require(\"./Reachability\");\nObject.defineProperty(exports, \"Reachability\", { enumerable: true, get: function () { return Reachability_1.Reachability; } });\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,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,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceWorker.js","sources":["../../../src/ServiceWorker/ServiceWorker.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.ServiceWorkerClass = void 0;\nconst Logger_1 = require(\"../Logger\");\nconst utils_1 = require(\"../utils\");\nconst errors_1 = require(\"../errors\");\nconst pinpoint_1 = require(\"../providers/pinpoint\");\nconst singleton_1 = require(\"../singleton\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\n/**\n * Provides a means to registering a service worker in the browser\n * and communicating with it via postMessage events.\n * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/\n *\n * postMessage events are currently not supported in all browsers. See:\n * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API\n *\n * At the minmum this class will register the service worker and listen\n * and attempt to dispatch messages on state change and record analytics\n * events based on the service worker lifecycle.\n */\nclass ServiceWorkerClass {\n constructor() {\n // The AWS Amplify logger\n this._logger = new Logger_1.ConsoleLogger('ServiceWorker');\n }\n /**\n * Get the currently active service worker\n */\n get serviceWorker() {\n (0, errorHelpers_1.assert)(this._serviceWorker !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedInstance);\n return this._serviceWorker;\n }\n /**\n * Register the service-worker.js file in the browser\n * Make sure the service-worker.js is part of the build\n * for example with Angular, modify the angular-cli.json file\n * and add to \"assets\" array \"service-worker.js\"\n * @param {string} filePath Service worker file. Defaults to \"/service-worker.js\"\n * @param {string} scope The service worker scope. Defaults to \"/\"\n * - API Doc: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register\n * @returns {Promise}\n *\t- resolve(ServiceWorkerRegistration)\n *\t- reject(Error)\n **/\n register(filePath = '/service-worker.js', scope = '/') {\n this._logger.debug(`registering ${filePath}`);\n this._logger.debug(`registering service worker with scope ${scope}`);\n return new Promise((resolve, reject) => {\n if (navigator && 'serviceWorker' in navigator) {\n navigator.serviceWorker\n .register(filePath, {\n scope,\n })\n .then(registration => {\n if (registration.installing) {\n this._serviceWorker = registration.installing;\n }\n else if (registration.waiting) {\n this._serviceWorker = registration.waiting;\n }\n else if (registration.active) {\n this._serviceWorker = registration.active;\n }\n this._registration = registration;\n this._setupListeners();\n this._logger.debug(`Service Worker Registration Success: ${registration}`);\n resolve(registration);\n })\n .catch(error => {\n this._logger.debug(`Service Worker Registration Failed ${error}`);\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n underlyingError: error,\n }));\n });\n }\n else {\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n }));\n }\n });\n }\n /**\n * Enable web push notifications. If not subscribed, a new subscription will\n * be created and registered.\n * \tTest Push Server: https://web-push-codelab.glitch.me/\n * \tPush Server Libraries: https://github.com/web-push-libs/\n * \tAPI Doc: https://developers.google.com/web/fundamentals/codelabs/push-notifications/\n * @param publicKey\n * @returns {Promise}\n * \t- resolve(PushSubscription)\n * - reject(Error)\n */\n enablePush(publicKey) {\n (0, errorHelpers_1.assert)(this._registration !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedRegistration);\n this._publicKey = publicKey;\n return new Promise((resolve, reject) => {\n if ((0, utils_1.isBrowser)()) {\n (0, errorHelpers_1.assert)(this._registration !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedRegistration);\n this._registration.pushManager.getSubscription().then(subscription => {\n if (subscription) {\n this._subscription = subscription;\n this._logger.debug(`User is subscribed to push: ${JSON.stringify(subscription)}`);\n resolve(subscription);\n }\n else {\n this._logger.debug(`User is NOT subscribed to push`);\n return this._registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: this._urlB64ToUint8Array(publicKey),\n })\n .then(pushManagerSubscription => {\n this._subscription = pushManagerSubscription;\n this._logger.debug(`User subscribed: ${JSON.stringify(pushManagerSubscription)}`);\n resolve(pushManagerSubscription);\n })\n .catch(error => {\n this._logger.error(error);\n });\n }\n });\n }\n else {\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n }));\n }\n });\n }\n /**\n * Convert a base64 encoded string to a Uint8 array for the push server key\n * @param base64String\n */\n _urlB64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding)\n .replace(/-/g, '+')\n .replace(/_/g, '/');\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n }\n /**\n * Send a message to the service worker. The service worker needs\n * to implement `self.addEventListener('message') to handle the\n * message. This ***currently*** does not work in Safari or IE.\n * @param {object | string} message An arbitrary JSON object or string message to send to the service worker\n *\t- see: https://developer.mozilla.org/en-US/docs/Web/API/Transferable\n * @returns {Promise}\n **/\n send(message) {\n if (this._serviceWorker) {\n this._serviceWorker.postMessage(typeof message === 'object' ? JSON.stringify(message) : message);\n }\n }\n /**\n * Listen for service worker state change and message events\n * https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/state\n **/\n _setupListeners() {\n this.serviceWorker.addEventListener('statechange', async () => {\n const currentState = this.serviceWorker.state;\n this._logger.debug(`ServiceWorker statechange: ${currentState}`);\n const { appId, region, bufferSize, flushInterval, flushSize, resendLimit, } = singleton_1.Amplify.getConfig().Analytics?.Pinpoint ?? {};\n const { credentials } = await (0, singleton_1.fetchAuthSession)();\n if (appId && region && credentials) {\n // Pinpoint is configured, record an event\n (0, pinpoint_1.record)({\n appId,\n region,\n category: 'Core',\n credentials,\n bufferSize,\n flushInterval,\n flushSize,\n resendLimit,\n event: {\n name: 'ServiceWorker',\n attributes: {\n state: currentState,\n },\n },\n });\n }\n });\n this.serviceWorker.addEventListener('message', event => {\n this._logger.debug(`ServiceWorker message event: ${event}`);\n });\n }\n}\nexports.ServiceWorkerClass = ServiceWorkerClass;\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,MAAM;AACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC,MAAM,UAAU,GAAG,OAAO,CAAC,uBAAuB,CAAC;AACnD,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;AAC3C,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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yright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServiceWorkerClass = void 0;\nconst Logger_1 = require(\"../Logger\");\nconst utils_1 = require(\"../utils\");\nconst errors_1 = require(\"../errors\");\nconst pinpoint_1 = require(\"../providers/pinpoint\");\nconst singleton_1 = require(\"../singleton\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\n/**\n * Provides a means to registering a service worker in the browser\n * and communicating with it via postMessage events.\n * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/\n *\n * postMessage events are currently not supported in all browsers. See:\n * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API\n *\n * At the minmum this class will register the service worker and listen\n * and attempt to dispatch messages on state change and record analytics\n * events based on the service worker lifecycle.\n */\nclass ServiceWorkerClass {\n constructor() {\n // The AWS Amplify logger\n this._logger = new Logger_1.ConsoleLogger('ServiceWorker');\n }\n /**\n * Get the currently active service worker\n */\n get serviceWorker() {\n (0, errorHelpers_1.assert)(this._serviceWorker !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedInstance);\n return this._serviceWorker;\n }\n /**\n * Register the service-worker.js file in the browser\n * Make sure the service-worker.js is part of the build\n * for example with Angular, modify the angular-cli.json file\n * and add to \"assets\" array \"service-worker.js\"\n * @param {string} filePath Service worker file. Defaults to \"/service-worker.js\"\n * @param {string} scope The service worker scope. Defaults to \"/\"\n * - API Doc: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register\n * @returns {Promise}\n *\t- resolve(ServiceWorkerRegistration)\n *\t- reject(Error)\n **/\n register(filePath = '/service-worker.js', scope = '/') {\n this._logger.debug(`registering ${filePath}`);\n this._logger.debug(`registering service worker with scope ${scope}`);\n return new Promise((resolve, reject) => {\n if (navigator && 'serviceWorker' in navigator) {\n navigator.serviceWorker\n .register(filePath, {\n scope,\n })\n .then(registration => {\n if (registration.installing) {\n this._serviceWorker = registration.installing;\n }\n else if (registration.waiting) {\n this._serviceWorker = registration.waiting;\n }\n else if (registration.active) {\n this._serviceWorker = registration.active;\n }\n this._registration = registration;\n this._setupListeners();\n this._logger.debug(`Service Worker Registration Success: ${registration}`);\n resolve(registration);\n })\n .catch(error => {\n this._logger.debug(`Service Worker Registration Failed ${error}`);\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n underlyingError: error,\n }));\n });\n }\n else {\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n }));\n }\n });\n }\n /**\n * Enable web push notifications. If not subscribed, a new subscription will\n * be created and registered.\n * \tTest Push Server: https://web-push-codelab.glitch.me/\n * \tPush Server Libraries: https://github.com/web-push-libs/\n * \tAPI Doc: https://developers.google.com/web/fundamentals/codelabs/push-notifications/\n * @param publicKey\n * @returns {Promise}\n * \t- resolve(PushSubscription)\n * - reject(Error)\n */\n enablePush(publicKey) {\n (0, errorHelpers_1.assert)(this._registration !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedRegistration);\n this._publicKey = publicKey;\n return new Promise((resolve, reject) => {\n if ((0, utils_1.isBrowser)()) {\n (0, errorHelpers_1.assert)(this._registration !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedRegistration);\n this._registration.pushManager.getSubscription().then(subscription => {\n if (subscription) {\n this._subscription = subscription;\n this._logger.debug(`User is subscribed to push: ${JSON.stringify(subscription)}`);\n resolve(subscription);\n }\n else {\n this._logger.debug(`User is NOT subscribed to push`);\n return this._registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: this._urlB64ToUint8Array(publicKey),\n })\n .then(pushManagerSubscription => {\n this._subscription = pushManagerSubscription;\n this._logger.debug(`User subscribed: ${JSON.stringify(pushManagerSubscription)}`);\n resolve(pushManagerSubscription);\n })\n .catch(error => {\n this._logger.error(error);\n });\n }\n });\n }\n else {\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n }));\n }\n });\n }\n /**\n * Convert a base64 encoded string to a Uint8 array for the push server key\n * @param base64String\n */\n _urlB64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding)\n .replace(/-/g, '+')\n .replace(/_/g, '/');\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n }\n /**\n * Send a message to the service worker. The service worker needs\n * to implement `self.addEventListener('message') to handle the\n * message. This ***currently*** does not work in Safari or IE.\n * @param {object | string} message An arbitrary JSON object or string message to send to the service worker\n *\t- see: https://developer.mozilla.org/en-US/docs/Web/API/Transferable\n * @returns {Promise}\n **/\n send(message) {\n if (this._serviceWorker) {\n this._serviceWorker.postMessage(typeof message === 'object' ? JSON.stringify(message) : message);\n }\n }\n /**\n * Listen for service worker state change and message events\n * https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/state\n **/\n _setupListeners() {\n this.serviceWorker.addEventListener('statechange', async () => {\n const currentState = this.serviceWorker.state;\n this._logger.debug(`ServiceWorker statechange: ${currentState}`);\n const { appId, region, bufferSize, flushInterval, flushSize, resendLimit, } = singleton_1.Amplify.getConfig().Analytics?.Pinpoint ?? {};\n const { credentials } = await (0, singleton_1.fetchAuthSession)();\n if (appId && region && credentials) {\n // Pinpoint is configured, record an event\n (0, pinpoint_1.record)({\n appId,\n region,\n category: 'Core',\n credentials,\n bufferSize,\n flushInterval,\n flushSize,\n resendLimit,\n event: {\n name: 'ServiceWorker',\n attributes: {\n state: currentState,\n },\n },\n });\n }\n });\n this.serviceWorker.addEventListener('message', event => {\n this._logger.debug(`ServiceWorker message event: ${event}`);\n });\n }\n}\nexports.ServiceWorkerClass = ServiceWorkerClass;\n"],"names":[],"mappings":";;AACA;AACA;AACA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E,MAAM;AACpC,oBAAoB,WAAW;AAC/B,oBAAoB,UAAU;AAC9B,oBAAoB,aAAa;AACjC,oBAAoB,SAAS;AAC7B,oBAAoB,WAAW;AAC/B,oBAAoB,KAAK,EAAE;AAC3B,wBAAwB,IAAI,EAAE,eAAe;AAC7C,wBAAwB,UAAU,EAAE;AACpC,4BAA4B,KAAK,EAAE,YAAY;AAC/C,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB,CAAC;AAClB,YAAY;AACZ,QAAQ,CAAC,CAAC;AACV,QAAQ,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,IAAI;AAChE,YAAY,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC,CAAC;AACvE,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;AACA,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/ServiceWorker/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.ServiceWorker = void 0;\nvar ServiceWorker_1 = require(\"./ServiceWorker\");\nObject.defineProperty(exports, \"ServiceWorker\", { enumerable: true, get: function () { return ServiceWorker_1.ServiceWorkerClass; } });\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,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,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/ServiceWorker/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.ServiceWorker = void 0;\nvar ServiceWorker_1 = require(\"./ServiceWorker\");\nObject.defineProperty(exports, \"ServiceWorker\", { enumerable: true, get: function () { return ServiceWorker_1.ServiceWorkerClass; } });\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,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,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateUtils.js","sources":["../../../src/Signer/DateUtils.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Date & time utility functions to abstract the `aws-sdk` away from users.\n * (v2 => v3 modularization is a breaking change)\n *\n * @see https://github.com/aws/aws-sdk-js/blob/6edf586dcc1de7fe8fbfbbd9a0d2b1847921e6e1/lib/util.js#L262\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DateUtils = void 0;\nconst FIVE_MINUTES_IN_MS = 1000 * 60 * 5;\n/**\n * This utility is intended to be deprecated and replaced by `signRequest` and `presignUrl` functions from\n * `clients/middleware/signing/signer/signatureV4`.\n *\n * TODO: refactor the logics here into `signRequest` and `presignUrl` functions and remove this class.\n *\n * @internal\n * @deprecated\n */\nexports.DateUtils = {\n /**\n * Milliseconds to offset the date to compensate for clock skew between device & services\n */\n clockOffset: 0,\n getDateWithClockOffset() {\n if (exports.DateUtils.clockOffset) {\n return new Date(new Date().getTime() + exports.DateUtils.clockOffset);\n }\n else {\n return new Date();\n }\n },\n /**\n * @returns {number} Clock offset in milliseconds\n */\n getClockOffset() {\n return exports.DateUtils.clockOffset;\n },\n getHeaderStringFromDate(date = exports.DateUtils.getDateWithClockOffset()) {\n return date.toISOString().replace(/[:-]|\\.\\d{3}/g, '');\n },\n getDateFromHeaderString(header) {\n const [, year, month, day, hour, minute, second] = header.match(/^(\\d{4})(\\d{2})(\\d{2})T(\\d{2})(\\d{2})(\\d{2}).+/);\n return new Date(Date.UTC(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute), Number(second)));\n },\n isClockSkewed(serverDate) {\n // API gateway permits client calls that are off by no more than ±5 minutes\n return (Math.abs(serverDate.getTime() - exports.DateUtils.getDateWithClockOffset().getTime()) >= FIVE_MINUTES_IN_MS);\n },\n isClockSkewError(error) {\n if (!error.response || !error.response.headers) {\n return false;\n }\n const { headers } = error.response;\n return Boolean(['BadRequestException', 'InvalidSignatureException'].includes(headers['x-amzn-errortype']) &&\n (headers.date || headers.Date));\n },\n /**\n * @param {number} offset Clock offset in milliseconds\n */\n setClockOffset(offset) {\n exports.DateUtils.clockOffset = offset;\n },\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,SAAS,GAAG;AACpB;AACA;AACA;AACA,IAAI,WAAW,EAAE,CAAC;AAClB,IAAI,sBAAsB,GAAG;AAC7B,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE;AAC3C,YAAY,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC;AACjF;
|
|
1
|
+
{"version":3,"file":"DateUtils.js","sources":["../../../src/Signer/DateUtils.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Date & time utility functions to abstract the `aws-sdk` away from users.\n * (v2 => v3 modularization is a breaking change)\n *\n * @see https://github.com/aws/aws-sdk-js/blob/6edf586dcc1de7fe8fbfbbd9a0d2b1847921e6e1/lib/util.js#L262\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DateUtils = void 0;\nconst FIVE_MINUTES_IN_MS = 1000 * 60 * 5;\n/**\n * This utility is intended to be deprecated and replaced by `signRequest` and `presignUrl` functions from\n * `clients/middleware/signing/signer/signatureV4`.\n *\n * TODO: refactor the logics here into `signRequest` and `presignUrl` functions and remove this class.\n *\n * @internal\n * @deprecated\n */\nexports.DateUtils = {\n /**\n * Milliseconds to offset the date to compensate for clock skew between device & services\n */\n clockOffset: 0,\n getDateWithClockOffset() {\n if (exports.DateUtils.clockOffset) {\n return new Date(new Date().getTime() + exports.DateUtils.clockOffset);\n }\n else {\n return new Date();\n }\n },\n /**\n * @returns {number} Clock offset in milliseconds\n */\n getClockOffset() {\n return exports.DateUtils.clockOffset;\n },\n getHeaderStringFromDate(date = exports.DateUtils.getDateWithClockOffset()) {\n return date.toISOString().replace(/[:-]|\\.\\d{3}/g, '');\n },\n getDateFromHeaderString(header) {\n const [, year, month, day, hour, minute, second] = header.match(/^(\\d{4})(\\d{2})(\\d{2})T(\\d{2})(\\d{2})(\\d{2}).+/);\n return new Date(Date.UTC(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute), Number(second)));\n },\n isClockSkewed(serverDate) {\n // API gateway permits client calls that are off by no more than ±5 minutes\n return (Math.abs(serverDate.getTime() - exports.DateUtils.getDateWithClockOffset().getTime()) >= FIVE_MINUTES_IN_MS);\n },\n isClockSkewError(error) {\n if (!error.response || !error.response.headers) {\n return false;\n }\n const { headers } = error.response;\n return Boolean(['BadRequestException', 'InvalidSignatureException'].includes(headers['x-amzn-errortype']) &&\n (headers.date || headers.Date));\n },\n /**\n * @param {number} offset Clock offset in milliseconds\n */\n setClockOffset(offset) {\n exports.DateUtils.clockOffset = offset;\n },\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,SAAS,GAAG;AACpB;AACA;AACA;AACA,IAAI,WAAW,EAAE,CAAC;AAClB,IAAI,sBAAsB,GAAG;AAC7B,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE;AAC3C,YAAY,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC;AACjF,QAAQ;AACR,aAAa;AACb,YAAY,OAAO,IAAI,IAAI,EAAE;AAC7B,QAAQ;AACR,IAAI,CAAC;AACL;AACA;AACA;AACA,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,OAAO,CAAC,SAAS,CAAC,WAAW;AAC5C,IAAI,CAAC;AACL,IAAI,uBAAuB,CAAC,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,sBAAsB,EAAE,EAAE;AAC/E,QAAQ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AAC,MAAM,EAAE;AAC3B,QAAQ,OAAO,CAAC,SAAS,CAAC,WAAW,GAAG,MAAM;AAC9C,IAAI,CAAC;AACL,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Signer.js","sources":["../../../src/Signer/Signer.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.Signer = void 0;\nconst signatureV4_1 = require(\"../clients/middleware/signing/signer/signatureV4\");\nconst amplifyUrl_1 = require(\"../utils/amplifyUrl\");\nconst DateUtils_1 = require(\"./DateUtils\");\nconst IOT_SERVICE_NAME = 'iotdevicegateway';\n// Best practice regex to parse the service and region from an AWS endpoint\nconst AWS_ENDPOINT_REGEX = /([^.]+)\\.(?:([^.]*)\\.)?amazonaws\\.com(.cn)?$/;\n/**\n * This class is intended to be deprecated and replaced by `signRequest` and `presignUrl` functions from\n * `clients/middleware/signing/signer/signatureV4`.\n *\n * TODO: refactor the logics here into `signRequest` and `presignUrl` functions and remove this class.\n *\n * @internal\n * @deprecated\n */\nclass Signer {\n /**\n * Sign a HTTP request, add 'Authorization' header to request param\n * @method sign\n * @memberof Signer\n * @static\n *\n * @param {object} request - HTTP request object\n <pre>\n request: {\n method: GET | POST | PUT ...\n url: ...,\n headers: {\n header1: ...\n },\n data: data\n }\n </pre>\n * @param {object} access_info - AWS access credential info\n <pre>\n access_info: {\n access_key: ...,\n secret_key: ...,\n session_token: ...\n }\n </pre>\n * @param {object} [service_info] - AWS service type and region, optional,\n * if not provided then parse out from url\n <pre>\n service_info: {\n service: ...,\n region: ...\n }\n </pre>\n *\n * @returns {object} Signed HTTP request\n */\n static sign(request, accessInfo, serviceInfo) {\n request.headers = request.headers || {};\n if (request.body && !request.data) {\n throw new Error('The attribute \"body\" was found on the request object. Please use the attribute \"data\" instead.');\n }\n const requestToSign = {\n ...request,\n body: request.data,\n url: new amplifyUrl_1.AmplifyUrl(request.url),\n };\n const options = getOptions(requestToSign, accessInfo, serviceInfo);\n const signedRequest = (0, signatureV4_1.signRequest)(requestToSign, options);\n // Prior to using `signRequest`, Signer accepted urls as strings and outputted urls as string. Coerce the property\n // back to a string so as not to disrupt consumers of Signer.\n signedRequest.url = signedRequest.url.toString();\n // HTTP headers should be case insensitive but, to maintain parity with the previous Signer implementation and\n // limit the impact of this implementation swap, replace lowercased headers with title cased ones.\n signedRequest.headers.Authorization = signedRequest.headers.authorization;\n signedRequest.headers['X-Amz-Security-Token'] =\n signedRequest.headers['x-amz-security-token'];\n delete signedRequest.headers.authorization;\n delete signedRequest.headers['x-amz-security-token'];\n return signedRequest;\n }\n static signUrl(urlOrRequest, accessInfo, serviceInfo, expiration) {\n const urlToSign = typeof urlOrRequest === 'object' ? urlOrRequest.url : urlOrRequest;\n const method = typeof urlOrRequest === 'object' ? urlOrRequest.method : 'GET';\n const body = typeof urlOrRequest === 'object' ? urlOrRequest.body : undefined;\n const presignable = {\n body,\n method,\n url: new amplifyUrl_1.AmplifyUrl(urlToSign),\n };\n const options = getOptions(presignable, accessInfo, serviceInfo, expiration);\n const signedUrl = (0, signatureV4_1.presignUrl)(presignable, options);\n if (accessInfo.session_token &&\n !sessionTokenRequiredInSigning(options.signingService)) {\n signedUrl.searchParams.append(signatureV4_1.TOKEN_QUERY_PARAM, accessInfo.session_token);\n }\n return signedUrl.toString();\n }\n}\nexports.Signer = Signer;\nconst getOptions = (request, accessInfo, serviceInfo, expiration) => {\n const { access_key, secret_key, session_token } = accessInfo ?? {};\n const { region: urlRegion, service: urlService } = parseServiceInfo(request.url);\n const { region = urlRegion, service = urlService } = serviceInfo ?? {};\n const credentials = {\n accessKeyId: access_key,\n secretAccessKey: secret_key,\n ...(sessionTokenRequiredInSigning(service)\n ? { sessionToken: session_token }\n : {}),\n };\n return {\n credentials,\n signingDate: DateUtils_1.DateUtils.getDateWithClockOffset(),\n signingRegion: region,\n signingService: service,\n ...(expiration && { expiration }),\n };\n};\nconst parseServiceInfo = (url) => {\n const { host } = url;\n const matched = host.match(AWS_ENDPOINT_REGEX) ?? [];\n let parsed = matched.slice(1, 3);\n if (parsed[1] === 'es') {\n // Elastic Search\n parsed = parsed.reverse();\n }\n return {\n service: parsed[0],\n region: parsed[1],\n };\n};\n// IoT service does not allow the session token in the canonical request\n// https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\nconst sessionTokenRequiredInSigning = (service) => service !== IOT_SERVICE_NAME;\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,MAAM;AACvB,MAAM,aAAa,GAAG,OAAO,CAAC,kDAAkD,CAAC;AACjF,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC;AACnD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,MAAM,gBAAgB,GAAG,kBAAkB;AAC3C;AACA,MAAM,kBAAkB,GAAG,8CAA8C;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,CAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE;AAClD,QAAQ,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE;AAC/C,QAAQ,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;AAC3C,YAAY,MAAM,IAAI,KAAK,CAAC,gGAAgG,CAAC;AAC7H;
|
|
1
|
+
{"version":3,"file":"Signer.js","sources":["../../../src/Signer/Signer.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.Signer = void 0;\nconst signatureV4_1 = require(\"../clients/middleware/signing/signer/signatureV4\");\nconst amplifyUrl_1 = require(\"../utils/amplifyUrl\");\nconst DateUtils_1 = require(\"./DateUtils\");\nconst IOT_SERVICE_NAME = 'iotdevicegateway';\n// Best practice regex to parse the service and region from an AWS endpoint\nconst AWS_ENDPOINT_REGEX = /([^.]+)\\.(?:([^.]*)\\.)?amazonaws\\.com(.cn)?$/;\n/**\n * This class is intended to be deprecated and replaced by `signRequest` and `presignUrl` functions from\n * `clients/middleware/signing/signer/signatureV4`.\n *\n * TODO: refactor the logics here into `signRequest` and `presignUrl` functions and remove this class.\n *\n * @internal\n * @deprecated\n */\nclass Signer {\n /**\n * Sign a HTTP request, add 'Authorization' header to request param\n * @method sign\n * @memberof Signer\n * @static\n *\n * @param {object} request - HTTP request object\n <pre>\n request: {\n method: GET | POST | PUT ...\n url: ...,\n headers: {\n header1: ...\n },\n data: data\n }\n </pre>\n * @param {object} access_info - AWS access credential info\n <pre>\n access_info: {\n access_key: ...,\n secret_key: ...,\n session_token: ...\n }\n </pre>\n * @param {object} [service_info] - AWS service type and region, optional,\n * if not provided then parse out from url\n <pre>\n service_info: {\n service: ...,\n region: ...\n }\n </pre>\n *\n * @returns {object} Signed HTTP request\n */\n static sign(request, accessInfo, serviceInfo) {\n request.headers = request.headers || {};\n if (request.body && !request.data) {\n throw new Error('The attribute \"body\" was found on the request object. Please use the attribute \"data\" instead.');\n }\n const requestToSign = {\n ...request,\n body: request.data,\n url: new amplifyUrl_1.AmplifyUrl(request.url),\n };\n const options = getOptions(requestToSign, accessInfo, serviceInfo);\n const signedRequest = (0, signatureV4_1.signRequest)(requestToSign, options);\n // Prior to using `signRequest`, Signer accepted urls as strings and outputted urls as string. Coerce the property\n // back to a string so as not to disrupt consumers of Signer.\n signedRequest.url = signedRequest.url.toString();\n // HTTP headers should be case insensitive but, to maintain parity with the previous Signer implementation and\n // limit the impact of this implementation swap, replace lowercased headers with title cased ones.\n signedRequest.headers.Authorization = signedRequest.headers.authorization;\n signedRequest.headers['X-Amz-Security-Token'] =\n signedRequest.headers['x-amz-security-token'];\n delete signedRequest.headers.authorization;\n delete signedRequest.headers['x-amz-security-token'];\n return signedRequest;\n }\n static signUrl(urlOrRequest, accessInfo, serviceInfo, expiration) {\n const urlToSign = typeof urlOrRequest === 'object' ? urlOrRequest.url : urlOrRequest;\n const method = typeof urlOrRequest === 'object' ? urlOrRequest.method : 'GET';\n const body = typeof urlOrRequest === 'object' ? urlOrRequest.body : undefined;\n const presignable = {\n body,\n method,\n url: new amplifyUrl_1.AmplifyUrl(urlToSign),\n };\n const options = getOptions(presignable, accessInfo, serviceInfo, expiration);\n const signedUrl = (0, signatureV4_1.presignUrl)(presignable, options);\n if (accessInfo.session_token &&\n !sessionTokenRequiredInSigning(options.signingService)) {\n signedUrl.searchParams.append(signatureV4_1.TOKEN_QUERY_PARAM, accessInfo.session_token);\n }\n return signedUrl.toString();\n }\n}\nexports.Signer = Signer;\nconst getOptions = (request, accessInfo, serviceInfo, expiration) => {\n const { access_key, secret_key, session_token } = accessInfo ?? {};\n const { region: urlRegion, service: urlService } = parseServiceInfo(request.url);\n const { region = urlRegion, service = urlService } = serviceInfo ?? {};\n const credentials = {\n accessKeyId: access_key,\n secretAccessKey: secret_key,\n ...(sessionTokenRequiredInSigning(service)\n ? { sessionToken: session_token }\n : {}),\n };\n return {\n credentials,\n signingDate: DateUtils_1.DateUtils.getDateWithClockOffset(),\n signingRegion: region,\n signingService: service,\n ...(expiration && { expiration }),\n };\n};\nconst parseServiceInfo = (url) => {\n const { host } = url;\n const matched = host.match(AWS_ENDPOINT_REGEX) ?? [];\n let parsed = matched.slice(1, 3);\n if (parsed[1] === 'es') {\n // Elastic Search\n parsed = parsed.reverse();\n }\n return {\n service: parsed[0],\n region: parsed[1],\n };\n};\n// IoT service does not allow the session token in the canonical request\n// https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\nconst sessionTokenRequiredInSigning = (service) => service !== IOT_SERVICE_NAME;\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,MAAM;AACvB,MAAM,aAAa,GAAG,OAAO,CAAC,kDAAkD,CAAC;AACjF,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC;AACnD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,MAAM,gBAAgB,GAAG,kBAAkB;AAC3C;AACA,MAAM,kBAAkB,GAAG,8CAA8C;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,CAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE;AAClD,QAAQ,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE;AAC/C,QAAQ,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;AAC3C,YAAY,MAAM,IAAI,KAAK,CAAC,gGAAgG,CAAC;AAC7H,QAAQ;AACR,QAAQ,MAAM,aAAa,GAAG;AAC9B,YAAY,GAAG,OAAO;AACtB,YAAY,IAAI,EAAE,OAAO,CAAC,IAAI;AAC9B,YAAY,GAAG,EAAE,IAAI,YAAY,CAAC,UAAU,CAAC,OAAO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GAAG,KAAK;AAClC,IAAI,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG;AACxB,IAAI,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,EAAE;AACxD,IAAI,IAAI,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AACpC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;AAC5B;AACA,QAAQ,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE;AACjC,IAAI;AACJ,IAAI,OAAO;AACX,QAAQ,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAC1B,QAAQ,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACzB,KAAK;AACL,CAAC;AACD;AACA;AACA,MAAM,6BAA6B,GAAG,CAAC,OAAO,KAAK,OAAO,KAAK,gBAAgB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/Signer/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.Signer = void 0;\nvar Signer_1 = require(\"./Signer\");\nObject.defineProperty(exports, \"Signer\", { enumerable: true, get: function () { return Signer_1.Signer; } });\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,MAAM;AACvB,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,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/Signer/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.Signer = void 0;\nvar Signer_1 = require(\"./Signer\");\nObject.defineProperty(exports, \"Signer\", { enumerable: true, get: function () { return Signer_1.Signer; } });\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,MAAM;AACvB,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":"AmplifyServerContextError.js","sources":["../../../../src/adapterCore/error/AmplifyServerContextError.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.AmplifyServerContextError = void 0;\nconst errors_1 = require(\"../../errors\");\nclass AmplifyServerContextError extends errors_1.AmplifyError {\n constructor({ message, recoverySuggestion, underlyingError, }) {\n super({\n name: 'AmplifyServerContextError',\n message,\n recoverySuggestion,\n underlyingError,\n });\n }\n}\nexports.AmplifyServerContextError = AmplifyServerContextError;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,yBAAyB,GAAG,MAAM;AAC1C,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,MAAM,yBAAyB,SAAS,QAAQ,CAAC,YAAY,CAAC;AAC9D,IAAI,WAAW,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,eAAe,GAAG,EAAE;AACnE,QAAQ,KAAK,CAAC;AACd,YAAY,IAAI,EAAE,2BAA2B;AAC7C,YAAY,OAAO;AACnB,YAAY,kBAAkB;AAC9B,YAAY,eAAe;AAC3B,SAAS,CAAC;AACV;
|
|
1
|
+
{"version":3,"file":"AmplifyServerContextError.js","sources":["../../../../src/adapterCore/error/AmplifyServerContextError.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.AmplifyServerContextError = void 0;\nconst errors_1 = require(\"../../errors\");\nclass AmplifyServerContextError extends errors_1.AmplifyError {\n constructor({ message, recoverySuggestion, underlyingError, }) {\n super({\n name: 'AmplifyServerContextError',\n message,\n recoverySuggestion,\n underlyingError,\n });\n }\n}\nexports.AmplifyServerContextError = AmplifyServerContextError;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,yBAAyB,GAAG,MAAM;AAC1C,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,MAAM,yBAAyB,SAAS,QAAQ,CAAC,YAAY,CAAC;AAC9D,IAAI,WAAW,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,eAAe,GAAG,EAAE;AACnE,QAAQ,KAAK,CAAC;AACd,YAAY,IAAI,EAAE,2BAA2B;AAC7C,YAAY,OAAO;AACnB,YAAY,kBAAkB;AAC9B,YAAY,eAAe;AAC3B,SAAS,CAAC;AACV,IAAI;AACJ;AACA,OAAO,CAAC,yBAAyB,GAAG,yBAAyB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/adapterCore/error/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.AmplifyServerContextError = void 0;\nvar AmplifyServerContextError_1 = require(\"./AmplifyServerContextError\");\nObject.defineProperty(exports, \"AmplifyServerContextError\", { enumerable: true, get: function () { return AmplifyServerContextError_1.AmplifyServerContextError; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,yBAAyB,GAAG,MAAM;AAC1C,IAAI,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACxE,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,2BAA2B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,2BAA2B,CAAC,yBAAyB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/adapterCore/error/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.AmplifyServerContextError = void 0;\nvar AmplifyServerContextError_1 = require(\"./AmplifyServerContextError\");\nObject.defineProperty(exports, \"AmplifyServerContextError\", { enumerable: true, get: function () { return AmplifyServerContextError_1.AmplifyServerContextError; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,yBAAyB,GAAG,MAAM;AAC1C,IAAI,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACxE,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,2BAA2B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,2BAA2B,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/adapterCore/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.AmplifyServerContextError = exports.destroyAmplifyServerContext = exports.getAmplifyServerContext = exports.createAmplifyServerContext = void 0;\nvar serverContext_1 = require(\"./serverContext\");\nObject.defineProperty(exports, \"createAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.createAmplifyServerContext; } });\nObject.defineProperty(exports, \"getAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.getAmplifyServerContext; } });\nObject.defineProperty(exports, \"destroyAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.destroyAmplifyServerContext; } });\nvar error_1 = require(\"./error\");\nObject.defineProperty(exports, \"AmplifyServerContextError\", { enumerable: true, get: function () { return error_1.AmplifyServerContextError; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,0BAA0B,GAAG,MAAM;AACvJ,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,0BAA0B,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/adapterCore/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.AmplifyServerContextError = exports.destroyAmplifyServerContext = exports.getAmplifyServerContext = exports.createAmplifyServerContext = void 0;\nvar serverContext_1 = require(\"./serverContext\");\nObject.defineProperty(exports, \"createAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.createAmplifyServerContext; } });\nObject.defineProperty(exports, \"getAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.getAmplifyServerContext; } });\nObject.defineProperty(exports, \"destroyAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.destroyAmplifyServerContext; } });\nvar error_1 = require(\"./error\");\nObject.defineProperty(exports, \"AmplifyServerContextError\", { enumerable: true, get: function () { return error_1.AmplifyServerContextError; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,0BAA0B,GAAG,MAAM;AACvJ,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3J,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,yBAAyB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;AACrJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,6BAA6B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7J,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAChC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,2BAA2B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/adapterCore/serverContext/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.getAmplifyServerContext = exports.destroyAmplifyServerContext = exports.createAmplifyServerContext = void 0;\nvar serverContext_1 = require(\"./serverContext\");\nObject.defineProperty(exports, \"createAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.createAmplifyServerContext; } });\nObject.defineProperty(exports, \"destroyAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.destroyAmplifyServerContext; } });\nObject.defineProperty(exports, \"getAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.getAmplifyServerContext; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC,0BAA0B,GAAG,MAAM;AACnH,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,0BAA0B,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/adapterCore/serverContext/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.getAmplifyServerContext = exports.destroyAmplifyServerContext = exports.createAmplifyServerContext = void 0;\nvar serverContext_1 = require(\"./serverContext\");\nObject.defineProperty(exports, \"createAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.createAmplifyServerContext; } });\nObject.defineProperty(exports, \"destroyAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.destroyAmplifyServerContext; } });\nObject.defineProperty(exports, \"getAmplifyServerContext\", { enumerable: true, get: function () { return serverContext_1.getAmplifyServerContext; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC,0BAA0B,GAAG,MAAM;AACnH,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3J,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,6BAA6B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7J,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,yBAAyB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverContext.js","sources":["../../../../src/adapterCore/serverContext/serverContext.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.destroyAmplifyServerContext = exports.getAmplifyServerContext = exports.createAmplifyServerContext = void 0;\nconst singleton_1 = require(\"../../singleton\");\nconst error_1 = require(\"../error\");\nconst serverContextRegistry_1 = require(\"./serverContextRegistry\");\n/**\n * Creates an Amplify server context.\n * @param amplifyConfig The Amplify resource config.\n * @param libraryOptions The Amplify library options.\n * @returns The Amplify server context spec.\n */\nconst createAmplifyServerContext = (amplifyConfig, libraryOptions) => {\n const amplify = new singleton_1.AmplifyClass();\n amplify.configure(amplifyConfig, libraryOptions);\n return serverContextRegistry_1.serverContextRegistry.register({\n amplify,\n });\n};\nexports.createAmplifyServerContext = createAmplifyServerContext;\n/**\n * Returns an Amplify server context.\n * @param contextSpec The context spec used to get the Amplify server context.\n * @returns The Amplify server context.\n */\nconst getAmplifyServerContext = (contextSpec) => {\n assertContextSpec(contextSpec);\n const context = serverContextRegistry_1.serverContextRegistry.get(contextSpec);\n if (context) {\n return context;\n }\n throw new error_1.AmplifyServerContextError({\n message: 'Attempted to get the Amplify Server Context that may have been destroyed.',\n recoverySuggestion: 'Ensure always call Amplify APIs within `runWithAmplifyServerContext` function, and do not attempt to reuse `contextSpec` object.',\n });\n};\nexports.getAmplifyServerContext = getAmplifyServerContext;\n/**\n * Destroys an Amplify server context.\n * @param contextSpec The context spec used to destroy the Amplify server context.\n */\nconst destroyAmplifyServerContext = (contextSpec) => {\n serverContextRegistry_1.serverContextRegistry.deregister(contextSpec);\n};\nexports.destroyAmplifyServerContext = destroyAmplifyServerContext;\nconst assertContextSpec = (contextSpec) => {\n let invalid = false;\n if (!Object.prototype.hasOwnProperty.call(contextSpec, 'token')) {\n invalid = true;\n }\n else if (!Object.prototype.hasOwnProperty.call(contextSpec.token, 'value')) {\n invalid = true;\n }\n else if (Object.prototype.toString.call(contextSpec.token.value) !==\n '[object Symbol]') {\n invalid = true;\n }\n if (invalid) {\n throw new error_1.AmplifyServerContextError({\n message: 'Invalid `contextSpec`.',\n recoverySuggestion: 'Ensure to use the `contextSpec` object injected by `runWithAmplifyServerContext` function.',\n });\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,2BAA2B,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,0BAA0B,GAAG,MAAM;AACnH,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,0BAA0B,GAAG,CAAC,aAAa,EAAE,cAAc,KAAK;AACtE,IAAI,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,YAAY,EAAE;AAClD,IAAI,OAAO,CAAC,SAAS,CAAC,aAAa,EAAE,cAAc,CAAC;AACpD,IAAI,OAAO,uBAAuB,CAAC,qBAAqB,CAAC,QAAQ,CAAC;AAClE,QAAQ,OAAO;AACf,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,0BAA0B,GAAG,0BAA0B;AAC/D;AACA;AACA;AACA;AACA;AACA,MAAM,uBAAuB,GAAG,CAAC,WAAW,KAAK;AACjD,IAAI,iBAAiB,CAAC,WAAW,CAAC;AAClC,IAAI,MAAM,OAAO,GAAG,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,CAAC,WAAW,CAAC;AAClF,IAAI,IAAI,OAAO,EAAE;AACjB,QAAQ,OAAO,OAAO;AACtB;
|
|
1
|
+
{"version":3,"file":"serverContext.js","sources":["../../../../src/adapterCore/serverContext/serverContext.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.destroyAmplifyServerContext = exports.getAmplifyServerContext = exports.createAmplifyServerContext = void 0;\nconst singleton_1 = require(\"../../singleton\");\nconst error_1 = require(\"../error\");\nconst serverContextRegistry_1 = require(\"./serverContextRegistry\");\n/**\n * Creates an Amplify server context.\n * @param amplifyConfig The Amplify resource config.\n * @param libraryOptions The Amplify library options.\n * @returns The Amplify server context spec.\n */\nconst createAmplifyServerContext = (amplifyConfig, libraryOptions) => {\n const amplify = new singleton_1.AmplifyClass();\n amplify.configure(amplifyConfig, libraryOptions);\n return serverContextRegistry_1.serverContextRegistry.register({\n amplify,\n });\n};\nexports.createAmplifyServerContext = createAmplifyServerContext;\n/**\n * Returns an Amplify server context.\n * @param contextSpec The context spec used to get the Amplify server context.\n * @returns The Amplify server context.\n */\nconst getAmplifyServerContext = (contextSpec) => {\n assertContextSpec(contextSpec);\n const context = serverContextRegistry_1.serverContextRegistry.get(contextSpec);\n if (context) {\n return context;\n }\n throw new error_1.AmplifyServerContextError({\n message: 'Attempted to get the Amplify Server Context that may have been destroyed.',\n recoverySuggestion: 'Ensure always call Amplify APIs within `runWithAmplifyServerContext` function, and do not attempt to reuse `contextSpec` object.',\n });\n};\nexports.getAmplifyServerContext = getAmplifyServerContext;\n/**\n * Destroys an Amplify server context.\n * @param contextSpec The context spec used to destroy the Amplify server context.\n */\nconst destroyAmplifyServerContext = (contextSpec) => {\n serverContextRegistry_1.serverContextRegistry.deregister(contextSpec);\n};\nexports.destroyAmplifyServerContext = destroyAmplifyServerContext;\nconst assertContextSpec = (contextSpec) => {\n let invalid = false;\n if (!Object.prototype.hasOwnProperty.call(contextSpec, 'token')) {\n invalid = true;\n }\n else if (!Object.prototype.hasOwnProperty.call(contextSpec.token, 'value')) {\n invalid = true;\n }\n else if (Object.prototype.toString.call(contextSpec.token.value) !==\n '[object Symbol]') {\n invalid = true;\n }\n if (invalid) {\n throw new error_1.AmplifyServerContextError({\n message: 'Invalid `contextSpec`.',\n recoverySuggestion: 'Ensure to use the `contextSpec` object injected by `runWithAmplifyServerContext` function.',\n });\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,2BAA2B,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,0BAA0B,GAAG,MAAM;AACnH,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,0BAA0B,GAAG,CAAC,aAAa,EAAE,cAAc,KAAK;AACtE,IAAI,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,YAAY,EAAE;AAClD,IAAI,OAAO,CAAC,SAAS,CAAC,aAAa,EAAE,cAAc,CAAC;AACpD,IAAI,OAAO,uBAAuB,CAAC,qBAAqB,CAAC,QAAQ,CAAC;AAClE,QAAQ,OAAO;AACf,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,0BAA0B,GAAG,0BAA0B;AAC/D;AACA;AACA;AACA;AACA;AACA,MAAM,uBAAuB,GAAG,CAAC,WAAW,KAAK;AACjD,IAAI,iBAAiB,CAAC,WAAW,CAAC;AAClC,IAAI,MAAM,OAAO,GAAG,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,CAAC,WAAW,CAAC;A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version":3,"file":"serverContextRegistry.js","sources":["../../../../src/adapterCore/serverContext/serverContextRegistry.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.serverContextRegistry = void 0;\nconst storage = new WeakMap();\nfunction createToken() {\n return {\n value: Symbol('AmplifyServerContextToken'),\n };\n}\nexports.serverContextRegistry = {\n register(context) {\n const token = createToken();\n storage.set(token, context);\n return { token };\n },\n deregister(contextSpec) {\n return storage.delete(contextSpec.token);\n },\n get(contextSpec) {\n return storage.get(contextSpec.token);\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,MAAM;AACtC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;AAC7B,SAAS,WAAW,GAAG;AACvB,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,MAAM,CAAC,2BAA2B,CAAC;AAClD,KAAK;AACL;AACA,OAAO,CAAC,qBAAqB,GAAG;AAChC,IAAI,QAAQ,CAAC,OAAO,EAAE;AACtB,QAAQ,MAAM,KAAK,GAAG,WAAW,EAAE;AACnC,QAAQ,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC;AACnC,QAAQ,OAAO,EAAE,KAAK,EAAE;AACxB,
|
|
1
|
+
{"version":3,"file":"serverContextRegistry.js","sources":["../../../../src/adapterCore/serverContext/serverContextRegistry.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.serverContextRegistry = void 0;\nconst storage = new WeakMap();\nfunction createToken() {\n return {\n value: Symbol('AmplifyServerContextToken'),\n };\n}\nexports.serverContextRegistry = {\n register(context) {\n const token = createToken();\n storage.set(token, context);\n return { token };\n },\n deregister(contextSpec) {\n return storage.delete(contextSpec.token);\n },\n get(contextSpec) {\n return storage.get(contextSpec.token);\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,MAAM;AACtC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;AAC7B,SAAS,WAAW,GAAG;AACvB,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,MAAM,CAAC,2BAA2B,CAAC;AAClD,KAAK;AACL;AACA,OAAO,CAAC,qBAAqB,GAAG;AAChC,IAAI,QAAQ,CAAC,OAAO,EAAE;AACtB,QAAQ,MAAM,KAAK,GAAG,WAAW,EAAE;AACnC,QAAQ,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC;AACnC,QAAQ,OAAO,EAAE,KAAK,EAAE;AACxB,IAAI,CAAC;AACL,IAAI,UAAU,CAAC,WAAW,EAAE;AAC5B,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC;AAChD,IAAI,CAAC;AACL,IAAI,GAAG,CAAC,WAAW,EAAE;AACrB,QAAQ,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC;AAC7C,IAAI,CAAC;AACL,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../src/awsClients/pinpoint/base.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.getSharedHeaders = exports.defaultConfig = void 0;\nconst endpoints_1 = require(\"../../clients/endpoints\");\nconst retry_1 = require(\"../../clients/middleware/retry\");\nconst json_1 = require(\"../../clients/serde/json\");\nconst Platform_1 = require(\"../../Platform\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\n/**\n * The service name used to sign requests if the API requires authentication.\n */\nconst SERVICE_NAME = 'mobiletargeting';\n/**\n * The endpoint resolver function that returns the endpoint URL for a given region.\n */\nconst endpointResolver = ({ region }) => ({\n url: new amplifyUrl_1.AmplifyUrl(`https://pinpoint.${region}.${(0, endpoints_1.getDnsSuffix)(region)}`),\n});\n/**\n * @internal\n */\nexports.defaultConfig = {\n service: SERVICE_NAME,\n endpointResolver,\n retryDecider: (0, retry_1.getRetryDecider)(json_1.parseJsonError),\n computeDelay: retry_1.jitteredBackoff,\n get userAgentValue() {\n return (0, Platform_1.getAmplifyUserAgent)();\n },\n};\n/**\n * @internal\n */\nconst getSharedHeaders = () => ({\n 'content-type': 'application/json',\n});\nexports.getSharedHeaders = getSharedHeaders;\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,OAAO,CAAC,aAAa,GAAG,MAAM;AACzD,MAAM,WAAW,GAAG,OAAO,CAAC,yBAAyB,CAAC;AACtD,MAAM,OAAO,GAAG,OAAO,CAAC,gCAAgC,CAAC;AACzD,MAAM,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;AAClD,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAC5C,MAAM,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACtD;AACA;AACA;AACA,MAAM,YAAY,GAAG,iBAAiB;AACtC;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM;AAC1C,IAAI,GAAG,EAAE,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,EAAE,IAAI,WAAW,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAC3G,CAAC,CAAC;AACF;AACA;AACA;AACA,OAAO,CAAC,aAAa,GAAG;AACxB,IAAI,OAAO,EAAE,YAAY;AACzB,IAAI,gBAAgB;AACpB,IAAI,YAAY,EAAE,IAAI,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,cAAc,CAAC;AACrE,IAAI,YAAY,EAAE,OAAO,CAAC,eAAe;AACzC,IAAI,IAAI,cAAc,GAAG;AACzB,QAAQ,OAAO,IAAI,UAAU,CAAC,mBAAmB,GAAG;AACpD,
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../src/awsClients/pinpoint/base.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.getSharedHeaders = exports.defaultConfig = void 0;\nconst endpoints_1 = require(\"../../clients/endpoints\");\nconst retry_1 = require(\"../../clients/middleware/retry\");\nconst json_1 = require(\"../../clients/serde/json\");\nconst Platform_1 = require(\"../../Platform\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\n/**\n * The service name used to sign requests if the API requires authentication.\n */\nconst SERVICE_NAME = 'mobiletargeting';\n/**\n * The endpoint resolver function that returns the endpoint URL for a given region.\n */\nconst endpointResolver = ({ region }) => ({\n url: new amplifyUrl_1.AmplifyUrl(`https://pinpoint.${region}.${(0, endpoints_1.getDnsSuffix)(region)}`),\n});\n/**\n * @internal\n */\nexports.defaultConfig = {\n service: SERVICE_NAME,\n endpointResolver,\n retryDecider: (0, retry_1.getRetryDecider)(json_1.parseJsonError),\n computeDelay: retry_1.jitteredBackoff,\n get userAgentValue() {\n return (0, Platform_1.getAmplifyUserAgent)();\n },\n};\n/**\n * @internal\n */\nconst getSharedHeaders = () => ({\n 'content-type': 'application/json',\n});\nexports.getSharedHeaders = getSharedHeaders;\n"],"names":[],"mappings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ppMessages.js","sources":["../../../../src/awsClients/pinpoint/getInAppMessages.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.getInAppMessages = void 0;\nconst authenticated_1 = require(\"../../clients/handlers/aws/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst getInAppMessagesSerializer = ({ ApplicationId = '', EndpointId = '' }, endpoint) => {\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/endpoints/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(EndpointId)}/inappmessages`;\n return { method: 'GET', headers, url };\n};\nconst getInAppMessagesDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { InAppMessageCampaigns } = await (0, serde_1.parseJsonBody)(response);\n return {\n InAppMessagesResponse: { InAppMessageCampaigns },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.getInAppMessages = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, getInAppMessagesSerializer, getInAppMessagesDeserializer, base_1.defaultConfig);\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,eAAe,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC3E,MAAM,mBAAmB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC/E,MAAM,4BAA4B,GAAG,OAAO,CAAC,mEAAmE,CAAC;AACjH,MAAM,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC9C,MAAM,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACtD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,0BAA0B,GAAG,CAAC,EAAE,aAAa,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,EAAE,QAAQ,KAAK;AAC1F,IAAI,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,gBAAgB,GAAG;AAClD,IAAI,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzD,IAAI,GAAG,CAAC,QAAQ,GAAG,CAAC,QAAQ,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC,WAAW,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAC,cAAc,CAAC;AAC/M,IAAI,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE;AAC1C,CAAC;AACD,MAAM,4BAA4B,GAAG,OAAO,QAAQ,KAAK;AACzD,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC;AACjE,QAAQ,MAAM,KAAK;AACnB;
|
|
1
|
+
{"version":3,"file":"getInAppMessages.js","sources":["../../../../src/awsClients/pinpoint/getInAppMessages.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.getInAppMessages = void 0;\nconst authenticated_1 = require(\"../../clients/handlers/aws/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst getInAppMessagesSerializer = ({ ApplicationId = '', EndpointId = '' }, endpoint) => {\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/endpoints/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(EndpointId)}/inappmessages`;\n return { method: 'GET', headers, url };\n};\nconst getInAppMessagesDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { InAppMessageCampaigns } = await (0, serde_1.parseJsonBody)(response);\n return {\n InAppMessagesResponse: { InAppMessageCampaigns },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.getInAppMessages = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, getInAppMessagesSerializer, getInAppMessagesDeserializer, base_1.defaultConfig);\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,eAAe,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC3E,MAAM,mBAAmB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC/E,MAAM,4BAA4B,GAAG,OAAO,CAAC,mEAAmE,CAAC;AACjH,MAAM,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC9C,MAAM,YAAY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B,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/awsClients/pinpoint/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.updateEndpoint = exports.putEvents = exports.getInAppMessages = void 0;\nvar getInAppMessages_1 = require(\"./getInAppMessages\");\nObject.defineProperty(exports, \"getInAppMessages\", { enumerable: true, get: function () { return getInAppMessages_1.getInAppMessages; } });\nvar putEvents_1 = require(\"./putEvents\");\nObject.defineProperty(exports, \"putEvents\", { enumerable: true, get: function () { return putEvents_1.putEvents; } });\nvar updateEndpoint_1 = require(\"./updateEndpoint\");\nObject.defineProperty(exports, \"updateEndpoint\", { enumerable: true, get: function () { return updateEndpoint_1.updateEndpoint; } });\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,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,gBAAgB,GAAG,MAAM;AAC9E,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,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/awsClients/pinpoint/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.updateEndpoint = exports.putEvents = exports.getInAppMessages = void 0;\nvar getInAppMessages_1 = require(\"./getInAppMessages\");\nObject.defineProperty(exports, \"getInAppMessages\", { enumerable: true, get: function () { return getInAppMessages_1.getInAppMessages; } });\nvar putEvents_1 = require(\"./putEvents\");\nObject.defineProperty(exports, \"putEvents\", { enumerable: true, get: function () { return putEvents_1.putEvents; } });\nvar updateEndpoint_1 = require(\"./updateEndpoint\");\nObject.defineProperty(exports, \"updateEndpoint\", { enumerable: true, get: function () { return updateEndpoint_1.updateEndpoint; } });\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,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,gBAAgB,GAAG,MAAM;AAC9E,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,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AACxC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;AACrH,IAAI,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAClD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"putEvents.js","sources":["../../../../src/awsClients/pinpoint/putEvents.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.putEvents = void 0;\nconst authenticated_1 = require(\"../../clients/handlers/aws/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\nconst putEventsSerializer = ({ ApplicationId, EventsRequest }, endpoint) => {\n (0, errorHelpers_1.assert)(!!ApplicationId, errorHelpers_1.PinpointValidationErrorCode.NoAppId);\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/events`;\n const body = JSON.stringify(EventsRequest ?? {});\n return { method: 'POST', headers, url, body };\n};\nconst putEventsDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { Results } = await (0, serde_1.parseJsonBody)(response);\n return {\n EventsResponse: { Results },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.putEvents = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, putEventsSerializer, putEventsDeserializer, base_1.defaultConfig);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B,MAAM,eAAe,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC3E,MAAM,mBAAm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Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.putEvents = void 0;\nconst authenticated_1 = require(\"../../clients/handlers/aws/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\nconst putEventsSerializer = ({ ApplicationId, EventsRequest }, endpoint) => {\n (0, errorHelpers_1.assert)(!!ApplicationId, errorHelpers_1.PinpointValidationErrorCode.NoAppId);\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/events`;\n const body = JSON.stringify(EventsRequest ?? {});\n return { method: 'POST', headers, url, body };\n};\nconst putEventsDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { Results } = await (0, serde_1.parseJsonBody)(response);\n return {\n EventsResponse: { Results },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.putEvents = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, putEventsSerializer, putEventsDeserializer, base_1.defaultConfig);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B,MAAM,eAAe,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC3E,MAAM,mBAAmB,GAAG,OAAO,CAAC,0CAA0C,CAA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ACf,YAAY,cAAc,EAAE,EAAE,OAAO,EAAE;AACvC,YAAY,SAAS,EAAE,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC3D,SAAS;AACT,IAAI;AACJ,CAAC;AACD;AACA;AACA;AACA,OAAO,CAAC,SAAS,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,eAAe,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateEndpoint.js","sources":["../../../../src/awsClients/pinpoint/updateEndpoint.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.updateEndpoint = void 0;\nconst authenticated_1 = require(\"../../clients/handlers/aws/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst updateEndpointSerializer = ({ ApplicationId = '', EndpointId = '', EndpointRequest }, endpoint) => {\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/endpoints/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(EndpointId)}`;\n const body = JSON.stringify(EndpointRequest);\n return { method: 'PUT', headers, url, body };\n};\nconst updateEndpointDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { Message, RequestID } = await (0, serde_1.parseJsonBody)(response);\n return {\n MessageBody: {\n Message,\n RequestID,\n },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.updateEndpoint = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, updateEndpointSerializer, updateEndpointDeserializer, base_1.defaultConfig);\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,eAAe,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC3E,MAAM,mBAAmB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC/E,MAAM,4BAA4B,GAAG,OAAO,CAAC,mEAAmE,CAAC;AACjH,MAAM,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC9C,MAAM,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACtD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,wBAAwB,GAAG,CAAC,EAAE,aAAa,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,eAAe,EAAE,EAAE,QAAQ,KAAK;AACzG,IAAI,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,gBAAgB,GAAG;AAClD,IAAI,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzD,IAAI,GAAG,CAAC,QAAQ,GAAG,CAAC,QAAQ,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC,WAAW,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAC,CAAC;AACjM,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC;AAChD,IAAI,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE;AAChD,CAAC;AACD,MAAM,0BAA0B,GAAG,OAAO,QAAQ,KAAK;AACvD,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC;AACjE,QAAQ,MAAM,KAAK;AACnB;
|
|
1
|
+
{"version":3,"file":"updateEndpoint.js","sources":["../../../../src/awsClients/pinpoint/updateEndpoint.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.updateEndpoint = void 0;\nconst authenticated_1 = require(\"../../clients/handlers/aws/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst updateEndpointSerializer = ({ ApplicationId = '', EndpointId = '', EndpointRequest }, endpoint) => {\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/endpoints/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(EndpointId)}`;\n const body = JSON.stringify(EndpointRequest);\n return { method: 'PUT', headers, url, body };\n};\nconst updateEndpointDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { Message, RequestID } = await (0, serde_1.parseJsonBody)(response);\n return {\n MessageBody: {\n Message,\n RequestID,\n },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.updateEndpoint = (0, composeServiceAp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,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC;AACjE,QAAQ,MAAM,KAAK;AACnB,IAAI;AACJ,SAAS;AACT,QAAQ,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AACjF,QAAQ,OAAO;AACf,YAAY,WAAW,EAAE;AACzB,gBAAgB,OAAO;AACvB,gBAAgB,SAAS;AACzB,aAAa;AACb,YAAY,SAAS,EAAE,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC3D,SAAS;AACT,IAAI;AACJ,CAAC;AACD;AACA;AACA;AACA,OAAO,CAAC,cAAc,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,eAAe,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDnsSuffix.js","sources":["../../../../src/clients/endpoints/getDnsSuffix.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.getDnsSuffix = void 0;\nconst partitions_1 = require(\"./partitions\");\n/**\n * Get the AWS Services endpoint URL's DNS suffix for a given region. A typical AWS regional service endpoint URL will\n * follow this pattern: {endpointPrefix}.{region}.{dnsSuffix}. For example, the endpoint URL for Cognito Identity in\n * us-east-1 will be cognito-identity.us-east-1.amazonaws.com. Here the DnsSuffix is `amazonaws.com`.\n *\n * @param region\n * @returns The DNS suffix\n *\n * @internal\n */\nconst getDnsSuffix = (region) => {\n const { partitions } = partitions_1.partitionsInfo;\n for (const { regions, outputs, regionRegex } of partitions) {\n const regex = new RegExp(regionRegex);\n if (regions.includes(region) || regex.test(region)) {\n return outputs.dnsSuffix;\n }\n }\n return partitions_1.defaultPartition.outputs.dnsSuffix;\n};\nexports.getDnsSuffix = getDnsSuffix;\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,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,MAAM,KAAK;AACjC,IAAI,MAAM,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC,cAAc;AACtD,IAAI,KAAK,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,UAAU,EAAE;AAChE,QAAQ,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC;AAC7C,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AAC5D,YAAY,OAAO,OAAO,CAAC,SAAS;AACpC;
|
|
1
|
+
{"version":3,"file":"getDnsSuffix.js","sources":["../../../../src/clients/endpoints/getDnsSuffix.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.getDnsSuffix = void 0;\nconst partitions_1 = require(\"./partitions\");\n/**\n * Get the AWS Services endpoint URL's DNS suffix for a given region. A typical AWS regional service endpoint URL will\n * follow this pattern: {endpointPrefix}.{region}.{dnsSuffix}. For example, the endpoint URL for Cognito Identity in\n * us-east-1 will be cognito-identity.us-east-1.amazonaws.com. Here the DnsSuffix is `amazonaws.com`.\n *\n * @param region\n * @returns The DNS suffix\n *\n * @internal\n */\nconst getDnsSuffix = (region) => {\n const { partitions } = partitions_1.partitionsInfo;\n for (const { regions, outputs, regionRegex } of partitions) {\n const regex = new RegExp(regionRegex);\n if (regions.includes(region) || regex.test(region)) {\n return outputs.dnsSuffix;\n }\n }\n return partitions_1.defaultPartition.outputs.dnsSuffix;\n};\nexports.getDnsSuffix = getDnsSuffix;\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,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,MAAM,KAAK;AACjC,IAAI,MAAM,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC,cAAc;AACtD,IAAI,KAAK,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,UAAU,EAAE;AAChE,QAAQ,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC;AAC7C,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AAC5D,YAAY,OAAO,OAAO,CAAC,SAAS;AACpC,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,SAAS;AAC1D,CAAC;AACD,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/clients/endpoints/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.getDnsSuffix = void 0;\nvar getDnsSuffix_1 = require(\"./getDnsSuffix\");\nObject.defineProperty(exports, \"getDnsSuffix\", { enumerable: true, get: function () { return getDnsSuffix_1.getDnsSuffix; } });\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,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,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/clients/endpoints/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.getDnsSuffix = void 0;\nvar getDnsSuffix_1 = require(\"./getDnsSuffix\");\nObject.defineProperty(exports, \"getDnsSuffix\", { enumerable: true, get: function () { return getDnsSuffix_1.getDnsSuffix; } });\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,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,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sources":["../../../../src/clients/handlers/fetch.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.fetchTransferHandler = void 0;\nconst errors_1 = require(\"../../errors\");\nconst memoization_1 = require(\"../utils/memoization\");\nconst types_1 = require(\"../../types\");\nconst shouldSendBody = (method) => !['HEAD', 'GET'].includes(method.toUpperCase());\n// TODO[AllanZhengYP]: we need to provide isCanceledError utility\nconst fetchTransferHandler = async ({ url, method, headers, body }, { abortSignal, cache, withCrossDomainCredentials }) => {\n let resp;\n try {\n resp = await fetch(url, {\n method,\n headers,\n body: shouldSendBody(method) ? body : undefined,\n signal: abortSignal,\n cache,\n credentials: withCrossDomainCredentials ? 'include' : 'same-origin',\n });\n }\n catch (e) {\n if (e instanceof TypeError) {\n throw new errors_1.AmplifyError({\n name: types_1.AmplifyErrorCode.NetworkError,\n message: 'A network error has occurred.',\n underlyingError: e,\n });\n }\n throw e;\n }\n const responseHeaders = {};\n resp.headers?.forEach((value, key) => {\n responseHeaders[key.toLowerCase()] = value;\n });\n const httpResponse = {\n statusCode: resp.status,\n headers: responseHeaders,\n body: null,\n };\n // resp.body is a ReadableStream according to Fetch API spec, but React Native\n // does not implement it.\n const bodyWithMixin = Object.assign(resp.body ?? {}, {\n text: (0, memoization_1.withMemoization)(() => resp.text()),\n blob: (0, memoization_1.withMemoization)(() => resp.blob()),\n json: (0, memoization_1.withMemoization)(() => resp.json()),\n });\n return {\n ...httpResponse,\n body: bodyWithMixin,\n };\n};\nexports.fetchTransferHandler = fetchTransferHandler;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oBAAoB,GAAG,MAAM;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,MAAM,aAAa,GAAG,OAAO,CAAC,sBAAsB,CAAC;AACrD,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,cAAc,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;AAClF;AACA,MAAM,oBAAoB,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,0BAA0B,EAAE,KAAK;AAC3H,IAAI,IAAI,IAAI;AACZ,IAAI,IAAI;AACR,QAAQ,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;AAChC,YAAY,MAAM;AAClB,YAAY,OAAO;AACnB,YAAY,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS;AAC3D,YAAY,MAAM,EAAE,WAAW;AAC/B,YAAY,KAAK;AACjB,YAAY,WAAW,EAAE,0BAA0B,GAAG,SAAS,GAAG,aAAa;AAC/E,SAAS,CAAC;AACV;
|
|
1
|
+
{"version":3,"file":"fetch.js","sources":["../../../../src/clients/handlers/fetch.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.fetchTransferHandler = void 0;\nconst errors_1 = require(\"../../errors\");\nconst memoization_1 = require(\"../utils/memoization\");\nconst types_1 = require(\"../../types\");\nconst shouldSendBody = (method) => !['HEAD', 'GET'].includes(method.toUpperCase());\n// TODO[AllanZhengYP]: we need to provide isCanceledError utility\nconst fetchTransferHandler = async ({ url, method, headers, body }, { abortSignal, cache, withCrossDomainCredentials }) => {\n let resp;\n try {\n resp = await fetch(url, {\n method,\n headers,\n body: shouldSendBody(method) ? body : undefined,\n signal: abortSignal,\n cache,\n credentials: withCrossDomainCredentials ? 'include' : 'same-origin',\n });\n }\n catch (e) {\n if (e instanceof TypeError) {\n throw new errors_1.AmplifyError({\n name: types_1.AmplifyErrorCode.NetworkError,\n message: 'A network error has occurred.',\n underlyingError: e,\n });\n }\n throw e;\n }\n const responseHeaders = {};\n resp.headers?.forEach((value, key) => {\n responseHeaders[key.toLowerCase()] = value;\n });\n const httpResponse = {\n statusCode: resp.status,\n headers: responseHeaders,\n body: null,\n };\n // resp.body is a ReadableStream according to Fetch API spec, but React Native\n // does not implement it.\n const bodyWithMixin = Object.assign(resp.body ?? {}, {\n text: (0, memoization_1.withMemoization)(() => resp.text()),\n blob: (0, memoization_1.withMemoization)(() => resp.blob()),\n json: (0, memoization_1.withMemoization)(() => resp.json()),\n });\n return {\n ...httpResponse,\n body: bodyWithMixin,\n };\n};\nexports.fetchTransferHandler = fetchTransferHandler;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oBAAoB,GAAG,MAAM;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,MAAM,aAAa,GAAG,OAAO,CAAC,sBAAsB,CAAC;AACrD,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,cAAc,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;AAClF;AACA,MAAM,oBAAoB,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,0BAA0B,EAAE,KAAK;AAC3H,IAAI,IAAI,IAAI;AACZ,IAAI,IAAI;AACR,QAAQ,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;AAChC,YAAY,MAAM;AAClB,YAAY,OAAO;AACnB,YAAY,IAAI,EAAE,cAAc,CAAC,MAAM,C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