@aws-amplify/core 6.0.1-console-preview.0bbe168.0 → 6.0.1-console-preview.4b7d177.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/core",
3
- "version": "6.0.1-console-preview.0bbe168.0+0bbe168",
3
+ "version": "6.0.1-console-preview.4b7d177.0+4b7d177",
4
4
  "description": "Core category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -92,7 +92,7 @@
92
92
  "name": "Core (I18n)",
93
93
  "path": "./lib-esm/index.js",
94
94
  "import": "{ I18n }",
95
- "limit": "2.33 kB"
95
+ "limit": "4.82 kB"
96
96
  },
97
97
  {
98
98
  "name": "Custom clients (fetch handler)",
@@ -185,5 +185,5 @@
185
185
  "lib-esm"
186
186
  ]
187
187
  },
188
- "gitHead": "0bbe168c66929877174b331c71f7666bb16529d6"
188
+ "gitHead": "4b7d177e4da0aad2f1e1dd76c8c788f77f3114a2"
189
189
  }
package/src/I18n/I18n.ts CHANGED
@@ -3,20 +3,18 @@
3
3
 
4
4
  import { ConsoleLogger as Logger } from '../Logger';
5
5
  import { Amplify } from '../singleton';
6
- import { I18nOptions } from './types';
6
+ import { I18nConfig } from './types';
7
7
 
8
8
  const logger = new Logger('I18n');
9
9
 
10
10
  /**
11
11
  * Language translation utility.
12
- *
13
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
14
12
  */
15
13
  export class I18n {
16
14
  /**
17
15
  * @private
18
16
  */
19
- _options: I18nOptions | null = null;
17
+ _options: I18nConfig | null = null;
20
18
 
21
19
  /**
22
20
  * @private
@@ -32,21 +30,17 @@ export class I18n {
32
30
  * @constructor
33
31
  * Initialize with configurations
34
32
  * @param {Object} options
35
- *
36
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
37
33
  */
38
34
  constructor() {}
39
35
 
40
36
  /**
41
37
  * Sets the default language from the configuration when required.
42
- *
43
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
44
38
  */
45
39
  setDefaultLanguage() {
46
- /*if (!this._lang) {
40
+ if (!this._lang) {
47
41
  const i18nConfig = Amplify.getConfig().I18n;
48
42
  this._lang = i18nConfig?.language;
49
- }*/
43
+ }
50
44
 
51
45
  // Default to window language if not set in config
52
46
  if (
@@ -65,8 +59,6 @@ export class I18n {
65
59
  * @method
66
60
  * Explicitly setting language
67
61
  * @param {String} lang
68
- *
69
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
70
62
  */
71
63
  setLanguage(lang: string) {
72
64
  this._lang = lang;
@@ -77,8 +69,6 @@ export class I18n {
77
69
  * Get value
78
70
  * @param {String} key
79
71
  * @param {String} defVal - Default value
80
- *
81
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
82
72
  */
83
73
  get(key: string, defVal: string | undefined = undefined) {
84
74
  if (!this._lang) {
@@ -107,8 +97,6 @@ export class I18n {
107
97
  * @param {String} key
108
98
  * @param {String} language - Specified langurage to be used
109
99
  * @param {String} defVal - Default value
110
- *
111
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
112
100
  */
113
101
  getByLanguage(key: string, language: string, defVal: string | null = null) {
114
102
  if (!language) {
@@ -128,8 +116,6 @@ export class I18n {
128
116
  * Add vocabularies for one language
129
117
  * @param {String} language - Language of the dictionary
130
118
  * @param {Object} vocabularies - Object that has key-value as dictionary entry
131
- *
132
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
133
119
  */
134
120
  putVocabulariesForLanguage(
135
121
  language: string,
@@ -147,8 +133,6 @@ export class I18n {
147
133
  * Add vocabularies for one language
148
134
  * @param {Object} vocabularies - Object that has language as key,
149
135
  * vocabularies of each language as value
150
- *
151
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
152
136
  */
153
137
  putVocabularies(vocabularies: Record<string, any>) {
154
138
  Object.keys(vocabularies).map(key => {
package/src/I18n/index.ts CHANGED
@@ -4,18 +4,16 @@
4
4
  import { I18n as I18nClass } from './I18n';
5
5
 
6
6
  import { ConsoleLogger as Logger } from '../Logger';
7
- import { I18nOptions } from './types';
7
+ import { I18nConfig } from './types';
8
8
  import { assert, I18nErrorCode } from './errorHelpers';
9
9
 
10
10
  const logger = new Logger('I18n');
11
11
 
12
- let _config: I18nOptions = { language: null };
12
+ let _config: I18nConfig = { language: null };
13
13
  let _i18n: I18nClass | null = null;
14
14
 
15
15
  /**
16
16
  * Export I18n APIs
17
- *
18
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
19
17
  */
20
18
  export class I18n {
21
19
  /**
@@ -45,8 +43,6 @@ export class I18n {
45
43
  * @static
46
44
  * @method
47
45
  * Create an instance of I18n for the library
48
- *
49
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
50
46
  */
51
47
  static createInstance() {
52
48
  logger.debug('create I18n instance');
@@ -60,8 +56,6 @@ export class I18n {
60
56
  * @static @method
61
57
  * Explicitly setting language
62
58
  * @param {String} lang
63
- *
64
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
65
59
  */
66
60
  static setLanguage(lang: string) {
67
61
  I18n.checkConfig();
@@ -75,8 +69,6 @@ export class I18n {
75
69
  * Get value
76
70
  * @param {String} key
77
71
  * @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.
80
72
  */
81
73
  static get(key: string, defVal?: string) {
82
74
  if (!I18n.checkConfig()) {
@@ -93,8 +85,6 @@ export class I18n {
93
85
  * Add vocabularies for one language
94
86
  * @param {String} langurage - Language of the dictionary
95
87
  * @param {Object} vocabularies - Object that has key-value as dictionary entry
96
- *
97
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
98
88
  */
99
89
  static putVocabulariesForLanguage(
100
90
  language: string,
@@ -112,8 +102,6 @@ export class I18n {
112
102
  * Add vocabularies for one language
113
103
  * @param {Object} vocabularies - Object that has language as key,
114
104
  * vocabularies of each language as value
115
- *
116
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
117
105
  */
118
106
  static putVocabularies(vocabularies: Record<string, string>) {
119
107
  I18n.checkConfig();
package/src/I18n/types.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- /**
5
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
6
- */
7
- export class I18nOptions {
4
+ export class I18nConfig {
8
5
  language = null;
9
6
  }
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '6.0.1-console-preview.0bbe168.0+0bbe168';
2
+ export const version = '6.0.1-console-preview.4b7d177.0+4b7d177';
@@ -18,6 +18,7 @@ import {
18
18
  StorageAccessLevel,
19
19
  StorageConfig,
20
20
  } from './Storage/types';
21
+ import { I18nConfig } from '../I18n/types';
21
22
 
22
23
  export type LegacyConfig = {
23
24
  /**
@@ -32,7 +33,7 @@ export type ResourcesConfig = {
32
33
  Auth?: AuthConfig;
33
34
  // Cache?: CacheConfig;
34
35
  // DataStore?: {};
35
- // I18n?: I18nOptions;
36
+ I18n?: I18nConfig;
36
37
  // Interactions?: {};
37
38
  // Notifications?: {};
38
39
  // Predictions?: {};