@aws-amplify/core 6.0.16 → 6.0.17-unstable.0d2aa5d.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/BackgroundProcessManager.js +11 -16
- package/dist/cjs/BackgroundProcessManager/BackgroundProcessManager.js.map +1 -1
- package/dist/cjs/Cache/StorageCacheCommon.js +5 -5
- package/dist/cjs/Cache/StorageCacheCommon.js.map +1 -1
- package/dist/cjs/Cache/utils/CacheList.js +2 -2
- package/dist/cjs/Cache/utils/CacheList.js.map +1 -1
- package/dist/cjs/Hub/index.js +2 -2
- package/dist/cjs/Hub/index.js.map +1 -1
- package/dist/cjs/I18n/I18n.js +8 -13
- package/dist/cjs/I18n/I18n.js.map +1 -1
- package/dist/cjs/I18n/index.js +4 -4
- package/dist/cjs/I18n/index.js.map +1 -1
- package/dist/cjs/Logger/ConsoleLogger.js +8 -7
- package/dist/cjs/Logger/ConsoleLogger.js.map +1 -1
- package/dist/cjs/Logger/types.js +1 -0
- package/dist/cjs/Logger/types.js.map +1 -1
- package/dist/cjs/Mutex/Mutex.js +4 -1
- package/dist/cjs/Mutex/Mutex.js.map +1 -1
- package/dist/cjs/Platform/detectFramework.js +3 -1
- package/dist/cjs/Platform/detectFramework.js.map +1 -1
- package/dist/cjs/Platform/detection/Angular.js +2 -4
- package/dist/cjs/Platform/detection/Angular.js.map +1 -1
- package/dist/cjs/Platform/detection/Expo.js +1 -2
- package/dist/cjs/Platform/detection/Expo.js.map +1 -1
- package/dist/cjs/Platform/detection/Next.js +3 -2
- package/dist/cjs/Platform/detection/Next.js.map +1 -1
- package/dist/cjs/Platform/detection/Nuxt.js +3 -4
- package/dist/cjs/Platform/detection/Nuxt.js.map +1 -1
- package/dist/cjs/Platform/index.js +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 +6 -2
- package/dist/cjs/Reachability/Reachability.js.map +1 -1
- package/dist/cjs/ServiceWorker/ServiceWorker.js +11 -11
- package/dist/cjs/ServiceWorker/ServiceWorker.js.map +1 -1
- package/dist/cjs/Signer/DateUtils.js +1 -1
- package/dist/cjs/Signer/DateUtils.js.map +1 -1
- package/dist/cjs/Signer/Signer.js +3 -3
- package/dist/cjs/Signer/Signer.js.map +1 -1
- package/dist/cjs/adapterCore/serverContext/serverContext.js +1 -1
- package/dist/cjs/adapterCore/serverContext/serverContext.js.map +1 -1
- package/dist/cjs/awsClients/cognitoIdentity/base.js +2 -2
- package/dist/cjs/awsClients/cognitoIdentity/base.js.map +1 -1
- package/dist/cjs/awsClients/cognitoIdentity/getCredentialsForIdentity.js +1 -1
- package/dist/cjs/awsClients/cognitoIdentity/getCredentialsForIdentity.js.map +1 -1
- package/dist/cjs/awsClients/cognitoIdentity/getId.js +1 -1
- package/dist/cjs/awsClients/cognitoIdentity/getId.js.map +1 -1
- package/dist/cjs/awsClients/pinpoint/getInAppMessages.js +1 -1
- package/dist/cjs/awsClients/pinpoint/getInAppMessages.js.map +1 -1
- package/dist/cjs/awsClients/pinpoint/putEvents.js +1 -1
- package/dist/cjs/awsClients/pinpoint/putEvents.js.map +1 -1
- package/dist/cjs/awsClients/pinpoint/types.js +0 -1
- package/dist/cjs/awsClients/pinpoint/types.js.map +1 -1
- package/dist/cjs/awsClients/pinpoint/updateEndpoint.js +1 -1
- package/dist/cjs/awsClients/pinpoint/updateEndpoint.js.map +1 -1
- package/dist/cjs/clients/handlers/authenticated.js +3 -3
- package/dist/cjs/clients/handlers/authenticated.js.map +1 -1
- package/dist/cjs/clients/handlers/unauthenticated.js +1 -1
- package/dist/cjs/clients/handlers/unauthenticated.js.map +1 -1
- package/dist/cjs/clients/index.js +4 -4
- package/dist/cjs/clients/index.js.map +1 -1
- package/dist/cjs/clients/internal/composeServiceApi.js +1 -1
- package/dist/cjs/clients/internal/composeServiceApi.js.map +1 -1
- package/dist/cjs/clients/internal/composeTransferHandler.js +1 -1
- package/dist/cjs/clients/internal/composeTransferHandler.js.map +1 -1
- package/dist/cjs/clients/middleware/retry/defaultRetryDecider.js +2 -2
- package/dist/cjs/clients/middleware/retry/defaultRetryDecider.js.map +1 -1
- package/dist/cjs/clients/middleware/retry/index.js +2 -2
- package/dist/cjs/clients/middleware/retry/index.js.map +1 -1
- package/dist/cjs/clients/middleware/retry/jitteredBackoff.js +1 -1
- package/dist/cjs/clients/middleware/retry/jitteredBackoff.js.map +1 -1
- package/dist/cjs/clients/middleware/retry/middleware.js +6 -6
- package/dist/cjs/clients/middleware/retry/middleware.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/index.js +2 -2
- package/dist/cjs/clients/middleware/signing/index.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/middleware.js +3 -3
- package/dist/cjs/clients/middleware/signing/middleware.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/signer/signatureV4/presignUrl.js +1 -2
- package/dist/cjs/clients/middleware/signing/signer/signatureV4/presignUrl.js.map +1 -1
- package/dist/cjs/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +1 -1
- package/dist/cjs/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js.map +1 -1
- package/dist/cjs/clients/middleware/userAgent/index.js +2 -2
- package/dist/cjs/clients/middleware/userAgent/index.js.map +1 -1
- package/dist/cjs/clients/middleware/userAgent/middleware.js +3 -3
- package/dist/cjs/clients/middleware/userAgent/middleware.js.map +1 -1
- package/dist/cjs/clients/serde/json.js +1 -1
- package/dist/cjs/clients/serde/json.js.map +1 -1
- package/dist/cjs/errors/errorHelpers.js +1 -1
- package/dist/cjs/errors/errorHelpers.js.map +1 -1
- package/dist/cjs/parseAWSExports.js +1 -1
- package/dist/cjs/parseAWSExports.js.map +1 -1
- package/dist/cjs/providers/pinpoint/apis/updateEndpoint.js +1 -1
- package/dist/cjs/providers/pinpoint/apis/updateEndpoint.js.map +1 -1
- package/dist/cjs/providers/pinpoint/utils/PinpointEventBuffer.js +2 -3
- package/dist/cjs/providers/pinpoint/utils/PinpointEventBuffer.js.map +1 -1
- package/dist/cjs/providers/pinpoint/utils/isAppInForeground.native.js +0 -1
- package/dist/cjs/providers/pinpoint/utils/isAppInForeground.native.js.map +1 -1
- package/dist/cjs/singleton/Amplify.js +1 -1
- package/dist/cjs/singleton/Amplify.js.map +1 -1
- package/dist/cjs/singleton/Auth/index.js +2 -6
- package/dist/cjs/singleton/Auth/index.js.map +1 -1
- package/dist/cjs/singleton/Auth/utils/index.js +4 -4
- package/dist/cjs/singleton/Auth/utils/index.js.map +1 -1
- package/dist/cjs/singleton/apis/fetchAuthSession.js +1 -1
- package/dist/cjs/singleton/apis/fetchAuthSession.js.map +1 -1
- package/dist/cjs/storage/CookieStorage.js +8 -4
- package/dist/cjs/storage/CookieStorage.js.map +1 -1
- package/dist/cjs/storage/CookieStorage.native.js +0 -3
- package/dist/cjs/storage/CookieStorage.native.js.map +1 -1
- package/dist/cjs/utils/WordArray.js +2 -2
- package/dist/cjs/utils/WordArray.js.map +1 -1
- package/dist/cjs/utils/deDupeAsyncFunction.js +8 -8
- package/dist/cjs/utils/deDupeAsyncFunction.js.map +1 -1
- package/dist/cjs/utils/getClientInfo/getClientInfo.android.js +2 -3
- package/dist/cjs/utils/getClientInfo/getClientInfo.android.js.map +1 -1
- package/dist/cjs/utils/getClientInfo/getClientInfo.ios.js +2 -3
- package/dist/cjs/utils/getClientInfo/getClientInfo.ios.js.map +1 -1
- package/dist/cjs/utils/queuedStorage/createQueuedStorage.native.js +2 -2
- package/dist/cjs/utils/queuedStorage/createQueuedStorage.native.js.map +1 -1
- package/dist/cjs/utils/retry/NonRetryableError.js +2 -2
- package/dist/cjs/utils/retry/NonRetryableError.js.map +1 -1
- package/dist/cjs/utils/retry/retry.js +15 -6
- package/dist/cjs/utils/retry/retry.js.map +1 -1
- package/dist/esm/BackgroundProcessManager/BackgroundProcessManager.d.ts +2 -8
- package/dist/esm/BackgroundProcessManager/BackgroundProcessManager.mjs +11 -16
- package/dist/esm/BackgroundProcessManager/BackgroundProcessManager.mjs.map +1 -1
- package/dist/esm/BackgroundProcessManager/types.d.ts +3 -3
- package/dist/esm/Cache/StorageCacheCommon.mjs +5 -5
- package/dist/esm/Cache/StorageCacheCommon.mjs.map +1 -1
- package/dist/esm/Cache/types/cache.d.ts +1 -1
- package/dist/esm/Cache/utils/CacheList.mjs +2 -2
- package/dist/esm/Cache/utils/CacheList.mjs.map +1 -1
- package/dist/esm/Hub/index.d.ts +4 -4
- package/dist/esm/Hub/index.mjs +2 -2
- package/dist/esm/Hub/index.mjs.map +1 -1
- package/dist/esm/Hub/types/AuthTypes.d.ts +11 -11
- package/dist/esm/Hub/types/HubTypes.d.ts +8 -8
- package/dist/esm/I18n/I18n.d.ts +0 -6
- package/dist/esm/I18n/I18n.mjs +8 -13
- package/dist/esm/I18n/I18n.mjs.map +1 -1
- package/dist/esm/I18n/index.mjs +4 -4
- package/dist/esm/I18n/index.mjs.map +1 -1
- package/dist/esm/Logger/ConsoleLogger.d.ts +1 -1
- package/dist/esm/Logger/ConsoleLogger.mjs +8 -7
- package/dist/esm/Logger/ConsoleLogger.mjs.map +1 -1
- package/dist/esm/Logger/types.d.ts +2 -1
- package/dist/esm/Logger/types.mjs +1 -0
- package/dist/esm/Logger/types.mjs.map +1 -1
- package/dist/esm/Mutex/Mutex.mjs +4 -1
- package/dist/esm/Mutex/Mutex.mjs.map +1 -1
- package/dist/esm/Mutex/types.d.ts +2 -6
- package/dist/esm/Platform/detectFramework.mjs +3 -1
- package/dist/esm/Platform/detectFramework.mjs.map +1 -1
- package/dist/esm/Platform/detection/Angular.mjs +2 -4
- package/dist/esm/Platform/detection/Angular.mjs.map +1 -1
- package/dist/esm/Platform/detection/Expo.mjs +1 -2
- package/dist/esm/Platform/detection/Expo.mjs.map +1 -1
- package/dist/esm/Platform/detection/Next.mjs +3 -2
- package/dist/esm/Platform/detection/Next.mjs.map +1 -1
- package/dist/esm/Platform/detection/Nuxt.mjs +3 -4
- package/dist/esm/Platform/detection/Nuxt.mjs.map +1 -1
- package/dist/esm/Platform/detection/index.mjs.map +1 -1
- package/dist/esm/Platform/index.d.ts +2 -2
- package/dist/esm/Platform/index.mjs +1 -1
- package/dist/esm/Platform/index.mjs.map +1 -1
- package/dist/esm/Platform/types.d.ts +12 -12
- 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 +6 -2
- package/dist/esm/Reachability/Reachability.mjs.map +1 -1
- package/dist/esm/Reachability/types.d.ts +2 -2
- package/dist/esm/ServiceWorker/ServiceWorker.d.ts +0 -1
- package/dist/esm/ServiceWorker/ServiceWorker.mjs +11 -11
- package/dist/esm/ServiceWorker/ServiceWorker.mjs.map +1 -1
- package/dist/esm/Signer/DateUtils.d.ts +9 -9
- package/dist/esm/Signer/DateUtils.mjs +1 -1
- package/dist/esm/Signer/DateUtils.mjs.map +1 -1
- package/dist/esm/Signer/Signer.mjs +3 -3
- package/dist/esm/Signer/Signer.mjs.map +1 -1
- package/dist/esm/adapterCore/serverContext/serverContext.d.ts +1 -1
- package/dist/esm/adapterCore/serverContext/serverContext.mjs +1 -1
- package/dist/esm/adapterCore/serverContext/serverContext.mjs.map +1 -1
- package/dist/esm/adapterCore/serverContext/types/amplifyServer.d.ts +7 -9
- package/dist/esm/awsClients/cognitoIdentity/base.d.ts +1 -1
- package/dist/esm/awsClients/cognitoIdentity/base.mjs +2 -2
- package/dist/esm/awsClients/cognitoIdentity/base.mjs.map +1 -1
- package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.d.ts +2 -6
- package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.mjs +1 -1
- package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.mjs.map +1 -1
- package/dist/esm/awsClients/cognitoIdentity/getId.d.ts +2 -6
- package/dist/esm/awsClients/cognitoIdentity/getId.mjs +1 -1
- package/dist/esm/awsClients/cognitoIdentity/getId.mjs.map +1 -1
- package/dist/esm/awsClients/cognitoIdentity/types.d.ts +2 -4
- package/dist/esm/awsClients/pinpoint/base.mjs.map +1 -1
- package/dist/esm/awsClients/pinpoint/getInAppMessages.d.ts +1 -1
- package/dist/esm/awsClients/pinpoint/getInAppMessages.mjs +1 -1
- package/dist/esm/awsClients/pinpoint/getInAppMessages.mjs.map +1 -1
- package/dist/esm/awsClients/pinpoint/putEvents.d.ts +1 -1
- package/dist/esm/awsClients/pinpoint/putEvents.mjs +1 -1
- package/dist/esm/awsClients/pinpoint/putEvents.mjs.map +1 -1
- package/dist/esm/awsClients/pinpoint/types.d.ts +3 -6
- package/dist/esm/awsClients/pinpoint/updateEndpoint.d.ts +1 -1
- package/dist/esm/awsClients/pinpoint/updateEndpoint.mjs +1 -1
- package/dist/esm/awsClients/pinpoint/updateEndpoint.mjs.map +1 -1
- package/dist/esm/clients/handlers/authenticated.mjs +6 -6
- package/dist/esm/clients/handlers/authenticated.mjs.map +1 -1
- package/dist/esm/clients/handlers/unauthenticated.mjs +3 -3
- package/dist/esm/clients/handlers/unauthenticated.mjs.map +1 -1
- package/dist/esm/clients/index.d.ts +3 -3
- package/dist/esm/clients/index.mjs +3 -3
- package/dist/esm/clients/internal/composeServiceApi.d.ts +2 -2
- package/dist/esm/clients/internal/composeServiceApi.mjs +1 -1
- package/dist/esm/clients/internal/composeServiceApi.mjs.map +1 -1
- package/dist/esm/clients/internal/composeTransferHandler.d.ts +2 -2
- package/dist/esm/clients/internal/composeTransferHandler.mjs +1 -1
- package/dist/esm/clients/internal/composeTransferHandler.mjs.map +1 -1
- package/dist/esm/clients/middleware/retry/defaultRetryDecider.d.ts +1 -1
- package/dist/esm/clients/middleware/retry/defaultRetryDecider.mjs +2 -2
- package/dist/esm/clients/middleware/retry/defaultRetryDecider.mjs.map +1 -1
- package/dist/esm/clients/middleware/retry/index.d.ts +1 -1
- package/dist/esm/clients/middleware/retry/index.mjs +1 -1
- package/dist/esm/clients/middleware/retry/jitteredBackoff.mjs.map +1 -1
- package/dist/esm/clients/middleware/retry/middleware.d.ts +3 -3
- package/dist/esm/clients/middleware/retry/middleware.mjs +5 -5
- package/dist/esm/clients/middleware/retry/middleware.mjs.map +1 -1
- package/dist/esm/clients/middleware/signing/index.d.ts +1 -1
- package/dist/esm/clients/middleware/signing/index.mjs +1 -1
- package/dist/esm/clients/middleware/signing/middleware.d.ts +1 -1
- package/dist/esm/clients/middleware/signing/middleware.mjs +2 -2
- package/dist/esm/clients/middleware/signing/middleware.mjs.map +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/presignUrl.d.ts +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/presignUrl.mjs +1 -2
- package/dist/esm/clients/middleware/signing/signer/signatureV4/presignUrl.mjs.map +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.mjs +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.mjs.map +1 -1
- package/dist/esm/clients/middleware/userAgent/index.d.ts +1 -1
- package/dist/esm/clients/middleware/userAgent/index.mjs +1 -1
- package/dist/esm/clients/middleware/userAgent/middleware.d.ts +1 -1
- package/dist/esm/clients/middleware/userAgent/middleware.mjs +2 -2
- package/dist/esm/clients/middleware/userAgent/middleware.mjs.map +1 -1
- package/dist/esm/clients/serde/json.mjs +1 -1
- package/dist/esm/clients/serde/json.mjs.map +1 -1
- package/dist/esm/clients/types/aws.d.ts +3 -3
- package/dist/esm/clients/types/core.d.ts +3 -5
- package/dist/esm/errors/APIError.d.ts +1 -1
- package/dist/esm/errors/errorHelpers.mjs +1 -1
- package/dist/esm/errors/errorHelpers.mjs.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/libraryUtils.d.ts +1 -1
- package/dist/esm/parseAWSExports.mjs +1 -1
- package/dist/esm/parseAWSExports.mjs.map +1 -1
- package/dist/esm/providers/kinesis/types/kinesis.d.ts +2 -2
- package/dist/esm/providers/kinesis-firehose/types/kinesis-firehose.d.ts +2 -2
- package/dist/esm/providers/personalize/types/personalize.d.ts +2 -2
- package/dist/esm/providers/pinpoint/apis/updateEndpoint.mjs +1 -1
- package/dist/esm/providers/pinpoint/apis/updateEndpoint.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/types/buffer.d.ts +6 -8
- package/dist/esm/providers/pinpoint/types/pinpoint.d.ts +10 -10
- package/dist/esm/providers/pinpoint/utils/PinpointEventBuffer.d.ts +1 -1
- package/dist/esm/providers/pinpoint/utils/PinpointEventBuffer.mjs +2 -3
- package/dist/esm/providers/pinpoint/utils/PinpointEventBuffer.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/utils/getEventBuffer.d.ts +1 -1
- package/dist/esm/providers/pinpoint/utils/isAppInForeground.native.mjs +0 -1
- package/dist/esm/providers/pinpoint/utils/isAppInForeground.native.mjs.map +1 -1
- package/dist/esm/singleton/API/types.d.ts +35 -37
- package/dist/esm/singleton/Amplify.d.ts +1 -1
- package/dist/esm/singleton/Amplify.mjs +1 -1
- package/dist/esm/singleton/Amplify.mjs.map +1 -1
- package/dist/esm/singleton/Auth/index.d.ts +0 -1
- package/dist/esm/singleton/Auth/index.mjs +2 -6
- package/dist/esm/singleton/Auth/index.mjs.map +1 -1
- package/dist/esm/singleton/Auth/types.d.ts +53 -52
- package/dist/esm/singleton/Auth/utils/index.d.ts +1 -1
- package/dist/esm/singleton/Auth/utils/index.mjs +4 -4
- package/dist/esm/singleton/Auth/utils/index.mjs.map +1 -1
- package/dist/esm/singleton/Geo/types.d.ts +3 -3
- package/dist/esm/singleton/Interactions/types.d.ts +4 -4
- package/dist/esm/singleton/Notifications/types.d.ts +5 -5
- package/dist/esm/singleton/Predictions/types.d.ts +28 -28
- package/dist/esm/singleton/Storage/types.d.ts +2 -2
- package/dist/esm/singleton/apis/fetchAuthSession.mjs +1 -1
- package/dist/esm/singleton/apis/fetchAuthSession.mjs.map +1 -1
- package/dist/esm/singleton/types.d.ts +8 -8
- package/dist/esm/storage/CookieStorage.mjs +8 -4
- package/dist/esm/storage/CookieStorage.mjs.map +1 -1
- package/dist/esm/storage/CookieStorage.native.d.ts +0 -1
- package/dist/esm/storage/CookieStorage.native.mjs +0 -3
- package/dist/esm/storage/CookieStorage.native.mjs.map +1 -1
- package/dist/esm/types/core.d.ts +2 -2
- package/dist/esm/types/errors.d.ts +4 -4
- package/dist/esm/types/storage.d.ts +2 -2
- package/dist/esm/utils/WordArray.mjs +2 -2
- package/dist/esm/utils/WordArray.mjs.map +1 -1
- package/dist/esm/utils/deDupeAsyncFunction.d.ts +1 -5
- package/dist/esm/utils/deDupeAsyncFunction.mjs +8 -8
- package/dist/esm/utils/deDupeAsyncFunction.mjs.map +1 -1
- package/dist/esm/utils/getClientInfo/getClientInfo.android.mjs +0 -1
- package/dist/esm/utils/getClientInfo/getClientInfo.android.mjs.map +1 -1
- package/dist/esm/utils/getClientInfo/getClientInfo.ios.mjs +0 -1
- package/dist/esm/utils/getClientInfo/getClientInfo.ios.mjs.map +1 -1
- package/dist/esm/utils/globalHelpers/index.native.mjs.map +1 -1
- package/dist/esm/utils/queuedStorage/createQueuedStorage.native.mjs +2 -2
- package/dist/esm/utils/queuedStorage/createQueuedStorage.native.mjs.map +1 -1
- package/dist/esm/utils/retry/NonRetryableError.d.ts +0 -1
- package/dist/esm/utils/retry/NonRetryableError.mjs +2 -2
- package/dist/esm/utils/retry/NonRetryableError.mjs.map +1 -1
- package/dist/esm/utils/retry/retry.mjs +15 -6
- package/dist/esm/utils/retry/retry.mjs.map +1 -1
- package/dist/esm/utils/sessionListener/SessionListener.d.ts +1 -1
- package/dist/esm/utils/sessionListener/SessionListener.native.d.ts +1 -1
- package/dist/esm/utils/sessionListener/types.d.ts +2 -2
- package/package.json +5 -4
- package/src/BackgroundProcessManager/BackgroundProcessManager.ts +29 -34
- package/src/BackgroundProcessManager/types.ts +3 -3
- package/src/Cache/StorageCache.native.ts +5 -0
- package/src/Cache/StorageCache.ts +2 -0
- package/src/Cache/StorageCacheCommon.ts +49 -29
- package/src/Cache/types/cache.ts +2 -1
- package/src/Cache/utils/CacheList.ts +6 -3
- package/src/Cache/utils/cacheHelpers.ts +2 -1
- package/src/Hub/index.ts +15 -15
- package/src/Hub/types/AuthTypes.ts +11 -11
- package/src/Hub/types/HubTypes.ts +11 -8
- package/src/I18n/I18n.ts +10 -16
- package/src/I18n/index.ts +7 -7
- package/src/Logger/ConsoleLogger.ts +12 -9
- package/src/Logger/types.ts +1 -0
- package/src/Mutex/Mutex.ts +8 -4
- package/src/Mutex/types.ts +3 -7
- package/src/Platform/customUserAgent.ts +3 -3
- package/src/Platform/detectFramework.ts +4 -1
- package/src/Platform/detection/Angular.ts +4 -4
- package/src/Platform/detection/Expo.ts +1 -2
- package/src/Platform/detection/Next.ts +5 -2
- package/src/Platform/detection/Nuxt.ts +5 -4
- package/src/Platform/detection/index.ts +9 -9
- package/src/Platform/index.ts +4 -4
- package/src/Platform/types.ts +12 -12
- package/src/Platform/version.ts +1 -1
- package/src/Reachability/Reachability.native.ts +6 -3
- package/src/Reachability/Reachability.ts +12 -6
- package/src/Reachability/types.ts +2 -2
- package/src/ServiceWorker/ServiceWorker.ts +28 -23
- package/src/Signer/DateUtils.ts +16 -16
- package/src/Signer/Signer.ts +19 -13
- package/src/adapterCore/serverContext/serverContext.ts +6 -5
- package/src/adapterCore/serverContext/serverContextRegistry.ts +2 -1
- package/src/adapterCore/serverContext/types/amplifyServer.ts +15 -17
- package/src/adapterCore/serverContext/types/cookieStorage.ts +1 -1
- package/src/awsClients/cognitoIdentity/base.ts +16 -12
- package/src/awsClients/cognitoIdentity/getCredentialsForIdentity.ts +13 -10
- package/src/awsClients/cognitoIdentity/getId.ts +12 -9
- package/src/awsClients/cognitoIdentity/types.ts +3 -3
- package/src/awsClients/pinpoint/base.ts +1 -1
- package/src/awsClients/pinpoint/getInAppMessages.ts +8 -5
- package/src/awsClients/pinpoint/putEvents.ts +8 -5
- package/src/awsClients/pinpoint/types.ts +3 -4
- package/src/awsClients/pinpoint/updateEndpoint.ts +8 -5
- package/src/clients/endpoints/getDnsSuffix.ts +1 -0
- package/src/clients/handlers/authenticated.ts +14 -7
- package/src/clients/handlers/fetch.ts +1 -1
- package/src/clients/handlers/unauthenticated.ts +8 -4
- package/src/clients/index.ts +6 -3
- package/src/clients/internal/composeServiceApi.ts +8 -7
- package/src/clients/internal/composeTransferHandler.ts +16 -15
- package/src/clients/middleware/retry/defaultRetryDecider.ts +5 -3
- package/src/clients/middleware/retry/index.ts +1 -1
- package/src/clients/middleware/retry/jitteredBackoff.ts +3 -1
- package/src/clients/middleware/retry/middleware.ts +12 -9
- package/src/clients/middleware/signing/index.ts +1 -1
- package/src/clients/middleware/signing/middleware.ts +5 -2
- package/src/clients/middleware/signing/signer/signatureV4/presignUrl.ts +4 -4
- package/src/clients/middleware/signing/signer/signatureV4/signRequest.ts +2 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.ts +4 -2
- package/src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.ts +2 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.ts +2 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.ts +1 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.ts +1 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.ts +2 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.ts +3 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getSignature.ts +4 -3
- package/src/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.ts +3 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.ts +3 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.ts +2 -2
- package/src/clients/middleware/signing/utils/getUpdatedSystemClockOffset.ts +2 -1
- package/src/clients/middleware/signing/utils/isClockSkewed.ts +2 -2
- package/src/clients/middleware/userAgent/index.ts +1 -1
- package/src/clients/middleware/userAgent/middleware.ts +3 -1
- package/src/clients/serde/json.ts +6 -2
- package/src/clients/serde/responseInfo.ts +6 -2
- package/src/clients/types/aws.ts +6 -3
- package/src/clients/types/core.ts +6 -8
- package/src/clients/types/http.ts +2 -1
- package/src/clients/utils/memoization.ts +2 -0
- package/src/errors/APIError.ts +3 -2
- package/src/errors/PlatformNotSupportedError.ts +1 -0
- package/src/errors/createAssertionFunction.ts +2 -1
- package/src/errors/errorHelpers.ts +2 -1
- package/src/index.ts +0 -1
- package/src/libraryUtils.ts +1 -0
- package/src/parseAWSExports.ts +16 -15
- package/src/providers/kinesis/types/kinesis.ts +2 -2
- package/src/providers/kinesis-firehose/types/kinesis-firehose.ts +2 -2
- package/src/providers/personalize/types/personalize.ts +2 -2
- package/src/providers/pinpoint/apis/updateEndpoint.ts +2 -2
- package/src/providers/pinpoint/types/buffer.ts +7 -8
- package/src/providers/pinpoint/types/pinpoint.ts +11 -10
- package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +11 -21
- package/src/providers/pinpoint/utils/cacheEndpointId.ts +3 -1
- package/src/providers/pinpoint/utils/getCacheKey.ts +1 -1
- package/src/providers/pinpoint/utils/getEndpointId.ts +3 -1
- package/src/providers/pinpoint/utils/getEventBuffer.ts +2 -1
- package/src/providers/pinpoint/utils/isAppInForeground.native.ts +0 -1
- package/src/providers/pinpoint/utils/resolveEndpointId.ts +1 -0
- package/src/singleton/API/types.ts +35 -33
- package/src/singleton/Amplify.ts +8 -6
- package/src/singleton/Auth/index.ts +9 -13
- package/src/singleton/Auth/types.ts +59 -51
- package/src/singleton/Auth/utils/index.ts +16 -28
- package/src/singleton/Geo/types.ts +3 -3
- package/src/singleton/Interactions/types.ts +4 -4
- package/src/singleton/Notifications/types.ts +6 -5
- package/src/singleton/Predictions/types.ts +28 -28
- package/src/singleton/Storage/types.ts +2 -2
- package/src/singleton/apis/fetchAuthSession.ts +2 -1
- package/src/singleton/apis/internal/fetchAuthSession.ts +1 -1
- package/src/singleton/apis/server/fetchAuthSession.ts +2 -2
- package/src/singleton/types.ts +10 -10
- package/src/storage/CookieStorage.native.ts +1 -5
- package/src/storage/CookieStorage.ts +12 -6
- package/src/storage/DefaultStorage.native.ts +3 -1
- package/src/storage/InMemoryStorage.ts +1 -0
- package/src/storage/KeyValueStorage.ts +1 -0
- package/src/types/core.ts +3 -3
- package/src/types/errors.ts +5 -5
- package/src/types/storage.ts +2 -2
- package/src/utils/WordArray.ts +2 -2
- package/src/utils/convert/base64/base64Encoder.ts +1 -0
- package/src/utils/convert/types.ts +1 -1
- package/src/utils/cryptoSecureRandomInt.ts +1 -0
- package/src/utils/deDupeAsyncFunction.ts +15 -20
- package/src/utils/generateRandomString.ts +1 -1
- package/src/utils/getClientInfo/getClientInfo.android.ts +3 -2
- package/src/utils/getClientInfo/getClientInfo.ios.ts +4 -2
- package/src/utils/getClientInfo/getClientInfo.ts +3 -3
- package/src/utils/globalHelpers/index.native.ts +2 -1
- package/src/utils/haveCredentialsChanged.ts +5 -2
- package/src/utils/isWebWorker.ts +1 -0
- package/src/utils/queuedStorage/createQueuedStorage.native.ts +9 -6
- package/src/utils/queuedStorage/createQueuedStorage.ts +7 -3
- package/src/utils/queuedStorage/types.ts +1 -1
- package/src/utils/retry/NonRetryableError.ts +0 -3
- package/src/utils/retry/isNonRetryableError.ts +1 -0
- package/src/utils/retry/jitteredBackoff.ts +3 -1
- package/src/utils/retry/jitteredExponentialRetry.ts +1 -1
- package/src/utils/retry/retry.ts +22 -8
- package/src/utils/sessionListener/SessionListener.native.ts +4 -3
- package/src/utils/sessionListener/SessionListener.ts +4 -3
- package/src/utils/sessionListener/index.ts +1 -0
- package/src/utils/sessionListener/types.ts +2 -2
- package/src/utils/urlSafeDecode.ts +1 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Headers } from '../../clients';
|
|
2
2
|
import { AtLeastOne } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export interface LibraryAPIOptions {
|
|
4
4
|
GraphQL?: {
|
|
5
|
-
headers
|
|
5
|
+
headers?(options?: {
|
|
6
6
|
query?: string;
|
|
7
7
|
variables?: Record<string, DocumentType>;
|
|
8
|
-
})
|
|
8
|
+
}): Promise<Headers | Record<string, unknown>>;
|
|
9
9
|
withCredentials?: boolean;
|
|
10
10
|
};
|
|
11
11
|
REST?: {
|
|
12
|
-
headers
|
|
12
|
+
headers?(options: {
|
|
13
13
|
apiName: string;
|
|
14
|
-
})
|
|
14
|
+
}): Promise<Headers>;
|
|
15
15
|
};
|
|
16
|
-
}
|
|
17
|
-
|
|
16
|
+
}
|
|
17
|
+
interface APIGraphQLConfig {
|
|
18
18
|
/**
|
|
19
19
|
* Required GraphQL endpoint, must be a valid URL string.
|
|
20
20
|
*/
|
|
@@ -41,8 +41,8 @@ type APIGraphQLConfig = {
|
|
|
41
41
|
*/
|
|
42
42
|
defaultAuthMode: GraphQLAuthMode;
|
|
43
43
|
modelIntrospection?: ModelIntrospectionSchema;
|
|
44
|
-
}
|
|
45
|
-
|
|
44
|
+
}
|
|
45
|
+
interface APIRestConfig {
|
|
46
46
|
/**
|
|
47
47
|
* Required REST endpoint, must be a valid URL string.
|
|
48
48
|
*/
|
|
@@ -60,13 +60,13 @@ type APIRestConfig = {
|
|
|
60
60
|
* @default 'execute-api'
|
|
61
61
|
*/
|
|
62
62
|
service?: string;
|
|
63
|
-
}
|
|
64
|
-
export
|
|
63
|
+
}
|
|
64
|
+
export interface RESTProviderConfig {
|
|
65
65
|
REST: Record<string, APIRestConfig>;
|
|
66
|
-
}
|
|
67
|
-
export
|
|
66
|
+
}
|
|
67
|
+
export interface GraphQLProviderConfig {
|
|
68
68
|
GraphQL: APIGraphQLConfig;
|
|
69
|
-
}
|
|
69
|
+
}
|
|
70
70
|
export type APIConfig = AtLeastOne<RESTProviderConfig & GraphQLProviderConfig>;
|
|
71
71
|
export type GraphQLAuthMode = 'apiKey' | 'oidc' | 'userPool' | 'iam' | 'lambda' | 'none';
|
|
72
72
|
/**
|
|
@@ -80,53 +80,51 @@ export type DocumentType = null | boolean | number | string | DocumentType[] | {
|
|
|
80
80
|
*
|
|
81
81
|
* Borrowed from: https://github.com/aws-amplify/samsara-cli/pull/377/commits/c08ea2c1a43f36aafe63b6d14d03f884e9c0c671#diff-21ae6faa2f22c15bb25ff9b272eaab7846c0650e2d267ab720546c19559583d0R4-R108
|
|
82
82
|
*/
|
|
83
|
-
export
|
|
83
|
+
export interface ModelIntrospectionSchema {
|
|
84
84
|
version: 1;
|
|
85
85
|
models: SchemaModels;
|
|
86
86
|
nonModels: SchemaNonModels;
|
|
87
87
|
enums: SchemaEnums;
|
|
88
|
-
}
|
|
88
|
+
}
|
|
89
89
|
/**
|
|
90
90
|
* Top-level Entities on a Schema
|
|
91
91
|
*/
|
|
92
92
|
export type SchemaModels = Record<string, SchemaModel>;
|
|
93
93
|
export type SchemaNonModels = Record<string, SchemaNonModel>;
|
|
94
94
|
export type SchemaEnums = Record<string, SchemaEnum>;
|
|
95
|
-
export
|
|
95
|
+
export interface SchemaModel {
|
|
96
96
|
name: string;
|
|
97
97
|
attributes?: ModelAttribute[];
|
|
98
98
|
fields: Fields;
|
|
99
99
|
pluralName: string;
|
|
100
100
|
syncable?: boolean;
|
|
101
101
|
primaryKeyInfo: PrimaryKeyInfo;
|
|
102
|
-
}
|
|
103
|
-
export
|
|
102
|
+
}
|
|
103
|
+
export interface SchemaNonModel {
|
|
104
104
|
name: string;
|
|
105
105
|
fields: Fields;
|
|
106
|
-
}
|
|
107
|
-
export
|
|
106
|
+
}
|
|
107
|
+
export interface SchemaEnum {
|
|
108
108
|
name: string;
|
|
109
109
|
values: string[];
|
|
110
|
-
}
|
|
111
|
-
export
|
|
110
|
+
}
|
|
111
|
+
export interface ModelAttribute {
|
|
112
112
|
type: string;
|
|
113
|
-
properties?:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
};
|
|
117
|
-
export type SecondaryIndexAttribute = {
|
|
113
|
+
properties?: Record<string, any>;
|
|
114
|
+
}
|
|
115
|
+
export interface SecondaryIndexAttribute {
|
|
118
116
|
type: 'key';
|
|
119
117
|
properties: {
|
|
120
118
|
name: string;
|
|
121
119
|
queryField: string;
|
|
122
120
|
fields: string[];
|
|
123
121
|
};
|
|
124
|
-
}
|
|
122
|
+
}
|
|
125
123
|
/**
|
|
126
124
|
* Field Definition
|
|
127
125
|
*/
|
|
128
126
|
export type Fields = Record<string, Field>;
|
|
129
|
-
export
|
|
127
|
+
export interface Field {
|
|
130
128
|
name: string;
|
|
131
129
|
type: FieldType;
|
|
132
130
|
isArray: boolean;
|
|
@@ -135,10 +133,10 @@ export type Field = {
|
|
|
135
133
|
isArrayNullable?: boolean;
|
|
136
134
|
attributes?: FieldAttribute[];
|
|
137
135
|
association?: AssociationType;
|
|
138
|
-
}
|
|
139
|
-
export
|
|
136
|
+
}
|
|
137
|
+
export interface ModelFieldType {
|
|
140
138
|
model: string;
|
|
141
|
-
}
|
|
139
|
+
}
|
|
142
140
|
export type FieldType = 'ID' | 'String' | 'Int' | 'Float' | 'AWSDate' | 'AWSTime' | 'AWSDateTime' | 'AWSTimestamp' | 'AWSEmail' | 'AWSURL' | 'AWSIPAddress' | 'Boolean' | 'AWSJSON' | 'AWSPhone' | {
|
|
143
141
|
enum: string;
|
|
144
142
|
} | ModelFieldType | {
|
|
@@ -153,9 +151,9 @@ export declare enum CodeGenConnectionType {
|
|
|
153
151
|
BELONGS_TO = "BELONGS_TO",
|
|
154
152
|
HAS_MANY = "HAS_MANY"
|
|
155
153
|
}
|
|
156
|
-
export
|
|
154
|
+
export interface AssociationBaseType {
|
|
157
155
|
connectionType: CodeGenConnectionType;
|
|
158
|
-
}
|
|
156
|
+
}
|
|
159
157
|
export type AssociationHasMany = AssociationBaseType & {
|
|
160
158
|
connectionType: CodeGenConnectionType.HAS_MANY;
|
|
161
159
|
associatedWith: string[];
|
|
@@ -170,9 +168,9 @@ export type AssociationBelongsTo = AssociationBaseType & {
|
|
|
170
168
|
targetNames: string[];
|
|
171
169
|
};
|
|
172
170
|
export type AssociationType = AssociationHasMany | AssociationHasOne | AssociationBelongsTo;
|
|
173
|
-
export
|
|
171
|
+
export interface PrimaryKeyInfo {
|
|
174
172
|
isCustomPrimaryKey: boolean;
|
|
175
173
|
primaryKeyFieldName: string;
|
|
176
174
|
sortKeyFieldNames: string[];
|
|
177
|
-
}
|
|
175
|
+
}
|
|
178
176
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AuthClass } from './Auth';
|
|
2
1
|
import { AuthConfig, LegacyConfig, LibraryOptions, ResourcesConfig } from './types';
|
|
2
|
+
import { AuthClass } from './Auth';
|
|
3
3
|
import { ADD_OAUTH_LISTENER } from './constants';
|
|
4
4
|
export declare class AmplifyClass {
|
|
5
5
|
private oAuthListener;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AuthClass } from './Auth/index.mjs';
|
|
2
1
|
import { Hub, AMPLIFY_SYMBOL } from '../Hub/index.mjs';
|
|
3
2
|
import { parseAWSExports } from '../parseAWSExports.mjs';
|
|
4
3
|
import '../utils/getClientInfo/getClientInfo.mjs';
|
|
5
4
|
import '../utils/retry/retry.mjs';
|
|
6
5
|
import { deepFreeze } from '../utils/deepFreeze.mjs';
|
|
6
|
+
import { AuthClass } from './Auth/index.mjs';
|
|
7
7
|
import { ADD_OAUTH_LISTENER } from './constants.mjs';
|
|
8
8
|
|
|
9
9
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Amplify.mjs","sources":["../../../src/singleton/Amplify.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport {
|
|
1
|
+
{"version":3,"file":"Amplify.mjs","sources":["../../../src/singleton/Amplify.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AMPLIFY_SYMBOL, Hub } from '../Hub';\nimport { parseAWSExports } from '../parseAWSExports';\nimport { deepFreeze } from '../utils';\nimport { AuthClass } from './Auth';\nimport { ADD_OAUTH_LISTENER } from './constants';\nexport class AmplifyClass {\n constructor() {\n this.oAuthListener = undefined;\n this.resourcesConfig = {};\n this.libraryOptions = {};\n this.Auth = new 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 let resolvedResourceConfig;\n if (Object.keys(resourcesConfig).some(key => key.startsWith('aws_'))) {\n resolvedResourceConfig = parseAWSExports(resourcesConfig);\n }\n else {\n resolvedResourceConfig = resourcesConfig;\n }\n this.resourcesConfig = resolvedResourceConfig;\n if (libraryOptions) {\n this.libraryOptions = libraryOptions;\n }\n // Make resource config immutable\n this.resourcesConfig = deepFreeze(this.resourcesConfig);\n this.Auth.configure(this.resourcesConfig.Auth, this.libraryOptions.Auth);\n Hub.dispatch('core', {\n event: 'configure',\n data: this.resourcesConfig,\n }, 'Configure', AMPLIFY_SYMBOL);\n this.notifyOAuthListener();\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 return this.resourcesConfig;\n }\n /** @internal */\n [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}\n/**\n * The `Amplify` utility is used to configure the library.\n *\n * @remarks\n * `Amplify` is responsible for orchestrating cross-category communication within the library.\n */\nexport const Amplify = new AmplifyClass();\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAMO,MAAM,YAAY,CAAC;AAC1B,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;AACvC,QAAQ,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;AAClC,QAAQ,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;AACjC,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC;AACpC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,eAAe,EAAE,cAAc,EAAE;AAC/C,QAAQ,IAAI,sBAAsB,CAAC;AACnC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE;AAC9E,YAAY,sBAAsB,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC;AACtE,SAAS;AACT,aAAa;AACb,YAAY,sBAAsB,GAAG,eAAe,CAAC;AACrD,SAAS;AACT,QAAQ,IAAI,CAAC,eAAe,GAAG,sBAAsB,CAAC;AACtD,QAAQ,IAAI,cAAc,EAAE;AAC5B,YAAY,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;AACjD,SAAS;AACT;AACA,QAAQ,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAChE,QAAQ,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACjF,QAAQ,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE;AAC7B,YAAY,KAAK,EAAE,WAAW;AAC9B,YAAY,IAAI,EAAE,IAAI,CAAC,eAAe;AACtC,SAAS,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;AACxC,QAAQ,IAAI,CAAC,mBAAmB,EAAE,CAAC;AACnC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,GAAG;AAChB,QAAQ,OAAO,IAAI,CAAC,eAAe,CAAC;AACpC,KAAK;AACL;AACA,IAAI,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;AACnC,QAAQ,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE;AACjE;AACA,YAAY,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACzD,SAAS;AACT,aAAa;AACb;AACA,YAAY,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;AAC1C,SAAS;AACT,KAAK;AACL,IAAI,mBAAmB,GAAG;AAC1B,QAAQ,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK;AAChE,YAAY,CAAC,IAAI,CAAC,aAAa,EAAE;AACjC,YAAY,OAAO;AACnB,SAAS;AACT,QAAQ,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/D;AACA,QAAQ,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;AACvC,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAG,IAAI,YAAY;;;;"}
|
|
@@ -3,7 +3,6 @@ function isTokenExpired({ expiresAt, clockDrift, }) {
|
|
|
3
3
|
return currentTime + clockDrift > expiresAt;
|
|
4
4
|
}
|
|
5
5
|
class AuthClass {
|
|
6
|
-
constructor() { }
|
|
7
6
|
/**
|
|
8
7
|
* Configure Auth category
|
|
9
8
|
*
|
|
@@ -28,11 +27,10 @@ class AuthClass {
|
|
|
28
27
|
* @returns Promise of current auth session {@link AuthSession}.
|
|
29
28
|
*/
|
|
30
29
|
async fetchAuthSession(options = {}) {
|
|
31
|
-
let tokens;
|
|
32
30
|
let credentialsAndIdentityId;
|
|
33
31
|
let userSub;
|
|
34
32
|
// Get tokens will throw if session cannot be refreshed (network or service error) or return null if not available
|
|
35
|
-
tokens = await this.getTokens(options);
|
|
33
|
+
const tokens = await this.getTokens(options);
|
|
36
34
|
if (tokens) {
|
|
37
35
|
userSub = tokens.accessToken?.payload?.sub;
|
|
38
36
|
// getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)
|
|
@@ -61,9 +59,7 @@ class AuthClass {
|
|
|
61
59
|
};
|
|
62
60
|
}
|
|
63
61
|
async clearCredentials() {
|
|
64
|
-
|
|
65
|
-
return await this.authOptions.credentialsProvider.clearCredentialsAndIdentityId();
|
|
66
|
-
}
|
|
62
|
+
await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId();
|
|
67
63
|
}
|
|
68
64
|
async getTokens(options) {
|
|
69
65
|
return ((await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../src/singleton/Auth/index.ts"],"sourcesContent":["export function isTokenExpired({ expiresAt, clockDrift, }) {\n const currentTime = Date.now();\n return currentTime + clockDrift > expiresAt;\n}\nexport class AuthClass {\n
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../src/singleton/Auth/index.ts"],"sourcesContent":["export function isTokenExpired({ expiresAt, clockDrift, }) {\n const currentTime = Date.now();\n return currentTime + clockDrift > expiresAt;\n}\nexport class AuthClass {\n /**\n * Configure Auth category\n *\n * @internal\n *\n * @param authResourcesConfig - Resources configurations required by Auth providers.\n * @param authOptions - Client options used by library\n *\n * @returns void\n */\n configure(authResourcesConfig, authOptions) {\n this.authConfig = authResourcesConfig;\n this.authOptions = authOptions;\n }\n /**\n * Fetch the auth tokens, and the temporary AWS credentials and identity if they are configured. By default it\n * does not refresh the auth tokens or credentials if they are loaded in storage already. You can force a refresh\n * with `{ forceRefresh: true }` input.\n *\n * @param options - Options configuring the fetch behavior.\n *\n * @returns Promise of current auth session {@link AuthSession}.\n */\n async fetchAuthSession(options = {}) {\n let credentialsAndIdentityId;\n let userSub;\n // Get tokens will throw if session cannot be refreshed (network or service error) or return null if not available\n const tokens = await this.getTokens(options);\n if (tokens) {\n userSub = tokens.accessToken?.payload?.sub;\n // getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)\n credentialsAndIdentityId =\n await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({\n authConfig: this.authConfig,\n tokens,\n authenticated: true,\n forceRefresh: options.forceRefresh,\n });\n }\n else {\n // getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)\n credentialsAndIdentityId =\n await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({\n authConfig: this.authConfig,\n authenticated: false,\n forceRefresh: options.forceRefresh,\n });\n }\n return {\n tokens,\n credentials: credentialsAndIdentityId?.credentials,\n identityId: credentialsAndIdentityId?.identityId,\n userSub,\n };\n }\n async clearCredentials() {\n await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId();\n }\n async getTokens(options) {\n return ((await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined);\n }\n}\n"],"names":[],"mappings":"AAAO,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,UAAU,GAAG,EAAE;AAC3D,IAAI,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACnC,IAAI,OAAO,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAChD,CAAC;AACM,MAAM,SAAS,CAAC;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,mBAAmB,EAAE,WAAW,EAAE;AAChD,QAAQ,IAAI,CAAC,UAAU,GAAG,mBAAmB,CAAC;AAC9C,QAAQ,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;AACvC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,gBAAgB,CAAC,OAAO,GAAG,EAAE,EAAE;AACzC,QAAQ,IAAI,wBAAwB,CAAC;AACrC,QAAQ,IAAI,OAAO,CAAC;AACpB;AACA,QAAQ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACrD,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;AACvD;AACA,YAAY,wBAAwB;AACpC,gBAAgB,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;AACzF,oBAAoB,UAAU,EAAE,IAAI,CAAC,UAAU;AAC/C,oBAAoB,MAAM;AAC1B,oBAAoB,aAAa,EAAE,IAAI;AACvC,oBAAoB,YAAY,EAAE,OAAO,CAAC,YAAY;AACtD,iBAAiB,CAAC,CAAC;AACnB,SAAS;AACT,aAAa;AACb;AACA,YAAY,wBAAwB;AACpC,gBAAgB,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;AACzF,oBAAoB,UAAU,EAAE,IAAI,CAAC,UAAU;AAC/C,oBAAoB,aAAa,EAAE,KAAK;AACxC,oBAAoB,YAAY,EAAE,OAAO,CAAC,YAAY;AACtD,iBAAiB,CAAC,CAAC;AACnB,SAAS;AACT,QAAQ,OAAO;AACf,YAAY,MAAM;AAClB,YAAY,WAAW,EAAE,wBAAwB,EAAE,WAAW;AAC9D,YAAY,UAAU,EAAE,wBAAwB,EAAE,UAAU;AAC5D,YAAY,OAAO;AACnB,SAAS,CAAC;AACV,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,CAAC;AACrF,KAAK;AACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;AAC7B,QAAQ,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE;AAC1F,KAAK;AACL;;;;"}
|
|
@@ -9,48 +9,49 @@ interface JwtPayloadStandardFields {
|
|
|
9
9
|
jti?: string;
|
|
10
10
|
sub?: string;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type JsonPrimitive = null | string | number | boolean;
|
|
13
|
+
/** JSON array type */
|
|
14
|
+
type JsonArray = JsonPrimitive[];
|
|
14
15
|
/** JSON Object type */
|
|
15
|
-
|
|
16
|
-
[
|
|
17
|
-
}
|
|
16
|
+
interface JsonObject {
|
|
17
|
+
[x: string]: JsonPrimitive | JsonArray | JsonObject;
|
|
18
|
+
}
|
|
18
19
|
export type JwtPayload = JwtPayloadStandardFields & JsonObject;
|
|
19
|
-
export
|
|
20
|
+
export interface JWT {
|
|
20
21
|
payload: JwtPayload;
|
|
21
|
-
toString
|
|
22
|
-
}
|
|
22
|
+
toString(): string;
|
|
23
|
+
}
|
|
23
24
|
export type JWTCreator = (stringJWT: string) => JWT;
|
|
24
|
-
export
|
|
25
|
+
export interface AuthSession {
|
|
25
26
|
tokens?: AuthTokens;
|
|
26
27
|
credentials?: AWSCredentials;
|
|
27
28
|
identityId?: string;
|
|
28
29
|
userSub?: string;
|
|
29
|
-
}
|
|
30
|
-
export
|
|
30
|
+
}
|
|
31
|
+
export interface LibraryAuthOptions {
|
|
31
32
|
tokenProvider?: TokenProvider;
|
|
32
33
|
credentialsProvider?: CredentialsAndIdentityIdProvider;
|
|
33
|
-
}
|
|
34
|
-
export
|
|
34
|
+
}
|
|
35
|
+
export interface Identity {
|
|
35
36
|
id: string;
|
|
36
37
|
type: 'guest' | 'primary';
|
|
37
|
-
}
|
|
38
|
+
}
|
|
38
39
|
export interface CredentialsAndIdentityIdProvider {
|
|
39
|
-
getCredentialsAndIdentityId
|
|
40
|
-
clearCredentialsAndIdentityId
|
|
40
|
+
getCredentialsAndIdentityId(getCredentialsOptions: GetCredentialsOptions): Promise<CredentialsAndIdentityId | undefined>;
|
|
41
|
+
clearCredentialsAndIdentityId(): void;
|
|
41
42
|
}
|
|
42
|
-
export
|
|
43
|
-
getTokens
|
|
43
|
+
export interface TokenProvider {
|
|
44
|
+
getTokens({ forceRefresh, }?: {
|
|
44
45
|
forceRefresh?: boolean;
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
export
|
|
46
|
+
}): Promise<AuthTokens | null>;
|
|
47
|
+
}
|
|
48
|
+
export interface FetchAuthSessionOptions {
|
|
48
49
|
forceRefresh?: boolean;
|
|
49
|
-
}
|
|
50
|
-
export
|
|
50
|
+
}
|
|
51
|
+
export interface AuthTokens {
|
|
51
52
|
idToken?: JWT;
|
|
52
53
|
accessToken: JWT;
|
|
53
|
-
}
|
|
54
|
+
}
|
|
54
55
|
export type AuthStandardAttributeKey = 'address' | 'birthdate' | 'email_verified' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number_verified' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo' | AuthVerifiableAttributeKey;
|
|
55
56
|
export type LegacyUserAttributeKey = Uppercase<AuthStandardAttributeKey>;
|
|
56
57
|
export type AuthVerifiableAttributeKey = 'email' | 'phone_number';
|
|
@@ -62,7 +63,7 @@ export type CognitoProviderConfig = StrictUnion<AuthIdentityPoolConfig | AuthUse
|
|
|
62
63
|
type UnionKeys<T> = T extends T ? keyof T : never;
|
|
63
64
|
type StrictUnionHelper<T, TAll> = T extends any ? T & Partial<Record<Exclude<UnionKeys<TAll>, keyof T>, never>> : never;
|
|
64
65
|
export type StrictUnion<T> = StrictUnionHelper<T, T>;
|
|
65
|
-
export
|
|
66
|
+
export interface AuthIdentityPoolConfig {
|
|
66
67
|
Cognito: CognitoIdentityPoolConfig & {
|
|
67
68
|
userPoolClientId?: never;
|
|
68
69
|
userPoolId?: never;
|
|
@@ -73,18 +74,18 @@ export type AuthIdentityPoolConfig = {
|
|
|
73
74
|
mfa?: never;
|
|
74
75
|
passwordFormat?: never;
|
|
75
76
|
};
|
|
76
|
-
}
|
|
77
|
-
export
|
|
77
|
+
}
|
|
78
|
+
export interface CognitoIdentityPoolConfig {
|
|
78
79
|
identityPoolId: string;
|
|
79
80
|
allowGuestAccess?: boolean;
|
|
80
|
-
}
|
|
81
|
-
export
|
|
81
|
+
}
|
|
82
|
+
export interface AuthUserPoolConfig {
|
|
82
83
|
Cognito: CognitoUserPoolConfig & {
|
|
83
84
|
identityPoolId?: never;
|
|
84
85
|
allowGuestAccess?: never;
|
|
85
86
|
};
|
|
86
|
-
}
|
|
87
|
-
export
|
|
87
|
+
}
|
|
88
|
+
export interface CognitoUserPoolConfig {
|
|
88
89
|
userPoolClientId: string;
|
|
89
90
|
userPoolId: string;
|
|
90
91
|
userPoolEndpoint?: string;
|
|
@@ -108,51 +109,51 @@ export type CognitoUserPoolConfig = {
|
|
|
108
109
|
requireNumbers?: boolean;
|
|
109
110
|
requireSpecialCharacters?: boolean;
|
|
110
111
|
};
|
|
111
|
-
}
|
|
112
|
-
export
|
|
112
|
+
}
|
|
113
|
+
export interface OAuthConfig {
|
|
113
114
|
domain: string;
|
|
114
|
-
scopes:
|
|
115
|
-
redirectSignIn:
|
|
116
|
-
redirectSignOut:
|
|
115
|
+
scopes: OAuthScope[];
|
|
116
|
+
redirectSignIn: string[];
|
|
117
|
+
redirectSignOut: string[];
|
|
117
118
|
responseType: 'code' | 'token';
|
|
118
|
-
providers?:
|
|
119
|
-
}
|
|
119
|
+
providers?: (OAuthProvider | CustomProvider)[];
|
|
120
|
+
}
|
|
120
121
|
export type OAuthProvider = 'Google' | 'Facebook' | 'Amazon' | 'Apple';
|
|
121
|
-
|
|
122
|
+
interface CustomProvider {
|
|
122
123
|
custom: string;
|
|
123
|
-
}
|
|
124
|
-
type CustomScope = string &
|
|
125
|
-
type OAuthScope = 'email' | 'openid' | 'phone' | 'email' | 'profile' | 'aws.cognito.signin.user.admin' | CustomScope;
|
|
124
|
+
}
|
|
125
|
+
type CustomScope = string & NonNullable<unknown>;
|
|
126
|
+
export type OAuthScope = 'email' | 'openid' | 'phone' | 'email' | 'profile' | 'aws.cognito.signin.user.admin' | CustomScope;
|
|
126
127
|
export type CognitoUserPoolWithOAuthConfig = CognitoUserPoolConfig & {
|
|
127
128
|
loginWith: {
|
|
128
129
|
oauth: OAuthConfig;
|
|
129
130
|
};
|
|
130
131
|
};
|
|
131
|
-
export
|
|
132
|
+
export interface AuthUserPoolAndIdentityPoolConfig {
|
|
132
133
|
Cognito: CognitoUserPoolAndIdentityPoolConfig;
|
|
133
|
-
}
|
|
134
|
+
}
|
|
134
135
|
export type CognitoUserPoolAndIdentityPoolConfig = CognitoUserPoolConfig & CognitoIdentityPoolConfig;
|
|
135
136
|
export type GetCredentialsOptions = GetCredentialsAuthenticatedUser | GetCredentialsUnauthenticatedUser;
|
|
136
|
-
|
|
137
|
+
interface GetCredentialsAuthenticatedUser {
|
|
137
138
|
authenticated: true;
|
|
138
139
|
forceRefresh?: boolean;
|
|
139
140
|
authConfig: AuthConfig | undefined;
|
|
140
141
|
tokens: AuthTokens;
|
|
141
|
-
}
|
|
142
|
-
|
|
142
|
+
}
|
|
143
|
+
interface GetCredentialsUnauthenticatedUser {
|
|
143
144
|
authenticated: false;
|
|
144
145
|
forceRefresh?: boolean;
|
|
145
146
|
authConfig: AuthConfig | undefined;
|
|
146
147
|
tokens?: never;
|
|
147
|
-
}
|
|
148
|
-
export
|
|
148
|
+
}
|
|
149
|
+
export interface CredentialsAndIdentityId {
|
|
149
150
|
credentials: AWSCredentials;
|
|
150
151
|
identityId?: string;
|
|
151
|
-
}
|
|
152
|
-
export
|
|
152
|
+
}
|
|
153
|
+
export interface AWSCredentials {
|
|
153
154
|
accessKeyId: string;
|
|
154
155
|
secretAccessKey: string;
|
|
155
156
|
sessionToken?: string;
|
|
156
157
|
expiration?: Date;
|
|
157
|
-
}
|
|
158
|
+
}
|
|
158
159
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthConfig,
|
|
1
|
+
import { AuthConfig, CognitoIdentityPoolConfig, CognitoUserPoolAndIdentityPoolConfig, CognitoUserPoolConfig, JWT, OAuthConfig, StrictUnion } from '../types';
|
|
2
2
|
export declare function assertTokenProviderConfig(cognitoConfig?: StrictUnion<CognitoUserPoolConfig | CognitoUserPoolAndIdentityPoolConfig | CognitoIdentityPoolConfig>): asserts cognitoConfig is CognitoUserPoolAndIdentityPoolConfig | CognitoUserPoolConfig;
|
|
3
3
|
export declare function assertOAuthConfig(cognitoConfig?: AuthConfig['Cognito']): asserts cognitoConfig is AuthConfig['Cognito'] & {
|
|
4
4
|
loginWith: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { assert, AuthConfigurationErrorCode } from './errorHelpers.mjs';
|
|
2
1
|
import { base64Decoder } from '../../../utils/convert/base64/base64Decoder.mjs';
|
|
3
2
|
import '../../../types/errors.mjs';
|
|
4
3
|
import '../../../errors/errorHelpers.mjs';
|
|
4
|
+
import { assert, AuthConfigurationErrorCode } from './errorHelpers.mjs';
|
|
5
5
|
|
|
6
6
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
7
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -14,18 +14,18 @@ function assertTokenProviderConfig(cognitoConfig) {
|
|
|
14
14
|
assertionValid =
|
|
15
15
|
!!cognitoConfig.userPoolId && !!cognitoConfig.userPoolClientId;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
assert(assertionValid, AuthConfigurationErrorCode.AuthUserPoolException);
|
|
18
18
|
}
|
|
19
19
|
function assertOAuthConfig(cognitoConfig) {
|
|
20
20
|
const validOAuthConfig = !!cognitoConfig?.loginWith?.oauth?.domain &&
|
|
21
21
|
!!cognitoConfig?.loginWith?.oauth?.redirectSignOut &&
|
|
22
22
|
!!cognitoConfig?.loginWith?.oauth?.redirectSignIn &&
|
|
23
23
|
!!cognitoConfig?.loginWith?.oauth?.responseType;
|
|
24
|
-
|
|
24
|
+
assert(validOAuthConfig, AuthConfigurationErrorCode.OAuthNotConfigureException);
|
|
25
25
|
}
|
|
26
26
|
function assertIdentityPoolIdConfig(cognitoConfig) {
|
|
27
27
|
const validConfig = !!cognitoConfig?.identityPoolId;
|
|
28
|
-
|
|
28
|
+
assert(validConfig, AuthConfigurationErrorCode.InvalidIdentityPoolIdException);
|
|
29
29
|
}
|
|
30
30
|
function decodeJWT(token) {
|
|
31
31
|
const tokenParts = token.split('.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../src/singleton/Auth/utils/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../src/singleton/Auth/utils/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { base64Decoder } from '../../../utils/convert';\nimport { AuthConfigurationErrorCode, assert } from './errorHelpers';\nexport function assertTokenProviderConfig(cognitoConfig) {\n let assertionValid = true; // assume valid until otherwise proveed\n if (!cognitoConfig) {\n assertionValid = false;\n }\n else {\n assertionValid =\n !!cognitoConfig.userPoolId && !!cognitoConfig.userPoolClientId;\n }\n assert(assertionValid, AuthConfigurationErrorCode.AuthUserPoolException);\n}\nexport function assertOAuthConfig(cognitoConfig) {\n const validOAuthConfig = !!cognitoConfig?.loginWith?.oauth?.domain &&\n !!cognitoConfig?.loginWith?.oauth?.redirectSignOut &&\n !!cognitoConfig?.loginWith?.oauth?.redirectSignIn &&\n !!cognitoConfig?.loginWith?.oauth?.responseType;\n assert(validOAuthConfig, AuthConfigurationErrorCode.OAuthNotConfigureException);\n}\nexport function assertIdentityPoolIdConfig(cognitoConfig) {\n const validConfig = !!cognitoConfig?.identityPoolId;\n assert(validConfig, AuthConfigurationErrorCode.InvalidIdentityPoolIdException);\n}\nexport function decodeJWT(token) {\n const tokenParts = token.split('.');\n if (tokenParts.length !== 3) {\n throw new Error('Invalid token');\n }\n try {\n const base64WithUrlSafe = tokenParts[1];\n const base64 = base64WithUrlSafe.replace(/-/g, '+').replace(/_/g, '/');\n const jsonStr = decodeURIComponent(base64Decoder\n .convert(base64)\n .split('')\n .map(char => `%${`00${char.charCodeAt(0).toString(16)}`.slice(-2)}`)\n .join(''));\n const payload = JSON.parse(jsonStr);\n return {\n toString: () => token,\n payload,\n };\n }\n catch (err) {\n throw new Error('Invalid token payload');\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAGO,SAAS,yBAAyB,CAAC,aAAa,EAAE;AACzD,IAAI,IAAI,cAAc,GAAG,IAAI,CAAC;AAC9B,IAAI,IAAI,CAAC,aAAa,EAAE;AACxB,QAAQ,cAAc,GAAG,KAAK,CAAC;AAC/B,KAAK;AACL,SAAS;AACT,QAAQ,cAAc;AACtB,YAAY,CAAC,CAAC,aAAa,CAAC,UAAU,IAAI,CAAC,CAAC,aAAa,CAAC,gBAAgB,CAAC;AAC3E,KAAK;AACL,IAAI,MAAM,CAAC,cAAc,EAAE,0BAA0B,CAAC,qBAAqB,CAAC,CAAC;AAC7E,CAAC;AACM,SAAS,iBAAiB,CAAC,aAAa,EAAE;AACjD,IAAI,MAAM,gBAAgB,GAAG,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM;AACtE,QAAQ,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe;AAC1D,QAAQ,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc;AACzD,QAAQ,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,CAAC;AACxD,IAAI,MAAM,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,0BAA0B,CAAC,CAAC;AACpF,CAAC;AACM,SAAS,0BAA0B,CAAC,aAAa,EAAE;AAC1D,IAAI,MAAM,WAAW,GAAG,CAAC,CAAC,aAAa,EAAE,cAAc,CAAC;AACxD,IAAI,MAAM,CAAC,WAAW,EAAE,0BAA0B,CAAC,8BAA8B,CAAC,CAAC;AACnF,CAAC;AACM,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACxC,IAAI,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;AACjC,QAAQ,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;AACzC,KAAK;AACL,IAAI,IAAI;AACR,QAAQ,MAAM,iBAAiB,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAChD,QAAQ,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC/E,QAAQ,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa;AACxD,aAAa,OAAO,CAAC,MAAM,CAAC;AAC5B,aAAa,KAAK,CAAC,EAAE,CAAC;AACtB,aAAa,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,aAAa,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACvB,QAAQ,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC5C,QAAQ,OAAO;AACf,YAAY,QAAQ,EAAE,MAAM,KAAK;AACjC,YAAY,OAAO;AACnB,SAAS,CAAC;AACV,KAAK;AACL,IAAI,OAAO,GAAG,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;AACjD,KAAK;AACL;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AtLeastOne } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export interface LocationServiceConfig {
|
|
3
3
|
LocationService: {
|
|
4
4
|
region: string;
|
|
5
5
|
maps?: {
|
|
6
|
-
items:
|
|
6
|
+
items: Record<string, unknown>;
|
|
7
7
|
default: string;
|
|
8
8
|
};
|
|
9
9
|
searchIndices?: {
|
|
@@ -15,5 +15,5 @@ export type LocationServiceConfig = {
|
|
|
15
15
|
default: string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
}
|
|
18
|
+
}
|
|
19
19
|
export type GeoConfig = AtLeastOne<LocationServiceConfig>;
|
|
@@ -9,11 +9,11 @@ interface LexV2BotConfig {
|
|
|
9
9
|
localeId: string;
|
|
10
10
|
region: string;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interface InteractionsLexV1Config {
|
|
13
13
|
LexV1: Record<string, LexV1BotConfig>;
|
|
14
|
-
}
|
|
15
|
-
|
|
14
|
+
}
|
|
15
|
+
interface InteractionsLexV2Config {
|
|
16
16
|
LexV2: Record<string, LexV2BotConfig>;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
export type InteractionsConfig = AtLeastOne<InteractionsLexV1Config & InteractionsLexV2Config>;
|
|
19
19
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { AtLeastOne } from '../types';
|
|
1
2
|
import { InAppMessagingConfig } from './InAppMessaging/types';
|
|
2
3
|
import { PushNotificationConfig } from './PushNotification/types';
|
|
3
|
-
|
|
4
|
-
export type InAppMessagingProviderConfig = {
|
|
4
|
+
export interface InAppMessagingProviderConfig {
|
|
5
5
|
InAppMessaging: InAppMessagingConfig;
|
|
6
|
-
}
|
|
7
|
-
export
|
|
6
|
+
}
|
|
7
|
+
export interface PushNotificationProviderConfig {
|
|
8
8
|
PushNotification: PushNotificationConfig;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
export type NotificationsConfig = AtLeastOne<InAppMessagingProviderConfig & PushNotificationProviderConfig>;
|