@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
|
@@ -1,23 +1,47 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
+
function step(op) {
|
|
17
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
19
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
+
switch (op[0]) {
|
|
22
|
+
case 0: case 1: t = op; break;
|
|
23
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
+
default:
|
|
27
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
+
if (t[2]) _.ops.pop();
|
|
32
|
+
_.trys.pop(); continue;
|
|
33
|
+
}
|
|
34
|
+
op = body.call(thisArg, _);
|
|
35
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
+
}
|
|
38
|
+
};
|
|
15
39
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
16
|
-
import { isBrowser } from '../
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
40
|
+
import { isBrowser } from '../utils';
|
|
41
|
+
import { AmplifyError } from '../errors';
|
|
42
|
+
import { assert, ServiceWorkerErrorCode } from './errorHelpers';
|
|
43
|
+
import { record } from '../providers/pinpoint';
|
|
44
|
+
import { Amplify, fetchAuthSession } from '../singleton';
|
|
21
45
|
/**
|
|
22
46
|
* Provides a means to registering a service worker in the browser
|
|
23
47
|
* and communicating with it via postMessage events.
|
|
@@ -40,10 +64,7 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
40
64
|
* Get the currently active service worker
|
|
41
65
|
*/
|
|
42
66
|
get: function () {
|
|
43
|
-
|
|
44
|
-
name: SERVICE_WORKER_EXCEPTION,
|
|
45
|
-
message: 'Service Worker instance is undefined',
|
|
46
|
-
});
|
|
67
|
+
assert(this._serviceWorker !== undefined, ServiceWorkerErrorCode.UndefinedInstance);
|
|
47
68
|
return this._serviceWorker;
|
|
48
69
|
},
|
|
49
70
|
enumerable: false,
|
|
@@ -91,7 +112,7 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
91
112
|
.catch(function (error) {
|
|
92
113
|
_this._logger.debug("Service Worker Registration Failed ".concat(error));
|
|
93
114
|
return reject(new AmplifyError({
|
|
94
|
-
name:
|
|
115
|
+
name: ServiceWorkerErrorCode.Unavailable,
|
|
95
116
|
message: 'Service Worker not available',
|
|
96
117
|
underlyingError: error,
|
|
97
118
|
}));
|
|
@@ -99,7 +120,7 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
99
120
|
}
|
|
100
121
|
else {
|
|
101
122
|
return reject(new AmplifyError({
|
|
102
|
-
name:
|
|
123
|
+
name: ServiceWorkerErrorCode.Unavailable,
|
|
103
124
|
message: 'Service Worker not available',
|
|
104
125
|
}));
|
|
105
126
|
}
|
|
@@ -118,17 +139,11 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
118
139
|
*/
|
|
119
140
|
ServiceWorkerClass.prototype.enablePush = function (publicKey) {
|
|
120
141
|
var _this = this;
|
|
121
|
-
|
|
122
|
-
name: SERVICE_WORKER_EXCEPTION,
|
|
123
|
-
message: 'Service Worker registration is undefined',
|
|
124
|
-
});
|
|
142
|
+
assert(this._registration !== undefined, ServiceWorkerErrorCode.UndefinedRegistration);
|
|
125
143
|
this._publicKey = publicKey;
|
|
126
144
|
return new Promise(function (resolve, reject) {
|
|
127
145
|
if (isBrowser()) {
|
|
128
|
-
|
|
129
|
-
name: SERVICE_WORKER_EXCEPTION,
|
|
130
|
-
message: 'Service Worker registration is undefined',
|
|
131
|
-
});
|
|
146
|
+
assert(_this._registration !== undefined, ServiceWorkerErrorCode.UndefinedRegistration);
|
|
132
147
|
_this._registration.pushManager.getSubscription().then(function (subscription) {
|
|
133
148
|
if (subscription) {
|
|
134
149
|
_this._subscription = subscription;
|
|
@@ -154,7 +169,7 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
154
169
|
}
|
|
155
170
|
else {
|
|
156
171
|
return reject(new AmplifyError({
|
|
157
|
-
name:
|
|
172
|
+
name: ServiceWorkerErrorCode.Unavailable,
|
|
158
173
|
message: 'Service Worker not available',
|
|
159
174
|
}));
|
|
160
175
|
}
|
|
@@ -195,19 +210,37 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
195
210
|
**/
|
|
196
211
|
ServiceWorkerClass.prototype._setupListeners = function () {
|
|
197
212
|
var _this = this;
|
|
198
|
-
this.serviceWorker.addEventListener('statechange', function (event) {
|
|
199
|
-
var currentState
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
213
|
+
this.serviceWorker.addEventListener('statechange', function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
214
|
+
var currentState, _a, appId, region, credentials;
|
|
215
|
+
var _b, _c;
|
|
216
|
+
return __generator(this, function (_d) {
|
|
217
|
+
switch (_d.label) {
|
|
218
|
+
case 0:
|
|
219
|
+
currentState = this.serviceWorker.state;
|
|
220
|
+
this._logger.debug("ServiceWorker statechange: ".concat(currentState));
|
|
221
|
+
_a = (_c = (_b = Amplify.getConfig().Analytics) === null || _b === void 0 ? void 0 : _b.Pinpoint) !== null && _c !== void 0 ? _c : {}, appId = _a.appId, region = _a.region;
|
|
222
|
+
return [4 /*yield*/, fetchAuthSession()];
|
|
223
|
+
case 1:
|
|
224
|
+
credentials = (_d.sent()).credentials;
|
|
225
|
+
if (appId && region && credentials) {
|
|
226
|
+
// Pinpoint is configured, record an event
|
|
227
|
+
record({
|
|
228
|
+
appId: appId,
|
|
229
|
+
region: region,
|
|
230
|
+
category: 'Core',
|
|
231
|
+
credentials: credentials,
|
|
232
|
+
event: {
|
|
233
|
+
name: 'ServiceWorker',
|
|
234
|
+
attributes: {
|
|
235
|
+
state: currentState,
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return [2 /*return*/];
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}); });
|
|
211
244
|
this.serviceWorker.addEventListener('message', function (event) {
|
|
212
245
|
_this._logger.debug("ServiceWorker message event: ".concat(event));
|
|
213
246
|
});
|
|
@@ -215,6 +248,3 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
215
248
|
return ServiceWorkerClass;
|
|
216
249
|
}());
|
|
217
250
|
export { ServiceWorkerClass };
|
|
218
|
-
function isAmplifyWithAnalytics(amplify) {
|
|
219
|
-
return amplify.Analytics && typeof amplify.Analytics.record === 'function';
|
|
220
|
-
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AssertionFunction } from '../types';
|
|
2
|
+
export declare enum ServiceWorkerErrorCode {
|
|
3
|
+
UndefinedInstance = "UndefinedInstance",
|
|
4
|
+
UndefinedRegistration = "UndefinedRegistration",
|
|
5
|
+
Unavailable = "Unavailable"
|
|
6
|
+
}
|
|
7
|
+
export declare const assert: AssertionFunction<ServiceWorkerErrorCode>;
|
|
@@ -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 ServiceWorkerErrorCode;
|
|
6
|
+
(function (ServiceWorkerErrorCode) {
|
|
7
|
+
ServiceWorkerErrorCode["UndefinedInstance"] = "UndefinedInstance";
|
|
8
|
+
ServiceWorkerErrorCode["UndefinedRegistration"] = "UndefinedRegistration";
|
|
9
|
+
ServiceWorkerErrorCode["Unavailable"] = "Unavailable";
|
|
10
|
+
})(ServiceWorkerErrorCode || (ServiceWorkerErrorCode = {}));
|
|
11
|
+
var serviceWorkerErrorMap = (_a = {},
|
|
12
|
+
_a[ServiceWorkerErrorCode.UndefinedInstance] = {
|
|
13
|
+
message: 'Service Worker instance is undefined.',
|
|
14
|
+
},
|
|
15
|
+
_a[ServiceWorkerErrorCode.UndefinedRegistration] = {
|
|
16
|
+
message: 'Service Worker registration is undefined.',
|
|
17
|
+
},
|
|
18
|
+
_a[ServiceWorkerErrorCode.Unavailable] = {
|
|
19
|
+
message: 'Service Worker not available.',
|
|
20
|
+
},
|
|
21
|
+
_a);
|
|
22
|
+
export var assert = createAssertionFunction(serviceWorkerErrorMap);
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
13
1
|
export { ServiceWorkerClass as ServiceWorker } from './ServiceWorker';
|
|
@@ -1,15 +1,3 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
/**
|
|
4
|
-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
7
|
-
* the License. A copy of the License is located at
|
|
8
|
-
*
|
|
9
|
-
* http://aws.amazon.com/apache2.0/
|
|
10
|
-
*
|
|
11
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
12
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
13
|
-
* and limitations under the License.
|
|
14
|
-
*/
|
|
15
3
|
export { ServiceWorkerClass as ServiceWorker } from './ServiceWorker';
|
|
@@ -11,8 +11,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
return __assign.apply(this, arguments);
|
|
13
13
|
};
|
|
14
|
-
import { DateUtils } from './
|
|
15
|
-
import { presignUrl, signRequest, TOKEN_QUERY_PARAM, } from '
|
|
14
|
+
import { DateUtils } from './DateUtils';
|
|
15
|
+
import { presignUrl, signRequest, TOKEN_QUERY_PARAM, } from '../clients/middleware/signing/signer/signatureV4';
|
|
16
|
+
import { AmplifyUrl } from '../utils/amplifyUrl';
|
|
16
17
|
var IOT_SERVICE_NAME = 'iotdevicegateway';
|
|
17
18
|
// Best practice regex to parse the service and region from an AWS endpoint
|
|
18
19
|
var AWS_ENDPOINT_REGEX = /([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(.cn)?$/;
|
|
@@ -60,7 +61,7 @@ var Signer = /** @class */ (function () {
|
|
|
60
61
|
if (request.body && !request.data) {
|
|
61
62
|
throw new Error('The attribute "body" was found on the request object. Please use the attribute "data" instead.');
|
|
62
63
|
}
|
|
63
|
-
var requestToSign = __assign(__assign({}, request), { body: request.data, url: new
|
|
64
|
+
var requestToSign = __assign(__assign({}, request), { body: request.data, url: new AmplifyUrl(request.url) });
|
|
64
65
|
var options = getOptions(requestToSign, accessInfo, serviceInfo);
|
|
65
66
|
var signedRequest = signRequest(requestToSign, options);
|
|
66
67
|
// Prior to using `signRequest`, Signer accepted urls as strings and outputted urls as string. Coerce the property
|
|
@@ -82,7 +83,7 @@ var Signer = /** @class */ (function () {
|
|
|
82
83
|
var presignable = {
|
|
83
84
|
body: body,
|
|
84
85
|
method: method,
|
|
85
|
-
url: new
|
|
86
|
+
url: new AmplifyUrl(urlToSign),
|
|
86
87
|
};
|
|
87
88
|
var options = getOptions(presignable, accessInfo, serviceInfo, expiration);
|
|
88
89
|
var signedUrl = presignUrl(presignable, options);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Signer } from './Signer';
|
|
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
16
|
};
|
|
17
17
|
})();
|
|
18
|
-
import { AmplifyError } from '../../
|
|
18
|
+
import { AmplifyError } from '../../errors';
|
|
19
19
|
var AmplifyServerContextError = /** @class */ (function (_super) {
|
|
20
20
|
__extends(AmplifyServerContextError, _super);
|
|
21
21
|
function AmplifyServerContextError(_a) {
|
|
@@ -41,6 +41,7 @@ import { composeTransferHandler } from '../../clients/internal/composeTransferHa
|
|
|
41
41
|
import { jitteredBackoff, getRetryDecider, } from '../../clients/middleware/retry';
|
|
42
42
|
import { getAmplifyUserAgent } from '../../Platform';
|
|
43
43
|
import { observeFrameworkChanges } from '../../Platform/detectFramework';
|
|
44
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
44
45
|
/**
|
|
45
46
|
* The service name used to sign requests if the API requires authentication.
|
|
46
47
|
*/
|
|
@@ -51,7 +52,7 @@ var SERVICE_NAME = 'cognito-identity';
|
|
|
51
52
|
var endpointResolver = function (_a) {
|
|
52
53
|
var region = _a.region;
|
|
53
54
|
return ({
|
|
54
|
-
url: new
|
|
55
|
+
url: new AmplifyUrl("https://cognito-identity.".concat(region, ".").concat(getDnsSuffix(region))),
|
|
55
56
|
});
|
|
56
57
|
};
|
|
57
58
|
/**
|
|
@@ -14,8 +14,9 @@ export declare const getCredentialsForIdentity: (config: {
|
|
|
14
14
|
userAgentValue?: string | undefined;
|
|
15
15
|
cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
|
|
16
16
|
} & {
|
|
17
|
-
region: string;
|
|
18
17
|
abortSignal?: AbortSignal | undefined;
|
|
18
|
+
withCrossDomainCredentials?: boolean | undefined;
|
|
19
19
|
maxAttempts?: number | undefined;
|
|
20
20
|
userAgentHeader?: string | undefined;
|
|
21
|
+
region: string;
|
|
21
22
|
}, input: GetCredentialsForIdentityInput) => Promise<GetCredentialsForIdentityOutput>;
|
|
@@ -14,8 +14,9 @@ export declare const getId: (config: {
|
|
|
14
14
|
userAgentValue?: string | undefined;
|
|
15
15
|
cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
|
|
16
16
|
} & {
|
|
17
|
-
region: string;
|
|
18
17
|
abortSignal?: AbortSignal | undefined;
|
|
18
|
+
withCrossDomainCredentials?: boolean | undefined;
|
|
19
19
|
maxAttempts?: number | undefined;
|
|
20
20
|
userAgentHeader?: string | undefined;
|
|
21
|
+
region: string;
|
|
21
22
|
}, input: GetIdInput) => Promise<GetIdOutput>;
|
|
@@ -4,6 +4,7 @@ import { getDnsSuffix } from '../../clients/endpoints';
|
|
|
4
4
|
import { jitteredBackoff, getRetryDecider, } from '../../clients/middleware/retry';
|
|
5
5
|
import { parseJsonError } from '../../clients/serde/json';
|
|
6
6
|
import { getAmplifyUserAgent } from '../../Platform';
|
|
7
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
7
8
|
/**
|
|
8
9
|
* The service name used to sign requests if the API requires authentication.
|
|
9
10
|
*/
|
|
@@ -14,7 +15,7 @@ var SERVICE_NAME = 'mobiletargeting';
|
|
|
14
15
|
var endpointResolver = function (_a) {
|
|
15
16
|
var region = _a.region;
|
|
16
17
|
return ({
|
|
17
|
-
url: new
|
|
18
|
+
url: new AmplifyUrl("https://pinpoint.".concat(region, ".").concat(getDnsSuffix(region))),
|
|
18
19
|
});
|
|
19
20
|
};
|
|
20
21
|
/**
|
|
@@ -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 PinpointValidationErrorCode;
|
|
6
|
+
(function (PinpointValidationErrorCode) {
|
|
7
|
+
PinpointValidationErrorCode["NoAppId"] = "NoAppId";
|
|
8
|
+
})(PinpointValidationErrorCode || (PinpointValidationErrorCode = {}));
|
|
9
|
+
var pinpointValidationErrorMap = (_a = {},
|
|
10
|
+
_a[PinpointValidationErrorCode.NoAppId] = {
|
|
11
|
+
message: 'Missing application id.',
|
|
12
|
+
},
|
|
13
|
+
_a);
|
|
14
|
+
export var assert = createAssertionFunction(pinpointValidationErrorMap);
|
|
@@ -13,11 +13,12 @@ export declare const getInAppMessages: (config: {
|
|
|
13
13
|
computeDelay?: ((attempt: number) => number) | undefined;
|
|
14
14
|
userAgentValue?: string | undefined;
|
|
15
15
|
} & {
|
|
16
|
-
uriEscapePath?: boolean | undefined;
|
|
17
|
-
credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
|
|
18
|
-
region: string;
|
|
19
16
|
abortSignal?: AbortSignal | undefined;
|
|
20
17
|
cache?: RequestCache | undefined;
|
|
18
|
+
withCrossDomainCredentials?: boolean | undefined;
|
|
21
19
|
maxAttempts?: number | undefined;
|
|
22
20
|
userAgentHeader?: string | undefined;
|
|
21
|
+
uriEscapePath?: boolean | undefined;
|
|
22
|
+
credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
|
|
23
|
+
region: string;
|
|
23
24
|
}, input: GetInAppMessagesInput) => Promise<GetInAppMessagesOutput>;
|
|
@@ -41,10 +41,11 @@ import { composeServiceApi } from '../../clients/internal/composeServiceApi';
|
|
|
41
41
|
import { extendedEncodeURIComponent } from '../../clients/middleware/signing/utils/extendedEncodeURIComponent';
|
|
42
42
|
import { parseJsonBody, parseJsonError, parseMetadata, } from '../../clients/serde';
|
|
43
43
|
import { defaultConfig, getSharedHeaders } from './base';
|
|
44
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
44
45
|
var getInAppMessagesSerializer = function (_a, endpoint) {
|
|
45
46
|
var _b = _a.ApplicationId, ApplicationId = _b === void 0 ? '' : _b, _c = _a.EndpointId, EndpointId = _c === void 0 ? '' : _c;
|
|
46
47
|
var headers = getSharedHeaders();
|
|
47
|
-
var url = new
|
|
48
|
+
var url = new AmplifyUrl(endpoint.url);
|
|
48
49
|
url.pathname = "v1/apps/".concat(extendedEncodeURIComponent(ApplicationId), "/endpoints/").concat(extendedEncodeURIComponent(EndpointId), "/inappmessages");
|
|
49
50
|
return { method: 'GET', headers: headers, url: url };
|
|
50
51
|
};
|
|
@@ -13,11 +13,12 @@ export declare const putEvents: (config: {
|
|
|
13
13
|
computeDelay?: ((attempt: number) => number) | undefined;
|
|
14
14
|
userAgentValue?: string | undefined;
|
|
15
15
|
} & {
|
|
16
|
-
uriEscapePath?: boolean | undefined;
|
|
17
|
-
credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
|
|
18
|
-
region: string;
|
|
19
16
|
abortSignal?: AbortSignal | undefined;
|
|
20
17
|
cache?: RequestCache | undefined;
|
|
18
|
+
withCrossDomainCredentials?: boolean | undefined;
|
|
21
19
|
maxAttempts?: number | undefined;
|
|
22
20
|
userAgentHeader?: string | undefined;
|
|
21
|
+
uriEscapePath?: boolean | undefined;
|
|
22
|
+
credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
|
|
23
|
+
region: string;
|
|
23
24
|
}, input: PutEventsInput) => Promise<PutEventsOutput>;
|
|
@@ -36,21 +36,18 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
import { asserts } from '../../Util/errors/AssertError';
|
|
40
39
|
import { authenticatedHandler } from '../../clients/handlers/authenticated';
|
|
41
40
|
import { composeServiceApi } from '../../clients/internal/composeServiceApi';
|
|
42
41
|
import { extendedEncodeURIComponent } from '../../clients/middleware/signing/utils/extendedEncodeURIComponent';
|
|
43
42
|
import { parseJsonBody, parseJsonError, parseMetadata, } from '../../clients/serde';
|
|
44
|
-
import { APPLICATION_ID_EXCEPTION } from '../../Util/Constants';
|
|
45
43
|
import { defaultConfig, getSharedHeaders } from './base';
|
|
44
|
+
import { assert, PinpointValidationErrorCode } from './errorHelpers';
|
|
45
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
46
46
|
var putEventsSerializer = function (_a, endpoint) {
|
|
47
47
|
var ApplicationId = _a.ApplicationId, EventsRequest = _a.EventsRequest;
|
|
48
|
-
|
|
49
|
-
name: APPLICATION_ID_EXCEPTION,
|
|
50
|
-
message: 'ApplicationId is required for putEvents',
|
|
51
|
-
});
|
|
48
|
+
assert(!!ApplicationId, PinpointValidationErrorCode.NoAppId);
|
|
52
49
|
var headers = getSharedHeaders();
|
|
53
|
-
var url = new
|
|
50
|
+
var url = new AmplifyUrl(endpoint.url);
|
|
54
51
|
url.pathname = "v1/apps/".concat(extendedEncodeURIComponent(ApplicationId), "/events");
|
|
55
52
|
var body = JSON.stringify(EventsRequest !== null && EventsRequest !== void 0 ? EventsRequest : {});
|
|
56
53
|
return { method: 'POST', headers: headers, url: url, body: body };
|
|
@@ -13,11 +13,12 @@ export declare const updateEndpoint: (config: {
|
|
|
13
13
|
computeDelay?: ((attempt: number) => number) | undefined;
|
|
14
14
|
userAgentValue?: string | undefined;
|
|
15
15
|
} & {
|
|
16
|
-
uriEscapePath?: boolean | undefined;
|
|
17
|
-
credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
|
|
18
|
-
region: string;
|
|
19
16
|
abortSignal?: AbortSignal | undefined;
|
|
20
17
|
cache?: RequestCache | undefined;
|
|
18
|
+
withCrossDomainCredentials?: boolean | undefined;
|
|
21
19
|
maxAttempts?: number | undefined;
|
|
22
20
|
userAgentHeader?: string | undefined;
|
|
21
|
+
uriEscapePath?: boolean | undefined;
|
|
22
|
+
credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
|
|
23
|
+
region: string;
|
|
23
24
|
}, input: UpdateEndpointInput) => Promise<UpdateEndpointOutput>;
|
|
@@ -41,10 +41,11 @@ import { composeServiceApi } from '../../clients/internal/composeServiceApi';
|
|
|
41
41
|
import { extendedEncodeURIComponent } from '../../clients/middleware/signing/utils/extendedEncodeURIComponent';
|
|
42
42
|
import { parseJsonBody, parseJsonError, parseMetadata, } from '../../clients/serde';
|
|
43
43
|
import { defaultConfig, getSharedHeaders } from './base';
|
|
44
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
44
45
|
var updateEndpointSerializer = function (_a, endpoint) {
|
|
45
46
|
var _b = _a.ApplicationId, ApplicationId = _b === void 0 ? '' : _b, _c = _a.EndpointId, EndpointId = _c === void 0 ? '' : _c, EndpointRequest = _a.EndpointRequest;
|
|
46
47
|
var headers = getSharedHeaders();
|
|
47
|
-
var url = new
|
|
48
|
+
var url = new AmplifyUrl(endpoint.url);
|
|
48
49
|
url.pathname = "v1/apps/".concat(extendedEncodeURIComponent(ApplicationId), "/endpoints/").concat(extendedEncodeURIComponent(EndpointId));
|
|
49
50
|
var body = JSON.stringify(EndpointRequest);
|
|
50
51
|
return { method: 'PUT', headers: headers, url: url, body: body };
|
|
@@ -54,7 +54,7 @@ var shouldSendBody = function (method) {
|
|
|
54
54
|
// TODO[AllanZhengYP]: we need to provide isCanceledError utility
|
|
55
55
|
export var fetchTransferHandler = function (_a, _b) {
|
|
56
56
|
var url = _a.url, method = _a.method, headers = _a.headers, body = _a.body;
|
|
57
|
-
var abortSignal = _b.abortSignal, cache = _b.cache;
|
|
57
|
+
var abortSignal = _b.abortSignal, cache = _b.cache, withCrossDomainCredentials = _b.withCrossDomainCredentials;
|
|
58
58
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
59
59
|
var resp, e_1, responseHeaders, httpResponse, bodyWithMixin;
|
|
60
60
|
var _c, _d;
|
|
@@ -68,6 +68,7 @@ export var fetchTransferHandler = function (_a, _b) {
|
|
|
68
68
|
body: shouldSendBody(method) ? body : undefined,
|
|
69
69
|
signal: abortSignal,
|
|
70
70
|
cache: cache,
|
|
71
|
+
credentials: withCrossDomainCredentials ? 'include' : 'same-origin',
|
|
71
72
|
})];
|
|
72
73
|
case 1:
|
|
73
74
|
resp = _e.sent();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
// TODO: [v6] The separate retry utility is used by Data packages now and will replaced by retry middleware.
|
|
4
|
-
import { jitteredBackoff as jitteredBackoffUtil } from '../../../
|
|
4
|
+
import { jitteredBackoff as jitteredBackoffUtil } from '../../../utils';
|
|
5
5
|
var DEFAULT_MAX_DELAY_MS = 5 * 60 * 1000;
|
|
6
6
|
export var jitteredBackoff = function (attempt) {
|
|
7
7
|
var delayFunction = jitteredBackoffUtil(DEFAULT_MAX_DELAY_MS);
|
|
@@ -41,6 +41,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
41
41
|
import { ALGORITHM_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, CREDENTIAL_QUERY_PARAM, EXPIRES_QUERY_PARAM, HOST_HEADER, SHA256_ALGORITHM_IDENTIFIER, SIGNATURE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, TOKEN_QUERY_PARAM, } from './constants';
|
|
42
42
|
import { getSigningValues } from './utils/getSigningValues';
|
|
43
43
|
import { getSignature } from './utils/getSignature';
|
|
44
|
+
import { AmplifyUrl } from '../../../../../utils/amplifyUrl';
|
|
44
45
|
/**
|
|
45
46
|
* Given a `Presignable` object, returns a Signature Version 4 presigned `URL` object.
|
|
46
47
|
*
|
|
@@ -56,7 +57,7 @@ export var presignUrl = function (_a, _b) {
|
|
|
56
57
|
var accessKeyId = signingValues.accessKeyId, credentialScope = signingValues.credentialScope, longDate = signingValues.longDate, sessionToken = signingValues.sessionToken;
|
|
57
58
|
// create the request to sign
|
|
58
59
|
// @ts-ignore URL constructor accepts a URL object
|
|
59
|
-
var presignedUrl = new
|
|
60
|
+
var presignedUrl = new AmplifyUrl(url);
|
|
60
61
|
Object.entries(__assign(__assign((_c = {}, _c[ALGORITHM_QUERY_PARAM] = SHA256_ALGORITHM_IDENTIFIER, _c[CREDENTIAL_QUERY_PARAM] = "".concat(accessKeyId, "/").concat(credentialScope), _c[AMZ_DATE_QUERY_PARAM] = longDate, _c[SIGNED_HEADERS_QUERY_PARAM] = HOST_HEADER, _c), (expiration && (_d = {}, _d[EXPIRES_QUERY_PARAM] = expiration.toString(), _d))), (sessionToken && (_e = {}, _e[TOKEN_QUERY_PARAM] = sessionToken, _e)))).forEach(function (_a) {
|
|
61
62
|
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
62
63
|
presignedUrl.searchParams.append(key, value);
|
|
@@ -17,7 +17,7 @@ export interface HttpRequest extends Request {
|
|
|
17
17
|
*/
|
|
18
18
|
export type ResponseBodyMixin = Pick<Body, 'blob' | 'json' | 'text'>;
|
|
19
19
|
export interface HttpResponse extends Response {
|
|
20
|
-
body: (ResponseBodyMixin & ReadableStream) | ResponseBodyMixin
|
|
20
|
+
body: (ResponseBodyMixin & ReadableStream) | ResponseBodyMixin;
|
|
21
21
|
statusCode: number;
|
|
22
22
|
/**
|
|
23
23
|
* @see {@link HttpRequest.headers}
|
|
@@ -34,5 +34,21 @@ export interface HttpTransferOptions {
|
|
|
34
34
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/cache}
|
|
35
35
|
*/
|
|
36
36
|
cache?: RequestCache;
|
|
37
|
+
/**
|
|
38
|
+
* Internal-only option controls whether or not cross-site Access-Control requests should be made using credentials
|
|
39
|
+
* such as cookies, authorization headers or TLS client certificates. It has no effect on same-origin requests.
|
|
40
|
+
* If set to `true`, the request will include credentials such as cookies, authorization headers, TLS
|
|
41
|
+
* client certificates, and so on. Moreover the response cookies will also be set.
|
|
42
|
+
* If set to `false`, the cross-site request will not include credentials, and the response cookies from a different
|
|
43
|
+
* domain will be ignored.
|
|
44
|
+
*
|
|
45
|
+
* This option is only conformed by {@link fetchTransferHandler | fetchTransferHandler }
|
|
46
|
+
*
|
|
47
|
+
* @default 'same-origin'
|
|
48
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials}
|
|
49
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials}
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
withCrossDomainCredentials?: boolean;
|
|
37
53
|
}
|
|
38
54
|
export type HttpTransferHandler = TransferHandler<HttpRequest, HttpResponse, HttpTransferOptions>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const AWS_CLOUDWATCH_CATEGORY = "Logging";
|
|
2
|
+
export declare const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER: string | symbol;
|
|
3
|
+
export declare const USER_AGENT_HEADER = "x-amz-user-agent";
|
|
4
|
+
export declare const NO_HUBCALLBACK_PROVIDED_EXCEPTION = "NoHubcallbackProvidedException";
|
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
// Logging constants
|
|
4
4
|
export var AWS_CLOUDWATCH_CATEGORY = 'Logging';
|
|
5
|
-
export var NO_CREDS_ERROR_STRING = 'No credentials';
|
|
6
|
-
export var RETRY_ERROR_CODES = [
|
|
7
|
-
'ResourceNotFoundException',
|
|
8
|
-
'InvalidSequenceTokenException',
|
|
9
|
-
];
|
|
10
5
|
/**
|
|
11
6
|
* This Symbol is used to reference an internal-only PubSub provider that
|
|
12
7
|
* is used for AppSync/GraphQL subscriptions in the API category.
|
|
@@ -17,10 +12,4 @@ export var INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = hasSymbol
|
|
|
17
12
|
: '@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER';
|
|
18
13
|
export var USER_AGENT_HEADER = 'x-amz-user-agent';
|
|
19
14
|
// Error exception code constants
|
|
20
|
-
export var AUTH_CONFING_EXCEPTION = 'AuthConfigException';
|
|
21
|
-
export var CACHE_LIST_EXCEPTION = 'CacheListException';
|
|
22
|
-
export var I18N_EXCEPTION = 'I18NException';
|
|
23
|
-
export var SERVICE_WORKER_EXCEPTION = 'ServiceWorkerException';
|
|
24
|
-
export var STORAGE_CACHE_EXCEPTION = 'StorageCacheException';
|
|
25
|
-
export var APPLICATION_ID_EXCEPTION = 'ApplicationIdException';
|
|
26
15
|
export var NO_HUBCALLBACK_PROVIDED_EXCEPTION = 'NoHubcallbackProvidedException';
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function missingConfig(name: string): Error;
|
|
3
|
-
export declare function invalidParameter(name: string): Error;
|
|
4
|
-
export declare enum AmplifyErrorString {
|
|
5
|
-
UNKNOWN = "UnknownError",
|
|
6
|
-
PLATFORM_NOT_SUPPORTED_ERROR = "PlatformNotSupportedError"
|
|
7
|
-
}
|
|
1
|
+
import { AmplifyErrorParams } from '../types/errors';
|
|
8
2
|
export declare class AmplifyError extends Error {
|
|
9
3
|
underlyingError?: Error | unknown;
|
|
10
4
|
recoverySuggestion?: string;
|
|
@@ -16,6 +10,5 @@ export declare class AmplifyError extends Error {
|
|
|
16
10
|
* @param recoverySuggestion suggestion to recover from the error.
|
|
17
11
|
*
|
|
18
12
|
*/
|
|
19
|
-
constructor({ message, name, recoverySuggestion, underlyingError, }:
|
|
13
|
+
constructor({ message, name, recoverySuggestion, underlyingError, }: AmplifyErrorParams);
|
|
20
14
|
}
|
|
21
|
-
export declare const PlatformNotSupportedError: AmplifyError;
|