@aws-amplify/core 4.7.12 → 4.7.13-unstable.2

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 (274) hide show
  1. package/CHANGELOG.md +0 -8
  2. package/lib/.tsbuildinfo +3 -0
  3. package/lib/Amplify.d.ts +28 -0
  4. package/lib/Amplify.js +3 -21
  5. package/lib/Amplify.js.map +1 -1
  6. package/lib/ClientDevice/android.d.ts +5 -0
  7. package/lib/ClientDevice/android.js +2 -12
  8. package/lib/ClientDevice/android.js.map +1 -1
  9. package/lib/ClientDevice/browser.d.ts +25 -0
  10. package/lib/ClientDevice/browser.js +2 -12
  11. package/lib/ClientDevice/browser.js.map +1 -1
  12. package/lib/ClientDevice/index.d.ts +23 -0
  13. package/lib/ClientDevice/index.js +2 -16
  14. package/lib/ClientDevice/index.js.map +1 -1
  15. package/lib/ClientDevice/ios.d.ts +7 -0
  16. package/lib/ClientDevice/ios.js +2 -12
  17. package/lib/ClientDevice/ios.js.map +1 -1
  18. package/lib/ClientDevice/reactnative.d.ts +7 -0
  19. package/lib/ClientDevice/reactnative.js +2 -16
  20. package/lib/ClientDevice/reactnative.js.map +1 -1
  21. package/lib/Credentials.d.ts +47 -0
  22. package/lib/Credentials.js +52 -86
  23. package/lib/Credentials.js.map +1 -1
  24. package/lib/Errors.d.ts +2 -0
  25. package/lib/Errors.js +2 -12
  26. package/lib/Errors.js.map +1 -1
  27. package/lib/Hub.d.ts +55 -0
  28. package/lib/Hub.js +41 -57
  29. package/lib/Hub.js.map +1 -1
  30. package/lib/I18n/I18n.d.ts +59 -0
  31. package/lib/I18n/I18n.js +2 -12
  32. package/lib/I18n/I18n.js.map +1 -1
  33. package/lib/I18n/index.d.ts +49 -0
  34. package/lib/I18n/index.js +2 -16
  35. package/lib/I18n/index.js.map +1 -1
  36. package/lib/I18n/types.d.ts +3 -0
  37. package/lib/I18n/types.js +2 -12
  38. package/lib/I18n/types.js.map +1 -1
  39. package/lib/JS.d.ts +32 -0
  40. package/lib/JS.js +4 -39
  41. package/lib/JS.js.map +1 -1
  42. package/lib/Logger/ConsoleLogger.d.ts +80 -0
  43. package/lib/Logger/ConsoleLogger.js +10 -50
  44. package/lib/Logger/ConsoleLogger.js.map +1 -1
  45. package/lib/Logger/index.d.ts +1 -0
  46. package/lib/Logger/index.js +5 -16
  47. package/lib/Logger/index.js.map +1 -1
  48. package/lib/Logger/logger-interface.d.ts +8 -0
  49. package/lib/Logger/logger-interface.js +2 -12
  50. package/lib/Logger/logger-interface.js.map +1 -1
  51. package/lib/OAuthHelper/FacebookOAuth.d.ts +6 -0
  52. package/lib/OAuthHelper/FacebookOAuth.js +5 -54
  53. package/lib/OAuthHelper/FacebookOAuth.js.map +1 -1
  54. package/lib/OAuthHelper/GoogleOAuth.d.ts +6 -0
  55. package/lib/OAuthHelper/GoogleOAuth.js +5 -54
  56. package/lib/OAuthHelper/GoogleOAuth.js.map +1 -1
  57. package/lib/OAuthHelper/index.d.ts +4 -0
  58. package/lib/OAuthHelper/index.js +2 -12
  59. package/lib/OAuthHelper/index.js.map +1 -1
  60. package/lib/Platform/index.d.ts +7 -0
  61. package/lib/Platform/index.js +2 -16
  62. package/lib/Platform/index.js.map +1 -1
  63. package/lib/Platform/version.d.ts +1 -0
  64. package/lib/Platform/version.js +1 -1
  65. package/lib/Platform/version.js.map +1 -1
  66. package/lib/Providers/AWSCloudWatchProvider.d.ts +34 -0
  67. package/lib/Providers/AWSCloudWatchProvider.js +32 -97
  68. package/lib/Providers/AWSCloudWatchProvider.js.map +1 -1
  69. package/lib/Providers/index.d.ts +1 -0
  70. package/lib/Providers/index.js +2 -4
  71. package/lib/Providers/index.js.map +1 -1
  72. package/lib/RNComponents/index.d.ts +5 -0
  73. package/lib/RNComponents/index.js +2 -12
  74. package/lib/RNComponents/index.js.map +1 -1
  75. package/lib/RNComponents/reactnative.d.ts +3 -0
  76. package/lib/RNComponents/reactnative.js +4 -16
  77. package/lib/RNComponents/reactnative.js.map +1 -1
  78. package/lib/ServiceWorker/ServiceWorker.d.ts +68 -0
  79. package/lib/ServiceWorker/ServiceWorker.js +0 -4
  80. package/lib/ServiceWorker/ServiceWorker.js.map +1 -1
  81. package/lib/ServiceWorker/index.d.ts +13 -0
  82. package/lib/Signer.d.ts +41 -0
  83. package/lib/Signer.js +8 -43
  84. package/lib/Signer.js.map +1 -1
  85. package/lib/StorageHelper/index.d.ts +41 -0
  86. package/lib/StorageHelper/index.js +2 -16
  87. package/lib/StorageHelper/index.js.map +1 -1
  88. package/lib/StorageHelper/reactnative.d.ts +13 -0
  89. package/lib/StorageHelper/reactnative.js +4 -20
  90. package/lib/StorageHelper/reactnative.js.map +1 -1
  91. package/lib/UniversalStorage/index.d.ts +23 -0
  92. package/lib/UniversalStorage/index.js +2 -4
  93. package/lib/UniversalStorage/index.js.map +1 -1
  94. package/lib/Util/BackgroundProcessManager.d.ts +204 -0
  95. package/lib/Util/BackgroundProcessManager.js +10 -69
  96. package/lib/Util/BackgroundProcessManager.js.map +1 -1
  97. package/lib/Util/Constants.d.ts +8 -0
  98. package/lib/Util/Constants.js +2 -12
  99. package/lib/Util/Constants.js.map +1 -1
  100. package/lib/Util/DateUtils.d.ts +7 -0
  101. package/lib/Util/DateUtils.js +2 -17
  102. package/lib/Util/DateUtils.js.map +1 -1
  103. package/lib/Util/Mutex.d.ts +45 -0
  104. package/lib/Util/Reachability.d.ts +13 -0
  105. package/lib/Util/Reachability.js +3 -16
  106. package/lib/Util/Reachability.js.map +1 -1
  107. package/lib/Util/Reachability.native.d.ts +11 -0
  108. package/lib/Util/Reachability.native.js +2 -4
  109. package/lib/Util/Reachability.native.js.map +1 -1
  110. package/lib/Util/Retry.d.ts +21 -0
  111. package/lib/Util/Retry.js +10 -78
  112. package/lib/Util/Retry.js.map +1 -1
  113. package/lib/Util/StringUtils.d.ts +2 -0
  114. package/lib/Util/index.d.ts +7 -0
  115. package/lib/Util/index.js +23 -8
  116. package/lib/Util/index.js.map +1 -1
  117. package/lib/constants.d.ts +6 -0
  118. package/lib/constants.js +2 -12
  119. package/lib/constants.js.map +1 -1
  120. package/lib/index.d.ts +29 -0
  121. package/lib/index.js +54 -25
  122. package/lib/index.js.map +1 -1
  123. package/lib/parseAWSExports.d.ts +2 -0
  124. package/lib/{Parser.js → parseAWSExports.js} +4 -28
  125. package/lib/parseAWSExports.js.map +1 -0
  126. package/lib/types/index.d.ts +1 -0
  127. package/lib/types/types.d.ts +46 -0
  128. package/lib-esm/.tsbuildinfo +3 -0
  129. package/lib-esm/Amplify.d.ts +1 -4
  130. package/lib-esm/Amplify.js +2 -20
  131. package/lib-esm/Amplify.js.map +1 -1
  132. package/lib-esm/ClientDevice/android.js +2 -12
  133. package/lib-esm/ClientDevice/android.js.map +1 -1
  134. package/lib-esm/ClientDevice/browser.js +2 -12
  135. package/lib-esm/ClientDevice/browser.js.map +1 -1
  136. package/lib-esm/ClientDevice/index.d.ts +0 -4
  137. package/lib-esm/ClientDevice/index.js +2 -16
  138. package/lib-esm/ClientDevice/index.js.map +1 -1
  139. package/lib-esm/ClientDevice/ios.js +2 -12
  140. package/lib-esm/ClientDevice/ios.js.map +1 -1
  141. package/lib-esm/ClientDevice/reactnative.d.ts +0 -7
  142. package/lib-esm/ClientDevice/reactnative.js +2 -16
  143. package/lib-esm/ClientDevice/reactnative.js.map +1 -1
  144. package/lib-esm/Credentials.d.ts +0 -4
  145. package/lib-esm/Credentials.js +24 -58
  146. package/lib-esm/Credentials.js.map +1 -1
  147. package/lib-esm/Errors.js +2 -12
  148. package/lib-esm/Errors.js.map +1 -1
  149. package/lib-esm/Hub.d.ts +28 -4
  150. package/lib-esm/Hub.js +36 -52
  151. package/lib-esm/Hub.js.map +1 -1
  152. package/lib-esm/I18n/I18n.js +2 -12
  153. package/lib-esm/I18n/I18n.js.map +1 -1
  154. package/lib-esm/I18n/index.d.ts +0 -4
  155. package/lib-esm/I18n/index.js +2 -16
  156. package/lib-esm/I18n/index.js.map +1 -1
  157. package/lib-esm/I18n/types.js +2 -12
  158. package/lib-esm/I18n/types.js.map +1 -1
  159. package/lib-esm/JS.d.ts +0 -24
  160. package/lib-esm/JS.js +4 -39
  161. package/lib-esm/JS.js.map +1 -1
  162. package/lib-esm/Logger/ConsoleLogger.js +3 -43
  163. package/lib-esm/Logger/ConsoleLogger.js.map +1 -1
  164. package/lib-esm/Logger/index.d.ts +1 -1
  165. package/lib-esm/Logger/index.js +3 -13
  166. package/lib-esm/Logger/index.js.map +1 -1
  167. package/lib-esm/Logger/logger-interface.d.ts +0 -4
  168. package/lib-esm/Logger/logger-interface.js +2 -12
  169. package/lib-esm/Logger/logger-interface.js.map +1 -1
  170. package/lib-esm/OAuthHelper/FacebookOAuth.d.ts +0 -4
  171. package/lib-esm/OAuthHelper/FacebookOAuth.js +3 -52
  172. package/lib-esm/OAuthHelper/FacebookOAuth.js.map +1 -1
  173. package/lib-esm/OAuthHelper/GoogleOAuth.d.ts +0 -4
  174. package/lib-esm/OAuthHelper/GoogleOAuth.js +3 -52
  175. package/lib-esm/OAuthHelper/GoogleOAuth.js.map +1 -1
  176. package/lib-esm/OAuthHelper/index.js +2 -12
  177. package/lib-esm/OAuthHelper/index.js.map +1 -1
  178. package/lib-esm/Platform/index.d.ts +0 -4
  179. package/lib-esm/Platform/index.js +2 -16
  180. package/lib-esm/Platform/index.js.map +1 -1
  181. package/lib-esm/Platform/version.d.ts +1 -1
  182. package/lib-esm/Platform/version.js +1 -1
  183. package/lib-esm/Platform/version.js.map +1 -1
  184. package/lib-esm/Providers/AWSCloudWatchProvider.js +5 -70
  185. package/lib-esm/Providers/AWSCloudWatchProvider.js.map +1 -1
  186. package/lib-esm/Providers/index.d.ts +1 -1
  187. package/lib-esm/Providers/index.js +1 -1
  188. package/lib-esm/Providers/index.js.map +1 -1
  189. package/lib-esm/RNComponents/index.js +2 -12
  190. package/lib-esm/RNComponents/index.js.map +1 -1
  191. package/lib-esm/RNComponents/reactnative.js +2 -12
  192. package/lib-esm/RNComponents/reactnative.js.map +1 -1
  193. package/lib-esm/ServiceWorker/ServiceWorker.d.ts +0 -4
  194. package/lib-esm/ServiceWorker/ServiceWorker.js +0 -4
  195. package/lib-esm/ServiceWorker/ServiceWorker.js.map +1 -1
  196. package/lib-esm/Signer.d.ts +0 -4
  197. package/lib-esm/Signer.js +3 -38
  198. package/lib-esm/Signer.js.map +1 -1
  199. package/lib-esm/StorageHelper/index.d.ts +0 -4
  200. package/lib-esm/StorageHelper/index.js +2 -16
  201. package/lib-esm/StorageHelper/index.js.map +1 -1
  202. package/lib-esm/StorageHelper/reactnative.d.ts +0 -4
  203. package/lib-esm/StorageHelper/reactnative.js +2 -16
  204. package/lib-esm/StorageHelper/reactnative.js.map +1 -1
  205. package/lib-esm/Util/BackgroundProcessManager.js +1 -60
  206. package/lib-esm/Util/BackgroundProcessManager.js.map +1 -1
  207. package/lib-esm/Util/Constants.js +2 -12
  208. package/lib-esm/Util/Constants.js.map +1 -1
  209. package/lib-esm/Util/DateUtils.js +1 -16
  210. package/lib-esm/Util/DateUtils.js.map +1 -1
  211. package/lib-esm/Util/Reachability.js +1 -11
  212. package/lib-esm/Util/Reachability.js.map +1 -1
  213. package/lib-esm/Util/Retry.d.ts +1 -0
  214. package/lib-esm/Util/Retry.js +2 -70
  215. package/lib-esm/Util/Retry.js.map +1 -1
  216. package/lib-esm/Util/index.d.ts +5 -5
  217. package/lib-esm/Util/index.js +5 -5
  218. package/lib-esm/Util/index.js.map +1 -1
  219. package/lib-esm/constants.js +2 -12
  220. package/lib-esm/constants.js.map +1 -1
  221. package/lib-esm/index.d.ts +8 -9
  222. package/lib-esm/index.js +10 -21
  223. package/lib-esm/index.js.map +1 -1
  224. package/lib-esm/parseAWSExports.d.ts +2 -0
  225. package/lib-esm/{Parser.js → parseAWSExports.js} +3 -27
  226. package/lib-esm/parseAWSExports.js.map +1 -0
  227. package/lib-esm/types/types.d.ts +3 -0
  228. package/package.json +13 -9
  229. package/src/Amplify.ts +1 -5
  230. package/src/ClientDevice/android.ts +2 -12
  231. package/src/ClientDevice/browser.ts +2 -12
  232. package/src/ClientDevice/index.ts +2 -17
  233. package/src/ClientDevice/ios.ts +2 -12
  234. package/src/ClientDevice/reactnative.ts +2 -17
  235. package/src/Credentials.ts +34 -6
  236. package/src/Errors.ts +2 -12
  237. package/src/Hub.ts +40 -23
  238. package/src/I18n/I18n.ts +2 -12
  239. package/src/I18n/index.ts +2 -17
  240. package/src/I18n/types.ts +2 -12
  241. package/src/JS.ts +6 -37
  242. package/src/Logger/ConsoleLogger.ts +2 -12
  243. package/src/Logger/index.ts +3 -13
  244. package/src/Logger/logger-interface.ts +2 -17
  245. package/src/OAuthHelper/FacebookOAuth.ts +2 -17
  246. package/src/OAuthHelper/GoogleOAuth.ts +2 -17
  247. package/src/OAuthHelper/index.ts +2 -12
  248. package/src/Platform/index.ts +2 -17
  249. package/src/Platform/version.ts +1 -1
  250. package/src/Providers/AWSCloudWatchProvider.ts +4 -14
  251. package/src/Providers/index.ts +1 -1
  252. package/src/RNComponents/index.ts +2 -12
  253. package/src/RNComponents/reactnative.ts +2 -12
  254. package/src/ServiceWorker/ServiceWorker.ts +1 -6
  255. package/src/Signer.ts +2 -17
  256. package/src/StorageHelper/index.ts +2 -17
  257. package/src/StorageHelper/reactnative.ts +2 -17
  258. package/src/Util/Constants.ts +2 -12
  259. package/src/Util/Retry.ts +1 -1
  260. package/src/Util/index.ts +23 -5
  261. package/src/constants.ts +2 -12
  262. package/src/index.ts +48 -21
  263. package/src/{Parser.ts → parseAWSExports.ts} +1 -13
  264. package/src/types/types.ts +3 -0
  265. package/build.js +0 -5
  266. package/dist/aws-amplify-core.js +0 -42644
  267. package/dist/aws-amplify-core.js.map +0 -1
  268. package/dist/aws-amplify-core.min.js +0 -32
  269. package/dist/aws-amplify-core.min.js.map +0 -1
  270. package/index.js +0 -7
  271. package/lib/Parser.js.map +0 -1
  272. package/lib-esm/Parser.d.ts +0 -12
  273. package/lib-esm/Parser.js.map +0 -1
  274. package/webpack.config.dev.js +0 -6
