@aws-amplify/datastore 3.7.6-unstable.3 → 3.7.7-cloud-logging.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.
@@ -27859,217 +27859,21 @@ function isnan (val) {
27859
27859
 
27860
27860
  /***/ }),
27861
27861
 
27862
- /***/ "../../node_modules/cookie/index.js":
27863
- /*!*****************************************************!*\
27864
- !*** /root/amplify-js/node_modules/cookie/index.js ***!
27865
- \*****************************************************/
27862
+ /***/ "../../node_modules/fast-text-encoding/text.min.js":
27863
+ /*!********************************************************************!*\
27864
+ !*** /root/amplify-js/node_modules/fast-text-encoding/text.min.js ***!
27865
+ \********************************************************************/
27866
27866
  /*! no static exports found */
27867
27867
  /***/ (function(module, exports, __webpack_require__) {
27868
27868
 
27869
- "use strict";
27870
- /*!
27871
- * cookie
27872
- * Copyright(c) 2012-2014 Roman Shtylman
27873
- * Copyright(c) 2015 Douglas Christopher Wilson
27874
- * MIT Licensed
27875
- */
27876
-
27877
-
27878
-
27879
- /**
27880
- * Module exports.
27881
- * @public
27882
- */
27883
-
27884
- exports.parse = parse;
27885
- exports.serialize = serialize;
27886
-
27887
- /**
27888
- * Module variables.
27889
- * @private
27890
- */
27891
-
27892
- var decode = decodeURIComponent;
27893
- var encode = encodeURIComponent;
27894
- var pairSplitRegExp = /; */;
27895
-
27896
- /**
27897
- * RegExp to match field-content in RFC 7230 sec 3.2
27898
- *
27899
- * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
27900
- * field-vchar = VCHAR / obs-text
27901
- * obs-text = %x80-FF
27902
- */
27903
-
27904
- var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
27905
-
27906
- /**
27907
- * Parse a cookie header.
27908
- *
27909
- * Parse the given cookie header string into an object
27910
- * The object has the various cookies as keys(names) => values
27911
- *
27912
- * @param {string} str
27913
- * @param {object} [options]
27914
- * @return {object}
27915
- * @public
27916
- */
27917
-
27918
- function parse(str, options) {
27919
- if (typeof str !== 'string') {
27920
- throw new TypeError('argument str must be a string');
27921
- }
27922
-
27923
- var obj = {}
27924
- var opt = options || {};
27925
- var pairs = str.split(pairSplitRegExp);
27926
- var dec = opt.decode || decode;
27927
-
27928
- for (var i = 0; i < pairs.length; i++) {
27929
- var pair = pairs[i];
27930
- var eq_idx = pair.indexOf('=');
27931
-
27932
- // skip things that don't look like key=value
27933
- if (eq_idx < 0) {
27934
- continue;
27935
- }
27936
-
27937
- var key = pair.substr(0, eq_idx).trim()
27938
- var val = pair.substr(++eq_idx, pair.length).trim();
27939
-
27940
- // quoted values
27941
- if ('"' == val[0]) {
27942
- val = val.slice(1, -1);
27943
- }
27944
-
27945
- // only assign once
27946
- if (undefined == obj[key]) {
27947
- obj[key] = tryDecode(val, dec);
27948
- }
27949
- }
27950
-
27951
- return obj;
27952
- }
27953
-
27954
- /**
27955
- * Serialize data into a cookie header.
27956
- *
27957
- * Serialize the a name value pair into a cookie string suitable for
27958
- * http headers. An optional options object specified cookie parameters.
27959
- *
27960
- * serialize('foo', 'bar', { httpOnly: true })
27961
- * => "foo=bar; httpOnly"
27962
- *
27963
- * @param {string} name
27964
- * @param {string} val
27965
- * @param {object} [options]
27966
- * @return {string}
27967
- * @public
27968
- */
27969
-
27970
- function serialize(name, val, options) {
27971
- var opt = options || {};
27972
- var enc = opt.encode || encode;
27973
-
27974
- if (typeof enc !== 'function') {
27975
- throw new TypeError('option encode is invalid');
27976
- }
27977
-
27978
- if (!fieldContentRegExp.test(name)) {
27979
- throw new TypeError('argument name is invalid');
27980
- }
27981
-
27982
- var value = enc(val);
27983
-
27984
- if (value && !fieldContentRegExp.test(value)) {
27985
- throw new TypeError('argument val is invalid');
27986
- }
27987
-
27988
- var str = name + '=' + value;
27989
-
27990
- if (null != opt.maxAge) {
27991
- var maxAge = opt.maxAge - 0;
27992
-
27993
- if (isNaN(maxAge) || !isFinite(maxAge)) {
27994
- throw new TypeError('option maxAge is invalid')
27995
- }
27996
-
27997
- str += '; Max-Age=' + Math.floor(maxAge);
27998
- }
27999
-
28000
- if (opt.domain) {
28001
- if (!fieldContentRegExp.test(opt.domain)) {
28002
- throw new TypeError('option domain is invalid');
28003
- }
28004
-
28005
- str += '; Domain=' + opt.domain;
28006
- }
28007
-
28008
- if (opt.path) {
28009
- if (!fieldContentRegExp.test(opt.path)) {
28010
- throw new TypeError('option path is invalid');
28011
- }
28012
-
28013
- str += '; Path=' + opt.path;
28014
- }
28015
-
28016
- if (opt.expires) {
28017
- if (typeof opt.expires.toUTCString !== 'function') {
28018
- throw new TypeError('option expires is invalid');
28019
- }
28020
-
28021
- str += '; Expires=' + opt.expires.toUTCString();
28022
- }
28023
-
28024
- if (opt.httpOnly) {
28025
- str += '; HttpOnly';
28026
- }
28027
-
28028
- if (opt.secure) {
28029
- str += '; Secure';
28030
- }
28031
-
28032
- if (opt.sameSite) {
28033
- var sameSite = typeof opt.sameSite === 'string'
28034
- ? opt.sameSite.toLowerCase() : opt.sameSite;
28035
-
28036
- switch (sameSite) {
28037
- case true:
28038
- str += '; SameSite=Strict';
28039
- break;
28040
- case 'lax':
28041
- str += '; SameSite=Lax';
28042
- break;
28043
- case 'strict':
28044
- str += '; SameSite=Strict';
28045
- break;
28046
- case 'none':
28047
- str += '; SameSite=None';
28048
- break;
28049
- default:
28050
- throw new TypeError('option sameSite is invalid');
28051
- }
28052
- }
28053
-
28054
- return str;
28055
- }
28056
-
28057
- /**
28058
- * Try decoding a string using a decoding function.
28059
- *
28060
- * @param {string} str
28061
- * @param {function} decode
28062
- * @private
28063
- */
28064
-
28065
- function tryDecode(str, decode) {
28066
- try {
28067
- return decode(str);
28068
- } catch (e) {
28069
- return str;
28070
- }
28071
- }
27869
+ /* WEBPACK VAR INJECTION */(function(global, Buffer) {(function(l){function m(){}function k(a,c){a=void 0===a?"utf-8":a;c=void 0===c?{fatal:!1}:c;if(-1===r.indexOf(a.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+a+"') is invalid.");if(c.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}function t(a){return Buffer.from(a.buffer,a.byteOffset,a.byteLength).toString("utf-8")}function u(a){var c=URL.createObjectURL(new Blob([a],{type:"text/plain;charset=UTF-8"}));
27870
+ try{var f=new XMLHttpRequest;f.open("GET",c,!1);f.send();return f.responseText}catch(e){return q(a)}finally{URL.revokeObjectURL(c)}}function q(a){for(var c=0,f=Math.min(65536,a.length+1),e=new Uint16Array(f),h=[],d=0;;){var b=c<a.length;if(!b||d>=f-1){h.push(String.fromCharCode.apply(null,e.subarray(0,d)));if(!b)return h.join("");a=a.subarray(c);d=c=0}b=a[c++];if(0===(b&128))e[d++]=b;else if(192===(b&224)){var g=a[c++]&63;e[d++]=(b&31)<<6|g}else if(224===(b&240)){g=a[c++]&63;var n=a[c++]&63;e[d++]=
27871
+ (b&31)<<12|g<<6|n}else if(240===(b&248)){g=a[c++]&63;n=a[c++]&63;var v=a[c++]&63;b=(b&7)<<18|g<<12|n<<6|v;65535<b&&(b-=65536,e[d++]=b>>>10&1023|55296,b=56320|b&1023);e[d++]=b}}}if(l.TextEncoder&&l.TextDecoder)return!1;var r=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(m.prototype,"encoding",{value:"utf-8"});m.prototype.encode=function(a,c){c=void 0===c?{stream:!1}:c;if(c.stream)throw Error("Failed to encode: the 'stream' option is unsupported.");c=0;for(var f=a.length,e=0,h=Math.max(32,
27872
+ f+(f>>>1)+7),d=new Uint8Array(h>>>3<<3);c<f;){var b=a.charCodeAt(c++);if(55296<=b&&56319>=b){if(c<f){var g=a.charCodeAt(c);56320===(g&64512)&&(++c,b=((b&1023)<<10)+(g&1023)+65536)}if(55296<=b&&56319>=b)continue}e+4>d.length&&(h+=8,h*=1+c/a.length*2,h=h>>>3<<3,g=new Uint8Array(h),g.set(d),d=g);if(0===(b&4294967168))d[e++]=b;else{if(0===(b&4294965248))d[e++]=b>>>6&31|192;else if(0===(b&4294901760))d[e++]=b>>>12&15|224,d[e++]=b>>>6&63|128;else if(0===(b&4292870144))d[e++]=b>>>18&7|240,d[e++]=b>>>12&
27873
+ 63|128,d[e++]=b>>>6&63|128;else continue;d[e++]=b&63|128}}return d.slice?d.slice(0,e):d.subarray(0,e)};Object.defineProperty(k.prototype,"encoding",{value:"utf-8"});Object.defineProperty(k.prototype,"fatal",{value:!1});Object.defineProperty(k.prototype,"ignoreBOM",{value:!1});var p=q;"function"===typeof Buffer&&Buffer.from?p=t:"function"===typeof Blob&&"function"===typeof URL&&"function"===typeof URL.createObjectURL&&(p=u);k.prototype.decode=function(a,c){c=void 0===c?{stream:!1}:c;if(c.stream)throw Error("Failed to decode: the 'stream' option is unsupported.");
27874
+ a=a instanceof Uint8Array?a:a.buffer instanceof ArrayBuffer?new Uint8Array(a.buffer):new Uint8Array(a);return p(a)};l.TextEncoder=m;l.TextDecoder=k})("undefined"!==typeof window?window:"undefined"!==typeof global?global:this);
28072
27875
 
27876
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../buffer/index.js */ "../../node_modules/buffer/index.js").Buffer))
28073
27877
 
28074
27878
  /***/ }),
28075
27879
 
@@ -48778,7 +48582,7 @@ __webpack_require__.r(__webpack_exports__);
48778
48582
 
48779
48583
  "use strict";
48780
48584
  __webpack_require__.r(__webpack_exports__);
48781
- /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ "../../node_modules/cookie/index.js");
48585
+ /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ "../../node_modules/universal-cookie/node_modules/cookie/index.js");
48782
48586
  /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cookie__WEBPACK_IMPORTED_MODULE_0__);
