@aws-amplify/datastore 3.7.9-api-logging.5 → 3.7.9-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.
@@ -69939,12 +69939,11 @@ function () {
69939
69939
  /*!***********************************************!*\
69940
69940
  !*** ../core/lib-esm/Logger/ConsoleLogger.js ***!
69941
69941
  \***********************************************/
69942
- /*! exports provided: LOG_LEVELS, LOG_TYPE, ConsoleLogger */
69942
+ /*! exports provided: LOG_TYPE, ConsoleLogger */
69943
69943
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
69944
69944
 
69945
69945
  "use strict";
69946
69946
  __webpack_require__.r(__webpack_exports__);
69947
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOG_LEVELS", function() { return LOG_LEVELS; });
69948
69947
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOG_TYPE", function() { return LOG_TYPE; });
69949
69948
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConsoleLogger", function() { return ConsoleLogger; });
69950
69949
  /* harmony import */ var _Util_Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Util/Constants */ "../core/lib-esm/Util/Constants.js");
@@ -70052,10 +70051,6 @@ function () {
70052
70051
  this._pluggables = [];
70053
70052
  }
70054
70053
 
70055
- ConsoleLogger.addPluggable = function (pluggable) {
70056
- ConsoleLogger.pluggables.push(pluggable);
70057
- };
70058
-
70059
70054
  ConsoleLogger.prototype._padding = function (n) {
70060
70055
  return n < 10 ? '0' + n : '' + n;
70061
70056
  };
@@ -70070,75 +70065,6 @@ function () {
70070
70065
  this._config = config;
70071
70066
  return this._config;
70072
70067
  };
70073
-
70074
- ConsoleLogger.prototype._logGlobal = function (type) {
70075
- var e_1, _a;
70076
-
70077
- var msg = [];
70078
-
70079
- for (var _i = 1; _i < arguments.length; _i++) {
70080
- msg[_i - 1] = arguments[_i];
70081
- }
70082
-
70083
- try {
70084
- for (var _b = __values(ConsoleLogger.pluggables), _c = _b.next(); !_c.done; _c = _b.next()) {
70085
- var pluggable = _c.value;
70086
- pluggable.pushLogs([this._generateLoggerEvent(type, msg)]);
70087
- }
70088
- } catch (e_1_1) {
70089
- e_1 = {
70090
- error: e_1_1
70091
- };
70092
- } finally {
70093
- try {
70094
- if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
70095
- } finally {
70096
- if (e_1) throw e_1.error;
70097
- }
70098
- }
70099
- };
70100
-
70101
- ConsoleLogger.prototype._generateLoggerEvent = function (type, msg) {
70102
- var strMessage = '';
70103
- var data;
70104
- var error;
70105
-
70106
- if (msg.length === 1 && typeof msg[0] === 'string') {
70107
- strMessage = msg[0];
70108
- } else if (msg.length === 1) {
70109
- data = msg[0];
70110
- } else if (typeof msg[0] === 'string') {
70111
- var obj = msg.slice(1);
70112
-
70113
- if (obj.length === 1) {
70114
- obj = obj[0];
70115
- }
70116
-
70117
- strMessage = msg[0];
70118
-
70119
- if (obj instanceof Error) {
70120
- error = {
70121
- message: obj.message,
70122
- name: obj.name
70123
- };
70124
- }
70125
-
70126
- data = obj;
70127
- } else {
70128
- data = msg;
70129
- }
70130
-
70131
- return {
70132
- message: strMessage,
70133
- timestamp: Date.now(),
70134
- loggerInfo: {
70135
- level: type.toLowerCase(),
70136
- name: this.name,
70137
- data: data,
70138
- error: error
70139
- }
70140
- };
70141
- };
70142
70068
  /**
70143
70069
  * Write log
70144
70070
  * @method
@@ -70149,7 +70075,7 @@ function () {
70149
70075
 
70150
70076
 
70151
70077
  ConsoleLogger.prototype._log = function (type) {
70152
- var e_2, _a;
70078
+ var e_1, _a;
70153
70079
 
70154
70080
  var msg = [];
70155
70081
 
@@ -70157,8 +70083,6 @@ function () {
70157
70083
  msg[_i - 1] = arguments[_i];
70158
70084
  }
70159
70085
 
70160
- this._logGlobal.apply(this, __spread([type], msg));
70161
-
70162
70086
  var logger_level_name = this.level;
70163
70087
 
70164
70088
  if (ConsoleLogger.LOG_LEVEL) {
@@ -70219,15 +70143,15 @@ function () {
70219
70143
  };
70220
70144
  plugin.pushLogs([logEvent]);
70221
70145
  }
70222
- } catch (e_2_1) {
70223
- e_2 = {
70224
- error: e_2_1
70146
+ } catch (e_1_1) {
70147
+ e_1 = {
70148
+ error: e_1_1
70225
70149
  };
70226
70150
  } finally {
70227
70151
  try {
70228
70152
  if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
70229
70153
  } finally {
70230
- if (e_2) throw e_2.error;
70154
+ if (e_1) throw e_1.error;
70231
70155
  }
70232
70156
  }
70233
70157
  };
@@ -70346,7 +70270,6 @@ function () {
70346
70270
  return this._pluggables;
70347
70271
  };
70348
70272
 
70349
- ConsoleLogger.pluggables = [];
70350
70273
  ConsoleLogger.LOG_LEVEL = null;
70351
70274
  return ConsoleLogger;
70352
70275
  }();
@@ -70359,14 +70282,12 @@ function () {
70359
70282
  /*!***************************************!*\
70360
70283
  !*** ../core/lib-esm/Logger/index.js ***!
70361
70284
  \***************************************/
70362
- /*! exports provided: LOG_LEVELS, LOG_TYPE, ConsoleLogger */
70285
+ /*! exports provided: LOG_TYPE, ConsoleLogger */
70363
70286
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
70364
70287
 
70365
70288
  "use strict";
70366
70289
  __webpack_require__.r(__webpack_exports__);
70367
70290
  /* harmony import */ var _ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ConsoleLogger */ "../core/lib-esm/Logger/ConsoleLogger.js");
70368
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LOG_LEVELS", function() { return _ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["LOG_LEVELS"]; });
70369
-
70370
70291
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LOG_TYPE", function() { return _ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["LOG_TYPE"]; });
70371
70292
 
