@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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* Default cache config
|
|
5
|
+
*/
|
|
6
|
+
export var defaultConfig = {
|
|
7
|
+
keyPrefix: 'aws-amplify-cache',
|
|
8
|
+
capacityInBytes: 1048576,
|
|
9
|
+
itemMaxSize: 210000,
|
|
10
|
+
defaultTTL: 259200000,
|
|
11
|
+
defaultPriority: 5,
|
|
12
|
+
warningThreshold: 0.8,
|
|
13
|
+
};
|
|
14
|
+
export var currentSizeKey = 'CurSize';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CacheConfig } from '../../singleton/Cache/types';
|
|
2
|
+
export { CacheConfig };
|
|
3
|
+
/**
|
|
4
|
+
* Cache Interface
|
|
5
|
+
*/
|
|
6
|
+
export interface Cache {
|
|
7
|
+
/** Put item into cache */
|
|
8
|
+
setItem(key: string, value: any, options?: CacheItemOptions): Promise<void>;
|
|
9
|
+
/** Get item from cache */
|
|
10
|
+
getItem(key: string, options?: CacheItemOptions): Promise<CacheItem['data']>;
|
|
11
|
+
/** Remove item from cache */
|
|
12
|
+
removeItem(key: string): Promise<void>;
|
|
13
|
+
/** Remove all items from cache */
|
|
14
|
+
clear(): Promise<void>;
|
|
15
|
+
/** Get all keys form cache */
|
|
16
|
+
getAllKeys(): Promise<string[]>;
|
|
17
|
+
/** Get current size of the cache */
|
|
18
|
+
getCurrentCacheSize(): Promise<number>;
|
|
19
|
+
/** create a new instance with customized config */
|
|
20
|
+
createInstance(config: CacheConfig): Cache;
|
|
21
|
+
/** change current configuration */
|
|
22
|
+
configure(config: CacheConfig): CacheConfig;
|
|
23
|
+
}
|
|
24
|
+
export interface CacheItem {
|
|
25
|
+
key: string;
|
|
26
|
+
data: any;
|
|
27
|
+
timestamp: number;
|
|
28
|
+
visitedTime: number;
|
|
29
|
+
priority: number;
|
|
30
|
+
expires: number;
|
|
31
|
+
type: string;
|
|
32
|
+
byteSize: number;
|
|
33
|
+
}
|
|
34
|
+
export interface CacheItemOptions {
|
|
35
|
+
priority?: number;
|
|
36
|
+
expires?: number;
|
|
37
|
+
callback?: Function;
|
|
38
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './cache';
|
|
@@ -11,8 +11,7 @@ var __values = (this && this.__values) || function(o) {
|
|
|
11
11
|
};
|
|
12
12
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
13
13
|
};
|
|
14
|
-
import {
|
|
15
|
-
import { CACHE_LIST_EXCEPTION } from '../../Util/Constants';
|
|
14
|
+
import { assert, CacheErrorCode } from './errorHelpers';
|
|
16
15
|
var DoubleLinkedNode = /** @class */ (function () {
|
|
17
16
|
function DoubleLinkedNode(keyVal) {
|
|
18
17
|
this.key = keyVal ? keyVal : '';
|
|
@@ -54,10 +53,7 @@ var CacheList = /** @class */ (function () {
|
|
|
54
53
|
this.head.nextNode = node;
|
|
55
54
|
node.nextNode = tmp;
|
|
56
55
|
node.prevNode = this.head;
|
|
57
|
-
|
|
58
|
-
name: CACHE_LIST_EXCEPTION,
|
|
59
|
-
message: 'previous node is null',
|
|
60
|
-
});
|
|
56
|
+
assert(tmp !== null, CacheErrorCode.NullPreviousNode);
|
|
61
57
|
tmp.prevNode = node;
|
|
62
58
|
this.length = this.length + 1;
|
|
63
59
|
};
|
|
@@ -67,14 +63,8 @@ var CacheList = /** @class */ (function () {
|
|
|
67
63
|
* @param node
|
|
68
64
|
*/
|
|
69
65
|
CacheList.prototype.removeNode = function (node) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
message: 'previous node is null',
|
|
73
|
-
});
|
|
74
|
-
asserts(node.nextNode !== null, {
|
|
75
|
-
name: CACHE_LIST_EXCEPTION,
|
|
76
|
-
message: 'nextNode node is null',
|
|
77
|
-
});
|
|
66
|
+
assert(node.prevNode !== null, CacheErrorCode.NullPreviousNode);
|
|
67
|
+
assert(node.nextNode !== null, CacheErrorCode.NullNextNode);
|
|
78
68
|
node.prevNode.nextNode = node.nextNode;
|
|
79
69
|
node.nextNode.prevNode = node.prevNode;
|
|
80
70
|
node.prevNode = null;
|
|
@@ -111,10 +101,7 @@ var CacheList = /** @class */ (function () {
|
|
|
111
101
|
* @return the LAST Recently Visited key
|
|
112
102
|
*/
|
|
113
103
|
CacheList.prototype.getLastItem = function () {
|
|
114
|
-
|
|
115
|
-
name: CACHE_LIST_EXCEPTION,
|
|
116
|
-
message: 'previous node is null',
|
|
117
|
-
});
|
|
104
|
+
assert(this.tail.prevNode !== null, CacheErrorCode.NullPreviousNode);
|
|
118
105
|
return this.tail.prevNode.key;
|
|
119
106
|
};
|
|
120
107
|
/**
|
|
@@ -191,4 +178,4 @@ var CacheList = /** @class */ (function () {
|
|
|
191
178
|
};
|
|
192
179
|
return CacheList;
|
|
193
180
|
}());
|
|
194
|
-
export
|
|
181
|
+
export { CacheList };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* return the byte size of the string
|
|
3
|
+
* @param str
|
|
4
|
+
*/
|
|
5
|
+
export declare function getByteLength(str: string): number;
|
|
6
|
+
/**
|
|
7
|
+
* get current time
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCurrentTime(): number;
|
|
10
|
+
/**
|
|
11
|
+
* check if passed value is an integer
|
|
12
|
+
*/
|
|
13
|
+
export declare function isInteger(value?: number): boolean;
|
|
14
|
+
export declare const getCurrentSizeKey: (keyPrefix: string) => string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { currentSizeKey } from '../constants';
|
|
4
|
+
/**
|
|
5
|
+
* return the byte size of the string
|
|
6
|
+
* @param str
|
|
7
|
+
*/
|
|
8
|
+
export function getByteLength(str) {
|
|
9
|
+
var ret = 0;
|
|
10
|
+
ret = str.length;
|
|
11
|
+
for (var i = str.length; i >= 0; i -= 1) {
|
|
12
|
+
var charCode = str.charCodeAt(i);
|
|
13
|
+
if (charCode > 0x7f && charCode <= 0x7ff) {
|
|
14
|
+
ret += 1;
|
|
15
|
+
}
|
|
16
|
+
else if (charCode > 0x7ff && charCode <= 0xffff) {
|
|
17
|
+
ret += 2;
|
|
18
|
+
}
|
|
19
|
+
// trail surrogate
|
|
20
|
+
if (charCode >= 0xdc00 && charCode <= 0xdfff) {
|
|
21
|
+
i -= 1;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return ret;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* get current time
|
|
28
|
+
*/
|
|
29
|
+
export function getCurrentTime() {
|
|
30
|
+
var currentTime = new Date();
|
|
31
|
+
return currentTime.getTime();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* check if passed value is an integer
|
|
35
|
+
*/
|
|
36
|
+
export function isInteger(value) {
|
|
37
|
+
if (Number.isInteger) {
|
|
38
|
+
return Number.isInteger(value);
|
|
39
|
+
}
|
|
40
|
+
return (typeof value === 'number' && isFinite(value) && Math.floor(value) === value);
|
|
41
|
+
}
|
|
42
|
+
export var getCurrentSizeKey = function (keyPrefix) {
|
|
43
|
+
return "".concat(keyPrefix).concat(currentSizeKey);
|
|
44
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var _a;
|
|
4
|
+
import { createAssertionFunction } from '../../errors';
|
|
5
|
+
export var CacheErrorCode;
|
|
6
|
+
(function (CacheErrorCode) {
|
|
7
|
+
CacheErrorCode["NoCacheItem"] = "NoCacheItem";
|
|
8
|
+
CacheErrorCode["NullNextNode"] = "NullNextNode";
|
|
9
|
+
CacheErrorCode["NullPreviousNode"] = "NullPreviousNode";
|
|
10
|
+
})(CacheErrorCode || (CacheErrorCode = {}));
|
|
11
|
+
var cacheErrorMap = (_a = {},
|
|
12
|
+
_a[CacheErrorCode.NoCacheItem] = {
|
|
13
|
+
message: 'Item not found in the cache storage.',
|
|
14
|
+
},
|
|
15
|
+
_a[CacheErrorCode.NullNextNode] = {
|
|
16
|
+
message: 'Next node is null.',
|
|
17
|
+
},
|
|
18
|
+
_a[CacheErrorCode.NullPreviousNode] = {
|
|
19
|
+
message: 'Previous node is null.',
|
|
20
|
+
},
|
|
21
|
+
_a);
|
|
22
|
+
export var assert = createAssertionFunction(cacheErrorMap);
|
package/lib-esm/Hub/index.d.ts
CHANGED
|
@@ -37,3 +37,10 @@ export declare class HubClass {
|
|
|
37
37
|
private _toListeners;
|
|
38
38
|
}
|
|
39
39
|
export declare const Hub: HubClass;
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*
|
|
43
|
+
* Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
export declare const HubInternal: HubClass;
|
package/lib-esm/Hub/index.js
CHANGED
|
@@ -37,8 +37,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
37
37
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
38
38
|
};
|
|
39
39
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
40
|
-
import { NO_HUBCALLBACK_PROVIDED_EXCEPTION } from '../
|
|
41
|
-
import { AmplifyError } from '../
|
|
40
|
+
import { NO_HUBCALLBACK_PROVIDED_EXCEPTION } from '../constants';
|
|
41
|
+
import { AmplifyError } from '../errors';
|
|
42
42
|
export var AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
|
|
43
43
|
? Symbol.for('amplify_default')
|
|
44
44
|
: '@@amplify_default');
|
|
@@ -146,3 +146,10 @@ export { HubClass };
|
|
|
146
146
|
pseudo Singleton for the main messaging bus, however you can still create
|
|
147
147
|
your own instance of HubClass() for a separate "private bus" of events.*/
|
|
148
148
|
export var Hub = new HubClass('__default__');
|
|
149
|
+
/**
|
|
150
|
+
* @internal
|
|
151
|
+
*
|
|
152
|
+
* Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.
|
|
153
|
+
*
|
|
154
|
+
*/
|
|
155
|
+
export var HubInternal = new HubClass('internal-hub');
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
type AuthUser = {
|
|
2
|
+
username: string;
|
|
3
|
+
userId: string;
|
|
4
|
+
};
|
|
1
5
|
export type AuthHubEventData =
|
|
2
6
|
/** Dispatched when a user signs in with an oauth provider such as Google.*/
|
|
3
7
|
{
|
|
@@ -14,4 +18,19 @@ export type AuthHubEventData =
|
|
|
14
18
|
/** Dispatched when there is an error in the refresh of tokens.*/
|
|
15
19
|
| {
|
|
16
20
|
event: 'tokenRefresh_failure';
|
|
21
|
+
}
|
|
22
|
+
/** Dispatched when there is a customState passed in the options of the `signInWithRedirect` API.*/
|
|
23
|
+
| {
|
|
24
|
+
event: 'customOAuthState';
|
|
25
|
+
data: string;
|
|
26
|
+
}
|
|
27
|
+
/** Dispatched when the user is signed-in.*/
|
|
28
|
+
| {
|
|
29
|
+
event: 'signedIn';
|
|
30
|
+
data: AuthUser;
|
|
31
|
+
}
|
|
32
|
+
/** Dispatched after the user calls the `signOut` API successfully.*/
|
|
33
|
+
| {
|
|
34
|
+
event: 'signedOut';
|
|
17
35
|
};
|
|
36
|
+
export {};
|
package/lib-esm/I18n/I18n.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I18nConfig } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Language translation utility.
|
|
4
|
-
*
|
|
5
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
6
4
|
*/
|
|
7
5
|
export declare class I18n {
|
|
8
6
|
/**
|
|
9
7
|
* @private
|
|
10
8
|
*/
|
|
11
|
-
_options:
|
|
9
|
+
_options: I18nConfig | null;
|
|
12
10
|
/**
|
|
13
11
|
* @private
|
|
14
12
|
*/
|
|
@@ -21,22 +19,16 @@ export declare class I18n {
|
|
|
21
19
|
* @constructor
|
|
22
20
|
* Initialize with configurations
|
|
23
21
|
* @param {Object} options
|
|
24
|
-
*
|
|
25
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
26
22
|
*/
|
|
27
23
|
constructor();
|
|
28
24
|
/**
|
|
29
25
|
* Sets the default language from the configuration when required.
|
|
30
|
-
*
|
|
31
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
32
26
|
*/
|
|
33
27
|
setDefaultLanguage(): void;
|
|
34
28
|
/**
|
|
35
29
|
* @method
|
|
36
30
|
* Explicitly setting language
|
|
37
31
|
* @param {String} lang
|
|
38
|
-
*
|
|
39
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
40
32
|
*/
|
|
41
33
|
setLanguage(lang: string): void;
|
|
42
34
|
/**
|
|
@@ -44,8 +36,6 @@ export declare class I18n {
|
|
|
44
36
|
* Get value
|
|
45
37
|
* @param {String} key
|
|
46
38
|
* @param {String} defVal - Default value
|
|
47
|
-
*
|
|
48
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
49
39
|
*/
|
|
50
40
|
get(key: string, defVal?: string | undefined): any;
|
|
51
41
|
/**
|
|
@@ -54,8 +44,6 @@ export declare class I18n {
|
|
|
54
44
|
* @param {String} key
|
|
55
45
|
* @param {String} language - Specified langurage to be used
|
|
56
46
|
* @param {String} defVal - Default value
|
|
57
|
-
*
|
|
58
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
59
47
|
*/
|
|
60
48
|
getByLanguage(key: string, language: string, defVal?: string | null): any;
|
|
61
49
|
/**
|
|
@@ -63,8 +51,6 @@ export declare class I18n {
|
|
|
63
51
|
* Add vocabularies for one language
|
|
64
52
|
* @param {String} language - Language of the dictionary
|
|
65
53
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
66
|
-
*
|
|
67
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
68
54
|
*/
|
|
69
55
|
putVocabulariesForLanguage(language: string, vocabularies: Record<string, any>): void;
|
|
70
56
|
/**
|
|
@@ -72,8 +58,6 @@ export declare class I18n {
|
|
|
72
58
|
* Add vocabularies for one language
|
|
73
59
|
* @param {Object} vocabularies - Object that has language as key,
|
|
74
60
|
* vocabularies of each language as value
|
|
75
|
-
*
|
|
76
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
77
61
|
*/
|
|
78
|
-
putVocabularies(vocabularies: Record<string,
|
|
62
|
+
putVocabularies(vocabularies: Record<string, Record<string, string>>): void;
|
|
79
63
|
}
|
package/lib-esm/I18n/I18n.js
CHANGED
|
@@ -15,16 +15,12 @@ import { ConsoleLogger as Logger } from '../Logger';
|
|
|
15
15
|
var logger = new Logger('I18n');
|
|
16
16
|
/**
|
|
17
17
|
* Language translation utility.
|
|
18
|
-
*
|
|
19
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
20
18
|
*/
|
|
21
19
|
var I18n = /** @class */ (function () {
|
|
22
20
|
/**
|
|
23
21
|
* @constructor
|
|
24
22
|
* Initialize with configurations
|
|
25
23
|
* @param {Object} options
|
|
26
|
-
*
|
|
27
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
28
24
|
*/
|
|
29
25
|
function I18n() {
|
|
30
26
|
/**
|
|
@@ -42,15 +38,9 @@ var I18n = /** @class */ (function () {
|
|
|
42
38
|
}
|
|
43
39
|
/**
|
|
44
40
|
* Sets the default language from the configuration when required.
|
|
45
|
-
*
|
|
46
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
47
41
|
*/
|
|
48
42
|
I18n.prototype.setDefaultLanguage = function () {
|
|
49
|
-
|
|
50
|
-
const i18nConfig = Amplify.getConfig().I18n;
|
|
51
|
-
this._lang = i18nConfig?.language;
|
|
52
|
-
}*/
|
|
53
|
-
// Default to window language if not set in config
|
|
43
|
+
// Default to window language if not set in instance
|
|
54
44
|
if (!this._lang &&
|
|
55
45
|
typeof window !== 'undefined' &&
|
|
56
46
|
window &&
|
|
@@ -63,8 +53,6 @@ var I18n = /** @class */ (function () {
|
|
|
63
53
|
* @method
|
|
64
54
|
* Explicitly setting language
|
|
65
55
|
* @param {String} lang
|
|
66
|
-
*
|
|
67
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
68
56
|
*/
|
|
69
57
|
I18n.prototype.setLanguage = function (lang) {
|
|
70
58
|
this._lang = lang;
|
|
@@ -74,8 +62,6 @@ var I18n = /** @class */ (function () {
|
|
|
74
62
|
* Get value
|
|
75
63
|
* @param {String} key
|
|
76
64
|
* @param {String} defVal - Default value
|
|
77
|
-
*
|
|
78
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
79
65
|
*/
|
|
80
66
|
I18n.prototype.get = function (key, defVal) {
|
|
81
67
|
if (defVal === void 0) { defVal = undefined; }
|
|
@@ -101,8 +87,6 @@ var I18n = /** @class */ (function () {
|
|
|
101
87
|
* @param {String} key
|
|
102
88
|
* @param {String} language - Specified langurage to be used
|
|
103
89
|
* @param {String} defVal - Default value
|
|
104
|
-
*
|
|
105
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
106
90
|
*/
|
|
107
91
|
I18n.prototype.getByLanguage = function (key, language, defVal) {
|
|
108
92
|
if (defVal === void 0) { defVal = null; }
|
|
@@ -120,8 +104,6 @@ var I18n = /** @class */ (function () {
|
|
|
120
104
|
* Add vocabularies for one language
|
|
121
105
|
* @param {String} language - Language of the dictionary
|
|
122
106
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
123
|
-
*
|
|
124
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
125
107
|
*/
|
|
126
108
|
I18n.prototype.putVocabulariesForLanguage = function (language, vocabularies) {
|
|
127
109
|
var lang_dict = this._dict[language];
|
|
@@ -135,8 +117,6 @@ var I18n = /** @class */ (function () {
|
|
|
135
117
|
* Add vocabularies for one language
|
|
136
118
|
* @param {Object} vocabularies - Object that has language as key,
|
|
137
119
|
* vocabularies of each language as value
|
|
138
|
-
*
|
|
139
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
140
120
|
*/
|
|
141
121
|
I18n.prototype.putVocabularies = function (vocabularies) {
|
|
142
122
|
var _this = this;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var _a;
|
|
4
|
+
import { createAssertionFunction } from '../errors';
|
|
5
|
+
export var I18nErrorCode;
|
|
6
|
+
(function (I18nErrorCode) {
|
|
7
|
+
I18nErrorCode["NotConfigured"] = "NotConfigured";
|
|
8
|
+
})(I18nErrorCode || (I18nErrorCode = {}));
|
|
9
|
+
var i18nErrorMap = (_a = {},
|
|
10
|
+
_a[I18nErrorCode.NotConfigured] = {
|
|
11
|
+
message: 'i18n is not configured.',
|
|
12
|
+
},
|
|
13
|
+
_a);
|
|
14
|
+
export var assert = createAssertionFunction(i18nErrorMap);
|
package/lib-esm/I18n/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I18nConfig } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Export I18n APIs
|
|
4
|
-
*
|
|
5
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
6
4
|
*/
|
|
7
5
|
export declare class I18n {
|
|
8
6
|
/**
|
|
@@ -11,22 +9,18 @@ export declare class I18n {
|
|
|
11
9
|
* Configure I18n part
|
|
12
10
|
* @param {Object} config - Configuration of the I18n
|
|
13
11
|
*/
|
|
14
|
-
static configure(config: Record<string, any>):
|
|
12
|
+
static configure(config: Record<string, any>): I18nConfig;
|
|
15
13
|
static getModuleName(): string;
|
|
16
14
|
/**
|
|
17
15
|
* @static
|
|
18
16
|
* @method
|
|
19
17
|
* Create an instance of I18n for the library
|
|
20
|
-
*
|
|
21
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
22
18
|
*/
|
|
23
19
|
static createInstance(): void;
|
|
24
20
|
/**
|
|
25
21
|
* @static @method
|
|
26
22
|
* Explicitly setting language
|
|
27
23
|
* @param {String} lang
|
|
28
|
-
*
|
|
29
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
30
24
|
*/
|
|
31
25
|
static setLanguage(lang: string): void;
|
|
32
26
|
/**
|
|
@@ -34,8 +28,6 @@ export declare class I18n {
|
|
|
34
28
|
* Get value
|
|
35
29
|
* @param {String} key
|
|
36
30
|
* @param {String} defVal - Default value
|
|
37
|
-
*
|
|
38
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
39
31
|
*/
|
|
40
32
|
static get(key: string, defVal?: string): any;
|
|
41
33
|
/**
|
|
@@ -44,8 +36,6 @@ export declare class I18n {
|
|
|
44
36
|
* Add vocabularies for one language
|
|
45
37
|
* @param {String} langurage - Language of the dictionary
|
|
46
38
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
47
|
-
*
|
|
48
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
49
39
|
*/
|
|
50
40
|
static putVocabulariesForLanguage(language: string, vocabularies: Record<string, string>): void;
|
|
51
41
|
/**
|
|
@@ -54,9 +44,7 @@ export declare class I18n {
|
|
|
54
44
|
* Add vocabularies for one language
|
|
55
45
|
* @param {Object} vocabularies - Object that has language as key,
|
|
56
46
|
* vocabularies of each language as value
|
|
57
|
-
*
|
|
58
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
59
47
|
*/
|
|
60
|
-
static putVocabularies(vocabularies: Record<string, string
|
|
48
|
+
static putVocabularies(vocabularies: Record<string, Record<string, string>>): void;
|
|
61
49
|
static checkConfig(): boolean;
|
|
62
50
|
}
|
package/lib-esm/I18n/index.js
CHANGED
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { I18n as I18nClass } from './I18n';
|
|
4
4
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
5
|
-
import {
|
|
6
|
-
import { I18N_EXCEPTION } from '../Util/Constants';
|
|
5
|
+
import { assert, I18nErrorCode } from './errorHelpers';
|
|
7
6
|
var logger = new Logger('I18n');
|
|
8
7
|
var _config = { language: null };
|
|
9
8
|
var _i18n = null;
|
|
10
9
|
/**
|
|
11
10
|
* Export I18n APIs
|
|
12
|
-
*
|
|
13
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
14
11
|
*/
|
|
15
12
|
var I18n = /** @class */ (function () {
|
|
16
13
|
function I18n() {
|
|
@@ -37,8 +34,6 @@ var I18n = /** @class */ (function () {
|
|
|
37
34
|
* @static
|
|
38
35
|
* @method
|
|
39
36
|
* Create an instance of I18n for the library
|
|
40
|
-
*
|
|
41
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
42
37
|
*/
|
|
43
38
|
I18n.createInstance = function () {
|
|
44
39
|
logger.debug('create I18n instance');
|
|
@@ -51,15 +46,10 @@ var I18n = /** @class */ (function () {
|
|
|
51
46
|
* @static @method
|
|
52
47
|
* Explicitly setting language
|
|
53
48
|
* @param {String} lang
|
|
54
|
-
*
|
|
55
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
56
49
|
*/
|
|
57
50
|
I18n.setLanguage = function (lang) {
|
|
58
51
|
I18n.checkConfig();
|
|
59
|
-
|
|
60
|
-
name: I18N_EXCEPTION,
|
|
61
|
-
message: 'I18N is not configured',
|
|
62
|
-
});
|
|
52
|
+
assert(!!_i18n, I18nErrorCode.NotConfigured);
|
|
63
53
|
return _i18n.setLanguage(lang);
|
|
64
54
|
};
|
|
65
55
|
/**
|
|
@@ -67,17 +57,12 @@ var I18n = /** @class */ (function () {
|
|
|
67
57
|
* Get value
|
|
68
58
|
* @param {String} key
|
|
69
59
|
* @param {String} defVal - Default value
|
|
70
|
-
*
|
|
71
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
72
60
|
*/
|
|
73
61
|
I18n.get = function (key, defVal) {
|
|
74
62
|
if (!I18n.checkConfig()) {
|
|
75
63
|
return typeof defVal === 'undefined' ? key : defVal;
|
|
76
64
|
}
|
|
77
|
-
|
|
78
|
-
name: I18N_EXCEPTION,
|
|
79
|
-
message: 'I18N is not configured',
|
|
80
|
-
});
|
|
65
|
+
assert(!!_i18n, I18nErrorCode.NotConfigured);
|
|
81
66
|
return _i18n.get(key, defVal);
|
|
82
67
|
};
|
|
83
68
|
/**
|
|
@@ -86,15 +71,10 @@ var I18n = /** @class */ (function () {
|
|
|
86
71
|
* Add vocabularies for one language
|
|
87
72
|
* @param {String} langurage - Language of the dictionary
|
|
88
73
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
89
|
-
*
|
|
90
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
91
74
|
*/
|
|
92
75
|
I18n.putVocabulariesForLanguage = function (language, vocabularies) {
|
|
93
76
|
I18n.checkConfig();
|
|
94
|
-
|
|
95
|
-
name: I18N_EXCEPTION,
|
|
96
|
-
message: 'I18N is not configured',
|
|
97
|
-
});
|
|
77
|
+
assert(!!_i18n, I18nErrorCode.NotConfigured);
|
|
98
78
|
return _i18n.putVocabulariesForLanguage(language, vocabularies);
|
|
99
79
|
};
|
|
100
80
|
/**
|
|
@@ -103,15 +83,10 @@ var I18n = /** @class */ (function () {
|
|
|
103
83
|
* Add vocabularies for one language
|
|
104
84
|
* @param {Object} vocabularies - Object that has language as key,
|
|
105
85
|
* vocabularies of each language as value
|
|
106
|
-
*
|
|
107
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
108
86
|
*/
|
|
109
87
|
I18n.putVocabularies = function (vocabularies) {
|
|
110
88
|
I18n.checkConfig();
|
|
111
|
-
|
|
112
|
-
name: I18N_EXCEPTION,
|
|
113
|
-
message: 'I18N is not configured',
|
|
114
|
-
});
|
|
89
|
+
assert(!!_i18n, I18nErrorCode.NotConfigured);
|
|
115
90
|
return _i18n.putVocabularies(vocabularies);
|
|
116
91
|
};
|
|
117
92
|
I18n.checkConfig = function () {
|