48783
48587
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "../../node_modules/universal-cookie/es6/utils.js");
48784
48588
  var __assign = (undefined && undefined.__assign) || function () {
@@ -48895,7 +48699,7 @@ __webpack_require__.r(__webpack_exports__);
48895
48699
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseCookies", function() { return parseCookies; });
48896
48700
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isParsingCookie", function() { return isParsingCookie; });
48897
48701
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readCookie", function() { return readCookie; });
48898
- /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ "../../node_modules/cookie/index.js");
48702
+ /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ "../../node_modules/universal-cookie/node_modules/cookie/index.js");
48899
48703
  /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cookie__WEBPACK_IMPORTED_MODULE_0__);
48900
48704
 
48901
48705
  function hasDocumentCookie() {
@@ -48952,6 +48756,220 @@ function cleanupCookieValue(value) {
48952
48756
  }
48953
48757
 
48954
48758
 
48759
+ /***/ }),
48760
+
48761
+ /***/ "../../node_modules/universal-cookie/node_modules/cookie/index.js":
48762
+ /*!***********************************************************************************!*\
48763
+ !*** /root/amplify-js/node_modules/universal-cookie/node_modules/cookie/index.js ***!
48764
+ \***********************************************************************************/
48765
+ /*! no static exports found */
48766
+ /***/ (function(module, exports, __webpack_require__) {
48767
+
48768
+ "use strict";
48769
+ /*!
48770
+ * cookie
48771
+ * Copyright(c) 2012-2014 Roman Shtylman
48772
+ * Copyright(c) 2015 Douglas Christopher Wilson
48773
+ * MIT Licensed
48774
+ */
48775
+
48776
+
48777
+
48778
+ /**
48779
+ * Module exports.
48780
+ * @public
48781
+ */
48782
+
48783
+ exports.parse = parse;
48784
+ exports.serialize = serialize;
48785
+
48786
+ /**
48787
+ * Module variables.
48788
+ * @private
48789
+ */
48790
+
48791
+ var decode = decodeURIComponent;
48792
+ var encode = encodeURIComponent;
48793
+
48794
+ /**
48795
+ * RegExp to match field-content in RFC 7230 sec 3.2
48796
+ *
48797
+ * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
48798
+ * field-vchar = VCHAR / obs-text
48799
+ * obs-text = %x80-FF
48800
+ */
48801
+
48802
+ var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
48803
+
48804
+ /**
48805
+ * Parse a cookie header.
48806
+ *
48807
+ * Parse the given cookie header string into an object
48808
+ * The object has the various cookies as keys(names) => values
48809
+ *
48810
+ * @param {string} str
48811
+ * @param {object} [options]
48812
+ * @return {object}
48813
+ * @public
48814
+ */
48815
+
48816
+ function parse(str, options) {
48817
+ if (typeof str !== 'string') {
48818
+ throw new TypeError('argument str must be a string');
48819
+ }
48820
+
48821
+ var obj = {}
48822
+ var opt = options || {};
48823
+ var pairs = str.split(';')
48824
+ var dec = opt.decode || decode;
48825
+
48826
+ for (var i = 0; i < pairs.length; i++) {
48827
+ var pair = pairs[i];
48828
+ var index = pair.indexOf('=')
48829
+
48830
+ // skip things that don't look like key=value
48831
+ if (index < 0) {
48832
+ continue;
48833
+ }
48834
+
48835
+ var key = pair.substring(0, index).trim()
48836
+
48837
+ // only assign once
48838
+ if (undefined == obj[key]) {
48839
+ var val = pair.substring(index + 1, pair.length).trim()
48840
+
48841
+ // quoted values
48842
+ if (val[0] === '"') {
48843
+ val = val.slice(1, -1)
48844
+ }
48845
+
48846
+ obj[key] = tryDecode(val, dec);
48847
+ }
48848
+ }
48849
+
48850
+ return obj;
48851
+ }
48852
+
48853
+ /**
48854
+ * Serialize data into a cookie header.
48855
+ *
48856
+ * Serialize the a name value pair into a cookie string suitable for
48857
+ * http headers. An optional options object specified cookie parameters.
48858
+ *
48859
+ * serialize('foo', 'bar', { httpOnly: true })
48860
+ * => "foo=bar; httpOnly"
48861
+ *
48862
+ * @param {string} name
48863
+ * @param {string} val
48864
+ * @param {object} [options]
48865
+ * @return {string}
48866
+ * @public
48867
+ */
48868
+
48869
+ function serialize(name, val, options) {
48870
+ var opt = options || {};
48871
+ var enc = opt.encode || encode;
48872
+
48873
+ if (typeof enc !== 'function') {
48874
+ throw new TypeError('option encode is invalid');
48875
+ }
48876
+
48877
+ if (!fieldContentRegExp.test(name)) {
48878
+ throw new TypeError('argument name is invalid');
48879
+ }
48880
+
48881
+ var value = enc(val);
48882
+
48883
+ if (value && !fieldContentRegExp.test(value)) {
48884
+ throw new TypeError('argument val is invalid');
48885
+ }
48886
+
48887
+ var str = name + '=' + value;
48888
+
48889
+ if (null != opt.maxAge) {
48890
+ var maxAge = opt.maxAge - 0;
48891
+
48892
+ if (isNaN(maxAge) || !isFinite(maxAge)) {
48893
+ throw new TypeError('option maxAge is invalid')
48894
+ }
48895
+
48896
+ str += '; Max-Age=' + Math.floor(maxAge);
48897
+ }
48898
+
48899
+ if (opt.domain) {
48900
+ if (!fieldContentRegExp.test(opt.domain)) {
48901
+ throw new TypeError('option domain is invalid');
48902
+ }
48903
+
48904
+ str += '; Domain=' + opt.domain;
48905
+ }
48906
+
48907
+ if (opt.path) {
48908
+ if (!fieldContentRegExp.test(opt.path)) {
48909
+ throw new TypeError('option path is invalid');
48910
+ }
48911
+
48912
+ str += '; Path=' + opt.path;
48913
+ }
48914
+
48915
+ if (opt.expires) {
48916
+ if (typeof opt.expires.toUTCString !== 'function') {
48917
+ throw new TypeError('option expires is invalid');
48918
+ }
48919
+
48920
+ str += '; Expires=' + opt.expires.toUTCString();
48921
+ }
48922
+
48923
+ if (opt.httpOnly) {
48924
+ str += '; HttpOnly';
48925
+ }
48926
+
48927
+ if (opt.secure) {
48928
+ str += '; Secure';
48929
+ }
48930
+
48931
+ if (opt.sameSite) {
48932
+ var sameSite = typeof opt.sameSite === 'string'
48933
+ ? opt.sameSite.toLowerCase() : opt.sameSite;
48934
+
48935
+ switch (sameSite) {
48936
+ case true:
48937
+ str += '; SameSite=Strict';
48938
+ break;
48939
+ case 'lax':
48940
+ str += '; SameSite=Lax';
48941
+ break;
48942
+ case 'strict':
48943
+ str += '; SameSite=Strict';
48944
+ break;
48945
+ case 'none':
48946
+ str += '; SameSite=None';
48947
+ break;
48948
+ default:
48949
+ throw new TypeError('option sameSite is invalid');
48950
+ }
48951
+ }
48952
+
48953
+ return str;
48954
+ }
48955
+
48956
+ /**
48957
+ * Try decoding a string using a decoding function.
48958
+ *
48959
+ * @param {string} str
48960
+ * @param {function} decode
48961
+ * @private
48962
+ */
48963
+
48964
+ function tryDecode(str, decode) {
48965
+ try {
48966
+ return decode(str);
48967
+ } catch (e) {
48968
+ return str;
48969
+ }
48970
+ }
48971
+
48972
+
48955
48973
  /***/ }),
