@aws-amplify/datastore 3.7.6 → 3.7.7-cloud-logging.10

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,6 +27859,238 @@ 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
+ \*****************************************************/
27866
+ /*! no static exports found */
27867
+ /***/ (function(module, exports, __webpack_require__) {
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
+
27895
+ /**
27896
+ * RegExp to match field-content in RFC 7230 sec 3.2
27897
+ *
27898
+ * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
27899
+ * field-vchar = VCHAR / obs-text
27900
+ * obs-text = %x80-FF
27901
+ */
27902
+
27903
+ var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
27904
+
27905
+ /**
27906
+ * Parse a cookie header.
27907
+ *
27908
+ * Parse the given cookie header string into an object
27909
+ * The object has the various cookies as keys(names) => values
27910
+ *
27911
+ * @param {string} str
27912
+ * @param {object} [options]
27913
+ * @return {object}
27914
+ * @public
27915
+ */
27916
+
27917
+ function parse(str, options) {
27918
+ if (typeof str !== 'string') {
27919
+ throw new TypeError('argument str must be a string');
27920
+ }
27921
+
27922
+ var obj = {}
27923
+ var opt = options || {};
27924
+ var pairs = str.split(';')
27925
+ var dec = opt.decode || decode;
27926
+
27927
+ for (var i = 0; i < pairs.length; i++) {
27928
+ var pair = pairs[i];
27929
+ var index = pair.indexOf('=')
27930
+
27931
+ // skip things that don't look like key=value
27932
+ if (index < 0) {
27933
+ continue;
27934
+ }
27935
+
27936
+ var key = pair.substring(0, index).trim()
27937
+
27938
+ // only assign once
27939
+ if (undefined == obj[key]) {
27940
+ var val = pair.substring(index + 1, pair.length).trim()
27941
+
27942
+ // quoted values
27943
+ if (val[0] === '"') {
27944
+ val = val.slice(1, -1)
27945
+ }
27946
+
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
+ }
28072
+
28073
+
28074
+ /***/ }),
28075
+
28076
+ /***/ "../../node_modules/fast-text-encoding/text.min.js":
28077
+ /*!********************************************************************!*\
28078
+ !*** /root/amplify-js/node_modules/fast-text-encoding/text.min.js ***!
28079
+ \********************************************************************/
28080
+ /*! no static exports found */
28081
+ /***/ (function(module, exports, __webpack_require__) {
28082
+
28083
+ /* 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"}));
28084
+ 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++]=
28085
+ (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,
28086
+ 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&
28087
+ 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.");
28088
+ 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);
28089
+
28090
+ /* 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))
28091
+
28092
+ /***/ }),
28093
+
27862
28094
  /***/ "../../node_modules/graphql/error/GraphQLError.mjs":
27863
28095
  /*!********************************************************************!*\
27864
28096
  !*** /root/amplify-js/node_modules/graphql/error/GraphQLError.mjs ***!
@@ -48564,7 +48796,7 @@ __webpack_require__.r(__webpack_exports__);
48564
48796
 
48565
48797
  "use strict";
48566
48798
  __webpack_require__.r(__webpack_exports__);
48567
- /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ "../../node_modules/universal-cookie/node_modules/cookie/index.js");
48799
+ /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ "../../node_modules/cookie/index.js");
48568
48800
  /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cookie__WEBPACK_IMPORTED_MODULE_0__);
48569
48801
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "../../node_modules/universal-cookie/es6/utils.js");
48570
48802
  var __assign = (undefined && undefined.__assign) || function () {
@@ -48681,7 +48913,7 @@ __webpack_require__.r(__webpack_exports__);
48681
48913
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseCookies", function() { return parseCookies; });
48682
48914
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isParsingCookie", function() { return isParsingCookie; });
48683
48915
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readCookie", function() { return readCookie; });
48684
- /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ "../../node_modules/universal-cookie/node_modules/cookie/index.js");
48916
+ /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ "../../node_modules/cookie/index.js");
48685
48917
  /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cookie__WEBPACK_IMPORTED_MODULE_0__);
48686
48918
 
48687
48919
  function hasDocumentCookie() {
@@ -48738,220 +48970,6 @@ function cleanupCookieValue(value) {
48738
48970
  }
48739
48971
 
48740
48972
 
48741
- /***/ }),
48742
-
48743
- /***/ "../../node_modules/universal-cookie/node_modules/cookie/index.js":
48744
- /*!***********************************************************************************!*\
48745
- !*** /root/amplify-js/node_modules/universal-cookie/node_modules/cookie/index.js ***!
48746
- \***********************************************************************************/
48747
- /*! no static exports found */
48748
- /***/ (function(module, exports, __webpack_require__) {
48749
-
48750
- "use strict";
48751
- /*!
48752
- * cookie
48753
- * Copyright(c) 2012-2014 Roman Shtylman
48754
- * Copyright(c) 2015 Douglas Christopher Wilson
48755
- * MIT Licensed
48756
- */
48757
-
48758
-
48759
-
48760
- /**
48761
- * Module exports.
48762
- * @public
48763
- */
48764
-
48765
- exports.parse = parse;
48766
- exports.serialize = serialize;
48767
-
48768
- /**
48769
- * Module variables.
48770
- * @private
48771
- */
48772
-
48773
- var decode = decodeURIComponent;
48774
- var encode = encodeURIComponent;
48775
-
48776
- /**
48777
- * RegExp to match field-content in RFC 7230 sec 3.2
48778
- *
48779
- * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
48780
- * field-vchar = VCHAR / obs-text
48781
- * obs-text = %x80-FF
48782
- */
48783
-
48784
- var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
48785
-
48786
- /**
48787
- * Parse a cookie header.
48788
- *
48789
- * Parse the given cookie header string into an object
48790
- * The object has the various cookies as keys(names) => values
48791
- *
48792
- * @param {string} str
48793
- * @param {object} [options]
48794
- * @return {object}
48795
- * @public
48796
- */
48797
-
48798
- function parse(str, options) {
48799
- if (typeof str !== 'string') {
48800
- throw new TypeError('argument str must be a string');
48801
- }
48802
-
48803
- var obj = {}
48804
- var opt = options || {};
48805
- var pairs = str.split(';')
48806
- var dec = opt.decode || decode;
48807
-
48808
- for (var i = 0; i < pairs.length; i++) {
48809
- var pair = pairs[i];
48810
- var index = pair.indexOf('=')
48811
-
48812
- // skip things that don't look like key=value
48813
- if (index < 0) {
48814
- continue;
48815
- }
48816
-
48817
- var key = pair.substring(0, index).trim()
48818
-
48819
- // only assign once
48820
- if (undefined == obj[key]) {
48821
- var val = pair.substring(index + 1, pair.length).trim()
48822
-
48823
- // quoted values
48824
- if (val[0] === '"') {
48825
- val = val.slice(1, -1)
48826
- }
48827
-
48828
- obj[key] = tryDecode(val, dec);
48829
- }
48830
- }
48831
-
48832
- return obj;
48833
- }
48834
-
48835
- /**
48836
- * Serialize data into a cookie header.
48837
- *
48838
- * Serialize the a name value pair into a cookie string suitable for
48839
- * http headers. An optional options object specified cookie parameters.
48840
- *
48841
- * serialize('foo', 'bar', { httpOnly: true })
48842
- * => "foo=bar; httpOnly"
48843
- *
48844
- * @param {string} name
48845
- * @param {string} val
48846
- * @param {object} [options]
48847
- * @return {string}
48848
- * @public
48849
- */
48850
-
48851
- function serialize(name, val, options) {
48852
- var opt = options || {};
48853
- var enc = opt.encode || encode;
48854
-
48855
- if (typeof enc !== 'function') {
48856
- throw new TypeError('option encode is invalid');
48857
- }
48858
-
48859
- if (!fieldContentRegExp.test(name)) {
48860
- throw new TypeError('argument name is invalid');
48861
- }
48862
-
48863
- var value = enc(val);
48864
-
48865
- if (value && !fieldContentRegExp.test(value)) {
48866
- throw new TypeError('argument val is invalid');
48867
- }
48868
-
48869
- var str = name + '=' + value;
48870
-
48871
- if (null != opt.maxAge) {
48872
- var maxAge = opt.maxAge - 0;
48873
-
48874
- if (isNaN(maxAge) || !isFinite(maxAge)) {
48875
- throw new TypeError('option maxAge is invalid')
48876
- }
48877
-
48878
- str += '; Max-Age=' + Math.floor(maxAge);
48879
- }
48880
-
48881
- if (opt.domain) {
48882
- if (!fieldContentRegExp.test(opt.domain)) {
48883
- throw new TypeError('option domain is invalid');
48884
- }
48885
-
48886
- str += '; Domain=' + opt.domain;
48887
- }
48888
-
48889
- if (opt.path) {
48890
- if (!fieldContentRegExp.test(opt.path)) {
48891
- throw new TypeError('option path is invalid');
48892
- }
48893
-
48894
- str += '; Path=' + opt.path;
48895
- }
48896
-
48897
- if (opt.expires) {
48898
- if (typeof opt.expires.toUTCString !== 'function') {
48899
- throw new TypeError('option expires is invalid');
48900
- }
48901
-
48902
- str += '; Expires=' + opt.expires.toUTCString();
48903
- }
48904
-
48905
- if (opt.httpOnly) {
48906
- str += '; HttpOnly';
48907
- }
48908
-
48909
- if (opt.secure) {
48910
- str += '; Secure';
48911
- }
48912
-
48913
- if (opt.sameSite) {
48914
- var sameSite = typeof opt.sameSite === 'string'
48915
- ? opt.sameSite.toLowerCase() : opt.sameSite;
48916
-
48917
- switch (sameSite) {
48918
- case true:
48919
- str += '; SameSite=Strict';
48920
- break;
48921
- case 'lax':
48922
- str += '; SameSite=Lax';
48923
- break;
48924
- case 'strict':
48925
- str += '; SameSite=Strict';
48926
- break;
48927
- case 'none':
48928
- str += '; SameSite=None';
48929
- break;
48930
- default:
48931
- throw new TypeError('option sameSite is invalid');
48932
- }
48933
- }
48934
-
48935
- return str;
48936
- }
48937
-
48938
- /**
48939
- * Try decoding a string using a decoding function.
48940
- *
48941
- * @param {string} str
48942
- * @param {function} decode
48943
- * @private
48944
- */
48945
-
48946
- function tryDecode(str, decode) {
48947
- try {
48948
- return decode(str);
48949
- } catch (e) {
48950
- return str;
48951
- }
48952
- }
48953
-
48954
-
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,61 +71130,42 @@ 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 = 10000;
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);
71083
71153
 
71084
- this._initiateLogPushInterval();
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
+ }
71085
71169
  }
