@aws-amplify/core 6.0.1-api-v6-models.ce6e561.0 → 6.0.1-api-v6-models.572a7b5.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/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-esm/Cache/AsyncStorageCache.d.ts → lib/Cache/StorageCacheCommon.d.ts} +124 -99
- package/lib/Cache/{AsyncStorageCache.js → StorageCacheCommon.js} +494 -432
- 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 +2 -1
- package/lib/Cache/utils/cacheHelpers.d.ts +14 -0
- package/lib/Cache/utils/cacheHelpers.js +51 -0
- package/lib/Cache/{Utils → utils}/errorHelpers.d.ts +0 -1
- package/lib/Cache/{Utils → utils}/errorHelpers.js +0 -4
- package/lib/Cache/utils/index.d.ts +2 -0
- package/lib/Cache/utils/index.js +12 -0
- package/lib/I18n/I18n.js +1 -6
- package/lib/Platform/types.d.ts +18 -8
- package/lib/Platform/types.js +10 -2
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/Reachability/Reachability.d.ts +1 -0
- package/lib/Reachability/Reachability.js +42 -1
- package/lib/ServiceWorker/ServiceWorker.js +69 -17
- package/lib/ServiceWorker/index.d.ts +0 -12
- package/lib/ServiceWorker/index.js +0 -12
- package/lib/Signer/Signer.js +3 -2
- package/lib/awsClients/cognitoIdentity/base.js +2 -1
- package/lib/awsClients/pinpoint/base.js +2 -1
- package/lib/awsClients/pinpoint/getInAppMessages.js +2 -1
- package/lib/awsClients/pinpoint/putEvents.js +2 -1
- package/lib/awsClients/pinpoint/updateEndpoint.js +2 -1
- package/lib/clients/middleware/signing/signer/signatureV4/index.d.ts +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/index.js +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js +2 -1
- package/lib/errors/errorHelpers.d.ts +2 -0
- package/lib/errors/errorHelpers.js +20 -0
- package/lib/errors/index.d.ts +1 -0
- package/lib/errors/index.js +3 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +9 -6
- package/lib/libraryUtils.d.ts +8 -7
- package/lib/libraryUtils.js +17 -17
- package/lib/parseAWSExports.js +34 -19
- package/lib/providers/pinpoint/apis/flushEvents.d.ts +2 -2
- 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.js +6 -6
- package/lib/providers/pinpoint/index.d.ts +2 -2
- package/lib/providers/pinpoint/index.js +4 -2
- 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 +3 -3
- package/lib/providers/pinpoint/utils/index.d.ts +1 -0
- package/lib/providers/pinpoint/utils/index.js +3 -1
- package/lib/providers/pinpoint/utils/resolveEndpointId.d.ts +8 -0
- package/lib/providers/pinpoint/utils/resolveEndpointId.js +85 -0
- package/lib/singleton/Amplify.d.ts +2 -2
- package/lib/singleton/Amplify.js +6 -5
- package/lib/singleton/Auth/types.d.ts +3 -3
- package/lib/singleton/Cache/types.d.ts +18 -0
- package/lib/singleton/Cache/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/PushNotification/types.d.ts +2 -0
- package/lib/singleton/Notifications/PushNotification/types.js +4 -0
- package/lib/singleton/Notifications/types.d.ts +3 -1
- package/lib/singleton/types.d.ts +3 -3
- package/lib/storage/CookieStorage.js +8 -5
- package/lib/storage/DefaultStorage.js +1 -1
- package/lib/storage/utils.d.ts +1 -1
- package/lib/storage/utils.js +3 -3
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/errors.d.ts +1 -0
- package/lib/types/errors.js +1 -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/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/deepFreeze.d.ts +1 -0
- package/lib/utils/deepFreeze.js +38 -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/{ClientDevice/browser.d.ts → 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/index.d.ts +2 -0
- package/lib/utils/index.js +5 -1
- 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-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/Cache/AsyncStorageCache.d.ts → lib-esm/Cache/StorageCacheCommon.d.ts} +124 -99
- package/lib-esm/Cache/{AsyncStorageCache.js → StorageCacheCommon.js} +493 -430
- 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 +1 -1
- package/lib-esm/Cache/utils/cacheHelpers.d.ts +14 -0
- package/lib-esm/Cache/utils/cacheHelpers.js +44 -0
- package/lib-esm/Cache/{Utils → utils}/errorHelpers.d.ts +0 -1
- package/lib-esm/Cache/{Utils → utils}/errorHelpers.js +0 -4
- package/lib-esm/Cache/utils/index.d.ts +2 -0
- package/lib-esm/Cache/utils/index.js +4 -0
- package/lib-esm/I18n/I18n.js +1 -6
- package/lib-esm/Platform/types.d.ts +18 -8
- package/lib-esm/Platform/types.js +10 -2
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/Reachability/Reachability.d.ts +1 -0
- package/lib-esm/Reachability/Reachability.js +43 -2
- package/lib-esm/ServiceWorker/ServiceWorker.js +69 -17
- package/lib-esm/ServiceWorker/index.d.ts +0 -12
- package/lib-esm/ServiceWorker/index.js +0 -12
- package/lib-esm/Signer/Signer.js +3 -2
- package/lib-esm/awsClients/cognitoIdentity/base.js +2 -1
- package/lib-esm/awsClients/pinpoint/base.js +2 -1
- package/lib-esm/awsClients/pinpoint/getInAppMessages.js +2 -1
- package/lib-esm/awsClients/pinpoint/putEvents.js +2 -1
- package/lib-esm/awsClients/pinpoint/updateEndpoint.js +2 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.d.ts +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js +2 -1
- package/lib-esm/errors/errorHelpers.d.ts +2 -0
- package/lib-esm/errors/errorHelpers.js +17 -0
- package/lib-esm/errors/index.d.ts +1 -0
- package/lib-esm/errors/index.js +1 -0
- package/lib-esm/index.d.ts +4 -4
- package/lib-esm/index.js +5 -4
- package/lib-esm/libraryUtils.d.ts +8 -7
- package/lib-esm/libraryUtils.js +7 -7
- package/lib-esm/parseAWSExports.js +34 -19
- package/lib-esm/providers/pinpoint/apis/flushEvents.d.ts +2 -2
- 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.js +6 -6
- package/lib-esm/providers/pinpoint/index.d.ts +2 -2
- package/lib-esm/providers/pinpoint/index.js +2 -1
- 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 +3 -3
- 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/resolveEndpointId.d.ts +8 -0
- package/lib-esm/providers/pinpoint/utils/resolveEndpointId.js +81 -0
- package/lib-esm/singleton/Amplify.d.ts +2 -2
- package/lib-esm/singleton/Amplify.js +6 -5
- package/lib-esm/singleton/Auth/types.d.ts +3 -3
- package/lib-esm/singleton/Cache/types.d.ts +18 -0
- package/lib-esm/singleton/Cache/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/PushNotification/types.d.ts +2 -0
- package/lib-esm/singleton/Notifications/PushNotification/types.js +3 -0
- package/lib-esm/singleton/Notifications/types.d.ts +3 -1
- package/lib-esm/singleton/types.d.ts +3 -3
- package/lib-esm/storage/CookieStorage.js +5 -5
- package/lib-esm/storage/DefaultStorage.js +2 -2
- package/lib-esm/storage/utils.d.ts +1 -1
- package/lib-esm/storage/utils.js +1 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/errors.d.ts +1 -0
- package/lib-esm/types/errors.js +1 -0
- package/lib-esm/utils/amplifyUrl/index.d.ts +13 -0
- package/lib-esm/utils/amplifyUrl/index.js +6 -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.native.js +4 -0
- package/lib-esm/utils/deepFreeze.d.ts +1 -0
- package/lib-esm/utils/deepFreeze.js +34 -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-esm/{ClientDevice/browser.d.ts → 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/index.d.ts +2 -0
- package/lib-esm/utils/index.js +2 -0
- 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/package.json +9 -19
- 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 -185
- package/src/Cache/utils/cacheHelpers.ts +52 -0
- package/src/Cache/{Utils → utils}/errorHelpers.ts +0 -4
- package/src/Cache/{Utils → utils}/index.ts +4 -5
- package/src/I18n/I18n.ts +1 -6
- package/src/Platform/types.ts +20 -11
- package/src/Platform/version.ts +1 -1
- package/src/Reachability/Reachability.ts +22 -2
- package/src/ServiceWorker/ServiceWorker.ts +20 -17
- package/src/ServiceWorker/index.ts +0 -12
- package/src/Signer/Signer.ts +3 -2
- package/src/awsClients/cognitoIdentity/base.ts +4 -1
- package/src/awsClients/pinpoint/base.ts +2 -1
- package/src/awsClients/pinpoint/getInAppMessages.ts +2 -1
- package/src/awsClients/pinpoint/putEvents.ts +2 -1
- package/src/awsClients/pinpoint/updateEndpoint.ts +2 -1
- package/src/clients/middleware/signing/signer/signatureV4/index.ts +0 -2
- package/src/clients/middleware/signing/signer/signatureV4/presignUrl.ts +2 -1
- package/src/errors/errorHelpers.ts +20 -0
- package/src/errors/index.ts +1 -0
- package/src/index.ts +8 -4
- package/src/libraryUtils.ts +17 -11
- package/src/parseAWSExports.ts +28 -9
- package/src/providers/pinpoint/apis/flushEvents.ts +2 -2
- package/src/providers/pinpoint/apis/record.ts +14 -28
- package/src/providers/pinpoint/apis/updateEndpoint.ts +6 -6
- package/src/providers/pinpoint/index.ts +6 -2
- 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 +3 -2
- package/src/providers/pinpoint/utils/index.ts +1 -0
- package/src/providers/pinpoint/utils/resolveEndpointId.ts +46 -0
- package/src/singleton/Amplify.ts +10 -8
- package/src/singleton/Auth/types.ts +3 -3
- package/src/singleton/Cache/types.ts +27 -0
- package/src/singleton/Interactions/types.ts +29 -0
- package/src/singleton/Notifications/PushNotification/types.ts +6 -0
- package/src/singleton/Notifications/types.ts +3 -1
- package/src/singleton/types.ts +3 -5
- package/src/storage/CookieStorage.ts +5 -9
- package/src/storage/DefaultStorage.ts +2 -2
- package/src/storage/utils.ts +1 -1
- package/src/types/errors.ts +1 -0
- package/src/utils/amplifyUrl/index.ts +9 -0
- package/src/{clients/middleware/signing/signer/signatureV4/polyfills/index.native.ts → utils/amplifyUrl/polyfill.native.ts} +1 -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/deepFreeze.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/index.ts +2 -0
- 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/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 -456
- package/lib/Cache/InMemoryCache.d.ts +0 -129
- package/lib/Cache/InMemoryCache.js +0 -342
- package/lib/Cache/Utils/CacheUtils.d.ts +0 -25
- package/lib/Cache/Utils/CacheUtils.js +0 -86
- 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-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 -453
- package/lib-esm/Cache/InMemoryCache.d.ts +0 -129
- package/lib-esm/Cache/InMemoryCache.js +0 -339
- package/lib-esm/Cache/Utils/CacheUtils.d.ts +0 -25
- package/lib-esm/Cache/Utils/CacheUtils.js +0 -79
- 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/src/Amplify.ts +0 -106
- package/src/Cache/AsyncStorageCache.ts +0 -495
- package/src/Cache/BrowserStorageCache.ts +0 -504
- package/src/Cache/CHANGELOG.md +0 -1239
- package/src/Cache/InMemoryCache.ts +0 -347
- package/src/Cache/Utils/CacheUtils.ts +0 -90
- 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/lib/Cache/types/{Cache.js → cache.js} +0 -0
- package/lib/{clients/middleware/signing/signer/signatureV4/polyfills/index.native.js → utils/amplifyUrl/polyfill.native.js} +1 -1
- /package/lib-esm/Cache/types/{Cache.js → cache.js} +0 -0
- /package/lib-esm/{clients/middleware/signing/signer/signatureV4/polyfills/index.d.ts → utils/amplifyUrl/polyfill.d.ts} +0 -0
- /package/lib-esm/{clients/middleware/signing/signer/signatureV4/polyfills/index.js → utils/amplifyUrl/polyfill.js} +0 -0
- /package/lib-esm/{clients/middleware/signing/signer/signatureV4/polyfills/index.native.d.ts → utils/amplifyUrl/polyfill.native.d.ts} +0 -0
- /package/lib-esm/{clients/middleware/signing/signer/signatureV4/polyfills/index.native.js → utils/amplifyUrl/polyfill.native.js} +0 -0
- /package/{lib/clients/middleware/signing/signer/signatureV4/polyfills/index.d.ts → lib-esm/utils/amplifyUuid/polyfill.d.ts} +0 -0
- /package/{lib/clients/middleware/signing/signer/signatureV4/polyfills/index.js → lib-esm/utils/amplifyUuid/polyfill.js} +0 -0
- /package/{lib/clients/middleware/signing/signer/signatureV4/polyfills/index.native.d.ts → lib-esm/utils/amplifyUuid/polyfill.native.d.ts} +0 -0
- /package/src/{clients/middleware/signing/signer/signatureV4/polyfills/index.ts → utils/amplifyUrl/polyfill.ts} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PinpointUpdateEndpointInput } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,
|
|
4
|
+
* which will generate and cache an endpoint id between calls.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const resolveEndpointId: ({ address, appId, category, channelType, credentials, identityId, region, userAgentValue, }: PinpointUpdateEndpointInput) => Promise<string>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
14
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
15
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
16
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
17
|
+
function step(op) {
|
|
18
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
19
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
20
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
21
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
22
|
+
switch (op[0]) {
|
|
23
|
+
case 0: case 1: t = op; break;
|
|
24
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
25
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
26
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
27
|
+
default:
|
|
28
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
29
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
30
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
31
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
32
|
+
if (t[2]) _.ops.pop();
|
|
33
|
+
_.trys.pop(); continue;
|
|
34
|
+
}
|
|
35
|
+
op = body.call(thisArg, _);
|
|
36
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
37
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.resolveEndpointId = void 0;
|
|
42
|
+
var errors_1 = require("../../../errors");
|
|
43
|
+
var types_1 = require("../../../types");
|
|
44
|
+
var apis_1 = require("../apis");
|
|
45
|
+
var getEndpointId_1 = require("./getEndpointId");
|
|
46
|
+
/**
|
|
47
|
+
* Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,
|
|
48
|
+
* which will generate and cache an endpoint id between calls.
|
|
49
|
+
*
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
var resolveEndpointId = function (_a) {
|
|
53
|
+
var address = _a.address, appId = _a.appId, category = _a.category, channelType = _a.channelType, credentials = _a.credentials, identityId = _a.identityId, region = _a.region, userAgentValue = _a.userAgentValue;
|
|
54
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
+
var endpointId;
|
|
56
|
+
return __generator(this, function (_b) {
|
|
57
|
+
switch (_b.label) {
|
|
58
|
+
case 0: return [4 /*yield*/, (0, getEndpointId_1.getEndpointId)(appId, category)];
|
|
59
|
+
case 1:
|
|
60
|
+
endpointId = _b.sent();
|
|
61
|
+
if (!!endpointId) return [3 /*break*/, 4];
|
|
62
|
+
return [4 /*yield*/, (0, apis_1.updateEndpoint)({
|
|
63
|
+
address: address,
|
|
64
|
+
appId: appId,
|
|
65
|
+
category: category,
|
|
66
|
+
channelType: channelType,
|
|
67
|
+
credentials: credentials,
|
|
68
|
+
identityId: identityId,
|
|
69
|
+
region: region,
|
|
70
|
+
userAgentValue: userAgentValue,
|
|
71
|
+
})];
|
|
72
|
+
case 2:
|
|
73
|
+
_b.sent();
|
|
74
|
+
return [4 /*yield*/, (0, getEndpointId_1.getEndpointId)(appId, category)];
|
|
75
|
+
case 3:
|
|
76
|
+
endpointId = _b.sent();
|
|
77
|
+
_b.label = 4;
|
|
78
|
+
case 4:
|
|
79
|
+
(0, errors_1.assert)(!!endpointId, types_1.AmplifyErrorCode.NoEndpointId);
|
|
80
|
+
return [2 /*return*/, endpointId];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
exports.resolveEndpointId = resolveEndpointId;
|
|
@@ -23,9 +23,9 @@ export declare class AmplifyClass {
|
|
|
23
23
|
/**
|
|
24
24
|
* Provides access to the current back-end resource configuration for the Library.
|
|
25
25
|
*
|
|
26
|
-
* @returns Returns the
|
|
26
|
+
* @returns Returns the immutable back-end resource configuration.
|
|
27
27
|
*/
|
|
28
|
-
getConfig(): ResourcesConfig
|
|
28
|
+
getConfig(): Readonly<ResourcesConfig>;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* The `Amplify` utility is used to configure the library.
|
package/lib/singleton/Amplify.js
CHANGED
|
@@ -28,13 +28,12 @@ exports.Amplify = exports.AmplifyClass = void 0;
|
|
|
28
28
|
var Auth_1 = require("./Auth");
|
|
29
29
|
var Hub_1 = require("../Hub");
|
|
30
30
|
var parseAWSExports_1 = require("../parseAWSExports");
|
|
31
|
-
|
|
31
|
+
var utils_1 = require("../utils");
|
|
32
32
|
var AmplifyClass = /** @class */ (function () {
|
|
33
33
|
function AmplifyClass() {
|
|
34
34
|
this.resourcesConfig = {};
|
|
35
|
-
this.Auth = new Auth_1.AuthClass();
|
|
36
|
-
// TODO(v6): add default providers for getting started
|
|
37
35
|
this.libraryOptions = {};
|
|
36
|
+
this.Auth = new Auth_1.AuthClass();
|
|
38
37
|
}
|
|
39
38
|
/**
|
|
40
39
|
* Configures Amplify for use with your back-end resources.
|
|
@@ -56,6 +55,8 @@ var AmplifyClass = /** @class */ (function () {
|
|
|
56
55
|
}
|
|
57
56
|
this.resourcesConfig = mergeResourceConfig(this.resourcesConfig, resolvedResourceConfig);
|
|
58
57
|
this.libraryOptions = mergeLibraryOptions(this.libraryOptions, libraryOptions);
|
|
58
|
+
// Make resource config immutable
|
|
59
|
+
this.resourcesConfig = (0, utils_1.deepFreeze)(this.resourcesConfig);
|
|
59
60
|
this.Auth.configure(this.resourcesConfig.Auth, this.libraryOptions.Auth);
|
|
60
61
|
Hub_1.Hub.dispatch('core', {
|
|
61
62
|
event: 'configure',
|
|
@@ -65,10 +66,10 @@ var AmplifyClass = /** @class */ (function () {
|
|
|
65
66
|
/**
|
|
66
67
|
* Provides access to the current back-end resource configuration for the Library.
|
|
67
68
|
*
|
|
68
|
-
* @returns Returns the
|
|
69
|
+
* @returns Returns the immutable back-end resource configuration.
|
|
69
70
|
*/
|
|
70
71
|
AmplifyClass.prototype.getConfig = function () {
|
|
71
|
-
return
|
|
72
|
+
return this.resourcesConfig;
|
|
72
73
|
};
|
|
73
74
|
return AmplifyClass;
|
|
74
75
|
}());
|
|
@@ -63,12 +63,12 @@ export type AuthIdentityPoolConfig = {
|
|
|
63
63
|
Cognito: CognitoIdentityPoolConfig & {
|
|
64
64
|
userPoolClientId?: never;
|
|
65
65
|
userPoolId?: never;
|
|
66
|
+
userPoolEndpoint?: never;
|
|
66
67
|
loginWith?: never;
|
|
67
68
|
signUpVerificationMethod?: never;
|
|
68
69
|
userAttributes?: never;
|
|
69
70
|
mfa?: never;
|
|
70
71
|
passwordFormat?: never;
|
|
71
|
-
endpoint?: never;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
74
|
export type CognitoIdentityPoolConfig = {
|
|
@@ -84,6 +84,7 @@ export type AuthUserPoolConfig = {
|
|
|
84
84
|
export type CognitoUserPoolConfig = {
|
|
85
85
|
userPoolClientId: string;
|
|
86
86
|
userPoolId: string;
|
|
87
|
+
userPoolEndpoint?: string;
|
|
87
88
|
signUpVerificationMethod?: 'code' | 'link';
|
|
88
89
|
loginWith?: {
|
|
89
90
|
oauth?: OAuthConfig;
|
|
@@ -104,7 +105,6 @@ export type CognitoUserPoolConfig = {
|
|
|
104
105
|
requireNumbers?: boolean;
|
|
105
106
|
requireSpecialCharacters?: boolean;
|
|
106
107
|
};
|
|
107
|
-
endpoint?: string;
|
|
108
108
|
};
|
|
109
109
|
export type OAuthConfig = {
|
|
110
110
|
domain: string;
|
|
@@ -146,7 +146,7 @@ export type AWSCredentialsAndIdentityId = {
|
|
|
146
146
|
credentials: AWSCredentials;
|
|
147
147
|
identityId?: string;
|
|
148
148
|
};
|
|
149
|
-
type AWSCredentials = {
|
|
149
|
+
export type AWSCredentials = {
|
|
150
150
|
accessKeyId: string;
|
|
151
151
|
secretAccessKey: string;
|
|
152
152
|
sessionToken?: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache instance options
|
|
3
|
+
*/
|
|
4
|
+
export interface CacheConfig {
|
|
5
|
+
/** Prepend to key to avoid conflicts */
|
|
6
|
+
keyPrefix: string;
|
|
7
|
+
/** Cache capacity, in bytes */
|
|
8
|
+
capacityInBytes: number;
|
|
9
|
+
/** Max size of one item */
|
|
10
|
+
itemMaxSize: number;
|
|
11
|
+
/** Time to live, in milliseconds */
|
|
12
|
+
defaultTTL: number;
|
|
13
|
+
/** Warn when over threshold percentage of capacity, maximum 1 */
|
|
14
|
+
warningThreshold: number;
|
|
15
|
+
/** default priority number put on cached items */
|
|
16
|
+
defaultPriority: number;
|
|
17
|
+
storage?: Storage;
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface LexV1BotConfig {
|
|
2
|
+
alias: string;
|
|
3
|
+
region: string;
|
|
4
|
+
}
|
|
5
|
+
interface LexV2BotConfig {
|
|
6
|
+
botId: string;
|
|
7
|
+
aliasId: string;
|
|
8
|
+
localeId: string;
|
|
9
|
+
region: string;
|
|
10
|
+
}
|
|
11
|
+
type InteractionsLexV1Config = {
|
|
12
|
+
LexV1: Record<string, LexV1BotConfig>;
|
|
13
|
+
};
|
|
14
|
+
type InteractionsLexV2Config = {
|
|
15
|
+
LexV2: Record<string, LexV2BotConfig>;
|
|
16
|
+
};
|
|
17
|
+
type AtLeastOne<T, U = {
|
|
18
|
+
[K in keyof T]: Pick<T, K>;
|
|
19
|
+
}> = Partial<T> & U[keyof U];
|
|
20
|
+
export type InteractionsConfig = AtLeastOne<InteractionsLexV1Config & InteractionsLexV2Config>;
|
|
21
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { InAppMessagingConfig } from './InAppMessaging/types';
|
|
2
|
+
import { PushNotificationConfig } from './PushNotification/types';
|
|
2
3
|
export type NotificationsConfig = {
|
|
3
|
-
InAppMessaging
|
|
4
|
+
InAppMessaging?: InAppMessagingConfig;
|
|
5
|
+
PushNotification?: PushNotificationConfig;
|
|
4
6
|
};
|
package/lib/singleton/types.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { AnalyticsConfig } from './Analytics/types';
|
|
|
3
3
|
import { AuthConfig, LibraryAuthOptions, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, CognitoIdentityPoolConfig } from './Auth/types';
|
|
4
4
|
import { GeoConfig } from './Geo/types';
|
|
5
5
|
import { LibraryStorageOptions, StorageAccessLevel, StorageConfig } from './Storage/types';
|
|
6
|
-
import { I18nConfig } from '../I18n/types';
|
|
7
6
|
import { NotificationsConfig } from './Notifications/types';
|
|
7
|
+
import { InteractionsConfig } from './Interactions/types';
|
|
8
8
|
export type LegacyConfig = {
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated The field should not be used.
|
|
@@ -15,7 +15,7 @@ export type ResourcesConfig = {
|
|
|
15
15
|
API?: APIConfig;
|
|
16
16
|
Analytics?: AnalyticsConfig;
|
|
17
17
|
Auth?: AuthConfig;
|
|
18
|
-
|
|
18
|
+
Interactions?: InteractionsConfig;
|
|
19
19
|
Notifications?: NotificationsConfig;
|
|
20
20
|
Storage?: StorageConfig;
|
|
21
21
|
Geo?: GeoConfig;
|
|
@@ -26,4 +26,4 @@ export type LibraryOptions = {
|
|
|
26
26
|
Storage?: LibraryStorageOptions;
|
|
27
27
|
ssr?: boolean;
|
|
28
28
|
};
|
|
29
|
-
export { APIConfig, AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, GeoConfig, };
|
|
29
|
+
export { APIConfig, AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, InteractionsConfig, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, GeoConfig, };
|
|
@@ -48,9 +48,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
|
+
};
|
|
51
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
55
|
exports.CookieStorage = void 0;
|
|
53
|
-
var js_cookie_1 = require("js-cookie");
|
|
56
|
+
var js_cookie_1 = __importDefault(require("js-cookie"));
|
|
54
57
|
var CookieStorage = /** @class */ (function () {
|
|
55
58
|
function CookieStorage(data) {
|
|
56
59
|
if (data === void 0) { data = {}; }
|
|
@@ -72,7 +75,7 @@ var CookieStorage = /** @class */ (function () {
|
|
|
72
75
|
CookieStorage.prototype.setItem = function (key, value) {
|
|
73
76
|
return __awaiter(this, void 0, void 0, function () {
|
|
74
77
|
return __generator(this, function (_a) {
|
|
75
|
-
|
|
78
|
+
js_cookie_1.default.set(key, value, this.getData());
|
|
76
79
|
return [2 /*return*/];
|
|
77
80
|
});
|
|
78
81
|
});
|
|
@@ -81,7 +84,7 @@ var CookieStorage = /** @class */ (function () {
|
|
|
81
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
82
85
|
var item;
|
|
83
86
|
return __generator(this, function (_a) {
|
|
84
|
-
item =
|
|
87
|
+
item = js_cookie_1.default.get(key);
|
|
85
88
|
return [2 /*return*/, item !== null && item !== void 0 ? item : null];
|
|
86
89
|
});
|
|
87
90
|
});
|
|
@@ -89,7 +92,7 @@ var CookieStorage = /** @class */ (function () {
|
|
|
89
92
|
CookieStorage.prototype.removeItem = function (key) {
|
|
90
93
|
return __awaiter(this, void 0, void 0, function () {
|
|
91
94
|
return __generator(this, function (_a) {
|
|
92
|
-
|
|
95
|
+
js_cookie_1.default.remove(key, this.getData());
|
|
93
96
|
return [2 /*return*/];
|
|
94
97
|
});
|
|
95
98
|
});
|
|
@@ -101,7 +104,7 @@ var CookieStorage = /** @class */ (function () {
|
|
|
101
104
|
return __generator(this, function (_a) {
|
|
102
105
|
switch (_a.label) {
|
|
103
106
|
case 0:
|
|
104
|
-
cookie =
|
|
107
|
+
cookie = js_cookie_1.default.get();
|
|
105
108
|
promises = Object.keys(cookie).map(function (key) { return _this.removeItem(key); });
|
|
106
109
|
return [4 /*yield*/, Promise.all(promises)];
|
|
107
110
|
case 1:
|
|
@@ -26,7 +26,7 @@ var utils_1 = require("./utils");
|
|
|
26
26
|
var DefaultStorage = /** @class */ (function (_super) {
|
|
27
27
|
__extends(DefaultStorage, _super);
|
|
28
28
|
function DefaultStorage() {
|
|
29
|
-
return _super.call(this, (0, utils_1.
|
|
29
|
+
return _super.call(this, (0, utils_1.getLocalStorageWithFallback)()) || this;
|
|
30
30
|
}
|
|
31
31
|
return DefaultStorage;
|
|
32
32
|
}(KeyValueStorage_1.KeyValueStorage));
|
package/lib/storage/utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @internal
|
|
3
3
|
* @returns Either a reference to window.localStorage or an in-memory storage as fallback
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const getLocalStorageWithFallback: () => Storage;
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
* @returns Either a reference to window.sessionStorage or an in-memory storage as fallback
|
package/lib/storage/utils.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
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.getSessionStorageWithFallback = exports.
|
|
5
|
+
exports.getSessionStorageWithFallback = exports.getLocalStorageWithFallback = void 0;
|
|
6
6
|
var InMemoryStorage_1 = require("./InMemoryStorage");
|
|
7
7
|
/**
|
|
8
8
|
* @internal
|
|
9
9
|
* @returns Either a reference to window.localStorage or an in-memory storage as fallback
|
|
10
10
|
*/
|
|
11
|
-
var
|
|
11
|
+
var getLocalStorageWithFallback = function () {
|
|
12
12
|
return typeof window !== 'undefined' && window.localStorage
|
|
13
13
|
? window.localStorage
|
|
14
14
|
: new InMemoryStorage_1.InMemoryStorage();
|
|
15
15
|
};
|
|
16
|
-
exports.
|
|
16
|
+
exports.getLocalStorageWithFallback = getLocalStorageWithFallback;
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
|
19
19
|
* @returns Either a reference to window.sessionStorage or an in-memory storage as fallback
|