@aws-amplify/core 5.8.2 → 6.0.1-console-preview.7919075.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/README.md +3 -0
- package/lib/Amplify.d.ts +18 -17
- package/lib/Amplify.js +9 -0
- package/lib/AwsClients/CognitoIdentity/base.d.ts +3 -10
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +3 -17
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +8 -8
- package/lib/AwsClients/CognitoIdentity/getId.d.ts +3 -17
- package/lib/AwsClients/Pinpoint/base.d.ts +2 -10
- package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +3 -17
- package/lib/AwsClients/Pinpoint/getInAppMessages.js +1 -1
- package/lib/AwsClients/Pinpoint/putEvents.d.ts +3 -17
- package/lib/AwsClients/Pinpoint/putEvents.js +6 -0
- package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +3 -17
- package/lib/AwsClients/Pinpoint/updateEndpoint.js +2 -2
- package/lib/Cache/AsyncStorageCache.d.ts +154 -0
- package/lib/Cache/AsyncStorageCache.js +744 -0
- package/lib/Cache/BrowserStorageCache.d.ts +166 -0
- package/lib/Cache/BrowserStorageCache.js +469 -0
- package/lib/Cache/InMemoryCache.d.ts +129 -0
- package/lib/Cache/InMemoryCache.js +349 -0
- package/lib/Cache/StorageCache.d.ts +39 -0
- package/lib/Cache/StorageCache.js +121 -0
- package/lib/Cache/Utils/CacheList.d.ts +89 -0
- package/lib/Cache/Utils/CacheList.js +196 -0
- package/lib/Cache/Utils/CacheUtils.d.ts +25 -0
- package/lib/Cache/Utils/CacheUtils.js +88 -0
- package/lib/Cache/Utils/index.d.ts +2 -0
- package/lib/Cache/Utils/index.js +16 -0
- package/lib/Cache/reactnative.d.ts +3 -0
- package/lib/Cache/reactnative.js +8 -0
- package/lib/Cache/types/Cache.d.ts +55 -0
- package/lib/Cache/types/Cache.js +4 -0
- package/lib/Cache/types/index.d.ts +1 -0
- package/lib/Cache/types/index.js +19 -0
- package/lib/ClientDevice/android.js +3 -2
- package/lib/ClientDevice/ios.d.ts +2 -2
- package/lib/ClientDevice/ios.js +3 -2
- package/lib/ClientDevice/reactnative.js +3 -2
- package/lib/Credentials.d.ts +1 -1
- package/lib/Credentials.js +2 -1
- package/lib/Errors.d.ts +19 -0
- package/lib/Errors.js +50 -1
- package/lib/Hub.js +1 -0
- package/lib/I18n/I18n.d.ts +29 -9
- package/lib/I18n/I18n.js +30 -5
- package/lib/I18n/index.d.ts +18 -5
- package/lib/I18n/index.js +35 -5
- package/lib/I18n/types.d.ts +4 -1
- package/lib/I18n/types.js +3 -0
- package/lib/JS.d.ts +6 -6
- package/lib/Logger/ConsoleLogger.d.ts +11 -11
- package/lib/OAuthHelper/GoogleOAuth.js +2 -1
- package/lib/Platform/detectFramework.js +2 -1
- package/lib/Platform/detection/Next.d.ts +1 -1
- package/lib/Platform/detection/React.js +1 -0
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/Providers/AWSCloudWatchProvider.d.ts +2 -2
- package/lib/Providers/AWSCloudWatchProvider.js +35 -12
- package/lib/RNComponents/index.d.ts +1 -1
- package/lib/RNComponents/reactnative.js +3 -2
- package/lib/ServiceWorker/ServiceWorker.d.ts +4 -4
- package/lib/ServiceWorker/ServiceWorker.js +37 -11
- package/lib/Signer.d.ts +14 -1
- package/lib/StorageHelper/cookieStorage.d.ts +13 -0
- package/lib/StorageHelper/cookieStorage.js +167 -0
- package/lib/StorageHelper/inMemoryStorage.d.ts +10 -0
- package/lib/StorageHelper/inMemoryStorage.js +82 -0
- package/lib/StorageHelper/index.d.ts +7 -3
- package/lib/StorageHelper/index.js +9 -1
- package/lib/StorageHelper/localStorage.d.ts +32 -0
- package/lib/StorageHelper/localStorage.js +114 -0
- package/lib/StorageHelper/reactnative.d.ts +71 -1
- package/lib/StorageHelper/reactnative.js +154 -10
- package/lib/StorageHelper/sessionStorage.d.ts +32 -0
- package/lib/StorageHelper/sessionStorage.js +114 -0
- package/lib/UniversalStorage/index.d.ts +2 -2
- package/lib/Util/BackgroundProcessManager.d.ts +2 -2
- package/lib/Util/BackgroundProcessManager.js +1 -0
- package/lib/Util/DateUtils.d.ts +12 -1
- package/lib/Util/Reachability.js +7 -5
- package/lib/Util/Reachability.native.d.ts +3 -2
- package/lib/Util/StringUtils.js +3 -10
- package/lib/Util/errors/AssertError.d.ts +2 -0
- package/lib/Util/errors/AssertError.js +11 -0
- package/lib/clients/middleware/retry/defaultRetryDecider.d.ts +1 -1
- package/lib/clients/middleware/retry/defaultRetryDecider.js +17 -13
- package/lib/clients/middleware/retry/isClockSkewError.js +1 -1
- package/lib/clients/middleware/retry/middleware.d.ts +1 -1
- package/lib/clients/middleware/retry/middleware.js +13 -13
- package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +1 -1
- package/lib/clients/serde/responseInfo.js +1 -1
- package/lib/clients/types/aws.d.ts +4 -0
- package/lib/clients/types/index.d.ts +1 -1
- package/lib/constants.d.ts +7 -0
- package/lib/constants.js +9 -1
- package/lib/index.d.ts +18 -4
- package/lib/index.js +32 -5
- package/lib/parseAWSExports.d.ts +1 -1
- package/lib/singleton/Auth/index.d.ts +30 -0
- package/lib/singleton/Auth/index.js +133 -0
- package/lib/singleton/Auth/types.d.ts +95 -0
- package/lib/singleton/Auth/types.js +6 -0
- package/lib/singleton/Auth/utils/index.d.ts +5 -0
- package/lib/singleton/Auth/utils/index.js +52 -0
- package/lib/singleton/Storage/types.d.ts +14 -0
- package/lib/singleton/Storage/types.js +4 -0
- package/lib/singleton/index.d.ts +46 -0
- package/lib/singleton/index.js +160 -0
- package/lib/singleton/types.d.ts +21 -0
- package/lib/singleton/types.js +4 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/types.d.ts +31 -1
- package/lib/types/types.js +2 -0
- package/lib-esm/Amplify.d.ts +18 -17
- package/lib-esm/Amplify.js +9 -0
- package/lib-esm/AwsClients/CognitoIdentity/base.d.ts +3 -10
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +3 -17
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +8 -8
- package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +3 -17
- package/lib-esm/AwsClients/Pinpoint/base.d.ts +2 -10
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +3 -17
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.js +1 -1
- package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +3 -17
- package/lib-esm/AwsClients/Pinpoint/putEvents.js +6 -0
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +3 -17
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.js +2 -2
- package/lib-esm/Cache/AsyncStorageCache.d.ts +154 -0
- package/lib-esm/Cache/AsyncStorageCache.js +737 -0
- package/lib-esm/Cache/BrowserStorageCache.d.ts +166 -0
- package/lib-esm/Cache/BrowserStorageCache.js +466 -0
- package/lib-esm/Cache/InMemoryCache.d.ts +129 -0
- package/lib-esm/Cache/InMemoryCache.js +346 -0
- package/lib-esm/Cache/StorageCache.d.ts +39 -0
- package/lib-esm/Cache/StorageCache.js +118 -0
- package/lib-esm/Cache/Utils/CacheList.d.ts +89 -0
- package/lib-esm/Cache/Utils/CacheList.js +194 -0
- package/lib-esm/Cache/Utils/CacheUtils.d.ts +25 -0
- package/lib-esm/Cache/Utils/CacheUtils.js +81 -0
- package/lib-esm/Cache/Utils/index.d.ts +2 -0
- package/lib-esm/Cache/Utils/index.js +4 -0
- package/lib-esm/Cache/reactnative.d.ts +3 -0
- package/lib-esm/Cache/reactnative.js +6 -0
- package/lib-esm/Cache/types/Cache.d.ts +55 -0
- package/lib-esm/Cache/types/Cache.js +3 -0
- package/lib-esm/Cache/types/index.d.ts +1 -0
- package/lib-esm/Cache/types/index.js +3 -0
- package/lib-esm/ClientDevice/android.js +1 -0
- package/lib-esm/ClientDevice/ios.d.ts +2 -2
- package/lib-esm/ClientDevice/ios.js +1 -0
- package/lib-esm/ClientDevice/reactnative.js +1 -0
- package/lib-esm/Credentials.d.ts +1 -1
- package/lib-esm/Credentials.js +2 -1
- package/lib-esm/Errors.d.ts +19 -0
- package/lib-esm/Errors.js +49 -0
- package/lib-esm/Hub.js +1 -0
- package/lib-esm/I18n/I18n.d.ts +29 -9
- package/lib-esm/I18n/I18n.js +30 -5
- package/lib-esm/I18n/index.d.ts +18 -5
- package/lib-esm/I18n/index.js +35 -5
- package/lib-esm/I18n/types.d.ts +4 -1
- package/lib-esm/I18n/types.js +3 -0
- package/lib-esm/JS.d.ts +6 -6
- package/lib-esm/Logger/ConsoleLogger.d.ts +11 -11
- package/lib-esm/OAuthHelper/GoogleOAuth.js +2 -1
- package/lib-esm/Platform/detectFramework.js +2 -1
- package/lib-esm/Platform/detection/Next.d.ts +1 -1
- package/lib-esm/Platform/detection/React.js +1 -0
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/Providers/AWSCloudWatchProvider.d.ts +2 -2
- package/lib-esm/Providers/AWSCloudWatchProvider.js +33 -10
- package/lib-esm/RNComponents/index.d.ts +1 -1
- package/lib-esm/RNComponents/reactnative.js +1 -0
- package/lib-esm/ServiceWorker/ServiceWorker.d.ts +4 -4
- package/lib-esm/ServiceWorker/ServiceWorker.js +37 -11
- package/lib-esm/Signer.d.ts +14 -1
- package/lib-esm/StorageHelper/cookieStorage.d.ts +13 -0
- package/lib-esm/StorageHelper/cookieStorage.js +141 -0
- package/lib-esm/StorageHelper/inMemoryStorage.d.ts +10 -0
- package/lib-esm/StorageHelper/inMemoryStorage.js +79 -0
- package/lib-esm/StorageHelper/index.d.ts +7 -3
- package/lib-esm/StorageHelper/index.js +4 -0
- package/lib-esm/StorageHelper/localStorage.d.ts +32 -0
- package/lib-esm/StorageHelper/localStorage.js +111 -0
- package/lib-esm/StorageHelper/reactnative.d.ts +71 -1
- package/lib-esm/StorageHelper/reactnative.js +153 -9
- package/lib-esm/StorageHelper/sessionStorage.d.ts +32 -0
- package/lib-esm/StorageHelper/sessionStorage.js +111 -0
- package/lib-esm/UniversalStorage/index.d.ts +2 -2
- package/lib-esm/Util/BackgroundProcessManager.d.ts +2 -2
- package/lib-esm/Util/BackgroundProcessManager.js +1 -0
- package/lib-esm/Util/DateUtils.d.ts +12 -1
- package/lib-esm/Util/Reachability.js +5 -3
- package/lib-esm/Util/Reachability.native.d.ts +3 -2
- package/lib-esm/Util/StringUtils.js +3 -10
- package/lib-esm/Util/errors/AssertError.d.ts +2 -0
- package/lib-esm/Util/errors/AssertError.js +7 -0
- package/lib-esm/clients/middleware/retry/defaultRetryDecider.d.ts +1 -1
- package/lib-esm/clients/middleware/retry/defaultRetryDecider.js +17 -13
- package/lib-esm/clients/middleware/retry/isClockSkewError.js +1 -1
- package/lib-esm/clients/middleware/retry/middleware.d.ts +1 -1
- package/lib-esm/clients/middleware/retry/middleware.js +13 -13
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +1 -1
- package/lib-esm/clients/serde/responseInfo.js +1 -1
- package/lib-esm/clients/types/aws.d.ts +4 -0
- package/lib-esm/clients/types/index.d.ts +1 -1
- package/lib-esm/constants.d.ts +7 -0
- package/lib-esm/constants.js +8 -0
- package/lib-esm/index.d.ts +18 -4
- package/lib-esm/index.js +15 -3
- package/lib-esm/parseAWSExports.d.ts +1 -1
- package/lib-esm/singleton/Auth/index.d.ts +30 -0
- package/lib-esm/singleton/Auth/index.js +129 -0
- package/lib-esm/singleton/Auth/types.d.ts +95 -0
- package/lib-esm/singleton/Auth/types.js +5 -0
- package/lib-esm/singleton/Auth/utils/index.d.ts +5 -0
- package/lib-esm/singleton/Auth/utils/index.js +45 -0
- package/lib-esm/singleton/Storage/types.d.ts +14 -0
- package/lib-esm/singleton/Storage/types.js +3 -0
- package/lib-esm/singleton/index.d.ts +46 -0
- package/lib-esm/singleton/index.js +156 -0
- package/lib-esm/singleton/types.d.ts +21 -0
- package/lib-esm/singleton/types.js +3 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/types.d.ts +31 -1
- package/lib-esm/types/types.js +2 -0
- package/package.json +38 -15
- package/src/Amplify.ts +9 -3
- package/src/AwsClients/CognitoIdentity/base.ts +2 -1
- package/src/AwsClients/CognitoIdentity/getCredentialsForIdentity.ts +13 -6
- package/src/AwsClients/Pinpoint/base.ts +6 -2
- package/src/AwsClients/Pinpoint/getInAppMessages.ts +1 -1
- package/src/AwsClients/Pinpoint/putEvents.ts +6 -0
- package/src/AwsClients/Pinpoint/updateEndpoint.ts +2 -2
- package/src/Cache/AsyncStorageCache.ts +500 -0
- package/src/Cache/BrowserStorageCache.ts +517 -0
- package/src/Cache/CHANGELOG.md +1227 -0
- package/src/Cache/InMemoryCache.ts +354 -0
- package/src/Cache/StorageCache.ts +157 -0
- package/src/Cache/Utils/CacheList.ts +198 -0
- package/src/Cache/Utils/CacheUtils.ts +92 -0
- package/src/Cache/Utils/index.ts +11 -0
- package/src/Cache/reactnative.ts +9 -0
- package/src/Cache/types/Cache.ts +75 -0
- package/src/Cache/types/index.ts +4 -0
- package/src/ClientDevice/android.ts +1 -1
- package/src/ClientDevice/ios.ts +2 -2
- package/src/ClientDevice/reactnative.ts +1 -1
- package/src/Credentials.ts +19 -17
- package/src/Errors.ts +41 -0
- package/src/Hub.ts +1 -0
- package/src/I18n/I18n.ts +40 -12
- package/src/I18n/index.ts +45 -12
- package/src/I18n/types.ts +3 -0
- package/src/JS.ts +24 -17
- package/src/Logger/ConsoleLogger.ts +10 -10
- package/src/OAuthHelper/FacebookOAuth.ts +2 -2
- package/src/OAuthHelper/GoogleOAuth.ts +9 -6
- package/src/Platform/detectFramework.ts +1 -1
- package/src/Platform/detection/React.ts +5 -3
- package/src/Platform/version.ts +1 -1
- package/src/Providers/AWSCloudWatchProvider.ts +39 -14
- package/src/RNComponents/index.ts +1 -1
- package/src/RNComponents/reactnative.ts +1 -1
- package/src/ServiceWorker/ServiceWorker.ts +58 -18
- package/src/Signer.ts +22 -3
- package/src/StorageHelper/cookieStorage.ts +99 -0
- package/src/StorageHelper/inMemoryStorage.ts +32 -0
- package/src/StorageHelper/index.ts +6 -1
- package/src/StorageHelper/localStorage.ts +60 -0
- package/src/StorageHelper/reactnative.ts +94 -14
- package/src/StorageHelper/sessionStorage.ts +60 -0
- package/src/Util/BackgroundProcessManager.ts +33 -9
- package/src/Util/DateUtils.ts +14 -5
- package/src/Util/Reachability.native.ts +3 -2
- package/src/Util/Reachability.ts +9 -7
- package/src/Util/Retry.ts +2 -1
- package/src/Util/StringUtils.ts +3 -10
- package/src/Util/errors/AssertError.ts +11 -0
- package/src/clients/handlers/fetch.ts +2 -2
- package/src/clients/middleware/retry/defaultRetryDecider.ts +12 -6
- package/src/clients/middleware/retry/isClockSkewError.ts +1 -1
- package/src/clients/middleware/retry/middleware.ts +9 -9
- package/src/clients/middleware/signing/middleware.ts +1 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.ts +1 -1
- package/src/clients/serde/responseInfo.ts +2 -1
- package/src/clients/types/aws.ts +10 -0
- package/src/clients/types/index.ts +1 -0
- package/src/constants.ts +16 -0
- package/src/global.d.ts +11 -0
- package/src/index.ts +66 -4
- package/src/parseAWSExports.ts +1 -1
- package/src/singleton/Auth/index.ts +113 -0
- package/src/singleton/Auth/types.ts +129 -0
- package/src/singleton/Auth/utils/index.ts +68 -0
- package/src/singleton/Storage/types.ts +21 -0
- package/src/singleton/index.ts +144 -0
- package/src/singleton/types.ts +48 -0
- package/src/types/types.ts +38 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* double linked list plus a hash table inside
|
|
3
|
+
* each key in the cache stored as a node in the list
|
|
4
|
+
* recently visited node will be rotated to the head
|
|
5
|
+
* so the Last Recently Visited node will be at the tail
|
|
6
|
+
*
|
|
7
|
+
* @member head - dummy head of the linked list
|
|
8
|
+
* @member tail - dummy tail of the linked list
|
|
9
|
+
* @member hashtable - the hashtable which maps cache key to list node
|
|
10
|
+
* @member length - length of the list
|
|
11
|
+
*/
|
|
12
|
+
export default class CacheList {
|
|
13
|
+
private head;
|
|
14
|
+
private tail;
|
|
15
|
+
private hashtable;
|
|
16
|
+
private length;
|
|
17
|
+
/**
|
|
18
|
+
* initialization
|
|
19
|
+
*/
|
|
20
|
+
constructor();
|
|
21
|
+
/**
|
|
22
|
+
* insert node to the head of the list
|
|
23
|
+
*
|
|
24
|
+
* @param node
|
|
25
|
+
*/
|
|
26
|
+
private insertNodeToHead;
|
|
27
|
+
/**
|
|
28
|
+
* remove node
|
|
29
|
+
*
|
|
30
|
+
* @param node
|
|
31
|
+
*/
|
|
32
|
+
private removeNode;
|
|
33
|
+
/**
|
|
34
|
+
* @return true if list is empty
|
|
35
|
+
*/
|
|
36
|
+
isEmpty(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* refresh node so it is rotated to the head
|
|
39
|
+
*
|
|
40
|
+
* @param key - key of the node
|
|
41
|
+
*/
|
|
42
|
+
refresh(key: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* insert new node to the head and add it in the hashtable
|
|
45
|
+
*
|
|
46
|
+
* @param key - the key of the node
|
|
47
|
+
*/
|
|
48
|
+
insertItem(key: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* @return the LAST Recently Visited key
|
|
51
|
+
*/
|
|
52
|
+
getLastItem(): string;
|
|
53
|
+
/**
|
|
54
|
+
* remove the cache key from the list and hashtable
|
|
55
|
+
* @param key - the key of the node
|
|
56
|
+
*/
|
|
57
|
+
removeItem(key: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* @return length of the list
|
|
60
|
+
*/
|
|
61
|
+
getSize(): number;
|
|
62
|
+
/**
|
|
63
|
+
* @return true if the key is in the hashtable
|
|
64
|
+
* @param key
|
|
65
|
+
*/
|
|
66
|
+
containsKey(key: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* clean up the list and hashtable
|
|
69
|
+
*/
|
|
70
|
+
clearList(): void;
|
|
71
|
+
/**
|
|
72
|
+
* @return all keys in the hashtable
|
|
73
|
+
*/
|
|
74
|
+
getKeys(): string[];
|
|
75
|
+
/**
|
|
76
|
+
* mainly for test
|
|
77
|
+
*
|
|
78
|
+
* @param key
|
|
79
|
+
* @return true if key is the head node
|
|
80
|
+
*/
|
|
81
|
+
isHeadNode(key: string): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* mainly for test
|
|
84
|
+
*
|
|
85
|
+
* @param key
|
|
86
|
+
* @return true if key is the tail node
|
|
87
|
+
*/
|
|
88
|
+
isTailNode(key: string): boolean;
|
|
89
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
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 { asserts } from '../../Util/errors/AssertError';
|
|
15
|
+
import { CACHE_LIST_EXCEPTION } from '../../constants';
|
|
16
|
+
var DoubleLinkedNode = /** @class */ (function () {
|
|
17
|
+
function DoubleLinkedNode(keyVal) {
|
|
18
|
+
this.key = keyVal ? keyVal : '';
|
|
19
|
+
this.prevNode = null;
|
|
20
|
+
this.nextNode = null;
|
|
21
|
+
}
|
|
22
|
+
return DoubleLinkedNode;
|
|
23
|
+
}());
|
|
24
|
+
/**
|
|
25
|
+
* double linked list plus a hash table inside
|
|
26
|
+
* each key in the cache stored as a node in the list
|
|
27
|
+
* recently visited node will be rotated to the head
|
|
28
|
+
* so the Last Recently Visited node will be at the tail
|
|
29
|
+
*
|
|
30
|
+
* @member head - dummy head of the linked list
|
|
31
|
+
* @member tail - dummy tail of the linked list
|
|
32
|
+
* @member hashtable - the hashtable which maps cache key to list node
|
|
33
|
+
* @member length - length of the list
|
|
34
|
+
*/
|
|
35
|
+
var CacheList = /** @class */ (function () {
|
|
36
|
+
/**
|
|
37
|
+
* initialization
|
|
38
|
+
*/
|
|
39
|
+
function CacheList() {
|
|
40
|
+
this.head = new DoubleLinkedNode();
|
|
41
|
+
this.tail = new DoubleLinkedNode();
|
|
42
|
+
this.hashtable = {};
|
|
43
|
+
this.length = 0;
|
|
44
|
+
this.head.nextNode = this.tail;
|
|
45
|
+
this.tail.prevNode = this.head;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* insert node to the head of the list
|
|
49
|
+
*
|
|
50
|
+
* @param node
|
|
51
|
+
*/
|
|
52
|
+
CacheList.prototype.insertNodeToHead = function (node) {
|
|
53
|
+
var tmp = this.head.nextNode;
|
|
54
|
+
this.head.nextNode = node;
|
|
55
|
+
node.nextNode = tmp;
|
|
56
|
+
node.prevNode = this.head;
|
|
57
|
+
asserts(tmp !== null, {
|
|
58
|
+
name: CACHE_LIST_EXCEPTION,
|
|
59
|
+
message: 'previous node is null',
|
|
60
|
+
});
|
|
61
|
+
tmp.prevNode = node;
|
|
62
|
+
this.length = this.length + 1;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* remove node
|
|
66
|
+
*
|
|
67
|
+
* @param node
|
|
68
|
+
*/
|
|
69
|
+
CacheList.prototype.removeNode = function (node) {
|
|
70
|
+
asserts(node.prevNode !== null, {
|
|
71
|
+
name: CACHE_LIST_EXCEPTION,
|
|
72
|
+
message: 'previous node is null',
|
|
73
|
+
});
|
|
74
|
+
asserts(node.nextNode !== null, {
|
|
75
|
+
name: CACHE_LIST_EXCEPTION,
|
|
76
|
+
message: 'nextNode node is null',
|
|
77
|
+
});
|
|
78
|
+
node.prevNode.nextNode = node.nextNode;
|
|
79
|
+
node.nextNode.prevNode = node.prevNode;
|
|
80
|
+
node.prevNode = null;
|
|
81
|
+
node.nextNode = null;
|
|
82
|
+
this.length = this.length - 1;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* @return true if list is empty
|
|
86
|
+
*/
|
|
87
|
+
CacheList.prototype.isEmpty = function () {
|
|
88
|
+
return this.length === 0;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* refresh node so it is rotated to the head
|
|
92
|
+
*
|
|
93
|
+
* @param key - key of the node
|
|
94
|
+
*/
|
|
95
|
+
CacheList.prototype.refresh = function (key) {
|
|
96
|
+
var node = this.hashtable[key];
|
|
97
|
+
this.removeNode(node);
|
|
98
|
+
this.insertNodeToHead(node);
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* insert new node to the head and add it in the hashtable
|
|
102
|
+
*
|
|
103
|
+
* @param key - the key of the node
|
|
104
|
+
*/
|
|
105
|
+
CacheList.prototype.insertItem = function (key) {
|
|
106
|
+
var node = new DoubleLinkedNode(key);
|
|
107
|
+
this.hashtable[key] = node;
|
|
108
|
+
this.insertNodeToHead(node);
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* @return the LAST Recently Visited key
|
|
112
|
+
*/
|
|
113
|
+
CacheList.prototype.getLastItem = function () {
|
|
114
|
+
asserts(this.tail.prevNode !== null, {
|
|
115
|
+
name: CACHE_LIST_EXCEPTION,
|
|
116
|
+
message: 'previous node is null',
|
|
117
|
+
});
|
|
118
|
+
return this.tail.prevNode.key;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* remove the cache key from the list and hashtable
|
|
122
|
+
* @param key - the key of the node
|
|
123
|
+
*/
|
|
124
|
+
CacheList.prototype.removeItem = function (key) {
|
|
125
|
+
var removedItem = this.hashtable[key];
|
|
126
|
+
this.removeNode(removedItem);
|
|
127
|
+
delete this.hashtable[key];
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* @return length of the list
|
|
131
|
+
*/
|
|
132
|
+
CacheList.prototype.getSize = function () {
|
|
133
|
+
return this.length;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* @return true if the key is in the hashtable
|
|
137
|
+
* @param key
|
|
138
|
+
*/
|
|
139
|
+
CacheList.prototype.containsKey = function (key) {
|
|
140
|
+
return key in this.hashtable;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* clean up the list and hashtable
|
|
144
|
+
*/
|
|
145
|
+
CacheList.prototype.clearList = function () {
|
|
146
|
+
var e_1, _a;
|
|
147
|
+
try {
|
|
148
|
+
for (var _b = __values(Object.keys(this.hashtable)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
149
|
+
var key = _c.value;
|
|
150
|
+
if (this.hashtable.hasOwnProperty(key)) {
|
|
151
|
+
delete this.hashtable[key];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
156
|
+
finally {
|
|
157
|
+
try {
|
|
158
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
159
|
+
}
|
|
160
|
+
finally { if (e_1) throw e_1.error; }
|
|
161
|
+
}
|
|
162
|
+
this.head.nextNode = this.tail;
|
|
163
|
+
this.tail.prevNode = this.head;
|
|
164
|
+
this.length = 0;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* @return all keys in the hashtable
|
|
168
|
+
*/
|
|
169
|
+
CacheList.prototype.getKeys = function () {
|
|
170
|
+
return Object.keys(this.hashtable);
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* mainly for test
|
|
174
|
+
*
|
|
175
|
+
* @param key
|
|
176
|
+
* @return true if key is the head node
|
|
177
|
+
*/
|
|
178
|
+
CacheList.prototype.isHeadNode = function (key) {
|
|
179
|
+
var node = this.hashtable[key];
|
|
180
|
+
return node.prevNode === this.head;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* mainly for test
|
|
184
|
+
*
|
|
185
|
+
* @param key
|
|
186
|
+
* @return true if key is the tail node
|
|
187
|
+
*/
|
|
188
|
+
CacheList.prototype.isTailNode = function (key) {
|
|
189
|
+
var node = this.hashtable[key];
|
|
190
|
+
return node.nextNode === this.tail;
|
|
191
|
+
};
|
|
192
|
+
return CacheList;
|
|
193
|
+
}());
|
|
194
|
+
export default CacheList;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CacheConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Default cache config
|
|
4
|
+
*/
|
|
5
|
+
export declare const defaultConfig: CacheConfig;
|
|
6
|
+
/**
|
|
7
|
+
* return the byte size of the string
|
|
8
|
+
* @param str
|
|
9
|
+
*/
|
|
10
|
+
export declare function getByteLength(str: string): number;
|
|
11
|
+
/**
|
|
12
|
+
* get current time
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCurrTime(): number;
|
|
15
|
+
/**
|
|
16
|
+
* check if passed value is an integer
|
|
17
|
+
*/
|
|
18
|
+
export declare function isInteger(value?: number): boolean;
|
|
19
|
+
export declare class CacheObject {
|
|
20
|
+
static clear(): void;
|
|
21
|
+
static getItem(key: string): string | null;
|
|
22
|
+
static setItem(key: string, value: string): void;
|
|
23
|
+
static removeItem(key: string): void;
|
|
24
|
+
}
|
|
25
|
+
export declare const getCurrSizeKey: (keyPrefix: string) => string;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { StorageHelper } from '../../StorageHelper';
|
|
4
|
+
/**
|
|
5
|
+
* Default cache config
|
|
6
|
+
*/
|
|
7
|
+
export var defaultConfig = {
|
|
8
|
+
keyPrefix: 'aws-amplify-cache',
|
|
9
|
+
capacityInBytes: 1048576,
|
|
10
|
+
itemMaxSize: 210000,
|
|
11
|
+
defaultTTL: 259200000,
|
|
12
|
+
defaultPriority: 5,
|
|
13
|
+
warningThreshold: 0.8,
|
|
14
|
+
// the storage helper will check if localStorage exists,
|
|
15
|
+
// if not, will use a in-memory object instead
|
|
16
|
+
storage: new StorageHelper().getStorage(),
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* return the byte size of the string
|
|
20
|
+
* @param str
|
|
21
|
+
*/
|
|
22
|
+
export function getByteLength(str) {
|
|
23
|
+
var ret = 0;
|
|
24
|
+
ret = str.length;
|
|
25
|
+
for (var i = str.length; i >= 0; i -= 1) {
|
|
26
|
+
var charCode = str.charCodeAt(i);
|
|
27
|
+
if (charCode > 0x7f && charCode <= 0x7ff) {
|
|
28
|
+
ret += 1;
|
|
29
|
+
}
|
|
30
|
+
else if (charCode > 0x7ff && charCode <= 0xffff) {
|
|
31
|
+
ret += 2;
|
|
32
|
+
}
|
|
33
|
+
// trail surrogate
|
|
34
|
+
if (charCode >= 0xdc00 && charCode <= 0xdfff) {
|
|
35
|
+
i -= 1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return ret;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* get current time
|
|
42
|
+
*/
|
|
43
|
+
export function getCurrTime() {
|
|
44
|
+
var currTime = new Date();
|
|
45
|
+
return currTime.getTime();
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* check if passed value is an integer
|
|
49
|
+
*/
|
|
50
|
+
export function isInteger(value) {
|
|
51
|
+
if (Number.isInteger) {
|
|
52
|
+
return Number.isInteger(value);
|
|
53
|
+
}
|
|
54
|
+
return _isInteger(value);
|
|
55
|
+
}
|
|
56
|
+
function _isInteger(value) {
|
|
57
|
+
return (typeof value === 'number' && isFinite(value) && Math.floor(value) === value);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* provide an object as the in-memory cache
|
|
61
|
+
*/
|
|
62
|
+
var store = {};
|
|
63
|
+
var CacheObject = /** @class */ (function () {
|
|
64
|
+
function CacheObject() {
|
|
65
|
+
}
|
|
66
|
+
CacheObject.clear = function () {
|
|
67
|
+
store = {};
|
|
68
|
+
};
|
|
69
|
+
CacheObject.getItem = function (key) {
|
|
70
|
+
return store[key] || null;
|
|
71
|
+
};
|
|
72
|
+
CacheObject.setItem = function (key, value) {
|
|
73
|
+
store[key] = value;
|
|
74
|
+
};
|
|
75
|
+
CacheObject.removeItem = function (key) {
|
|
76
|
+
delete store[key];
|
|
77
|
+
};
|
|
78
|
+
return CacheObject;
|
|
79
|
+
}());
|
|
80
|
+
export { CacheObject };
|
|
81
|
+
export var getCurrSizeKey = function (keyPrefix) { return keyPrefix + 'CurSize'; };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { Cache, AsyncStorageCache } from './AsyncStorageCache';
|
|
4
|
+
export { AsyncStorageCache };
|
|
5
|
+
// Standard `Cache` export to maintain interoperability with React Native
|
|
6
|
+
export { Cache };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache Interface
|
|
3
|
+
*/
|
|
4
|
+
export interface ICache {
|
|
5
|
+
/** Put item into cache */
|
|
6
|
+
setItem(key: string, value: any, options?: CacheItemOptions): void;
|
|
7
|
+
/** Get item from cache */
|
|
8
|
+
getItem(key: string, options?: CacheItemOptions): any;
|
|
9
|
+
/** Remove item from cache */
|
|
10
|
+
removeItem(key: string): void;
|
|
11
|
+
/** Remove all items from cache */
|
|
12
|
+
clear(): void;
|
|
13
|
+
/** Get all keys form cache */
|
|
14
|
+
getAllKeys(): string[] | Promise<string[]>;
|
|
15
|
+
/** Get current size of the cache */
|
|
16
|
+
getCacheCurSize(): number | Promise<number>;
|
|
17
|
+
/** create a new instance with customized config */
|
|
18
|
+
createInstance(config: CacheConfig): ICache;
|
|
19
|
+
/** change current configuration */
|
|
20
|
+
configure(config: CacheConfig): CacheConfig;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Cache instance options
|
|
24
|
+
*/
|
|
25
|
+
export interface CacheConfig {
|
|
26
|
+
/** Prepend to key to avoid conflicts */
|
|
27
|
+
keyPrefix: string;
|
|
28
|
+
/** Cache capacity, in bytes */
|
|
29
|
+
capacityInBytes: number;
|
|
30
|
+
/** Max size of one item */
|
|
31
|
+
itemMaxSize: number;
|
|
32
|
+
/** Time to live, in milliseconds */
|
|
33
|
+
defaultTTL: number;
|
|
34
|
+
/** Warn when over threshold percentage of capacity, maximum 1 */
|
|
35
|
+
warningThreshold: number;
|
|
36
|
+
/** default priority number put on cached items */
|
|
37
|
+
defaultPriority: number;
|
|
38
|
+
storage?: Storage;
|
|
39
|
+
Cache?: Cache;
|
|
40
|
+
}
|
|
41
|
+
export interface CacheItem {
|
|
42
|
+
key: string;
|
|
43
|
+
data: any;
|
|
44
|
+
timestamp: number;
|
|
45
|
+
visitedTime: number;
|
|
46
|
+
priority: number;
|
|
47
|
+
expires: number;
|
|
48
|
+
type: string;
|
|
49
|
+
byteSize: number;
|
|
50
|
+
}
|
|
51
|
+
export interface CacheItemOptions {
|
|
52
|
+
priority?: number;
|
|
53
|
+
expires?: number;
|
|
54
|
+
callback?: Function;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Cache';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// @ts-ignore: missing type definition
|
|
3
4
|
import { Platform, Dimensions } from 'react-native';
|
|
4
5
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
5
6
|
var logger = new Logger('DeviceInfo');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// @ts-ignore: missing type definition
|
|
3
4
|
import { Platform, Dimensions } from 'react-native';
|
|
4
5
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
5
6
|
var logger = new Logger('DeviceInfo');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// @ts-ignore: missing type definition
|
|
3
4
|
import { Platform } from 'react-native';
|
|
4
5
|
import { clientInfo as iOSClientInfo } from './ios';
|
|
5
6
|
import { clientInfo as androidClientInfo } from './android';
|
package/lib-esm/Credentials.d.ts
CHANGED
package/lib-esm/Credentials.js
CHANGED
|
@@ -45,6 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
+
// @ts-nocheck
|
|
48
49
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
49
50
|
// SPDX-License-Identifier: Apache-2.0
|
|
50
51
|
import { ConsoleLogger as Logger } from './Logger';
|
|
@@ -480,7 +481,7 @@ var CredentialsClass = /** @class */ (function () {
|
|
|
480
481
|
Logins: logins,
|
|
481
482
|
})];
|
|
482
483
|
case 4:
|
|
483
|
-
_a = _c.sent(), _b = _a.Credentials, AccessKeyId = _b.AccessKeyId, Expiration = _b.Expiration, SecretKey = _b.SecretKey, SessionToken = _b.SessionToken, primaryIdentityId = _a.IdentityId;
|
|
484
|
+
_a = (_c.sent()), _b = _a.Credentials, AccessKeyId = _b.AccessKeyId, Expiration = _b.Expiration, SecretKey = _b.SecretKey, SessionToken = _b.SessionToken, primaryIdentityId = _a.IdentityId;
|
|
484
485
|
this._identityId = primaryIdentityId;
|
|
485
486
|
if (!guestIdentityId) return [3 /*break*/, 6];
|
|
486
487
|
// if guestIdentity is found and used by GetCredentialsForIdentity
|
package/lib-esm/Errors.d.ts
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
+
import { ErrorParams } from './types/types';
|
|
1
2
|
export declare function missingConfig(name: string): Error;
|
|
2
3
|
export declare function invalidParameter(name: string): Error;
|
|
4
|
+
export declare enum AmplifyErrorString {
|
|
5
|
+
UNKNOWN = "UnknownError",
|
|
6
|
+
PLATFORM_NOT_SUPPORTED_ERROR = "PlatformNotSupportedError"
|
|
7
|
+
}
|
|
8
|
+
export declare class AmplifyError extends Error {
|
|
9
|
+
underlyingError?: Error | unknown;
|
|
10
|
+
recoverySuggestion?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Constructs an AmplifyError.
|
|
13
|
+
*
|
|
14
|
+
* @param message text that describes the main problem.
|
|
15
|
+
* @param underlyingError the underlying cause of the error.
|
|
16
|
+
* @param recoverySuggestion suggestion to recover from the error.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
constructor({ message, name, recoverySuggestion, underlyingError, }: ErrorParams);
|
|
20
|
+
}
|
|
21
|
+
export declare const PlatformNotSupportedError: AmplifyError;
|
package/lib-esm/Errors.js
CHANGED
|
@@ -1,8 +1,57 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var __extends = (this && this.__extends) || (function () {
|
|
4
|
+
var extendStatics = function (d, b) {
|
|
5
|
+
extendStatics = Object.setPrototypeOf ||
|
|
6
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
|
+
return extendStatics(d, b);
|
|
9
|
+
};
|
|
10
|
+
return function (d, b) {
|
|
11
|
+
if (typeof b !== "function" && b !== null)
|
|
12
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
13
|
+
extendStatics(d, b);
|
|
14
|
+
function __() { this.constructor = d; }
|
|
15
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
|
+
};
|
|
17
|
+
})();
|
|
3
18
|
export function missingConfig(name) {
|
|
4
19
|
return new Error('Missing config value of ' + name);
|
|
5
20
|
}
|
|
6
21
|
export function invalidParameter(name) {
|
|
7
22
|
return new Error('Invalid parameter value of ' + name);
|
|
8
23
|
}
|
|
24
|
+
export var AmplifyErrorString;
|
|
25
|
+
(function (AmplifyErrorString) {
|
|
26
|
+
AmplifyErrorString["UNKNOWN"] = "UnknownError";
|
|
27
|
+
AmplifyErrorString["PLATFORM_NOT_SUPPORTED_ERROR"] = "PlatformNotSupportedError";
|
|
28
|
+
})(AmplifyErrorString || (AmplifyErrorString = {}));
|
|
29
|
+
var AmplifyError = /** @class */ (function (_super) {
|
|
30
|
+
__extends(AmplifyError, _super);
|
|
31
|
+
/**
|
|
32
|
+
* Constructs an AmplifyError.
|
|
33
|
+
*
|
|
34
|
+
* @param message text that describes the main problem.
|
|
35
|
+
* @param underlyingError the underlying cause of the error.
|
|
36
|
+
* @param recoverySuggestion suggestion to recover from the error.
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
function AmplifyError(_a) {
|
|
40
|
+
var message = _a.message, name = _a.name, recoverySuggestion = _a.recoverySuggestion, underlyingError = _a.underlyingError;
|
|
41
|
+
var _this = _super.call(this, message) || this;
|
|
42
|
+
_this.name = name;
|
|
43
|
+
_this.underlyingError = underlyingError;
|
|
44
|
+
_this.recoverySuggestion = recoverySuggestion;
|
|
45
|
+
// Hack for making the custom error class work when transpiled to es5
|
|
46
|
+
// TODO: Delete the following 2 lines after we change the build target to >= es2015
|
|
47
|
+
_this.constructor = AmplifyError;
|
|
48
|
+
Object.setPrototypeOf(_this, AmplifyError.prototype);
|
|
49
|
+
return _this;
|
|
50
|
+
}
|
|
51
|
+
return AmplifyError;
|
|
52
|
+
}(Error));
|
|
53
|
+
export { AmplifyError };
|
|
54
|
+
export var PlatformNotSupportedError = new AmplifyError({
|
|
55
|
+
name: AmplifyErrorString.PLATFORM_NOT_SUPPORTED_ERROR,
|
|
56
|
+
message: 'Function not supported on current platform',
|
|
57
|
+
});
|
package/lib-esm/Hub.js
CHANGED