@aws-amplify/core 4.4.2-api-logging.5 → 4.4.2-unstable.3

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 (110) hide show
  1. package/dist/aws-amplify-core.js +225 -1052
  2. package/dist/aws-amplify-core.js.map +1 -1
  3. package/dist/aws-amplify-core.min.js +7 -7
  4. package/dist/aws-amplify-core.min.js.map +1 -1
  5. package/lib/Logger/ConsoleLogger.d.ts +1 -12
  6. package/lib/Logger/ConsoleLogger.js +6 -69
  7. package/lib/Logger/ConsoleLogger.js.map +1 -1
  8. package/lib/Providers/AWSCloudWatchProvider.js +1 -8
  9. package/lib/Providers/AWSCloudWatchProvider.js.map +1 -1
  10. package/lib/Providers/index.d.ts +0 -1
  11. package/lib/Providers/index.js +0 -2
  12. package/lib/Providers/index.js.map +1 -1
  13. package/lib/Util/Constants.d.ts +1 -3
  14. package/lib/Util/Constants.js +0 -4
  15. package/lib/Util/Constants.js.map +1 -1
  16. package/lib/Util/Reachability.js +5 -7
  17. package/lib/Util/Reachability.js.map +1 -1
  18. package/lib/Util/Retry.d.ts +5 -0
  19. package/lib/Util/Retry.js +8 -2
  20. package/lib/Util/Retry.js.map +1 -1
  21. package/lib/Util/StringUtils.d.ts +0 -1
  22. package/lib/Util/StringUtils.js +6 -11
  23. package/lib/Util/StringUtils.js.map +1 -1
  24. package/lib/types/index.js +0 -4
  25. package/lib/types/index.js.map +1 -1
  26. package/lib/types/types.d.ts +1 -38
  27. package/lib/types/types.js +0 -4
  28. package/lib/types/types.js.map +1 -1
  29. package/lib-esm/Logger/ConsoleLogger.d.ts +1 -12
  30. package/lib-esm/Logger/ConsoleLogger.js +4 -67
  31. package/lib-esm/Logger/ConsoleLogger.js.map +1 -1
  32. package/lib-esm/Providers/AWSCloudWatchProvider.js +1 -8
  33. package/lib-esm/Providers/AWSCloudWatchProvider.js.map +1 -1
  34. package/lib-esm/Providers/index.d.ts +0 -1
  35. package/lib-esm/Providers/index.js +0 -1
  36. package/lib-esm/Providers/index.js.map +1 -1
  37. package/lib-esm/Util/Constants.d.ts +1 -3
  38. package/lib-esm/Util/Constants.js +1 -3
  39. package/lib-esm/Util/Constants.js.map +1 -1
  40. package/lib-esm/Util/Reachability.js +3 -5
  41. package/lib-esm/Util/Reachability.js.map +1 -1
  42. package/lib-esm/Util/Retry.d.ts +5 -0
  43. package/lib-esm/Util/Retry.js +8 -3
  44. package/lib-esm/Util/Retry.js.map +1 -1
  45. package/lib-esm/Util/StringUtils.d.ts +0 -1
  46. package/lib-esm/Util/StringUtils.js +6 -11
  47. package/lib-esm/Util/StringUtils.js.map +1 -1
  48. package/lib-esm/types/index.js +0 -1
  49. package/lib-esm/types/index.js.map +1 -1
  50. package/lib-esm/types/types.d.ts +1 -38
  51. package/lib-esm/types/types.js +0 -3
  52. package/lib-esm/types/types.js.map +1 -1
  53. package/package.json +2 -2
  54. package/src/Logger/ConsoleLogger.ts +2 -54
  55. package/src/Providers/AWSCloudWatchProvider.ts +1 -9
  56. package/src/Providers/index.ts +0 -1
  57. package/src/Util/Constants.ts +0 -4
  58. package/src/Util/Reachability.ts +7 -9
  59. package/src/Util/Retry.ts +9 -3
  60. package/src/Util/StringUtils.ts +6 -15
  61. package/src/types/types.ts +62 -106
  62. package/lib/Providers/APIProvider/APILoggingProvider.d.ts +0 -28
  63. package/lib/Providers/APIProvider/APILoggingProvider.js +0 -320
  64. package/lib/Providers/APIProvider/APILoggingProvider.js.map +0 -1
  65. package/lib/Providers/APIProvider/CloudWatchEventFormatter.d.ts +0 -5
  66. package/lib/Providers/APIProvider/CloudWatchEventFormatter.js +0 -78
  67. package/lib/Providers/APIProvider/CloudWatchEventFormatter.js.map +0 -1
  68. package/lib/Providers/APIProvider/Fetch.d.ts +0 -10
  69. package/lib/Providers/APIProvider/Fetch.js +0 -13
  70. package/lib/Providers/APIProvider/Fetch.js.map +0 -1
  71. package/lib/Providers/APIProvider/LoggerReachability/index.d.ts +0 -3
  72. package/lib/Providers/APIProvider/LoggerReachability/index.js +0 -5
  73. package/lib/Providers/APIProvider/LoggerReachability/index.js.map +0 -1
  74. package/lib/Providers/APIProvider/LoggerReachability/index.native.d.ts +0 -3
  75. package/lib/Providers/APIProvider/LoggerReachability/index.native.js +0 -9
  76. package/lib/Providers/APIProvider/LoggerReachability/index.native.js.map +0 -1
  77. package/lib/Providers/APIProvider/index.d.ts +0 -1
  78. package/lib/Providers/APIProvider/index.js +0 -5
  79. package/lib/Providers/APIProvider/index.js.map +0 -1
  80. package/lib/Providers/APIProvider/loggerConnectivity.d.ts +0 -14
  81. package/lib/Providers/APIProvider/loggerConnectivity.js +0 -55
  82. package/lib/Providers/APIProvider/loggerConnectivity.js.map +0 -1
  83. package/lib-esm/Providers/APIProvider/APILoggingProvider.d.ts +0 -28
  84. package/lib-esm/Providers/APIProvider/APILoggingProvider.js +0 -315
  85. package/lib-esm/Providers/APIProvider/APILoggingProvider.js.map +0 -1
  86. package/lib-esm/Providers/APIProvider/CloudWatchEventFormatter.d.ts +0 -5
  87. package/lib-esm/Providers/APIProvider/CloudWatchEventFormatter.js +0 -76
  88. package/lib-esm/Providers/APIProvider/CloudWatchEventFormatter.js.map +0 -1
  89. package/lib-esm/Providers/APIProvider/Fetch.d.ts +0 -10
  90. package/lib-esm/Providers/APIProvider/Fetch.js +0 -11
  91. package/lib-esm/Providers/APIProvider/Fetch.js.map +0 -1
  92. package/lib-esm/Providers/APIProvider/LoggerReachability/index.d.ts +0 -3
  93. package/lib-esm/Providers/APIProvider/LoggerReachability/index.js +0 -3
  94. package/lib-esm/Providers/APIProvider/LoggerReachability/index.js.map +0 -1
  95. package/lib-esm/Providers/APIProvider/LoggerReachability/index.native.d.ts +0 -3
  96. package/lib-esm/Providers/APIProvider/LoggerReachability/index.native.js +0 -4
  97. package/lib-esm/Providers/APIProvider/LoggerReachability/index.native.js.map +0 -1
  98. package/lib-esm/Providers/APIProvider/index.d.ts +0 -1
  99. package/lib-esm/Providers/APIProvider/index.js +0 -2
  100. package/lib-esm/Providers/APIProvider/index.js.map +0 -1
  101. package/lib-esm/Providers/APIProvider/loggerConnectivity.d.ts +0 -14
  102. package/lib-esm/Providers/APIProvider/loggerConnectivity.js +0 -50
  103. package/lib-esm/Providers/APIProvider/loggerConnectivity.js.map +0 -1
  104. package/src/Providers/APIProvider/APILoggingProvider.ts +0 -286
  105. package/src/Providers/APIProvider/CloudWatchEventFormatter.ts +0 -100
  106. package/src/Providers/APIProvider/Fetch.ts +0 -10
  107. package/src/Providers/APIProvider/LoggerReachability/index.native.ts +0 -4
  108. package/src/Providers/APIProvider/LoggerReachability/index.ts +0 -2
  109. package/src/Providers/APIProvider/index.ts +0 -1
  110. package/src/Providers/APIProvider/loggerConnectivity.ts +0 -49
@@ -31566,12 +31566,11 @@ function () {
31566
31566
  /*!*****************************************!*\
31567
31567
  !*** ./lib-esm/Logger/ConsoleLogger.js ***!
31568
31568
  \*****************************************/
31569
- /*! exports provided: LOG_LEVELS, LOG_TYPE, ConsoleLogger */
31569
+ /*! exports provided: LOG_TYPE, ConsoleLogger */
31570
31570
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
31571
31571
 
31572
31572
  "use strict";
31573
31573
  __webpack_require__.r(__webpack_exports__);
31574
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOG_LEVELS", function() { return LOG_LEVELS; });
31575
31574
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOG_TYPE", function() { return LOG_TYPE; });
31576
31575
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConsoleLogger", function() { return ConsoleLogger; });
31577
31576
  /* harmony import */ var _Util_Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Util/Constants */ "./lib-esm/Util/Constants.js");
@@ -31679,10 +31678,6 @@ function () {
31679
31678
  this._pluggables = [];
31680
31679
  }
31681
31680
 