70372
70293
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConsoleLogger", function() { return _ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]; });
@@ -70959,857 +70880,47 @@ function () {
70959
70880
  /***/ "../core/lib-esm/OAuthHelper/index.js":
70960
70881
  /*!********************************************!*\
70961
70882
  !*** ../core/lib-esm/OAuthHelper/index.js ***!
70962
- \********************************************/
70963
- /*! exports provided: GoogleOAuth, FacebookOAuth */
70964
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
70965
-
70966
- "use strict";
70967
- __webpack_require__.r(__webpack_exports__);
70968
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GoogleOAuth", function() { return GoogleOAuth; });
70969
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FacebookOAuth", function() { return FacebookOAuth; });
70970
- /* harmony import */ var _GoogleOAuth__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GoogleOAuth */ "../core/lib-esm/OAuthHelper/GoogleOAuth.js");
70971
- /* harmony import */ var _FacebookOAuth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FacebookOAuth */ "../core/lib-esm/OAuthHelper/FacebookOAuth.js");
70972
- /*
70973
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
70974
- *
70975
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
70976
- * the License. A copy of the License is located at
70977
- *
70978
- * http://aws.amazon.com/apache2.0/
70979
- *
70980
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
70981
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
70982
- * and limitations under the License.
70983
- */
70984
-
70985
-
70986
- var GoogleOAuth = new _GoogleOAuth__WEBPACK_IMPORTED_MODULE_0__["GoogleOAuth"]();
70987
- var FacebookOAuth = new _FacebookOAuth__WEBPACK_IMPORTED_MODULE_1__["FacebookOAuth"]();
70988
-
70989
- /***/ }),
70990
-
70991
- /***/ "../core/lib-esm/Parser.js":
70992
- /*!*********************************!*\
70993
- !*** ../core/lib-esm/Parser.js ***!
70994
- \*********************************/
70995
- /*! exports provided: parseMobileHubConfig, Parser, default */
70996
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
70997
-
70998
- "use strict";
70999
- __webpack_require__.r(__webpack_exports__);
71000
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseMobileHubConfig", function() { return parseMobileHubConfig; });
71001
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; });
71002
- /* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Logger */ "../core/lib-esm/Logger/index.js");
71003
- var __assign = undefined && undefined.__assign || function () {
71004
- __assign = Object.assign || function (t) {
71005
- for (var s, i = 1, n = arguments.length; i < n; i++) {
71006
- s = arguments[i];
71007
-
71008
- for (var p in s) {
71009
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
71010
- }
71011
- }
71012
-
71013
- return t;
71014
- };
71015
-
71016
- return __assign.apply(this, arguments);
71017
- };
71018
-
71019
-
71020
- var logger = new _Logger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Parser');
71021
- var parseMobileHubConfig = function parseMobileHubConfig(config) {
71022
- var amplifyConfig = {}; // Analytics
71023
-
71024
- if (config['aws_mobile_analytics_app_id']) {
71025
- var Analytics = {
71026
- AWSPinpoint: {
71027
- appId: config['aws_mobile_analytics_app_id'],
71028
- region: config['aws_mobile_analytics_app_region']
71029
- }
71030
- };
71031
- amplifyConfig.Analytics = Analytics;
71032
- } // Auth
71033
-
71034
-
71035
- if (config['aws_cognito_identity_pool_id'] || config['aws_user_pools_id']) {
71036
- amplifyConfig.Auth = {
71037
- userPoolId: config['aws_user_pools_id'],
71038
- userPoolWebClientId: config['aws_user_pools_web_client_id'],
71039
- region: config['aws_cognito_region'],
71040
- identityPoolId: config['aws_cognito_identity_pool_id'],
71041
- identityPoolRegion: config['aws_cognito_region'],
71042
- mandatorySignIn: config['aws_mandatory_sign_in'] === 'enable'
71043
- };
71044
- } // Storage
71045
-
71046
-
71047
- var storageConfig;
71048
-
71049
- if (config['aws_user_files_s3_bucket']) {
71050
- storageConfig = {
71051
- AWSS3: {
71052
- bucket: config['aws_user_files_s3_bucket'],
71053
- region: config['aws_user_files_s3_bucket_region'],
71054
- dangerouslyConnectToHttpEndpointForTesting: config['aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing']
71055
- }
71056
- };
71057
- } else {
71058
- storageConfig = config ? config.Storage || config : {};
71059
- } // Logging
71060
-
71061
-
71062
- if (config['Logging']) {
71063
- amplifyConfig.Logging = __assign(__assign({}, config['Logging']), {
71064
- region: config['aws_project_region']
71065
- });
71066
- } // Geo
71067
-
71068
-
71069
- if (config['geo']) {
71070
- amplifyConfig.Geo = Object.assign({}, config.geo);
71071
-
71072
- if (config.geo['amazon_location_service']) {
71073
- amplifyConfig.Geo = {
71074
- AmazonLocationService: config.geo['amazon_location_service']
71075
- };
71076
- }
71077
- }
71078
-
71079
- amplifyConfig.Analytics = Object.assign({}, amplifyConfig.Analytics, config.Analytics);
71080
- amplifyConfig.Auth = Object.assign({}, amplifyConfig.Auth, config.Auth);
71081
- amplifyConfig.Storage = Object.assign({}, storageConfig);
71082
- amplifyConfig.Logging = Object.assign({}, amplifyConfig.Logging, config.Logging);
71083
- logger.debug('parse config', config, 'to amplifyconfig', amplifyConfig);
71084
- return amplifyConfig;
71085
- };
71086
- /**
71087
- * @deprecated use per-function export
71088
- */
71089
-
71090
- var Parser =
71091
- /** @class */
71092
- function () {
71093
- function Parser() {}
71094
-
71095
- Parser.parseMobilehubConfig = parseMobileHubConfig;
71096
- return Parser;
71097
- }();
71098
-
71099
-
71100
- /**
71101
- * @deprecated use per-function export
71102
- */
71103
-
71104
- /* harmony default export */ __webpack_exports__["default"] = (Parser);
71105
-
71106
- /***/ }),
71107
-
71108
- /***/ "../core/lib-esm/Platform/index.js":
71109
- /*!*****************************************!*\
71110
- !*** ../core/lib-esm/Platform/index.js ***!
71111
- \*****************************************/
71112
- /*! exports provided: Platform, getAmplifyUserAgent, default */
71113
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
71114
-
71115
- "use strict";
71116
- __webpack_require__.r(__webpack_exports__);
71117
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Platform", function() { return Platform; });
71118
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAmplifyUserAgent", function() { return getAmplifyUserAgent; });
71119
- /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version */ "../core/lib-esm/Platform/version.js");
71120
- /*
71121
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
71122
- *
71123
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
71124
- * the License. A copy of the License is located at
71125
- *
71126
- * http://aws.amazon.com/apache2.0/
71127
- *
71128
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
71129
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
71130
- * and limitations under the License.
71131
- */
71132
-
71133
- var BASE_USER_AGENT = "aws-amplify/" + _version__WEBPACK_IMPORTED_MODULE_0__["version"];
71134
- var Platform = {
71135
- userAgent: BASE_USER_AGENT + " js",
71136
- product: '',
71137
- navigator: null,
71138
- isReactNative: false
71139
- };
71140
-
71141
- if (typeof navigator !== 'undefined' && navigator.product) {
71142
- Platform.product = navigator.product || '';
71143
- Platform.navigator = navigator || null;
71144
-
71145
- switch (navigator.product) {
71146
- case 'ReactNative':
71147
- Platform.userAgent = BASE_USER_AGENT + " react-native";
71148
- Platform.isReactNative = true;
71149
- break;
71150
-
71151
- default:
71152
- Platform.userAgent = BASE_USER_AGENT + " js";
71153
- Platform.isReactNative = false;
71154
- break;
71155
- }
71156
- }
71157
-
71158
- var getAmplifyUserAgent = function getAmplifyUserAgent() {
71159
- return Platform.userAgent;
71160
- };
71161
- /**
71162
- * @deprecated use named import
71163
- */
71164
-
71165
- /* harmony default export */ __webpack_exports__["default"] = (Platform);
71166
-
71167
- /***/ }),
71168
-
71169
- /***/ "../core/lib-esm/Platform/version.js":
71170
- /*!*******************************************!*\
71171
- !*** ../core/lib-esm/Platform/version.js ***!
71172
- \*******************************************/
71173
- /*! exports provided: version */
71174
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
71175
-
71176
- "use strict";
71177
- __webpack_require__.r(__webpack_exports__);
71178
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
71179
- // generated by genversion
71180
- var version = '4.4.1';
71181
-
71182
- /***/ }),
71183
-
71184
- /***/ "../core/lib-esm/Providers/APIProvider/APILoggingProvider.js":
71185
- /*!*******************************************************************!*\
71186
- !*** ../core/lib-esm/Providers/APIProvider/APILoggingProvider.js ***!
71187
- \*******************************************************************/
71188
- /*! exports provided: APILoggingProvider */
71189
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
71190
-
71191
- "use strict";
71192
- __webpack_require__.r(__webpack_exports__);
71193
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APILoggingProvider", function() { return APILoggingProvider; });
71194
- /* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Logger */ "../core/lib-esm/Logger/index.js");
71195
- /* harmony import */ var _loggerConnectivity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loggerConnectivity */ "../core/lib-esm/Providers/APIProvider/loggerConnectivity.js");
71196
- /* harmony import */ var _types_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../types/types */ "../core/lib-esm/types/types.js");
71197
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../ */ "../core/lib-esm/index.js");
71198
- /* harmony import */ var _Fetch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Fetch */ "../core/lib-esm/Providers/APIProvider/Fetch.js");
71199
- /* harmony import */ var _Util_Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Util/Constants */ "../core/lib-esm/Util/Constants.js");
71200
- /* harmony import */ var _Util_StringUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Util/StringUtils */ "../core/lib-esm/Util/StringUtils.js");
71201
- function _typeof(obj) {
71202
- "@babel/helpers - typeof";
71203
-
71204
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
71205
- return typeof obj;
71206
- } : function (obj) {
71207
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
71208
- }, _typeof(obj);
71209
- }
71210
-
71211
- var __assign = undefined && undefined.__assign || function () {
71212
- __assign = Object.assign || function (t) {
71213
- for (var s, i = 1, n = arguments.length; i < n; i++) {
71214
- s = arguments[i];
71215
-
71216
- for (var p in s) {
71217
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
71218
- }
71219
- }
71220
-
71221
- return t;
71222
- };
71223
-
71224
- return __assign.apply(this, arguments);
71225
- };
71226
-
71227
- var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
71228
- function adopt(value) {
71229
- return value instanceof P ? value : new P(function (resolve) {
71230
- resolve(value);
71231
- });
71232
- }
71233
-
71234
- return new (P || (P = Promise))(function (resolve, reject) {
71235
- function fulfilled(value) {
71236
- try {
71237
- step(generator.next(value));
71238
- } catch (e) {
71239
- reject(e);
71240
- }
71241
- }
71242
-
71243
- function rejected(value) {
71244
- try {
71245
- step(generator["throw"](value));
71246
- } catch (e) {
71247
- reject(e);
71248
- }
71249
- }
71250
-
71251
- function step(result) {
71252
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
71253
- }
71254
-
71255
- step((generator = generator.apply(thisArg, _arguments || [])).next());
71256
- });
71257
- };
71258
-
71259
- var __generator = undefined && undefined.__generator || function (thisArg, body) {
71260
- var _ = {
71261
- label: 0,
71262
- sent: function sent() {
71263
- if (t[0] & 1) throw t[1];
71264
- return t[1];
71265
- },
71266
- trys: [],
71267
- ops: []
71268
- },
71269
- f,
71270
- y,
71271
- t,
71272
- g;
71273
- return g = {
71274
- next: verb(0),
71275
- "throw": verb(1),
71276
- "return": verb(2)
71277
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
71278
- return this;
71279
- }), g;
71280
-
71281
- function verb(n) {
71282
- return function (v) {
71283
- return step([n, v]);
71284
- };
71285
- }
71286
-
71287
- function step(op) {
71288
- if (f) throw new TypeError("Generator is already executing.");
71289
-
71290
- while (_) {
71291
- try {
71292
- 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;
71293
- if (y = 0, t) op = [op[0] & 2, t.value];
71294
-
71295
- switch (op[0]) {
71296
- case 0:
71297
- case 1:
71298
- t = op;
71299
- break;
71300
-
71301
- case 4:
71302
- _.label++;
71303
- return {
71304
- value: op[1],
71305
- done: false
71306
- };
71307
-
71308
- case 5:
71309
- _.label++;
71310
- y = op[1];
71311
- op = [0];
71312
- continue;
71313
-
71314
- case 7:
71315
- op = _.ops.pop();
71316
-
71317
- _.trys.pop();
71318
-
71319
- continue;
71320
-
71321
- default:
71322
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
71323
- _ = 0;
71324
- continue;
71325
- }
71326
-
71327
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
71328
- _.label = op[1];
71329
- break;
71330
- }
71331
-
71332
- if (op[0] === 6 && _.label < t[1]) {
71333
- _.label = t[1];
71334
- t = op;
71335
- break;
71336
- }
71337
-
71338
- if (t && _.label < t[2]) {
71339
- _.label = t[2];
71340
-
71341
- _.ops.push(op);
71342
-
71343
- break;
71344
- }
71345
-
71346
- if (t[2]) _.ops.pop();
71347
-
71348
- _.trys.pop();
71349
-
71350
- continue;
71351
- }
71352
-
71353
- op = body.call(thisArg, _);
71354
- } catch (e) {
71355
- op = [6, e];
71356
- y = 0;
71357
- } finally {
71358
- f = t = 0;
71359
- }
71360
- }
71361
-
71362
- if (op[0] & 5) throw op[1];
71363
- return {
71364
- value: op[0] ? op[1] : void 0,
71365
- done: true
71366
- };
71367
- }
71368
- };
71369
-
71370
- var __read = undefined && undefined.__read || function (o, n) {
71371
- var m = typeof Symbol === "function" && o[Symbol.iterator];
71372
- if (!m) return o;
71373
- var i = m.call(o),
71374
- r,
71375
- ar = [],
71376
- e;
71377
-
71378
- try {
71379
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
71380
- ar.push(r.value);
71381
- }
71382
- } catch (error) {
71383
- e = {
71384
- error: error
71385
- };
71386
- } finally {
71387
- try {
71388
- if (r && !r.done && (m = i["return"])) m.call(i);
71389
- } finally {
71390
- if (e) throw e.error;
71391
- }
71392
- }
71393
-
71394
- return ar;
71395
- };
71396
-
71397
- var __spread = undefined && undefined.__spread || function () {
71398
- for (var ar = [], i = 0; i < arguments.length; i++) {
71399
- ar = ar.concat(__read(arguments[i]));
71400
- }
71401
-
71402
- return ar;
71403
- };
71404
-
71405
-
71406
-
71407
-
71408
-
71409
-
71410
-
71411
-
71412
- var logger = new _Logger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('APILoggingProvider');
71413
- var HTTPS = 'https';
71414
- var LOCALHOST = 'http://localhost';
71415
- var DEFAULT_INTERVAL = 3000; // Exclude these to avoid infinite loop
71416
-
71417
- var DEFAULT_CLASS_EXCLUDE_LIST = ['APILoggingProvider', 'AWSCloudWatch', 'Retry'];
71418
- var LAMBDA_PAYLOAD_LIMIT = 6 * 1024 * 1024; // 6MB
71419
-
71420
- /*
71421
- Todo:
71422
- * Refactor this into a FSM - managing state will become complex when remote config functionality gets added in P1
71423
- */
71424
-
71425
- var APILoggingProvider =
71426
- /** @class */
71427
- function () {
71428
- function APILoggingProvider(config) {
71429
- this.online = false;
71430
- this.eventBuffer = [];
71431
- this.configure(config);
71432
- }
71433
-
71434
- APILoggingProvider.prototype.getProviderName = function () {
71435
- return APILoggingProvider.PROVIDER_NAME;
71436
- };
71437
-
71438
- APILoggingProvider.prototype.getCategoryName = function () {
71439
- return APILoggingProvider.CATEGORY;
71440
- };
71441
-
71442
- APILoggingProvider.prototype.configure = function (config) {
71443
- try {
71444
- this.validateConfig(config);
71445
- this.config = this.normalizeConfig(config);
71446
-
71447
- if (this.config.enabled === true) {
71448
- this.initialize();
71449
- } else {
71450
- this.disable();
71451
- }
71452
-
71453
- return this.config;
71454
- } catch (error) {
71455
- logger.error('Unable to start: ', error);
71456
- }
71457
- };
71458
-
71459
- APILoggingProvider.prototype.pushLogs = function (events) {
71460
- var _this = this;
71461
-
71462
- var _a;
71463
-
71464
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enabled) === false) {
71465
- return;
71466
- }
71467
-
71468
- events.forEach(function (event) {
71469
- if (!Object(_types_types__WEBPACK_IMPORTED_MODULE_2__["isLoggerEvent"])(event)) {
71470
- return;
71471
- }
71472
-
71473
- var message = event.message,
71474
- timestamp = event.timestamp,
71475
- _a = event.loggerInfo,
71476
- level = _a.level,
71477
- data = _a.data,
71478
- name = _a.name,
71479
- _b = _a.error,
71480
- _c = _b === void 0 ? {} : _b,
71481
- errorMessage = _c.message,
71482
- errorName = _c.name;
71483
-
71484
- var error = errorName && errorMessage && {
71485
- errorMessage: errorMessage,
71486
- errorName: errorName
71487
- };
71488
- var combinedEvent = {
71489
- level: level,
71490
- error: error,
71491
- message: message,
71492
- context: {
71493
- category: name,
71494
- data: __assign(__assign({}, data), _this.config.metadata),
71495
- logTime: timestamp
71496
- }
71497
- };
71498
-
71499
- if (_this.verifyEvent(combinedEvent)) {
71500
- _this.eventBuffer.push(combinedEvent);
71501
- }
71502
- });
71503
- };
71504
-
71505
- APILoggingProvider.prototype.validateConfig = function (config) {
71506
- if (typeof (config === null || config === void 0 ? void 0 : config.endpoint) !== 'string') {
71507
- throw new Error("Invalid configuration. `config.endpoint` must be a string. Received: " + _typeof(config === null || config === void 0 ? void 0 : config.endpoint));
71508
- }
71509
-
71510
- var protocolStr = config.endpoint.substring(0, 5).toLowerCase();
71511
- var isUsingLocalhost = config.endpoint.substring(0, LOCALHOST.length).toLowerCase() === LOCALHOST;
71512
-
71513
- if (protocolStr !== HTTPS && !isUsingLocalhost) {
71514
- throw new Error("Invalid configuration. Only HTTPS endpoints are supported. Received: " + protocolStr);
71515
- }
71516
- };
71517
-
71518
- APILoggingProvider.prototype.normalizeConfig = function (config) {
71519
- var _a, _b, _c;
71520
-
71521
- var normalizedConfig = {
71522
- endpoint: config.endpoint,
71523
- apiKey: config.apiKey,
71524
- metadata: config.metadata,
71525
- enabled: (_a = config.enabled) !== null && _a !== void 0 ? _a : true,
71526
- level: (_b = config.level) !== null && _b !== void 0 ? _b : _Logger__WEBPACK_IMPORTED_MODULE_0__["LOG_TYPE"].WARN,
71527
- bufferInterval: (_c = config.bufferInterval) !== null && _c !== void 0 ? _c : DEFAULT_INTERVAL,
71528
- excludeClassList: config.excludeClassList instanceof Array ? __spread(DEFAULT_CLASS_EXCLUDE_LIST, config.excludeClassList) : DEFAULT_CLASS_EXCLUDE_LIST
71529
- };
71530
- return normalizedConfig;
71531
- };
71532
-
71533
- APILoggingProvider.prototype.initialize = function () {
71534
- this.subscribeConnectivity();
71535
- };
71536
-
71537
- APILoggingProvider.prototype.disable = function () {
71538
- this.clearInterval();
71539
- this.unsubscribeConnectivity();
71540
- this.eventBuffer = [];
71541
- };
71542
-
71543
- APILoggingProvider.prototype.subscribeConnectivity = function () {
71544
- var _this = this;
71545
-
71546
- if (this.connectivity) {
71547
- return;
71548
- }
71549
-
71550
- this.connectivity = new _loggerConnectivity__WEBPACK_IMPORTED_MODULE_1__["default"]();
71551
- this.connectivity.status().subscribe(function (_a) {
71552
- var online = _a.online;
71553
-
71554
- if (online && !_this.online) {
71555
- _this.startInterval();
71556
- } else {
71557
- _this.clearInterval();
71558
- }
71559
-
71560
- _this.online = online;
71561
- logger.debug('Connectivity status: ', online);
71562
- });
71563
- };
71564
-
71565
- APILoggingProvider.prototype.unsubscribeConnectivity = function () {
71566
- if (this.connectivity) {
71567
- this.connectivity.unsubscribe();
71568
- this.connectivity = undefined;
71569
- }
71570
- };
71571
-
71572
- APILoggingProvider.prototype.startInterval = function () {
71573
- var _this = this;
71574
-
71575
- if (this.bufferInterval) {
71576
- this.clearInterval();
71577
- }
71578
-
71579
- this.bufferInterval = setInterval(function () {
71580
- return __awaiter(_this, void 0, void 0, function () {
71581
- var error_1;
71582
- return __generator(this, function (_a) {
71583
- switch (_a.label) {
71584
- case 0:
71585
- _a.trys.push([0, 2,, 3]);
71586
-
71587
- return [4
71588
- /*yield*/
71589
- , this.uploadEvents()];
71590
-
71591
- case 1:
71592
- _a.sent();
71593
-
71594
- return [3
71595
- /*break*/
71596
- , 3];
71597
-
71598
- case 2:
71599
- error_1 = _a.sent();
71600
- logger.error("Could not upload log events", error_1);
71601
- return [3
71602
- /*break*/
71603
- , 3];
71604
-
71605
- case 3:
71606
- return [2
71607
- /*return*/
71608
- ];
71609
- }
71610
- });
71611
- });
71612
- }, this.config.bufferInterval);
71613
- };
71614
-
71615
- APILoggingProvider.prototype.clearInterval = function () {
71616
- clearInterval(this.bufferInterval);
71617
- this.bufferInterval = undefined;
71618
- };
71619
- /*
71620
- Filter out events that don't adhere to config settings
71621
- */
71622
-
71623
-
71624
- APILoggingProvider.prototype.verifyEvent = function (event) {
71625
- var level = event.level,
71626
- context = event.context;
71627
- var configLevelValue = _Logger__WEBPACK_IMPORTED_MODULE_0__["LOG_LEVELS"][this.config.level];
71628
- var eventLevelValue = _Logger__WEBPACK_IMPORTED_MODULE_0__["LOG_LEVELS"][level];
71629
-
71630
- if (eventLevelValue < configLevelValue) {
71631
- return false;
71632
- }
71633
-
71634
- if (this.config.excludeClassList.includes(context.category)) {
71635
- return false;
71636
- }
71637
-
71638
- return true;
71639
- };
71640
-
71641
- APILoggingProvider.prototype.uploadEvents = function () {
71642
- return __awaiter(this, void 0, void 0, function () {
71643
- var eventBatch, body, options;
71644
-
71645
- var _this = this;
71646
-
71647
- return __generator(this, function (_a) {
71648
- switch (_a.label) {
71649
- case 0:
71650
- eventBatch = this.genericLogEventBatch(this.eventBuffer);
71651
-
71652
- if (eventBatch.length < 1) {
71653
- return [2
71654
- /*return*/
71655
- ];
71656
- }
71657
-
71658
- body = {
71659
- logs: eventBatch
71660
- };
71661
- options = Object(_Fetch__WEBPACK_IMPORTED_MODULE_4__["postOptions"])(body);
71662
- return [4
71663
- /*yield*/
71664
- , Object(___WEBPACK_IMPORTED_MODULE_3__["jitteredExponentialRetry"])(function (endpoint, options) {
71665
- return __awaiter(_this, void 0, void 0, function () {
71666
- var error_2;
71667
- return __generator(this, function (_a) {
71668
- switch (_a.label) {
71669
- case 0:
71670
- _a.trys.push([0, 2,, 3]);
71671
-
71672
- return [4
71673
- /*yield*/
71674
- , fetch(endpoint, options)];
71675
-
71676
- case 1:
71677
- _a.sent(); // fetch doesnt return info for no-cors request
71678
-
71679
-
71680
- return [3
71681
- /*break*/
71682
- , 3];
71683
-
71684
- case 2:
71685
- error_2 = _a.sent(); // fetch will only fail in the event of a network error. Don't retry
71686
-
71687
- if (error_2.message === 'Failed to fetch') {
71688
- throw new ___WEBPACK_IMPORTED_MODULE_3__["NonRetryableError"](error_2.message);
71689
- } // all other errors are logged and retried
71690
-
71691
-
71692
- logger.warn(error_2);
71693
- throw error_2;
71694
-
71695
- case 3:
71696
- return [2
71697
- /*return*/
71698
- ];
71699
- }
71700
- });
71701
- });
71702
- }, [this.config.endpoint, options])];
71703
-
71704
- case 1:
71705
- _a.sent(); // remove events from buffer after the request succeeds
71706
-
71707
-
71708
- this.eventBuffer.splice(0, eventBatch.length);
71709
- return [2
71710
- /*return*/
71711
- ];
71712
- }
71713
- });
71714
- });
71715
- };
71716
-
71717
- APILoggingProvider.prototype.genericLogEventBatch = function (buffer) {
71718
- var totalByteSize = 0;
71719
- var currentEventIdx = 0;
71720
-
71721
- while (currentEventIdx < buffer.length) {
71722
- var currentEvent = buffer[currentEventIdx];
71723
- var eventSize = Object(_Util_StringUtils__WEBPACK_IMPORTED_MODULE_6__["getStringByteSize"])(JSON.stringify(currentEvent));
71724
-
71725
- if (totalByteSize + eventSize > LAMBDA_PAYLOAD_LIMIT) {
71726
- break;
71727
- }
71728
-
71729
- totalByteSize += eventSize;
71730
- currentEventIdx += 1;
71731
- }
71732
-
71733
- return buffer.slice(0, currentEventIdx);
71734
- };
71735
-
71736
- APILoggingProvider.PROVIDER_NAME = _Util_Constants__WEBPACK_IMPORTED_MODULE_5__["API_LOGGING_PROVIDER_NAME"];
71737
- APILoggingProvider.CATEGORY = _Util_Constants__WEBPACK_IMPORTED_MODULE_5__["API_LOGGING_PROVIDER_CATEGORY"];
71738
- return APILoggingProvider;
71739
- }();
71740
-
71741
-
71742
-
71743
- /***/ }),
71744
-
71745
- /***/ "../core/lib-esm/Providers/APIProvider/Fetch.js":
71746
- /*!******************************************************!*\
71747
- !*** ../core/lib-esm/Providers/APIProvider/Fetch.js ***!
71748
- \******************************************************/
71749
- /*! exports provided: postOptions */
71750
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
71751
-
71752
- "use strict";
71753
- __webpack_require__.r(__webpack_exports__);
71754
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "postOptions", function() { return postOptions; });
71755
- var postOptions = function postOptions(body) {
71756
- return {
71757
- method: 'POST',
71758
- mode: 'no-cors',
71759
- cache: 'no-cache',
71760
- credentials: 'same-origin',
71761
- headers: {
71762
- 'Content-Type': 'application/json'
71763
- },
71764
- body: JSON.stringify(body)
71765
- };
71766
- };
71767
-
71768
- /***/ }),
71769
-
71770
- /***/ "../core/lib-esm/Providers/APIProvider/LoggerReachability/index.js":
71771
- /*!*************************************************************************!*\
71772
- !*** ../core/lib-esm/Providers/APIProvider/LoggerReachability/index.js ***!
71773
- \*************************************************************************/
71774
- /*! exports provided: ReachabilityMonitor */
71775
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
71776
-
71777
- "use strict";
71778
- __webpack_require__.r(__webpack_exports__);
71779
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReachabilityMonitor", function() { return ReachabilityMonitor; });
71780
- /* harmony import */ var _Util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Util */ "../core/lib-esm/Util/index.js");
71781
-
71782
- var ReachabilityMonitor = new _Util__WEBPACK_IMPORTED_MODULE_0__["Reachability"]().networkMonitor();
71783
-
71784
- /***/ }),
71785
-
71786
- /***/ "../core/lib-esm/Providers/APIProvider/index.js":
71787
- /*!******************************************************!*\
71788
- !*** ../core/lib-esm/Providers/APIProvider/index.js ***!
71789
- \******************************************************/
71790
- /*! exports provided: APILoggingProvider */
70883
+ \********************************************/
70884
+ /*! exports provided: GoogleOAuth, FacebookOAuth */
71791
70885
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
71792
70886
 