71086
71170
 
71087
71171
  AWSCloudWatchProvider.prototype.getProviderName = function () {
@@ -71096,6 +71180,12 @@ function () {
71096
71180
  return this._dataTracker.logEvents;
71097
71181
  };
71098
71182
 
71183
+ AWSCloudWatchProvider.prototype.setPreFlightCheck = function (cb) {
71184
+ if (typeof cb === 'function') {
71185
+ this._preFlightCheck = cb;
71186
+ }
71187
+ };
71188
+
71099
71189
  AWSCloudWatchProvider.prototype.configure = function (config) {
71100
71190
  if (!config) return this._config || {};
71101
71191
  var conf = Object.assign({}, this._config, Object(_Parser__WEBPACK_IMPORTED_MODULE_4__["parseMobileHubConfig"])(config).Logging, config);
@@ -71349,8 +71439,27 @@ function () {
71349
71439
  };
71350
71440
 
71351
71441
  AWSCloudWatchProvider.prototype.pushLogs = function (logs) {
71352
- logger.debug('pushing log events to Cloudwatch...');
71353
- this._dataTracker.logEvents = __spread(this._dataTracker.logEvents, logs);
71442
+ logger.debug('pushing log events to buffer');
71443
+ this._dataTracker.logEvents = this._dataTracker.logEvents.concat(logs);
71444
+ };
71445
+
71446
+ AWSCloudWatchProvider.prototype.pause = function () {
71447
+ this._processing = false;
71448
+
71449
+ if (this._timer) {
71450
+ clearInterval(this._timer);
71451
+ }
71452
+ };
71453
+
71454
+ AWSCloudWatchProvider.prototype.resume = function () {
71455
+ this._processing = true;
71456
+
71457
+ this._initiateLogPushInterval();
71458
+ };
71459
+
71460
+ AWSCloudWatchProvider.prototype.clear = function () {
71461
+ this._dataTracker.logEvents = [];
71462
+ this._currentLogBatch = [];
71354
71463
  };
71355
71464
 
71356
71465
  AWSCloudWatchProvider.prototype._validateLogGroupExistsAndCreate = function (logGroupName) {
@@ -71667,13 +71776,33 @@ function () {
71667
71776
  return __generator(this, function (_a) {
71668
71777
  switch (_a.label) {
71669
71778
  case 0:
71670
- _a.trys.push([0, 3,, 4]);
71779
+ _a.trys.push([0, 4,, 5]);
71671
71780
 
71672
71781
  return [4
71673
71782
  /*yield*/
71674
- , this._getNextSequenceToken()];
71783
+ , this._preFlightCheck()];
71675
71784
 
71676
71785
  case 1:
71786
+ /**
71787
+ * CloudWatch has restrictions on the size of the log events that get sent up.
71788
+ * We need to track both the size of each event and the total size of the batch
71789
+ * of logs.
71790
+ *
71791
+ * We also need to ensure that the logs in the batch are sorted in chronological order.
71792
+ * https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html
71793
+ */
71794
+ if (!_a.sent()) {
71795
+ this.clear();
71796
+ return [2
71797
+ /*return*/
71798
+ ];
71799
+ }
71800
+
71801
+ return [4
71802
+ /*yield*/
71803
+ , this._getNextSequenceToken()];
71804
+
71805
+ case 2:
71677
71806
  seqToken = _a.sent();
71678
71807
  logBatch = this._currentLogBatch.length === 0 ? this._getBufferedBatchOfLogs() : this._currentLogBatch;
71679
71808
  putLogsPayload = {
@@ -71687,7 +71816,7 @@ function () {
71687
71816
  /*yield*/
71688
71817
  , this._sendLogEvents(putLogsPayload)];
71689
71818
 
71690
- case 2:
71819
+ case 3:
71691
71820
  sendLogEventsResponse = _a.sent();
71692
71821
  this._nextSequenceToken = sendLogEventsResponse.nextSequenceToken;
71693
71822
  this._dataTracker.eventUploadInProgress = false;
@@ -71696,7 +71825,7 @@ function () {
71696
71825
  /*return*/
71697
71826
  , sendLogEventsResponse];
71698
71827
 
71699
- case 3:
71828
+ case 4:
71700
71829
  err_5 = _a.sent();
71701
71830
  logger.error("error during _safeUploadLogEvents: " + err_5);
71702
71831
 
@@ -71713,9 +71842,9 @@ function () {
71713
71842
 
71714
71843
  return [3
71715
71844
  /*break*/
71716
- , 4];
71845
+ , 5];
71717
71846
 
71718
- case 4:
71847
+ case 5:
71719
71848
  return [2
71720
71849
  /*return*/
71721
71850
  ];
@@ -71724,6 +71853,41 @@ function () {
71724
71853
  });
71725
71854
  };
71726
71855
 
71856
+ AWSCloudWatchProvider.prototype.truncateOversizedEvent = function (event) {
71857
+ var timestamp = event.timestamp,
71858
+ message = event.message;
71859
+ var messageJson;
71860
+
71861
+ try {
71862
+ messageJson = JSON.parse(message);
71863
+ var truncated = JSON.stringify({
71864
+ level: messageJson.level,
71865
+ "class": messageJson["class"],
71866
+ message: messageJson.message.substring(0, 500)
71867
+ });
71868
+
71869
+ if (messageJson.data != null) {
71870
+ truncated['data'] = "OBJECT SIZE EXCEEDS CLOUDWATCH EVENT LIMIT. Truncated: " + JSON.stringify(messageJson.data).substring(0, 500);
71871
+ }
71872
+
71873
+ return {
71874
+ timestamp: timestamp,
71875
+ message: truncated
71876
+ };
71877
+ } catch (error) {
71878
+ logger.warn('Could not minify oversized event', error);
71879
+ var truncated = JSON.stringify({
71880
+ level: 'UNKNOWN',
71881
+ "class": 'Unknown',
71882
+ message: 'OBJECT SIZE EXCEEDS CLOUDWATCH EVENT LIMIT. Could not parse event to truncate'
71883
+ });
71884
+ return {
71885
+ timestamp: timestamp,
71886
+ message: truncated
71887
+ };
71888
+ }
71889
+ };
71890
+
71727
71891
  AWSCloudWatchProvider.prototype._getBufferedBatchOfLogs = function () {
71728
71892
  /**
71729
71893
  * CloudWatch has restrictions on the size of the log events that get sent up.
@@ -71743,7 +71907,9 @@ function () {
71743
71907
  if (eventSize > _Util_Constants__WEBPACK_IMPORTED_MODULE_5__["AWS_CLOUDWATCH_MAX_EVENT_SIZE"]) {
71744
71908
  var errString = "Log entry exceeds maximum size for CloudWatch logs. Log size: " + eventSize + ". Truncating log message.";
71745
71909
  logger.warn(errString);
71746
- currentEvent.message = currentEvent.message.substring(0, eventSize);
71910
+ currentEvent = this.truncateOversizedEvent(currentEvent);
71911
+ this._dataTracker.logEvents[currentEventIdx] = currentEvent;
71912
+ eventSize = new TextEncoder().encode(currentEvent.message).length + _Util_Constants__WEBPACK_IMPORTED_MODULE_5__["AWS_CLOUDWATCH_BASE_BUFFER_SIZE"];
71747
71913
  }
71748
71914
 
71749
71915
  if (totalByteSize + eventSize > _Util_Constants__WEBPACK_IMPORTED_MODULE_5__["AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE"]) break;
@@ -71834,6 +72000,7 @@ function () {
71834
72000
  case 3:
71835
72001
  err_7 = _a.sent();
71836
72002
  logger.error("error when calling _safeUploadLogEvents in the timer interval - " + err_7);
72003
+ this.pause();
71837
72004
  return [3
71838
72005
  /*break*/
71839
72006
  , 4];
@@ -71845,7 +72012,7 @@ function () {
71845
72012
  }
71846
72013
  });
71847
72014
  });
71848
- }, 2000);
72015
+ }, INTERVAL);
71849
72016
  };
