@twilio/conversations 2.2.0-rc.12 → 2.2.0-rc.13

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.
@@ -34549,13 +34549,13 @@ this.Twilio.Conversations = (function (exports) {
34549
34549
  return;
34550
34550
  }
34551
34551
 
34552
- var headers = parseResponseHeaders(xhr.getAllResponseHeaders());
34552
+ var responseHeaders = parseResponseHeaders(xhr.getAllResponseHeaders());
34553
34553
  var body = extractBody(xhr);
34554
34554
 
34555
34555
  if (200 <= xhr.status && xhr.status < 300) {
34556
34556
  resolve({
34557
34557
  status: xhr.status,
34558
- headers: headers,
34558
+ headers: responseHeaders,
34559
34559
  body: body
34560
34560
  });
34561
34561
  } else {
@@ -34565,13 +34565,21 @@ this.Twilio.Conversations = (function (exports) {
34565
34565
  var bodyRepresentation;
34566
34566
 
34567
34567
  if (typeof body === "string") {
34568
- bodyRepresentation = body && body.split("\n", 2).length === 1 ? body : "";
34568
+ if (body && body.split("\n", 2).length === 1) bodyRepresentation = body;else {
34569
+ var _body$replace$split$f; // TODO: RTDSDK-3716: investigate why body is HTML string
34570
+
34571
+
34572
+ var errorInfo = (_body$replace$split$f = body.replace(/<.*?>/g, "").split(/\r\n/g).filter(function (str) {
34573
+ return str.length;
34574
+ })[0]) === null || _body$replace$split$f === void 0 ? void 0 : _body$replace$split$f.split(" ");
34575
+ bodyRepresentation = (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.length) > 2 ? errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.slice(1).join(" ") : "";
34576
+ }
34569
34577
  } else {
34570
34578
  bodyRepresentation = JSON.stringify(body);
34571
34579
  }
34572
34580
 
34573
34581
  var message = "".concat(xhr.status, ": [").concat(status, "] ").concat(bodyRepresentation);
34574
- reject(new TransportError(message, xhr.status, body, status, headers));
34582
+ reject(new TransportError(message, xhr.status, body, status, responseHeaders));
34575
34583
  }
34576
34584
  };
34577
34585
 
@@ -34842,7 +34850,7 @@ this.Twilio.Conversations = (function (exports) {
34842
34850
  return Network;
34843
34851
  }();
34844
34852
 
34845
- var version = "0.6.0-rc.9";
34853
+ var version = "0.6.0-rc.10";
34846
34854
 
34847
34855
  var _class;
34848
34856
 
@@ -41530,7 +41538,7 @@ this.Twilio.Conversations = (function (exports) {
41530
41538
  this.data = data.data || {};
41531
41539
  });
41532
41540
 
41533
- var version = "2.2.0-rc.12";
41541
+ var version = "2.2.0-rc.13";
41534
41542
 
41535
41543
  function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
41536
41544
 
@@ -41942,9 +41950,6 @@ this.Twilio.Conversations = (function (exports) {
41942
41950
 
41943
41951
  /**
41944
41952
  * Fired when the client has completed initialization successfully.
41945
- *
41946
- * Parameters:
41947
- * 1. object `data` - Optional info object provided with the event
41948
41953
  * @event
41949
41954
  */
41950
41955
 
@@ -43010,7 +43015,7 @@ this.Twilio.Conversations = (function (exports) {
43010
43015
  this._resolveEnsureReady();
43011
43016
 
43012
43017
  this.emit("stateChanged", "initialized");
43013
- this.emit("initialized", {});
43018
+ this.emit("initialized");
43014
43019
 
43015
43020
  case 34:
43016
43021
  case "end":