@twilio/conversations 2.6.0-rc.0 → 2.6.0

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.
@@ -150,10 +150,10 @@ import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';
150
150
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
151
151
  import _createClass from '@babel/runtime/helpers/esm/createClass';
152
152
  import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';
153
- import 'core-js/modules/es.object.to-string.js';
154
- import 'core-js/modules/es.promise.js';
155
153
  import 'core-js/modules/es.array.map.js';
154
+ import 'core-js/modules/es.object.to-string.js';
156
155
  import 'core-js/modules/web.dom-collections.for-each.js';
156
+ import 'core-js/modules/es.promise.js';
157
157
  import _regeneratorRuntime from '@babel/runtime/regenerator';
158
158
  import _typeof from '@babel/runtime/helpers/esm/typeof';
159
159
  import 'core-js/modules/es.array.concat.js';
@@ -8025,7 +8025,7 @@ function PushNotification(data) {
8025
8025
  this.data = data.data || {};
8026
8026
  });
8027
8027
 
8028
- var version = "2.6.0-rc.0";
8028
+ var version = "2.6.0";
8029
8029
 
8030
8030
  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; }
8031
8031
 
@@ -9546,6 +9546,8 @@ var Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter) {
9546
9546
  terminal: true,
9547
9547
  message: "Twilsock has disconnected."
9548
9548
  });
9549
+
9550
+ _this._initializeEnsureReady((options === null || options === void 0 ? void 0 : options.throwErrorsAlways) || false);
9549
9551
  };
9550
9552
 
9551
9553
  _this._services.twilsockClient.once("connectionError", emitFailed);
@@ -9603,12 +9605,7 @@ var Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter) {
9603
9605
  }, _callee, null, [[3, 11]]);
9604
9606
  })));
9605
9607
 
9606
- _this._ensureReady = new Promise(function (resolve, reject) {
9607
- _this._resolveEnsureReady = resolve;
9608
- _this._rejectEnsureReady = reject;
9609
- }).catch(function () {
9610
- return void 0;
9611
- }); // @todo How to process unhandled rejection here?
9608
+ _this._initializeEnsureReady((options === null || options === void 0 ? void 0 : options.throwErrorsAlways) || false);
9612
9609
 
9613
9610
  if (startTwilsock) {
9614
9611
  _this._services.twilsockClient.connect();
@@ -10501,6 +10498,26 @@ var Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter) {
10501
10498
  _this5._services.notificationClient.unsubscribe(channelType, messageType);
10502
10499
  });
10503
10500
  }
10501
+ /**
10502
+ * Initialize the ensureReady promise.
10503
+ */
10504
+
10505
+ }, {
10506
+ key: "_initializeEnsureReady",
10507
+ value: function _initializeEnsureReady(throwErrorsAlways) {
10508
+ var _this6 = this;
10509
+
10510
+ this._ensureReady = new Promise(function (resolve, reject) {
10511
+ _this6._resolveEnsureReady = resolve;
10512
+ _this6._rejectEnsureReady = reject;
10513
+ }).catch(function (error) {
10514
+ if (throwErrorsAlways) {
10515
+ throw error;
10516
+ } else {
10517
+ return void 0;
10518
+ }
10519
+ });
10520
+ }
10504
10521
  }], [{
10505
10522
  key: "create",
10506
10523
  value: function () {