@aws-amplify/datastore 3.7.8 → 3.7.9-api-logging.5

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,11 +69939,12 @@ function () {
69939
69939
  /*!***********************************************!*\
69940
69940
  !*** ../core/lib-esm/Logger/ConsoleLogger.js ***!
69941
69941
  \***********************************************/
69942
- /*! exports provided: LOG_TYPE, ConsoleLogger */
69942
+ /*! exports provided: LOG_LEVELS, 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; });
69947
69948
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOG_TYPE", function() { return LOG_TYPE; });
69948
69949
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConsoleLogger", function() { return ConsoleLogger; });
69949
69950
  /* harmony import */ var _Util_Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Util/Constants */ "../core/lib-esm/Util/Constants.js");
@@ -70051,6 +70052,10 @@ function () {
70051
70052
  this._pluggables = [];
70052
70053
  }
70053
70054
 
70055
+ ConsoleLogger.addPluggable = function (pluggable) {
70056
+ ConsoleLogger.pluggables.push(pluggable);
70057
+ };
70058
+
70054
70059
  ConsoleLogger.prototype._padding = function (n) {
70055
70060
  return n < 10 ? '0' + n : '' + n;
70056
70061
  };
@@ -70065,6 +70070,75 @@ function () {
70065
70070
  this._config = config;
70066
70071
  return this._config;
70067
70072
  };
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
+ };
70068
70142
  /**
70069
70143
  * Write log
70070
70144
  * @method
@@ -70075,7 +70149,7 @@ function () {
70075
70149
 
70076
70150
 
70077
70151
  ConsoleLogger.prototype._log = function (type) {
70078
- var e_1, _a;
70152
+ var e_2, _a;
70079
70153
 
70080
70154
  var msg = [];
70081
70155
 
@@ -70083,6 +70157,8 @@ function () {
70083
70157
  msg[_i - 1] = arguments[_i];
70084
70158
  }
70085
70159
 
70160
+ this._logGlobal.apply(this, __spread([type], msg));
70161
+
70086
70162
  var logger_level_name = this.level;
70087
70163
 
70088
70164
  if (ConsoleLogger.LOG_LEVEL) {
@@ -70143,15 +70219,15 @@ function () {
70143
70219
  };
70144
70220
  plugin.pushLogs([logEvent]);
70145
70221
  }
70146
- } catch (e_1_1) {
70147
- e_1 = {
70148
- error: e_1_1
70222
+ } catch (e_2_1) {
70223
+ e_2 = {
70224
+ error: e_2_1
70149
70225
  };
70150
70226
  } finally {
70151
70227
  try {
70152
70228
  if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
70153
70229
  } finally {
70154
- if (e_1) throw e_1.error;
70230
+ if (e_2) throw e_2.error;
70155
70231
  }
70156
70232
  }
70157
70233
  };
@@ -70270,6 +70346,7 @@ function () {
70270
70346
  return this._pluggables;
70271
70347
  };
70272
70348
 
70349
+ ConsoleLogger.pluggables = [];
70273
70350
  ConsoleLogger.LOG_LEVEL = null;
70274
70351
  return ConsoleLogger;
70275
70352
  }();
@@ -70282,12 +70359,14 @@ function () {
70282
70359
  /*!***************************************!*\
70283
70360
  !*** ../core/lib-esm/Logger/index.js ***!
70284
70361
  \***************************************/
70285
- /*! exports provided: LOG_TYPE, ConsoleLogger */
70362
+ /*! exports provided: LOG_LEVELS, LOG_TYPE, ConsoleLogger */
70286
70363
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
70287
70364
 
70288
70365
  "use strict";
70289
70366
  __webpack_require__.r(__webpack_exports__);