71850
72017
 
71851
72018
  AWSCloudWatchProvider.prototype._getDocUploadPermissibility = function () {
@@ -72877,7 +73044,7 @@ function () {
72877
73044
  /*!*****************************************!*\
72878
73045
  !*** ../core/lib-esm/Util/Constants.js ***!
72879
73046
  \*****************************************/
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 */
73047
+ /*! 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
73048
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
72882
73049
 
72883
73050
  "use strict";
@@ -72889,6 +73056,8 @@ __webpack_require__.r(__webpack_exports__);
72889
73056
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWS_CLOUDWATCH_PROVIDER_NAME", function() { return AWS_CLOUDWATCH_PROVIDER_NAME; });
72890
73057
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NO_CREDS_ERROR_STRING", function() { return NO_CREDS_ERROR_STRING; });
72891
73058
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return RETRY_ERROR_CODES; });
73059
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AMAZON_KINESIS_LOGGING_PROVIDER_NAME", function() { return AMAZON_KINESIS_LOGGING_PROVIDER_NAME; });
73060
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AMAZON_KINESIS_LOGGING_CATEGORY", function() { return AMAZON_KINESIS_LOGGING_CATEGORY; });
72892
73061
  /*
72893
73062
  * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
72894
73063
  *
@@ -72902,11 +73071,14 @@ __webpack_require__.r(__webpack_exports__);
72902
73071
  * and limitations under the License.
72903
73072
  */
72904
73073
  // Logging constants
73074
+ // Cloudwatch
72905
73075
  var AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;
72906
73076
  var AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE = 1048576;
72907
73077
  var AWS_CLOUDWATCH_MAX_EVENT_SIZE = 256000;
72908
73078
  var AWS_CLOUDWATCH_CATEGORY = 'Logging';
72909
73079
  var AWS_CLOUDWATCH_PROVIDER_NAME = 'AWSCloudWatch';
73080
+ var AMAZON_KINESIS_LOGGING_CATEGORY = 'KinesisLogging';
73081
+ var AMAZON_KINESIS_LOGGING_PROVIDER_NAME = 'AmazonKinesisLogging';
72910
73082
  var NO_CREDS_ERROR_STRING = 'No credentials';
72911
73083
  var RETRY_ERROR_CODES = ['ResourceNotFoundException', 'InvalidSequenceTokenException'];
72912
73084
 
@@ -73609,7 +73781,7 @@ function urlSafeDecode(hex) {
73609
73781
  /*!*************************************!*\
73610
73782
  !*** ../core/lib-esm/Util/index.js ***!
73611
73783
  \*************************************/
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 */
73784
+ /*! 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
73785
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
73614
73786
 
73615
73787
  "use strict";
@@ -73650,6 +73822,10 @@ __webpack_require__.r(__webpack_exports__);
73650
73822
 
73651
73823
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["RETRY_ERROR_CODES"]; });
73652
73824
 
73825
+ /* 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"]; });
73826
+
73827
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AMAZON_KINESIS_LOGGING_CATEGORY", function() { return _Constants__WEBPACK_IMPORTED_MODULE_5__["AMAZON_KINESIS_LOGGING_CATEGORY"]; });
73828
+
73653
73829
 
73654
73830
 
73655
73831
 
@@ -73699,7 +73875,7 @@ var USER_AGENT_HEADER = 'x-amz-user-agent';
73699
73875
  /*!********************************!*\
73700
73876
  !*** ../core/lib-esm/index.js ***!
73701
73877
  \********************************/
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 */
73878
+ /*! 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
73879
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
73704
73880
 
73705
73881
  "use strict";
@@ -73838,6 +74014,10 @@ __webpack_require__.r(__webpack_exports__);
73838
74014
 
73839
74015
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RETRY_ERROR_CODES", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["RETRY_ERROR_CODES"]; });
73840
74016
 
74017
+ /* 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"]; });
74018
+
74019
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AMAZON_KINESIS_LOGGING_CATEGORY", function() { return _Util__WEBPACK_IMPORTED_MODULE_18__["AMAZON_KINESIS_LOGGING_CATEGORY"]; });
74020
+
73841
74021
  /*
73842
74022
  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
73843
74023
  *
@@ -82285,24 +82465,32 @@ function () {
82285
82465
  case 4:
82286
82466
  _b.sent();
82287
82467
 
82468
+ logger.debug('Debug info before sync');
82288
82469
  return [4
82289
82470
  /*yield*/
82290
- , checkSchemaVersion(this.storage, schema.version)];
82471
+ , this.storage.logDebugInfo()];
82291
82472
 
82292
82473
  case 5:
82293
82474
  _b.sent();
82294
82475
 
82476
+ return [4
82477
+ /*yield*/
82478
+ , checkSchemaVersion(this.storage, schema.version)];
82479
+
82480
+ case 6:
82481
+ _b.sent();
82482
+
82295
82483
  aws_appsync_graphqlEndpoint = this.amplifyConfig.aws_appsync_graphqlEndpoint;
82296
82484
  if (!aws_appsync_graphqlEndpoint) return [3
82297
82485
  /*break*/
82298
- , 7];
82486
+ , 8];
82299
82487
  logger.debug('GraphQL endpoint available', aws_appsync_graphqlEndpoint);