71793
70887
  "use strict";
71794
70888
  __webpack_require__.r(__webpack_exports__);
71795
- /* harmony import */ var _APILoggingProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./APILoggingProvider */ "../core/lib-esm/Providers/APIProvider/APILoggingProvider.js");
71796
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "APILoggingProvider", function() { return _APILoggingProvider__WEBPACK_IMPORTED_MODULE_0__["APILoggingProvider"]; });
70889
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GoogleOAuth", function() { return GoogleOAuth; });
70890
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FacebookOAuth", function() { return FacebookOAuth; });
70891
+ /* harmony import */ var _GoogleOAuth__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GoogleOAuth */ "../core/lib-esm/OAuthHelper/GoogleOAuth.js");
70892
+ /* harmony import */ var _FacebookOAuth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FacebookOAuth */ "../core/lib-esm/OAuthHelper/FacebookOAuth.js");
70893
+ /*
70894
+ * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
70895
+ *
70896
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
70897
+ * the License. A copy of the License is located at
70898
+ *
70899
+ * http://aws.amazon.com/apache2.0/
70900
+ *
70901
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
70902
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
70903
+ * and limitations under the License.
70904
+ */
71797
70905
 
71798
70906
 
70907
+ var GoogleOAuth = new _GoogleOAuth__WEBPACK_IMPORTED_MODULE_0__["GoogleOAuth"]();
70908
+ var FacebookOAuth = new _FacebookOAuth__WEBPACK_IMPORTED_MODULE_1__["FacebookOAuth"]();
71799
70909
 