48956
48974
 
48957
48975
  /***/ "../../node_modules/url/url.js":
@@ -61917,7 +61935,7 @@ function () {
61917
61935
  * Delete the current authenticated user
61918
61936
  * @return {Promise}
61919
61937
  **/
61920
- //TODO: Check return type void
61938
+ // TODO: Check return type void
61921
61939
 
61922
61940
 
61923
61941
  AuthClass.prototype.deleteUser = function () {
@@ -68825,7 +68843,7 @@ function () {
68825
68843
  function HubClass(name) {
68826
68844
  this.listeners = [];
68827
68845
  this.patterns = [];
68828
- this.protectedChannels = ['core', 'auth', 'api', 'analytics', 'interactions', 'pubsub', 'storage', 'xr'];
68846
+ this.protectedChannels = ['core', 'auth', 'api', 'analytics', 'interactions', 'pubsub', 'storage', 'ui', 'xr'];
68829
68847
  this.name = name;
68830
68848
  } // Note - Need to pass channel as a reference for removal to work and not anonymous function
68831
68849
 
@@ -69773,6 +69791,7 @@ var LOG_LEVELS = {
69773
69791
  WARN: 4,
69774
69792
  ERROR: 5
69775
69793
  };
69794
+ var COMPATIBLE_PLUGINS = [_Util_Constants__WEBPACK_IMPORTED_MODULE_0__["AWS_CLOUDWATCH_CATEGORY"]];
69776
69795
  var LOG_TYPE;
69777
69796
 
69778
69797
  (function (LOG_TYPE) {
@@ -69782,12 +69801,13 @@ var LOG_TYPE;
69782
69801
  LOG_TYPE["WARN"] = "WARN";
69783
69802
  LOG_TYPE["VERBOSE"] = "VERBOSE";
69784
69803
  })(LOG_TYPE || (LOG_TYPE = {}));
69804
+
69805
+ var cloudWatchExcludeList = ['AWSCloudWatch', 'Amplify', 'Credentials', 'AuthClass', 'CloudLogger'];
69785
69806
  /**
69786
69807
  * Write logs
69787
69808
  * @class Logger
69788
69809
  */
69789
69810
 
69790
-
69791
69811
  var ConsoleLogger =
69792
69812
  /** @class */
69793
69813
  function () {
@@ -69803,8 +69823,19 @@ function () {
69803
69823
  this.name = name;
69804
69824
  this.level = level;
69805
69825
  this._pluggables = [];
69826
+ this.addPluggable = this.addPluggable.bind(this);
69806
69827
  }
69807
69828
 
69829
+ ConsoleLogger.globalPluggables = function (pluggable) {
69830
+ if (pluggable && COMPATIBLE_PLUGINS.includes(pluggable.getCategoryName())) {
69831
+ ConsoleLogger._globalpluggables.push(pluggable);
69832
+ }
69833
+ };
69834
+
69835
+ ConsoleLogger.clearGlobalPluggables = function () {
69836
+ ConsoleLogger._globalpluggables = [];
69837
+ };
69838
+
69808
69839
  ConsoleLogger.prototype._padding = function (n) {
69809
69840
  return n < 10 ? '0' + n : '' + n;
69810
69841
  };
@@ -69819,6 +69850,20 @@ function () {
69819
69850
  this._config = config;
69820
69851
  return this._config;
69821
69852
  };
69853
+
69854
+ ConsoleLogger.prototype._checkPluggables = function () {
69855
+ if (this._pluggables.length !== ConsoleLogger._globalpluggables.length) {
69856
+ if (ConsoleLogger._globalpluggables.length > 0) {
69857
+ ConsoleLogger._globalpluggables.forEach(this.addPluggable);
69858
+
69859
+ return;
69860
+ }
69861
+
69862
+ if (ConsoleLogger._globalpluggables.length === 0) {
69863
+ this._pluggables = [];
69864
+ }
69865
+ }
69866
+ };
69822
69867
  /**
69823
69868
  * Write log
69824
69869
  * @method
@@ -69831,12 +69876,49 @@ function () {
69831
69876
  ConsoleLogger.prototype._log = function (type) {
69832
69877
  var e_1, _a;
69833
69878
 
69879
+ var _this = this;
69880
+
69834
69881
  var msg = [];
69835
69882
 
69836
69883
  for (var _i = 1; _i < arguments.length; _i++) {
69837
69884
  msg[_i - 1] = arguments[_i];
69838
69885
  }
69839
69886
 
69887
+ if (!cloudWatchExcludeList.includes(this.name)) {
69888
+ this._checkPluggables();
69889
+ }
69890
+
69891
+ var generateMessage = function generateMessage(msg) {};
69892
+
69893
+ var generateCloudMessage = function generateCloudMessage(msg) {
69894
+ var message = '';
69895
+ var data;
69896
+
69897
+ if (msg.length === 1 && typeof msg[0] === 'string') {
69898
+ message = msg[0];
69899
+ } else if (msg.length === 1) {
69900
+ data = msg[0];
69901
+ } else if (typeof msg[0] === 'string') {
69902
+ var obj = msg.slice(1);
69903
+
69904
+ if (obj.length === 1) {
69905
+ obj = obj[0];
69906
+ }
69907
+
69908
+ message = msg[0];
69909
+ data = obj;
69910
+ } else {
69911
+ data = msg;
69912
+ }
69913
+
69914
+ return JSON.stringify({
69915
+ level: type,
69916
+ "class": _this.name,
69917
+ message: message,
69918
+ data: data
69919
+ });
69920
+ };
69921
+
69840
69922
  var logger_level_name = this.level;
69841
69923
 
69842
69924
  if (ConsoleLogger.LOG_LEVEL) {
@@ -69850,62 +69932,72 @@ function () {
69850
69932
  var logger_level = LOG_LEVELS[logger_level_name];
69851
69933
  var type_level = LOG_LEVELS[type];
69852
69934
 
69853
- if (!(type_level >= logger_level)) {
69854
- // Do nothing if type is not greater than or equal to logger level (handle undefined)
69855
- return;
69856
- }
69935
+ if (type_level >= logger_level) {
69936
+ var log = console.log.bind(console);
69857
69937
 
69858
- var log = console.log.bind(console);
69938
+ if (type === LOG_TYPE.ERROR && console.error) {
69939
+ log = console.error.bind(console);
69940
+ }
69859
69941
 
69860
- if (type === LOG_TYPE.ERROR && console.error) {
69861
- log = console.error.bind(console);
69862
- }
69942
+ if (type === LOG_TYPE.WARN && console.warn) {
69943
+ log = console.warn.bind(console);
69944
+ }
69863
69945
 
69864
- if (type === LOG_TYPE.WARN && console.warn) {
69865
- log = console.warn.bind(console);
69866
- }
69946
+ var prefix = "[" + type + "] " + this._ts() + " " + this.name;
69947
+ var message = '';
69948
+ var data = void 0;
69867
69949
 
69868
- var prefix = "[" + type + "] " + this._ts() + " " + this.name;
69869
- var message = '';
69950
+ if (msg.length === 1 && typeof msg[0] === 'string') {
69951
+ message = msg[0];
69952
+ log(prefix + " - " + message);
69953
+ } else if (msg.length === 1) {
69954
+ data = msg[0];
69955
+ log(prefix, data);
69956
+ } else if (typeof msg[0] === 'string') {
69957
+ var obj = msg.slice(1);
69870
69958
 
69871
- if (msg.length === 1 && typeof msg[0] === 'string') {
69872
- message = prefix + " - " + msg[0];
69873
- log(message);
69874
- } else if (msg.length === 1) {
69875
- message = prefix + " " + msg[0];
69876
- log(prefix, msg[0]);
69877
- } else if (typeof msg[0] === 'string') {
69878
- var obj = msg.slice(1);
69959
+ if (obj.length === 1) {
69960
+ obj = obj[0];
69961
+ }
69879
69962
 
69880
- if (obj.length === 1) {
69881
- obj = obj[0];
69963
+ message = msg[0];
69964
+ data = obj;
69965
+ log(prefix + " - " + message, data);
69966
+ } else {
69967
+ data = msg;
69968
+ log(prefix, data);
69882
69969
  }
69883
-
69884
- message = prefix + " - " + msg[0] + " " + obj;
69885
- log(prefix + " - " + msg[0], obj);
69886
- } else {
69887
- message = prefix + " " + msg;
69888
- log(prefix, msg);
69889
69970
  }
69890
69971
 
69891
- try {
69892
- for (var _b = __values(this._pluggables), _c = _b.next(); !_c.done; _c = _b.next()) {
69893
- var plugin = _c.value;
69894
- var logEvent = {
69895
- message: message,
69896
- timestamp: Date.now()
69897
- };
69898
- plugin.pushLogs([logEvent]);
69899
- }
69900
- } catch (e_1_1) {
69901
- e_1 = {
69902
- error: e_1_1
69903
- };
69904
- } finally {
69972
+ if (ConsoleLogger.CLOUD_LOG_LEVEL != null && !cloudWatchExcludeList.includes(this.name)) {
69973
+ var cloudMessage = generateCloudMessage(msg);
69974
+
69905
69975
  try {
69906
- if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
69976
+ for (var _b = __values(this._pluggables), _c = _b.next(); !_c.done; _c = _b.next()) {
69977
+ var plugin = _c.value;
69978
+ var logger_level_1 = LOG_LEVELS[ConsoleLogger.CLOUD_LOG_LEVEL];
69979
+ var type_level_1 = LOG_LEVELS[type];
69980
+ var logEvent = {
69981
+ message: cloudMessage,
69982
+ timestamp: Date.now()
69983
+ };
69984
+
69985
+ if (type_level_1 >= logger_level_1) {
69986
+ plugin.pushLogs([logEvent]);
69987
+ } else {
69988
+ plugin.pushLogs([]);
69989
+ }
69990
+ }
69991
+ } catch (e_1_1) {
69992
+ e_1 = {
69993
+ error: e_1_1
69994
+ };
69907
69995
  } finally {
69908
- if (e_1) throw e_1.error;
69996
+ try {
69997
+ if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
69998
+ } finally {
69999
+ if (e_1) throw e_1.error;
70000
+ }
69909
70001
  }
69910
70002
  }
69911
70003
  };
@@ -70013,10 +70105,8 @@ function () {
70013
70105
  };
70014
70106
 
70015
70107
  ConsoleLogger.prototype.addPluggable = function (pluggable) {
70016
- if (pluggable && pluggable.getCategoryName() === _Util_Constants__WEBPACK_IMPORTED_MODULE_0__["AWS_CLOUDWATCH_CATEGORY"]) {
70108
+ if (pluggable && COMPATIBLE_PLUGINS.includes(pluggable.getCategoryName())) {
70017
70109
  this._pluggables.push(pluggable);
70018
-
70019
- pluggable.configure(this._config);
70020
70110
  }
70021
70111
  };
70022
70112
 
@@ -70024,7 +70114,9 @@ function () {
70024
70114
  return this._pluggables;
70025
70115
  };
70026
70116
 
70117
+ ConsoleLogger._globalpluggables = [];
70027
70118
  ConsoleLogger.LOG_LEVEL = null;
70119
+ ConsoleLogger.CLOUD_LOG_LEVEL = null;
70028
70120
  return ConsoleLogger;
70029
70121
  }();
70030
70122
 
@@ -70852,7 +70944,7 @@ var getAmplifyUserAgent = function getAmplifyUserAgent() {
70852
70944
  __webpack_require__.r(__webpack_exports__);
70853
70945
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
70854
70946
  // generated by genversion
70855
- var version = '4.3.13';
70947
+ var version = '4.3.14';
70856
70948
 
70857
70949
  /***/ }),
70858
70950
 
@@ -70872,6 +70964,15 @@ __webpack_require__.r(__webpack_exports__);
70872
70964
  /* harmony import */ var _Platform__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Platform */ "../core/lib-esm/Platform/index.js");
70873
70965
  /* harmony import */ var _Parser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Parser */ "../core/lib-esm/Parser.js");