31682
- ConsoleLogger.addPluggable = function (pluggable) {
31683
- ConsoleLogger.pluggables.push(pluggable);
31684
- };
31685
-
31686
31681
  ConsoleLogger.prototype._padding = function (n) {
31687
31682
  return n < 10 ? '0' + n : '' + n;
31688
31683
  };
@@ -31697,75 +31692,6 @@ function () {
31697
31692
  this._config = config;
31698
31693
  return this._config;
31699
31694
  };
31700
-
31701
- ConsoleLogger.prototype._logGlobal = function (type) {
31702
- var e_1, _a;
31703
-
31704
- var msg = [];
31705
-
31706
- for (var _i = 1; _i < arguments.length; _i++) {
31707
- msg[_i - 1] = arguments[_i];
31708
- }
31709
-
31710
- try {
31711
- for (var _b = __values(ConsoleLogger.pluggables), _c = _b.next(); !_c.done; _c = _b.next()) {
31712
- var pluggable = _c.value;
31713
- pluggable.pushLogs([this._generateLoggerEvent(type, msg)]);
31714
- }
31715
- } catch (e_1_1) {
31716
- e_1 = {
31717
- error: e_1_1
31718
- };
31719
- } finally {
31720
- try {
31721
- if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
31722
- } finally {
31723
- if (e_1) throw e_1.error;
31724
- }
31725
- }
31726
- };
31727
-
31728
- ConsoleLogger.prototype._generateLoggerEvent = function (type, msg) {
31729
- var strMessage = '';
31730
- var data;
31731
- var error;
31732
-
31733
- if (msg.length === 1 && typeof msg[0] === 'string') {
31734
- strMessage = msg[0];
31735
- } else if (msg.length === 1) {
31736
- data = msg[0];
31737
- } else if (typeof msg[0] === 'string') {
31738
- var obj = msg.slice(1);
31739
-
31740
- if (obj.length === 1) {
31741
- obj = obj[0];
31742
- }
31743
-
31744
- strMessage = msg[0];
31745
-
31746
- if (obj instanceof Error) {
31747
- error = {
31748
- message: obj.message,
31749
- name: obj.name
31750
- };
31751
- }
31752
-
31753
- data = obj;
31754
- } else {
31755
- data = msg;
31756
- }
31757
-
31758
- return {
31759
- message: strMessage,
31760
- timestamp: Date.now(),
31761
- loggerInfo: {
31762
- level: type.toLowerCase(),
31763
- name: this.name,
31764
- data: data,
31765
- error: error
31766
- }
31767
- };
31768
- };
31769
31695
  /**
31770
31696
  * Write log
31771
31697
  * @method
@@ -31776,7 +31702,7 @@ function () {
31776
31702
 
31777
31703
 
31778
31704
  ConsoleLogger.prototype._log = function (type) {
31779
- var e_2, _a;
31705
+ var e_1, _a;
31780
31706
 
31781
31707
  var msg = [];
31782
31708
 
@@ -31784,8 +31710,6 @@ function () {
31784
31710
  msg[_i - 1] = arguments[_i];
31785
31711
  }
31786
31712
 
31787
- this._logGlobal.apply(this, __spread([type], msg));
31788
-
31789
31713
  var logger_level_name = this.level;
31790
31714
 
31791
31715
  if (ConsoleLogger.LOG_LEVEL) {
@@ -31846,15 +31770,15 @@ function () {
31846
31770
  };
31847
31771
  plugin.pushLogs([logEvent]);
31848
31772
  }
31849
- } catch (e_2_1) {
31850
- e_2 = {
31851
- error: e_2_1
31773
+ } catch (e_1_1) {
31774
+ e_1 = {
31775
+ error: e_1_1
31852
31776
  };
31853
31777
  } finally {
31854
31778
  try {
31855
31779
  if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
31856
31780
  } finally {
31857
- if (e_2) throw e_2.error;
31781
+ if (e_1) throw e_1.error;
31858
31782
  }
31859
31783
  }
31860
31784
  };
@@ -31973,7 +31897,6 @@ function () {
31973
31897
  return this._pluggables;
31974
31898
  };
31975
31899
 
31976
- ConsoleLogger.pluggables = [];
31977
31900
  ConsoleLogger.LOG_LEVEL = null;
31978
31901
  return ConsoleLogger;
31979
31902
  }();
@@ -31986,14 +31909,12 @@ function () {
31986
31909
  /*!*********************************!*\
31987
31910
  !*** ./lib-esm/Logger/index.js ***!
31988
31911
  \*********************************/
31989
- /*! exports provided: LOG_LEVELS, LOG_TYPE, ConsoleLogger */
31912
+ /*! exports provided: LOG_TYPE, ConsoleLogger */
31990
31913
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
31991
31914
 
31992
31915
  "use strict";
31993
31916
  __webpack_require__.r(__webpack_exports__);
31994
31917
  /* harmony import */ var _ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ConsoleLogger */ "./lib-esm/Logger/ConsoleLogger.js");
31995
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LOG_LEVELS", function() { return _ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["LOG_LEVELS"]; });
31996
-
31997
31918
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LOG_TYPE", function() { return _ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["LOG_TYPE"]; });
31998
31919
 
31999
31920
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConsoleLogger", function() { return _ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]; });
@@ -32561,882 +32482,72 @@ function () {
32561
32482
  rej(new _Util__WEBPACK_IMPORTED_MODULE_2__["NonRetryableError"]('Failed to reload google auth response'));
32562
32483
  }
32563
32484
  });