71800
70910
  /***/ }),
71801
70911
 
71802
- /***/ "../core/lib-esm/Providers/APIProvider/loggerConnectivity.js":
71803
- /*!*******************************************************************!*\
71804
- !*** ../core/lib-esm/Providers/APIProvider/loggerConnectivity.js ***!
71805
- \*******************************************************************/
71806
- /*! exports provided: default */
70912
+ /***/ "../core/lib-esm/Parser.js":
70913
+ /*!*********************************!*\
70914
+ !*** ../core/lib-esm/Parser.js ***!
70915
+ \*********************************/
70916
+ /*! exports provided: parseMobileHubConfig, Parser, default */
71807
70917
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
71808
70918
 
71809
70919
  "use strict";
71810
70920
  __webpack_require__.r(__webpack_exports__);
71811
- /* harmony import */ var zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zen-observable-ts */ "../../node_modules/zen-observable-ts/lib/bundle.esm.js");
71812
- /* harmony import */ var _LoggerReachability__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LoggerReachability */ "../core/lib-esm/Providers/APIProvider/LoggerReachability/index.js");
70921
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseMobileHubConfig", function() { return parseMobileHubConfig; });
70922
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; });
70923
+ /* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Logger */ "../core/lib-esm/Logger/index.js");
71813
70924
  var __assign = undefined && undefined.__assign || function () {
71814
70925
  __assign = Object.assign || function (t) {
71815
70926
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -71827,54 +70938,167 @@ var __assign = undefined && undefined.__assign || function () {
71827
70938
  };
71828
70939
 
71829
70940
 
71830
- // TODO: refactor this to a singleton that supports numerous observers
70941
+ var logger = new _Logger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Parser');
70942
+ var parseMobileHubConfig = function parseMobileHubConfig(config) {
70943
+ var amplifyConfig = {}; // Analytics
71831
70944
 
71832
- var LoggerConnectivity =
71833
- /** @class */
71834
- function () {
71835
- function LoggerConnectivity() {
71836
- this.connectionStatus = {
71837
- online: false
70945
+ if (config['aws_mobile_analytics_app_id']) {
70946
+ var Analytics = {
70947
+ AWSPinpoint: {
70948
+ appId: config['aws_mobile_analytics_app_id'],
70949
+ region: config['aws_mobile_analytics_app_region']
70950
+ }
71838
70951
  };
71839
- }
70952
+ amplifyConfig.Analytics = Analytics;
70953
+ } // Auth
71840
70954
 
71841
- LoggerConnectivity.prototype.status = function () {
71842
- var _this = this;
71843
70955
 
71844
- if (this.observer) {
71845
- throw new Error('Subscriber already exists');
71846
- }
70956
+ if (config['aws_cognito_identity_pool_id'] || config['aws_user_pools_id']) {
70957
+ amplifyConfig.Auth = {
70958
+ userPoolId: config['aws_user_pools_id'],
70959
+ userPoolWebClientId: config['aws_user_pools_web_client_id'],
70960
+ region: config['aws_cognito_region'],
70961
+ identityPoolId: config['aws_cognito_identity_pool_id'],
70962
+ identityPoolRegion: config['aws_cognito_region'],
70963
+ mandatorySignIn: config['aws_mandatory_sign_in'] === 'enable'
70964
+ };
70965
+ } // Storage
71847
70966
 
71848
- return new zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__["default"](function (observer) {
71849
- _this.observer = observer;
71850
- _this.subscription = _LoggerReachability__WEBPACK_IMPORTED_MODULE_1__["ReachabilityMonitor"].subscribe(function (_a) {
71851
- var online = _a.online;
71852
- _this.connectionStatus.online = online;
71853
70967
 
71854
- var observerResult = __assign({}, _this.connectionStatus);
70968
+ var storageConfig;
71855
70969
 
71856
- observer.next(observerResult);
71857
- });
71858
- return function () {
71859
- clearTimeout(_this.timeout);
70970
+ if (config['aws_user_files_s3_bucket']) {
70971
+ storageConfig = {
70972
+ AWSS3: {
70973
+ bucket: config['aws_user_files_s3_bucket'],
70974
+ region: config['aws_user_files_s3_bucket_region'],
70975
+ dangerouslyConnectToHttpEndpointForTesting: config['aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing']
70976
+ }
70977
+ };
70978
+ } else {
70979
+ storageConfig = config ? config.Storage || config : {};
70980
+ } // Logging
71860
70981
 
71861
- _this.unsubscribe();
71862
- };
70982
+
70983
+ if (config['Logging']) {
70984
+ amplifyConfig.Logging = __assign(__assign({}, config['Logging']), {
70985
+ region: config['aws_project_region']
71863
70986
  });
71864
- };
70987
+ } // Geo
71865
70988
 
71866
- LoggerConnectivity.prototype.unsubscribe = function () {
71867
- if (this.subscription) {
71868
- clearTimeout(this.timeout);
71869
- this.subscription.unsubscribe();
71870
- this.observer = undefined;
70989
+
70990
+ if (config['geo']) {
70991
+ amplifyConfig.Geo = Object.assign({}, config.geo);
70992
+
70993
+ if (config.geo['amazon_location_service']) {
70994
+ amplifyConfig.Geo = {
70995
+ AmazonLocationService: config.geo['amazon_location_service']
70996
+ };
71871
70997
  }
71872
- };
70998
+ }
70999
+
71000
+ amplifyConfig.Analytics = Object.assign({}, amplifyConfig.Analytics, config.Analytics);
71001
+ amplifyConfig.Auth = Object.assign({}, amplifyConfig.Auth, config.Auth);
71002
+ amplifyConfig.Storage = Object.assign({}, storageConfig);
71003
+ amplifyConfig.Logging = Object.assign({}, amplifyConfig.Logging, config.Logging);
71004
+ logger.debug('parse config', config, 'to amplifyconfig', amplifyConfig);
71005
+ return amplifyConfig;
71006
+ };
71007
+ /**
71008
+ * @deprecated use per-function export
71009
+ */
71010
+
71011
+ var Parser =
71012
+ /** @class */
71013
+ function () {
71014
+ function Parser() {}
71873
71015
 
71874
- return LoggerConnectivity;
71016
+ Parser.parseMobilehubConfig = parseMobileHubConfig;
71017
+ return Parser;
71875
71018
  }();
71876
71019
 
71877
- /* harmony default export */ __webpack_exports__["default"] = (LoggerConnectivity);
71020
+
71021
+ /**
71022
+ * @deprecated use per-function export
71023
+ */
71024
+
71025
+ /* harmony default export */ __webpack_exports__["default"] = (Parser);
71026
+
71027
+ /***/ }),
71028
+
71029
+ /***/ "../core/lib-esm/Platform/index.js":
71030
+ /*!*****************************************!*\
71031
+ !*** ../core/lib-esm/Platform/index.js ***!
71032
+ \*****************************************/
71033
+ /*! exports provided: Platform, getAmplifyUserAgent, default */
71034
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
71035
+
71036
+ "use strict";
71037
+ __webpack_require__.r(__webpack_exports__);
71038
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Platform", function() { return Platform; });
71039
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAmplifyUserAgent", function() { return getAmplifyUserAgent; });
71040
+ /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version */ "../core/lib-esm/Platform/version.js");
71041
+ /*
71042
+ * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
71043
+ *
71044
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
71045
+ * the License. A copy of the License is located at
71046
+ *
71047
+ * http://aws.amazon.com/apache2.0/
71048
+ *
71049
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
71050
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
71051
+ * and limitations under the License.
71052
+ */
71053
+
71054
+ var BASE_USER_AGENT = "aws-amplify/" + _version__WEBPACK_IMPORTED_MODULE_0__["version"];
71055
+ var Platform = {
71056
+ userAgent: BASE_USER_AGENT + " js",
71057
+ product: '',
71058
+ navigator: null,
71059
+ isReactNative: false
71060
+ };
71061
+
71062
+ if (typeof navigator !== 'undefined' && navigator.product) {
71063
+ Platform.product = navigator.product || '';
71064
+ Platform.navigator = navigator || null;
71065
+
71066
+ switch (navigator.product) {
71067
+ case 'ReactNative':
71068
+ Platform.userAgent = BASE_USER_AGENT + " react-native";
71069
+ Platform.isReactNative = true;
71070
+ break;
71071
+
71072
+ default:
71073
+ Platform.userAgent = BASE_USER_AGENT + " js";
71074
+ Platform.isReactNative = false;
71075
+ break;
71076
+ }
71077
+ }
71078
+
71079
+ var getAmplifyUserAgent = function getAmplifyUserAgent() {
71080
+ return Platform.userAgent;
71081
+ };
71082
+ /**
71083
+ * @deprecated use named import
71084
+ */
71085
+
71086
+ /* harmony default export */ __webpack_exports__["default"] = (Platform);
71087
+
71088
+ /***/ }),
71089
+
71090
+ /***/ "../core/lib-esm/Platform/version.js":
71091
+ /*!*******************************************!*\
71092
+ !*** ../core/lib-esm/Platform/version.js ***!
71093
+ \*******************************************/
71094
+ /*! exports provided: version */
71095
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
71096
+
71097
+ "use strict";
71098
+ __webpack_require__.r(__webpack_exports__);
71099
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
71100
+ // generated by genversion
71101
+ var version = '4.4.1';
71878
71102
 
71879
71103
  /***/ }),
