stream-chat 8.45.3 → 8.46.1
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/browser.es.js +275 -162
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.full-bundle.min.js +1 -1
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/browser.js +275 -162
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +275 -162
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +275 -162
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +22 -1
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/client.d.ts +2 -26
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/events.d.ts +3 -0
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/types.d.ts +4 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channel.ts +54 -3
- package/src/events.ts +4 -0
- package/src/types.ts +10 -0
package/dist/browser.es.js
CHANGED
|
@@ -3537,6 +3537,111 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3537
3537
|
|
|
3538
3538
|
return keystroke;
|
|
3539
3539
|
}()
|
|
3540
|
+
/**
|
|
3541
|
+
* Sends an event to update the AI state for a specific message.
|
|
3542
|
+
* Typically used by the server connected to the AI service to notify clients of state changes.
|
|
3543
|
+
*
|
|
3544
|
+
* @param messageId - The ID of the message associated with the AI state.
|
|
3545
|
+
* @param state - The new state of the AI process (e.g., thinking, generating).
|
|
3546
|
+
* @param options - Optional parameters, such as `ai_message`, to include additional details in the event.
|
|
3547
|
+
*/
|
|
3548
|
+
|
|
3549
|
+
}, {
|
|
3550
|
+
key: "updateAIState",
|
|
3551
|
+
value: function () {
|
|
3552
|
+
var _updateAIState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(messageId, state) {
|
|
3553
|
+
var options,
|
|
3554
|
+
_args30 = arguments;
|
|
3555
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
3556
|
+
while (1) {
|
|
3557
|
+
switch (_context30.prev = _context30.next) {
|
|
3558
|
+
case 0:
|
|
3559
|
+
options = _args30.length > 2 && _args30[2] !== undefined ? _args30[2] : {};
|
|
3560
|
+
_context30.next = 3;
|
|
3561
|
+
return this.sendEvent(_objectSpread$a(_objectSpread$a({}, options), {}, {
|
|
3562
|
+
type: 'ai_indicator.update',
|
|
3563
|
+
message_id: messageId,
|
|
3564
|
+
ai_state: state
|
|
3565
|
+
}));
|
|
3566
|
+
|
|
3567
|
+
case 3:
|
|
3568
|
+
case "end":
|
|
3569
|
+
return _context30.stop();
|
|
3570
|
+
}
|
|
3571
|
+
}
|
|
3572
|
+
}, _callee30, this);
|
|
3573
|
+
}));
|
|
3574
|
+
|
|
3575
|
+
function updateAIState(_x29, _x30) {
|
|
3576
|
+
return _updateAIState.apply(this, arguments);
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
return updateAIState;
|
|
3580
|
+
}()
|
|
3581
|
+
/**
|
|
3582
|
+
* Sends an event to notify watchers to clear the typing/thinking UI when the AI response starts streaming.
|
|
3583
|
+
* Typically used by the server connected to the AI service to inform clients that the AI response has started.
|
|
3584
|
+
*/
|
|
3585
|
+
|
|
3586
|
+
}, {
|
|
3587
|
+
key: "clearAIIndicator",
|
|
3588
|
+
value: function () {
|
|
3589
|
+
var _clearAIIndicator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
|
|
3590
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
3591
|
+
while (1) {
|
|
3592
|
+
switch (_context31.prev = _context31.next) {
|
|
3593
|
+
case 0:
|
|
3594
|
+
_context31.next = 2;
|
|
3595
|
+
return this.sendEvent({
|
|
3596
|
+
type: 'ai_indicator.clear'
|
|
3597
|
+
});
|
|
3598
|
+
|
|
3599
|
+
case 2:
|
|
3600
|
+
case "end":
|
|
3601
|
+
return _context31.stop();
|
|
3602
|
+
}
|
|
3603
|
+
}
|
|
3604
|
+
}, _callee31, this);
|
|
3605
|
+
}));
|
|
3606
|
+
|
|
3607
|
+
function clearAIIndicator() {
|
|
3608
|
+
return _clearAIIndicator.apply(this, arguments);
|
|
3609
|
+
}
|
|
3610
|
+
|
|
3611
|
+
return clearAIIndicator;
|
|
3612
|
+
}()
|
|
3613
|
+
/**
|
|
3614
|
+
* Sends an event to stop AI response generation, leaving the message in its current state.
|
|
3615
|
+
* Triggered by the user to halt the AI response process.
|
|
3616
|
+
*/
|
|
3617
|
+
|
|
3618
|
+
}, {
|
|
3619
|
+
key: "stopAIResponse",
|
|
3620
|
+
value: function () {
|
|
3621
|
+
var _stopAIResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
|
|
3622
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
3623
|
+
while (1) {
|
|
3624
|
+
switch (_context32.prev = _context32.next) {
|
|
3625
|
+
case 0:
|
|
3626
|
+
_context32.next = 2;
|
|
3627
|
+
return this.sendEvent({
|
|
3628
|
+
type: 'ai_indicator.stop'
|
|
3629
|
+
});
|
|
3630
|
+
|
|
3631
|
+
case 2:
|
|
3632
|
+
case "end":
|
|
3633
|
+
return _context32.stop();
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
}, _callee32, this);
|
|
3637
|
+
}));
|
|
3638
|
+
|
|
3639
|
+
function stopAIResponse() {
|
|
3640
|
+
return _stopAIResponse.apply(this, arguments);
|
|
3641
|
+
}
|
|
3642
|
+
|
|
3643
|
+
return stopAIResponse;
|
|
3644
|
+
}()
|
|
3540
3645
|
/**
|
|
3541
3646
|
* stopTyping - Sets last typing to null and sends the typing.stop event
|
|
3542
3647
|
* @see {@link https://getstream.io/chat/docs/typing_indicators/?language=js|Docs}
|
|
@@ -3546,22 +3651,22 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3546
3651
|
}, {
|
|
3547
3652
|
key: "stopTyping",
|
|
3548
3653
|
value: function () {
|
|
3549
|
-
var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3550
|
-
return _regeneratorRuntime.wrap(function
|
|
3654
|
+
var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(parent_id, options) {
|
|
3655
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
3551
3656
|
while (1) {
|
|
3552
|
-
switch (
|
|
3657
|
+
switch (_context33.prev = _context33.next) {
|
|
3553
3658
|
case 0:
|
|
3554
3659
|
if (this._isTypingIndicatorsEnabled()) {
|
|
3555
|
-
|
|
3660
|
+
_context33.next = 2;
|
|
3556
3661
|
break;
|
|
3557
3662
|
}
|
|
3558
3663
|
|
|
3559
|
-
return
|
|
3664
|
+
return _context33.abrupt("return");
|
|
3560
3665
|
|
|
3561
3666
|
case 2:
|
|
3562
3667
|
this.lastTypingEvent = null;
|
|
3563
3668
|
this.isTyping = false;
|
|
3564
|
-
|
|
3669
|
+
_context33.next = 6;
|
|
3565
3670
|
return this.sendEvent(_objectSpread$a({
|
|
3566
3671
|
type: 'typing.stop',
|
|
3567
3672
|
parent_id: parent_id
|
|
@@ -3569,13 +3674,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3569
3674
|
|
|
3570
3675
|
case 6:
|
|
3571
3676
|
case "end":
|
|
3572
|
-
return
|
|
3677
|
+
return _context33.stop();
|
|
3573
3678
|
}
|
|
3574
3679
|
}
|
|
3575
|
-
},
|
|
3680
|
+
}, _callee33, this);
|
|
3576
3681
|
}));
|
|
3577
3682
|
|
|
3578
|
-
function stopTyping(
|
|
3683
|
+
function stopTyping(_x31, _x32) {
|
|
3579
3684
|
return _stopTyping.apply(this, arguments);
|
|
3580
3685
|
}
|
|
3581
3686
|
|
|
@@ -3627,39 +3732,39 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3627
3732
|
}, {
|
|
3628
3733
|
key: "markRead",
|
|
3629
3734
|
value: function () {
|
|
3630
|
-
var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3735
|
+
var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
|
|
3631
3736
|
var _this$getConfig2;
|
|
3632
3737
|
|
|
3633
3738
|
var data,
|
|
3634
|
-
|
|
3635
|
-
return _regeneratorRuntime.wrap(function
|
|
3739
|
+
_args34 = arguments;
|
|
3740
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
3636
3741
|
while (1) {
|
|
3637
|
-
switch (
|
|
3742
|
+
switch (_context34.prev = _context34.next) {
|
|
3638
3743
|
case 0:
|
|
3639
|
-
data =
|
|
3744
|
+
data = _args34.length > 0 && _args34[0] !== undefined ? _args34[0] : {};
|
|
3640
3745
|
|
|
3641
3746
|
this._checkInitialized();
|
|
3642
3747
|
|
|
3643
3748
|
if (!(!((_this$getConfig2 = this.getConfig()) !== null && _this$getConfig2 !== void 0 && _this$getConfig2.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
3644
|
-
|
|
3749
|
+
_context34.next = 4;
|
|
3645
3750
|
break;
|
|
3646
3751
|
}
|
|
3647
3752
|
|
|
3648
|
-
return
|
|
3753
|
+
return _context34.abrupt("return", Promise.resolve(null));
|
|
3649
3754
|
|
|
3650
3755
|
case 4:
|
|
3651
|
-
|
|
3756
|
+
_context34.next = 6;
|
|
3652
3757
|
return this.getClient().post(this._channelURL() + '/read', _objectSpread$a({}, data));
|
|
3653
3758
|
|
|
3654
3759
|
case 6:
|
|
3655
|
-
return
|
|
3760
|
+
return _context34.abrupt("return", _context34.sent);
|
|
3656
3761
|
|
|
3657
3762
|
case 7:
|
|
3658
3763
|
case "end":
|
|
3659
|
-
return
|
|
3764
|
+
return _context34.stop();
|
|
3660
3765
|
}
|
|
3661
3766
|
}
|
|
3662
|
-
},
|
|
3767
|
+
}, _callee34, this);
|
|
3663
3768
|
}));
|
|
3664
3769
|
|
|
3665
3770
|
function markRead() {
|
|
@@ -3678,38 +3783,38 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3678
3783
|
}, {
|
|
3679
3784
|
key: "markUnread",
|
|
3680
3785
|
value: function () {
|
|
3681
|
-
var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3786
|
+
var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(data) {
|
|
3682
3787
|
var _this$getConfig3;
|
|
3683
3788
|
|
|
3684
|
-
return _regeneratorRuntime.wrap(function
|
|
3789
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
3685
3790
|
while (1) {
|
|
3686
|
-
switch (
|
|
3791
|
+
switch (_context35.prev = _context35.next) {
|
|
3687
3792
|
case 0:
|
|
3688
3793
|
this._checkInitialized();
|
|
3689
3794
|
|
|
3690
3795
|
if (!(!((_this$getConfig3 = this.getConfig()) !== null && _this$getConfig3 !== void 0 && _this$getConfig3.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
3691
|
-
|
|
3796
|
+
_context35.next = 3;
|
|
3692
3797
|
break;
|
|
3693
3798
|
}
|
|
3694
3799
|
|
|
3695
|
-
return
|
|
3800
|
+
return _context35.abrupt("return", Promise.resolve(null));
|
|
3696
3801
|
|
|
3697
3802
|
case 3:
|
|
3698
|
-
|
|
3803
|
+
_context35.next = 5;
|
|
3699
3804
|
return this.getClient().post(this._channelURL() + '/unread', _objectSpread$a({}, data));
|
|
3700
3805
|
|
|
3701
3806
|
case 5:
|
|
3702
|
-
return
|
|
3807
|
+
return _context35.abrupt("return", _context35.sent);
|
|
3703
3808
|
|
|
3704
3809
|
case 6:
|
|
3705
3810
|
case "end":
|
|
3706
|
-
return
|
|
3811
|
+
return _context35.stop();
|
|
3707
3812
|
}
|
|
3708
3813
|
}
|
|
3709
|
-
},
|
|
3814
|
+
}, _callee35, this);
|
|
3710
3815
|
}));
|
|
3711
3816
|
|
|
3712
|
-
function markUnread(
|
|
3817
|
+
function markUnread(_x33) {
|
|
3713
3818
|
return _markUnread.apply(this, arguments);
|
|
3714
3819
|
}
|
|
3715
3820
|
|
|
@@ -3744,11 +3849,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3744
3849
|
}, {
|
|
3745
3850
|
key: "watch",
|
|
3746
3851
|
value: function () {
|
|
3747
|
-
var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3852
|
+
var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(options) {
|
|
3748
3853
|
var defaultOptions, combined, state;
|
|
3749
|
-
return _regeneratorRuntime.wrap(function
|
|
3854
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
3750
3855
|
while (1) {
|
|
3751
|
-
switch (
|
|
3856
|
+
switch (_context36.prev = _context36.next) {
|
|
3752
3857
|
case 0:
|
|
3753
3858
|
defaultOptions = {
|
|
3754
3859
|
state: true,
|
|
@@ -3756,7 +3861,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3756
3861
|
presence: false
|
|
3757
3862
|
}; // Make sure we wait for the connect promise if there is a pending one
|
|
3758
3863
|
|
|
3759
|
-
|
|
3864
|
+
_context36.next = 3;
|
|
3760
3865
|
return this.getClient().wsPromise;
|
|
3761
3866
|
|
|
3762
3867
|
case 3:
|
|
@@ -3765,11 +3870,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3765
3870
|
}
|
|
3766
3871
|
|
|
3767
3872
|
combined = _objectSpread$a(_objectSpread$a({}, defaultOptions), options);
|
|
3768
|
-
|
|
3873
|
+
_context36.next = 7;
|
|
3769
3874
|
return this.query(combined, 'latest');
|
|
3770
3875
|
|
|
3771
3876
|
case 7:
|
|
3772
|
-
state =
|
|
3877
|
+
state = _context36.sent;
|
|
3773
3878
|
this.initialized = true;
|
|
3774
3879
|
this.data = state.channel;
|
|
3775
3880
|
|
|
@@ -3778,17 +3883,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3778
3883
|
channel: this
|
|
3779
3884
|
});
|
|
3780
3885
|
|
|
3781
|
-
return
|
|
3886
|
+
return _context36.abrupt("return", state);
|
|
3782
3887
|
|
|
3783
3888
|
case 12:
|
|
3784
3889
|
case "end":
|
|
3785
|
-
return
|
|
3890
|
+
return _context36.stop();
|
|
3786
3891
|
}
|
|
3787
3892
|
}
|
|
3788
|
-
},
|
|
3893
|
+
}, _callee36, this);
|
|
3789
3894
|
}));
|
|
3790
3895
|
|
|
3791
|
-
function watch(
|
|
3896
|
+
function watch(_x34) {
|
|
3792
3897
|
return _watch.apply(this, arguments);
|
|
3793
3898
|
}
|
|
3794
3899
|
|
|
@@ -3803,31 +3908,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3803
3908
|
}, {
|
|
3804
3909
|
key: "stopWatching",
|
|
3805
3910
|
value: function () {
|
|
3806
|
-
var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3911
|
+
var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37() {
|
|
3807
3912
|
var response;
|
|
3808
|
-
return _regeneratorRuntime.wrap(function
|
|
3913
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
3809
3914
|
while (1) {
|
|
3810
|
-
switch (
|
|
3915
|
+
switch (_context37.prev = _context37.next) {
|
|
3811
3916
|
case 0:
|
|
3812
|
-
|
|
3917
|
+
_context37.next = 2;
|
|
3813
3918
|
return this.getClient().post(this._channelURL() + '/stop-watching', {});
|
|
3814
3919
|
|
|
3815
3920
|
case 2:
|
|
3816
|
-
response =
|
|
3921
|
+
response = _context37.sent;
|
|
3817
3922
|
|
|
3818
3923
|
this._client.logger('info', "channel:watch() - stopped watching channel ".concat(this.cid), {
|
|
3819
3924
|
tags: ['channel'],
|
|
3820
3925
|
channel: this
|
|
3821
3926
|
});
|
|
3822
3927
|
|
|
3823
|
-
return
|
|
3928
|
+
return _context37.abrupt("return", response);
|
|
3824
3929
|
|
|
3825
3930
|
case 5:
|
|
3826
3931
|
case "end":
|
|
3827
|
-
return
|
|
3932
|
+
return _context37.stop();
|
|
3828
3933
|
}
|
|
3829
3934
|
}
|
|
3830
|
-
},
|
|
3935
|
+
}, _callee37, this);
|
|
3831
3936
|
}));
|
|
3832
3937
|
|
|
3833
3938
|
function stopWatching() {
|
|
@@ -3850,37 +3955,37 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3850
3955
|
}, {
|
|
3851
3956
|
key: "getReplies",
|
|
3852
3957
|
value: function () {
|
|
3853
|
-
var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3958
|
+
var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(parent_id, options, sort) {
|
|
3854
3959
|
var normalizedSort, data;
|
|
3855
|
-
return _regeneratorRuntime.wrap(function
|
|
3960
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
3856
3961
|
while (1) {
|
|
3857
|
-
switch (
|
|
3962
|
+
switch (_context38.prev = _context38.next) {
|
|
3858
3963
|
case 0:
|
|
3859
3964
|
normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
|
|
3860
|
-
|
|
3965
|
+
_context38.next = 3;
|
|
3861
3966
|
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(parent_id), "/replies"), _objectSpread$a({
|
|
3862
3967
|
sort: normalizedSort
|
|
3863
3968
|
}, options));
|
|
3864
3969
|
|
|
3865
3970
|
case 3:
|
|
3866
|
-
data =
|
|
3971
|
+
data = _context38.sent;
|
|
3867
3972
|
|
|
3868
3973
|
// add any messages to our thread state
|
|
3869
3974
|
if (data.messages) {
|
|
3870
3975
|
this.state.addMessagesSorted(data.messages);
|
|
3871
3976
|
}
|
|
3872
3977
|
|
|
3873
|
-
return
|
|
3978
|
+
return _context38.abrupt("return", data);
|
|
3874
3979
|
|
|
3875
3980
|
case 6:
|
|
3876
3981
|
case "end":
|
|
3877
|
-
return
|
|
3982
|
+
return _context38.stop();
|
|
3878
3983
|
}
|
|
3879
3984
|
}
|
|
3880
|
-
},
|
|
3985
|
+
}, _callee38, this);
|
|
3881
3986
|
}));
|
|
3882
3987
|
|
|
3883
|
-
function getReplies(
|
|
3988
|
+
function getReplies(_x35, _x36, _x37) {
|
|
3884
3989
|
return _getReplies.apply(this, arguments);
|
|
3885
3990
|
}
|
|
3886
3991
|
|
|
@@ -3898,15 +4003,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3898
4003
|
}, {
|
|
3899
4004
|
key: "getPinnedMessages",
|
|
3900
4005
|
value: function () {
|
|
3901
|
-
var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4006
|
+
var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(options) {
|
|
3902
4007
|
var sort,
|
|
3903
|
-
|
|
3904
|
-
return _regeneratorRuntime.wrap(function
|
|
4008
|
+
_args39 = arguments;
|
|
4009
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
3905
4010
|
while (1) {
|
|
3906
|
-
switch (
|
|
4011
|
+
switch (_context39.prev = _context39.next) {
|
|
3907
4012
|
case 0:
|
|
3908
|
-
sort =
|
|
3909
|
-
|
|
4013
|
+
sort = _args39.length > 1 && _args39[1] !== undefined ? _args39[1] : [];
|
|
4014
|
+
_context39.next = 3;
|
|
3910
4015
|
return this.getClient().get(this._channelURL() + '/pinned_messages', {
|
|
3911
4016
|
payload: _objectSpread$a(_objectSpread$a({}, options), {}, {
|
|
3912
4017
|
sort: normalizeQuerySort(sort)
|
|
@@ -3914,17 +4019,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3914
4019
|
});
|
|
3915
4020
|
|
|
3916
4021
|
case 3:
|
|
3917
|
-
return
|
|
4022
|
+
return _context39.abrupt("return", _context39.sent);
|
|
3918
4023
|
|
|
3919
4024
|
case 4:
|
|
3920
4025
|
case "end":
|
|
3921
|
-
return
|
|
4026
|
+
return _context39.stop();
|
|
3922
4027
|
}
|
|
3923
4028
|
}
|
|
3924
|
-
},
|
|
4029
|
+
}, _callee39, this);
|
|
3925
4030
|
}));
|
|
3926
4031
|
|
|
3927
|
-
function getPinnedMessages(
|
|
4032
|
+
function getPinnedMessages(_x38) {
|
|
3928
4033
|
return _getPinnedMessages.apply(this, arguments);
|
|
3929
4034
|
}
|
|
3930
4035
|
|
|
@@ -4060,7 +4165,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4060
4165
|
* @return {Promise<QueryChannelAPIResponse<StreamChatGenerics>>} Returns a query response
|
|
4061
4166
|
*/
|
|
4062
4167
|
function () {
|
|
4063
|
-
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4168
|
+
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(options) {
|
|
4064
4169
|
var _options$messages$lim, _options$messages, _this$data6, _this$data7;
|
|
4065
4170
|
|
|
4066
4171
|
var messageSetToAddToIfDoesNotExist,
|
|
@@ -4071,14 +4176,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4071
4176
|
_this$_initializeStat,
|
|
4072
4177
|
messageSet,
|
|
4073
4178
|
areCapabilitiesChanged,
|
|
4074
|
-
|
|
4179
|
+
_args40 = arguments;
|
|
4075
4180
|
|
|
4076
|
-
return _regeneratorRuntime.wrap(function
|
|
4181
|
+
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
4077
4182
|
while (1) {
|
|
4078
|
-
switch (
|
|
4183
|
+
switch (_context40.prev = _context40.next) {
|
|
4079
4184
|
case 0:
|
|
4080
|
-
messageSetToAddToIfDoesNotExist =
|
|
4081
|
-
|
|
4185
|
+
messageSetToAddToIfDoesNotExist = _args40.length > 1 && _args40[1] !== undefined ? _args40[1] : 'current';
|
|
4186
|
+
_context40.next = 3;
|
|
4082
4187
|
return this.getClient().wsPromise;
|
|
4083
4188
|
|
|
4084
4189
|
case 3:
|
|
@@ -4088,14 +4193,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4088
4193
|
queryURL += "/".concat(encodeURIComponent(this.id));
|
|
4089
4194
|
}
|
|
4090
4195
|
|
|
4091
|
-
|
|
4196
|
+
_context40.next = 7;
|
|
4092
4197
|
return this.getClient().post(queryURL + '/query', _objectSpread$a({
|
|
4093
4198
|
data: this._data,
|
|
4094
4199
|
state: true
|
|
4095
4200
|
}, options));
|
|
4096
4201
|
|
|
4097
4202
|
case 7:
|
|
4098
|
-
state =
|
|
4203
|
+
state = _context40.sent;
|
|
4099
4204
|
|
|
4100
4205
|
// update the channel id if it was missing
|
|
4101
4206
|
if (!this.id) {
|
|
@@ -4151,17 +4256,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4151
4256
|
isLatestMessageSet: messageSet.isLatest
|
|
4152
4257
|
}
|
|
4153
4258
|
});
|
|
4154
|
-
return
|
|
4259
|
+
return _context40.abrupt("return", state);
|
|
4155
4260
|
|
|
4156
4261
|
case 19:
|
|
4157
4262
|
case "end":
|
|
4158
|
-
return
|
|
4263
|
+
return _context40.stop();
|
|
4159
4264
|
}
|
|
4160
4265
|
}
|
|
4161
|
-
},
|
|
4266
|
+
}, _callee40, this);
|
|
4162
4267
|
}));
|
|
4163
4268
|
|
|
4164
|
-
function query(
|
|
4269
|
+
function query(_x39) {
|
|
4165
4270
|
return _query.apply(this, arguments);
|
|
4166
4271
|
}
|
|
4167
4272
|
|
|
@@ -4178,31 +4283,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4178
4283
|
}, {
|
|
4179
4284
|
key: "banUser",
|
|
4180
4285
|
value: function () {
|
|
4181
|
-
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4182
|
-
return _regeneratorRuntime.wrap(function
|
|
4286
|
+
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(targetUserID, options) {
|
|
4287
|
+
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
4183
4288
|
while (1) {
|
|
4184
|
-
switch (
|
|
4289
|
+
switch (_context41.prev = _context41.next) {
|
|
4185
4290
|
case 0:
|
|
4186
4291
|
this._checkInitialized();
|
|
4187
4292
|
|
|
4188
|
-
|
|
4293
|
+
_context41.next = 3;
|
|
4189
4294
|
return this.getClient().banUser(targetUserID, _objectSpread$a(_objectSpread$a({}, options), {}, {
|
|
4190
4295
|
type: this.type,
|
|
4191
4296
|
id: this.id
|
|
4192
4297
|
}));
|
|
4193
4298
|
|
|
4194
4299
|
case 3:
|
|
4195
|
-
return
|
|
4300
|
+
return _context41.abrupt("return", _context41.sent);
|
|
4196
4301
|
|
|
4197
4302
|
case 4:
|
|
4198
4303
|
case "end":
|
|
4199
|
-
return
|
|
4304
|
+
return _context41.stop();
|
|
4200
4305
|
}
|
|
4201
4306
|
}
|
|
4202
|
-
},
|
|
4307
|
+
}, _callee41, this);
|
|
4203
4308
|
}));
|
|
4204
4309
|
|
|
4205
|
-
function banUser(
|
|
4310
|
+
function banUser(_x40, _x41) {
|
|
4206
4311
|
return _banUser.apply(this, arguments);
|
|
4207
4312
|
}
|
|
4208
4313
|
|
|
@@ -4220,34 +4325,34 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4220
4325
|
}, {
|
|
4221
4326
|
key: "hide",
|
|
4222
4327
|
value: function () {
|
|
4223
|
-
var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4328
|
+
var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
|
|
4224
4329
|
var userId,
|
|
4225
4330
|
clearHistory,
|
|
4226
|
-
|
|
4227
|
-
return _regeneratorRuntime.wrap(function
|
|
4331
|
+
_args42 = arguments;
|
|
4332
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
4228
4333
|
while (1) {
|
|
4229
|
-
switch (
|
|
4334
|
+
switch (_context42.prev = _context42.next) {
|
|
4230
4335
|
case 0:
|
|
4231
|
-
userId =
|
|
4232
|
-
clearHistory =
|
|
4336
|
+
userId = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : null;
|
|
4337
|
+
clearHistory = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : false;
|
|
4233
4338
|
|
|
4234
4339
|
this._checkInitialized();
|
|
4235
4340
|
|
|
4236
|
-
|
|
4341
|
+
_context42.next = 5;
|
|
4237
4342
|
return this.getClient().post("".concat(this._channelURL(), "/hide"), {
|
|
4238
4343
|
user_id: userId,
|
|
4239
4344
|
clear_history: clearHistory
|
|
4240
4345
|
});
|
|
4241
4346
|
|
|
4242
4347
|
case 5:
|
|
4243
|
-
return
|
|
4348
|
+
return _context42.abrupt("return", _context42.sent);
|
|
4244
4349
|
|
|
4245
4350
|
case 6:
|
|
4246
4351
|
case "end":
|
|
4247
|
-
return
|
|
4352
|
+
return _context42.stop();
|
|
4248
4353
|
}
|
|
4249
4354
|
}
|
|
4250
|
-
},
|
|
4355
|
+
}, _callee42, this);
|
|
4251
4356
|
}));
|
|
4252
4357
|
|
|
4253
4358
|
function hide() {
|
|
@@ -4266,31 +4371,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4266
4371
|
}, {
|
|
4267
4372
|
key: "show",
|
|
4268
4373
|
value: function () {
|
|
4269
|
-
var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4374
|
+
var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43() {
|
|
4270
4375
|
var userId,
|
|
4271
|
-
|
|
4272
|
-
return _regeneratorRuntime.wrap(function
|
|
4376
|
+
_args43 = arguments;
|
|
4377
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
4273
4378
|
while (1) {
|
|
4274
|
-
switch (
|
|
4379
|
+
switch (_context43.prev = _context43.next) {
|
|
4275
4380
|
case 0:
|
|
4276
|
-
userId =
|
|
4381
|
+
userId = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : null;
|
|
4277
4382
|
|
|
4278
4383
|
this._checkInitialized();
|
|
4279
4384
|
|
|
4280
|
-
|
|
4385
|
+
_context43.next = 4;
|
|
4281
4386
|
return this.getClient().post("".concat(this._channelURL(), "/show"), {
|
|
4282
4387
|
user_id: userId
|
|
4283
4388
|
});
|
|
4284
4389
|
|
|
4285
4390
|
case 4:
|
|
4286
|
-
return
|
|
4391
|
+
return _context43.abrupt("return", _context43.sent);
|
|
4287
4392
|
|
|
4288
4393
|
case 5:
|
|
4289
4394
|
case "end":
|
|
4290
|
-
return
|
|
4395
|
+
return _context43.stop();
|
|
4291
4396
|
}
|
|
4292
4397
|
}
|
|
4293
|
-
},
|
|
4398
|
+
}, _callee43, this);
|
|
4294
4399
|
}));
|
|
4295
4400
|
|
|
4296
4401
|
function show() {
|
|
@@ -4309,31 +4414,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4309
4414
|
}, {
|
|
4310
4415
|
key: "unbanUser",
|
|
4311
4416
|
value: function () {
|
|
4312
|
-
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4313
|
-
return _regeneratorRuntime.wrap(function
|
|
4417
|
+
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(targetUserID) {
|
|
4418
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
4314
4419
|
while (1) {
|
|
4315
|
-
switch (
|
|
4420
|
+
switch (_context44.prev = _context44.next) {
|
|
4316
4421
|
case 0:
|
|
4317
4422
|
this._checkInitialized();
|
|
4318
4423
|
|
|
4319
|
-
|
|
4424
|
+
_context44.next = 3;
|
|
4320
4425
|
return this.getClient().unbanUser(targetUserID, {
|
|
4321
4426
|
type: this.type,
|
|
4322
4427
|
id: this.id
|
|
4323
4428
|
});
|
|
4324
4429
|
|
|
4325
4430
|
case 3:
|
|
4326
|
-
return
|
|
4431
|
+
return _context44.abrupt("return", _context44.sent);
|
|
4327
4432
|
|
|
4328
4433
|
case 4:
|
|
4329
4434
|
case "end":
|
|
4330
|
-
return
|
|
4435
|
+
return _context44.stop();
|
|
4331
4436
|
}
|
|
4332
4437
|
}
|
|
4333
|
-
},
|
|
4438
|
+
}, _callee44, this);
|
|
4334
4439
|
}));
|
|
4335
4440
|
|
|
4336
|
-
function unbanUser(
|
|
4441
|
+
function unbanUser(_x42) {
|
|
4337
4442
|
return _unbanUser.apply(this, arguments);
|
|
4338
4443
|
}
|
|
4339
4444
|
|
|
@@ -4350,31 +4455,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4350
4455
|
}, {
|
|
4351
4456
|
key: "shadowBan",
|
|
4352
4457
|
value: function () {
|
|
4353
|
-
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4354
|
-
return _regeneratorRuntime.wrap(function
|
|
4458
|
+
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(targetUserID, options) {
|
|
4459
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
4355
4460
|
while (1) {
|
|
4356
|
-
switch (
|
|
4461
|
+
switch (_context45.prev = _context45.next) {
|
|
4357
4462
|
case 0:
|
|
4358
4463
|
this._checkInitialized();
|
|
4359
4464
|
|
|
4360
|
-
|
|
4465
|
+
_context45.next = 3;
|
|
4361
4466
|
return this.getClient().shadowBan(targetUserID, _objectSpread$a(_objectSpread$a({}, options), {}, {
|
|
4362
4467
|
type: this.type,
|
|
4363
4468
|
id: this.id
|
|
4364
4469
|
}));
|
|
4365
4470
|
|
|
4366
4471
|
case 3:
|
|
4367
|
-
return
|
|
4472
|
+
return _context45.abrupt("return", _context45.sent);
|
|
4368
4473
|
|
|
4369
4474
|
case 4:
|
|
4370
4475
|
case "end":
|
|
4371
|
-
return
|
|
4476
|
+
return _context45.stop();
|
|
4372
4477
|
}
|
|
4373
4478
|
}
|
|
4374
|
-
},
|
|
4479
|
+
}, _callee45, this);
|
|
4375
4480
|
}));
|
|
4376
4481
|
|
|
4377
|
-
function shadowBan(
|
|
4482
|
+
function shadowBan(_x43, _x44) {
|
|
4378
4483
|
return _shadowBan.apply(this, arguments);
|
|
4379
4484
|
}
|
|
4380
4485
|
|
|
@@ -4390,31 +4495,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4390
4495
|
}, {
|
|
4391
4496
|
key: "removeShadowBan",
|
|
4392
4497
|
value: function () {
|
|
4393
|
-
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4394
|
-
return _regeneratorRuntime.wrap(function
|
|
4498
|
+
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(targetUserID) {
|
|
4499
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
4395
4500
|
while (1) {
|
|
4396
|
-
switch (
|
|
4501
|
+
switch (_context46.prev = _context46.next) {
|
|
4397
4502
|
case 0:
|
|
4398
4503
|
this._checkInitialized();
|
|
4399
4504
|
|
|
4400
|
-
|
|
4505
|
+
_context46.next = 3;
|
|
4401
4506
|
return this.getClient().removeShadowBan(targetUserID, {
|
|
4402
4507
|
type: this.type,
|
|
4403
4508
|
id: this.id
|
|
4404
4509
|
});
|
|
4405
4510
|
|
|
4406
4511
|
case 3:
|
|
4407
|
-
return
|
|
4512
|
+
return _context46.abrupt("return", _context46.sent);
|
|
4408
4513
|
|
|
4409
4514
|
case 4:
|
|
4410
4515
|
case "end":
|
|
4411
|
-
return
|
|
4516
|
+
return _context46.stop();
|
|
4412
4517
|
}
|
|
4413
4518
|
}
|
|
4414
|
-
},
|
|
4519
|
+
}, _callee46, this);
|
|
4415
4520
|
}));
|
|
4416
4521
|
|
|
4417
|
-
function removeShadowBan(
|
|
4522
|
+
function removeShadowBan(_x45) {
|
|
4418
4523
|
return _removeShadowBan.apply(this, arguments);
|
|
4419
4524
|
}
|
|
4420
4525
|
|
|
@@ -4430,26 +4535,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4430
4535
|
}, {
|
|
4431
4536
|
key: "createCall",
|
|
4432
4537
|
value: function () {
|
|
4433
|
-
var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4434
|
-
return _regeneratorRuntime.wrap(function
|
|
4538
|
+
var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(options) {
|
|
4539
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
4435
4540
|
while (1) {
|
|
4436
|
-
switch (
|
|
4541
|
+
switch (_context47.prev = _context47.next) {
|
|
4437
4542
|
case 0:
|
|
4438
|
-
|
|
4543
|
+
_context47.next = 2;
|
|
4439
4544
|
return this.getClient().post(this._channelURL() + '/call', options);
|
|
4440
4545
|
|
|
4441
4546
|
case 2:
|
|
4442
|
-
return
|
|
4547
|
+
return _context47.abrupt("return", _context47.sent);
|
|
4443
4548
|
|
|
4444
4549
|
case 3:
|
|
4445
4550
|
case "end":
|
|
4446
|
-
return
|
|
4551
|
+
return _context47.stop();
|
|
4447
4552
|
}
|
|
4448
4553
|
}
|
|
4449
|
-
},
|
|
4554
|
+
}, _callee47, this);
|
|
4450
4555
|
}));
|
|
4451
4556
|
|
|
4452
|
-
function createCall(
|
|
4557
|
+
function createCall(_x46) {
|
|
4453
4558
|
return _createCall.apply(this, arguments);
|
|
4454
4559
|
}
|
|
4455
4560
|
|
|
@@ -4465,26 +4570,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4465
4570
|
}, {
|
|
4466
4571
|
key: "vote",
|
|
4467
4572
|
value: function () {
|
|
4468
|
-
var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4469
|
-
return _regeneratorRuntime.wrap(function
|
|
4573
|
+
var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(messageId, pollId, _vote) {
|
|
4574
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
4470
4575
|
while (1) {
|
|
4471
|
-
switch (
|
|
4576
|
+
switch (_context48.prev = _context48.next) {
|
|
4472
4577
|
case 0:
|
|
4473
|
-
|
|
4578
|
+
_context48.next = 2;
|
|
4474
4579
|
return this.getClient().castPollVote(messageId, pollId, _vote);
|
|
4475
4580
|
|
|
4476
4581
|
case 2:
|
|
4477
|
-
return
|
|
4582
|
+
return _context48.abrupt("return", _context48.sent);
|
|
4478
4583
|
|
|
4479
4584
|
case 3:
|
|
4480
4585
|
case "end":
|
|
4481
|
-
return
|
|
4586
|
+
return _context48.stop();
|
|
4482
4587
|
}
|
|
4483
4588
|
}
|
|
4484
|
-
},
|
|
4589
|
+
}, _callee48, this);
|
|
4485
4590
|
}));
|
|
4486
4591
|
|
|
4487
|
-
function vote(
|
|
4592
|
+
function vote(_x47, _x48, _x49) {
|
|
4488
4593
|
return _vote2.apply(this, arguments);
|
|
4489
4594
|
}
|
|
4490
4595
|
|
|
@@ -4493,26 +4598,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4493
4598
|
}, {
|
|
4494
4599
|
key: "removeVote",
|
|
4495
4600
|
value: function () {
|
|
4496
|
-
var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4497
|
-
return _regeneratorRuntime.wrap(function
|
|
4601
|
+
var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageId, pollId, voteId) {
|
|
4602
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
4498
4603
|
while (1) {
|
|
4499
|
-
switch (
|
|
4604
|
+
switch (_context49.prev = _context49.next) {
|
|
4500
4605
|
case 0:
|
|
4501
|
-
|
|
4606
|
+
_context49.next = 2;
|
|
4502
4607
|
return this.getClient().removePollVote(messageId, pollId, voteId);
|
|
4503
4608
|
|
|
4504
4609
|
case 2:
|
|
4505
|
-
return
|
|
4610
|
+
return _context49.abrupt("return", _context49.sent);
|
|
4506
4611
|
|
|
4507
4612
|
case 3:
|
|
4508
4613
|
case "end":
|
|
4509
|
-
return
|
|
4614
|
+
return _context49.stop();
|
|
4510
4615
|
}
|
|
4511
4616
|
}
|
|
4512
|
-
},
|
|
4617
|
+
}, _callee49, this);
|
|
4513
4618
|
}));
|
|
4514
4619
|
|
|
4515
|
-
function removeVote(
|
|
4620
|
+
function removeVote(_x50, _x51, _x52) {
|
|
4516
4621
|
return _removeVote.apply(this, arguments);
|
|
4517
4622
|
}
|
|
4518
4623
|
|
|
@@ -4588,7 +4693,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4588
4693
|
}, {
|
|
4589
4694
|
key: "_handleChannelEvent",
|
|
4590
4695
|
value: function _handleChannelEvent(event) {
|
|
4591
|
-
var _event$user, _event$user2, _event$user3, _event$user5, _event$user6, _event$channel, _event$member, _event$user9, _event$user11, _channelState$
|
|
4696
|
+
var _event$user, _event$user2, _event$user3, _event$user5, _event$user6, _event$channel, _event$member, _channelState$members, _event$member2, _event$member2$user, _event$user9, _event$user11, _channelState$members2, _event$user12, _channelState$members3;
|
|
4592
4697
|
|
|
4593
4698
|
var channel = this;
|
|
4594
4699
|
|
|
@@ -4762,8 +4867,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4762
4867
|
|
|
4763
4868
|
case 'member.added':
|
|
4764
4869
|
case 'member.updated':
|
|
4765
|
-
if ((_event$member = event.member) !== null && _event$member !== void 0 && _event$member.
|
|
4766
|
-
channelState.members = _objectSpread$a(_objectSpread$a({}, channelState.members), {}, _defineProperty({}, event.member.
|
|
4870
|
+
if ((_event$member = event.member) !== null && _event$member !== void 0 && _event$member.user) {
|
|
4871
|
+
channelState.members = _objectSpread$a(_objectSpread$a({}, channelState.members), {}, _defineProperty({}, event.member.user.id, event.member));
|
|
4872
|
+
}
|
|
4873
|
+
|
|
4874
|
+
if (typeof ((_channelState$members = channelState.membership.user) === null || _channelState$members === void 0 ? void 0 : _channelState$members.id) === 'string' && typeof ((_event$member2 = event.member) === null || _event$member2 === void 0 ? void 0 : (_event$member2$user = _event$member2.user) === null || _event$member2$user === void 0 ? void 0 : _event$member2$user.id) === 'string' && event.member.user.id === channelState.membership.user.id) {
|
|
4875
|
+
channelState.membership = event.member;
|
|
4767
4876
|
}
|
|
4768
4877
|
|
|
4769
4878
|
break;
|
|
@@ -4773,7 +4882,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4773
4882
|
var newMembers = _objectSpread$a({}, channelState.members);
|
|
4774
4883
|
|
|
4775
4884
|
delete newMembers[event.user.id];
|
|
4776
|
-
channelState.members = newMembers;
|
|
4885
|
+
channelState.members = newMembers; // TODO?: unset membership
|
|
4777
4886
|
}
|
|
4778
4887
|
|
|
4779
4888
|
break;
|
|
@@ -4867,7 +4976,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4867
4976
|
channelState.members[event.user.id] = _objectSpread$a(_objectSpread$a({}, channelState.members[event.user.id] || {}), {}, {
|
|
4868
4977
|
shadow_banned: !!event.shadow,
|
|
4869
4978
|
banned: !event.shadow,
|
|
4870
|
-
user: _objectSpread$a(_objectSpread$a({}, ((_channelState$
|
|
4979
|
+
user: _objectSpread$a(_objectSpread$a({}, ((_channelState$members2 = channelState.members[event.user.id]) === null || _channelState$members2 === void 0 ? void 0 : _channelState$members2.user) || {}), event.user)
|
|
4871
4980
|
});
|
|
4872
4981
|
break;
|
|
4873
4982
|
|
|
@@ -4876,7 +4985,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4876
4985
|
channelState.members[event.user.id] = _objectSpread$a(_objectSpread$a({}, channelState.members[event.user.id] || {}), {}, {
|
|
4877
4986
|
shadow_banned: false,
|
|
4878
4987
|
banned: false,
|
|
4879
|
-
user: _objectSpread$a(_objectSpread$a({}, ((_channelState$
|
|
4988
|
+
user: _objectSpread$a(_objectSpread$a({}, ((_channelState$members3 = channelState.members[event.user.id]) === null || _channelState$members3 === void 0 ? void 0 : _channelState$members3.user) || {}), event.user)
|
|
4880
4989
|
});
|
|
4881
4990
|
break;
|
|
4882
4991
|
} // any event can send over the online count
|
|
@@ -4928,7 +5037,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4928
5037
|
}
|
|
4929
5038
|
}
|
|
4930
5039
|
|
|
4931
|
-
this.state.membership = state.membership
|
|
5040
|
+
this.state.membership = _objectSpread$a(_objectSpread$a({}, this.state.membership), state.membership);
|
|
4932
5041
|
var messages = state.messages || [];
|
|
4933
5042
|
|
|
4934
5043
|
if (!this.state.messages) {
|
|
@@ -14629,7 +14738,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
14629
14738
|
}, {
|
|
14630
14739
|
key: "getUserAgent",
|
|
14631
14740
|
value: function getUserAgent() {
|
|
14632
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.
|
|
14741
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.46.1");
|
|
14633
14742
|
}
|
|
14634
14743
|
}, {
|
|
14635
14744
|
key: "setUserAgent",
|
|
@@ -16866,6 +16975,10 @@ var EVENT_MAP = {
|
|
|
16866
16975
|
'user.updated': true,
|
|
16867
16976
|
'user.watching.start': true,
|
|
16868
16977
|
'user.watching.stop': true,
|
|
16978
|
+
// AI events
|
|
16979
|
+
'ai_indicator.update': true,
|
|
16980
|
+
'ai_indicator.stop': true,
|
|
16981
|
+
'ai_indicator.clear': true,
|
|
16869
16982
|
// local events
|
|
16870
16983
|
'channels.queried': true,
|
|
16871
16984
|
'connection.changed': true,
|