@aws-amplify/core 5.8.6-api-v6-models.b3abc9b.0 → 6.0.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/README.md +3 -0
- package/internals/adapter-core/package.json +8 -0
- package/internals/aws-clients/pinpoint/package.json +4 -4
- package/internals/providers/pinpoint/package.json +8 -0
- package/internals/utils/package.json +7 -0
- package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
- package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.js +11 -0
- package/lib/BackgroundProcessManager/BackgroundProcessManager.d.ts +182 -0
- package/lib/BackgroundProcessManager/BackgroundProcessManager.js +287 -0
- package/lib/BackgroundProcessManager/index.d.ts +1 -0
- package/lib/BackgroundProcessManager/index.js +7 -0
- package/lib/BackgroundProcessManager/types.d.ts +41 -0
- package/lib/BackgroundProcessManager/types.js +23 -0
- package/lib/Cache/StorageCache.d.ts +22 -0
- package/lib/Cache/StorageCache.js +56 -0
- package/lib/Cache/StorageCache.native.d.ts +19 -0
- package/lib/Cache/StorageCache.native.js +62 -0
- package/lib/Cache/StorageCacheCommon.d.ts +179 -0
- package/lib/Cache/StorageCacheCommon.js +468 -0
- package/lib/Cache/constants.d.ts +6 -0
- package/lib/Cache/constants.js +17 -0
- package/lib/Cache/index.d.ts +2 -0
- package/lib/Cache/index.js +7 -0
- package/lib/Cache/types/cache.d.ts +38 -0
- package/lib/Cache/types/index.d.ts +1 -0
- package/lib/Cache/types/index.js +19 -0
- package/lib/Cache/utils/CacheList.d.ts +89 -0
- package/lib/Cache/utils/CacheList.js +160 -0
- package/lib/Cache/utils/cacheHelpers.d.ts +14 -0
- package/lib/Cache/utils/cacheHelpers.js +49 -0
- package/lib/Cache/utils/errorHelpers.d.ts +7 -0
- package/lib/Cache/utils/errorHelpers.js +24 -0
- package/lib/Cache/utils/index.d.ts +2 -0
- package/lib/Cache/utils/index.js +12 -0
- package/lib/Hub/index.d.ts +46 -0
- package/lib/Hub/index.js +118 -0
- package/lib/Hub/types/AuthTypes.d.ts +36 -0
- package/lib/Hub/types/AuthTypes.js +4 -0
- package/lib/Hub/types/HubTypes.d.ts +28 -0
- package/lib/Hub/types/HubTypes.js +4 -0
- package/lib/Hub/types/index.d.ts +2 -0
- package/lib/Hub/types/index.js +20 -0
- package/lib/I18n/I18n.d.ts +14 -10
- package/lib/I18n/I18n.js +29 -40
- package/lib/I18n/errorHelpers.d.ts +5 -0
- package/lib/I18n/errorHelpers.js +16 -0
- package/lib/I18n/index.d.ts +6 -5
- package/lib/I18n/index.js +32 -30
- package/lib/I18n/types.d.ts +2 -2
- package/lib/I18n/types.js +5 -6
- package/lib/Logger/ConsoleLogger.d.ts +11 -11
- package/lib/Logger/ConsoleLogger.js +54 -130
- package/lib/Mutex/Mutex.d.ts +32 -0
- package/lib/Mutex/Mutex.js +70 -0
- package/lib/Mutex/index.d.ts +1 -0
- package/lib/Mutex/index.js +7 -0
- package/lib/Mutex/types.d.ts +13 -0
- package/lib/Mutex/types.js +4 -0
- package/lib/Platform/customUserAgent.d.ts +16 -0
- package/lib/Platform/customUserAgent.js +57 -0
- package/lib/Platform/detectFramework.js +12 -12
- package/lib/Platform/detection/Angular.js +4 -5
- package/lib/Platform/detection/Expo.js +1 -1
- package/lib/Platform/detection/Next.d.ts +1 -1
- package/lib/Platform/detection/Next.js +1 -1
- package/lib/Platform/detection/Nuxt.js +1 -1
- package/lib/Platform/detection/React.js +6 -5
- package/lib/Platform/detection/Svelte.js +2 -2
- package/lib/Platform/detection/Vue.js +1 -1
- package/lib/Platform/detection/Web.js +1 -1
- package/lib/Platform/detection/helpers.js +7 -7
- package/lib/Platform/detection/index.js +13 -13
- package/lib/Platform/index.js +32 -52
- package/lib/Platform/types.d.ts +75 -8
- package/lib/Platform/types.js +40 -39
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/Reachability/Reachability.d.ts +7 -0
- package/lib/Reachability/Reachability.js +42 -0
- package/lib/Reachability/Reachability.native.d.ts +6 -0
- package/lib/Reachability/Reachability.native.js +38 -0
- package/lib/Reachability/index.d.ts +1 -0
- package/lib/Reachability/index.js +7 -0
- package/lib/Reachability/types.d.ts +3 -0
- package/lib/Reachability/types.js +4 -0
- package/lib/ServiceWorker/ServiceWorker.d.ts +4 -4
- package/lib/ServiceWorker/ServiceWorker.js +93 -93
- package/lib/ServiceWorker/errorHelpers.d.ts +7 -0
- package/lib/ServiceWorker/errorHelpers.js +24 -0
- package/lib/ServiceWorker/index.d.ts +0 -12
- package/lib/ServiceWorker/index.js +0 -12
- package/lib/Signer/DateUtils.d.ts +27 -0
- package/lib/Signer/DateUtils.js +66 -0
- package/lib/Signer/Signer.d.ts +63 -0
- package/lib/Signer/Signer.js +135 -0
- package/lib/Signer/index.d.ts +1 -0
- package/lib/Signer/index.js +7 -0
- package/lib/adapterCore/error/AmplifyServerContextError.d.ts +8 -0
- package/lib/adapterCore/error/AmplifyServerContextError.js +17 -0
- package/lib/adapterCore/error/index.d.ts +1 -0
- package/lib/adapterCore/error/index.js +7 -0
- package/lib/adapterCore/index.d.ts +2 -0
- package/lib/adapterCore/index.js +11 -0
- package/lib/adapterCore/serverContext/index.d.ts +2 -0
- package/lib/adapterCore/serverContext/index.js +9 -0
- package/lib/adapterCore/serverContext/serverContext.d.ts +20 -0
- package/lib/adapterCore/serverContext/serverContext.js +42 -0
- package/lib/adapterCore/serverContext/serverContextRegistry.d.ts +6 -0
- package/lib/adapterCore/serverContext/serverContextRegistry.js +24 -0
- package/lib/adapterCore/serverContext/types/amplifyServer.d.ts +16 -0
- package/lib/adapterCore/serverContext/types/amplifyServer.js +4 -0
- package/lib/adapterCore/serverContext/types/cookieStorage.d.ts +31 -0
- package/lib/adapterCore/serverContext/types/cookieStorage.js +4 -0
- package/lib/adapterCore/serverContext/types/index.d.ts +4 -0
- package/lib/adapterCore/serverContext/types/index.js +4 -0
- package/lib/awsClients/cognitoIdentity/base.d.ts +29 -0
- package/lib/awsClients/cognitoIdentity/base.js +67 -0
- package/lib/awsClients/cognitoIdentity/getCredentialsForIdentity.d.ts +22 -0
- package/lib/awsClients/cognitoIdentity/getCredentialsForIdentity.js +39 -0
- package/lib/awsClients/cognitoIdentity/getId.d.ts +22 -0
- package/lib/awsClients/cognitoIdentity/getId.js +30 -0
- package/lib/awsClients/cognitoIdentity/types.js +4 -0
- package/lib/awsClients/pinpoint/base.d.ts +17 -0
- package/lib/awsClients/pinpoint/base.js +37 -0
- package/lib/awsClients/pinpoint/errorHelpers.d.ts +5 -0
- package/lib/awsClients/pinpoint/errorHelpers.js +16 -0
- package/lib/awsClients/pinpoint/getInAppMessages.d.ts +24 -0
- package/lib/awsClients/pinpoint/getInAppMessages.js +34 -0
- package/lib/awsClients/pinpoint/index.d.ts +4 -0
- package/lib/awsClients/pinpoint/putEvents.d.ts +24 -0
- package/lib/awsClients/pinpoint/putEvents.js +37 -0
- package/lib/awsClients/pinpoint/updateEndpoint.d.ts +24 -0
- package/lib/awsClients/pinpoint/updateEndpoint.js +38 -0
- package/lib/clients/endpoints/getDnsSuffix.js +7 -29
- package/lib/clients/handlers/authenticated.d.ts +1 -1
- package/lib/clients/handlers/authenticated.js +5 -5
- package/lib/clients/handlers/fetch.d.ts +0 -1
- package/lib/clients/handlers/fetch.js +42 -97
- package/lib/clients/handlers/unauthenticated.d.ts +1 -1
- package/lib/clients/handlers/unauthenticated.js +4 -4
- package/lib/clients/internal/composeServiceApi.d.ts +8 -3
- package/lib/clients/internal/composeServiceApi.js +17 -67
- package/lib/clients/internal/composeTransferHandler.js +9 -11
- package/lib/clients/middleware/retry/defaultRetryDecider.d.ts +1 -1
- package/lib/clients/middleware/retry/defaultRetryDecider.js +18 -71
- package/lib/clients/middleware/retry/isClockSkewError.js +2 -4
- package/lib/clients/middleware/retry/jitteredBackoff.js +5 -5
- package/lib/clients/middleware/retry/middleware.d.ts +1 -1
- package/lib/clients/middleware/retry/middleware.js +61 -125
- package/lib/clients/middleware/signing/middleware.js +24 -86
- package/lib/clients/middleware/signing/signer/signatureV4/index.js +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js +21 -55
- package/lib/clients/middleware/signing/signer/signatureV4/signRequest.js +14 -25
- package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +7 -7
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +8 -30
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +11 -38
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +13 -17
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +5 -8
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +2 -2
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +3 -3
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +7 -11
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +9 -10
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +4 -6
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +8 -8
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +15 -16
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +2 -4
- package/lib/clients/middleware/signing/utils/extendedEncodeURIComponent.js +3 -5
- package/lib/clients/middleware/signing/utils/getSkewCorrectedDate.js +1 -3
- package/lib/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js +2 -2
- package/lib/clients/middleware/signing/utils/isClockSkewed.js +4 -6
- package/lib/clients/middleware/userAgent/middleware.js +14 -63
- package/lib/clients/serde/json.js +30 -96
- package/lib/clients/serde/responseInfo.js +12 -18
- package/lib/clients/types/aws.d.ts +1 -1
- package/lib/clients/types/http.d.ts +25 -1
- package/lib/clients/utils/memoization.js +3 -3
- package/lib/constants.d.ts +2 -0
- package/lib/constants.js +6 -2
- package/lib/errors/AmplifyError.d.ts +14 -0
- package/lib/errors/AmplifyError.js +26 -0
- package/lib/errors/PlatformNotSupportedError.d.ts +4 -0
- package/lib/errors/PlatformNotSupportedError.js +16 -0
- package/lib/errors/createAssertionFunction.d.ts +3 -0
- package/lib/errors/createAssertionFunction.js +19 -0
- package/lib/errors/errorHelpers.d.ts +2 -0
- package/lib/errors/errorHelpers.js +19 -0
- package/lib/errors/index.d.ts +4 -0
- package/lib/errors/index.js +13 -0
- package/lib/index.d.ts +12 -28
- package/lib/index.js +28 -99
- package/lib/libraryUtils.d.ts +30 -0
- package/lib/libraryUtils.js +102 -0
- package/lib/parseAWSExports.d.ts +10 -2
- package/lib/parseAWSExports.js +195 -54
- package/lib/providers/kinesis/types/index.d.ts +1 -0
- package/lib/providers/kinesis/types/index.js +19 -0
- package/lib/providers/kinesis/types/kinesis.d.ts +9 -0
- package/lib/providers/kinesis/types/kinesis.js +4 -0
- package/lib/providers/kinesis-firehose/types/index.d.ts +1 -0
- package/lib/providers/kinesis-firehose/types/index.js +4 -0
- package/lib/providers/kinesis-firehose/types/kinesis-firehose.d.ts +9 -0
- package/lib/providers/kinesis-firehose/types/kinesis-firehose.js +4 -0
- package/lib/providers/personalize/types/index.d.ts +1 -0
- package/lib/providers/personalize/types/index.js +4 -0
- package/lib/providers/personalize/types/personalize.d.ts +8 -0
- package/lib/providers/personalize/types/personalize.js +4 -0
- package/lib/providers/pinpoint/apis/flushEvents.d.ts +2 -0
- package/lib/providers/pinpoint/apis/flushEvents.js +21 -0
- package/lib/providers/pinpoint/apis/index.d.ts +3 -0
- package/lib/providers/pinpoint/apis/index.js +11 -0
- package/lib/providers/pinpoint/apis/record.d.ts +5 -0
- package/lib/providers/pinpoint/apis/record.js +69 -0
- package/lib/providers/pinpoint/apis/updateEndpoint.d.ts +5 -0
- package/lib/providers/pinpoint/apis/updateEndpoint.js +75 -0
- package/lib/providers/pinpoint/index.d.ts +3 -0
- package/lib/providers/pinpoint/index.js +24 -0
- package/lib/providers/pinpoint/types/buffer.d.ts +25 -0
- package/lib/providers/pinpoint/types/buffer.js +4 -0
- package/lib/providers/pinpoint/types/errors.d.ts +9 -0
- package/lib/providers/pinpoint/types/errors.js +15 -0
- package/lib/providers/pinpoint/types/index.d.ts +2 -0
- package/lib/providers/pinpoint/types/index.js +22 -0
- package/lib/providers/pinpoint/types/pinpoint.d.ts +43 -0
- package/lib/providers/pinpoint/types/pinpoint.js +4 -0
- package/lib/providers/pinpoint/utils/PinpointEventBuffer.d.ts +24 -0
- package/lib/providers/pinpoint/utils/PinpointEventBuffer.js +192 -0
- package/lib/providers/pinpoint/utils/cacheEndpointId.d.ts +7 -0
- package/lib/providers/pinpoint/utils/cacheEndpointId.js +24 -0
- package/lib/providers/pinpoint/utils/constants.d.ts +4 -0
- package/lib/providers/pinpoint/utils/constants.js +10 -0
- package/lib/providers/pinpoint/utils/getCacheKey.d.ts +7 -0
- package/lib/providers/pinpoint/utils/getCacheKey.js +13 -0
- package/lib/providers/pinpoint/utils/getEndpointId.d.ts +7 -0
- package/lib/providers/pinpoint/utils/getEndpointId.js +18 -0
- package/lib/providers/pinpoint/utils/getEventBuffer.d.ts +8 -0
- package/lib/providers/pinpoint/utils/getEventBuffer.js +46 -0
- package/lib/providers/pinpoint/utils/index.d.ts +4 -0
- package/lib/providers/pinpoint/utils/index.js +13 -0
- package/lib/providers/pinpoint/utils/isAppInForeground.d.ts +1 -0
- package/lib/providers/pinpoint/utils/isAppInForeground.js +7 -0
- package/lib/providers/pinpoint/utils/isAppInForeground.native.d.ts +1 -0
- package/lib/providers/pinpoint/utils/isAppInForeground.native.js +9 -0
- package/lib/providers/pinpoint/utils/resolveEndpointId.d.ts +8 -0
- package/lib/providers/pinpoint/utils/resolveEndpointId.js +34 -0
- package/lib/server.d.ts +1 -0
- package/lib/server.js +7 -0
- package/lib/singleton/API/types.d.ts +73 -0
- package/lib/singleton/Amplify.d.ts +40 -0
- package/lib/singleton/Amplify.js +65 -0
- package/lib/singleton/Analytics/types.d.ts +9 -0
- package/lib/singleton/Analytics/types.js +4 -0
- package/lib/singleton/Auth/index.d.ts +24 -0
- package/lib/singleton/Auth/index.js +67 -0
- package/lib/singleton/Auth/types.d.ts +155 -0
- package/lib/singleton/Auth/types.js +6 -0
- package/lib/singleton/Auth/utils/errorHelpers.d.ts +8 -0
- package/lib/singleton/Auth/utils/errorHelpers.js +32 -0
- package/lib/singleton/Auth/utils/index.d.ts +5 -0
- package/lib/singleton/Auth/utils/index.js +60 -0
- package/lib/singleton/Cache/types.d.ts +18 -0
- package/lib/singleton/Cache/types.js +4 -0
- package/lib/singleton/Geo/types.d.ts +17 -0
- package/lib/singleton/Geo/types.js +4 -0
- package/lib/singleton/Interactions/types.d.ts +21 -0
- package/lib/singleton/Interactions/types.js +4 -0
- package/lib/singleton/Notifications/InAppMessaging/types.d.ts +2 -0
- package/lib/singleton/Notifications/InAppMessaging/types.js +4 -0
- package/lib/singleton/Notifications/PushNotification/types.d.ts +2 -0
- package/lib/singleton/Notifications/PushNotification/types.js +4 -0
- package/lib/singleton/Notifications/types.d.ts +6 -0
- package/lib/singleton/Notifications/types.js +4 -0
- package/lib/singleton/Predictions/types.d.ts +49 -0
- package/lib/singleton/Predictions/types.js +4 -0
- package/lib/singleton/Storage/types.d.ts +25 -0
- package/lib/singleton/Storage/types.js +4 -0
- package/lib/singleton/apis/clearCredentials.d.ts +1 -0
- package/lib/singleton/apis/clearCredentials.js +10 -0
- package/lib/singleton/apis/fetchAuthSession.d.ts +2 -0
- package/lib/singleton/apis/fetchAuthSession.js +11 -0
- package/lib/singleton/apis/internal/fetchAuthSession.d.ts +3 -0
- package/lib/singleton/apis/internal/fetchAuthSession.js +9 -0
- package/lib/singleton/apis/server/fetchAuthSession.d.ts +3 -0
- package/lib/singleton/apis/server/fetchAuthSession.js +11 -0
- package/lib/singleton/index.d.ts +3 -0
- package/lib/singleton/index.js +12 -0
- package/lib/singleton/types.d.ts +31 -0
- package/lib/singleton/types.js +4 -0
- package/lib/storage/CookieStorage.d.ts +14 -0
- package/lib/storage/CookieStorage.js +52 -0
- package/lib/storage/CookieStorage.native.d.ts +7 -0
- package/lib/storage/CookieStorage.native.js +15 -0
- package/lib/storage/DefaultStorage.d.ts +7 -0
- package/lib/storage/DefaultStorage.js +16 -0
- package/lib/storage/DefaultStorage.native.d.ts +33 -0
- package/lib/storage/DefaultStorage.native.js +50 -0
- package/lib/storage/InMemoryStorage.d.ts +12 -0
- package/lib/storage/InMemoryStorage.js +35 -0
- package/lib/storage/KeyValueStorage.d.ts +33 -0
- package/lib/storage/KeyValueStorage.js +56 -0
- package/lib/storage/SessionStorage.d.ts +7 -0
- package/lib/storage/SessionStorage.js +16 -0
- package/lib/storage/index.d.ts +7 -0
- package/lib/storage/index.js +14 -0
- package/lib/storage/utils.d.ts +10 -0
- package/lib/storage/utils.js +22 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core.d.ts +42 -0
- package/lib/types/core.js +4 -0
- package/lib/types/errors.d.ts +22 -0
- package/lib/types/errors.js +11 -0
- package/lib/types/index.d.ts +4 -1
- package/lib/types/index.js +6 -3
- package/lib/types/logging.d.ts +13 -0
- package/lib/types/logging.js +4 -0
- package/lib/types/storage.d.ts +17 -0
- package/lib/types/storage.js +4 -0
- package/lib/utils/WordArray.d.ts +7 -0
- package/lib/utils/WordArray.js +49 -0
- package/lib/utils/amplifyUrl/index.d.ts +13 -0
- package/lib/utils/amplifyUrl/index.js +10 -0
- package/lib/utils/amplifyUrl/polyfill.d.ts +0 -0
- package/lib/utils/amplifyUrl/polyfill.js +4 -0
- package/lib/utils/amplifyUrl/polyfill.native.d.ts +1 -0
- package/lib/utils/amplifyUrl/polyfill.native.js +6 -0
- package/lib/utils/amplifyUuid/index.d.ts +3 -0
- package/lib/utils/amplifyUuid/index.js +9 -0
- package/lib/utils/amplifyUuid/polyfill.d.ts +0 -0
- package/lib/utils/amplifyUuid/polyfill.js +4 -0
- package/lib/utils/amplifyUuid/polyfill.native.d.ts +1 -0
- package/lib/utils/amplifyUuid/polyfill.native.js +6 -0
- package/lib/utils/convert/base64/base64Decoder.d.ts +2 -0
- package/lib/utils/convert/base64/base64Decoder.js +11 -0
- package/lib/utils/convert/base64/base64Encoder.d.ts +2 -0
- package/lib/utils/convert/base64/base64Encoder.js +17 -0
- package/lib/utils/convert/base64/bytesToString.d.ts +1 -0
- package/lib/utils/convert/base64/bytesToString.js +9 -0
- package/lib/utils/convert/index.d.ts +2 -0
- package/lib/utils/convert/index.js +9 -0
- package/lib/utils/convert/types.d.ts +9 -0
- package/lib/utils/convert/types.js +4 -0
- package/lib/utils/cryptoSecureRandomInt.d.ts +1 -0
- package/lib/utils/cryptoSecureRandomInt.js +16 -0
- package/lib/utils/deepFreeze.d.ts +1 -0
- package/lib/utils/deepFreeze.js +16 -0
- package/lib/utils/generateRandomString.d.ts +1 -0
- package/lib/utils/generateRandomString.js +14 -0
- package/lib/utils/getClientInfo/getClientInfo.android.d.ts +5 -0
- package/lib/utils/getClientInfo/getClientInfo.android.js +21 -0
- package/lib/utils/getClientInfo/getClientInfo.d.ts +17 -0
- package/lib/utils/getClientInfo/getClientInfo.ios.d.ts +7 -0
- package/lib/utils/getClientInfo/getClientInfo.ios.js +63 -0
- package/lib/utils/getClientInfo/getClientInfo.js +68 -0
- package/lib/utils/getClientInfo/index.d.ts +1 -0
- package/lib/utils/getClientInfo/index.js +7 -0
- package/lib/utils/globalHelpers/index.d.ts +3 -0
- package/lib/utils/globalHelpers/index.js +50 -0
- package/lib/utils/globalHelpers/index.native.d.ts +3 -0
- package/lib/utils/globalHelpers/index.native.js +28 -0
- package/lib/utils/index.d.ts +8 -0
- package/lib/utils/index.js +25 -0
- package/lib/utils/isBrowser.d.ts +1 -0
- package/lib/utils/isBrowser.js +7 -0
- package/lib/utils/isWebWorker.d.ts +1 -0
- package/lib/utils/isWebWorker.js +14 -0
- package/lib/utils/retry/NonRetryableError.d.ts +4 -0
- package/lib/utils/retry/NonRetryableError.js +12 -0
- package/lib/utils/retry/constants.d.ts +1 -0
- package/lib/utils/retry/constants.js +6 -0
- package/lib/utils/retry/index.d.ts +5 -0
- package/lib/utils/retry/index.js +15 -0
- package/lib/utils/retry/isNonRetryableError.d.ts +2 -0
- package/lib/utils/retry/isNonRetryableError.js +10 -0
- package/lib/utils/retry/jitteredBackoff.d.ts +6 -0
- package/lib/utils/retry/jitteredBackoff.js +19 -0
- package/lib/utils/retry/jitteredExponentialRetry.d.ts +5 -0
- package/lib/utils/retry/jitteredExponentialRetry.js +14 -0
- package/lib/utils/retry/retry.d.ts +6 -0
- package/lib/utils/retry/retry.js +64 -0
- package/lib/utils/sessionListener/SessionListener.d.ts +10 -0
- package/lib/utils/sessionListener/SessionListener.js +53 -0
- package/lib/utils/sessionListener/SessionListener.native.d.ts +10 -0
- package/lib/utils/sessionListener/SessionListener.native.js +50 -0
- package/lib/utils/sessionListener/constants.d.ts +2 -0
- package/lib/utils/sessionListener/constants.js +8 -0
- package/lib/utils/sessionListener/index.d.ts +3 -0
- package/lib/utils/sessionListener/index.js +10 -0
- package/lib/utils/sessionListener/types.d.ts +6 -0
- package/lib/utils/sessionListener/types.js +4 -0
- package/lib/utils/urlSafeDecode.d.ts +1 -0
- package/lib/utils/urlSafeDecode.js +10 -0
- package/lib/utils/urlSafeEncode.d.ts +1 -0
- package/lib/utils/urlSafeEncode.js +12 -0
- package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
- package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.js +7 -0
- package/lib-esm/BackgroundProcessManager/BackgroundProcessManager.d.ts +182 -0
- package/lib-esm/BackgroundProcessManager/BackgroundProcessManager.js +283 -0
- package/lib-esm/BackgroundProcessManager/index.d.ts +1 -0
- package/lib-esm/BackgroundProcessManager/index.js +3 -0
- package/lib-esm/BackgroundProcessManager/types.d.ts +41 -0
- package/lib-esm/BackgroundProcessManager/types.js +20 -0
- package/lib-esm/Cache/StorageCache.d.ts +22 -0
- package/lib-esm/Cache/StorageCache.js +52 -0
- package/lib-esm/Cache/StorageCache.native.d.ts +19 -0
- package/lib-esm/Cache/StorageCache.native.js +58 -0
- package/lib-esm/Cache/StorageCacheCommon.d.ts +179 -0
- package/lib-esm/Cache/StorageCacheCommon.js +464 -0
- package/lib-esm/Cache/constants.d.ts +6 -0
- package/lib-esm/Cache/constants.js +14 -0
- package/lib-esm/Cache/index.d.ts +2 -0
- package/lib-esm/Cache/index.js +4 -0
- package/lib-esm/Cache/types/cache.d.ts +38 -0
- package/lib-esm/Cache/types/index.d.ts +1 -0
- package/lib-esm/Cache/types/index.js +3 -0
- package/lib-esm/Cache/utils/CacheList.d.ts +89 -0
- package/lib-esm/Cache/utils/CacheList.js +156 -0
- package/lib-esm/Cache/utils/cacheHelpers.d.ts +14 -0
- package/lib-esm/Cache/utils/cacheHelpers.js +42 -0
- package/lib-esm/Cache/utils/errorHelpers.d.ts +7 -0
- package/lib-esm/Cache/utils/errorHelpers.js +21 -0
- package/lib-esm/Cache/utils/index.d.ts +2 -0
- package/lib-esm/Cache/utils/index.js +4 -0
- package/lib-esm/Hub/index.d.ts +46 -0
- package/lib-esm/Hub/index.js +114 -0
- package/lib-esm/Hub/types/AuthTypes.d.ts +36 -0
- package/lib-esm/Hub/types/AuthTypes.js +3 -0
- package/lib-esm/Hub/types/HubTypes.d.ts +28 -0
- package/lib-esm/Hub/types/HubTypes.js +3 -0
- package/lib-esm/Hub/types/index.d.ts +2 -0
- package/lib-esm/Hub/types/index.js +4 -0
- package/lib-esm/I18n/I18n.d.ts +14 -10
- package/lib-esm/I18n/I18n.js +28 -40
- package/lib-esm/I18n/errorHelpers.d.ts +5 -0
- package/lib-esm/I18n/errorHelpers.js +13 -0
- package/lib-esm/I18n/index.d.ts +6 -5
- package/lib-esm/I18n/index.js +30 -29
- package/lib-esm/I18n/types.d.ts +2 -2
- package/lib-esm/I18n/types.js +3 -5
- package/lib-esm/Logger/ConsoleLogger.d.ts +11 -11
- package/lib-esm/Logger/ConsoleLogger.js +53 -129
- package/lib-esm/Mutex/Mutex.d.ts +32 -0
- package/lib-esm/Mutex/Mutex.js +66 -0
- package/lib-esm/Mutex/index.d.ts +1 -0
- package/lib-esm/Mutex/index.js +3 -0
- package/lib-esm/Mutex/types.d.ts +13 -0
- package/lib-esm/Mutex/types.js +3 -0
- package/lib-esm/Platform/customUserAgent.d.ts +16 -0
- package/lib-esm/Platform/customUserAgent.js +52 -0
- package/lib-esm/Platform/detectFramework.js +11 -11
- package/lib-esm/Platform/detection/Angular.js +3 -4
- package/lib-esm/Platform/detection/Next.d.ts +1 -1
- package/lib-esm/Platform/detection/React.js +5 -4
- package/lib-esm/Platform/detection/Svelte.js +1 -1
- package/lib-esm/Platform/detection/helpers.js +7 -7
- package/lib-esm/Platform/detection/index.js +3 -3
- package/lib-esm/Platform/index.js +30 -50
- package/lib-esm/Platform/types.d.ts +75 -8
- package/lib-esm/Platform/types.js +40 -39
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/Reachability/Reachability.d.ts +7 -0
- package/lib-esm/Reachability/Reachability.js +39 -0
- package/lib-esm/Reachability/Reachability.native.d.ts +6 -0
- package/lib-esm/Reachability/Reachability.native.js +34 -0
- package/lib-esm/Reachability/index.d.ts +1 -0
- package/lib-esm/Reachability/index.js +3 -0
- package/lib-esm/Reachability/types.d.ts +3 -0
- package/lib-esm/Reachability/types.js +3 -0
- package/lib-esm/ServiceWorker/ServiceWorker.d.ts +4 -4
- package/lib-esm/ServiceWorker/ServiceWorker.js +90 -91
- package/lib-esm/ServiceWorker/errorHelpers.d.ts +7 -0
- package/lib-esm/ServiceWorker/errorHelpers.js +21 -0
- package/lib-esm/ServiceWorker/index.d.ts +0 -12
- package/lib-esm/ServiceWorker/index.js +0 -12
- package/lib-esm/Signer/DateUtils.d.ts +27 -0
- package/lib-esm/Signer/DateUtils.js +63 -0
- package/lib-esm/Signer/Signer.d.ts +63 -0
- package/lib-esm/Signer/Signer.js +131 -0
- package/lib-esm/Signer/index.d.ts +1 -0
- package/lib-esm/Signer/index.js +3 -0
- package/lib-esm/adapterCore/error/AmplifyServerContextError.d.ts +8 -0
- package/lib-esm/adapterCore/error/AmplifyServerContextError.js +13 -0
- package/lib-esm/adapterCore/error/index.d.ts +1 -0
- package/lib-esm/adapterCore/error/index.js +3 -0
- package/lib-esm/adapterCore/index.d.ts +2 -0
- package/lib-esm/adapterCore/index.js +4 -0
- package/lib-esm/adapterCore/serverContext/index.d.ts +2 -0
- package/lib-esm/adapterCore/serverContext/index.js +3 -0
- package/lib-esm/adapterCore/serverContext/serverContext.d.ts +20 -0
- package/lib-esm/adapterCore/serverContext/serverContext.js +36 -0
- package/lib-esm/adapterCore/serverContext/serverContextRegistry.d.ts +6 -0
- package/lib-esm/adapterCore/serverContext/serverContextRegistry.js +21 -0
- package/lib-esm/adapterCore/serverContext/types/amplifyServer.d.ts +16 -0
- package/lib-esm/adapterCore/serverContext/types/amplifyServer.js +3 -0
- package/lib-esm/adapterCore/serverContext/types/cookieStorage.d.ts +31 -0
- package/lib-esm/adapterCore/serverContext/types/cookieStorage.js +3 -0
- package/lib-esm/adapterCore/serverContext/types/index.d.ts +4 -0
- package/lib-esm/adapterCore/serverContext/types/index.js +3 -0
- package/lib-esm/awsClients/cognitoIdentity/base.d.ts +29 -0
- package/lib-esm/awsClients/cognitoIdentity/base.js +62 -0
- package/lib-esm/awsClients/cognitoIdentity/getCredentialsForIdentity.d.ts +22 -0
- package/lib-esm/awsClients/cognitoIdentity/getCredentialsForIdentity.js +36 -0
- package/lib-esm/awsClients/cognitoIdentity/getId.d.ts +22 -0
- package/lib-esm/awsClients/cognitoIdentity/getId.js +27 -0
- package/lib-esm/awsClients/cognitoIdentity/types.js +3 -0
- package/lib-esm/awsClients/pinpoint/base.d.ts +17 -0
- package/lib-esm/awsClients/pinpoint/base.js +33 -0
- package/lib-esm/awsClients/pinpoint/errorHelpers.d.ts +5 -0
- package/lib-esm/awsClients/pinpoint/errorHelpers.js +13 -0
- package/lib-esm/awsClients/pinpoint/getInAppMessages.d.ts +24 -0
- package/lib-esm/awsClients/pinpoint/getInAppMessages.js +31 -0
- package/lib-esm/awsClients/pinpoint/index.d.ts +4 -0
- package/lib-esm/awsClients/pinpoint/putEvents.d.ts +24 -0
- package/lib-esm/awsClients/pinpoint/putEvents.js +34 -0
- package/lib-esm/awsClients/pinpoint/updateEndpoint.d.ts +24 -0
- package/lib-esm/awsClients/pinpoint/updateEndpoint.js +35 -0
- package/lib-esm/clients/endpoints/getDnsSuffix.js +6 -28
- package/lib-esm/clients/endpoints/partitions.js +2 -2
- package/lib-esm/clients/handlers/authenticated.d.ts +1 -1
- package/lib-esm/clients/handlers/authenticated.js +1 -1
- package/lib-esm/clients/handlers/fetch.d.ts +0 -1
- package/lib-esm/clients/handlers/fetch.js +41 -96
- package/lib-esm/clients/handlers/unauthenticated.d.ts +1 -1
- package/lib-esm/clients/handlers/unauthenticated.js +1 -1
- package/lib-esm/clients/internal/composeServiceApi.d.ts +8 -3
- package/lib-esm/clients/internal/composeServiceApi.js +17 -67
- package/lib-esm/clients/internal/composeTransferHandler.js +9 -11
- package/lib-esm/clients/middleware/retry/defaultRetryDecider.d.ts +1 -1
- package/lib-esm/clients/middleware/retry/defaultRetryDecider.js +17 -70
- package/lib-esm/clients/middleware/retry/isClockSkewError.js +2 -4
- package/lib-esm/clients/middleware/retry/jitteredBackoff.js +5 -5
- package/lib-esm/clients/middleware/retry/middleware.d.ts +1 -1
- package/lib-esm/clients/middleware/retry/middleware.js +61 -125
- package/lib-esm/clients/middleware/signing/middleware.js +21 -83
- package/lib-esm/clients/middleware/signing/signer/signatureV4/constants.js +17 -17
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js +18 -52
- package/lib-esm/clients/middleware/signing/signer/signatureV4/signRequest.js +10 -21
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +6 -6
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +8 -30
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +11 -38
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +8 -12
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +5 -8
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +1 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +3 -3
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +5 -9
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +5 -6
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +4 -6
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +6 -6
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +13 -14
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +1 -3
- package/lib-esm/clients/middleware/signing/utils/extendedEncodeURIComponent.js +3 -5
- package/lib-esm/clients/middleware/signing/utils/getSkewCorrectedDate.js +1 -3
- package/lib-esm/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js +1 -1
- package/lib-esm/clients/middleware/signing/utils/isClockSkewed.js +3 -5
- package/lib-esm/clients/middleware/userAgent/middleware.js +14 -63
- package/lib-esm/clients/serde/json.js +29 -95
- package/lib-esm/clients/serde/responseInfo.js +11 -17
- package/lib-esm/clients/types/aws.d.ts +1 -1
- package/lib-esm/clients/types/http.d.ts +25 -1
- package/lib-esm/clients/utils/memoization.js +3 -3
- package/lib-esm/constants.d.ts +2 -0
- package/lib-esm/constants.js +7 -3
- package/lib-esm/errors/AmplifyError.d.ts +14 -0
- package/lib-esm/errors/AmplifyError.js +22 -0
- package/lib-esm/errors/PlatformNotSupportedError.d.ts +4 -0
- package/lib-esm/errors/PlatformNotSupportedError.js +12 -0
- package/lib-esm/errors/createAssertionFunction.d.ts +3 -0
- package/lib-esm/errors/createAssertionFunction.js +15 -0
- package/lib-esm/errors/errorHelpers.d.ts +2 -0
- package/lib-esm/errors/errorHelpers.js +16 -0
- package/lib-esm/errors/index.d.ts +4 -0
- package/lib-esm/errors/index.js +6 -0
- package/lib-esm/index.d.ts +12 -28
- package/lib-esm/index.js +15 -27
- package/lib-esm/libraryUtils.d.ts +30 -0
- package/lib-esm/libraryUtils.js +39 -0
- package/lib-esm/parseAWSExports.d.ts +10 -2
- package/lib-esm/parseAWSExports.js +194 -53
- package/lib-esm/providers/kinesis/types/index.d.ts +1 -0
- package/lib-esm/providers/kinesis/types/index.js +3 -0
- package/lib-esm/providers/kinesis/types/kinesis.d.ts +9 -0
- package/lib-esm/providers/kinesis/types/kinesis.js +3 -0
- package/lib-esm/providers/kinesis-firehose/types/index.d.ts +1 -0
- package/lib-esm/providers/kinesis-firehose/types/index.js +3 -0
- package/lib-esm/providers/kinesis-firehose/types/kinesis-firehose.d.ts +9 -0
- package/lib-esm/providers/kinesis-firehose/types/kinesis-firehose.js +3 -0
- package/lib-esm/providers/personalize/types/index.d.ts +1 -0
- package/lib-esm/providers/personalize/types/index.js +3 -0
- package/lib-esm/providers/personalize/types/personalize.d.ts +8 -0
- package/lib-esm/providers/personalize/types/personalize.js +3 -0
- package/lib-esm/providers/pinpoint/apis/flushEvents.d.ts +2 -0
- package/lib-esm/providers/pinpoint/apis/flushEvents.js +17 -0
- package/lib-esm/providers/pinpoint/apis/index.d.ts +3 -0
- package/lib-esm/providers/pinpoint/apis/index.js +5 -0
- package/lib-esm/providers/pinpoint/apis/record.d.ts +5 -0
- package/lib-esm/providers/pinpoint/apis/record.js +65 -0
- package/lib-esm/providers/pinpoint/apis/updateEndpoint.d.ts +5 -0
- package/lib-esm/providers/pinpoint/apis/updateEndpoint.js +71 -0
- package/lib-esm/providers/pinpoint/index.d.ts +3 -0
- package/lib-esm/providers/pinpoint/index.js +5 -0
- package/lib-esm/providers/pinpoint/types/buffer.d.ts +25 -0
- package/lib-esm/providers/pinpoint/types/buffer.js +3 -0
- package/lib-esm/providers/pinpoint/types/errors.d.ts +9 -0
- package/lib-esm/providers/pinpoint/types/errors.js +12 -0
- package/lib-esm/providers/pinpoint/types/index.d.ts +2 -0
- package/lib-esm/providers/pinpoint/types/index.js +4 -0
- package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +43 -0
- package/lib-esm/providers/pinpoint/types/pinpoint.js +3 -0
- package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.d.ts +24 -0
- package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.js +188 -0
- package/lib-esm/providers/pinpoint/utils/cacheEndpointId.d.ts +7 -0
- package/lib-esm/providers/pinpoint/utils/cacheEndpointId.js +20 -0
- package/lib-esm/providers/pinpoint/utils/constants.d.ts +4 -0
- package/lib-esm/providers/pinpoint/utils/constants.js +7 -0
- package/lib-esm/providers/pinpoint/utils/getCacheKey.d.ts +7 -0
- package/lib-esm/providers/pinpoint/utils/getCacheKey.js +9 -0
- package/lib-esm/providers/pinpoint/utils/getEndpointId.d.ts +7 -0
- package/lib-esm/providers/pinpoint/utils/getEndpointId.js +14 -0
- package/lib-esm/providers/pinpoint/utils/getEventBuffer.d.ts +8 -0
- package/lib-esm/providers/pinpoint/utils/getEventBuffer.js +42 -0
- package/lib-esm/providers/pinpoint/utils/index.d.ts +4 -0
- package/lib-esm/providers/pinpoint/utils/index.js +6 -0
- package/lib-esm/providers/pinpoint/utils/isAppInForeground.d.ts +1 -0
- package/lib-esm/providers/pinpoint/utils/isAppInForeground.js +3 -0
- package/lib-esm/providers/pinpoint/utils/isAppInForeground.native.d.ts +1 -0
- package/lib-esm/providers/pinpoint/utils/isAppInForeground.native.js +5 -0
- package/lib-esm/providers/pinpoint/utils/resolveEndpointId.d.ts +8 -0
- package/lib-esm/providers/pinpoint/utils/resolveEndpointId.js +30 -0
- package/lib-esm/server.d.ts +1 -0
- package/lib-esm/server.js +3 -0
- package/lib-esm/singleton/API/types.d.ts +73 -0
- package/lib-esm/singleton/Amplify.d.ts +40 -0
- package/lib-esm/singleton/Amplify.js +61 -0
- package/lib-esm/singleton/Analytics/types.d.ts +9 -0
- package/lib-esm/singleton/Analytics/types.js +3 -0
- package/lib-esm/singleton/Auth/index.d.ts +24 -0
- package/lib-esm/singleton/Auth/index.js +62 -0
- package/lib-esm/singleton/Auth/types.d.ts +155 -0
- package/lib-esm/singleton/Auth/types.js +5 -0
- package/lib-esm/singleton/Auth/utils/errorHelpers.d.ts +8 -0
- package/lib-esm/singleton/Auth/utils/errorHelpers.js +29 -0
- package/lib-esm/singleton/Auth/utils/index.d.ts +5 -0
- package/lib-esm/singleton/Auth/utils/index.js +53 -0
- package/lib-esm/singleton/Cache/types.d.ts +18 -0
- package/lib-esm/singleton/Cache/types.js +3 -0
- package/lib-esm/singleton/Geo/types.d.ts +17 -0
- package/lib-esm/singleton/Geo/types.js +3 -0
- package/lib-esm/singleton/Interactions/types.d.ts +21 -0
- package/lib-esm/singleton/Interactions/types.js +3 -0
- package/lib-esm/singleton/Notifications/InAppMessaging/types.d.ts +2 -0
- package/lib-esm/singleton/Notifications/InAppMessaging/types.js +3 -0
- package/lib-esm/singleton/Notifications/PushNotification/types.d.ts +2 -0
- package/lib-esm/singleton/Notifications/PushNotification/types.js +3 -0
- package/lib-esm/singleton/Notifications/types.d.ts +6 -0
- package/lib-esm/singleton/Notifications/types.js +3 -0
- package/lib-esm/singleton/Predictions/types.d.ts +49 -0
- package/lib-esm/singleton/Predictions/types.js +3 -0
- package/lib-esm/singleton/Storage/types.d.ts +25 -0
- package/lib-esm/singleton/Storage/types.js +3 -0
- package/lib-esm/singleton/apis/clearCredentials.d.ts +1 -0
- package/lib-esm/singleton/apis/clearCredentials.js +6 -0
- package/lib-esm/singleton/apis/fetchAuthSession.d.ts +2 -0
- package/lib-esm/singleton/apis/fetchAuthSession.js +7 -0
- package/lib-esm/singleton/apis/internal/fetchAuthSession.d.ts +3 -0
- package/lib-esm/singleton/apis/internal/fetchAuthSession.js +5 -0
- package/lib-esm/singleton/apis/server/fetchAuthSession.d.ts +3 -0
- package/lib-esm/singleton/apis/server/fetchAuthSession.js +7 -0
- package/lib-esm/singleton/index.d.ts +3 -0
- package/lib-esm/singleton/index.js +5 -0
- package/lib-esm/singleton/types.d.ts +31 -0
- package/lib-esm/singleton/types.js +3 -0
- package/lib-esm/storage/CookieStorage.d.ts +14 -0
- package/lib-esm/storage/CookieStorage.js +45 -0
- package/lib-esm/storage/CookieStorage.native.d.ts +7 -0
- package/lib-esm/storage/CookieStorage.native.js +11 -0
- package/lib-esm/storage/DefaultStorage.d.ts +7 -0
- package/lib-esm/storage/DefaultStorage.js +12 -0
- package/lib-esm/storage/DefaultStorage.native.d.ts +33 -0
- package/lib-esm/storage/DefaultStorage.native.js +46 -0
- package/lib-esm/storage/InMemoryStorage.d.ts +12 -0
- package/lib-esm/storage/InMemoryStorage.js +31 -0
- package/lib-esm/storage/KeyValueStorage.d.ts +33 -0
- package/lib-esm/storage/KeyValueStorage.js +52 -0
- package/lib-esm/storage/SessionStorage.d.ts +7 -0
- package/lib-esm/storage/SessionStorage.js +12 -0
- package/lib-esm/storage/index.d.ts +7 -0
- package/lib-esm/storage/index.js +10 -0
- package/lib-esm/storage/utils.d.ts +10 -0
- package/lib-esm/storage/utils.js +17 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/core.d.ts +42 -0
- package/lib-esm/types/core.js +3 -0
- package/lib-esm/types/errors.d.ts +22 -0
- package/lib-esm/types/errors.js +8 -0
- package/lib-esm/types/index.d.ts +4 -1
- package/lib-esm/types/index.js +4 -1
- package/lib-esm/types/logging.d.ts +13 -0
- package/lib-esm/types/logging.js +3 -0
- package/lib-esm/types/storage.d.ts +17 -0
- package/lib-esm/types/storage.js +3 -0
- package/lib-esm/utils/WordArray.d.ts +7 -0
- package/lib-esm/utils/WordArray.js +46 -0
- package/lib-esm/utils/amplifyUrl/index.d.ts +13 -0
- package/lib-esm/utils/amplifyUrl/index.js +6 -0
- package/lib-esm/utils/amplifyUrl/polyfill.d.ts +0 -0
- package/lib-esm/utils/amplifyUrl/polyfill.js +4 -0
- package/lib-esm/utils/amplifyUrl/polyfill.native.d.ts +1 -0
- package/lib-esm/utils/amplifyUrl/polyfill.native.js +4 -0
- package/lib-esm/utils/amplifyUuid/index.d.ts +3 -0
- package/lib-esm/utils/amplifyUuid/index.js +6 -0
- package/lib-esm/utils/amplifyUuid/polyfill.d.ts +0 -0
- package/lib-esm/utils/amplifyUuid/polyfill.js +4 -0
- package/lib-esm/utils/amplifyUuid/polyfill.native.d.ts +1 -0
- package/lib-esm/utils/amplifyUuid/polyfill.native.js +4 -0
- package/lib-esm/utils/convert/base64/base64Decoder.d.ts +2 -0
- package/lib-esm/utils/convert/base64/base64Decoder.js +8 -0
- package/lib-esm/utils/convert/base64/base64Encoder.d.ts +2 -0
- package/lib-esm/utils/convert/base64/base64Encoder.js +14 -0
- package/lib-esm/utils/convert/base64/bytesToString.d.ts +1 -0
- package/lib-esm/utils/convert/base64/bytesToString.js +5 -0
- package/lib-esm/utils/convert/index.d.ts +2 -0
- package/lib-esm/utils/convert/index.js +4 -0
- package/lib-esm/utils/convert/types.d.ts +9 -0
- package/lib-esm/utils/convert/types.js +3 -0
- package/lib-esm/utils/cryptoSecureRandomInt.d.ts +1 -0
- package/lib-esm/utils/cryptoSecureRandomInt.js +12 -0
- package/lib-esm/utils/deepFreeze.d.ts +1 -0
- package/lib-esm/utils/deepFreeze.js +12 -0
- package/lib-esm/utils/generateRandomString.d.ts +1 -0
- package/lib-esm/utils/generateRandomString.js +10 -0
- package/lib-esm/utils/getClientInfo/getClientInfo.android.d.ts +5 -0
- package/lib-esm/utils/getClientInfo/getClientInfo.android.js +17 -0
- package/lib-esm/utils/getClientInfo/getClientInfo.d.ts +17 -0
- package/lib-esm/utils/getClientInfo/getClientInfo.ios.d.ts +7 -0
- package/lib-esm/utils/getClientInfo/getClientInfo.ios.js +59 -0
- package/lib-esm/utils/getClientInfo/getClientInfo.js +64 -0
- package/lib-esm/utils/getClientInfo/index.d.ts +1 -0
- package/lib-esm/utils/getClientInfo/index.js +3 -0
- package/lib-esm/utils/globalHelpers/index.d.ts +3 -0
- package/lib-esm/utils/globalHelpers/index.js +44 -0
- package/lib-esm/utils/globalHelpers/index.native.d.ts +3 -0
- package/lib-esm/utils/globalHelpers/index.native.js +22 -0
- package/lib-esm/utils/index.d.ts +8 -0
- package/lib-esm/utils/index.js +10 -0
- package/lib-esm/utils/isBrowser.d.ts +1 -0
- package/lib-esm/utils/isBrowser.js +3 -0
- package/lib-esm/utils/isWebWorker.d.ts +1 -0
- package/lib-esm/utils/isWebWorker.js +10 -0
- package/lib-esm/utils/retry/NonRetryableError.d.ts +4 -0
- package/lib-esm/utils/retry/NonRetryableError.js +8 -0
- package/lib-esm/utils/retry/constants.d.ts +1 -0
- package/lib-esm/utils/retry/constants.js +3 -0
- package/lib-esm/utils/retry/index.d.ts +5 -0
- package/lib-esm/utils/retry/index.js +7 -0
- package/lib-esm/utils/retry/isNonRetryableError.d.ts +2 -0
- package/lib-esm/utils/retry/isNonRetryableError.js +6 -0
- package/lib-esm/utils/retry/jitteredBackoff.d.ts +6 -0
- package/lib-esm/utils/retry/jitteredBackoff.js +15 -0
- package/lib-esm/utils/retry/jitteredExponentialRetry.d.ts +5 -0
- package/lib-esm/utils/retry/jitteredExponentialRetry.js +10 -0
- package/lib-esm/utils/retry/retry.d.ts +6 -0
- package/lib-esm/utils/retry/retry.js +60 -0
- package/lib-esm/utils/sessionListener/SessionListener.d.ts +10 -0
- package/lib-esm/utils/sessionListener/SessionListener.js +49 -0
- package/lib-esm/utils/sessionListener/SessionListener.native.d.ts +10 -0
- package/lib-esm/utils/sessionListener/SessionListener.native.js +46 -0
- package/lib-esm/utils/sessionListener/constants.d.ts +2 -0
- package/lib-esm/utils/sessionListener/constants.js +5 -0
- package/lib-esm/utils/sessionListener/index.d.ts +3 -0
- package/lib-esm/utils/sessionListener/index.js +5 -0
- package/lib-esm/utils/sessionListener/types.d.ts +6 -0
- package/lib-esm/utils/sessionListener/types.js +3 -0
- package/lib-esm/utils/urlSafeDecode.d.ts +1 -0
- package/lib-esm/utils/urlSafeDecode.js +6 -0
- package/lib-esm/utils/urlSafeEncode.d.ts +1 -0
- package/lib-esm/utils/urlSafeEncode.js +8 -0
- package/package.json +39 -70
- package/server/package.json +8 -0
- package/src/BackgroundProcessManager/BackgroundManagerNotOpenError.ts +8 -0
- package/src/BackgroundProcessManager/BackgroundProcessManager.ts +421 -0
- package/src/BackgroundProcessManager/index.ts +4 -0
- package/src/BackgroundProcessManager/types.ts +49 -0
- package/src/Cache/StorageCache.native.ts +65 -0
- package/src/Cache/StorageCache.ts +61 -0
- package/src/Cache/StorageCacheCommon.ts +577 -0
- package/src/Cache/constants.ts +18 -0
- package/src/Cache/index.ts +6 -0
- package/src/Cache/types/cache.ts +51 -0
- package/src/Cache/types/index.ts +4 -0
- package/src/Cache/utils/CacheList.ts +185 -0
- package/src/Cache/utils/cacheHelpers.ts +52 -0
- package/src/Cache/utils/errorHelpers.ts +26 -0
- package/src/Cache/utils/index.ts +10 -0
- package/src/Hub/index.ts +213 -0
- package/src/Hub/types/AuthTypes.ts +23 -0
- package/src/Hub/types/HubTypes.ts +46 -0
- package/src/Hub/types/index.ts +5 -0
- package/src/I18n/I18n.ts +19 -12
- package/src/I18n/errorHelpers.ts +18 -0
- package/src/I18n/index.ts +20 -11
- package/src/I18n/types.ts +1 -1
- package/src/Logger/ConsoleLogger.ts +12 -13
- package/src/Mutex/Mutex.ts +78 -0
- package/src/Mutex/index.ts +4 -0
- package/src/Mutex/types.ts +20 -0
- package/src/Platform/customUserAgent.ts +75 -0
- package/src/Platform/detectFramework.ts +1 -1
- package/src/Platform/detection/React.ts +5 -3
- package/src/Platform/index.ts +14 -1
- package/src/Platform/types.ts +84 -39
- package/src/Platform/version.ts +1 -1
- package/src/Reachability/Reachability.native.ts +46 -0
- package/src/Reachability/Reachability.ts +55 -0
- package/src/Reachability/index.ts +4 -0
- package/src/Reachability/types.ts +6 -0
- package/src/ServiceWorker/ServiceWorker.ts +67 -36
- package/src/ServiceWorker/errorHelpers.ts +26 -0
- package/src/ServiceWorker/index.ts +0 -12
- package/src/Signer/DateUtils.ts +103 -0
- package/src/Signer/Signer.ts +203 -0
- package/src/Signer/index.ts +4 -0
- package/src/adapterCore/error/AmplifyServerContextError.ts +23 -0
- package/src/adapterCore/error/index.ts +4 -0
- package/src/adapterCore/index.ts +11 -0
- package/src/adapterCore/serverContext/index.ts +10 -0
- package/src/adapterCore/serverContext/serverContext.ts +54 -0
- package/src/adapterCore/serverContext/serverContextRegistry.ts +31 -0
- package/src/adapterCore/serverContext/types/amplifyServer.ts +29 -0
- package/src/adapterCore/serverContext/types/cookieStorage.ts +43 -0
- package/src/adapterCore/serverContext/types/index.ts +9 -0
- package/src/awsClients/cognitoIdentity/base.ts +97 -0
- package/src/awsClients/cognitoIdentity/getCredentialsForIdentity.ts +74 -0
- package/src/awsClients/pinpoint/base.ts +42 -0
- package/src/awsClients/pinpoint/errorHelpers.ts +19 -0
- package/src/awsClients/pinpoint/getInAppMessages.ts +57 -0
- package/src/awsClients/pinpoint/index.ts +15 -0
- package/src/awsClients/pinpoint/putEvents.ts +58 -0
- package/src/awsClients/pinpoint/updateEndpoint.ts +61 -0
- package/src/clients/handlers/authenticated.ts +2 -1
- package/src/clients/handlers/fetch.ts +9 -4
- package/src/clients/handlers/unauthenticated.ts +2 -1
- package/src/clients/internal/composeServiceApi.ts +22 -6
- package/src/clients/middleware/retry/defaultRetryDecider.ts +12 -6
- package/src/clients/middleware/retry/isClockSkewError.ts +1 -1
- package/src/clients/middleware/retry/jitteredBackoff.ts +1 -1
- package/src/clients/middleware/retry/middleware.ts +9 -9
- package/src/clients/middleware/signing/middleware.ts +1 -1
- package/src/clients/middleware/signing/signer/signatureV4/index.ts +0 -1
- package/src/clients/middleware/signing/signer/signatureV4/presignUrl.ts +2 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.ts +2 -2
- package/src/clients/serde/responseInfo.ts +2 -1
- package/src/clients/types/aws.ts +4 -1
- package/src/clients/types/http.ts +27 -1
- package/src/constants.ts +7 -0
- package/src/errors/AmplifyError.ts +34 -0
- package/src/errors/PlatformNotSupportedError.ts +14 -0
- package/src/errors/createAssertionFunction.ts +23 -0
- package/src/errors/errorHelpers.ts +20 -0
- package/src/errors/index.ts +7 -0
- package/src/global.d.ts +11 -0
- package/src/index.ts +62 -82
- package/src/libraryUtils.ts +113 -0
- package/src/parseAWSExports.ts +272 -56
- package/src/providers/kinesis/types/index.ts +4 -0
- package/src/providers/kinesis/types/kinesis.ts +12 -0
- package/src/providers/kinesis-firehose/types/index.ts +4 -0
- package/src/providers/kinesis-firehose/types/kinesis-firehose.ts +12 -0
- package/src/providers/personalize/types/index.ts +4 -0
- package/src/providers/personalize/types/personalize.ts +11 -0
- package/src/providers/pinpoint/apis/flushEvents.ts +31 -0
- package/src/providers/pinpoint/apis/index.ts +6 -0
- package/src/providers/pinpoint/apis/record.ts +93 -0
- package/src/providers/pinpoint/apis/updateEndpoint.ts +98 -0
- package/src/providers/pinpoint/index.ts +10 -0
- package/src/providers/pinpoint/types/buffer.ts +32 -0
- package/src/providers/pinpoint/types/errors.ts +12 -0
- package/src/providers/pinpoint/types/index.ts +5 -0
- package/src/providers/pinpoint/types/pinpoint.ts +60 -0
- package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +256 -0
- package/src/providers/pinpoint/utils/cacheEndpointId.ts +27 -0
- package/src/providers/pinpoint/utils/constants.ts +8 -0
- package/src/providers/pinpoint/utils/getCacheKey.ts +16 -0
- package/src/providers/pinpoint/utils/getEndpointId.ts +20 -0
- package/src/providers/pinpoint/utils/getEventBuffer.ts +60 -0
- package/src/providers/pinpoint/utils/index.ts +7 -0
- package/src/providers/pinpoint/utils/isAppInForeground.native.ts +7 -0
- package/src/providers/pinpoint/utils/isAppInForeground.ts +4 -0
- package/src/providers/pinpoint/utils/resolveEndpointId.ts +46 -0
- package/src/server.ts +4 -0
- package/src/singleton/API/types.ts +90 -0
- package/src/singleton/Amplify.ts +89 -0
- package/src/singleton/Analytics/types.ts +17 -0
- package/src/singleton/Auth/index.ts +103 -0
- package/src/singleton/Auth/types.ts +225 -0
- package/src/singleton/Auth/utils/errorHelpers.ts +37 -0
- package/src/singleton/Auth/utils/index.ts +106 -0
- package/src/singleton/Cache/types.ts +27 -0
- package/src/singleton/Geo/types.ts +20 -0
- package/src/singleton/Interactions/types.ts +29 -0
- package/src/singleton/Notifications/InAppMessaging/types.ts +6 -0
- package/src/singleton/Notifications/PushNotification/types.ts +6 -0
- package/src/singleton/Notifications/types.ts +10 -0
- package/src/singleton/Predictions/types.ts +61 -0
- package/src/singleton/Storage/types.ts +30 -0
- package/src/singleton/apis/clearCredentials.ts +8 -0
- package/src/singleton/apis/fetchAuthSession.ts +12 -0
- package/src/singleton/apis/internal/fetchAuthSession.ts +12 -0
- package/src/singleton/apis/server/fetchAuthSession.ts +16 -0
- package/src/singleton/index.ts +6 -0
- package/src/singleton/types.ts +64 -0
- package/src/storage/CookieStorage.native.ts +13 -0
- package/src/storage/CookieStorage.ts +68 -0
- package/src/storage/DefaultStorage.native.ts +58 -0
- package/src/storage/DefaultStorage.ts +14 -0
- package/src/storage/InMemoryStorage.ts +36 -0
- package/src/storage/KeyValueStorage.ts +57 -0
- package/src/storage/SessionStorage.ts +14 -0
- package/src/storage/index.ts +13 -0
- package/src/storage/utils.ts +22 -0
- package/src/types/core.ts +51 -0
- package/src/types/errors.ts +33 -0
- package/src/types/index.ts +5 -1
- package/src/types/logging.ts +24 -0
- package/src/types/storage.ts +23 -0
- package/src/utils/WordArray.ts +57 -0
- package/src/utils/amplifyUrl/index.ts +9 -0
- package/src/utils/amplifyUrl/polyfill.native.ts +6 -0
- package/src/utils/amplifyUrl/polyfill.ts +4 -0
- package/src/utils/amplifyUuid/index.ts +9 -0
- package/src/utils/amplifyUuid/polyfill.native.ts +6 -0
- package/src/utils/amplifyUuid/polyfill.ts +4 -0
- package/src/utils/convert/base64/base64Decoder.ts +11 -0
- package/src/utils/convert/base64/base64Encoder.ts +18 -0
- package/src/utils/convert/base64/bytesToString.ts +6 -0
- package/src/utils/convert/index.ts +5 -0
- package/src/utils/convert/types.ts +17 -0
- package/src/utils/cryptoSecureRandomInt.ts +14 -0
- package/src/utils/deepFreeze.ts +16 -0
- package/src/utils/generateRandomString.ts +16 -0
- package/src/utils/getClientInfo/getClientInfo.android.ts +21 -0
- package/src/utils/getClientInfo/getClientInfo.ios.ts +64 -0
- package/src/utils/getClientInfo/getClientInfo.ts +81 -0
- package/src/utils/getClientInfo/index.ts +4 -0
- package/src/utils/globalHelpers/index.native.ts +30 -0
- package/src/utils/globalHelpers/index.ts +54 -0
- package/src/utils/index.ts +17 -0
- package/src/utils/isBrowser.ts +5 -0
- package/src/utils/isWebWorker.ts +13 -0
- package/src/utils/retry/NonRetryableError.ts +9 -0
- package/src/utils/retry/constants.ts +4 -0
- package/src/utils/retry/index.ts +8 -0
- package/src/utils/retry/isNonRetryableError.ts +9 -0
- package/src/utils/retry/jitteredBackoff.ts +21 -0
- package/src/utils/retry/jitteredExponentialRetry.ts +18 -0
- package/src/utils/retry/retry.ts +82 -0
- package/src/utils/sessionListener/SessionListener.native.ts +70 -0
- package/src/utils/sessionListener/SessionListener.ts +74 -0
- package/src/utils/sessionListener/constants.ts +6 -0
- package/src/utils/sessionListener/index.ts +7 -0
- package/src/utils/sessionListener/types.ts +11 -0
- package/src/utils/urlSafeDecode.ts +7 -0
- package/src/utils/urlSafeEncode.ts +9 -0
- package/lib/Amplify.d.ts +0 -28
- package/lib/Amplify.js +0 -109
- package/lib/AwsClients/CognitoIdentity/base.d.ts +0 -28
- package/lib/AwsClients/CognitoIdentity/base.js +0 -113
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +0 -23
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +0 -83
- package/lib/AwsClients/CognitoIdentity/getId.d.ts +0 -23
- package/lib/AwsClients/CognitoIdentity/getId.js +0 -73
- package/lib/AwsClients/Pinpoint/base.d.ts +0 -17
- package/lib/AwsClients/Pinpoint/base.js +0 -39
- package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +0 -23
- package/lib/AwsClients/Pinpoint/getInAppMessages.js +0 -77
- package/lib/AwsClients/Pinpoint/index.d.ts +0 -4
- package/lib/AwsClients/Pinpoint/putEvents.d.ts +0 -23
- package/lib/AwsClients/Pinpoint/putEvents.js +0 -78
- package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +0 -23
- package/lib/AwsClients/Pinpoint/updateEndpoint.js +0 -81
- package/lib/ClientDevice/android.d.ts +0 -5
- package/lib/ClientDevice/android.js +0 -20
- package/lib/ClientDevice/browser.d.ts +0 -25
- package/lib/ClientDevice/browser.js +0 -80
- package/lib/ClientDevice/index.d.ts +0 -23
- package/lib/ClientDevice/index.js +0 -18
- package/lib/ClientDevice/ios.d.ts +0 -7
- package/lib/ClientDevice/ios.js +0 -62
- package/lib/ClientDevice/reactnative.d.ts +0 -7
- package/lib/ClientDevice/reactnative.js +0 -23
- package/lib/Credentials.d.ts +0 -47
- package/lib/Credentials.js +0 -678
- package/lib/Errors.d.ts +0 -2
- package/lib/Errors.js +0 -13
- package/lib/Hub.d.ts +0 -55
- package/lib/Hub.js +0 -219
- package/lib/JS.d.ts +0 -32
- package/lib/JS.js +0 -221
- package/lib/OAuthHelper/FacebookOAuth.d.ts +0 -6
- package/lib/OAuthHelper/FacebookOAuth.js +0 -124
- package/lib/OAuthHelper/GoogleOAuth.d.ts +0 -6
- package/lib/OAuthHelper/GoogleOAuth.js +0 -133
- package/lib/OAuthHelper/index.d.ts +0 -4
- package/lib/OAuthHelper/index.js +0 -9
- package/lib/Providers/AWSCloudWatchProvider.d.ts +0 -34
- package/lib/Providers/AWSCloudWatchProvider.js +0 -596
- package/lib/Providers/index.d.ts +0 -1
- package/lib/Providers/index.js +0 -7
- package/lib/RNComponents/index.d.ts +0 -5
- package/lib/RNComponents/index.js +0 -15
- package/lib/RNComponents/reactnative.d.ts +0 -3
- package/lib/RNComponents/reactnative.js +0 -13
- package/lib/Signer.d.ts +0 -41
- package/lib/Signer.js +0 -130
- package/lib/StorageHelper/index.d.ts +0 -41
- package/lib/StorageHelper/index.js +0 -75
- package/lib/StorageHelper/reactnative.d.ts +0 -13
- package/lib/StorageHelper/reactnative.js +0 -106
- package/lib/UniversalStorage/index.d.ts +0 -23
- package/lib/UniversalStorage/index.js +0 -112
- package/lib/Util/BackgroundProcessManager.d.ts +0 -204
- package/lib/Util/BackgroundProcessManager.js +0 -448
- package/lib/Util/Constants.d.ts +0 -8
- package/lib/Util/Constants.js +0 -23
- package/lib/Util/DateUtils.d.ts +0 -7
- package/lib/Util/DateUtils.js +0 -75
- package/lib/Util/Mutex.d.ts +0 -45
- package/lib/Util/Mutex.js +0 -73
- package/lib/Util/Reachability.d.ts +0 -13
- package/lib/Util/Reachability.js +0 -70
- package/lib/Util/Reachability.native.d.ts +0 -11
- package/lib/Util/Reachability.native.js +0 -44
- package/lib/Util/Retry.d.ts +0 -21
- package/lib/Util/Retry.js +0 -205
- package/lib/Util/StringUtils.d.ts +0 -2
- package/lib/Util/StringUtils.js +0 -24
- package/lib/Util/index.d.ts +0 -7
- package/lib/Util/index.js +0 -35
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.d.ts +0 -5
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.js +0 -15
- package/lib/types/types.d.ts +0 -46
- package/lib-esm/Amplify.d.ts +0 -28
- package/lib-esm/Amplify.js +0 -106
- package/lib-esm/AwsClients/CognitoIdentity/base.d.ts +0 -28
- package/lib-esm/AwsClients/CognitoIdentity/base.js +0 -108
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +0 -23
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +0 -80
- package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +0 -23
- package/lib-esm/AwsClients/CognitoIdentity/getId.js +0 -70
- package/lib-esm/AwsClients/Pinpoint/base.d.ts +0 -17
- package/lib-esm/AwsClients/Pinpoint/base.js +0 -35
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +0 -23
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.js +0 -74
- package/lib-esm/AwsClients/Pinpoint/index.d.ts +0 -4
- package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +0 -23
- package/lib-esm/AwsClients/Pinpoint/putEvents.js +0 -75
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +0 -23
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.js +0 -78
- package/lib-esm/ClientDevice/android.d.ts +0 -5
- package/lib-esm/ClientDevice/android.js +0 -16
- package/lib-esm/ClientDevice/browser.d.ts +0 -25
- package/lib-esm/ClientDevice/browser.js +0 -74
- package/lib-esm/ClientDevice/index.d.ts +0 -23
- package/lib-esm/ClientDevice/index.js +0 -15
- package/lib-esm/ClientDevice/ios.d.ts +0 -7
- package/lib-esm/ClientDevice/ios.js +0 -58
- package/lib-esm/ClientDevice/reactnative.d.ts +0 -7
- package/lib-esm/ClientDevice/reactnative.js +0 -20
- package/lib-esm/Credentials.d.ts +0 -47
- package/lib-esm/Credentials.js +0 -675
- package/lib-esm/Errors.d.ts +0 -2
- package/lib-esm/Errors.js +0 -8
- package/lib-esm/Hub.d.ts +0 -55
- package/lib-esm/Hub.js +0 -216
- package/lib-esm/JS.d.ts +0 -32
- package/lib-esm/JS.js +0 -206
- package/lib-esm/OAuthHelper/FacebookOAuth.d.ts +0 -6
- package/lib-esm/OAuthHelper/FacebookOAuth.js +0 -121
- package/lib-esm/OAuthHelper/GoogleOAuth.d.ts +0 -6
- package/lib-esm/OAuthHelper/GoogleOAuth.js +0 -130
- package/lib-esm/OAuthHelper/index.d.ts +0 -4
- package/lib-esm/OAuthHelper/index.js +0 -6
- package/lib-esm/Providers/AWSCloudWatchProvider.d.ts +0 -34
- package/lib-esm/Providers/AWSCloudWatchProvider.js +0 -593
- package/lib-esm/Providers/index.d.ts +0 -1
- package/lib-esm/Providers/index.js +0 -3
- package/lib-esm/RNComponents/index.d.ts +0 -5
- package/lib-esm/RNComponents/index.js +0 -12
- package/lib-esm/RNComponents/reactnative.d.ts +0 -3
- package/lib-esm/RNComponents/reactnative.js +0 -5
- package/lib-esm/Signer.d.ts +0 -41
- package/lib-esm/Signer.js +0 -127
- package/lib-esm/StorageHelper/index.d.ts +0 -41
- package/lib-esm/StorageHelper/index.js +0 -72
- package/lib-esm/StorageHelper/reactnative.d.ts +0 -13
- package/lib-esm/StorageHelper/reactnative.js +0 -100
- package/lib-esm/UniversalStorage/index.d.ts +0 -23
- package/lib-esm/UniversalStorage/index.js +0 -106
- package/lib-esm/Util/BackgroundProcessManager.d.ts +0 -204
- package/lib-esm/Util/BackgroundProcessManager.js +0 -445
- package/lib-esm/Util/Constants.d.ts +0 -8
- package/lib-esm/Util/Constants.js +0 -14
- package/lib-esm/Util/DateUtils.d.ts +0 -7
- package/lib-esm/Util/DateUtils.js +0 -72
- package/lib-esm/Util/Mutex.d.ts +0 -45
- package/lib-esm/Util/Mutex.js +0 -71
- package/lib-esm/Util/Reachability.d.ts +0 -13
- package/lib-esm/Util/Reachability.js +0 -65
- package/lib-esm/Util/Reachability.native.d.ts +0 -11
- package/lib-esm/Util/Reachability.native.js +0 -39
- package/lib-esm/Util/Retry.d.ts +0 -21
- package/lib-esm/Util/Retry.js +0 -198
- package/lib-esm/Util/StringUtils.d.ts +0 -2
- package/lib-esm/Util/StringUtils.js +0 -19
- package/lib-esm/Util/index.d.ts +0 -7
- package/lib-esm/Util/index.js +0 -9
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.d.ts +0 -5
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js +0 -8
- package/lib-esm/types/types.d.ts +0 -46
- package/polyfills/URL/index.js +0 -1
- package/polyfills/URL/index.ts +0 -14
- package/polyfills/URL/tsconfig.json +0 -10
- package/polyfills/URL/webpack.config.js +0 -43
- package/src/Amplify.ts +0 -100
- package/src/AwsClients/CognitoIdentity/base.ts +0 -93
- package/src/AwsClients/CognitoIdentity/getCredentialsForIdentity.ts +0 -67
- package/src/AwsClients/Pinpoint/base.ts +0 -41
- package/src/AwsClients/Pinpoint/getInAppMessages.ts +0 -56
- package/src/AwsClients/Pinpoint/index.ts +0 -15
- package/src/AwsClients/Pinpoint/putEvents.ts +0 -55
- package/src/AwsClients/Pinpoint/updateEndpoint.ts +0 -60
- package/src/ClientDevice/android.ts +0 -21
- package/src/ClientDevice/browser.ts +0 -93
- package/src/ClientDevice/index.ts +0 -14
- package/src/ClientDevice/ios.ts +0 -64
- package/src/ClientDevice/reactnative.ts +0 -18
- package/src/Credentials.ts +0 -634
- package/src/Errors.ts +0 -9
- package/src/Hub.ts +0 -235
- package/src/JS.ts +0 -259
- package/src/OAuthHelper/FacebookOAuth.ts +0 -83
- package/src/OAuthHelper/GoogleOAuth.ts +0 -94
- package/src/OAuthHelper/index.ts +0 -7
- package/src/Providers/AWSCloudWatchProvider.ts +0 -515
- package/src/Providers/index.ts +0 -3
- package/src/RNComponents/index.ts +0 -15
- package/src/RNComponents/reactnative.ts +0 -6
- package/src/Signer.ts +0 -176
- package/src/StorageHelper/index.ts +0 -73
- package/src/StorageHelper/reactnative.ts +0 -102
- package/src/UniversalStorage/index.ts +0 -119
- package/src/Util/BackgroundProcessManager.ts +0 -451
- package/src/Util/Constants.ts +0 -24
- package/src/Util/DateUtils.ts +0 -86
- package/src/Util/Mutex.ts +0 -96
- package/src/Util/Reachability.native.ts +0 -50
- package/src/Util/Reachability.ts +0 -60
- package/src/Util/Retry.ts +0 -121
- package/src/Util/StringUtils.ts +0 -20
- package/src/Util/index.ts +0 -27
- package/src/clients/middleware/signing/signer/signatureV4/index.native.ts +0 -10
- package/src/types/types.ts +0 -67
- /package/lib/{AwsClients/CognitoIdentity/types.js → Cache/types/cache.js} +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.d.ts +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.js +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.d.ts +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/index.js +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/types.d.ts +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/types.js +0 -0
- /package/lib/{types → singleton/API}/types.js +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity/types.js → Cache/types/cache.js} +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.d.ts +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.js +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.d.ts +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/index.js +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/types.d.ts +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/types.js +0 -0
- /package/lib-esm/{types → singleton/API}/types.js +0 -0
- /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.ts +0 -0
- /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.ts +0 -0
- /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.ts +0 -0
- /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/types.ts +0 -0
package/lib-esm/Signer.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
var __assign = (this && this.__assign) || function () {
|
|
4
|
-
__assign = Object.assign || function(t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
-
t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
return __assign.apply(this, arguments);
|
|
13
|
-
};
|
|
14
|
-
import { DateUtils } from './Util';
|
|
15
|
-
import { presignUrl, signRequest, TOKEN_QUERY_PARAM, } from './clients/middleware/signing/signer/signatureV4';
|
|
16
|
-
var IOT_SERVICE_NAME = 'iotdevicegateway';
|
|
17
|
-
// Best practice regex to parse the service and region from an AWS endpoint
|
|
18
|
-
var AWS_ENDPOINT_REGEX = /([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(.cn)?$/;
|
|
19
|
-
var Signer = /** @class */ (function () {
|
|
20
|
-
function Signer() {
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Sign a HTTP request, add 'Authorization' header to request param
|
|
24
|
-
* @method sign
|
|
25
|
-
* @memberof Signer
|
|
26
|
-
* @static
|
|
27
|
-
*
|
|
28
|
-
* @param {object} request - HTTP request object
|
|
29
|
-
<pre>
|
|
30
|
-
request: {
|
|
31
|
-
method: GET | POST | PUT ...
|
|
32
|
-
url: ...,
|
|
33
|
-
headers: {
|
|
34
|
-
header1: ...
|
|
35
|
-
},
|
|
36
|
-
data: data
|
|
37
|
-
}
|
|
38
|
-
</pre>
|
|
39
|
-
* @param {object} access_info - AWS access credential info
|
|
40
|
-
<pre>
|
|
41
|
-
access_info: {
|
|
42
|
-
access_key: ...,
|
|
43
|
-
secret_key: ...,
|
|
44
|
-
session_token: ...
|
|
45
|
-
}
|
|
46
|
-
</pre>
|
|
47
|
-
* @param {object} [service_info] - AWS service type and region, optional,
|
|
48
|
-
* if not provided then parse out from url
|
|
49
|
-
<pre>
|
|
50
|
-
service_info: {
|
|
51
|
-
service: ...,
|
|
52
|
-
region: ...
|
|
53
|
-
}
|
|
54
|
-
</pre>
|
|
55
|
-
*
|
|
56
|
-
* @returns {object} Signed HTTP request
|
|
57
|
-
*/
|
|
58
|
-
Signer.sign = function (request, accessInfo, serviceInfo) {
|
|
59
|
-
request.headers = request.headers || {};
|
|
60
|
-
if (request.body && !request.data) {
|
|
61
|
-
throw new Error('The attribute "body" was found on the request object. Please use the attribute "data" instead.');
|
|
62
|
-
}
|
|
63
|
-
var requestToSign = __assign(__assign({}, request), { body: request.data, url: new URL(request.url) });
|
|
64
|
-
var options = getOptions(requestToSign, accessInfo, serviceInfo);
|
|
65
|
-
var signedRequest = signRequest(requestToSign, options);
|
|
66
|
-
// Prior to using `signRequest`, Signer accepted urls as strings and outputted urls as string. Coerce the property
|
|
67
|
-
// back to a string so as not to disrupt consumers of Signer.
|
|
68
|
-
signedRequest.url = signedRequest.url.toString();
|
|
69
|
-
// HTTP headers should be case insensitive but, to maintain parity with the previous Signer implementation and
|
|
70
|
-
// limit the impact of this implementation swap, replace lowercased headers with title cased ones.
|
|
71
|
-
signedRequest.headers.Authorization = signedRequest.headers.authorization;
|
|
72
|
-
signedRequest.headers['X-Amz-Security-Token'] =
|
|
73
|
-
signedRequest.headers['x-amz-security-token'];
|
|
74
|
-
delete signedRequest.headers.authorization;
|
|
75
|
-
delete signedRequest.headers['x-amz-security-token'];
|
|
76
|
-
return signedRequest;
|
|
77
|
-
};
|
|
78
|
-
Signer.signUrl = function (urlOrRequest, accessInfo, serviceInfo, expiration) {
|
|
79
|
-
var urlToSign = typeof urlOrRequest === 'object' ? urlOrRequest.url : urlOrRequest;
|
|
80
|
-
var method = typeof urlOrRequest === 'object' ? urlOrRequest.method : 'GET';
|
|
81
|
-
var body = typeof urlOrRequest === 'object' ? urlOrRequest.body : undefined;
|
|
82
|
-
var presignable = {
|
|
83
|
-
body: body,
|
|
84
|
-
method: method,
|
|
85
|
-
url: new URL(urlToSign),
|
|
86
|
-
};
|
|
87
|
-
var options = getOptions(presignable, accessInfo, serviceInfo, expiration);
|
|
88
|
-
var signedUrl = presignUrl(presignable, options);
|
|
89
|
-
if (accessInfo.session_token &&
|
|
90
|
-
!sessionTokenRequiredInSigning(options.signingService)) {
|
|
91
|
-
signedUrl.searchParams.append(TOKEN_QUERY_PARAM, accessInfo.session_token);
|
|
92
|
-
}
|
|
93
|
-
return signedUrl.toString();
|
|
94
|
-
};
|
|
95
|
-
return Signer;
|
|
96
|
-
}());
|
|
97
|
-
export { Signer };
|
|
98
|
-
var getOptions = function (request, accessInfo, serviceInfo, expiration) {
|
|
99
|
-
var _a = accessInfo !== null && accessInfo !== void 0 ? accessInfo : {}, access_key = _a.access_key, secret_key = _a.secret_key, session_token = _a.session_token;
|
|
100
|
-
var _b = parseServiceInfo(request.url), urlRegion = _b.region, urlService = _b.service;
|
|
101
|
-
var _c = serviceInfo !== null && serviceInfo !== void 0 ? serviceInfo : {}, _d = _c.region, region = _d === void 0 ? urlRegion : _d, _e = _c.service, service = _e === void 0 ? urlService : _e;
|
|
102
|
-
var credentials = __assign({ accessKeyId: access_key, secretAccessKey: secret_key }, (sessionTokenRequiredInSigning(service)
|
|
103
|
-
? { sessionToken: session_token }
|
|
104
|
-
: {}));
|
|
105
|
-
return __assign({ credentials: credentials, signingDate: DateUtils.getDateWithClockOffset(), signingRegion: region, signingService: service }, (expiration && { expiration: expiration }));
|
|
106
|
-
};
|
|
107
|
-
// TODO: V6 investigate whether add to custom clients' general signer implementation.
|
|
108
|
-
var parseServiceInfo = function (url) {
|
|
109
|
-
var _a;
|
|
110
|
-
var host = url.host;
|
|
111
|
-
var matched = (_a = host.match(AWS_ENDPOINT_REGEX)) !== null && _a !== void 0 ? _a : [];
|
|
112
|
-
var parsed = matched.slice(1, 3);
|
|
113
|
-
if (parsed[1] === 'es') {
|
|
114
|
-
// Elastic Search
|
|
115
|
-
parsed = parsed.reverse();
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
service: parsed[0],
|
|
119
|
-
region: parsed[1],
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
// IoT service does not allow the session token in the canonical request
|
|
123
|
-
// https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html
|
|
124
|
-
// TODO: V6 investigate whether add to custom clients' general signer implementation.
|
|
125
|
-
var sessionTokenRequiredInSigning = function (service) {
|
|
126
|
-
return service !== IOT_SERVICE_NAME;
|
|
127
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** @class */
|
|
2
|
-
export declare class MemoryStorage {
|
|
3
|
-
/**
|
|
4
|
-
* This is used to set a specific item in storage
|
|
5
|
-
* @param {string} key - the key for the item
|
|
6
|
-
* @param {object} value - the value
|
|
7
|
-
* @returns {string} value that was set
|
|
8
|
-
*/
|
|
9
|
-
static setItem(key: string, value: any): any;
|
|
10
|
-
/**
|
|
11
|
-
* This is used to get a specific key from storage
|
|
12
|
-
* @param {string} key - the key for the item
|
|
13
|
-
* This is used to clear the storage
|
|
14
|
-
* @returns {string} the data item
|
|
15
|
-
*/
|
|
16
|
-
static getItem(key: string): any;
|
|
17
|
-
/**
|
|
18
|
-
* This is used to remove an item from storage
|
|
19
|
-
* @param {string} key - the key being set
|
|
20
|
-
* @returns {string} value - value that was deleted
|
|
21
|
-
*/
|
|
22
|
-
static removeItem(key: string): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* This is used to clear the storage
|
|
25
|
-
* @returns {string} nothing
|
|
26
|
-
*/
|
|
27
|
-
static clear(): {};
|
|
28
|
-
}
|
|
29
|
-
export declare class StorageHelper {
|
|
30
|
-
private storageWindow;
|
|
31
|
-
/**
|
|
32
|
-
* This is used to get a storage object
|
|
33
|
-
* @returns {object} the storage
|
|
34
|
-
*/
|
|
35
|
-
constructor();
|
|
36
|
-
/**
|
|
37
|
-
* This is used to return the storage
|
|
38
|
-
* @returns {object} the storage
|
|
39
|
-
*/
|
|
40
|
-
getStorage(): any;
|
|
41
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
var dataMemory = {};
|
|
4
|
-
/** @class */
|
|
5
|
-
var MemoryStorage = /** @class */ (function () {
|
|
6
|
-
function MemoryStorage() {
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* This is used to set a specific item in storage
|
|
10
|
-
* @param {string} key - the key for the item
|
|
11
|
-
* @param {object} value - the value
|
|
12
|
-
* @returns {string} value that was set
|
|
13
|
-
*/
|
|
14
|
-
MemoryStorage.setItem = function (key, value) {
|
|
15
|
-
dataMemory[key] = value;
|
|
16
|
-
return dataMemory[key];
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* This is used to get a specific key from storage
|
|
20
|
-
* @param {string} key - the key for the item
|
|
21
|
-
* This is used to clear the storage
|
|
22
|
-
* @returns {string} the data item
|
|
23
|
-
*/
|
|
24
|
-
MemoryStorage.getItem = function (key) {
|
|
25
|
-
return Object.prototype.hasOwnProperty.call(dataMemory, key)
|
|
26
|
-
? dataMemory[key]
|
|
27
|
-
: undefined;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* This is used to remove an item from storage
|
|
31
|
-
* @param {string} key - the key being set
|
|
32
|
-
* @returns {string} value - value that was deleted
|
|
33
|
-
*/
|
|
34
|
-
MemoryStorage.removeItem = function (key) {
|
|
35
|
-
return delete dataMemory[key];
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* This is used to clear the storage
|
|
39
|
-
* @returns {string} nothing
|
|
40
|
-
*/
|
|
41
|
-
MemoryStorage.clear = function () {
|
|
42
|
-
dataMemory = {};
|
|
43
|
-
return dataMemory;
|
|
44
|
-
};
|
|
45
|
-
return MemoryStorage;
|
|
46
|
-
}());
|
|
47
|
-
export { MemoryStorage };
|
|
48
|
-
var StorageHelper = /** @class */ (function () {
|
|
49
|
-
/**
|
|
50
|
-
* This is used to get a storage object
|
|
51
|
-
* @returns {object} the storage
|
|
52
|
-
*/
|
|
53
|
-
function StorageHelper() {
|
|
54
|
-
try {
|
|
55
|
-
this.storageWindow = window.localStorage;
|
|
56
|
-
this.storageWindow.setItem('aws.amplify.test-ls', 1);
|
|
57
|
-
this.storageWindow.removeItem('aws.amplify.test-ls');
|
|
58
|
-
}
|
|
59
|
-
catch (exception) {
|
|
60
|
-
this.storageWindow = MemoryStorage;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* This is used to return the storage
|
|
65
|
-
* @returns {object} the storage
|
|
66
|
-
*/
|
|
67
|
-
StorageHelper.prototype.getStorage = function () {
|
|
68
|
-
return this.storageWindow;
|
|
69
|
-
};
|
|
70
|
-
return StorageHelper;
|
|
71
|
-
}());
|
|
72
|
-
export { StorageHelper };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare class StorageHelper {
|
|
2
|
-
private storageWindow;
|
|
3
|
-
/**
|
|
4
|
-
* This is used to get a storage object
|
|
5
|
-
* @returns {object} the storage
|
|
6
|
-
*/
|
|
7
|
-
constructor();
|
|
8
|
-
/**
|
|
9
|
-
* This is used to return the storage
|
|
10
|
-
* @returns {object} the storage
|
|
11
|
-
*/
|
|
12
|
-
getStorage(): any;
|
|
13
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
4
|
-
var MEMORY_KEY_PREFIX = '@MemoryStorage:';
|
|
5
|
-
var dataMemory = {};
|
|
6
|
-
/** @class */
|
|
7
|
-
var MemoryStorage = /** @class */ (function () {
|
|
8
|
-
function MemoryStorage() {
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* This is used to set a specific item in storage
|
|
12
|
-
* @param {string} key - the key for the item
|
|
13
|
-
* @param {object} value - the value
|
|
14
|
-
* @returns {string} value that was set
|
|
15
|
-
*/
|
|
16
|
-
MemoryStorage.setItem = function (key, value) {
|
|
17
|
-
if (value) {
|
|
18
|
-
AsyncStorage.setItem(MEMORY_KEY_PREFIX + key, value);
|
|
19
|
-
dataMemory[key] = value;
|
|
20
|
-
return dataMemory[key];
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* This is used to get a specific key from storage
|
|
25
|
-
* @param {string} key - the key for the item
|
|
26
|
-
* This is used to clear the storage
|
|
27
|
-
* @returns {string} the data item
|
|
28
|
-
*/
|
|
29
|
-
MemoryStorage.getItem = function (key) {
|
|
30
|
-
return Object.prototype.hasOwnProperty.call(dataMemory, key)
|
|
31
|
-
? dataMemory[key]
|
|
32
|
-
: undefined;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* This is used to remove an item from storage
|
|
36
|
-
* @param {string} key - the key being set
|
|
37
|
-
* @returns {string} value - value that was deleted
|
|
38
|
-
*/
|
|
39
|
-
MemoryStorage.removeItem = function (key) {
|
|
40
|
-
AsyncStorage.removeItem(MEMORY_KEY_PREFIX + key);
|
|
41
|
-
return delete dataMemory[key];
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* This is used to clear the storage
|
|
45
|
-
* @returns {string} nothing
|
|
46
|
-
*/
|
|
47
|
-
MemoryStorage.clear = function () {
|
|
48
|
-
dataMemory = {};
|
|
49
|
-
return dataMemory;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Will sync the MemoryStorage data from AsyncStorage to storageWindow MemoryStorage
|
|
53
|
-
* @returns {void}
|
|
54
|
-
*/
|
|
55
|
-
MemoryStorage.sync = function () {
|
|
56
|
-
if (!MemoryStorage.syncPromise) {
|
|
57
|
-
MemoryStorage.syncPromise = new Promise(function (res, rej) {
|
|
58
|
-
AsyncStorage.getAllKeys(function (errKeys, keys) {
|
|
59
|
-
if (errKeys)
|
|
60
|
-
rej(errKeys);
|
|
61
|
-
var memoryKeys = keys.filter(function (key) {
|
|
62
|
-
return key.startsWith(MEMORY_KEY_PREFIX);
|
|
63
|
-
});
|
|
64
|
-
AsyncStorage.multiGet(memoryKeys, function (err, stores) {
|
|
65
|
-
if (err)
|
|
66
|
-
rej(err);
|
|
67
|
-
stores.map(function (result, index, store) {
|
|
68
|
-
var key = store[index][0];
|
|
69
|
-
var value = store[index][1];
|
|
70
|
-
var memoryKey = key.replace(MEMORY_KEY_PREFIX, '');
|
|
71
|
-
dataMemory[memoryKey] = value;
|
|
72
|
-
});
|
|
73
|
-
res();
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
return MemoryStorage.syncPromise;
|
|
79
|
-
};
|
|
80
|
-
MemoryStorage.syncPromise = null;
|
|
81
|
-
return MemoryStorage;
|
|
82
|
-
}());
|
|
83
|
-
var StorageHelper = /** @class */ (function () {
|
|
84
|
-
/**
|
|
85
|
-
* This is used to get a storage object
|
|
86
|
-
* @returns {object} the storage
|
|
87
|
-
*/
|
|
88
|
-
function StorageHelper() {
|
|
89
|
-
this.storageWindow = MemoryStorage;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* This is used to return the storage
|
|
93
|
-
* @returns {object} the storage
|
|
94
|
-
*/
|
|
95
|
-
StorageHelper.prototype.getStorage = function () {
|
|
96
|
-
return this.storageWindow;
|
|
97
|
-
};
|
|
98
|
-
return StorageHelper;
|
|
99
|
-
}());
|
|
100
|
-
export { StorageHelper };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import Cookies, { CookieSetOptions } from 'universal-cookie';
|
|
2
|
-
type Store = Record<string, string>;
|
|
3
|
-
type Context = {
|
|
4
|
-
req?: any;
|
|
5
|
-
};
|
|
6
|
-
export declare class UniversalStorage implements Storage {
|
|
7
|
-
cookies: Cookies;
|
|
8
|
-
store: Store;
|
|
9
|
-
constructor(context?: Context);
|
|
10
|
-
get length(): number;
|
|
11
|
-
clear(): void;
|
|
12
|
-
getItem(key: keyof Store): string;
|
|
13
|
-
protected getLocalItem(key: keyof Store): string;
|
|
14
|
-
protected getUniversalItem(key: keyof Store): any;
|
|
15
|
-
key(index: number): string;
|
|
16
|
-
removeItem(key: string): void;
|
|
17
|
-
protected removeLocalItem(key: keyof Store): void;
|
|
18
|
-
protected removeUniversalItem(key: keyof Store): void;
|
|
19
|
-
setItem(key: keyof Store, value: string): void;
|
|
20
|
-
protected setLocalItem(key: keyof Store, value: string): void;
|
|
21
|
-
protected setUniversalItem(key: keyof Store, value: string, options?: CookieSetOptions): void;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
13
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
14
|
-
import Cookies from 'universal-cookie';
|
|
15
|
-
import { browserOrNode } from '../JS';
|
|
16
|
-
var isBrowser = browserOrNode().isBrowser;
|
|
17
|
-
var ONE_YEAR_IN_MS = 365 * 24 * 60 * 60 * 1000;
|
|
18
|
-
var UniversalStorage = /** @class */ (function () {
|
|
19
|
-
function UniversalStorage(context) {
|
|
20
|
-
if (context === void 0) { context = {}; }
|
|
21
|
-
this.cookies = new Cookies();
|
|
22
|
-
this.store = isBrowser ? window.localStorage : Object.create(null);
|
|
23
|
-
this.cookies = context.req
|
|
24
|
-
? new Cookies(decodeURIComponent(context.req.headers.cookie))
|
|
25
|
-
: new Cookies();
|
|
26
|
-
Object.assign(this.store, this.cookies.getAll());
|
|
27
|
-
}
|
|
28
|
-
Object.defineProperty(UniversalStorage.prototype, "length", {
|
|
29
|
-
get: function () {
|
|
30
|
-
return Object.entries(this.store).length;
|
|
31
|
-
},
|
|
32
|
-
enumerable: false,
|
|
33
|
-
configurable: true
|
|
34
|
-
});
|
|
35
|
-
UniversalStorage.prototype.clear = function () {
|
|
36
|
-
var _this = this;
|
|
37
|
-
Array.from(new Array(this.length))
|
|
38
|
-
.map(function (_, i) { return _this.key(i); })
|
|
39
|
-
.forEach(function (key) { return _this.removeItem(key); });
|
|
40
|
-
};
|
|
41
|
-
UniversalStorage.prototype.getItem = function (key) {
|
|
42
|
-
return this.getLocalItem(key);
|
|
43
|
-
};
|
|
44
|
-
UniversalStorage.prototype.getLocalItem = function (key) {
|
|
45
|
-
return Object.prototype.hasOwnProperty.call(this.store, key)
|
|
46
|
-
? this.store[key]
|
|
47
|
-
: null;
|
|
48
|
-
};
|
|
49
|
-
UniversalStorage.prototype.getUniversalItem = function (key) {
|
|
50
|
-
return this.cookies.get(key);
|
|
51
|
-
};
|
|
52
|
-
UniversalStorage.prototype.key = function (index) {
|
|
53
|
-
return Object.keys(this.store)[index];
|
|
54
|
-
};
|
|
55
|
-
UniversalStorage.prototype.removeItem = function (key) {
|
|
56
|
-
this.removeLocalItem(key);
|
|
57
|
-
this.removeUniversalItem(key);
|
|
58
|
-
};
|
|
59
|
-
UniversalStorage.prototype.removeLocalItem = function (key) {
|
|
60
|
-
delete this.store[key];
|
|
61
|
-
};
|
|
62
|
-
UniversalStorage.prototype.removeUniversalItem = function (key) {
|
|
63
|
-
this.cookies.remove(key, {
|
|
64
|
-
path: '/',
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
UniversalStorage.prototype.setItem = function (key, value) {
|
|
68
|
-
this.setLocalItem(key, value);
|
|
69
|
-
// keys take the shape:
|
|
70
|
-
// 1. `${ProviderPrefix}.${userPoolClientId}.${username}.${tokenType}
|
|
71
|
-
// 2. `${ProviderPrefix}.${userPoolClientId}.LastAuthUser
|
|
72
|
-
var tokenType = key.split('.').pop();
|
|
73
|
-
var sessionTokenTypes = [
|
|
74
|
-
'LastAuthUser',
|
|
75
|
-
'accessToken',
|
|
76
|
-
// refreshToken originates on the client, but SSR pages won't fail when this expires
|
|
77
|
-
// Note: the new `accessToken` will also be refreshed on the client (since Amplify doesn't set server-side cookies)
|
|
78
|
-
'refreshToken',
|
|
79
|
-
// Required for CognitoUserSession
|
|
80
|
-
'idToken',
|
|
81
|
-
// userData is used when `Auth.currentAuthenticatedUser({ bypassCache: false })`.
|
|
82
|
-
// Can be persisted to speed up calls to `Auth.currentAuthenticatedUser()`
|
|
83
|
-
// 'userData',
|
|
84
|
-
// Ignoring clockDrift on the server for now, but needs testing
|
|
85
|
-
// 'clockDrift',
|
|
86
|
-
];
|
|
87
|
-
if (sessionTokenTypes.includes(tokenType !== null && tokenType !== void 0 ? tokenType : '')) {
|
|
88
|
-
this.setUniversalItem(key, value, {
|
|
89
|
-
expires: new Date(Date.now() + ONE_YEAR_IN_MS),
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
UniversalStorage.prototype.setLocalItem = function (key, value) {
|
|
94
|
-
this.store[key] = value;
|
|
95
|
-
};
|
|
96
|
-
UniversalStorage.prototype.setUniversalItem = function (key, value, options) {
|
|
97
|
-
if (options === void 0) { options = {}; }
|
|
98
|
-
this.cookies.set(key, value, __assign(__assign({}, options), { path: '/',
|
|
99
|
-
// `httpOnly` cannot be set via JavaScript: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#JavaScript_access_using_Document.cookie
|
|
100
|
-
sameSite: true,
|
|
101
|
-
// Allow unsecure requests to http://localhost:3000/ when in development.
|
|
102
|
-
secure: isBrowser && window.location.hostname === 'localhost' ? false : true }));
|
|
103
|
-
};
|
|
104
|
-
return UniversalStorage;
|
|
105
|
-
}());
|
|
106
|
-
export { UniversalStorage };
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @private For internal Amplify use.
|
|
3
|
-
*
|
|
4
|
-
* Creates a new scope for promises, observables, and other types of work or
|
|
5
|
-
* processes that may be running in the background. This manager provides
|
|
6
|
-
* an singular entrypoint to request termination and await completion.
|
|
7
|
-
*
|
|
8
|
-
* As work completes on its own prior to close, the manager removes them
|
|
9
|
-
* from the registry to avoid holding references to completed jobs.
|
|
10
|
-
*/
|
|
11
|
-
export declare class BackgroundProcessManager {
|
|
12
|
-
/**
|
|
13
|
-
* A string indicating whether the manager is accepting new work ("Open"),
|
|
14
|
-
* waiting for work to complete ("Closing"), or fully done with all
|
|
15
|
-
* submitted work and *not* accepting new jobs ("Closed").
|
|
16
|
-
*/
|
|
17
|
-
private _state;
|
|
18
|
-
private _closingPromise;
|
|
19
|
-
/**
|
|
20
|
-
* The list of outstanding jobs we'll need to wait for upon `close()`
|
|
21
|
-
*/
|
|
22
|
-
private jobs;
|
|
23
|
-
/**
|
|
24
|
-
* Creates a new manager for promises, observables, and other types
|
|
25
|
-
* of work that may be running in the background. This manager provides
|
|
26
|
-
* a centralized mechanism to request termination and await completion.
|
|
27
|
-
*/
|
|
28
|
-
constructor();
|
|
29
|
-
/**
|
|
30
|
-
* Executes an async `job` function, passing the return value through to
|
|
31
|
-
* the caller, registering it as a running job in the manager. When the
|
|
32
|
-
* manager *closes*, it will `await` the job.
|
|
33
|
-
*
|
|
34
|
-
* @param job The function to execute.
|
|
35
|
-
* @param description Optional description to help identify pending jobs.
|
|
36
|
-
* @returns The return value from the given function.
|
|
37
|
-
*/
|
|
38
|
-
add<T>(job: () => Promise<T>, description?: string): Promise<T>;
|
|
39
|
-
/**
|
|
40
|
-
* Executes an async `job` function, passing the return value through to
|
|
41
|
-
* the caller, registering it as a running job in the manager. When the
|
|
42
|
-
* manager *closes*, it will request termination by resolving the
|
|
43
|
-
* provided `onTerminate` promise. It will then `await` the job, so it is
|
|
44
|
-
* important that the job still `resolve()` or `reject()` when responding
|
|
45
|
-
* to a termination request.
|
|
46
|
-
*
|
|
47
|
-
* @param job The function to execute.
|
|
48
|
-
* @param description Optional description to help identify pending jobs.
|
|
49
|
-
* @returns The return value from the given function.
|
|
50
|
-
*/
|
|
51
|
-
add<T>(job: (onTerminate: Promise<void>) => Promise<T>, description?: string): Promise<T>;
|
|
52
|
-
/**
|
|
53
|
-
* Create a no-op job, registers it with the manager, and returns hooks
|
|
54
|
-
* to the caller to signal the job's completion and respond to termination
|
|
55
|
-
* requests.
|
|
56
|
-
*
|
|
57
|
-
* When the manager closes, the no-op job will be `await`-ed, so its
|
|
58
|
-
* important to always `resolve()` or `reject()` when done responding to an
|
|
59
|
-
* `onTerminate` signal.
|
|
60
|
-
* @param description Optional description to help identify pending jobs.
|
|
61
|
-
* @returns Job promise hooks + onTerminate signaling promise
|
|
62
|
-
*/
|
|
63
|
-
add(description?: string): {
|
|
64
|
-
resolve: (value?: unknown) => void;
|
|
65
|
-
reject: (reason?: any) => void;
|
|
66
|
-
onTerminate: Promise<void>;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Adds another job manager to await on at the time of closing. the inner
|
|
70
|
-
* manager's termination is signaled when this manager's `close()` is
|
|
71
|
-
* called for.
|
|
72
|
-
*
|
|
73
|
-
* @param job The inner job manager to await.
|
|
74
|
-
* @param description Optional description to help identify pending jobs.
|
|
75
|
-
*/
|
|
76
|
-
add(job: BackgroundProcessManager, description?: string): any;
|
|
77
|
-
/**
|
|
78
|
-
* Adds a **cleaner** function that doesn't immediately get executed.
|
|
79
|
-
* Instead, the caller gets a **terminate** function back. The *cleaner* is
|
|
80
|
-
* invoked only once the mananger *closes* or the returned **terminate**
|
|
81
|
-
* function is called.
|
|
82
|
-
*
|
|
83
|
-
* @param clean The cleanup function.
|
|
84
|
-
* @param description Optional description to help identify pending jobs.
|
|
85
|
-
* @returns A terminate function.
|
|
86
|
-
*/
|
|
87
|
-
addCleaner<T>(clean: () => Promise<T>, description?: string): () => Promise<void>;
|
|
88
|
-
private addFunction;
|
|
89
|
-
private addManager;
|
|
90
|
-
/**
|
|
91
|
-
* Creates and registers a fabricated job for processes that need to operate
|
|
92
|
-
* with callbacks/hooks. The returned `resolve` and `reject`
|
|
93
|
-
* functions can be used to signal the job is done successfully or not.
|
|
94
|
-
* The returned `onTerminate` is a promise that will resolve when the
|
|
95
|
-
* manager is requesting the termination of the job.
|
|
96
|
-
*
|
|
97
|
-
* @param description Optional description to help identify pending jobs.
|
|
98
|
-
* @returns `{ resolve, reject, onTerminate }`
|
|
99
|
-
*/
|
|
100
|
-
private addHook;
|
|
101
|
-
/**
|
|
102
|
-
* Adds a Promise based job to the list of jobs for monitoring and listens
|
|
103
|
-
* for either a success or failure, upon which the job is considered "done"
|
|
104
|
-
* and removed from the registry.
|
|
105
|
-
*
|
|
106
|
-
* @param promise A promise that is on its way to being returned to a
|
|
107
|
-
* caller, which needs to be tracked as a background job.
|
|
108
|
-
* @param terminate The termination function to register, which can be
|
|
109
|
-
* invoked to request the job stop.
|
|
110
|
-
* @param description Optional description to help identify pending jobs.
|
|
111
|
-
*/
|
|
112
|
-
private registerPromise;
|
|
113
|
-
/**
|
|
114
|
-
* The number of jobs being waited on.
|
|
115
|
-
*
|
|
116
|
-
* We don't use this for anything. It's just informational for the caller,
|
|
117
|
-
* and can be used in logging and testing.
|
|
118
|
-
*
|
|
119
|
-
* @returns the number of jobs.
|
|
120
|
-
*/
|
|
121
|
-
get length(): number;
|
|
122
|
-
/**
|
|
123
|
-
* The execution state of the manager. One of:
|
|
124
|
-
*
|
|
125
|
-
* 1. "Open" -> Accepting new jobs
|
|
126
|
-
* 1. "Closing" -> Not accepting new work. Waiting for jobs to complete.
|
|
127
|
-
* 1. "Closed" -> Not accepting new work. All submitted jobs are complete.
|
|
128
|
-
*/
|
|
129
|
-
get state(): BackgroundProcessManagerState;
|
|
130
|
-
/**
|
|
131
|
-
* The registered `description` of all still-pending jobs.
|
|
132
|
-
*
|
|
133
|
-
* @returns descriptions as an array.
|
|
134
|
-
*/
|
|
135
|
-
get pending(): string[];
|
|
136
|
-
/**
|
|
137
|
-
* Whether the manager is accepting new jobs.
|
|
138
|
-
*/
|
|
139
|
-
get isOpen(): boolean;
|
|
140
|
-
/**
|
|
141
|
-
* Whether the manager is rejecting new work, but still waiting for
|
|
142
|
-
* submitted work to complete.
|
|
143
|
-
*/
|
|
144
|
-
get isClosing(): boolean;
|
|
145
|
-
/**
|
|
146
|
-
* Whether the manager is rejecting work and done waiting for submitted
|
|
147
|
-
* work to complete.
|
|
148
|
-
*/
|
|
149
|
-
get isClosed(): boolean;
|
|
150
|
-
private closedFailure;
|
|
151
|
-
/**
|
|
152
|
-
* Signals jobs to stop (for those that accept interruptions) and waits
|
|
153
|
-
* for confirmation that jobs have stopped.
|
|
154
|
-
*
|
|
155
|
-
* This immediately puts the manager into a closing state and just begins
|
|
156
|
-
* to reject new work. After all work in the manager is complete, the
|
|
157
|
-
* manager goes into a `Completed` state and `close()` returns.
|
|
158
|
-
*
|
|
159
|
-
* This call is idempotent.
|
|
160
|
-
*
|
|
161
|
-
* If the manager is already closing or closed, `finalCleaup` is not executed.
|
|
162
|
-
*
|
|
163
|
-
* @param onClosed
|
|
164
|
-
* @returns The settled results of each still-running job's promise. If the
|
|
165
|
-
* manager is already closed, this will contain the results as of when the
|
|
166
|
-
* manager's `close()` was called in an `Open` state.
|
|
167
|
-
*/
|
|
168
|
-
close(): Promise<any>;
|
|
169
|
-
/**
|
|
170
|
-
* Signals the manager to start accepting work (again) and returns once
|
|
171
|
-
* the manager is ready to do so.
|
|
172
|
-
*
|
|
173
|
-
* If the state is already `Open`, this call is a no-op.
|
|
174
|
-
*
|
|
175
|
-
* If the state is `Closed`, this call simply updates state and returns.
|
|
176
|
-
*
|
|
177
|
-
* If the state is `Closing`, this call waits for completion before it
|
|
178
|
-
* updates the state and returns.
|
|
179
|
-
*/
|
|
180
|
-
open(): Promise<void>;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
*
|
|
184
|
-
*/
|
|
185
|
-
export declare class BackgroundManagerNotOpenError extends Error {
|
|
186
|
-
constructor(message: string);
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* All possible states a `BackgroundProcessManager` instance can be in.
|
|
190
|
-
*/
|
|
191
|
-
export declare enum BackgroundProcessManagerState {
|
|
192
|
-
/**
|
|
193
|
-
* Accepting new jobs.
|
|
194
|
-
*/
|
|
195
|
-
Open = "Open",
|
|
196
|
-
/**
|
|
197
|
-
* Not accepting new jobs. Waiting for submitted jobs to complete.
|
|
198
|
-
*/
|
|
199
|
-
Closing = "Closing",
|
|
200
|
-
/**
|
|
201
|
-
* Not accepting new jobs. All submitted jobs are complete.
|
|
202
|
-
*/
|
|
203
|
-
Closed = "Closed"
|
|
204
|
-
}
|