@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/Hub.js
CHANGED
package/lib/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/I18n/I18n.js
CHANGED
|
@@ -15,17 +15,22 @@ var __assign = (this && this.__assign) || function () {
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.I18n = void 0;
|
|
17
17
|
var Logger_1 = require("../Logger");
|
|
18
|
+
var singleton_1 = require("../singleton");
|
|
18
19
|
var logger = new Logger_1.ConsoleLogger('I18n');
|
|
19
20
|
/**
|
|
20
|
-
* Language
|
|
21
|
+
* Language translation utility.
|
|
22
|
+
*
|
|
23
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
21
24
|
*/
|
|
22
25
|
var I18n = /** @class */ (function () {
|
|
23
26
|
/**
|
|
24
27
|
* @constructor
|
|
25
28
|
* Initialize with configurations
|
|
26
29
|
* @param {Object} options
|
|
30
|
+
*
|
|
31
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
27
32
|
*/
|
|
28
|
-
function I18n(
|
|
33
|
+
function I18n() {
|
|
29
34
|
/**
|
|
30
35
|
* @private
|
|
31
36
|
*/
|
|
@@ -38,8 +43,18 @@ var I18n = /** @class */ (function () {
|
|
|
38
43
|
* @private
|
|
39
44
|
*/
|
|
40
45
|
this._dict = {};
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Sets the default language from the configuration when required.
|
|
49
|
+
*
|
|
50
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
51
|
+
*/
|
|
52
|
+
I18n.prototype.setDefaultLanguage = function () {
|
|
53
|
+
if (!this._lang) {
|
|
54
|
+
var i18nConfig = singleton_1.AmplifyV6.getConfig().I18n;
|
|
55
|
+
this._lang = i18nConfig === null || i18nConfig === void 0 ? void 0 : i18nConfig.language;
|
|
56
|
+
}
|
|
57
|
+
// Default to window language if not set in config
|
|
43
58
|
if (!this._lang &&
|
|
44
59
|
typeof window !== 'undefined' &&
|
|
45
60
|
window &&
|
|
@@ -47,11 +62,13 @@ var I18n = /** @class */ (function () {
|
|
|
47
62
|
this._lang = window.navigator.language;
|
|
48
63
|
}
|
|
49
64
|
logger.debug(this._lang);
|
|
50
|
-
}
|
|
65
|
+
};
|
|
51
66
|
/**
|
|
52
67
|
* @method
|
|
53
68
|
* Explicitly setting language
|
|
54
69
|
* @param {String} lang
|
|
70
|
+
*
|
|
71
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
55
72
|
*/
|
|
56
73
|
I18n.prototype.setLanguage = function (lang) {
|
|
57
74
|
this._lang = lang;
|
|
@@ -61,6 +78,8 @@ var I18n = /** @class */ (function () {
|
|
|
61
78
|
* Get value
|
|
62
79
|
* @param {String} key
|
|
63
80
|
* @param {String} defVal - Default value
|
|
81
|
+
*
|
|
82
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
64
83
|
*/
|
|
65
84
|
I18n.prototype.get = function (key, defVal) {
|
|
66
85
|
if (defVal === void 0) { defVal = undefined; }
|
|
@@ -86,6 +105,8 @@ var I18n = /** @class */ (function () {
|
|
|
86
105
|
* @param {String} key
|
|
87
106
|
* @param {String} language - Specified langurage to be used
|
|
88
107
|
* @param {String} defVal - Default value
|
|
108
|
+
*
|
|
109
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
89
110
|
*/
|
|
90
111
|
I18n.prototype.getByLanguage = function (key, language, defVal) {
|
|
91
112
|
if (defVal === void 0) { defVal = null; }
|
|
@@ -103,6 +124,8 @@ var I18n = /** @class */ (function () {
|
|
|
103
124
|
* Add vocabularies for one language
|
|
104
125
|
* @param {String} language - Language of the dictionary
|
|
105
126
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
127
|
+
*
|
|
128
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
106
129
|
*/
|
|
107
130
|
I18n.prototype.putVocabulariesForLanguage = function (language, vocabularies) {
|
|
108
131
|
var lang_dict = this._dict[language];
|
|
@@ -116,6 +139,8 @@ var I18n = /** @class */ (function () {
|
|
|
116
139
|
* Add vocabularies for one language
|
|
117
140
|
* @param {Object} vocabularies - Object that has language as key,
|
|
118
141
|
* vocabularies of each language as value
|
|
142
|
+
*
|
|
143
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
119
144
|
*/
|
|
120
145
|
I18n.prototype.putVocabularies = function (vocabularies) {
|
|
121
146
|
var _this = this;
|
package/lib/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/I18n/index.js
CHANGED
|
@@ -5,12 +5,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.I18n = void 0;
|
|
6
6
|
var I18n_1 = require("./I18n");
|
|
7
7
|
var Logger_1 = require("../Logger");
|
|
8
|
-
var
|
|
8
|
+
var AssertError_1 = require("../Util/errors/AssertError");
|
|
9
|
+
var constants_1 = require("../constants");
|
|
9
10
|
var logger = new Logger_1.ConsoleLogger('I18n');
|
|
10
|
-
var _config = null;
|
|
11
|
+
var _config = { language: null };
|
|
11
12
|
var _i18n = null;
|
|
12
13
|
/**
|
|
13
14
|
* Export I18n APIs
|
|
15
|
+
*
|
|
16
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
14
17
|
*/
|
|
15
18
|
var I18n = /** @class */ (function () {
|
|
16
19
|
function I18n() {
|
|
@@ -37,21 +40,29 @@ var I18n = /** @class */ (function () {
|
|
|
37
40
|
* @static
|
|
38
41
|
* @method
|
|
39
42
|
* Create an instance of I18n for the library
|
|
43
|
+
*
|
|
44
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
40
45
|
*/
|
|
41
46
|
I18n.createInstance = function () {
|
|
42
47
|
logger.debug('create I18n instance');
|
|
43
48
|
if (_i18n) {
|
|
44
49
|
return;
|
|
45
50
|
}
|
|
46
|
-
_i18n = new I18n_1.I18n(
|
|
51
|
+
_i18n = new I18n_1.I18n();
|
|
47
52
|
};
|
|
48
53
|
/**
|
|
49
54
|
* @static @method
|
|
50
55
|
* Explicitly setting language
|
|
51
56
|
* @param {String} lang
|
|
57
|
+
*
|
|
58
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
52
59
|
*/
|
|
53
60
|
I18n.setLanguage = function (lang) {
|
|
54
61
|
I18n.checkConfig();
|
|
62
|
+
(0, AssertError_1.asserts)(!!_i18n, {
|
|
63
|
+
name: constants_1.I18N_EXCEPTION,
|
|
64
|
+
message: 'I18N is not configured',
|
|
65
|
+
});
|
|
55
66
|
return _i18n.setLanguage(lang);
|
|
56
67
|
};
|
|
57
68
|
/**
|
|
@@ -59,11 +70,17 @@ var I18n = /** @class */ (function () {
|
|
|
59
70
|
* Get value
|
|
60
71
|
* @param {String} key
|
|
61
72
|
* @param {String} defVal - Default value
|
|
73
|
+
*
|
|
74
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
62
75
|
*/
|
|
63
76
|
I18n.get = function (key, defVal) {
|
|
64
77
|
if (!I18n.checkConfig()) {
|
|
65
78
|
return typeof defVal === 'undefined' ? key : defVal;
|
|
66
79
|
}
|
|
80
|
+
(0, AssertError_1.asserts)(!!_i18n, {
|
|
81
|
+
name: constants_1.I18N_EXCEPTION,
|
|
82
|
+
message: 'I18N is not configured',
|
|
83
|
+
});
|
|
67
84
|
return _i18n.get(key, defVal);
|
|
68
85
|
};
|
|
69
86
|
/**
|
|
@@ -72,9 +89,15 @@ var I18n = /** @class */ (function () {
|
|
|
72
89
|
* Add vocabularies for one language
|
|
73
90
|
* @param {String} langurage - Language of the dictionary
|
|
74
91
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
92
|
+
*
|
|
93
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
75
94
|
*/
|
|
76
95
|
I18n.putVocabulariesForLanguage = function (language, vocabularies) {
|
|
77
96
|
I18n.checkConfig();
|
|
97
|
+
(0, AssertError_1.asserts)(!!_i18n, {
|
|
98
|
+
name: constants_1.I18N_EXCEPTION,
|
|
99
|
+
message: 'I18N is not configured',
|
|
100
|
+
});
|
|
78
101
|
return _i18n.putVocabulariesForLanguage(language, vocabularies);
|
|
79
102
|
};
|
|
80
103
|
/**
|
|
@@ -83,18 +106,25 @@ var I18n = /** @class */ (function () {
|
|
|
83
106
|
* Add vocabularies for one language
|
|
84
107
|
* @param {Object} vocabularies - Object that has language as key,
|
|
85
108
|
* vocabularies of each language as value
|
|
109
|
+
*
|
|
110
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
86
111
|
*/
|
|
87
112
|
I18n.putVocabularies = function (vocabularies) {
|
|
88
113
|
I18n.checkConfig();
|
|
114
|
+
(0, AssertError_1.asserts)(!!_i18n, {
|
|
115
|
+
name: constants_1.I18N_EXCEPTION,
|
|
116
|
+
message: 'I18N is not configured',
|
|
117
|
+
});
|
|
89
118
|
return _i18n.putVocabularies(vocabularies);
|
|
90
119
|
};
|
|
91
120
|
I18n.checkConfig = function () {
|
|
92
121
|
if (!_i18n) {
|
|
93
|
-
|
|
122
|
+
I18n.createInstance();
|
|
94
123
|
}
|
|
95
124
|
return true;
|
|
96
125
|
};
|
|
97
126
|
return I18n;
|
|
98
127
|
}());
|
|
99
128
|
exports.I18n = I18n;
|
|
100
|
-
|
|
129
|
+
// Create an instance of I18n in the static class
|
|
130
|
+
I18n.createInstance();
|
package/lib/I18n/types.d.ts
CHANGED
package/lib/I18n/types.js
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.I18nOptions = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
8
|
+
*/
|
|
6
9
|
var I18nOptions = /** @class */ (function () {
|
|
7
10
|
function I18nOptions() {
|
|
8
11
|
this.language = null;
|
package/lib/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
|
}
|
|
@@ -109,7 +109,8 @@ var GoogleOAuth = /** @class */ (function () {
|
|
|
109
109
|
res({ token: id_token, expires_at: expires_at });
|
|
110
110
|
})
|
|
111
111
|
.catch(function (err) {
|
|
112
|
-
if (err &&
|
|
112
|
+
if (err &&
|
|
113
|
+
err.error === 'network_error') {
|
|
113
114
|
// Not using NonRetryableError so handler will be retried
|
|
114
115
|
rej('Network error reloading google auth response');
|
|
115
116
|
}
|
|
@@ -14,6 +14,7 @@ var SSR_RESET_TIMEOUT = 10; // ms
|
|
|
14
14
|
var WEB_RESET_TIMEOUT = 10; // ms
|
|
15
15
|
var PRIME_FRAMEWORK_DELAY = 1000; // ms
|
|
16
16
|
var detectFramework = function () {
|
|
17
|
+
var _a;
|
|
17
18
|
if (!frameworkCache) {
|
|
18
19
|
frameworkCache = (0, detection_1.detect)();
|
|
19
20
|
if (resetTriggered) {
|
|
@@ -22,7 +23,7 @@ var detectFramework = function () {
|
|
|
22
23
|
// So we don't need to notify the observers again so the observer
|
|
23
24
|
// can be removed after the final notice.
|
|
24
25
|
while (exports.frameworkChangeObservers.length) {
|
|
25
|
-
exports.frameworkChangeObservers.pop()();
|
|
26
|
+
(_a = exports.frameworkChangeObservers.pop()) === null || _a === void 0 ? void 0 : _a();
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
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";
|
package/lib/Platform/version.js
CHANGED
|
@@ -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;
|