32564
- } else {
32565
- rej(new _Util__WEBPACK_IMPORTED_MODULE_2__["NonRetryableError"]('User is not signed in with Google'));
32566
- }
32567
- })["catch"](function (err) {
32568
- logger.debug('Failed to refresh google token', err);
32569
- rej(new _Util__WEBPACK_IMPORTED_MODULE_2__["NonRetryableError"]('Failed to refresh google token'));
32570
- });
32571
- });
32572
- };
32573
-
32574
- return GoogleOAuth;
32575
- }();
32576
-
32577
-
32578
- /**
32579
- * @deprecated use named import
32580
- */
32581
-
32582
- /* harmony default export */ __webpack_exports__["default"] = (GoogleOAuth);
32583
-
32584
- /***/ }),
32585
-
32586
- /***/ "./lib-esm/OAuthHelper/index.js":
32587
- /*!**************************************!*\
32588
- !*** ./lib-esm/OAuthHelper/index.js ***!
32589
- \**************************************/
32590
- /*! exports provided: GoogleOAuth, FacebookOAuth */
32591
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
32592
-
32593
- "use strict";
32594
- __webpack_require__.r(__webpack_exports__);
32595
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GoogleOAuth", function() { return GoogleOAuth; });
32596
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FacebookOAuth", function() { return FacebookOAuth; });
32597
- /* harmony import */ var _GoogleOAuth__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GoogleOAuth */ "./lib-esm/OAuthHelper/GoogleOAuth.js");
32598
- /* harmony import */ var _FacebookOAuth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FacebookOAuth */ "./lib-esm/OAuthHelper/FacebookOAuth.js");
32599
- /*
32600
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
32601
- *
32602
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
32603
- * the License. A copy of the License is located at
32604
- *
32605
- * http://aws.amazon.com/apache2.0/
32606
- *
32607
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
32608
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
32609
- * and limitations under the License.
32610
- */
32611
-
32612
-
32613
- var GoogleOAuth = new _GoogleOAuth__WEBPACK_IMPORTED_MODULE_0__["GoogleOAuth"]();
32614
- var FacebookOAuth = new _FacebookOAuth__WEBPACK_IMPORTED_MODULE_1__["FacebookOAuth"]();
32615
-
32616
- /***/ }),
32617
-
32618
- /***/ "./lib-esm/Parser.js":
32619
- /*!***************************!*\
32620
- !*** ./lib-esm/Parser.js ***!
32621
- \***************************/
32622
- /*! exports provided: parseMobileHubConfig, Parser, default */
32623
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
32624
-
32625
- "use strict";
32626
- __webpack_require__.r(__webpack_exports__);
32627
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseMobileHubConfig", function() { return parseMobileHubConfig; });
32628
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; });
32629
- /* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Logger */ "./lib-esm/Logger/index.js");
32630
- var __assign = undefined && undefined.__assign || function () {
32631
- __assign = Object.assign || function (t) {
32632
- for (var s, i = 1, n = arguments.length; i < n; i++) {
32633
- s = arguments[i];
32634
-
32635
- for (var p in s) {
32636
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
32637
- }
32638
- }
32639
-
32640
- return t;
32641
- };
32642
-
32643
- return __assign.apply(this, arguments);
32644
- };
32645
-
32646
-
32647
- var logger = new _Logger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Parser');
32648
- var parseMobileHubConfig = function parseMobileHubConfig(config) {
32649
- var amplifyConfig = {}; // Analytics
32650
-
32651
- if (config['aws_mobile_analytics_app_id']) {
32652
- var Analytics = {
32653
- AWSPinpoint: {
32654
- appId: config['aws_mobile_analytics_app_id'],
32655
- region: config['aws_mobile_analytics_app_region']
32656
- }
32657
- };
32658
- amplifyConfig.Analytics = Analytics;
32659
- } // Auth
32660
-
32661
-
32662
- if (config['aws_cognito_identity_pool_id'] || config['aws_user_pools_id']) {
32663
- amplifyConfig.Auth = {
32664
- userPoolId: config['aws_user_pools_id'],
32665
- userPoolWebClientId: config['aws_user_pools_web_client_id'],
32666
- region: config['aws_cognito_region'],
32667
- identityPoolId: config['aws_cognito_identity_pool_id'],
32668
- identityPoolRegion: config['aws_cognito_region'],
32669
- mandatorySignIn: config['aws_mandatory_sign_in'] === 'enable'
32670
- };
32671
- } // Storage
32672
-
32673
-
32674
- var storageConfig;
32675
-
32676
- if (config['aws_user_files_s3_bucket']) {
32677
- storageConfig = {
32678
- AWSS3: {
32679
- bucket: config['aws_user_files_s3_bucket'],
32680
- region: config['aws_user_files_s3_bucket_region'],
32681
- dangerouslyConnectToHttpEndpointForTesting: config['aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing']
32682
- }
32683
- };
32684
- } else {
32685
- storageConfig = config ? config.Storage || config : {};
32686
- } // Logging
32687
-
32688
-
32689
- if (config['Logging']) {
32690
- amplifyConfig.Logging = __assign(__assign({}, config['Logging']), {
32691
- region: config['aws_project_region']
32692
- });
32693
- } // Geo
32694
-
32695
-
32696
- if (config['geo']) {
32697
- amplifyConfig.Geo = Object.assign({}, config.geo);
32698
-
32699
- if (config.geo['amazon_location_service']) {
32700
- amplifyConfig.Geo = {
32701
- AmazonLocationService: config.geo['amazon_location_service']
32702
- };
32703
- }
32704
- }
32705
-
32706
- amplifyConfig.Analytics = Object.assign({}, amplifyConfig.Analytics, config.Analytics);
32707
- amplifyConfig.Auth = Object.assign({}, amplifyConfig.Auth, config.Auth);
32708
- amplifyConfig.Storage = Object.assign({}, storageConfig);
32709
- amplifyConfig.Logging = Object.assign({}, amplifyConfig.Logging, config.Logging);
32710
- logger.debug('parse config', config, 'to amplifyconfig', amplifyConfig);
32711
- return amplifyConfig;
32712
- };
32713
- /**
32714
- * @deprecated use per-function export
32715
- */
32716
-
32717
- var Parser =
32718
- /** @class */
32719
- function () {
32720
- function Parser() {}
32721
-
32722
- Parser.parseMobilehubConfig = parseMobileHubConfig;
32723
- return Parser;
32724
- }();
32725
-
32726
-
32727
- /**
32728
- * @deprecated use per-function export
32729
- */
32730
-
32731
- /* harmony default export */ __webpack_exports__["default"] = (Parser);
32732
-
32733
- /***/ }),
32734
-
32735
- /***/ "./lib-esm/Platform/index.js":
32736
- /*!***********************************!*\
32737
- !*** ./lib-esm/Platform/index.js ***!
32738
- \***********************************/
32739
- /*! exports provided: Platform, getAmplifyUserAgent, default */
32740
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
32741
-
32742
- "use strict";
32743
- __webpack_require__.r(__webpack_exports__);
32744
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Platform", function() { return Platform; });
32745
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAmplifyUserAgent", function() { return getAmplifyUserAgent; });
32746
- /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version */ "./lib-esm/Platform/version.js");
32747
- /*
32748
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
32749
- *
32750
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
32751
- * the License. A copy of the License is located at
32752
- *
32753
- * http://aws.amazon.com/apache2.0/
32754
- *
32755
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
32756
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
32757
- * and limitations under the License.
32758
- */
32759
-
32760
- var BASE_USER_AGENT = "aws-amplify/" + _version__WEBPACK_IMPORTED_MODULE_0__["version"];
32761
- var Platform = {
32762
- userAgent: BASE_USER_AGENT + " js",
32763
- product: '',
32764
- navigator: null,
32765
- isReactNative: false
32766
- };
32767
-
32768
- if (typeof navigator !== 'undefined' && navigator.product) {
32769
- Platform.product = navigator.product || '';
32770
- Platform.navigator = navigator || null;
32771
-
32772
- switch (navigator.product) {
32773
- case 'ReactNative':
32774
- Platform.userAgent = BASE_USER_AGENT + " react-native";
32775
- Platform.isReactNative = true;
32776
- break;
32777
-
32778
- default:
32779
- Platform.userAgent = BASE_USER_AGENT + " js";
32780
- Platform.isReactNative = false;
32781
- break;
32782
- }
32783
- }
32784
-
32785
- var getAmplifyUserAgent = function getAmplifyUserAgent() {
32786
- return Platform.userAgent;
32787
- };
32788
- /**
32789
- * @deprecated use named import
32790
- */
32791
-
32792
- /* harmony default export */ __webpack_exports__["default"] = (Platform);
32793
-
32794
- /***/ }),
32795
-
32796
- /***/ "./lib-esm/Platform/version.js":
32797
- /*!*************************************!*\
32798
- !*** ./lib-esm/Platform/version.js ***!
32799
- \*************************************/
32800
- /*! exports provided: version */
32801
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
32802
-
32803
- "use strict";
32804
- __webpack_require__.r(__webpack_exports__);
32805
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
32806
- // generated by genversion
32807
- var version = '4.4.1';
32808
-
32809
- /***/ }),
32810
-
32811
- /***/ "./lib-esm/Providers/APIProvider/APILoggingProvider.js":
32812
- /*!*************************************************************!*\
32813
- !*** ./lib-esm/Providers/APIProvider/APILoggingProvider.js ***!
32814
- \*************************************************************/
32815
- /*! exports provided: APILoggingProvider */
32816
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
32817
-
32818
- "use strict";
32819
- __webpack_require__.r(__webpack_exports__);
32820
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APILoggingProvider", function() { return APILoggingProvider; });
32821
- /* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Logger */ "./lib-esm/Logger/index.js");
32822
- /* harmony import */ var _loggerConnectivity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loggerConnectivity */ "./lib-esm/Providers/APIProvider/loggerConnectivity.js");
32823
- /* harmony import */ var _types_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../types/types */ "./lib-esm/types/types.js");
32824
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../ */ "./lib-esm/index.js");
32825
- /* harmony import */ var _Fetch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Fetch */ "./lib-esm/Providers/APIProvider/Fetch.js");
32826
- /* harmony import */ var _Util_Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Util/Constants */ "./lib-esm/Util/Constants.js");
32827
- /* harmony import */ var _Util_StringUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Util/StringUtils */ "./lib-esm/Util/StringUtils.js");
32828
- function _typeof(obj) {
32829
- "@babel/helpers - typeof";
32830
-
32831
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
32832
- return typeof obj;
32833
- } : function (obj) {
32834
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
32835
- }, _typeof(obj);
32836
- }
32837
-
32838
- var __assign = undefined && undefined.__assign || function () {
32839
- __assign = Object.assign || function (t) {
32840
- for (var s, i = 1, n = arguments.length; i < n; i++) {
32841
- s = arguments[i];
32842
-
32843
- for (var p in s) {
32844
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
32845
- }
32846
- }
32847
-
32848
- return t;
32849
- };
32850
-
32851
- return __assign.apply(this, arguments);
32852
- };
32853
-
32854
- var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
32855
- function adopt(value) {
32856
- return value instanceof P ? value : new P(function (resolve) {
32857
- resolve(value);
32858
- });
32859
- }
32860
-
32861
- return new (P || (P = Promise))(function (resolve, reject) {
32862
- function fulfilled(value) {
32863
- try {
32864
- step(generator.next(value));
32865
- } catch (e) {
32866
- reject(e);
32867
- }
32868
- }
32869
-
32870
- function rejected(value) {
32871
- try {
32872
- step(generator["throw"](value));
32873
- } catch (e) {
32874
- reject(e);
32875
- }
32876
- }
32877
-
32878
- function step(result) {
32879
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
32880
- }
32881
-
32882
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32883
- });
32884
- };
32885
-
32886
- var __generator = undefined && undefined.__generator || function (thisArg, body) {
32887
- var _ = {
32888
- label: 0,
32889
- sent: function sent() {
32890
- if (t[0] & 1) throw t[1];
32891
- return t[1];
32892
- },
32893
- trys: [],
32894
- ops: []
32895
- },
32896
- f,
32897
- y,
32898
- t,
32899
- g;
32900
- return g = {
32901
- next: verb(0),
32902
- "throw": verb(1),
32903
- "return": verb(2)
32904
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
32905
- return this;
32906
- }), g;
32907
-
32908
- function verb(n) {
32909
- return function (v) {
32910
- return step([n, v]);
32911
- };
32912
- }
32913
-
32914
- function step(op) {
32915
- if (f) throw new TypeError("Generator is already executing.");
32916
-
32917
- while (_) {
32918
- try {
32919
- 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;
32920
- if (y = 0, t) op = [op[0] & 2, t.value];
32921
-
32922
- switch (op[0]) {
32923
- case 0:
32924
- case 1:
32925
- t = op;
32926
- break;
32927
-
32928
- case 4:
32929
- _.label++;
32930
- return {
32931
- value: op[1],
32932
- done: false
32933
- };
32934
-
32935
- case 5:
32936
- _.label++;
32937
- y = op[1];
32938
- op = [0];
32939
- continue;
32940
-
32941
- case 7:
32942
- op = _.ops.pop();
32943
-
32944
- _.trys.pop();
32945
-
32946
- continue;
32947
-
32948
- default:
32949
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
32950
- _ = 0;
32951
- continue;
32952
- }
32953
-
32954
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
32955
- _.label = op[1];
32956
- break;
32957
- }
32958
-
32959
- if (op[0] === 6 && _.label < t[1]) {
32960
- _.label = t[1];
32961
- t = op;
32962
- break;
32963
- }
32964
-
32965
- if (t && _.label < t[2]) {
32966
- _.label = t[2];
32967
-
32968
- _.ops.push(op);
32969
-
32970
- break;
32971
- }
32972
-
32973
- if (t[2]) _.ops.pop();
32974
-
32975
- _.trys.pop();
32976
-
32977
- continue;
32978
- }
32979
-
32980
- op = body.call(thisArg, _);
32981
- } catch (e) {
32982
- op = [6, e];
32983
- y = 0;
32984
- } finally {
32985
- f = t = 0;
32986
- }
32987
- }
32988
-
32989
- if (op[0] & 5) throw op[1];
32990
- return {
32991
- value: op[0] ? op[1] : void 0,
32992
- done: true
32993
- };
32994
- }
32995
- };
32996
-
32997
- var __read = undefined && undefined.__read || function (o, n) {
32998
- var m = typeof Symbol === "function" && o[Symbol.iterator];
32999
- if (!m) return o;
33000
- var i = m.call(o),
33001
- r,
33002
- ar = [],
33003
- e;
33004
-
33005
- try {
33006
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
33007
- ar.push(r.value);
33008
- }
33009
- } catch (error) {
33010
- e = {
33011
- error: error
33012
- };
33013
- } finally {
33014
- try {
33015
- if (r && !r.done && (m = i["return"])) m.call(i);
33016
- } finally {
33017
- if (e) throw e.error;
33018
- }
33019
- }
33020
-
33021
- return ar;
33022
- };
33023
-
33024
- var __spread = undefined && undefined.__spread || function () {
33025
- for (var ar = [], i = 0; i < arguments.length; i++) {
33026
- ar = ar.concat(__read(arguments[i]));
33027
- }
33028
-
33029
- return ar;
33030
- };
33031
-
33032
-
33033
-
33034
-
33035
-
33036
-
33037
-
33038
-
33039
- var logger = new _Logger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('APILoggingProvider');
33040
- var HTTPS = 'https';
33041
- var LOCALHOST = 'http://localhost';
33042
- var DEFAULT_INTERVAL = 3000; // Exclude these to avoid infinite loop
33043
-
33044
- var DEFAULT_CLASS_EXCLUDE_LIST = ['APILoggingProvider', 'AWSCloudWatch', 'Retry'];
33045
- var LAMBDA_PAYLOAD_LIMIT = 6 * 1024 * 1024; // 6MB
33046
-
33047
- /*
33048
- Todo:
33049
- * Refactor this into a FSM - managing state will become complex when remote config functionality gets added in P1
33050
- */
33051
-
33052
- var APILoggingProvider =
33053
- /** @class */
33054
- function () {
33055
- function APILoggingProvider(config) {
33056
- this.online = false;
33057
- this.eventBuffer = [];
33058
- this.configure(config);
33059
- }
33060
-
33061
- APILoggingProvider.prototype.getProviderName = function () {
33062
- return APILoggingProvider.PROVIDER_NAME;
33063
- };
33064
-
33065
- APILoggingProvider.prototype.getCategoryName = function () {
33066
- return APILoggingProvider.CATEGORY;
33067
- };
33068
-
33069
- APILoggingProvider.prototype.configure = function (config) {
33070
- try {
33071
- this.validateConfig(config);
33072
- this.config = this.normalizeConfig(config);
33073
-
33074
- if (this.config.enabled === true) {
33075
- this.initialize();
33076
- } else {
33077
- this.disable();
33078
- }
33079
-
33080
- return this.config;
33081
- } catch (error) {
33082
- logger.error('Unable to start: ', error);
33083
- }
33084
- };
33085
-
33086
- APILoggingProvider.prototype.pushLogs = function (events) {
33087
- var _this = this;
33088
-
33089
- var _a;
33090
-
33091
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enabled) === false) {
33092
- return;
33093
- }
33094
-
33095
- events.forEach(function (event) {
33096
- if (!Object(_types_types__WEBPACK_IMPORTED_MODULE_2__["isLoggerEvent"])(event)) {
33097
- return;
33098
- }
33099
-
33100
- var message = event.message,
33101
- timestamp = event.timestamp,
33102
- _a = event.loggerInfo,
33103
- level = _a.level,
33104
- data = _a.data,
33105
- name = _a.name,
33106
- _b = _a.error,
33107
- _c = _b === void 0 ? {} : _b,
33108
- errorMessage = _c.message,
33109
- errorName = _c.name;
33110
-
33111
- var error = errorName && errorMessage && {
33112
- errorMessage: errorMessage,
33113
- errorName: errorName
33114
- };
33115
- var combinedEvent = {
33116
- level: level,
33117
- error: error,
33118
- message: message,
33119
- context: {
33120
- category: name,
33121
- data: __assign(__assign({}, data), _this.config.metadata),
33122
- logTime: timestamp
33123
- }
33124
- };
33125
-
33126
- if (_this.verifyEvent(combinedEvent)) {
33127
- _this.eventBuffer.push(combinedEvent);
33128
- }
33129
- });
33130
- };
33131
-
33132
- APILoggingProvider.prototype.validateConfig = function (config) {
33133
- if (typeof (config === null || config === void 0 ? void 0 : config.endpoint) !== 'string') {
33134
- throw new Error("Invalid configuration. `config.endpoint` must be a string. Received: " + _typeof(config === null || config === void 0 ? void 0 : config.endpoint));
33135
- }
33136
-
33137
- var protocolStr = config.endpoint.substring(0, 5).toLowerCase();
33138
- var isUsingLocalhost = config.endpoint.substring(0, LOCALHOST.length).toLowerCase() === LOCALHOST;
33139
-
33140
- if (protocolStr !== HTTPS && !isUsingLocalhost) {
33141
- throw new Error("Invalid configuration. Only HTTPS endpoints are supported. Received: " + protocolStr);
33142
- }
33143
- };
33144
-
33145
- APILoggingProvider.prototype.normalizeConfig = function (config) {
33146
- var _a, _b, _c;
33147
-
33148
- var normalizedConfig = {
33149
- endpoint: config.endpoint,
33150
- apiKey: config.apiKey,
33151
- metadata: config.metadata,
33152
- enabled: (_a = config.enabled) !== null && _a !== void 0 ? _a : true,
33153
- level: (_b = config.level) !== null && _b !== void 0 ? _b : _Logger__WEBPACK_IMPORTED_MODULE_0__["LOG_TYPE"].WARN,
33154
- bufferInterval: (_c = config.bufferInterval) !== null && _c !== void 0 ? _c : DEFAULT_INTERVAL,
33155
- excludeClassList: config.excludeClassList instanceof Array ? __spread(DEFAULT_CLASS_EXCLUDE_LIST, config.excludeClassList) : DEFAULT_CLASS_EXCLUDE_LIST
33156
- };
33157
- return normalizedConfig;
33158
- };
33159
-
33160
- APILoggingProvider.prototype.initialize = function () {
33161
- this.subscribeConnectivity();
33162
- };
33163
-
33164
- APILoggingProvider.prototype.disable = function () {
33165
- this.clearInterval();
33166
- this.unsubscribeConnectivity();
33167
- this.eventBuffer = [];
33168
- };
33169
-
33170
- APILoggingProvider.prototype.subscribeConnectivity = function () {
33171
- var _this = this;
33172
-
33173
- if (this.connectivity) {
33174
- return;
33175
- }
33176
-
33177
- this.connectivity = new _loggerConnectivity__WEBPACK_IMPORTED_MODULE_1__["default"]();
33178
- this.connectivity.status().subscribe(function (_a) {
33179
- var online = _a.online;
33180
-
33181
- if (online && !_this.online) {
33182
- _this.startInterval();
33183
- } else {
33184
- _this.clearInterval();
33185
- }
33186
-
33187
- _this.online = online;
33188
- logger.debug('Connectivity status: ', online);
33189
- });
33190
- };
33191
-
33192
- APILoggingProvider.prototype.unsubscribeConnectivity = function () {
33193
- if (this.connectivity) {
33194
- this.connectivity.unsubscribe();
33195
- this.connectivity = undefined;
33196
- }
33197
- };
33198
-
33199
- APILoggingProvider.prototype.startInterval = function () {
33200
- var _this = this;
33201
-
33202
- if (this.bufferInterval) {
33203
- this.clearInterval();
33204
- }
33205
-
33206
- this.bufferInterval = setInterval(function () {
33207
- return __awaiter(_this, void 0, void 0, function () {
33208
- var error_1;
33209
- return __generator(this, function (_a) {
33210
- switch (_a.label) {
33211
- case 0:
33212
- _a.trys.push([0, 2,, 3]);
33213
-
33214
- return [4
33215
- /*yield*/
33216
- , this.uploadEvents()];
33217
-
33218
- case 1:
33219
- _a.sent();
33220
-
33221
- return [3
33222
- /*break*/
33223
- , 3];
33224
-
33225
- case 2:
33226
- error_1 = _a.sent();
33227
- logger.error("Could not upload log events", error_1);
33228
- return [3
33229
- /*break*/
33230
- , 3];
33231
-
33232
- case 3:
33233
- return [2
33234
- /*return*/
33235
- ];
33236
- }
33237
- });
33238
- });
33239
- }, this.config.bufferInterval);
33240
- };
33241
-
33242
- APILoggingProvider.prototype.clearInterval = function () {
33243
- clearInterval(this.bufferInterval);
33244
- this.bufferInterval = undefined;
33245
- };
33246
- /*
33247
- Filter out events that don't adhere to config settings
33248
- */
33249
-
33250
-
33251
- APILoggingProvider.prototype.verifyEvent = function (event) {
33252
- var level = event.level,
33253
- context = event.context;
33254
- var configLevelValue = _Logger__WEBPACK_IMPORTED_MODULE_0__["LOG_LEVELS"][this.config.level];
33255
- var eventLevelValue = _Logger__WEBPACK_IMPORTED_MODULE_0__["LOG_LEVELS"][level];
33256
-
33257
- if (eventLevelValue < configLevelValue) {
33258
- return false;
33259
- }
33260
-
33261
- if (this.config.excludeClassList.includes(context.category)) {
33262
- return false;
33263
- }
33264
-
33265
- return true;
33266
- };
33267
-
33268
- APILoggingProvider.prototype.uploadEvents = function () {
33269
- return __awaiter(this, void 0, void 0, function () {
33270
- var eventBatch, body, options;
33271
-
33272
- var _this = this;
33273
-
33274
- return __generator(this, function (_a) {
33275
- switch (_a.label) {
33276
- case 0:
33277
- eventBatch = this.genericLogEventBatch(this.eventBuffer);
33278
-
33279
- if (eventBatch.length < 1) {
33280
- return [2
33281
- /*return*/
33282
- ];
33283
- }
33284
-
33285
- body = {
33286
- logs: eventBatch
33287
- };
33288
- options = Object(_Fetch__WEBPACK_IMPORTED_MODULE_4__["postOptions"])(body);
33289
- return [4
33290
- /*yield*/
33291
- , Object(___WEBPACK_IMPORTED_MODULE_3__["jitteredExponentialRetry"])(function (endpoint, options) {
33292
- return __awaiter(_this, void 0, void 0, function () {
33293
- var error_2;
33294
- return __generator(this, function (_a) {
33295
- switch (_a.label) {
33296
- case 0:
33297
- _a.trys.push([0, 2,, 3]);
33298
-
33299
- return [4
33300
- /*yield*/
33301
- , fetch(endpoint, options)];
33302
-
33303
- case 1:
33304
- _a.sent(); // fetch doesnt return info for no-cors request
33305
-
33306
-
33307
- return [3
33308
- /*break*/
33309
- , 3];
33310
-
33311
- case 2:
33312
- error_2 = _a.sent(); // fetch will only fail in the event of a network error. Don't retry
33313
-
33314
- if (error_2.message === 'Failed to fetch') {
33315
- throw new ___WEBPACK_IMPORTED_MODULE_3__["NonRetryableError"](error_2.message);
33316
- } // all other errors are logged and retried
33317
-
33318
-
33319
- logger.warn(error_2);
33320
- throw error_2;
33321
-
33322
- case 3:
33323
- return [2
33324
- /*return*/
33325
- ];
33326
- }
33327
- });
33328
- });
33329
- }, [this.config.endpoint, options])];
33330
-
33331
- case 1:
33332
- _a.sent(); // remove events from buffer after the request succeeds
33333
-
33334
-
33335
- this.eventBuffer.splice(0, eventBatch.length);
33336
- return [2
33337
- /*return*/
33338
- ];
33339
- }
33340
- });
33341
- });
33342
- };
33343
-
33344
- APILoggingProvider.prototype.genericLogEventBatch = function (buffer) {
33345
- var totalByteSize = 0;
33346
- var currentEventIdx = 0;
33347
-
33348
- while (currentEventIdx < buffer.length) {
33349
- var currentEvent = buffer[currentEventIdx];
33350
- var eventSize = Object(_Util_StringUtils__WEBPACK_IMPORTED_MODULE_6__["getStringByteSize"])(JSON.stringify(currentEvent));
33351
-
33352
- if (totalByteSize + eventSize > LAMBDA_PAYLOAD_LIMIT) {
33353
- break;
33354
- }
33355
-
33356
- totalByteSize += eventSize;
33357
- currentEventIdx += 1;
33358
- }
33359
-
33360
- return buffer.slice(0, currentEventIdx);
33361
- };
33362
-
33363
- APILoggingProvider.PROVIDER_NAME = _Util_Constants__WEBPACK_IMPORTED_MODULE_5__["API_LOGGING_PROVIDER_NAME"];
33364
- APILoggingProvider.CATEGORY = _Util_Constants__WEBPACK_IMPORTED_MODULE_5__["API_LOGGING_PROVIDER_CATEGORY"];
33365
- return APILoggingProvider;
33366
- }();
33367
-
33368
-
33369
-
33370
- /***/ }),
33371
-
33372
- /***/ "./lib-esm/Providers/APIProvider/Fetch.js":
33373
- /*!************************************************!*\
33374
- !*** ./lib-esm/Providers/APIProvider/Fetch.js ***!
33375
- \************************************************/
33376
- /*! exports provided: postOptions */
33377
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
33378
-
33379
- "use strict";
33380
- __webpack_require__.r(__webpack_exports__);
33381
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "postOptions", function() { return postOptions; });
33382
- var postOptions = function postOptions(body) {
33383
- return {
33384
- method: 'POST',
33385
- mode: 'no-cors',
33386
- cache: 'no-cache',
33387
- credentials: 'same-origin',
33388
- headers: {
33389
- 'Content-Type': 'application/json'
33390
- },
33391
- body: JSON.stringify(body)
32485
+ } else {
32486
+ rej(new _Util__WEBPACK_IMPORTED_MODULE_2__["NonRetryableError"]('User is not signed in with Google'));
32487
+ }
32488
+ })["catch"](function (err) {
32489
+ logger.debug('Failed to refresh google token', err);
32490
+ rej(new _Util__WEBPACK_IMPORTED_MODULE_2__["NonRetryableError"]('Failed to refresh google token'));
32491
+ });
32492
+ });
33392
32493
  };