package/src/Hub.ts CHANGED
@@ -1,24 +1,15 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { ConsoleLogger as Logger } from './Logger';
15
5
 
16
6
  const logger = new Logger('Hub');
17
7
 
18
- const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' &&
19
- typeof Symbol.for === 'function'
20
- ? Symbol.for('amplify_default')
21
- : '@@amplify_default') as Symbol;
8
+ const AMPLIFY_SYMBOL = (
9
+ typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
10
+ ? Symbol.for('amplify_default')
11
+ : '@@amplify_default'
12
+ ) as Symbol;
22
13
  interface IPattern {
23
14
  pattern: RegExp;
24
15
  callback: HubCallback;
@@ -71,8 +62,13 @@ export class HubClass {
71
62
  this.name = name;
72
63
  }
73
64
 
74
- // Note - Need to pass channel as a reference for removal to work and not anonymous function
75
- remove(channel: string | RegExp, listener: HubCallback) {
65
+ /**
66
+ * Used internally to remove a Hub listener.
67
+ *
68
+ * @remarks
69
+ * This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.
70
+ */
71
+ private _remove(channel: string | RegExp, listener: HubCallback) {
76
72
  if (channel instanceof RegExp) {
77
73
  const pattern = this.patterns.find(
78
74
  ({ pattern }) => pattern.source === channel.source
@@ -94,6 +90,22 @@ export class HubClass {
94
90
  }
95
91
  }
96
92
 
93
+ /**
94
+ * @deprecated Instead of calling Hub.remove, call the result of Hub.listen.
95
+ */
96
+ remove(channel: string | RegExp, listener: HubCallback) {
97
+ this._remove(channel, listener);
98
+ }
99
+
100
+ /**
101
+ * Used to send a Hub event.
102
+ *
103
+ * @param channel - The channel on which the event will be broadcast
104
+ * @param payload - The HubPayload
105
+ * @param source - The source of the event; defaults to ''
106
+ * @param ampSymbol - Symbol used to determine if the event is dispatched internally on a protected channel
107
+ *
108
+ */
97
109
  dispatch(
98
110
  channel: string,
99
111
  payload: HubPayload,
@@ -124,6 +136,15 @@ export class HubClass {
124
136
  }
125
137
  }
126
138
 
139
+ /**
140
+ * Used to listen for Hub events.
141
+ *
142
+ * @param channel - The channel on which to listen
143
+ * @param callback - The callback to execute when an event is received on the specified channel
144
+ * @param listenerName - The name of the listener; defaults to 'noname'
145
+ * @returns A function which can be called to cancel the listener.
146
+ *
147
+ */
127
148
  listen(
128
149
  channel: string | RegExp,
129
150
  callback?: HubCallback | LegacyCallback,
@@ -162,7 +183,7 @@ export class HubClass {
162
183
  }
163
184
 
164
185
  return () => {
165
- this.remove(channel, cb);
186
+ this._remove(channel, cb);
166
187
  };
167
188
  }
168
189
 
@@ -212,7 +233,3 @@ export class HubClass {
212
233
  pseudo Singleton for the main messaging bus, however you can still create
213
234
  your own instance of HubClass() for a separate "private bus" of events.*/
214
235
  export const Hub = new HubClass('__default__');
215
- /**
216
- * @deprecated use named import
217
- */
218
- export default Hub;
package/src/I18n/I18n.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { I18nOptions } from './types';
15
5
  import { ConsoleLogger as Logger } from '../Logger';
package/src/I18n/index.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { I18n as I18nClass } from './I18n';
15
5
 
@@ -122,8 +112,3 @@ export class I18n {
122
112
  }
123
113
 
124
114
  Amplify.register(I18n);
125
-
126
- /**
127
- * @deprecated use named import
128
- */
129
- export default I18n;
package/src/I18n/types.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  export class I18nOptions {
15
5
  language = null;
package/src/JS.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  const MIME_MAP = [
15
5
  { type: 'text/plain', ext: 'txt' },
@@ -167,8 +157,10 @@ export const isWebWorker = () => {
167
157
  return false;
168
158
  }
169
159
  const selfContext = self as { WorkerGlobalScope? };
170
- return typeof selfContext.WorkerGlobalScope !== 'undefined' &&
171
- self instanceof selfContext.WorkerGlobalScope;
160
+ return (
161
+ typeof selfContext.WorkerGlobalScope !== 'undefined' &&
162
+ self instanceof selfContext.WorkerGlobalScope
163
+ );
172
164
  };
173
165
 
174
166
  export const browserOrNode = () => {
@@ -265,26 +257,3 @@ export const isStrictObject = obj => {
265
257
  !(obj instanceof Boolean)
266
258
  );
267
259
  };
268
-
269
- /**
270
- * @deprecated use per-function imports
271
- */
272
- export class JS {
273
- static isEmpty = isEmpty;
274
- static sortByField = sortByField;
275
- static objectLessAttributes = objectLessAttributes;
276
- static filenameToContentType = filenameToContentType;
277
- static isTextFile = isTextFile;
278
- static generateRandomString = generateRandomString;
279
- static makeQuerablePromise = makeQuerablePromise;
280
- static isWebWorker = isWebWorker;
281
- static browserOrNode = browserOrNode;
282
- static transferKeyToLowerCase = transferKeyToLowerCase;
283
- static transferKeyToUpperCase = transferKeyToUpperCase;
284
- static isStrictObject = isStrictObject;
285
- }
286
-
287
- /**
288
- * @deprecated use per-function imports
289
- */
290
- export default JS;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { InputLogEvent } from '@aws-sdk/client-cloudwatch-logs';
15
5
  import { LoggingProvider } from '../types';
@@ -1,14 +1,4 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
- export * from './ConsoleLogger';
4
+ export { ConsoleLogger, LOG_TYPE } from './ConsoleLogger';
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { LoggingProvider } from '../types';
15
5
 
@@ -20,8 +10,3 @@ export interface Logger {
20
10
  error(msg: string): void;
21
11
  addPluggable(pluggable: LoggingProvider): void;
22
12
  }
23
-
24
- /**
25
- * @deprecated use named import
26
- */
27
- export default Logger;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { ConsoleLogger as Logger } from '../Logger';
14
4
  import { browserOrNode } from '../JS';
15
5
  import { NonRetryableError } from '../Util';
@@ -91,8 +81,3 @@ export class FacebookOAuth {
91
81
  });
92
82
  }
93
83
  }
94
-
95
- /**
96
- * @deprecated use named import
97
- */
98
- export default FacebookOAuth;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { ConsoleLogger as Logger } from '../Logger';
14
4
  import { browserOrNode } from '../JS';
15
5
  import { NonRetryableError } from '../Util';
@@ -102,8 +92,3 @@ export class GoogleOAuth {
102
92
  });
103
93
  }
104
94
  }
