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.js
CHANGED
|
@@ -450,8 +450,10 @@ function addToMessageList(messages, newMessage) {
|
|
|
450
450
|
} // for empty list just concat and return unless it's an update or deletion
|
|
451
451
|
|
|
452
452
|
|
|
453
|
-
if (
|
|
453
|
+
if (newMessages.length === 0 && addMessageToList) {
|
|
454
454
|
return newMessages.concat(newMessage);
|
|
455
|
+
} else if (newMessages.length === 0) {
|
|
456
|
+
return newMessages;
|
|
455
457
|
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
456
458
|
|
|
457
459
|
|
|
@@ -461,6 +463,8 @@ function addToMessageList(messages, newMessage) {
|
|
|
461
463
|
|
|
462
464
|
if (messageIsNewest && addMessageToList) {
|
|
463
465
|
return newMessages.concat(newMessage);
|
|
466
|
+
} else if (newMessages.length === 0) {
|
|
467
|
+
return newMessages;
|
|
464
468
|
} // find the closest index to push the new message
|
|
465
469
|
|
|
466
470
|
|
|
@@ -2279,6 +2283,51 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2279
2283
|
|
|
2280
2284
|
return queryMembers;
|
|
2281
2285
|
}()
|
|
2286
|
+
/**
|
|
2287
|
+
* partialUpdateMember - Partial update a member
|
|
2288
|
+
*
|
|
2289
|
+
* @param {string} user_id member user id
|
|
2290
|
+
* @param {PartialUpdateMember<StreamChatGenerics>} updates
|
|
2291
|
+
*
|
|
2292
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} Updated member
|
|
2293
|
+
*/
|
|
2294
|
+
|
|
2295
|
+
}, {
|
|
2296
|
+
key: "partialUpdateMember",
|
|
2297
|
+
value: function () {
|
|
2298
|
+
var _partialUpdateMember = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(user_id, updates) {
|
|
2299
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
|
2300
|
+
while (1) {
|
|
2301
|
+
switch (_context6.prev = _context6.next) {
|
|
2302
|
+
case 0:
|
|
2303
|
+
if (user_id) {
|
|
2304
|
+
_context6.next = 2;
|
|
2305
|
+
break;
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
throw Error('Please specify the user id');
|
|
2309
|
+
|
|
2310
|
+
case 2:
|
|
2311
|
+
_context6.next = 4;
|
|
2312
|
+
return this.getClient().patch(this._channelURL() + "/member/".concat(encodeURIComponent(user_id)), updates);
|
|
2313
|
+
|
|
2314
|
+
case 4:
|
|
2315
|
+
return _context6.abrupt("return", _context6.sent);
|
|
2316
|
+
|
|
2317
|
+
case 5:
|
|
2318
|
+
case "end":
|
|
2319
|
+
return _context6.stop();
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
}, _callee6, this);
|
|
2323
|
+
}));
|
|
2324
|
+
|
|
2325
|
+
function partialUpdateMember(_x7, _x8) {
|
|
2326
|
+
return _partialUpdateMember.apply(this, arguments);
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
return partialUpdateMember;
|
|
2330
|
+
}()
|
|
2282
2331
|
/**
|
|
2283
2332
|
* sendReaction - Send a reaction about a message
|
|
2284
2333
|
*
|
|
@@ -2292,13 +2341,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2292
2341
|
}, {
|
|
2293
2342
|
key: "sendReaction",
|
|
2294
2343
|
value: function () {
|
|
2295
|
-
var _sendReaction = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2296
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2344
|
+
var _sendReaction = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7(messageID, reaction, options) {
|
|
2345
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
|
|
2297
2346
|
while (1) {
|
|
2298
|
-
switch (
|
|
2347
|
+
switch (_context7.prev = _context7.next) {
|
|
2299
2348
|
case 0:
|
|
2300
2349
|
if (messageID) {
|
|
2301
|
-
|
|
2350
|
+
_context7.next = 2;
|
|
2302
2351
|
break;
|
|
2303
2352
|
}
|
|
2304
2353
|
|
|
@@ -2306,30 +2355,30 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2306
2355
|
|
|
2307
2356
|
case 2:
|
|
2308
2357
|
if (!(!reaction || Object.keys(reaction).length === 0)) {
|
|
2309
|
-
|
|
2358
|
+
_context7.next = 4;
|
|
2310
2359
|
break;
|
|
2311
2360
|
}
|
|
2312
2361
|
|
|
2313
2362
|
throw Error("Reaction object is missing");
|
|
2314
2363
|
|
|
2315
2364
|
case 4:
|
|
2316
|
-
|
|
2365
|
+
_context7.next = 6;
|
|
2317
2366
|
return this.getClient().post(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(messageID), "/reaction"), _objectSpread$9({
|
|
2318
2367
|
reaction: reaction
|
|
2319
2368
|
}, options));
|
|
2320
2369
|
|
|
2321
2370
|
case 6:
|
|
2322
|
-
return
|
|
2371
|
+
return _context7.abrupt("return", _context7.sent);
|
|
2323
2372
|
|
|
2324
2373
|
case 7:
|
|
2325
2374
|
case "end":
|
|
2326
|
-
return
|
|
2375
|
+
return _context7.stop();
|
|
2327
2376
|
}
|
|
2328
2377
|
}
|
|
2329
|
-
},
|
|
2378
|
+
}, _callee7, this);
|
|
2330
2379
|
}));
|
|
2331
2380
|
|
|
2332
|
-
function sendReaction(
|
|
2381
|
+
function sendReaction(_x9, _x10, _x11) {
|
|
2333
2382
|
return _sendReaction.apply(this, arguments);
|
|
2334
2383
|
}
|
|
2335
2384
|
|
|
@@ -2376,39 +2425,39 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2376
2425
|
}, {
|
|
2377
2426
|
key: "update",
|
|
2378
2427
|
value: function () {
|
|
2379
|
-
var _update2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2428
|
+
var _update2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
|
|
2380
2429
|
var channelData,
|
|
2381
2430
|
updateMessage,
|
|
2382
2431
|
options,
|
|
2383
2432
|
reserved,
|
|
2384
|
-
|
|
2385
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2433
|
+
_args8 = arguments;
|
|
2434
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
|
|
2386
2435
|
while (1) {
|
|
2387
|
-
switch (
|
|
2436
|
+
switch (_context8.prev = _context8.next) {
|
|
2388
2437
|
case 0:
|
|
2389
|
-
channelData =
|
|
2390
|
-
updateMessage =
|
|
2391
|
-
options =
|
|
2438
|
+
channelData = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
|
2439
|
+
updateMessage = _args8.length > 1 ? _args8[1] : undefined;
|
|
2440
|
+
options = _args8.length > 2 ? _args8[2] : undefined;
|
|
2392
2441
|
// Strip out reserved names that will result in API errors.
|
|
2393
2442
|
reserved = ['config', 'cid', 'created_by', 'id', 'member_count', 'type', 'created_at', 'updated_at', 'last_message_at', 'own_capabilities'];
|
|
2394
2443
|
reserved.forEach(function (key) {
|
|
2395
2444
|
delete channelData[key];
|
|
2396
2445
|
});
|
|
2397
|
-
|
|
2446
|
+
_context8.next = 7;
|
|
2398
2447
|
return this._update(_objectSpread$9({
|
|
2399
2448
|
message: updateMessage,
|
|
2400
2449
|
data: channelData
|
|
2401
2450
|
}, options));
|
|
2402
2451
|
|
|
2403
2452
|
case 7:
|
|
2404
|
-
return
|
|
2453
|
+
return _context8.abrupt("return", _context8.sent);
|
|
2405
2454
|
|
|
2406
2455
|
case 8:
|
|
2407
2456
|
case "end":
|
|
2408
|
-
return
|
|
2457
|
+
return _context8.stop();
|
|
2409
2458
|
}
|
|
2410
2459
|
}
|
|
2411
|
-
},
|
|
2460
|
+
}, _callee8, this);
|
|
2412
2461
|
}));
|
|
2413
2462
|
|
|
2414
2463
|
function update() {
|
|
@@ -2428,19 +2477,19 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2428
2477
|
}, {
|
|
2429
2478
|
key: "updatePartial",
|
|
2430
2479
|
value: function () {
|
|
2431
|
-
var _updatePartial = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2480
|
+
var _updatePartial = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(update) {
|
|
2432
2481
|
var _this$data2, _this$data3;
|
|
2433
2482
|
|
|
2434
2483
|
var data, areCapabilitiesChanged;
|
|
2435
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2484
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
|
|
2436
2485
|
while (1) {
|
|
2437
|
-
switch (
|
|
2486
|
+
switch (_context9.prev = _context9.next) {
|
|
2438
2487
|
case 0:
|
|
2439
|
-
|
|
2488
|
+
_context9.next = 2;
|
|
2440
2489
|
return this.getClient().patch(this._channelURL(), update);
|
|
2441
2490
|
|
|
2442
2491
|
case 2:
|
|
2443
|
-
data =
|
|
2492
|
+
data = _context9.sent;
|
|
2444
2493
|
areCapabilitiesChanged = _toConsumableArray__default['default'](data.channel.own_capabilities || []).sort().join() !== _toConsumableArray__default['default'](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();
|
|
2445
2494
|
this.data = data.channel; // If the capabiltities are changed, we trigger the `capabilities.changed` event.
|
|
2446
2495
|
|
|
@@ -2452,17 +2501,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2452
2501
|
});
|
|
2453
2502
|
}
|
|
2454
2503
|
|
|
2455
|
-
return
|
|
2504
|
+
return _context9.abrupt("return", data);
|
|
2456
2505
|
|
|
2457
2506
|
case 7:
|
|
2458
2507
|
case "end":
|
|
2459
|
-
return
|
|
2508
|
+
return _context9.stop();
|
|
2460
2509
|
}
|
|
2461
2510
|
}
|
|
2462
|
-
},
|
|
2511
|
+
}, _callee9, this);
|
|
2463
2512
|
}));
|
|
2464
2513
|
|
|
2465
|
-
function updatePartial(
|
|
2514
|
+
function updatePartial(_x12) {
|
|
2466
2515
|
return _updatePartial.apply(this, arguments);
|
|
2467
2516
|
}
|
|
2468
2517
|
|
|
@@ -2478,31 +2527,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2478
2527
|
}, {
|
|
2479
2528
|
key: "enableSlowMode",
|
|
2480
2529
|
value: function () {
|
|
2481
|
-
var _enableSlowMode = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2530
|
+
var _enableSlowMode = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(coolDownInterval) {
|
|
2482
2531
|
var data;
|
|
2483
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2532
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
|
|
2484
2533
|
while (1) {
|
|
2485
|
-
switch (
|
|
2534
|
+
switch (_context10.prev = _context10.next) {
|
|
2486
2535
|
case 0:
|
|
2487
|
-
|
|
2536
|
+
_context10.next = 2;
|
|
2488
2537
|
return this.getClient().post(this._channelURL(), {
|
|
2489
2538
|
cooldown: coolDownInterval
|
|
2490
2539
|
});
|
|
2491
2540
|
|
|
2492
2541
|
case 2:
|
|
2493
|
-
data =
|
|
2542
|
+
data = _context10.sent;
|
|
2494
2543
|
this.data = data.channel;
|
|
2495
|
-
return
|
|
2544
|
+
return _context10.abrupt("return", data);
|
|
2496
2545
|
|
|
2497
2546
|
case 5:
|
|
2498
2547
|
case "end":
|
|
2499
|
-
return
|
|
2548
|
+
return _context10.stop();
|
|
2500
2549
|
}
|
|
2501
2550
|
}
|
|
2502
|
-
},
|
|
2551
|
+
}, _callee10, this);
|
|
2503
2552
|
}));
|
|
2504
2553
|
|
|
2505
|
-
function enableSlowMode(
|
|
2554
|
+
function enableSlowMode(_x13) {
|
|
2506
2555
|
return _enableSlowMode.apply(this, arguments);
|
|
2507
2556
|
}
|
|
2508
2557
|
|
|
@@ -2517,28 +2566,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2517
2566
|
}, {
|
|
2518
2567
|
key: "disableSlowMode",
|
|
2519
2568
|
value: function () {
|
|
2520
|
-
var _disableSlowMode = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2569
|
+
var _disableSlowMode = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee11() {
|
|
2521
2570
|
var data;
|
|
2522
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2571
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee11$(_context11) {
|
|
2523
2572
|
while (1) {
|
|
2524
|
-
switch (
|
|
2573
|
+
switch (_context11.prev = _context11.next) {
|
|
2525
2574
|
case 0:
|
|
2526
|
-
|
|
2575
|
+
_context11.next = 2;
|
|
2527
2576
|
return this.getClient().post(this._channelURL(), {
|
|
2528
2577
|
cooldown: 0
|
|
2529
2578
|
});
|
|
2530
2579
|
|
|
2531
2580
|
case 2:
|
|
2532
|
-
data =
|
|
2581
|
+
data = _context11.sent;
|
|
2533
2582
|
this.data = data.channel;
|
|
2534
|
-
return
|
|
2583
|
+
return _context11.abrupt("return", data);
|
|
2535
2584
|
|
|
2536
2585
|
case 5:
|
|
2537
2586
|
case "end":
|
|
2538
|
-
return
|
|
2587
|
+
return _context11.stop();
|
|
2539
2588
|
}
|
|
2540
2589
|
}
|
|
2541
|
-
},
|
|
2590
|
+
}, _callee11, this);
|
|
2542
2591
|
}));
|
|
2543
2592
|
|
|
2544
2593
|
function disableSlowMode() {
|
|
@@ -2558,26 +2607,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2558
2607
|
}, {
|
|
2559
2608
|
key: "delete",
|
|
2560
2609
|
value: function () {
|
|
2561
|
-
var _delete2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2610
|
+
var _delete2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee12() {
|
|
2562
2611
|
var options,
|
|
2563
|
-
|
|
2564
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2612
|
+
_args12 = arguments;
|
|
2613
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee12$(_context12) {
|
|
2565
2614
|
while (1) {
|
|
2566
|
-
switch (
|
|
2615
|
+
switch (_context12.prev = _context12.next) {
|
|
2567
2616
|
case 0:
|
|
2568
|
-
options =
|
|
2569
|
-
|
|
2617
|
+
options = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
|
|
2618
|
+
_context12.next = 3;
|
|
2570
2619
|
return this.getClient().delete(this._channelURL(), _objectSpread$9({}, options));
|
|
2571
2620
|
|
|
2572
2621
|
case 3:
|
|
2573
|
-
return
|
|
2622
|
+
return _context12.abrupt("return", _context12.sent);
|
|
2574
2623
|
|
|
2575
2624
|
case 4:
|
|
2576
2625
|
case "end":
|
|
2577
|
-
return
|
|
2626
|
+
return _context12.stop();
|
|
2578
2627
|
}
|
|
2579
2628
|
}
|
|
2580
|
-
},
|
|
2629
|
+
}, _callee12, this);
|
|
2581
2630
|
}));
|
|
2582
2631
|
|
|
2583
2632
|
function _delete() {
|
|
@@ -2595,26 +2644,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2595
2644
|
}, {
|
|
2596
2645
|
key: "truncate",
|
|
2597
2646
|
value: function () {
|
|
2598
|
-
var _truncate = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2647
|
+
var _truncate = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee13() {
|
|
2599
2648
|
var options,
|
|
2600
|
-
|
|
2601
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2649
|
+
_args13 = arguments;
|
|
2650
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee13$(_context13) {
|
|
2602
2651
|
while (1) {
|
|
2603
|
-
switch (
|
|
2652
|
+
switch (_context13.prev = _context13.next) {
|
|
2604
2653
|
case 0:
|
|
2605
|
-
options =
|
|
2606
|
-
|
|
2654
|
+
options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
|
|
2655
|
+
_context13.next = 3;
|
|
2607
2656
|
return this.getClient().post(this._channelURL() + '/truncate', options);
|
|
2608
2657
|
|
|
2609
2658
|
case 3:
|
|
2610
|
-
return
|
|
2659
|
+
return _context13.abrupt("return", _context13.sent);
|
|
2611
2660
|
|
|
2612
2661
|
case 4:
|
|
2613
2662
|
case "end":
|
|
2614
|
-
return
|
|
2663
|
+
return _context13.stop();
|
|
2615
2664
|
}
|
|
2616
2665
|
}
|
|
2617
|
-
},
|
|
2666
|
+
}, _callee13, this);
|
|
2618
2667
|
}));
|
|
2619
2668
|
|
|
2620
2669
|
function truncate() {
|
|
@@ -2634,28 +2683,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2634
2683
|
}, {
|
|
2635
2684
|
key: "acceptInvite",
|
|
2636
2685
|
value: function () {
|
|
2637
|
-
var _acceptInvite = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2686
|
+
var _acceptInvite = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee14() {
|
|
2638
2687
|
var options,
|
|
2639
|
-
|
|
2640
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2688
|
+
_args14 = arguments;
|
|
2689
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee14$(_context14) {
|
|
2641
2690
|
while (1) {
|
|
2642
|
-
switch (
|
|
2691
|
+
switch (_context14.prev = _context14.next) {
|
|
2643
2692
|
case 0:
|
|
2644
|
-
options =
|
|
2645
|
-
|
|
2693
|
+
options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
|
|
2694
|
+
_context14.next = 3;
|
|
2646
2695
|
return this._update(_objectSpread$9({
|
|
2647
2696
|
accept_invite: true
|
|
2648
2697
|
}, options));
|
|
2649
2698
|
|
|
2650
2699
|
case 3:
|
|
2651
|
-
return
|
|
2700
|
+
return _context14.abrupt("return", _context14.sent);
|
|
2652
2701
|
|
|
2653
2702
|
case 4:
|
|
2654
2703
|
case "end":
|
|
2655
|
-
return
|
|
2704
|
+
return _context14.stop();
|
|
2656
2705
|
}
|
|
2657
2706
|
}
|
|
2658
|
-
},
|
|
2707
|
+
}, _callee14, this);
|
|
2659
2708
|
}));
|
|
2660
2709
|
|
|
2661
2710
|
function acceptInvite() {
|
|
@@ -2675,28 +2724,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2675
2724
|
}, {
|
|
2676
2725
|
key: "rejectInvite",
|
|
2677
2726
|
value: function () {
|
|
2678
|
-
var _rejectInvite = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2727
|
+
var _rejectInvite = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee15() {
|
|
2679
2728
|
var options,
|
|
2680
|
-
|
|
2681
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2729
|
+
_args15 = arguments;
|
|
2730
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee15$(_context15) {
|
|
2682
2731
|
while (1) {
|
|
2683
|
-
switch (
|
|
2732
|
+
switch (_context15.prev = _context15.next) {
|
|
2684
2733
|
case 0:
|
|
2685
|
-
options =
|
|
2686
|
-
|
|
2734
|
+
options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
|
|
2735
|
+
_context15.next = 3;
|
|
2687
2736
|
return this._update(_objectSpread$9({
|
|
2688
2737
|
reject_invite: true
|
|
2689
2738
|
}, options));
|
|
2690
2739
|
|
|
2691
2740
|
case 3:
|
|
2692
|
-
return
|
|
2741
|
+
return _context15.abrupt("return", _context15.sent);
|
|
2693
2742
|
|
|
2694
2743
|
case 4:
|
|
2695
2744
|
case "end":
|
|
2696
|
-
return
|
|
2745
|
+
return _context15.stop();
|
|
2697
2746
|
}
|
|
2698
2747
|
}
|
|
2699
|
-
},
|
|
2748
|
+
}, _callee15, this);
|
|
2700
2749
|
}));
|
|
2701
2750
|
|
|
2702
2751
|
function rejectInvite() {
|
|
@@ -2717,32 +2766,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2717
2766
|
}, {
|
|
2718
2767
|
key: "addMembers",
|
|
2719
2768
|
value: function () {
|
|
2720
|
-
var _addMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2769
|
+
var _addMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee16(members, message) {
|
|
2721
2770
|
var options,
|
|
2722
|
-
|
|
2723
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2771
|
+
_args16 = arguments;
|
|
2772
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee16$(_context16) {
|
|
2724
2773
|
while (1) {
|
|
2725
|
-
switch (
|
|
2774
|
+
switch (_context16.prev = _context16.next) {
|
|
2726
2775
|
case 0:
|
|
2727
|
-
options =
|
|
2728
|
-
|
|
2776
|
+
options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
|
|
2777
|
+
_context16.next = 3;
|
|
2729
2778
|
return this._update(_objectSpread$9({
|
|
2730
2779
|
add_members: members,
|
|
2731
2780
|
message: message
|
|
2732
2781
|
}, options));
|
|
2733
2782
|
|
|
2734
2783
|
case 3:
|
|
2735
|
-
return
|
|
2784
|
+
return _context16.abrupt("return", _context16.sent);
|
|
2736
2785
|
|
|
2737
2786
|
case 4:
|
|
2738
2787
|
case "end":
|
|
2739
|
-
return
|
|
2788
|
+
return _context16.stop();
|
|
2740
2789
|
}
|
|
2741
2790
|
}
|
|
2742
|
-
},
|
|
2791
|
+
}, _callee16, this);
|
|
2743
2792
|
}));
|
|
2744
2793
|
|
|
2745
|
-
function addMembers(
|
|
2794
|
+
function addMembers(_x14, _x15) {
|
|
2746
2795
|
return _addMembers.apply(this, arguments);
|
|
2747
2796
|
}
|
|
2748
2797
|
|
|
@@ -2760,32 +2809,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2760
2809
|
}, {
|
|
2761
2810
|
key: "addModerators",
|
|
2762
2811
|
value: function () {
|
|
2763
|
-
var _addModerators = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2812
|
+
var _addModerators = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee17(members, message) {
|
|
2764
2813
|
var options,
|
|
2765
|
-
|
|
2766
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2814
|
+
_args17 = arguments;
|
|
2815
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee17$(_context17) {
|
|
2767
2816
|
while (1) {
|
|
2768
|
-
switch (
|
|
2817
|
+
switch (_context17.prev = _context17.next) {
|
|
2769
2818
|
case 0:
|
|
2770
|
-
options =
|
|
2771
|
-
|
|
2819
|
+
options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
|
|
2820
|
+
_context17.next = 3;
|
|
2772
2821
|
return this._update(_objectSpread$9({
|
|
2773
2822
|
add_moderators: members,
|
|
2774
2823
|
message: message
|
|
2775
2824
|
}, options));
|
|
2776
2825
|
|
|
2777
2826
|
case 3:
|
|
2778
|
-
return
|
|
2827
|
+
return _context17.abrupt("return", _context17.sent);
|
|
2779
2828
|
|
|
2780
2829
|
case 4:
|
|
2781
2830
|
case "end":
|
|
2782
|
-
return
|
|
2831
|
+
return _context17.stop();
|
|
2783
2832
|
}
|
|
2784
2833
|
}
|
|
2785
|
-
},
|
|
2834
|
+
}, _callee17, this);
|
|
2786
2835
|
}));
|
|
2787
2836
|
|
|
2788
|
-
function addModerators(
|
|
2837
|
+
function addModerators(_x16, _x17) {
|
|
2789
2838
|
return _addModerators.apply(this, arguments);
|
|
2790
2839
|
}
|
|
2791
2840
|
|
|
@@ -2803,32 +2852,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2803
2852
|
}, {
|
|
2804
2853
|
key: "assignRoles",
|
|
2805
2854
|
value: function () {
|
|
2806
|
-
var _assignRoles = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2855
|
+
var _assignRoles = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee18(roles, message) {
|
|
2807
2856
|
var options,
|
|
2808
|
-
|
|
2809
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2857
|
+
_args18 = arguments;
|
|
2858
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee18$(_context18) {
|
|
2810
2859
|
while (1) {
|
|
2811
|
-
switch (
|
|
2860
|
+
switch (_context18.prev = _context18.next) {
|
|
2812
2861
|
case 0:
|
|
2813
|
-
options =
|
|
2814
|
-
|
|
2862
|
+
options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
|
|
2863
|
+
_context18.next = 3;
|
|
2815
2864
|
return this._update(_objectSpread$9({
|
|
2816
2865
|
assign_roles: roles,
|
|
2817
2866
|
message: message
|
|
2818
2867
|
}, options));
|
|
2819
2868
|
|
|
2820
2869
|
case 3:
|
|
2821
|
-
return
|
|
2870
|
+
return _context18.abrupt("return", _context18.sent);
|
|
2822
2871
|
|
|
2823
2872
|
case 4:
|
|
2824
2873
|
case "end":
|
|
2825
|
-
return
|
|
2874
|
+
return _context18.stop();
|
|
2826
2875
|
}
|
|
2827
2876
|
}
|
|
2828
|
-
},
|
|
2877
|
+
}, _callee18, this);
|
|
2829
2878
|
}));
|
|
2830
2879
|
|
|
2831
|
-
function assignRoles(
|
|
2880
|
+
function assignRoles(_x18, _x19) {
|
|
2832
2881
|
return _assignRoles.apply(this, arguments);
|
|
2833
2882
|
}
|
|
2834
2883
|
|
|
@@ -2846,32 +2895,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2846
2895
|
}, {
|
|
2847
2896
|
key: "inviteMembers",
|
|
2848
2897
|
value: function () {
|
|
2849
|
-
var _inviteMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2898
|
+
var _inviteMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee19(members, message) {
|
|
2850
2899
|
var options,
|
|
2851
|
-
|
|
2852
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2900
|
+
_args19 = arguments;
|
|
2901
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee19$(_context19) {
|
|
2853
2902
|
while (1) {
|
|
2854
|
-
switch (
|
|
2903
|
+
switch (_context19.prev = _context19.next) {
|
|
2855
2904
|
case 0:
|
|
2856
|
-
options =
|
|
2857
|
-
|
|
2905
|
+
options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
|
|
2906
|
+
_context19.next = 3;
|
|
2858
2907
|
return this._update(_objectSpread$9({
|
|
2859
2908
|
invites: members,
|
|
2860
2909
|
message: message
|
|
2861
2910
|
}, options));
|
|
2862
2911
|
|
|
2863
2912
|
case 3:
|
|
2864
|
-
return
|
|
2913
|
+
return _context19.abrupt("return", _context19.sent);
|
|
2865
2914
|
|
|
2866
2915
|
case 4:
|
|
2867
2916
|
case "end":
|
|
2868
|
-
return
|
|
2917
|
+
return _context19.stop();
|
|
2869
2918
|
}
|
|
2870
2919
|
}
|
|
2871
|
-
},
|
|
2920
|
+
}, _callee19, this);
|
|
2872
2921
|
}));
|
|
2873
2922
|
|
|
2874
|
-
function inviteMembers(
|
|
2923
|
+
function inviteMembers(_x20, _x21) {
|
|
2875
2924
|
return _inviteMembers.apply(this, arguments);
|
|
2876
2925
|
}
|
|
2877
2926
|
|
|
@@ -2889,32 +2938,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2889
2938
|
}, {
|
|
2890
2939
|
key: "removeMembers",
|
|
2891
2940
|
value: function () {
|
|
2892
|
-
var _removeMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2941
|
+
var _removeMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee20(members, message) {
|
|
2893
2942
|
var options,
|
|
2894
|
-
|
|
2895
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2943
|
+
_args20 = arguments;
|
|
2944
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee20$(_context20) {
|
|
2896
2945
|
while (1) {
|
|
2897
|
-
switch (
|
|
2946
|
+
switch (_context20.prev = _context20.next) {
|
|
2898
2947
|
case 0:
|
|
2899
|
-
options =
|
|
2900
|
-
|
|
2948
|
+
options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
|
|
2949
|
+
_context20.next = 3;
|
|
2901
2950
|
return this._update(_objectSpread$9({
|
|
2902
2951
|
remove_members: members,
|
|
2903
2952
|
message: message
|
|
2904
2953
|
}, options));
|
|
2905
2954
|
|
|
2906
2955
|
case 3:
|
|
2907
|
-
return
|
|
2956
|
+
return _context20.abrupt("return", _context20.sent);
|
|
2908
2957
|
|
|
2909
2958
|
case 4:
|
|
2910
2959
|
case "end":
|
|
2911
|
-
return
|
|
2960
|
+
return _context20.stop();
|
|
2912
2961
|
}
|
|
2913
2962
|
}
|
|
2914
|
-
},
|
|
2963
|
+
}, _callee20, this);
|
|
2915
2964
|
}));
|
|
2916
2965
|
|
|
2917
|
-
function removeMembers(
|
|
2966
|
+
function removeMembers(_x22, _x23) {
|
|
2918
2967
|
return _removeMembers.apply(this, arguments);
|
|
2919
2968
|
}
|
|
2920
2969
|
|
|
@@ -2932,32 +2981,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2932
2981
|
}, {
|
|
2933
2982
|
key: "demoteModerators",
|
|
2934
2983
|
value: function () {
|
|
2935
|
-
var _demoteModerators = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2984
|
+
var _demoteModerators = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee21(members, message) {
|
|
2936
2985
|
var options,
|
|
2937
|
-
|
|
2938
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2986
|
+
_args21 = arguments;
|
|
2987
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee21$(_context21) {
|
|
2939
2988
|
while (1) {
|
|
2940
|
-
switch (
|
|
2989
|
+
switch (_context21.prev = _context21.next) {
|
|
2941
2990
|
case 0:
|
|
2942
|
-
options =
|
|
2943
|
-
|
|
2991
|
+
options = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : {};
|
|
2992
|
+
_context21.next = 3;
|
|
2944
2993
|
return this._update(_objectSpread$9({
|
|
2945
2994
|
demote_moderators: members,
|
|
2946
2995
|
message: message
|
|
2947
2996
|
}, options));
|
|
2948
2997
|
|
|
2949
2998
|
case 3:
|
|
2950
|
-
return
|
|
2999
|
+
return _context21.abrupt("return", _context21.sent);
|
|
2951
3000
|
|
|
2952
3001
|
case 4:
|
|
2953
3002
|
case "end":
|
|
2954
|
-
return
|
|
3003
|
+
return _context21.stop();
|
|
2955
3004
|
}
|
|
2956
3005
|
}
|
|
2957
|
-
},
|
|
3006
|
+
}, _callee21, this);
|
|
2958
3007
|
}));
|
|
2959
3008
|
|
|
2960
|
-
function demoteModerators(
|
|
3009
|
+
function demoteModerators(_x24, _x25) {
|
|
2961
3010
|
return _demoteModerators.apply(this, arguments);
|
|
2962
3011
|
}
|
|
2963
3012
|
|
|
@@ -2973,29 +3022,29 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2973
3022
|
}, {
|
|
2974
3023
|
key: "_update",
|
|
2975
3024
|
value: function () {
|
|
2976
|
-
var _update3 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3025
|
+
var _update3 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee22(payload) {
|
|
2977
3026
|
var data;
|
|
2978
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3027
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee22$(_context22) {
|
|
2979
3028
|
while (1) {
|
|
2980
|
-
switch (
|
|
3029
|
+
switch (_context22.prev = _context22.next) {
|
|
2981
3030
|
case 0:
|
|
2982
|
-
|
|
3031
|
+
_context22.next = 2;
|
|
2983
3032
|
return this.getClient().post(this._channelURL(), payload);
|
|
2984
3033
|
|
|
2985
3034
|
case 2:
|
|
2986
|
-
data =
|
|
3035
|
+
data = _context22.sent;
|
|
2987
3036
|
this.data = data.channel;
|
|
2988
|
-
return
|
|
3037
|
+
return _context22.abrupt("return", data);
|
|
2989
3038
|
|
|
2990
3039
|
case 5:
|
|
2991
3040
|
case "end":
|
|
2992
|
-
return
|
|
3041
|
+
return _context22.stop();
|
|
2993
3042
|
}
|
|
2994
3043
|
}
|
|
2995
|
-
},
|
|
3044
|
+
}, _callee22, this);
|
|
2996
3045
|
}));
|
|
2997
3046
|
|
|
2998
|
-
function _update(
|
|
3047
|
+
function _update(_x26) {
|
|
2999
3048
|
return _update3.apply(this, arguments);
|
|
3000
3049
|
}
|
|
3001
3050
|
|
|
@@ -3017,28 +3066,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3017
3066
|
}, {
|
|
3018
3067
|
key: "mute",
|
|
3019
3068
|
value: function () {
|
|
3020
|
-
var _mute = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3069
|
+
var _mute = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee23() {
|
|
3021
3070
|
var opts,
|
|
3022
|
-
|
|
3023
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3071
|
+
_args23 = arguments;
|
|
3072
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee23$(_context23) {
|
|
3024
3073
|
while (1) {
|
|
3025
|
-
switch (
|
|
3074
|
+
switch (_context23.prev = _context23.next) {
|
|
3026
3075
|
case 0:
|
|
3027
|
-
opts =
|
|
3028
|
-
|
|
3076
|
+
opts = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
|
|
3077
|
+
_context23.next = 3;
|
|
3029
3078
|
return this.getClient().post(this.getClient().baseURL + '/moderation/mute/channel', _objectSpread$9({
|
|
3030
3079
|
channel_cid: this.cid
|
|
3031
3080
|
}, opts));
|
|
3032
3081
|
|
|
3033
3082
|
case 3:
|
|
3034
|
-
return
|
|
3083
|
+
return _context23.abrupt("return", _context23.sent);
|
|
3035
3084
|
|
|
3036
3085
|
case 4:
|
|
3037
3086
|
case "end":
|
|
3038
|
-
return
|
|
3087
|
+
return _context23.stop();
|
|
3039
3088
|
}
|
|
3040
3089
|
}
|
|
3041
|
-
},
|
|
3090
|
+
}, _callee23, this);
|
|
3042
3091
|
}));
|
|
3043
3092
|
|
|
3044
3093
|
function mute() {
|
|
@@ -3059,28 +3108,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3059
3108
|
}, {
|
|
3060
3109
|
key: "unmute",
|
|
3061
3110
|
value: function () {
|
|
3062
|
-
var _unmute = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3111
|
+
var _unmute = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee24() {
|
|
3063
3112
|
var opts,
|
|
3064
|
-
|
|
3065
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3113
|
+
_args24 = arguments;
|
|
3114
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee24$(_context24) {
|
|
3066
3115
|
while (1) {
|
|
3067
|
-
switch (
|
|
3116
|
+
switch (_context24.prev = _context24.next) {
|
|
3068
3117
|
case 0:
|
|
3069
|
-
opts =
|
|
3070
|
-
|
|
3118
|
+
opts = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
|
|
3119
|
+
_context24.next = 3;
|
|
3071
3120
|
return this.getClient().post(this.getClient().baseURL + '/moderation/unmute/channel', _objectSpread$9({
|
|
3072
3121
|
channel_cid: this.cid
|
|
3073
3122
|
}, opts));
|
|
3074
3123
|
|
|
3075
3124
|
case 3:
|
|
3076
|
-
return
|
|
3125
|
+
return _context24.abrupt("return", _context24.sent);
|
|
3077
3126
|
|
|
3078
3127
|
case 4:
|
|
3079
3128
|
case "end":
|
|
3080
|
-
return
|
|
3129
|
+
return _context24.stop();
|
|
3081
3130
|
}
|
|
3082
3131
|
}
|
|
3083
|
-
},
|
|
3132
|
+
}, _callee24, this);
|
|
3084
3133
|
}));
|
|
3085
3134
|
|
|
3086
3135
|
function unmute() {
|
|
@@ -3127,18 +3176,18 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3127
3176
|
}, {
|
|
3128
3177
|
key: "keystroke",
|
|
3129
3178
|
value: function () {
|
|
3130
|
-
var _keystroke = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3179
|
+
var _keystroke = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee25(parent_id, options) {
|
|
3131
3180
|
var now, diff;
|
|
3132
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3181
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee25$(_context25) {
|
|
3133
3182
|
while (1) {
|
|
3134
|
-
switch (
|
|
3183
|
+
switch (_context25.prev = _context25.next) {
|
|
3135
3184
|
case 0:
|
|
3136
3185
|
if (this._isTypingIndicatorsEnabled()) {
|
|
3137
|
-
|
|
3186
|
+
_context25.next = 2;
|
|
3138
3187
|
break;
|
|
3139
3188
|
}
|
|
3140
3189
|
|
|
3141
|
-
return
|
|
3190
|
+
return _context25.abrupt("return");
|
|
3142
3191
|
|
|
3143
3192
|
case 2:
|
|
3144
3193
|
now = new Date();
|
|
@@ -3147,12 +3196,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3147
3196
|
this.isTyping = true; // send a typing.start every 2 seconds
|
|
3148
3197
|
|
|
3149
3198
|
if (!(diff === null || diff > 2000)) {
|
|
3150
|
-
|
|
3199
|
+
_context25.next = 10;
|
|
3151
3200
|
break;
|
|
3152
3201
|
}
|
|
3153
3202
|
|
|
3154
3203
|
this.lastTypingEvent = new Date();
|
|
3155
|
-
|
|
3204
|
+
_context25.next = 10;
|
|
3156
3205
|
return this.sendEvent(_objectSpread$9({
|
|
3157
3206
|
type: 'typing.start',
|
|
3158
3207
|
parent_id: parent_id
|
|
@@ -3160,13 +3209,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3160
3209
|
|
|
3161
3210
|
case 10:
|
|
3162
3211
|
case "end":
|
|
3163
|
-
return
|
|
3212
|
+
return _context25.stop();
|
|
3164
3213
|
}
|
|
3165
3214
|
}
|
|
3166
|
-
},
|
|
3215
|
+
}, _callee25, this);
|
|
3167
3216
|
}));
|
|
3168
3217
|
|
|
3169
|
-
function keystroke(
|
|
3218
|
+
function keystroke(_x27, _x28) {
|
|
3170
3219
|
return _keystroke.apply(this, arguments);
|
|
3171
3220
|
}
|
|
3172
3221
|
|
|
@@ -3181,22 +3230,22 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3181
3230
|
}, {
|
|
3182
3231
|
key: "stopTyping",
|
|
3183
3232
|
value: function () {
|
|
3184
|
-
var _stopTyping = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3185
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3233
|
+
var _stopTyping = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee26(parent_id, options) {
|
|
3234
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee26$(_context26) {
|
|
3186
3235
|
while (1) {
|
|
3187
|
-
switch (
|
|
3236
|
+
switch (_context26.prev = _context26.next) {
|
|
3188
3237
|
case 0:
|
|
3189
3238
|
if (this._isTypingIndicatorsEnabled()) {
|
|
3190
|
-
|
|
3239
|
+
_context26.next = 2;
|
|
3191
3240
|
break;
|
|
3192
3241
|
}
|
|
3193
3242
|
|
|
3194
|
-
return
|
|
3243
|
+
return _context26.abrupt("return");
|
|
3195
3244
|
|
|
3196
3245
|
case 2:
|
|
3197
3246
|
this.lastTypingEvent = null;
|
|
3198
3247
|
this.isTyping = false;
|
|
3199
|
-
|
|
3248
|
+
_context26.next = 6;
|
|
3200
3249
|
return this.sendEvent(_objectSpread$9({
|
|
3201
3250
|
type: 'typing.stop',
|
|
3202
3251
|
parent_id: parent_id
|
|
@@ -3204,13 +3253,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3204
3253
|
|
|
3205
3254
|
case 6:
|
|
3206
3255
|
case "end":
|
|
3207
|
-
return
|
|
3256
|
+
return _context26.stop();
|
|
3208
3257
|
}
|
|
3209
3258
|
}
|
|
3210
|
-
},
|
|
3259
|
+
}, _callee26, this);
|
|
3211
3260
|
}));
|
|
3212
3261
|
|
|
3213
|
-
function stopTyping(
|
|
3262
|
+
function stopTyping(_x29, _x30) {
|
|
3214
3263
|
return _stopTyping.apply(this, arguments);
|
|
3215
3264
|
}
|
|
3216
3265
|
|
|
@@ -3262,39 +3311,39 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3262
3311
|
}, {
|
|
3263
3312
|
key: "markRead",
|
|
3264
3313
|
value: function () {
|
|
3265
|
-
var _markRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3314
|
+
var _markRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee27() {
|
|
3266
3315
|
var _this$getConfig2;
|
|
3267
3316
|
|
|
3268
3317
|
var data,
|
|
3269
|
-
|
|
3270
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3318
|
+
_args27 = arguments;
|
|
3319
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee27$(_context27) {
|
|
3271
3320
|
while (1) {
|
|
3272
|
-
switch (
|
|
3321
|
+
switch (_context27.prev = _context27.next) {
|
|
3273
3322
|
case 0:
|
|
3274
|
-
data =
|
|
3323
|
+
data = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
|
|
3275
3324
|
|
|
3276
3325
|
this._checkInitialized();
|
|
3277
3326
|
|
|
3278
3327
|
if (!(!((_this$getConfig2 = this.getConfig()) !== null && _this$getConfig2 !== void 0 && _this$getConfig2.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
3279
|
-
|
|
3328
|
+
_context27.next = 4;
|
|
3280
3329
|
break;
|
|
3281
3330
|
}
|
|
3282
3331
|
|
|
3283
|
-
return
|
|
3332
|
+
return _context27.abrupt("return", Promise.resolve(null));
|
|
3284
3333
|
|
|
3285
3334
|
case 4:
|
|
3286
|
-
|
|
3335
|
+
_context27.next = 6;
|
|
3287
3336
|
return this.getClient().post(this._channelURL() + '/read', _objectSpread$9({}, data));
|
|
3288
3337
|
|
|
3289
3338
|
case 6:
|
|
3290
|
-
return
|
|
3339
|
+
return _context27.abrupt("return", _context27.sent);
|
|
3291
3340
|
|
|
3292
3341
|
case 7:
|
|
3293
3342
|
case "end":
|
|
3294
|
-
return
|
|
3343
|
+
return _context27.stop();
|
|
3295
3344
|
}
|
|
3296
3345
|
}
|
|
3297
|
-
},
|
|
3346
|
+
}, _callee27, this);
|
|
3298
3347
|
}));
|
|
3299
3348
|
|
|
3300
3349
|
function markRead() {
|
|
@@ -3313,38 +3362,38 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3313
3362
|
}, {
|
|
3314
3363
|
key: "markUnread",
|
|
3315
3364
|
value: function () {
|
|
3316
|
-
var _markUnread = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3365
|
+
var _markUnread = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee28(data) {
|
|
3317
3366
|
var _this$getConfig3;
|
|
3318
3367
|
|
|
3319
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3368
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee28$(_context28) {
|
|
3320
3369
|
while (1) {
|
|
3321
|
-
switch (
|
|
3370
|
+
switch (_context28.prev = _context28.next) {
|
|
3322
3371
|
case 0:
|
|
3323
3372
|
this._checkInitialized();
|
|
3324
3373
|
|
|
3325
3374
|
if (!(!((_this$getConfig3 = this.getConfig()) !== null && _this$getConfig3 !== void 0 && _this$getConfig3.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
3326
|
-
|
|
3375
|
+
_context28.next = 3;
|
|
3327
3376
|
break;
|
|
3328
3377
|
}
|
|
3329
3378
|
|
|
3330
|
-
return
|
|
3379
|
+
return _context28.abrupt("return", Promise.resolve(null));
|
|
3331
3380
|
|
|
3332
3381
|
case 3:
|
|
3333
|
-
|
|
3382
|
+
_context28.next = 5;
|
|
3334
3383
|
return this.getClient().post(this._channelURL() + '/unread', _objectSpread$9({}, data));
|
|
3335
3384
|
|
|
3336
3385
|
case 5:
|
|
3337
|
-
return
|
|
3386
|
+
return _context28.abrupt("return", _context28.sent);
|
|
3338
3387
|
|
|
3339
3388
|
case 6:
|
|
3340
3389
|
case "end":
|
|
3341
|
-
return
|
|
3390
|
+
return _context28.stop();
|
|
3342
3391
|
}
|
|
3343
3392
|
}
|
|
3344
|
-
},
|
|
3393
|
+
}, _callee28, this);
|
|
3345
3394
|
}));
|
|
3346
3395
|
|
|
3347
|
-
function markUnread(
|
|
3396
|
+
function markUnread(_x31) {
|
|
3348
3397
|
return _markUnread.apply(this, arguments);
|
|
3349
3398
|
}
|
|
3350
3399
|
|
|
@@ -3379,11 +3428,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3379
3428
|
}, {
|
|
3380
3429
|
key: "watch",
|
|
3381
3430
|
value: function () {
|
|
3382
|
-
var _watch = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3431
|
+
var _watch = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee29(options) {
|
|
3383
3432
|
var defaultOptions, combined, state;
|
|
3384
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3433
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee29$(_context29) {
|
|
3385
3434
|
while (1) {
|
|
3386
|
-
switch (
|
|
3435
|
+
switch (_context29.prev = _context29.next) {
|
|
3387
3436
|
case 0:
|
|
3388
3437
|
defaultOptions = {
|
|
3389
3438
|
state: true,
|
|
@@ -3391,7 +3440,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3391
3440
|
presence: false
|
|
3392
3441
|
}; // Make sure we wait for the connect promise if there is a pending one
|
|
3393
3442
|
|
|
3394
|
-
|
|
3443
|
+
_context29.next = 3;
|
|
3395
3444
|
return this.getClient().wsPromise;
|
|
3396
3445
|
|
|
3397
3446
|
case 3:
|
|
@@ -3400,11 +3449,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3400
3449
|
}
|
|
3401
3450
|
|
|
3402
3451
|
combined = _objectSpread$9(_objectSpread$9({}, defaultOptions), options);
|
|
3403
|
-
|
|
3452
|
+
_context29.next = 7;
|
|
3404
3453
|
return this.query(combined, 'latest');
|
|
3405
3454
|
|
|
3406
3455
|
case 7:
|
|
3407
|
-
state =
|
|
3456
|
+
state = _context29.sent;
|
|
3408
3457
|
this.initialized = true;
|
|
3409
3458
|
this.data = state.channel;
|
|
3410
3459
|
|
|
@@ -3413,17 +3462,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3413
3462
|
channel: this
|
|
3414
3463
|
});
|
|
3415
3464
|
|
|
3416
|
-
return
|
|
3465
|
+
return _context29.abrupt("return", state);
|
|
3417
3466
|
|
|
3418
3467
|
case 12:
|
|
3419
3468
|
case "end":
|
|
3420
|
-
return
|
|
3469
|
+
return _context29.stop();
|
|
3421
3470
|
}
|
|
3422
3471
|
}
|
|
3423
|
-
},
|
|
3472
|
+
}, _callee29, this);
|
|
3424
3473
|
}));
|
|
3425
3474
|
|
|
3426
|
-
function watch(
|
|
3475
|
+
function watch(_x32) {
|
|
3427
3476
|
return _watch.apply(this, arguments);
|
|
3428
3477
|
}
|
|
3429
3478
|
|
|
@@ -3438,31 +3487,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3438
3487
|
}, {
|
|
3439
3488
|
key: "stopWatching",
|
|
3440
3489
|
value: function () {
|
|
3441
|
-
var _stopWatching = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3490
|
+
var _stopWatching = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee30() {
|
|
3442
3491
|
var response;
|
|
3443
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3492
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee30$(_context30) {
|
|
3444
3493
|
while (1) {
|
|
3445
|
-
switch (
|
|
3494
|
+
switch (_context30.prev = _context30.next) {
|
|
3446
3495
|
case 0:
|
|
3447
|
-
|
|
3496
|
+
_context30.next = 2;
|
|
3448
3497
|
return this.getClient().post(this._channelURL() + '/stop-watching', {});
|
|
3449
3498
|
|
|
3450
3499
|
case 2:
|
|
3451
|
-
response =
|
|
3500
|
+
response = _context30.sent;
|
|
3452
3501
|
|
|
3453
3502
|
this._client.logger('info', "channel:watch() - stopped watching channel ".concat(this.cid), {
|
|
3454
3503
|
tags: ['channel'],
|
|
3455
3504
|
channel: this
|
|
3456
3505
|
});
|
|
3457
3506
|
|
|
3458
|
-
return
|
|
3507
|
+
return _context30.abrupt("return", response);
|
|
3459
3508
|
|
|
3460
3509
|
case 5:
|
|
3461
3510
|
case "end":
|
|
3462
|
-
return
|
|
3511
|
+
return _context30.stop();
|
|
3463
3512
|
}
|
|
3464
3513
|
}
|
|
3465
|
-
},
|
|
3514
|
+
}, _callee30, this);
|
|
3466
3515
|
}));
|
|
3467
3516
|
|
|
3468
3517
|
function stopWatching() {
|
|
@@ -3485,37 +3534,37 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3485
3534
|
}, {
|
|
3486
3535
|
key: "getReplies",
|
|
3487
3536
|
value: function () {
|
|
3488
|
-
var _getReplies = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3537
|
+
var _getReplies = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee31(parent_id, options, sort) {
|
|
3489
3538
|
var normalizedSort, data;
|
|
3490
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3539
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee31$(_context31) {
|
|
3491
3540
|
while (1) {
|
|
3492
|
-
switch (
|
|
3541
|
+
switch (_context31.prev = _context31.next) {
|
|
3493
3542
|
case 0:
|
|
3494
3543
|
normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
|
|
3495
|
-
|
|
3544
|
+
_context31.next = 3;
|
|
3496
3545
|
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(parent_id), "/replies"), _objectSpread$9({
|
|
3497
3546
|
sort: normalizedSort
|
|
3498
3547
|
}, options));
|
|
3499
3548
|
|
|
3500
3549
|
case 3:
|
|
3501
|
-
data =
|
|
3550
|
+
data = _context31.sent;
|
|
3502
3551
|
|
|
3503
3552
|
// add any messages to our thread state
|
|
3504
3553
|
if (data.messages) {
|
|
3505
3554
|
this.state.addMessagesSorted(data.messages);
|
|
3506
3555
|
}
|
|
3507
3556
|
|
|
3508
|
-
return
|
|
3557
|
+
return _context31.abrupt("return", data);
|
|
3509
3558
|
|
|
3510
3559
|
case 6:
|
|
3511
3560
|
case "end":
|
|
3512
|
-
return
|
|
3561
|
+
return _context31.stop();
|
|
3513
3562
|
}
|
|
3514
3563
|
}
|
|
3515
|
-
},
|
|
3564
|
+
}, _callee31, this);
|
|
3516
3565
|
}));
|
|
3517
3566
|
|
|
3518
|
-
function getReplies(
|
|
3567
|
+
function getReplies(_x33, _x34, _x35) {
|
|
3519
3568
|
return _getReplies.apply(this, arguments);
|
|
3520
3569
|
}
|
|
3521
3570
|
|
|
@@ -3533,15 +3582,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3533
3582
|
}, {
|
|
3534
3583
|
key: "getPinnedMessages",
|
|
3535
3584
|
value: function () {
|
|
3536
|
-
var _getPinnedMessages = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3585
|
+
var _getPinnedMessages = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee32(options) {
|
|
3537
3586
|
var sort,
|
|
3538
|
-
|
|
3539
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3587
|
+
_args32 = arguments;
|
|
3588
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee32$(_context32) {
|
|
3540
3589
|
while (1) {
|
|
3541
|
-
switch (
|
|
3590
|
+
switch (_context32.prev = _context32.next) {
|
|
3542
3591
|
case 0:
|
|
3543
|
-
sort =
|
|
3544
|
-
|
|
3592
|
+
sort = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : [];
|
|
3593
|
+
_context32.next = 3;
|
|
3545
3594
|
return this.getClient().get(this._channelURL() + '/pinned_messages', {
|
|
3546
3595
|
payload: _objectSpread$9(_objectSpread$9({}, options), {}, {
|
|
3547
3596
|
sort: normalizeQuerySort(sort)
|
|
@@ -3549,17 +3598,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3549
3598
|
});
|
|
3550
3599
|
|
|
3551
3600
|
case 3:
|
|
3552
|
-
return
|
|
3601
|
+
return _context32.abrupt("return", _context32.sent);
|
|
3553
3602
|
|
|
3554
3603
|
case 4:
|
|
3555
3604
|
case "end":
|
|
3556
|
-
return
|
|
3605
|
+
return _context32.stop();
|
|
3557
3606
|
}
|
|
3558
3607
|
}
|
|
3559
|
-
},
|
|
3608
|
+
}, _callee32, this);
|
|
3560
3609
|
}));
|
|
3561
3610
|
|
|
3562
|
-
function getPinnedMessages(
|
|
3611
|
+
function getPinnedMessages(_x36) {
|
|
3563
3612
|
return _getPinnedMessages.apply(this, arguments);
|
|
3564
3613
|
}
|
|
3565
3614
|
|
|
@@ -3695,7 +3744,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3695
3744
|
* @return {Promise<QueryChannelAPIResponse<StreamChatGenerics>>} Returns a query response
|
|
3696
3745
|
*/
|
|
3697
3746
|
function () {
|
|
3698
|
-
var _query = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3747
|
+
var _query = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee33(options) {
|
|
3699
3748
|
var _options$messages$lim, _options$messages, _this$data6, _this$data7;
|
|
3700
3749
|
|
|
3701
3750
|
var messageSetToAddToIfDoesNotExist,
|
|
@@ -3706,14 +3755,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3706
3755
|
_this$_initializeStat,
|
|
3707
3756
|
messageSet,
|
|
3708
3757
|
areCapabilitiesChanged,
|
|
3709
|
-
|
|
3758
|
+
_args33 = arguments;
|
|
3710
3759
|
|
|
3711
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3760
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee33$(_context33) {
|
|
3712
3761
|
while (1) {
|
|
3713
|
-
switch (
|
|
3762
|
+
switch (_context33.prev = _context33.next) {
|
|
3714
3763
|
case 0:
|
|
3715
|
-
messageSetToAddToIfDoesNotExist =
|
|
3716
|
-
|
|
3764
|
+
messageSetToAddToIfDoesNotExist = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : 'current';
|
|
3765
|
+
_context33.next = 3;
|
|
3717
3766
|
return this.getClient().wsPromise;
|
|
3718
3767
|
|
|
3719
3768
|
case 3:
|
|
@@ -3723,14 +3772,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3723
3772
|
queryURL += "/".concat(encodeURIComponent(this.id));
|
|
3724
3773
|
}
|
|
3725
3774
|
|
|
3726
|
-
|
|
3775
|
+
_context33.next = 7;
|
|
3727
3776
|
return this.getClient().post(queryURL + '/query', _objectSpread$9({
|
|
3728
3777
|
data: this._data,
|
|
3729
3778
|
state: true
|
|
3730
3779
|
}, options));
|
|
3731
3780
|
|
|
3732
3781
|
case 7:
|
|
3733
|
-
state =
|
|
3782
|
+
state = _context33.sent;
|
|
3734
3783
|
|
|
3735
3784
|
// update the channel id if it was missing
|
|
3736
3785
|
if (!this.id) {
|
|
@@ -3785,17 +3834,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3785
3834
|
isLatestMessageSet: messageSet.isLatest
|
|
3786
3835
|
}
|
|
3787
3836
|
});
|
|
3788
|
-
return
|
|
3837
|
+
return _context33.abrupt("return", state);
|
|
3789
3838
|
|
|
3790
3839
|
case 18:
|
|
3791
3840
|
case "end":
|
|
3792
|
-
return
|
|
3841
|
+
return _context33.stop();
|
|
3793
3842
|
}
|
|
3794
3843
|
}
|
|
3795
|
-
},
|
|
3844
|
+
}, _callee33, this);
|
|
3796
3845
|
}));
|
|
3797
3846
|
|
|
3798
|
-
function query(
|
|
3847
|
+
function query(_x37) {
|
|
3799
3848
|
return _query.apply(this, arguments);
|
|
3800
3849
|
}
|
|
3801
3850
|
|
|
@@ -3812,31 +3861,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3812
3861
|
}, {
|
|
3813
3862
|
key: "banUser",
|
|
3814
3863
|
value: function () {
|
|
3815
|
-
var _banUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3816
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3864
|
+
var _banUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee34(targetUserID, options) {
|
|
3865
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee34$(_context34) {
|
|
3817
3866
|
while (1) {
|
|
3818
|
-
switch (
|
|
3867
|
+
switch (_context34.prev = _context34.next) {
|
|
3819
3868
|
case 0:
|
|
3820
3869
|
this._checkInitialized();
|
|
3821
3870
|
|
|
3822
|
-
|
|
3871
|
+
_context34.next = 3;
|
|
3823
3872
|
return this.getClient().banUser(targetUserID, _objectSpread$9(_objectSpread$9({}, options), {}, {
|
|
3824
3873
|
type: this.type,
|
|
3825
3874
|
id: this.id
|
|
3826
3875
|
}));
|
|
3827
3876
|
|
|
3828
3877
|
case 3:
|
|
3829
|
-
return
|
|
3878
|
+
return _context34.abrupt("return", _context34.sent);
|
|
3830
3879
|
|
|
3831
3880
|
case 4:
|
|
3832
3881
|
case "end":
|
|
3833
|
-
return
|
|
3882
|
+
return _context34.stop();
|
|
3834
3883
|
}
|
|
3835
3884
|
}
|
|
3836
|
-
},
|
|
3885
|
+
}, _callee34, this);
|
|
3837
3886
|
}));
|
|
3838
3887
|
|
|
3839
|
-
function banUser(
|
|
3888
|
+
function banUser(_x38, _x39) {
|
|
3840
3889
|
return _banUser.apply(this, arguments);
|
|
3841
3890
|
}
|
|
3842
3891
|
|
|
@@ -3854,34 +3903,34 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3854
3903
|
}, {
|
|
3855
3904
|
key: "hide",
|
|
3856
3905
|
value: function () {
|
|
3857
|
-
var _hide = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3906
|
+
var _hide = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee35() {
|
|
3858
3907
|
var userId,
|
|
3859
3908
|
clearHistory,
|
|
3860
|
-
|
|
3861
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3909
|
+
_args35 = arguments;
|
|
3910
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee35$(_context35) {
|
|
3862
3911
|
while (1) {
|
|
3863
|
-
switch (
|
|
3912
|
+
switch (_context35.prev = _context35.next) {
|
|
3864
3913
|
case 0:
|
|
3865
|
-
userId =
|
|
3866
|
-
clearHistory =
|
|
3914
|
+
userId = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : null;
|
|
3915
|
+
clearHistory = _args35.length > 1 && _args35[1] !== undefined ? _args35[1] : false;
|
|
3867
3916
|
|
|
3868
3917
|
this._checkInitialized();
|
|
3869
3918
|
|
|
3870
|
-
|
|
3919
|
+
_context35.next = 5;
|
|
3871
3920
|
return this.getClient().post("".concat(this._channelURL(), "/hide"), {
|
|
3872
3921
|
user_id: userId,
|
|
3873
3922
|
clear_history: clearHistory
|
|
3874
3923
|
});
|
|
3875
3924
|
|
|
3876
3925
|
case 5:
|
|
3877
|
-
return
|
|
3926
|
+
return _context35.abrupt("return", _context35.sent);
|
|
3878
3927
|
|
|
3879
3928
|
case 6:
|
|
3880
3929
|
case "end":
|
|
3881
|
-
return
|
|
3930
|
+
return _context35.stop();
|
|
3882
3931
|
}
|
|
3883
3932
|
}
|
|
3884
|
-
},
|
|
3933
|
+
}, _callee35, this);
|
|
3885
3934
|
}));
|
|
3886
3935
|
|
|
3887
3936
|
function hide() {
|
|
@@ -3900,31 +3949,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3900
3949
|
}, {
|
|
3901
3950
|
key: "show",
|
|
3902
3951
|
value: function () {
|
|
3903
|
-
var _show = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3952
|
+
var _show = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee36() {
|
|
3904
3953
|
var userId,
|
|
3905
|
-
|
|
3906
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3954
|
+
_args36 = arguments;
|
|
3955
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee36$(_context36) {
|
|
3907
3956
|
while (1) {
|
|
3908
|
-
switch (
|
|
3957
|
+
switch (_context36.prev = _context36.next) {
|
|
3909
3958
|
case 0:
|
|
3910
|
-
userId =
|
|
3959
|
+
userId = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : null;
|
|
3911
3960
|
|
|
3912
3961
|
this._checkInitialized();
|
|
3913
3962
|
|
|
3914
|
-
|
|
3963
|
+
_context36.next = 4;
|
|
3915
3964
|
return this.getClient().post("".concat(this._channelURL(), "/show"), {
|
|
3916
3965
|
user_id: userId
|
|
3917
3966
|
});
|
|
3918
3967
|
|
|
3919
3968
|
case 4:
|
|
3920
|
-
return
|
|
3969
|
+
return _context36.abrupt("return", _context36.sent);
|
|
3921
3970
|
|
|
3922
3971
|
case 5:
|
|
3923
3972
|
case "end":
|
|
3924
|
-
return
|
|
3973
|
+
return _context36.stop();
|
|
3925
3974
|
}
|
|
3926
3975
|
}
|
|
3927
|
-
},
|
|
3976
|
+
}, _callee36, this);
|
|
3928
3977
|
}));
|
|
3929
3978
|
|
|
3930
3979
|
function show() {
|
|
@@ -3943,31 +3992,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3943
3992
|
}, {
|
|
3944
3993
|
key: "unbanUser",
|
|
3945
3994
|
value: function () {
|
|
3946
|
-
var _unbanUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3947
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3995
|
+
var _unbanUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee37(targetUserID) {
|
|
3996
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee37$(_context37) {
|
|
3948
3997
|
while (1) {
|
|
3949
|
-
switch (
|
|
3998
|
+
switch (_context37.prev = _context37.next) {
|
|
3950
3999
|
case 0:
|
|
3951
4000
|
this._checkInitialized();
|
|
3952
4001
|
|
|
3953
|
-
|
|
4002
|
+
_context37.next = 3;
|
|
3954
4003
|
return this.getClient().unbanUser(targetUserID, {
|
|
3955
4004
|
type: this.type,
|
|
3956
4005
|
id: this.id
|
|
3957
4006
|
});
|
|
3958
4007
|
|
|
3959
4008
|
case 3:
|
|
3960
|
-
return
|
|
4009
|
+
return _context37.abrupt("return", _context37.sent);
|
|
3961
4010
|
|
|
3962
4011
|
case 4:
|
|
3963
4012
|
case "end":
|
|
3964
|
-
return
|
|
4013
|
+
return _context37.stop();
|
|
3965
4014
|
}
|
|
3966
4015
|
}
|
|
3967
|
-
},
|
|
4016
|
+
}, _callee37, this);
|
|
3968
4017
|
}));
|
|
3969
4018
|
|
|
3970
|
-
function unbanUser(
|
|
4019
|
+
function unbanUser(_x40) {
|
|
3971
4020
|
return _unbanUser.apply(this, arguments);
|
|
3972
4021
|
}
|
|
3973
4022
|
|
|
@@ -3984,31 +4033,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3984
4033
|
}, {
|
|
3985
4034
|
key: "shadowBan",
|
|
3986
4035
|
value: function () {
|
|
3987
|
-
var _shadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3988
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4036
|
+
var _shadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee38(targetUserID, options) {
|
|
4037
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee38$(_context38) {
|
|
3989
4038
|
while (1) {
|
|
3990
|
-
switch (
|
|
4039
|
+
switch (_context38.prev = _context38.next) {
|
|
3991
4040
|
case 0:
|
|
3992
4041
|
this._checkInitialized();
|
|
3993
4042
|
|
|
3994
|
-
|
|
4043
|
+
_context38.next = 3;
|
|
3995
4044
|
return this.getClient().shadowBan(targetUserID, _objectSpread$9(_objectSpread$9({}, options), {}, {
|
|
3996
4045
|
type: this.type,
|
|
3997
4046
|
id: this.id
|
|
3998
4047
|
}));
|
|
3999
4048
|
|
|
4000
4049
|
case 3:
|
|
4001
|
-
return
|
|
4050
|
+
return _context38.abrupt("return", _context38.sent);
|
|
4002
4051
|
|
|
4003
4052
|
case 4:
|
|
4004
4053
|
case "end":
|
|
4005
|
-
return
|
|
4054
|
+
return _context38.stop();
|
|
4006
4055
|
}
|
|
4007
4056
|
}
|
|
4008
|
-
},
|
|
4057
|
+
}, _callee38, this);
|
|
4009
4058
|
}));
|
|
4010
4059
|
|
|
4011
|
-
function shadowBan(
|
|
4060
|
+
function shadowBan(_x41, _x42) {
|
|
4012
4061
|
return _shadowBan.apply(this, arguments);
|
|
4013
4062
|
}
|
|
4014
4063
|
|
|
@@ -4024,31 +4073,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4024
4073
|
}, {
|
|
4025
4074
|
key: "removeShadowBan",
|
|
4026
4075
|
value: function () {
|
|
4027
|
-
var _removeShadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4028
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4076
|
+
var _removeShadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee39(targetUserID) {
|
|
4077
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee39$(_context39) {
|
|
4029
4078
|
while (1) {
|
|
4030
|
-
switch (
|
|
4079
|
+
switch (_context39.prev = _context39.next) {
|
|
4031
4080
|
case 0:
|
|
4032
4081
|
this._checkInitialized();
|
|
4033
4082
|
|
|
4034
|
-
|
|
4083
|
+
_context39.next = 3;
|
|
4035
4084
|
return this.getClient().removeShadowBan(targetUserID, {
|
|
4036
4085
|
type: this.type,
|
|
4037
4086
|
id: this.id
|
|
4038
4087
|
});
|
|
4039
4088
|
|
|
4040
4089
|
case 3:
|
|
4041
|
-
return
|
|
4090
|
+
return _context39.abrupt("return", _context39.sent);
|
|
4042
4091
|
|
|
4043
4092
|
case 4:
|
|
4044
4093
|
case "end":
|
|
4045
|
-
return
|
|
4094
|
+
return _context39.stop();
|
|
4046
4095
|
}
|
|
4047
4096
|
}
|
|
4048
|
-
},
|
|
4097
|
+
}, _callee39, this);
|
|
4049
4098
|
}));
|
|
4050
4099
|
|
|
4051
|
-
function removeShadowBan(
|
|
4100
|
+
function removeShadowBan(_x43) {
|
|
4052
4101
|
return _removeShadowBan.apply(this, arguments);
|
|
4053
4102
|
}
|
|
4054
4103
|
|
|
@@ -4064,26 +4113,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4064
4113
|
}, {
|
|
4065
4114
|
key: "createCall",
|
|
4066
4115
|
value: function () {
|
|
4067
|
-
var _createCall = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4068
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4116
|
+
var _createCall = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee40(options) {
|
|
4117
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee40$(_context40) {
|
|
4069
4118
|
while (1) {
|
|
4070
|
-
switch (
|
|
4119
|
+
switch (_context40.prev = _context40.next) {
|
|
4071
4120
|
case 0:
|
|
4072
|
-
|
|
4121
|
+
_context40.next = 2;
|
|
4073
4122
|
return this.getClient().post(this._channelURL() + '/call', options);
|
|
4074
4123
|
|
|
4075
4124
|
case 2:
|
|
4076
|
-
return
|
|
4125
|
+
return _context40.abrupt("return", _context40.sent);
|
|
4077
4126
|
|
|
4078
4127
|
case 3:
|
|
4079
4128
|
case "end":
|
|
4080
|
-
return
|
|
4129
|
+
return _context40.stop();
|
|
4081
4130
|
}
|
|
4082
4131
|
}
|
|
4083
|
-
},
|
|
4132
|
+
}, _callee40, this);
|
|
4084
4133
|
}));
|
|
4085
4134
|
|
|
4086
|
-
function createCall(
|
|
4135
|
+
function createCall(_x44) {
|
|
4087
4136
|
return _createCall.apply(this, arguments);
|
|
4088
4137
|
}
|
|
4089
4138
|
|
|
@@ -4099,26 +4148,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4099
4148
|
}, {
|
|
4100
4149
|
key: "vote",
|
|
4101
4150
|
value: function () {
|
|
4102
|
-
var _vote2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4103
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4151
|
+
var _vote2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee41(messageId, pollId, _vote) {
|
|
4152
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee41$(_context41) {
|
|
4104
4153
|
while (1) {
|
|
4105
|
-
switch (
|
|
4154
|
+
switch (_context41.prev = _context41.next) {
|
|
4106
4155
|
case 0:
|
|
4107
|
-
|
|
4156
|
+
_context41.next = 2;
|
|
4108
4157
|
return this.getClient().castPollVote(messageId, pollId, _vote);
|
|
4109
4158
|
|
|
4110
4159
|
case 2:
|
|
4111
|
-
return
|
|
4160
|
+
return _context41.abrupt("return", _context41.sent);
|
|
4112
4161
|
|
|
4113
4162
|
case 3:
|
|
4114
4163
|
case "end":
|
|
4115
|
-
return
|
|
4164
|
+
return _context41.stop();
|
|
4116
4165
|
}
|
|
4117
4166
|
}
|
|
4118
|
-
},
|
|
4167
|
+
}, _callee41, this);
|
|
4119
4168
|
}));
|
|
4120
4169
|
|
|
4121
|
-
function vote(
|
|
4170
|
+
function vote(_x45, _x46, _x47) {
|
|
4122
4171
|
return _vote2.apply(this, arguments);
|
|
4123
4172
|
}
|
|
4124
4173
|
|
|
@@ -4127,26 +4176,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4127
4176
|
}, {
|
|
4128
4177
|
key: "removeVote",
|
|
4129
4178
|
value: function () {
|
|
4130
|
-
var _removeVote = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4131
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4179
|
+
var _removeVote = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee42(messageId, pollId, voteId) {
|
|
4180
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee42$(_context42) {
|
|
4132
4181
|
while (1) {
|
|
4133
|
-
switch (
|
|
4182
|
+
switch (_context42.prev = _context42.next) {
|
|
4134
4183
|
case 0:
|
|
4135
|
-
|
|
4184
|
+
_context42.next = 2;
|
|
4136
4185
|
return this.getClient().removePollVote(messageId, pollId, voteId);
|
|
4137
4186
|
|
|
4138
4187
|
case 2:
|
|
4139
|
-
return
|
|
4188
|
+
return _context42.abrupt("return", _context42.sent);
|
|
4140
4189
|
|
|
4141
4190
|
case 3:
|
|
4142
4191
|
case "end":
|
|
4143
|
-
return
|
|
4192
|
+
return _context42.stop();
|
|
4144
4193
|
}
|
|
4145
4194
|
}
|
|
4146
|
-
},
|
|
4195
|
+
}, _callee42, this);
|
|
4147
4196
|
}));
|
|
4148
4197
|
|
|
4149
|
-
function removeVote(
|
|
4198
|
+
function removeVote(_x48, _x49, _x50) {
|
|
4150
4199
|
return _removeVote.apply(this, arguments);
|
|
4151
4200
|
}
|
|
4152
4201
|
|
|
@@ -4687,13 +4736,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4687
4736
|
}
|
|
4688
4737
|
|
|
4689
4738
|
if (state.members) {
|
|
4690
|
-
this.state.members
|
|
4691
|
-
if (member.user) {
|
|
4692
|
-
acc[member.user.id] = member;
|
|
4693
|
-
}
|
|
4694
|
-
|
|
4695
|
-
return acc;
|
|
4696
|
-
}, {});
|
|
4739
|
+
this._hydrateMembers(state.members);
|
|
4697
4740
|
}
|
|
4698
4741
|
|
|
4699
4742
|
return {
|
|
@@ -4713,6 +4756,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4713
4756
|
event.message.own_reactions = message.own_reactions;
|
|
4714
4757
|
}
|
|
4715
4758
|
}
|
|
4759
|
+
}, {
|
|
4760
|
+
key: "_hydrateMembers",
|
|
4761
|
+
value: function _hydrateMembers(members) {
|
|
4762
|
+
this.state.members = members.reduce(function (acc, member) {
|
|
4763
|
+
if (member.user) {
|
|
4764
|
+
acc[member.user.id] = member;
|
|
4765
|
+
}
|
|
4766
|
+
|
|
4767
|
+
return acc;
|
|
4768
|
+
}, {});
|
|
4769
|
+
}
|
|
4716
4770
|
}, {
|
|
4717
4771
|
key: "_disconnect",
|
|
4718
4772
|
value: function _disconnect() {
|
|
@@ -7866,9 +7920,17 @@ var Thread = /*#__PURE__*/function () {
|
|
|
7866
7920
|
};
|
|
7867
7921
|
}());
|
|
7868
7922
|
|
|
7923
|
+
var _channel = client.channel(threadData.channel.type, threadData.channel.id, {
|
|
7924
|
+
name: threadData.channel.name
|
|
7925
|
+
});
|
|
7926
|
+
|
|
7927
|
+
if (threadData.channel.members) {
|
|
7928
|
+
_channel._hydrateMembers(threadData.channel.members);
|
|
7929
|
+
}
|
|
7930
|
+
|
|
7869
7931
|
this.state = new StateStore({
|
|
7870
7932
|
active: false,
|
|
7871
|
-
channel:
|
|
7933
|
+
channel: _channel,
|
|
7872
7934
|
createdAt: new Date(threadData.created_at),
|
|
7873
7935
|
deletedAt: threadData.deleted_at ? new Date(threadData.deleted_at) : null,
|
|
7874
7936
|
isLoading: false,
|
|
@@ -13300,7 +13362,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
13300
13362
|
}, {
|
|
13301
13363
|
key: "getUserAgent",
|
|
13302
13364
|
value: function getUserAgent() {
|
|
13303
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.40.
|
|
13365
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.40.4");
|
|
13304
13366
|
}
|
|
13305
13367
|
}, {
|
|
13306
13368
|
key: "setUserAgent",
|