33393
- };
33394
32494
 
33395
- /***/ }),
32495
+ return GoogleOAuth;
32496
+ }();
33396
32497
 
33397
- /***/ "./lib-esm/Providers/APIProvider/LoggerReachability/index.js":
33398
- /*!*******************************************************************!*\
33399
- !*** ./lib-esm/Providers/APIProvider/LoggerReachability/index.js ***!
33400
- \*******************************************************************/
33401
- /*! exports provided: ReachabilityMonitor */
33402
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
33403
32498
 
33404
- "use strict";
33405
- __webpack_require__.r(__webpack_exports__);
33406
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReachabilityMonitor", function() { return ReachabilityMonitor; });
33407
- /* harmony import */ var _Util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Util */ "./lib-esm/Util/index.js");
32499
+ /**
32500
+ * @deprecated use named import
32501
+ */
33408
32502
 
33409
- var ReachabilityMonitor = new _Util__WEBPACK_IMPORTED_MODULE_0__["Reachability"]().networkMonitor();
32503
+ /* harmony default export */ __webpack_exports__["default"] = (GoogleOAuth);
33410
32504
 
33411
32505
  /***/ }),
33412
32506
 
33413
- /***/ "./lib-esm/Providers/APIProvider/index.js":
33414
- /*!************************************************!*\
33415
- !*** ./lib-esm/Providers/APIProvider/index.js ***!
33416
- \************************************************/
33417
- /*! exports provided: APILoggingProvider */
32507
+ /***/ "./lib-esm/OAuthHelper/index.js":
32508
+ /*!**************************************!*\
32509
+ !*** ./lib-esm/OAuthHelper/index.js ***!
32510
+ \**************************************/
32511
+ /*! exports provided: GoogleOAuth, FacebookOAuth */
33418
32512
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
33419
32513
 
