@aws-amplify/core 4.7.13-unstable.4 → 4.7.13

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 (278) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/build.js +5 -0
  3. package/dist/aws-amplify-core.js +42702 -0
  4. package/dist/aws-amplify-core.js.map +1 -0
  5. package/dist/aws-amplify-core.min.js +32 -0
  6. package/dist/aws-amplify-core.min.js.map +1 -0
  7. package/index.js +7 -0
  8. package/lib/Amplify.js +21 -3
  9. package/lib/Amplify.js.map +1 -1
  10. package/lib/ClientDevice/android.js +12 -2
  11. package/lib/ClientDevice/android.js.map +1 -1
  12. package/lib/ClientDevice/browser.js +12 -2
  13. package/lib/ClientDevice/browser.js.map +1 -1
  14. package/lib/ClientDevice/index.js +16 -2
  15. package/lib/ClientDevice/index.js.map +1 -1
  16. package/lib/ClientDevice/ios.js +12 -2
  17. package/lib/ClientDevice/ios.js.map +1 -1
  18. package/lib/ClientDevice/reactnative.js +16 -2
  19. package/lib/ClientDevice/reactnative.js.map +1 -1
  20. package/lib/Credentials.js +90 -59
  21. package/lib/Credentials.js.map +1 -1
  22. package/lib/Errors.js +12 -2
  23. package/lib/Errors.js.map +1 -1
  24. package/lib/Hub.js +57 -41
  25. package/lib/Hub.js.map +1 -1
  26. package/lib/I18n/I18n.js +12 -2
  27. package/lib/I18n/I18n.js.map +1 -1
  28. package/lib/I18n/index.js +16 -2
  29. package/lib/I18n/index.js.map +1 -1
  30. package/lib/I18n/types.js +12 -2
  31. package/lib/I18n/types.js.map +1 -1
  32. package/lib/JS.js +39 -4
  33. package/lib/JS.js.map +1 -1
  34. package/lib/Logger/ConsoleLogger.js +50 -10
  35. package/lib/Logger/ConsoleLogger.js.map +1 -1
  36. package/lib/Logger/index.js +16 -5
  37. package/lib/Logger/index.js.map +1 -1
  38. package/lib/Logger/logger-interface.js +12 -2
  39. package/lib/Logger/logger-interface.js.map +1 -1
  40. package/lib/OAuthHelper/FacebookOAuth.js +54 -5
  41. package/lib/OAuthHelper/FacebookOAuth.js.map +1 -1
  42. package/lib/OAuthHelper/GoogleOAuth.js +54 -5
  43. package/lib/OAuthHelper/GoogleOAuth.js.map +1 -1
  44. package/lib/OAuthHelper/index.js +12 -2
  45. package/lib/OAuthHelper/index.js.map +1 -1
  46. package/lib/{parseAWSExports.js → Parser.js} +28 -4
  47. package/lib/Parser.js.map +1 -0
  48. package/lib/Platform/index.js +16 -2
  49. package/lib/Platform/index.js.map +1 -1
  50. package/lib/Platform/version.js +1 -1
  51. package/lib/Providers/AWSCloudWatchProvider.js +97 -32
  52. package/lib/Providers/AWSCloudWatchProvider.js.map +1 -1
  53. package/lib/Providers/index.js +4 -2
  54. package/lib/Providers/index.js.map +1 -1
  55. package/lib/RNComponents/index.js +12 -2
  56. package/lib/RNComponents/index.js.map +1 -1
  57. package/lib/RNComponents/reactnative.js +16 -4
  58. package/lib/RNComponents/reactnative.js.map +1 -1
  59. package/lib/ServiceWorker/ServiceWorker.js +4 -0
  60. package/lib/ServiceWorker/ServiceWorker.js.map +1 -1
  61. package/lib/Signer.js +43 -8
  62. package/lib/Signer.js.map +1 -1
  63. package/lib/StorageHelper/index.js +16 -2
  64. package/lib/StorageHelper/index.js.map +1 -1
  65. package/lib/StorageHelper/reactnative.js +20 -4
  66. package/lib/StorageHelper/reactnative.js.map +1 -1
  67. package/lib/UniversalStorage/index.js +4 -2
  68. package/lib/UniversalStorage/index.js.map +1 -1
  69. package/lib/Util/BackgroundProcessManager.js +69 -10
  70. package/lib/Util/BackgroundProcessManager.js.map +1 -1
  71. package/lib/Util/CognitoIdentityClient.js +41 -0
  72. package/lib/Util/CognitoIdentityClient.js.map +1 -0
  73. package/lib/Util/Constants.js +12 -2
  74. package/lib/Util/Constants.js.map +1 -1
  75. package/lib/Util/DateUtils.js +17 -2
  76. package/lib/Util/DateUtils.js.map +1 -1
  77. package/lib/Util/Reachability.js +16 -3
  78. package/lib/Util/Reachability.js.map +1 -1
  79. package/lib/Util/Reachability.native.js +4 -2
  80. package/lib/Util/Reachability.native.js.map +1 -1
  81. package/lib/Util/Retry.js +78 -10
  82. package/lib/Util/Retry.js.map +1 -1
  83. package/lib/Util/index.js +8 -23
  84. package/lib/Util/index.js.map +1 -1
  85. package/lib/constants.js +12 -2
  86. package/lib/constants.js.map +1 -1
  87. package/lib/index.js +25 -54
  88. package/lib/index.js.map +1 -1
  89. package/lib-esm/Amplify.d.ts +4 -1
  90. package/lib-esm/Amplify.js +20 -2
  91. package/lib-esm/Amplify.js.map +1 -1
  92. package/lib-esm/ClientDevice/android.js +12 -2
  93. package/lib-esm/ClientDevice/android.js.map +1 -1
  94. package/lib-esm/ClientDevice/browser.js +12 -2
  95. package/lib-esm/ClientDevice/browser.js.map +1 -1
  96. package/lib-esm/ClientDevice/index.d.ts +4 -0
  97. package/lib-esm/ClientDevice/index.js +16 -2
  98. package/lib-esm/ClientDevice/index.js.map +1 -1
  99. package/lib-esm/ClientDevice/ios.js +12 -2
  100. package/lib-esm/ClientDevice/ios.js.map +1 -1
  101. package/lib-esm/ClientDevice/reactnative.d.ts +7 -0
  102. package/lib-esm/ClientDevice/reactnative.js +16 -2
  103. package/lib-esm/ClientDevice/reactnative.js.map +1 -1
  104. package/lib-esm/Credentials.d.ts +4 -0
  105. package/lib-esm/Credentials.js +63 -32
  106. package/lib-esm/Credentials.js.map +1 -1
  107. package/lib-esm/Errors.js +12 -2
  108. package/lib-esm/Errors.js.map +1 -1
  109. package/lib-esm/Hub.d.ts +4 -28
  110. package/lib-esm/Hub.js +52 -36
  111. package/lib-esm/Hub.js.map +1 -1
  112. package/lib-esm/I18n/I18n.js +12 -2
  113. package/lib-esm/I18n/I18n.js.map +1 -1
  114. package/lib-esm/I18n/index.d.ts +4 -0
  115. package/lib-esm/I18n/index.js +16 -2
  116. package/lib-esm/I18n/index.js.map +1 -1
  117. package/lib-esm/I18n/types.js +12 -2
  118. package/lib-esm/I18n/types.js.map +1 -1
  119. package/lib-esm/JS.d.ts +24 -0
  120. package/lib-esm/JS.js +39 -4
  121. package/lib-esm/JS.js.map +1 -1
  122. package/lib-esm/Logger/ConsoleLogger.js +43 -3
  123. package/lib-esm/Logger/ConsoleLogger.js.map +1 -1
  124. package/lib-esm/Logger/index.d.ts +1 -1
  125. package/lib-esm/Logger/index.js +13 -3
  126. package/lib-esm/Logger/index.js.map +1 -1
  127. package/lib-esm/Logger/logger-interface.d.ts +4 -0
  128. package/lib-esm/Logger/logger-interface.js +12 -2
  129. package/lib-esm/Logger/logger-interface.js.map +1 -1
  130. package/lib-esm/OAuthHelper/FacebookOAuth.d.ts +4 -0
  131. package/lib-esm/OAuthHelper/FacebookOAuth.js +52 -3
  132. package/lib-esm/OAuthHelper/FacebookOAuth.js.map +1 -1
  133. package/lib-esm/OAuthHelper/GoogleOAuth.d.ts +4 -0
  134. package/lib-esm/OAuthHelper/GoogleOAuth.js +52 -3
  135. package/lib-esm/OAuthHelper/GoogleOAuth.js.map +1 -1
  136. package/lib-esm/OAuthHelper/index.js +12 -2
  137. package/lib-esm/OAuthHelper/index.js.map +1 -1
  138. package/lib-esm/Parser.d.ts +12 -0
  139. package/lib-esm/{parseAWSExports.js → Parser.js} +27 -3
  140. package/lib-esm/Parser.js.map +1 -0
  141. package/lib-esm/Platform/index.d.ts +4 -0
  142. package/lib-esm/Platform/index.js +16 -2
  143. package/lib-esm/Platform/index.js.map +1 -1
  144. package/lib-esm/Platform/version.d.ts +1 -1
  145. package/lib-esm/Platform/version.js +1 -1
  146. package/lib-esm/Providers/AWSCloudWatchProvider.js +70 -5
  147. package/lib-esm/Providers/AWSCloudWatchProvider.js.map +1 -1
  148. package/lib-esm/Providers/index.d.ts +1 -1
  149. package/lib-esm/Providers/index.js +1 -1
  150. package/lib-esm/Providers/index.js.map +1 -1
  151. package/lib-esm/RNComponents/index.js +12 -2
  152. package/lib-esm/RNComponents/index.js.map +1 -1
  153. package/lib-esm/RNComponents/reactnative.js +12 -2
  154. package/lib-esm/RNComponents/reactnative.js.map +1 -1
  155. package/lib-esm/ServiceWorker/ServiceWorker.d.ts +4 -0
  156. package/lib-esm/ServiceWorker/ServiceWorker.js +4 -0
  157. package/lib-esm/ServiceWorker/ServiceWorker.js.map +1 -1
  158. package/lib-esm/Signer.d.ts +4 -0
  159. package/lib-esm/Signer.js +38 -3
  160. package/lib-esm/Signer.js.map +1 -1
  161. package/lib-esm/StorageHelper/index.d.ts +4 -0
  162. package/lib-esm/StorageHelper/index.js +16 -2
  163. package/lib-esm/StorageHelper/index.js.map +1 -1
  164. package/lib-esm/StorageHelper/reactnative.d.ts +4 -0
  165. package/lib-esm/StorageHelper/reactnative.js +16 -2
  166. package/lib-esm/StorageHelper/reactnative.js.map +1 -1
  167. package/lib-esm/Util/BackgroundProcessManager.js +60 -1
  168. package/lib-esm/Util/BackgroundProcessManager.js.map +1 -1
  169. package/lib-esm/Util/CognitoIdentityClient.d.ts +14 -0
  170. package/lib-esm/Util/CognitoIdentityClient.js +37 -0
  171. package/lib-esm/Util/CognitoIdentityClient.js.map +1 -0
  172. package/lib-esm/Util/Constants.js +12 -2
  173. package/lib-esm/Util/Constants.js.map +1 -1
  174. package/lib-esm/Util/DateUtils.js +16 -1
  175. package/lib-esm/Util/DateUtils.js.map +1 -1
  176. package/lib-esm/Util/Reachability.js +11 -1
  177. package/lib-esm/Util/Reachability.js.map +1 -1
  178. package/lib-esm/Util/Retry.d.ts +0 -1
  179. package/lib-esm/Util/Retry.js +70 -2
  180. package/lib-esm/Util/Retry.js.map +1 -1
  181. package/lib-esm/Util/index.d.ts +5 -5
  182. package/lib-esm/Util/index.js +5 -5
  183. package/lib-esm/Util/index.js.map +1 -1
  184. package/lib-esm/constants.js +12 -2
  185. package/lib-esm/constants.js.map +1 -1
  186. package/lib-esm/index.d.ts +9 -8
  187. package/lib-esm/index.js +21 -10
  188. package/lib-esm/index.js.map +1 -1
  189. package/lib-esm/types/types.d.ts +0 -3
  190. package/package.json +9 -13
  191. package/src/Amplify.ts +5 -1
  192. package/src/ClientDevice/android.ts +12 -2
  193. package/src/ClientDevice/browser.ts +12 -2
  194. package/src/ClientDevice/index.ts +17 -2
  195. package/src/ClientDevice/ios.ts +12 -2
  196. package/src/ClientDevice/reactnative.ts +17 -2
  197. package/src/Credentials.ts +10 -42
  198. package/src/Errors.ts +12 -2
  199. package/src/Hub.ts +23 -40
  200. package/src/I18n/I18n.ts +12 -2
  201. package/src/I18n/index.ts +17 -2
  202. package/src/I18n/types.ts +12 -2
  203. package/src/JS.ts +37 -6
  204. package/src/Logger/ConsoleLogger.ts +12 -2
  205. package/src/Logger/index.ts +13 -3
  206. package/src/Logger/logger-interface.ts +17 -2
  207. package/src/OAuthHelper/FacebookOAuth.ts +17 -2
  208. package/src/OAuthHelper/GoogleOAuth.ts +17 -2
  209. package/src/OAuthHelper/index.ts +12 -2
  210. package/src/{parseAWSExports.ts → Parser.ts} +13 -1
  211. package/src/Platform/index.ts +17 -2
  212. package/src/Platform/version.ts +1 -1
  213. package/src/Providers/AWSCloudWatchProvider.ts +14 -4
  214. package/src/Providers/index.ts +1 -1
  215. package/src/RNComponents/index.ts +12 -2
  216. package/src/RNComponents/reactnative.ts +12 -2
  217. package/src/ServiceWorker/ServiceWorker.ts +6 -1
  218. package/src/Signer.ts +17 -2
  219. package/src/StorageHelper/index.ts +17 -2
  220. package/src/StorageHelper/reactnative.ts +17 -2
  221. package/src/Util/CognitoIdentityClient.ts +48 -0
  222. package/src/Util/Constants.ts +12 -2
  223. package/src/Util/Retry.ts +1 -1
  224. package/src/Util/index.ts +5 -23
  225. package/src/constants.ts +12 -2
  226. package/src/index.ts +21 -48
  227. package/src/types/types.ts +0 -3
  228. package/webpack.config.dev.js +6 -0
  229. package/lib/.tsbuildinfo +0 -3
  230. package/lib/Amplify.d.ts +0 -28
  231. package/lib/ClientDevice/android.d.ts +0 -5
  232. package/lib/ClientDevice/browser.d.ts +0 -25
  233. package/lib/ClientDevice/index.d.ts +0 -23
  234. package/lib/ClientDevice/ios.d.ts +0 -7
  235. package/lib/ClientDevice/reactnative.d.ts +0 -7
  236. package/lib/Credentials.d.ts +0 -47
  237. package/lib/Errors.d.ts +0 -2
  238. package/lib/Hub.d.ts +0 -55
  239. package/lib/I18n/I18n.d.ts +0 -59
  240. package/lib/I18n/index.d.ts +0 -49
  241. package/lib/I18n/types.d.ts +0 -3
  242. package/lib/JS.d.ts +0 -32
  243. package/lib/Logger/ConsoleLogger.d.ts +0 -80
  244. package/lib/Logger/index.d.ts +0 -1
  245. package/lib/Logger/logger-interface.d.ts +0 -8
  246. package/lib/OAuthHelper/FacebookOAuth.d.ts +0 -6
  247. package/lib/OAuthHelper/GoogleOAuth.d.ts +0 -6
  248. package/lib/OAuthHelper/index.d.ts +0 -4
  249. package/lib/Platform/index.d.ts +0 -7
  250. package/lib/Platform/version.d.ts +0 -1
  251. package/lib/Providers/AWSCloudWatchProvider.d.ts +0 -34
  252. package/lib/Providers/index.d.ts +0 -1
  253. package/lib/RNComponents/index.d.ts +0 -5
  254. package/lib/RNComponents/reactnative.d.ts +0 -3
  255. package/lib/ServiceWorker/ServiceWorker.d.ts +0 -68
  256. package/lib/ServiceWorker/index.d.ts +0 -13
  257. package/lib/Signer.d.ts +0 -41
  258. package/lib/StorageHelper/index.d.ts +0 -41
  259. package/lib/StorageHelper/reactnative.d.ts +0 -13
  260. package/lib/UniversalStorage/index.d.ts +0 -23
  261. package/lib/Util/BackgroundProcessManager.d.ts +0 -204
  262. package/lib/Util/Constants.d.ts +0 -8
  263. package/lib/Util/DateUtils.d.ts +0 -7
  264. package/lib/Util/Mutex.d.ts +0 -45
  265. package/lib/Util/Reachability.d.ts +0 -13
  266. package/lib/Util/Reachability.native.d.ts +0 -11
  267. package/lib/Util/Retry.d.ts +0 -21
  268. package/lib/Util/StringUtils.d.ts +0 -2
  269. package/lib/Util/index.d.ts +0 -7
  270. package/lib/constants.d.ts +0 -6
  271. package/lib/index.d.ts +0 -29
  272. package/lib/parseAWSExports.d.ts +0 -2
  273. package/lib/parseAWSExports.js.map +0 -1
  274. package/lib/types/index.d.ts +0 -1
  275. package/lib/types/types.d.ts +0 -46
  276. package/lib-esm/.tsbuildinfo +0 -3
  277. package/lib-esm/parseAWSExports.d.ts +0 -2
  278. package/lib-esm/parseAWSExports.js.map +0 -1