70874
70966
  /* harmony import */ var _Util_Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Util/Constants */ "../core/lib-esm/Util/Constants.js");
70967
+ function _typeof(obj) {
70968
+ "@babel/helpers - typeof";
70969
+
70970
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
70971
+ return typeof obj;
70972
+ } : function (obj) {
70973
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
70974
+ }, _typeof(obj);
70975
+ }
70875
70976
  /*
70876
70977
  * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
70877
70978
  *
@@ -70884,6 +70985,8 @@ __webpack_require__.r(__webpack_exports__);
70884
70985
  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
70885
70986
  * and limitations under the License.
70886
70987
  */
70988
+
70989
+
70887
70990
  var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
70888
70991
  function adopt(value) {
70889
70992
  return value instanceof P ? value : new P(function (resolve) {
@@ -71027,62 +71130,44 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
71027
71130
  }
71028
71131
  };
71029
71132
 
71030
- var __read = undefined && undefined.__read || function (o, n) {
71031
- var m = typeof Symbol === "function" && o[Symbol.iterator];
71032
- if (!m) return o;
71033
- var i = m.call(o),
71034
- r,
71035
- ar = [],
71036
- e;
71037
-
71038
- try {
71039
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
71040
- ar.push(r.value);
71041
- }
71042
- } catch (error) {
71043
- e = {
71044
- error: error
71045
- };
71046
- } finally {
71047
- try {
71048
- if (r && !r.done && (m = i["return"])) m.call(i);
71049
- } finally {
71050
- if (e) throw e.error;
71051
- }
71052
- }
71053
-
71054
- return ar;
71055
- };
71056
-
71057
- var __spread = undefined && undefined.__spread || function () {
71058
- for (var ar = [], i = 0; i < arguments.length; i++) {
71059
- ar = ar.concat(__read(arguments[i]));
71060
- }
71061
71133
 
71062
- return ar;
71063
- };
71064
71134
 