71880
71104
 
@@ -72372,15 +71596,7 @@ function () {
72372
71596
 
72373
71597
  AWSCloudWatchProvider.prototype.pushLogs = function (logs) {
72374
71598
  logger.debug('pushing log events to Cloudwatch...');
72375
- var formattedLogs = logs.map(function (_a) {
72376
- var message = _a.message,
72377
- timestamp = _a.timestamp;
72378
- return {
72379
- message: message,
72380
- timestamp: timestamp
72381
- };
72382
- });
72383
- this._dataTracker.logEvents = __spread(this._dataTracker.logEvents, formattedLogs);
71599
+ this._dataTracker.logEvents = __spread(this._dataTracker.logEvents, logs);
72384
71600
  };
72385
71601
 
72386
71602
  AWSCloudWatchProvider.prototype._validateLogGroupExistsAndCreate = function (logGroupName) {
@@ -72895,7 +72111,7 @@ function () {
72895
72111
  /*!******************************************!*\
72896
72112
  !*** ../core/lib-esm/Providers/index.js ***!
72897
72113
  \******************************************/
72898
- /*! exports provided: AWSCloudWatchProvider, APILoggingProvider */
72114
+ /*! exports provided: AWSCloudWatchProvider */
72899
72115
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
72900
72116
 
72901
72117
  "use strict";
@@ -72903,10 +72119,6 @@ __webpack_require__.r(__webpack_exports__);
72903
72119
  /* harmony import */ var _AWSCloudWatchProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AWSCloudWatchProvider */ "../core/lib-esm/Providers/AWSCloudWatchProvider.js");
72904
72120
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWSCloudWatchProvider", function() { return _AWSCloudWatchProvider__WEBPACK_IMPORTED_MODULE_0__["AWSCloudWatchProvider"]; });
72905
72121
 
72906
- /* harmony import */ var _APIProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./APIProvider */ "../core/lib-esm/Providers/APIProvider/index.js");
72907
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "APILoggingProvider", function() { return _APIProvider__WEBPACK_IMPORTED_MODULE_1__["APILoggingProvider"]; });
72908
-
72909
-
72910
72122
 