70290
70367
  /* 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
+
70291
70370
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LOG_TYPE", function() { return _ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["LOG_TYPE"]; });
70292
70371
 
70293
70372
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConsoleLogger", function() { return _ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]; });
@@ -70865,62 +70944,872 @@ function () {
70865
70944
  });
70866
70945
  };
70867
70946
 
70868
- return GoogleOAuth;
70869
- }();
70947
+ return GoogleOAuth;
70948
+ }();
70949
+
70950
+
70951
+ /**
70952
+ * @deprecated use named import
70953
+ */
70954
+
70955
+ /* harmony default export */ __webpack_exports__["default"] = (GoogleOAuth);
70956
+
70957
+ /***/ }),
70958
+
70959
+ /***/ "../core/lib-esm/OAuthHelper/index.js":
70960
+ /*!********************************************!*\
70961
+ !*** ../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
+ /***/ }),
70870
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__) {
70871
71776
 
70872
- /**
70873
- * @deprecated use named import
70874
- */
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");
70875
71781
 
70876
- /* harmony default export */ __webpack_exports__["default"] = (GoogleOAuth);
71782
+ var ReachabilityMonitor = new _Util__WEBPACK_IMPORTED_MODULE_0__["Reachability"]().networkMonitor();
70877
71783
 
70878
71784
  /***/ }),
70879
71785
 
70880
- /***/ "../core/lib-esm/OAuthHelper/index.js":
70881
- /*!********************************************!*\
70882
- !*** ../core/lib-esm/OAuthHelper/index.js ***!
70883
- \********************************************/
70884
- /*! exports provided: GoogleOAuth, FacebookOAuth */
71786
+ /***/ "../core/lib-esm/Providers/APIProvider/index.js":
71787
+ /*!******************************************************!*\
71788
+ !*** ../core/lib-esm/Providers/APIProvider/index.js ***!
71789
+ \******************************************************/
71790
+ /*! exports provided: APILoggingProvider */
70885
71791
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
70886
71792
 
70887
71793
  "use strict";
70888
71794
  __webpack_require__.r(__webpack_exports__);
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
- */
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"]; });
70905
71797
 
70906
71798
 
70907
- var GoogleOAuth = new _GoogleOAuth__WEBPACK_IMPORTED_MODULE_0__["GoogleOAuth"]();
70908
- var FacebookOAuth = new _FacebookOAuth__WEBPACK_IMPORTED_MODULE_1__["FacebookOAuth"]();
70909
71799
 
70910
71800
  /***/ }),
70911
71801
 
70912
- /***/ "../core/lib-esm/Parser.js":
70913
- /*!*********************************!*\
70914
- !*** ../core/lib-esm/Parser.js ***!
70915
- \*********************************/
70916
- /*! exports provided: parseMobileHubConfig, Parser, default */
71802
+ /***/ "../core/lib-esm/Providers/APIProvider/loggerConnectivity.js":
71803
+ /*!*******************************************************************!*\
71804
+ !*** ../core/lib-esm/Providers/APIProvider/loggerConnectivity.js ***!
71805
+ \*******************************************************************/
71806
+ /*! exports provided: default */
70917
71807
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
70918
71808
 
70919
71809
  "use strict";