71065
71135
 
71066
71136
 
71067
71137
 
71068
71138
 
71069
71139
 
71140
+ if (typeof window === 'undefined' || (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' && !window.TextEncoder) {
71141
+ __webpack_require__(/*! fast-text-encoding */ "../../node_modules/fast-text-encoding/text.min.js");
71142
+ }
71070
71143
 
71071
71144
  var logger = new _Logger__WEBPACK_IMPORTED_MODULE_2__["ConsoleLogger"]('AWSCloudWatch');
71145
+ var INTERVAL = 30000;
71072
71146
 
71073
71147
  var AWSCloudWatchProvider =
71074
71148
  /** @class */
71075
71149
  function () {
71076
71150
  function AWSCloudWatchProvider(config) {
71077
- this.configure(config);
71078
- this._dataTracker = {
71079
- eventUploadInProgress: false,
71080
- logEvents: []
71081
- };
71082
- this._currentLogBatch = [];
71151
+ this._initialized = false;
71152
+ console.log('cstr', config);
71153
+
71154
+ if (!this._initialized) {
71155
+ this.configure(config);
71156
+ this._dataTracker = {
71157
+ eventUploadInProgress: false,
71158
+ logEvents: [],
71159
+ verifiedLogGroup: {
71160
+ logGroupName: this._config.logGroupName
71161
+ }
71162
+ };
71163
+ this._currentLogBatch = [];
71164
+
71165
+ this._initiateLogPushInterval();
71166
+
71167
+ this._initialized = true;
71168
+ }
71169
+ } // public static instance: AWSCloudWatchProvider;
71083
71170
 
71084
- this._initiateLogPushInterval();
71085
- }
71086
71171
 
71087
71172
  AWSCloudWatchProvider.prototype.getProviderName = function () {
71088
71173
  return AWSCloudWatchProvider.PROVIDER_NAME;
@@ -71096,6 +71181,12 @@ function () {
71096
71181
  return this._dataTracker.logEvents;
71097
71182
  };
71098
71183
 
71184
+ AWSCloudWatchProvider.prototype.setPreFlightCheck = function (cb) {
71185
+ if (typeof cb === 'function') {
71186
+ this._preFlightCheck = cb;
71187
+ }
71188
+ };
71189
+
71099
71190
  AWSCloudWatchProvider.prototype.configure = function (config) {
71100
71191
  if (!config) return this._config || {};
71101
71192
  var conf = Object.assign({}, this._config, Object(_Parser__WEBPACK_IMPORTED_MODULE_4__["parseMobileHubConfig"])(config).Logging, config);
@@ -71349,8 +71440,27 @@ function () {
71349
71440
  };
71350
71441
 
71351
71442
  AWSCloudWatchProvider.prototype.pushLogs = function (logs) {
71352
- logger.debug('pushing log events to Cloudwatch...');
71353
- this._dataTracker.logEvents = __spread(this._dataTracker.logEvents, logs);
71443
+ logger.debug('pushing log events to Cloudwatch buffer');
71444
+ this._dataTracker.logEvents = this._dataTracker.logEvents.concat(logs);
71445
+ };
71446
+
71447
+ AWSCloudWatchProvider.prototype.pause = function () {
71448
+ this._processing = false;
71449
+
71450
+ if (this._timer) {
71451
+ clearInterval(this._timer);
71452
+ }
71453
+ };
71454
+
71455
+ AWSCloudWatchProvider.prototype.resume = function () {
71456
+ this._processing = true;
71457
+
71458
+ this._initiateLogPushInterval();
71459
+ };
71460
+
71461
+ AWSCloudWatchProvider.prototype.clear = function () {
71462
+ this._dataTracker.logEvents = [];
71463
+ this._currentLogBatch = [];
71354
71464
  };
71355
71465
 
71356
71466
  AWSCloudWatchProvider.prototype._validateLogGroupExistsAndCreate = function (logGroupName) {
@@ -71667,13 +71777,33 @@ function () {
71667
71777
  return __generator(this, function (_a) {
71668
71778
  switch (_a.label) {
71669
71779
  case 0:
71670
- _a.trys.push([0, 3,, 4]);
71780
+ _a.trys.push([0, 4,, 5]);
71671
71781
 
71672
71782
  return [4
71673
71783
  /*yield*/
71674
- , this._getNextSequenceToken()];
71784
+ , this._preFlightCheck()];
71675
71785
 
71676
71786
  case 1:
71787
+ /**
71788
+ * CloudWatch has restrictions on the size of the log events that get sent up.
71789
+ * We need to track both the size of each event and the total size of the batch
71790
+ * of logs.
71791
+ *
71792
+ * We also need to ensure that the logs in the batch are sorted in chronological order.
71793
+ * https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html
71794
+ */
71795
+ if (!_a.sent()) {
71796
+ this.clear();
71797
+ return [2
71798
+ /*return*/
71799
+ ];
71800
+ }
71801
+
71802
+ return [4
71803
+ /*yield*/
71804
+ , this._getNextSequenceToken()];
71805
+
71806
+ case 2:
71677
71807
  seqToken = _a.sent();
71678
71808
  logBatch = this._currentLogBatch.length === 0 ? this._getBufferedBatchOfLogs() : this._currentLogBatch;
71679
71809
  putLogsPayload = {
@@ -71687,7 +71817,7 @@ function () {
71687
71817
  /*yield*/
71688
71818
  , this._sendLogEvents(putLogsPayload)];
71689
71819
 
71690
- case 2:
71820
+ case 3:
71691
71821
  sendLogEventsResponse = _a.sent();
71692
71822
  this._nextSequenceToken = sendLogEventsResponse.nextSequenceToken;
71693
71823
  this._dataTracker.eventUploadInProgress = false;
@@ -71696,7 +71826,7 @@ function () {
71696
71826
  /*return*/
71697
71827
  , sendLogEventsResponse];
71698
71828
 
71699
- case 3:
71829
+ case 4:
71700
71830
  err_5 = _a.sent();
71701
71831
  logger.error("error during _safeUploadLogEvents: " + err_5);
71702
71832
 
@@ -71713,9 +71843,9 @@ function () {
71713
71843
 
71714
71844
  return [3
71715
71845
  /*break*/
71716
- , 4];
71846
+ , 5];
71717
71847
 
71718
- case 4:
71848
+ case 5:
71719
71849
  return [2
71720
71850
  /*return*/
71721
71851
  ];
@@ -71834,6 +71964,7 @@ function () {
71834
71964
  case 3:
71835
71965
  err_7 = _a.sent();
71836
71966
  logger.error("error when calling _safeUploadLogEvents in the timer interval - " + err_7);
71967
+ this.pause();
71837
71968
  return [3
71838
71969
  /*break*/
71839
71970
  , 4];
@@ -71845,7 +71976,7 @@ function () {
71845
71976
  }
71846
71977
  });
71847
71978
  });
71848
- }, 2000);
71979
+ }, INTERVAL);
71849
71980
  };
