@aws-amplify/core 6.0.1-console-preview.67f944e.0 → 6.0.1-console-preview.0bbe168.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 (239) 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/Logger/ConsoleLogger.js +2 -2
  14. package/lib/{Util → Mutex}/Mutex.d.ts +2 -15
  15. package/lib/{Util → Mutex}/Mutex.js +2 -1
  16. package/lib/Mutex/index.d.ts +1 -0
  17. package/lib/Mutex/index.js +7 -0
  18. package/lib/Mutex/types.d.ts +13 -0
  19. package/lib/Mutex/types.js +4 -0
  20. package/lib/Platform/version.d.ts +1 -1
  21. package/lib/Platform/version.js +1 -1
  22. package/lib/Reachability/Reachability.d.ts +6 -0
  23. package/lib/Reachability/Reachability.js +29 -0
  24. package/lib/Reachability/Reachability.native.d.ts +6 -0
  25. package/lib/{Util → Reachability}/Reachability.native.js +8 -10
  26. package/lib/Reachability/index.d.ts +1 -0
  27. package/lib/Reachability/index.js +7 -0
  28. package/lib/Reachability/types.d.ts +3 -0
  29. package/lib/Reachability/types.js +4 -0
  30. package/lib/ServiceWorker/ServiceWorker.js +2 -2
  31. package/lib/{Signer.js → Signer/Signer.js} +3 -3
  32. package/lib/Signer/index.d.ts +1 -0
  33. package/lib/Signer/index.js +7 -0
  34. package/lib/clients/middleware/retry/jitteredBackoff.js +2 -2
  35. package/lib/{Util/Constants.d.ts → constants.d.ts} +0 -2
  36. package/lib/{Util/Constants.js → constants.js} +1 -6
  37. package/lib/libraryUtils.d.ts +7 -6
  38. package/lib/libraryUtils.js +37 -49
  39. package/lib/providers/pinpoint/apis/updateEndpoint.d.ts +1 -1
  40. package/lib/providers/pinpoint/apis/updateEndpoint.js +7 -5
  41. package/lib/providers/pinpoint/types/pinpoint.d.ts +1 -0
  42. package/lib/singleton/Auth/utils/index.js +2 -1
  43. package/lib/tsconfig.tsbuildinfo +1 -1
  44. package/lib/types/core.d.ts +4 -1
  45. package/lib/utils/convert/base64/base64Decoder.d.ts +2 -0
  46. package/lib/utils/convert/base64/base64Decoder.js +11 -0
  47. package/lib/utils/convert/base64/base64Encoder.d.ts +2 -0
  48. package/lib/utils/convert/base64/base64Encoder.js +18 -0
  49. package/lib/utils/convert/base64/bytesToString.d.ts +1 -0
  50. package/lib/utils/convert/base64/bytesToString.js +9 -0
  51. package/lib/utils/convert/index.d.ts +2 -0
  52. package/lib/utils/convert/index.js +9 -0
  53. package/lib/utils/convert/types.d.ts +9 -0
  54. package/lib/utils/convert/types.js +4 -0
  55. package/lib/utils/generateRandomString.d.ts +1 -0
  56. package/lib/utils/generateRandomString.js +14 -0
  57. package/lib/utils/globalHelpers/index.d.ts +3 -0
  58. package/lib/utils/globalHelpers/index.js +50 -0
  59. package/lib/utils/globalHelpers/index.native.d.ts +5 -0
  60. package/lib/utils/globalHelpers/index.native.js +27 -0
  61. package/lib/utils/index.d.ts +6 -0
  62. package/lib/utils/index.js +21 -0
  63. package/lib/utils/isBrowser.d.ts +1 -0
  64. package/lib/utils/isBrowser.js +9 -0
  65. package/lib/utils/isWebWorker.d.ts +1 -0
  66. package/lib/utils/isWebWorker.js +14 -0
  67. package/lib/utils/retry/NonRetryableError.d.ts +4 -0
  68. package/lib/utils/retry/NonRetryableError.js +30 -0
  69. package/lib/utils/retry/constants.d.ts +1 -0
  70. package/lib/utils/retry/constants.js +6 -0
  71. package/lib/utils/retry/index.d.ts +5 -0
  72. package/lib/utils/retry/index.js +15 -0
  73. package/lib/utils/retry/isNonRetryableError.d.ts +2 -0
  74. package/lib/utils/retry/isNonRetryableError.js +10 -0
  75. package/lib/utils/retry/jitteredBackoff.d.ts +6 -0
  76. package/lib/utils/retry/jitteredBackoff.js +20 -0
  77. package/lib/utils/retry/jitteredExponentialRetry.d.ts +5 -0
  78. package/lib/utils/retry/jitteredExponentialRetry.js +17 -0
  79. package/lib/utils/retry/retry.d.ts +6 -0
  80. package/lib/{Util/Retry.js → utils/retry/retry.js} +6 -57
  81. package/lib/utils/urlSafeDecode.d.ts +1 -0
  82. package/lib/{Util/StringUtils.js → utils/urlSafeDecode.js} +2 -9
  83. package/lib/utils/urlSafeEncode.d.ts +1 -0
  84. package/lib/utils/urlSafeEncode.js +12 -0
  85. package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +1 -1
  86. package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +1 -1
  87. package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
  88. package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
  89. package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.js +25 -0
  90. package/{lib/Util → lib-esm/BackgroundProcessManager}/BackgroundProcessManager.d.ts +1 -23
  91. package/lib-esm/{Util → BackgroundProcessManager}/BackgroundProcessManager.js +4 -47
  92. package/lib-esm/BackgroundProcessManager/index.d.ts +1 -0
  93. package/lib-esm/BackgroundProcessManager/index.js +3 -0
  94. package/lib-esm/BackgroundProcessManager/types.d.ts +41 -0
  95. package/lib-esm/BackgroundProcessManager/types.js +20 -0
  96. package/lib-esm/Hub/index.js +1 -1
  97. package/lib-esm/Logger/ConsoleLogger.js +1 -1
  98. package/lib-esm/{Util → Mutex}/Mutex.d.ts +2 -15
  99. package/lib-esm/{Util → Mutex}/Mutex.js +1 -1
  100. package/lib-esm/Mutex/index.d.ts +1 -0
  101. package/lib-esm/Mutex/index.js +3 -0
  102. package/lib-esm/Mutex/types.d.ts +13 -0
  103. package/lib-esm/Mutex/types.js +3 -0
  104. package/lib-esm/Platform/version.d.ts +1 -1
  105. package/lib-esm/Platform/version.js +1 -1
  106. package/lib-esm/Reachability/Reachability.d.ts +6 -0
  107. package/lib-esm/Reachability/Reachability.js +26 -0
  108. package/lib-esm/Reachability/Reachability.native.d.ts +6 -0
  109. package/lib-esm/{Util → Reachability}/Reachability.native.js +6 -6
  110. package/lib-esm/Reachability/index.d.ts +1 -0
  111. package/lib-esm/Reachability/index.js +3 -0
  112. package/lib-esm/Reachability/types.d.ts +3 -0
  113. package/lib-esm/Reachability/types.js +3 -0
  114. package/lib-esm/ServiceWorker/ServiceWorker.js +1 -1
  115. package/lib-esm/{Signer.js → Signer/Signer.js} +2 -2
  116. package/lib-esm/Signer/index.d.ts +1 -0
  117. package/lib-esm/Signer/index.js +3 -0
  118. package/lib-esm/clients/middleware/retry/jitteredBackoff.js +1 -1
  119. package/lib-esm/{Util/Constants.d.ts → constants.d.ts} +0 -2
  120. package/lib-esm/{Util/Constants.js → constants.js} +0 -5
  121. package/lib-esm/libraryUtils.d.ts +7 -6
  122. package/lib-esm/libraryUtils.js +8 -8
  123. package/lib-esm/providers/pinpoint/apis/updateEndpoint.d.ts +1 -1
  124. package/lib-esm/providers/pinpoint/apis/updateEndpoint.js +7 -5
  125. package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +1 -0
  126. package/lib-esm/singleton/Auth/utils/index.js +2 -1
  127. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  128. package/lib-esm/types/core.d.ts +4 -1
  129. package/lib-esm/utils/convert/base64/base64Decoder.d.ts +2 -0
  130. package/lib-esm/utils/convert/base64/base64Decoder.js +8 -0
  131. package/lib-esm/utils/convert/base64/base64Encoder.d.ts +2 -0
  132. package/lib-esm/utils/convert/base64/base64Encoder.js +15 -0
  133. package/lib-esm/utils/convert/base64/bytesToString.d.ts +1 -0
  134. package/lib-esm/utils/convert/base64/bytesToString.js +5 -0
  135. package/lib-esm/utils/convert/index.d.ts +2 -0
  136. package/lib-esm/utils/convert/index.js +4 -0
  137. package/lib-esm/utils/convert/types.d.ts +9 -0
  138. package/lib-esm/utils/convert/types.js +3 -0
  139. package/lib-esm/utils/generateRandomString.d.ts +1 -0
  140. package/lib-esm/utils/generateRandomString.js +10 -0
  141. package/lib-esm/utils/globalHelpers/index.d.ts +3 -0
  142. package/lib-esm/utils/globalHelpers/index.js +44 -0
  143. package/lib-esm/utils/globalHelpers/index.native.d.ts +5 -0
  144. package/lib-esm/utils/globalHelpers/index.native.js +21 -0
  145. package/lib-esm/utils/index.d.ts +6 -0
  146. package/lib-esm/utils/index.js +8 -0
  147. package/lib-esm/utils/isBrowser.d.ts +1 -0
  148. package/lib-esm/utils/isBrowser.js +5 -0
  149. package/lib-esm/utils/isWebWorker.d.ts +1 -0
  150. package/lib-esm/utils/isWebWorker.js +10 -0
  151. package/lib-esm/utils/retry/NonRetryableError.d.ts +4 -0
  152. package/lib-esm/utils/retry/NonRetryableError.js +27 -0
  153. package/lib-esm/utils/retry/constants.d.ts +1 -0
  154. package/lib-esm/utils/retry/constants.js +3 -0
  155. package/lib-esm/utils/retry/index.d.ts +5 -0
  156. package/lib-esm/utils/retry/index.js +7 -0
  157. package/lib-esm/utils/retry/isNonRetryableError.d.ts +2 -0
  158. package/lib-esm/utils/retry/isNonRetryableError.js +6 -0
  159. package/lib-esm/utils/retry/jitteredBackoff.d.ts +6 -0
  160. package/lib-esm/utils/retry/jitteredBackoff.js +16 -0
  161. package/lib-esm/utils/retry/jitteredExponentialRetry.d.ts +5 -0
  162. package/lib-esm/utils/retry/jitteredExponentialRetry.js +13 -0
  163. package/lib-esm/utils/retry/retry.d.ts +6 -0
  164. package/lib-esm/{Util/Retry.js → utils/retry/retry.js} +4 -52
  165. package/lib-esm/{Util/StringUtils.d.ts → utils/urlSafeDecode.d.ts} +0 -1
  166. package/lib-esm/{Util/StringUtils.js → utils/urlSafeDecode.js} +0 -6
  167. package/{lib/Util/StringUtils.d.ts → lib-esm/utils/urlSafeEncode.d.ts} +0 -1
  168. package/lib-esm/utils/urlSafeEncode.js +8 -0
  169. package/package.json +7 -4
  170. package/src/BackgroundProcessManager/BackgroundManagerNotOpenError.ts +8 -0
  171. package/src/{Util → BackgroundProcessManager}/BackgroundProcessManager.ts +4 -58
  172. package/src/BackgroundProcessManager/index.ts +4 -0
  173. package/src/BackgroundProcessManager/types.ts +49 -0
  174. package/src/Hub/index.ts +1 -1
  175. package/src/Logger/ConsoleLogger.ts +1 -1
  176. package/src/{Util → Mutex}/Mutex.ts +2 -20
  177. package/src/Mutex/index.ts +4 -0
  178. package/src/Mutex/types.ts +20 -0
  179. package/src/Platform/version.ts +1 -1
  180. package/src/{Util → Reachability}/Reachability.native.ts +4 -11
  181. package/src/Reachability/Reachability.ts +35 -0
  182. package/src/Reachability/index.ts +4 -0
  183. package/src/Reachability/types.ts +6 -0
  184. package/src/ServiceWorker/ServiceWorker.ts +1 -1
  185. package/src/{Signer.ts → Signer/Signer.ts} +2 -2
  186. package/src/Signer/index.ts +4 -0
  187. package/src/clients/middleware/retry/jitteredBackoff.ts +1 -1
  188. package/src/{Util/Constants.ts → constants.ts} +0 -5
  189. package/src/libraryUtils.ts +16 -35
  190. package/src/providers/pinpoint/apis/updateEndpoint.ts +19 -3
  191. package/src/providers/pinpoint/types/pinpoint.ts +1 -0
  192. package/src/singleton/Auth/utils/index.ts +2 -1
  193. package/src/types/core.ts +4 -1
  194. package/src/utils/convert/base64/base64Decoder.ts +11 -0
  195. package/src/utils/convert/base64/base64Encoder.ts +18 -0
  196. package/src/utils/convert/base64/bytesToString.ts +6 -0
  197. package/src/utils/convert/index.ts +5 -0
  198. package/src/utils/convert/types.ts +17 -0
  199. package/src/utils/generateRandomString.ts +16 -0
  200. package/src/utils/globalHelpers/index.native.ts +28 -0
  201. package/src/utils/globalHelpers/index.ts +54 -0
  202. package/src/utils/index.ts +15 -0
  203. package/src/utils/isBrowser.ts +5 -0
  204. package/src/utils/isWebWorker.ts +13 -0
  205. package/src/utils/retry/NonRetryableError.ts +9 -0
  206. package/src/utils/retry/constants.ts +4 -0
  207. package/src/utils/retry/index.ts +8 -0
  208. package/src/utils/retry/isNonRetryableError.ts +9 -0
  209. package/src/utils/retry/jitteredBackoff.ts +21 -0
  210. package/src/utils/retry/jitteredExponentialRetry.ts +18 -0
  211. package/src/{Util/Retry.ts → utils/retry/retry.ts} +4 -44
  212. package/src/{Util/StringUtils.ts → utils/urlSafeDecode.ts} +0 -6
  213. package/src/utils/urlSafeEncode.ts +9 -0
  214. package/lib/Util/JS.d.ts +0 -29
  215. package/lib/Util/JS.js +0 -214
  216. package/lib/Util/Reachability.d.ts +0 -13
  217. package/lib/Util/Reachability.js +0 -69
  218. package/lib/Util/Reachability.native.d.ts +0 -12
  219. package/lib/Util/Retry.d.ts +0 -21
  220. package/lib/Util/index.d.ts +0 -7
  221. package/lib/Util/index.js +0 -31
  222. package/lib-esm/Util/JS.d.ts +0 -29
  223. package/lib-esm/Util/JS.js +0 -199
  224. package/lib-esm/Util/Reachability.d.ts +0 -13
  225. package/lib-esm/Util/Reachability.js +0 -64
  226. package/lib-esm/Util/Reachability.native.d.ts +0 -12
  227. package/lib-esm/Util/Retry.d.ts +0 -21
  228. package/lib-esm/Util/index.d.ts +0 -7
  229. package/lib-esm/Util/index.js +0 -9
  230. package/src/Util/JS.ts +0 -255
  231. package/src/Util/Reachability.ts +0 -58
  232. package/src/Util/index.ts +0 -23
  233. /package/lib/{Util → Signer}/DateUtils.d.ts +0 -0
  234. /package/lib/{Util → Signer}/DateUtils.js +0 -0
  235. /package/lib/{Signer.d.ts → Signer/Signer.d.ts} +0 -0
  236. /package/lib-esm/{Util → Signer}/DateUtils.d.ts +0 -0
  237. /package/lib-esm/{Util → Signer}/DateUtils.js +0 -0
  238. /package/lib-esm/{Signer.d.ts → Signer/Signer.d.ts} +0 -0
  239. /package/src/{Util → Signer}/DateUtils.ts +0 -0
