@aws-amplify/core 6.0.1-api-v6-models.8035dfc.0 → 6.0.1-api-v6-models.3eb7748.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,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* Default cache config
|
|
5
|
+
*/
|
|
6
|
+
export var defaultConfig = {
|
|
7
|
+
keyPrefix: 'aws-amplify-cache',
|
|
8
|
+
capacityInBytes: 1048576,
|
|
9
|
+
itemMaxSize: 210000,
|
|
10
|
+
defaultTTL: 259200000,
|
|
11
|
+
defaultPriority: 5,
|
|
12
|
+
warningThreshold: 0.8,
|
|
13
|
+
};
|
|
14
|
+
export var currentSizeKey = 'CurSize';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CacheConfig } from '../../singleton/Cache/types';
|
|
2
|
+
export { CacheConfig };
|
|
3
|
+
/**
|
|
4
|
+
* Cache Interface
|
|
5
|
+
*/
|
|
6
|
+
export interface Cache {
|
|
7
|
+
/** Put item into cache */
|
|
8
|
+
setItem(key: string, value: any, options?: CacheItemOptions): Promise<void>;
|
|
9
|
+
/** Get item from cache */
|
|
10
|
+
getItem(key: string, options?: CacheItemOptions): Promise<CacheItem['data']>;
|
|
11
|
+
/** Remove item from cache */
|
|
12
|
+
removeItem(key: string): Promise<void>;
|
|
13
|
+
/** Remove all items from cache */
|
|
14
|
+
clear(): Promise<void>;
|
|
15
|
+
/** Get all keys form cache */
|
|
16
|
+
getAllKeys(): Promise<string[]>;
|
|
17
|
+
/** Get current size of the cache */
|
|
18
|
+
getCurrentCacheSize(): Promise<number>;
|
|
19
|
+
/** create a new instance with customized config */
|
|
20
|
+
createInstance(config: CacheConfig): Cache;
|
|
21
|
+
/** change current configuration */
|
|
22
|
+
configure(config: CacheConfig): CacheConfig;
|
|
23
|
+
}
|
|
24
|
+
export interface CacheItem {
|
|
25
|
+
key: string;
|
|
26
|
+
data: any;
|
|
27
|
+
timestamp: number;
|
|
28
|
+
visitedTime: number;
|
|
29
|
+
priority: number;
|
|
30
|
+
expires: number;
|
|
31
|
+
type: string;
|
|
32
|
+
byteSize: number;
|
|
33
|
+
}
|
|
34
|
+
export interface CacheItemOptions {
|
|
35
|
+
priority?: number;
|
|
36
|
+
expires?: number;
|
|
37
|
+
callback?: Function;
|
|
38
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './cache';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* return the byte size of the string
|
|
3
|
+
* @param str
|
|
4
|
+
*/
|
|
5
|
+
export declare function getByteLength(str: string): number;
|
|
6
|
+
/**
|
|
7
|
+
* get current time
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCurrentTime(): number;
|
|
10
|
+
/**
|
|
11
|
+
* check if passed value is an integer
|
|
12
|
+
*/
|
|
13
|
+
export declare function isInteger(value?: number): boolean;
|
|
14
|
+
export declare const getCurrentSizeKey: (keyPrefix: string) => string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { currentSizeKey } from '../constants';
|
|
4
|
+
/**
|
|
5
|
+
* return the byte size of the string
|
|
6
|
+
* @param str
|
|
7
|
+
*/
|
|
8
|
+
export function getByteLength(str) {
|
|
9
|
+
var ret = 0;
|
|
10
|
+
ret = str.length;
|
|
11
|
+
for (var i = str.length; i >= 0; i -= 1) {
|
|
12
|
+
var charCode = str.charCodeAt(i);
|
|
13
|
+
if (charCode > 0x7f && charCode <= 0x7ff) {
|
|
14
|
+
ret += 1;
|
|
15
|
+
}
|
|
16
|
+
else if (charCode > 0x7ff && charCode <= 0xffff) {
|
|
17
|
+
ret += 2;
|
|
18
|
+
}
|
|
19
|
+
// trail surrogate
|
|
20
|
+
if (charCode >= 0xdc00 && charCode <= 0xdfff) {
|
|
21
|
+
i -= 1;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return ret;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* get current time
|
|
28
|
+
*/
|
|
29
|
+
export function getCurrentTime() {
|
|
30
|
+
var currentTime = new Date();
|
|
31
|
+
return currentTime.getTime();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* check if passed value is an integer
|
|
35
|
+
*/
|
|
36
|
+
export function isInteger(value) {
|
|
37
|
+
if (Number.isInteger) {
|
|
38
|
+
return Number.isInteger(value);
|
|
39
|
+
}
|
|
40
|
+
return (typeof value === 'number' && isFinite(value) && Math.floor(value) === value);
|
|
41
|
+
}
|
|
42
|
+
export var getCurrentSizeKey = function (keyPrefix) {
|
|
43
|
+
return "".concat(keyPrefix).concat(currentSizeKey);
|
|
44
|
+
};
|
|
@@ -5,7 +5,6 @@ import { createAssertionFunction } from '../../errors';
|
|
|
5
5
|
export var CacheErrorCode;
|
|
6
6
|
(function (CacheErrorCode) {
|
|
7
7
|
CacheErrorCode["NoCacheItem"] = "NoCacheItem";
|
|
8
|
-
CacheErrorCode["NoCacheStorage"] = "NoCacheStorage";
|
|
9
8
|
CacheErrorCode["NullNextNode"] = "NullNextNode";
|
|
10
9
|
CacheErrorCode["NullPreviousNode"] = "NullPreviousNode";
|
|
11
10
|
})(CacheErrorCode || (CacheErrorCode = {}));
|
|
@@ -13,9 +12,6 @@ var cacheErrorMap = (_a = {},
|
|
|
13
12
|
_a[CacheErrorCode.NoCacheItem] = {
|
|
14
13
|
message: 'Item not found in the cache storage.',
|
|
15
14
|
},
|
|
16
|
-
_a[CacheErrorCode.NoCacheStorage] = {
|
|
17
|
-
message: 'Storage is not defined in the cache config.',
|
|
18
|
-
},
|
|
19
15
|
_a[CacheErrorCode.NullNextNode] = {
|
|
20
16
|
message: 'Next node is null.',
|
|
21
17
|
},
|
package/lib-esm/I18n/I18n.js
CHANGED
|
@@ -12,7 +12,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
return __assign.apply(this, arguments);
|
|
13
13
|
};
|
|
14
14
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
15
|
-
import { Amplify } from '../singleton';
|
|
16
15
|
var logger = new Logger('I18n');
|
|
17
16
|
/**
|
|
18
17
|
* Language translation utility.
|
|
@@ -41,11 +40,7 @@ var I18n = /** @class */ (function () {
|
|
|
41
40
|
* Sets the default language from the configuration when required.
|
|
42
41
|
*/
|
|
43
42
|
I18n.prototype.setDefaultLanguage = function () {
|
|
44
|
-
if
|
|
45
|
-
var i18nConfig = Amplify.getConfig().I18n;
|
|
46
|
-
this._lang = i18nConfig === null || i18nConfig === void 0 ? void 0 : i18nConfig.language;
|
|
47
|
-
}
|
|
48
|
-
// Default to window language if not set in config
|
|
43
|
+
// Default to window language if not set in instance
|
|
49
44
|
if (!this._lang &&
|
|
50
45
|
typeof window !== 'undefined' &&
|
|
51
46
|
window &&
|
|
@@ -73,7 +73,14 @@ export declare enum DataStoreAction {
|
|
|
73
73
|
GraphQl = "2"
|
|
74
74
|
}
|
|
75
75
|
export declare enum GeoAction {
|
|
76
|
-
|
|
76
|
+
SearchByText = "0",
|
|
77
|
+
SearchByCoordinates = "1",
|
|
78
|
+
SearchForSuggestions = "2",
|
|
79
|
+
SearchByPlaceId = "3",
|
|
80
|
+
SaveGeofences = "4",
|
|
81
|
+
GetGeofence = "5",
|
|
82
|
+
ListGeofences = "6",
|
|
83
|
+
DeleteGeofences = "7"
|
|
77
84
|
}
|
|
78
85
|
export declare enum InAppMessagingAction {
|
|
79
86
|
SyncMessages = "1",
|
|
@@ -92,7 +99,8 @@ export declare enum PubSubAction {
|
|
|
92
99
|
Subscribe = "1"
|
|
93
100
|
}
|
|
94
101
|
export declare enum PushNotificationAction {
|
|
95
|
-
|
|
102
|
+
InitializePushNotifications = "1",
|
|
103
|
+
IdentifyUser = "2"
|
|
96
104
|
}
|
|
97
105
|
export declare enum StorageAction {
|
|
98
106
|
UploadData = "1",
|
|
@@ -139,23 +147,25 @@ export type CategoryUserAgentStateMap = Record<string, {
|
|
|
139
147
|
}>;
|
|
140
148
|
export type CustomUserAgentStateMap = Record<string, CategoryUserAgentStateMap>;
|
|
141
149
|
export type AdditionalDetails = [string, string?][];
|
|
142
|
-
type StorageUserAgentInput = {
|
|
150
|
+
export type StorageUserAgentInput = {
|
|
143
151
|
category: Category.Storage;
|
|
144
152
|
apis: StorageAction[];
|
|
153
|
+
additionalDetails: AdditionalDetails;
|
|
145
154
|
};
|
|
146
|
-
type AuthUserAgentInput = {
|
|
155
|
+
export type AuthUserAgentInput = {
|
|
147
156
|
category: Category.Auth;
|
|
148
157
|
apis: AuthAction[];
|
|
158
|
+
additionalDetails: AdditionalDetails;
|
|
149
159
|
};
|
|
150
|
-
type InAppMessagingUserAgentInput = {
|
|
160
|
+
export type InAppMessagingUserAgentInput = {
|
|
151
161
|
category: Category.InAppMessaging;
|
|
152
162
|
apis: InAppMessagingAction[];
|
|
163
|
+
additionalDetails: AdditionalDetails;
|
|
153
164
|
};
|
|
154
|
-
type GeoUserAgentInput = {
|
|
165
|
+
export type GeoUserAgentInput = {
|
|
155
166
|
category: Category.Geo;
|
|
156
167
|
apis: GeoAction[];
|
|
157
|
-
};
|
|
158
|
-
export type SetCustomUserAgentInput = (StorageUserAgentInput | AuthUserAgentInput | InAppMessagingUserAgentInput | GeoUserAgentInput) & {
|
|
159
168
|
additionalDetails: AdditionalDetails;
|
|
160
169
|
};
|
|
170
|
+
export type SetCustomUserAgentInput = StorageUserAgentInput | AuthUserAgentInput | InAppMessagingUserAgentInput | GeoUserAgentInput;
|
|
161
171
|
export {};
|
|
@@ -85,7 +85,14 @@ export var DataStoreAction;
|
|
|
85
85
|
})(DataStoreAction || (DataStoreAction = {}));
|
|
86
86
|
export var GeoAction;
|
|
87
87
|
(function (GeoAction) {
|
|
88
|
-
GeoAction["
|
|
88
|
+
GeoAction["SearchByText"] = "0";
|
|
89
|
+
GeoAction["SearchByCoordinates"] = "1";
|
|
90
|
+
GeoAction["SearchForSuggestions"] = "2";
|
|
91
|
+
GeoAction["SearchByPlaceId"] = "3";
|
|
92
|
+
GeoAction["SaveGeofences"] = "4";
|
|
93
|
+
GeoAction["GetGeofence"] = "5";
|
|
94
|
+
GeoAction["ListGeofences"] = "6";
|
|
95
|
+
GeoAction["DeleteGeofences"] = "7";
|
|
89
96
|
})(GeoAction || (GeoAction = {}));
|
|
90
97
|
export var InAppMessagingAction;
|
|
91
98
|
(function (InAppMessagingAction) {
|
|
@@ -109,7 +116,8 @@ export var PubSubAction;
|
|
|
109
116
|
})(PubSubAction || (PubSubAction = {}));
|
|
110
117
|
export var PushNotificationAction;
|
|
111
118
|
(function (PushNotificationAction) {
|
|
112
|
-
PushNotificationAction["
|
|
119
|
+
PushNotificationAction["InitializePushNotifications"] = "1";
|
|
120
|
+
PushNotificationAction["IdentifyUser"] = "2";
|
|
113
121
|
})(PushNotificationAction || (PushNotificationAction = {}));
|
|
114
122
|
export var StorageAction;
|
|
115
123
|
(function (StorageAction) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.1-api-v6-models.
|
|
1
|
+
export declare const version = "6.0.1-api-v6-models.3eb7748.0+3eb7748";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export var version = '6.0.1-api-v6-models.
|
|
2
|
+
export var version = '6.0.1-api-v6-models.3eb7748.0+3eb7748';
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
3
|
+
var __values = (this && this.__values) || function(o) {
|
|
4
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
5
|
+
if (m) return m.call(o);
|
|
6
|
+
if (o && typeof o.length === "number") return {
|
|
7
|
+
next: function () {
|
|
8
|
+
if (o && i >= o.length) o = void 0;
|
|
9
|
+
return { value: o && o[i++], done: !o };
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
13
|
+
};
|
|
14
|
+
import { Observable, from } from 'rxjs';
|
|
4
15
|
import { isWebWorker } from '../libraryUtils';
|
|
5
16
|
export var Reachability = /** @class */ (function () {
|
|
6
17
|
function Reachability() {
|
|
7
18
|
}
|
|
8
19
|
Reachability.prototype.networkMonitor = function (_) {
|
|
9
|
-
var globalObj = isWebWorker()
|
|
20
|
+
var globalObj = isWebWorker()
|
|
21
|
+
? self
|
|
22
|
+
: typeof window !== 'undefined' && window;
|
|
23
|
+
if (!globalObj) {
|
|
24
|
+
return from([{ online: true }]);
|
|
25
|
+
}
|
|
10
26
|
return new Observable(function (observer) {
|
|
11
27
|
observer.next({ online: globalObj.navigator.onLine });
|
|
12
28
|
var notifyOnline = function () { return observer.next({ online: true }); };
|
|
@@ -21,6 +37,31 @@ export var Reachability = /** @class */ (function () {
|
|
|
21
37
|
};
|
|
22
38
|
});
|
|
23
39
|
};
|
|
40
|
+
// expose observers to simulate offline mode for integration testing
|
|
41
|
+
Reachability._observerOverride = function (status) {
|
|
42
|
+
var e_1, _a;
|
|
43
|
+
var _loop_1 = function (observer) {
|
|
44
|
+
if (observer.closed) {
|
|
45
|
+
this_1._observers = this_1._observers.filter(function (_observer) { return _observer !== observer; });
|
|
46
|
+
return "continue";
|
|
47
|
+
}
|
|
48
|
+
(observer === null || observer === void 0 ? void 0 : observer.next) && observer.next(status);
|
|
49
|
+
};
|
|
50
|
+
var this_1 = this;
|
|
51
|
+
try {
|
|
52
|
+
for (var _b = __values(this._observers), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
53
|
+
var observer = _c.value;
|
|
54
|
+
_loop_1(observer);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
58
|
+
finally {
|
|
59
|
+
try {
|
|
60
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
61
|
+
}
|
|
62
|
+
finally { if (e_1) throw e_1.error; }
|
|
63
|
+
}
|
|
64
|
+
};
|
|
24
65
|
Reachability._observers = [];
|
|
25
66
|
return Reachability;
|
|
26
67
|
}());
|
|
@@ -1,10 +1,47 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
+
function step(op) {
|
|
17
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
19
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
+
switch (op[0]) {
|
|
22
|
+
case 0: case 1: t = op; break;
|
|
23
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
+
default:
|
|
27
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
+
if (t[2]) _.ops.pop();
|
|
32
|
+
_.trys.pop(); continue;
|
|
33
|
+
}
|
|
34
|
+
op = body.call(thisArg, _);
|
|
35
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
+
}
|
|
38
|
+
};
|
|
3
39
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
4
40
|
import { isBrowser } from '../utils';
|
|
5
|
-
import { Amplify } from '../Amplify';
|
|
6
41
|
import { AmplifyError } from '../errors';
|
|
7
42
|
import { assert, ServiceWorkerErrorCode } from './errorHelpers';
|
|
43
|
+
import { record } from '../providers/pinpoint';
|
|
44
|
+
import { Amplify, fetchAuthSession } from '../singleton';
|
|
8
45
|
/**
|
|
9
46
|
* Provides a means to registering a service worker in the browser
|
|
10
47
|
* and communicating with it via postMessage events.
|
|
@@ -173,19 +210,37 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
173
210
|
**/
|
|
174
211
|
ServiceWorkerClass.prototype._setupListeners = function () {
|
|
175
212
|
var _this = this;
|
|
176
|
-
this.serviceWorker.addEventListener('statechange', function (event) {
|
|
177
|
-
var currentState
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
213
|
+
this.serviceWorker.addEventListener('statechange', function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
214
|
+
var currentState, _a, appId, region, credentials;
|
|
215
|
+
var _b, _c;
|
|
216
|
+
return __generator(this, function (_d) {
|
|
217
|
+
switch (_d.label) {
|
|
218
|
+
case 0:
|
|
219
|
+
currentState = this.serviceWorker.state;
|
|
220
|
+
this._logger.debug("ServiceWorker statechange: ".concat(currentState));
|
|
221
|
+
_a = (_c = (_b = Amplify.getConfig().Analytics) === null || _b === void 0 ? void 0 : _b.Pinpoint) !== null && _c !== void 0 ? _c : {}, appId = _a.appId, region = _a.region;
|
|
222
|
+
return [4 /*yield*/, fetchAuthSession()];
|
|
223
|
+
case 1:
|
|
224
|
+
credentials = (_d.sent()).credentials;
|
|
225
|
+
if (appId && region && credentials) {
|
|
226
|
+
// Pinpoint is configured, record an event
|
|
227
|
+
record({
|
|
228
|
+
appId: appId,
|
|
229
|
+
region: region,
|
|
230
|
+
category: 'Core',
|
|
231
|
+
credentials: credentials,
|
|
232
|
+
event: {
|
|
233
|
+
name: 'ServiceWorker',
|
|
234
|
+
attributes: {
|
|
235
|
+
state: currentState,
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return [2 /*return*/];
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}); });
|
|
189
244
|
this.serviceWorker.addEventListener('message', function (event) {
|
|
190
245
|
_this._logger.debug("ServiceWorker message event: ".concat(event));
|
|
191
246
|
});
|
|
@@ -193,6 +248,3 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
193
248
|
return ServiceWorkerClass;
|
|
194
249
|
}());
|
|
195
250
|
export { ServiceWorkerClass };
|
|
196
|
-
function isAmplifyWithAnalytics(amplify) {
|
|
197
|
-
return amplify.Analytics && typeof amplify.Analytics.record === 'function';
|
|
198
|
-
}
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
13
1
|
export { ServiceWorkerClass as ServiceWorker } from './ServiceWorker';
|
|
@@ -1,15 +1,3 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
/**
|
|
4
|
-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
7
|
-
* the License. A copy of the License is located at
|
|
8
|
-
*
|
|
9
|
-
* http://aws.amazon.com/apache2.0/
|
|
10
|
-
*
|
|
11
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
12
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
13
|
-
* and limitations under the License.
|
|
14
|
-
*/
|
|
15
3
|
export { ServiceWorkerClass as ServiceWorker } from './ServiceWorker';
|
package/lib-esm/Signer/Signer.js
CHANGED
|
@@ -13,6 +13,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
};
|
|
14
14
|
import { DateUtils } from './DateUtils';
|
|
15
15
|
import { presignUrl, signRequest, TOKEN_QUERY_PARAM, } from '../clients/middleware/signing/signer/signatureV4';
|
|
16
|
+
import { AmplifyUrl } from '../utils/amplifyUrl';
|
|
16
17
|
var IOT_SERVICE_NAME = 'iotdevicegateway';
|
|
17
18
|
// Best practice regex to parse the service and region from an AWS endpoint
|
|
18
19
|
var AWS_ENDPOINT_REGEX = /([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(.cn)?$/;
|
|
@@ -60,7 +61,7 @@ var Signer = /** @class */ (function () {
|
|
|
60
61
|
if (request.body && !request.data) {
|
|
61
62
|
throw new Error('The attribute "body" was found on the request object. Please use the attribute "data" instead.');
|
|
62
63
|
}
|
|
63
|
-
var requestToSign = __assign(__assign({}, request), { body: request.data, url: new
|
|
64
|
+
var requestToSign = __assign(__assign({}, request), { body: request.data, url: new AmplifyUrl(request.url) });
|
|
64
65
|
var options = getOptions(requestToSign, accessInfo, serviceInfo);
|
|
65
66
|
var signedRequest = signRequest(requestToSign, options);
|
|
66
67
|
// Prior to using `signRequest`, Signer accepted urls as strings and outputted urls as string. Coerce the property
|
|
@@ -82,7 +83,7 @@ var Signer = /** @class */ (function () {
|
|
|
82
83
|
var presignable = {
|
|
83
84
|
body: body,
|
|
84
85
|
method: method,
|
|
85
|
-
url: new
|
|
86
|
+
url: new AmplifyUrl(urlToSign),
|
|
86
87
|
};
|
|
87
88
|
var options = getOptions(presignable, accessInfo, serviceInfo, expiration);
|
|
88
89
|
var signedUrl = presignUrl(presignable, options);
|
|
@@ -41,6 +41,7 @@ import { composeTransferHandler } from '../../clients/internal/composeTransferHa
|
|
|
41
41
|
import { jitteredBackoff, getRetryDecider, } from '../../clients/middleware/retry';
|
|
42
42
|
import { getAmplifyUserAgent } from '../../Platform';
|
|
43
43
|
import { observeFrameworkChanges } from '../../Platform/detectFramework';
|
|
44
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
44
45
|
/**
|
|
45
46
|
* The service name used to sign requests if the API requires authentication.
|
|
46
47
|
*/
|
|
@@ -51,7 +52,7 @@ var SERVICE_NAME = 'cognito-identity';
|
|
|
51
52
|
var endpointResolver = function (_a) {
|
|
52
53
|
var region = _a.region;
|
|
53
54
|
return ({
|
|
54
|
-
url: new
|
|
55
|
+
url: new AmplifyUrl("https://cognito-identity.".concat(region, ".").concat(getDnsSuffix(region))),
|
|
55
56
|
});
|
|
56
57
|
};
|
|
57
58
|
/**
|
|
@@ -4,6 +4,7 @@ import { getDnsSuffix } from '../../clients/endpoints';
|
|
|
4
4
|
import { jitteredBackoff, getRetryDecider, } from '../../clients/middleware/retry';
|
|
5
5
|
import { parseJsonError } from '../../clients/serde/json';
|
|
6
6
|
import { getAmplifyUserAgent } from '../../Platform';
|
|
7
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
7
8
|
/**
|
|
8
9
|
* The service name used to sign requests if the API requires authentication.
|
|
9
10
|
*/
|
|
@@ -14,7 +15,7 @@ var SERVICE_NAME = 'mobiletargeting';
|
|
|
14
15
|
var endpointResolver = function (_a) {
|
|
15
16
|
var region = _a.region;
|
|
16
17
|
return ({
|
|
17
|
-
url: new
|
|
18
|
+
url: new AmplifyUrl("https://pinpoint.".concat(region, ".").concat(getDnsSuffix(region))),
|
|
18
19
|
});
|
|
19
20
|
};
|
|
20
21
|
/**
|
|
@@ -41,10 +41,11 @@ import { composeServiceApi } from '../../clients/internal/composeServiceApi';
|
|
|
41
41
|
import { extendedEncodeURIComponent } from '../../clients/middleware/signing/utils/extendedEncodeURIComponent';
|
|
42
42
|
import { parseJsonBody, parseJsonError, parseMetadata, } from '../../clients/serde';
|
|
43
43
|
import { defaultConfig, getSharedHeaders } from './base';
|
|
44
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
44
45
|
var getInAppMessagesSerializer = function (_a, endpoint) {
|
|
45
46
|
var _b = _a.ApplicationId, ApplicationId = _b === void 0 ? '' : _b, _c = _a.EndpointId, EndpointId = _c === void 0 ? '' : _c;
|
|
46
47
|
var headers = getSharedHeaders();
|
|
47
|
-
var url = new
|
|
48
|
+
var url = new AmplifyUrl(endpoint.url);
|
|
48
49
|
url.pathname = "v1/apps/".concat(extendedEncodeURIComponent(ApplicationId), "/endpoints/").concat(extendedEncodeURIComponent(EndpointId), "/inappmessages");
|
|
49
50
|
return { method: 'GET', headers: headers, url: url };
|
|
50
51
|
};
|
|
@@ -42,11 +42,12 @@ import { extendedEncodeURIComponent } from '../../clients/middleware/signing/uti
|
|
|
42
42
|
import { parseJsonBody, parseJsonError, parseMetadata, } from '../../clients/serde';
|
|
43
43
|
import { defaultConfig, getSharedHeaders } from './base';
|
|
44
44
|
import { assert, PinpointValidationErrorCode } from './errorHelpers';
|
|
45
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
45
46
|
var putEventsSerializer = function (_a, endpoint) {
|
|
46
47
|
var ApplicationId = _a.ApplicationId, EventsRequest = _a.EventsRequest;
|
|
47
48
|
assert(!!ApplicationId, PinpointValidationErrorCode.NoAppId);
|
|
48
49
|
var headers = getSharedHeaders();
|
|
49
|
-
var url = new
|
|
50
|
+
var url = new AmplifyUrl(endpoint.url);
|
|
50
51
|
url.pathname = "v1/apps/".concat(extendedEncodeURIComponent(ApplicationId), "/events");
|
|
51
52
|
var body = JSON.stringify(EventsRequest !== null && EventsRequest !== void 0 ? EventsRequest : {});
|
|
52
53
|
return { method: 'POST', headers: headers, url: url, body: body };
|
|
@@ -41,10 +41,11 @@ import { composeServiceApi } from '../../clients/internal/composeServiceApi';
|
|
|
41
41
|
import { extendedEncodeURIComponent } from '../../clients/middleware/signing/utils/extendedEncodeURIComponent';
|
|
42
42
|
import { parseJsonBody, parseJsonError, parseMetadata, } from '../../clients/serde';
|
|
43
43
|
import { defaultConfig, getSharedHeaders } from './base';
|
|
44
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
44
45
|
var updateEndpointSerializer = function (_a, endpoint) {
|
|
45
46
|
var _b = _a.ApplicationId, ApplicationId = _b === void 0 ? '' : _b, _c = _a.EndpointId, EndpointId = _c === void 0 ? '' : _c, EndpointRequest = _a.EndpointRequest;
|
|
46
47
|
var headers = getSharedHeaders();
|
|
47
|
-
var url = new
|
|
48
|
+
var url = new AmplifyUrl(endpoint.url);
|
|
48
49
|
url.pathname = "v1/apps/".concat(extendedEncodeURIComponent(ApplicationId), "/endpoints/").concat(extendedEncodeURIComponent(EndpointId));
|
|
49
50
|
var body = JSON.stringify(EndpointRequest);
|
|
50
51
|
return { method: 'PUT', headers: headers, url: url, body: body };
|