33420
32514
  "use strict";
33421
32515
  __webpack_require__.r(__webpack_exports__);
33422
- /* harmony import */ var _APILoggingProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./APILoggingProvider */ "./lib-esm/Providers/APIProvider/APILoggingProvider.js");
33423
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "APILoggingProvider", function() { return _APILoggingProvider__WEBPACK_IMPORTED_MODULE_0__["APILoggingProvider"]; });
32516
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GoogleOAuth", function() { return GoogleOAuth; });
32517
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FacebookOAuth", function() { return FacebookOAuth; });
32518
+ /* harmony import */ var _GoogleOAuth__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GoogleOAuth */ "./lib-esm/OAuthHelper/GoogleOAuth.js");
32519
+ /* harmony import */ var _FacebookOAuth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FacebookOAuth */ "./lib-esm/OAuthHelper/FacebookOAuth.js");
32520
+ /*
32521
+ * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
32522
+ *
32523
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
32524
+ * the License. A copy of the License is located at
32525
+ *
32526
+ * http://aws.amazon.com/apache2.0/
32527
+ *
32528
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
32529
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
32530
+ * and limitations under the License.
32531
+ */
33424
32532
 
33425
32533
 
32534
+ var GoogleOAuth = new _GoogleOAuth__WEBPACK_IMPORTED_MODULE_0__["GoogleOAuth"]();
32535
+ var FacebookOAuth = new _FacebookOAuth__WEBPACK_IMPORTED_MODULE_1__["FacebookOAuth"]();
33426
32536
 
33427
32537
  /***/ }),
33428
32538
 