package/src/Signer.ts CHANGED
@@ -1,5 +1,15 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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
+ */
3
13
 
4
14
  import { ConsoleLogger as Logger } from './Logger';
5
15
  import { Sha256 as jsSha256 } from '@aws-crypto/sha256-js';
@@ -429,3 +439,8 @@ export class Signer {
429
439
  return result;
430
440
  }
431
441
  }
442
+
443
+ /**
444
+ * @deprecated use per-function import
445
+ */
446
+ export default Signer;
@@ -1,5 +1,15 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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
+ */
3
13
 
4
14
  let dataMemory = {};
5
15
 
@@ -71,3 +81,8 @@ export class StorageHelper {
71
81
  return this.storageWindow;
72
82
  }
73
83
  }
84
+
85
+ /**
86
+ * @deprecated use named import
87
+ */
88
+ export default StorageHelper;
@@ -1,5 +1,15 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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
+ */
3
13
  import AsyncStorage from '@react-native-async-storage/async-storage';
4
14
 
5
15
  const MEMORY_KEY_PREFIX = '@MemoryStorage:';
@@ -100,3 +110,8 @@ export class StorageHelper {
100
110
  return this.storageWindow;
101
111
  }
102
112
  }
113
+
114
+ /**
115
+ * @deprecated use named import
116
+ */
117
+ export default StorageHelper;
@@ -0,0 +1,48 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import {
5
+ CognitoIdentityClient,
6
+ CognitoIdentityClientConfig,
7
+ } from '@aws-sdk/client-cognito-identity';
8
+ import { Provider } from '@aws-sdk/types';
9
+ import { getAmplifyUserAgent } from '../Platform';
10
+
11
+ /**
12
+ * Returns a CognitoIdentityClient with middleware
13
+ * @param {CognitoIdentityClientConfig} config
14
+ * @return {CognitoIdentityClient}
15
+ */
16
+ export function createCognitoIdentityClient(
17
+ config: CognitoIdentityClientConfig
18
+ ): CognitoIdentityClient {
19
+ const client = new CognitoIdentityClient({
20
+ region: config.region,
21
+ customUserAgent: getAmplifyUserAgent(),
22
+ });
23
+
24
+ client.middlewareStack.add(
25
+ (next, _) => (args: any) => {
26
+ return next(middlewareArgs(args));
27
+ },
28
+ {
29
+ step: 'build',
30
+ name: 'cacheControlMiddleWare',
31
+ }
32
+ );
33
+
34
+ return client;
35
+ }
36
+
37
+ export function middlewareArgs(args: { request: any; input: any }) {
38
+ return {
39
+ ...args,
40
+ request: {
41
+ ...args.request,
42
+ headers: {
43
+ ...args.request.headers,
44
+ 'cache-control': 'no-store',
45
+ },
46
+ },
47
+ };
48
+ }
@@ -1,5 +1,15 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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
+ */
3
13
 
