stream-chat 8.40.2 → 8.40.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.
package/dist/index.es.js CHANGED
@@ -2251,6 +2251,51 @@ var Channel = /*#__PURE__*/function () {
2251
2251
 
2252
2252
  return queryMembers;
2253
2253
  }()
2254
+ /**
2255
+ * partialUpdateMember - Partial update a member
2256
+ *
2257
+ * @param {string} user_id member user id
2258
+ * @param {PartialUpdateMember<StreamChatGenerics>} updates
2259
+ *
2260
+ * @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} Updated member
2261
+ */
2262
+
2263
+ }, {
2264
+ key: "partialUpdateMember",
2265
+ value: function () {
2266
+ var _partialUpdateMember = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(user_id, updates) {
2267
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
2268
+ while (1) {
2269
+ switch (_context6.prev = _context6.next) {
2270
+ case 0:
2271
+ if (user_id) {
2272
+ _context6.next = 2;
2273
+ break;
2274
+ }
2275
+
2276
+ throw Error('Please specify the user id');
2277
+
2278
+ case 2:
2279
+ _context6.next = 4;
2280
+ return this.getClient().patch(this._channelURL() + "/member/".concat(encodeURIComponent(user_id)), updates);
2281
+
2282
+ case 4:
2283
+ return _context6.abrupt("return", _context6.sent);
2284
+
2285
+ case 5:
2286
+ case "end":
2287
+ return _context6.stop();
2288
+ }
2289
+ }
2290
+ }, _callee6, this);
2291
+ }));
2292
+
2293
+ function partialUpdateMember(_x7, _x8) {
2294
+ return _partialUpdateMember.apply(this, arguments);
2295
+ }
2296
+
2297
+ return partialUpdateMember;
2298
+ }()
2254
2299
  /**
2255
2300
  * sendReaction - Send a reaction about a message
2256
2301
  *
@@ -2264,13 +2309,13 @@ var Channel = /*#__PURE__*/function () {
2264
2309
  }, {
2265
2310
  key: "sendReaction",
2266
2311
  value: function () {
2267
- var _sendReaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(messageID, reaction, options) {
2268
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
2312
+ var _sendReaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(messageID, reaction, options) {
2313
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
2269
2314
  while (1) {
2270
- switch (_context6.prev = _context6.next) {
2315
+ switch (_context7.prev = _context7.next) {
2271
2316
  case 0:
2272
2317
  if (messageID) {
2273
- _context6.next = 2;
2318
+ _context7.next = 2;
2274
2319
  break;
2275
2320
  }
2276
2321
 
@@ -2278,30 +2323,30 @@ var Channel = /*#__PURE__*/function () {
2278
2323
 
2279
2324
  case 2:
2280
2325
  if (!(!reaction || Object.keys(reaction).length === 0)) {
2281
- _context6.next = 4;
2326
+ _context7.next = 4;
2282
2327
  break;
2283
2328
  }
2284
2329
 
2285
2330
  throw Error("Reaction object is missing");
2286
2331
 
2287
2332
  case 4:
2288
- _context6.next = 6;
2333
+ _context7.next = 6;
2289
2334
  return this.getClient().post(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(messageID), "/reaction"), _objectSpread$9({
2290
2335
  reaction: reaction
2291
2336
  }, options));
2292
2337
 
2293
2338
  case 6:
2294
- return _context6.abrupt("return", _context6.sent);
2339
+ return _context7.abrupt("return", _context7.sent);
2295
2340
 
2296
2341
  case 7:
2297
2342
  case "end":
2298
- return _context6.stop();
2343
+ return _context7.stop();
2299
2344
  }
2300
2345
  }
2301
- }, _callee6, this);
2346
+ }, _callee7, this);
2302
2347
  }));
2303
2348
 
2304
- function sendReaction(_x7, _x8, _x9) {
2349
+ function sendReaction(_x9, _x10, _x11) {
2305
2350
  return _sendReaction.apply(this, arguments);
2306
2351
  }
2307
2352
 
@@ -2348,39 +2393,39 @@ var Channel = /*#__PURE__*/function () {
2348
2393
  }, {
2349
2394
  key: "update",
2350
2395
  value: function () {
2351
- var _update2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
2396
+ var _update2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
2352
2397
  var channelData,
2353
2398
  updateMessage,
2354
2399
  options,
2355
2400
  reserved,
2356
- _args7 = arguments;
2357
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
2401
+ _args8 = arguments;
2402
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
2358
2403
  while (1) {
2359
- switch (_context7.prev = _context7.next) {
2404
+ switch (_context8.prev = _context8.next) {
2360
2405
  case 0:
2361
- channelData = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
2362
- updateMessage = _args7.length > 1 ? _args7[1] : undefined;
2363
- options = _args7.length > 2 ? _args7[2] : undefined;
2406
+ channelData = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
2407
+ updateMessage = _args8.length > 1 ? _args8[1] : undefined;
2408
+ options = _args8.length > 2 ? _args8[2] : undefined;
2364
2409
  // Strip out reserved names that will result in API errors.
2365
2410
  reserved = ['config', 'cid', 'created_by', 'id', 'member_count', 'type', 'created_at', 'updated_at', 'last_message_at', 'own_capabilities'];
2366
2411
  reserved.forEach(function (key) {
2367
2412
  delete channelData[key];
2368
2413
  });
2369
- _context7.next = 7;
2414
+ _context8.next = 7;
2370
2415
  return this._update(_objectSpread$9({
2371
2416
  message: updateMessage,
2372
2417
  data: channelData
2373
2418
  }, options));
2374
2419
 
2375
2420
  case 7:
2376
- return _context7.abrupt("return", _context7.sent);
2421
+ return _context8.abrupt("return", _context8.sent);
2377
2422
 
2378
2423
  case 8:
2379
2424
  case "end":
2380
- return _context7.stop();
2425
+ return _context8.stop();
2381
2426
  }
2382
2427
  }
2383
- }, _callee7, this);
2428
+ }, _callee8, this);
2384
2429
  }));
2385
2430
 
2386
2431
  function update() {
@@ -2400,19 +2445,19 @@ var Channel = /*#__PURE__*/function () {
2400
2445
  }, {
2401
2446
  key: "updatePartial",
2402
2447
  value: function () {
2403
- var _updatePartial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(update) {
2448
+ var _updatePartial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(update) {
2404
2449
  var _this$data2, _this$data3;
2405
2450
 
2406
2451
  var data, areCapabilitiesChanged;
2407
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
2452
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
2408
2453
  while (1) {
2409
- switch (_context8.prev = _context8.next) {
2454
+ switch (_context9.prev = _context9.next) {
2410
2455
  case 0:
2411
- _context8.next = 2;
2456
+ _context9.next = 2;
2412
2457
  return this.getClient().patch(this._channelURL(), update);
2413
2458
 
2414
2459
  case 2:
2415
- data = _context8.sent;
2460
+ data = _context9.sent;
2416
2461
  areCapabilitiesChanged = _toConsumableArray(data.channel.own_capabilities || []).sort().join() !== _toConsumableArray(Array.isArray((_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2.own_capabilities) ? (_this$data3 = this.data) === null || _this$data3 === void 0 ? void 0 : _this$data3.own_capabilities : []).sort().join();
2417
2462
  this.data = data.channel; // If the capabiltities are changed, we trigger the `capabilities.changed` event.
2418
2463
 
@@ -2424,17 +2469,17 @@ var Channel = /*#__PURE__*/function () {
2424
2469
  });
2425
2470
  }
2426
2471
 
2427
- return _context8.abrupt("return", data);
2472
+ return _context9.abrupt("return", data);
2428
2473
 
2429
2474
  case 7:
2430
2475
  case "end":
2431
- return _context8.stop();
2476
+ return _context9.stop();
2432
2477
  }
2433
2478
  }
2434
- }, _callee8, this);
2479
+ }, _callee9, this);
2435
2480
  }));
2436
2481
 
