@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.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QAAQ,WAAA;wBAAR,QAAQ;aAQlB;;;;;;;;;IACF,CAAC;IA5Cc,gCAAU,GAErB,EAAE,CAAC;IA2CR,4BAAC;CAAA,AA9CD,IA8CC;eA9CoB,qBAAqB"}
@@ -3,6 +3,7 @@ export declare class NonRetryableError extends Error {
3
3
  readonly nonRetryable = true;
4
4
  constructor(message: string);
5
5
  }
6
+ export declare const isNonRetryableError: (obj: any) => obj is NonRetryableError;
6
7
  /**
7
8
  * @private
8
9
  * Internal use of Amplify only
@@ -1,72 +1,4 @@
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
- var __generator = (this && this.__generator) || function (thisArg, body) {
24
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
25
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
- function verb(n) { return function (v) { return step([n, v]); }; }
27
- function step(op) {
28
- if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
30
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
31
- if (y = 0, t) op = [op[0] & 2, t.value];
32
- switch (op[0]) {
33
- case 0: case 1: t = op; break;
34
- case 4: _.label++; return { value: op[1], done: false };
35
- case 5: _.label++; y = op[1]; op = [0]; continue;
36
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
- default:
38
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
- if (t[2]) _.ops.pop();
43
- _.trys.pop(); continue;
44
- }
45
- op = body.call(thisArg, _);
46
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
- }
49
- };
50
- var __read = (this && this.__read) || function (o, n) {
51
- var m = typeof Symbol === "function" && o[Symbol.iterator];
52
- if (!m) return o;
53
- var i = m.call(o), r, ar = [], e;
54
- try {
55
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
56
- }
57
- catch (error) { e = { error: error }; }
58
- finally {
59
- try {
60
- if (r && !r.done && (m = i["return"])) m.call(i);
61
- }
62
- finally { if (e) throw e.error; }
63
- }
64
- return ar;
65
- };
66
- var __spread = (this && this.__spread) || function () {
67
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
68
- return ar;
69
- };
1
+ import { __awaiter, __extends, __generator, __read, __spread } from "tslib";
70
2
  import { ConsoleLogger as Logger } from '../Logger/ConsoleLogger';
71
3
  var logger = new Logger('Util');
72
4
  var NonRetryableError = /** @class */ (function (_super) {
@@ -79,7 +11,7 @@ var NonRetryableError = /** @class */ (function (_super) {
79
11
  return NonRetryableError;
80
12
  }(Error));
81
13
  export { NonRetryableError };
82
- var isNonRetryableError = function (obj) {
14
+ export var isNonRetryableError = function (obj) {
83
15
  var key = 'nonRetryable';
84
16
  return obj && obj[key];
85
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Retry.js","sourceRoot":"","sources":["../../src/Util/Retry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAClE,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;AAElC;IAAuC,qCAAK;IAE3C,2BAAY,OAAe;QAA3B,YACC,kBAAM,OAAO,CAAC,SACd;QAHe,kBAAY,GAAG,IAAI,CAAC;;IAGpC,CAAC;IACF,wBAAC;AAAD,CAAC,AALD,CAAuC,KAAK,GAK3C;;AAED,IAAM,mBAAmB,GAAG,UAAC,GAAQ;IACpC,IAAM,GAAG,GAA4B,cAAc,CAAC;IACpD,OAAO,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAgB,KAAK,CAC1B,eAAsC,EACtC,IAAW,EACX,OAAsB,EACtB,WAA2B;;;;YAE3B,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE;gBAC1C,MAAM,KAAK,CAAC,oCAAoC,CAAC,CAAC;aAClD;YAED,sBAAO,IAAI,OAAO,CAAC,UAAO,OAAO,EAAE,MAAM;;;;;gCACpC,OAAO,GAAG,CAAC,CAAC;gCACZ,UAAU,GAAG,KAAK,CAAC;gCAEnB,MAAM,GAAQ,cAAO,CAAC,CAAC;gCAK3B,WAAW;oCACV,WAAW,CAAC,IA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teredBackoff, jitteredExponentialRetry, retry, } from './Retry';
2
2
  export { default as Mutex } from './Mutex';
3
3
  export { default as Reachability } from './Reachability';
4
- export * from './DateUtils';
5
- export * from './StringUtils';
6
- export * from './Constants';
7
- export * from './BackgroundProcessManager';
4
+ export { DateUtils } from './DateUtils';
5
+ export { urlSafeDecode, urlSafeEncode } from './StringUtils';
6
+ export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, } from './Constants';
7
+ export { BackgroundProcessManager, BackgroundManagerNotOpenError, BackgroundProcessManagerState, } from './BackgroundProcessManager';
@@ -1,8 +1,8 @@
1
- export * from './Retry';
1
+ export { NonRetryableError, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, } from './Retry';
2
2
  export { default as Mutex } from './Mutex';
3
3
  export { default as Reachability } from './Reachability';
4
- export * from './DateUtils';
5
- export * from './StringUtils';
6
- export * from './Constants';
7
- export * from './BackgroundProcessManager';
4
+ export { DateUtils } from './DateUtils';
5
+ export { urlSafeDecode, urlSafeEncode } from './StringUtils';
6
+ export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, } from './Constants';
7
+ export { BackgroundProcessManager, BackgroundManagerNotOpenError, BackgroundProcessManagerState, } from './BackgroundProcessManager';
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Util/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Util/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,KAAK,GACL,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EACN,+BAA+B,EAC/B,uBAAuB,EACvB,mCAAmC,EACnC,6BAA6B,EAC7B,4BAA4B,EAC5B,qBAAqB,EACrB,iBAAiB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,wBAAwB,EACxB,6BAA6B,EAC7B,6BAA6B,GAC7B,MAAM,4BAA4B,CAAC"}
@@ -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
  * This Symbol is used to reference an internal-only PubSub provider that
15
5
  * is used for AppSync/GraphQL subscriptions in the API category.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH,IAAM,SAAS,GACd,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,UAAU,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,IAAM,oCAAoC,GAAG,SAAS;IAC5D,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC;IACpD,CAAC,CAAC,wCAAwC,CAAC;AAE5C,MAAM,CAAC,IAAM,6CAA6C,GAAG,SAAS;IACrE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,+CAA+C,CAAC;IAC7D,CAAC,CAAC,iDAAiD,CAAC;AAErD,MAAM,CAAC,IAAM,iBAAiB,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC;;;GAGG;AACH,IAAM,SAAS,GACd,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,UAAU,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,IAAM,oCAAoC,GAAG,SAAS;IAC5D,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC;IACpD,CAAC,CAAC,wCAAwC,CAAC;AAE5C,MAAM,CAAC,IAAM,6CAA6C,GAAG,SAAS;IACrE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,+CAA+C,CAAC;IAC7D,CAAC,CAAC,iDAAiD,CAAC;AAErD,MAAM,CAAC,IAAM,iBAAiB,GAAG,kBAAkB,CAAC"}
@@ -1,29 +1,28 @@
1
1
  import { Amplify } from './Amplify';
2
+ export { Amplify } from './Amplify';
2
3
  export { AmplifyClass } from './Amplify';
3
4
  export { ClientDevice } from './ClientDevice';
4
5
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
5
- export * from './Errors';
6
+ export { invalidParameter, missingConfig } from './Errors';
6
7
  export { Hub, HubCapsule, HubCallback, HubPayload } from './Hub';
7
8
  export { I18n } from './I18n';
8
- export * from './JS';
9
+ export { browserOrNode, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './JS';
9
10
  export { Signer } from './Signer';
10
- export * from './Parser';
11
- export * from './Providers';
11
+ export { parseAWSExports } from './parseAWSExports';
12
+ export { AWSCloudWatchProvider } from './Providers';
12
13
  export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
13
- export * from './RNComponents';
14
+ export { AppState, AsyncStorage, Linking } from './RNComponents';
14
15
  export { Credentials, CredentialsClass } from './Credentials';
15
16
  export { ServiceWorker } from './ServiceWorker';
16
17
  export { ICredentials } from './types';
17
18
  export { StorageHelper, MemoryStorage } from './StorageHelper';
18
19
  export { UniversalStorage } from './UniversalStorage';
19
20
  export { Platform, getAmplifyUserAgent } from './Platform';
20
- export * from './constants';
21
+ export { INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER, INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './constants';
21
22
  export declare const Constants: {
22
23
  userAgent: string;
23
24
  };
24
- export * from './constants';
25
- export * from './Util';
26
- export { Amplify };
25
+ export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
27
26
  /**
28
27
  * @deprecated use named import
29
28
  */
package/lib-esm/index.js CHANGED
@@ -1,41 +1,30 @@
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 { Amplify } from './Amplify';
14
4
  import { Platform } from './Platform';
5
+ export { Amplify } from './Amplify';
15
6
  export { AmplifyClass } from './Amplify';
16
7
  export { ClientDevice } from './ClientDevice';
17
8
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
18
- export * from './Errors';
9
+ export { invalidParameter, missingConfig } from './Errors';
19
10
  export { Hub } from './Hub';
20
11
  export { I18n } from './I18n';
21
- export * from './JS';
12
+ export { browserOrNode, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './JS';
22
13
  export { Signer } from './Signer';
23
- export * from './Parser';
24
- export * from './Providers';
14
+ export { parseAWSExports } from './parseAWSExports';
15
+ export { AWSCloudWatchProvider } from './Providers';
25
16
  export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
26
- export * from './RNComponents';
17
+ export { AppState, AsyncStorage, Linking } from './RNComponents';
27
18
  export { Credentials, CredentialsClass } from './Credentials';
28
19
  export { ServiceWorker } from './ServiceWorker';
29
20
  export { StorageHelper, MemoryStorage } from './StorageHelper';
30
21
  export { UniversalStorage } from './UniversalStorage';
31
22
  export { Platform, getAmplifyUserAgent } from './Platform';
32
- export * from './constants';
23
+ export { INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER, INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './constants';
33
24
  export var Constants = {
34
25
  userAgent: Platform.userAgent,
35
26
  };
36
- export * from './constants';
37
- export * from './Util';
38
- export { Amplify };
27
+ export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
39
28
  /**
40
29
  * @deprecated use named import
41
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAClE,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,GAAG,EAAuC,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,cAAc,MAAM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nB,eAAe,EACf,wBAAwB,EACxB,KAAK,EACL,aAAa,EACb,aAAa,GACb,MAAM,QAAQ,CAAC;AAEhB;;GAEG;AACH,eAAe,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { AmplifyConfig } from './types';
2
+ export declare const parseAWSExports: (config: any) => AmplifyConfig;
@@ -1,17 +1,7 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
1
+ import { __assign } from "tslib";
12
2
  import { ConsoleLogger as Logger } from './Logger';
13
3
  var logger = new Logger('Parser');
14
- export var parseMobileHubConfig = function (config) {
4
+ export var parseAWSExports = function (config) {
15
5
  var amplifyConfig = {};
16
6
  // Analytics
17
7
  if (config['aws_mobile_analytics_app_id']) {
@@ -69,18 +59,4 @@ export var parseMobileHubConfig = function (config) {
69
59
  logger.debug('parse config', config, 'to amplifyconfig', amplifyConfig);
70
60
  return amplifyConfig;
71
61
  };
72
- /**
73
- * @deprecated use per-function export
74
- */
75
- var Parser = /** @class */ (function () {
76
- function Parser() {
77
- }
78
- Parser.parseMobilehubConfig = parseMobileHubConfig;
79
- return Parser;
80
- }());
81
- export { Parser };
82
- /**
83
- * @deprecated use per-function export
84
- */
85
- export default Parser;
86
- //# sourceMappingURL=Parser.js.map
62
+ //# sourceMappingURL=parseAWSExports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseAWSExports.js","sourceRoot":"","sources":["../src/parseAWSExports.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAEnD,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEpC,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,M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AC,OAAO,yBACjB,MAAM,CAAC,SAAS,CAAC,KACpB,MAAM,EAAE,MAAM,CAAC,oBAAoB,CAAC,GACpC,CAAC;KACF;IAED,MAAM;IACN,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE;QAClB,aAAa,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,EAAE;YAC1C,aAAa,CAAC,GAAG,GAAG;gBACnB,qBAAqB,EAAE,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC;aAC5D,CAAC;SACF;KACD;IAED,aAAa,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CACtC,EAAE,EACF,aAAa,CAAC,SAAS,EACvB,MAAM,CAAC,SAAS,CAChB,CAAC;IACF,aAAa,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACxE,aAAa,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;IACzD,aAAa,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CACpC,EAAE,EACF,aAAa,CAAC,OAAO,EACrB,MAAM,CAAC,OAAO,CACd,CAAC;IACF,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,MAAM,EAAE,kBAAkB,EAAE,aAAa,CAAC,CAAC;IACxE,OAAO,aAAa,CAAC;AACtB,CAAC,CAAC"}
@@ -8,6 +8,9 @@ export interface AmplifyConfig {
8
8
  Storage?: object;
9
9
  Cache?: object;
10
10
  Geo?: object;
11
+ Notifications?: {
12
+ InAppMessaging?: object;
13
+ };
11
14
  ssr?: boolean;
12
15
  }
13
16
  export interface ICredentials {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/core",
3
- "version": "4.7.12",
3
+ "version": "4.7.13-unstable.2+55e13f5a7",
4
4
  "description": "Core category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -9,14 +9,10 @@
9
9
  "access": "public"
10
10
  },
11
11
  "sideEffects": [
12
- "./src/I18n/index.ts",
13
- "./src/Credentials.ts",
14
12
  "./lib/I18n/index.js",
15
13
  "./lib/Credentials.js",
16
14
  "./lib-esm/I18n/index.js",
17
- "./lib-esm/Credentials.js",
18
- "./dist/aws-amplify-core.min.js",
19
- "./dist/aws-amplify-core.js"
15
+ "./lib-esm/Credentials.js"
20
16
  ],
21
17
  "scripts": {
22
18
  "test": "tslint 'src/**/*.ts' && jest -w 1 --coverage",
@@ -29,7 +25,8 @@
29
25
  "generate-version": "genversion src/Platform/version.ts --es6 --semi",
30
26
  "clean": "rimraf lib-esm lib dist",
31
27
  "format": "echo \"Not implemented\"",
32
- "lint": "tslint 'src/**/*.ts'"
28
+ "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
29
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 76.41"
33
30
  },
34
31
  "react-native": {
35
32
  "./lib/index": "./lib-esm/index.js",
@@ -54,13 +51,20 @@
54
51
  "prepend-file": "^1.3.1",
55
52
  "react-native": "^0.64.1"
56
53
  },
54
+ "files": [
55
+ "lib",
56
+ "lib-esm",
57
+ "src",
58
+ "typings.d.ts"
59
+ ],
57
60
  "dependencies": {
58
- "@aws-crypto/sha256-js": "1.0.0-alpha.0",
61
+ "@aws-crypto/sha256-js": "1.2.2",
59
62
  "@aws-sdk/client-cloudwatch-logs": "3.6.1",
60
63
  "@aws-sdk/client-cognito-identity": "3.6.1",
61
64
  "@aws-sdk/credential-provider-cognito-identity": "3.6.1",
62
65
  "@aws-sdk/types": "3.6.1",
63
66
  "@aws-sdk/util-hex-encoding": "3.6.1",
67
+ "tslib": "^1.8.0",
64
68
  "universal-cookie": "^4.0.4",
65
69
  "zen-observable-ts": "0.8.19"
66
70
  },
@@ -108,5 +112,5 @@
108
112
  "lib-esm"
109
113
  ]
110
114
  },
111
- "gitHead": "f2a588ee786fe23d391d600e5eb0a3f277b4841c"
115
+ "gitHead": "55e13f5a77488793f97b9c7ffe963aaa0c687884"
112
116
  }
package/src/Amplify.ts CHANGED
@@ -27,6 +27,7 @@ export class AmplifyClass {
27
27
  Predictions = null;
28
28
  DataStore = null;
29
29
  Geo = null;
30
+ Notifications = null;
30
31
 
31
32
  Logger = LoggerClass;
32
33
  ServiceWorker = null;
@@ -95,8 +96,3 @@ export class AmplifyClass {
95
96
  }
96
97
 
97
98
  export const Amplify = new AmplifyClass();
98
-
99
- /**
100
- * @deprecated use named import
101
- */
102
- export default Amplify;
@@ -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 { Platform, Dimensions } from 'react-native';
15
5
  import { ConsoleLogger as Logger } from '../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
 
15
5
  const logger = new Logger('ClientDevice_Browser');
@@ -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 { clientInfo, dimension } from './browser';
15
5
 
@@ -22,8 +12,3 @@ export class ClientDevice {
22
12
  return dimension();
23
13
  }
24
14
  }
25
-
26
- /**
27
- * @deprecated use named import
28
- */
29
- export default ClientDevice;
@@ -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 { Platform, Dimensions } from 'react-native';
15
5
  import { ConsoleLogger as Logger } from '../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
 
14
4
  import { Platform } from 'react-native';
15
5
  import { clientInfo as iOSClientInfo } from './ios';
@@ -26,8 +16,3 @@ export class ClientDevice {
26
16
  }
27
17
  }
28
18
  }