71850
71981
 
71851
71982
  AWSCloudWatchProvider.prototype._getDocUploadPermissibility = function () {
@@ -72877,7 +73008,7 @@ function () {
72877
73008
  /*!*****************************************!*\
72878
73009
  !*** ../core/lib-esm/Util/Constants.js ***!
72879
73010
  \*****************************************/
72880
- /*! 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 */
73011
+ /*! 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, AMAZON_KINESIS_LOGGING_PROVIDER_NAME, AMAZON_KINESIS_LOGGING_CATEGORY */
72881
73012
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
72882
73013
 
72883
73014
  "use strict";
@@ -72889,6 +73020,8 @@ __webpack_require__.r(__webpack_exports__);
72889
73020
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWS_CLOUDWATCH_PROVIDER_NAME", function() { return AWS_CLOUDWATCH_PROVIDER_NAME; });
72890
73021
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NO_CREDS_ERROR_STRING", function() { return NO_CREDS_ERROR_STRING; });
72891
73022
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return RETRY_ERROR_CODES; });
73023
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AMAZON_KINESIS_LOGGING_PROVIDER_NAME", function() { return AMAZON_KINESIS_LOGGING_PROVIDER_NAME; });
73024
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AMAZON_KINESIS_LOGGING_CATEGORY", function() { return AMAZON_KINESIS_LOGGING_CATEGORY; });
72892
73025
  /*
72893
73026
  * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
72894
73027
  *
@@ -72902,11 +73035,14 @@ __webpack_require__.r(__webpack_exports__);
72902
73035
  * and limitations under the License.
72903
73036
  */