2437
- function updatePartial(_x10) {
2482
+ function updatePartial(_x12) {
2438
2483
  return _updatePartial.apply(this, arguments);
2439
2484
  }
2440
2485
 
@@ -2450,31 +2495,31 @@ var Channel = /*#__PURE__*/function () {
2450
2495
  }, {
2451
2496
  key: "enableSlowMode",
2452
2497
  value: function () {
2453
- var _enableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(coolDownInterval) {
2498
+ var _enableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(coolDownInterval) {
2454
2499
  var data;
2455
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
2500
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
2456
2501
  while (1) {
2457
- switch (_context9.prev = _context9.next) {
2502
+ switch (_context10.prev = _context10.next) {
2458
2503
  case 0:
2459
- _context9.next = 2;
2504
+ _context10.next = 2;
2460
2505
  return this.getClient().post(this._channelURL(), {
2461
2506
  cooldown: coolDownInterval
2462
2507
  });
2463
2508
 
2464
2509
  case 2:
2465
- data = _context9.sent;
2510
+ data = _context10.sent;
2466
2511
  this.data = data.channel;
2467
- return _context9.abrupt("return", data);
2512
+ return _context10.abrupt("return", data);
2468
2513
 
2469
2514
  case 5:
2470
2515
  case "end":
2471
- return _context9.stop();
2516
+ return _context10.stop();
2472
2517
  }
2473
2518
  }
2474
- }, _callee9, this);
2519
+ }, _callee10, this);
2475
2520
  }));
2476
2521
 
2477
- function enableSlowMode(_x11) {
2522
+ function enableSlowMode(_x13) {
2478
2523
  return _enableSlowMode.apply(this, arguments);
2479
2524
  }
2480
2525
 
@@ -2489,28 +2534,28 @@ var Channel = /*#__PURE__*/function () {
2489
2534
  }, {
2490
2535
  key: "disableSlowMode",
2491
2536
  value: function () {
2492
- var _disableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
2537
+ var _disableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
2493
2538
  var data;
2494
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
2539
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
2495
2540
  while (1) {
2496
- switch (_context10.prev = _context10.next) {
2541
+ switch (_context11.prev = _context11.next) {
2497
2542
  case 0:
2498
- _context10.next = 2;
2543
+ _context11.next = 2;
2499
2544
  return this.getClient().post(this._channelURL(), {
2500
2545
  cooldown: 0
2501
2546
  });
2502
2547
 
2503
2548
  case 2:
2504
- data = _context10.sent;
2549
+ data = _context11.sent;
2505
2550
  this.data = data.channel;
2506
- return _context10.abrupt("return", data);
2551
+ return _context11.abrupt("return", data);
2507
2552
 
2508
2553
  case 5:
2509
2554
  case "end":
2510
- return _context10.stop();
2555
+ return _context11.stop();
2511
2556
  }
2512
2557
  }
2513
- }, _callee10, this);
2558
+ }, _callee11, this);
2514
2559
  }));
2515
2560
 
2516
2561
  function disableSlowMode() {
@@ -2530,26 +2575,26 @@ var Channel = /*#__PURE__*/function () {
2530
2575
  }, {
2531
2576
  key: "delete",
2532
2577
  value: function () {
2533
- var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
2578
+ var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
2534
2579
  var options,
2535
- _args11 = arguments;
2536
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
2580
+ _args12 = arguments;
2581
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
2537
2582
  while (1) {
2538
- switch (_context11.prev = _context11.next) {
2583
+ switch (_context12.prev = _context12.next) {
2539
2584
  case 0:
2540
- options = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
2541
- _context11.next = 3;
2585
+ options = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
2586
+ _context12.next = 3;
2542
2587
  return this.getClient().delete(this._channelURL(), _objectSpread$9({}, options));
2543
2588
 
2544
2589
  case 3:
2545
- return _context11.abrupt("return", _context11.sent);
2590
+ return _context12.abrupt("return", _context12.sent);
2546
2591
 
2547
2592
  case 4:
2548
2593
  case "end":
2549
- return _context11.stop();
2594
+ return _context12.stop();
2550
2595
  }
2551
2596
  }
2552
- }, _callee11, this);
2597
+ }, _callee12, this);
2553
2598
  }));
2554
2599
 
2555
2600
  function _delete() {
@@ -2567,26 +2612,26 @@ var Channel = /*#__PURE__*/function () {
2567
2612
  }, {
2568
2613
  key: "truncate",
2569
2614
  value: function () {
2570
- var _truncate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
2615
+ var _truncate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
2571
2616
  var options,
2572
- _args12 = arguments;
2573
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
2617
+ _args13 = arguments;
2618
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
2574
2619
  while (1) {
2575
- switch (_context12.prev = _context12.next) {
2620
+ switch (_context13.prev = _context13.next) {
2576
2621
  case 0:
2577
- options = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
2578
- _context12.next = 3;
2622
+ options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
2623
+ _context13.next = 3;
2579
2624
  return this.getClient().post(this._channelURL() + '/truncate', options);
2580
2625
 
2581
2626
  case 3:
2582
- return _context12.abrupt("return", _context12.sent);
2627
+ return _context13.abrupt("return", _context13.sent);
2583
2628
 
2584
2629
  case 4:
2585
2630
  case "end":
2586
- return _context12.stop();
2631
+ return _context13.stop();
2587
2632
  }
2588
2633
  }
2589
- }, _callee12, this);
2634
+ }, _callee13, this);
2590
2635
  }));
2591
2636
 
2592
2637
  function truncate() {
@@ -2606,28 +2651,28 @@ var Channel = /*#__PURE__*/function () {
2606
2651
  }, {
2607
2652
  key: "acceptInvite",
2608
2653
  value: function () {
2609
- var _acceptInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
2654
+ var _acceptInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
2610
2655
  var options,
2611
- _args13 = arguments;
2612
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
2656
+ _args14 = arguments;
2657
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
2613
2658
  while (1) {
2614
- switch (_context13.prev = _context13.next) {
2659
+ switch (_context14.prev = _context14.next) {
2615
2660
  case 0:
2616
- options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
2617
- _context13.next = 3;
2661
+ options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
2662
+ _context14.next = 3;
2618
2663
  return this._update(_objectSpread$9({
2619
2664
  accept_invite: true
2620
2665
  }, options));
2621
2666
 
2622
2667
  case 3:
2623
- return _context13.abrupt("return", _context13.sent);
2668
+ return _context14.abrupt("return", _context14.sent);
2624
2669
 
2625
2670
  case 4:
2626
2671
  case "end":
2627
- return _context13.stop();
2672
+ return _context14.stop();
2628
2673
  }
2629
2674
  }
2630
- }, _callee13, this);
2675
+ }, _callee14, this);
2631
2676
  }));
2632
2677
 
2633
2678
  function acceptInvite() {
@@ -2647,28 +2692,28 @@ var Channel = /*#__PURE__*/function () {
2647
2692
  }, {
2648
2693
  key: "rejectInvite",
2649
2694
  value: function () {
2650
- var _rejectInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
2695
+ var _rejectInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
2651
2696
  var options,
2652
- _args14 = arguments;
2653
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
2697
+ _args15 = arguments;
2698
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
2654
2699
  while (1) {
2655
- switch (_context14.prev = _context14.next) {
2700
+ switch (_context15.prev = _context15.next) {
2656
2701
  case 0:
2657
- options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
2658
- _context14.next = 3;
2702
+ options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
2703
+ _context15.next = 3;
2659
2704
  return this._update(_objectSpread$9({
2660
2705
  reject_invite: true
2661
2706
  }, options));
2662
2707
 
2663
2708
  case 3:
2664
- return _context14.abrupt("return", _context14.sent);
2709
+ return _context15.abrupt("return", _context15.sent);
2665
2710
 
2666
2711
  case 4:
2667
2712
  case "end":
2668
- return _context14.stop();
2713
+ return _context15.stop();
2669
2714
  }
2670
2715
  }
2671
- }, _callee14, this);
2716
+ }, _callee15, this);
2672
2717
  }));
2673
2718
 
