@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/libraryUtils.js
CHANGED
|
@@ -2,50 +2,46 @@
|
|
|
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
|
-
exports.
|
|
5
|
+
exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.AmplifyErrorCode = exports.createAssertionFunction = exports.PlatformNotSupportedError = exports.AmplifyError = exports.setCustomUserAgent = exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InAppMessagingAction = exports.InteractionsAction = exports.GeoAction = exports.Framework = exports.DataStoreAction = exports.Category = exports.AnalyticsAction = exports.AuthAction = exports.ApiAction = exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.parseAWSExports = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;
|
|
6
|
+
exports.sessionListener = exports.HubInternal = exports.getCrypto = void 0;
|
|
7
7
|
/*
|
|
8
8
|
This file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal
|
|
9
9
|
utils for use throughout the library.
|
|
10
10
|
*/
|
|
11
|
-
//
|
|
12
|
-
var
|
|
13
|
-
Object.defineProperty(exports, "
|
|
14
|
-
Object.defineProperty(exports, "
|
|
15
|
-
Object.defineProperty(exports, "
|
|
16
|
-
Object.defineProperty(exports, "
|
|
17
|
-
Object.defineProperty(exports, "
|
|
18
|
-
Object.defineProperty(exports, "
|
|
19
|
-
Object.defineProperty(exports, "
|
|
20
|
-
Object.defineProperty(exports, "
|
|
21
|
-
Object.defineProperty(exports, "
|
|
22
|
-
Object.defineProperty(exports, "
|
|
23
|
-
Object.defineProperty(exports, "transferKeyToLowerCase", { enumerable: true, get: function () { return JS_1.transferKeyToLowerCase; } });
|
|
24
|
-
Object.defineProperty(exports, "transferKeyToUpperCase", { enumerable: true, get: function () { return JS_1.transferKeyToUpperCase; } });
|
|
11
|
+
// Core utilities
|
|
12
|
+
var utils_1 = require("./utils");
|
|
13
|
+
Object.defineProperty(exports, "generateRandomString", { enumerable: true, get: function () { return utils_1.generateRandomString; } });
|
|
14
|
+
Object.defineProperty(exports, "isBrowser", { enumerable: true, get: function () { return utils_1.isBrowser; } });
|
|
15
|
+
Object.defineProperty(exports, "isNonRetryableError", { enumerable: true, get: function () { return utils_1.isNonRetryableError; } });
|
|
16
|
+
Object.defineProperty(exports, "isWebWorker", { enumerable: true, get: function () { return utils_1.isWebWorker; } });
|
|
17
|
+
Object.defineProperty(exports, "jitteredBackoff", { enumerable: true, get: function () { return utils_1.jitteredBackoff; } });
|
|
18
|
+
Object.defineProperty(exports, "jitteredExponentialRetry", { enumerable: true, get: function () { return utils_1.jitteredExponentialRetry; } });
|
|
19
|
+
Object.defineProperty(exports, "NonRetryableError", { enumerable: true, get: function () { return utils_1.NonRetryableError; } });
|
|
20
|
+
Object.defineProperty(exports, "retry", { enumerable: true, get: function () { return utils_1.retry; } });
|
|
21
|
+
Object.defineProperty(exports, "urlSafeDecode", { enumerable: true, get: function () { return utils_1.urlSafeDecode; } });
|
|
22
|
+
Object.defineProperty(exports, "urlSafeEncode", { enumerable: true, get: function () { return utils_1.urlSafeEncode; } });
|
|
25
23
|
var parseAWSExports_1 = require("./parseAWSExports");
|
|
26
24
|
Object.defineProperty(exports, "parseAWSExports", { enumerable: true, get: function () { return parseAWSExports_1.parseAWSExports; } });
|
|
25
|
+
var amplifyUuid_1 = require("./utils/amplifyUuid");
|
|
26
|
+
Object.defineProperty(exports, "amplifyUuid", { enumerable: true, get: function () { return amplifyUuid_1.amplifyUuid; } });
|
|
27
|
+
var amplifyUrl_1 = require("./utils/amplifyUrl");
|
|
28
|
+
Object.defineProperty(exports, "AmplifyUrl", { enumerable: true, get: function () { return amplifyUrl_1.AmplifyUrl; } });
|
|
29
|
+
Object.defineProperty(exports, "AmplifyUrlSearchParams", { enumerable: true, get: function () { return amplifyUrl_1.AmplifyUrlSearchParams; } });
|
|
27
30
|
// Auth utilities
|
|
28
|
-
var
|
|
29
|
-
Object.defineProperty(exports, "decodeJWT", { enumerable: true, get: function () { return
|
|
30
|
-
Object.defineProperty(exports, "assertTokenProviderConfig", { enumerable: true, get: function () { return
|
|
31
|
-
Object.defineProperty(exports, "
|
|
32
|
-
Object.defineProperty(exports, "assertOAuthConfig", { enumerable: true, get: function () { return
|
|
31
|
+
var utils_2 = require("./singleton/Auth/utils");
|
|
32
|
+
Object.defineProperty(exports, "decodeJWT", { enumerable: true, get: function () { return utils_2.decodeJWT; } });
|
|
33
|
+
Object.defineProperty(exports, "assertTokenProviderConfig", { enumerable: true, get: function () { return utils_2.assertTokenProviderConfig; } });
|
|
34
|
+
Object.defineProperty(exports, "assertIdentityPoolIdConfig", { enumerable: true, get: function () { return utils_2.assertIdentityPoolIdConfig; } });
|
|
35
|
+
Object.defineProperty(exports, "assertOAuthConfig", { enumerable: true, get: function () { return utils_2.assertOAuthConfig; } });
|
|
33
36
|
var Auth_1 = require("./singleton/Auth");
|
|
34
37
|
Object.defineProperty(exports, "isTokenExpired", { enumerable: true, get: function () { return Auth_1.isTokenExpired; } });
|
|
35
38
|
var Signer_1 = require("./Signer");
|
|
36
39
|
Object.defineProperty(exports, "Signer", { enumerable: true, get: function () { return Signer_1.Signer; } });
|
|
37
|
-
//
|
|
38
|
-
var Logger_1 = require("./Logger");
|
|
39
|
-
Object.defineProperty(exports, "ConsoleLogger", { enumerable: true, get: function () { return Logger_1.ConsoleLogger; } });
|
|
40
|
-
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return Logger_1.ConsoleLogger; } });
|
|
41
|
-
// Platform & device utils
|
|
40
|
+
// Platform & user-agent utilities
|
|
42
41
|
var Platform_1 = require("./Platform");
|
|
43
|
-
|
|
44
|
-
Object.defineProperty(exports, "
|
|
45
|
-
|
|
46
|
-
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return Platform_2.Platform; } });
|
|
47
|
-
Object.defineProperty(exports, "getAmplifyUserAgentObject", { enumerable: true, get: function () { return Platform_2.getAmplifyUserAgentObject; } });
|
|
48
|
-
Object.defineProperty(exports, "getAmplifyUserAgent", { enumerable: true, get: function () { return Platform_2.getAmplifyUserAgent; } });
|
|
42
|
+
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return Platform_1.Platform; } });
|
|
43
|
+
Object.defineProperty(exports, "getAmplifyUserAgentObject", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgentObject; } });
|
|
44
|
+
Object.defineProperty(exports, "getAmplifyUserAgent", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgent; } });
|
|
49
45
|
var types_1 = require("./Platform/types");
|
|
50
46
|
Object.defineProperty(exports, "ApiAction", { enumerable: true, get: function () { return types_1.ApiAction; } });
|
|
51
47
|
Object.defineProperty(exports, "AuthAction", { enumerable: true, get: function () { return types_1.AuthAction; } });
|
|
@@ -60,45 +56,37 @@ Object.defineProperty(exports, "PredictionsAction", { enumerable: true, get: fun
|
|
|
60
56
|
Object.defineProperty(exports, "PubSubAction", { enumerable: true, get: function () { return types_1.PubSubAction; } });
|
|
61
57
|
Object.defineProperty(exports, "PushNotificationAction", { enumerable: true, get: function () { return types_1.PushNotificationAction; } });
|
|
62
58
|
Object.defineProperty(exports, "StorageAction", { enumerable: true, get: function () { return types_1.StorageAction; } });
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Object.defineProperty(exports, "
|
|
59
|
+
var customUserAgent_1 = require("./Platform/customUserAgent");
|
|
60
|
+
Object.defineProperty(exports, "setCustomUserAgent", { enumerable: true, get: function () { return customUserAgent_1.setCustomUserAgent; } });
|
|
61
|
+
// Error handling
|
|
62
|
+
var errors_1 = require("./errors");
|
|
63
|
+
Object.defineProperty(exports, "AmplifyError", { enumerable: true, get: function () { return errors_1.AmplifyError; } });
|
|
64
|
+
Object.defineProperty(exports, "PlatformNotSupportedError", { enumerable: true, get: function () { return errors_1.PlatformNotSupportedError; } });
|
|
65
|
+
Object.defineProperty(exports, "createAssertionFunction", { enumerable: true, get: function () { return errors_1.createAssertionFunction; } });
|
|
66
|
+
var types_2 = require("./types");
|
|
67
|
+
Object.defineProperty(exports, "AmplifyErrorCode", { enumerable: true, get: function () { return types_2.AmplifyErrorCode; } });
|
|
69
68
|
// Other utilities & constants
|
|
70
|
-
var
|
|
71
|
-
Object.defineProperty(exports, "
|
|
72
|
-
|
|
73
|
-
Object.defineProperty(exports, "
|
|
74
|
-
|
|
75
|
-
Object.defineProperty(exports, "
|
|
76
|
-
|
|
77
|
-
Object.defineProperty(exports, "
|
|
78
|
-
Object.defineProperty(exports, "
|
|
79
|
-
Object.defineProperty(exports, "RETRY_ERROR_CODES", { enumerable: true, get: function () { return Util_1.RETRY_ERROR_CODES; } });
|
|
80
|
-
Object.defineProperty(exports, "Reachability", { enumerable: true, get: function () { return Util_1.Reachability; } });
|
|
81
|
-
Object.defineProperty(exports, "isNonRetryableError", { enumerable: true, get: function () { return Util_1.isNonRetryableError; } });
|
|
82
|
-
Object.defineProperty(exports, "jitteredBackoff", { enumerable: true, get: function () { return Util_1.jitteredBackoff; } });
|
|
83
|
-
Object.defineProperty(exports, "jitteredExponentialRetry", { enumerable: true, get: function () { return Util_1.jitteredExponentialRetry; } });
|
|
84
|
-
Object.defineProperty(exports, "retry", { enumerable: true, get: function () { return Util_1.retry; } });
|
|
85
|
-
Object.defineProperty(exports, "urlSafeDecode", { enumerable: true, get: function () { return Util_1.urlSafeDecode; } });
|
|
86
|
-
Object.defineProperty(exports, "urlSafeEncode", { enumerable: true, get: function () { return Util_1.urlSafeEncode; } });
|
|
87
|
-
var AssertError_1 = require("./Util/errors/AssertError");
|
|
88
|
-
Object.defineProperty(exports, "asserts", { enumerable: true, get: function () { return AssertError_1.asserts; } });
|
|
89
|
-
var Errors_1 = require("./Util/Errors");
|
|
90
|
-
Object.defineProperty(exports, "invalidParameter", { enumerable: true, get: function () { return Errors_1.invalidParameter; } });
|
|
91
|
-
Object.defineProperty(exports, "missingConfig", { enumerable: true, get: function () { return Errors_1.missingConfig; } });
|
|
92
|
-
Object.defineProperty(exports, "AmplifyError", { enumerable: true, get: function () { return Errors_1.AmplifyError; } });
|
|
93
|
-
Object.defineProperty(exports, "AmplifyErrorString", { enumerable: true, get: function () { return Errors_1.AmplifyErrorString; } });
|
|
94
|
-
var RNComponents_1 = require("./RNComponents");
|
|
95
|
-
Object.defineProperty(exports, "AppState", { enumerable: true, get: function () { return RNComponents_1.AppState; } });
|
|
96
|
-
Object.defineProperty(exports, "AsyncStorage", { enumerable: true, get: function () { return RNComponents_1.AsyncStorage; } });
|
|
97
|
-
Object.defineProperty(exports, "Linking", { enumerable: true, get: function () { return RNComponents_1.Linking; } });
|
|
98
|
-
var Constants_1 = require("./Util/Constants");
|
|
99
|
-
Object.defineProperty(exports, "INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER", { enumerable: true, get: function () { return Constants_1.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER; } });
|
|
100
|
-
Object.defineProperty(exports, "USER_AGENT_HEADER", { enumerable: true, get: function () { return Constants_1.USER_AGENT_HEADER; } });
|
|
69
|
+
var BackgroundProcessManager_1 = require("./BackgroundProcessManager");
|
|
70
|
+
Object.defineProperty(exports, "BackgroundProcessManager", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManager; } });
|
|
71
|
+
var Mutex_1 = require("./Mutex");
|
|
72
|
+
Object.defineProperty(exports, "Mutex", { enumerable: true, get: function () { return Mutex_1.Mutex; } });
|
|
73
|
+
var Reachability_1 = require("./Reachability");
|
|
74
|
+
Object.defineProperty(exports, "Reachability", { enumerable: true, get: function () { return Reachability_1.Reachability; } });
|
|
75
|
+
var constants_1 = require("./constants");
|
|
76
|
+
Object.defineProperty(exports, "INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER", { enumerable: true, get: function () { return constants_1.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER; } });
|
|
77
|
+
Object.defineProperty(exports, "USER_AGENT_HEADER", { enumerable: true, get: function () { return constants_1.USER_AGENT_HEADER; } });
|
|
101
78
|
var fetchAuthSession_1 = require("./singleton/apis/internal/fetchAuthSession");
|
|
102
79
|
Object.defineProperty(exports, "fetchAuthSession", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });
|
|
103
80
|
var Hub_1 = require("./Hub");
|
|
104
81
|
Object.defineProperty(exports, "AMPLIFY_SYMBOL", { enumerable: true, get: function () { return Hub_1.AMPLIFY_SYMBOL; } });
|
|
82
|
+
var convert_1 = require("./utils/convert");
|
|
83
|
+
Object.defineProperty(exports, "base64Decoder", { enumerable: true, get: function () { return convert_1.base64Decoder; } });
|
|
84
|
+
Object.defineProperty(exports, "base64Encoder", { enumerable: true, get: function () { return convert_1.base64Encoder; } });
|
|
85
|
+
var globalHelpers_1 = require("./utils/globalHelpers");
|
|
86
|
+
Object.defineProperty(exports, "getCrypto", { enumerable: true, get: function () { return globalHelpers_1.getCrypto; } });
|
|
87
|
+
// Hub
|
|
88
|
+
var Hub_2 = require("./Hub");
|
|
89
|
+
Object.defineProperty(exports, "HubInternal", { enumerable: true, get: function () { return Hub_2.HubInternal; } });
|
|
90
|
+
// Session listener
|
|
91
|
+
var sessionListener_1 = require("./utils/sessionListener");
|
|
92
|
+
Object.defineProperty(exports, "sessionListener", { enumerable: true, get: function () { return sessionListener_1.sessionListener; } });
|
package/lib/parseAWSExports.js
CHANGED
|
@@ -10,8 +10,45 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o), r, ar = [], e;
|
|
17
|
+
try {
|
|
18
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
+
}
|
|
20
|
+
catch (error) { e = { error: error }; }
|
|
21
|
+
finally {
|
|
22
|
+
try {
|
|
23
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
+
}
|
|
25
|
+
finally { if (e) throw e.error; }
|
|
26
|
+
}
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
30
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
31
|
+
if (ar || !(i in from)) {
|
|
32
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
33
|
+
ar[i] = from[i];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
37
|
+
};
|
|
13
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
39
|
exports.parseAWSExports = void 0;
|
|
40
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
41
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
42
|
+
var Logger_1 = require("./Logger");
|
|
43
|
+
var logger = new Logger_1.ConsoleLogger('parseAWSExports');
|
|
44
|
+
var authTypeMapping = {
|
|
45
|
+
API_KEY: 'apiKey',
|
|
46
|
+
AWS_IAM: 'iam',
|
|
47
|
+
AMAZON_COGNITO_USER_POOLS: 'userPool',
|
|
48
|
+
OPENID_CONNECT: 'oidc',
|
|
49
|
+
NONE: 'none',
|
|
50
|
+
LAMBDA: 'lambda',
|
|
51
|
+
};
|
|
15
52
|
/**
|
|
16
53
|
* This utility converts the `aws-exports.js` file generated by the Amplify CLI into a {@link ResourcesConfig} object
|
|
17
54
|
* consumable by Amplify.
|
|
@@ -21,8 +58,9 @@ exports.parseAWSExports = void 0;
|
|
|
21
58
|
* @returns A {@link ResourcesConfig} object.
|
|
22
59
|
*/
|
|
23
60
|
var parseAWSExports = function (config) {
|
|
61
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
24
62
|
if (config === void 0) { config = {}; }
|
|
25
|
-
var aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth;
|
|
63
|
+
var aws_appsync_apiKey = config.aws_appsync_apiKey, aws_appsync_authenticationType = config.aws_appsync_authenticationType, aws_appsync_graphqlEndpoint = config.aws_appsync_graphqlEndpoint, aws_appsync_region = config.aws_appsync_region, aws_bots = config.aws_bots, aws_bots_config = config.aws_bots_config, aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_cognito_mfa_configuration = config.aws_cognito_mfa_configuration, aws_cognito_mfa_types = config.aws_cognito_mfa_types, aws_cognito_password_protection_settings = config.aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms = config.aws_cognito_verification_mechanisms, aws_cognito_signup_attributes = config.aws_cognito_signup_attributes, aws_cognito_username_attributes = config.aws_cognito_username_attributes, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth, aws_cloud_logic_custom = config.aws_cloud_logic_custom, Notifications = config.Notifications, modelIntrospection = config.modelIntrospection;
|
|
26
64
|
var amplifyConfig = {};
|
|
27
65
|
// Analytics
|
|
28
66
|
if (aws_mobile_analytics_app_id) {
|
|
@@ -33,13 +71,98 @@ var parseAWSExports = function (config) {
|
|
|
33
71
|
},
|
|
34
72
|
};
|
|
35
73
|
}
|
|
74
|
+
// Notifications
|
|
75
|
+
var _o = Notifications !== null && Notifications !== void 0 ? Notifications : {}, InAppMessaging = _o.InAppMessaging, Push = _o.Push;
|
|
76
|
+
if ((InAppMessaging === null || InAppMessaging === void 0 ? void 0 : InAppMessaging.AWSPinpoint) || (Push === null || Push === void 0 ? void 0 : Push.AWSPinpoint)) {
|
|
77
|
+
amplifyConfig.Notifications = {};
|
|
78
|
+
if (InAppMessaging === null || InAppMessaging === void 0 ? void 0 : InAppMessaging.AWSPinpoint) {
|
|
79
|
+
var _p = InAppMessaging.AWSPinpoint, appId = _p.appId, region = _p.region;
|
|
80
|
+
amplifyConfig.Notifications.InAppMessaging = {
|
|
81
|
+
Pinpoint: {
|
|
82
|
+
appId: appId,
|
|
83
|
+
region: region,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (Push === null || Push === void 0 ? void 0 : Push.AWSPinpoint) {
|
|
88
|
+
var _q = Push.AWSPinpoint, appId = _q.appId, region = _q.region;
|
|
89
|
+
amplifyConfig.Notifications.PushNotification = {
|
|
90
|
+
Pinpoint: {
|
|
91
|
+
appId: appId,
|
|
92
|
+
region: region,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Interactions
|
|
98
|
+
if (Array.isArray(aws_bots_config)) {
|
|
99
|
+
amplifyConfig.Interactions = {
|
|
100
|
+
LexV1: Object.fromEntries(aws_bots_config.map(function (bot) { return [bot.name, bot]; })),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
// API
|
|
104
|
+
if (aws_appsync_graphqlEndpoint) {
|
|
105
|
+
var defaultAuthMode = authTypeMapping[aws_appsync_authenticationType];
|
|
106
|
+
if (!defaultAuthMode) {
|
|
107
|
+
logger.debug("Invalid authentication type ".concat(aws_appsync_authenticationType, ". Falling back to IAM."));
|
|
108
|
+
}
|
|
109
|
+
amplifyConfig.API = {
|
|
110
|
+
GraphQL: {
|
|
111
|
+
endpoint: aws_appsync_graphqlEndpoint,
|
|
112
|
+
apiKey: aws_appsync_apiKey,
|
|
113
|
+
region: aws_appsync_region,
|
|
114
|
+
defaultAuthMode: defaultAuthMode !== null && defaultAuthMode !== void 0 ? defaultAuthMode : 'iam',
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
if (modelIntrospection) {
|
|
118
|
+
amplifyConfig.API.GraphQL.modelIntrospection = modelIntrospection;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
36
121
|
// Auth
|
|
122
|
+
var mfaConfig = aws_cognito_mfa_configuration
|
|
123
|
+
? {
|
|
124
|
+
status: aws_cognito_mfa_configuration &&
|
|
125
|
+
aws_cognito_mfa_configuration.toLowerCase(),
|
|
126
|
+
totpEnabled: (_a = aws_cognito_mfa_types === null || aws_cognito_mfa_types === void 0 ? void 0 : aws_cognito_mfa_types.includes('TOTP')) !== null && _a !== void 0 ? _a : false,
|
|
127
|
+
smsEnabled: (_b = aws_cognito_mfa_types === null || aws_cognito_mfa_types === void 0 ? void 0 : aws_cognito_mfa_types.includes('SMS')) !== null && _b !== void 0 ? _b : false,
|
|
128
|
+
}
|
|
129
|
+
: undefined;
|
|
130
|
+
var passwordFormatConfig = aws_cognito_password_protection_settings
|
|
131
|
+
? {
|
|
132
|
+
minLength: aws_cognito_password_protection_settings.passwordPolicyMinLength,
|
|
133
|
+
requireLowercase: (_d = (_c = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _c === void 0 ? void 0 : _c.includes('REQUIRES_LOWERCASE')) !== null && _d !== void 0 ? _d : false,
|
|
134
|
+
requireUppercase: (_f = (_e = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _e === void 0 ? void 0 : _e.includes('REQUIRES_UPPERCASE')) !== null && _f !== void 0 ? _f : false,
|
|
135
|
+
requireNumbers: (_h = (_g = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _g === void 0 ? void 0 : _g.includes('REQUIRES_NUMBERS')) !== null && _h !== void 0 ? _h : false,
|
|
136
|
+
requireSpecialCharacters: (_k = (_j = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _j === void 0 ? void 0 : _j.includes('REQUIRES_SYMBOLS')) !== null && _k !== void 0 ? _k : false,
|
|
137
|
+
}
|
|
138
|
+
: undefined;
|
|
139
|
+
var mergedUserAttributes = Array.from(new Set(__spreadArray(__spreadArray([], __read((aws_cognito_verification_mechanisms !== null && aws_cognito_verification_mechanisms !== void 0 ? aws_cognito_verification_mechanisms : [])), false), __read((aws_cognito_signup_attributes !== null && aws_cognito_signup_attributes !== void 0 ? aws_cognito_signup_attributes : [])), false)));
|
|
140
|
+
var userAttributesConfig = mergedUserAttributes.map(function (s) {
|
|
141
|
+
var _a;
|
|
142
|
+
return (_a = {},
|
|
143
|
+
_a[s.toLowerCase()] = {
|
|
144
|
+
required: true, // All user attributes generated by the CLI will be required
|
|
145
|
+
},
|
|
146
|
+
_a);
|
|
147
|
+
});
|
|
148
|
+
var loginWithEmailEnabled = (_l = aws_cognito_username_attributes === null || aws_cognito_username_attributes === void 0 ? void 0 : aws_cognito_username_attributes.includes('EMAIL')) !== null && _l !== void 0 ? _l : false;
|
|
149
|
+
var loginWithPhoneEnabled = (_m = aws_cognito_username_attributes === null || aws_cognito_username_attributes === void 0 ? void 0 : aws_cognito_username_attributes.includes('PHONE_NUMBER')) !== null && _m !== void 0 ? _m : false;
|
|
37
150
|
if (aws_cognito_identity_pool_id || aws_user_pools_id) {
|
|
38
151
|
amplifyConfig.Auth = {
|
|
39
|
-
Cognito:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
152
|
+
Cognito: {
|
|
153
|
+
identityPoolId: aws_cognito_identity_pool_id,
|
|
154
|
+
allowGuestAccess: aws_mandatory_sign_in !== 'enable',
|
|
155
|
+
signUpVerificationMethod: aws_cognito_sign_up_verification_method,
|
|
156
|
+
userAttributes: userAttributesConfig,
|
|
157
|
+
userPoolClientId: aws_user_pools_web_client_id,
|
|
158
|
+
userPoolId: aws_user_pools_id,
|
|
159
|
+
mfa: mfaConfig,
|
|
160
|
+
passwordFormat: passwordFormatConfig,
|
|
161
|
+
loginWith: __assign({ username: loginWithEmailEnabled || loginWithPhoneEnabled ? false : true, email: loginWithEmailEnabled, phone: loginWithPhoneEnabled }, (oauth &&
|
|
162
|
+
Object.keys(oauth).length > 0 && {
|
|
163
|
+
oauth: getOAuthConfig(oauth),
|
|
164
|
+
})),
|
|
165
|
+
},
|
|
43
166
|
};
|
|
44
167
|
}
|
|
45
168
|
// Storage
|
|
@@ -56,9 +179,19 @@ var parseAWSExports = function (config) {
|
|
|
56
179
|
if (geo) {
|
|
57
180
|
var amazon_location_service = geo.amazon_location_service;
|
|
58
181
|
amplifyConfig.Geo = amazon_location_service
|
|
59
|
-
? {
|
|
182
|
+
? {
|
|
183
|
+
LocationService: __assign(__assign({}, amazon_location_service), { searchIndices: amazon_location_service.search_indices, region: amazon_location_service.region }),
|
|
184
|
+
}
|
|
60
185
|
: __assign({}, geo);
|
|
61
186
|
}
|
|
187
|
+
// REST API
|
|
188
|
+
if (aws_cloud_logic_custom) {
|
|
189
|
+
amplifyConfig.API = __assign(__assign({}, amplifyConfig.API), { REST: aws_cloud_logic_custom.reduce(function (acc, api) {
|
|
190
|
+
var _a;
|
|
191
|
+
var name = api.name, endpoint = api.endpoint, region = api.region, service = api.service;
|
|
192
|
+
return __assign(__assign({}, acc), (_a = {}, _a[name] = __assign(__assign({ endpoint: endpoint }, (service ? { service: service } : undefined)), (region ? { region: region } : undefined)), _a));
|
|
193
|
+
}, {}) });
|
|
194
|
+
}
|
|
62
195
|
return amplifyConfig;
|
|
63
196
|
};
|
|
64
197
|
exports.parseAWSExports = parseAWSExports;
|
|
@@ -68,12 +201,10 @@ var getRedirectUrl = function (redirectStr) {
|
|
|
68
201
|
var getOAuthConfig = function (_a) {
|
|
69
202
|
var domain = _a.domain, scope = _a.scope, redirectSignIn = _a.redirectSignIn, redirectSignOut = _a.redirectSignOut, responseType = _a.responseType;
|
|
70
203
|
return ({
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
responseType: responseType,
|
|
77
|
-
},
|
|
204
|
+
domain: domain,
|
|
205
|
+
scopes: scope,
|
|
206
|
+
redirectSignIn: getRedirectUrl(redirectSignIn),
|
|
207
|
+
redirectSignOut: getRedirectUrl(redirectSignOut),
|
|
208
|
+
responseType: responseType,
|
|
78
209
|
});
|
|
79
210
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './kinesis';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
__exportStar(require("./kinesis"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { KinesisFirehoseProviderConfig } from './kinesis-firehose';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PersonalizeProviderConfig } from './personalize';
|
|
@@ -0,0 +1,21 @@
|
|
|
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.flushEvents = void 0;
|
|
6
|
+
var getEventBuffer_1 = require("../utils/getEventBuffer");
|
|
7
|
+
var constants_1 = require("../utils/constants");
|
|
8
|
+
var flushEvents = function (appId, region, credentials, identityId, userAgentValue) {
|
|
9
|
+
(0, getEventBuffer_1.getEventBuffer)({
|
|
10
|
+
appId: appId,
|
|
11
|
+
bufferSize: constants_1.BUFFER_SIZE,
|
|
12
|
+
credentials: credentials,
|
|
13
|
+
flushInterval: constants_1.FLUSH_INTERVAL,
|
|
14
|
+
flushSize: constants_1.FLUSH_SIZE,
|
|
15
|
+
identityId: identityId,
|
|
16
|
+
region: region,
|
|
17
|
+
resendLimit: constants_1.RESEND_LIMIT,
|
|
18
|
+
userAgentValue: userAgentValue,
|
|
19
|
+
}).flushAll();
|
|
20
|
+
};
|
|
21
|
+
exports.flushEvents = flushEvents;
|
|
@@ -2,8 +2,10 @@
|
|
|
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.record = exports.updateEndpoint = void 0;
|
|
5
|
+
exports.flushEvents = exports.record = exports.updateEndpoint = void 0;
|
|
6
6
|
var updateEndpoint_1 = require("./updateEndpoint");
|
|
7
7
|
Object.defineProperty(exports, "updateEndpoint", { enumerable: true, get: function () { return updateEndpoint_1.updateEndpoint; } });
|
|
8
8
|
var record_1 = require("./record");
|
|
9
9
|
Object.defineProperty(exports, "record", { enumerable: true, get: function () { return record_1.record; } });
|
|
10
|
+
var flushEvents_1 = require("./flushEvents");
|
|
11
|
+
Object.defineProperty(exports, "flushEvents", { enumerable: true, get: function () { return flushEvents_1.flushEvents; } });
|
|
@@ -2,4 +2,4 @@ import { PinpointRecordInput } from '../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const record: ({ appId, category, credentials, event, identityId, region, userAgentValue, }: PinpointRecordInput) => Promise<void>;
|
|
5
|
+
export declare const record: ({ appId, category, channelType, credentials, event, identityId, region, userAgentValue, }: PinpointRecordInput) => Promise<void>;
|
|
@@ -39,29 +39,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.record = void 0;
|
|
42
|
-
var
|
|
42
|
+
var amplifyUuid_1 = require("../../../utils/amplifyUuid");
|
|
43
43
|
var utils_1 = require("../utils");
|
|
44
44
|
var constants_1 = require("../utils/constants");
|
|
45
|
-
var updateEndpoint_1 = require("./updateEndpoint");
|
|
46
45
|
var getEventBuffer_1 = require("../utils/getEventBuffer");
|
|
47
|
-
var libraryUtils_1 = require("../../../libraryUtils");
|
|
48
46
|
// TODO(v6) Refactor when we add support for session tracking & `autoTrack`
|
|
49
47
|
var session;
|
|
50
48
|
/**
|
|
51
49
|
* @internal
|
|
52
50
|
*/
|
|
53
51
|
var record = function (_a) {
|
|
54
|
-
var appId = _a.appId, category = _a.category, credentials = _a.credentials, event = _a.event, identityId = _a.identityId, region = _a.region, userAgentValue = _a.userAgentValue;
|
|
52
|
+
var appId = _a.appId, category = _a.category, channelType = _a.channelType, credentials = _a.credentials, event = _a.event, identityId = _a.identityId, region = _a.region, userAgentValue = _a.userAgentValue;
|
|
55
53
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
var timestampISOString, eventId,
|
|
54
|
+
var timestampISOString, eventId, buffer, endpointId, sessionId;
|
|
57
55
|
return __generator(this, function (_b) {
|
|
58
56
|
switch (_b.label) {
|
|
59
57
|
case 0:
|
|
60
58
|
timestampISOString = new Date().toISOString();
|
|
61
|
-
eventId = (0,
|
|
62
|
-
return [4 /*yield*/, (0, utils_1.getEndpointId)(appId, category)];
|
|
63
|
-
case 1:
|
|
64
|
-
endpointId = _b.sent();
|
|
59
|
+
eventId = (0, amplifyUuid_1.amplifyUuid)();
|
|
65
60
|
buffer = (0, getEventBuffer_1.getEventBuffer)({
|
|
66
61
|
appId: appId,
|
|
67
62
|
bufferSize: constants_1.BUFFER_SIZE,
|
|
@@ -73,31 +68,20 @@ var record = function (_a) {
|
|
|
73
68
|
resendLimit: constants_1.RESEND_LIMIT,
|
|
74
69
|
userAgentValue: userAgentValue,
|
|
75
70
|
});
|
|
76
|
-
|
|
77
|
-
return [4 /*yield*/, (0, updateEndpoint_1.updateEndpoint)({
|
|
71
|
+
return [4 /*yield*/, (0, utils_1.resolveEndpointId)({
|
|
78
72
|
appId: appId,
|
|
79
73
|
category: category,
|
|
74
|
+
channelType: channelType,
|
|
80
75
|
credentials: credentials,
|
|
81
76
|
identityId: identityId,
|
|
82
77
|
region: region,
|
|
83
78
|
userAgentValue: userAgentValue,
|
|
84
79
|
})];
|
|
85
|
-
case
|
|
86
|
-
_b.sent();
|
|
87
|
-
return [4 /*yield*/, (0, utils_1.getEndpointId)(appId, category)];
|
|
88
|
-
case 3:
|
|
80
|
+
case 1:
|
|
89
81
|
endpointId = _b.sent();
|
|
90
|
-
_b.label = 4;
|
|
91
|
-
case 4:
|
|
92
|
-
if (!endpointId) {
|
|
93
|
-
throw new libraryUtils_1.AmplifyError({
|
|
94
|
-
name: 'ENDPOINT_NOT_CREATED',
|
|
95
|
-
message: 'Endpoint was not created.',
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
82
|
// Generate session if required
|
|
99
83
|
if (!session) {
|
|
100
|
-
sessionId = (0,
|
|
84
|
+
sessionId = (0, amplifyUuid_1.amplifyUuid)();
|
|
101
85
|
session = {
|
|
102
86
|
Id: sessionId,
|
|
103
87
|
StartTimestamp: timestampISOString,
|
|
@@ -2,4 +2,4 @@ import { PinpointUpdateEndpointInput } from '../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const updateEndpoint: ({ address, appId, category, channelType, credentials, identityId, optOut, region, userId, userProfile, userAgentValue, }: PinpointUpdateEndpointInput) => Promise<void>;
|
|
5
|
+
export declare const updateEndpoint: ({ address, appId, category, channelType, credentials, identityId, optOut, region, userAttributes, userId, userProfile, userAgentValue, }: PinpointUpdateEndpointInput) => Promise<void>;
|