105
-
106
- /**
107
- * @deprecated use named import
108
- */
109
- export default GoogleOAuth;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { GoogleOAuth as GoogleOAuthClass } from './GoogleOAuth';
14
4
  import { FacebookOAuth as FacebookOAuthClass } from './FacebookOAuth';
15
5
 
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { version } from './version';
14
4
 
15
5
  const BASE_USER_AGENT = `aws-amplify/${version}`;
@@ -38,8 +28,3 @@ if (typeof navigator !== 'undefined' && navigator.product) {
38
28
  export const getAmplifyUserAgent = (content?: string) => {
39
29
  return `${Platform.userAgent}${content ? content : ''}`;
40
30
  };
41
-
42
- /**
43
- * @deprecated use named import
44
- */
45
- export default Platform;
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '4.7.11';
2
+ export const version = '5.0.0';
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import {
15
5
  CloudWatchLogsClient,
@@ -43,7 +33,7 @@ import {
43
33
  import { Credentials } from '../..';
44
34
  import { ConsoleLogger as Logger } from '../Logger';
45
35
  import { getAmplifyUserAgent } from '../Platform';
46
- import { parseMobileHubConfig } from '../Parser';
36
+ import { parseAWSExports } from '../parseAWSExports';
47
37
  import {
48
38
  AWS_CLOUDWATCH_BASE_BUFFER_SIZE,
49
39
  AWS_CLOUDWATCH_CATEGORY,
@@ -96,7 +86,7 @@ class AWSCloudWatchProvider implements LoggingProvider {
96
86
  const conf = Object.assign(
97
87
  {},
98
88
  this._config,
99
- parseMobileHubConfig(config).Logging,
89
+ parseAWSExports(config).Logging,
100
90
  config
101
91
  );
102
92
  this._config = conf;
@@ -1 +1 @@
1
- export * from './AWSCloudWatchProvider';
1
+ export { AWSCloudWatchProvider } from './AWSCloudWatchProvider';
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { browserOrNode } from '../JS';
15
5
  import { StorageHelper } from '../StorageHelper';
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { Linking, AppState } from 'react-native';
15
5
  import AsyncStorage from '@react-native-async-storage/async-storage';
@@ -42,7 +42,7 @@ export class ServiceWorkerClass {
42
42
  // The AWS Amplify logger
43
43
  private _logger: Logger = new Logger('ServiceWorker');
44
44
 
45
- constructor() { }
45
+ constructor() {}
46
46
 
47
47
  /**
48
48
  * Get the currently active service worker
@@ -202,8 +202,3 @@ export class ServiceWorkerClass {
202
202
  });
203
203
  }
204
204
  }
205
-
206
- /**
207
- * @deprecated use named import
208
- */
209
- export default ServiceWorkerClass;
package/src/Signer.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { ConsoleLogger as Logger } from './Logger';
15
5
  import { Sha256 as jsSha256 } from '@aws-crypto/sha256-js';
@@ -439,8 +429,3 @@ export class Signer {
439
429
  return result;
440
430
  }
441
431
  }
442
-
443
- /**
444
- * @deprecated use per-function import
445
- */
446
- export default Signer;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  let dataMemory = {};
15
5
 
@@ -81,8 +71,3 @@ export class StorageHelper {
81
71
  return this.storageWindow;
82
72
  }
83
73
  }
84
-
85
- /**
86
- * @deprecated use named import
87
- */
88
- export default StorageHelper;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import AsyncStorage from '@react-native-async-storage/async-storage';
14
4
 
15
5
  const MEMORY_KEY_PREFIX = '@MemoryStorage:';
@@ -110,8 +100,3 @@ export class StorageHelper {
110
100
  return this.storageWindow;
111
101
  }
112
102
  }
113
-
114
- /**
115
- * @deprecated use named import
116
- */
117
- export default StorageHelper;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  // Logging constants
15
5
  const AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;
package/src/Util/Retry.ts CHANGED
@@ -9,7 +9,7 @@ export class NonRetryableError extends Error {
9
9
  }
10
10
  }
11
11
 
12
- const isNonRetryableError = (obj: any): obj is NonRetryableError => {
12
+ export const isNonRetryableError = (obj: any): obj is NonRetryableError => {
13
13
  const key: keyof NonRetryableError = 'nonRetryable';
14
14
  return obj && obj[key];
15
15
  };
package/src/Util/index.ts CHANGED
@@ -1,7 +1,25 @@
1
- export * from './Retry';
1
+ export {
2
+ NonRetryableError,
3
+ isNonRetryableError,
4
+ jitteredBackoff,
5
+ jitteredExponentialRetry,
6
+ retry,
7
+ } from './Retry';
2
8
  export { default as Mutex } from './Mutex';
3
9
  export { default as Reachability } from './Reachability';
4
- export * from './DateUtils';
5
- export * from './StringUtils';
6
- export * from './Constants';
7
- export * from './BackgroundProcessManager';
10
+ export { DateUtils } from './DateUtils';
11
+ export { urlSafeDecode, urlSafeEncode } from './StringUtils';
12
+ export {
13
+ AWS_CLOUDWATCH_BASE_BUFFER_SIZE,
14
+ AWS_CLOUDWATCH_CATEGORY,
15
+ AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE,
16
+ AWS_CLOUDWATCH_MAX_EVENT_SIZE,
17
+ AWS_CLOUDWATCH_PROVIDER_NAME,
18
+ NO_CREDS_ERROR_STRING,
19
+ RETRY_ERROR_CODES,
20
+ } from './Constants';
21
+ export {
22
+ BackgroundProcessManager,
23
+ BackgroundManagerNotOpenError,
24
+ BackgroundProcessManagerState,
25
+ } from './BackgroundProcessManager';
package/src/constants.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  /**
15
5
  * This Symbol is used to reference an internal-only PubSub provider that