72904
73037
  // Logging constants
73038
+ // Cloudwatch
72905
73039
  var AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;
72906
73040
  var AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE = 1048576;
72907
73041
  var AWS_CLOUDWATCH_MAX_EVENT_SIZE = 256000;
72908
73042
  var AWS_CLOUDWATCH_CATEGORY = 'Logging';
72909
73043
  var AWS_CLOUDWATCH_PROVIDER_NAME = 'AWSCloudWatch';
73044
+ var AMAZON_KINESIS_LOGGING_CATEGORY = 'KinesisLogging';
73045
+ var AMAZON_KINESIS_LOGGING_PROVIDER_NAME = 'AmazonKinesisLogging';
72910
73046
  var NO_CREDS_ERROR_STRING = 'No credentials';
72911
73047
  var RETRY_ERROR_CODES = ['ResourceNotFoundException', 'InvalidSequenceTokenException'];
72912
73048
 
@@ -73609,7 +73745,7 @@ function urlSafeDecode(hex) {
73609
73745
  /*!*************************************!*\
73610
73746
  !*** ../core/lib-esm/Util/index.js ***!
73611
73747
  \*************************************/
73612
- /*! 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 */
73748
+ /*! 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, AMAZON_KINESIS_LOGGING_PROVIDER_NAME, AMAZON_KINESIS_LOGGING_CATEGORY */
73613
73749
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
73614
73750
 
73615
73751
  "use strict";
@@ -73650,6 +73786,10 @@ __webpack_require__.r(__webpack_exports__);
73650
73786
 
73651
73787
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["RETRY_ERROR_CODES"]; });
73652
73788
 
73789
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AMAZON_KINESIS_LOGGING_PROVIDER_NAME", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["AMAZON_KINESIS_LOGGING_PROVIDER_NAME"]; });
73790
+
73791
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AMAZON_KINESIS_LOGGING_CATEGORY", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["AMAZON_KINESIS_LOGGING_CATEGORY"]; });
73792
+
73653
73793
 
73654
73794
 
73655
73795
 
@@ -73699,7 +73839,7 @@ var USER_AGENT_HEADER = 'x-amz-user-agent';
73699
73839
  /*!********************************!*\
73700
73840
  !*** ../core/lib-esm/index.js ***!
73701
73841
  \********************************/
73702
- /*! 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 */
73842
+ /*! 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, AMAZON_KINESIS_LOGGING_PROVIDER_NAME, AMAZON_KINESIS_LOGGING_CATEGORY, Amplify, default */
73703
73843
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
73704
73844
 
73705
73845
  "use strict";
@@ -73838,6 +73978,10 @@ __webpack_require__.r(__webpack_exports__);
73838
73978
 
73839
73979
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["RETRY_ERROR_CODES"]; });
73840
73980
 
73981
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AMAZON_KINESIS_LOGGING_PROVIDER_NAME", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["AMAZON_KINESIS_LOGGING_PROVIDER_NAME"]; });
73982
+
73983
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AMAZON_KINESIS_LOGGING_CATEGORY", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["AMAZON_KINESIS_LOGGING_CATEGORY"]; });
73984
+
73841
73985
  /*
73842
73986
  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
73843
73987
  *
@@ -82285,26 +82429,34 @@ function () {
82285
82429
  case 4:
82286
82430
  _b.sent();
82287
82431
 
82432
+ logger.debug('Debug info before sync');
82288
82433
  return [4
82289
82434
  /*yield*/
82290
- , checkSchemaVersion(this.storage, schema.version)];
82435
+ , this.storage.logDebugInfo()];
82291
82436
 
82292
82437
  case 5:
82293
82438
  _b.sent();
82294
82439
 
82440
+ return [4
82441
+ /*yield*/
82442
+ , checkSchemaVersion(this.storage, schema.version)];
82443
+
82444
+ case 6:
82445
+ _b.sent();
82446
+
82295
82447
  aws_appsync_graphqlEndpoint = this.amplifyConfig.aws_appsync_graphqlEndpoint;
82296
82448
  if (!aws_appsync_graphqlEndpoint) return [3
82297
82449
  /*break*/
82298
- , 7];
82450
+ , 8];
82299
82451
  logger.debug('GraphQL endpoint available', aws_appsync_graphqlEndpoint);
82300
82452
  _a = this;
82301
82453
  return [4
82302
82454
  /*yield*/
82303
82455
  , this.processSyncExpressions()];
82304
82456
 
82305
- case 6:
82457
+ case 7:
82306
82458
  _a.syncPredicates = _b.sent();
82307
- this.sync = new _sync__WEBPACK_IMPORTED_MODULE_7__["SyncEngine"](schema, namespaceResolver, syncClasses, userClasses, this.storage, modelInstanceCreator, this.maxRecordsToSync, this.syncPageSize, this.conflictHandler, this.errorHandler, this.syncPredicates, this.amplifyConfig, this.authModeStrategy);
82459
+ this.sync = new _sync__WEBPACK_IMPORTED_MODULE_7__["SyncEngine"](schema, namespaceResolver, syncClasses, userClasses, this.storage, modelInstanceCreator, this.conflictHandler, this.errorHandler, this.syncPredicates, this.amplifyConfig, this.authModeStrategy);
82308
82460
  fullSyncIntervalInMilliseconds = this.fullSyncInterval * 1000 * 60;
