@aws-amplify/core 6.0.1-console-preview.431c340.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.
Files changed (246) hide show
  1. package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +1 -1
  2. package/lib/AwsClients/Pinpoint/putEvents.d.ts +1 -1
  3. package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
  4. package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
  5. package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.js +28 -0
  6. package/{lib-esm/Util → lib/BackgroundProcessManager}/BackgroundProcessManager.d.ts +1 -23
  7. package/lib/{Util → BackgroundProcessManager}/BackgroundProcessManager.js +13 -56
  8. package/lib/BackgroundProcessManager/index.d.ts +1 -0
  9. package/lib/BackgroundProcessManager/index.js +7 -0
  10. package/lib/BackgroundProcessManager/types.d.ts +41 -0
  11. package/lib/BackgroundProcessManager/types.js +23 -0
  12. package/lib/Hub/index.js +2 -2
  13. package/lib/I18n/I18n.d.ts +2 -18
  14. package/lib/I18n/I18n.js +5 -20
  15. package/lib/I18n/index.d.ts +2 -14
  16. package/lib/I18n/index.js +0 -12
  17. package/lib/I18n/types.d.ts +1 -4
  18. package/lib/I18n/types.js +5 -8
  19. package/lib/Logger/ConsoleLogger.js +2 -2
  20. package/lib/{Util → Mutex}/Mutex.d.ts +2 -15
  21. package/lib/{Util → Mutex}/Mutex.js +2 -1
  22. package/lib/Mutex/index.d.ts +1 -0
  23. package/lib/Mutex/index.js +7 -0
  24. package/lib/Mutex/types.d.ts +13 -0
  25. package/lib/Mutex/types.js +4 -0
  26. package/lib/Platform/version.d.ts +1 -1
  27. package/lib/Platform/version.js +1 -1
  28. package/lib/Reachability/Reachability.d.ts +6 -0
  29. package/lib/Reachability/Reachability.js +29 -0
  30. package/lib/Reachability/Reachability.native.d.ts +6 -0
  31. package/lib/{Util → Reachability}/Reachability.native.js +8 -10
  32. package/lib/Reachability/index.d.ts +1 -0
  33. package/lib/Reachability/index.js +7 -0
  34. package/lib/Reachability/types.d.ts +3 -0
  35. package/lib/Reachability/types.js +4 -0
  36. package/lib/ServiceWorker/ServiceWorker.js +2 -2
  37. package/lib/{Signer.js → Signer/Signer.js} +3 -3
  38. package/lib/Signer/index.d.ts +1 -0
  39. package/lib/Signer/index.js +7 -0
  40. package/lib/clients/middleware/retry/jitteredBackoff.js +2 -2
  41. package/lib/{Util/Constants.d.ts → constants.d.ts} +0 -2
  42. package/lib/{Util/Constants.js → constants.js} +1 -6
  43. package/lib/libraryUtils.d.ts +7 -6
  44. package/lib/libraryUtils.js +37 -49
  45. package/lib/singleton/Auth/utils/index.js +2 -1
  46. package/lib/singleton/types.d.ts +2 -0
  47. package/lib/tsconfig.tsbuildinfo +1 -1
  48. package/lib/utils/convert/base64/base64Decoder.d.ts +2 -0
  49. package/lib/utils/convert/base64/base64Decoder.js +11 -0
  50. package/lib/utils/convert/base64/base64Encoder.d.ts +2 -0
  51. package/lib/utils/convert/base64/base64Encoder.js +18 -0
  52. package/lib/utils/convert/base64/bytesToString.d.ts +1 -0
  53. package/lib/utils/convert/base64/bytesToString.js +9 -0
  54. package/lib/utils/convert/index.d.ts +2 -0
  55. package/lib/utils/convert/index.js +9 -0
  56. package/lib/utils/convert/types.d.ts +9 -0
  57. package/lib/utils/convert/types.js +4 -0
  58. package/lib/utils/generateRandomString.d.ts +1 -0
  59. package/lib/utils/generateRandomString.js +14 -0
  60. package/lib/utils/globalHelpers/index.d.ts +3 -0
  61. package/lib/utils/globalHelpers/index.js +50 -0
  62. package/lib/utils/globalHelpers/index.native.d.ts +5 -0
  63. package/lib/utils/globalHelpers/index.native.js +27 -0
  64. package/lib/utils/index.d.ts +6 -0
  65. package/lib/utils/index.js +21 -0
  66. package/lib/utils/isBrowser.d.ts +1 -0
  67. package/lib/utils/isBrowser.js +9 -0
  68. package/lib/utils/isWebWorker.d.ts +1 -0
  69. package/lib/utils/isWebWorker.js +14 -0
  70. package/lib/utils/retry/NonRetryableError.d.ts +4 -0
  71. package/lib/utils/retry/NonRetryableError.js +30 -0
  72. package/lib/utils/retry/constants.d.ts +1 -0
  73. package/lib/utils/retry/constants.js +6 -0
  74. package/lib/utils/retry/index.d.ts +5 -0
  75. package/lib/utils/retry/index.js +15 -0
  76. package/lib/utils/retry/isNonRetryableError.d.ts +2 -0
  77. package/lib/utils/retry/isNonRetryableError.js +10 -0
  78. package/lib/utils/retry/jitteredBackoff.d.ts +6 -0
  79. package/lib/utils/retry/jitteredBackoff.js +20 -0
  80. package/lib/utils/retry/jitteredExponentialRetry.d.ts +5 -0
  81. package/lib/utils/retry/jitteredExponentialRetry.js +17 -0
  82. package/lib/utils/retry/retry.d.ts +6 -0
  83. package/lib/{Util/Retry.js → utils/retry/retry.js} +6 -57
  84. package/lib/utils/urlSafeDecode.d.ts +1 -0
  85. package/lib/{Util/StringUtils.js → utils/urlSafeDecode.js} +2 -9
  86. package/lib/utils/urlSafeEncode.d.ts +1 -0
  87. package/lib/utils/urlSafeEncode.js +12 -0
  88. package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +1 -1
  89. package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +1 -1
  90. package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
  91. package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
  92. package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.js +25 -0
  93. package/{lib/Util → lib-esm/BackgroundProcessManager}/BackgroundProcessManager.d.ts +1 -23
  94. package/lib-esm/{Util → BackgroundProcessManager}/BackgroundProcessManager.js +4 -47
  95. package/lib-esm/BackgroundProcessManager/index.d.ts +1 -0
  96. package/lib-esm/BackgroundProcessManager/index.js +3 -0
  97. package/lib-esm/BackgroundProcessManager/types.d.ts +41 -0
  98. package/lib-esm/BackgroundProcessManager/types.js +20 -0
  99. package/lib-esm/Hub/index.js +1 -1
  100. package/lib-esm/I18n/I18n.d.ts +2 -18
  101. package/lib-esm/I18n/I18n.js +5 -20
  102. package/lib-esm/I18n/index.d.ts +2 -14
  103. package/lib-esm/I18n/index.js +0 -12
  104. package/lib-esm/I18n/types.d.ts +1 -4
  105. package/lib-esm/I18n/types.js +4 -7
  106. package/lib-esm/Logger/ConsoleLogger.js +1 -1
  107. package/lib-esm/{Util → Mutex}/Mutex.d.ts +2 -15
  108. package/lib-esm/{Util → Mutex}/Mutex.js +1 -1
  109. package/lib-esm/Mutex/index.d.ts +1 -0
  110. package/lib-esm/Mutex/index.js +3 -0
  111. package/lib-esm/Mutex/types.d.ts +13 -0
  112. package/lib-esm/Mutex/types.js +3 -0
  113. package/lib-esm/Platform/version.d.ts +1 -1
  114. package/lib-esm/Platform/version.js +1 -1
  115. package/lib-esm/Reachability/Reachability.d.ts +6 -0
  116. package/lib-esm/Reachability/Reachability.js +26 -0
  117. package/lib-esm/Reachability/Reachability.native.d.ts +6 -0
  118. package/lib-esm/{Util → Reachability}/Reachability.native.js +6 -6
  119. package/lib-esm/Reachability/index.d.ts +1 -0
  120. package/lib-esm/Reachability/index.js +3 -0
  121. package/lib-esm/Reachability/types.d.ts +3 -0
  122. package/lib-esm/Reachability/types.js +3 -0
  123. package/lib-esm/ServiceWorker/ServiceWorker.js +1 -1
  124. package/lib-esm/{Signer.js → Signer/Signer.js} +2 -2
  125. package/lib-esm/Signer/index.d.ts +1 -0
  126. package/lib-esm/Signer/index.js +3 -0
  127. package/lib-esm/clients/middleware/retry/jitteredBackoff.js +1 -1
  128. package/lib-esm/{Util/Constants.d.ts → constants.d.ts} +0 -2
  129. package/lib-esm/{Util/Constants.js → constants.js} +0 -5
  130. package/lib-esm/libraryUtils.d.ts +7 -6
  131. package/lib-esm/libraryUtils.js +8 -8
  132. package/lib-esm/singleton/Auth/utils/index.js +2 -1
  133. package/lib-esm/singleton/types.d.ts +2 -0
  134. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  135. package/lib-esm/utils/convert/base64/base64Decoder.d.ts +2 -0
  136. package/lib-esm/utils/convert/base64/base64Decoder.js +8 -0
  137. package/lib-esm/utils/convert/base64/base64Encoder.d.ts +2 -0
  138. package/lib-esm/utils/convert/base64/base64Encoder.js +15 -0
  139. package/lib-esm/utils/convert/base64/bytesToString.d.ts +1 -0
  140. package/lib-esm/utils/convert/base64/bytesToString.js +5 -0
  141. package/lib-esm/utils/convert/index.d.ts +2 -0
  142. package/lib-esm/utils/convert/index.js +4 -0
  143. package/lib-esm/utils/convert/types.d.ts +9 -0
  144. package/lib-esm/utils/convert/types.js +3 -0
  145. package/lib-esm/utils/generateRandomString.d.ts +1 -0
  146. package/lib-esm/utils/generateRandomString.js +10 -0
  147. package/lib-esm/utils/globalHelpers/index.d.ts +3 -0
  148. package/lib-esm/utils/globalHelpers/index.js +44 -0
  149. package/lib-esm/utils/globalHelpers/index.native.d.ts +5 -0
  150. package/lib-esm/utils/globalHelpers/index.native.js +21 -0
  151. package/lib-esm/utils/index.d.ts +6 -0
  152. package/lib-esm/utils/index.js +8 -0
  153. package/lib-esm/utils/isBrowser.d.ts +1 -0
  154. package/lib-esm/utils/isBrowser.js +5 -0
  155. package/lib-esm/utils/isWebWorker.d.ts +1 -0
  156. package/lib-esm/utils/isWebWorker.js +10 -0
  157. package/lib-esm/utils/retry/NonRetryableError.d.ts +4 -0
  158. package/lib-esm/utils/retry/NonRetryableError.js +27 -0
  159. package/lib-esm/utils/retry/constants.d.ts +1 -0
  160. package/lib-esm/utils/retry/constants.js +3 -0
  161. package/lib-esm/utils/retry/index.d.ts +5 -0
  162. package/lib-esm/utils/retry/index.js +7 -0
  163. package/lib-esm/utils/retry/isNonRetryableError.d.ts +2 -0
  164. package/lib-esm/utils/retry/isNonRetryableError.js +6 -0
  165. package/lib-esm/utils/retry/jitteredBackoff.d.ts +6 -0
  166. package/lib-esm/utils/retry/jitteredBackoff.js +16 -0
  167. package/lib-esm/utils/retry/jitteredExponentialRetry.d.ts +5 -0
  168. package/lib-esm/utils/retry/jitteredExponentialRetry.js +13 -0
  169. package/lib-esm/utils/retry/retry.d.ts +6 -0
  170. package/lib-esm/{Util/Retry.js → utils/retry/retry.js} +4 -52
  171. package/lib-esm/{Util/StringUtils.d.ts → utils/urlSafeDecode.d.ts} +0 -1
  172. package/lib-esm/{Util/StringUtils.js → utils/urlSafeDecode.js} +0 -6
  173. package/{lib/Util/StringUtils.d.ts → lib-esm/utils/urlSafeEncode.d.ts} +0 -1
  174. package/lib-esm/utils/urlSafeEncode.js +8 -0
  175. package/package.json +8 -5
  176. package/src/BackgroundProcessManager/BackgroundManagerNotOpenError.ts +8 -0
  177. package/src/{Util → BackgroundProcessManager}/BackgroundProcessManager.ts +4 -58
  178. package/src/BackgroundProcessManager/index.ts +4 -0
  179. package/src/BackgroundProcessManager/types.ts +49 -0
  180. package/src/Hub/index.ts +1 -1
  181. package/src/I18n/I18n.ts +4 -20
  182. package/src/I18n/index.ts +2 -14
  183. package/src/I18n/types.ts +1 -4
  184. package/src/Logger/ConsoleLogger.ts +1 -1
  185. package/src/{Util → Mutex}/Mutex.ts +2 -20
  186. package/src/Mutex/index.ts +4 -0
  187. package/src/Mutex/types.ts +20 -0
  188. package/src/Platform/version.ts +1 -1
  189. package/src/{Util → Reachability}/Reachability.native.ts +4 -11
  190. package/src/Reachability/Reachability.ts +35 -0
  191. package/src/Reachability/index.ts +4 -0
  192. package/src/Reachability/types.ts +6 -0
  193. package/src/ServiceWorker/ServiceWorker.ts +1 -1
  194. package/src/{Signer.ts → Signer/Signer.ts} +2 -2
  195. package/src/Signer/index.ts +4 -0
  196. package/src/clients/middleware/retry/jitteredBackoff.ts +1 -1
  197. package/src/{Util/Constants.ts → constants.ts} +0 -5
  198. package/src/libraryUtils.ts +16 -35
  199. package/src/singleton/Auth/utils/index.ts +2 -1
  200. package/src/singleton/types.ts +2 -1
  201. package/src/utils/convert/base64/base64Decoder.ts +11 -0
  202. package/src/utils/convert/base64/base64Encoder.ts +18 -0
  203. package/src/utils/convert/base64/bytesToString.ts +6 -0
  204. package/src/utils/convert/index.ts +5 -0
  205. package/src/utils/convert/types.ts +17 -0
  206. package/src/utils/generateRandomString.ts +16 -0
  207. package/src/utils/globalHelpers/index.native.ts +28 -0
  208. package/src/utils/globalHelpers/index.ts +54 -0
  209. package/src/utils/index.ts +15 -0
  210. package/src/utils/isBrowser.ts +5 -0
  211. package/src/utils/isWebWorker.ts +13 -0
  212. package/src/utils/retry/NonRetryableError.ts +9 -0
  213. package/src/utils/retry/constants.ts +4 -0
  214. package/src/utils/retry/index.ts +8 -0
  215. package/src/utils/retry/isNonRetryableError.ts +9 -0
  216. package/src/utils/retry/jitteredBackoff.ts +21 -0
  217. package/src/utils/retry/jitteredExponentialRetry.ts +18 -0
  218. package/src/{Util/Retry.ts → utils/retry/retry.ts} +4 -44
  219. package/src/{Util/StringUtils.ts → utils/urlSafeDecode.ts} +0 -6
  220. package/src/utils/urlSafeEncode.ts +9 -0
  221. package/lib/Util/JS.d.ts +0 -29
  222. package/lib/Util/JS.js +0 -214
  223. package/lib/Util/Reachability.d.ts +0 -13
  224. package/lib/Util/Reachability.js +0 -69
  225. package/lib/Util/Reachability.native.d.ts +0 -12
  226. package/lib/Util/Retry.d.ts +0 -21
  227. package/lib/Util/index.d.ts +0 -7
  228. package/lib/Util/index.js +0 -31
  229. package/lib-esm/Util/JS.d.ts +0 -29
  230. package/lib-esm/Util/JS.js +0 -199
  231. package/lib-esm/Util/Reachability.d.ts +0 -13
  232. package/lib-esm/Util/Reachability.js +0 -64
  233. package/lib-esm/Util/Reachability.native.d.ts +0 -12
  234. package/lib-esm/Util/Retry.d.ts +0 -21
  235. package/lib-esm/Util/index.d.ts +0 -7
  236. package/lib-esm/Util/index.js +0 -9
  237. package/src/Util/JS.ts +0 -255
  238. package/src/Util/Reachability.ts +0 -58
  239. package/src/Util/index.ts +0 -23
  240. /package/lib/{Util → Signer}/DateUtils.d.ts +0 -0
  241. /package/lib/{Util → Signer}/DateUtils.js +0 -0
  242. /package/lib/{Signer.d.ts → Signer/Signer.d.ts} +0 -0
  243. /package/lib-esm/{Util → Signer}/DateUtils.d.ts +0 -0
  244. /package/lib-esm/{Util → Signer}/DateUtils.js +0 -0
  245. /package/lib-esm/{Signer.d.ts → Signer/Signer.d.ts} +0 -0
  246. /package/src/{Util → Signer}/DateUtils.ts +0 -0