4
14
  // Logging constants
5
15
  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
- export const isNonRetryableError = (obj: any): obj is NonRetryableError => {
12
+ 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,25 +1,7 @@
1
- export {
2
- NonRetryableError,
3
- isNonRetryableError,
4
- jitteredBackoff,
5
- jitteredExponentialRetry,
6
- retry,
7
- } from './Retry';
1
+ export * from './Retry';
8
2
  export { default as Mutex } from './Mutex';
9
3
  export { default as Reachability } from './Reachability';
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';
4
+ export * from './DateUtils';
5
+ export * from './StringUtils';
6
+ export * from './Constants';
7
+ export * from './BackgroundProcessManager';
package/src/constants.ts CHANGED
@@ -1,5 +1,15 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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
+ */
3
13
 
4
14
  /**
5
15
  * This Symbol is used to reference an internal-only PubSub provider that
package/src/index.ts CHANGED
@@ -1,74 +1,47 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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
+ */
3
13
 
4
14
  import { Amplify } from './Amplify';
5
15
  import { Platform } from './Platform';
6
16
 
7
- export { Amplify } from './Amplify';
8
17
  export { AmplifyClass } from './Amplify';
9
18
  export { ClientDevice } from './ClientDevice';
10
19
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
11
- export { invalidParameter, missingConfig } from './Errors';
20
+ export * from './Errors';
12
21
  export { Hub, HubCapsule, HubCallback, HubPayload } from './Hub';
13
22
  export { I18n } from './I18n';
14
- export {
15
- browserOrNode,
16
- filenameToContentType,
17
- generateRandomString,
18
- isEmpty,
19
- isStrictObject,
20
- isTextFile,
21
- isWebWorker,
22
- makeQuerablePromise,
23
- objectLessAttributes,
24
- sortByField,
25
- transferKeyToLowerCase,
26
- transferKeyToUpperCase,
27
- } from './JS';
23
+ export * from './JS';
28
24
  export { Signer } from './Signer';
29
- export { parseAWSExports } from './parseAWSExports';
30
- export { AWSCloudWatchProvider } from './Providers';
25
+ export * from './Parser';
26
+ export * from './Providers';
31
27
  export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
32
- export { AppState, AsyncStorage, Linking } from './RNComponents';
28
+ export * from './RNComponents';
33
29
  export { Credentials, CredentialsClass } from './Credentials';
34
30
  export { ServiceWorker } from './ServiceWorker';
35
31
  export { ICredentials } from './types';
36
32
  export { StorageHelper, MemoryStorage } from './StorageHelper';
37
33
  export { UniversalStorage } from './UniversalStorage';
38
34
  export { Platform, getAmplifyUserAgent } from './Platform';
39
- export {
40
- INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER,
41
- INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER,
42
- USER_AGENT_HEADER,
43
- } from './constants';
35
+ export * from './constants';
44
36
 
45
37
  export const Constants = {
46
38
  userAgent: Platform.userAgent,
47
39
  };
48
40
 
49
- export {
50
- AWS_CLOUDWATCH_BASE_BUFFER_SIZE,
51
- AWS_CLOUDWATCH_CATEGORY,
52
- AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE,
53
- AWS_CLOUDWATCH_MAX_EVENT_SIZE,
54
- AWS_CLOUDWATCH_PROVIDER_NAME,
55
- BackgroundManagerNotOpenError,
56
- BackgroundProcessManager,
57
- BackgroundProcessManagerState,
58
- DateUtils,
59
- Mutex,
60
- NO_CREDS_ERROR_STRING,
61
- NonRetryableError,
62
- RETRY_ERROR_CODES,
63
- Reachability,
64
- isNonRetryableError,
65
- jitteredBackoff,
66
- jitteredExponentialRetry,
67
- retry,
68
- urlSafeDecode,
69
- urlSafeEncode,
70
- } from './Util';
41
+ export * from './constants';
42
+ export * from './Util';
71
43
 
44
+ export { Amplify };
72
45
  /**
73
46
  * @deprecated use named import
74
47
  */
@@ -9,9 +9,6 @@ export interface AmplifyConfig {
9
9
  Storage?: object;
10
10
  Cache?: object;
11
11
  Geo?: object;
12
- Notifications?: {
13
- InAppMessaging?: object;
14
- };
15
12
  ssr?: boolean;
16
13
  }
17
14
 
@@ -0,0 +1,6 @@
1
+ var config = require('./webpack.config.js');
2
+
3
+ var entry = {
4
+ 'aws-amplify-core': './lib-esm/index.js',
5
+ };
6
+ module.exports = Object.assign(config, { entry, mode: 'development' });
package/lib/.tsbuildinfo DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "version": "3.8.3"
3
- }
package/lib/Amplify.d.ts DELETED
@@ -1,28 +0,0 @@
1
- import { ConsoleLogger as LoggerClass } from './Logger';
2
- export declare class AmplifyClass {
3
- private _components;
4
- private _config;
5
- private _modules;
6
- Auth: any;
7
- Analytics: any;
8
- API: any;
9
- Credentials: any;
10
- Storage: any;
11
- I18n: any;
12
- Cache: any;
13
- PubSub: any;
14
- Interactions: any;
15
- Pushnotification: any;
16
- UI: any;
17
- XR: any;
18
- Predictions: any;
19
- DataStore: any;
20
- Geo: any;
21
- Notifications: any;
22
- Logger: typeof LoggerClass;
23
- ServiceWorker: any;
24
- register(comp: any): void;
25
- configure(config?: any): {};
26
- addPluggable(pluggable: any): void;
27
- }
28
- export declare const Amplify: AmplifyClass;
@@ -1,5 +0,0 @@
1
- export declare const clientInfo: () => {
2
- platform: string;
3
- version: string;
4
- appVersion: string;
5
- };
@@ -1,25 +0,0 @@
1
- export declare function clientInfo(): {
2
- platform?: undefined;
3
- make?: undefined;
4
- model?: undefined;
5
- version?: undefined;
6
- appVersion?: undefined;
7
- language?: undefined;
8
- timezone?: undefined;
9
- } | {
10
- platform: string;
11
- make: string;
12
- model: string;
13
- version: string;
14
- appVersion: string;
15
- language: string;
16
- timezone: string;
17
- };
18
- export declare function dimension(): {
19
- width: number;
20
- height: number;
21
- };
22
- export declare function browserType(userAgent: string): {
23
- type: string;
24
- version: string;
25
- };
@@ -1,23 +0,0 @@
1
- export declare class ClientDevice {
2
- static clientInfo(): {
3
- platform?: undefined;
4
- make?: undefined;
5
- model?: undefined;
6
- version?: undefined;
7
- appVersion?: undefined;
8
- language?: undefined;
9
- timezone?: undefined;
10
- } | {
11
- platform: string;
12
- make: string;
13
- model: string;
14
- version: string;
15
- appVersion: string;
16
- language: string;
17
- timezone: string;
18
- };
19
- static dimension(): {
20
- width: number;
21
- height: number;
22
- };
23
- }
@@ -1,7 +0,0 @@
1
- export declare const clientInfo: () => {
2
- platform: string;
3
- version: string;
4
- appVersion: string;
5
- make: string;
6
- model: string;
7
- };
@@ -1,7 +0,0 @@
1
- export declare class ClientDevice {
2
- static clientInfo(): {
3
- platform: string;
4
- version: string;
5
- appVersion: string;
6
- };
7
- }
@@ -1,47 +0,0 @@
1
- import { ICredentials } from './types';
2
- export declare class CredentialsClass {
3
- private _config;
4
- private _credentials;
5
- private _credentials_source;
6
- private _gettingCredPromise;
7
- private _refreshHandlers;
8
- private _storage;
9
- private _storageSync;
10
- private _identityId;
11
- private _nextCredentialsRefresh;
12
- Auth: any;
13
- constructor(config: any);
14
- getModuleName(): string;
15
- getCredSource(): any;
16
- configure(config: any): any;
17
- get(): any;
18
- private _getCognitoIdentityIdStorageKey;
19
- private _pickupCredentials;
20
- private _keepAlive;
21
- refreshFederatedToken(federatedInfo: any): Promise<ICredentials>;
22
- private _providerRefreshWithRetry;
23
- private _isExpired;
24
- private _isPastTTL;
25
- private _setCredentialsForGuest;
26
- private _setCredentialsFromFederation;
27
- private _setCredentialsFromSession;
28
- private _loadCredentials;
29
- set(params: any, source: any): Promise<ICredentials>;
30
- clear(): Promise<void>;
31
- private _getGuestIdentityId;
32
- private _setGuestIdentityId;
33
- private _removeGuestIdentityId;
34
- /**
35
- * Compact version of credentials
36
- * @param {Object} credentials
37
- * @return {Object} - Credentials
38
- */
39
- shear(credentials: any): {
40
- accessKeyId: any;
41
- sessionToken: any;
42
- secretAccessKey: any;
43
- identityId: any;
44
- authenticated: any;
45
- };
46
- }
47
- export declare const Credentials: CredentialsClass;
package/lib/Errors.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function missingConfig(name: string): Error;
2
- export declare function invalidParameter(name: string): Error;
package/lib/Hub.d.ts DELETED
@@ -1,55 +0,0 @@
1
- export declare type HubCapsule = {
2
- channel: string;
3
- payload: HubPayload;
4
- source: string;
5
- patternInfo?: string[];
6
- };
7
- export declare type HubPayload = {
8
- event: string;
9
- data?: any;
10
- message?: string;
11
- };
12
- export declare type HubCallback = (capsule: HubCapsule) => void;
13
- export declare type LegacyCallback = {
14
- onHubCapsule: HubCallback;
15
- };
16
- export declare class HubClass {
17
- name: string;
18
- private listeners;
19
- private patterns;
20
- protectedChannels: string[];
21
- constructor(name: string);
22
- /**
23
- * Used internally to remove a Hub listener.
24
- *
25
- * @remarks
26
- * This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.
27
- */
28
- private _remove;
29
- /**
30
- * @deprecated Instead of calling Hub.remove, call the result of Hub.listen.
31
- */
32
- remove(channel: string | RegExp, listener: HubCallback): void;
33
- /**
34
- * Used to send a Hub event.
35
- *
36
- * @param channel - The channel on which the event will be broadcast
37
- * @param payload - The HubPayload
38
- * @param source - The source of the event; defaults to ''
39
- * @param ampSymbol - Symbol used to determine if the event is dispatched internally on a protected channel
40
- *
41
- */
42
- dispatch(channel: string, payload: HubPayload, source?: string, ampSymbol?: Symbol): void;
43
- /**
44
- * Used to listen for Hub events.
45
- *
46
- * @param channel - The channel on which to listen
47
- * @param callback - The callback to execute when an event is received on the specified channel
48
- * @param listenerName - The name of the listener; defaults to 'noname'
49
- * @returns A function which can be called to cancel the listener.
50
- *
51
- */
52
- listen(channel: string | RegExp, callback?: HubCallback | LegacyCallback, listenerName?: string): () => void;
53
- private _toListeners;
54
- }
55
- export declare const Hub: HubClass;
@@ -1,59 +0,0 @@
1
- import { I18nOptions } from './types';
2
- /**
3
- * Language transition class
4
- */
5
- export declare class I18n {
6
- /**
7
- * @private
8
- */
9
- _options: I18nOptions;
10
- /**
11
- * @private
12
- */
13
- _lang: any;
14
- /**
15
- * @private
16
- */
17
- _dict: {};
18
- /**
19
- * @constructor
20
- * Initialize with configurations
21
- * @param {Object} options
22
- */
23
- constructor(options: I18nOptions);
24
- /**
25
- * @method
26
- * Explicitly setting language
27
- * @param {String} lang
28
- */
29
- setLanguage(lang: string): void;
30
- /**
31
- * @method
32
- * Get value
33
- * @param {String} key
34
- * @param {String} defVal - Default value
35
- */
36
- get(key: any, defVal?: any): any;
37
- /**
38
- * @method
39
- * Get value according to specified language
40
- * @param {String} key
41
- * @param {String} language - Specified langurage to be used
42
- * @param {String} defVal - Default value
43
- */
44
- getByLanguage(key: any, language: any, defVal?: any): any;
45
- /**
46
- * @method
47
- * Add vocabularies for one language
48
- * @param {String} language - Language of the dictionary
49
- * @param {Object} vocabularies - Object that has key-value as dictionary entry
50
- */
51
- putVocabulariesForLanguage(language: any, vocabularies: any): void;
52
- /**
53
- * @method
54
- * Add vocabularies for one language
55
- * @param {Object} vocabularies - Object that has language as key,
56
- * vocabularies of each language as value
57
- */
58
- putVocabularies(vocabularies: any): void;
59
- }
@@ -1,49 +0,0 @@
1
- /**
2
- * Export I18n APIs
3
- */
4
- export declare class I18n {
5
- /**
6
- * @static
7
- * @method
8
- * Configure I18n part
9
- * @param {Object} config - Configuration of the I18n
10
- */
11
- static configure(config: any): any;
12
- static getModuleName(): string;
13
- /**
14
- * @static
15
- * @method
16
- * Create an instance of I18n for the library
17
- */
18
- static createInstance(): void;
19
- /**
20
- * @static @method
21
- * Explicitly setting language
22
- * @param {String} lang
23
- */
24
- static setLanguage(lang: any): any;
25
- /**
26
- * @static @method
27
- * Get value
28
- * @param {String} key
29
- * @param {String} defVal - Default value
30
- */
31
- static get(key: any, defVal?: any): any;
32
- /**
33
- * @static
34
- * @method
35
- * Add vocabularies for one language
36
- * @param {String} langurage - Language of the dictionary
37
- * @param {Object} vocabularies - Object that has key-value as dictionary entry
38
- */
39
- static putVocabulariesForLanguage(language: any, vocabularies: any): any;
40
- /**
41
- * @static
42
- * @method
43
- * Add vocabularies for one language
44
- * @param {Object} vocabularies - Object that has language as key,
45
- * vocabularies of each language as value
46
- */
47
- static putVocabularies(vocabularies: any): any;
48
- static checkConfig(): boolean;
49
- }
@@ -1,3 +0,0 @@
1
- export declare class I18nOptions {
2
- language: any;
3
- }