@@ -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,18 +1,5 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
16
3
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
4
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
5
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -60,8 +47,8 @@ var __values = (this && this.__values) || function(o) {
60
47
  };
61
48
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
62
49
  };
63
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
64
- // SPDX-License-Identifier: Apache-2.0
50
+ import { BackgroundManagerNotOpenError } from './BackgroundManagerNotOpenError';
51
+ import { BackgroundProcessManagerState } from './types';
65
52
  /**
66
53
  * @private For internal Amplify use.
67
54
  *
@@ -414,33 +401,3 @@ var BackgroundProcessManager = /** @class */ (function () {
414
401
  return BackgroundProcessManager;
415
402
  }());
416
403
  export { BackgroundProcessManager };
417
- /**
418
- *
419
- */
420
- var BackgroundManagerNotOpenError = /** @class */ (function (_super) {
421
- __extends(BackgroundManagerNotOpenError, _super);
422
- function BackgroundManagerNotOpenError(message) {
423
- return _super.call(this, "BackgroundManagerNotOpenError: ".concat(message)) || this;
424
- }
425
- return BackgroundManagerNotOpenError;
426
- }(Error));
427
- export { BackgroundManagerNotOpenError };
428
- /**
429
- * All possible states a `BackgroundProcessManager` instance can be in.
430
- */
431
- export var BackgroundProcessManagerState;
432
- (function (BackgroundProcessManagerState) {
433
- /**
434
- * Accepting new jobs.
435
- */
436
- BackgroundProcessManagerState["Open"] = "Open";
437
- /**
438
- * Not accepting new jobs. Waiting for submitted jobs to complete.
439
- */
440
- BackgroundProcessManagerState["Closing"] = "Closing";
441
- /**
442
- * Not accepting new jobs. All submitted jobs are complete.
443
- */
444
- BackgroundProcessManagerState["Closed"] = "Closed";
445
- })(BackgroundProcessManagerState || (BackgroundProcessManagerState = {}));
446
- var process = new BackgroundProcessManager();
@@ -0,0 +1 @@
1
+ export { BackgroundProcessManager } from './BackgroundProcessManager';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { BackgroundProcessManager } from './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,20 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ /**
4
+ * All possible states a `BackgroundProcessManager` instance can be in.
5
+ */
6
+ export var BackgroundProcessManagerState;
7
+ (function (BackgroundProcessManagerState) {
8
+ /**
9
+ * Accepting new jobs.
10
+ */
11
+ BackgroundProcessManagerState["Open"] = "Open";
12
+ /**
13
+ * Not accepting new jobs. Waiting for submitted jobs to complete.
14
+ */
15
+ BackgroundProcessManagerState["Closing"] = "Closing";
16
+ /**
17
+ * Not accepting new jobs. All submitted jobs are complete.
18
+ */
19
+ BackgroundProcessManagerState["Closed"] = "Closed";
20
+ })(BackgroundProcessManagerState || (BackgroundProcessManagerState = {}));
@@ -37,7 +37,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
37
37
  return to.concat(ar || Array.prototype.slice.call(from));
