@aws-amplify/core 6.0.1-preview-testing.be90020.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/I18n/index.js
CHANGED
|
@@ -5,15 +5,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.I18n = void 0;
|
|
6
6
|
var I18n_1 = require("./I18n");
|
|
7
7
|
var Logger_1 = require("../Logger");
|
|
8
|
-
var
|
|
9
|
-
var Constants_1 = require("../Util/Constants");
|
|
8
|
+
var errorHelpers_1 = require("./errorHelpers");
|
|
10
9
|
var logger = new Logger_1.ConsoleLogger('I18n');
|
|
11
10
|
var _config = { language: null };
|
|
12
11
|
var _i18n = null;
|
|
13
12
|
/**
|
|
14
13
|
* Export I18n APIs
|
|
15
|
-
*
|
|
16
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
17
14
|
*/
|
|
18
15
|
var I18n = /** @class */ (function () {
|
|
19
16
|
function I18n() {
|
|
@@ -40,8 +37,6 @@ var I18n = /** @class */ (function () {
|
|
|
40
37
|
* @static
|
|
41
38
|
* @method
|
|
42
39
|
* Create an instance of I18n for the library
|
|
43
|
-
*
|
|
44
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
45
40
|
*/
|
|
46
41
|
I18n.createInstance = function () {
|
|
47
42
|
logger.debug('create I18n instance');
|
|
@@ -54,15 +49,10 @@ var I18n = /** @class */ (function () {
|
|
|
54
49
|
* @static @method
|
|
55
50
|
* Explicitly setting language
|
|
56
51
|
* @param {String} lang
|
|
57
|
-
*
|
|
58
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
59
52
|
*/
|
|
60
53
|
I18n.setLanguage = function (lang) {
|
|
61
54
|
I18n.checkConfig();
|
|
62
|
-
(0,
|
|
63
|
-
name: Constants_1.I18N_EXCEPTION,
|
|
64
|
-
message: 'I18N is not configured',
|
|
65
|
-
});
|
|
55
|
+
(0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);
|
|
66
56
|
return _i18n.setLanguage(lang);
|
|
67
57
|
};
|
|
68
58
|
/**
|
|
@@ -70,17 +60,12 @@ var I18n = /** @class */ (function () {
|
|
|
70
60
|
* Get value
|
|
71
61
|
* @param {String} key
|
|
72
62
|
* @param {String} defVal - Default value
|
|
73
|
-
*
|
|
74
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
75
63
|
*/
|
|
76
64
|
I18n.get = function (key, defVal) {
|
|
77
65
|
if (!I18n.checkConfig()) {
|
|
78
66
|
return typeof defVal === 'undefined' ? key : defVal;
|
|
79
67
|
}
|
|
80
|
-
(0,
|
|
81
|
-
name: Constants_1.I18N_EXCEPTION,
|
|
82
|
-
message: 'I18N is not configured',
|
|
83
|
-
});
|
|
68
|
+
(0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);
|
|
84
69
|
return _i18n.get(key, defVal);
|
|
85
70
|
};
|
|
86
71
|
/**
|
|
@@ -89,15 +74,10 @@ var I18n = /** @class */ (function () {
|
|
|
89
74
|
* Add vocabularies for one language
|
|
90
75
|
* @param {String} langurage - Language of the dictionary
|
|
91
76
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
92
|
-
*
|
|
93
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
94
77
|
*/
|
|
95
78
|
I18n.putVocabulariesForLanguage = function (language, vocabularies) {
|
|
96
79
|
I18n.checkConfig();
|
|
97
|
-
(0,
|
|
98
|
-
name: Constants_1.I18N_EXCEPTION,
|
|
99
|
-
message: 'I18N is not configured',
|
|
100
|
-
});
|
|
80
|
+
(0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);
|
|
101
81
|
return _i18n.putVocabulariesForLanguage(language, vocabularies);
|
|
102
82
|
};
|
|
103
83
|
/**
|
|
@@ -106,15 +86,10 @@ var I18n = /** @class */ (function () {
|
|
|
106
86
|
* Add vocabularies for one language
|
|
107
87
|
* @param {Object} vocabularies - Object that has language as key,
|
|
108
88
|
* vocabularies of each language as value
|
|
109
|
-
*
|
|
110
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
111
89
|
*/
|
|
112
90
|
I18n.putVocabularies = function (vocabularies) {
|
|
113
91
|
I18n.checkConfig();
|
|
114
|
-
(0,
|
|
115
|
-
name: Constants_1.I18N_EXCEPTION,
|
|
116
|
-
message: 'I18N is not configured',
|
|
117
|
-
});
|
|
92
|
+
(0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);
|
|
118
93
|
return _i18n.putVocabularies(vocabularies);
|
|
119
94
|
};
|
|
120
95
|
I18n.checkConfig = function () {
|
package/lib/I18n/types.d.ts
CHANGED
package/lib/I18n/types.js
CHANGED
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
var I18nOptions = /** @class */ (function () {
|
|
10
|
-
function I18nOptions() {
|
|
5
|
+
exports.I18nConfig = void 0;
|
|
6
|
+
var I18nConfig = /** @class */ (function () {
|
|
7
|
+
function I18nConfig() {
|
|
11
8
|
this.language = null;
|
|
12
9
|
}
|
|
13
|
-
return
|
|
10
|
+
return I18nConfig;
|
|
14
11
|
}());
|
|
15
|
-
exports.
|
|
12
|
+
exports.I18nConfig = I18nConfig;
|
|
@@ -39,7 +39,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.ConsoleLogger = exports.LOG_TYPE = void 0;
|
|
42
|
-
var
|
|
42
|
+
var constants_1 = require("../constants");
|
|
43
43
|
var LOG_LEVELS = {
|
|
44
44
|
VERBOSE: 1,
|
|
45
45
|
DEBUG: 2,
|
|
@@ -234,7 +234,7 @@ var ConsoleLogger = exports.ConsoleLogger = /** @class */ (function () {
|
|
|
234
234
|
this._log.apply(this, __spreadArray([LOG_TYPE.VERBOSE], __read(msg), false));
|
|
235
235
|
};
|
|
236
236
|
ConsoleLogger.prototype.addPluggable = function (pluggable) {
|
|
237
|
-
if (pluggable && pluggable.getCategoryName() ===
|
|
237
|
+
if (pluggable && pluggable.getCategoryName() === constants_1.AWS_CLOUDWATCH_CATEGORY) {
|
|
238
238
|
this._pluggables.push(pluggable);
|
|
239
239
|
pluggable.configure(this._config);
|
|
240
240
|
}
|
|
@@ -21,20 +21,8 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
22
|
* THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
|
|
27
|
-
isLocked(): boolean;
|
|
28
|
-
}
|
|
29
|
-
declare namespace MutexInterface {
|
|
30
|
-
interface Releaser {
|
|
31
|
-
(): void;
|
|
32
|
-
}
|
|
33
|
-
interface Worker<T> {
|
|
34
|
-
(): Promise<T> | T;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
declare class Mutex implements MutexInterface {
|
|
24
|
+
import { MutexInterface } from './types';
|
|
25
|
+
export declare class Mutex implements MutexInterface {
|
|
38
26
|
isLocked(): boolean;
|
|
39
27
|
acquire(): Promise<MutexInterface.Releaser>;
|
|
40
28
|
runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
|
|
@@ -42,4 +30,3 @@ declare class Mutex implements MutexInterface {
|
|
|
42
30
|
private _queue;
|
|
43
31
|
private _pending;
|
|
44
32
|
}
|
|
45
|
-
export default Mutex;
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* THE SOFTWARE.
|
|
26
26
|
*/
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.Mutex = void 0;
|
|
28
29
|
var Mutex = /** @class */ (function () {
|
|
29
30
|
function Mutex() {
|
|
30
31
|
this._queue = [];
|
|
@@ -70,4 +71,4 @@ var Mutex = /** @class */ (function () {
|
|
|
70
71
|
};
|
|
71
72
|
return Mutex;
|
|
72
73
|
}());
|
|
73
|
-
exports.
|
|
74
|
+
exports.Mutex = Mutex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Mutex } from './Mutex';
|
|
@@ -0,0 +1,7 @@
|
|
|
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.Mutex = void 0;
|
|
6
|
+
var Mutex_1 = require("./Mutex");
|
|
7
|
+
Object.defineProperty(exports, "Mutex", { enumerable: true, get: function () { return Mutex_1.Mutex; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface MutexInterface {
|
|
2
|
+
acquire(): Promise<MutexInterface.Releaser>;
|
|
3
|
+
runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
|
|
4
|
+
isLocked(): boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare namespace MutexInterface {
|
|
7
|
+
interface Releaser {
|
|
8
|
+
(): void;
|
|
9
|
+
}
|
|
10
|
+
interface Worker<T> {
|
|
11
|
+
(): Promise<T> | T;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AdditionalDetails, SetCustomUserAgentInput } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to
|
|
4
|
+
* clean up any custom state set with this API.
|
|
5
|
+
*
|
|
6
|
+
* @note
|
|
7
|
+
* This API operates globally. Calling this API multiple times will result in the most recently set values for a
|
|
8
|
+
* particular API being used.
|
|
9
|
+
*
|
|
10
|
+
* @note
|
|
11
|
+
* This utility IS NOT compatible with SSR.
|
|
12
|
+
*
|
|
13
|
+
* @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.
|
|
14
|
+
*/
|
|
15
|
+
export declare const setCustomUserAgent: (input: SetCustomUserAgentInput) => (() => void);
|
|
16
|
+
export declare const getCustomUserAgent: (category: string, api: string) => AdditionalDetails | undefined;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var __assign = (this && this.__assign) || function () {
|
|
5
|
+
__assign = Object.assign || function(t) {
|
|
6
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7
|
+
s = arguments[i];
|
|
8
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
9
|
+
t[p] = s[p];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
return __assign.apply(this, arguments);
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.getCustomUserAgent = exports.setCustomUserAgent = void 0;
|
|
17
|
+
// Maintains custom user-agent state set by external consumers.
|
|
18
|
+
var customUserAgentState = {};
|
|
19
|
+
/**
|
|
20
|
+
* Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to
|
|
21
|
+
* clean up any custom state set with this API.
|
|
22
|
+
*
|
|
23
|
+
* @note
|
|
24
|
+
* This API operates globally. Calling this API multiple times will result in the most recently set values for a
|
|
25
|
+
* particular API being used.
|
|
26
|
+
*
|
|
27
|
+
* @note
|
|
28
|
+
* This utility IS NOT compatible with SSR.
|
|
29
|
+
*
|
|
30
|
+
* @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.
|
|
31
|
+
*/
|
|
32
|
+
var setCustomUserAgent = function (input) {
|
|
33
|
+
var _a;
|
|
34
|
+
// Save custom user-agent state & increment reference counter
|
|
35
|
+
// TODO Remove `any` when we upgrade to TypeScript 5.2, see: https://github.com/microsoft/TypeScript/issues/44373
|
|
36
|
+
customUserAgentState[input.category] = input.apis.reduce(function (acc, api) {
|
|
37
|
+
var _a;
|
|
38
|
+
var _b;
|
|
39
|
+
return (__assign(__assign({}, acc), (_a = {}, _a[api] = {
|
|
40
|
+
refCount: ((_b = acc[api]) === null || _b === void 0 ? void 0 : _b.refCount) ? acc[api].refCount + 1 : 1,
|
|
41
|
+
additionalDetails: input.additionalDetails,
|
|
42
|
+
}, _a)));
|
|
43
|
+
}, (_a = customUserAgentState[input.category]) !== null && _a !== void 0 ? _a : {});
|
|
44
|
+
// Callback that cleans up state for APIs recorded by this call
|
|
45
|
+
var cleanUpCallbackCalled = false;
|
|
46
|
+
var cleanUpCallback = function () {
|
|
47
|
+
// Only allow the cleanup callback to be called once
|
|
48
|
+
if (cleanUpCallbackCalled) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
cleanUpCallbackCalled = true;
|
|
52
|
+
input.apis.forEach(function (api) {
|
|
53
|
+
var apiRefCount = customUserAgentState[input.category][api].refCount;
|
|
54
|
+
if (apiRefCount > 1) {
|
|
55
|
+
customUserAgentState[input.category][api].refCount = apiRefCount - 1;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
delete customUserAgentState[input.category][api];
|
|
59
|
+
// Clean up category if no more APIs set
|
|
60
|
+
if (!Object.keys(customUserAgentState[input.category]).length) {
|
|
61
|
+
delete customUserAgentState[input.category];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
return cleanUpCallback;
|
|
67
|
+
};
|
|
68
|
+
exports.setCustomUserAgent = setCustomUserAgent;
|
|
69
|
+
var getCustomUserAgent = function (category, api) { var _a, _b; return (_b = (_a = customUserAgentState[category]) === null || _a === void 0 ? void 0 : _a[api]) === null || _b === void 0 ? void 0 : _b.additionalDetails; };
|
|
70
|
+
exports.getCustomUserAgent = getCustomUserAgent;
|
package/lib/Platform/index.js
CHANGED
|
@@ -22,6 +22,7 @@ exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platfo
|
|
|
22
22
|
var types_1 = require("./types");
|
|
23
23
|
var version_1 = require("./version");
|
|
24
24
|
var detectFramework_1 = require("./detectFramework");
|
|
25
|
+
var customUserAgent_1 = require("./customUserAgent");
|
|
25
26
|
var BASE_USER_AGENT = "aws-amplify";
|
|
26
27
|
var PlatformBuilder = /** @class */ (function () {
|
|
27
28
|
function PlatformBuilder() {
|
|
@@ -55,6 +56,14 @@ var getAmplifyUserAgentObject = function (_a) {
|
|
|
55
56
|
userAgent.push([category, action]);
|
|
56
57
|
}
|
|
57
58
|
userAgent.push(['framework', (0, detectFramework_1.detectFramework)()]);
|
|
59
|
+
if (category && action) {
|
|
60
|
+
var customState = (0, customUserAgent_1.getCustomUserAgent)(category, action);
|
|
61
|
+
if (customState) {
|
|
62
|
+
customState.forEach(function (state) {
|
|
63
|
+
userAgent.push(state);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
58
67
|
return userAgent;
|
|
59
68
|
};
|
|
60
69
|
exports.getAmplifyUserAgentObject = getAmplifyUserAgentObject;
|
|
@@ -63,7 +72,7 @@ var getAmplifyUserAgent = function (customUserAgentDetails) {
|
|
|
63
72
|
var userAgentString = userAgent
|
|
64
73
|
.map(function (_a) {
|
|
65
74
|
var _b = __read(_a, 2), agentKey = _b[0], agentValue = _b[1];
|
|
66
|
-
return "".concat(agentKey, "/").concat(agentValue);
|
|
75
|
+
return agentKey && agentValue ? "".concat(agentKey, "/").concat(agentValue) : agentKey;
|
|
67
76
|
})
|
|
68
77
|
.join(' ');
|
|
69
78
|
return userAgentString;
|
package/lib/Platform/types.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare enum Category {
|
|
|
31
31
|
}
|
|
32
32
|
export declare enum AnalyticsAction {
|
|
33
33
|
Record = "1",
|
|
34
|
-
|
|
34
|
+
IdentifyUser = "2"
|
|
35
35
|
}
|
|
36
36
|
export declare enum ApiAction {
|
|
37
37
|
GraphQl = "1",
|
|
@@ -43,17 +43,49 @@ export declare enum ApiAction {
|
|
|
43
43
|
Head = "7"
|
|
44
44
|
}
|
|
45
45
|
export declare enum AuthAction {
|
|
46
|
-
|
|
46
|
+
SignUp = "1",
|
|
47
|
+
ConfirmSignUp = "2",
|
|
48
|
+
ResendSignUpCode = "3",
|
|
49
|
+
SignIn = "4",
|
|
50
|
+
FetchMFAPreference = "6",
|
|
51
|
+
UpdateMFAPreference = "7",
|
|
52
|
+
SetUpTOTP = "10",
|
|
53
|
+
VerifyTOTPSetup = "11",
|
|
54
|
+
ConfirmSignIn = "12",
|
|
55
|
+
DeleteUserAttributes = "15",
|
|
56
|
+
DeleteUser = "16",
|
|
57
|
+
UpdateUserAttributes = "17",
|
|
58
|
+
FetchUserAttributes = "18",
|
|
59
|
+
ConfirmUserAttribute = "22",
|
|
60
|
+
SignOut = "26",
|
|
61
|
+
UpdatePassword = "27",
|
|
62
|
+
ResetPassword = "28",
|
|
63
|
+
ConfirmResetPassword = "29",
|
|
64
|
+
FederatedSignIn = "30",
|
|
65
|
+
RememberDevice = "32",
|
|
66
|
+
ForgetDevice = "33",
|
|
67
|
+
FetchDevices = "34",
|
|
68
|
+
SendUserAttributeVerificationCode = "35",
|
|
69
|
+
SignInWithRedirect = "36"
|
|
47
70
|
}
|
|
48
71
|
export declare enum DataStoreAction {
|
|
49
72
|
Subscribe = "1",
|
|
50
73
|
GraphQl = "2"
|
|
51
74
|
}
|
|
52
75
|
export declare enum GeoAction {
|
|
53
|
-
|
|
76
|
+
SearchByText = "0",
|
|
77
|
+
SearchByCoordinates = "1",
|
|
78
|
+
SearchForSuggestions = "2",
|
|
79
|
+
SearchByPlaceId = "3",
|
|
80
|
+
SaveGeofences = "4",
|
|
81
|
+
GetGeofence = "5",
|
|
82
|
+
ListGeofences = "6",
|
|
83
|
+
DeleteGeofences = "7"
|
|
54
84
|
}
|
|
55
85
|
export declare enum InAppMessagingAction {
|
|
56
|
-
|
|
86
|
+
SyncMessages = "1",
|
|
87
|
+
IdentifyUser = "2",
|
|
88
|
+
DispatchEvent = "3"
|
|
57
89
|
}
|
|
58
90
|
export declare enum InteractionsAction {
|
|
59
91
|
None = "0"
|
|
@@ -67,15 +99,17 @@ export declare enum PubSubAction {
|
|
|
67
99
|
Subscribe = "1"
|
|
68
100
|
}
|
|
69
101
|
export declare enum PushNotificationAction {
|
|
70
|
-
|
|
102
|
+
InitializePushNotifications = "1",
|
|
103
|
+
IdentifyUser = "2"
|
|
71
104
|
}
|
|
72
105
|
export declare enum StorageAction {
|
|
73
|
-
|
|
74
|
-
|
|
106
|
+
UploadData = "1",
|
|
107
|
+
DownloadData = "2",
|
|
75
108
|
List = "3",
|
|
76
109
|
Copy = "4",
|
|
77
110
|
Remove = "5",
|
|
78
|
-
GetProperties = "6"
|
|
111
|
+
GetProperties = "6",
|
|
112
|
+
GetUrl = "7"
|
|
79
113
|
}
|
|
80
114
|
type ActionMap = {
|
|
81
115
|
[Category.Auth]: AuthAction;
|
|
@@ -101,4 +135,37 @@ export type CustomUserAgentDetails = (CustomUserAgentDetailsBase & {
|
|
|
101
135
|
category?: never;
|
|
102
136
|
action?: never;
|
|
103
137
|
}) | UserAgentDetailsWithCategory<Category.API> | UserAgentDetailsWithCategory<Category.Auth> | UserAgentDetailsWithCategory<Category.Analytics> | UserAgentDetailsWithCategory<Category.DataStore> | UserAgentDetailsWithCategory<Category.Geo> | UserAgentDetailsWithCategory<Category.Interactions> | UserAgentDetailsWithCategory<Category.InAppMessaging> | UserAgentDetailsWithCategory<Category.Predictions> | UserAgentDetailsWithCategory<Category.PubSub> | UserAgentDetailsWithCategory<Category.PushNotification> | UserAgentDetailsWithCategory<Category.Storage>;
|
|
138
|
+
/**
|
|
139
|
+
* `refCount` tracks how many consumers have set state for a particular API to avoid it being cleared before all
|
|
140
|
+
* consumers are done using it.
|
|
141
|
+
*
|
|
142
|
+
* Category -> Action -> Custom State
|
|
143
|
+
*/
|
|
144
|
+
export type CategoryUserAgentStateMap = Record<string, {
|
|
145
|
+
refCount: number;
|
|
146
|
+
additionalDetails: AdditionalDetails;
|
|
147
|
+
}>;
|
|
148
|
+
export type CustomUserAgentStateMap = Record<string, CategoryUserAgentStateMap>;
|
|
149
|
+
export type AdditionalDetails = [string, string?][];
|
|
150
|
+
export type StorageUserAgentInput = {
|
|
151
|
+
category: Category.Storage;
|
|
152
|
+
apis: StorageAction[];
|
|
153
|
+
additionalDetails: AdditionalDetails;
|
|
154
|
+
};
|
|
155
|
+
export type AuthUserAgentInput = {
|
|
156
|
+
category: Category.Auth;
|
|
157
|
+
apis: AuthAction[];
|
|
158
|
+
additionalDetails: AdditionalDetails;
|
|
159
|
+
};
|
|
160
|
+
export type InAppMessagingUserAgentInput = {
|
|
161
|
+
category: Category.InAppMessaging;
|
|
162
|
+
apis: InAppMessagingAction[];
|
|
163
|
+
additionalDetails: AdditionalDetails;
|
|
164
|
+
};
|
|
165
|
+
export type GeoUserAgentInput = {
|
|
166
|
+
category: Category.Geo;
|
|
167
|
+
apis: GeoAction[];
|
|
168
|
+
additionalDetails: AdditionalDetails;
|
|
169
|
+
};
|
|
170
|
+
export type SetCustomUserAgentInput = StorageUserAgentInput | AuthUserAgentInput | InAppMessagingUserAgentInput | GeoUserAgentInput;
|
|
104
171
|
export {};
|
package/lib/Platform/types.js
CHANGED
|
@@ -42,7 +42,7 @@ var Category;
|
|
|
42
42
|
var AnalyticsAction;
|
|
43
43
|
(function (AnalyticsAction) {
|
|
44
44
|
AnalyticsAction["Record"] = "1";
|
|
45
|
-
AnalyticsAction["
|
|
45
|
+
AnalyticsAction["IdentifyUser"] = "2";
|
|
46
46
|
})(AnalyticsAction = exports.AnalyticsAction || (exports.AnalyticsAction = {}));
|
|
47
47
|
var ApiAction;
|
|
48
48
|
(function (ApiAction) {
|
|
@@ -56,40 +56,30 @@ var ApiAction;
|
|
|
56
56
|
})(ApiAction = exports.ApiAction || (exports.ApiAction = {}));
|
|
57
57
|
var AuthAction;
|
|
58
58
|
(function (AuthAction) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
// CurrentUserPoolUser = '19',
|
|
78
|
-
// CurrentAuthenticatedUser = '20',
|
|
79
|
-
// CurrentSession = '21',
|
|
80
|
-
// VerifyUserAttribute = '22',
|
|
81
|
-
// VerifyUserAttributeSubmit = '23',
|
|
82
|
-
// VerifyCurrentUserAttribute = '24',
|
|
83
|
-
// VerifyCurrentUserAttributeSubmit = '25',
|
|
84
|
-
// SignOut = '26',
|
|
85
|
-
// ChangePassword = '27',
|
|
86
|
-
// ForgotPassword = '28',
|
|
87
|
-
// ForgotPasswordSubmit = '29',
|
|
59
|
+
AuthAction["SignUp"] = "1";
|
|
60
|
+
AuthAction["ConfirmSignUp"] = "2";
|
|
61
|
+
AuthAction["ResendSignUpCode"] = "3";
|
|
62
|
+
AuthAction["SignIn"] = "4";
|
|
63
|
+
AuthAction["FetchMFAPreference"] = "6";
|
|
64
|
+
AuthAction["UpdateMFAPreference"] = "7";
|
|
65
|
+
AuthAction["SetUpTOTP"] = "10";
|
|
66
|
+
AuthAction["VerifyTOTPSetup"] = "11";
|
|
67
|
+
AuthAction["ConfirmSignIn"] = "12";
|
|
68
|
+
AuthAction["DeleteUserAttributes"] = "15";
|
|
69
|
+
AuthAction["DeleteUser"] = "16";
|
|
70
|
+
AuthAction["UpdateUserAttributes"] = "17";
|
|
71
|
+
AuthAction["FetchUserAttributes"] = "18";
|
|
72
|
+
AuthAction["ConfirmUserAttribute"] = "22";
|
|
73
|
+
AuthAction["SignOut"] = "26";
|
|
74
|
+
AuthAction["UpdatePassword"] = "27";
|
|
75
|
+
AuthAction["ResetPassword"] = "28";
|
|
76
|
+
AuthAction["ConfirmResetPassword"] = "29";
|
|
88
77
|
AuthAction["FederatedSignIn"] = "30";
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
78
|
+
AuthAction["RememberDevice"] = "32";
|
|
79
|
+
AuthAction["ForgetDevice"] = "33";
|
|
80
|
+
AuthAction["FetchDevices"] = "34";
|
|
81
|
+
AuthAction["SendUserAttributeVerificationCode"] = "35";
|
|
82
|
+
AuthAction["SignInWithRedirect"] = "36";
|
|
93
83
|
})(AuthAction = exports.AuthAction || (exports.AuthAction = {}));
|
|
94
84
|
var DataStoreAction;
|
|
95
85
|
(function (DataStoreAction) {
|
|
@@ -98,11 +88,20 @@ var DataStoreAction;
|
|
|
98
88
|
})(DataStoreAction = exports.DataStoreAction || (exports.DataStoreAction = {}));
|
|
99
89
|
var GeoAction;
|
|
100
90
|
(function (GeoAction) {
|
|
101
|
-
GeoAction["
|
|
91
|
+
GeoAction["SearchByText"] = "0";
|
|
92
|
+
GeoAction["SearchByCoordinates"] = "1";
|
|
93
|
+
GeoAction["SearchForSuggestions"] = "2";
|
|
94
|
+
GeoAction["SearchByPlaceId"] = "3";
|
|
95
|
+
GeoAction["SaveGeofences"] = "4";
|
|
96
|
+
GeoAction["GetGeofence"] = "5";
|
|
97
|
+
GeoAction["ListGeofences"] = "6";
|
|
98
|
+
GeoAction["DeleteGeofences"] = "7";
|
|
102
99
|
})(GeoAction = exports.GeoAction || (exports.GeoAction = {}));
|
|
103
100
|
var InAppMessagingAction;
|
|
104
101
|
(function (InAppMessagingAction) {
|
|
105
|
-
InAppMessagingAction["
|
|
102
|
+
InAppMessagingAction["SyncMessages"] = "1";
|
|
103
|
+
InAppMessagingAction["IdentifyUser"] = "2";
|
|
104
|
+
InAppMessagingAction["DispatchEvent"] = "3";
|
|
106
105
|
})(InAppMessagingAction = exports.InAppMessagingAction || (exports.InAppMessagingAction = {}));
|
|
107
106
|
var InteractionsAction;
|
|
108
107
|
(function (InteractionsAction) {
|
|
@@ -120,14 +119,16 @@ var PubSubAction;
|
|
|
120
119
|
})(PubSubAction = exports.PubSubAction || (exports.PubSubAction = {}));
|
|
121
120
|
var PushNotificationAction;
|
|
122
121
|
(function (PushNotificationAction) {
|
|
123
|
-
PushNotificationAction["
|
|
122
|
+
PushNotificationAction["InitializePushNotifications"] = "1";
|
|
123
|
+
PushNotificationAction["IdentifyUser"] = "2";
|
|
124
124
|
})(PushNotificationAction = exports.PushNotificationAction || (exports.PushNotificationAction = {}));
|
|
125
125
|
var StorageAction;
|
|
126
126
|
(function (StorageAction) {
|
|
127
|
-
StorageAction["
|
|
128
|
-
StorageAction["
|
|
127
|
+
StorageAction["UploadData"] = "1";
|
|
128
|
+
StorageAction["DownloadData"] = "2";
|
|
129
129
|
StorageAction["List"] = "3";
|
|
130
130
|
StorageAction["Copy"] = "4";
|
|
131
131
|
StorageAction["Remove"] = "5";
|
|
132
132
|
StorageAction["GetProperties"] = "6";
|
|
133
|
+
StorageAction["GetUrl"] = "7";
|
|
133
134
|
})(StorageAction = exports.StorageAction || (exports.StorageAction = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.1-
|
|
1
|
+
export declare const version = "6.0.1-server-generate-client.1e317a1.0+1e317a1";
|
package/lib/Platform/version.js
CHANGED