@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":"libraryUtils.js","sources":["../../src/libraryUtils.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.ApiError = exports.createAssertionFunction = exports.PlatformNotSupportedError = exports.AmplifyError = exports.setCustomUserAgent = exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InAppMessagingAction = exports.InteractionsAction = exports.GeoAction = exports.Framework = exports.DataStoreAction = exports.Category = exports.AnalyticsAction = exports.AuthAction = exports.ApiAction = exports.AiAction = exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.haveCredentialsChanged = exports.Signer = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.getDeviceName = exports.getClientInfo = exports.parseAmplifyConfig = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.ADD_OAUTH_LISTENER = exports.parseAmplifyOutputs = exports.isAmplifyOutputs = exports.parseAWSExports = exports.deDupeAsyncFunction = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isTokenExpired = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;\nexports.SESSION_STOP_EVENT = exports.SESSION_START_EVENT = exports.sessionListener = exports.HubInternal = exports.WordArray = exports.cryptoSecureRandomInt = exports.getCrypto = exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.AmplifyErrorCode = void 0;\n/*\nThis file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal\nutils for use throughout the library.\n*/\n// Core utilities\nvar utils_1 = require(\"./utils\");\nObject.defineProperty(exports, \"generateRandomString\", { enumerable: true, get: function () { return utils_1.generateRandomString; } });\nObject.defineProperty(exports, \"isBrowser\", { enumerable: true, get: function () { return utils_1.isBrowser; } });\nObject.defineProperty(exports, \"isNonRetryableError\", { enumerable: true, get: function () { return utils_1.isNonRetryableError; } });\nObject.defineProperty(exports, \"isTokenExpired\", { enumerable: true, get: function () { return utils_1.isTokenExpired; } });\nObject.defineProperty(exports, \"isWebWorker\", { enumerable: true, get: function () { return utils_1.isWebWorker; } });\nObject.defineProperty(exports, \"jitteredBackoff\", { enumerable: true, get: function () { return utils_1.jitteredBackoff; } });\nObject.defineProperty(exports, \"jitteredExponentialRetry\", { enumerable: true, get: function () { return utils_1.jitteredExponentialRetry; } });\nObject.defineProperty(exports, \"NonRetryableError\", { enumerable: true, get: function () { return utils_1.NonRetryableError; } });\nObject.defineProperty(exports, \"retry\", { enumerable: true, get: function () { return utils_1.retry; } });\nObject.defineProperty(exports, \"urlSafeDecode\", { enumerable: true, get: function () { return utils_1.urlSafeDecode; } });\nObject.defineProperty(exports, \"urlSafeEncode\", { enumerable: true, get: function () { return utils_1.urlSafeEncode; } });\nObject.defineProperty(exports, \"deDupeAsyncFunction\", { enumerable: true, get: function () { return utils_1.deDupeAsyncFunction; } });\nvar parseAWSExports_1 = require(\"./parseAWSExports\");\nObject.defineProperty(exports, \"parseAWSExports\", { enumerable: true, get: function () { return parseAWSExports_1.parseAWSExports; } });\nvar parseAmplifyOutputs_1 = require(\"./parseAmplifyOutputs\");\nObject.defineProperty(exports, \"isAmplifyOutputs\", { enumerable: true, get: function () { return parseAmplifyOutputs_1.isAmplifyOutputs; } });\nObject.defineProperty(exports, \"parseAmplifyOutputs\", { enumerable: true, get: function () { return parseAmplifyOutputs_1.parseAmplifyOutputs; } });\nvar constants_1 = require(\"./singleton/constants\");\nObject.defineProperty(exports, \"ADD_OAUTH_LISTENER\", { enumerable: true, get: function () { return constants_1.ADD_OAUTH_LISTENER; } });\nvar amplifyUuid_1 = require(\"./utils/amplifyUuid\");\nObject.defineProperty(exports, \"amplifyUuid\", { enumerable: true, get: function () { return amplifyUuid_1.amplifyUuid; } });\nvar amplifyUrl_1 = require(\"./utils/amplifyUrl\");\nObject.defineProperty(exports, \"AmplifyUrl\", { enumerable: true, get: function () { return amplifyUrl_1.AmplifyUrl; } });\nObject.defineProperty(exports, \"AmplifyUrlSearchParams\", { enumerable: true, get: function () { return amplifyUrl_1.AmplifyUrlSearchParams; } });\nvar parseAmplifyConfig_1 = require(\"./utils/parseAmplifyConfig\");\nObject.defineProperty(exports, \"parseAmplifyConfig\", { enumerable: true, get: function () { return parseAmplifyConfig_1.parseAmplifyConfig; } });\nvar utils_2 = require(\"./utils\");\nObject.defineProperty(exports, \"getClientInfo\", { enumerable: true, get: function () { return utils_2.getClientInfo; } });\nvar deviceName_1 = require(\"./utils/deviceName\");\nObject.defineProperty(exports, \"getDeviceName\", { enumerable: true, get: function () { return deviceName_1.getDeviceName; } });\n// Auth utilities\nvar utils_3 = require(\"./singleton/Auth/utils\");\nObject.defineProperty(exports, \"decodeJWT\", { enumerable: true, get: function () { return utils_3.decodeJWT; } });\nObject.defineProperty(exports, \"assertTokenProviderConfig\", { enumerable: true, get: function () { return utils_3.assertTokenProviderConfig; } });\nObject.defineProperty(exports, \"assertIdentityPoolIdConfig\", { enumerable: true, get: function () { return utils_3.assertIdentityPoolIdConfig; } });\nObject.defineProperty(exports, \"assertOAuthConfig\", { enumerable: true, get: function () { return utils_3.assertOAuthConfig; } });\nvar Signer_1 = require(\"./Signer\");\nObject.defineProperty(exports, \"Signer\", { enumerable: true, get: function () { return Signer_1.Signer; } });\nvar haveCredentialsChanged_1 = require(\"./utils/haveCredentialsChanged\");\nObject.defineProperty(exports, \"haveCredentialsChanged\", { enumerable: true, get: function () { return haveCredentialsChanged_1.haveCredentialsChanged; } });\n// Platform & user-agent utilities\nvar Platform_1 = require(\"./Platform\");\nObject.defineProperty(exports, \"Platform\", { enumerable: true, get: function () { return Platform_1.Platform; } });\nObject.defineProperty(exports, \"getAmplifyUserAgentObject\", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgentObject; } });\nObject.defineProperty(exports, \"getAmplifyUserAgent\", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgent; } });\nvar types_1 = require(\"./Platform/types\");\nObject.defineProperty(exports, \"AiAction\", { enumerable: true, get: function () { return types_1.AiAction; } });\nObject.defineProperty(exports, \"ApiAction\", { enumerable: true, get: function () { return types_1.ApiAction; } });\nObject.defineProperty(exports, \"AuthAction\", { enumerable: true, get: function () { return types_1.AuthAction; } });\nObject.defineProperty(exports, \"AnalyticsAction\", { enumerable: true, get: function () { return types_1.AnalyticsAction; } });\nObject.defineProperty(exports, \"Category\", { enumerable: true, get: function () { return types_1.Category; } });\nObject.defineProperty(exports, \"DataStoreAction\", { enumerable: true, get: function () { return types_1.DataStoreAction; } });\nObject.defineProperty(exports, \"Framework\", { enumerable: true, get: function () { return types_1.Framework; } });\nObject.defineProperty(exports, \"GeoAction\", { enumerable: true, get: function () { return types_1.GeoAction; } });\nObject.defineProperty(exports, \"InteractionsAction\", { enumerable: true, get: function () { return types_1.InteractionsAction; } });\nObject.defineProperty(exports, \"InAppMessagingAction\", { enumerable: true, get: function () { return types_1.InAppMessagingAction; } });\nObject.defineProperty(exports, \"PredictionsAction\", { enumerable: true, get: function () { return types_1.PredictionsAction; } });\nObject.defineProperty(exports, \"PubSubAction\", { enumerable: true, get: function () { return types_1.PubSubAction; } });\nObject.defineProperty(exports, \"PushNotificationAction\", { enumerable: true, get: function () { return types_1.PushNotificationAction; } });\nObject.defineProperty(exports, \"StorageAction\", { enumerable: true, get: function () { return types_1.StorageAction; } });\nvar customUserAgent_1 = require(\"./Platform/customUserAgent\");\nObject.defineProperty(exports, \"setCustomUserAgent\", { enumerable: true, get: function () { return customUserAgent_1.setCustomUserAgent; } });\n// Error handling\nvar errors_1 = require(\"./errors\");\nObject.defineProperty(exports, \"AmplifyError\", { enumerable: true, get: function () { return errors_1.AmplifyError; } });\nObject.defineProperty(exports, \"PlatformNotSupportedError\", { enumerable: true, get: function () { return errors_1.PlatformNotSupportedError; } });\nObject.defineProperty(exports, \"createAssertionFunction\", { enumerable: true, get: function () { return errors_1.createAssertionFunction; } });\nObject.defineProperty(exports, \"ApiError\", { enumerable: true, get: function () { return errors_1.ApiError; } });\nvar types_2 = require(\"./types\");\nObject.defineProperty(exports, \"AmplifyErrorCode\", { enumerable: true, get: function () { return types_2.AmplifyErrorCode; } });\n// Other utilities & constants\nvar BackgroundProcessManager_1 = require(\"./BackgroundProcessManager\");\nObject.defineProperty(exports, \"BackgroundProcessManager\", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManager; } });\nvar Mutex_1 = require(\"./Mutex\");\nObject.defineProperty(exports, \"Mutex\", { enumerable: true, get: function () { return Mutex_1.Mutex; } });\nvar Reachability_1 = require(\"./Reachability\");\nObject.defineProperty(exports, \"Reachability\", { enumerable: true, get: function () { return Reachability_1.Reachability; } });\nvar constants_2 = require(\"./constants\");\nObject.defineProperty(exports, \"USER_AGENT_HEADER\", { enumerable: true, get: function () { return constants_2.USER_AGENT_HEADER; } });\nvar fetchAuthSession_1 = require(\"./singleton/apis/internal/fetchAuthSession\");\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });\nvar Hub_1 = require(\"./Hub\");\nObject.defineProperty(exports, \"AMPLIFY_SYMBOL\", { enumerable: true, get: function () { return Hub_1.AMPLIFY_SYMBOL; } });\nvar convert_1 = require(\"./utils/convert\");\nObject.defineProperty(exports, \"base64Decoder\", { enumerable: true, get: function () { return convert_1.base64Decoder; } });\nObject.defineProperty(exports, \"base64Encoder\", { enumerable: true, get: function () { return convert_1.base64Encoder; } });\nvar globalHelpers_1 = require(\"./utils/globalHelpers\");\nObject.defineProperty(exports, \"getCrypto\", { enumerable: true, get: function () { return globalHelpers_1.getCrypto; } });\nvar cryptoSecureRandomInt_1 = require(\"./utils/cryptoSecureRandomInt\");\nObject.defineProperty(exports, \"cryptoSecureRandomInt\", { enumerable: true, get: function () { return cryptoSecureRandomInt_1.cryptoSecureRandomInt; } });\nvar WordArray_1 = require(\"./utils/WordArray\");\nObject.defineProperty(exports, \"WordArray\", { enumerable: true, get: function () { return WordArray_1.WordArray; } });\n// Hub\nvar Hub_2 = require(\"./Hub\");\nObject.defineProperty(exports, \"HubInternal\", { enumerable: true, get: function () { return Hub_2.HubInternal; } });\n// Session listener\nvar sessionListener_1 = require(\"./utils/sessionListener\");\nObject.defineProperty(exports, \"sessionListener\", { enumerable: true, get: function () { return sessionListener_1.sessionListener; } });\nvar sessionListener_2 = require(\"./utils/sessionListener\");\nObject.defineProperty(exports, \"SESSION_START_EVENT\", { enumerable: true, get: function () { return sessionListener_2.SESSION_START_EVENT; } });\nObject.defineProperty(exports, \"SESSION_STOP_EVENT\", { enumerable: true, get: function () { return sessionListener_2.SESSION_STOP_EVENT; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CA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AC,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,KAAK,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC;AACnH;AACA,IAAI,iBAAiB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC1D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC;AACvI,IAAI,iBAAiB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC1D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,qBAAqB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,mBAAmB,CAAC,EAAE,EAAE,CAAC;AAC/I,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC;;"}
|
|
1
|
+
{"version":3,"file":"libraryUtils.js","sources":["../../src/libraryUtils.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.ApiError = exports.createAssertionFunction = exports.PlatformNotSupportedError = exports.AmplifyError = exports.setCustomUserAgent = exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InAppMessagingAction = exports.InteractionsAction = exports.GeoAction = exports.Framework = exports.DataStoreAction = exports.Category = exports.AnalyticsAction = exports.AuthAction = exports.ApiAction = exports.AiAction = exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.haveCredentialsChanged = exports.Signer = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.getDeviceName = exports.getClientInfo = exports.parseAmplifyConfig = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.ADD_OAUTH_LISTENER = exports.parseAmplifyOutputs = exports.isAmplifyOutputs = exports.parseAWSExports = exports.deDupeAsyncFunction = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isTokenExpired = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;\nexports.SESSION_STOP_EVENT = exports.SESSION_START_EVENT = exports.sessionListener = exports.HubInternal = exports.WordArray = exports.cryptoSecureRandomInt = exports.getCrypto = exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.AmplifyErrorCode = void 0;\n/*\nThis file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal\nutils for use throughout the library.\n*/\n// Core utilities\nvar utils_1 = require(\"./utils\");\nObject.defineProperty(exports, \"generateRandomString\", { enumerable: true, get: function () { return utils_1.generateRandomString; } });\nObject.defineProperty(exports, \"isBrowser\", { enumerable: true, get: function () { return utils_1.isBrowser; } });\nObject.defineProperty(exports, \"isNonRetryableError\", { enumerable: true, get: function () { return utils_1.isNonRetryableError; } });\nObject.defineProperty(exports, \"isTokenExpired\", { enumerable: true, get: function () { return utils_1.isTokenExpired; } });\nObject.defineProperty(exports, \"isWebWorker\", { enumerable: true, get: function () { return utils_1.isWebWorker; } });\nObject.defineProperty(exports, \"jitteredBackoff\", { enumerable: true, get: function () { return utils_1.jitteredBackoff; } });\nObject.defineProperty(exports, \"jitteredExponentialRetry\", { enumerable: true, get: function () { return utils_1.jitteredExponentialRetry; } });\nObject.defineProperty(exports, \"NonRetryableError\", { enumerable: true, get: function () { return utils_1.NonRetryableError; } });\nObject.defineProperty(exports, \"retry\", { enumerable: true, get: function () { return utils_1.retry; } });\nObject.defineProperty(exports, \"urlSafeDecode\", { enumerable: true, get: function () { return utils_1.urlSafeDecode; } });\nObject.defineProperty(exports, \"urlSafeEncode\", { enumerable: true, get: function () { return utils_1.urlSafeEncode; } });\nObject.defineProperty(exports, \"deDupeAsyncFunction\", { enumerable: true, get: function () { return utils_1.deDupeAsyncFunction; } });\nvar parseAWSExports_1 = require(\"./parseAWSExports\");\nObject.defineProperty(exports, \"parseAWSExports\", { enumerable: true, get: function () { return parseAWSExports_1.parseAWSExports; } });\nvar parseAmplifyOutputs_1 = require(\"./parseAmplifyOutputs\");\nObject.defineProperty(exports, \"isAmplifyOutputs\", { enumerable: true, get: function () { return parseAmplifyOutputs_1.isAmplifyOutputs; } });\nObject.defineProperty(exports, \"parseAmplifyOutputs\", { enumerable: true, get: function () { return parseAmplifyOutputs_1.parseAmplifyOutputs; } });\nvar constants_1 = require(\"./singleton/constants\");\nObject.defineProperty(exports, \"ADD_OAUTH_LISTENER\", { enumerable: true, get: function () { return constants_1.ADD_OAUTH_LISTENER; } });\nvar amplifyUuid_1 = require(\"./utils/amplifyUuid\");\nObject.defineProperty(exports, \"amplifyUuid\", { enumerable: true, get: function () { return amplifyUuid_1.amplifyUuid; } });\nvar amplifyUrl_1 = require(\"./utils/amplifyUrl\");\nObject.defineProperty(exports, \"AmplifyUrl\", { enumerable: true, get: function () { return amplifyUrl_1.AmplifyUrl; } });\nObject.defineProperty(exports, \"AmplifyUrlSearchParams\", { enumerable: true, get: function () { return amplifyUrl_1.AmplifyUrlSearchParams; } });\nvar parseAmplifyConfig_1 = require(\"./utils/parseAmplifyConfig\");\nObject.defineProperty(exports, \"parseAmplifyConfig\", { enumerable: true, get: function () { return parseAmplifyConfig_1.parseAmplifyConfig; } });\nvar utils_2 = require(\"./utils\");\nObject.defineProperty(exports, \"getClientInfo\", { enumerable: true, get: function () { return utils_2.getClientInfo; } });\nvar deviceName_1 = require(\"./utils/deviceName\");\nObject.defineProperty(exports, \"getDeviceName\", { enumerable: true, get: function () { return deviceName_1.getDeviceName; } });\n// Auth utilities\nvar utils_3 = require(\"./singleton/Auth/utils\");\nObject.defineProperty(exports, \"decodeJWT\", { enumerable: true, get: function () { return utils_3.decodeJWT; } });\nObject.defineProperty(exports, \"assertTokenProviderConfig\", { enumerable: true, get: function () { return utils_3.assertTokenProviderConfig; } });\nObject.defineProperty(exports, \"assertIdentityPoolIdConfig\", { enumerable: true, get: function () { return utils_3.assertIdentityPoolIdConfig; } });\nObject.defineProperty(exports, \"assertOAuthConfig\", { enumerable: true, get: function () { return utils_3.assertOAuthConfig; } });\nvar Signer_1 = require(\"./Signer\");\nObject.defineProperty(exports, \"Signer\", { enumerable: true, get: function () { return Signer_1.Signer; } });\nvar haveCredentialsChanged_1 = require(\"./utils/haveCredentialsChanged\");\nObject.defineProperty(exports, \"haveCredentialsChanged\", { enumerable: true, get: function () { return haveCredentialsChanged_1.haveCredentialsChanged; } });\n// Platform & user-agent utilities\nvar Platform_1 = require(\"./Platform\");\nObject.defineProperty(exports, \"Platform\", { enumerable: true, get: function () { return Platform_1.Platform; } });\nObject.defineProperty(exports, \"getAmplifyUserAgentObject\", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgentObject; } });\nObject.defineProperty(exports, \"getAmplifyUserAgent\", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgent; } });\nvar types_1 = require(\"./Platform/types\");\nObject.defineProperty(exports, \"AiAction\", { enumerable: true, get: function () { return types_1.AiAction; } });\nObject.defineProperty(exports, \"ApiAction\", { enumerable: true, get: function () { return types_1.ApiAction; } });\nObject.defineProperty(exports, \"AuthAction\", { enumerable: true, get: function () { return types_1.AuthAction; } });\nObject.defineProperty(exports, \"AnalyticsAction\", { enumerable: true, get: function () { return types_1.AnalyticsAction; } });\nObject.defineProperty(exports, \"Category\", { enumerable: true, get: function () { return types_1.Category; } });\nObject.defineProperty(exports, \"DataStoreAction\", { enumerable: true, get: function () { return types_1.DataStoreAction; } });\nObject.defineProperty(exports, \"Framework\", { enumerable: true, get: function () { return types_1.Framework; } });\nObject.defineProperty(exports, \"GeoAction\", { enumerable: true, get: function () { return types_1.GeoAction; } });\nObject.defineProperty(exports, \"InteractionsAction\", { enumerable: true, get: function () { return types_1.InteractionsAction; } });\nObject.defineProperty(exports, \"InAppMessagingAction\", { enumerable: true, get: function () { return types_1.InAppMessagingAction; } });\nObject.defineProperty(exports, \"PredictionsAction\", { enumerable: true, get: function () { return types_1.PredictionsAction; } });\nObject.defineProperty(exports, \"PubSubAction\", { enumerable: true, get: function () { return types_1.PubSubAction; } });\nObject.defineProperty(exports, \"PushNotificationAction\", { enumerable: true, get: function () { return types_1.PushNotificationAction; } });\nObject.defineProperty(exports, \"StorageAction\", { enumerable: true, get: function () { return types_1.StorageAction; } });\nvar customUserAgent_1 = require(\"./Platform/customUserAgent\");\nObject.defineProperty(exports, \"setCustomUserAgent\", { enumerable: true, get: function () { return customUserAgent_1.setCustomUserAgent; } });\n// Error handling\nvar errors_1 = require(\"./errors\");\nObject.defineProperty(exports, \"AmplifyError\", { enumerable: true, get: function () { return errors_1.AmplifyError; } });\nObject.defineProperty(exports, \"PlatformNotSupportedError\", { enumerable: true, get: function () { return errors_1.PlatformNotSupportedError; } });\nObject.defineProperty(exports, \"createAssertionFunction\", { enumerable: true, get: function () { return errors_1.createAssertionFunction; } });\nObject.defineProperty(exports, \"ApiError\", { enumerable: true, get: function () { return errors_1.ApiError; } });\nvar types_2 = require(\"./types\");\nObject.defineProperty(exports, \"AmplifyErrorCode\", { enumerable: true, get: function () { return types_2.AmplifyErrorCode; } });\n// Other utilities & constants\nvar BackgroundProcessManager_1 = require(\"./BackgroundProcessManager\");\nObject.defineProperty(exports, \"BackgroundProcessManager\", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManager; } });\nvar Mutex_1 = require(\"./Mutex\");\nObject.defineProperty(exports, \"Mutex\", { enumerable: true, get: function () { return Mutex_1.Mutex; } });\nvar Reachability_1 = require(\"./Reachability\");\nObject.defineProperty(exports, \"Reachability\", { enumerable: true, get: function () { return Reachability_1.Reachability; } });\nvar constants_2 = require(\"./constants\");\nObject.defineProperty(exports, \"USER_AGENT_HEADER\", { enumerable: true, get: function () { return constants_2.USER_AGENT_HEADER; } });\nvar fetchAuthSession_1 = require(\"./singleton/apis/internal/fetchAuthSession\");\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });\nvar Hub_1 = require(\"./Hub\");\nObject.defineProperty(exports, \"AMPLIFY_SYMBOL\", { enumerable: true, get: function () { return Hub_1.AMPLIFY_SYMBOL; } });\nvar convert_1 = require(\"./utils/convert\");\nObject.defineProperty(exports, \"base64Decoder\", { enumerable: true, get: function () { return convert_1.base64Decoder; } });\nObject.defineProperty(exports, \"base64Encoder\", { enumerable: true, get: function () { return convert_1.base64Encoder; } });\nvar globalHelpers_1 = require(\"./utils/globalHelpers\");\nObject.defineProperty(exports, \"getCrypto\", { enumerable: true, get: function () { return globalHelpers_1.getCrypto; } });\nvar cryptoSecureRandomInt_1 = require(\"./utils/cryptoSecureRandomInt\");\nObject.defineProperty(exports, \"cryptoSecureRandomInt\", { enumerable: true, get: function () { return cryptoSecureRandomInt_1.cryptoSecureRandomInt; } });\nvar WordArray_1 = require(\"./utils/WordArray\");\nObject.defineProperty(exports, \"WordArray\", { enumerable: true, get: function () { return WordArray_1.WordArray; } });\n// Hub\nvar Hub_2 = require(\"./Hub\");\nObject.defineProperty(exports, \"HubInternal\", { enumerable: true, get: function () { return Hub_2.HubInternal; } });\n// Session listener\nvar sessionListener_1 = require(\"./utils/sessionListener\");\nObject.defineProperty(exports, \"sessionListener\", { enumerable: true, get: function () { return sessionListener_1.sessionListener; } });\nvar sessionListener_2 = require(\"./utils/sessionListener\");\nObject.defineProperty(exports, \"SESSION_START_EVENT\", { enumerable: true, get: function () { return sessionListener_2.SESSION_START_EVENT; } });\nObject.defineProperty(exports, \"SESSION_STOP_EVENT\", { enumerable: true, get: function () { return sessionListener_2.SESSION_STOP_EVENT; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAA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EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;AACrH;AACA,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;AAC5B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;AACnH;AACA,IAAI,iBAAiB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC1D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;AACvI,IAAI,iBAAiB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC1D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,qBAAqB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/I,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseAWSExports.js","sources":["../../src/parseAWSExports.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseAWSExports = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst Logger_1 = require(\"./Logger\");\nconst errors_1 = require(\"./errors\");\nconst logger = new Logger_1.ConsoleLogger('parseAWSExports');\nconst authTypeMapping = {\n API_KEY: 'apiKey',\n AWS_IAM: 'iam',\n AMAZON_COGNITO_USER_POOLS: 'userPool',\n OPENID_CONNECT: 'oidc',\n NONE: 'none',\n AWS_LAMBDA: 'lambda',\n // `LAMBDA` is an incorrect value that was added during the v6 rewrite.\n // Keeping it as a valid value until v7 to prevent breaking customers who might\n // be relying on it as a workaround.\n // ref: https://github.com/aws-amplify/amplify-js/pull/12922\n // TODO: @v7 remove next line\n LAMBDA: 'lambda',\n};\n/**\n * Converts the object imported from `aws-exports.js` or `amplifyconfiguration.json` files generated by\n * the Amplify CLI into an object that conforms to the {@link ResourcesConfig}.\n *\n * @param config A configuration object imported from `aws-exports.js` or `amplifyconfiguration.json`.\n *\n * @returns An object that conforms to the {@link ResourcesConfig} .\n */\nconst parseAWSExports = (config = {}) => {\n if (!Object.prototype.hasOwnProperty.call(config, 'aws_project_region')) {\n throw new errors_1.AmplifyError({\n name: 'InvalidParameterException',\n message: 'Invalid config parameter.',\n recoverySuggestion: 'Ensure passing the config object imported from `amplifyconfiguration.json`.',\n });\n }\n const { aws_appsync_apiKey, aws_appsync_authenticationType, aws_appsync_graphqlEndpoint, aws_appsync_region, aws_bots_config, aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method, aws_cognito_mfa_configuration, aws_cognito_mfa_types, aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms, aws_cognito_signup_attributes, aws_cognito_social_providers, aws_cognito_username_attributes, aws_mandatory_sign_in, aws_mobile_analytics_app_id, aws_mobile_analytics_app_region, aws_user_files_s3_bucket, aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id, aws_user_pools_web_client_id, geo, oauth, predictions, aws_cloud_logic_custom, Notifications, modelIntrospection, } = config;\n const amplifyConfig = {};\n // Analytics\n if (aws_mobile_analytics_app_id) {\n amplifyConfig.Analytics = {\n Pinpoint: {\n appId: aws_mobile_analytics_app_id,\n region: aws_mobile_analytics_app_region,\n },\n };\n }\n // Notifications\n const { InAppMessaging, Push } = Notifications ?? {};\n if (InAppMessaging?.AWSPinpoint || Push?.AWSPinpoint) {\n if (InAppMessaging?.AWSPinpoint) {\n const { appId, region } = InAppMessaging.AWSPinpoint;\n amplifyConfig.Notifications = {\n InAppMessaging: {\n Pinpoint: {\n appId,\n region,\n },\n },\n };\n }\n if (Push?.AWSPinpoint) {\n const { appId, region } = Push.AWSPinpoint;\n amplifyConfig.Notifications = {\n ...amplifyConfig.Notifications,\n PushNotification: {\n Pinpoint: {\n appId,\n region,\n },\n },\n };\n }\n }\n // Interactions\n if (Array.isArray(aws_bots_config)) {\n amplifyConfig.Interactions = {\n LexV1: Object.fromEntries(aws_bots_config.map(bot => [bot.name, bot])),\n };\n }\n // API\n if (aws_appsync_graphqlEndpoint) {\n const defaultAuthMode = authTypeMapping[aws_appsync_authenticationType];\n if (!defaultAuthMode) {\n logger.debug(`Invalid authentication type ${aws_appsync_authenticationType}. Falling back to IAM.`);\n }\n amplifyConfig.API = {\n GraphQL: {\n endpoint: aws_appsync_graphqlEndpoint,\n apiKey: aws_appsync_apiKey,\n region: aws_appsync_region,\n defaultAuthMode: defaultAuthMode ?? 'iam',\n },\n };\n if (modelIntrospection) {\n amplifyConfig.API.GraphQL.modelIntrospection = modelIntrospection;\n }\n }\n // Auth\n const mfaConfig = aws_cognito_mfa_configuration\n ? {\n status: aws_cognito_mfa_configuration &&\n aws_cognito_mfa_configuration.toLowerCase(),\n totpEnabled: aws_cognito_mfa_types?.includes('TOTP') ?? false,\n smsEnabled: aws_cognito_mfa_types?.includes('SMS') ?? false,\n }\n : undefined;\n const passwordFormatConfig = aws_cognito_password_protection_settings\n ? {\n minLength: aws_cognito_password_protection_settings.passwordPolicyMinLength,\n requireLowercase: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_LOWERCASE') ?? false,\n requireUppercase: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_UPPERCASE') ?? false,\n requireNumbers: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_NUMBERS') ?? false,\n requireSpecialCharacters: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_SYMBOLS') ?? false,\n }\n : undefined;\n const mergedUserAttributes = Array.from(new Set([\n ...(aws_cognito_verification_mechanisms ?? []),\n ...(aws_cognito_signup_attributes ?? []),\n ]));\n const userAttributes = mergedUserAttributes.reduce((attributes, key) => ({\n ...attributes,\n // All user attributes generated by the CLI are required\n [key.toLowerCase()]: { required: true },\n }), {});\n const loginWithEmailEnabled = aws_cognito_username_attributes?.includes('EMAIL') ?? false;\n const loginWithPhoneEnabled = aws_cognito_username_attributes?.includes('PHONE_NUMBER') ?? false;\n if (aws_cognito_identity_pool_id || aws_user_pools_id) {\n amplifyConfig.Auth = {\n Cognito: {\n identityPoolId: aws_cognito_identity_pool_id,\n allowGuestAccess: aws_mandatory_sign_in !== 'enable',\n signUpVerificationMethod: aws_cognito_sign_up_verification_method,\n userAttributes,\n userPoolClientId: aws_user_pools_web_client_id,\n userPoolId: aws_user_pools_id,\n mfa: mfaConfig,\n passwordFormat: passwordFormatConfig,\n loginWith: {\n username: !(loginWithEmailEnabled || loginWithPhoneEnabled),\n email: loginWithEmailEnabled,\n phone: loginWithPhoneEnabled,\n },\n },\n };\n }\n const hasOAuthConfig = oauth ? Object.keys(oauth).length > 0 : false;\n const hasSocialProviderConfig = aws_cognito_social_providers\n ? aws_cognito_social_providers.length > 0\n : false;\n if (amplifyConfig.Auth && hasOAuthConfig) {\n amplifyConfig.Auth.Cognito.loginWith = {\n ...amplifyConfig.Auth.Cognito.loginWith,\n oauth: {\n ...getOAuthConfig(oauth),\n ...(hasSocialProviderConfig && {\n providers: parseSocialProviders(aws_cognito_social_providers),\n }),\n },\n };\n }\n // Storage\n if (aws_user_files_s3_bucket) {\n amplifyConfig.Storage = {\n S3: {\n bucket: aws_user_files_s3_bucket,\n region: aws_user_files_s3_bucket_region,\n dangerouslyConnectToHttpEndpointForTesting: aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing,\n },\n };\n }\n // Geo\n if (geo) {\n const { amazon_location_service } = geo;\n amplifyConfig.Geo = {\n LocationService: {\n maps: amazon_location_service.maps,\n geofenceCollections: amazon_location_service.geofenceCollections,\n searchIndices: amazon_location_service.search_indices,\n region: amazon_location_service.region,\n },\n };\n }\n // REST API\n if (aws_cloud_logic_custom) {\n amplifyConfig.API = {\n ...amplifyConfig.API,\n REST: aws_cloud_logic_custom.reduce((acc, api) => {\n const { name, endpoint, region, service } = api;\n return {\n ...acc,\n [name]: {\n endpoint,\n ...(service ? { service } : undefined),\n ...(region ? { region } : undefined),\n },\n };\n }, {}),\n };\n }\n // Predictions\n if (predictions) {\n // map VoiceId from speechGenerator defaults to voiceId\n const { VoiceId: voiceId } = predictions?.convert?.speechGenerator?.defaults ?? {};\n amplifyConfig.Predictions = voiceId\n ? {\n ...predictions,\n convert: {\n ...predictions.convert,\n speechGenerator: {\n ...predictions.convert.speechGenerator,\n defaults: { voiceId },\n },\n },\n }\n : predictions;\n }\n return amplifyConfig;\n};\nexports.parseAWSExports = parseAWSExports;\nconst getRedirectUrl = (redirectStr) => redirectStr?.split(',') ?? [];\nconst getOAuthConfig = ({ domain, scope, redirectSignIn, redirectSignOut, responseType, }) => ({\n domain,\n scopes: scope,\n redirectSignIn: getRedirectUrl(redirectSignIn),\n redirectSignOut: getRedirectUrl(redirectSignOut),\n responseType,\n});\nconst parseSocialProviders = (aws_cognito_social_providers) => {\n return aws_cognito_social_providers.map((provider) => {\n const updatedProvider = provider.toLowerCase();\n return updatedProvider.charAt(0).toUpperCase() + updatedProvider.slice(1);\n });\n};\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC;AACA;AACA,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC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AAc,GAAG,CAAC,WAAW,KAAK,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE;AACrE,MAAM,cAAc,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,GAAG,MAAM;AAC/F,IAAI,MAAM;AACV,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,cAAc,EAAE,cAAc,CAAC,cAAc,CAAC;AAClD,IAAI,eAAe,EAAE,cAAc,CAAC,eAAe,CAAC;AACpD,IAAI,YAAY;AAChB,CAAC,CAAC;AACF,MAAM,oBAAoB,GAAG,CAAC,4BAA4B,KAAK;AAC/D,IAAI,OAAO,4BAA4B,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK;AAC1D,QAAQ,MAAM,eAAe,GAAG,QAAQ,CAAC,WAAW,EAAE;AACtD,QAAQ,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;AACjF,KAAK,CAAC;AACN,CAAC;;"}
|
|
1
|
+
{"version":3,"file":"parseAWSExports.js","sources":["../../src/parseAWSExports.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseAWSExports = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst Logger_1 = require(\"./Logger\");\nconst errors_1 = require(\"./errors\");\nconst logger = new Logger_1.ConsoleLogger('parseAWSExports');\nconst authTypeMapping = {\n API_KEY: 'apiKey',\n AWS_IAM: 'iam',\n AMAZON_COGNITO_USER_POOLS: 'userPool',\n OPENID_CONNECT: 'oidc',\n NONE: 'none',\n AWS_LAMBDA: 'lambda',\n // `LAMBDA` is an incorrect value that was added during the v6 rewrite.\n // Keeping it as a valid value until v7 to prevent breaking customers who might\n // be relying on it as a workaround.\n // ref: https://github.com/aws-amplify/amplify-js/pull/12922\n // TODO: @v7 remove next line\n LAMBDA: 'lambda',\n};\n/**\n * Converts the object imported from `aws-exports.js` or `amplifyconfiguration.json` files generated by\n * the Amplify CLI into an object that conforms to the {@link ResourcesConfig}.\n *\n * @param config A configuration object imported from `aws-exports.js` or `amplifyconfiguration.json`.\n *\n * @returns An object that conforms to the {@link ResourcesConfig} .\n */\nconst parseAWSExports = (config = {}) => {\n if (!Object.prototype.hasOwnProperty.call(config, 'aws_project_region')) {\n throw new errors_1.AmplifyError({\n name: 'InvalidParameterException',\n message: 'Invalid config parameter.',\n recoverySuggestion: 'Ensure passing the config object imported from `amplifyconfiguration.json`.',\n });\n }\n const { aws_appsync_apiKey, aws_appsync_authenticationType, aws_appsync_graphqlEndpoint, aws_appsync_region, aws_bots_config, aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method, aws_cognito_mfa_configuration, aws_cognito_mfa_types, aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms, aws_cognito_signup_attributes, aws_cognito_social_providers, aws_cognito_username_attributes, aws_mandatory_sign_in, aws_mobile_analytics_app_id, aws_mobile_analytics_app_region, aws_user_files_s3_bucket, aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id, aws_user_pools_web_client_id, geo, oauth, predictions, aws_cloud_logic_custom, Notifications, modelIntrospection, } = config;\n const amplifyConfig = {};\n // Analytics\n if (aws_mobile_analytics_app_id) {\n amplifyConfig.Analytics = {\n Pinpoint: {\n appId: aws_mobile_analytics_app_id,\n region: aws_mobile_analytics_app_region,\n },\n };\n }\n // Notifications\n const { InAppMessaging, Push } = Notifications ?? {};\n if (InAppMessaging?.AWSPinpoint || Push?.AWSPinpoint) {\n if (InAppMessaging?.AWSPinpoint) {\n const { appId, region } = InAppMessaging.AWSPinpoint;\n amplifyConfig.Notifications = {\n InAppMessaging: {\n Pinpoint: {\n appId,\n region,\n },\n },\n };\n }\n if (Push?.AWSPinpoint) {\n const { appId, region } = Push.AWSPinpoint;\n amplifyConfig.Notifications = {\n ...amplifyConfig.Notifications,\n PushNotification: {\n Pinpoint: {\n appId,\n region,\n },\n },\n };\n }\n }\n // Interactions\n if (Array.isArray(aws_bots_config)) {\n amplifyConfig.Interactions = {\n LexV1: Object.fromEntries(aws_bots_config.map(bot => [bot.name, bot])),\n };\n }\n // API\n if (aws_appsync_graphqlEndpoint) {\n const defaultAuthMode = authTypeMapping[aws_appsync_authenticationType];\n if (!defaultAuthMode) {\n logger.debug(`Invalid authentication type ${aws_appsync_authenticationType}. Falling back to IAM.`);\n }\n amplifyConfig.API = {\n GraphQL: {\n endpoint: aws_appsync_graphqlEndpoint,\n apiKey: aws_appsync_apiKey,\n region: aws_appsync_region,\n defaultAuthMode: defaultAuthMode ?? 'iam',\n },\n };\n if (modelIntrospection) {\n amplifyConfig.API.GraphQL.modelIntrospection = modelIntrospection;\n }\n }\n // Auth\n const mfaConfig = aws_cognito_mfa_configuration\n ? {\n status: aws_cognito_mfa_configuration &&\n aws_cognito_mfa_configuration.toLowerCase(),\n totpEnabled: aws_cognito_mfa_types?.includes('TOTP') ?? false,\n smsEnabled: aws_cognito_mfa_types?.includes('SMS') ?? false,\n }\n : undefined;\n const passwordFormatConfig = aws_cognito_password_protection_settings\n ? {\n minLength: aws_cognito_password_protection_settings.passwordPolicyMinLength,\n requireLowercase: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_LOWERCASE') ?? false,\n requireUppercase: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_UPPERCASE') ?? false,\n requireNumbers: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_NUMBERS') ?? false,\n requireSpecialCharacters: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_SYMBOLS') ?? false,\n }\n : undefined;\n const mergedUserAttributes = Array.from(new Set([\n ...(aws_cognito_verification_mechanisms ?? []),\n ...(aws_cognito_signup_attributes ?? []),\n ]));\n const userAttributes = mergedUserAttributes.reduce((attributes, key) => ({\n ...attributes,\n // All user attributes generated by the CLI are required\n [key.toLowerCase()]: { required: true },\n }), {});\n const loginWithEmailEnabled = aws_cognito_username_attributes?.includes('EMAIL') ?? false;\n const loginWithPhoneEnabled = aws_cognito_username_attributes?.includes('PHONE_NUMBER') ?? false;\n if (aws_cognito_identity_pool_id || aws_user_pools_id) {\n amplifyConfig.Auth = {\n Cognito: {\n identityPoolId: aws_cognito_identity_pool_id,\n allowGuestAccess: aws_mandatory_sign_in !== 'enable',\n signUpVerificationMethod: aws_cognito_sign_up_verification_method,\n userAttributes,\n userPoolClientId: aws_user_pools_web_client_id,\n userPoolId: aws_user_pools_id,\n mfa: mfaConfig,\n passwordFormat: passwordFormatConfig,\n loginWith: {\n username: !(loginWithEmailEnabled || loginWithPhoneEnabled),\n email: loginWithEmailEnabled,\n phone: loginWithPhoneEnabled,\n },\n },\n };\n }\n const hasOAuthConfig = oauth ? Object.keys(oauth).length > 0 : false;\n const hasSocialProviderConfig = aws_cognito_social_providers\n ? aws_cognito_social_providers.length > 0\n : false;\n if (amplifyConfig.Auth && hasOAuthConfig) {\n amplifyConfig.Auth.Cognito.loginWith = {\n ...amplifyConfig.Auth.Cognito.loginWith,\n oauth: {\n ...getOAuthConfig(oauth),\n ...(hasSocialProviderConfig && {\n providers: parseSocialProviders(aws_cognito_social_providers),\n }),\n },\n };\n }\n // Storage\n if (aws_user_files_s3_bucket) {\n amplifyConfig.Storage = {\n S3: {\n bucket: aws_user_files_s3_bucket,\n region: aws_user_files_s3_bucket_region,\n dangerouslyConnectToHttpEndpointForTesting: aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing,\n },\n };\n }\n // Geo\n if (geo) {\n const { amazon_location_service } = geo;\n amplifyConfig.Geo = {\n LocationService: {\n maps: amazon_location_service.maps,\n geofenceCollections: amazon_location_service.geofenceCollections,\n searchIndices: amazon_location_service.search_indices,\n region: amazon_location_service.region,\n },\n };\n }\n // REST API\n if (aws_cloud_logic_custom) {\n amplifyConfig.API = {\n ...amplifyConfig.API,\n REST: aws_cloud_logic_custom.reduce((acc, api) => {\n const { name, endpoint, region, service } = api;\n return {\n ...acc,\n [name]: {\n endpoint,\n ...(service ? { service } : undefined),\n ...(region ? { region } : undefined),\n },\n };\n }, {}),\n };\n }\n // Predictions\n if (predictions) {\n // map VoiceId from speechGenerator defaults to voiceId\n const { VoiceId: voiceId } = predictions?.convert?.speechGenerator?.defaults ?? {};\n amplifyConfig.Predictions = voiceId\n ? {\n ...predictions,\n convert: {\n ...predictions.convert,\n speechGenerator: {\n ...predictions.convert.speechGenerator,\n defaults: { voiceId },\n },\n },\n }\n : predictions;\n }\n return amplifyConfig;\n};\nexports.parseAWSExports = parseAWSExports;\nconst getRedirectUrl = (redirectStr) => redirectStr?.split(',') ?? [];\nconst getOAuthConfig = ({ domain, scope, redirectSignIn, redirectSignOut, responseType, }) => ({\n domain,\n scopes: scope,\n redirectSignIn: getRedirectUrl(redirectSignIn),\n redirectSignOut: getRedirectUrl(redirectSignOut),\n responseType,\n});\nconst parseSocialProviders = (aws_cognito_social_providers) => {\n return aws_cognito_social_providers.map((provider) => {\n const updatedProvider = provider.toLowerCase();\n return updatedProvider.charAt(0).toUpperCase() + updatedProvider.slice(1);\n });\n};\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC;AACA;AACA,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AACpC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,iBAAiB,CAAC;AAC5D,MAAM,eAAe,GAAG;AACxB,IAAI,OAAO,EAAE,QAAQ;AACrB,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,yBAAyB,EAAE,UAAU;AACzC,IAAI,cAAc,E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AAE,eAAe,EAAE,YAAY,GAAG,MAAM;AAC/F,IAAI,MAAM;AACV,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,cAAc,EAAE,cAAc,CAAC,cAAc,CAAC;AAClD,IAAI,eAAe,EAAE,cAAc,CAAC,eAAe,CAAC;AACpD,IAAI,YAAY;AAChB,CAAC,CAAC;AACF,MAAM,oBAAoB,GAAG,CAAC,4BAA4B,KAAK;AAC/D,IAAI,OAAO,4BAA4B,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK;AAC1D,QAAQ,MAAM,eAAe,GAAG,QAAQ,CAAC,WAAW,EAAE;AACtD,QAAQ,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;AACjF,IAAI,CAAC,CAAC;AACN,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseAmplifyOutputs.js","sources":["../../src/parseAmplifyOutputs.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.isAmplifyOutputs = isAmplifyOutputs;\nexports.parseAnalytics = parseAnalytics;\nexports.parseAmplifyOutputs = parseAmplifyOutputs;\nfunction isAmplifyOutputs(config) {\n // version format initially will be '1' but is expected to be something like x.y where x is major and y minor version\n const { version } = config;\n if (!version) {\n return false;\n }\n return version.startsWith('1');\n}\nfunction parseStorage(amplifyOutputsStorageProperties) {\n if (!amplifyOutputsStorageProperties) {\n return undefined;\n }\n const { bucket_name, aws_region, buckets } = amplifyOutputsStorageProperties;\n return {\n S3: {\n bucket: bucket_name,\n region: aws_region,\n buckets: buckets && createBucketInfoMap(buckets),\n },\n };\n}\nfunction parseAuth(amplifyOutputsAuthProperties) {\n if (!amplifyOutputsAuthProperties) {\n return undefined;\n }\n const { user_pool_id, user_pool_client_id, identity_pool_id, password_policy, mfa_configuration, mfa_methods, unauthenticated_identities_enabled, oauth, username_attributes, standard_required_attributes, groups, } = amplifyOutputsAuthProperties;\n const authConfig = {\n Cognito: {\n userPoolId: user_pool_id,\n userPoolClientId: user_pool_client_id,\n groups,\n },\n };\n if (identity_pool_id) {\n authConfig.Cognito = {\n ...authConfig.Cognito,\n identityPoolId: identity_pool_id,\n };\n }\n if (password_policy) {\n authConfig.Cognito.passwordFormat = {\n requireLowercase: password_policy.require_lowercase,\n requireNumbers: password_policy.require_numbers,\n requireUppercase: password_policy.require_uppercase,\n requireSpecialCharacters: password_policy.require_symbols,\n minLength: password_policy.min_length ?? 6,\n };\n }\n if (mfa_configuration) {\n authConfig.Cognito.mfa = {\n status: getMfaStatus(mfa_configuration),\n smsEnabled: mfa_methods?.includes('SMS'),\n totpEnabled: mfa_methods?.includes('TOTP'),\n };\n }\n if (unauthenticated_identities_enabled) {\n authConfig.Cognito.allowGuestAccess = unauthenticated_identities_enabled;\n }\n if (oauth) {\n authConfig.Cognito.loginWith = {\n oauth: {\n domain: oauth.domain,\n redirectSignIn: oauth.redirect_sign_in_uri,\n redirectSignOut: oauth.redirect_sign_out_uri,\n responseType: oauth.response_type === 'token' ? 'token' : 'code',\n scopes: oauth.scopes,\n providers: getOAuthProviders(oauth.identity_providers),\n },\n };\n }\n if (username_attributes) {\n authConfig.Cognito.loginWith = {\n ...authConfig.Cognito.loginWith,\n email: username_attributes.includes('email'),\n phone: username_attributes.includes('phone_number'),\n // Signing in with a username is not currently supported in Gen2, this should always evaluate to false\n username: username_attributes.includes('username'),\n };\n }\n if (standard_required_attributes) {\n authConfig.Cognito.userAttributes = standard_required_attributes.reduce((acc, curr) => ({ ...acc, [curr]: { required: true } }), {});\n }\n return authConfig;\n}\nfunction parseAnalytics(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties?.amazon_pinpoint) {\n return undefined;\n }\n const { amazon_pinpoint } = amplifyOutputsAnalyticsProperties;\n return {\n Pinpoint: {\n appId: amazon_pinpoint.app_id,\n region: amazon_pinpoint.aws_region,\n },\n };\n}\nfunction parseGeo(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties) {\n return undefined;\n }\n const { aws_region, geofence_collections, maps, search_indices } = amplifyOutputsAnalyticsProperties;\n return {\n LocationService: {\n region: aws_region,\n searchIndices: search_indices,\n geofenceCollections: geofence_collections,\n maps,\n },\n };\n}\nfunction parseData(amplifyOutputsDataProperties) {\n if (!amplifyOutputsDataProperties) {\n return undefined;\n }\n const { aws_region, default_authorization_type, url, api_key, model_introspection, } = amplifyOutputsDataProperties;\n const GraphQL = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n modelIntrospection: model_introspection,\n };\n return {\n GraphQL,\n };\n}\nfunction parseCustom(amplifyOutputsCustomProperties) {\n if (!amplifyOutputsCustomProperties?.events) {\n return undefined;\n }\n const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;\n const Events = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n };\n return {\n Events,\n };\n}\nfunction parseNotifications(amplifyOutputsNotificationsProperties) {\n if (!amplifyOutputsNotificationsProperties) {\n return undefined;\n }\n const { aws_region, channels, amazon_pinpoint_app_id } = amplifyOutputsNotificationsProperties;\n const hasInAppMessaging = channels.includes('IN_APP_MESSAGING');\n const hasPushNotification = channels.includes('APNS') || channels.includes('FCM');\n if (!(hasInAppMessaging || hasPushNotification)) {\n return undefined;\n }\n // At this point, we know the Amplify outputs contains at least one supported channel\n const notificationsConfig = {};\n if (hasInAppMessaging) {\n notificationsConfig.InAppMessaging = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n if (hasPushNotification) {\n notificationsConfig.PushNotification = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n return notificationsConfig;\n}\nfunction parseAmplifyOutputs(amplifyOutputs) {\n const resourcesConfig = {};\n if (amplifyOutputs.storage) {\n resourcesConfig.Storage = parseStorage(amplifyOutputs.storage);\n }\n if (amplifyOutputs.auth) {\n resourcesConfig.Auth = parseAuth(amplifyOutputs.auth);\n }\n if (amplifyOutputs.analytics) {\n resourcesConfig.Analytics = parseAnalytics(amplifyOutputs.analytics);\n }\n if (amplifyOutputs.geo) {\n resourcesConfig.Geo = parseGeo(amplifyOutputs.geo);\n }\n if (amplifyOutputs.data) {\n resourcesConfig.API = parseData(amplifyOutputs.data);\n }\n if (amplifyOutputs.custom) {\n const customConfig = parseCustom(amplifyOutputs.custom);\n if (customConfig && 'Events' in customConfig) {\n resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };\n }\n }\n if (amplifyOutputs.notifications) {\n resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);\n }\n return resourcesConfig;\n}\nconst authModeNames = {\n AMAZON_COGNITO_USER_POOLS: 'userPool',\n API_KEY: 'apiKey',\n AWS_IAM: 'iam',\n AWS_LAMBDA: 'lambda',\n OPENID_CONNECT: 'oidc',\n};\nfunction getGraphQLAuthMode(authType) {\n return authModeNames[authType];\n}\nconst providerNames = {\n GOOGLE: 'Google',\n LOGIN_WITH_AMAZON: 'Amazon',\n FACEBOOK: 'Facebook',\n SIGN_IN_WITH_APPLE: 'Apple',\n};\nfunction getOAuthProviders(providers = []) {\n return providers.reduce((oAuthProviders, provider) => {\n if (providerNames[provider] !== undefined) {\n oAuthProviders.push(providerNames[provider]);\n }\n return oAuthProviders;\n }, []);\n}\nfunction getMfaStatus(mfaConfiguration) {\n if (mfaConfiguration === 'OPTIONAL')\n return 'optional';\n if (mfaConfiguration === 'REQUIRED')\n return 'on';\n return 'off';\n}\nfunction createBucketInfoMap(buckets) {\n const mappedBuckets = {};\n buckets.forEach(({ name, bucket_name: bucketName, aws_region: region, paths }) => {\n if (name in mappedBuckets) {\n throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);\n }\n const sanitizedPaths = paths\n ? Object.entries(paths).reduce((acc, [key, value]) => {\n if (value !== undefined) {\n acc[key] = value;\n }\n return acc;\n }, {})\n : undefined;\n mappedBuckets[name] = {\n bucketName,\n region,\n paths: sanitizedPaths,\n };\n });\n return mappedBuckets;\n}\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,gBAAgB;AAC3C,OAAO,CAAC,cAAc,GAAG,cAAc;AACvC,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;AACjD,SAAS,gBAAgB,CAAC,MAAM,EAAE;AAClC;AACA,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM;AAC9B,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,KAAK;AACpB;AACA,IAAI,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;AAClC;AACA,SAAS,YAAY,CAAC,+BAA+B,EAAE;AACvD,IAAI,IAAI,CAAC,+BAA+B,EAAE;AAC1C,QAAQ,OAAO,SAAS;AACxB;AACA,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,+BAA+B;AAChF,IAAI,OAAO;AACX,QAAQ,EAAE,EAAE;AACZ,YAAY,MAAM,EAAE,WAAW;AAC/B,YAAY,MAAM,EAAE,UAAU;AAC9B,YAAY,OAAO,EAAE,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC;AAC5D,SAAS;AACT,KAAK;AACL;AACA,SAAS,SAAS,CAAC,4BAA4B,EAAE;AACjD,IAAI,IAAI,CAAC,4BAA4B,EAAE;AACvC,QAAQ,OAAO,SAAS;AACxB;AACA,IAAI,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAi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KAAK,KAAK,SAAS,EAAE;AACzC,oBAAoB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AACpC;AACA,gBAAgB,OAAO,GAAG;AAC1B,aAAa,EAAE,EAAE;AACjB,cAAc,SAAS;AACvB,QAAQ,aAAa,CAAC,IAAI,CAAC,GAAG;AAC9B,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,KAAK,EAAE,cAAc;AACjC,SAAS;AACT,KAAK,CAAC;AACN,IAAI,OAAO,aAAa;AACxB;;"}
|
|
1
|
+
{"version":3,"file":"parseAmplifyOutputs.js","sources":["../../src/parseAmplifyOutputs.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.isAmplifyOutputs = isAmplifyOutputs;\nexports.parseAnalytics = parseAnalytics;\nexports.parseAmplifyOutputs = parseAmplifyOutputs;\nfunction isAmplifyOutputs(config) {\n // version format initially will be '1' but is expected to be something like x.y where x is major and y minor version\n const { version } = config;\n if (!version) {\n return false;\n }\n return version.startsWith('1');\n}\nfunction parseStorage(amplifyOutputsStorageProperties) {\n if (!amplifyOutputsStorageProperties) {\n return undefined;\n }\n const { bucket_name, aws_region, buckets } = amplifyOutputsStorageProperties;\n return {\n S3: {\n bucket: bucket_name,\n region: aws_region,\n buckets: buckets && createBucketInfoMap(buckets),\n },\n };\n}\nfunction parseAuth(amplifyOutputsAuthProperties) {\n if (!amplifyOutputsAuthProperties) {\n return undefined;\n }\n const { user_pool_id, user_pool_client_id, identity_pool_id, password_policy, mfa_configuration, mfa_methods, unauthenticated_identities_enabled, oauth, username_attributes, standard_required_attributes, groups, } = amplifyOutputsAuthProperties;\n const authConfig = {\n Cognito: {\n userPoolId: user_pool_id,\n userPoolClientId: user_pool_client_id,\n groups,\n },\n };\n if (identity_pool_id) {\n authConfig.Cognito = {\n ...authConfig.Cognito,\n identityPoolId: identity_pool_id,\n };\n }\n if (password_policy) {\n authConfig.Cognito.passwordFormat = {\n requireLowercase: password_policy.require_lowercase,\n requireNumbers: password_policy.require_numbers,\n requireUppercase: password_policy.require_uppercase,\n requireSpecialCharacters: password_policy.require_symbols,\n minLength: password_policy.min_length ?? 6,\n };\n }\n if (mfa_configuration) {\n authConfig.Cognito.mfa = {\n status: getMfaStatus(mfa_configuration),\n smsEnabled: mfa_methods?.includes('SMS'),\n totpEnabled: mfa_methods?.includes('TOTP'),\n };\n }\n if (unauthenticated_identities_enabled) {\n authConfig.Cognito.allowGuestAccess = unauthenticated_identities_enabled;\n }\n if (oauth) {\n authConfig.Cognito.loginWith = {\n oauth: {\n domain: oauth.domain,\n redirectSignIn: oauth.redirect_sign_in_uri,\n redirectSignOut: oauth.redirect_sign_out_uri,\n responseType: oauth.response_type === 'token' ? 'token' : 'code',\n scopes: oauth.scopes,\n providers: getOAuthProviders(oauth.identity_providers),\n },\n };\n }\n if (username_attributes) {\n authConfig.Cognito.loginWith = {\n ...authConfig.Cognito.loginWith,\n email: username_attributes.includes('email'),\n phone: username_attributes.includes('phone_number'),\n // Signing in with a username is not currently supported in Gen2, this should always evaluate to false\n username: username_attributes.includes('username'),\n };\n }\n if (standard_required_attributes) {\n authConfig.Cognito.userAttributes = standard_required_attributes.reduce((acc, curr) => ({ ...acc, [curr]: { required: true } }), {});\n }\n return authConfig;\n}\nfunction parseAnalytics(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties?.amazon_pinpoint) {\n return undefined;\n }\n const { amazon_pinpoint } = amplifyOutputsAnalyticsProperties;\n return {\n Pinpoint: {\n appId: amazon_pinpoint.app_id,\n region: amazon_pinpoint.aws_region,\n },\n };\n}\nfunction parseGeo(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties) {\n return undefined;\n }\n const { aws_region, geofence_collections, maps, search_indices } = amplifyOutputsAnalyticsProperties;\n return {\n LocationService: {\n region: aws_region,\n searchIndices: search_indices,\n geofenceCollections: geofence_collections,\n maps,\n },\n };\n}\nfunction parseData(amplifyOutputsDataProperties) {\n if (!amplifyOutputsDataProperties) {\n return undefined;\n }\n const { aws_region, default_authorization_type, url, api_key, model_introspection, } = amplifyOutputsDataProperties;\n const GraphQL = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n modelIntrospection: model_introspection,\n };\n return {\n GraphQL,\n };\n}\nfunction parseCustom(amplifyOutputsCustomProperties) {\n if (!amplifyOutputsCustomProperties?.events) {\n return undefined;\n }\n const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;\n const Events = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n };\n return {\n Events,\n };\n}\nfunction parseNotifications(amplifyOutputsNotificationsProperties) {\n if (!amplifyOutputsNotificationsProperties) {\n return undefined;\n }\n const { aws_region, channels, amazon_pinpoint_app_id } = amplifyOutputsNotificationsProperties;\n const hasInAppMessaging = channels.includes('IN_APP_MESSAGING');\n const hasPushNotification = channels.includes('APNS') || channels.includes('FCM');\n if (!(hasInAppMessaging || hasPushNotification)) {\n return undefined;\n }\n // At this point, we know the Amplify outputs contains at least one supported channel\n const notificationsConfig = {};\n if (hasInAppMessaging) {\n notificationsConfig.InAppMessaging = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n if (hasPushNotification) {\n notificationsConfig.PushNotification = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n return notificationsConfig;\n}\nfunction parseAmplifyOutputs(amplifyOutputs) {\n const resourcesConfig = {};\n if (amplifyOutputs.storage) {\n resourcesConfig.Storage = parseStorage(amplifyOutputs.storage);\n }\n if (amplifyOutputs.auth) {\n resourcesConfig.Auth = parseAuth(amplifyOutputs.auth);\n }\n if (amplifyOutputs.analytics) {\n resourcesConfig.Analytics = parseAnalytics(amplifyOutputs.analytics);\n }\n if (amplifyOutputs.geo) {\n resourcesConfig.Geo = parseGeo(amplifyOutputs.geo);\n }\n if (amplifyOutputs.data) {\n resourcesConfig.API = parseData(amplifyOutputs.data);\n }\n if (amplifyOutputs.custom) {\n const customConfig = parseCustom(amplifyOutputs.custom);\n if (customConfig && 'Events' in customConfig) {\n resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };\n }\n }\n if (amplifyOutputs.notifications) {\n resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);\n }\n return resourcesConfig;\n}\nconst authModeNames = {\n AMAZON_COGNITO_USER_POOLS: 'userPool',\n API_KEY: 'apiKey',\n AWS_IAM: 'iam',\n AWS_LAMBDA: 'lambda',\n OPENID_CONNECT: 'oidc',\n};\nfunction getGraphQLAuthMode(authType) {\n return authModeNames[authType];\n}\nconst providerNames = {\n GOOGLE: 'Google',\n LOGIN_WITH_AMAZON: 'Amazon',\n FACEBOOK: 'Facebook',\n SIGN_IN_WITH_APPLE: 'Apple',\n};\nfunction getOAuthProviders(providers = []) {\n return providers.reduce((oAuthProviders, provider) => {\n if (providerNames[provider] !== undefined) {\n oAuthProviders.push(providerNames[provider]);\n }\n return oAuthProviders;\n }, []);\n}\nfunction getMfaStatus(mfaConfiguration) {\n if (mfaConfiguration === 'OPTIONAL')\n return 'optional';\n if (mfaConfiguration === 'REQUIRED')\n return 'on';\n return 'off';\n}\nfunction createBucketInfoMap(buckets) {\n const mappedBuckets = {};\n buckets.forEach(({ name, bucket_name: bucketName, aws_region: region, paths }) => {\n if (name in mappedBuckets) {\n throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);\n }\n const sanitizedPaths = paths\n ? Object.entries(paths).reduce((acc, [key, value]) => {\n if (value !== undefined) {\n acc[key] = value;\n }\n return acc;\n }, {})\n : undefined;\n mappedBuckets[name] = {\n bucketName,\n region,\n paths: sanitizedPaths,\n };\n });\n return mappedBuckets;\n}\n"],"names":[],"mappings":";;AACA;AACA;A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oBAAoB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AACpC,gBAAgB;AAChB,gBAAgB,OAAO,GAAG;AAC1B,YAAY,CAAC,EAAE,EAAE;AACjB,cAAc,SAAS;AACvB,QAAQ,aAAa,CAAC,IAAI,CAAC,GAAG;AAC9B,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,KAAK,EAAE,cAAc;AACjC,SAAS;AACT,IAAI,CAAC,CAAC;AACN,IAAI,OAAO,aAAa;AACxB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/providers/pinpoint/apis/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.flushEvents = exports.record = exports.updateEndpoint = void 0;\nvar updateEndpoint_1 = require(\"./updateEndpoint\");\nObject.defineProperty(exports, \"updateEndpoint\", { enumerable: true, get: function () { return updateEndpoint_1.updateEndpoint; } });\nvar record_1 = require(\"./record\");\nObject.defineProperty(exports, \"record\", { enumerable: true, get: function () { return record_1.record; } });\nvar flushEvents_1 = require(\"./flushEvents\");\nObject.defineProperty(exports, \"flushEvents\", { enumerable: true, get: function () { return flushEvents_1.flushEvents; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,MAAM;AACtE,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,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/providers/pinpoint/apis/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.flushEvents = exports.record = exports.updateEndpoint = void 0;\nvar updateEndpoint_1 = require(\"./updateEndpoint\");\nObject.defineProperty(exports, \"updateEndpoint\", { enumerable: true, get: function () { return updateEndpoint_1.updateEndpoint; } });\nvar record_1 = require(\"./record\");\nObject.defineProperty(exports, \"record\", { enumerable: true, get: function () { return record_1.record; } });\nvar flushEvents_1 = require(\"./flushEvents\");\nObject.defineProperty(exports, \"flushEvents\", { enumerable: true, get: function () { return flushEvents_1.flushEvents; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,MAAM;AACtE,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;AACpI,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;AAC5G,IAAI,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;AAC5C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sources":["../../../../../src/providers/pinpoint/apis/record.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.record = void 0;\nconst amplifyUuid_1 = require(\"../../../utils/amplifyUuid\");\nconst utils_1 = require(\"../utils\");\nconst sessionListener_1 = require(\"../../../utils/sessionListener\");\nconst constants_1 = require(\"../utils/constants\");\nconst getEventBuffer_1 = require(\"../utils/getEventBuffer\");\nlet session;\n/**\n * @internal\n */\nconst record = async ({ appId, category, channelType, credentials, event, identityId, region, userAgentValue, bufferSize, flushInterval, flushSize, resendLimit, }) => {\n let eventSession = session;\n const currentTime = new Date();\n const timestampISOString = currentTime.toISOString();\n const eventId = (0, amplifyUuid_1.amplifyUuid)();\n // Prepare event buffer if required\n const buffer = (0, getEventBuffer_1.getEventBuffer)({\n appId,\n region,\n credentials,\n bufferSize: bufferSize ?? constants_1.BUFFER_SIZE,\n flushInterval: flushInterval ?? constants_1.FLUSH_INTERVAL,\n flushSize: flushSize ?? constants_1.FLUSH_SIZE,\n resendLimit: resendLimit ?? constants_1.RESEND_LIMIT,\n identityId,\n userAgentValue,\n });\n const endpointId = await (0, utils_1.resolveEndpointId)({\n appId,\n category,\n channelType,\n credentials,\n identityId,\n region,\n userAgentValue,\n });\n // Generate session if required\n if (!eventSession || event.name === sessionListener_1.SESSION_START_EVENT) {\n const sessionId = (0, amplifyUuid_1.amplifyUuid)();\n session = {\n Id: sessionId,\n StartTimestamp: timestampISOString,\n };\n eventSession = session;\n }\n // Terminate session when required\n if (session && event.name === sessionListener_1.SESSION_STOP_EVENT) {\n eventSession = {\n ...session,\n StopTimestamp: timestampISOString,\n Duration: currentTime.getTime() - new Date(session.StartTimestamp).getTime(),\n };\n session = undefined;\n }\n // Push event to buffer\n buffer.push({\n eventId,\n endpointId,\n event,\n session: eventSession,\n timestamp: timestampISOString,\n resendLimit: resendLimit ?? constants_1.RESEND_LIMIT,\n });\n};\nexports.record = record;\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,4BAA4B,CAAC;AAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,iBAAiB,GAAG,OAAO,CAAC,gCAAgC,CAAC;AACnE,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;AACjD,MAAM,gBAAgB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC3D,IAAI,OAAO;AACX;AACA;AACA;AACA,MAAM,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,GAAG,KAAK;AACvK,IAAI,IAAI,YAAY,GAAG,OAAO;AAC9B,IAAI,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE;AAClC,IAAI,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,EAAE;AACxD,IAAI,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,WAAW,GAAG;AACpD;AACA,IAAI,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,cAAc,EAAE;AACxD,QAAQ,KAAK;AACb,QAAQ,MAAM;AACd,QAAQ,WAAW;AACnB,QAAQ,UAAU,EAAE,UAAU,IAAI,WAAW,CAAC,WAAW;AACzD,QAAQ,aAAa,EAAE,aAAa,IAAI,WAAW,CAAC,cAAc;AAClE,QAAQ,SAAS,EAAE,SAAS,IAAI,WAAW,CAAC,UAAU;AACtD,QAAQ,WAAW,EAAE,WAAW,IAAI,WAAW,CAAC,YAAY;AAC5D,QAAQ,UAAU;AAClB,QAAQ,cAAc;AACtB,KAAK,CAAC;AACN,IAAI,MAAM,UAAU,GAAG,MAAM,IAAI,OAAO,CAAC,iBAAiB,EAAE;AAC5D,QAAQ,KAAK;AACb,QAAQ,QAAQ;AAChB,QAAQ,WAAW;AACnB,QAAQ,WAAW;AACnB,QAAQ,UAAU;AAClB,QAAQ,MAAM;AACd,QAAQ,cAAc;AACtB,KAAK,CAAC;AACN;AACA,IAAI,IAAI,CAAC,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,CAAC,mBAAmB,EAAE;AAC/E,QAAQ,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,WAAW,GAAG;AAC1D,QAAQ,OAAO,GAAG;AAClB,YAAY,EAAE,EAAE,SAAS;AACzB,YAAY,cAAc,EAAE,kBAAkB;AAC9C,SAAS;AACT,QAAQ,YAAY,GAAG,OAAO;AAC9B;
|
|
1
|
+
{"version":3,"file":"record.js","sources":["../../../../../src/providers/pinpoint/apis/record.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.record = void 0;\nconst amplifyUuid_1 = require(\"../../../utils/amplifyUuid\");\nconst utils_1 = require(\"../utils\");\nconst sessionListener_1 = require(\"../../../utils/sessionListener\");\nconst constants_1 = require(\"../utils/constants\");\nconst getEventBuffer_1 = require(\"../utils/getEventBuffer\");\nlet session;\n/**\n * @internal\n */\nconst record = async ({ appId, category, channelType, credentials, event, identityId, region, userAgentValue, bufferSize, flushInterval, flushSize, resendLimit, }) => {\n let eventSession = session;\n const currentTime = new Date();\n const timestampISOString = currentTime.toISOString();\n const eventId = (0, amplifyUuid_1.amplifyUuid)();\n // Prepare event buffer if required\n const buffer = (0, getEventBuffer_1.getEventBuffer)({\n appId,\n region,\n credentials,\n bufferSize: bufferSize ?? constants_1.BUFFER_SIZE,\n flushInterval: flushInterval ?? constants_1.FLUSH_INTERVAL,\n flushSize: flushSize ?? constants_1.FLUSH_SIZE,\n resendLimit: resendLimit ?? constants_1.RESEND_LIMIT,\n identityId,\n userAgentValue,\n });\n const endpointId = await (0, utils_1.resolveEndpointId)({\n appId,\n category,\n channelType,\n credentials,\n identityId,\n region,\n userAgentValue,\n });\n // Generate session if required\n if (!eventSession || event.name === sessionListener_1.SESSION_START_EVENT) {\n const sessionId = (0, amplifyUuid_1.amplifyUuid)();\n session = {\n Id: sessionId,\n StartTimestamp: timestampISOString,\n };\n eventSession = session;\n }\n // Terminate session when required\n if (session && event.name === sessionListener_1.SESSION_STOP_EVENT) {\n eventSession = {\n ...session,\n StopTimestamp: timestampISOString,\n Duration: currentTime.getTime() - new Date(session.StartTimestamp).getTime(),\n };\n session = undefined;\n }\n // Push event to buffer\n buffer.push({\n eventId,\n endpointId,\n event,\n session: eventSession,\n timestamp: timestampISOString,\n resendLimit: resendLimit ?? constants_1.RESEND_LIMIT,\n });\n};\nexports.record = record;\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,4BAA4B,CAAC;AAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,iBAAiB,GAAG,OAAO,CAAC,gCAAgC,CAAC;AACnE,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;AACjD,MAAM,gBAAgB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC3D,IAAI,OAAO;AACX;AACA;AACA;AACA,MAAM,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AE,kBAAkB;AAC9C,SAAS;AACT,QAAQ,YAAY,GAAG,OAAO;AAC9B,IAAI;AACJ;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,CAAC,kBAAkB,EAAE;AACxE,QAAQ,YAAY,GAAG;AACvB,YAAY,GAAG,OAAO;AACtB,YAAY,aAAa,EAAE,kBAAkB;AAC7C,YAAY,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;AACxF,SAAS;AACT,QAAQ,OAAO,GAAG,SAAS;AAC3B,IAAI;AACJ;AACA,IAAI,MAAM,CAAC,IAAI,CAAC;AAChB,QAAQ,OAAO;AACf,QAAQ,UAAU;AAClB,QAAQ,KAAK;AACb,QAAQ,OAAO,EAAE,YAAY;AAC7B,QAAQ,SAAS,EAAE,kBAAkB;AACrC,QAAQ,WAAW,EAAE,WAAW,IAAI,WAAW,CAAC,YAAY;AAC5D,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,MAAM,GAAG,MAAM;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateEndpoint.js","sources":["../../../../../src/providers/pinpoint/apis/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 pinpoint_1 = require(\"../../../awsClients/pinpoint\");\nconst amplifyUuid_1 = require(\"../../../utils/amplifyUuid\");\nconst getClientInfo_1 = require(\"../../../utils/getClientInfo\");\nconst cacheEndpointId_1 = require(\"../utils/cacheEndpointId\");\nconst createEndpointId_1 = require(\"../utils/createEndpointId\");\nconst getEndpointId_1 = require(\"../utils/getEndpointId\");\n/**\n * @internal\n */\nconst updateEndpoint = async ({ address, appId, category, channelType, credentials, identityId, optOut, region, userAttributes, userId, userProfile, userAgentValue, }) => {\n const endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n // only generate a new endpoint id if one was not found in cache\n const createdEndpointId = !endpointId\n ? (0, createEndpointId_1.createEndpointId)(appId, category)\n : undefined;\n const { customProperties, demographic, email, location, metrics, name, plan, } = userProfile ?? {};\n // only automatically populate the endpoint with client info and identity id upon endpoint creation to\n // avoid overwriting the endpoint with these values every time the endpoint is updated\n const demographicsFromClientInfo = {};\n const resolvedUserId = createdEndpointId ? (userId ?? identityId) : userId;\n if (createdEndpointId) {\n const clientInfo = (0, getClientInfo_1.getClientInfo)();\n demographicsFromClientInfo.appVersion = clientInfo.appVersion;\n demographicsFromClientInfo.make = clientInfo.make;\n demographicsFromClientInfo.model = clientInfo.model;\n demographicsFromClientInfo.modelVersion = clientInfo.version;\n demographicsFromClientInfo.platform = clientInfo.platform;\n }\n const mergedDemographic = {\n ...demographicsFromClientInfo,\n ...demographic,\n };\n const attributes = {\n ...(email && { email: [email] }),\n ...(name && { name: [name] }),\n ...(plan && { plan: [plan] }),\n ...customProperties,\n };\n const shouldAddDemographics = createdEndpointId || demographic;\n const shouldAddAttributes = email || customProperties || name || plan;\n const shouldAddUser = resolvedUserId || userAttributes;\n const input = {\n ApplicationId: appId,\n EndpointId: endpointId ?? createdEndpointId,\n EndpointRequest: {\n RequestId: (0, amplifyUuid_1.amplifyUuid)(),\n EffectiveDate: new Date().toISOString(),\n ChannelType: channelType,\n Address: address,\n ...(shouldAddAttributes && { Attributes: attributes }),\n ...(shouldAddDemographics && {\n Demographic: {\n AppVersion: mergedDemographic.appVersion,\n Locale: mergedDemographic.locale,\n Make: mergedDemographic.make,\n Model: mergedDemographic.model,\n ModelVersion: mergedDemographic.modelVersion,\n Platform: mergedDemographic.platform,\n PlatformVersion: mergedDemographic.platformVersion,\n Timezone: mergedDemographic.timezone,\n },\n }),\n ...(location && {\n Location: {\n City: location.city,\n Country: location.country,\n Latitude: location.latitude,\n Longitude: location.longitude,\n PostalCode: location.postalCode,\n Region: location.region,\n },\n }),\n Metrics: metrics,\n OptOut: optOut,\n ...(shouldAddUser && {\n User: {\n UserId: resolvedUserId,\n UserAttributes: userAttributes,\n },\n }),\n },\n };\n try {\n await (0, pinpoint_1.updateEndpoint)({ credentials, region, userAgentValue }, input);\n // if we had to create an endpoint id, we need to now cache it\n if (createdEndpointId) {\n await (0, cacheEndpointId_1.cacheEndpointId)(appId, category, createdEndpointId);\n }\n }\n finally {\n // at this point, we completely reset the behavior so even if the update was unsuccessful\n // we can just start over with a newly created endpoint id\n if (createdEndpointId) {\n (0, createEndpointId_1.clearCreatedEndpointId)(appId, category);\n }\n }\n};\nexports.updateEndpoint = 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,MAAM;AAC/B,MAAM,UAAU,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC1D,MAAM,aAAa,GAAG,OAAO,CAAC,4BAA4B,CAAC;AAC3D,MAAM,eAAe,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC/D,MAAM,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,CAAC;AAC7D,MAAM,kBAAkB,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC/D,MAAM,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACzD;AACA;AACA;AACA,MAAM,cAAc,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,GAAG,KAAK;AAC3K,IAAI,MAAM,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC;AAChF;AACA,IAAI,MAAM,iBAAiB,GAAG,CAAC;AAC/B,UAAU,IAAI,kBAAkB,CAAC,gBAAgB,EAAE,KAAK,EAAE,QAAQ;AAClE,UAAU,SAAS;AACnB,IAAI,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,GAAG,WAAW,IAAI,EAAE;AACtG;AACA;AACA,IAAI,MAAM,0BAA0B,GAAG,EAAE;AACzC,IAAI,MAAM,cAAc,GAAG,iBAAiB,IAAI,MAAM,IAAI,UAAU,IAAI,MAAM;AAC9E,IAAI,IAAI,iBAAiB,EAAE;AAC3B,QAAQ,MAAM,UAAU,GAAG,IAAI,eAAe,CAAC,aAAa,GAAG;AAC/D,QAAQ,0BAA0B,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU;AACrE,QAAQ,0BAA0B,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI;AACzD,QAAQ,0BAA0B,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK;AAC3D,QAAQ,0BAA0B,CAAC,YAAY,GAAG,UAAU,CAAC,OAAO;AACpE,QAAQ,0BAA0B,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ;AACjE;
|
|
1
|
+
{"version":3,"file":"updateEndpoint.js","sources":["../../../../../src/providers/pinpoint/apis/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 pinpoint_1 = require(\"../../../awsClients/pinpoint\");\nconst amplifyUuid_1 = require(\"../../../utils/amplifyUuid\");\nconst getClientInfo_1 = require(\"../../../utils/getClientInfo\");\nconst cacheEndpointId_1 = require(\"../utils/cacheEndpointId\");\nconst createEndpointId_1 = require(\"../utils/createEndpointId\");\nconst getEndpointId_1 = require(\"../utils/getEndpointId\");\n/**\n * @internal\n */\nconst updateEndpoint = async ({ address, appId, category, channelType, credentials, identityId, optOut, region, userAttributes, userId, userProfile, userAgentValue, }) => {\n const endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n // only generate a new endpoint id if one was not found in cache\n const createdEndpointId = !endpointId\n ? (0, createEndpointId_1.createEndpointId)(appId, category)\n : undefined;\n const { customProperties, demographic, email, location, metrics, name, plan, } = userProfile ?? {};\n // only automatically populate the endpoint with client info and identity id upon endpoint creation to\n // avoid overwriting the endpoint with these values every time the endpoint is updated\n const demographicsFromClientInfo = {};\n const resolvedUserId = createdEndpointId ? (userId ?? identityId) : userId;\n if (createdEndpointId) {\n const clientInfo = (0, getClientInfo_1.getClientInfo)();\n demographicsFromClientInfo.appVersion = clientInfo.appVersion;\n demographicsFromClientInfo.make = clientInfo.make;\n demographicsFromClientInfo.model = clientInfo.model;\n demographicsFromClientInfo.modelVersion = clientInfo.version;\n demographicsFromClientInfo.platform = clientInfo.platform;\n }\n const mergedDemographic = {\n ...demographicsFromClientInfo,\n ...demographic,\n };\n const attributes = {\n ...(email && { email: [email] }),\n ...(name && { name: [name] }),\n ...(plan && { plan: [plan] }),\n ...customProperties,\n };\n const shouldAddDemographics = createdEndpointId || demographic;\n const shouldAddAttributes = email || customProperties || name || plan;\n const shouldAddUser = resolvedUserId || userAttributes;\n const input = {\n ApplicationId: appId,\n EndpointId: endpointId ?? createdEndpointId,\n EndpointRequest: {\n RequestId: (0, amplifyUuid_1.amplifyUuid)(),\n EffectiveDate: new Date().toISOString(),\n ChannelType: channelType,\n Address: address,\n ...(shouldAddAttributes && { Attributes: attributes }),\n ...(shouldAddDemographics && {\n Demographic: {\n AppVersion: mergedDemographic.appVersion,\n Locale: mergedDemographic.locale,\n Make: mergedDemographic.make,\n Model: mergedDemographic.model,\n ModelVersion: mergedDemographic.modelVersion,\n Platform: mergedDemographic.platform,\n PlatformVersion: mergedDemographic.platformVersion,\n Timezone: mergedDemographic.timezone,\n },\n }),\n ...(location && {\n Location: {\n City: location.city,\n Country: location.country,\n Latitude: location.latitude,\n Longitude: location.longitude,\n PostalCode: location.postalCode,\n Region: location.region,\n },\n }),\n Metrics: metrics,\n OptOut: optOut,\n ...(shouldAddUser && {\n User: {\n UserId: resolvedUserId,\n UserAttributes: userAttributes,\n },\n }),\n },\n };\n try {\n await (0, pinpoint_1.updateEndpoint)({ credentials, region, userAgentValue }, input);\n // if we had to create an endpoint id, we need to now cache it\n if (createdEndpointId) {\n await (0, cacheEndpointId_1.cacheEndpointId)(appId, category, createdEndpointId);\n }\n }\n finally {\n // at this point, we completely reset the behavior so even if the update was unsuccessful\n // we can just start over with a newly created endpoint id\n if (createdEndpointId) {\n (0, createEndpointId_1.clearCreatedEndpointId)(appId, category);\n }\n }\n};\nexports.updateEndpoint = 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,MAAM;AAC/B,MAAM,UAAU,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC1D,MAAM,aAAa,GAAG,OAAO,CAAC,4BAA4B,CAAC;AAC3D,MAAM,eAAe,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC/D,MAAM,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,CAAC;AAC7D,MAAM,kBAAkB,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC/D,MAAM,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACzD;AACA;AACA;AACA,MAAM,cAAc,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,GAAG,KAAK;AAC3K,IAAI,MAAM,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAA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QAAQ,CAAC,SAAS;AACjD,oBAAoB,UAAU,EAAE,QAAQ,CAAC,UAAU;AACnD,oBAAoB,MAAM,EAAE,QAAQ,CAAC,MAAM;AAC3C,iBAAiB;AACjB,aAAa,CAAC;AACd,YAAY,OAAO,EAAE,OAAO;AAC5B,YAAY,MAAM,EAAE,MAAM;AAC1B,YAAY,IAAI,aAAa,IAAI;AACjC,gBAAgB,IAAI,EAAE;AACtB,oBAAoB,MAAM,EAAE,cAAc;AAC1C,oBAAoB,cAAc,EAAE,cAAc;AAClD,iBAAiB;AACjB,aAAa,CAAC;AACd,SAAS;AACT,KAAK;AACL,IAAI,IAAI;AACR,QAAQ,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,cAAc,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,KAAK,CAAC;AAC5F;AACA,QAAQ,IAAI,iBAAiB,EAAE;AAC/B,YAAY,MAAM,CAAC,CAAC,EAAE,iBAAiB,CAAC,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,iBAAiB,CAAC;AAC5F,QAAQ;AACR,IAAI;AACJ,YAAY;AACZ;AACA;AACA,QAAQ,IAAI,iBAAiB,EAAE;AAC/B,YAAY,IAAI,kBAAkB,CAAC,sBAAsB,EAAE,KAAK,EAAE,QAAQ,CAAC;AAC3E,QAAQ;AACR,IAAI;AACJ,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/providers/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.resolveEndpointId = exports.getEndpointId = exports.UpdateEndpointException = void 0;\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./apis\"), exports);\nvar types_1 = require(\"./types\");\nObject.defineProperty(exports, \"UpdateEndpointException\", { enumerable: true, get: function () { return types_1.UpdateEndpointException; } });\nvar utils_1 = require(\"./utils\");\nObject.defineProperty(exports, \"getEndpointId\", { enumerable: true, get: function () { return utils_1.getEndpointId; } });\nObject.defineProperty(exports, \"resolveEndpointId\", { enumerable: true, get: function () { return utils_1.resolveEndpointId; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,uBAAuB,GAAG,MAAM;AAC5F,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAChC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;AAChD,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAChC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,yBAAyB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,uBAAuB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/providers/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.resolveEndpointId = exports.getEndpointId = exports.UpdateEndpointException = void 0;\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./apis\"), exports);\nvar types_1 = require(\"./types\");\nObject.defineProperty(exports, \"UpdateEndpointException\", { enumerable: true, get: function () { return types_1.UpdateEndpointException; } });\nvar utils_1 = require(\"./utils\");\nObject.defineProperty(exports, \"getEndpointId\", { enumerable: true, get: function () { return utils_1.getEndpointId; } });\nObject.defineProperty(exports, \"resolveEndpointId\", { enumerable: true, get: function () { return utils_1.resolveEndpointId; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,uBAAuB,GAAG,MAAM;AAC5F,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAChC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;AAChD,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAChC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,yBAAyB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7I,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAChC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACzH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/providers/pinpoint/types/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.UpdateEndpointException = void 0;\nvar errors_1 = require(\"./errors\");\nObject.defineProperty(exports, \"UpdateEndpointException\", { enumerable: true, get: function () { return errors_1.UpdateEndpointException; } });\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,MAAM;AACxC,IAAI,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AAClC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,yBAAyB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,uBAAuB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/providers/pinpoint/types/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.UpdateEndpointException = void 0;\nvar errors_1 = require(\"./errors\");\nObject.defineProperty(exports, \"UpdateEndpointException\", { enumerable: true, get: function () { return errors_1.UpdateEndpointException; } });\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,MAAM;AACxC,IAAI,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AAClC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,yBAAyB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinpointEventBuffer.js","sources":["../../../../../src/providers/pinpoint/utils/PinpointEventBuffer.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.PinpointEventBuffer = void 0;\nconst Logger_1 = require(\"../../../Logger\");\nconst pinpoint_1 = require(\"../../../awsClients/pinpoint\");\nconst haveCredentialsChanged_1 = require(\"../../../utils/haveCredentialsChanged\");\nconst isAppInForeground_1 = require(\"./isAppInForeground\");\nconst logger = new Logger_1.ConsoleLogger('PinpointEventBuffer');\nconst RETRYABLE_CODES = [429, 500];\nconst ACCEPTED_CODES = [202];\nclass PinpointEventBuffer {\n constructor(config) {\n this._interval = undefined;\n this._pause = false;\n this._flush = false;\n this._buffer = [];\n this._config = config;\n this._sendBatch = this._sendBatch.bind(this);\n this._startLoop();\n }\n push(event) {\n if (this._buffer.length >= this._config.bufferSize) {\n logger.debug('Exceeded Pinpoint event buffer limits, event dropped.', {\n eventId: event.eventId,\n });\n return;\n }\n this._buffer.push({ [event.eventId]: event });\n }\n pause() {\n this._pause = true;\n }\n resume() {\n this._pause = false;\n }\n flush() {\n this._flush = true;\n }\n identityHasChanged(identityId) {\n return this._config.identityId !== identityId;\n }\n haveCredentialsChanged(credentials) {\n return (0, haveCredentialsChanged_1.haveCredentialsChanged)(this._config.credentials, credentials);\n }\n flushAll() {\n this._putEvents(this._buffer.splice(0, this._buffer.length));\n }\n _startLoop() {\n if (this._interval) {\n clearInterval(this._interval);\n }\n const { flushInterval } = this._config;\n this._interval = setInterval(this._sendBatch, flushInterval);\n }\n _sendBatch() {\n const bufferLength = this._buffer.length;\n if (this._flush && !bufferLength && this._interval) {\n clearInterval(this._interval);\n }\n if (this._pause || !bufferLength || !(0, isAppInForeground_1.isAppInForeground)()) {\n return;\n }\n const { flushSize } = this._config;\n const batchSize = Math.min(flushSize, bufferLength);\n const bufferSubset = this._buffer.splice(0, batchSize);\n this._putEvents(bufferSubset);\n }\n async _putEvents(buffer) {\n const eventMap = this._bufferToMap(buffer);\n const batchEventParams = this._generateBatchEventParams(eventMap);\n try {\n const { credentials, region, userAgentValue } = this._config;\n const data = await (0, pinpoint_1.putEvents)({\n credentials,\n region,\n userAgentValue,\n }, batchEventParams);\n this._processPutEventsSuccessResponse(data, eventMap);\n }\n catch (err) {\n this._handlePutEventsFailure(err, eventMap);\n }\n }\n _generateBatchEventParams(eventMap) {\n const batchItem = {};\n Object.values(eventMap).forEach(item => {\n const { event, timestamp, endpointId, eventId, session } = item;\n const { name, attributes, metrics } = event;\n batchItem[endpointId] = {\n Endpoint: {\n ...batchItem[endpointId]?.Endpoint,\n },\n Events: {\n ...batchItem[endpointId]?.Events,\n [eventId]: {\n EventType: name,\n Timestamp: new Date(timestamp).toISOString(),\n Attributes: attributes,\n Metrics: metrics,\n Session: session,\n },\n },\n };\n });\n return {\n ApplicationId: this._config.appId,\n EventsRequest: {\n BatchItem: batchItem,\n },\n };\n }\n _handlePutEventsFailure(err, eventMap) {\n logger.debug('putEvents call to Pinpoint failed.', err);\n const statusCode = err.$metadata && err.$metadata.httpStatusCode;\n if (RETRYABLE_CODES.includes(statusCode)) {\n const retryableEvents = Object.values(eventMap);\n this._retry(retryableEvents);\n }\n }\n _processPutEventsSuccessResponse(data, eventMap) {\n const { Results = {} } = data.EventsResponse ?? {};\n const retryableEvents = [];\n Object.entries(Results).forEach(([_, endpointValues]) => {\n const responses = endpointValues.EventsItemResponse ?? {};\n Object.entries(responses).forEach(([eventId, eventValues]) => {\n const eventObject = eventMap[eventId];\n if (!eventObject) {\n return;\n }\n const { StatusCode, Message } = eventValues ?? {};\n if (StatusCode && ACCEPTED_CODES.includes(StatusCode)) {\n return;\n }\n if (StatusCode && RETRYABLE_CODES.includes(StatusCode)) {\n retryableEvents.push(eventObject);\n return;\n }\n const { name } = eventObject.event;\n logger.warn('Pinpoint event failed to send.', {\n eventId,\n name,\n message: Message,\n });\n });\n });\n if (retryableEvents.length) {\n this._retry(retryableEvents);\n }\n }\n _retry(retryableEvents) {\n // retryable events that haven't reached the resendLimit\n const eligibleEvents = [];\n retryableEvents.forEach((bufferedEvent) => {\n const { eventId } = bufferedEvent;\n const { name } = bufferedEvent.event;\n if (bufferedEvent.resendLimit-- > 0) {\n logger.debug('Resending event.', {\n eventId,\n name,\n remainingAttempts: bufferedEvent.resendLimit,\n });\n eligibleEvents.push({ [eventId]: bufferedEvent });\n return;\n }\n logger.debug('No retry attempts remaining for event.', {\n eventId,\n name,\n });\n });\n // add the events to the front of the buffer\n this._buffer.unshift(...eligibleEvents);\n }\n _bufferToMap(buffer) {\n return buffer.reduce((acc, curVal) => {\n const [[key, value]] = Object.entries(curVal);\n acc[key] = value;\n return acc;\n }, {});\n }\n}\nexports.PinpointEventBuffer = PinpointEventBuffer;\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,MAAM;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC1D,MAAM,wBAAwB,GAAG,OAAO,CAAC,uCAAuC,CAAC;AACjF,MAAM,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC1D,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAC;AAChE,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC;AAClC,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC;AAC5B,MAAM,mBAAmB,CAAC;AAC1B,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,IAAI,CAAC,SAAS,GAAG,SAAS;AAClC,QAAQ,IAAI,CAAC,MAAM,GAAG,KAAK;AAC3B,QAAQ,IAAI,CAAC,MAAM,GAAG,KAAK;AAC3B,QAAQ,IAAI,CAAC,OAAO,GAAG,EAAE;AACzB,QAAQ,IAAI,CAAC,OAAO,GAAG,MAA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CAAC,GAAG,EAAE,MAAM,KAAK;AAC9C,YAAY,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;AACzD,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAC5B,YAAY,OAAO,GAAG;AACtB,SAAS,EAAE,EAAE,CAAC;AACd;AACA;AACA,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
|
|
1
|
+
{"version":3,"file":"PinpointEventBuffer.js","sources":["../../../../../src/providers/pinpoint/utils/PinpointEventBuffer.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.PinpointEventBuffer = void 0;\nconst Logger_1 = require(\"../../../Logger\");\nconst pinpoint_1 = require(\"../../../awsClients/pinpoint\");\nconst haveCredentialsChanged_1 = require(\"../../../utils/haveCredentialsChanged\");\nconst isAppInForeground_1 = require(\"./isAppInForeground\");\nconst logger = new Logger_1.ConsoleLogger('PinpointEventBuffer');\nconst RETRYABLE_CODES = [429, 500];\nconst ACCEPTED_CODES = [202];\nclass PinpointEventBuffer {\n constructor(config) {\n this._interval = undefined;\n this._pause = false;\n this._flush = false;\n this._buffer = [];\n this._config = config;\n this._sendBatch = this._sendBatch.bind(this);\n this._startLoop();\n }\n push(event) {\n if (this._buffer.length >= this._config.bufferSize) {\n logger.debug('Exceeded Pinpoint event buffer limits, event dropped.', {\n eventId: event.eventId,\n });\n return;\n }\n this._buffer.push({ [event.eventId]: event });\n }\n pause() {\n this._pause = true;\n }\n resume() {\n this._pause = false;\n }\n flush() {\n this._flush = true;\n }\n identityHasChanged(identityId) {\n return this._config.identityId !== identityId;\n }\n haveCredentialsChanged(credentials) {\n return (0, haveCredentialsChanged_1.haveCredentialsChanged)(this._config.credentials, credentials);\n }\n flushAll() {\n this._putEvents(this._buffer.splice(0, this._buffer.length));\n }\n _startLoop() {\n if (this._interval) {\n clearInterval(this._interval);\n }\n const { flushInterval } = this._config;\n this._interval = setInterval(this._sendBatch, flushInterval);\n }\n _sendBatch() {\n const bufferLength = this._buffer.length;\n if (this._flush && !bufferLength && this._interval) {\n clearInterval(this._interval);\n }\n if (this._pause || !bufferLength || !(0, isAppInForeground_1.isAppInForeground)()) {\n return;\n }\n const { flushSize } = this._config;\n const batchSize = Math.min(flushSize, bufferLength);\n const bufferSubset = this._buffer.splice(0, batchSize);\n this._putEvents(bufferSubset);\n }\n async _putEvents(buffer) {\n const eventMap = this._bufferToMap(buffer);\n const batchEventParams = this._generateBatchEventParams(eventMap);\n try {\n const { credentials, region, userAgentValue } = this._config;\n const data = await (0, pinpoint_1.putEvents)({\n credentials,\n region,\n userAgentValue,\n }, batchEventParams);\n this._processPutEventsSuccessResponse(data, eventMap);\n }\n catch (err) {\n this._handlePutEventsFailure(err, eventMap);\n }\n }\n _generateBatchEventParams(eventMap) {\n const batchItem = {};\n Object.values(eventMap).forEach(item => {\n const { event, timestamp, endpointId, eventId, session } = item;\n const { name, attributes, metrics } = event;\n batchItem[endpointId] = {\n Endpoint: {\n ...batchItem[endpointId]?.Endpoint,\n },\n Events: {\n ...batchItem[endpointId]?.Events,\n [eventId]: {\n EventType: name,\n Timestamp: new Date(timestamp).toISOString(),\n Attributes: attributes,\n Metrics: metrics,\n Session: session,\n },\n },\n };\n });\n return {\n ApplicationId: this._config.appId,\n EventsRequest: {\n BatchItem: batchItem,\n },\n };\n }\n _handlePutEventsFailure(err, eventMap) {\n logger.debug('putEvents call to Pinpoint failed.', err);\n const statusCode = err.$metadata && err.$metadata.httpStatusCode;\n if (RETRYABLE_CODES.includes(statusCode)) {\n const retryableEvents = Object.values(eventMap);\n this._retry(retryableEvents);\n }\n }\n _processPutEventsSuccessResponse(data, eventMap) {\n const { Results = {} } = data.EventsResponse ?? {};\n const retryableEvents = [];\n Object.entries(Results).forEach(([_, endpointValues]) => {\n const responses = endpointValues.EventsItemResponse ?? {};\n Object.entries(responses).forEach(([eventId, eventValues]) => {\n const eventObject = eventMap[eventId];\n if (!eventObject) {\n return;\n }\n const { StatusCode, Message } = eventValues ?? {};\n if (StatusCode && ACCEPTED_CODES.includes(StatusCode)) {\n return;\n }\n if (StatusCode && RETRYABLE_CODES.includes(StatusCode)) {\n retryableEvents.push(eventObject);\n return;\n }\n const { name } = eventObject.event;\n logger.warn('Pinpoint event failed to send.', {\n eventId,\n name,\n message: Message,\n });\n });\n });\n if (retryableEvents.length) {\n this._retry(retryableEvents);\n }\n }\n _retry(retryableEvents) {\n // retryable events that haven't reached the resendLimit\n const eligibleEvents = [];\n retryableEvents.forEach((bufferedEvent) => {\n const { eventId } = bufferedEvent;\n const { name } = bufferedEvent.event;\n if (bufferedEvent.resendLimit-- > 0) {\n logger.debug('Resending event.', {\n eventId,\n name,\n remainingAttempts: bufferedEvent.resendLimit,\n });\n eligibleEvents.push({ [eventId]: bufferedEvent });\n return;\n }\n logger.debug('No retry attempts remaining for event.', {\n eventId,\n name,\n });\n });\n // add the events to the front of the buffer\n this._buffer.unshift(...eligibleEvents);\n }\n _bufferToMap(buffer) {\n return buffer.reduce((acc, curVal) => {\n const [[key, value]] = Object.entries(curVal);\n acc[key] = value;\n return acc;\n }, {});\n }\n}\nexports.PinpointEventBuffer = PinpointEventBuffer;\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,MAAM;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC1D,MAAM,wBAAwB,GAAG,OAAO,CAAC,uCAAuC,CAAC;AACjF,MAAM,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC1D,MAAM,MAAM,G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,EAAE,GAAG,aAAa,CAAC,KAAK;AAChD,YAAY,IAAI,aAAa,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE;AACjD,gBAAgB,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE;AACjD,oBAAoB,OAAO;AAC3B,oBAAoB,IAAI;AACxB,oBAAoB,iBAAiB,EAAE,aAAa,CAAC,WAAW;AAChE,iBAAiB,CAAC;AAClB,gBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,GAAG,aAAa,EAAE,CAAC;AACjE,gBAAgB;AAChB,YAAY;AACZ,YAAY,MAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE;AACnE,gBAAgB,OAAO;AACvB,gBAAgB,IAAI;AACpB,aAAa,CAAC;AACd,QAAQ,CAAC,CAAC;AACV;AACA,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC;AAC/C,IAAI;AACJ,IAAI,YAAY,CAAC,MAAM,EAAE;AACzB,QAAQ,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK;AAC9C,YAAY,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;AACzD,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAC5B,YAAY,OAAO,GAAG;AACtB,QAAQ,CAAC,EAAE,EAAE,CAAC;AACd,IAAI;AACJ;AACA,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEndpointId.js","sources":["../../../../../src/providers/pinpoint/utils/createEndpointId.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.clearCreatedEndpointId = exports.createEndpointId = void 0;\nconst amplifyUuid_1 = require(\"../../../utils/amplifyUuid\");\nconst getCacheKey_1 = require(\"./getCacheKey\");\nconst createdEndpointIds = {};\n/**\n * Creates an endpoint id and guarantees multiple creations for a category returns the same uuid.\n *\n * @internal\n */\nconst createEndpointId = (appId, category) => {\n const cacheKey = (0, getCacheKey_1.getCacheKey)(appId, category);\n if (!createdEndpointIds[cacheKey]) {\n createdEndpointIds[cacheKey] = (0, amplifyUuid_1.amplifyUuid)();\n }\n return createdEndpointIds[cacheKey];\n};\nexports.createEndpointId = createEndpointId;\n/**\n * Clears a created endpoint id for a category.\n *\n * @internal\n */\nconst clearCreatedEndpointId = (appId, category) => {\n const cacheKey = (0, getCacheKey_1.getCacheKey)(appId, category);\n delete createdEndpointIds[cacheKey];\n};\nexports.clearCreatedEndpointId = clearCreatedEndpointId;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,GAAG,MAAM;AAClE,MAAM,aAAa,GAAG,OAAO,CAAC,4BAA4B,CAAC;AAC3D,MAAM,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;AAC9C,MAAM,kBAAkB,GAAG,EAAE;AAC7B;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AAC9C,IAAI,MAAM,QAAQ,GAAG,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpE,IAAI,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE;AACvC,QAAQ,kBAAkB,CAAC,QAAQ,CAAC,GAAG,IAAI,aAAa,CAAC,WAAW,GAAG;AACvE;
|
|
1
|
+
{"version":3,"file":"createEndpointId.js","sources":["../../../../../src/providers/pinpoint/utils/createEndpointId.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.clearCreatedEndpointId = exports.createEndpointId = void 0;\nconst amplifyUuid_1 = require(\"../../../utils/amplifyUuid\");\nconst getCacheKey_1 = require(\"./getCacheKey\");\nconst createdEndpointIds = {};\n/**\n * Creates an endpoint id and guarantees multiple creations for a category returns the same uuid.\n *\n * @internal\n */\nconst createEndpointId = (appId, category) => {\n const cacheKey = (0, getCacheKey_1.getCacheKey)(appId, category);\n if (!createdEndpointIds[cacheKey]) {\n createdEndpointIds[cacheKey] = (0, amplifyUuid_1.amplifyUuid)();\n }\n return createdEndpointIds[cacheKey];\n};\nexports.createEndpointId = createEndpointId;\n/**\n * Clears a created endpoint id for a category.\n *\n * @internal\n */\nconst clearCreatedEndpointId = (appId, category) => {\n const cacheKey = (0, getCacheKey_1.getCacheKey)(appId, category);\n delete createdEndpointIds[cacheKey];\n};\nexports.clearCreatedEndpointId = clearCreatedEndpointId;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,GAAG,MAAM;AAClE,MAAM,aAAa,GAAG,OAAO,CAAC,4BAA4B,CAAC;AAC3D,MAAM,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;AAC9C,MAAM,kBAAkB,GAAG,EAAE;AAC7B;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AAC9C,IAAI,MAAM,QAAQ,GAAG,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpE,IAAI,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE;AACvC,QAAQ,kBAAkB,CAAC,QAAQ,CAAC,GAAG,IAAI,aAAa,CAAC,WAAW,GAAG;AACvE,IAAI;AACJ,IAAI,OAAO,kBAAkB,CAAC,QAAQ,CAAC;AACvC,CAAC;AACD,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AACpD,IAAI,MAAM,QAAQ,GAAG,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpE,IAAI,OAAO,kBAAkB,CAAC,QAAQ,CAAC;AACvC,CAAC;AACD,OAAO,CAAC,sBAAsB,GAAG,sBAAsB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEventBuffer.js","sources":["../../../../../src/providers/pinpoint/utils/getEventBuffer.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.getEventBuffer = void 0;\nconst PinpointEventBuffer_1 = require(\"./PinpointEventBuffer\");\n// Map of buffers by region -> appId\nconst eventBufferMap = {};\n/**\n * Returns a PinpointEventBuffer instance for the specified region & app ID, creating one if it does not yet exist.\n *\n * @internal\n */\nconst getEventBuffer = ({ appId, region, credentials, bufferSize, flushInterval, flushSize, resendLimit, identityId, userAgentValue, }) => {\n if (eventBufferMap[region]?.[appId]) {\n const buffer = eventBufferMap[region][appId];\n /*\n If the identity or credentials has changed flush out the buffer and create a new instance. The old instance will be garbage\n collected.\n */\n const shouldFlushBuffer = buffer.identityHasChanged(identityId) ||\n buffer.haveCredentialsChanged(credentials);\n if (shouldFlushBuffer) {\n buffer.flush();\n }\n else {\n return buffer;\n }\n }\n const buffer = new PinpointEventBuffer_1.PinpointEventBuffer({\n appId,\n bufferSize,\n credentials,\n flushInterval,\n flushSize,\n identityId,\n region,\n resendLimit,\n userAgentValue,\n });\n if (!eventBufferMap[region]) {\n eventBufferMap[region] = {};\n }\n eventBufferMap[region][appId] = buffer;\n return buffer;\n};\nexports.getEventBuffer = getEventBuffer;\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,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;AAC9D;AACA,MAAM,cAAc,GAAG,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,GAAG,KAAK;AAC3I,IAAI,IAAI,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE;AACzC,QAAQ,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;AACpD;AACA;AACA;AACA;AACA,QAAQ,MAAM,iBAAiB,GAAG,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC;AACvE,YAAY,MAAM,CAAC,sBAAsB,CAAC,WAAW,CAAC;AACtD,QAAQ,IAAI,iBAAiB,EAAE;AAC/B,YAAY,MAAM,CAAC,KAAK,EAAE;AAC1B;
|
|
1
|
+
{"version":3,"file":"getEventBuffer.js","sources":["../../../../../src/providers/pinpoint/utils/getEventBuffer.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.getEventBuffer = void 0;\nconst PinpointEventBuffer_1 = require(\"./PinpointEventBuffer\");\n// Map of buffers by region -> appId\nconst eventBufferMap = {};\n/**\n * Returns a PinpointEventBuffer instance for the specified region & app ID, creating one if it does not yet exist.\n *\n * @internal\n */\nconst getEventBuffer = ({ appId, region, credentials, bufferSize, flushInterval, flushSize, resendLimit, identityId, userAgentValue, }) => {\n if (eventBufferMap[region]?.[appId]) {\n const buffer = eventBufferMap[region][appId];\n /*\n If the identity or credentials has changed flush out the buffer and create a new instance. The old instance will be garbage\n collected.\n */\n const shouldFlushBuffer = buffer.identityHasChanged(identityId) ||\n buffer.haveCredentialsChanged(credentials);\n if (shouldFlushBuffer) {\n buffer.flush();\n }\n else {\n return buffer;\n }\n }\n const buffer = new PinpointEventBuffer_1.PinpointEventBuffer({\n appId,\n bufferSize,\n credentials,\n flushInterval,\n flushSize,\n identityId,\n region,\n resendLimit,\n userAgentValue,\n });\n if (!eventBufferMap[region]) {\n eventBufferMap[region] = {};\n }\n eventBufferMap[region][appId] = buffer;\n return buffer;\n};\nexports.getEventBuffer = getEventBuffer;\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,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;AAC9D;AACA,MAAM,cAAc,GAAG,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,GAAG,KAAK;AAC3I,IAAI,IAAI,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE;AACzC,QAAQ,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;AACpD;AACA;AACA;AACA;AACA,QAAQ,MAAM,iBAAiB,GAAG,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC;AACvE,YAAY,MAAM,CAAC,sBAAsB,CAAC,WAAW,CAAC;AACtD,QAAQ,IAAI,iBAAiB,EAAE;AAC/B,YAAY,MAAM,CAAC,KAAK,EAAE;AAC1B,QAAQ;AACR,aAAa;AACb,YAAY,OAAO,MAAM;AACzB,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,MAAM,GAAG,IAAI,qBAAqB,CAAC,mBAAmB,CAAC;AACjE,QAAQ,KAAK;AACb,QAAQ,UAAU;AAClB,QAAQ,WAAW;AACnB,QAAQ,aAAa;AACrB,QAAQ,SAAS;AACjB,QAAQ,UAAU;AAClB,QAAQ,MAAM;AACd,QAAQ,WAAW;AACnB,QAAQ,cAAc;AACtB,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;AACjC,QAAQ,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE;AACnC,IAAI;AACJ,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,MAAM;AAC1C,IAAI,OAAO,MAAM;AACjB,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/providers/pinpoint/utils/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveEndpointId = exports.getEndpointId = exports.getCacheKey = exports.createEndpointId = exports.cacheEndpointId = void 0;\nvar cacheEndpointId_1 = require(\"./cacheEndpointId\");\nObject.defineProperty(exports, \"cacheEndpointId\", { enumerable: true, get: function () { return cacheEndpointId_1.cacheEndpointId; } });\nvar createEndpointId_1 = require(\"./createEndpointId\");\nObject.defineProperty(exports, \"createEndpointId\", { enumerable: true, get: function () { return createEndpointId_1.createEndpointId; } });\nvar getCacheKey_1 = require(\"./getCacheKey\");\nObject.defineProperty(exports, \"getCacheKey\", { enumerable: true, get: function () { return getCacheKey_1.getCacheKey; } });\nvar getEndpointId_1 = require(\"./getEndpointId\");\nObject.defineProperty(exports, \"getEndpointId\", { enumerable: true, get: function () { return getEndpointId_1.getEndpointId; } });\nvar resolveEndpointId_1 = require(\"./resolveEndpointId\");\nObject.defineProperty(exports, \"resolveEndpointId\", { enumerable: true, get: function () { return resolveEndpointId_1.resolveEndpointId; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,GAAG,MAAM;AACrI,IAAI,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACpD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/providers/pinpoint/utils/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveEndpointId = exports.getEndpointId = exports.getCacheKey = exports.createEndpointId = exports.cacheEndpointId = void 0;\nvar cacheEndpointId_1 = require(\"./cacheEndpointId\");\nObject.defineProperty(exports, \"cacheEndpointId\", { enumerable: true, get: function () { return cacheEndpointId_1.cacheEndpointId; } });\nvar createEndpointId_1 = require(\"./createEndpointId\");\nObject.defineProperty(exports, \"createEndpointId\", { enumerable: true, get: function () { return createEndpointId_1.createEndpointId; } });\nvar getCacheKey_1 = require(\"./getCacheKey\");\nObject.defineProperty(exports, \"getCacheKey\", { enumerable: true, get: function () { return getCacheKey_1.getCacheKey; } });\nvar getEndpointId_1 = require(\"./getEndpointId\");\nObject.defineProperty(exports, \"getEndpointId\", { enumerable: true, get: function () { return getEndpointId_1.getEndpointId; } });\nvar resolveEndpointId_1 = require(\"./resolveEndpointId\");\nObject.defineProperty(exports, \"resolveEndpointId\", { enumerable: true, get: function () { return resolveEndpointId_1.resolveEndpointId; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,GAAG,MAAM;AACrI,IAAI,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACpD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;AACvI,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,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;AAC5C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3H,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACjI,IAAI,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AACxD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveEndpointId.js","sources":["../../../../../src/providers/pinpoint/utils/resolveEndpointId.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.resolveEndpointId = void 0;\nconst errors_1 = require(\"../../../errors\");\nconst types_1 = require(\"../../../types\");\nconst updateEndpoint_1 = require(\"../apis/updateEndpoint\");\nconst getEndpointId_1 = require(\"./getEndpointId\");\n/**\n * Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,\n * which will generate and cache an endpoint id between calls.\n *\n * @internal\n */\nconst resolveEndpointId = async ({ address, appId, category, channelType, credentials, identityId, region, userAgentValue, }) => {\n let endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n if (!endpointId) {\n await (0, updateEndpoint_1.updateEndpoint)({\n address,\n appId,\n category,\n channelType,\n credentials,\n identityId,\n region,\n userAgentValue,\n });\n endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n }\n (0, errors_1.assert)(!!endpointId, types_1.AmplifyErrorCode.NoEndpointId);\n return endpointId;\n};\nexports.resolveEndpointId = resolveEndpointId;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iBAAiB,GAAG,MAAM;AAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,gBAAgB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AAC1D,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,KAAK;AACjI,IAAI,IAAI,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC;AAC9E,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,QAAQ,MAAM,IAAI,gBAAgB,CAAC,cAAc,EAAE;AACnD,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB,YAAY,QAAQ;AACpB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,cAAc;AAC1B,SAAS,CAAC;AACV,QAAQ,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC;AAC9E;
|
|
1
|
+
{"version":3,"file":"resolveEndpointId.js","sources":["../../../../../src/providers/pinpoint/utils/resolveEndpointId.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.resolveEndpointId = void 0;\nconst errors_1 = require(\"../../../errors\");\nconst types_1 = require(\"../../../types\");\nconst updateEndpoint_1 = require(\"../apis/updateEndpoint\");\nconst getEndpointId_1 = require(\"./getEndpointId\");\n/**\n * Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,\n * which will generate and cache an endpoint id between calls.\n *\n * @internal\n */\nconst resolveEndpointId = async ({ address, appId, category, channelType, credentials, identityId, region, userAgentValue, }) => {\n let endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n if (!endpointId) {\n await (0, updateEndpoint_1.updateEndpoint)({\n address,\n appId,\n category,\n channelType,\n credentials,\n identityId,\n region,\n userAgentValue,\n });\n endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n }\n (0, errors_1.assert)(!!endpointId, types_1.AmplifyErrorCode.NoEndpointId);\n return endpointId;\n};\nexports.resolveEndpointId = resolveEndpointId;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iBAAiB,GAAG,MAAM;AAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,gBAAgB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AAC1D,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,KAAK;AACjI,IAAI,IAAI,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC;AAC9E,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,QAAQ,MAAM,IAAI,gBAAgB,CAAC,cAAc,EAAE;AACnD,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB,YAAY,QAAQ;AACpB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,cAAc;AAC1B,SAAS,CAAC;AACV,QAAQ,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC;AAC9E,IAAI;AACJ,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,YAAY,CAAC;AAC7E,IAAI,OAAO,UAAU;AACrB,CAAC;AACD,OAAO,CAAC,iBAAiB,GAAG,iBAAiB;;"}
|
package/dist/cjs/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sources":["../../src/server.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchAuthSession = void 0;\nvar fetchAuthSession_1 = require(\"./singleton/apis/server/fetchAuthSession\");\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });\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,IAAI,kBAAkB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC5E,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":"server.js","sources":["../../src/server.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchAuthSession = void 0;\nvar fetchAuthSession_1 = require(\"./singleton/apis/server/fetchAuthSession\");\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });\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,IAAI,kBAAkB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC5E,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;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Amplify.js","sources":["../../../src/singleton/Amplify.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Amplify = exports.AmplifyClass = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst Hub_1 = require(\"../Hub\");\nconst utils_1 = require(\"../utils\");\nconst libraryUtils_1 = require(\"../libraryUtils\");\nconst Auth_1 = require(\"./Auth\");\nconst constants_1 = require(\"./constants\");\nclass AmplifyClass {\n constructor() {\n this.oAuthListener = undefined;\n this.isConfigured = false;\n this.resourcesConfig = {};\n this.libraryOptions = {};\n this.Auth = new Auth_1.AuthClass();\n }\n /**\n * Configures Amplify for use with your back-end resources.\n *\n * @remarks\n * This API does not perform any merging of either `resourcesConfig` or `libraryOptions`. The most recently\n * provided values will be used after configuration.\n *\n * @remarks\n * `configure` can be used to specify additional library options where available for supported categories.\n *\n * @param resourceConfig - Back-end resource configuration. Typically provided via the `aws-exports.js` file.\n * @param libraryOptions - Additional options for customizing the behavior of the library.\n */\n configure(resourcesConfig, libraryOptions) {\n const resolvedResourceConfig = (0, libraryUtils_1.parseAmplifyConfig)(resourcesConfig);\n this.resourcesConfig = resolvedResourceConfig;\n if (libraryOptions) {\n this.libraryOptions = libraryOptions;\n }\n // Make resource config immutable\n this.resourcesConfig = (0, utils_1.deepFreeze)(this.resourcesConfig);\n this.Auth.configure(this.resourcesConfig.Auth, this.libraryOptions.Auth);\n Hub_1.Hub.dispatch('core', {\n event: 'configure',\n data: this.resourcesConfig,\n }, 'Configure', Hub_1.AMPLIFY_SYMBOL);\n this.notifyOAuthListener();\n this.isConfigured = true;\n }\n /**\n * Provides access to the current back-end resource configuration for the Library.\n *\n * @returns Returns the immutable back-end resource configuration.\n */\n getConfig() {\n if (!this.isConfigured) {\n // eslint-disable-next-line no-console\n console.warn(`Amplify has not been configured. Please call Amplify.configure() before using this service.`);\n }\n return this.resourcesConfig;\n }\n /** @internal */\n [constants_1.ADD_OAUTH_LISTENER](listener) {\n if (this.resourcesConfig.Auth?.Cognito.loginWith?.oauth) {\n // when Amplify has been configured with a valid OAuth config while adding the listener, run it directly\n listener(this.resourcesConfig.Auth?.Cognito);\n }\n else {\n // otherwise register the listener and run it later when Amplify gets configured with a valid oauth config\n this.oAuthListener = listener;\n }\n }\n notifyOAuthListener() {\n if (!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth ||\n !this.oAuthListener) {\n return;\n }\n this.oAuthListener(this.resourcesConfig.Auth?.Cognito);\n // the listener should only be notified once with a valid oauth config\n this.oAuthListener = undefined;\n }\n}\nexports.AmplifyClass = AmplifyClass;\n/**\n * The `Amplify` utility is used to configure the library.\n *\n * @remarks\n * `Amplify` orchestrates cross-category communication within the library.\n */\nexports.Amplify = new AmplifyClass();\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,YAAY,GAAG,MAAM;AAC/C;AACA;AACA,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC;AAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC;AACjD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,MAAM,YAAY,CAAC;AACnB,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,aAAa,GAAG,SAAS;AACtC,QAAQ,IAAI,CAAC,YAAY,GAAG,KAAK;AACjC,QAAQ,IAAI,CAAC,eAAe,GAAG,EAAE;AACjC,QAAQ,IAAI,CAAC,cAAc,GAAG,EAAE;AAChC,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE;AAC1C;
|
|
1
|
+
{"version":3,"file":"Amplify.js","sources":["../../../src/singleton/Amplify.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Amplify = exports.AmplifyClass = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst Hub_1 = require(\"../Hub\");\nconst utils_1 = require(\"../utils\");\nconst libraryUtils_1 = require(\"../libraryUtils\");\nconst Auth_1 = require(\"./Auth\");\nconst constants_1 = require(\"./constants\");\nclass AmplifyClass {\n constructor() {\n this.oAuthListener = undefined;\n this.isConfigured = false;\n this.resourcesConfig = {};\n this.libraryOptions = {};\n this.Auth = new Auth_1.AuthClass();\n }\n /**\n * Configures Amplify for use with your back-end resources.\n *\n * @remarks\n * This API does not perform any merging of either `resourcesConfig` or `libraryOptions`. The most recently\n * provided values will be used after configuration.\n *\n * @remarks\n * `configure` can be used to specify additional library options where available for supported categories.\n *\n * @param resourceConfig - Back-end resource configuration. Typically provided via the `aws-exports.js` file.\n * @param libraryOptions - Additional options for customizing the behavior of the library.\n */\n configure(resourcesConfig, libraryOptions) {\n const resolvedResourceConfig = (0, libraryUtils_1.parseAmplifyConfig)(resourcesConfig);\n this.resourcesConfig = resolvedResourceConfig;\n if (libraryOptions) {\n this.libraryOptions = libraryOptions;\n }\n // Make resource config immutable\n this.resourcesConfig = (0, utils_1.deepFreeze)(this.resourcesConfig);\n this.Auth.configure(this.resourcesConfig.Auth, this.libraryOptions.Auth);\n Hub_1.Hub.dispatch('core', {\n event: 'configure',\n data: this.resourcesConfig,\n }, 'Configure', Hub_1.AMPLIFY_SYMBOL);\n this.notifyOAuthListener();\n this.isConfigured = true;\n }\n /**\n * Provides access to the current back-end resource configuration for the Library.\n *\n * @returns Returns the immutable back-end resource configuration.\n */\n getConfig() {\n if (!this.isConfigured) {\n // eslint-disable-next-line no-console\n console.warn(`Amplify has not been configured. Please call Amplify.configure() before using this service.`);\n }\n return this.resourcesConfig;\n }\n /** @internal */\n [constants_1.ADD_OAUTH_LISTENER](listener) {\n if (this.resourcesConfig.Auth?.Cognito.loginWith?.oauth) {\n // when Amplify has been configured with a valid OAuth config while adding the listener, run it directly\n listener(this.resourcesConfig.Auth?.Cognito);\n }\n else {\n // otherwise register the listener and run it later when Amplify gets configured with a valid oauth config\n this.oAuthListener = listener;\n }\n }\n notifyOAuthListener() {\n if (!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth ||\n !this.oAuthListener) {\n return;\n }\n this.oAuthListener(this.resourcesConfig.Auth?.Cognito);\n // the listener should only be notified once with a valid oauth config\n this.oAuthListener = undefined;\n }\n}\nexports.AmplifyClass = AmplifyClass;\n/**\n * The `Amplify` utility is used to configure the library.\n *\n * @remarks\n * `Amplify` orchestrates cross-category communication within the library.\n */\nexports.Amplify = new AmplifyClass();\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,YAAY,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
}
|
|
31
31
|
/**
|
|
32
32
|
* Fetch the auth tokens, and the temporary AWS credentials and identity if they are configured. By default it
|
|
33
|
-
*
|
|
34
|
-
* with `{ forceRefresh: true }` input.
|
|
33
|
+
* will automatically refresh expired auth tokens if a valid refresh token is present. You can force a refresh
|
|
34
|
+
* of non-expired tokens with `{ forceRefresh: true }` input.
|
|
35
35
|
*
|
|
36
36
|
* @param options - Options configuring the fetch behavior.
|
|
37
37
|
*
|