82300
82488
  _a = this;
82301
82489
  return [4
82302
82490
  /*yield*/
82303
82491
  , this.processSyncExpressions()];
82304
82492
 
82305
- case 6:
82493
+ case 7:
82306
82494
  _a.syncPredicates = _b.sent();
82307
82495
  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
82496
  fullSyncIntervalInMilliseconds = this.fullSyncInterval * 1000 * 60;
@@ -82320,6 +82508,16 @@ function () {
82320
82508
  _this.initResolve();
82321
82509
  }
82322
82510
 
82511
+ if (type === _sync__WEBPACK_IMPORTED_MODULE_7__["ControlMessage"].SYNC_ENGINE_SYNC_QUERIES_READY) {
82512
+ logger.debug('Debug info after sync');
82513
+
82514
+ _this.storage.logDebugInfo();
82515
+ }
82516
+
82517
+ logger.debug({
82518
+ event: type,
82519
+ data: data
82520
+ });
82323
82521
  _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Hub"].dispatch('datastore', {
82324
82522
  event: type,
82325
82523
  data: data
@@ -82333,21 +82531,21 @@ function () {
82333
82531
  });
82334
82532
  return [3
82335
82533
  /*break*/
82336
- , 8];
82534
+ , 9];
82337
82535
 
82338
- case 7:
82536
+ case 8:
82339
82537
  logger.warn("Data won't be synchronized. No GraphQL endpoint configured. Did you forget `Amplify.configure(awsconfig)`?", {
82340
82538
  config: this.amplifyConfig
82341
82539
  });