29
-
30
- /**
31
- * @deprecated use named import
32
- */
33
- export default ClientDevice;
@@ -18,6 +18,8 @@ import {
18
18
  GetCredentialsForIdentityCommand,
19
19
  } from '@aws-sdk/client-cognito-identity';
20
20
  import { CredentialProvider } from '@aws-sdk/types';
21
+ import { parseAWSExports } from './parseAWSExports';
22
+ import { Hub } from './Hub';
21
23
 
22
24
  const logger = new Logger('Credentials');
23
25
 
@@ -25,6 +27,20 @@ const CREDENTIALS_TTL = 50 * 60 * 1000; // 50 min, can be modified on config if
25
27
 
26
28
  const COGNITO_IDENTITY_KEY_PREFIX = 'CognitoIdentityId-';
27
29
 
30
+ const AMPLIFY_SYMBOL = (
31
+ typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
32
+ ? Symbol.for('amplify_default')
33
+ : '@@amplify_default'
34
+ ) as Symbol;
35
+
36
+ const dispatchCredentialsEvent = (
37
+ event: string,
38
+ data: any,
39
+ message: string
40
+ ) => {
41
+ Hub.dispatch('core', { event, data, message }, 'Credentials', AMPLIFY_SYMBOL);
42
+ };
43
+
28
44
  export class CredentialsClass {
29
45
  private _config;
30
46
  private _credentials;
@@ -78,6 +94,12 @@ export class CredentialsClass {
78
94
  this._storageSync = this._storage['sync']();
79
95
  }
80
96
 
97
+ dispatchCredentialsEvent(
98
+ 'credentials_configured',
99
+ null,
100
+ `Credentials has been configured successfully`
101
+ );
102
+
81
103
  return this._config;
82
104
  }
