@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
|
@@ -6,13 +6,14 @@ import { UserProfile } from '../../../types';
|
|
|
6
6
|
|
|
7
7
|
export type SupportedCategory =
|
|
8
8
|
| 'Analytics'
|
|
9
|
+
| 'Core'
|
|
9
10
|
| 'InAppMessaging'
|
|
10
11
|
| 'PushNotification';
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
type SupportedChannelType = 'APNS' | 'APNS_SANDBOX' | 'GCM' | 'IN_APP';
|
|
13
14
|
|
|
14
15
|
export type PinpointProviderConfig = {
|
|
15
|
-
Pinpoint
|
|
16
|
+
Pinpoint?: {
|
|
16
17
|
appId: string;
|
|
17
18
|
region: string;
|
|
18
19
|
};
|
|
@@ -21,6 +22,7 @@ export type PinpointProviderConfig = {
|
|
|
21
22
|
export type PinpointServiceOptions = {
|
|
22
23
|
address?: string;
|
|
23
24
|
optOut?: 'ALL' | 'NONE';
|
|
25
|
+
userAttributes?: Record<string, string[]>;
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
export type PinpointSession = {
|
|
@@ -38,6 +40,7 @@ export type PinpointAnalyticsEvent = {
|
|
|
38
40
|
type PinpointCommonParameters = {
|
|
39
41
|
appId: string;
|
|
40
42
|
category: SupportedCategory;
|
|
43
|
+
channelType?: SupportedChannelType;
|
|
41
44
|
credentials: Required<AuthSession>['credentials'];
|
|
42
45
|
identityId?: AuthSession['identityId'];
|
|
43
46
|
region: string;
|
|
@@ -46,7 +49,6 @@ type PinpointCommonParameters = {
|
|
|
46
49
|
|
|
47
50
|
export type PinpointUpdateEndpointInput = PinpointCommonParameters &
|
|
48
51
|
PinpointServiceOptions & {
|
|
49
|
-
channelType?: SupportedChannelType;
|
|
50
52
|
userId?: string;
|
|
51
53
|
userProfile?: UserProfile;
|
|
52
54
|
};
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
putEvents,
|
|
8
8
|
PutEventsInput,
|
|
9
9
|
PutEventsOutput,
|
|
10
|
-
} from '../../../
|
|
11
|
-
import {
|
|
10
|
+
} from '../../../awsClients/pinpoint';
|
|
11
|
+
import {
|
|
12
12
|
EventBufferConfig,
|
|
13
13
|
BufferedEvent,
|
|
14
14
|
BufferedEventMap,
|
|
15
|
-
EventBuffer
|
|
15
|
+
EventBuffer,
|
|
16
16
|
} from '../types/buffer';
|
|
17
17
|
import { AuthSession } from '../../../singleton/Auth/types';
|
|
18
|
-
import { isAppInForeground } from '
|
|
18
|
+
import { isAppInForeground } from './isAppInForeground';
|
|
19
19
|
|
|
20
20
|
const logger = new Logger('PinpointEventBuffer');
|
|
21
21
|
const RETRYABLE_CODES = [429, 500];
|
|
@@ -39,7 +39,9 @@ export class PinpointEventBuffer {
|
|
|
39
39
|
|
|
40
40
|
public push(event: BufferedEvent) {
|
|
41
41
|
if (this._buffer.length >= this._config.bufferSize) {
|
|
42
|
-
logger.debug('Exceeded Pinpoint event buffer limits, event dropped.', {
|
|
42
|
+
logger.debug('Exceeded Pinpoint event buffer limits, event dropped.', {
|
|
43
|
+
eventId: event.eventId,
|
|
44
|
+
});
|
|
43
45
|
|
|
44
46
|
return;
|
|
45
47
|
}
|
|
@@ -63,6 +65,10 @@ export class PinpointEventBuffer {
|
|
|
63
65
|
return this._config.identityId !== identityId;
|
|
64
66
|
}
|
|
65
67
|
|
|
68
|
+
public flushAll() {
|
|
69
|
+
this._putEvents(this._buffer.splice(0, this._buffer.length));
|
|
70
|
+
}
|
|
71
|
+
|
|
66
72
|
private _startLoop() {
|
|
67
73
|
if (this._interval) {
|
|
68
74
|
clearInterval(this._interval);
|
|
@@ -112,16 +118,18 @@ export class PinpointEventBuffer {
|
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
120
|
|
|
115
|
-
private _generateBatchEventParams(
|
|
121
|
+
private _generateBatchEventParams(
|
|
122
|
+
eventMap: BufferedEventMap
|
|
123
|
+
): PutEventsInput {
|
|
116
124
|
const batchItem: Record<string, EventsBatch> = {};
|
|
117
125
|
|
|
118
126
|
Object.values(eventMap).forEach(item => {
|
|
119
127
|
const { event, timestamp, endpointId, eventId, session } = item;
|
|
120
128
|
const { name, attributes, metrics } = event;
|
|
121
|
-
|
|
129
|
+
|
|
122
130
|
batchItem[endpointId] = {
|
|
123
131
|
Endpoint: {
|
|
124
|
-
...batchItem[endpointId]?.Endpoint
|
|
132
|
+
...batchItem[endpointId]?.Endpoint,
|
|
125
133
|
},
|
|
126
134
|
Events: {
|
|
127
135
|
...batchItem[endpointId]?.Events,
|
|
@@ -131,11 +139,11 @@ export class PinpointEventBuffer {
|
|
|
131
139
|
Attributes: attributes,
|
|
132
140
|
Metrics: metrics,
|
|
133
141
|
Session: session,
|
|
134
|
-
}
|
|
142
|
+
},
|
|
135
143
|
},
|
|
136
144
|
};
|
|
137
145
|
});
|
|
138
|
-
|
|
146
|
+
|
|
139
147
|
return {
|
|
140
148
|
ApplicationId: this._config.appId,
|
|
141
149
|
EventsRequest: {
|
|
@@ -200,7 +208,7 @@ export class PinpointEventBuffer {
|
|
|
200
208
|
logger.warn('Pinpoint event failed to send.', {
|
|
201
209
|
eventId,
|
|
202
210
|
name,
|
|
203
|
-
message: Message
|
|
211
|
+
message: Message,
|
|
204
212
|
});
|
|
205
213
|
});
|
|
206
214
|
});
|
|
@@ -222,7 +230,7 @@ export class PinpointEventBuffer {
|
|
|
222
230
|
logger.debug('Resending event.', {
|
|
223
231
|
eventId,
|
|
224
232
|
name,
|
|
225
|
-
remainingAttempts: bufferedEvent.resendLimit
|
|
233
|
+
remainingAttempts: bufferedEvent.resendLimit,
|
|
226
234
|
});
|
|
227
235
|
eligibleEvents.push({ [eventId!]: bufferedEvent });
|
|
228
236
|
return;
|
|
@@ -230,7 +238,7 @@ export class PinpointEventBuffer {
|
|
|
230
238
|
|
|
231
239
|
logger.debug('No retry attempts remaining for event.', {
|
|
232
240
|
eventId,
|
|
233
|
-
name
|
|
241
|
+
name,
|
|
234
242
|
});
|
|
235
243
|
});
|
|
236
244
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
// @ts-ignore: missing type definition
|
|
5
|
+
import { AppState } from 'react-native';
|
|
6
|
+
|
|
7
|
+
export const isAppInForeground = () => AppState.currentState === 'active';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { assert } from '../../../errors';
|
|
5
|
+
import { AmplifyErrorCode } from '../../../types';
|
|
6
|
+
import { updateEndpoint } from '../apis';
|
|
7
|
+
import { PinpointUpdateEndpointInput } from '../types';
|
|
8
|
+
import { getEndpointId } from './getEndpointId';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,
|
|
12
|
+
* which will generate and cache an endpoint id between calls.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export const resolveEndpointId = async ({
|
|
17
|
+
address,
|
|
18
|
+
appId,
|
|
19
|
+
category,
|
|
20
|
+
channelType,
|
|
21
|
+
credentials,
|
|
22
|
+
identityId,
|
|
23
|
+
region,
|
|
24
|
+
userAgentValue,
|
|
25
|
+
}: PinpointUpdateEndpointInput) => {
|
|
26
|
+
let endpointId = await getEndpointId(appId, category);
|
|
27
|
+
|
|
28
|
+
if (!endpointId) {
|
|
29
|
+
await updateEndpoint({
|
|
30
|
+
address,
|
|
31
|
+
appId,
|
|
32
|
+
category,
|
|
33
|
+
channelType,
|
|
34
|
+
credentials,
|
|
35
|
+
identityId,
|
|
36
|
+
region,
|
|
37
|
+
userAgentValue,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
endpointId = await getEndpointId(appId, category);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
assert(!!endpointId, AmplifyErrorCode.NoEndpointId);
|
|
44
|
+
|
|
45
|
+
return endpointId;
|
|
46
|
+
};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { Headers } from '../../clients';
|
|
4
|
+
|
|
5
|
+
export type LibraryAPIOptions = {
|
|
6
|
+
GraphQL?: {
|
|
7
|
+
// custom headers for given GraphQL service. Will be applied to all operations.
|
|
8
|
+
headers?: (options: {
|
|
9
|
+
query: string;
|
|
10
|
+
variables?: Record<string, DocumentType>;
|
|
11
|
+
}) => Promise<Headers>;
|
|
12
|
+
withCredentials?: boolean;
|
|
13
|
+
};
|
|
14
|
+
REST?: {
|
|
15
|
+
// custom headers for given REST service. Will be applied to all operations.
|
|
16
|
+
headers?: (options: { apiName: string }) => Promise<Headers>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type APIGraphQLConfig = {
|
|
21
|
+
/**
|
|
22
|
+
* Required GraphQL endpoint, must be a valid URL string.
|
|
23
|
+
*/
|
|
24
|
+
endpoint: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional region string used to sign the request. Required only if the auth mode is 'iam'.
|
|
27
|
+
*/
|
|
28
|
+
region?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Optional API key string. Required only if the auth mode is 'apiKey'.
|
|
31
|
+
*/
|
|
32
|
+
apiKey?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Custom domain endpoint for GraphQL API.
|
|
35
|
+
*/
|
|
36
|
+
customEndpoint?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Optional region string used to sign the request to `customEndpoint`. Effective only if `customEndpoint` is
|
|
39
|
+
* specified, and the auth mode is 'iam'.
|
|
40
|
+
*/
|
|
41
|
+
customEndpointRegion?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Default auth mode for all the API calls to given service.
|
|
44
|
+
*/
|
|
45
|
+
defaultAuthMode: GraphQLAuthMode;
|
|
46
|
+
modelIntrospection?: ModelIntrospectionSchema;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
type APIRestConfig = {
|
|
50
|
+
/**
|
|
51
|
+
* Required REST endpoint, must be a valid URL string.
|
|
52
|
+
*/
|
|
53
|
+
endpoint: string;
|
|
54
|
+
/**
|
|
55
|
+
* Optional region string used to sign the request with IAM credentials. If Omitted, region will be extracted from
|
|
56
|
+
* the endpoint.
|
|
57
|
+
*
|
|
58
|
+
* @default 'us-east-1'
|
|
59
|
+
*/
|
|
60
|
+
region?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Optional service name string to sign the request with IAM credentials.
|
|
63
|
+
*
|
|
64
|
+
* @default 'execute-api'
|
|
65
|
+
*/
|
|
66
|
+
service?: string;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type APIConfig = {
|
|
70
|
+
REST?: Record<string, APIRestConfig>;
|
|
71
|
+
GraphQL?: APIGraphQLConfig;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type GraphQLAuthMode =
|
|
75
|
+
| 'apiKey'
|
|
76
|
+
| 'oidc'
|
|
77
|
+
| 'userPool'
|
|
78
|
+
| 'iam'
|
|
79
|
+
| 'lambda'
|
|
80
|
+
| 'none';
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Type representing a plain JavaScript object that can be serialized to JSON.
|
|
84
|
+
*/
|
|
85
|
+
export type DocumentType =
|
|
86
|
+
| null
|
|
87
|
+
| boolean
|
|
88
|
+
| number
|
|
89
|
+
| string
|
|
90
|
+
| DocumentType[]
|
|
91
|
+
| { [prop: string]: DocumentType };
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Root model instrospection schema shape.
|
|
95
|
+
*
|
|
96
|
+
* Borrowed from: https://github.com/aws-amplify/samsara-cli/pull/377/commits/c08ea2c1a43f36aafe63b6d14d03f884e9c0c671#diff-21ae6faa2f22c15bb25ff9b272eaab7846c0650e2d267ab720546c19559583d0R4-R108
|
|
97
|
+
*/
|
|
98
|
+
export type ModelIntrospectionSchema = {
|
|
99
|
+
version: 1;
|
|
100
|
+
models: SchemaModels;
|
|
101
|
+
nonModels: SchemaNonModels;
|
|
102
|
+
enums: SchemaEnums;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Top-level Entities on a Schema
|
|
107
|
+
*/
|
|
108
|
+
export type SchemaModels = Record<string, SchemaModel>;
|
|
109
|
+
export type SchemaNonModels = Record<string, SchemaNonModel>;
|
|
110
|
+
export type SchemaEnums = Record<string, SchemaEnum>;
|
|
111
|
+
|
|
112
|
+
export type SchemaModel = {
|
|
113
|
+
name: string;
|
|
114
|
+
attributes?: ModelAttribute[];
|
|
115
|
+
fields: Fields;
|
|
116
|
+
pluralName: string;
|
|
117
|
+
syncable?: boolean;
|
|
118
|
+
primaryKeyInfo: PrimaryKeyInfo;
|
|
119
|
+
};
|
|
120
|
+
export type SchemaNonModel = {
|
|
121
|
+
name: string;
|
|
122
|
+
fields: Fields;
|
|
123
|
+
};
|
|
124
|
+
export type SchemaEnum = {
|
|
125
|
+
name: string;
|
|
126
|
+
values: string[];
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export type ModelAttribute = {
|
|
130
|
+
type: string;
|
|
131
|
+
properties?: { [key: string]: any };
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Field Definition
|
|
136
|
+
*/
|
|
137
|
+
export type Fields = Record<string, Field>;
|
|
138
|
+
export type Field = {
|
|
139
|
+
name: string;
|
|
140
|
+
type: FieldType;
|
|
141
|
+
isArray: boolean;
|
|
142
|
+
isRequired: boolean;
|
|
143
|
+
isReadOnly?: boolean;
|
|
144
|
+
isArrayNullable?: boolean;
|
|
145
|
+
attributes?: FieldAttribute[];
|
|
146
|
+
association?: AssociationType;
|
|
147
|
+
};
|
|
148
|
+
export type FieldType =
|
|
149
|
+
| 'ID'
|
|
150
|
+
| 'String'
|
|
151
|
+
| 'Int'
|
|
152
|
+
| 'Float'
|
|
153
|
+
| 'AWSDate'
|
|
154
|
+
| 'AWSTime'
|
|
155
|
+
| 'AWSDateTime'
|
|
156
|
+
| 'AWSTimestamp'
|
|
157
|
+
| 'AWSEmail'
|
|
158
|
+
| 'AWSURL'
|
|
159
|
+
| 'AWSIPAddress'
|
|
160
|
+
| 'Boolean'
|
|
161
|
+
| 'AWSJSON'
|
|
162
|
+
| 'AWSPhone'
|
|
163
|
+
| { enum: string }
|
|
164
|
+
| { model: string }
|
|
165
|
+
| { nonModel: string };
|
|
166
|
+
export type FieldAttribute = ModelAttribute;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Field-level Relationship Definitions
|
|
170
|
+
*/
|
|
171
|
+
export enum CodeGenConnectionType {
|
|
172
|
+
HAS_ONE = 'HAS_ONE',
|
|
173
|
+
BELONGS_TO = 'BELONGS_TO',
|
|
174
|
+
HAS_MANY = 'HAS_MANY',
|
|
175
|
+
}
|
|
176
|
+
export type AssociationBaseType = {
|
|
177
|
+
connectionType: CodeGenConnectionType;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export type AssociationHasMany = AssociationBaseType & {
|
|
181
|
+
connectionType: CodeGenConnectionType.HAS_MANY;
|
|
182
|
+
associatedWith: string[];
|
|
183
|
+
};
|
|
184
|
+
export type AssociationHasOne = AssociationBaseType & {
|
|
185
|
+
connectionType: CodeGenConnectionType.HAS_ONE;
|
|
186
|
+
associatedWith: string[];
|
|
187
|
+
targetNames: string[];
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export type AssociationBelongsTo = AssociationBaseType & {
|
|
191
|
+
connectionType: CodeGenConnectionType.BELONGS_TO;
|
|
192
|
+
targetNames: string[];
|
|
193
|
+
};
|
|
194
|
+
export type AssociationType =
|
|
195
|
+
| AssociationHasMany
|
|
196
|
+
| AssociationHasOne
|
|
197
|
+
| AssociationBelongsTo;
|
|
198
|
+
|
|
199
|
+
export type PrimaryKeyInfo = {
|
|
200
|
+
isCustomPrimaryKey: boolean;
|
|
201
|
+
primaryKeyFieldName: string;
|
|
202
|
+
sortKeyFieldNames: string[];
|
|
203
|
+
};
|
package/src/singleton/Amplify.ts
CHANGED
|
@@ -4,24 +4,23 @@ import { AuthClass } from './Auth';
|
|
|
4
4
|
import { Hub, AMPLIFY_SYMBOL } from '../Hub';
|
|
5
5
|
import { LegacyConfig, LibraryOptions, ResourcesConfig } from './types';
|
|
6
6
|
import { parseAWSExports } from '../parseAWSExports';
|
|
7
|
-
|
|
8
|
-
// TODO(v6): add default AuthTokenStore for each platform
|
|
7
|
+
import { deepFreeze } from '../utils';
|
|
9
8
|
|
|
10
9
|
export class AmplifyClass {
|
|
11
10
|
resourcesConfig: ResourcesConfig;
|
|
12
11
|
libraryOptions: LibraryOptions;
|
|
12
|
+
|
|
13
13
|
/**
|
|
14
14
|
* Cross-category Auth utilities.
|
|
15
15
|
*
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
18
18
|
public readonly Auth: AuthClass;
|
|
19
|
+
|
|
19
20
|
constructor() {
|
|
20
21
|
this.resourcesConfig = {};
|
|
21
|
-
this.Auth = new AuthClass();
|
|
22
|
-
|
|
23
|
-
// TODO(v6): add default providers for getting started
|
|
24
22
|
this.libraryOptions = {};
|
|
23
|
+
this.Auth = new AuthClass();
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
/**
|
|
@@ -55,6 +54,9 @@ export class AmplifyClass {
|
|
|
55
54
|
libraryOptions
|
|
56
55
|
);
|
|
57
56
|
|
|
57
|
+
// Make resource config immutable
|
|
58
|
+
this.resourcesConfig = deepFreeze(this.resourcesConfig);
|
|
59
|
+
|
|
58
60
|
this.Auth.configure(this.resourcesConfig.Auth!, this.libraryOptions.Auth);
|
|
59
61
|
|
|
60
62
|
Hub.dispatch(
|
|
@@ -71,10 +73,10 @@ export class AmplifyClass {
|
|
|
71
73
|
/**
|
|
72
74
|
* Provides access to the current back-end resource configuration for the Library.
|
|
73
75
|
*
|
|
74
|
-
* @returns Returns the
|
|
76
|
+
* @returns Returns the immutable back-end resource configuration.
|
|
75
77
|
*/
|
|
76
|
-
getConfig(): ResourcesConfig {
|
|
77
|
-
return
|
|
78
|
+
getConfig(): Readonly<ResourcesConfig> {
|
|
79
|
+
return this.resourcesConfig;
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
|
|
@@ -2,5 +2,11 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { PinpointProviderConfig } from '../../providers/pinpoint/types';
|
|
5
|
+
import { KinesisProviderConfig } from '../../providers/kinesis/types';
|
|
6
|
+
import { KinesisFirehoseProviderConfig } from '../../providers/kinesis-firehose/types';
|
|
7
|
+
import { PersonalizeProviderConfig } from '../../providers/personalize/types';
|
|
5
8
|
|
|
6
|
-
export type AnalyticsConfig = PinpointProviderConfig
|
|
9
|
+
export type AnalyticsConfig = PinpointProviderConfig &
|
|
10
|
+
KinesisProviderConfig &
|
|
11
|
+
KinesisFirehoseProviderConfig &
|
|
12
|
+
PersonalizeProviderConfig;
|
|
@@ -20,7 +20,7 @@ type Json = null | string | number | boolean | Json[] | JsonObject;
|
|
|
20
20
|
/** JSON Object type */
|
|
21
21
|
type JsonObject = { [name: string]: Json };
|
|
22
22
|
|
|
23
|
-
type JwtPayload = JwtPayloadStandardFields & JsonObject;
|
|
23
|
+
export type JwtPayload = JwtPayloadStandardFields & JsonObject;
|
|
24
24
|
|
|
25
25
|
export type JWT = {
|
|
26
26
|
payload: JwtPayload;
|
|
@@ -70,6 +70,33 @@ export type AuthTokens = {
|
|
|
70
70
|
accessToken: JWT;
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
+
export type AuthStandardAttributeKey =
|
|
74
|
+
| 'address'
|
|
75
|
+
| 'birthdate'
|
|
76
|
+
| 'email_verified'
|
|
77
|
+
| 'family_name'
|
|
78
|
+
| 'gender'
|
|
79
|
+
| 'given_name'
|
|
80
|
+
| 'locale'
|
|
81
|
+
| 'middle_name'
|
|
82
|
+
| 'name'
|
|
83
|
+
| 'nickname'
|
|
84
|
+
| 'phone_number_verified'
|
|
85
|
+
| 'picture'
|
|
86
|
+
| 'preferred_username'
|
|
87
|
+
| 'profile'
|
|
88
|
+
| 'sub'
|
|
89
|
+
| 'updated_at'
|
|
90
|
+
| 'website'
|
|
91
|
+
| 'zoneinfo'
|
|
92
|
+
| AuthVerifiableAttributeKey;
|
|
93
|
+
|
|
94
|
+
export type AuthVerifiableAttributeKey = 'email' | 'phone_number';
|
|
95
|
+
|
|
96
|
+
export type AuthConfigUserAttributes = Partial<
|
|
97
|
+
Record<AuthStandardAttributeKey, { required: boolean }>
|
|
98
|
+
>;
|
|
99
|
+
|
|
73
100
|
export type AuthConfig = StrictUnion<
|
|
74
101
|
| AuthIdentityPoolConfig
|
|
75
102
|
| AuthUserPoolConfig
|
|
@@ -86,7 +113,12 @@ export type AuthIdentityPoolConfig = {
|
|
|
86
113
|
Cognito: CognitoIdentityPoolConfig & {
|
|
87
114
|
userPoolClientId?: never;
|
|
88
115
|
userPoolId?: never;
|
|
116
|
+
userPoolEndpoint?: never;
|
|
89
117
|
loginWith?: never;
|
|
118
|
+
signUpVerificationMethod?: never;
|
|
119
|
+
userAttributes?: never;
|
|
120
|
+
mfa?: never;
|
|
121
|
+
passwordFormat?: never;
|
|
90
122
|
};
|
|
91
123
|
};
|
|
92
124
|
|
|
@@ -105,9 +137,26 @@ export type AuthUserPoolConfig = {
|
|
|
105
137
|
export type CognitoUserPoolConfig = {
|
|
106
138
|
userPoolClientId: string;
|
|
107
139
|
userPoolId: string;
|
|
140
|
+
userPoolEndpoint?: string;
|
|
108
141
|
signUpVerificationMethod?: 'code' | 'link';
|
|
109
142
|
loginWith?: {
|
|
110
143
|
oauth?: OAuthConfig;
|
|
144
|
+
username?: boolean;
|
|
145
|
+
email?: boolean;
|
|
146
|
+
phone?: boolean;
|
|
147
|
+
};
|
|
148
|
+
userAttributes?: AuthConfigUserAttributes;
|
|
149
|
+
mfa?: {
|
|
150
|
+
status?: 'on' | 'off' | 'optional';
|
|
151
|
+
totpEnabled?: boolean;
|
|
152
|
+
smsEnabled?: boolean;
|
|
153
|
+
};
|
|
154
|
+
passwordFormat?: {
|
|
155
|
+
minLength?: number;
|
|
156
|
+
requireLowercase?: boolean;
|
|
157
|
+
requireUppercase?: boolean;
|
|
158
|
+
requireNumbers?: boolean;
|
|
159
|
+
requireSpecialCharacters?: boolean;
|
|
111
160
|
};
|
|
112
161
|
};
|
|
113
162
|
|
|
@@ -168,7 +217,7 @@ export type AWSCredentialsAndIdentityId = {
|
|
|
168
217
|
identityId?: string;
|
|
169
218
|
};
|
|
170
219
|
|
|
171
|
-
type AWSCredentials = {
|
|
220
|
+
export type AWSCredentials = {
|
|
172
221
|
accessKeyId: string;
|
|
173
222
|
secretAccessKey: string;
|
|
174
223
|
sessionToken?: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { createAssertionFunction } from '../../../errors';
|
|
5
|
+
import { AmplifyErrorMap, AssertionFunction } from '../../../types';
|
|
6
|
+
|
|
7
|
+
export enum AuthConfigurationErrorCode {
|
|
8
|
+
AuthTokenConfigException = 'AuthTokenConfigException',
|
|
9
|
+
AuthUserPoolAndIdentityPoolException = 'AuthUserPoolAndIdentityPoolException',
|
|
10
|
+
InvalidIdentityPoolIdException = 'InvalidIdentityPoolIdException',
|
|
11
|
+
OAuthNotConfigureException = 'OAuthNotConfigureException',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const authConfigurationErrorMap: AmplifyErrorMap<AuthConfigurationErrorCode> = {
|
|
15
|
+
[AuthConfigurationErrorCode.AuthTokenConfigException]: {
|
|
16
|
+
message: 'Auth Token Provider not configured.',
|
|
17
|
+
recoverySuggestion: 'Make sure to call Amplify.configure in your app.',
|
|
18
|
+
},
|
|
19
|
+
[AuthConfigurationErrorCode.AuthUserPoolAndIdentityPoolException]: {
|
|
20
|
+
message: 'Auth UserPool or IdentityPool not configured.',
|
|
21
|
+
recoverySuggestion:
|
|
22
|
+
'Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId.',
|
|
23
|
+
},
|
|
24
|
+
[AuthConfigurationErrorCode.InvalidIdentityPoolIdException]: {
|
|
25
|
+
message: 'Invalid identity pool id provided.',
|
|
26
|
+
recoverySuggestion:
|
|
27
|
+
'Make sure a valid identityPoolId is given in the config.',
|
|
28
|
+
},
|
|
29
|
+
[AuthConfigurationErrorCode.OAuthNotConfigureException]: {
|
|
30
|
+
message: 'oauth param not configured.',
|
|
31
|
+
recoverySuggestion:
|
|
32
|
+
'Make sure to call Amplify.configure with oauth parameter in your app.',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const assert: AssertionFunction<AuthConfigurationErrorCode> =
|
|
37
|
+
createAssertionFunction(authConfigurationErrorMap);
|