82342
82540
  this.initResolve();
82343
- _b.label = 8;
82541
+ _b.label = 9;
82344
82542
 
82345
- case 8:
82543
+ case 9:
82346
82544
  return [4
82347
82545
  /*yield*/
82348
82546
  , this.initialized];
82349
82547
 
82350
- case 9:
82548
+ case 10:
82351
82549
  _b.sent();
82352
82550
 
82353
82551
  return [2
@@ -89343,6 +89541,33 @@ function () {
89343
89541
  });
89344
89542
  };
89345
89543
 
89544
+ StorageClass.prototype.logDebugInfo = function () {
89545
+ return __awaiter(this, void 0, void 0, function () {
89546
+ var results;
89547
+ return __generator(this, function (_a) {
89548
+ switch (_a.label) {
89549
+ case 0:
89550
+ if (!(typeof this.adapter.getDebugInfo === 'function')) return [3
89551
+ /*break*/
89552
+ , 2];
89553
+ return [4
89554
+ /*yield*/
89555
+ , this.adapter.getDebugInfo()];
89556
+
89557
+ case 1:
89558
+ results = _a.sent();
89559
+ logger.debug('DB Debug Info', results);
89560
+ _a.label = 2;
89561
+
89562
+ case 2:
89563
+ return [2
89564
+ /*return*/
89565
+ ];
89566
+ }
89567
+ });
89568
+ });
89569
+ };
89570
+
89346
89571
  return StorageClass;
89347
89572
  }();
89348
89573
 
@@ -89448,6 +89673,18 @@ function () {
89448
89673
  return this.storage.batchSave(modelConstructor, items);
89449
89674
  };
89450
89675
 
89676
+ ExclusiveStorage.prototype.logDebugInfo = function () {
89677
+ return __awaiter(this, void 0, void 0, function () {
89678
+ return __generator(this, function (_a) {
89679
+ return [2
89680
+ /*return*/
89681
+ , this.runExclusive(function (storage) {
89682
+ return storage.logDebugInfo();
89683
+ })];
89684
+ });
89685
+ });
89686
+ };
89687
+
89451
89688
  ExclusiveStorage.prototype.init = function () {
89452
89689
  return __awaiter(this, void 0, void 0, function () {
89453
89690
  return __generator(this, function (_a) {