stream-chat 8.27.0 → 8.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.es.js +44 -18
- 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 +44 -18
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +44 -18
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +44 -18
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +4 -2
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/client.d.ts +18 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/types.d.ts +10 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channel.ts +4 -0
- package/src/types.ts +10 -5
- package/src/utils.ts +31 -0
package/dist/browser.js
CHANGED
|
@@ -390,7 +390,8 @@ function formatMessage(message) {
|
|
|
390
390
|
pinned_at: message.pinned_at ? new Date(message.pinned_at) : null,
|
|
391
391
|
created_at: message.created_at ? new Date(message.created_at) : new Date(),
|
|
392
392
|
updated_at: message.updated_at ? new Date(message.updated_at) : new Date(),
|
|
393
|
-
status: message.status || 'received'
|
|
393
|
+
status: message.status || 'received',
|
|
394
|
+
reaction_groups: maybeGetReactionGroupsFallback(message.reaction_groups, message.reaction_counts, message.reaction_scores)
|
|
394
395
|
});
|
|
395
396
|
}
|
|
396
397
|
function addToMessageList(messages, message) {
|
|
@@ -457,6 +458,28 @@ function addToMessageList(messages, message) {
|
|
|
457
458
|
return _toConsumableArray__default['default'](messageArr);
|
|
458
459
|
}
|
|
459
460
|
|
|
461
|
+
function maybeGetReactionGroupsFallback(groups, counts, scores) {
|
|
462
|
+
if (groups) {
|
|
463
|
+
return groups;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
if (counts && scores) {
|
|
467
|
+
var fallback = {};
|
|
468
|
+
|
|
469
|
+
for (var _i2 = 0, _Object$keys = Object.keys(counts); _i2 < _Object$keys.length; _i2++) {
|
|
470
|
+
var type = _Object$keys[_i2];
|
|
471
|
+
fallback[type] = {
|
|
472
|
+
count: counts[type],
|
|
473
|
+
sum_scores: scores[type]
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
return fallback;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
return null;
|
|
481
|
+
}
|
|
482
|
+
|
|
460
483
|
function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
461
484
|
|
|
462
485
|
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$7(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -3148,16 +3171,19 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3148
3171
|
}, {
|
|
3149
3172
|
key: "getReplies",
|
|
3150
3173
|
value: function () {
|
|
3151
|
-
var _getReplies = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee30(parent_id, options) {
|
|
3152
|
-
var data;
|
|
3174
|
+
var _getReplies = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee30(parent_id, options, sort) {
|
|
3175
|
+
var normalizedSort, data;
|
|
3153
3176
|
return _regeneratorRuntime__default['default'].wrap(function _callee30$(_context30) {
|
|
3154
3177
|
while (1) {
|
|
3155
3178
|
switch (_context30.prev = _context30.next) {
|
|
3156
3179
|
case 0:
|
|
3157
|
-
|
|
3158
|
-
|
|
3180
|
+
normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
|
|
3181
|
+
_context30.next = 3;
|
|
3182
|
+
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(parent_id, "/replies"), _objectSpread$6({
|
|
3183
|
+
sort: normalizedSort
|
|
3184
|
+
}, options));
|
|
3159
3185
|
|
|
3160
|
-
case
|
|
3186
|
+
case 3:
|
|
3161
3187
|
data = _context30.sent;
|
|
3162
3188
|
|
|
3163
3189
|
// add any messages to our thread state
|
|
@@ -3167,7 +3193,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3167
3193
|
|
|
3168
3194
|
return _context30.abrupt("return", data);
|
|
3169
3195
|
|
|
3170
|
-
case
|
|
3196
|
+
case 6:
|
|
3171
3197
|
case "end":
|
|
3172
3198
|
return _context30.stop();
|
|
3173
3199
|
}
|
|
@@ -3175,7 +3201,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3175
3201
|
}, _callee30, this);
|
|
3176
3202
|
}));
|
|
3177
3203
|
|
|
3178
|
-
function getReplies(_x31, _x32) {
|
|
3204
|
+
function getReplies(_x31, _x32, _x33) {
|
|
3179
3205
|
return _getReplies.apply(this, arguments);
|
|
3180
3206
|
}
|
|
3181
3207
|
|
|
@@ -3219,7 +3245,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3219
3245
|
}, _callee31, this);
|
|
3220
3246
|
}));
|
|
3221
3247
|
|
|
3222
|
-
function getPinnedMessages(
|
|
3248
|
+
function getPinnedMessages(_x34) {
|
|
3223
3249
|
return _getPinnedMessages.apply(this, arguments);
|
|
3224
3250
|
}
|
|
3225
3251
|
|
|
@@ -3449,7 +3475,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3449
3475
|
}, _callee32, this);
|
|
3450
3476
|
}));
|
|
3451
3477
|
|
|
3452
|
-
function query(
|
|
3478
|
+
function query(_x35) {
|
|
3453
3479
|
return _query.apply(this, arguments);
|
|
3454
3480
|
}
|
|
3455
3481
|
|
|
@@ -3490,7 +3516,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3490
3516
|
}, _callee33, this);
|
|
3491
3517
|
}));
|
|
3492
3518
|
|
|
3493
|
-
function banUser(
|
|
3519
|
+
function banUser(_x36, _x37) {
|
|
3494
3520
|
return _banUser.apply(this, arguments);
|
|
3495
3521
|
}
|
|
3496
3522
|
|
|
@@ -3621,7 +3647,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3621
3647
|
}, _callee36, this);
|
|
3622
3648
|
}));
|
|
3623
3649
|
|
|
3624
|
-
function unbanUser(
|
|
3650
|
+
function unbanUser(_x38) {
|
|
3625
3651
|
return _unbanUser.apply(this, arguments);
|
|
3626
3652
|
}
|
|
3627
3653
|
|
|
@@ -3662,7 +3688,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3662
3688
|
}, _callee37, this);
|
|
3663
3689
|
}));
|
|
3664
3690
|
|
|
3665
|
-
function shadowBan(
|
|
3691
|
+
function shadowBan(_x39, _x40) {
|
|
3666
3692
|
return _shadowBan.apply(this, arguments);
|
|
3667
3693
|
}
|
|
3668
3694
|
|
|
@@ -3702,7 +3728,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3702
3728
|
}, _callee38, this);
|
|
3703
3729
|
}));
|
|
3704
3730
|
|
|
3705
|
-
function removeShadowBan(
|
|
3731
|
+
function removeShadowBan(_x41) {
|
|
3706
3732
|
return _removeShadowBan.apply(this, arguments);
|
|
3707
3733
|
}
|
|
3708
3734
|
|
|
@@ -3737,7 +3763,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3737
3763
|
}, _callee39, this);
|
|
3738
3764
|
}));
|
|
3739
3765
|
|
|
3740
|
-
function createCall(
|
|
3766
|
+
function createCall(_x42) {
|
|
3741
3767
|
return _createCall.apply(this, arguments);
|
|
3742
3768
|
}
|
|
3743
3769
|
|
|
@@ -3772,7 +3798,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3772
3798
|
}, _callee40, this);
|
|
3773
3799
|
}));
|
|
3774
3800
|
|
|
3775
|
-
function vote(
|
|
3801
|
+
function vote(_x43, _x44, _x45) {
|
|
3776
3802
|
return _vote2.apply(this, arguments);
|
|
3777
3803
|
}
|
|
3778
3804
|
|
|
@@ -3800,7 +3826,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3800
3826
|
}, _callee41, this);
|
|
3801
3827
|
}));
|
|
3802
3828
|
|
|
3803
|
-
function removeVote(
|
|
3829
|
+
function removeVote(_x46, _x47, _x48) {
|
|
3804
3830
|
return _removeVote.apply(this, arguments);
|
|
3805
3831
|
}
|
|
3806
3832
|
|
|
@@ -11417,7 +11443,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11417
11443
|
}, {
|
|
11418
11444
|
key: "getUserAgent",
|
|
11419
11445
|
value: function getUserAgent() {
|
|
11420
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.
|
|
11446
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.29.0");
|
|
11421
11447
|
}
|
|
11422
11448
|
}, {
|
|
11423
11449
|
key: "setUserAgent",
|