82309
82461
  syncSubscription = this.sync.start({
82310
82462
  fullSyncInterval: fullSyncIntervalInMilliseconds
@@ -82320,6 +82472,16 @@ function () {
82320
82472
  _this.initResolve();
82321
82473
  }
82322
82474
 
82475
+ if (type === _sync__WEBPACK_IMPORTED_MODULE_7__["ControlMessage"].SYNC_ENGINE_SYNC_QUERIES_READY) {
82476
+ logger.debug('Debug info after sync');
82477
+
82478
+ _this.storage.logDebugInfo();
82479
+ }
82480
+
82481
+ logger.debug({
82482
+ event: type,
82483
+ data: data
82484
+ });
82323
82485
  _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Hub"].dispatch('datastore', {
82324
82486
  event: type,
82325
82487
  data: data
@@ -82333,21 +82495,21 @@ function () {
82333
82495
  });
82334
82496
  return [3
82335
82497
  /*break*/
82336
- , 8];
82498
+ , 9];
82337
82499
 
82338
- case 7:
82500
+ case 8:
82339
82501
  logger.warn("Data won't be synchronized. No GraphQL endpoint configured. Did you forget `Amplify.configure(awsconfig)`?", {
82340
82502
  config: this.amplifyConfig
82341
82503
  });
82342
82504
  this.initResolve();
82343
- _b.label = 8;
82505
+ _b.label = 9;
82344
82506
 
82345
- case 8:
82507
+ case 9:
82346
82508
  return [4
82347
82509
  /*yield*/
82348
82510
  , this.initialized];
82349
82511
 
82350
- case 9:
82512
+ case 10:
82351
82513
  _b.sent();
82352
82514
 
82353
82515
  return [2
@@ -82912,16 +83074,16 @@ function () {
82912
83074
 
82913
83075
 
82914
83076
  _this.amplifyConfig.authProviders = configDataStore && configDataStore.authProviders || configAuthProviders;
82915
- _this.syncExpressions = configDataStore && configDataStore.syncExpressions || _this.syncExpressions || configSyncExpressions;
82916
- _this.maxRecordsToSync = configDataStore && configDataStore.maxRecordsToSync || configMaxRecordsToSync || 10000; // store on config object, so that Sync, Subscription, and Mutation processors can have access
83077
+ _this.syncExpressions = configDataStore && configDataStore.syncExpressions || configSyncExpressions || _this.syncExpressions;
83078
+ _this.maxRecordsToSync = configDataStore && configDataStore.maxRecordsToSync || configMaxRecordsToSync || _this.maxRecordsToSync || 10000; // store on config object, so that Sync, Subscription, and Mutation processors can have access
82917
83079
 
82918
83080
  _this.amplifyConfig.maxRecordsToSync = _this.maxRecordsToSync;
82919
- _this.syncPageSize = configDataStore && configDataStore.syncPageSize || configSyncPageSize || 1000; // store on config object, so that Sync, Subscription, and Mutation processors can have access
83081
+ _this.syncPageSize = configDataStore && configDataStore.syncPageSize || configSyncPageSize || _this.syncPageSize || 1000; // store on config object, so that Sync, Subscription, and Mutation processors can have access
82920
83082
 
82921
83083
  _this.amplifyConfig.syncPageSize = _this.syncPageSize;
82922
- _this.fullSyncInterval = configDataStore && configDataStore.fullSyncInterval || _this.fullSyncInterval || configFullSyncInterval || 24 * 60; // 1 day
83084
+ _this.fullSyncInterval = configDataStore && configDataStore.fullSyncInterval || configFullSyncInterval || _this.fullSyncInterval || 24 * 60; // 1 day
82923
83085
 
82924
- _this.storageAdapter = configDataStore && configDataStore.storageAdapter || _this.storageAdapter || configStorageAdapter || undefined;
83086
+ _this.storageAdapter = configDataStore && configDataStore.storageAdapter || configStorageAdapter || _this.storageAdapter || undefined;
82925
83087
  _this.sessionId = _this.retrieveSessionId();
82926
83088
  };
82927
83089
 
@@ -89343,6 +89505,33 @@ function () {
89343
89505
  });
89344
89506
  };
89345
89507
 
89508
+ StorageClass.prototype.logDebugInfo = function () {
89509
+ return __awaiter(this, void 0, void 0, function () {
89510
+ var results;
89511
+ return __generator(this, function (_a) {
89512
+ switch (_a.label) {
89513
+ case 0:
89514
+ if (!(typeof this.adapter.getDebugInfo === 'function')) return [3
89515
+ /*break*/
89516
+ , 2];
89517
+ return [4
89518
+ /*yield*/
89519
+ , this.adapter.getDebugInfo()];
89520
+
89521
+ case 1:
89522
+ results = _a.sent();
89523
+ logger.debug('DB Debug Info', results);
89524
+ _a.label = 2;
89525
+
89526
+ case 2:
89527
+ return [2
89528
+ /*return*/
89529
+ ];
89530
+ }
89531
+ });
89532
+ });
89533
+ };
89534
+
89346
89535
  return StorageClass;
89347
89536
  }();
89348
89537
 
@@ -89448,6 +89637,18 @@ function () {
89448
89637
  return this.storage.batchSave(modelConstructor, items);
89449
89638
  };
89450
89639
 
89640
+ ExclusiveStorage.prototype.logDebugInfo = function () {
89641
+ return __awaiter(this, void 0, void 0, function () {
89642
+ return __generator(this, function (_a) {
89643
+ return [2
89644
+ /*return*/
89645
+ , this.runExclusive(function (storage) {
89646
+ return storage.logDebugInfo();
89647
+ })];
89648
+ });
89649
+ });
89650
+ };
89651
+
89451
89652
  ExclusiveStorage.prototype.init = function () {
89452
89653
  return __awaiter(this, void 0, void 0, function () {
89453
89654
  return __generator(this, function (_a) {
@@ -89836,7 +90037,7 @@ var ControlMessage;
89836
90037
  var SyncEngine =
89837
90038
  /** @class */
89838
90039
  function () {
89839
- function SyncEngine(schema, namespaceResolver, modelClasses, userModelClasses, storage, modelInstanceCreator, maxRecordsToSync, syncPageSize, conflictHandler, errorHandler, syncPredicates, amplifyConfig, authModeStrategy) {
90040
+ function SyncEngine(schema, namespaceResolver, modelClasses, userModelClasses, storage, modelInstanceCreator, conflictHandler, errorHandler, syncPredicates, amplifyConfig, authModeStrategy) {
89840
90041
  if (amplifyConfig === void 0) {
89841
90042
  amplifyConfig = {};
89842
90043
  }
@@ -89847,8 +90048,6 @@ function () {
89847
90048
  this.userModelClasses = userModelClasses;
89848
90049
  this.storage = storage;
89849
90050
  this.modelInstanceCreator = modelInstanceCreator;
89850
- this.maxRecordsToSync = maxRecordsToSync;
89851
- this.syncPageSize = syncPageSize;
89852
90051
  this.syncPredicates = syncPredicates;
89853
90052
  this.amplifyConfig = amplifyConfig;
89854
90053
  this.authModeStrategy = authModeStrategy;