72911
72123
 
72912
72124
  /***/ }),
@@ -73911,7 +73123,7 @@ function () {
73911
73123
  /*!*****************************************!*\
73912
73124
  !*** ../core/lib-esm/Util/Constants.js ***!
73913
73125
  \*****************************************/
73914
- /*! 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 */
73126
+ /*! 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 */
73915
73127
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
73916
73128
 
73917
73129
  "use strict";
@@ -73923,8 +73135,6 @@ __webpack_require__.r(__webpack_exports__);
73923
73135
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWS_CLOUDWATCH_PROVIDER_NAME", function() { return AWS_CLOUDWATCH_PROVIDER_NAME; });
73924
73136
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NO_CREDS_ERROR_STRING", function() { return NO_CREDS_ERROR_STRING; });
73925
73137
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return RETRY_ERROR_CODES; });
73926
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_NAME", function() { return API_LOGGING_PROVIDER_NAME; });
73927
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_CATEGORY", function() { return API_LOGGING_PROVIDER_CATEGORY; });
73928
73138
  /*
73929
73139
  * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
73930
73140
  *
@@ -73945,8 +73155,6 @@ var AWS_CLOUDWATCH_CATEGORY = 'Logging';
73945
73155
  var AWS_CLOUDWATCH_PROVIDER_NAME = 'AWSCloudWatch';
73946
73156
  var NO_CREDS_ERROR_STRING = 'No credentials';
73947
73157
  var RETRY_ERROR_CODES = ['ResourceNotFoundException', 'InvalidSequenceTokenException'];
73948
- var API_LOGGING_PROVIDER_NAME = 'API';
73949
- var API_LOGGING_PROVIDER_CATEGORY = 'Logging';
73950
73158
 
73951
73159
 
73952
73160
  /***/ }),
