@aws-amplify/core 6.0.1-preview-testing.034e780.0 → 6.0.1-server-generate-client.1e317a1.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/internals/aws-clients/pinpoint/package.json +4 -4
- package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
- package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.js +28 -0
- package/lib/{Util → BackgroundProcessManager}/BackgroundProcessManager.d.ts +1 -23
- package/lib/{Util → BackgroundProcessManager}/BackgroundProcessManager.js +13 -56
- 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 +14 -31
- package/lib/Cache/StorageCache.js +97 -102
- package/lib/Cache/StorageCache.native.d.ts +19 -0
- package/lib/Cache/StorageCache.native.js +164 -0
- package/lib/Cache/{AsyncStorageCache.d.ts → StorageCacheCommon.d.ts} +124 -99
- package/lib/Cache/{AsyncStorageCache.js → StorageCacheCommon.js} +494 -441
- 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 -1
- package/lib/Cache/types/index.js +1 -1
- package/lib/Cache/{Utils → utils}/CacheList.d.ts +1 -1
- package/lib/Cache/{Utils → utils}/CacheList.js +7 -19
- package/lib/Cache/utils/cacheHelpers.d.ts +14 -0
- package/lib/Cache/utils/cacheHelpers.js +51 -0
- package/lib/Cache/utils/errorHelpers.d.ts +7 -0
- package/lib/Cache/utils/errorHelpers.js +25 -0
- package/lib/Cache/utils/index.d.ts +2 -0
- package/lib/Cache/utils/index.js +12 -0
- package/lib/Hub/index.d.ts +7 -0
- package/lib/Hub/index.js +12 -5
- package/lib/Hub/types/AuthTypes.d.ts +19 -0
- package/lib/I18n/I18n.d.ts +3 -19
- package/lib/I18n/I18n.js +1 -21
- package/lib/I18n/errorHelpers.d.ts +5 -0
- package/lib/I18n/errorHelpers.js +17 -0
- package/lib/I18n/index.d.ts +3 -15
- package/lib/I18n/index.js +5 -30
- package/lib/I18n/types.d.ts +1 -4
- package/lib/I18n/types.js +5 -8
- package/lib/Logger/ConsoleLogger.js +2 -2
- package/{lib-esm/Util → lib/Mutex}/Mutex.d.ts +2 -15
- package/lib/{Util → Mutex}/Mutex.js +2 -1
- 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/Platform/customUserAgent.d.ts +16 -0
- package/lib/Platform/customUserAgent.js +70 -0
- package/lib/Platform/index.js +10 -1
- 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/{Util → Reachability}/Reachability.js +24 -23
- package/lib/Reachability/Reachability.native.d.ts +6 -0
- package/lib/{Util → Reachability}/Reachability.native.js +8 -10
- 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.js +84 -54
- package/lib/ServiceWorker/errorHelpers.d.ts +7 -0
- package/lib/ServiceWorker/errorHelpers.js +25 -0
- package/lib/ServiceWorker/index.d.ts +0 -12
- package/lib/ServiceWorker/index.js +0 -12
- package/lib/{Signer.js → Signer/Signer.js} +6 -5
- package/lib/Signer/index.d.ts +1 -0
- package/lib/Signer/index.js +7 -0
- package/lib/adapterCore/error/AmplifyServerContextError.d.ts +1 -1
- package/lib/adapterCore/error/AmplifyServerContextError.js +2 -2
- package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.js +2 -1
- package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.d.ts +2 -1
- package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.d.ts +2 -1
- package/lib/awsClients/cognitoIdentity/types.js +4 -0
- package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/base.js +2 -1
- package/lib/awsClients/pinpoint/errorHelpers.d.ts +5 -0
- package/lib/awsClients/pinpoint/errorHelpers.js +17 -0
- package/{lib-esm/AwsClients/Pinpoint → lib/awsClients/pinpoint}/getInAppMessages.d.ts +4 -3
- package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/getInAppMessages.js +2 -1
- package/{lib-esm/AwsClients/Pinpoint → lib/awsClients/pinpoint}/putEvents.d.ts +4 -3
- package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/putEvents.js +4 -7
- package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.d.ts +4 -3
- package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.js +2 -1
- package/lib/clients/handlers/fetch.js +2 -1
- package/lib/clients/middleware/retry/jitteredBackoff.js +2 -2
- package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js +2 -1
- package/lib/clients/types/http.d.ts +17 -1
- package/lib/constants.d.ts +4 -0
- package/lib/constants.js +18 -0
- package/lib/{Util/Errors.d.ts → errors/AmplifyError.d.ts} +2 -9
- package/lib/{Util/Errors.js → errors/AmplifyError.js} +1 -18
- package/lib/errors/PlatformNotSupportedError.d.ts +4 -0
- package/lib/errors/PlatformNotSupportedError.js +33 -0
- package/lib/errors/createAssertionFunction.d.ts +3 -0
- package/lib/errors/createAssertionFunction.js +22 -0
- package/lib/errors/errorHelpers.d.ts +2 -0
- package/lib/errors/errorHelpers.js +20 -0
- package/lib/errors/index.d.ts +4 -0
- package/lib/errors/index.js +13 -0
- package/lib/index.d.ts +7 -7
- package/lib/index.js +17 -16
- package/lib/libraryUtils.d.ts +19 -16
- package/lib/libraryUtils.js +57 -69
- package/lib/parseAWSExports.js +144 -13
- 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 +1 -0
- package/lib/providers/pinpoint/apis/index.js +3 -1
- package/lib/providers/pinpoint/apis/record.d.ts +1 -1
- package/lib/providers/pinpoint/apis/record.js +8 -24
- package/lib/providers/pinpoint/apis/updateEndpoint.d.ts +1 -1
- package/lib/providers/pinpoint/apis/updateEndpoint.js +15 -13
- package/lib/providers/pinpoint/index.d.ts +2 -1
- package/lib/providers/pinpoint/index.js +5 -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 +1 -0
- package/lib/providers/pinpoint/types/index.js +3 -0
- package/lib/providers/pinpoint/types/pinpoint.d.ts +5 -4
- package/lib/providers/pinpoint/utils/PinpointEventBuffer.d.ts +1 -0
- package/lib/providers/pinpoint/utils/PinpointEventBuffer.js +12 -7
- package/lib/providers/pinpoint/utils/index.d.ts +1 -0
- package/lib/providers/pinpoint/utils/index.js +3 -1
- package/lib/providers/pinpoint/utils/isAppInForeground.d.ts +1 -0
- package/lib/{RNComponents → providers/pinpoint/utils}/isAppInForeground.js +1 -4
- 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/{StorageHelper/inMemoryStorage.js → providers/pinpoint/utils/resolveEndpointId.js} +44 -41
- package/lib/singleton/API/types.d.ts +165 -0
- package/lib/singleton/API/types.js +12 -0
- package/lib/singleton/Amplify.d.ts +2 -2
- package/lib/singleton/Amplify.js +6 -5
- package/lib/singleton/Analytics/types.d.ts +4 -1
- package/lib/singleton/Auth/types.d.ts +29 -2
- package/lib/singleton/Auth/utils/errorHelpers.d.ts +8 -0
- package/lib/singleton/Auth/utils/errorHelpers.js +33 -0
- package/lib/singleton/Auth/utils/index.d.ts +1 -1
- package/lib/singleton/Auth/utils/index.js +21 -36
- 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/types.d.ts +10 -1
- package/{lib-esm/StorageHelper/cookieStorage.d.ts → lib/storage/CookieStorage.d.ts} +4 -3
- package/lib/{StorageHelper/cookieStorage.js → storage/CookieStorage.js} +38 -83
- package/lib/storage/CookieStorage.native.d.ts +7 -0
- package/lib/storage/CookieStorage.native.js +32 -0
- package/lib/storage/DefaultStorage.d.ts +7 -0
- package/lib/storage/DefaultStorage.js +33 -0
- package/{lib-esm/StorageHelper/localStorage.d.ts → lib/storage/DefaultStorage.native.d.ts} +6 -5
- package/lib/{StorageHelper/localStorage.js → storage/DefaultStorage.native.js} +25 -43
- package/lib/storage/InMemoryStorage.d.ts +12 -0
- package/lib/storage/InMemoryStorage.js +41 -0
- package/lib/{StorageHelper/sessionStorage.d.ts → storage/KeyValueStorage.d.ts} +5 -4
- package/{lib-esm/StorageHelper/sessionStorage.js → lib/storage/KeyValueStorage.js} +20 -19
- package/lib/storage/SessionStorage.d.ts +7 -0
- package/lib/storage/SessionStorage.js +33 -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 +26 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core.d.ts +4 -1
- package/lib/types/errors.d.ts +9 -3
- package/lib/types/errors.js +7 -0
- package/lib/types/storage.d.ts +3 -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 +18 -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/deepFreeze.d.ts +1 -0
- package/lib/utils/deepFreeze.js +38 -0
- package/lib/utils/generateRandomString.d.ts +1 -0
- package/lib/utils/generateRandomString.js +14 -0
- package/lib/{ClientDevice/android.d.ts → utils/getClientInfo/getClientInfo.android.d.ts} +1 -1
- package/lib/{ClientDevice/android.js → utils/getClientInfo/getClientInfo.android.js} +4 -4
- package/{lib-esm/ClientDevice/browser.d.ts → lib/utils/getClientInfo/getClientInfo.d.ts} +1 -9
- package/lib/{ClientDevice/ios.d.ts → utils/getClientInfo/getClientInfo.ios.d.ts} +1 -1
- package/lib/{ClientDevice/ios.js → utils/getClientInfo/getClientInfo.ios.js} +4 -4
- package/lib/{ClientDevice/browser.js → utils/getClientInfo/getClientInfo.js} +6 -18
- 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 +9 -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 +30 -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 +20 -0
- package/lib/utils/retry/jitteredExponentialRetry.d.ts +5 -0
- package/lib/utils/retry/jitteredExponentialRetry.js +17 -0
- package/lib/utils/retry/retry.d.ts +6 -0
- package/lib/{Util/Retry.js → utils/retry/retry.js} +6 -57
- package/lib/utils/sessionListener/SessionListener.d.ts +10 -0
- package/lib/utils/sessionListener/SessionListener.js +55 -0
- package/lib/utils/sessionListener/SessionListener.native.d.ts +10 -0
- package/lib/utils/sessionListener/SessionListener.native.js +54 -0
- package/lib/utils/sessionListener/index.d.ts +2 -0
- package/lib/utils/sessionListener/index.js +7 -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/{Util/StringUtils.js → utils/urlSafeDecode.js} +2 -9
- 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 +25 -0
- package/lib-esm/{Util → BackgroundProcessManager}/BackgroundProcessManager.d.ts +1 -23
- package/lib-esm/{Util → BackgroundProcessManager}/BackgroundProcessManager.js +4 -47
- 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 +14 -31
- package/lib-esm/Cache/StorageCache.js +97 -102
- package/lib-esm/Cache/StorageCache.native.d.ts +19 -0
- package/lib-esm/Cache/StorageCache.native.js +161 -0
- package/lib-esm/Cache/{AsyncStorageCache.d.ts → StorageCacheCommon.d.ts} +124 -99
- package/lib-esm/Cache/{AsyncStorageCache.js → StorageCacheCommon.js} +494 -437
- 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 -1
- package/lib-esm/Cache/types/index.js +1 -1
- package/lib-esm/Cache/{Utils → utils}/CacheList.d.ts +1 -1
- package/lib-esm/Cache/{Utils → utils}/CacheList.js +6 -19
- package/lib-esm/Cache/utils/cacheHelpers.d.ts +14 -0
- package/lib-esm/Cache/utils/cacheHelpers.js +44 -0
- package/lib-esm/Cache/utils/errorHelpers.d.ts +7 -0
- package/lib-esm/Cache/utils/errorHelpers.js +22 -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 +7 -0
- package/lib-esm/Hub/index.js +9 -2
- package/lib-esm/Hub/types/AuthTypes.d.ts +19 -0
- package/lib-esm/I18n/I18n.d.ts +3 -19
- package/lib-esm/I18n/I18n.js +1 -21
- package/lib-esm/I18n/errorHelpers.d.ts +5 -0
- package/lib-esm/I18n/errorHelpers.js +14 -0
- package/lib-esm/I18n/index.d.ts +3 -15
- package/lib-esm/I18n/index.js +5 -30
- package/lib-esm/I18n/types.d.ts +1 -4
- package/lib-esm/I18n/types.js +4 -7
- package/lib-esm/Logger/ConsoleLogger.js +1 -1
- package/{lib/Util → lib-esm/Mutex}/Mutex.d.ts +2 -15
- package/lib-esm/{Util → Mutex}/Mutex.js +1 -1
- 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/Platform/customUserAgent.d.ts +16 -0
- package/lib-esm/Platform/customUserAgent.js +65 -0
- package/lib-esm/Platform/index.js +10 -1
- 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/{Util → Reachability}/Reachability.js +22 -19
- package/lib-esm/Reachability/Reachability.native.d.ts +6 -0
- package/lib-esm/{Util → Reachability}/Reachability.native.js +6 -6
- 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.js +78 -48
- package/lib-esm/ServiceWorker/errorHelpers.d.ts +7 -0
- package/lib-esm/ServiceWorker/errorHelpers.js +22 -0
- package/lib-esm/ServiceWorker/index.d.ts +0 -12
- package/lib-esm/ServiceWorker/index.js +0 -12
- package/lib-esm/{Signer.js → Signer/Signer.js} +5 -4
- 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 +1 -1
- package/lib-esm/adapterCore/error/AmplifyServerContextError.js +1 -1
- package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.js +2 -1
- package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.d.ts +2 -1
- package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.d.ts +2 -1
- package/lib-esm/awsClients/cognitoIdentity/types.js +3 -0
- package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/base.js +2 -1
- package/lib-esm/awsClients/pinpoint/errorHelpers.d.ts +5 -0
- package/lib-esm/awsClients/pinpoint/errorHelpers.js +14 -0
- package/{lib/AwsClients/Pinpoint → lib-esm/awsClients/pinpoint}/getInAppMessages.d.ts +4 -3
- package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/getInAppMessages.js +2 -1
- package/{lib/AwsClients/Pinpoint → lib-esm/awsClients/pinpoint}/putEvents.d.ts +4 -3
- package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/putEvents.js +4 -7
- package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.d.ts +4 -3
- package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.js +2 -1
- package/lib-esm/clients/handlers/fetch.js +2 -1
- package/lib-esm/clients/middleware/retry/jitteredBackoff.js +1 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js +2 -1
- package/lib-esm/clients/types/http.d.ts +17 -1
- package/lib-esm/constants.d.ts +4 -0
- package/lib-esm/{Util/Constants.js → constants.js} +0 -11
- package/lib-esm/{Util/Errors.d.ts → errors/AmplifyError.d.ts} +2 -9
- package/lib-esm/{Util/Errors.js → errors/AmplifyError.js} +0 -15
- package/lib-esm/errors/PlatformNotSupportedError.d.ts +4 -0
- package/lib-esm/errors/PlatformNotSupportedError.js +30 -0
- package/lib-esm/errors/createAssertionFunction.d.ts +3 -0
- package/lib-esm/errors/createAssertionFunction.js +18 -0
- package/lib-esm/errors/errorHelpers.d.ts +2 -0
- package/lib-esm/errors/errorHelpers.js +17 -0
- package/lib-esm/errors/index.d.ts +4 -0
- package/lib-esm/errors/index.js +6 -0
- package/lib-esm/index.d.ts +7 -7
- package/lib-esm/index.js +7 -6
- package/lib-esm/libraryUtils.d.ts +19 -16
- package/lib-esm/libraryUtils.js +20 -18
- package/lib-esm/parseAWSExports.js +144 -13
- 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 +1 -0
- package/lib-esm/providers/pinpoint/apis/index.js +1 -0
- package/lib-esm/providers/pinpoint/apis/record.d.ts +1 -1
- package/lib-esm/providers/pinpoint/apis/record.js +9 -25
- package/lib-esm/providers/pinpoint/apis/updateEndpoint.d.ts +1 -1
- package/lib-esm/providers/pinpoint/apis/updateEndpoint.js +14 -12
- package/lib-esm/providers/pinpoint/index.d.ts +2 -1
- package/lib-esm/providers/pinpoint/index.js +2 -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 +1 -0
- package/lib-esm/providers/pinpoint/types/index.js +1 -0
- package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +5 -4
- package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.d.ts +1 -0
- package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.js +11 -6
- package/lib-esm/providers/pinpoint/utils/index.d.ts +1 -0
- package/lib-esm/providers/pinpoint/utils/index.js +1 -0
- package/lib-esm/providers/pinpoint/utils/isAppInForeground.js +3 -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 +81 -0
- package/lib-esm/singleton/API/types.d.ts +165 -0
- package/lib-esm/singleton/API/types.js +9 -0
- package/lib-esm/singleton/Amplify.d.ts +2 -2
- package/lib-esm/singleton/Amplify.js +6 -5
- package/lib-esm/singleton/Analytics/types.d.ts +4 -1
- package/lib-esm/singleton/Auth/types.d.ts +29 -2
- package/lib-esm/singleton/Auth/utils/errorHelpers.d.ts +8 -0
- package/lib-esm/singleton/Auth/utils/errorHelpers.js +30 -0
- package/lib-esm/singleton/Auth/utils/index.d.ts +1 -1
- package/lib-esm/singleton/Auth/utils/index.js +19 -34
- 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/types.d.ts +10 -1
- package/{lib/StorageHelper/cookieStorage.d.ts → lib-esm/storage/CookieStorage.d.ts} +4 -3
- package/lib-esm/{StorageHelper/cookieStorage.js → storage/CookieStorage.js} +36 -61
- package/lib-esm/storage/CookieStorage.native.d.ts +7 -0
- package/lib-esm/storage/CookieStorage.native.js +29 -0
- package/lib-esm/storage/DefaultStorage.d.ts +7 -0
- package/lib-esm/storage/DefaultStorage.js +30 -0
- package/{lib/StorageHelper/localStorage.d.ts → lib-esm/storage/DefaultStorage.native.d.ts} +6 -5
- package/{lib/StorageHelper/sessionStorage.js → lib-esm/storage/DefaultStorage.native.js} +24 -45
- package/lib-esm/storage/InMemoryStorage.d.ts +12 -0
- package/lib-esm/storage/InMemoryStorage.js +38 -0
- package/lib-esm/{StorageHelper/sessionStorage.d.ts → storage/KeyValueStorage.d.ts} +5 -4
- package/lib-esm/{StorageHelper/localStorage.js → storage/KeyValueStorage.js} +17 -19
- package/lib-esm/storage/SessionStorage.d.ts +7 -0
- package/lib-esm/storage/SessionStorage.js +30 -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 +21 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/core.d.ts +4 -1
- package/lib-esm/types/errors.d.ts +9 -3
- package/lib-esm/types/errors.js +6 -1
- package/lib-esm/types/storage.d.ts +3 -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 +15 -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/deepFreeze.d.ts +1 -0
- package/lib-esm/utils/deepFreeze.js +34 -0
- package/lib-esm/utils/generateRandomString.d.ts +1 -0
- package/lib-esm/utils/generateRandomString.js +10 -0
- package/lib-esm/{ClientDevice/android.d.ts → utils/getClientInfo/getClientInfo.android.d.ts} +1 -1
- package/lib-esm/{ClientDevice/android.js → utils/getClientInfo/getClientInfo.android.js} +2 -2
- package/{lib/ClientDevice/browser.d.ts → lib-esm/utils/getClientInfo/getClientInfo.d.ts} +1 -9
- package/lib-esm/{ClientDevice/ios.d.ts → utils/getClientInfo/getClientInfo.ios.d.ts} +1 -1
- package/lib-esm/{ClientDevice/ios.js → utils/getClientInfo/getClientInfo.ios.js} +2 -2
- package/lib-esm/{ClientDevice/browser.js → utils/getClientInfo/getClientInfo.js} +4 -14
- 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 +5 -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 +27 -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 +16 -0
- package/lib-esm/utils/retry/jitteredExponentialRetry.d.ts +5 -0
- package/lib-esm/utils/retry/jitteredExponentialRetry.js +13 -0
- package/lib-esm/utils/retry/retry.d.ts +6 -0
- package/lib-esm/{Util/Retry.js → utils/retry/retry.js} +4 -52
- package/lib-esm/utils/sessionListener/SessionListener.d.ts +10 -0
- package/lib-esm/utils/sessionListener/SessionListener.js +52 -0
- package/lib-esm/utils/sessionListener/SessionListener.native.d.ts +10 -0
- package/lib-esm/utils/sessionListener/SessionListener.native.js +51 -0
- package/lib-esm/utils/sessionListener/index.d.ts +2 -0
- package/lib-esm/utils/sessionListener/index.js +4 -0
- package/lib-esm/utils/sessionListener/types.d.ts +6 -0
- package/lib-esm/utils/sessionListener/types.js +3 -0
- package/lib-esm/{Util/StringUtils.d.ts → utils/urlSafeDecode.d.ts} +0 -1
- package/lib-esm/{Util/StringUtils.js → utils/urlSafeDecode.js} +0 -6
- package/{lib/Util/StringUtils.d.ts → lib-esm/utils/urlSafeEncode.d.ts} +0 -1
- package/lib-esm/utils/urlSafeEncode.js +8 -0
- package/package.json +12 -26
- package/src/BackgroundProcessManager/BackgroundManagerNotOpenError.ts +8 -0
- package/src/{Util → BackgroundProcessManager}/BackgroundProcessManager.ts +4 -58
- 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 -158
- 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 -4
- package/src/Cache/{Utils → utils}/CacheList.ts +185 -198
- package/src/Cache/utils/cacheHelpers.ts +52 -0
- package/src/Cache/utils/errorHelpers.ts +26 -0
- package/src/Cache/{Utils → utils}/index.ts +4 -5
- package/src/Hub/index.ts +11 -2
- package/src/Hub/types/AuthTypes.ts +12 -1
- package/src/I18n/I18n.ts +4 -25
- package/src/I18n/errorHelpers.ts +18 -0
- package/src/I18n/index.ts +9 -33
- package/src/I18n/types.ts +1 -4
- package/src/Logger/ConsoleLogger.ts +1 -1
- package/src/{Util → Mutex}/Mutex.ts +2 -20
- package/src/Mutex/index.ts +4 -0
- package/src/Mutex/types.ts +20 -0
- package/src/Platform/customUserAgent.ts +75 -0
- package/src/Platform/index.ts +14 -1
- package/src/Platform/types.ts +84 -39
- package/src/Platform/version.ts +1 -1
- package/src/{Util → Reachability}/Reachability.native.ts +7 -12
- 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 +39 -48
- package/src/ServiceWorker/errorHelpers.ts +26 -0
- package/src/ServiceWorker/index.ts +0 -12
- package/src/{Util → Signer}/DateUtils.ts +1 -1
- package/src/{Signer.ts → Signer/Signer.ts} +5 -4
- package/src/Signer/index.ts +4 -0
- package/src/adapterCore/error/AmplifyServerContextError.ts +1 -1
- package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.ts +4 -1
- package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/base.ts +2 -1
- package/src/awsClients/pinpoint/errorHelpers.ts +19 -0
- package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/getInAppMessages.ts +2 -1
- package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/putEvents.ts +4 -7
- package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.ts +2 -1
- package/src/clients/handlers/fetch.ts +5 -1
- package/src/clients/middleware/retry/jitteredBackoff.ts +1 -1
- package/src/clients/middleware/signing/signer/signatureV4/presignUrl.ts +2 -1
- package/src/clients/types/http.ts +19 -1
- package/src/{Util/Constants.ts → constants.ts} +0 -11
- package/src/{Util/Errors.ts → errors/AmplifyError.ts} +2 -18
- 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/index.ts +15 -11
- package/src/libraryUtils.ts +57 -57
- package/src/parseAWSExports.ts +179 -14
- 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 +1 -0
- package/src/providers/pinpoint/apis/record.ts +14 -28
- package/src/providers/pinpoint/apis/updateEndpoint.ts +26 -10
- package/src/providers/pinpoint/index.ts +6 -1
- package/src/providers/pinpoint/types/errors.ts +12 -0
- package/src/providers/pinpoint/types/index.ts +1 -0
- package/src/providers/pinpoint/types/pinpoint.ts +5 -3
- package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +21 -13
- package/src/providers/pinpoint/utils/index.ts +1 -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/singleton/API/types.ts +203 -0
- package/src/singleton/Amplify.ts +10 -8
- package/src/singleton/Analytics/types.ts +7 -1
- package/src/singleton/Auth/types.ts +51 -2
- package/src/singleton/Auth/utils/errorHelpers.ts +37 -0
- package/src/singleton/Auth/utils/index.ts +35 -38
- 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/types.ts +12 -6
- 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/{StorageHelper/sessionStorage.ts → storage/KeyValueStorage.ts} +15 -18
- 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 +4 -1
- package/src/types/errors.ts +15 -3
- package/src/types/storage.ts +4 -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/deepFreeze.ts +16 -0
- package/src/utils/generateRandomString.ts +16 -0
- package/src/{ClientDevice/android.ts → utils/getClientInfo/getClientInfo.android.ts} +2 -2
- package/src/{ClientDevice/ios.ts → utils/getClientInfo/getClientInfo.ios.ts} +3 -3
- package/src/{ClientDevice/browser.ts → utils/getClientInfo/getClientInfo.ts} +4 -16
- 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/{Util/Retry.ts → utils/retry/retry.ts} +4 -44
- package/src/utils/sessionListener/SessionListener.native.ts +70 -0
- package/src/utils/sessionListener/SessionListener.ts +74 -0
- package/src/utils/sessionListener/index.ts +6 -0
- package/src/utils/sessionListener/types.ts +11 -0
- package/src/{Util/StringUtils.ts → utils/urlSafeDecode.ts} +0 -6
- package/src/utils/urlSafeEncode.ts +9 -0
- package/lib/Amplify.d.ts +0 -29
- package/lib/Amplify.js +0 -118
- package/lib/Cache/BrowserStorageCache.d.ts +0 -166
- package/lib/Cache/BrowserStorageCache.js +0 -469
- package/lib/Cache/InMemoryCache.d.ts +0 -129
- package/lib/Cache/InMemoryCache.js +0 -349
- package/lib/Cache/Utils/CacheUtils.d.ts +0 -25
- package/lib/Cache/Utils/CacheUtils.js +0 -88
- package/lib/Cache/Utils/index.d.ts +0 -2
- package/lib/Cache/Utils/index.js +0 -16
- package/lib/Cache/reactnative.d.ts +0 -3
- package/lib/Cache/reactnative.js +0 -8
- package/lib/Cache/types/Cache.d.ts +0 -55
- package/lib/ClientDevice/index.d.ts +0 -23
- package/lib/ClientDevice/index.js +0 -18
- package/lib/ClientDevice/reactnative.d.ts +0 -7
- package/lib/ClientDevice/reactnative.js +0 -24
- package/lib/RNComponents/index.d.ts +0 -6
- package/lib/RNComponents/index.js +0 -16
- package/lib/RNComponents/reactnative.d.ts +0 -3
- package/lib/RNComponents/reactnative.js +0 -14
- package/lib/StorageHelper/inMemoryStorage.d.ts +0 -10
- package/lib/StorageHelper/index.d.ts +0 -45
- package/lib/StorageHelper/index.js +0 -83
- package/lib/StorageHelper/reactnative.d.ts +0 -83
- package/lib/StorageHelper/reactnative.js +0 -250
- package/lib/Util/Constants.d.ts +0 -12
- package/lib/Util/Constants.js +0 -29
- package/lib/Util/JS.d.ts +0 -29
- package/lib/Util/JS.js +0 -214
- package/lib/Util/Reachability.d.ts +0 -13
- package/lib/Util/Reachability.native.d.ts +0 -12
- package/lib/Util/Retry.d.ts +0 -21
- package/lib/Util/errors/AssertError.d.ts +0 -2
- package/lib/Util/errors/AssertError.js +0 -11
- package/lib/Util/index.d.ts +0 -7
- package/lib/Util/index.js +0 -31
- 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-esm/Amplify.d.ts +0 -29
- package/lib-esm/Amplify.js +0 -115
- package/lib-esm/Cache/BrowserStorageCache.d.ts +0 -166
- package/lib-esm/Cache/BrowserStorageCache.js +0 -466
- package/lib-esm/Cache/InMemoryCache.d.ts +0 -129
- package/lib-esm/Cache/InMemoryCache.js +0 -346
- package/lib-esm/Cache/Utils/CacheUtils.d.ts +0 -25
- package/lib-esm/Cache/Utils/CacheUtils.js +0 -81
- package/lib-esm/Cache/Utils/index.d.ts +0 -2
- package/lib-esm/Cache/Utils/index.js +0 -4
- package/lib-esm/Cache/reactnative.d.ts +0 -3
- package/lib-esm/Cache/reactnative.js +0 -6
- package/lib-esm/Cache/types/Cache.d.ts +0 -55
- package/lib-esm/ClientDevice/index.d.ts +0 -23
- package/lib-esm/ClientDevice/index.js +0 -15
- package/lib-esm/ClientDevice/reactnative.d.ts +0 -7
- package/lib-esm/ClientDevice/reactnative.js +0 -21
- package/lib-esm/RNComponents/index.d.ts +0 -6
- package/lib-esm/RNComponents/index.js +0 -13
- package/lib-esm/RNComponents/isAppInForeground.js +0 -6
- package/lib-esm/RNComponents/reactnative.d.ts +0 -3
- package/lib-esm/RNComponents/reactnative.js +0 -6
- package/lib-esm/StorageHelper/inMemoryStorage.d.ts +0 -10
- package/lib-esm/StorageHelper/inMemoryStorage.js +0 -79
- package/lib-esm/StorageHelper/index.d.ts +0 -45
- package/lib-esm/StorageHelper/index.js +0 -76
- package/lib-esm/StorageHelper/reactnative.d.ts +0 -83
- package/lib-esm/StorageHelper/reactnative.js +0 -244
- package/lib-esm/Util/Constants.d.ts +0 -12
- package/lib-esm/Util/JS.d.ts +0 -29
- package/lib-esm/Util/JS.js +0 -199
- package/lib-esm/Util/Reachability.d.ts +0 -13
- package/lib-esm/Util/Reachability.native.d.ts +0 -12
- package/lib-esm/Util/Retry.d.ts +0 -21
- package/lib-esm/Util/errors/AssertError.d.ts +0 -2
- package/lib-esm/Util/errors/AssertError.js +0 -7
- 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/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 -106
- package/src/Cache/AsyncStorageCache.ts +0 -500
- package/src/Cache/BrowserStorageCache.ts +0 -517
- package/src/Cache/CHANGELOG.md +0 -1239
- package/src/Cache/InMemoryCache.ts +0 -354
- package/src/Cache/Utils/CacheUtils.ts +0 -92
- package/src/Cache/reactnative.ts +0 -9
- package/src/Cache/types/Cache.ts +0 -75
- package/src/ClientDevice/index.ts +0 -14
- package/src/ClientDevice/reactnative.ts +0 -18
- package/src/RNComponents/index.ts +0 -16
- package/src/RNComponents/isAppInForeground.ts +0 -8
- package/src/RNComponents/reactnative.ts +0 -6
- package/src/StorageHelper/cookieStorage.ts +0 -99
- package/src/StorageHelper/inMemoryStorage.ts +0 -32
- package/src/StorageHelper/index.ts +0 -78
- package/src/StorageHelper/localStorage.ts +0 -60
- package/src/StorageHelper/reactnative.ts +0 -182
- package/src/Util/JS.ts +0 -255
- package/src/Util/Reachability.ts +0 -58
- package/src/Util/errors/AssertError.ts +0 -11
- package/src/Util/index.ts +0 -23
- package/src/clients/middleware/signing/signer/signatureV4/index.native.ts +0 -10
- /package/lib/{AwsClients/CognitoIdentity/types.js → Cache/types/cache.js} +0 -0
- /package/lib/{Cache/types/Cache.js → Mutex/types.js} +0 -0
- /package/lib/{Util → Signer}/DateUtils.d.ts +0 -0
- /package/lib/{Util → Signer}/DateUtils.js +0 -0
- /package/lib/{Signer.d.ts → Signer/Signer.d.ts} +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.d.ts +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.js +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.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}/base.d.ts +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/index.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-esm/{AwsClients/CognitoIdentity/types.js → Cache/types/cache.js} +0 -0
- /package/lib-esm/{Cache/types/Cache.js → Mutex/types.js} +0 -0
- /package/lib-esm/{Util → Signer}/DateUtils.d.ts +0 -0
- /package/lib-esm/{Util → Signer}/DateUtils.js +0 -0
- /package/lib-esm/{Signer.d.ts → Signer/Signer.d.ts} +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.d.ts +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.js +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.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}/base.d.ts +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/index.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/{RNComponents → providers/pinpoint/utils}/isAppInForeground.d.ts +0 -0
- /package/{lib/RNComponents/isAppInForeground.d.ts → lib-esm/providers/pinpoint/utils/isAppInForeground.native.d.ts} +0 -0
- /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.ts +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}/index.ts +0 -0
- /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/types.ts +0 -0
package/lib/Util/JS.js
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.isStrictObject = exports.transferKeyToUpperCase = exports.transferKeyToLowerCase = exports.isBrowser = exports.isWebWorker = exports.makeQuerablePromise = exports.generateRandomString = exports.isTextFile = exports.filenameToContentType = exports.objectLessAttributes = exports.sortByField = exports.isEmpty = void 0;
|
|
6
|
-
var MIME_MAP = [
|
|
7
|
-
{ type: 'text/plain', ext: 'txt' },
|
|
8
|
-
{ type: 'text/html', ext: 'html' },
|
|
9
|
-
{ type: 'text/javascript', ext: 'js' },
|
|
10
|
-
{ type: 'text/css', ext: 'css' },
|
|
11
|
-
{ type: 'text/csv', ext: 'csv' },
|
|
12
|
-
{ type: 'text/yaml', ext: 'yml' },
|
|
13
|
-
{ type: 'text/yaml', ext: 'yaml' },
|
|
14
|
-
{ type: 'text/calendar', ext: 'ics' },
|
|
15
|
-
{ type: 'text/calendar', ext: 'ical' },
|
|
16
|
-
{ type: 'image/apng', ext: 'apng' },
|
|
17
|
-
{ type: 'image/bmp', ext: 'bmp' },
|
|
18
|
-
{ type: 'image/gif', ext: 'gif' },
|
|
19
|
-
{ type: 'image/x-icon', ext: 'ico' },
|
|
20
|
-
{ type: 'image/x-icon', ext: 'cur' },
|
|
21
|
-
{ type: 'image/jpeg', ext: 'jpg' },
|
|
22
|
-
{ type: 'image/jpeg', ext: 'jpeg' },
|
|
23
|
-
{ type: 'image/jpeg', ext: 'jfif' },
|
|
24
|
-
{ type: 'image/jpeg', ext: 'pjp' },
|
|
25
|
-
{ type: 'image/jpeg', ext: 'pjpeg' },
|
|
26
|
-
{ type: 'image/png', ext: 'png' },
|
|
27
|
-
{ type: 'image/svg+xml', ext: 'svg' },
|
|
28
|
-
{ type: 'image/tiff', ext: 'tif' },
|
|
29
|
-
{ type: 'image/tiff', ext: 'tiff' },
|
|
30
|
-
{ type: 'image/webp', ext: 'webp' },
|
|
31
|
-
{ type: 'application/json', ext: 'json' },
|
|
32
|
-
{ type: 'application/xml', ext: 'xml' },
|
|
33
|
-
{ type: 'application/x-sh', ext: 'sh' },
|
|
34
|
-
{ type: 'application/zip', ext: 'zip' },
|
|
35
|
-
{ type: 'application/x-rar-compressed', ext: 'rar' },
|
|
36
|
-
{ type: 'application/x-tar', ext: 'tar' },
|
|
37
|
-
{ type: 'application/x-bzip', ext: 'bz' },
|
|
38
|
-
{ type: 'application/x-bzip2', ext: 'bz2' },
|
|
39
|
-
{ type: 'application/pdf', ext: 'pdf' },
|
|
40
|
-
{ type: 'application/java-archive', ext: 'jar' },
|
|
41
|
-
{ type: 'application/msword', ext: 'doc' },
|
|
42
|
-
{ type: 'application/vnd.ms-excel', ext: 'xls' },
|
|
43
|
-
{ type: 'application/vnd.ms-excel', ext: 'xlsx' },
|
|
44
|
-
{ type: 'message/rfc822', ext: 'eml' },
|
|
45
|
-
];
|
|
46
|
-
var isEmpty = function (obj) {
|
|
47
|
-
if (obj === void 0) { obj = {}; }
|
|
48
|
-
return Object.keys(obj).length === 0;
|
|
49
|
-
};
|
|
50
|
-
exports.isEmpty = isEmpty;
|
|
51
|
-
var sortByField = function (list, field, dir) {
|
|
52
|
-
if (!list || !list.sort) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
var dirX = dir && dir === 'desc' ? -1 : 1;
|
|
56
|
-
list.sort(function (a, b) {
|
|
57
|
-
var a_val = a[field];
|
|
58
|
-
var b_val = b[field];
|
|
59
|
-
if (typeof b_val === 'undefined') {
|
|
60
|
-
return typeof a_val === 'undefined' ? 0 : 1 * dirX;
|
|
61
|
-
}
|
|
62
|
-
if (typeof a_val === 'undefined') {
|
|
63
|
-
return -1 * dirX;
|
|
64
|
-
}
|
|
65
|
-
if (a_val < b_val) {
|
|
66
|
-
return -1 * dirX;
|
|
67
|
-
}
|
|
68
|
-
if (a_val > b_val) {
|
|
69
|
-
return 1 * dirX;
|
|
70
|
-
}
|
|
71
|
-
return 0;
|
|
72
|
-
});
|
|
73
|
-
return true;
|
|
74
|
-
};
|
|
75
|
-
exports.sortByField = sortByField;
|
|
76
|
-
var objectLessAttributes = function (obj, less) {
|
|
77
|
-
var ret = Object.assign({}, obj);
|
|
78
|
-
if (less) {
|
|
79
|
-
if (typeof less === 'string') {
|
|
80
|
-
delete ret[less];
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
less.forEach(function (attr) {
|
|
84
|
-
delete ret[attr];
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return ret;
|
|
89
|
-
};
|
|
90
|
-
exports.objectLessAttributes = objectLessAttributes;
|
|
91
|
-
var filenameToContentType = function (filename, defVal) {
|
|
92
|
-
if (defVal === void 0) { defVal = 'application/octet-stream'; }
|
|
93
|
-
var name = filename.toLowerCase();
|
|
94
|
-
var filtered = MIME_MAP.filter(function (mime) { return name.endsWith('.' + mime.ext); });
|
|
95
|
-
return filtered.length > 0 ? filtered[0].type : defVal;
|
|
96
|
-
};
|
|
97
|
-
exports.filenameToContentType = filenameToContentType;
|
|
98
|
-
var isTextFile = function (contentType) {
|
|
99
|
-
var type = contentType.toLowerCase();
|
|
100
|
-
if (type.startsWith('text/')) {
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
return ('application/json' === type ||
|
|
104
|
-
'application/xml' === type ||
|
|
105
|
-
'application/sh' === type);
|
|
106
|
-
};
|
|
107
|
-
exports.isTextFile = isTextFile;
|
|
108
|
-
var generateRandomString = function () {
|
|
109
|
-
var result = '';
|
|
110
|
-
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
111
|
-
for (var i = 32; i > 0; i -= 1) {
|
|
112
|
-
result += chars[Math.floor(Math.random() * chars.length)];
|
|
113
|
-
}
|
|
114
|
-
return result;
|
|
115
|
-
};
|
|
116
|
-
exports.generateRandomString = generateRandomString;
|
|
117
|
-
var makeQuerablePromise = function (promise) {
|
|
118
|
-
if (promise.isResolved)
|
|
119
|
-
return promise;
|
|
120
|
-
var isPending = true;
|
|
121
|
-
var isRejected = false;
|
|
122
|
-
var isFullfilled = false;
|
|
123
|
-
var result = promise.then(function (data) {
|
|
124
|
-
isFullfilled = true;
|
|
125
|
-
isPending = false;
|
|
126
|
-
return data;
|
|
127
|
-
}, function (e) {
|
|
128
|
-
isRejected = true;
|
|
129
|
-
isPending = false;
|
|
130
|
-
throw e;
|
|
131
|
-
});
|
|
132
|
-
result.isFullfilled = function () { return isFullfilled; };
|
|
133
|
-
result.isPending = function () { return isPending; };
|
|
134
|
-
result.isRejected = function () { return isRejected; };
|
|
135
|
-
return result;
|
|
136
|
-
};
|
|
137
|
-
exports.makeQuerablePromise = makeQuerablePromise;
|
|
138
|
-
var isWebWorker = function () {
|
|
139
|
-
if (typeof self === 'undefined') {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
var selfContext = self;
|
|
143
|
-
return (typeof selfContext.WorkerGlobalScope !== 'undefined' &&
|
|
144
|
-
self instanceof selfContext.WorkerGlobalScope);
|
|
145
|
-
};
|
|
146
|
-
exports.isWebWorker = isWebWorker;
|
|
147
|
-
var isBrowser = function () {
|
|
148
|
-
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
149
|
-
};
|
|
150
|
-
exports.isBrowser = isBrowser;
|
|
151
|
-
/**
|
|
152
|
-
* transfer the first letter of the keys to lowercase
|
|
153
|
-
* @param {Object} obj - the object need to be transferred
|
|
154
|
-
* @param {Array} whiteListForItself - whitelist itself from being transferred
|
|
155
|
-
* @param {Array} whiteListForChildren - whitelist its children keys from being transferred
|
|
156
|
-
*/
|
|
157
|
-
var transferKeyToLowerCase = function (obj, whiteListForItself, whiteListForChildren) {
|
|
158
|
-
if (whiteListForItself === void 0) { whiteListForItself = []; }
|
|
159
|
-
if (whiteListForChildren === void 0) { whiteListForChildren = []; }
|
|
160
|
-
if (!(0, exports.isStrictObject)(obj))
|
|
161
|
-
return obj;
|
|
162
|
-
var ret = {};
|
|
163
|
-
for (var key in obj) {
|
|
164
|
-
if (obj.hasOwnProperty(key)) {
|
|
165
|
-
var transferedKey = whiteListForItself.includes(key)
|
|
166
|
-
? key
|
|
167
|
-
: key[0].toLowerCase() + key.slice(1);
|
|
168
|
-
ret[transferedKey] = whiteListForChildren.includes(key)
|
|
169
|
-
? obj[key]
|
|
170
|
-
: (0, exports.transferKeyToLowerCase)(obj[key], whiteListForItself, whiteListForChildren);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return ret;
|
|
174
|
-
};
|
|
175
|
-
exports.transferKeyToLowerCase = transferKeyToLowerCase;
|
|
176
|
-
/**
|
|
177
|
-
* transfer the first letter of the keys to lowercase
|
|
178
|
-
* @param {Object} obj - the object need to be transferred
|
|
179
|
-
* @param {Array} whiteListForItself - whitelist itself from being transferred
|
|
180
|
-
* @param {Array} whiteListForChildren - whitelist its children keys from being transferred
|
|
181
|
-
*/
|
|
182
|
-
var transferKeyToUpperCase = function (obj, whiteListForItself, whiteListForChildren) {
|
|
183
|
-
if (whiteListForItself === void 0) { whiteListForItself = []; }
|
|
184
|
-
if (whiteListForChildren === void 0) { whiteListForChildren = []; }
|
|
185
|
-
if (!(0, exports.isStrictObject)(obj))
|
|
186
|
-
return obj;
|
|
187
|
-
var ret = {};
|
|
188
|
-
for (var key in obj) {
|
|
189
|
-
if (obj.hasOwnProperty(key)) {
|
|
190
|
-
var transferredKey = whiteListForItself.includes(key)
|
|
191
|
-
? key
|
|
192
|
-
: key[0].toUpperCase() + key.slice(1);
|
|
193
|
-
ret[transferredKey] = whiteListForChildren.includes(key)
|
|
194
|
-
? obj[key]
|
|
195
|
-
: (0, exports.transferKeyToUpperCase)(obj[key], whiteListForItself, whiteListForChildren);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return ret;
|
|
199
|
-
};
|
|
200
|
-
exports.transferKeyToUpperCase = transferKeyToUpperCase;
|
|
201
|
-
/**
|
|
202
|
-
* Return true if the object is a strict object
|
|
203
|
-
* which means it's not Array, Function, Number, String, Boolean or Null
|
|
204
|
-
* @param obj the Object
|
|
205
|
-
*/
|
|
206
|
-
var isStrictObject = function (obj) {
|
|
207
|
-
return (obj instanceof Object &&
|
|
208
|
-
!(obj instanceof Array) &&
|
|
209
|
-
!(obj instanceof Function) &&
|
|
210
|
-
!(obj instanceof Number) &&
|
|
211
|
-
!(obj instanceof String) &&
|
|
212
|
-
!(obj instanceof Boolean));
|
|
213
|
-
};
|
|
214
|
-
exports.isStrictObject = isStrictObject;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Observable from 'zen-observable-ts';
|
|
2
|
-
type NetworkStatus = {
|
|
3
|
-
online: boolean;
|
|
4
|
-
};
|
|
5
|
-
export default class ReachabilityNavigator implements Reachability {
|
|
6
|
-
private static _observers;
|
|
7
|
-
networkMonitor(netInfo?: any): Observable<NetworkStatus>;
|
|
8
|
-
private static _observerOverride;
|
|
9
|
-
}
|
|
10
|
-
interface Reachability {
|
|
11
|
-
networkMonitor(netInfo?: any): Observable<NetworkStatus>;
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import Observable from 'zen-observable-ts';
|
|
2
|
-
import type NetInfo from '@react-native-community/netinfo';
|
|
3
|
-
type NetworkStatus = {
|
|
4
|
-
online: boolean;
|
|
5
|
-
};
|
|
6
|
-
export default class ReachabilityNavigator implements Reachability {
|
|
7
|
-
networkMonitor(netInfo?: typeof NetInfo): Observable<NetworkStatus>;
|
|
8
|
-
}
|
|
9
|
-
interface Reachability {
|
|
10
|
-
networkMonitor(netInfo?: typeof NetInfo): Observable<NetworkStatus>;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
package/lib/Util/Retry.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DelayFunction } from '../types';
|
|
2
|
-
export declare class NonRetryableError extends Error {
|
|
3
|
-
readonly nonRetryable = true;
|
|
4
|
-
constructor(message: string);
|
|
5
|
-
}
|
|
6
|
-
export declare const isNonRetryableError: (obj: any) => obj is NonRetryableError;
|
|
7
|
-
/**
|
|
8
|
-
* @private
|
|
9
|
-
* Internal use of Amplify only
|
|
10
|
-
*/
|
|
11
|
-
export declare function retry<T>(functionToRetry: (...args: any[]) => T, args: any[], delayFn: DelayFunction, onTerminate?: Promise<void>): Promise<T>;
|
|
12
|
-
/**
|
|
13
|
-
* @private
|
|
14
|
-
* Internal use of Amplify only
|
|
15
|
-
*/
|
|
16
|
-
export declare function jitteredBackoff(maxDelayMs?: number): DelayFunction;
|
|
17
|
-
/**
|
|
18
|
-
* @private
|
|
19
|
-
* Internal use of Amplify only
|
|
20
|
-
*/
|
|
21
|
-
export declare const jitteredExponentialRetry: <T>(functionToRetry: (...args: any[]) => T, args: any[], maxDelayMs?: number, onTerminate?: Promise<void>) => Promise<T>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.asserts = void 0;
|
|
4
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
var Errors_1 = require("../Errors");
|
|
7
|
-
function asserts(assertion, errorParams) {
|
|
8
|
-
if (!assertion)
|
|
9
|
-
throw new Errors_1.AmplifyError(errorParams);
|
|
10
|
-
}
|
|
11
|
-
exports.asserts = asserts;
|
package/lib/Util/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { NonRetryableError, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, } from './Retry';
|
|
2
|
-
export { default as Mutex } from './Mutex';
|
|
3
|
-
export { default as Reachability } from './Reachability';
|
|
4
|
-
export { DateUtils } from './DateUtils';
|
|
5
|
-
export { urlSafeDecode, urlSafeEncode } from './StringUtils';
|
|
6
|
-
export { AWS_CLOUDWATCH_CATEGORY, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, } from './Constants';
|
|
7
|
-
export { BackgroundProcessManager, BackgroundManagerNotOpenError, BackgroundProcessManagerState, } from './BackgroundProcessManager';
|
package/lib/Util/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BackgroundProcessManagerState = exports.BackgroundManagerNotOpenError = exports.BackgroundProcessManager = exports.RETRY_ERROR_CODES = exports.NO_CREDS_ERROR_STRING = exports.AWS_CLOUDWATCH_CATEGORY = exports.urlSafeEncode = exports.urlSafeDecode = exports.DateUtils = exports.Reachability = exports.Mutex = exports.retry = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isNonRetryableError = exports.NonRetryableError = void 0;
|
|
7
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
-
var Retry_1 = require("./Retry");
|
|
10
|
-
Object.defineProperty(exports, "NonRetryableError", { enumerable: true, get: function () { return Retry_1.NonRetryableError; } });
|
|
11
|
-
Object.defineProperty(exports, "isNonRetryableError", { enumerable: true, get: function () { return Retry_1.isNonRetryableError; } });
|
|
12
|
-
Object.defineProperty(exports, "jitteredBackoff", { enumerable: true, get: function () { return Retry_1.jitteredBackoff; } });
|
|
13
|
-
Object.defineProperty(exports, "jitteredExponentialRetry", { enumerable: true, get: function () { return Retry_1.jitteredExponentialRetry; } });
|
|
14
|
-
Object.defineProperty(exports, "retry", { enumerable: true, get: function () { return Retry_1.retry; } });
|
|
15
|
-
var Mutex_1 = require("./Mutex");
|
|
16
|
-
Object.defineProperty(exports, "Mutex", { enumerable: true, get: function () { return __importDefault(Mutex_1).default; } });
|
|
17
|
-
var Reachability_1 = require("./Reachability");
|
|
18
|
-
Object.defineProperty(exports, "Reachability", { enumerable: true, get: function () { return __importDefault(Reachability_1).default; } });
|
|
19
|
-
var DateUtils_1 = require("./DateUtils");
|
|
20
|
-
Object.defineProperty(exports, "DateUtils", { enumerable: true, get: function () { return DateUtils_1.DateUtils; } });
|
|
21
|
-
var StringUtils_1 = require("./StringUtils");
|
|
22
|
-
Object.defineProperty(exports, "urlSafeDecode", { enumerable: true, get: function () { return StringUtils_1.urlSafeDecode; } });
|
|
23
|
-
Object.defineProperty(exports, "urlSafeEncode", { enumerable: true, get: function () { return StringUtils_1.urlSafeEncode; } });
|
|
24
|
-
var Constants_1 = require("./Constants");
|
|
25
|
-
Object.defineProperty(exports, "AWS_CLOUDWATCH_CATEGORY", { enumerable: true, get: function () { return Constants_1.AWS_CLOUDWATCH_CATEGORY; } });
|
|
26
|
-
Object.defineProperty(exports, "NO_CREDS_ERROR_STRING", { enumerable: true, get: function () { return Constants_1.NO_CREDS_ERROR_STRING; } });
|
|
27
|
-
Object.defineProperty(exports, "RETRY_ERROR_CODES", { enumerable: true, get: function () { return Constants_1.RETRY_ERROR_CODES; } });
|
|
28
|
-
var BackgroundProcessManager_1 = require("./BackgroundProcessManager");
|
|
29
|
-
Object.defineProperty(exports, "BackgroundProcessManager", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManager; } });
|
|
30
|
-
Object.defineProperty(exports, "BackgroundManagerNotOpenError", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundManagerNotOpenError; } });
|
|
31
|
-
Object.defineProperty(exports, "BackgroundProcessManagerState", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManagerState; } });
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getHashedPayload = exports.TOKEN_QUERY_PARAM = exports.presignUrl = exports.signRequest = void 0;
|
|
6
|
-
require("@aws-amplify/core/polyfills/URL");
|
|
7
|
-
// TODO: V6 replace Signer
|
|
8
|
-
var signRequest_1 = require("./signRequest");
|
|
9
|
-
Object.defineProperty(exports, "signRequest", { enumerable: true, get: function () { return signRequest_1.signRequest; } });
|
|
10
|
-
var presignUrl_1 = require("./presignUrl");
|
|
11
|
-
Object.defineProperty(exports, "presignUrl", { enumerable: true, get: function () { return presignUrl_1.presignUrl; } });
|
|
12
|
-
var constants_1 = require("./constants");
|
|
13
|
-
Object.defineProperty(exports, "TOKEN_QUERY_PARAM", { enumerable: true, get: function () { return constants_1.TOKEN_QUERY_PARAM; } });
|
|
14
|
-
var getHashedPayload_1 = require("./utils/getHashedPayload");
|
|
15
|
-
Object.defineProperty(exports, "getHashedPayload", { enumerable: true, get: function () { return getHashedPayload_1.getHashedPayload; } });
|
package/lib-esm/Amplify.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ConsoleLogger as LoggerClass } from './Logger';
|
|
2
|
-
export declare class AmplifyClass {
|
|
3
|
-
private _components;
|
|
4
|
-
private _config;
|
|
5
|
-
private _modules;
|
|
6
|
-
Auth: null;
|
|
7
|
-
Analytics: null;
|
|
8
|
-
API: null;
|
|
9
|
-
Credentials: null;
|
|
10
|
-
Storage: null;
|
|
11
|
-
I18n: null;
|
|
12
|
-
Cache: null;
|
|
13
|
-
PubSub: null;
|
|
14
|
-
Interactions: null;
|
|
15
|
-
Pushnotification: null;
|
|
16
|
-
UI: null;
|
|
17
|
-
XR: null;
|
|
18
|
-
Predictions: null;
|
|
19
|
-
DataStore: null;
|
|
20
|
-
Geo: null;
|
|
21
|
-
Notifications: null;
|
|
22
|
-
Logger: typeof LoggerClass;
|
|
23
|
-
ServiceWorker: null;
|
|
24
|
-
get config(): any;
|
|
25
|
-
register(comp: any): void;
|
|
26
|
-
configure(config?: any): {};
|
|
27
|
-
addPluggable(pluggable: any): void;
|
|
28
|
-
}
|
|
29
|
-
export declare const Amplify: AmplifyClass;
|
package/lib-esm/Amplify.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
2
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3
|
-
if (!m) return o;
|
|
4
|
-
var i = m.call(o), r, ar = [], e;
|
|
5
|
-
try {
|
|
6
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
7
|
-
}
|
|
8
|
-
catch (error) { e = { error: error }; }
|
|
9
|
-
finally {
|
|
10
|
-
try {
|
|
11
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
12
|
-
}
|
|
13
|
-
finally { if (e) throw e.error; }
|
|
14
|
-
}
|
|
15
|
-
return ar;
|
|
16
|
-
};
|
|
17
|
-
// @ts-nocheck
|
|
18
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
19
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
20
|
-
import { ConsoleLogger as LoggerClass } from './Logger';
|
|
21
|
-
var logger = new LoggerClass('Amplify');
|
|
22
|
-
var AmplifyClass = /** @class */ (function () {
|
|
23
|
-
function AmplifyClass() {
|
|
24
|
-
// Everything that is `register`ed is tracked here
|
|
25
|
-
this._components = [];
|
|
26
|
-
this._config = {};
|
|
27
|
-
// All modules (with `getModuleName()`) are stored here for dependency injection
|
|
28
|
-
this._modules = {};
|
|
29
|
-
// for backward compatibility to avoid breaking change
|
|
30
|
-
// if someone is using like Amplify.Auth
|
|
31
|
-
this.Auth = null;
|
|
32
|
-
this.Analytics = null;
|
|
33
|
-
this.API = null;
|
|
34
|
-
this.Credentials = null;
|
|
35
|
-
this.Storage = null;
|
|
36
|
-
this.I18n = null;
|
|
37
|
-
this.Cache = null;
|
|
38
|
-
this.PubSub = null;
|
|
39
|
-
this.Interactions = null;
|
|
40
|
-
this.Pushnotification = null;
|
|
41
|
-
this.UI = null;
|
|
42
|
-
this.XR = null;
|
|
43
|
-
this.Predictions = null;
|
|
44
|
-
this.DataStore = null;
|
|
45
|
-
this.Geo = null;
|
|
46
|
-
this.Notifications = null;
|
|
47
|
-
this.Logger = LoggerClass;
|
|
48
|
-
this.ServiceWorker = null;
|
|
49
|
-
}
|
|
50
|
-
Object.defineProperty(AmplifyClass.prototype, "config", {
|
|
51
|
-
// TODO: update "any" when types are determined
|
|
52
|
-
get: function () {
|
|
53
|
-
return Object.assign({}, this._config);
|
|
54
|
-
},
|
|
55
|
-
enumerable: false,
|
|
56
|
-
configurable: true
|
|
57
|
-
});
|
|
58
|
-
AmplifyClass.prototype.register = function (comp) {
|
|
59
|
-
logger.debug('component registered in amplify', comp);
|
|
60
|
-
this._components.push(comp);
|
|
61
|
-
if (typeof comp.getModuleName === 'function') {
|
|
62
|
-
this._modules[comp.getModuleName()] = comp;
|
|
63
|
-
this[comp.getModuleName()] = comp;
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
logger.debug('no getModuleName method for component', comp);
|
|
67
|
-
}
|
|
68
|
-
// Finally configure this new component(category) loaded
|
|
69
|
-
// With the new modularization changes in Amplify V3, all the Amplify
|
|
70
|
-
// component are not loaded/registered right away but when they are
|
|
71
|
-
// imported (and hence instantiated) in the client's app. This ensures
|
|
72
|
-
// that all new components imported get correctly configured with the
|
|
73
|
-
// configuration that Amplify.configure() was called with.
|
|
74
|
-
comp.configure(this._config);
|
|
75
|
-
};
|
|
76
|
-
AmplifyClass.prototype.configure = function (config) {
|
|
77
|
-
var _this = this;
|
|
78
|
-
if (!config)
|
|
79
|
-
return this._config;
|
|
80
|
-
this._config = Object.assign(this._config, config);
|
|
81
|
-
logger.debug('amplify config', this._config);
|
|
82
|
-
// Dependency Injection via property-setting.
|
|
83
|
-
// This avoids introducing a public method/interface/setter that's difficult to remove later.
|
|
84
|
-
// Plus, it reduces `if` statements within the `constructor` and `configure` of each module
|
|
85
|
-
Object.entries(this._modules).forEach(function (_a) {
|
|
86
|
-
var _b = __read(_a, 2), Name = _b[0], comp = _b[1];
|
|
87
|
-
// e.g. Auth.*
|
|
88
|
-
Object.keys(comp).forEach(function (property) {
|
|
89
|
-
// e.g. Auth["Credentials"] = this._modules["Credentials"] when set
|
|
90
|
-
if (_this._modules[property]) {
|
|
91
|
-
comp[property] = _this._modules[property];
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
this._components.map(function (comp) {
|
|
96
|
-
comp.configure(_this._config);
|
|
97
|
-
});
|
|
98
|
-
return this._config;
|
|
99
|
-
};
|
|
100
|
-
AmplifyClass.prototype.addPluggable = function (pluggable) {
|
|
101
|
-
if (pluggable &&
|
|
102
|
-
pluggable['getCategory'] &&
|
|
103
|
-
typeof pluggable['getCategory'] === 'function') {
|
|
104
|
-
this._components.map(function (comp) {
|
|
105
|
-
if (comp['addPluggable'] &&
|
|
106
|
-
typeof comp['addPluggable'] === 'function') {
|
|
107
|
-
comp.addPluggable(pluggable);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
return AmplifyClass;
|
|
113
|
-
}());
|
|
114
|
-
export { AmplifyClass };
|
|
115
|
-
export var Amplify = new AmplifyClass();
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { StorageCache } from './StorageCache';
|
|
2
|
-
import { ICache, CacheConfig, CacheItemOptions } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Customized storage based on the SessionStorage or LocalStorage with LRU implemented
|
|
5
|
-
*/
|
|
6
|
-
export declare class BrowserStorageCacheClass extends StorageCache implements ICache {
|
|
7
|
-
/**
|
|
8
|
-
* initialize the cache
|
|
9
|
-
* @param config - the configuration of the cache
|
|
10
|
-
*/
|
|
11
|
-
constructor(config?: CacheConfig);
|
|
12
|
-
private getStorage;
|
|
13
|
-
/**
|
|
14
|
-
* decrease current size of the cache
|
|
15
|
-
*
|
|
16
|
-
* @private
|
|
17
|
-
* @param amount - the amount of the cache size which needs to be decreased
|
|
18
|
-
*/
|
|
19
|
-
private _decreaseCurSizeInBytes;
|
|
20
|
-
/**
|
|
21
|
-
* increase current size of the cache
|
|
22
|
-
*
|
|
23
|
-
* @private
|
|
24
|
-
* @param amount - the amount of the cache szie which need to be increased
|
|
25
|
-
*/
|
|
26
|
-
private _increaseCurSizeInBytes;
|
|
27
|
-
/**
|
|
28
|
-
* update the visited time if item has been visited
|
|
29
|
-
*
|
|
30
|
-
* @private
|
|
31
|
-
* @param item - the item which need to be refreshed
|
|
32
|
-
* @param prefixedKey - the key of the item
|
|
33
|
-
*
|
|
34
|
-
* @return the refreshed item
|
|
35
|
-
*/
|
|
36
|
-
private _refreshItem;
|
|
37
|
-
/**
|
|
38
|
-
* check wether item is expired
|
|
39
|
-
*
|
|
40
|
-
* @private
|
|
41
|
-
* @param key - the key of the item
|
|
42
|
-
*
|
|
43
|
-
* @return true if the item is expired.
|
|
44
|
-
*/
|
|
45
|
-
private _isExpired;
|
|
46
|
-
/**
|
|
47
|
-
* delete item from cache
|
|
48
|
-
*
|
|
49
|
-
* @private
|
|
50
|
-
* @param prefixedKey - the key of the item
|
|
51
|
-
* @param size - optional, the byte size of the item
|
|
52
|
-
*/
|
|
53
|
-
private _removeItem;
|
|
54
|
-
/**
|
|
55
|
-
* put item into cache
|
|
56
|
-
*
|
|
57
|
-
* @private
|
|
58
|
-
* @param prefixedKey - the key of the item
|
|
59
|
-
* @param itemData - the value of the item
|
|
60
|
-
* @param itemSizeInBytes - the byte size of the item
|
|
61
|
-
*/
|
|
62
|
-
private _setItem;
|
|
63
|
-
/**
|
|
64
|
-
* total space needed when poping out items
|
|
65
|
-
*
|
|
66
|
-
* @private
|
|
67
|
-
* @param itemSize
|
|
68
|
-
*
|
|
69
|
-
* @return total space needed
|
|
70
|
-
*/
|
|
71
|
-
private _sizeToPop;
|
|
72
|
-
/**
|
|
73
|
-
* see whether cache is full
|
|
74
|
-
*
|
|
75
|
-
* @private
|
|
76
|
-
* @param itemSize
|
|
77
|
-
*
|
|
78
|
-
* @return true if cache is full
|
|
79
|
-
*/
|
|
80
|
-
private _isCacheFull;
|
|
81
|
-
/**
|
|
82
|
-
* scan the storage and find out all the keys owned by this cache
|
|
83
|
-
* also clean the expired keys while scanning
|
|
84
|
-
*
|
|
85
|
-
* @private
|
|
86
|
-
*
|
|
87
|
-
* @return array of keys
|
|
88
|
-
*/
|
|
89
|
-
private _findValidKeys;
|
|
90
|
-
/**
|
|
91
|
-
* get all the items we have, sort them by their priority,
|
|
92
|
-
* if priority is same, sort them by their last visited time
|
|
93
|
-
* pop out items from the low priority (5 is the lowest)
|
|
94
|
-
*
|
|
95
|
-
* @private
|
|
96
|
-
* @param keys - all the keys in this cache
|
|
97
|
-
* @param sizeToPop - the total size of the items which needed to be poped out
|
|
98
|
-
*/
|
|
99
|
-
private _popOutItems;
|
|
100
|
-
/**
|
|
101
|
-
* Set item into cache. You can put number, string, boolean or object.
|
|
102
|
-
* The cache will first check whether has the same key.
|
|
103
|
-
* If it has, it will delete the old item and then put the new item in
|
|
104
|
-
* The cache will pop out items if it is full
|
|
105
|
-
* You can specify the cache item options. The cache will abort and output a warning:
|
|
106
|
-
* If the key is invalid
|
|
107
|
-
* If the size of the item exceeds itemMaxSize.
|
|
108
|
-
* If the value is undefined
|
|
109
|
-
* If incorrect cache item configuration
|
|
110
|
-
* If error happened with browser storage
|
|
111
|
-
*
|
|
112
|
-
* @param key - the key of the item
|
|
113
|
-
* @param value - the value of the item
|
|
114
|
-
* @param {Object} [options] - optional, the specified meta-data
|
|
115
|
-
*/
|
|
116
|
-
setItem(key: string, value: object | number | string | boolean, options?: CacheItemOptions): void;
|
|
117
|
-
/**
|
|
118
|
-
* Get item from cache. It will return null if item doesn’t exist or it has been expired.
|
|
119
|
-
* If you specified callback function in the options,
|
|
120
|
-
* then the function will be executed if no such item in the cache
|
|
121
|
-
* and finally put the return value into cache.
|
|
122
|
-
* Please make sure the callback function will return the value you want to put into the cache.
|
|
123
|
-
* The cache will abort output a warning:
|
|
124
|
-
* If the key is invalid
|
|
125
|
-
* If error happened with browser storage
|
|
126
|
-
*
|
|
127
|
-
* @param key - the key of the item
|
|
128
|
-
* @param {Object} [options] - the options of callback function
|
|
129
|
-
*
|
|
130
|
-
* @return - return the value of the item
|
|
131
|
-
*/
|
|
132
|
-
getItem(key: string, options?: CacheItemOptions): any;
|
|
133
|
-
/**
|
|
134
|
-
* remove item from the cache
|
|
135
|
-
* The cache will abort output a warning:
|
|
136
|
-
* If error happened with browser storage
|
|
137
|
-
* @param key - the key of the item
|
|
138
|
-
*/
|
|
139
|
-
removeItem(key: string): void;
|
|
140
|
-
/**
|
|
141
|
-
* clear the entire cache
|
|
142
|
-
* The cache will abort output a warning:
|
|
143
|
-
* If error happened with browser storage
|
|
144
|
-
*/
|
|
145
|
-
clear(): void;
|
|
146
|
-
/**
|
|
147
|
-
* Return all the keys in the cache.
|
|
148
|
-
*
|
|
149
|
-
* @return - all keys in the cache
|
|
150
|
-
*/
|
|
151
|
-
getAllKeys(): string[];
|
|
152
|
-
/**
|
|
153
|
-
* return the current size of the cache
|
|
154
|
-
*
|
|
155
|
-
* @return - current size of the cache
|
|
156
|
-
*/
|
|
157
|
-
getCacheCurSize(): number;
|
|
158
|
-
/**
|
|
159
|
-
* Return a new instance of cache with customized configuration.
|
|
160
|
-
* @param config - the customized configuration
|
|
161
|
-
*
|
|
162
|
-
* @return - new instance of Cache
|
|
163
|
-
*/
|
|
164
|
-
createInstance(config: CacheConfig): ICache;
|
|
165
|
-
}
|
|
166
|
-
export declare const BrowserStorageCache: ICache;
|