@aws-amplify/core 5.8.2 → 6.0.1-console-preview.f63250a.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 +147 -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 +143 -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 +131 -0
- package/src/singleton/types.ts +48 -0
- package/src/types/types.ts +38 -1
package/lib-esm/I18n/I18n.d.ts
CHANGED
|
@@ -1,30 +1,42 @@
|
|
|
1
1
|
import { I18nOptions } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* Language
|
|
3
|
+
* Language translation utility.
|
|
4
|
+
*
|
|
5
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
4
6
|
*/
|
|
5
7
|
export declare class I18n {
|
|
6
8
|
/**
|
|
7
9
|
* @private
|
|
8
10
|
*/
|
|
9
|
-
_options: I18nOptions;
|
|
11
|
+
_options: I18nOptions | null;
|
|
10
12
|
/**
|
|
11
13
|
* @private
|
|
12
14
|
*/
|
|
13
|
-
_lang
|
|
15
|
+
_lang?: string | null;
|
|
14
16
|
/**
|
|
15
17
|
* @private
|
|
16
18
|
*/
|
|
17
|
-
_dict:
|
|
19
|
+
_dict: Record<string, any>;
|
|
18
20
|
/**
|
|
19
21
|
* @constructor
|
|
20
22
|
* Initialize with configurations
|
|
21
23
|
* @param {Object} options
|
|
24
|
+
*
|
|
25
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
22
26
|
*/
|
|
23
|
-
constructor(
|
|
27
|
+
constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Sets the default language from the configuration when required.
|
|
30
|
+
*
|
|
31
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
32
|
+
*/
|
|
33
|
+
setDefaultLanguage(): void;
|
|
24
34
|
/**
|
|
25
35
|
* @method
|
|
26
36
|
* Explicitly setting language
|
|
27
37
|
* @param {String} lang
|
|
38
|
+
*
|
|
39
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
28
40
|
*/
|
|
29
41
|
setLanguage(lang: string): void;
|
|
30
42
|
/**
|
|
@@ -32,28 +44,36 @@ export declare class I18n {
|
|
|
32
44
|
* Get value
|
|
33
45
|
* @param {String} key
|
|
34
46
|
* @param {String} defVal - Default value
|
|
47
|
+
*
|
|
48
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
35
49
|
*/
|
|
36
|
-
get(key:
|
|
50
|
+
get(key: string, defVal?: string | undefined): any;
|
|
37
51
|
/**
|
|
38
52
|
* @method
|
|
39
53
|
* Get value according to specified language
|
|
40
54
|
* @param {String} key
|
|
41
55
|
* @param {String} language - Specified langurage to be used
|
|
42
56
|
* @param {String} defVal - Default value
|
|
57
|
+
*
|
|
58
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
43
59
|
*/
|
|
44
|
-
getByLanguage(key:
|
|
60
|
+
getByLanguage(key: string, language: string, defVal?: string | null): any;
|
|
45
61
|
/**
|
|
46
62
|
* @method
|
|
47
63
|
* Add vocabularies for one language
|
|
48
64
|
* @param {String} language - Language of the dictionary
|
|
49
65
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
66
|
+
*
|
|
67
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
50
68
|
*/
|
|
51
|
-
putVocabulariesForLanguage(language:
|
|
69
|
+
putVocabulariesForLanguage(language: string, vocabularies: Record<string, any>): void;
|
|
52
70
|
/**
|
|
53
71
|
* @method
|
|
54
72
|
* Add vocabularies for one language
|
|
55
73
|
* @param {Object} vocabularies - Object that has language as key,
|
|
56
74
|
* vocabularies of each language as value
|
|
75
|
+
*
|
|
76
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
57
77
|
*/
|
|
58
|
-
putVocabularies(vocabularies: any): void;
|
|
78
|
+
putVocabularies(vocabularies: Record<string, any>): void;
|
|
59
79
|
}
|
package/lib-esm/I18n/I18n.js
CHANGED
|
@@ -12,17 +12,22 @@ 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 { AmplifyV6 } from '../singleton';
|
|
15
16
|
var logger = new Logger('I18n');
|
|
16
17
|
/**
|
|
17
|
-
* Language
|
|
18
|
+
* Language translation utility.
|
|
19
|
+
*
|
|
20
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
18
21
|
*/
|
|
19
22
|
var I18n = /** @class */ (function () {
|
|
20
23
|
/**
|
|
21
24
|
* @constructor
|
|
22
25
|
* Initialize with configurations
|
|
23
26
|
* @param {Object} options
|
|
27
|
+
*
|
|
28
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
24
29
|
*/
|
|
25
|
-
function I18n(
|
|
30
|
+
function I18n() {
|
|
26
31
|
/**
|
|
27
32
|
* @private
|
|
28
33
|
*/
|
|
@@ -35,8 +40,18 @@ var I18n = /** @class */ (function () {
|
|
|
35
40
|
* @private
|
|
36
41
|
*/
|
|
37
42
|
this._dict = {};
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Sets the default language from the configuration when required.
|
|
46
|
+
*
|
|
47
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
48
|
+
*/
|
|
49
|
+
I18n.prototype.setDefaultLanguage = function () {
|
|
50
|
+
if (!this._lang) {
|
|
51
|
+
var i18nConfig = AmplifyV6.getConfig().I18n;
|
|
52
|
+
this._lang = i18nConfig === null || i18nConfig === void 0 ? void 0 : i18nConfig.language;
|
|
53
|
+
}
|
|
54
|
+
// Default to window language if not set in config
|
|
40
55
|
if (!this._lang &&
|
|
41
56
|
typeof window !== 'undefined' &&
|
|
42
57
|
window &&
|
|
@@ -44,11 +59,13 @@ var I18n = /** @class */ (function () {
|
|
|
44
59
|
this._lang = window.navigator.language;
|
|
45
60
|
}
|
|
46
61
|
logger.debug(this._lang);
|
|
47
|
-
}
|
|
62
|
+
};
|
|
48
63
|
/**
|
|
49
64
|
* @method
|
|
50
65
|
* Explicitly setting language
|
|
51
66
|
* @param {String} lang
|
|
67
|
+
*
|
|
68
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
52
69
|
*/
|
|
53
70
|
I18n.prototype.setLanguage = function (lang) {
|
|
54
71
|
this._lang = lang;
|
|
@@ -58,6 +75,8 @@ var I18n = /** @class */ (function () {
|
|
|
58
75
|
* Get value
|
|
59
76
|
* @param {String} key
|
|
60
77
|
* @param {String} defVal - Default value
|
|
78
|
+
*
|
|
79
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
61
80
|
*/
|
|
62
81
|
I18n.prototype.get = function (key, defVal) {
|
|
63
82
|
if (defVal === void 0) { defVal = undefined; }
|
|
@@ -83,6 +102,8 @@ var I18n = /** @class */ (function () {
|
|
|
83
102
|
* @param {String} key
|
|
84
103
|
* @param {String} language - Specified langurage to be used
|
|
85
104
|
* @param {String} defVal - Default value
|
|
105
|
+
*
|
|
106
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
86
107
|
*/
|
|
87
108
|
I18n.prototype.getByLanguage = function (key, language, defVal) {
|
|
88
109
|
if (defVal === void 0) { defVal = null; }
|
|
@@ -100,6 +121,8 @@ var I18n = /** @class */ (function () {
|
|
|
100
121
|
* Add vocabularies for one language
|
|
101
122
|
* @param {String} language - Language of the dictionary
|
|
102
123
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
124
|
+
*
|
|
125
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
103
126
|
*/
|
|
104
127
|
I18n.prototype.putVocabulariesForLanguage = function (language, vocabularies) {
|
|
105
128
|
var lang_dict = this._dict[language];
|
|
@@ -113,6 +136,8 @@ var I18n = /** @class */ (function () {
|
|
|
113
136
|
* Add vocabularies for one language
|
|
114
137
|
* @param {Object} vocabularies - Object that has language as key,
|
|
115
138
|
* vocabularies of each language as value
|
|
139
|
+
*
|
|
140
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
116
141
|
*/
|
|
117
142
|
I18n.prototype.putVocabularies = function (vocabularies) {
|
|
118
143
|
var _this = this;
|
package/lib-esm/I18n/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { I18nOptions } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* Export I18n APIs
|
|
4
|
+
*
|
|
5
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
3
6
|
*/
|
|
4
7
|
export declare class I18n {
|
|
5
8
|
/**
|
|
@@ -8,42 +11,52 @@ export declare class I18n {
|
|
|
8
11
|
* Configure I18n part
|
|
9
12
|
* @param {Object} config - Configuration of the I18n
|
|
10
13
|
*/
|
|
11
|
-
static configure(config: any):
|
|
14
|
+
static configure(config: Record<string, any>): I18nOptions;
|
|
12
15
|
static getModuleName(): string;
|
|
13
16
|
/**
|
|
14
17
|
* @static
|
|
15
18
|
* @method
|
|
16
19
|
* Create an instance of I18n for the library
|
|
20
|
+
*
|
|
21
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
17
22
|
*/
|
|
18
23
|
static createInstance(): void;
|
|
19
24
|
/**
|
|
20
25
|
* @static @method
|
|
21
26
|
* Explicitly setting language
|
|
22
27
|
* @param {String} lang
|
|
28
|
+
*
|
|
29
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
23
30
|
*/
|
|
24
|
-
static setLanguage(lang:
|
|
31
|
+
static setLanguage(lang: string): void;
|
|
25
32
|
/**
|
|
26
33
|
* @static @method
|
|
27
34
|
* Get value
|
|
28
35
|
* @param {String} key
|
|
29
36
|
* @param {String} defVal - Default value
|
|
37
|
+
*
|
|
38
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
30
39
|
*/
|
|
31
|
-
static get(key:
|
|
40
|
+
static get(key: string, defVal?: string): any;
|
|
32
41
|
/**
|
|
33
42
|
* @static
|
|
34
43
|
* @method
|
|
35
44
|
* Add vocabularies for one language
|
|
36
45
|
* @param {String} langurage - Language of the dictionary
|
|
37
46
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
47
|
+
*
|
|
48
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
38
49
|
*/
|
|
39
|
-
static putVocabulariesForLanguage(language:
|
|
50
|
+
static putVocabulariesForLanguage(language: string, vocabularies: Record<string, string>): void;
|
|
40
51
|
/**
|
|
41
52
|
* @static
|
|
42
53
|
* @method
|
|
43
54
|
* Add vocabularies for one language
|
|
44
55
|
* @param {Object} vocabularies - Object that has language as key,
|
|
45
56
|
* vocabularies of each language as value
|
|
57
|
+
*
|
|
58
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
46
59
|
*/
|
|
47
|
-
static putVocabularies(vocabularies:
|
|
60
|
+
static putVocabularies(vocabularies: Record<string, string>): void;
|
|
48
61
|
static checkConfig(): boolean;
|
|
49
62
|
}
|
package/lib-esm/I18n/index.js
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { I18n as I18nClass } from './I18n';
|
|
4
4
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
5
|
-
import {
|
|
5
|
+
import { asserts } from '../Util/errors/AssertError';
|
|
6
|
+
import { I18N_EXCEPTION } from '../constants';
|
|
6
7
|
var logger = new Logger('I18n');
|
|
7
|
-
var _config = null;
|
|
8
|
+
var _config = { language: null };
|
|
8
9
|
var _i18n = null;
|
|
9
10
|
/**
|
|
10
11
|
* Export I18n APIs
|
|
12
|
+
*
|
|
13
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
11
14
|
*/
|
|
12
15
|
var I18n = /** @class */ (function () {
|
|
13
16
|
function I18n() {
|
|
@@ -34,21 +37,29 @@ var I18n = /** @class */ (function () {
|
|
|
34
37
|
* @static
|
|
35
38
|
* @method
|
|
36
39
|
* Create an instance of I18n for the library
|
|
40
|
+
*
|
|
41
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
37
42
|
*/
|
|
38
43
|
I18n.createInstance = function () {
|
|
39
44
|
logger.debug('create I18n instance');
|
|
40
45
|
if (_i18n) {
|
|
41
46
|
return;
|
|
42
47
|
}
|
|
43
|
-
_i18n = new I18nClass(
|
|
48
|
+
_i18n = new I18nClass();
|
|
44
49
|
};
|
|
45
50
|
/**
|
|
46
51
|
* @static @method
|
|
47
52
|
* Explicitly setting language
|
|
48
53
|
* @param {String} lang
|
|
54
|
+
*
|
|
55
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
49
56
|
*/
|
|
50
57
|
I18n.setLanguage = function (lang) {
|
|
51
58
|
I18n.checkConfig();
|
|
59
|
+
asserts(!!_i18n, {
|
|
60
|
+
name: I18N_EXCEPTION,
|
|
61
|
+
message: 'I18N is not configured',
|
|
62
|
+
});
|
|
52
63
|
return _i18n.setLanguage(lang);
|
|
53
64
|
};
|
|
54
65
|
/**
|
|
@@ -56,11 +67,17 @@ var I18n = /** @class */ (function () {
|
|
|
56
67
|
* Get value
|
|
57
68
|
* @param {String} key
|
|
58
69
|
* @param {String} defVal - Default value
|
|
70
|
+
*
|
|
71
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
59
72
|
*/
|
|
60
73
|
I18n.get = function (key, defVal) {
|
|
61
74
|
if (!I18n.checkConfig()) {
|
|
62
75
|
return typeof defVal === 'undefined' ? key : defVal;
|
|
63
76
|
}
|
|
77
|
+
asserts(!!_i18n, {
|
|
78
|
+
name: I18N_EXCEPTION,
|
|
79
|
+
message: 'I18N is not configured',
|
|
80
|
+
});
|
|
64
81
|
return _i18n.get(key, defVal);
|
|
65
82
|
};
|
|
66
83
|
/**
|
|
@@ -69,9 +86,15 @@ var I18n = /** @class */ (function () {
|
|
|
69
86
|
* Add vocabularies for one language
|
|
70
87
|
* @param {String} langurage - Language of the dictionary
|
|
71
88
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
89
|
+
*
|
|
90
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
72
91
|
*/
|
|
73
92
|
I18n.putVocabulariesForLanguage = function (language, vocabularies) {
|
|
74
93
|
I18n.checkConfig();
|
|
94
|
+
asserts(!!_i18n, {
|
|
95
|
+
name: I18N_EXCEPTION,
|
|
96
|
+
message: 'I18N is not configured',
|
|
97
|
+
});
|
|
75
98
|
return _i18n.putVocabulariesForLanguage(language, vocabularies);
|
|
76
99
|
};
|
|
77
100
|
/**
|
|
@@ -80,18 +103,25 @@ var I18n = /** @class */ (function () {
|
|
|
80
103
|
* Add vocabularies for one language
|
|
81
104
|
* @param {Object} vocabularies - Object that has language as key,
|
|
82
105
|
* vocabularies of each language as value
|
|
106
|
+
*
|
|
107
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
83
108
|
*/
|
|
84
109
|
I18n.putVocabularies = function (vocabularies) {
|
|
85
110
|
I18n.checkConfig();
|
|
111
|
+
asserts(!!_i18n, {
|
|
112
|
+
name: I18N_EXCEPTION,
|
|
113
|
+
message: 'I18N is not configured',
|
|
114
|
+
});
|
|
86
115
|
return _i18n.putVocabularies(vocabularies);
|
|
87
116
|
};
|
|
88
117
|
I18n.checkConfig = function () {
|
|
89
118
|
if (!_i18n) {
|
|
90
|
-
|
|
119
|
+
I18n.createInstance();
|
|
91
120
|
}
|
|
92
121
|
return true;
|
|
93
122
|
};
|
|
94
123
|
return I18n;
|
|
95
124
|
}());
|
|
96
125
|
export { I18n };
|
|
97
|
-
|
|
126
|
+
// Create an instance of I18n in the static class
|
|
127
|
+
I18n.createInstance();
|
package/lib-esm/I18n/types.d.ts
CHANGED
package/lib-esm/I18n/types.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
5
|
+
*/
|
|
3
6
|
var I18nOptions = /** @class */ (function () {
|
|
4
7
|
function I18nOptions() {
|
|
5
8
|
this.language = null;
|
package/lib-esm/JS.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const isEmpty: (obj?: {}) => boolean;
|
|
2
|
-
export declare const sortByField: (list: any, field:
|
|
3
|
-
export declare const objectLessAttributes: (obj:
|
|
4
|
-
export declare const filenameToContentType: (filename:
|
|
5
|
-
export declare const isTextFile: (contentType:
|
|
2
|
+
export declare const sortByField: (list: any[], field: string | number, dir: string) => boolean;
|
|
3
|
+
export declare const objectLessAttributes: (obj: Record<string, any>, less: string | string[]) => Record<string, any>;
|
|
4
|
+
export declare const filenameToContentType: (filename: string, defVal?: string) => string;
|
|
5
|
+
export declare const isTextFile: (contentType: string) => boolean;
|
|
6
6
|
export declare const generateRandomString: () => string;
|
|
7
7
|
export declare const makeQuerablePromise: (promise: any) => any;
|
|
8
8
|
export declare const isWebWorker: () => boolean;
|
|
@@ -16,14 +16,14 @@ export declare const browserOrNode: () => {
|
|
|
16
16
|
* @param {Array} whiteListForItself - whitelist itself from being transferred
|
|
17
17
|
* @param {Array} whiteListForChildren - whitelist its children keys from being transferred
|
|
18
18
|
*/
|
|
19
|
-
export declare const transferKeyToLowerCase: (obj:
|
|
19
|
+
export declare const transferKeyToLowerCase: (obj: Record<string, any>, whiteListForItself?: string[], whiteListForChildren?: string[]) => Record<string, any>;
|
|
20
20
|
/**
|
|
21
21
|
* transfer the first letter of the keys to lowercase
|
|
22
22
|
* @param {Object} obj - the object need to be transferred
|
|
23
23
|
* @param {Array} whiteListForItself - whitelist itself from being transferred
|
|
24
24
|
* @param {Array} whiteListForChildren - whitelist its children keys from being transferred
|
|
25
25
|
*/
|
|
26
|
-
export declare const transferKeyToUpperCase: (obj:
|
|
26
|
+
export declare const transferKeyToUpperCase: (obj: Record<string, any>, whiteListForItself?: string[], whiteListForChildren?: string[]) => Record<string, any>;
|
|
27
27
|
/**
|
|
28
28
|
* Return true if the object is a strict object
|
|
29
29
|
* which means it's not Array, Function, Number, String, Boolean or Null
|
|
@@ -15,16 +15,16 @@ export declare class ConsoleLogger implements Logger {
|
|
|
15
15
|
name: string;
|
|
16
16
|
level: LOG_TYPE | string;
|
|
17
17
|
private _pluggables;
|
|
18
|
-
private _config
|
|
18
|
+
private _config?;
|
|
19
19
|
/**
|
|
20
20
|
* @constructor
|
|
21
21
|
* @param {string} name - Name of the logger
|
|
22
22
|
*/
|
|
23
23
|
constructor(name: string, level?: LOG_TYPE | string);
|
|
24
|
-
static LOG_LEVEL:
|
|
25
|
-
_padding(n:
|
|
24
|
+
static LOG_LEVEL: null;
|
|
25
|
+
_padding(n: number): string;
|
|
26
26
|
_ts(): string;
|
|
27
|
-
configure(config?: object): object;
|
|
27
|
+
configure(config?: object): object | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* Write log
|
|
30
30
|
* @method
|
|
@@ -32,49 +32,49 @@ export declare class ConsoleLogger implements Logger {
|
|
|
32
32
|
* @param {LOG_TYPE|string} type - log type, default INFO
|
|
33
33
|
* @param {string|object} msg - Logging message or object
|
|
34
34
|
*/
|
|
35
|
-
_log(type: LOG_TYPE | string, ...msg: any
|
|
35
|
+
_log(type: LOG_TYPE | string, ...msg: any): void;
|
|
36
36
|
/**
|
|
37
37
|
* Write General log. Default to INFO
|
|
38
38
|
* @method
|
|
39
39
|
* @memeberof Logger
|
|
40
40
|
* @param {string|object} msg - Logging message or object
|
|
41
41
|
*/
|
|
42
|
-
log(...msg: any
|
|
42
|
+
log(...msg: any): void;
|
|
43
43
|
/**
|
|
44
44
|
* Write INFO log
|
|
45
45
|
* @method
|
|
46
46
|
* @memeberof Logger
|
|
47
47
|
* @param {string|object} msg - Logging message or object
|
|
48
48
|
*/
|
|
49
|
-
info(...msg: any
|
|
49
|
+
info(...msg: any): void;
|
|
50
50
|
/**
|
|
51
51
|
* Write WARN log
|
|
52
52
|
* @method
|
|
53
53
|
* @memeberof Logger
|
|
54
54
|
* @param {string|object} msg - Logging message or object
|
|
55
55
|
*/
|
|
56
|
-
warn(...msg: any
|
|
56
|
+
warn(...msg: any): void;
|
|
57
57
|
/**
|
|
58
58
|
* Write ERROR log
|
|
59
59
|
* @method
|
|
60
60
|
* @memeberof Logger
|
|
61
61
|
* @param {string|object} msg - Logging message or object
|
|
62
62
|
*/
|
|
63
|
-
error(...msg: any
|
|
63
|
+
error(...msg: any): void;
|
|
64
64
|
/**
|
|
65
65
|
* Write DEBUG log
|
|
66
66
|
* @method
|
|
67
67
|
* @memeberof Logger
|
|
68
68
|
* @param {string|object} msg - Logging message or object
|
|
69
69
|
*/
|
|
70
|
-
debug(...msg: any
|
|
70
|
+
debug(...msg: any): void;
|
|
71
71
|
/**
|
|
72
72
|
* Write VERBOSE log
|
|
73
73
|
* @method
|
|
74
74
|
* @memeberof Logger
|
|
75
75
|
* @param {string|object} msg - Logging message or object
|
|
76
76
|
*/
|
|
77
|
-
verbose(...msg: any
|
|
77
|
+
verbose(...msg: any): void;
|
|
78
78
|
addPluggable(pluggable: LoggingProvider): void;
|
|
79
79
|
listPluggables(): LoggingProvider[];
|
|
80
80
|
}
|
|
@@ -106,7 +106,8 @@ var GoogleOAuth = /** @class */ (function () {
|
|
|
106
106
|
res({ token: id_token, expires_at: expires_at });
|
|
107
107
|
})
|
|
108
108
|
.catch(function (err) {
|
|
109
|
-
if (err &&
|
|
109
|
+
if (err &&
|
|
110
|
+
err.error === 'network_error') {
|
|
110
111
|
// Not using NonRetryableError so handler will be retried
|
|
111
112
|
rej('Network error reloading google auth response');
|
|
112
113
|
}
|
|
@@ -11,6 +11,7 @@ var SSR_RESET_TIMEOUT = 10; // ms
|
|
|
11
11
|
var WEB_RESET_TIMEOUT = 10; // ms
|
|
12
12
|
var PRIME_FRAMEWORK_DELAY = 1000; // ms
|
|
13
13
|
export var detectFramework = function () {
|
|
14
|
+
var _a;
|
|
14
15
|
if (!frameworkCache) {
|
|
15
16
|
frameworkCache = detect();
|
|
16
17
|
if (resetTriggered) {
|
|
@@ -19,7 +20,7 @@ export var detectFramework = function () {
|
|
|
19
20
|
// So we don't need to notify the observers again so the observer
|
|
20
21
|
// can be removed after the final notice.
|
|
21
22
|
while (frameworkChangeObservers.length) {
|
|
22
|
-
frameworkChangeObservers.pop()();
|
|
23
|
+
(_a = frameworkChangeObservers.pop()) === null || _a === void 0 ? void 0 : _a();
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
else {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function nextWebDetect():
|
|
1
|
+
export declare function nextWebDetect(): any;
|
|
2
2
|
export declare function nextSSRDetect(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "
|
|
1
|
+
export declare const version = "6.0.1-console-preview.f63250a.0+f63250a";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export var version = '
|
|
2
|
+
export var version = '6.0.1-console-preview.f63250a.0+f63250a';
|
|
@@ -3,10 +3,10 @@ import { AWSCloudWatchProviderOptions, LoggingProvider } from '../types/types';
|
|
|
3
3
|
declare class AWSCloudWatchProvider implements LoggingProvider {
|
|
4
4
|
static readonly PROVIDER_NAME = "AWSCloudWatch";
|
|
5
5
|
static readonly CATEGORY = "Logging";
|
|
6
|
-
private _config
|
|
6
|
+
private _config?;
|
|
7
7
|
private _dataTracker;
|
|
8
8
|
private _currentLogBatch;
|
|
9
|
-
private _timer
|
|
9
|
+
private _timer?;
|
|
10
10
|
private _nextSequenceToken;
|
|
11
11
|
constructor(config?: AWSCloudWatchProviderOptions);
|
|
12
12
|
getProviderName(): string;
|