@@ -13,11 +13,11 @@ export declare const getInAppMessages: (config: {
13
13
  computeDelay?: ((attempt: number) => number) | undefined;
14
14
  userAgentValue?: string | undefined;
15
15
  } & {
16
- uriEscapePath?: boolean | undefined;
17
16
  credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
18
17
  region: string;
19
18
  abortSignal?: AbortSignal | undefined;
20
19
  cache?: RequestCache | undefined;
21
20
  maxAttempts?: number | undefined;
22
21
  userAgentHeader?: string | undefined;
22
+ uriEscapePath?: boolean | undefined;
23
23
  }, input: GetInAppMessagesInput) => Promise<GetInAppMessagesOutput>;
@@ -13,11 +13,11 @@ export declare const putEvents: (config: {
13
13
  computeDelay?: ((attempt: number) => number) | undefined;
14
14
  userAgentValue?: string | undefined;
15
15
  } & {
16
- uriEscapePath?: boolean | undefined;
17
16
  credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
18
17
  region: string;
19
18
  abortSignal?: AbortSignal | undefined;
20
19
  cache?: RequestCache | undefined;
21
20
  maxAttempts?: number | undefined;
22
21
  userAgentHeader?: string | undefined;
22
+ uriEscapePath?: boolean | undefined;
23
23
  }, input: PutEventsInput) => Promise<PutEventsOutput>;
