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