@twilio/conversations 2.5.0-rc.0 → 2.5.0-rc.8

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.
package/builds/browser.js CHANGED
@@ -302,11 +302,13 @@ var Logger = /*#__PURE__*/function () {
302
302
  }, {
303
303
  key: "trace",
304
304
  value: function trace() {
305
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
306
- args[_key] = arguments[_key];
307
- }
305
+ if (log$7.getLevel() == log$7.levels.TRACE) {
306
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
307
+ args[_key] = arguments[_key];
308
+ }
308
309
 
309
- log$7.trace.apply(null, prepareLine(this.prefix + "T", args));
310
+ log$7.debug.apply(null, prepareLine(this.prefix + "T", args));
311
+ }
310
312
  }
311
313
  }, {
312
314
  key: "debug",
@@ -357,11 +359,13 @@ var Logger = /*#__PURE__*/function () {
357
359
  }, {
358
360
  key: "trace",
359
361
  value: function trace() {
360
- for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
361
- args[_key6] = arguments[_key6];
362
- }
362
+ if (log$7.getLevel() == log$7.levels.TRACE) {
363
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
364
+ args[_key6] = arguments[_key6];
365
+ }
363
366
 
364
- log$7.trace.apply(null, prepareLine("T", args));
367
+ log$7.debug.apply(null, prepareLine("T", args));
368
+ }
365
369
  }
366
370
  }, {
367
371
  key: "debug",
@@ -2462,14 +2466,15 @@ var RestPaginator = /*#__PURE__*/function () {
2462
2466
  /**
2463
2467
  * @internal
2464
2468
  */
2465
- function RestPaginator(items, source, prevToken, nextToken) {
2469
+ function RestPaginator(items, source, prevToken, nextToken, pageSize) {
2466
2470
  _classCallCheck__default["default"](this, RestPaginator);
2467
2471
 
2468
2472
  this.state = {
2469
2473
  prevToken: prevToken,
2470
2474
  nextToken: nextToken,
2471
2475
  source: source,
2472
- items: items
2476
+ items: items,
2477
+ pageSize: pageSize
2473
2478
  };
2474
2479
  }
2475
2480
  /**
@@ -2507,7 +2512,7 @@ var RestPaginator = /*#__PURE__*/function () {
2507
2512
  }, {
2508
2513
  key: "nextPage",
2509
2514
  value: function nextPage() {
2510
- return this.hasNextPage ? this.state.source(this.state.nextToken) : Promise.reject(new Error("No next page"));
2515
+ return this.hasNextPage ? this.state.source(this.state.nextToken, this.state.pageSize) : Promise.reject(new Error("No next page"));
2511
2516
  }
2512
2517
  /**
2513
2518
  * Request the previous page. Does not modify the existing object.
@@ -2516,7 +2521,7 @@ var RestPaginator = /*#__PURE__*/function () {
2516
2521
  }, {
2517
2522
  key: "prevPage",
2518
2523
  value: function prevPage() {
2519
- return this.hasPrevPage ? this.state.source(this.state.prevToken) : Promise.reject(new Error("No previous page"));
2524
+ return this.hasPrevPage ? this.state.source(this.state.prevToken, this.state.pageSize) : Promise.reject(new Error("No previous page"));
2520
2525
  }
2521
2526
  }]);
2522
2527
 
@@ -3608,7 +3613,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
3608
3613
  pageToken: pageToken,
3609
3614
  pageSize: pageSize
3610
3615
  });
3611
- }, response.body.meta.previous_token, response.body.meta.next_token));
3616
+ }, response.body.meta.previous_token, response.body.meta.next_token, options === null || options === void 0 ? void 0 : options.pageSize));
3612
3617
 
3613
3618
  case 6:
3614
3619
  case "end":
@@ -6044,18 +6049,19 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
6044
6049
  }()
6045
6050
  /**
6046
6051
  * Get recipients of all messages in the conversation.
6052
+ * @param options Optional configuration, set pageSize to request a specific pagination page size. Page size specifies a number of messages to include in a single batch. Each message may include multiple recipients.
6047
6053
  */
6048
6054
 
6049
6055
  }, {
6050
6056
  key: "getMessageRecipients",
6051
6057
  value: function () {
6052
- var _getMessageRecipients = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee24() {
6058
+ var _getMessageRecipients = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee24(options) {
6053
6059
  return _regeneratorRuntime__default["default"].wrap(function _callee24$(_context24) {
6054
6060
  while (1) {
6055
6061
  switch (_context24.prev = _context24.next) {
6056
6062
  case 0:
6057
6063
  _context24.next = 2;
6058
- return this._services.messageRecipientsClient.getRecipientsFromConversation(this.sid);
6064
+ return this._services.messageRecipientsClient.getRecipientsFromConversation(this.sid, options);
6059
6065
 
6060
6066
  case 2:
6061
6067
  return _context24.abrupt("return", _context24.sent);
@@ -6068,7 +6074,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
6068
6074
  }, _callee24, this);
6069
6075
  }));
6070
6076
 
6071
- function getMessageRecipients() {
6077
+ function getMessageRecipients(_x19) {
6072
6078
  return _getMessageRecipients.apply(this, arguments);
6073
6079
  }
6074
6080
 
@@ -6077,7 +6083,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
6077
6083
  /**
6078
6084
  * Load and subscribe to this conversation and do not subscribe to its
6079
6085
  * participants and messages. This or _subscribeStreams will need to be called
6080
- * before any events on conversation will fire.
6086
+ * before any events in the conversation will fire.
6081
6087
  * @internal
6082
6088
  */
6083
6089
 
@@ -6532,7 +6538,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
6532
6538
  }, _callee29, this);
6533
6539
  }));