33429
- /***/ "./lib-esm/Providers/APIProvider/loggerConnectivity.js":
33430
- /*!*************************************************************!*\
33431
- !*** ./lib-esm/Providers/APIProvider/loggerConnectivity.js ***!
33432
- \*************************************************************/
33433
- /*! exports provided: default */
32539
+ /***/ "./lib-esm/Parser.js":
32540
+ /*!***************************!*\
32541
+ !*** ./lib-esm/Parser.js ***!
32542
+ \***************************/
32543
+ /*! exports provided: parseMobileHubConfig, Parser, default */
33434
32544
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
33435
32545
 
33436
32546
  "use strict";
33437
32547
  __webpack_require__.r(__webpack_exports__);
33438
- /* harmony import */ var zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zen-observable-ts */ "../../node_modules/zen-observable-ts/lib/bundle.esm.js");
33439
- /* harmony import */ var _LoggerReachability__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LoggerReachability */ "./lib-esm/Providers/APIProvider/LoggerReachability/index.js");
32548
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseMobileHubConfig", function() { return parseMobileHubConfig; });
32549
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; });
32550
+ /* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Logger */ "./lib-esm/Logger/index.js");
33440
32551
  var __assign = undefined && undefined.__assign || function () {
33441
32552
  __assign = Object.assign || function (t) {
33442
32553
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -33454,54 +32565,167 @@ var __assign = undefined && undefined.__assign || function () {
33454
32565
  };
33455
32566
 
33456
32567
 
33457
- // TODO: refactor this to a singleton that supports numerous observers
32568
+ var logger = new _Logger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Parser');
32569
+ var parseMobileHubConfig = function parseMobileHubConfig(config) {
32570
+ var amplifyConfig = {}; // Analytics
33458
32571
 
33459
- var LoggerConnectivity =
33460
- /** @class */
33461
- function () {
33462
- function LoggerConnectivity() {
33463
- this.connectionStatus = {
33464
- online: false
32572
+ if (config['aws_mobile_analytics_app_id']) {
32573
+ var Analytics = {
32574
+ AWSPinpoint: {
32575
+ appId: config['aws_mobile_analytics_app_id'],
32576
+ region: config['aws_mobile_analytics_app_region']
32577
+ }
33465
32578
  };
33466
- }
32579
+ amplifyConfig.Analytics = Analytics;
32580
+ } // Auth
33467
32581
 
33468
- LoggerConnectivity.prototype.status = function () {
33469
- var _this = this;
33470
32582
 
33471
- if (this.observer) {
33472
- throw new Error('Subscriber already exists');
33473
- }
32583
+ if (config['aws_cognito_identity_pool_id'] || config['aws_user_pools_id']) {
32584
+ amplifyConfig.Auth = {
32585
+ userPoolId: config['aws_user_pools_id'],
32586
+ userPoolWebClientId: config['aws_user_pools_web_client_id'],
32587
+ region: config['aws_cognito_region'],
32588
+ identityPoolId: config['aws_cognito_identity_pool_id'],
32589
+ identityPoolRegion: config['aws_cognito_region'],
32590
+ mandatorySignIn: config['aws_mandatory_sign_in'] === 'enable'
32591
+ };
32592
+ } // Storage
33474
32593
 
33475
- return new zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__["default"](function (observer) {
33476
- _this.observer = observer;
33477
- _this.subscription = _LoggerReachability__WEBPACK_IMPORTED_MODULE_1__["ReachabilityMonitor"].subscribe(function (_a) {
33478
- var online = _a.online;
33479
- _this.connectionStatus.online = online;
33480
32594
 
33481
- var observerResult = __assign({}, _this.connectionStatus);
32595
+ var storageConfig;
33482
32596
 
33483
- observer.next(observerResult);
33484
- });
33485
- return function () {
33486
- clearTimeout(_this.timeout);
32597
+ if (config['aws_user_files_s3_bucket']) {
32598
+ storageConfig = {
32599
+ AWSS3: {
32600
+ bucket: config['aws_user_files_s3_bucket'],
32601
+ region: config['aws_user_files_s3_bucket_region'],
32602
+ dangerouslyConnectToHttpEndpointForTesting: config['aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing']
32603
+ }
32604
+ };
32605
+ } else {
32606
+ storageConfig = config ? config.Storage || config : {};
32607
+ } // Logging
33487
32608
 
33488
- _this.unsubscribe();
33489
- };
32609
+
32610
+ if (config['Logging']) {
32611
+ amplifyConfig.Logging = __assign(__assign({}, config['Logging']), {
32612
+ region: config['aws_project_region']
33490
32613
  });
33491
- };
32614
+ } // Geo
33492
32615
 
33493
- LoggerConnectivity.prototype.unsubscribe = function () {
33494
- if (this.subscription) {
33495
- clearTimeout(this.timeout);
33496
- this.subscription.unsubscribe();
33497
- this.observer = undefined;
32616
+
32617
+ if (config['geo']) {
32618
+ amplifyConfig.Geo = Object.assign({}, config.geo);
32619
+
32620
+ if (config.geo['amazon_location_service']) {
32621
+ amplifyConfig.Geo = {
32622
+ AmazonLocationService: config.geo['amazon_location_service']
32623
+ };
33498
32624
  }
33499
- };
32625
+ }
32626
+
32627
+ amplifyConfig.Analytics = Object.assign({}, amplifyConfig.Analytics, config.Analytics);
32628
+ amplifyConfig.Auth = Object.assign({}, amplifyConfig.Auth, config.Auth);
32629
+ amplifyConfig.Storage = Object.assign({}, storageConfig);
32630
+ amplifyConfig.Logging = Object.assign({}, amplifyConfig.Logging, config.Logging);
32631
+ logger.debug('parse config', config, 'to amplifyconfig', amplifyConfig);
32632
+ return amplifyConfig;
32633
+ };
32634
+ /**
32635
+ * @deprecated use per-function export
32636
+ */
32637
+
32638
+ var Parser =
32639
+ /** @class */
32640
+ function () {
32641
+ function Parser() {}
33500
32642
 
33501
- return LoggerConnectivity;
32643
+ Parser.parseMobilehubConfig = parseMobileHubConfig;
32644
+ return Parser;
33502
32645
  }();
33503
32646
 
33504
- /* harmony default export */ __webpack_exports__["default"] = (LoggerConnectivity);
32647
+
32648
+ /**
32649
+ * @deprecated use per-function export
32650
+ */
32651
+
32652
+ /* harmony default export */ __webpack_exports__["default"] = (Parser);
32653
+
32654
+ /***/ }),
32655
+
32656
+ /***/ "./lib-esm/Platform/index.js":
32657
+ /*!***********************************!*\
32658
+ !*** ./lib-esm/Platform/index.js ***!
32659
+ \***********************************/
32660
+ /*! exports provided: Platform, getAmplifyUserAgent, default */
32661
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
32662
+
32663
+ "use strict";
32664
+ __webpack_require__.r(__webpack_exports__);
32665
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Platform", function() { return Platform; });
32666
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAmplifyUserAgent", function() { return getAmplifyUserAgent; });
32667
+ /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version */ "./lib-esm/Platform/version.js");
32668
+ /*
32669
+ * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
32670
+ *
32671
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
32672
+ * the License. A copy of the License is located at
32673
+ *
32674
+ * http://aws.amazon.com/apache2.0/
32675
+ *
32676
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
32677
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
32678
+ * and limitations under the License.
32679
+ */
32680
+
32681
+ var BASE_USER_AGENT = "aws-amplify/" + _version__WEBPACK_IMPORTED_MODULE_0__["version"];
32682
+ var Platform = {
32683
+ userAgent: BASE_USER_AGENT + " js",
32684
+ product: '',
32685
+ navigator: null,
32686
+ isReactNative: false
32687
+ };
32688
+
32689
+ if (typeof navigator !== 'undefined' && navigator.product) {
32690
+ Platform.product = navigator.product || '';
32691
+ Platform.navigator = navigator || null;
32692
+
32693
+ switch (navigator.product) {
32694
+ case 'ReactNative':
32695
+ Platform.userAgent = BASE_USER_AGENT + " react-native";
32696
+ Platform.isReactNative = true;
32697
+ break;
32698
+
32699
+ default:
32700
+ Platform.userAgent = BASE_USER_AGENT + " js";
32701
+ Platform.isReactNative = false;
32702
+ break;
32703
+ }
32704
+ }
32705
+
32706
+ var getAmplifyUserAgent = function getAmplifyUserAgent() {
32707
+ return Platform.userAgent;
32708
+ };
32709
+ /**
32710
+ * @deprecated use named import
32711
+ */
32712
+
32713
+ /* harmony default export */ __webpack_exports__["default"] = (Platform);
32714
+
32715
+ /***/ }),
32716
+
32717
+ /***/ "./lib-esm/Platform/version.js":
32718
+ /*!*************************************!*\
32719
+ !*** ./lib-esm/Platform/version.js ***!
32720
+ \*************************************/
32721
+ /*! exports provided: version */
32722
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
32723
+
32724
+ "use strict";
32725
+ __webpack_require__.r(__webpack_exports__);
32726
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
32727
+ // generated by genversion
32728
+ var version = '4.4.1';
33505
32729
 
33506
32730
  /***/ }),
33507
32731
 