2674
2719
  function rejectInvite() {
@@ -2689,32 +2734,32 @@ var Channel = /*#__PURE__*/function () {
2689
2734
  }, {
2690
2735
  key: "addMembers",
2691
2736
  value: function () {
2692
- var _addMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(members, message) {
2737
+ var _addMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(members, message) {
2693
2738
  var options,
2694
- _args15 = arguments;
2695
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
2739
+ _args16 = arguments;
2740
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
2696
2741
  while (1) {
2697
- switch (_context15.prev = _context15.next) {
2742
+ switch (_context16.prev = _context16.next) {
2698
2743
  case 0:
2699
- options = _args15.length > 2 && _args15[2] !== undefined ? _args15[2] : {};
2700
- _context15.next = 3;
2744
+ options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
2745
+ _context16.next = 3;
2701
2746
  return this._update(_objectSpread$9({
2702
2747
  add_members: members,
2703
2748
  message: message
2704
2749
  }, options));
2705
2750
 
2706
2751
  case 3:
2707
- return _context15.abrupt("return", _context15.sent);
2752
+ return _context16.abrupt("return", _context16.sent);
2708
2753
 
2709
2754
  case 4:
2710
2755
  case "end":
2711
- return _context15.stop();
2756
+ return _context16.stop();
2712
2757
  }
2713
2758
  }
2714
- }, _callee15, this);
2759
+ }, _callee16, this);
2715
2760
  }));
2716
2761
 
2717
- function addMembers(_x12, _x13) {
2762
+ function addMembers(_x14, _x15) {
2718
2763
  return _addMembers.apply(this, arguments);
2719
2764
  }
2720
2765
 
@@ -2732,32 +2777,32 @@ var Channel = /*#__PURE__*/function () {
2732
2777
  }, {
2733
2778
  key: "addModerators",
2734
2779
  value: function () {
2735
- var _addModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(members, message) {
2780
+ var _addModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(members, message) {
2736
2781
  var options,
2737
- _args16 = arguments;
2738
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
2782
+ _args17 = arguments;
2783
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
2739
2784
  while (1) {
2740
- switch (_context16.prev = _context16.next) {
2785
+ switch (_context17.prev = _context17.next) {
2741
2786
  case 0:
2742
- options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
2743
- _context16.next = 3;
2787
+ options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
2788
+ _context17.next = 3;
2744
2789
  return this._update(_objectSpread$9({
2745
2790
  add_moderators: members,
2746
2791
  message: message
2747
2792
  }, options));
2748
2793
 
2749
2794
  case 3:
2750
- return _context16.abrupt("return", _context16.sent);
2795
+ return _context17.abrupt("return", _context17.sent);
2751
2796
 
2752
2797
  case 4:
2753
2798
  case "end":
2754
- return _context16.stop();
2799
+ return _context17.stop();
2755
2800
  }
2756
2801
  }
2757
- }, _callee16, this);
2802
+ }, _callee17, this);
2758
2803
  }));
2759
2804
 
2760
- function addModerators(_x14, _x15) {
2805
+ function addModerators(_x16, _x17) {
2761
2806
  return _addModerators.apply(this, arguments);
2762
2807
  }
2763
2808
 
@@ -2775,32 +2820,32 @@ var Channel = /*#__PURE__*/function () {
2775
2820
  }, {
2776
2821
  key: "assignRoles",
2777
2822
  value: function () {
2778
- var _assignRoles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(roles, message) {
2823
+ var _assignRoles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(roles, message) {
2779
2824
  var options,
2780
- _args17 = arguments;
2781
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
2825
+ _args18 = arguments;
2826
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
2782
2827
  while (1) {
2783
- switch (_context17.prev = _context17.next) {
2828
+ switch (_context18.prev = _context18.next) {
2784
2829
  case 0:
2785
- options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
2786
- _context17.next = 3;
2830
+ options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
2831
+ _context18.next = 3;
2787
2832
  return this._update(_objectSpread$9({
2788
2833
  assign_roles: roles,
2789
2834
  message: message
2790
2835
  }, options));
2791
2836
 
2792
2837
  case 3:
2793
- return _context17.abrupt("return", _context17.sent);
2838
+ return _context18.abrupt("return", _context18.sent);
2794
2839
 
2795
2840
  case 4:
2796
2841
  case "end":
2797
- return _context17.stop();
2842
+ return _context18.stop();
2798
2843
  }
2799
2844
  }
2800
- }, _callee17, this);
2845
+ }, _callee18, this);
2801
2846
  }));
2802
2847
 
2803
- function assignRoles(_x16, _x17) {
2848
+ function assignRoles(_x18, _x19) {
2804
2849
  return _assignRoles.apply(this, arguments);
2805
2850
  }
2806
2851
 
@@ -2818,32 +2863,32 @@ var Channel = /*#__PURE__*/function () {
2818
2863
  }, {
2819
2864
  key: "inviteMembers",
2820
2865
  value: function () {
2821
- var _inviteMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(members, message) {
2866
+ var _inviteMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(members, message) {
2822
2867
  var options,
2823
- _args18 = arguments;
2824
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
2868
+ _args19 = arguments;
2869
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
2825
2870
  while (1) {
2826
- switch (_context18.prev = _context18.next) {
2871
+ switch (_context19.prev = _context19.next) {
2827
2872
  case 0:
2828
- options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
2829
- _context18.next = 3;
2873
+ options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
2874
+ _context19.next = 3;
2830
2875
  return this._update(_objectSpread$9({
2831
2876
  invites: members,
2832
2877
  message: message
2833
2878
  }, options));
2834
2879
 
2835
2880
  case 3:
2836
- return _context18.abrupt("return", _context18.sent);
2881
+ return _context19.abrupt("return", _context19.sent);
2837
2882
 
2838
2883
  case 4:
2839
2884
  case "end":
2840
- return _context18.stop();
2885
+ return _context19.stop();
2841
2886
  }
2842
2887
  }
2843
- }, _callee18, this);
2888
+ }, _callee19, this);
2844
2889
  }));
2845
2890
 
2846
- function inviteMembers(_x18, _x19) {
2891
+ function inviteMembers(_x20, _x21) {
2847
2892
  return _inviteMembers.apply(this, arguments);
2848
2893
  }
2849
2894
 
@@ -2861,32 +2906,32 @@ var Channel = /*#__PURE__*/function () {
2861
2906
  }, {
2862
2907
  key: "removeMembers",
2863
2908
  value: function () {
2864
- var _removeMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(members, message) {
2909
+ var _removeMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(members, message) {
2865
2910
  var options,
2866
- _args19 = arguments;
2867
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
2911
+ _args20 = arguments;
2912
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
2868
2913
  while (1) {
2869
- switch (_context19.prev = _context19.next) {
2914
+ switch (_context20.prev = _context20.next) {
2870
2915
  case 0:
2871
- options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
2872
- _context19.next = 3;
2916
+ options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
2917
+ _context20.next = 3;
2873
2918
  return this._update(_objectSpread$9({
2874
2919
  remove_members: members,
2875
2920
  message: message
2876
2921
  }, options));
2877
2922
 
2878
2923
  case 3:
2879
- return _context19.abrupt("return", _context19.sent);
2924
+ return _context20.abrupt("return", _context20.sent);
2880
2925
 
2881
2926
  case 4:
2882
2927
  case "end":
2883
- return _context19.stop();
2928
+ return _context20.stop();
2884
2929
  }
2885
2930
  }
2886
- }, _callee19, this);
2931
+ }, _callee20, this);
2887
2932
  }));
2888
2933
 