83
105
 
@@ -117,7 +139,8 @@ export class CredentialsClass {
117
139
  const { Auth = Amplify.Auth } = this;
118
140
 
119
141
  if (!Auth || typeof Auth.currentUserCredentials !== 'function') {
120
- return Promise.reject('No Auth module registered in Amplify');
142
+ // If Auth module is not imported, do a best effort to get guest credentials
143
+ return this._setCredentialsForGuest();
121
144
  }
122
145
 
123
146
  if (!this._isExpired(cred) && this._isPastTTL()) {
@@ -233,7 +256,17 @@ export class CredentialsClass {
233
256
 
234
257
  private async _setCredentialsForGuest() {
235
258
  logger.debug('setting credentials for guest');
259
+ if (!this._config?.identityPoolId) {
260
+ // If Credentials are not configured thru Auth module,
261
+ // doing best effort to check if the library was configured
262
+ this._config = Object.assign(
263
+ {},
264
+ this._config,
265
+ parseAWSExports(this._config || {}).Auth
266
+ );
267
+ }
236
268
  const { identityPoolId, region, mandatorySignIn } = this._config;
269
+
237
270
  if (mandatorySignIn) {
238
271
  return Promise.reject(
239
272
  'cannot get guest credentials when mandatory signin enabled'
@@ -624,8 +657,3 @@ export class CredentialsClass {
624
657
  export const Credentials = new CredentialsClass(null);
625
658
 
626
659
  Amplify.register(Credentials);
627
-
628
- /**
629
- * @deprecated use named import
630
- */
631
- export default Credentials;
package/src/Errors.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 function missingConfig(name: string) {
15
5
  return new Error('Missing config value of ' + name);