6534
6540
 
6535
- function _setLastReadMessageIndex(_x19) {
6541
+ function _setLastReadMessageIndex(_x20) {
6536
6542
  return _setLastReadMessageIndex2.apply(this, arguments);
6537
6543
  }
6538
6544
 
@@ -6612,7 +6618,7 @@ _defineProperty__default["default"](Conversation, "_logger", Logger.scope("Conve
6612
6618
 
6613
6619
  __decorate([declarativeTypeValidator.validateTypesAsync(declarativeTypeValidator.nonEmptyString, optionalJson), __metadata("design:type", Function), __metadata("design:paramtypes", [String, Object]), __metadata("design:returntype", Promise)], Conversation.prototype, "add", null);
6614
6620
 
6615
- __decorate([declarativeTypeValidator.validateTypesAsync(declarativeTypeValidator.nonEmptyString, declarativeTypeValidator.nonEmptyString, optionalJson), __metadata("design:type", Function), __metadata("design:paramtypes", [String, String, Object, Object]), __metadata("design:returntype", Promise)], Conversation.prototype, "addNonChatParticipant", null);
6621
+ __decorate([declarativeTypeValidator.validateTypesAsync(declarativeTypeValidator.nonEmptyString, declarativeTypeValidator.nonEmptyString, optionalJson, optionalJson), __metadata("design:type", Function), __metadata("design:paramtypes", [String, String, Object, Object]), __metadata("design:returntype", Promise)], Conversation.prototype, "addNonChatParticipant", null);
6616
6622
 
6617
6623
  __decorate([declarativeTypeValidator.validateTypesAsync(declarativeTypeValidator.nonNegativeInteger), __metadata("design:type", Function), __metadata("design:paramtypes", [Number]), __metadata("design:returntype", Promise)], Conversation.prototype, "advanceLastReadMessageIndex", null);
6618
6624
 
@@ -7954,7 +7960,7 @@ function PushNotification(data) {
7954
7960
  this.data = data.data || {};
7955
7961
  });
7956
7962
 
7957
- var version = "2.5.0-rc.0";
7963
+ var version = "2.5.0-rc.8";
7958
7964
 
7959
7965
  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; }
7960
7966
 
@@ -8949,7 +8955,7 @@ var MessageRecipientsClient = /*#__PURE__*/function () {
8949
8955
  while (1) {
8950
8956
  switch (_context2.prev = _context2.next) {
8951
8957
  case 0:
8952
- url = new UriBuilder(this._configuration.links.conversations).path(conversationSid).path("MessageRecipients").arg("PageToken", (_paginatorOptions$pag = paginatorOptions === null || paginatorOptions === void 0 ? void 0 : paginatorOptions.pageToken) !== null && _paginatorOptions$pag !== void 0 ? _paginatorOptions$pag : "").arg("PageSize", (_paginatorOptions$pag2 = paginatorOptions === null || paginatorOptions === void 0 ? void 0 : paginatorOptions.pageSize) !== null && _paginatorOptions$pag2 !== void 0 ? _paginatorOptions$pag2 : "").build();
8958
+ url = new UriBuilder(this._configuration.links.conversations).path(conversationSid).path("MessageRecipients").arg("PageToken", (_paginatorOptions$pag = paginatorOptions === null || paginatorOptions === void 0 ? void 0 : paginatorOptions.pageToken) !== null && _paginatorOptions$pag !== void 0 ? _paginatorOptions$pag : undefined).arg("PageSize", (_paginatorOptions$pag2 = paginatorOptions === null || paginatorOptions === void 0 ? void 0 : paginatorOptions.pageSize) !== null && _paginatorOptions$pag2 !== void 0 ? _paginatorOptions$pag2 : undefined).build();
8953
8959
  _context2.next = 3;
8954
8960
  return this._services.commandExecutor.fetchResource(url);
8955
8961
 
@@ -8981,7 +8987,7 @@ var MessageRecipientsClient = /*#__PURE__*/function () {
8981
8987
  pageToken: pageToken,
8982
8988
  pageSize: pageSize
8983
8989
  });
8984
- }, recipientsResponse.meta.previous_token, recipientsResponse.meta.next_token));
8990
+ }, recipientsResponse.meta.previous_token, recipientsResponse.meta.next_token, paginatorOptions === null || paginatorOptions === void 0 ? void 0 : paginatorOptions.pageSize));
8985
8991
 
8986
8992
  case 8:
8987
8993
  case "end":