@@ -13,11 +13,11 @@ export declare const updateEndpoint: (config: {
13
13
  computeDelay?: ((attempt: number) => number) | undefined;
14
14
  userAgentValue?: string | undefined;
15
15
  } & {
16
- uriEscapePath?: boolean | undefined;
17
16
  credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
18
17
  region: string;
19
18
  abortSignal?: AbortSignal | undefined;
20
19
  cache?: RequestCache | undefined;
21
20
  maxAttempts?: number | undefined;
22
21
  userAgentHeader?: string | undefined;
22
+ uriEscapePath?: boolean | undefined;
23
23
  }, input: UpdateEndpointInput) => Promise<UpdateEndpointOutput>;
@@ -0,0 +1,3 @@
1
+ export declare class BackgroundManagerNotOpenError extends Error {
2
+ constructor(message: string);
3
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ var __extends = (this && this.__extends) || (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics = Object.setPrototypeOf ||
7
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
9
+ return extendStatics(d, b);
10
+ };
11
+ return function (d, b) {
12
+ if (typeof b !== "function" && b !== null)
13
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
14
+ extendStatics(d, b);
15
+ function __() { this.constructor = d; }
16
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
17
+ };
18
+ })();
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.BackgroundManagerNotOpenError = void 0;
21
+ var BackgroundManagerNotOpenError = /** @class */ (function (_super) {
22
+ __extends(BackgroundManagerNotOpenError, _super);
23
+ function BackgroundManagerNotOpenError(message) {
24
+ return _super.call(this, "BackgroundManagerNotOpenError: ".concat(message)) || this;
25
+ }
26
+ return BackgroundManagerNotOpenError;
27
+ }(Error));
28
+ exports.BackgroundManagerNotOpenError = BackgroundManagerNotOpenError;
@@ -1,3 +1,4 @@
1
+ import { BackgroundProcessManagerState } from './types';
1
2
  /**
2
3
  * @private For internal Amplify use.
3
4
  *
@@ -179,26 +180,3 @@ export declare class BackgroundProcessManager {
179
180
  */