2889
- function removeMembers(_x20, _x21) {
2934
+ function removeMembers(_x22, _x23) {
2890
2935
  return _removeMembers.apply(this, arguments);
2891
2936
  }
2892
2937
 
@@ -2904,32 +2949,32 @@ var Channel = /*#__PURE__*/function () {
2904
2949
  }, {
2905
2950
  key: "demoteModerators",
2906
2951
  value: function () {
2907
- var _demoteModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(members, message) {
2952
+ var _demoteModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(members, message) {
2908
2953
  var options,
2909
- _args20 = arguments;
2910
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
2954
+ _args21 = arguments;
2955
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
2911
2956
  while (1) {
2912
- switch (_context20.prev = _context20.next) {
2957
+ switch (_context21.prev = _context21.next) {
2913
2958
  case 0:
2914
- options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
2915
- _context20.next = 3;
2959
+ options = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : {};
2960
+ _context21.next = 3;
2916
2961
  return this._update(_objectSpread$9({
2917
2962
  demote_moderators: members,
2918
2963
  message: message
2919
2964
  }, options));
2920
2965
 
2921
2966
  case 3:
2922
- return _context20.abrupt("return", _context20.sent);
2967
+ return _context21.abrupt("return", _context21.sent);
2923
2968
 
2924
2969
  case 4:
2925
2970
  case "end":
2926
- return _context20.stop();
2971
+ return _context21.stop();
2927
2972
  }
2928
2973
  }
2929
- }, _callee20, this);
2974
+ }, _callee21, this);
2930
2975
  }));
2931
2976
 
2932
- function demoteModerators(_x22, _x23) {
2977
+ function demoteModerators(_x24, _x25) {
2933
2978
  return _demoteModerators.apply(this, arguments);
2934
2979
  }
2935
2980
 
@@ -2945,29 +2990,29 @@ var Channel = /*#__PURE__*/function () {
2945
2990
  }, {
2946
2991
  key: "_update",
2947
2992
  value: function () {
2948
- var _update3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(payload) {
2993
+ var _update3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(payload) {
2949
2994
  var data;
2950
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
2995
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
2951
2996
  while (1) {
2952
- switch (_context21.prev = _context21.next) {
2997
+ switch (_context22.prev = _context22.next) {
2953
2998
  case 0:
2954
- _context21.next = 2;
2999
+ _context22.next = 2;
2955
3000
  return this.getClient().post(this._channelURL(), payload);
2956
3001
 
2957
3002
  case 2:
2958
- data = _context21.sent;
3003
+ data = _context22.sent;
2959
3004
  this.data = data.channel;
2960
- return _context21.abrupt("return", data);
3005
+ return _context22.abrupt("return", data);
2961
3006
 
2962
3007
  case 5:
2963
3008
  case "end":
2964
- return _context21.stop();
3009
+ return _context22.stop();
2965
3010
  }
2966
3011
  }
2967
- }, _callee21, this);
3012
+ }, _callee22, this);
2968
3013
  }));
2969
3014
 
2970
- function _update(_x24) {
3015
+ function _update(_x26) {
2971
3016
  return _update3.apply(this, arguments);
2972
3017
  }
2973
3018
 
@@ -2989,28 +3034,28 @@ var Channel = /*#__PURE__*/function () {
2989
3034
  }, {
2990
3035
  key: "mute",
2991
3036
  value: function () {
2992
- var _mute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
3037
+ var _mute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
2993
3038
  var opts,
2994
- _args22 = arguments;
2995
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
3039
+ _args23 = arguments;
3040
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
2996
3041
  while (1) {
2997
- switch (_context22.prev = _context22.next) {
3042
+ switch (_context23.prev = _context23.next) {
2998
3043
  case 0:
2999
- opts = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {};
3000
- _context22.next = 3;
3044
+ opts = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
3045
+ _context23.next = 3;
3001
3046
  return this.getClient().post(this.getClient().baseURL + '/moderation/mute/channel', _objectSpread$9({
3002
3047
  channel_cid: this.cid
3003
3048
  }, opts));
3004
3049
 
3005
3050
  case 3:
3006
- return _context22.abrupt("return", _context22.sent);
3051
+ return _context23.abrupt("return", _context23.sent);
3007
3052
 
3008
3053
  case 4:
3009
3054
  case "end":
3010
- return _context22.stop();
3055
+ return _context23.stop();
3011
3056
  }
3012
3057
  }
3013
- }, _callee22, this);
3058
+ }, _callee23, this);
3014
3059
  }));
3015
3060
 
3016
3061
  function mute() {
@@ -3031,28 +3076,28 @@ var Channel = /*#__PURE__*/function () {
3031
3076
  }, {
3032
3077
  key: "unmute",
3033
3078
  value: function () {
3034
- var _unmute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
3079
+ var _unmute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
3035
3080
  var opts,
3036
- _args23 = arguments;
3037
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
3081
+ _args24 = arguments;
3082
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
3038
3083
  while (1) {
3039
- switch (_context23.prev = _context23.next) {
3084
+ switch (_context24.prev = _context24.next) {
3040
3085
  case 0:
3041
- opts = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
3042
- _context23.next = 3;
3086
+ opts = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
3087
+ _context24.next = 3;
3043
3088
  return this.getClient().post(this.getClient().baseURL + '/moderation/unmute/channel', _objectSpread$9({
3044
3089
  channel_cid: this.cid
3045
3090
  }, opts));
3046
3091
 
3047
3092
  case 3:
3048
- return _context23.abrupt("return", _context23.sent);
3093
+ return _context24.abrupt("return", _context24.sent);
3049
3094
 
3050
3095
  case 4:
3051
3096
  case "end":
3052
- return _context23.stop();
3097
+ return _context24.stop();
3053
3098
  }
3054
3099
  }
3055
- }, _callee23, this);
3100
+ }, _callee24, this);
3056
3101
  }));
3057
3102
 
