@aws-amplify/core 6.0.17-unstable.e316a2e.0 → 6.0.17
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 +7 -7
- package/dist/cjs/Logger/ConsoleLogger.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 +7 -7
- package/dist/esm/Logger/ConsoleLogger.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/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 +11 -9
- package/src/Logger/types.ts +1 -1
- 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/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 +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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|
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;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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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,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>;
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
import { AtLeastOne } from '../types';
|
|
2
|
-
|
|
2
|
+
interface SpeechGeneratorDefaults {
|
|
3
3
|
voiceId?: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
interface TranscriptionDefaults {
|
|
6
6
|
language?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
7
|
+
}
|
|
8
|
+
interface TranslateTextDefaults {
|
|
9
9
|
sourceLanguage?: string;
|
|
10
10
|
targetLanguage?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
11
|
+
}
|
|
12
|
+
interface IdentifyEntitiesDefaults {
|
|
13
13
|
collectionId?: string;
|
|
14
14
|
maxEntities?: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
15
|
+
}
|
|
16
|
+
interface IdentityLabelsDefaults {
|
|
17
17
|
type?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
18
|
+
}
|
|
19
|
+
interface IdentifyTextDefaults {
|
|
20
20
|
format?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
21
|
+
}
|
|
22
|
+
interface InterpretTextDefaults {
|
|
23
23
|
type?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
24
|
+
}
|
|
25
|
+
interface ConvertConfig {
|
|
26
26
|
speechGenerator?: PredictionsProviderConfig<SpeechGeneratorDefaults>;
|
|
27
27
|
transcription?: PredictionsProviderConfig<TranscriptionDefaults>;
|
|
28
28
|
translateText?: PredictionsProviderConfig<TranslateTextDefaults>;
|
|
29
|
-
}
|
|
30
|
-
|
|
29
|
+
}
|
|
30
|
+
interface IdentifyConfig {
|
|
31
31
|
identifyEntities?: PredictionsProviderConfig<IdentifyEntitiesDefaults> & {
|
|
32
32
|
celebrityDetectionEnabled?: boolean;
|
|
33
33
|
};
|
|
34
34
|
identifyLabels?: PredictionsProviderConfig<IdentityLabelsDefaults>;
|
|
35
35
|
identifyText?: PredictionsProviderConfig<IdentifyTextDefaults>;
|
|
36
|
-
}
|
|
37
|
-
|
|
36
|
+
}
|
|
37
|
+
interface InterpretConfig {
|
|
38
38
|
interpretText?: PredictionsProviderConfig<InterpretTextDefaults>;
|
|
39
|
-
}
|
|
40
|
-
export
|
|
39
|
+
}
|
|
40
|
+
export interface PredictionsProviderConfig<T> {
|
|
41
41
|
region?: string;
|
|
42
42
|
proxy?: boolean;
|
|
43
43
|
defaults?: T;
|
|
44
|
-
}
|
|
45
|
-
export
|
|
44
|
+
}
|
|
45
|
+
export interface PredictionsConvertConfig {
|
|
46
46
|
convert: ConvertConfig;
|
|
47
|
-
}
|
|
48
|
-
export
|
|
47
|
+
}
|
|
48
|
+
export interface PredictionsIdentifyConfig {
|
|
49
49
|
identify: IdentifyConfig;
|
|
50
|
-
}
|
|
51
|
-
export
|
|
50
|
+
}
|
|
51
|
+
export interface PredictionsInterpretConfig {
|
|
52
52
|
interpret: InterpretConfig;
|
|
53
|
-
}
|
|
53
|
+
}
|
|
54
54
|
export type PredictionsConfig = AtLeastOne<PredictionsConvertConfig & PredictionsIdentifyConfig & PredictionsInterpretConfig>;
|
|
55
55
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AtLeastOne } from '../types';
|
|
2
2
|
export type StorageAccessLevel = 'guest' | 'protected' | 'private';
|
|
3
|
-
export
|
|
3
|
+
export interface S3ProviderConfig {
|
|
4
4
|
S3: {
|
|
5
5
|
bucket?: string;
|
|
6
6
|
region?: string;
|
|
@@ -11,7 +11,7 @@ export type S3ProviderConfig = {
|
|
|
11
11
|
*/
|
|
12
12
|
dangerouslyConnectToHttpEndpointForTesting?: string;
|
|
13
13
|
};
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
export type StorageConfig = AtLeastOne<S3ProviderConfig>;
|
|
16
16
|
type StoragePrefixResolver = (params: {
|
|
17
17
|
accessLevel: StorageAccessLevel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { fetchAuthSession as fetchAuthSession$1 } from './internal/fetchAuthSession.mjs';
|
|
2
1
|
import { Amplify } from '../Amplify.mjs';
|
|
2
|
+
import { fetchAuthSession as fetchAuthSession$1 } from './internal/fetchAuthSession.mjs';
|
|
3
3
|
|
|
4
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAuthSession.mjs","sources":["../../../../src/singleton/apis/fetchAuthSession.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport {
|
|
1
|
+
{"version":3,"file":"fetchAuthSession.mjs","sources":["../../../../src/singleton/apis/fetchAuthSession.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '../Amplify';\nimport { fetchAuthSession as fetchAuthSessionInternal } from './internal/fetchAuthSession';\nexport const fetchAuthSession = (options) => {\n return fetchAuthSessionInternal(Amplify, options);\n};\n"],"names":["fetchAuthSessionInternal"],"mappings":";;;AAAA;AACA;AAGY,MAAC,gBAAgB,GAAG,CAAC,OAAO,KAAK;AAC7C,IAAI,OAAOA,kBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACtD;;;;"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { APIConfig,
|
|
1
|
+
import { APIConfig, GraphQLProviderConfig, LibraryAPIOptions } from './API/types';
|
|
2
2
|
import { AnalyticsConfig } from './Analytics/types';
|
|
3
|
-
import { AuthConfig,
|
|
3
|
+
import { AuthConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, AuthUserPoolConfig, CognitoIdentityPoolConfig, GetCredentialsOptions, LibraryAuthOptions } from './Auth/types';
|
|
4
4
|
import { GeoConfig } from './Geo/types';
|
|
5
5
|
import { PredictionsConfig } from './Predictions/types';
|
|
6
6
|
import { LibraryStorageOptions, StorageAccessLevel, StorageConfig } from './Storage/types';
|
|
7
7
|
import { NotificationsConfig } from './Notifications/types';
|
|
8
8
|
import { InteractionsConfig } from './Interactions/types';
|
|
9
|
-
export
|
|
9
|
+
export interface LegacyConfig {
|
|
10
10
|
/**
|
|
11
11
|
* @deprecated The field should not be used.
|
|
12
12
|
*/
|
|
13
13
|
aws_project_region?: string;
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
export type AtLeastOne<T, U = {
|
|
16
16
|
[K in keyof T]: Pick<T, K>;
|
|
17
17
|
}> = Partial<T> & U[keyof U];
|
|
18
|
-
export
|
|
18
|
+
export interface ResourcesConfig {
|
|
19
19
|
API?: APIConfig;
|
|
20
20
|
Analytics?: AnalyticsConfig;
|
|
21
21
|
Auth?: AuthConfig;
|
|
@@ -24,11 +24,11 @@ export type ResourcesConfig = {
|
|
|
24
24
|
Predictions?: PredictionsConfig;
|
|
25
25
|
Storage?: StorageConfig;
|
|
26
26
|
Geo?: GeoConfig;
|
|
27
|
-
}
|
|
28
|
-
export
|
|
27
|
+
}
|
|
28
|
+
export interface LibraryOptions {
|
|
29
29
|
API?: LibraryAPIOptions;
|
|
30
30
|
Auth?: LibraryAuthOptions;
|
|
31
31
|
Storage?: LibraryStorageOptions;
|
|
32
32
|
ssr?: boolean;
|
|
33
|
-
}
|
|
33
|
+
}
|
|
34
34
|
export { APIConfig, AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, GraphQLProviderConfig, InteractionsConfig, PredictionsConfig, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, GeoConfig, };
|
|
@@ -6,10 +6,14 @@ class CookieStorage {
|
|
|
6
6
|
constructor(data = {}) {
|
|
7
7
|
const { path, domain, expires, sameSite, secure } = data;
|
|
8
8
|
this.domain = domain;
|
|
9
|
-
this.path = path
|
|
10
|
-
this.expires =
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
this.path = path || '/';
|
|
10
|
+
this.expires = Object.prototype.hasOwnProperty.call(data, 'expires')
|
|
11
|
+
? expires
|
|
12
|
+
: 365;
|
|
13
|
+
this.secure = Object.prototype.hasOwnProperty.call(data, 'secure')
|
|
14
|
+
? secure
|
|
15
|
+
: true;
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(data, 'sameSite')) {
|
|
13
17
|
if (!sameSite || !['strict', 'lax', 'none'].includes(sameSite)) {
|
|
14
18
|
throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');
|
|
15
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CookieStorage.mjs","sources":["../../../src/storage/CookieStorage.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport JsCookie from 'js-cookie';\nexport class CookieStorage {\n constructor(data = {}) {\n const { path, domain, expires, sameSite, secure } = data;\n this.domain = domain;\n this.path = path
|
|
1
|
+
{"version":3,"file":"CookieStorage.mjs","sources":["../../../src/storage/CookieStorage.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport JsCookie from 'js-cookie';\nexport class CookieStorage {\n constructor(data = {}) {\n const { path, domain, expires, sameSite, secure } = data;\n this.domain = domain;\n this.path = path || '/';\n this.expires = Object.prototype.hasOwnProperty.call(data, 'expires')\n ? expires\n : 365;\n this.secure = Object.prototype.hasOwnProperty.call(data, 'secure')\n ? secure\n : true;\n if (Object.prototype.hasOwnProperty.call(data, 'sameSite')) {\n if (!sameSite || !['strict', 'lax', 'none'].includes(sameSite)) {\n throw new Error('The sameSite value of cookieStorage must be \"lax\", \"strict\" or \"none\".');\n }\n if (sameSite === 'none' && !this.secure) {\n throw new Error('sameSite = None requires the Secure attribute in latest browser versions.');\n }\n this.sameSite = sameSite;\n }\n }\n async setItem(key, value) {\n JsCookie.set(key, value, this.getData());\n }\n async getItem(key) {\n const item = JsCookie.get(key);\n return item ?? null;\n }\n async removeItem(key) {\n JsCookie.remove(key, this.getData());\n }\n async clear() {\n const cookie = JsCookie.get();\n const promises = Object.keys(cookie).map(key => this.removeItem(key));\n await Promise.all(promises);\n }\n getData() {\n return {\n path: this.path,\n expires: this.expires,\n domain: this.domain,\n secure: this.secure,\n ...(this.sameSite && { sameSite: this.sameSite }),\n };\n }\n}\n"],"names":[],"mappings":";;AAAA;AACA;AAEO,MAAM,aAAa,CAAC;AAC3B,IAAI,WAAW,CAAC,IAAI,GAAG,EAAE,EAAE;AAC3B,QAAQ,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;AACjE,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AAC7B,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,GAAG,CAAC;AAChC,QAAQ,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;AAC5E,cAAc,OAAO;AACrB,cAAc,GAAG,CAAC;AAClB,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AAC1E,cAAc,MAAM;AACpB,cAAc,IAAI,CAAC;A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9E,QAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACpC,KAAK;AACL,IAAI,OAAO,GAAG;AACd,QAAQ,OAAO;AACf,YAAY,IAAI,EAAE,IAAI,CAAC,IAAI;AAC3B,YAAY,OAAO,EAAE,IAAI,CAAC,OAAO;AACjC,YAAY,MAAM,EAAE,IAAI,CAAC,MAAM;AAC/B,YAAY,MAAM,EAAE,IAAI,CAAC,MAAM;AAC/B,YAAY,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;AAC5D,SAAS,CAAC;AACV,KAAK;AACL;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CookieStorage.native.mjs","sources":["../../../src/storage/CookieStorage.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { KeyValueStorage } from './KeyValueStorage';\n/**\n * @internal\n */\nexport class CookieStorage extends KeyValueStorage {\n
|
|
1
|
+
{"version":3,"file":"CookieStorage.native.mjs","sources":["../../../src/storage/CookieStorage.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { KeyValueStorage } from './KeyValueStorage';\n/**\n * @internal\n */\nexport class CookieStorage extends KeyValueStorage {\n}\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACO,MAAM,aAAa,SAAS,eAAe,CAAC;AACnD;;;;"}
|
package/dist/esm/types/core.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface AmplifyConfig {
|
|
|
11
11
|
};
|
|
12
12
|
ssr?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export interface UserProfile {
|
|
15
15
|
customProperties?: Record<string, string[]>;
|
|
16
16
|
demographic?: {
|
|
17
17
|
appVersion?: string;
|
|
@@ -35,7 +35,7 @@ export type UserProfile = {
|
|
|
35
35
|
metrics?: Record<string, number>;
|
|
36
36
|
name?: string;
|
|
37
37
|
plan?: string;
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
39
|
/**
|
|
40
40
|
* @internal
|
|
41
41
|
*/
|