180
181
  open(): Promise<void>;
181
182
  }
182
- /**
183
- *
184
- */
185
- export declare class BackgroundManagerNotOpenError extends Error {
186
- constructor(message: string);
187
- }
188
- /**
189
- * All possible states a `BackgroundProcessManager` instance can be in.
190
- */
191
- export declare enum BackgroundProcessManagerState {
192
- /**
193
- * Accepting new jobs.
194
- */
195
- Open = "Open",
196
- /**
197
- * Not accepting new jobs. Waiting for submitted jobs to complete.
198
- */
199
- Closing = "Closing",
200
- /**
201
- * Not accepting new jobs. All submitted jobs are complete.
202
- */
203
- Closed = "Closed"
204
- }
@@ -1,19 +1,6 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
17
4
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
5
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
6
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -62,9 +49,9 @@ var __values = (this && this.__values) || function(o) {
62
49
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
63
50
  };
64
51
  Object.defineProperty(exports, "__esModule", { value: true });
65
- exports.BackgroundProcessManagerState = exports.BackgroundManagerNotOpenError = exports.BackgroundProcessManager = void 0;
66
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
67
- // SPDX-License-Identifier: Apache-2.0
52
+ exports.BackgroundProcessManager = void 0;
53
+ var BackgroundManagerNotOpenError_1 = require("./BackgroundManagerNotOpenError");
54
+ var types_1 = require("./types");
68
55
  /**
69
56
  * @private For internal Amplify use.
70
57
  *
@@ -87,7 +74,7 @@ var BackgroundProcessManager = /** @class */ (function () {
87
74
  * waiting for work to complete ("Closing"), or fully done with all
88
75
  * submitted work and *not* accepting new jobs ("Closed").
89
76
  */
90
- this._state = BackgroundProcessManagerState.Open;
77
+ this._state = types_1.BackgroundProcessManagerState.Open;
91
78
  /**
92
79
  * The list of outstanding jobs we'll need to wait for upon `close()`
93
80
  */
@@ -288,7 +275,7 @@ var BackgroundProcessManager = /** @class */ (function () {
288
275
  * Whether the manager is accepting new jobs.
289
276
  */
290
277
  get: function () {
291
- return this._state === BackgroundProcessManagerState.Open;
278
+ return this._state === types_1.BackgroundProcessManagerState.Open;
292
279
  },
293
280
  enumerable: false,
294
281
  configurable: true
@@ -299,7 +286,7 @@ var BackgroundProcessManager = /** @class */ (function () {
299
286
  * submitted work to complete.
300
287
  */
301
288
  get: function () {
302
- return this._state === BackgroundProcessManagerState.Closing;
289
+ return this._state === types_1.BackgroundProcessManagerState.Closing;
303
290
  },
304
291
  enumerable: false,
305
292
  configurable: true
@@ -310,14 +297,14 @@ var BackgroundProcessManager = /** @class */ (function () {
310
297
  * work to complete.
311
298
  */
312
299
  get: function () {
313
- return this._state === BackgroundProcessManagerState.Closed;
300
+ return this._state === types_1.BackgroundProcessManagerState.Closed;
314
301
  },
315
302
  enumerable: false,
316
303
  configurable: true
317
304
  });
318
305
  BackgroundProcessManager.prototype.closedFailure = function (description) {
319
306
  if (!this.isOpen) {
320
- return Promise.reject(new BackgroundManagerNotOpenError([
307
+ return Promise.reject(new BackgroundManagerNotOpenError_1.BackgroundManagerNotOpenError([
321
308
  "The manager is ".concat(this.state, "."),
322
309
  "You tried to add \"".concat(description, "\"."),
323
310
  "Pending jobs: [\n".concat(this.pending
@@ -351,7 +338,7 @@ var BackgroundProcessManager = /** @class */ (function () {
351
338
  switch (_d.label) {
352
339
  case 0:
353
340
  if (!this.isOpen) return [3 /*break*/, 2];
354
- this._state = BackgroundProcessManagerState.Closing;
341
+ this._state = types_1.BackgroundProcessManagerState.Closing;
355
342
  try {
356
343
  for (_a = __values(Array.from(this.jobs)), _b = _a.next(); !_b.done; _b = _a.next()) {
357
344
  job = _b.value;
@@ -379,7 +366,7 @@ var BackgroundProcessManager = /** @class */ (function () {
379
366
  return [4 /*yield*/, this._closingPromise];
380
367
  case 1:
381
368
  _d.sent();
382
- this._state = BackgroundProcessManagerState.Closed;
369
+ this._state = types_1.BackgroundProcessManagerState.Closed;
383
370
  _d.label = 2;
384
371
  case 2: return [2 /*return*/, this._closingPromise];
385
372
  }
@@ -408,7 +395,7 @@ var BackgroundProcessManager = /** @class */ (function () {
408
395
  _a.sent();
409
396
  _a.label = 2;
410
397
  case 2:
411
- this._state = BackgroundProcessManagerState.Open;
398
+ this._state = types_1.BackgroundProcessManagerState.Open;
412
399
  return [2 /*return*/];
413
400
  }
414
401
  });
@@ -417,33 +404,3 @@ var BackgroundProcessManager = /** @class */ (function () {
417
404
  return BackgroundProcessManager;
418
405
  }());
419
406
  exports.BackgroundProcessManager = BackgroundProcessManager;
420
- /**
421
- *
422
- */
423
- var BackgroundManagerNotOpenError = /** @class */ (function (_super) {
424
- __extends(BackgroundManagerNotOpenError, _super);
425
- function BackgroundManagerNotOpenError(message) {
426
- return _super.call(this, "BackgroundManagerNotOpenError: ".concat(message)) || this;
427
- }
428
- return BackgroundManagerNotOpenError;
429
- }(Error));
430
- exports.BackgroundManagerNotOpenError = BackgroundManagerNotOpenError;
431
- /**
432
- * All possible states a `BackgroundProcessManager` instance can be in.
433
- */
434
- var BackgroundProcessManagerState;
435
- (function (BackgroundProcessManagerState) {
436
- /**
437
- * Accepting new jobs.
438
- */
439
- BackgroundProcessManagerState["Open"] = "Open";
440
- /**
441
- * Not accepting new jobs. Waiting for submitted jobs to complete.
442
- */
443
- BackgroundProcessManagerState["Closing"] = "Closing";
444
- /**
445
- * Not accepting new jobs. All submitted jobs are complete.
446
- */
447
- BackgroundProcessManagerState["Closed"] = "Closed";
448
- })(BackgroundProcessManagerState = exports.BackgroundProcessManagerState || (exports.BackgroundProcessManagerState = {}));
449
- var process = new BackgroundProcessManager();
@@ -0,0 +1 @@
1
+ export { BackgroundProcessManager } from './BackgroundProcessManager';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.BackgroundProcessManager = void 0;
6
+ var BackgroundProcessManager_1 = require("./BackgroundProcessManager");
7
+ Object.defineProperty(exports, "BackgroundProcessManager", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManager; } });
@@ -0,0 +1,41 @@
1
+ /**
2
+ * All possible states a `BackgroundProcessManager` instance can be in.
3
+ */
4
+ export declare enum BackgroundProcessManagerState {
5
+ /**
6
+ * Accepting new jobs.
7
+ */
8
+ Open = "Open",
9
+ /**
10
+ * Not accepting new jobs. Waiting for submitted jobs to complete.
11
+ */
12
+ Closing = "Closing",
13
+ /**
14
+ * Not accepting new jobs. All submitted jobs are complete.
15
+ */
16
+ Closed = "Closed"
17
+ }
18
+ /**
19
+ * Completely internal to `BackgroundProcessManager`, and describes the structure of
20
+ * an entry in the jobs registry.
21
+ */
22
+ export type JobEntry = {
23
+ /**
24
+ * The underlying promise provided by the job function to wait for.
25
+ */
26
+ promise: Promise<any>;
27
+ /**
28
+ * Request the termination of the job.
29
+ */
30
+ terminate: () => void;
31
+ /**
32
+ * An object provided by the caller that can be used to identify the description
33
+ * of the job, which can otherwise be unclear from the `promise` and
34
+ * `terminate` function. The `description` can be a string. (May be extended
35
+ * later to also support object refs.)
36
+ *
37
+ * Useful for troubleshooting why a manager is waiting for long periods of time
38
+ * on `close()`.
39
+ */
40
+ description?: string;
41
+ };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.BackgroundProcessManagerState = void 0;
6
+ /**
7
+ * All possible states a `BackgroundProcessManager` instance can be in.
8
+ */
9
+ var BackgroundProcessManagerState;
10
+ (function (BackgroundProcessManagerState) {
11
+ /**
12
+ * Accepting new jobs.
13
+ */
14
+ BackgroundProcessManagerState["Open"] = "Open";
15
+ /**
16
+ * Not accepting new jobs. Waiting for submitted jobs to complete.
17
+ */
18
+ BackgroundProcessManagerState["Closing"] = "Closing";
19
+ /**
20
+ * Not accepting new jobs. All submitted jobs are complete.
21
+ */
22
+ BackgroundProcessManagerState["Closed"] = "Closed";
23
+ })(BackgroundProcessManagerState = exports.BackgroundProcessManagerState || (exports.BackgroundProcessManagerState = {}));
package/lib/Hub/index.js CHANGED
@@ -40,7 +40,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
40
40
  Object.defineProperty(exports, "__esModule", { value: true });
41
41
  exports.Hub = exports.HubClass = exports.AMPLIFY_SYMBOL = void 0;
42
42
  var Logger_1 = require("../Logger");
43
- var Constants_1 = require("../Util/Constants");
43
+ var constants_1 = require("../constants");
44
44
  var errors_1 = require("../errors");
45
45
  exports.AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
46
46
  ? Symbol.for('amplify_default')
@@ -106,7 +106,7 @@ var HubClass = /** @class */ (function () {
106
106
  var cb;
107
107
  if (typeof callback !== 'function') {
108
108
  throw new errors_1.AmplifyError({
109
- name: Constants_1.NO_HUBCALLBACK_PROVIDED_EXCEPTION,
109
+ name: constants_1.NO_HUBCALLBACK_PROVIDED_EXCEPTION,
110
110
  message: 'No callback supplied to Hub',
111
111
  });
112
112
  }
@@ -1,14 +1,12 @@
1
- import { I18nOptions } from './types';
1
+ import { I18nConfig } from './types';
2
2
  /**
3
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.
6
4
  */
7
5
  export declare class I18n {
8
6
  /**
9
7
  * @private
10
8
  */
11
- _options: I18nOptions | null;
9
+ _options: I18nConfig | null;
12
10
  /**
13
11
  * @private
14
12
  */
@@ -21,22 +19,16 @@ export declare class I18n {
21
19
  * @constructor
22
20
  * Initialize with configurations
23
21
  * @param {Object} options
24
- *
25
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
26
22
  */
27
23
  constructor();
28
24
  /**
29
25
  * 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
26
  */
33
27
  setDefaultLanguage(): void;
34
28
  /**
35
29
  * @method
36
30
  * Explicitly setting language
37
31
  * @param {String} lang
38
- *
39
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
40
32
  */
41
33
  setLanguage(lang: string): void;
42
34
  /**
@@ -44,8 +36,6 @@ export declare class I18n {
44
36
  * Get value
45
37
  * @param {String} key
46
38
  * @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.
49
39
  */
50
40
  get(key: string, defVal?: string | undefined): any;
51
41
  /**
@@ -54,8 +44,6 @@ export declare class I18n {
54
44
  * @param {String} key
55
45
  * @param {String} language - Specified langurage to be used
56
46
  * @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.
59
47
  */
60
48
  getByLanguage(key: string, language: string, defVal?: string | null): any;
61
49
  /**
@@ -63,8 +51,6 @@ export declare class I18n {
63
51
  * Add vocabularies for one language
64
52
  * @param {String} language - Language of the dictionary
65
53
  * @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.
68
54
  */
69
55
  putVocabulariesForLanguage(language: string, vocabularies: Record<string, any>): void;
70
56
  /**
@@ -72,8 +58,6 @@ export declare class I18n {
72
58
  * Add vocabularies for one language
73
59
  * @param {Object} vocabularies - Object that has language as key,
74
60
  * 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.
77
61
  */
78
62
  putVocabularies(vocabularies: Record<string, any>): void;
79
63
  }
package/lib/I18n/I18n.js CHANGED
@@ -15,19 +15,16 @@ 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
21
  * Language translation utility.
21
- *
22
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
23
22
  */
24
23
  var I18n = /** @class */ (function () {
25
24
  /**
26
25
  * @constructor
27
26
  * Initialize with configurations
28
27
  * @param {Object} options
29
- *
30
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
31
28
  */
32
29
  function I18n() {
33
30
  /**
@@ -45,14 +42,12 @@ var I18n = /** @class */ (function () {
45
42
  }
46
43
  /**
47
44
  * Sets the default language from the configuration when required.
48
- *
49
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
50
45
  */
51
46
  I18n.prototype.setDefaultLanguage = function () {
52
- /*if (!this._lang) {
53
- const i18nConfig = Amplify.getConfig().I18n;
54
- this._lang = i18nConfig?.language;
55
- }*/
47
+ if (!this._lang) {
48
+ var i18nConfig = singleton_1.Amplify.getConfig().I18n;
49
+ this._lang = i18nConfig === null || i18nConfig === void 0 ? void 0 : i18nConfig.language;
50
+ }
56
51
  // Default to window language if not set in config
57
52
  if (!this._lang &&
58
53
  typeof window !== 'undefined' &&
@@ -66,8 +61,6 @@ var I18n = /** @class */ (function () {
66
61
  * @method
67
62
  * Explicitly setting language
68
63
  * @param {String} lang
69
- *
70
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
71
64
  */
72
65
  I18n.prototype.setLanguage = function (lang) {
73
66
  this._lang = lang;
@@ -77,8 +70,6 @@ var I18n = /** @class */ (function () {
77
70
  * Get value
78
71
  * @param {String} key
79
72
  * @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
73
  */
83
74
  I18n.prototype.get = function (key, defVal) {
84
75
  if (defVal === void 0) { defVal = undefined; }
@@ -104,8 +95,6 @@ var I18n = /** @class */ (function () {
104
95
  * @param {String} key
105
96
  * @param {String} language - Specified langurage to be used
106
97
  * @param {String} defVal - Default value
107
- *
108
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
109
98
  */
110
99
  I18n.prototype.getByLanguage = function (key, language, defVal) {
111
100
  if (defVal === void 0) { defVal = null; }
@@ -123,8 +112,6 @@ var I18n = /** @class */ (function () {
123
112
  * Add vocabularies for one language
124
113
  * @param {String} language - Language of the dictionary
125
114
  * @param {Object} vocabularies - Object that has key-value as dictionary entry
126
- *
127
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
128
115
  */
129
116
  I18n.prototype.putVocabulariesForLanguage = function (language, vocabularies) {
130
117
  var lang_dict = this._dict[language];
@@ -138,8 +125,6 @@ var I18n = /** @class */ (function () {
138
125
  * Add vocabularies for one language
139
126
  * @param {Object} vocabularies - Object that has language as key,
140
127
  * vocabularies of each language as value
141
- *
142
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
143
128
  */
144
129
  I18n.prototype.putVocabularies = function (vocabularies) {
145
130
  var _this = this;
@@ -1,8 +1,6 @@
1
- import { I18nOptions } from './types';
1
+ import { I18nConfig } from './types';
2
2
  /**
3
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.
6
4
  */
7
5
  export declare class I18n {
8
6
  /**
@@ -11,22 +9,18 @@ export declare class I18n {
11
9
  * Configure I18n part
12
10
  * @param {Object} config - Configuration of the I18n
13
11
  */
14
- static configure(config: Record<string, any>): I18nOptions;
12
+ static configure(config: Record<string, any>): I18nConfig;
15
13
  static getModuleName(): string;
16
14
  /**
17
15
  * @static
18
16
  * @method
19
17
  * 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.
22
18
  */
23
19
  static createInstance(): void;
24
20
  /**
25
21
  * @static @method
26
22
  * Explicitly setting language
27
23
  * @param {String} lang
28
- *
29
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
30
24
  */
31
25
  static setLanguage(lang: string): void;
32
26
  /**
@@ -34,8 +28,6 @@ export declare class I18n {
34
28
  * Get value
35
29
  * @param {String} key
36
30
  * @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.
39
31
  */
40
32
  static get(key: string, defVal?: string): any;
41
33
  /**
@@ -44,8 +36,6 @@ export declare class I18n {
44
36
  * Add vocabularies for one language
45
37
  * @param {String} langurage - Language of the dictionary
46
38
  * @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.
49
39
  */
50
40
  static putVocabulariesForLanguage(language: string, vocabularies: Record<string, string>): void;
51
41
  /**
@@ -54,8 +44,6 @@ export declare class I18n {
54
44
  * Add vocabularies for one language
55
45
  * @param {Object} vocabularies - Object that has language as key,
56
46
  * 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.
59
47
  */
60
48
  static putVocabularies(vocabularies: Record<string, string>): void;
61
49
  static checkConfig(): boolean;
package/lib/I18n/index.js CHANGED
@@ -11,8 +11,6 @@ var _config = { language: null };
11
11
  var _i18n = null;
12
12
  /**
13
13
  * Export I18n APIs
14
- *
15
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
16
14
  */
17
15
  var I18n = /** @class */ (function () {
18
16
  function I18n() {
@@ -39,8 +37,6 @@ var I18n = /** @class */ (function () {
39
37
  * @static
40
38
  * @method
41
39
  * Create an instance of I18n for the library
42
- *
43
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
44
40
  */
45
41
  I18n.createInstance = function () {
46
42
  logger.debug('create I18n instance');
@@ -53,8 +49,6 @@ var I18n = /** @class */ (function () {
53
49
  * @static @method
54
50
  * Explicitly setting language
55
51
  * @param {String} lang
56
- *
57
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
58
52
  */
59
53
  I18n.setLanguage = function (lang) {
60
54
  I18n.checkConfig();
@@ -66,8 +60,6 @@ var I18n = /** @class */ (function () {
66
60
  * Get value
67
61
  * @param {String} key
68
62
  * @param {String} defVal - Default value
69
- *
70
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
71
63
  */
72
64
  I18n.get = function (key, defVal) {
73
65
  if (!I18n.checkConfig()) {
@@ -82,8 +74,6 @@ var I18n = /** @class */ (function () {
82
74
  * Add vocabularies for one language
83
75
  * @param {String} langurage - Language of the dictionary
84
76
  * @param {Object} vocabularies - Object that has key-value as dictionary entry
85
- *
86
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
87
77
  */
88
78
  I18n.putVocabulariesForLanguage = function (language, vocabularies) {
89
79
  I18n.checkConfig();
@@ -96,8 +86,6 @@ var I18n = /** @class */ (function () {
96
86
  * Add vocabularies for one language
97
87
  * @param {Object} vocabularies - Object that has language as key,
98
88
  * vocabularies of each language as value
99
- *
100
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
101
89
  */
102
90
  I18n.putVocabularies = function (vocabularies) {
103
91
  I18n.checkConfig();
@@ -1,6 +1,3 @@
1
- /**
2
- * @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
3
- */
4
- export declare class I18nOptions {
1
+ export declare class I18nConfig {
5
2
  language: null;
6
3
  }
package/lib/I18n/types.js CHANGED
@@ -2,14 +2,11 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.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
- */
9
- var I18nOptions = /** @class */ (function () {
10
- function I18nOptions() {
5
+ exports.I18nConfig = void 0;
6
+ var I18nConfig = /** @class */ (function () {
7
+ function I18nConfig() {
11
8
  this.language = null;
12
9
  }
13
- return I18nOptions;
10
+ return I18nConfig;
14
11
  }());
15
- exports.I18nOptions = I18nOptions;
12
+ exports.I18nConfig = I18nConfig;
@@ -39,7 +39,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
39
39
  };
40
40
  Object.defineProperty(exports, "__esModule", { value: true });
41
41
  exports.ConsoleLogger = exports.LOG_TYPE = void 0;
42
- var Constants_1 = require("../Util/Constants");
42
+ var constants_1 = require("../constants");
43
43
  var LOG_LEVELS = {
44
44
  VERBOSE: 1,
45
45
  DEBUG: 2,
@@ -234,7 +234,7 @@ var ConsoleLogger = exports.ConsoleLogger = /** @class */ (function () {
234
234
  this._log.apply(this, __spreadArray([LOG_TYPE.VERBOSE], __read(msg), false));
235
235
  };
236
236
  ConsoleLogger.prototype.addPluggable = function (pluggable) {
237
- if (pluggable && pluggable.getCategoryName() === Constants_1.AWS_CLOUDWATCH_CATEGORY) {
237
+ if (pluggable && pluggable.getCategoryName() === constants_1.AWS_CLOUDWATCH_CATEGORY) {
238
238
  this._pluggables.push(pluggable);
239
239
  pluggable.configure(this._config);
240
240
  }