3058
3103
  function unmute() {
@@ -3099,18 +3144,18 @@ var Channel = /*#__PURE__*/function () {
3099
3144
  }, {
3100
3145
  key: "keystroke",
3101
3146
  value: function () {
3102
- var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(parent_id, options) {
3147
+ var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(parent_id, options) {
3103
3148
  var now, diff;
3104
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
3149
+ return _regeneratorRuntime.wrap(function _callee25$(_context25) {
3105
3150
  while (1) {
3106
- switch (_context24.prev = _context24.next) {
3151
+ switch (_context25.prev = _context25.next) {
3107
3152
  case 0:
3108
3153
  if (this._isTypingIndicatorsEnabled()) {
3109
- _context24.next = 2;
3154
+ _context25.next = 2;
3110
3155
  break;
3111
3156
  }
3112
3157
 
3113
- return _context24.abrupt("return");
3158
+ return _context25.abrupt("return");
3114
3159
 
3115
3160
  case 2:
3116
3161
  now = new Date();
@@ -3119,12 +3164,12 @@ var Channel = /*#__PURE__*/function () {
3119
3164
  this.isTyping = true; // send a typing.start every 2 seconds
3120
3165
 
3121
3166
  if (!(diff === null || diff > 2000)) {
3122
- _context24.next = 10;
3167
+ _context25.next = 10;
3123
3168
  break;
3124
3169
  }
3125
3170
 
3126
3171
  this.lastTypingEvent = new Date();
3127
- _context24.next = 10;
3172
+ _context25.next = 10;
3128
3173
  return this.sendEvent(_objectSpread$9({
3129
3174
  type: 'typing.start',
3130
3175
  parent_id: parent_id
@@ -3132,13 +3177,13 @@ var Channel = /*#__PURE__*/function () {
3132
3177
 
3133
3178
  case 10:
3134
3179
  case "end":
3135
- return _context24.stop();
3180
+ return _context25.stop();
3136
3181
  }
3137
3182
  }
3138
- }, _callee24, this);
3183
+ }, _callee25, this);
3139
3184
  }));
3140
3185
 
3141
- function keystroke(_x25, _x26) {
3186
+ function keystroke(_x27, _x28) {
3142
3187
  return _keystroke.apply(this, arguments);
3143
3188
  }
3144
3189
 
@@ -3153,22 +3198,22 @@ var Channel = /*#__PURE__*/function () {
3153
3198
  }, {
3154
3199
  key: "stopTyping",
3155
3200
  value: function () {
3156
- var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(parent_id, options) {
3157
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
3201
+ var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(parent_id, options) {
3202
+ return _regeneratorRuntime.wrap(function _callee26$(_context26) {
3158
3203
  while (1) {
3159
- switch (_context25.prev = _context25.next) {
3204
+ switch (_context26.prev = _context26.next) {
3160
3205
  case 0:
3161
3206
  if (this._isTypingIndicatorsEnabled()) {
3162
- _context25.next = 2;
3207
+ _context26.next = 2;
3163
3208
  break;
3164
3209
  }
3165
3210
 
3166
- return _context25.abrupt("return");
3211
+ return _context26.abrupt("return");
3167
3212
 
3168
3213
  case 2:
3169
3214
  this.lastTypingEvent = null;
3170
3215
  this.isTyping = false;
3171
- _context25.next = 6;
3216
+ _context26.next = 6;
3172
3217
  return this.sendEvent(_objectSpread$9({
3173
3218
  type: 'typing.stop',
3174
3219
  parent_id: parent_id
@@ -3176,13 +3221,13 @@ var Channel = /*#__PURE__*/function () {
3176
3221
 
3177
3222
  case 6:
3178
3223
  case "end":
3179
- return _context25.stop();
3224
+ return _context26.stop();
3180
3225
  }
3181
3226
  }
3182
- }, _callee25, this);
3227
+ }, _callee26, this);
3183
3228
  }));
3184
3229
 
3185
- function stopTyping(_x27, _x28) {
3230
+ function stopTyping(_x29, _x30) {
3186
3231
  return _stopTyping.apply(this, arguments);
3187
3232
  }
3188
3233
 
@@ -3234,39 +3279,39 @@ var Channel = /*#__PURE__*/function () {
3234
3279
  }, {
3235
3280
  key: "markRead",
3236
3281
  value: function () {
3237
- var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
3282
+ var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
3238
3283
  var _this$getConfig2;
3239
3284
 
3240
3285
  var data,
3241
- _args26 = arguments;
3242
- return _regeneratorRuntime.wrap(function _callee26$(_context26) {
3286
+ _args27 = arguments;
3287
+ return _regeneratorRuntime.wrap(function _callee27$(_context27) {
3243
3288
  while (1) {
3244
- switch (_context26.prev = _context26.next) {
3289
+ switch (_context27.prev = _context27.next) {
3245
3290
  case 0:
3246
- data = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
3291
+ data = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
3247
3292
 
3248
3293
  this._checkInitialized();
3249
3294
 
3250
3295
  if (!(!((_this$getConfig2 = this.getConfig()) !== null && _this$getConfig2 !== void 0 && _this$getConfig2.read_events) && !this.getClient()._isUsingServerAuth())) {
3251
- _context26.next = 4;
3296
+ _context27.next = 4;
3252
3297
  break;
3253
3298
  }
3254
3299
 
3255
- return _context26.abrupt("return", Promise.resolve(null));
3300
+ return _context27.abrupt("return", Promise.resolve(null));
3256
3301
 
3257
3302
  case 4:
3258
- _context26.next = 6;
3303
+ _context27.next = 6;
3259
3304
  return this.getClient().post(this._channelURL() + '/read', _objectSpread$9({}, data));
3260
3305
 
3261
3306
  case 6:
3262
- return _context26.abrupt("return", _context26.sent);
3307
+ return _context27.abrupt("return", _context27.sent);
3263
3308
 
3264
3309
  case 7:
3265
3310
  case "end":
3266
- return _context26.stop();
3311
+ return _context27.stop();
3267
3312
  }
3268
3313
  }
3269
- }, _callee26, this);
3314
+ }, _callee27, this);
3270
3315
  }));
3271
3316
 
3272
3317
  function markRead() {
@@ -3285,38 +3330,38 @@ var Channel = /*#__PURE__*/function () {
3285
3330
  }, {
3286
3331
  key: "markUnread",
3287
3332
  value: function () {
3288
- var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(data) {
3333
+ var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(data) {
3289
3334
  var _this$getConfig3;
3290
3335
 
3291
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
3336
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
3292
3337
  while (1) {
3293
- switch (_context27.prev = _context27.next) {
3338
+ switch (_context28.prev = _context28.next) {
3294
3339
  case 0:
3295
3340
  this._checkInitialized();
3296
3341
 
3297
3342
  if (!(!((_this$getConfig3 = this.getConfig()) !== null && _this$getConfig3 !== void 0 && _this$getConfig3.read_events) && !this.getClient()._isUsingServerAuth())) {
3298
- _context27.next = 3;
3343
+ _context28.next = 3;
3299
3344
  break;
3300
3345
  }
3301
3346
 
3302
- return _context27.abrupt("return", Promise.resolve(null));
3347
+ return _context28.abrupt("return", Promise.resolve(null));
3303
3348
 
3304
3349
  case 3:
3305
- _context27.next = 5;
3350
+ _context28.next = 5;
3306
3351
  return this.getClient().post(this._channelURL() + '/unread', _objectSpread$9({}, data));
3307
3352
 
3308
3353
  case 5:
3309
- return _context27.abrupt("return", _context27.sent);
3354
+ return _context28.abrupt("return", _context28.sent);
3310
3355
 
3311
3356
  case 6:
3312
3357
  case "end":
3313
- return _context27.stop();
3358
+ return _context28.stop();
3314
3359
  }
3315
3360
  }
3316
- }, _callee27, this);
3361
+ }, _callee28, this);
3317
3362
  }));
3318
3363
 
3319
- function markUnread(_x29) {
3364
+ function markUnread(_x31) {
3320
3365
  return _markUnread.apply(this, arguments);
3321
3366
  }
3322
3367
 
@@ -3351,11 +3396,11 @@ var Channel = /*#__PURE__*/function () {
3351
3396
  }, {
3352
3397
  key: "watch",
3353
3398
  value: function () {
3354
- var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(options) {
3399
+ var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(options) {
3355
3400
  var defaultOptions, combined, state;
3356
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
3401
+ return _regeneratorRuntime.wrap(function _callee29$(_context29) {
3357
3402
  while (1) {
3358
- switch (_context28.prev = _context28.next) {
3403
+ switch (_context29.prev = _context29.next) {
3359
3404
  case 0:
3360
3405
  defaultOptions = {
3361
3406
  state: true,
@@ -3363,7 +3408,7 @@ var Channel = /*#__PURE__*/function () {
3363
3408
  presence: false
3364
3409
  }; // Make sure we wait for the connect promise if there is a pending one
3365
3410
 
3366
- _context28.next = 3;
3411
+ _context29.next = 3;
3367
3412
  return this.getClient().wsPromise;
3368
3413
 
3369
3414
  case 3:
@@ -3372,11 +3417,11 @@ var Channel = /*#__PURE__*/function () {
3372
3417
  }
3373
3418
 
3374
3419
  combined = _objectSpread$9(_objectSpread$9({}, defaultOptions), options);
3375
- _context28.next = 7;
3420
+ _context29.next = 7;
3376
3421
  return this.query(combined, 'latest');
3377
3422
 
3378
3423
  case 7:
3379
- state = _context28.sent;
3424
+ state = _context29.sent;
3380
3425
  this.initialized = true;
3381
3426
  this.data = state.channel;
3382
3427
 
@@ -3385,17 +3430,17 @@ var Channel = /*#__PURE__*/function () {
3385
3430
  channel: this
3386
3431
  });
3387
3432
 
3388
- return _context28.abrupt("return", state);
3433
+ return _context29.abrupt("return", state);
3389
3434
 
3390
3435
  case 12:
3391
3436
  case "end":
3392
- return _context28.stop();
3437
+ return _context29.stop();
3393
3438
  }
3394
3439
  }
3395
- }, _callee28, this);
3440
+ }, _callee29, this);
3396
3441
  }));
3397
3442
 
3398
- function watch(_x30) {
3443
+ function watch(_x32) {
3399
3444
  return _watch.apply(this, arguments);
3400
3445
  }
3401
3446
 
@@ -3410,31 +3455,31 @@ var Channel = /*#__PURE__*/function () {
3410
3455
  }, {
3411
3456
  key: "stopWatching",
3412
3457
  value: function () {
3413
- var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
3458
+ var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
3414
3459
  var response;
3415
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
3460
+ return _regeneratorRuntime.wrap(function _callee30$(_context30) {
3416
3461
  while (1) {
3417
- switch (_context29.prev = _context29.next) {
3462
+ switch (_context30.prev = _context30.next) {
3418
3463
  case 0:
3419
- _context29.next = 2;
3464
+ _context30.next = 2;
3420
3465
  return this.getClient().post(this._channelURL() + '/stop-watching', {});
3421
3466
 
3422
3467
  case 2:
3423
- response = _context29.sent;
3468
+ response = _context30.sent;
3424
3469
 
3425
3470
  this._client.logger('info', "channel:watch() - stopped watching channel ".concat(this.cid), {
3426
3471
  tags: ['channel'],
3427
3472
  channel: this
3428
3473
  });
3429
3474
 
3430
- return _context29.abrupt("return", response);
3475
+ return _context30.abrupt("return", response);
3431
3476
 
3432
3477
  case 5:
3433
3478
  case "end":
3434
- return _context29.stop();
3479
+ return _context30.stop();
3435
3480
  }
3436
3481
  }
3437
- }, _callee29, this);
3482
+ }, _callee30, this);
3438
3483
  }));
3439
3484
 
3440
3485
  function stopWatching() {
@@ -3457,37 +3502,37 @@ var Channel = /*#__PURE__*/function () {
3457
3502
  }, {
3458
3503
  key: "getReplies",
3459
3504
  value: function () {
3460
- var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(parent_id, options, sort) {
3505
+ var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(parent_id, options, sort) {
3461
3506
  var normalizedSort, data;
3462
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
3507
+ return _regeneratorRuntime.wrap(function _callee31$(_context31) {
3463
3508
  while (1) {
3464
- switch (_context30.prev = _context30.next) {
3509
+ switch (_context31.prev = _context31.next) {
3465
3510
  case 0:
3466
3511
  normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
3467
- _context30.next = 3;
3512
+ _context31.next = 3;
3468
3513
  return this.getClient().get(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(parent_id), "/replies"), _objectSpread$9({
3469
3514
  sort: normalizedSort
3470
3515
  }, options));
3471
3516
 
3472
3517
  case 3:
3473
- data = _context30.sent;
3518
+ data = _context31.sent;
3474
3519
 
3475
3520
  // add any messages to our thread state
3476
3521
  if (data.messages) {
3477
3522
  this.state.addMessagesSorted(data.messages);
3478
3523
  }
3479
3524
 
3480
- return _context30.abrupt("return", data);
3525
+ return _context31.abrupt("return", data);
3481
3526
 
3482
3527
  case 6:
3483
3528
  case "end":
3484
- return _context30.stop();
3529
+ return _context31.stop();
3485
3530
  }
3486
3531
  }
3487
- }, _callee30, this);
3532
+ }, _callee31, this);
3488
3533
  }));
3489
3534
 
3490
- function getReplies(_x31, _x32, _x33) {
3535
+ function getReplies(_x33, _x34, _x35) {
3491
3536
  return _getReplies.apply(this, arguments);
3492
3537
  }
3493
3538
 
@@ -3505,15 +3550,15 @@ var Channel = /*#__PURE__*/function () {
3505
3550
  }, {
3506
3551
  key: "getPinnedMessages",
3507
3552
  value: function () {
3508
- var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(options) {
3553
+ var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(options) {
3509
3554
  var sort,
3510
- _args31 = arguments;
3511
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
3555
+ _args32 = arguments;
3556
+ return _regeneratorRuntime.wrap(function _callee32$(_context32) {
3512
3557
  while (1) {
3513
- switch (_context31.prev = _context31.next) {
3558
+ switch (_context32.prev = _context32.next) {
3514
3559
  case 0:
3515
- sort = _args31.length > 1 && _args31[1] !== undefined ? _args31[1] : [];
3516
- _context31.next = 3;
3560
+ sort = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : [];
3561
+ _context32.next = 3;
3517
3562
  return this.getClient().get(this._channelURL() + '/pinned_messages', {
3518
3563
  payload: _objectSpread$9(_objectSpread$9({}, options), {}, {
3519
3564
  sort: normalizeQuerySort(sort)
@@ -3521,17 +3566,17 @@ var Channel = /*#__PURE__*/function () {
3521
3566
  });
3522
3567
 
3523
3568
  case 3:
3524
- return _context31.abrupt("return", _context31.sent);
3569
+ return _context32.abrupt("return", _context32.sent);
3525
3570
 
3526
3571
  case 4:
3527
3572
  case "end":
3528
- return _context31.stop();
3573
+ return _context32.stop();
3529
3574
  }
3530
3575
  }
3531
- }, _callee31, this);
3576
+ }, _callee32, this);
3532
3577
  }));
3533
3578
 
3534
- function getPinnedMessages(_x34) {
3579
+ function getPinnedMessages(_x36) {
3535
3580
  return _getPinnedMessages.apply(this, arguments);
3536
3581
  }
3537
3582
 
@@ -3667,7 +3712,7 @@ var Channel = /*#__PURE__*/function () {
3667
3712
  * @return {Promise<QueryChannelAPIResponse<StreamChatGenerics>>} Returns a query response
3668
3713
  */
3669
3714
  function () {
3670
- var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(options) {
3715
+ var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(options) {
3671
3716
  var _options$messages$lim, _options$messages, _this$data6, _this$data7;
3672
3717
 
3673
3718
  var messageSetToAddToIfDoesNotExist,
@@ -3678,14 +3723,14 @@ var Channel = /*#__PURE__*/function () {
3678
3723
  _this$_initializeStat,
3679
3724
  messageSet,
3680
3725
  areCapabilitiesChanged,
3681
- _args32 = arguments;
3726
+ _args33 = arguments;
3682
3727
 
3683
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
3728
+ return _regeneratorRuntime.wrap(function _callee33$(_context33) {
3684
3729
  while (1) {
3685
- switch (_context32.prev = _context32.next) {
3730
+ switch (_context33.prev = _context33.next) {
3686
3731
  case 0:
3687
- messageSetToAddToIfDoesNotExist = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : 'current';
3688
- _context32.next = 3;
3732
+ messageSetToAddToIfDoesNotExist = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : 'current';
3733
+ _context33.next = 3;
3689
3734
  return this.getClient().wsPromise;
3690
3735
 
3691
3736
  case 3:
@@ -3695,14 +3740,14 @@ var Channel = /*#__PURE__*/function () {
3695
3740
  queryURL += "/".concat(encodeURIComponent(this.id));
3696
3741
  }
3697
3742
 
3698
- _context32.next = 7;
3743
+ _context33.next = 7;
3699
3744
  return this.getClient().post(queryURL + '/query', _objectSpread$9({
3700
3745
  data: this._data,
3701
3746
  state: true
3702
3747
  }, options));
3703
3748
 
3704
3749
  case 7:
3705
- state = _context32.sent;
3750
+ state = _context33.sent;
3706
3751
 
3707
3752
  // update the channel id if it was missing
3708
3753
  if (!this.id) {
@@ -3757,17 +3802,17 @@ var Channel = /*#__PURE__*/function () {
3757
3802
  isLatestMessageSet: messageSet.isLatest
3758
3803
  }
3759
3804
  });
3760
- return _context32.abrupt("return", state);
3805
+ return _context33.abrupt("return", state);
3761
3806
 
3762
3807
  case 18:
3763
3808
  case "end":
3764
- return _context32.stop();
3809
+ return _context33.stop();
3765
3810
  }
3766
3811
  }
3767
- }, _callee32, this);
3812
+ }, _callee33, this);
3768
3813
  }));
3769
3814
 
3770
- function query(_x35) {
3815
+ function query(_x37) {
3771
3816
  return _query.apply(this, arguments);
3772
3817
  }
3773
3818
 
@@ -3784,31 +3829,31 @@ var Channel = /*#__PURE__*/function () {
3784
3829
  }, {
3785
3830
  key: "banUser",
3786
3831
  value: function () {
3787
- var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(targetUserID, options) {
3788
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
3832
+ var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(targetUserID, options) {
3833
+ return _regeneratorRuntime.wrap(function _callee34$(_context34) {
3789
3834
  while (1) {
3790
- switch (_context33.prev = _context33.next) {
3835
+ switch (_context34.prev = _context34.next) {
3791
3836
  case 0:
3792
3837
  this._checkInitialized();
3793
3838
 
3794
- _context33.next = 3;
3839
+ _context34.next = 3;
3795
3840
  return this.getClient().banUser(targetUserID, _objectSpread$9(_objectSpread$9({}, options), {}, {
3796
3841
  type: this.type,
3797
3842
  id: this.id
3798
3843
  }));
3799
3844
 
3800
3845
  case 3:
3801
- return _context33.abrupt("return", _context33.sent);
3846
+ return _context34.abrupt("return", _context34.sent);
3802
3847
 
3803
3848
  case 4:
3804
3849
  case "end":
3805
- return _context33.stop();
3850
+ return _context34.stop();
3806
3851
  }
3807
3852
  }
3808
- }, _callee33, this);
3853
+ }, _callee34, this);
3809
3854
  }));
3810
3855
 
3811
- function banUser(_x36, _x37) {
3856
+ function banUser(_x38, _x39) {
3812
3857
  return _banUser.apply(this, arguments);
3813
3858
  }
3814
3859
 
@@ -3826,34 +3871,34 @@ var Channel = /*#__PURE__*/function () {
3826
3871
  }, {
3827
3872
  key: "hide",
3828
3873
  value: function () {
3829
- var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
3874
+ var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
3830
3875
  var userId,
3831
3876
  clearHistory,
3832
- _args34 = arguments;
3833
- return _regeneratorRuntime.wrap(function _callee34$(_context34) {
3877
+ _args35 = arguments;
3878
+ return _regeneratorRuntime.wrap(function _callee35$(_context35) {
3834
3879
  while (1) {
3835
- switch (_context34.prev = _context34.next) {
3880
+ switch (_context35.prev = _context35.next) {
3836
3881
  case 0:
3837
- userId = _args34.length > 0 && _args34[0] !== undefined ? _args34[0] : null;
3838
- clearHistory = _args34.length > 1 && _args34[1] !== undefined ? _args34[1] : false;
3882
+ userId = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : null;
3883
+ clearHistory = _args35.length > 1 && _args35[1] !== undefined ? _args35[1] : false;
3839
3884
 
3840
3885
  this._checkInitialized();
3841
3886
 
3842
- _context34.next = 5;
3887
+ _context35.next = 5;
3843
3888
  return this.getClient().post("".concat(this._channelURL(), "/hide"), {
3844
3889
  user_id: userId,
3845
3890
  clear_history: clearHistory
3846
3891
  });
3847
3892
 
3848
3893
  case 5:
3849
- return _context34.abrupt("return", _context34.sent);
3894
+ return _context35.abrupt("return", _context35.sent);
3850
3895
 
3851
3896
  case 6:
3852
3897
  case "end":
3853
- return _context34.stop();
3898
+ return _context35.stop();
3854
3899
  }
3855
3900
  }
3856
- }, _callee34, this);
3901
+ }, _callee35, this);
3857
3902
  }));
3858
3903
 
3859
3904
  function hide() {
@@ -3872,31 +3917,31 @@ var Channel = /*#__PURE__*/function () {
3872
3917
  }, {
3873
3918
  key: "show",
3874
3919
  value: function () {
3875
- var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
3920
+ var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36() {
3876
3921
  var userId,
3877
- _args35 = arguments;
3878
- return _regeneratorRuntime.wrap(function _callee35$(_context35) {
3922
+ _args36 = arguments;
3923
+ return _regeneratorRuntime.wrap(function _callee36$(_context36) {
3879
3924
  while (1) {
3880
- switch (_context35.prev = _context35.next) {
3925
+ switch (_context36.prev = _context36.next) {
3881
3926
  case 0:
3882
- userId = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : null;
3927
+ userId = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : null;
3883
3928
 
3884
3929
  this._checkInitialized();
3885
3930
 
3886
- _context35.next = 4;
3931
+ _context36.next = 4;
3887
3932
  return this.getClient().post("".concat(this._channelURL(), "/show"), {
3888
3933
  user_id: userId
3889
3934
  });
3890
3935
 
3891
3936
  case 4:
3892
- return _context35.abrupt("return", _context35.sent);
3937
+ return _context36.abrupt("return", _context36.sent);
3893
3938
 
3894
3939
  case 5:
3895
3940
  case "end":
3896
- return _context35.stop();
3941
+ return _context36.stop();
3897
3942
  }
3898
3943
  }
3899
- }, _callee35, this);
3944
+ }, _callee36, this);
3900
3945
  }));
3901
3946
 
3902
3947
  function show() {
@@ -3915,31 +3960,31 @@ var Channel = /*#__PURE__*/function () {
3915
3960
  }, {
3916
3961
  key: "unbanUser",
3917
3962
  value: function () {
3918
- var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetUserID) {
3919
- return _regeneratorRuntime.wrap(function _callee36$(_context36) {
3963
+ var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetUserID) {
3964
+ return _regeneratorRuntime.wrap(function _callee37$(_context37) {
3920
3965
  while (1) {
3921
- switch (_context36.prev = _context36.next) {
3966
+ switch (_context37.prev = _context37.next) {
3922
3967
  case 0:
3923
3968
  this._checkInitialized();
3924
3969
 
3925
- _context36.next = 3;
3970
+ _context37.next = 3;
3926
3971
  return this.getClient().unbanUser(targetUserID, {
3927
3972
  type: this.type,
3928
3973
  id: this.id
3929
3974
  });
3930
3975
 
3931
3976
  case 3:
3932
- return _context36.abrupt("return", _context36.sent);
3977
+ return _context37.abrupt("return", _context37.sent);
3933
3978
 
3934
3979
  case 4:
3935
3980
  case "end":
3936
- return _context36.stop();
3981
+ return _context37.stop();
3937
3982
  }
3938
3983
  }
3939
- }, _callee36, this);
3984
+ }, _callee37, this);
3940
3985
  }));
3941
3986
 
3942
- function unbanUser(_x38) {
3987
+ function unbanUser(_x40) {
3943
3988
  return _unbanUser.apply(this, arguments);
3944
3989
  }
3945
3990
 
@@ -3956,31 +4001,31 @@ var Channel = /*#__PURE__*/function () {
3956
4001
  }, {
3957
4002
  key: "shadowBan",
3958
4003
  value: function () {
3959
- var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetUserID, options) {
3960
- return _regeneratorRuntime.wrap(function _callee37$(_context37) {
4004
+ var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetUserID, options) {
4005
+ return _regeneratorRuntime.wrap(function _callee38$(_context38) {
3961
4006
  while (1) {
3962
- switch (_context37.prev = _context37.next) {
4007
+ switch (_context38.prev = _context38.next) {
3963
4008
  case 0:
3964
4009
  this._checkInitialized();
3965
4010
 
3966
- _context37.next = 3;
4011
+ _context38.next = 3;
3967
4012
  return this.getClient().shadowBan(targetUserID, _objectSpread$9(_objectSpread$9({}, options), {}, {
3968
4013
  type: this.type,
3969
4014
  id: this.id
3970
4015
  }));
3971
4016
 
3972
4017
  case 3:
3973
- return _context37.abrupt("return", _context37.sent);
4018
+ return _context38.abrupt("return", _context38.sent);
3974
4019
 
3975
4020
  case 4:
3976
4021
  case "end":
3977
- return _context37.stop();
4022
+ return _context38.stop();
3978
4023
  }
3979
4024
  }
3980
- }, _callee37, this);
4025
+ }, _callee38, this);
3981
4026
  }));
3982
4027
 
3983
- function shadowBan(_x39, _x40) {
4028
+ function shadowBan(_x41, _x42) {
3984
4029
  return _shadowBan.apply(this, arguments);
3985
4030
  }
3986
4031
 
@@ -3996,31 +4041,31 @@ var Channel = /*#__PURE__*/function () {
3996
4041
  }, {
3997
4042
  key: "removeShadowBan",
3998
4043
  value: function () {
3999
- var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetUserID) {
4000
- return _regeneratorRuntime.wrap(function _callee38$(_context38) {
4044
+ var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(targetUserID) {
4045
+ return _regeneratorRuntime.wrap(function _callee39$(_context39) {
4001
4046
  while (1) {
4002
- switch (_context38.prev = _context38.next) {
4047
+ switch (_context39.prev = _context39.next) {
4003
4048
  case 0:
4004
4049
  this._checkInitialized();
4005
4050
 
4006
- _context38.next = 3;
4051
+ _context39.next = 3;
4007
4052
  return this.getClient().removeShadowBan(targetUserID, {
4008
4053
  type: this.type,
4009
4054
  id: this.id
4010
4055
  });
4011
4056
 
4012
4057
  case 3:
4013
- return _context38.abrupt("return", _context38.sent);
4058
+ return _context39.abrupt("return", _context39.sent);
4014
4059
 
4015
4060
  case 4:
4016
4061
  case "end":
4017
- return _context38.stop();
4062
+ return _context39.stop();
4018
4063
  }
4019
4064
  }
4020
- }, _callee38, this);
4065
+ }, _callee39, this);
4021
4066
  }));
4022
4067
 
4023
- function removeShadowBan(_x41) {
4068
+ function removeShadowBan(_x43) {
4024
4069
  return _removeShadowBan.apply(this, arguments);
4025
4070
  }
4026
4071
 
@@ -4036,26 +4081,26 @@ var Channel = /*#__PURE__*/function () {
4036
4081
  }, {
4037
4082
  key: "createCall",
4038
4083
  value: function () {
4039
- var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(options) {
4040
- return _regeneratorRuntime.wrap(function _callee39$(_context39) {
4084
+ var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(options) {
4085
+ return _regeneratorRuntime.wrap(function _callee40$(_context40) {
4041
4086
  while (1) {
4042
- switch (_context39.prev = _context39.next) {
4087
+ switch (_context40.prev = _context40.next) {
4043
4088
  case 0:
4044
- _context39.next = 2;
4089
+ _context40.next = 2;
4045
4090
  return this.getClient().post(this._channelURL() + '/call', options);
4046
4091
 
4047
4092
  case 2:
4048
- return _context39.abrupt("return", _context39.sent);
4093
+ return _context40.abrupt("return", _context40.sent);
4049
4094
 
4050
4095
  case 3:
4051
4096
  case "end":
4052
- return _context39.stop();
4097
+ return _context40.stop();
4053
4098
  }
4054
4099
  }
4055
- }, _callee39, this);
4100
+ }, _callee40, this);
4056
4101
  }));
4057
4102
 
4058
- function createCall(_x42) {
4103
+ function createCall(_x44) {
4059
4104
  return _createCall.apply(this, arguments);
4060
4105
  }
4061
4106
 
@@ -4071,26 +4116,26 @@ var Channel = /*#__PURE__*/function () {
4071
4116
  }, {
4072
4117
  key: "vote",
4073
4118
  value: function () {
4074
- var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(messageId, pollId, _vote) {
4075
- return _regeneratorRuntime.wrap(function _callee40$(_context40) {
4119
+ var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(messageId, pollId, _vote) {
4120
+ return _regeneratorRuntime.wrap(function _callee41$(_context41) {
4076
4121
  while (1) {
4077
- switch (_context40.prev = _context40.next) {
4122
+ switch (_context41.prev = _context41.next) {
4078
4123
  case 0:
4079
- _context40.next = 2;
4124
+ _context41.next = 2;
4080
4125
  return this.getClient().castPollVote(messageId, pollId, _vote);
4081
4126
 
4082
4127
  case 2:
4083
- return _context40.abrupt("return", _context40.sent);
4128
+ return _context41.abrupt("return", _context41.sent);
4084
4129
 
4085
4130
  case 3:
4086
4131
  case "end":
4087
- return _context40.stop();
4132
+ return _context41.stop();
4088
4133
  }
4089
4134
  }
4090
- }, _callee40, this);
4135
+ }, _callee41, this);
4091
4136
  }));
4092
4137
 
4093
- function vote(_x43, _x44, _x45) {
4138
+ function vote(_x45, _x46, _x47) {
4094
4139
  return _vote2.apply(this, arguments);
4095
4140
  }
4096
4141
 
@@ -4099,26 +4144,26 @@ var Channel = /*#__PURE__*/function () {
4099
4144
  }, {
4100
4145
  key: "removeVote",
4101
4146
  value: function () {
4102
- var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(messageId, pollId, voteId) {
4103
- return _regeneratorRuntime.wrap(function _callee41$(_context41) {
4147
+ var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(messageId, pollId, voteId) {
4148
+ return _regeneratorRuntime.wrap(function _callee42$(_context42) {
4104
4149
  while (1) {
4105
- switch (_context41.prev = _context41.next) {
4150
+ switch (_context42.prev = _context42.next) {
4106
4151
  case 0:
4107
- _context41.next = 2;
4152
+ _context42.next = 2;
4108
4153
  return this.getClient().removePollVote(messageId, pollId, voteId);
4109
4154
 
4110
4155
  case 2:
4111
- return _context41.abrupt("return", _context41.sent);
4156
+ return _context42.abrupt("return", _context42.sent);
4112
4157
 
4113
4158
  case 3:
4114
4159
  case "end":
4115
- return _context41.stop();
4160
+ return _context42.stop();
4116
4161
  }
4117
4162
  }
4118
- }, _callee41, this);
4163
+ }, _callee42, this);
4119
4164
  }));
4120
4165
 
4121
- function removeVote(_x46, _x47, _x48) {
4166
+ function removeVote(_x48, _x49, _x50) {
4122
4167
  return _removeVote.apply(this, arguments);
4123
4168
  }
4124
4169
 
@@ -4659,13 +4704,7 @@ var Channel = /*#__PURE__*/function () {
4659
4704
  }
4660
4705
 
4661
4706
  if (state.members) {
4662
- this.state.members = state.members.reduce(function (acc, member) {
4663
- if (member.user) {
4664
- acc[member.user.id] = member;
4665
- }
4666
-
4667
- return acc;
4668
- }, {});
4707
+ this._hydrateMembers(state.members);
4669
4708
  }
4670
4709
 
4671
4710
  return {
@@ -4685,6 +4724,17 @@ var Channel = /*#__PURE__*/function () {
4685
4724
  event.message.own_reactions = message.own_reactions;
4686
4725
  }
4687
4726
  }
4727
+ }, {
4728
+ key: "_hydrateMembers",
4729
+ value: function _hydrateMembers(members) {
4730
+ this.state.members = members.reduce(function (acc, member) {
4731
+ if (member.user) {
4732
+ acc[member.user.id] = member;
4733
+ }
4734
+
4735
+ return acc;
4736
+ }, {});
4737
+ }
4688
4738
  }, {
4689
4739
  key: "_disconnect",
4690
4740
  value: function _disconnect() {
@@ -7838,9 +7888,17 @@ var Thread = /*#__PURE__*/function () {
7838
7888
  };
7839
7889
  }());
7840
7890
 
7891
+ var _channel = client.channel(threadData.channel.type, threadData.channel.id, {
7892
+ name: threadData.channel.name
7893
+ });
7894
+
7895
+ if (threadData.channel.members) {
7896
+ _channel._hydrateMembers(threadData.channel.members);
7897
+ }
7898
+
7841
7899
  this.state = new StateStore({
7842
7900
  active: false,
7843
- channel: client.channel(threadData.channel.type, threadData.channel.id),
7901
+ channel: _channel,
7844
7902
  createdAt: new Date(threadData.created_at),
7845
7903
  deletedAt: threadData.deleted_at ? new Date(threadData.deleted_at) : null,
7846
7904
  isLoading: false,
@@ -13272,7 +13330,7 @@ var StreamChat = /*#__PURE__*/function () {
13272
13330
  }, {
13273
13331
  key: "getUserAgent",
13274
13332
  value: function getUserAgent() {
13275
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.40.2");
13333
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.40.3");
13276
13334
  }
13277
13335
  }, {
13278
13336
  key: "setUserAgent",