@@ -74160,7 +73368,7 @@ function () {
74160
73368
 
74161
73369
  "use strict";
74162
73370
  __webpack_require__.r(__webpack_exports__);
74163
- /* harmony import */ var _JS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../JS */ "../core/lib-esm/JS.js");
73371
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core */ "../core/lib-esm/index.js");
74164
73372
  /* harmony import */ var zen_observable_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! zen-observable-ts */ "../../node_modules/zen-observable-ts/lib/bundle.esm.js");
74165
73373
  var __values = undefined && undefined.__values || function (o) {
74166
73374
  var s = typeof Symbol === "function" && Symbol.iterator,
@@ -74188,13 +73396,13 @@ function () {
74188
73396
  function ReachabilityNavigator() {}
74189
73397
 
74190
73398
  ReachabilityNavigator.prototype.networkMonitor = function (netInfo) {
74191
- if (Object(_JS__WEBPACK_IMPORTED_MODULE_0__["browserOrNode"])().isNode) {
73399
+ if (Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["browserOrNode"])().isNode) {
74192
73400
  return zen_observable_ts__WEBPACK_IMPORTED_MODULE_1__["default"].from([{
74193
73401
  online: true
74194
73402
  }]);
74195
73403
  }
74196
73404
 
74197
- var globalObj = Object(_JS__WEBPACK_IMPORTED_MODULE_0__["isWebWorker"])() ? self : window;
73405
+ var globalObj = Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["isWebWorker"])() ? self : window;
74198
73406
  return new zen_observable_ts__WEBPACK_IMPORTED_MODULE_1__["default"](function (observer) {
74199
73407
  observer.next({
74200
73408
  online: globalObj.navigator.onLine
@@ -74273,13 +73481,14 @@ function () {
74273
73481
  /*!*************************************!*\
74274
73482
  !*** ../core/lib-esm/Util/Retry.js ***!
74275
73483
  \*************************************/
74276
- /*! exports provided: NonRetryableError, retry, jitteredExponentialRetry */
73484
+ /*! exports provided: NonRetryableError, retry, jitteredBackoff, jitteredExponentialRetry */
74277
73485
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
74278
73486
 
74279
73487
  "use strict";
74280
73488
  __webpack_require__.r(__webpack_exports__);
74281
73489
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NonRetryableError", function() { return NonRetryableError; });
74282
73490
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return retry; });
73491
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jitteredBackoff", function() { return jitteredBackoff; });
74283
73492
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jitteredExponentialRetry", function() { return jitteredExponentialRetry; });
74284
73493
  /* harmony import */ var _Logger_ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Logger/ConsoleLogger */ "../core/lib-esm/Logger/ConsoleLogger.js");
74285
73494
  var __extends = undefined && undefined.__extends || function () {
@@ -74487,7 +73696,7 @@ var __spread = undefined && undefined.__spread || function () {
74487
73696
  };
74488
73697
 
74489
73698
 
74490
- var logger = new _Logger_ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Retry');
73699
+ var logger = new _Logger_ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Util');
74491
73700
 
74492
73701
  var NonRetryableError =
74493
73702
  /** @class */
@@ -74530,7 +73739,7 @@ function retry(functionToRetry, args, delayFn, attempt) {
74530
73739
  throw Error('functionToRetry must be a function');
74531
73740
  }
74532
73741
 
74533
- logger.debug(functionToRetry.name + " attempt #" + attempt + " with these vars: " + JSON.stringify(args));
73742
+ logger.debug(functionToRetry.name + " attempt #" + attempt + " with this vars: " + JSON.stringify(args));
74534
73743
  _a.label = 1;
74535
73744
 
74536
73745
  case 1:
@@ -74594,8 +73803,16 @@ function retry(functionToRetry, args, delayFn, attempt) {
74594
73803
  });
74595
73804
  }
74596
73805
  var MAX_DELAY_MS = 5 * 60 * 1000;
73806
+ /**
73807
+ * @private
73808
+ * Internal use of Amplify only
73809
+ */
74597
73810
 
74598
73811
  function jitteredBackoff(maxDelayMs) {
73812
+ if (maxDelayMs === void 0) {
73813
+ maxDelayMs = MAX_DELAY_MS;
73814
+ }
73815
+
74599
73816
  var BASE_TIME_MS = 100;
74600
73817
  var JITTER_FACTOR = 100;
74601
73818
  return function (attempt) {
@@ -74608,7 +73825,6 @@ function jitteredBackoff(maxDelayMs) {
74608
73825
  * Internal use of Amplify only
74609
73826
  */
74610
73827
 
74611
-
74612
73828
  var jitteredExponentialRetry = function jitteredExponentialRetry(functionToRetry, args, maxDelayMs) {
74613
73829
  if (maxDelayMs === void 0) {
74614
73830
  maxDelayMs = MAX_DELAY_MS;
@@ -74623,16 +73839,13 @@ var jitteredExponentialRetry = function jitteredExponentialRetry(functionToRetry
74623
73839
  /*!*******************************************!*\
74624
73840
  !*** ../core/lib-esm/Util/StringUtils.js ***!
74625
73841
  \*******************************************/
74626
- /*! exports provided: urlSafeEncode, urlSafeDecode, getStringByteSize */
73842
+ /*! exports provided: urlSafeEncode, urlSafeDecode */
74627
73843
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
74628
73844
 
74629
73845
  "use strict";
74630
73846
  __webpack_require__.r(__webpack_exports__);
74631
- /* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlSafeEncode", function() { return urlSafeEncode; });
73847
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlSafeEncode", function() { return urlSafeEncode; });
74632
73848
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlSafeDecode", function() { return urlSafeDecode; });
74633
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStringByteSize", function() { return getStringByteSize; });
74634
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ */ "../core/lib-esm/index.js");
74635
-
74636
73849
  function urlSafeEncode(str) {
74637
73850
  return str.split('').map(function (_char) {
74638
73851
  return _char.charCodeAt(0).toString(16).padStart(2, '0');
@@ -74643,18 +73856,6 @@ function urlSafeDecode(hex) {
74643
73856
  return String.fromCharCode(parseInt(_char2, 16));
74644
73857
  }).join('');
74645
73858
  }
74646
- var getStringByteSize = function getStringByteSize(str) {
74647
- if (Object(___WEBPACK_IMPORTED_MODULE_0__["browserOrNode"])().isBrowser || Blob !== undefined) {
74648
- return new Blob([str]).size;
74649
- }
74650
-
74651
- if (Buffer !== undefined) {
74652
- return Buffer.byteLength(str, 'utf8');
74653
- }
74654
-
74655
- throw new Error('Cannot compute string length. Blob and Buffer are undefined');
74656
- };
74657
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/buffer/index.js */ "../../node_modules/buffer/index.js").Buffer))
74658
73859
 
74659
73860
  /***/ }),
74660
73861
 
@@ -74662,7 +73863,7 @@ var getStringByteSize = function getStringByteSize(str) {
74662
73863
  /*!*************************************!*\
74663
73864
  !*** ../core/lib-esm/Util/index.js ***!
74664
73865
  \*************************************/
74665
- /*! 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 */
73866
+ /*! 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 */
74666
73867
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
74667
73868
 
74668
73869
  "use strict";
@@ -74672,6 +73873,8 @@ __webpack_require__.r(__webpack_exports__);
74672
73873
 
74673
73874
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _Retry__WEBPACK_IMPORTED_MODULE_0__["retry"]; });
74674
73875
 
73876
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jitteredBackoff", function() { return _Retry__WEBPACK_IMPORTED_MODULE_0__["jitteredBackoff"]; });
73877
+
74675
73878
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jitteredExponentialRetry", function() { return _Retry__WEBPACK_IMPORTED_MODULE_0__["jitteredExponentialRetry"]; });
74676
73879
 
74677
73880
  /* harmony import */ var _Mutex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Mutex */ "../core/lib-esm/Util/Mutex.js");
@@ -74688,8 +73891,6 @@ __webpack_require__.r(__webpack_exports__);
74688
73891
 
74689
73892
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlSafeDecode", function() { return _StringUtils__WEBPACK_IMPORTED_MODULE_4__["urlSafeDecode"]; });
74690
73893
 
74691
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStringByteSize", function() { return _StringUtils__WEBPACK_IMPORTED_MODULE_4__["getStringByteSize"]; });
74692
-
74693
73894
  /* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Constants */ "../core/lib-esm/Util/Constants.js");
74694
73895
  /* 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"]; });
74695
73896
 
@@ -74705,10 +73906,6 @@ __webpack_require__.r(__webpack_exports__);
74705
73906
 
74706
73907
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["RETRY_ERROR_CODES"]; });
74707
73908
 
74708
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_NAME", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["API_LOGGING_PROVIDER_NAME"]; });
74709
-
74710
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_CATEGORY", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["API_LOGGING_PROVIDER_CATEGORY"]; });
74711
-
74712
73909
 
74713
73910
 
74714
73911
 
@@ -74758,7 +73955,7 @@ var USER_AGENT_HEADER = 'x-amz-user-agent';
74758
73955
  /*!********************************!*\
74759
73956
  !*** ../core/lib-esm/index.js ***!
74760
73957
  \********************************/
74761
- /*! 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 */
73958
+ /*! 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 */
74762
73959
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
74763
73960
 
74764
73961
  "use strict";
@@ -74827,8 +74024,6 @@ __webpack_require__.r(__webpack_exports__);
74827
74024
  /* harmony import */ var _Providers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Providers */ "../core/lib-esm/Providers/index.js");