@@ -33999,15 +33223,7 @@ function () {
33999
33223
 
34000
33224
  AWSCloudWatchProvider.prototype.pushLogs = function (logs) {
34001
33225
  logger.debug('pushing log events to Cloudwatch...');
34002
- var formattedLogs = logs.map(function (_a) {
34003
- var message = _a.message,
34004
- timestamp = _a.timestamp;
34005
- return {
34006
- message: message,
34007
- timestamp: timestamp
34008
- };
34009
- });
34010
- this._dataTracker.logEvents = __spread(this._dataTracker.logEvents, formattedLogs);
33226
+ this._dataTracker.logEvents = __spread(this._dataTracker.logEvents, logs);
34011
33227
  };
34012
33228
 
34013
33229
  AWSCloudWatchProvider.prototype._validateLogGroupExistsAndCreate = function (logGroupName) {
@@ -34522,7 +33738,7 @@ function () {
34522
33738
  /*!************************************!*\
34523
33739
  !*** ./lib-esm/Providers/index.js ***!
34524
33740
  \************************************/
34525
- /*! exports provided: AWSCloudWatchProvider, APILoggingProvider */
33741
+ /*! exports provided: AWSCloudWatchProvider */
34526
33742
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
34527
33743
 
34528
33744
  "use strict";
@@ -34530,10 +33746,6 @@ __webpack_require__.r(__webpack_exports__);
34530
33746
  /* harmony import */ var _AWSCloudWatchProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AWSCloudWatchProvider */ "./lib-esm/Providers/AWSCloudWatchProvider.js");
34531
33747
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWSCloudWatchProvider", function() { return _AWSCloudWatchProvider__WEBPACK_IMPORTED_MODULE_0__["AWSCloudWatchProvider"]; });
34532
33748
 
34533
- /* harmony import */ var _APIProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./APIProvider */ "./lib-esm/Providers/APIProvider/index.js");
34534
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "APILoggingProvider", function() { return _APIProvider__WEBPACK_IMPORTED_MODULE_1__["APILoggingProvider"]; });
34535
-
34536
-
34537
33749
 
34538
33750
 
34539
33751
  /***/ }),
@@ -35538,7 +34750,7 @@ function () {
35538
34750
  /*!***********************************!*\
35539
34751
  !*** ./lib-esm/Util/Constants.js ***!
35540
34752
  \***********************************/
35541
- /*! exports provided: 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, API_LOGGING_PROVIDER_NAME, API_LOGGING_PROVIDER_CATEGORY */
34753
+ /*! exports provided: 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 */
35542
34754
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
35543
34755
 
35544
34756
  "use strict";
@@ -35550,8 +34762,6 @@ __webpack_require__.r(__webpack_exports__);
35550
34762
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWS_CLOUDWATCH_PROVIDER_NAME", function() { return AWS_CLOUDWATCH_PROVIDER_NAME; });
35551
34763
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NO_CREDS_ERROR_STRING", function() { return NO_CREDS_ERROR_STRING; });
35552
34764
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return RETRY_ERROR_CODES; });
35553
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_NAME", function() { return API_LOGGING_PROVIDER_NAME; });
35554
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_CATEGORY", function() { return API_LOGGING_PROVIDER_CATEGORY; });
35555
34765
  /*
35556
34766
  * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
35557
34767
  *
@@ -35572,8 +34782,6 @@ var AWS_CLOUDWATCH_CATEGORY = 'Logging';
35572
34782
  var AWS_CLOUDWATCH_PROVIDER_NAME = 'AWSCloudWatch';
35573
34783
  var NO_CREDS_ERROR_STRING = 'No credentials';
35574
34784
  var RETRY_ERROR_CODES = ['ResourceNotFoundException', 'InvalidSequenceTokenException'];
35575
- var API_LOGGING_PROVIDER_NAME = 'API';
35576
- var API_LOGGING_PROVIDER_CATEGORY = 'Logging';
35577
34785
 
35578
34786
 
35579
34787
  /***/ }),
@@ -35787,7 +34995,7 @@ function () {
35787
34995
 
35788
34996
  "use strict";
35789
34997
  __webpack_require__.r(__webpack_exports__);
35790
- /* harmony import */ var _JS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../JS */ "./lib-esm/JS.js");
34998
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core */ "./lib-esm/index.js");
35791
34999
  /* harmony import */ var zen_observable_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! zen-observable-ts */ "../../node_modules/zen-observable-ts/lib/bundle.esm.js");
35792
35000
  var __values = undefined && undefined.__values || function (o) {
35793
35001
  var s = typeof Symbol === "function" && Symbol.iterator,
@@ -35815,13 +35023,13 @@ function () {
35815
35023
  function ReachabilityNavigator() {}
35816
35024
 
35817
35025
  ReachabilityNavigator.prototype.networkMonitor = function (netInfo) {
35818
- if (Object(_JS__WEBPACK_IMPORTED_MODULE_0__["browserOrNode"])().isNode) {
35026
+ if (Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["browserOrNode"])().isNode) {
35819
35027
  return zen_observable_ts__WEBPACK_IMPORTED_MODULE_1__["default"].from([{
35820
35028
  online: true
35821
35029
  }]);
35822
35030
  }
35823
35031
 
35824
- var globalObj = Object(_JS__WEBPACK_IMPORTED_MODULE_0__["isWebWorker"])() ? self : window;
35032
+ var globalObj = Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["isWebWorker"])() ? self : window;
35825
35033
  return new zen_observable_ts__WEBPACK_IMPORTED_MODULE_1__["default"](function (observer) {
35826
35034
  observer.next({
35827
35035
  online: globalObj.navigator.onLine
@@ -35900,13 +35108,14 @@ function () {
35900
35108
  /*!*******************************!*\
35901
35109
  !*** ./lib-esm/Util/Retry.js ***!
35902
35110
  \*******************************/
35903
- /*! exports provided: NonRetryableError, retry, jitteredExponentialRetry */
35111
+ /*! exports provided: NonRetryableError, retry, jitteredBackoff, jitteredExponentialRetry */
35904
35112
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
35905
35113
 
35906
35114
  "use strict";
35907
35115
  __webpack_require__.r(__webpack_exports__);
35908
35116
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NonRetryableError", function() { return NonRetryableError; });
35909
35117
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return retry; });
35118
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jitteredBackoff", function() { return jitteredBackoff; });
35910
35119
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jitteredExponentialRetry", function() { return jitteredExponentialRetry; });
35911
35120
  /* harmony import */ var _Logger_ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Logger/ConsoleLogger */ "./lib-esm/Logger/ConsoleLogger.js");
35912
35121
  var __extends = undefined && undefined.__extends || function () {
@@ -36114,7 +35323,7 @@ var __spread = undefined && undefined.__spread || function () {
36114
35323
  };
36115
35324
 
36116
35325
 
36117
- var logger = new _Logger_ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Retry');
35326
+ var logger = new _Logger_ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Util');
36118
35327
 
36119
35328
  var NonRetryableError =
36120
35329
  /** @class */
@@ -36157,7 +35366,7 @@ function retry(functionToRetry, args, delayFn, attempt) {
36157
35366
  throw Error('functionToRetry must be a function');
36158
35367
  }
36159
35368
 
36160
- logger.debug(functionToRetry.name + " attempt #" + attempt + " with these vars: " + JSON.stringify(args));
35369
+ logger.debug(functionToRetry.name + " attempt #" + attempt + " with this vars: " + JSON.stringify(args));
36161
35370
  _a.label = 1;
36162
35371
 
36163
35372
  case 1:
@@ -36221,8 +35430,16 @@ function retry(functionToRetry, args, delayFn, attempt) {
36221
35430
  });
36222
35431
  }
36223
35432
  var MAX_DELAY_MS = 5 * 60 * 1000;
35433
+ /**
35434
+ * @private
35435
+ * Internal use of Amplify only
35436
+ */
36224
35437
 
36225
35438
  function jitteredBackoff(maxDelayMs) {
35439
+ if (maxDelayMs === void 0) {
35440
+ maxDelayMs = MAX_DELAY_MS;
35441
+ }
35442
+
36226
35443
  var BASE_TIME_MS = 100;
36227
35444
  var JITTER_FACTOR = 100;
36228
35445
  return function (attempt) {
@@ -36235,7 +35452,6 @@ function jitteredBackoff(maxDelayMs) {
36235
35452
  * Internal use of Amplify only
36236
35453
  */
36237
35454
 
36238
-
36239
35455
  var jitteredExponentialRetry = function jitteredExponentialRetry(functionToRetry, args, maxDelayMs) {
36240
35456
  if (maxDelayMs === void 0) {
36241
35457
  maxDelayMs = MAX_DELAY_MS;
@@ -36250,16 +35466,13 @@ var jitteredExponentialRetry = function jitteredExponentialRetry(functionToRetry
36250
35466
  /*!*************************************!*\
36251
35467
  !*** ./lib-esm/Util/StringUtils.js ***!
36252
35468
  \*************************************/
36253
- /*! exports provided: urlSafeEncode, urlSafeDecode, getStringByteSize */
35469
+ /*! exports provided: urlSafeEncode, urlSafeDecode */
36254
35470
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
36255
35471
 
36256
35472
  "use strict";
36257
35473
  __webpack_require__.r(__webpack_exports__);
36258
- /* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlSafeEncode", function() { return urlSafeEncode; });
35474
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlSafeEncode", function() { return urlSafeEncode; });
36259
35475
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlSafeDecode", function() { return urlSafeDecode; });
36260
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStringByteSize", function() { return getStringByteSize; });
36261
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ */ "./lib-esm/index.js");
36262
-
36263
35476
  function urlSafeEncode(str) {
36264
35477
  return str.split('').map(function (_char) {
36265
35478
  return _char.charCodeAt(0).toString(16).padStart(2, '0');
@@ -36270,18 +35483,6 @@ function urlSafeDecode(hex) {
36270
35483
  return String.fromCharCode(parseInt(_char2, 16));
36271
35484
  }).join('');
36272
35485
  }
36273
- var getStringByteSize = function getStringByteSize(str) {
36274
- if (Object(___WEBPACK_IMPORTED_MODULE_0__["browserOrNode"])().isBrowser || Blob !== undefined) {
36275
- return new Blob([str]).size;
36276
- }
36277
-
36278
- if (Buffer !== undefined) {
36279
- return Buffer.byteLength(str, 'utf8');
36280
- }
36281
-
36282
- throw new Error('Cannot compute string length. Blob and Buffer are undefined');
36283
- };
36284
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/buffer/index.js */ "../../node_modules/buffer/index.js").Buffer))
36285
35486
 
36286
35487
  /***/ }),
36287
35488
 
@@ -36289,7 +35490,7 @@ var getStringByteSize = function getStringByteSize(str) {
36289
35490
  /*!*******************************!*\
36290
35491
  !*** ./lib-esm/Util/index.js ***!
36291
35492
  \*******************************/
36292
- /*! exports provided: NonRetryableError, retry, jitteredExponentialRetry, Mutex, Reachability, DateUtils, urlSafeEncode, urlSafeDecode, getStringByteSize, 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, API_LOGGING_PROVIDER_NAME, API_LOGGING_PROVIDER_CATEGORY */
35493
+ /*! exports provided: NonRetryableError, retry, jitteredBackoff, jitteredExponentialRetry, Mutex, Reachability, DateUtils, urlSafeEncode, urlSafeDecode, 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 */
36293
35494
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
36294
35495
 
36295
35496
  "use strict";
@@ -36299,6 +35500,8 @@ __webpack_require__.r(__webpack_exports__);
36299
35500
 
36300
35501
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _Retry__WEBPACK_IMPORTED_MODULE_0__["retry"]; });
36301
35502
 
35503
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jitteredBackoff", function() { return _Retry__WEBPACK_IMPORTED_MODULE_0__["jitteredBackoff"]; });
35504
+
36302
35505
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jitteredExponentialRetry", function() { return _Retry__WEBPACK_IMPORTED_MODULE_0__["jitteredExponentialRetry"]; });
36303
35506
 
36304
35507
  /* harmony import */ var _Mutex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Mutex */ "./lib-esm/Util/Mutex.js");
@@ -36315,8 +35518,6 @@ __webpack_require__.r(__webpack_exports__);
36315
35518
 
36316
35519
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlSafeDecode", function() { return _StringUtils__WEBPACK_IMPORTED_MODULE_4__["urlSafeDecode"]; });
36317
35520
 
36318
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStringByteSize", function() { return _StringUtils__WEBPACK_IMPORTED_MODULE_4__["getStringByteSize"]; });
36319
-
36320
35521
  /* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Constants */ "./lib-esm/Util/Constants.js");
36321
35522
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWS_CLOUDWATCH_BASE_BUFFER_SIZE", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["AWS_CLOUDWATCH_BASE_BUFFER_SIZE"]; });
36322
35523
 
@@ -36332,10 +35533,6 @@ __webpack_require__.r(__webpack_exports__);
36332
35533
 
36333
35534
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["RETRY_ERROR_CODES"]; });
36334
35535
 