70920
71810
  __webpack_require__.r(__webpack_exports__);
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");
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");
70924
71813
  var __assign = undefined && undefined.__assign || function () {
70925
71814
  __assign = Object.assign || function (t) {
70926
71815
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -70938,167 +71827,54 @@ var __assign = undefined && undefined.__assign || function () {
70938
71827
  };
70939
71828
 
70940
71829
 
70941
- var logger = new _Logger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Parser');
70942
- var parseMobileHubConfig = function parseMobileHubConfig(config) {
70943
- var amplifyConfig = {}; // Analytics
71830
+ // TODO: refactor this to a singleton that supports numerous observers
70944
71831
 
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
- }
71832
+ var LoggerConnectivity =
71833
+ /** @class */
71834
+ function () {
71835
+ function LoggerConnectivity() {
71836
+ this.connectionStatus = {
71837
+ online: false
70951
71838
  };
70952
- amplifyConfig.Analytics = Analytics;
70953
- } // Auth
70954
-
71839
+ }
70955
71840
 
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
71841
+ LoggerConnectivity.prototype.status = function () {
71842
+ var _this = this;
70966
71843
 
71844
+ if (this.observer) {
71845
+ throw new Error('Subscriber already exists');
71846
+ }
70967
71847
 
70968
- var storageConfig;
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;
70969
71853
 
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
71854
+ var observerResult = __assign({}, _this.connectionStatus);
70981
71855
 
71856
+ observer.next(observerResult);
71857
+ });
71858
+ return function () {
71859
+ clearTimeout(_this.timeout);
70982
71860
 
70983
- if (config['Logging']) {
70984
- amplifyConfig.Logging = __assign(__assign({}, config['Logging']), {
70985
- region: config['aws_project_region']
71861
+ _this.unsubscribe();
71862
+ };
70986
71863
  });
70987
- } // Geo
70988
-
70989
-
70990
- if (config['geo']) {
70991
- amplifyConfig.Geo = Object.assign({}, config.geo);
71864
+ };
70992
71865
 
70993
- if (config.geo['amazon_location_service']) {
70994
- amplifyConfig.Geo = {
70995
- AmazonLocationService: config.geo['amazon_location_service']
70996
- };
71866
+ LoggerConnectivity.prototype.unsubscribe = function () {
71867
+ if (this.subscription) {
71868
+ clearTimeout(this.timeout);
71869
+ this.subscription.unsubscribe();
71870
+ this.observer = undefined;
70997
71871
  }
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() {}
71872
+ };
71015
71873
 
71016
- Parser.parseMobilehubConfig = parseMobileHubConfig;
71017
- return Parser;
71874
+ return LoggerConnectivity;
71018
71875
  }();
71019
71876
 
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.0';
71877
+ /* harmony default export */ __webpack_exports__["default"] = (LoggerConnectivity);
71102
71878
 
71103
71879
  /***/ }),
71104
71880
 
@@ -71596,7 +72372,15 @@ function () {
71596
72372
 
71597
72373
  AWSCloudWatchProvider.prototype.pushLogs = function (logs) {
71598
72374
  logger.debug('pushing log events to Cloudwatch...');
71599
- this._dataTracker.logEvents = __spread(this._dataTracker.logEvents, logs);
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);
71600
72384
  };
71601
72385
 
71602
72386
  AWSCloudWatchProvider.prototype._validateLogGroupExistsAndCreate = function (logGroupName) {
@@ -72111,7 +72895,7 @@ function () {
72111
72895
  /*!******************************************!*\
72112
72896
  !*** ../core/lib-esm/Providers/index.js ***!
72113
72897
  \******************************************/
72114
- /*! exports provided: AWSCloudWatchProvider */
72898
+ /*! exports provided: AWSCloudWatchProvider, APILoggingProvider */
72115
72899
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
72116
72900
 
72117
72901
  "use strict";
@@ -72119,6 +72903,10 @@ __webpack_require__.r(__webpack_exports__);
72119
72903
  /* harmony import */ var _AWSCloudWatchProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AWSCloudWatchProvider */ "../core/lib-esm/Providers/AWSCloudWatchProvider.js");
72120
72904
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWSCloudWatchProvider", function() { return _AWSCloudWatchProvider__WEBPACK_IMPORTED_MODULE_0__["AWSCloudWatchProvider"]; });
72121
72905
 
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
+
72122
72910
 
72123
72911
 
72124
72912
  /***/ }),
@@ -73123,7 +73911,7 @@ function () {
73123
73911
  /*!*****************************************!*\
73124
73912
  !*** ../core/lib-esm/Util/Constants.js ***!
73125
73913
  \*****************************************/
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 */
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 */
73127
73915
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
73128
73916
 
73129
73917
  "use strict";
@@ -73135,6 +73923,8 @@ __webpack_require__.r(__webpack_exports__);
73135
73923
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWS_CLOUDWATCH_PROVIDER_NAME", function() { return AWS_CLOUDWATCH_PROVIDER_NAME; });
73136
73924
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NO_CREDS_ERROR_STRING", function() { return NO_CREDS_ERROR_STRING; });
73137
73925
  /* 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; });
73138
73928
  /*
73139
73929
  * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
73140
73930
  *
@@ -73155,6 +73945,8 @@ var AWS_CLOUDWATCH_CATEGORY = 'Logging';
73155
73945
  var AWS_CLOUDWATCH_PROVIDER_NAME = 'AWSCloudWatch';
73156
73946
  var NO_CREDS_ERROR_STRING = 'No credentials';
73157
73947
  var RETRY_ERROR_CODES = ['ResourceNotFoundException', 'InvalidSequenceTokenException'];
73948
+ var API_LOGGING_PROVIDER_NAME = 'API';
73949
+ var API_LOGGING_PROVIDER_CATEGORY = 'Logging';
73158
73950
 
73159
73951
 
73160
73952
  /***/ }),
