stream-chat 8.42.0 → 8.43.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 +531 -161
- 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 +531 -161
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +531 -161
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +531 -161
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +62 -2
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/moderation.d.ts +30 -1
- package/dist/types/moderation.d.ts.map +1 -1
- package/dist/types/types.d.ts +27 -4
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channel.ts +91 -2
- package/src/moderation.ts +64 -0
- package/src/types.ts +34 -4
package/dist/browser.es.js
CHANGED
|
@@ -3202,6 +3202,258 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3202
3202
|
|
|
3203
3203
|
return unmute;
|
|
3204
3204
|
}()
|
|
3205
|
+
/**
|
|
3206
|
+
* archive - archives the current channel
|
|
3207
|
+
* @param {{ user_id?: string }} opts user_id if called server side
|
|
3208
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} The server response
|
|
3209
|
+
*
|
|
3210
|
+
* example:
|
|
3211
|
+
* await channel.archives();
|
|
3212
|
+
*
|
|
3213
|
+
* example server side:
|
|
3214
|
+
* await channel.archive({user_id: userId});
|
|
3215
|
+
*
|
|
3216
|
+
*/
|
|
3217
|
+
|
|
3218
|
+
}, {
|
|
3219
|
+
key: "archive",
|
|
3220
|
+
value: function () {
|
|
3221
|
+
var _archive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
|
|
3222
|
+
var opts,
|
|
3223
|
+
cli,
|
|
3224
|
+
uid,
|
|
3225
|
+
resp,
|
|
3226
|
+
_args25 = arguments;
|
|
3227
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
3228
|
+
while (1) {
|
|
3229
|
+
switch (_context25.prev = _context25.next) {
|
|
3230
|
+
case 0:
|
|
3231
|
+
opts = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
|
|
3232
|
+
cli = this.getClient();
|
|
3233
|
+
uid = opts.user_id || cli.userID;
|
|
3234
|
+
|
|
3235
|
+
if (uid) {
|
|
3236
|
+
_context25.next = 5;
|
|
3237
|
+
break;
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
throw Error('A user_id is required for archiving a channel');
|
|
3241
|
+
|
|
3242
|
+
case 5:
|
|
3243
|
+
_context25.next = 7;
|
|
3244
|
+
return this.partialUpdateMember(uid, {
|
|
3245
|
+
set: {
|
|
3246
|
+
archived: true
|
|
3247
|
+
}
|
|
3248
|
+
});
|
|
3249
|
+
|
|
3250
|
+
case 7:
|
|
3251
|
+
resp = _context25.sent;
|
|
3252
|
+
return _context25.abrupt("return", resp.channel_member);
|
|
3253
|
+
|
|
3254
|
+
case 9:
|
|
3255
|
+
case "end":
|
|
3256
|
+
return _context25.stop();
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
}, _callee25, this);
|
|
3260
|
+
}));
|
|
3261
|
+
|
|
3262
|
+
function archive() {
|
|
3263
|
+
return _archive.apply(this, arguments);
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3266
|
+
return archive;
|
|
3267
|
+
}()
|
|
3268
|
+
/**
|
|
3269
|
+
* unarchive - unarchives the current channel
|
|
3270
|
+
* @param {{ user_id?: string }} opts user_id if called server side
|
|
3271
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} The server response
|
|
3272
|
+
*
|
|
3273
|
+
* example:
|
|
3274
|
+
* await channel.unarchive();
|
|
3275
|
+
*
|
|
3276
|
+
* example server side:
|
|
3277
|
+
* await channel.unarchive({user_id: userId});
|
|
3278
|
+
*
|
|
3279
|
+
*/
|
|
3280
|
+
|
|
3281
|
+
}, {
|
|
3282
|
+
key: "unarchive",
|
|
3283
|
+
value: function () {
|
|
3284
|
+
var _unarchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
|
|
3285
|
+
var opts,
|
|
3286
|
+
cli,
|
|
3287
|
+
uid,
|
|
3288
|
+
resp,
|
|
3289
|
+
_args26 = arguments;
|
|
3290
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
3291
|
+
while (1) {
|
|
3292
|
+
switch (_context26.prev = _context26.next) {
|
|
3293
|
+
case 0:
|
|
3294
|
+
opts = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
|
|
3295
|
+
cli = this.getClient();
|
|
3296
|
+
uid = opts.user_id || cli.userID;
|
|
3297
|
+
|
|
3298
|
+
if (uid) {
|
|
3299
|
+
_context26.next = 5;
|
|
3300
|
+
break;
|
|
3301
|
+
}
|
|
3302
|
+
|
|
3303
|
+
throw Error('A user_id is required for unarchiving a channel');
|
|
3304
|
+
|
|
3305
|
+
case 5:
|
|
3306
|
+
_context26.next = 7;
|
|
3307
|
+
return this.partialUpdateMember(uid, {
|
|
3308
|
+
set: {
|
|
3309
|
+
archived: false
|
|
3310
|
+
}
|
|
3311
|
+
});
|
|
3312
|
+
|
|
3313
|
+
case 7:
|
|
3314
|
+
resp = _context26.sent;
|
|
3315
|
+
return _context26.abrupt("return", resp.channel_member);
|
|
3316
|
+
|
|
3317
|
+
case 9:
|
|
3318
|
+
case "end":
|
|
3319
|
+
return _context26.stop();
|
|
3320
|
+
}
|
|
3321
|
+
}
|
|
3322
|
+
}, _callee26, this);
|
|
3323
|
+
}));
|
|
3324
|
+
|
|
3325
|
+
function unarchive() {
|
|
3326
|
+
return _unarchive.apply(this, arguments);
|
|
3327
|
+
}
|
|
3328
|
+
|
|
3329
|
+
return unarchive;
|
|
3330
|
+
}()
|
|
3331
|
+
/**
|
|
3332
|
+
* pin - pins the current channel
|
|
3333
|
+
* @param {{ user_id?: string }} opts user_id if called server side
|
|
3334
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} The server response
|
|
3335
|
+
*
|
|
3336
|
+
* example:
|
|
3337
|
+
* await channel.pin();
|
|
3338
|
+
*
|
|
3339
|
+
* example server side:
|
|
3340
|
+
* await channel.pin({user_id: userId});
|
|
3341
|
+
*
|
|
3342
|
+
*/
|
|
3343
|
+
|
|
3344
|
+
}, {
|
|
3345
|
+
key: "pin",
|
|
3346
|
+
value: function () {
|
|
3347
|
+
var _pin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
|
|
3348
|
+
var opts,
|
|
3349
|
+
cli,
|
|
3350
|
+
uid,
|
|
3351
|
+
resp,
|
|
3352
|
+
_args27 = arguments;
|
|
3353
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
3354
|
+
while (1) {
|
|
3355
|
+
switch (_context27.prev = _context27.next) {
|
|
3356
|
+
case 0:
|
|
3357
|
+
opts = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
|
|
3358
|
+
cli = this.getClient();
|
|
3359
|
+
uid = opts.user_id || cli.userID;
|
|
3360
|
+
|
|
3361
|
+
if (uid) {
|
|
3362
|
+
_context27.next = 5;
|
|
3363
|
+
break;
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3366
|
+
throw Error('A user_id is required for pinning a channel');
|
|
3367
|
+
|
|
3368
|
+
case 5:
|
|
3369
|
+
_context27.next = 7;
|
|
3370
|
+
return this.partialUpdateMember(uid, {
|
|
3371
|
+
set: {
|
|
3372
|
+
pinned: true
|
|
3373
|
+
}
|
|
3374
|
+
});
|
|
3375
|
+
|
|
3376
|
+
case 7:
|
|
3377
|
+
resp = _context27.sent;
|
|
3378
|
+
return _context27.abrupt("return", resp.channel_member);
|
|
3379
|
+
|
|
3380
|
+
case 9:
|
|
3381
|
+
case "end":
|
|
3382
|
+
return _context27.stop();
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
}, _callee27, this);
|
|
3386
|
+
}));
|
|
3387
|
+
|
|
3388
|
+
function pin() {
|
|
3389
|
+
return _pin.apply(this, arguments);
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
return pin;
|
|
3393
|
+
}()
|
|
3394
|
+
/**
|
|
3395
|
+
* unpin - unpins the current channel
|
|
3396
|
+
* @param {{ user_id?: string }} opts user_id if called server side
|
|
3397
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} The server response
|
|
3398
|
+
*
|
|
3399
|
+
* example:
|
|
3400
|
+
* await channel.unpin();
|
|
3401
|
+
*
|
|
3402
|
+
* example server side:
|
|
3403
|
+
* await channel.unpin({user_id: userId});
|
|
3404
|
+
*
|
|
3405
|
+
*/
|
|
3406
|
+
|
|
3407
|
+
}, {
|
|
3408
|
+
key: "unpin",
|
|
3409
|
+
value: function () {
|
|
3410
|
+
var _unpin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
|
|
3411
|
+
var opts,
|
|
3412
|
+
cli,
|
|
3413
|
+
uid,
|
|
3414
|
+
resp,
|
|
3415
|
+
_args28 = arguments;
|
|
3416
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
3417
|
+
while (1) {
|
|
3418
|
+
switch (_context28.prev = _context28.next) {
|
|
3419
|
+
case 0:
|
|
3420
|
+
opts = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {};
|
|
3421
|
+
cli = this.getClient();
|
|
3422
|
+
uid = opts.user_id || cli.userID;
|
|
3423
|
+
|
|
3424
|
+
if (uid) {
|
|
3425
|
+
_context28.next = 5;
|
|
3426
|
+
break;
|
|
3427
|
+
}
|
|
3428
|
+
|
|
3429
|
+
throw Error('A user_id is required for unpinning a channel');
|
|
3430
|
+
|
|
3431
|
+
case 5:
|
|
3432
|
+
_context28.next = 7;
|
|
3433
|
+
return this.partialUpdateMember(uid, {
|
|
3434
|
+
set: {
|
|
3435
|
+
pinned: false
|
|
3436
|
+
}
|
|
3437
|
+
});
|
|
3438
|
+
|
|
3439
|
+
case 7:
|
|
3440
|
+
resp = _context28.sent;
|
|
3441
|
+
return _context28.abrupt("return", resp.channel_member);
|
|
3442
|
+
|
|
3443
|
+
case 9:
|
|
3444
|
+
case "end":
|
|
3445
|
+
return _context28.stop();
|
|
3446
|
+
}
|
|
3447
|
+
}
|
|
3448
|
+
}, _callee28, this);
|
|
3449
|
+
}));
|
|
3450
|
+
|
|
3451
|
+
function unpin() {
|
|
3452
|
+
return _unpin.apply(this, arguments);
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
return unpin;
|
|
3456
|
+
}()
|
|
3205
3457
|
/**
|
|
3206
3458
|
* muteStatus - returns the mute status for the current channel
|
|
3207
3459
|
* @return {{ muted: boolean; createdAt: Date | null; expiresAt: Date | null }} { muted: true | false, createdAt: Date | null, expiresAt: Date | null}
|
|
@@ -3240,18 +3492,18 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3240
3492
|
}, {
|
|
3241
3493
|
key: "keystroke",
|
|
3242
3494
|
value: function () {
|
|
3243
|
-
var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3495
|
+
var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(parent_id, options) {
|
|
3244
3496
|
var now, diff;
|
|
3245
|
-
return _regeneratorRuntime.wrap(function
|
|
3497
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
3246
3498
|
while (1) {
|
|
3247
|
-
switch (
|
|
3499
|
+
switch (_context29.prev = _context29.next) {
|
|
3248
3500
|
case 0:
|
|
3249
3501
|
if (this._isTypingIndicatorsEnabled()) {
|
|
3250
|
-
|
|
3502
|
+
_context29.next = 2;
|
|
3251
3503
|
break;
|
|
3252
3504
|
}
|
|
3253
3505
|
|
|
3254
|
-
return
|
|
3506
|
+
return _context29.abrupt("return");
|
|
3255
3507
|
|
|
3256
3508
|
case 2:
|
|
3257
3509
|
now = new Date();
|
|
@@ -3260,12 +3512,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3260
3512
|
this.isTyping = true; // send a typing.start every 2 seconds
|
|
3261
3513
|
|
|
3262
3514
|
if (!(diff === null || diff > 2000)) {
|
|
3263
|
-
|
|
3515
|
+
_context29.next = 10;
|
|
3264
3516
|
break;
|
|
3265
3517
|
}
|
|
3266
3518
|
|
|
3267
3519
|
this.lastTypingEvent = new Date();
|
|
3268
|
-
|
|
3520
|
+
_context29.next = 10;
|
|
3269
3521
|
return this.sendEvent(_objectSpread$a({
|
|
3270
3522
|
type: 'typing.start',
|
|
3271
3523
|
parent_id: parent_id
|
|
@@ -3273,10 +3525,10 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3273
3525
|
|
|
3274
3526
|
case 10:
|
|
3275
3527
|
case "end":
|
|
3276
|
-
return
|
|
3528
|
+
return _context29.stop();
|
|
3277
3529
|
}
|
|
3278
3530
|
}
|
|
3279
|
-
},
|
|
3531
|
+
}, _callee29, this);
|
|
3280
3532
|
}));
|
|
3281
3533
|
|
|
3282
3534
|
function keystroke(_x27, _x28) {
|
|
@@ -3294,22 +3546,22 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3294
3546
|
}, {
|
|
3295
3547
|
key: "stopTyping",
|
|
3296
3548
|
value: function () {
|
|
3297
|
-
var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3298
|
-
return _regeneratorRuntime.wrap(function
|
|
3549
|
+
var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(parent_id, options) {
|
|
3550
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
3299
3551
|
while (1) {
|
|
3300
|
-
switch (
|
|
3552
|
+
switch (_context30.prev = _context30.next) {
|
|
3301
3553
|
case 0:
|
|
3302
3554
|
if (this._isTypingIndicatorsEnabled()) {
|
|
3303
|
-
|
|
3555
|
+
_context30.next = 2;
|
|
3304
3556
|
break;
|
|
3305
3557
|
}
|
|
3306
3558
|
|
|
3307
|
-
return
|
|
3559
|
+
return _context30.abrupt("return");
|
|
3308
3560
|
|
|
3309
3561
|
case 2:
|
|
3310
3562
|
this.lastTypingEvent = null;
|
|
3311
3563
|
this.isTyping = false;
|
|
3312
|
-
|
|
3564
|
+
_context30.next = 6;
|
|
3313
3565
|
return this.sendEvent(_objectSpread$a({
|
|
3314
3566
|
type: 'typing.stop',
|
|
3315
3567
|
parent_id: parent_id
|
|
@@ -3317,10 +3569,10 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3317
3569
|
|
|
3318
3570
|
case 6:
|
|
3319
3571
|
case "end":
|
|
3320
|
-
return
|
|
3572
|
+
return _context30.stop();
|
|
3321
3573
|
}
|
|
3322
3574
|
}
|
|
3323
|
-
},
|
|
3575
|
+
}, _callee30, this);
|
|
3324
3576
|
}));
|
|
3325
3577
|
|
|
3326
3578
|
function stopTyping(_x29, _x30) {
|
|
@@ -3375,39 +3627,39 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3375
3627
|
}, {
|
|
3376
3628
|
key: "markRead",
|
|
3377
3629
|
value: function () {
|
|
3378
|
-
var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3630
|
+
var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
|
|
3379
3631
|
var _this$getConfig2;
|
|
3380
3632
|
|
|
3381
3633
|
var data,
|
|
3382
|
-
|
|
3383
|
-
return _regeneratorRuntime.wrap(function
|
|
3634
|
+
_args31 = arguments;
|
|
3635
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
3384
3636
|
while (1) {
|
|
3385
|
-
switch (
|
|
3637
|
+
switch (_context31.prev = _context31.next) {
|
|
3386
3638
|
case 0:
|
|
3387
|
-
data =
|
|
3639
|
+
data = _args31.length > 0 && _args31[0] !== undefined ? _args31[0] : {};
|
|
3388
3640
|
|
|
3389
3641
|
this._checkInitialized();
|
|
3390
3642
|
|
|
3391
3643
|
if (!(!((_this$getConfig2 = this.getConfig()) !== null && _this$getConfig2 !== void 0 && _this$getConfig2.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
3392
|
-
|
|
3644
|
+
_context31.next = 4;
|
|
3393
3645
|
break;
|
|
3394
3646
|
}
|
|
3395
3647
|
|
|
3396
|
-
return
|
|
3648
|
+
return _context31.abrupt("return", Promise.resolve(null));
|
|
3397
3649
|
|
|
3398
3650
|
case 4:
|
|
3399
|
-
|
|
3651
|
+
_context31.next = 6;
|
|
3400
3652
|
return this.getClient().post(this._channelURL() + '/read', _objectSpread$a({}, data));
|
|
3401
3653
|
|
|
3402
3654
|
case 6:
|
|
3403
|
-
return
|
|
3655
|
+
return _context31.abrupt("return", _context31.sent);
|
|
3404
3656
|
|
|
3405
3657
|
case 7:
|
|
3406
3658
|
case "end":
|
|
3407
|
-
return
|
|
3659
|
+
return _context31.stop();
|
|
3408
3660
|
}
|
|
3409
3661
|
}
|
|
3410
|
-
},
|
|
3662
|
+
}, _callee31, this);
|
|
3411
3663
|
}));
|
|
3412
3664
|
|
|
3413
3665
|
function markRead() {
|
|
@@ -3426,35 +3678,35 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3426
3678
|
}, {
|
|
3427
3679
|
key: "markUnread",
|
|
3428
3680
|
value: function () {
|
|
3429
|
-
var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3681
|
+
var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(data) {
|
|
3430
3682
|
var _this$getConfig3;
|
|
3431
3683
|
|
|
3432
|
-
return _regeneratorRuntime.wrap(function
|
|
3684
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
3433
3685
|
while (1) {
|
|
3434
|
-
switch (
|
|
3686
|
+
switch (_context32.prev = _context32.next) {
|
|
3435
3687
|
case 0:
|
|
3436
3688
|
this._checkInitialized();
|
|
3437
3689
|
|
|
3438
3690
|
if (!(!((_this$getConfig3 = this.getConfig()) !== null && _this$getConfig3 !== void 0 && _this$getConfig3.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
3439
|
-
|
|
3691
|
+
_context32.next = 3;
|
|
3440
3692
|
break;
|
|
3441
3693
|
}
|
|
3442
3694
|
|
|
3443
|
-
return
|
|
3695
|
+
return _context32.abrupt("return", Promise.resolve(null));
|
|
3444
3696
|
|
|
3445
3697
|
case 3:
|
|
3446
|
-
|
|
3698
|
+
_context32.next = 5;
|
|
3447
3699
|
return this.getClient().post(this._channelURL() + '/unread', _objectSpread$a({}, data));
|
|
3448
3700
|
|
|
3449
3701
|
case 5:
|
|
3450
|
-
return
|
|
3702
|
+
return _context32.abrupt("return", _context32.sent);
|
|
3451
3703
|
|
|
3452
3704
|
case 6:
|
|
3453
3705
|
case "end":
|
|
3454
|
-
return
|
|
3706
|
+
return _context32.stop();
|
|
3455
3707
|
}
|
|
3456
3708
|
}
|
|
3457
|
-
},
|
|
3709
|
+
}, _callee32, this);
|
|
3458
3710
|
}));
|
|
3459
3711
|
|
|
3460
3712
|
function markUnread(_x31) {
|
|
@@ -3492,11 +3744,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3492
3744
|
}, {
|
|
3493
3745
|
key: "watch",
|
|
3494
3746
|
value: function () {
|
|
3495
|
-
var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3747
|
+
var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(options) {
|
|
3496
3748
|
var defaultOptions, combined, state;
|
|
3497
|
-
return _regeneratorRuntime.wrap(function
|
|
3749
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
3498
3750
|
while (1) {
|
|
3499
|
-
switch (
|
|
3751
|
+
switch (_context33.prev = _context33.next) {
|
|
3500
3752
|
case 0:
|
|
3501
3753
|
defaultOptions = {
|
|
3502
3754
|
state: true,
|
|
@@ -3504,7 +3756,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3504
3756
|
presence: false
|
|
3505
3757
|
}; // Make sure we wait for the connect promise if there is a pending one
|
|
3506
3758
|
|
|
3507
|
-
|
|
3759
|
+
_context33.next = 3;
|
|
3508
3760
|
return this.getClient().wsPromise;
|
|
3509
3761
|
|
|
3510
3762
|
case 3:
|
|
@@ -3513,11 +3765,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3513
3765
|
}
|
|
3514
3766
|
|
|
3515
3767
|
combined = _objectSpread$a(_objectSpread$a({}, defaultOptions), options);
|
|
3516
|
-
|
|
3768
|
+
_context33.next = 7;
|
|
3517
3769
|
return this.query(combined, 'latest');
|
|
3518
3770
|
|
|
3519
3771
|
case 7:
|
|
3520
|
-
state =
|
|
3772
|
+
state = _context33.sent;
|
|
3521
3773
|
this.initialized = true;
|
|
3522
3774
|
this.data = state.channel;
|
|
3523
3775
|
|
|
@@ -3526,14 +3778,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3526
3778
|
channel: this
|
|
3527
3779
|
});
|
|
3528
3780
|
|
|
3529
|
-
return
|
|
3781
|
+
return _context33.abrupt("return", state);
|
|
3530
3782
|
|
|
3531
3783
|
case 12:
|
|
3532
3784
|
case "end":
|
|
3533
|
-
return
|
|
3785
|
+
return _context33.stop();
|
|
3534
3786
|
}
|
|
3535
3787
|
}
|
|
3536
|
-
},
|
|
3788
|
+
}, _callee33, this);
|
|
3537
3789
|
}));
|
|
3538
3790
|
|
|
3539
3791
|
function watch(_x32) {
|
|
@@ -3551,31 +3803,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3551
3803
|
}, {
|
|
3552
3804
|
key: "stopWatching",
|
|
3553
3805
|
value: function () {
|
|
3554
|
-
var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3806
|
+
var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
|
|
3555
3807
|
var response;
|
|
3556
|
-
return _regeneratorRuntime.wrap(function
|
|
3808
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
3557
3809
|
while (1) {
|
|
3558
|
-
switch (
|
|
3810
|
+
switch (_context34.prev = _context34.next) {
|
|
3559
3811
|
case 0:
|
|
3560
|
-
|
|
3812
|
+
_context34.next = 2;
|
|
3561
3813
|
return this.getClient().post(this._channelURL() + '/stop-watching', {});
|
|
3562
3814
|
|
|
3563
3815
|
case 2:
|
|
3564
|
-
response =
|
|
3816
|
+
response = _context34.sent;
|
|
3565
3817
|
|
|
3566
3818
|
this._client.logger('info', "channel:watch() - stopped watching channel ".concat(this.cid), {
|
|
3567
3819
|
tags: ['channel'],
|
|
3568
3820
|
channel: this
|
|
3569
3821
|
});
|
|
3570
3822
|
|
|
3571
|
-
return
|
|
3823
|
+
return _context34.abrupt("return", response);
|
|
3572
3824
|
|
|
3573
3825
|
case 5:
|
|
3574
3826
|
case "end":
|
|
3575
|
-
return
|
|
3827
|
+
return _context34.stop();
|
|
3576
3828
|
}
|
|
3577
3829
|
}
|
|
3578
|
-
},
|
|
3830
|
+
}, _callee34, this);
|
|
3579
3831
|
}));
|
|
3580
3832
|
|
|
3581
3833
|
function stopWatching() {
|
|
@@ -3598,34 +3850,34 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3598
3850
|
}, {
|
|
3599
3851
|
key: "getReplies",
|
|
3600
3852
|
value: function () {
|
|
3601
|
-
var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3853
|
+
var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(parent_id, options, sort) {
|
|
3602
3854
|
var normalizedSort, data;
|
|
3603
|
-
return _regeneratorRuntime.wrap(function
|
|
3855
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
3604
3856
|
while (1) {
|
|
3605
|
-
switch (
|
|
3857
|
+
switch (_context35.prev = _context35.next) {
|
|
3606
3858
|
case 0:
|
|
3607
3859
|
normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
|
|
3608
|
-
|
|
3860
|
+
_context35.next = 3;
|
|
3609
3861
|
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(parent_id), "/replies"), _objectSpread$a({
|
|
3610
3862
|
sort: normalizedSort
|
|
3611
3863
|
}, options));
|
|
3612
3864
|
|
|
3613
3865
|
case 3:
|
|
3614
|
-
data =
|
|
3866
|
+
data = _context35.sent;
|
|
3615
3867
|
|
|
3616
3868
|
// add any messages to our thread state
|
|
3617
3869
|
if (data.messages) {
|
|
3618
3870
|
this.state.addMessagesSorted(data.messages);
|
|
3619
3871
|
}
|
|
3620
3872
|
|
|
3621
|
-
return
|
|
3873
|
+
return _context35.abrupt("return", data);
|
|
3622
3874
|
|
|
3623
3875
|
case 6:
|
|
3624
3876
|
case "end":
|
|
3625
|
-
return
|
|
3877
|
+
return _context35.stop();
|
|
3626
3878
|
}
|
|
3627
3879
|
}
|
|
3628
|
-
},
|
|
3880
|
+
}, _callee35, this);
|
|
3629
3881
|
}));
|
|
3630
3882
|
|
|
3631
3883
|
function getReplies(_x33, _x34, _x35) {
|
|
@@ -3646,15 +3898,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3646
3898
|
}, {
|
|
3647
3899
|
key: "getPinnedMessages",
|
|
3648
3900
|
value: function () {
|
|
3649
|
-
var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3901
|
+
var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(options) {
|
|
3650
3902
|
var sort,
|
|
3651
|
-
|
|
3652
|
-
return _regeneratorRuntime.wrap(function
|
|
3903
|
+
_args36 = arguments;
|
|
3904
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
3653
3905
|
while (1) {
|
|
3654
|
-
switch (
|
|
3906
|
+
switch (_context36.prev = _context36.next) {
|
|
3655
3907
|
case 0:
|
|
3656
|
-
sort =
|
|
3657
|
-
|
|
3908
|
+
sort = _args36.length > 1 && _args36[1] !== undefined ? _args36[1] : [];
|
|
3909
|
+
_context36.next = 3;
|
|
3658
3910
|
return this.getClient().get(this._channelURL() + '/pinned_messages', {
|
|
3659
3911
|
payload: _objectSpread$a(_objectSpread$a({}, options), {}, {
|
|
3660
3912
|
sort: normalizeQuerySort(sort)
|
|
@@ -3662,14 +3914,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3662
3914
|
});
|
|
3663
3915
|
|
|
3664
3916
|
case 3:
|
|
3665
|
-
return
|
|
3917
|
+
return _context36.abrupt("return", _context36.sent);
|
|
3666
3918
|
|
|
3667
3919
|
case 4:
|
|
3668
3920
|
case "end":
|
|
3669
|
-
return
|
|
3921
|
+
return _context36.stop();
|
|
3670
3922
|
}
|
|
3671
3923
|
}
|
|
3672
|
-
},
|
|
3924
|
+
}, _callee36, this);
|
|
3673
3925
|
}));
|
|
3674
3926
|
|
|
3675
3927
|
function getPinnedMessages(_x36) {
|
|
@@ -3808,7 +4060,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3808
4060
|
* @return {Promise<QueryChannelAPIResponse<StreamChatGenerics>>} Returns a query response
|
|
3809
4061
|
*/
|
|
3810
4062
|
function () {
|
|
3811
|
-
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4063
|
+
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(options) {
|
|
3812
4064
|
var _options$messages$lim, _options$messages, _this$data6, _this$data7;
|
|
3813
4065
|
|
|
3814
4066
|
var messageSetToAddToIfDoesNotExist,
|
|
@@ -3819,14 +4071,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3819
4071
|
_this$_initializeStat,
|
|
3820
4072
|
messageSet,
|
|
3821
4073
|
areCapabilitiesChanged,
|
|
3822
|
-
|
|
4074
|
+
_args37 = arguments;
|
|
3823
4075
|
|
|
3824
|
-
return _regeneratorRuntime.wrap(function
|
|
4076
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
3825
4077
|
while (1) {
|
|
3826
|
-
switch (
|
|
4078
|
+
switch (_context37.prev = _context37.next) {
|
|
3827
4079
|
case 0:
|
|
3828
|
-
messageSetToAddToIfDoesNotExist =
|
|
3829
|
-
|
|
4080
|
+
messageSetToAddToIfDoesNotExist = _args37.length > 1 && _args37[1] !== undefined ? _args37[1] : 'current';
|
|
4081
|
+
_context37.next = 3;
|
|
3830
4082
|
return this.getClient().wsPromise;
|
|
3831
4083
|
|
|
3832
4084
|
case 3:
|
|
@@ -3836,14 +4088,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3836
4088
|
queryURL += "/".concat(encodeURIComponent(this.id));
|
|
3837
4089
|
}
|
|
3838
4090
|
|
|
3839
|
-
|
|
4091
|
+
_context37.next = 7;
|
|
3840
4092
|
return this.getClient().post(queryURL + '/query', _objectSpread$a({
|
|
3841
4093
|
data: this._data,
|
|
3842
4094
|
state: true
|
|
3843
4095
|
}, options));
|
|
3844
4096
|
|
|
3845
4097
|
case 7:
|
|
3846
|
-
state =
|
|
4098
|
+
state = _context37.sent;
|
|
3847
4099
|
|
|
3848
4100
|
// update the channel id if it was missing
|
|
3849
4101
|
if (!this.id) {
|
|
@@ -3899,14 +4151,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3899
4151
|
isLatestMessageSet: messageSet.isLatest
|
|
3900
4152
|
}
|
|
3901
4153
|
});
|
|
3902
|
-
return
|
|
4154
|
+
return _context37.abrupt("return", state);
|
|
3903
4155
|
|
|
3904
4156
|
case 19:
|
|
3905
4157
|
case "end":
|
|
3906
|
-
return
|
|
4158
|
+
return _context37.stop();
|
|
3907
4159
|
}
|
|
3908
4160
|
}
|
|
3909
|
-
},
|
|
4161
|
+
}, _callee37, this);
|
|
3910
4162
|
}));
|
|
3911
4163
|
|
|
3912
4164
|
function query(_x37) {
|
|
@@ -3926,28 +4178,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3926
4178
|
}, {
|
|
3927
4179
|
key: "banUser",
|
|
3928
4180
|
value: function () {
|
|
3929
|
-
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3930
|
-
return _regeneratorRuntime.wrap(function
|
|
4181
|
+
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetUserID, options) {
|
|
4182
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
3931
4183
|
while (1) {
|
|
3932
|
-
switch (
|
|
4184
|
+
switch (_context38.prev = _context38.next) {
|
|
3933
4185
|
case 0:
|
|
3934
4186
|
this._checkInitialized();
|
|
3935
4187
|
|
|
3936
|
-
|
|
4188
|
+
_context38.next = 3;
|
|
3937
4189
|
return this.getClient().banUser(targetUserID, _objectSpread$a(_objectSpread$a({}, options), {}, {
|
|
3938
4190
|
type: this.type,
|
|
3939
4191
|
id: this.id
|
|
3940
4192
|
}));
|
|
3941
4193
|
|
|
3942
4194
|
case 3:
|
|
3943
|
-
return
|
|
4195
|
+
return _context38.abrupt("return", _context38.sent);
|
|
3944
4196
|
|
|
3945
4197
|
case 4:
|
|
3946
4198
|
case "end":
|
|
3947
|
-
return
|
|
4199
|
+
return _context38.stop();
|
|
3948
4200
|
}
|
|
3949
4201
|
}
|
|
3950
|
-
},
|
|
4202
|
+
}, _callee38, this);
|
|
3951
4203
|
}));
|
|
3952
4204
|
|
|
3953
4205
|
function banUser(_x38, _x39) {
|
|
@@ -3968,34 +4220,34 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3968
4220
|
}, {
|
|
3969
4221
|
key: "hide",
|
|
3970
4222
|
value: function () {
|
|
3971
|
-
var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4223
|
+
var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39() {
|
|
3972
4224
|
var userId,
|
|
3973
4225
|
clearHistory,
|
|
3974
|
-
|
|
3975
|
-
return _regeneratorRuntime.wrap(function
|
|
4226
|
+
_args39 = arguments;
|
|
4227
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
3976
4228
|
while (1) {
|
|
3977
|
-
switch (
|
|
4229
|
+
switch (_context39.prev = _context39.next) {
|
|
3978
4230
|
case 0:
|
|
3979
|
-
userId =
|
|
3980
|
-
clearHistory =
|
|
4231
|
+
userId = _args39.length > 0 && _args39[0] !== undefined ? _args39[0] : null;
|
|
4232
|
+
clearHistory = _args39.length > 1 && _args39[1] !== undefined ? _args39[1] : false;
|
|
3981
4233
|
|
|
3982
4234
|
this._checkInitialized();
|
|
3983
4235
|
|
|
3984
|
-
|
|
4236
|
+
_context39.next = 5;
|
|
3985
4237
|
return this.getClient().post("".concat(this._channelURL(), "/hide"), {
|
|
3986
4238
|
user_id: userId,
|
|
3987
4239
|
clear_history: clearHistory
|
|
3988
4240
|
});
|
|
3989
4241
|
|
|
3990
4242
|
case 5:
|
|
3991
|
-
return
|
|
4243
|
+
return _context39.abrupt("return", _context39.sent);
|
|
3992
4244
|
|
|
3993
4245
|
case 6:
|
|
3994
4246
|
case "end":
|
|
3995
|
-
return
|
|
4247
|
+
return _context39.stop();
|
|
3996
4248
|
}
|
|
3997
4249
|
}
|
|
3998
|
-
},
|
|
4250
|
+
}, _callee39, this);
|
|
3999
4251
|
}));
|
|
4000
4252
|
|
|
4001
4253
|
function hide() {
|
|
@@ -4014,31 +4266,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4014
4266
|
}, {
|
|
4015
4267
|
key: "show",
|
|
4016
4268
|
value: function () {
|
|
4017
|
-
var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4269
|
+
var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40() {
|
|
4018
4270
|
var userId,
|
|
4019
|
-
|
|
4020
|
-
return _regeneratorRuntime.wrap(function
|
|
4271
|
+
_args40 = arguments;
|
|
4272
|
+
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
4021
4273
|
while (1) {
|
|
4022
|
-
switch (
|
|
4274
|
+
switch (_context40.prev = _context40.next) {
|
|
4023
4275
|
case 0:
|
|
4024
|
-
userId =
|
|
4276
|
+
userId = _args40.length > 0 && _args40[0] !== undefined ? _args40[0] : null;
|
|
4025
4277
|
|
|
4026
4278
|
this._checkInitialized();
|
|
4027
4279
|
|
|
4028
|
-
|
|
4280
|
+
_context40.next = 4;
|
|
4029
4281
|
return this.getClient().post("".concat(this._channelURL(), "/show"), {
|
|
4030
4282
|
user_id: userId
|
|
4031
4283
|
});
|
|
4032
4284
|
|
|
4033
4285
|
case 4:
|
|
4034
|
-
return
|
|
4286
|
+
return _context40.abrupt("return", _context40.sent);
|
|
4035
4287
|
|
|
4036
4288
|
case 5:
|
|
4037
4289
|
case "end":
|
|
4038
|
-
return
|
|
4290
|
+
return _context40.stop();
|
|
4039
4291
|
}
|
|
4040
4292
|
}
|
|
4041
|
-
},
|
|
4293
|
+
}, _callee40, this);
|
|
4042
4294
|
}));
|
|
4043
4295
|
|
|
4044
4296
|
function show() {
|
|
@@ -4057,28 +4309,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4057
4309
|
}, {
|
|
4058
4310
|
key: "unbanUser",
|
|
4059
4311
|
value: function () {
|
|
4060
|
-
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4061
|
-
return _regeneratorRuntime.wrap(function
|
|
4312
|
+
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(targetUserID) {
|
|
4313
|
+
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
4062
4314
|
while (1) {
|
|
4063
|
-
switch (
|
|
4315
|
+
switch (_context41.prev = _context41.next) {
|
|
4064
4316
|
case 0:
|
|
4065
4317
|
this._checkInitialized();
|
|
4066
4318
|
|
|
4067
|
-
|
|
4319
|
+
_context41.next = 3;
|
|
4068
4320
|
return this.getClient().unbanUser(targetUserID, {
|
|
4069
4321
|
type: this.type,
|
|
4070
4322
|
id: this.id
|
|
4071
4323
|
});
|
|
4072
4324
|
|
|
4073
4325
|
case 3:
|
|
4074
|
-
return
|
|
4326
|
+
return _context41.abrupt("return", _context41.sent);
|
|
4075
4327
|
|
|
4076
4328
|
case 4:
|
|
4077
4329
|
case "end":
|
|
4078
|
-
return
|
|
4330
|
+
return _context41.stop();
|
|
4079
4331
|
}
|
|
4080
4332
|
}
|
|
4081
|
-
},
|
|
4333
|
+
}, _callee41, this);
|
|
4082
4334
|
}));
|
|
4083
4335
|
|
|
4084
4336
|
function unbanUser(_x40) {
|
|
@@ -4098,28 +4350,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4098
4350
|
}, {
|
|
4099
4351
|
key: "shadowBan",
|
|
4100
4352
|
value: function () {
|
|
4101
|
-
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4102
|
-
return _regeneratorRuntime.wrap(function
|
|
4353
|
+
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(targetUserID, options) {
|
|
4354
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
4103
4355
|
while (1) {
|
|
4104
|
-
switch (
|
|
4356
|
+
switch (_context42.prev = _context42.next) {
|
|
4105
4357
|
case 0:
|
|
4106
4358
|
this._checkInitialized();
|
|
4107
4359
|
|
|
4108
|
-
|
|
4360
|
+
_context42.next = 3;
|
|
4109
4361
|
return this.getClient().shadowBan(targetUserID, _objectSpread$a(_objectSpread$a({}, options), {}, {
|
|
4110
4362
|
type: this.type,
|
|
4111
4363
|
id: this.id
|
|
4112
4364
|
}));
|
|
4113
4365
|
|
|
4114
4366
|
case 3:
|
|
4115
|
-
return
|
|
4367
|
+
return _context42.abrupt("return", _context42.sent);
|
|
4116
4368
|
|
|
4117
4369
|
case 4:
|
|
4118
4370
|
case "end":
|
|
4119
|
-
return
|
|
4371
|
+
return _context42.stop();
|
|
4120
4372
|
}
|
|
4121
4373
|
}
|
|
4122
|
-
},
|
|
4374
|
+
}, _callee42, this);
|
|
4123
4375
|
}));
|
|
4124
4376
|
|
|
4125
4377
|
function shadowBan(_x41, _x42) {
|
|
@@ -4138,28 +4390,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4138
4390
|
}, {
|
|
4139
4391
|
key: "removeShadowBan",
|
|
4140
4392
|
value: function () {
|
|
4141
|
-
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4142
|
-
return _regeneratorRuntime.wrap(function
|
|
4393
|
+
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(targetUserID) {
|
|
4394
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
4143
4395
|
while (1) {
|
|
4144
|
-
switch (
|
|
4396
|
+
switch (_context43.prev = _context43.next) {
|
|
4145
4397
|
case 0:
|
|
4146
4398
|
this._checkInitialized();
|
|
4147
4399
|
|
|
4148
|
-
|
|
4400
|
+
_context43.next = 3;
|
|
4149
4401
|
return this.getClient().removeShadowBan(targetUserID, {
|
|
4150
4402
|
type: this.type,
|
|
4151
4403
|
id: this.id
|
|
4152
4404
|
});
|
|
4153
4405
|
|
|
4154
4406
|
case 3:
|
|
4155
|
-
return
|
|
4407
|
+
return _context43.abrupt("return", _context43.sent);
|
|
4156
4408
|
|
|
4157
4409
|
case 4:
|
|
4158
4410
|
case "end":
|
|
4159
|
-
return
|
|
4411
|
+
return _context43.stop();
|
|
4160
4412
|
}
|
|
4161
4413
|
}
|
|
4162
|
-
},
|
|
4414
|
+
}, _callee43, this);
|
|
4163
4415
|
}));
|
|
4164
4416
|
|
|
4165
4417
|
function removeShadowBan(_x43) {
|
|
@@ -4178,23 +4430,23 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4178
4430
|
}, {
|
|
4179
4431
|
key: "createCall",
|
|
4180
4432
|
value: function () {
|
|
4181
|
-
var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4182
|
-
return _regeneratorRuntime.wrap(function
|
|
4433
|
+
var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(options) {
|
|
4434
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
4183
4435
|
while (1) {
|
|
4184
|
-
switch (
|
|
4436
|
+
switch (_context44.prev = _context44.next) {
|
|
4185
4437
|
case 0:
|
|
4186
|
-
|
|
4438
|
+
_context44.next = 2;
|
|
4187
4439
|
return this.getClient().post(this._channelURL() + '/call', options);
|
|
4188
4440
|
|
|
4189
4441
|
case 2:
|
|
4190
|
-
return
|
|
4442
|
+
return _context44.abrupt("return", _context44.sent);
|
|
4191
4443
|
|
|
4192
4444
|
case 3:
|
|
4193
4445
|
case "end":
|
|
4194
|
-
return
|
|
4446
|
+
return _context44.stop();
|
|
4195
4447
|
}
|
|
4196
4448
|
}
|
|
4197
|
-
},
|
|
4449
|
+
}, _callee44, this);
|
|
4198
4450
|
}));
|
|
4199
4451
|
|
|
4200
4452
|
function createCall(_x44) {
|
|
@@ -4213,23 +4465,23 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4213
4465
|
}, {
|
|
4214
4466
|
key: "vote",
|
|
4215
4467
|
value: function () {
|
|
4216
|
-
var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4217
|
-
return _regeneratorRuntime.wrap(function
|
|
4468
|
+
var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(messageId, pollId, _vote) {
|
|
4469
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
4218
4470
|
while (1) {
|
|
4219
|
-
switch (
|
|
4471
|
+
switch (_context45.prev = _context45.next) {
|
|
4220
4472
|
case 0:
|
|
4221
|
-
|
|
4473
|
+
_context45.next = 2;
|
|
4222
4474
|
return this.getClient().castPollVote(messageId, pollId, _vote);
|
|
4223
4475
|
|
|
4224
4476
|
case 2:
|
|
4225
|
-
return
|
|
4477
|
+
return _context45.abrupt("return", _context45.sent);
|
|
4226
4478
|
|
|
4227
4479
|
case 3:
|
|
4228
4480
|
case "end":
|
|
4229
|
-
return
|
|
4481
|
+
return _context45.stop();
|
|
4230
4482
|
}
|
|
4231
4483
|
}
|
|
4232
|
-
},
|
|
4484
|
+
}, _callee45, this);
|
|
4233
4485
|
}));
|
|
4234
4486
|
|
|
4235
4487
|
function vote(_x45, _x46, _x47) {
|
|
@@ -4241,23 +4493,23 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4241
4493
|
}, {
|
|
4242
4494
|
key: "removeVote",
|
|
4243
4495
|
value: function () {
|
|
4244
|
-
var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4245
|
-
return _regeneratorRuntime.wrap(function
|
|
4496
|
+
var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageId, pollId, voteId) {
|
|
4497
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
4246
4498
|
while (1) {
|
|
4247
|
-
switch (
|
|
4499
|
+
switch (_context46.prev = _context46.next) {
|
|
4248
4500
|
case 0:
|
|
4249
|
-
|
|
4501
|
+
_context46.next = 2;
|
|
4250
4502
|
return this.getClient().removePollVote(messageId, pollId, voteId);
|
|
4251
4503
|
|
|
4252
4504
|
case 2:
|
|
4253
|
-
return
|
|
4505
|
+
return _context46.abrupt("return", _context46.sent);
|
|
4254
4506
|
|
|
4255
4507
|
case 3:
|
|
4256
4508
|
case "end":
|
|
4257
|
-
return
|
|
4509
|
+
return _context46.stop();
|
|
4258
4510
|
}
|
|
4259
4511
|
}
|
|
4260
|
-
},
|
|
4512
|
+
}, _callee46, this);
|
|
4261
4513
|
}));
|
|
4262
4514
|
|
|
4263
4515
|
function removeVote(_x48, _x49, _x50) {
|
|
@@ -8221,39 +8473,157 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8221
8473
|
return getConfig;
|
|
8222
8474
|
}()
|
|
8223
8475
|
}, {
|
|
8224
|
-
key: "
|
|
8476
|
+
key: "deleteConfig",
|
|
8225
8477
|
value: function () {
|
|
8226
|
-
var
|
|
8227
|
-
var options,
|
|
8228
|
-
_args10 = arguments;
|
|
8478
|
+
var _deleteConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(key) {
|
|
8229
8479
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
8230
8480
|
while (1) {
|
|
8231
8481
|
switch (_context10.prev = _context10.next) {
|
|
8232
8482
|
case 0:
|
|
8233
|
-
|
|
8234
|
-
|
|
8483
|
+
_context10.next = 2;
|
|
8484
|
+
return this.client.delete(this.client.baseURL + '/api/v2/moderation/config/' + key);
|
|
8485
|
+
|
|
8486
|
+
case 2:
|
|
8487
|
+
return _context10.abrupt("return", _context10.sent);
|
|
8488
|
+
|
|
8489
|
+
case 3:
|
|
8490
|
+
case "end":
|
|
8491
|
+
return _context10.stop();
|
|
8492
|
+
}
|
|
8493
|
+
}
|
|
8494
|
+
}, _callee10, this);
|
|
8495
|
+
}));
|
|
8496
|
+
|
|
8497
|
+
function deleteConfig(_x14) {
|
|
8498
|
+
return _deleteConfig.apply(this, arguments);
|
|
8499
|
+
}
|
|
8500
|
+
|
|
8501
|
+
return deleteConfig;
|
|
8502
|
+
}()
|
|
8503
|
+
/**
|
|
8504
|
+
* Query moderation configs
|
|
8505
|
+
* @param {Object} filterConditions Filter conditions for querying moderation configs
|
|
8506
|
+
* @param {Object} sort Sort conditions for querying moderation configs
|
|
8507
|
+
* @param {Object} options Additional options for querying moderation configs
|
|
8508
|
+
*/
|
|
8509
|
+
|
|
8510
|
+
}, {
|
|
8511
|
+
key: "queryConfigs",
|
|
8512
|
+
value: function () {
|
|
8513
|
+
var _queryConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(filterConditions, sort) {
|
|
8514
|
+
var options,
|
|
8515
|
+
_args11 = arguments;
|
|
8516
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
8517
|
+
while (1) {
|
|
8518
|
+
switch (_context11.prev = _context11.next) {
|
|
8519
|
+
case 0:
|
|
8520
|
+
options = _args11.length > 2 && _args11[2] !== undefined ? _args11[2] : {};
|
|
8521
|
+
_context11.next = 3;
|
|
8522
|
+
return this.client.post(this.client.baseURL + '/api/v2/moderation/configs', _objectSpread$3({
|
|
8523
|
+
filter: filterConditions,
|
|
8524
|
+
sort: sort
|
|
8525
|
+
}, options));
|
|
8526
|
+
|
|
8527
|
+
case 3:
|
|
8528
|
+
return _context11.abrupt("return", _context11.sent);
|
|
8529
|
+
|
|
8530
|
+
case 4:
|
|
8531
|
+
case "end":
|
|
8532
|
+
return _context11.stop();
|
|
8533
|
+
}
|
|
8534
|
+
}
|
|
8535
|
+
}, _callee11, this);
|
|
8536
|
+
}));
|
|
8537
|
+
|
|
8538
|
+
function queryConfigs(_x15, _x16) {
|
|
8539
|
+
return _queryConfigs.apply(this, arguments);
|
|
8540
|
+
}
|
|
8541
|
+
|
|
8542
|
+
return queryConfigs;
|
|
8543
|
+
}()
|
|
8544
|
+
}, {
|
|
8545
|
+
key: "submitAction",
|
|
8546
|
+
value: function () {
|
|
8547
|
+
var _submitAction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(actionType, itemID) {
|
|
8548
|
+
var options,
|
|
8549
|
+
_args12 = arguments;
|
|
8550
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
8551
|
+
while (1) {
|
|
8552
|
+
switch (_context12.prev = _context12.next) {
|
|
8553
|
+
case 0:
|
|
8554
|
+
options = _args12.length > 2 && _args12[2] !== undefined ? _args12[2] : {};
|
|
8555
|
+
_context12.next = 3;
|
|
8235
8556
|
return this.client.post(this.client.baseURL + '/api/v2/moderation/submit_action', _objectSpread$3({
|
|
8236
8557
|
action_type: actionType,
|
|
8237
8558
|
item_id: itemID
|
|
8238
8559
|
}, options));
|
|
8239
8560
|
|
|
8240
8561
|
case 3:
|
|
8241
|
-
return
|
|
8562
|
+
return _context12.abrupt("return", _context12.sent);
|
|
8242
8563
|
|
|
8243
8564
|
case 4:
|
|
8244
8565
|
case "end":
|
|
8245
|
-
return
|
|
8566
|
+
return _context12.stop();
|
|
8246
8567
|
}
|
|
8247
8568
|
}
|
|
8248
|
-
},
|
|
8569
|
+
}, _callee12, this);
|
|
8249
8570
|
}));
|
|
8250
8571
|
|
|
8251
|
-
function submitAction(
|
|
8572
|
+
function submitAction(_x17, _x18) {
|
|
8252
8573
|
return _submitAction.apply(this, arguments);
|
|
8253
8574
|
}
|
|
8254
8575
|
|
|
8255
8576
|
return submitAction;
|
|
8256
8577
|
}()
|
|
8578
|
+
/**
|
|
8579
|
+
*
|
|
8580
|
+
* @param {string} entityType string Type of entity to be checked E.g., stream:user, stream:chat:v1:message, or any custom string
|
|
8581
|
+
* @param {string} entityID string ID of the entity to be checked. This is mainly for tracking purposes
|
|
8582
|
+
* @param {string} entityCreatorID string ID of the entity creator
|
|
8583
|
+
* @param {object} moderationPayload object Content to be checked for moderation. E.g., { texts: ['text1', 'text2'], images: ['image1', 'image2']}
|
|
8584
|
+
* @param {Array} moderationPayload.texts array Array of texts to be checked for moderation
|
|
8585
|
+
* @param {Array} moderationPayload.images array Array of images to be checked for moderation
|
|
8586
|
+
* @param {Array} moderationPayload.videos array Array of videos to be checked for moderation
|
|
8587
|
+
* @param configKey
|
|
8588
|
+
* @param options
|
|
8589
|
+
* @returns
|
|
8590
|
+
*/
|
|
8591
|
+
|
|
8592
|
+
}, {
|
|
8593
|
+
key: "check",
|
|
8594
|
+
value: function () {
|
|
8595
|
+
var _check = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(entityType, entityID, entityCreatorID, moderationPayload, configKey, options) {
|
|
8596
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
8597
|
+
while (1) {
|
|
8598
|
+
switch (_context13.prev = _context13.next) {
|
|
8599
|
+
case 0:
|
|
8600
|
+
_context13.next = 2;
|
|
8601
|
+
return this.client.post(this.client.baseURL + "/api/v2/moderation/check", {
|
|
8602
|
+
entity_type: entityType,
|
|
8603
|
+
entity_id: entityID,
|
|
8604
|
+
entity_creator_id: entityCreatorID,
|
|
8605
|
+
moderation_payload: moderationPayload,
|
|
8606
|
+
config_key: configKey,
|
|
8607
|
+
options: options
|
|
8608
|
+
});
|
|
8609
|
+
|
|
8610
|
+
case 2:
|
|
8611
|
+
return _context13.abrupt("return", _context13.sent);
|
|
8612
|
+
|
|
8613
|
+
case 3:
|
|
8614
|
+
case "end":
|
|
8615
|
+
return _context13.stop();
|
|
8616
|
+
}
|
|
8617
|
+
}
|
|
8618
|
+
}, _callee13, this);
|
|
8619
|
+
}));
|
|
8620
|
+
|
|
8621
|
+
function check(_x19, _x20, _x21, _x22, _x23, _x24) {
|
|
8622
|
+
return _check.apply(this, arguments);
|
|
8623
|
+
}
|
|
8624
|
+
|
|
8625
|
+
return check;
|
|
8626
|
+
}()
|
|
8257
8627
|
}]);
|
|
8258
8628
|
|
|
8259
8629
|
return Moderation;
|
|
@@ -14214,7 +14584,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
14214
14584
|
}, {
|
|
14215
14585
|
key: "getUserAgent",
|
|
14216
14586
|
value: function getUserAgent() {
|
|
14217
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.
|
|
14587
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.43.0");
|
|
14218
14588
|
}
|
|
14219
14589
|
}, {
|
|
14220
14590
|
key: "setUserAgent",
|