@aws-amplify/core 6.0.1-api-v6-models.8035dfc.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
package/lib/types/errors.d.ts
CHANGED
package/lib/types/errors.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.AmplifyErrorCode = void 0;
|
|
6
6
|
var AmplifyErrorCode;
|
|
7
7
|
(function (AmplifyErrorCode) {
|
|
8
|
+
AmplifyErrorCode["NoEndpointId"] = "NoEndpointId";
|
|
8
9
|
AmplifyErrorCode["PlatformNotSupported"] = "PlatformNotSupported";
|
|
9
10
|
AmplifyErrorCode["Unknown"] = "Unknown";
|
|
10
11
|
})(AmplifyErrorCode = exports.AmplifyErrorCode || (exports.AmplifyErrorCode = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './polyfill';
|
|
2
|
+
declare const AmplifyUrl: {
|
|
3
|
+
new (url: string | URL, base?: string | URL | undefined): URL;
|
|
4
|
+
prototype: URL;
|
|
5
|
+
createObjectURL(obj: Blob | MediaSource): string;
|
|
6
|
+
revokeObjectURL(url: string): void;
|
|
7
|
+
};
|
|
8
|
+
declare const AmplifyUrlSearchParams: {
|
|
9
|
+
new (init?: string | URLSearchParams | Record<string, string> | string[][] | undefined): URLSearchParams;
|
|
10
|
+
prototype: URLSearchParams;
|
|
11
|
+
toString(): string;
|
|
12
|
+
};
|
|
13
|
+
export { AmplifyUrl, AmplifyUrlSearchParams };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.AmplifyUrlSearchParams = exports.AmplifyUrl = void 0;
|
|
6
|
+
require("./polyfill");
|
|
7
|
+
var AmplifyUrl = URL;
|
|
8
|
+
exports.AmplifyUrl = AmplifyUrl;
|
|
9
|
+
var AmplifyUrlSearchParams = URLSearchParams;
|
|
10
|
+
exports.AmplifyUrlSearchParams = AmplifyUrlSearchParams;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.amplifyUuid = void 0;
|
|
6
|
+
require("./polyfill");
|
|
7
|
+
var uuid_1 = require("uuid");
|
|
8
|
+
var amplifyUuid = uuid_1.v4;
|
|
9
|
+
exports.amplifyUuid = amplifyUuid;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
var react_native_1 = require("@aws-amplify/react-native");
|
|
6
|
+
(0, react_native_1.loadGetRandomValues)();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deepFreeze: (object: any) => any;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var __values = (this && this.__values) || function(o) {
|
|
5
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
6
|
+
if (m) return m.call(o);
|
|
7
|
+
if (o && typeof o.length === "number") return {
|
|
8
|
+
next: function () {
|
|
9
|
+
if (o && i >= o.length) o = void 0;
|
|
10
|
+
return { value: o && o[i++], done: !o };
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.deepFreeze = void 0;
|
|
17
|
+
var deepFreeze = function (object) {
|
|
18
|
+
var e_1, _a;
|
|
19
|
+
var propNames = Reflect.ownKeys(object);
|
|
20
|
+
try {
|
|
21
|
+
for (var propNames_1 = __values(propNames), propNames_1_1 = propNames_1.next(); !propNames_1_1.done; propNames_1_1 = propNames_1.next()) {
|
|
22
|
+
var name_1 = propNames_1_1.value;
|
|
23
|
+
var value = object[name_1];
|
|
24
|
+
if ((value && typeof value === 'object') || typeof value === 'function') {
|
|
25
|
+
(0, exports.deepFreeze)(value);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
30
|
+
finally {
|
|
31
|
+
try {
|
|
32
|
+
if (propNames_1_1 && !propNames_1_1.done && (_a = propNames_1.return)) _a.call(propNames_1);
|
|
33
|
+
}
|
|
34
|
+
finally { if (e_1) throw e_1.error; }
|
|
35
|
+
}
|
|
36
|
+
return Object.freeze(object);
|
|
37
|
+
};
|
|
38
|
+
exports.deepFreeze = deepFreeze;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getClientInfo = void 0;
|
|
4
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
// @ts-ignore: missing type definition
|
|
7
7
|
var react_native_1 = require("react-native");
|
|
8
|
-
var Logger_1 = require("
|
|
8
|
+
var Logger_1 = require("../../Logger");
|
|
9
9
|
var logger = new Logger_1.ConsoleLogger('DeviceInfo');
|
|
10
|
-
var
|
|
10
|
+
var getClientInfo = function () {
|
|
11
11
|
var dim = react_native_1.Dimensions.get('screen');
|
|
12
12
|
logger.debug(react_native_1.Platform, dim);
|
|
13
13
|
var OS = 'android';
|
|
@@ -18,4 +18,4 @@ var clientInfo = function () {
|
|
|
18
18
|
appVersion: [OS, String(Version)].join('/'),
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
exports.
|
|
21
|
+
exports.getClientInfo = getClientInfo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function getClientInfo(): {
|
|
2
2
|
platform?: undefined;
|
|
3
3
|
make?: undefined;
|
|
4
4
|
model?: undefined;
|
|
@@ -15,11 +15,3 @@ export declare function clientInfo(): {
|
|
|
15
15
|
language: string;
|
|
16
16
|
timezone: string;
|
|
17
17
|
};
|
|
18
|
-
export declare function dimension(): {
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
};
|
|
22
|
-
export declare function browserType(userAgent: string): {
|
|
23
|
-
type: string;
|
|
24
|
-
version: string;
|
|
25
|
-
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getClientInfo = void 0;
|
|
4
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
// @ts-ignore: missing type definition
|
|
7
7
|
var react_native_1 = require("react-native");
|
|
8
|
-
var Logger_1 = require("
|
|
8
|
+
var Logger_1 = require("../../Logger");
|
|
9
9
|
var logger = new Logger_1.ConsoleLogger('DeviceInfo');
|
|
10
|
-
var
|
|
10
|
+
var getClientInfo = function () {
|
|
11
11
|
var dim = react_native_1.Dimensions.get('screen');
|
|
12
12
|
logger.debug(react_native_1.Platform, dim);
|
|
13
13
|
var OS = 'ios';
|
|
@@ -21,7 +21,7 @@ var clientInfo = function () {
|
|
|
21
21
|
model: model,
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
exports.
|
|
24
|
+
exports.getClientInfo = getClientInfo;
|
|
25
25
|
function dimToMake(dim) {
|
|
26
26
|
var height = dim.height, width = dim.width;
|
|
27
27
|
if (height < width) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getClientInfo = void 0;
|
|
4
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
var Logger_1 = require("
|
|
6
|
+
var Logger_1 = require("../../Logger");
|
|
7
7
|
var logger = new Logger_1.ConsoleLogger('ClientDevice_Browser');
|
|
8
|
-
function
|
|
8
|
+
function getClientInfo() {
|
|
9
9
|
if (typeof window === 'undefined') {
|
|
10
10
|
return {};
|
|
11
11
|
}
|
|
12
12
|
return browserClientInfo();
|
|
13
13
|
}
|
|
14
|
-
exports.
|
|
14
|
+
exports.getClientInfo = getClientInfo;
|
|
15
15
|
function browserClientInfo() {
|
|
16
16
|
if (typeof window === 'undefined') {
|
|
17
17
|
logger.warn('No window object available to get browser client info');
|
|
@@ -23,7 +23,7 @@ function browserClientInfo() {
|
|
|
23
23
|
return {};
|
|
24
24
|
}
|
|
25
25
|
var platform = nav.platform, product = nav.product, vendor = nav.vendor, userAgent = nav.userAgent, language = nav.language;
|
|
26
|
-
var type =
|
|
26
|
+
var type = getBrowserType(userAgent);
|
|
27
27
|
var timezone = browserTimezone();
|
|
28
28
|
return {
|
|
29
29
|
platform: platform,
|
|
@@ -35,22 +35,11 @@ function browserClientInfo() {
|
|
|
35
35
|
timezone: timezone,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function dimension() {
|
|
39
|
-
if (typeof window === 'undefined') {
|
|
40
|
-
logger.warn('No window object available to get browser client info');
|
|
41
|
-
return { width: 320, height: 320 };
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
width: window.innerWidth,
|
|
45
|
-
height: window.innerHeight,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
exports.dimension = dimension;
|
|
49
38
|
function browserTimezone() {
|
|
50
39
|
var tzMatch = /\(([A-Za-z\s].*)\)/.exec(new Date().toString());
|
|
51
40
|
return tzMatch ? tzMatch[1] || '' : '';
|
|
52
41
|
}
|
|
53
|
-
function
|
|
42
|
+
function getBrowserType(userAgent) {
|
|
54
43
|
var operaMatch = /.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(userAgent);
|
|
55
44
|
if (operaMatch) {
|
|
56
45
|
return { type: operaMatch[1], version: operaMatch[2] };
|
|
@@ -77,4 +66,3 @@ function browserType(userAgent) {
|
|
|
77
66
|
}
|
|
78
67
|
return { type: '', version: '' };
|
|
79
68
|
}
|
|
80
|
-
exports.browserType = browserType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getClientInfo } from './getClientInfo';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getClientInfo = void 0;
|
|
6
|
+
var getClientInfo_1 = require("./getClientInfo");
|
|
7
|
+
Object.defineProperty(exports, "getClientInfo", { enumerable: true, get: function () { return getClientInfo_1.getClientInfo; } });
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { generateRandomString } from './generateRandomString';
|
|
2
|
+
export { getClientInfo } from './getClientInfo';
|
|
2
3
|
export { isBrowser } from './isBrowser';
|
|
3
4
|
export { isWebWorker } from './isWebWorker';
|
|
4
5
|
export { NonRetryableError, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, } from './retry';
|
|
5
6
|
export { urlSafeDecode } from './urlSafeDecode';
|
|
6
7
|
export { urlSafeEncode } from './urlSafeEncode';
|
|
8
|
+
export { deepFreeze } from './deepFreeze';
|
package/lib/utils/index.js
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
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.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isNonRetryableError = exports.NonRetryableError = exports.isWebWorker = exports.isBrowser = exports.generateRandomString = void 0;
|
|
5
|
+
exports.deepFreeze = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isNonRetryableError = exports.NonRetryableError = exports.isWebWorker = exports.isBrowser = exports.getClientInfo = exports.generateRandomString = void 0;
|
|
6
6
|
var generateRandomString_1 = require("./generateRandomString");
|
|
7
7
|
Object.defineProperty(exports, "generateRandomString", { enumerable: true, get: function () { return generateRandomString_1.generateRandomString; } });
|
|
8
|
+
var getClientInfo_1 = require("./getClientInfo");
|
|
9
|
+
Object.defineProperty(exports, "getClientInfo", { enumerable: true, get: function () { return getClientInfo_1.getClientInfo; } });
|
|
8
10
|
var isBrowser_1 = require("./isBrowser");
|
|
9
11
|
Object.defineProperty(exports, "isBrowser", { enumerable: true, get: function () { return isBrowser_1.isBrowser; } });
|
|
10
12
|
var isWebWorker_1 = require("./isWebWorker");
|
|
@@ -19,3 +21,5 @@ var urlSafeDecode_1 = require("./urlSafeDecode");
|
|
|
19
21
|
Object.defineProperty(exports, "urlSafeDecode", { enumerable: true, get: function () { return urlSafeDecode_1.urlSafeDecode; } });
|
|
20
22
|
var urlSafeEncode_1 = require("./urlSafeEncode");
|
|
21
23
|
Object.defineProperty(exports, "urlSafeEncode", { enumerable: true, get: function () { return urlSafeEncode_1.urlSafeEncode; } });
|
|
24
|
+
var deepFreeze_1 = require("./deepFreeze");
|
|
25
|
+
Object.defineProperty(exports, "deepFreeze", { enumerable: true, get: function () { return deepFreeze_1.deepFreeze; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SessionStateChangeListener, SessionListenerInterface } from './types';
|
|
2
|
+
export declare class SessionListener implements SessionListenerInterface {
|
|
3
|
+
private listenerActive;
|
|
4
|
+
constructor();
|
|
5
|
+
addStateChangeListener(listener: SessionStateChangeListener, notifyOnAdd?: boolean): void;
|
|
6
|
+
removeStateChangeListener(handler: SessionStateChangeListener): void;
|
|
7
|
+
private handleVisibilityChange;
|
|
8
|
+
private notifyHandlers;
|
|
9
|
+
private getSessionState;
|
|
10
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.SessionListener = void 0;
|
|
6
|
+
var isBrowser_1 = require("../isBrowser");
|
|
7
|
+
var stateChangeListeners = new Set();
|
|
8
|
+
var SessionListener = /** @class */ (function () {
|
|
9
|
+
function SessionListener() {
|
|
10
|
+
this.listenerActive = false;
|
|
11
|
+
this.handleVisibilityChange = this.handleVisibilityChange.bind(this);
|
|
12
|
+
// Setup state listeners
|
|
13
|
+
if ((0, isBrowser_1.isBrowser)()) {
|
|
14
|
+
document.addEventListener('visibilitychange', this.handleVisibilityChange, false);
|
|
15
|
+
this.listenerActive = true;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
SessionListener.prototype.addStateChangeListener = function (listener, notifyOnAdd) {
|
|
19
|
+
if (notifyOnAdd === void 0) { notifyOnAdd = false; }
|
|
20
|
+
// No-op if document listener is not active
|
|
21
|
+
if (!this.listenerActive) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
stateChangeListeners.add(listener);
|
|
25
|
+
// Notify new handlers of the current status on add
|
|
26
|
+
if (notifyOnAdd) {
|
|
27
|
+
listener(this.getSessionState());
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
SessionListener.prototype.removeStateChangeListener = function (handler) {
|
|
31
|
+
// No-op if document listener is not active
|
|
32
|
+
if (!this.listenerActive) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
stateChangeListeners.delete(handler);
|
|
36
|
+
};
|
|
37
|
+
SessionListener.prototype.handleVisibilityChange = function () {
|
|
38
|
+
this.notifyHandlers();
|
|
39
|
+
};
|
|
40
|
+
SessionListener.prototype.notifyHandlers = function () {
|
|
41
|
+
var sessionState = this.getSessionState();
|
|
42
|
+
stateChangeListeners.forEach(function (listener) {
|
|
43
|
+
listener(sessionState);
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
SessionListener.prototype.getSessionState = function () {
|
|
47
|
+
if ((0, isBrowser_1.isBrowser)() && document.visibilityState !== 'hidden') {
|
|
48
|
+
return 'started';
|
|
49
|
+
}
|
|
50
|
+
// If, for any reason, document is undefined the session will never start
|
|
51
|
+
return 'ended';
|
|
52
|
+
};
|
|
53
|
+
return SessionListener;
|
|
54
|
+
}());
|
|
55
|
+
exports.SessionListener = SessionListener;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SessionStateChangeListener, SessionListenerInterface } from './types';
|
|
2
|
+
export declare class SessionListener implements SessionListenerInterface {
|
|
3
|
+
private currentAppState?;
|
|
4
|
+
constructor();
|
|
5
|
+
addStateChangeListener(listener: SessionStateChangeListener, notifyOnAdd?: boolean): void;
|
|
6
|
+
removeStateChangeListener(handler: SessionStateChangeListener): void;
|
|
7
|
+
private handleStateChange;
|
|
8
|
+
private notifyHandlers;
|
|
9
|
+
private getSessionState;
|
|
10
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.SessionListener = void 0;
|
|
6
|
+
var react_native_1 = require("@aws-amplify/react-native");
|
|
7
|
+
var stateChangeListeners = new Set();
|
|
8
|
+
var isActive = function (appState) { return appState === 'active'; };
|
|
9
|
+
var isInactive = function (appState) {
|
|
10
|
+
return appState === 'inactive' || appState === 'background';
|
|
11
|
+
};
|
|
12
|
+
var SessionListener = /** @class */ (function () {
|
|
13
|
+
function SessionListener() {
|
|
14
|
+
this.handleStateChange = this.handleStateChange.bind(this);
|
|
15
|
+
// Setup state listeners
|
|
16
|
+
(0, react_native_1.loadAppState)().addEventListener('change', this.handleStateChange);
|
|
17
|
+
}
|
|
18
|
+
SessionListener.prototype.addStateChangeListener = function (listener, notifyOnAdd) {
|
|
19
|
+
if (notifyOnAdd === void 0) { notifyOnAdd = false; }
|
|
20
|
+
stateChangeListeners.add(listener);
|
|
21
|
+
// Notify new handlers of the current state on add if the current state has been determined
|
|
22
|
+
if (notifyOnAdd && this.currentAppState !== undefined) {
|
|
23
|
+
listener(this.getSessionState());
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
SessionListener.prototype.removeStateChangeListener = function (handler) {
|
|
27
|
+
stateChangeListeners.delete(handler);
|
|
28
|
+
};
|
|
29
|
+
SessionListener.prototype.handleStateChange = function (nextAppState) {
|
|
30
|
+
if ((this.currentAppState === undefined ||
|
|
31
|
+
isInactive(this.currentAppState)) &&
|
|
32
|
+
isActive(nextAppState)) {
|
|
33
|
+
this.notifyHandlers('started');
|
|
34
|
+
}
|
|
35
|
+
else if (isActive(this.currentAppState) && isInactive(nextAppState)) {
|
|
36
|
+
this.notifyHandlers('ended');
|
|
37
|
+
}
|
|
38
|
+
this.currentAppState = nextAppState;
|
|
39
|
+
};
|
|
40
|
+
SessionListener.prototype.notifyHandlers = function (state) {
|
|
41
|
+
stateChangeListeners.forEach(function (listener) {
|
|
42
|
+
listener(state);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
SessionListener.prototype.getSessionState = function () {
|
|
46
|
+
if (isActive(this.currentAppState)) {
|
|
47
|
+
return 'started';
|
|
48
|
+
}
|
|
49
|
+
// Consider any other app state as ended
|
|
50
|
+
return 'ended';
|
|
51
|
+
};
|
|
52
|
+
return SessionListener;
|
|
53
|
+
}());
|
|
54
|
+
exports.SessionListener = SessionListener;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.sessionListener = void 0;
|
|
6
|
+
var SessionListener_1 = require("./SessionListener");
|
|
7
|
+
exports.sessionListener = new SessionListener_1.SessionListener();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type SessionState = 'started' | 'ended';
|
|
2
|
+
export type SessionStateChangeListener = (state: SessionState) => void;
|
|
3
|
+
export interface SessionListenerInterface {
|
|
4
|
+
addStateChangeListener: (listener: SessionStateChangeListener) => void;
|
|
5
|
+
removeStateChangeListener: (listener: SessionStateChangeListener) => void;
|
|
6
|
+
}
|
|
@@ -1,39 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StorageCacheCommon } from './StorageCacheCommon';
|
|
2
|
+
import { Cache, CacheConfig } from './types';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
4
|
+
* Customized storage based on the SessionStorage or LocalStorage with LRU implemented
|
|
5
5
|
*/
|
|
6
|
-
export declare class StorageCache {
|
|
7
|
-
|
|
6
|
+
export declare class StorageCache extends StorageCacheCommon implements Cache {
|
|
7
|
+
storage: Storage;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param config - Custom configuration for this instance.
|
|
9
|
+
* initialize the cache
|
|
10
|
+
* @param config - the configuration of the cache
|
|
12
11
|
*/
|
|
13
12
|
constructor(config?: CacheConfig);
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
protected getAllCacheKeys(options?: {
|
|
14
|
+
omitSizeKey?: boolean;
|
|
15
|
+
}): Promise<string[]>;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @param
|
|
19
|
-
* @
|
|
20
|
-
*
|
|
21
|
-
* @return - the item which has the meta-data and the value
|
|
17
|
+
* Return a new instance of cache with customized configuration.
|
|
18
|
+
* @param {Object} config - the customized configuration
|
|
19
|
+
* @return {Object} - the new instance of Cache
|
|
22
20
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Set custom configuration for the cache instance.
|
|
26
|
-
*
|
|
27
|
-
* @param config - customized configuration (without keyPrefix, which can't be changed)
|
|
28
|
-
*
|
|
29
|
-
* @return - the current configuration
|
|
30
|
-
*/
|
|
31
|
-
configure(config?: Omit<CacheConfig, 'keyPrefix'>): CacheConfig;
|
|
32
|
-
/**
|
|
33
|
-
* Returns an appropriate configuration for the Cache instance. Will apply any custom configuration for this
|
|
34
|
-
* instance on top of the global configuration. Default configuration will be applied in all cases.
|
|
35
|
-
*
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
|
-
protected get cacheConfig(): CacheConfig;
|
|
21
|
+
createInstance(config: CacheConfig): Cache;
|
|
39
22
|
}
|