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