36335
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_NAME", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["API_LOGGING_PROVIDER_NAME"]; });
36336
-
36337
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_CATEGORY", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["API_LOGGING_PROVIDER_CATEGORY"]; });
36338
-
36339
35536
 
36340
35537
 
36341
35538
 
@@ -36385,7 +35582,7 @@ var USER_AGENT_HEADER = 'x-amz-user-agent';
36385
35582
  /*!**************************!*\
36386
35583
  !*** ./lib-esm/index.js ***!
36387
35584
  \**************************/
36388
- /*! exports provided: AmplifyClass, ClientDevice, ConsoleLogger, Logger, missingConfig, invalidParameter, Hub, I18n, isEmpty, sortByField, objectLessAttributes, filenameToContentType, isTextFile, generateRandomString, makeQuerablePromise, isWebWorker, browserOrNode, transferKeyToLowerCase, transferKeyToUpperCase, isStrictObject, JS, Signer, parseMobileHubConfig, Parser, AWSCloudWatchProvider, APILoggingProvider, FacebookOAuth, GoogleOAuth, Linking, AppState, AsyncStorage, Credentials, CredentialsClass, ServiceWorker, StorageHelper, MemoryStorage, UniversalStorage, Platform, getAmplifyUserAgent, INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER, INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, Constants, NonRetryableError, retry, jitteredExponentialRetry, Mutex, Reachability, DateUtils, urlSafeEncode, urlSafeDecode, getStringByteSize, 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, API_LOGGING_PROVIDER_NAME, API_LOGGING_PROVIDER_CATEGORY, Amplify, default */
35585
+ /*! exports provided: AmplifyClass, ClientDevice, ConsoleLogger, Logger, missingConfig, invalidParameter, Hub, I18n, isEmpty, sortByField, objectLessAttributes, filenameToContentType, isTextFile, generateRandomString, makeQuerablePromise, isWebWorker, browserOrNode, transferKeyToLowerCase, transferKeyToUpperCase, isStrictObject, JS, Signer, parseMobileHubConfig, Parser, AWSCloudWatchProvider, FacebookOAuth, GoogleOAuth, Linking, AppState, AsyncStorage, Credentials, CredentialsClass, ServiceWorker, StorageHelper, MemoryStorage, UniversalStorage, Platform, getAmplifyUserAgent, INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER, INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, Constants, NonRetryableError, retry, jitteredBackoff, jitteredExponentialRetry, Mutex, Reachability, DateUtils, urlSafeEncode, urlSafeDecode, 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, Amplify, default */
36389
35586
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
36390
35587
 
36391
35588
  "use strict";
@@ -36454,8 +35651,6 @@ __webpack_require__.r(__webpack_exports__);
36454
35651
  /* harmony import */ var _Providers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Providers */ "./lib-esm/Providers/index.js");
36455
35652
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWSCloudWatchProvider", function() { return _Providers__WEBPACK_IMPORTED_MODULE_10__["AWSCloudWatchProvider"]; });
36456
35653
 
36457
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "APILoggingProvider", function() { return _Providers__WEBPACK_IMPORTED_MODULE_10__["APILoggingProvider"]; });
36458
-
36459
35654
  /* harmony import */ var _OAuthHelper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./OAuthHelper */ "./lib-esm/OAuthHelper/index.js");
36460
35655
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FacebookOAuth", function() { return _OAuthHelper__WEBPACK_IMPORTED_MODULE_11__["FacebookOAuth"]; });
36461
35656
 
@@ -36500,6 +35695,8 @@ __webpack_require__.r(__webpack_exports__);
36500
35695
 
36501
35696
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["retry"]; });
36502
35697
 
35698
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jitteredBackoff", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["jitteredBackoff"]; });
35699
+
36503
35700
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jitteredExponentialRetry", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["jitteredExponentialRetry"]; });
36504
35701
 
36505
35702
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Mutex", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["Mutex"]; });
@@ -36512,8 +35709,6 @@ __webpack_require__.r(__webpack_exports__);
36512
35709
 
36513
35710
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlSafeDecode", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["urlSafeDecode"]; });
36514
35711
 
36515
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStringByteSize", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["getStringByteSize"]; });
36516
-
36517
35712
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWS_CLOUDWATCH_BASE_BUFFER_SIZE", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["AWS_CLOUDWATCH_BASE_BUFFER_SIZE"]; });
36518
35713
 
36519
35714
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWS_CLOUDWATCH_CATEGORY", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["AWS_CLOUDWATCH_CATEGORY"]; });
@@ -36528,10 +35723,6 @@ __webpack_require__.r(__webpack_exports__);
36528
35723
 
36529
35724
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["RETRY_ERROR_CODES"]; });
36530
35725
 
36531
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_NAME", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["API_LOGGING_PROVIDER_NAME"]; });
36532
-
36533
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_CATEGORY", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["API_LOGGING_PROVIDER_CATEGORY"]; });
36534
-
36535
35726
  /*
36536
35727
  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
36537
35728
  *
@@ -36578,24 +35769,6 @@ var Constants = {
36578
35769
 
36579
35770
  /***/ }),
36580
35771
 
36581
- /***/ "./lib-esm/types/types.js":
36582
- /*!********************************!*\
36583
- !*** ./lib-esm/types/types.js ***!
36584
- \********************************/
36585
- /*! exports provided: isLoggerEvent */
36586
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
36587
-
36588
- "use strict";
36589
- __webpack_require__.r(__webpack_exports__);
36590
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLoggerEvent", function() { return isLoggerEvent; });
36591
- function isLoggerEvent(inputLogEvent) {
36592
- return inputLogEvent && !!Object.keys(inputLogEvent).find(function (k) {
36593
- return k === 'loggerInfo';
36594
- });
36595
- }
36596
-
36597
- /***/ }),
36598
-
36599
35772
  /***/ "./node_modules/@aws-crypto/sha256-js/build/RawSha256.js":
36600
35773
  /*!***************************************************************!*\
36601
35774
  !*** ./node_modules/@aws-crypto/sha256-js/build/RawSha256.js ***!