@@ -73368,7 +74160,7 @@ function () {
73368
74160
 
73369
74161
  "use strict";
73370
74162
  __webpack_require__.r(__webpack_exports__);
73371
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core */ "../core/lib-esm/index.js");
74163
+ /* harmony import */ var _JS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../JS */ "../core/lib-esm/JS.js");
73372
74164
  /* harmony import */ var zen_observable_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! zen-observable-ts */ "../../node_modules/zen-observable-ts/lib/bundle.esm.js");
73373
74165
  var __values = undefined && undefined.__values || function (o) {
73374
74166
  var s = typeof Symbol === "function" && Symbol.iterator,
@@ -73396,13 +74188,13 @@ function () {
73396
74188
  function ReachabilityNavigator() {}
73397
74189
 
73398
74190
  ReachabilityNavigator.prototype.networkMonitor = function (netInfo) {
73399
- if (Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["browserOrNode"])().isNode) {
74191
+ if (Object(_JS__WEBPACK_IMPORTED_MODULE_0__["browserOrNode"])().isNode) {
73400
74192
  return zen_observable_ts__WEBPACK_IMPORTED_MODULE_1__["default"].from([{
73401
74193
  online: true
73402
74194
  }]);
73403
74195
  }
73404
74196
 
73405
- var globalObj = Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["isWebWorker"])() ? self : window;
74197
+ var globalObj = Object(_JS__WEBPACK_IMPORTED_MODULE_0__["isWebWorker"])() ? self : window;
73406
74198
  return new zen_observable_ts__WEBPACK_IMPORTED_MODULE_1__["default"](function (observer) {
73407
74199
  observer.next({
73408
74200
  online: globalObj.navigator.onLine
@@ -73695,7 +74487,7 @@ var __spread = undefined && undefined.__spread || function () {
73695
74487
  };
73696
74488
 
73697
74489
 
73698
- var logger = new _Logger_ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Util');
74490
+ var logger = new _Logger_ConsoleLogger__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Retry');
73699
74491
 
73700
74492
  var NonRetryableError =
73701
74493
  /** @class */
@@ -73738,7 +74530,7 @@ function retry(functionToRetry, args, delayFn, attempt) {
73738
74530
  throw Error('functionToRetry must be a function');
73739
74531
  }
73740
74532
 
73741
- logger.debug(functionToRetry.name + " attempt #" + attempt + " with this vars: " + JSON.stringify(args));
74533
+ logger.debug(functionToRetry.name + " attempt #" + attempt + " with these vars: " + JSON.stringify(args));
73742
74534
  _a.label = 1;
73743
74535
 
73744
74536
  case 1:
@@ -73831,13 +74623,16 @@ var jitteredExponentialRetry = function jitteredExponentialRetry(functionToRetry
73831
74623
  /*!*******************************************!*\
73832
74624
  !*** ../core/lib-esm/Util/StringUtils.js ***!
73833
74625
  \*******************************************/
73834
- /*! exports provided: urlSafeEncode, urlSafeDecode */
74626
+ /*! exports provided: urlSafeEncode, urlSafeDecode, getStringByteSize */
73835
74627
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
73836
74628
 
73837
74629
  "use strict";
73838
74630
  __webpack_require__.r(__webpack_exports__);
73839
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlSafeEncode", function() { return urlSafeEncode; });
74631
+ /* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlSafeEncode", function() { return urlSafeEncode; });
73840
74632
  /* 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
+
73841
74636
  function urlSafeEncode(str) {
73842
74637
  return str.split('').map(function (_char) {
73843
74638
  return _char.charCodeAt(0).toString(16).padStart(2, '0');
@@ -73848,6 +74643,18 @@ function urlSafeDecode(hex) {
73848
74643
  return String.fromCharCode(parseInt(_char2, 16));
73849
74644
  }).join('');
73850
74645
  }
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))
73851
74658
 
73852
74659
  /***/ }),
73853
74660
 
@@ -73855,7 +74662,7 @@ function urlSafeDecode(hex) {
73855
74662
  /*!*************************************!*\
73856
74663
  !*** ../core/lib-esm/Util/index.js ***!
73857
74664
  \*************************************/
73858
- /*! exports provided: NonRetryableError, retry, 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 */
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 */
73859
74666
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
73860
74667
 
73861
74668
  "use strict";
@@ -73881,6 +74688,8 @@ __webpack_require__.r(__webpack_exports__);
73881
74688
 
73882
74689
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlSafeDecode", function() { return _StringUtils__WEBPACK_IMPORTED_MODULE_4__["urlSafeDecode"]; });
73883
74690
 
74691
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStringByteSize", function() { return _StringUtils__WEBPACK_IMPORTED_MODULE_4__["getStringByteSize"]; });
74692
+
73884
74693
  /* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Constants */ "../core/lib-esm/Util/Constants.js");
73885
74694
  /* 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"]; });
73886
74695
 
@@ -73896,6 +74705,10 @@ __webpack_require__.r(__webpack_exports__);
73896
74705
 
73897
74706
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["RETRY_ERROR_CODES"]; });
73898
74707
 
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
+
73899
74712
 
73900
74713
 
73901
74714
 
@@ -73945,7 +74758,7 @@ var USER_AGENT_HEADER = 'x-amz-user-agent';
73945
74758
  /*!********************************!*\
73946
74759
  !*** ../core/lib-esm/index.js ***!
73947
74760
  \********************************/
73948
- /*! 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, 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 */
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 */
73949
74762
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
73950
74763
 
73951
74764
  "use strict";
@@ -74014,6 +74827,8 @@ __webpack_require__.r(__webpack_exports__);
74014
74827
  /* harmony import */ var _Providers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Providers */ "../core/lib-esm/Providers/index.js");
74015
74828
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWSCloudWatchProvider", function() { return _Providers__WEBPACK_IMPORTED_MODULE_10__["AWSCloudWatchProvider"]; });
74016
74829
 
74830
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "APILoggingProvider", function() { return _Providers__WEBPACK_IMPORTED_MODULE_10__["APILoggingProvider"]; });
74831
+
74017
74832
  /* harmony import */ var _OAuthHelper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./OAuthHelper */ "../core/lib-esm/OAuthHelper/index.js");
74018
74833
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FacebookOAuth", function() { return _OAuthHelper__WEBPACK_IMPORTED_MODULE_11__["FacebookOAuth"]; });
74019
74834
 
@@ -74070,6 +74885,8 @@ __webpack_require__.r(__webpack_exports__);
74070
74885
 
74071
74886
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlSafeDecode", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["urlSafeDecode"]; });
74072
74887
 
74888
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStringByteSize", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["getStringByteSize"]; });
74889
+
74073
74890
  /* 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"]; });
74074
74891
 
74075
74892
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWS_CLOUDWATCH_CATEGORY", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["AWS_CLOUDWATCH_CATEGORY"]; });
@@ -74084,6 +74901,10 @@ __webpack_require__.r(__webpack_exports__);
74084
74901
 
74085
74902
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["RETRY_ERROR_CODES"]; });
74086
74903
 
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
+
74087
74908
  /*
74088
74909
  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
74089
74910
  *
@@ -74130,6 +74951,24 @@ var Constants = {
74130
74951
 
74131
74952
  /***/ }),
74132
74953
 
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
+
74133
74972
  /***/ "../core/node_modules/@aws-crypto/sha256-js/build/RawSha256.js":
74134
74973
  /*!*********************************************************************!*\
74135
74974
  !*** ../core/node_modules/@aws-crypto/sha256-js/build/RawSha256.js ***!