74828
74025
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWSCloudWatchProvider", function() { return _Providers__WEBPACK_IMPORTED_MODULE_10__["AWSCloudWatchProvider"]; });
74829
74026
 
74830
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "APILoggingProvider", function() { return _Providers__WEBPACK_IMPORTED_MODULE_10__["APILoggingProvider"]; });
74831
-
74832
74027
  /* harmony import */ var _OAuthHelper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./OAuthHelper */ "../core/lib-esm/OAuthHelper/index.js");
74833
74028
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FacebookOAuth", function() { return _OAuthHelper__WEBPACK_IMPORTED_MODULE_11__["FacebookOAuth"]; });
74834
74029
 
@@ -74873,6 +74068,8 @@ __webpack_require__.r(__webpack_exports__);
74873
74068
 
74874
74069
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["retry"]; });
74875
74070
 
74071
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jitteredBackoff", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["jitteredBackoff"]; });
74072
+
74876
74073
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jitteredExponentialRetry", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["jitteredExponentialRetry"]; });
74877
74074
 
74878
74075
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Mutex", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["Mutex"]; });
@@ -74885,8 +74082,6 @@ __webpack_require__.r(__webpack_exports__);
74885
74082
 
74886
74083
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlSafeDecode", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["urlSafeDecode"]; });
74887
74084
 
74888
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStringByteSize", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["getStringByteSize"]; });
74889
-
74890
74085
  /* 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"]; });
74891
74086
 
74892
74087
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWS_CLOUDWATCH_CATEGORY", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["AWS_CLOUDWATCH_CATEGORY"]; });
@@ -74901,10 +74096,6 @@ __webpack_require__.r(__webpack_exports__);
74901
74096
 
74902
74097
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["RETRY_ERROR_CODES"]; });
74903
74098
 
74904
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_NAME", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["API_LOGGING_PROVIDER_NAME"]; });
74905
-
74906
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "API_LOGGING_PROVIDER_CATEGORY", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["API_LOGGING_PROVIDER_CATEGORY"]; });
74907
-
74908
74099
  /*
74909
74100
  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
74910
74101
  *
@@ -74951,24 +74142,6 @@ var Constants = {
74951
74142
 
74952
74143
  /***/ }),
74953
74144
 
74954
- /***/ "../core/lib-esm/types/types.js":
74955
- /*!**************************************!*\
74956
- !*** ../core/lib-esm/types/types.js ***!
74957
- \**************************************/
74958
- /*! exports provided: isLoggerEvent */
74959
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
74960
-
74961
- "use strict";
74962
- __webpack_require__.r(__webpack_exports__);
74963
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLoggerEvent", function() { return isLoggerEvent; });
74964
- function isLoggerEvent(inputLogEvent) {
74965
- return inputLogEvent && !!Object.keys(inputLogEvent).find(function (k) {
74966
- return k === 'loggerInfo';
74967
- });
74968
- }
74969
-
74970
- /***/ }),
74971
-
74972
74145
  /***/ "../core/node_modules/@aws-crypto/sha256-js/build/RawSha256.js":
74973
74146
  /*!*********************************************************************!*\
74974
74147
  !*** ../core/node_modules/@aws-crypto/sha256-js/build/RawSha256.js ***!
@@ -92976,11 +92149,12 @@ function () {
92976
92149
  /*!*********************************************!*\
92977
92150
  !*** ./lib-esm/sync/processors/mutation.js ***!
92978
92151
  \*********************************************/
92979
- /*! exports provided: MutationProcessor */
92152
+ /*! exports provided: safeJitteredBackoff, MutationProcessor */
92980
92153
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92981
92154
 
92982
92155
  "use strict";
92983
92156
  __webpack_require__.r(__webpack_exports__);
92157
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeJitteredBackoff", function() { return safeJitteredBackoff; });
92984
92158
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MutationProcessor", function() { return MutationProcessor; });
92985
92159
  /* harmony import */ var _aws_amplify_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/api */ "../api/lib-esm/index.js");
92986
92160
  /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core */ "../core/lib-esm/index.js");
@@ -93534,7 +92708,7 @@ function () {
93534
92708
  case 0:
93535
92709
  return [4
93536
92710
  /*yield*/
93537
- , Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["jitteredExponentialRetry"])(function (model, operation, data, condition, modelConstructor, MutationEvent, mutationEvent) {
92711
+ , Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["retry"])(function (model, operation, data, condition, modelConstructor, MutationEvent, mutationEvent) {
93538
92712
  return __awaiter(_this, void 0, void 0, function () {
93539
92713
  var _a, query, variables, graphQLCondition, opName, modelDefinition, authToken, tryWith, attempt, opType, result, err_1, _b, error, _c, _d, code, retryWith, err_2, _e, _f, opName_1, query_1, authToken_1, serverData, namespace, updatedMutation, err_3;
93540
92714
 
@@ -93739,7 +92913,7 @@ function () {
93739
92913
  }
93740
92914
  });
93741
92915
  });
93742
- }, [model, operation, data, condition, modelConstructor, MutationEvent, mutationEvent])];
92916
+ }, [model, operation, data, condition, modelConstructor, MutationEvent, mutationEvent], safeJitteredBackoff)];
93743
92917
 
93744
92918
  case 1:
93745
92919
  return [2
@@ -93881,6 +93055,33 @@ function () {
93881
93055
  return MutationProcessor;
93882
93056
  }();
93883
93057
 
93058
+ var MAX_RETRY_DELAY_MS = 5 * 60 * 1000;
93059
+ var originalJitteredBackoff = Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["jitteredBackoff"])(MAX_RETRY_DELAY_MS);
93060
+ /**
93061
+ * @private
93062
+ * Internal use of Amplify only.
93063
+ *
93064
+ * Wraps the jittered backoff calculation to retry Network Errors indefinitely.
93065
+ * Backs off according to original jittered retry logic until the original retry
93066
+ * logic hits its max. After this occurs, if the error is a Network Error, we
93067
+ * ignore the attempt count and return MAX_RETRY_DELAY_MS to retry forever (until
93068
+ * the request succeeds).
93069
+ *
93070
+ * @param attempt ignored
93071
+ * @param _args ignored
93072
+ * @param error tested to see if `.message` is 'Network Error'
93073
+ * @returns number | false :
93074
+ */
93075
+
93076
+ var safeJitteredBackoff = function safeJitteredBackoff(attempt, _args, error) {
93077
+ var attemptResult = originalJitteredBackoff(attempt); // If this is the last attempt and it is a network error, we retry indefinitively every 5 minutes
93078
+
93079
+ if (attemptResult === false && (error === null || error === void 0 ? void 0 : error.message) === 'Network Error') {
93080
+ return MAX_RETRY_DELAY_MS;
93081
+ }
93082
+
93083
+ return attemptResult;
93084
+ };
93884
93085
 
93885
93086
 
93886
93087
  /***/ }),