38
38
  };
39
39
  import { ConsoleLogger as Logger } from '../Logger';
40
- import { NO_HUBCALLBACK_PROVIDED_EXCEPTION } from '../Util/Constants';
40
+ import { NO_HUBCALLBACK_PROVIDED_EXCEPTION } from '../constants';
41
41
  import { AmplifyError } from '../errors';
42
42
  export var AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
43
43
  ? Symbol.for('amplify_default')
@@ -36,7 +36,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
36
36
  }
37
37
  return to.concat(ar || Array.prototype.slice.call(from));
38
38
  };
39
- import { AWS_CLOUDWATCH_CATEGORY } from '../Util/Constants';
39
+ import { AWS_CLOUDWATCH_CATEGORY } from '../constants';
40
40
  var LOG_LEVELS = {
41
41
  VERBOSE: 1,
42
42
  DEBUG: 2,
@@ -21,20 +21,8 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
22
  * THE SOFTWARE.
23
23
  */
24
- interface MutexInterface {
25
- acquire(): Promise<MutexInterface.Releaser>;
26
- runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
27
- isLocked(): boolean;
28
- }
29
- declare namespace MutexInterface {
30
- interface Releaser {
31
- (): void;
32
- }
33
- interface Worker<T> {
34
- (): Promise<T> | T;
35
- }
36
- }
37
- declare class Mutex implements MutexInterface {
24
+ import { MutexInterface } from './types';
25
+ export declare class Mutex implements MutexInterface {
38
26
  isLocked(): boolean;
39
27
  acquire(): Promise<MutexInterface.Releaser>;
40
28
  runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
@@ -42,4 +30,3 @@ declare class Mutex implements MutexInterface {
42
30
  private _queue;
43
31
  private _pending;
44
32
  }
45
- export default Mutex;
@@ -68,4 +68,4 @@ var Mutex = /** @class */ (function () {
68
68
  };
69
69
  return Mutex;
70
70
  }());
71
- export default Mutex;
71
+ export { Mutex };
@@ -0,0 +1 @@
1
+ export { Mutex } from './Mutex';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { Mutex } from './Mutex';
@@ -0,0 +1,13 @@
1
+ export interface MutexInterface {
2
+ acquire(): Promise<MutexInterface.Releaser>;
3
+ runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
4
+ isLocked(): boolean;
5
+ }
6
+ export declare namespace MutexInterface {
7
+ interface Releaser {
8
+ (): void;
9
+ }
10
+ interface Worker<T> {
11
+ (): Promise<T> | T;
12
+ }
13
+ }
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -1 +1 @@
1
- export declare const version = "6.0.1-console-preview.67f944e.0+67f944e";
1
+ export declare const version = "6.0.1-console-preview.0bbe168.0+0bbe168";
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export var version = '6.0.1-console-preview.67f944e.0+67f944e';
2
+ export var version = '6.0.1-console-preview.0bbe168.0+0bbe168';
@@ -0,0 +1,6 @@
1
+ import { Observable } from 'rxjs';
2
+ import { NetworkStatus } from './types';
3
+ export declare class Reachability {
4
+ private static _observers;
5
+ networkMonitor(_?: unknown): Observable<NetworkStatus>;
6
+ }
@@ -0,0 +1,26 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { Observable } from 'rxjs';
4
+ import { isWebWorker } from '../libraryUtils';
5
+ export var Reachability = /** @class */ (function () {
6
+ function Reachability() {
7
+ }
8
+ Reachability.prototype.networkMonitor = function (_) {
9
+ var globalObj = isWebWorker() ? self : window;
10
+ return new Observable(function (observer) {
11
+ observer.next({ online: globalObj.navigator.onLine });
12
+ var notifyOnline = function () { return observer.next({ online: true }); };
13
+ var notifyOffline = function () { return observer.next({ online: false }); };
14
+ globalObj.addEventListener('online', notifyOnline);
15
+ globalObj.addEventListener('offline', notifyOffline);
16
+ Reachability._observers.push(observer);
17
+ return function () {
18
+ globalObj.removeEventListener('online', notifyOnline);
19
+ globalObj.removeEventListener('offline', notifyOffline);
20
+ Reachability._observers = Reachability._observers.filter(function (_observer) { return _observer !== observer; });
21
+ };
22
+ });
23
+ };
24
+ Reachability._observers = [];
25
+ return Reachability;
26
+ }());
@@ -0,0 +1,6 @@
1
+ import { Observable } from 'rxjs';
2
+ import type NetInfo from '@react-native-community/netinfo';
3
+ import { NetworkStatus } from './types';
4
+ export declare class Reachability {
5
+ networkMonitor(netInfo?: typeof NetInfo): Observable<NetworkStatus>;
6
+ }
@@ -1,12 +1,12 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import Observable from 'zen-observable-ts';
3
+ import { Observable } from 'rxjs';
4
4
  import { ConsoleLogger as Logger } from '../Logger';
5
5
  var logger = new Logger('Reachability', 'DEBUG');
6
- var ReachabilityNavigator = /** @class */ (function () {
7
- function ReachabilityNavigator() {
6
+ var Reachability = /** @class */ (function () {
7
+ function Reachability() {
8
8
  }
9
- ReachabilityNavigator.prototype.networkMonitor = function (netInfo) {
9
+ Reachability.prototype.networkMonitor = function (netInfo) {
10
10
  /**
11
11
  * Here netinfo refers to @react-native-community/netinfo
12
12
  * This is needed in React Native to enable network detection
@@ -34,6 +34,6 @@ var ReachabilityNavigator = /** @class */ (function () {
34
34
  };
35
35
  });
36
36
  };
37
- return ReachabilityNavigator;
37
+ return Reachability;
38
38
  }());
39
- export default ReachabilityNavigator;
39
+ export { Reachability };
@@ -0,0 +1 @@
1
+ export { Reachability } from './Reachability';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { Reachability } from './Reachability';
@@ -0,0 +1,3 @@
1
+ export type NetworkStatus = {
2
+ online: boolean;
3
+ };
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { ConsoleLogger as Logger } from '../Logger';
4
- import { isBrowser } from '../Util/JS';
4
+ import { isBrowser } from '../utils';
5
5
  import { Amplify } from '../Amplify';
6
6
  import { AmplifyError } from '../errors';
7
7
  import { assert, ServiceWorkerErrorCode } from './errorHelpers';
@@ -11,8 +11,8 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  return __assign.apply(this, arguments);
13
13
  };
14
- import { DateUtils } from './Util';
15
- import { presignUrl, signRequest, TOKEN_QUERY_PARAM, } from './clients/middleware/signing/signer/signatureV4';
14
+ import { DateUtils } from './DateUtils';
15
+ import { presignUrl, signRequest, TOKEN_QUERY_PARAM, } from '../clients/middleware/signing/signer/signatureV4';
16
16
  var IOT_SERVICE_NAME = 'iotdevicegateway';
17
17
  // Best practice regex to parse the service and region from an AWS endpoint
18
18
  var AWS_ENDPOINT_REGEX = /([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(.cn)?$/;
@@ -0,0 +1 @@
1
+ export { Signer } from './Signer';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { Signer } from './Signer';
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // TODO: [v6] The separate retry utility is used by Data packages now and will replaced by retry middleware.
4
- import { jitteredBackoff as jitteredBackoffUtil } from '../../../Util/Retry';
4
+ import { jitteredBackoff as jitteredBackoffUtil } from '../../../utils';
5
5
  var DEFAULT_MAX_DELAY_MS = 5 * 60 * 1000;
6
6
  export var jitteredBackoff = function (attempt) {
7
7
  var delayFunction = jitteredBackoffUtil(DEFAULT_MAX_DELAY_MS);
@@ -1,6 +1,4 @@
1
1
  export declare const AWS_CLOUDWATCH_CATEGORY = "Logging";
2
- export declare const NO_CREDS_ERROR_STRING = "No credentials";
3
- export declare const RETRY_ERROR_CODES: string[];
4
2
  export declare const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER: string | symbol;
5
3
  export declare const USER_AGENT_HEADER = "x-amz-user-agent";
6
4
  export declare const NO_HUBCALLBACK_PROVIDED_EXCEPTION = "NoHubcallbackProvidedException";
@@ -2,11 +2,6 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // Logging constants
4
4
  export var AWS_CLOUDWATCH_CATEGORY = 'Logging';
5
- export var NO_CREDS_ERROR_STRING = 'No credentials';
6
- export var RETRY_ERROR_CODES = [
7
- 'ResourceNotFoundException',
8
- 'InvalidSequenceTokenException',
9
- ];
10
5
  /**
11
6
  * This Symbol is used to reference an internal-only PubSub provider that
12
7
  * is used for AppSync/GraphQL subscriptions in the API category.
@@ -1,4 +1,4 @@
1
- export { isBrowser, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './Util/JS';
1
+ export { generateRandomString, isBrowser, isNonRetryableError, isWebWorker, jitteredBackoff, jitteredExponentialRetry, NonRetryableError, retry, urlSafeDecode, urlSafeEncode, } from './utils';
2
2
  export { parseAWSExports } from './parseAWSExports';
3
3
  export { LegacyConfig } from './singleton/types';
4
4
  export { JWT, StrictUnion, CognitoIdentityPoolConfig, JwtPayload, } from './singleton/Auth/types';
@@ -10,13 +10,14 @@ export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
10
10
  export { ClientDevice } from './ClientDevice';
11
11
  export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
12
12
  export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
13
- export declare const Constants: {
14
- userAgent: string;
15
- };
16
13
  export { ServiceWorker } from './ServiceWorker';
17
- export { AWS_CLOUDWATCH_CATEGORY, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
14
+ export { BackgroundProcessManager } from './BackgroundProcessManager';
15
+ export { Mutex } from './Mutex';
16
+ export { Reachability } from './Reachability';
18
17
  export { AmplifyError, PlatformNotSupportedError, createAssertionFunction, } from './errors';
19
18
  export { AmplifyErrorCode, AmplifyErrorMap, AmplifyErrorParams, AssertionFunction, ServiceError, } from './types';
20
- export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './Util/Constants';
19
+ export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './constants';
21
20
  export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
22
21
  export { AMPLIFY_SYMBOL } from './Hub';
22
+ export { base64Decoder, base64Encoder } from './utils/convert';
23
+ export { getCrypto } from './utils/globalHelpers';
@@ -4,8 +4,8 @@
4
4
  This file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal
5
5
  utils for use throughout the library.
6
6
  */
7
- // JS utilities
8
- export { isBrowser, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './Util/JS';
7
+ // Core utilities
8
+ export { generateRandomString, isBrowser, isNonRetryableError, isWebWorker, jitteredBackoff, jitteredExponentialRetry, NonRetryableError, retry, urlSafeDecode, urlSafeEncode, } from './utils';
9
9
  export { parseAWSExports } from './parseAWSExports';
10
10
  // Auth utilities
11
11
  export { decodeJWT, assertTokenProviderConfig, assertIdentityPoolIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
@@ -14,19 +14,19 @@ export { Signer } from './Signer';
14
14
  // Logging utilities
15
15
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
16
16
  // Platform & device utils
17
- import { Platform } from './Platform';
18
17
  export { ClientDevice } from './ClientDevice';
19
18
  export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
20
19
  export { ApiAction, AuthAction, AnalyticsAction, Category, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
21
- export var Constants = {
22
- userAgent: Platform.userAgent,
23
- };
24
20
  // Service worker
25
21
  export { ServiceWorker } from './ServiceWorker';
26
22
  // Other utilities & constants
27
- export { AWS_CLOUDWATCH_CATEGORY, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
23
+ export { BackgroundProcessManager } from './BackgroundProcessManager';
24
+ export { Mutex } from './Mutex';
25
+ export { Reachability } from './Reachability';
28
26
  export { AmplifyError, PlatformNotSupportedError, createAssertionFunction, } from './errors';
29
27
  export { AmplifyErrorCode, } from './types';
30
- export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './Util/Constants';
28
+ export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './constants';
31
29
  export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
32
30
  export { AMPLIFY_SYMBOL } from './Hub';
31
+ export { base64Decoder, base64Encoder } from './utils/convert';
32
+ export { getCrypto } from './utils/globalHelpers';
@@ -2,4 +2,4 @@ import { PinpointUpdateEndpointInput } from '../types';
2
2
  /**
3
3
  * @internal
4
4
  */
5
- export declare const updateEndpoint: ({ address, appId, category, channelType, credentials, identityId, optOut, region, userId, userProfile, userAgentValue, }: PinpointUpdateEndpointInput) => Promise<void>;
5
+ export declare const updateEndpoint: ({ address, appId, category, channelType, credentials, identityId, optOut, region, userAttributes, userId, userProfile, userAgentValue, }: PinpointUpdateEndpointInput) => Promise<void>;
@@ -55,18 +55,20 @@ import { cacheEndpointId, getEndpointId } from '../utils';
55
55
  * @internal
56
56
  */
57
57
  export var updateEndpoint = function (_a) {
58
- var address = _a.address, appId = _a.appId, category = _a.category, channelType = _a.channelType, credentials = _a.credentials, identityId = _a.identityId, optOut = _a.optOut, region = _a.region, userId = _a.userId, userProfile = _a.userProfile, userAgentValue = _a.userAgentValue;
58
+ var address = _a.address, appId = _a.appId, category = _a.category, channelType = _a.channelType, credentials = _a.credentials, identityId = _a.identityId, optOut = _a.optOut, region = _a.region, userAttributes = _a.userAttributes, userId = _a.userId, userProfile = _a.userProfile, userAgentValue = _a.userAgentValue;
59
59
  return __awaiter(void 0, void 0, void 0, function () {
60
- var endpointId, createdEndpointId, _b, attributes, demographic, location, metrics, clientInfo, mergedDemographic, input;
60
+ var endpointId, createdEndpointId, _b, customProperties, demographic, email, location, metrics, name, plan, clientInfo, mergedDemographic, shouldAddAttributes, attributes, input;
61
61
  return __generator(this, function (_c) {
62
62
  switch (_c.label) {
63
63
  case 0: return [4 /*yield*/, getEndpointId(appId, category)];
64
64
  case 1:
65
65
  endpointId = _c.sent();
66
66
  createdEndpointId = !endpointId ? uuidv4() : undefined;
67
- _b = userProfile !== null && userProfile !== void 0 ? userProfile : {}, attributes = _b.attributes, demographic = _b.demographic, location = _b.location, metrics = _b.metrics;
67
+ _b = userProfile !== null && userProfile !== void 0 ? userProfile : {}, customProperties = _b.customProperties, demographic = _b.demographic, email = _b.email, location = _b.location, metrics = _b.metrics, name = _b.name, plan = _b.plan;
68
68
  clientInfo = ClientDevice.clientInfo();
69
69
  mergedDemographic = __assign({ appVersion: clientInfo.appVersion, make: clientInfo.make, model: clientInfo.model, modelVersion: clientInfo.version, platform: clientInfo.platform }, demographic);
70
+ shouldAddAttributes = email || customProperties || name || plan;
71
+ attributes = __assign(__assign(__assign(__assign({}, (email && { email: [email] })), (name && { name: [name] })), (plan && { plan: [plan] })), customProperties);
70
72
  input = {
71
73
  ApplicationId: appId,
72
74
  EndpointId: endpointId !== null && endpointId !== void 0 ? endpointId : createdEndpointId,
@@ -75,7 +77,7 @@ export var updateEndpoint = function (_a) {
75
77
  EffectiveDate: new Date().toISOString(),
76
78
  ChannelType: channelType,
77
79
  Address: address,
78
- Attributes: attributes,
80
+ Attributes: shouldAddAttributes ? attributes : undefined,
79
81
  Demographic: {
80
82
  AppVersion: mergedDemographic.appVersion,
81
83
  Locale: mergedDemographic.locale,
@@ -98,7 +100,7 @@ export var updateEndpoint = function (_a) {
98
100
  OptOut: optOut,
99
101
  User: {
100
102
  UserId: userId !== null && userId !== void 0 ? userId : identityId,
101
- UserAttributes: attributes,
103
+ UserAttributes: userAttributes,
102
104
  },
103
105
  },
104
106
  };
@@ -11,6 +11,7 @@ export type PinpointProviderConfig = {
11
11
  export type PinpointServiceOptions = {
12
12
  address?: string;
13
13
  optOut?: 'ALL' | 'NONE';
14
+ userAttributes?: Record<string, string[]>;
14
15
  };
15
16
  export type PinpointSession = {
16
17
  Id: string;
@@ -1,6 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { AuthConfigurationErrorCode, assert } from './errorHelpers';
4
+ import { base64Decoder } from '../../../utils/convert';
4
5
  export function assertTokenProviderConfig(cognitoConfig) {
5
6
  var assertionValid = true; // assume valid until otherwise proveed
6
7
  if (!cognitoConfig) {
@@ -48,6 +49,6 @@ export function decodeJWT(token) {
48
49
  }
49
50
  }
50
51
  function base64ToBytes(base64) {
51
- var binString = atob(base64);
52
+ var binString = base64Decoder.convert(base64);
52
53
  return Uint8Array.from(binString, function (m) { return m.codePointAt(0) || 0; });
53
54
  }