@webex/internal-plugin-conversation 3.7.0-next.2 → 3.7.0-next.3
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/conversation.js +175 -157
- package/dist/conversation.js.map +1 -1
- package/dist/share-activity.js +1 -1
- package/package.json +1 -1
- package/src/conversation.js +28 -25
- package/test/unit/spec/conversation.js +6 -28
package/dist/conversation.js
CHANGED
|
@@ -327,38 +327,56 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
327
327
|
*/
|
|
328
328
|
addReaction: function addReaction(conversation, displayName, activity, recipientId) {
|
|
329
329
|
var _this7 = this;
|
|
330
|
-
return
|
|
331
|
-
var addReactionPayload
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
330
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
331
|
+
var hmac, addReactionPayload;
|
|
332
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
333
|
+
while (1) switch (_context.prev = _context.next) {
|
|
334
|
+
case 0:
|
|
335
|
+
if (!_this7.config.includeEncryptionTransforms) {
|
|
336
|
+
_context.next = 4;
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
_context.next = 3;
|
|
340
|
+
return _this7.createReactionHmac(displayName, activity);
|
|
341
|
+
case 3:
|
|
342
|
+
hmac = _context.sent;
|
|
343
|
+
case 4:
|
|
344
|
+
addReactionPayload = {
|
|
345
|
+
actor: {
|
|
346
|
+
objectType: 'person',
|
|
347
|
+
id: _this7.webex.internal.device.userId
|
|
348
|
+
},
|
|
349
|
+
target: {
|
|
350
|
+
id: conversation.id,
|
|
351
|
+
objectType: 'conversation'
|
|
352
|
+
},
|
|
353
|
+
verb: 'add',
|
|
354
|
+
objectType: 'activity',
|
|
355
|
+
parent: {
|
|
356
|
+
type: 'reaction',
|
|
357
|
+
id: activity.id
|
|
358
|
+
},
|
|
359
|
+
object: {
|
|
360
|
+
objectType: 'reaction2',
|
|
361
|
+
displayName: displayName,
|
|
362
|
+
hmac: hmac
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
if (recipientId) {
|
|
366
|
+
addReactionPayload.recipients = {
|
|
367
|
+
items: [{
|
|
368
|
+
id: recipientId,
|
|
369
|
+
objectType: 'person'
|
|
370
|
+
}]
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
return _context.abrupt("return", _this7.sendReaction(conversation, addReactionPayload));
|
|
374
|
+
case 7:
|
|
375
|
+
case "end":
|
|
376
|
+
return _context.stop();
|
|
350
377
|
}
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
addReactionPayload.recipients = {
|
|
354
|
-
items: [{
|
|
355
|
-
id: recipientId,
|
|
356
|
-
objectType: 'person'
|
|
357
|
-
}]
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
return _this7.sendReaction(conversation, addReactionPayload);
|
|
361
|
-
});
|
|
378
|
+
}, _callee);
|
|
379
|
+
}))();
|
|
362
380
|
},
|
|
363
381
|
/**
|
|
364
382
|
* delete content
|
|
@@ -694,23 +712,23 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
694
712
|
paginate: function paginate() {
|
|
695
713
|
var _arguments = arguments,
|
|
696
714
|
_this12 = this;
|
|
697
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
715
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
698
716
|
var options, queryOptions, reqOptions;
|
|
699
|
-
return _regenerator.default.wrap(function
|
|
700
|
-
while (1) switch (
|
|
717
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
718
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
701
719
|
case 0:
|
|
702
720
|
options = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : {};
|
|
703
721
|
if (!options.page) {
|
|
704
|
-
|
|
722
|
+
_context2.next = 5;
|
|
705
723
|
break;
|
|
706
724
|
}
|
|
707
725
|
if (!(!options.page.links || !options.page.links.next)) {
|
|
708
|
-
|
|
726
|
+
_context2.next = 4;
|
|
709
727
|
break;
|
|
710
728
|
}
|
|
711
729
|
throw new Error('No link to follow for the provided page');
|
|
712
730
|
case 4:
|
|
713
|
-
return
|
|
731
|
+
return _context2.abrupt("return", _this12.request({
|
|
714
732
|
url: options.page.links.next
|
|
715
733
|
}).then(function (res) {
|
|
716
734
|
return {
|
|
@@ -738,7 +756,7 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
738
756
|
reqOptions.service = 'conversation';
|
|
739
757
|
reqOptions.resource = 'conversations';
|
|
740
758
|
}
|
|
741
|
-
return
|
|
759
|
+
return _context2.abrupt("return", _this12.request(reqOptions).then(function (res) {
|
|
742
760
|
var response = {
|
|
743
761
|
page: new _webexCore.Page(res, _this12.webex)
|
|
744
762
|
};
|
|
@@ -749,9 +767,9 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
749
767
|
}));
|
|
750
768
|
case 9:
|
|
751
769
|
case "end":
|
|
752
|
-
return
|
|
770
|
+
return _context2.stop();
|
|
753
771
|
}
|
|
754
|
-
},
|
|
772
|
+
}, _callee2);
|
|
755
773
|
}))();
|
|
756
774
|
},
|
|
757
775
|
/**
|
|
@@ -812,26 +830,26 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
812
830
|
*/
|
|
813
831
|
listParentActivityIds: function listParentActivityIds(conversationUrl, query) {
|
|
814
832
|
var _this13 = this;
|
|
815
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
833
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
816
834
|
var params, response;
|
|
817
|
-
return _regenerator.default.wrap(function
|
|
818
|
-
while (1) switch (
|
|
835
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
836
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
819
837
|
case 0:
|
|
820
838
|
params = {
|
|
821
839
|
method: 'GET',
|
|
822
840
|
url: "".concat(conversationUrl, "/parents"),
|
|
823
841
|
qs: query
|
|
824
842
|
};
|
|
825
|
-
|
|
843
|
+
_context3.next = 3;
|
|
826
844
|
return _this13.request(params);
|
|
827
845
|
case 3:
|
|
828
|
-
response =
|
|
829
|
-
return
|
|
846
|
+
response = _context3.sent;
|
|
847
|
+
return _context3.abrupt("return", response.body);
|
|
830
848
|
case 5:
|
|
831
849
|
case "end":
|
|
832
|
-
return
|
|
850
|
+
return _context3.stop();
|
|
833
851
|
}
|
|
834
|
-
},
|
|
852
|
+
}, _callee3);
|
|
835
853
|
}))();
|
|
836
854
|
},
|
|
837
855
|
/**
|
|
@@ -845,29 +863,29 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
845
863
|
listAllChildActivitiesByParentId: function listAllChildActivitiesByParentId() {
|
|
846
864
|
var _arguments2 = arguments,
|
|
847
865
|
_this14 = this;
|
|
848
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
866
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
849
867
|
var options, conversationUrl, activityParentId, query, activityType, initialResponse, page, items, _iterator3, _step3, activity;
|
|
850
|
-
return _regenerator.default.wrap(function
|
|
851
|
-
while (1) switch (
|
|
868
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
869
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
852
870
|
case 0:
|
|
853
871
|
options = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : {};
|
|
854
872
|
conversationUrl = options.conversationUrl, activityParentId = options.activityParentId, query = options.query;
|
|
855
873
|
activityType = query.activityType;
|
|
856
|
-
|
|
874
|
+
_context4.next = 5;
|
|
857
875
|
return _this14.listChildActivitiesByParentId(conversationUrl, activityParentId, activityType, query);
|
|
858
876
|
case 5:
|
|
859
|
-
initialResponse =
|
|
877
|
+
initialResponse = _context4.sent;
|
|
860
878
|
page = new _webexCore.Page(initialResponse, _this14.webex);
|
|
861
879
|
items = (0, _toConsumableArray2.default)(page.items);
|
|
862
880
|
case 8:
|
|
863
881
|
if (!page.hasNext()) {
|
|
864
|
-
|
|
882
|
+
_context4.next = 16;
|
|
865
883
|
break;
|
|
866
884
|
}
|
|
867
|
-
|
|
885
|
+
_context4.next = 11;
|
|
868
886
|
return page.next();
|
|
869
887
|
case 11:
|
|
870
|
-
page =
|
|
888
|
+
page = _context4.sent;
|
|
871
889
|
_iterator3 = _createForOfIteratorHelper(page);
|
|
872
890
|
try {
|
|
873
891
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -879,19 +897,19 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
879
897
|
} finally {
|
|
880
898
|
_iterator3.f();
|
|
881
899
|
}
|
|
882
|
-
|
|
900
|
+
_context4.next = 8;
|
|
883
901
|
break;
|
|
884
902
|
case 16:
|
|
885
903
|
// reverse list if needed (see _list for precedent)
|
|
886
904
|
if (items.length && (0, _lodash.last)(items).published < items[0].published) {
|
|
887
905
|
items.reverse();
|
|
888
906
|
}
|
|
889
|
-
return
|
|
907
|
+
return _context4.abrupt("return", items);
|
|
890
908
|
case 18:
|
|
891
909
|
case "end":
|
|
892
|
-
return
|
|
910
|
+
return _context4.stop();
|
|
893
911
|
}
|
|
894
|
-
},
|
|
912
|
+
}, _callee4);
|
|
895
913
|
}))();
|
|
896
914
|
},
|
|
897
915
|
/**
|
|
@@ -906,10 +924,10 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
906
924
|
listChildActivitiesByParentId: function listChildActivitiesByParentId(conversationUrl, activityParentId, activityType) {
|
|
907
925
|
var _arguments3 = arguments,
|
|
908
926
|
_this15 = this;
|
|
909
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
927
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
910
928
|
var query, finalQuery, params;
|
|
911
|
-
return _regenerator.default.wrap(function
|
|
912
|
-
while (1) switch (
|
|
929
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
930
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
913
931
|
case 0:
|
|
914
932
|
query = _arguments3.length > 3 && _arguments3[3] !== undefined ? _arguments3[3] : {};
|
|
915
933
|
finalQuery = _objectSpread(_objectSpread({}, query), {}, {
|
|
@@ -920,12 +938,12 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
920
938
|
url: "".concat(conversationUrl, "/parents/").concat(activityParentId),
|
|
921
939
|
qs: finalQuery
|
|
922
940
|
};
|
|
923
|
-
return
|
|
941
|
+
return _context5.abrupt("return", _this15.request(params));
|
|
924
942
|
case 4:
|
|
925
943
|
case "end":
|
|
926
|
-
return
|
|
944
|
+
return _context5.stop();
|
|
927
945
|
}
|
|
928
|
-
},
|
|
946
|
+
}, _callee5);
|
|
929
947
|
}))();
|
|
930
948
|
},
|
|
931
949
|
/**
|
|
@@ -937,29 +955,29 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
937
955
|
*/
|
|
938
956
|
getReactionSummaryByParentId: function getReactionSummaryByParentId(conversationUrl, activityParentId, query) {
|
|
939
957
|
var _this16 = this;
|
|
940
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
958
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
941
959
|
var _yield$_this16$reques, body, reactionObjects;
|
|
942
|
-
return _regenerator.default.wrap(function
|
|
943
|
-
while (1) switch (
|
|
960
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
961
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
944
962
|
case 0:
|
|
945
|
-
|
|
963
|
+
_context6.next = 2;
|
|
946
964
|
return _this16.request({
|
|
947
965
|
method: 'GET',
|
|
948
966
|
url: "".concat(conversationUrl, "/activities/").concat(activityParentId),
|
|
949
967
|
qs: query
|
|
950
968
|
});
|
|
951
969
|
case 2:
|
|
952
|
-
_yield$_this16$reques =
|
|
970
|
+
_yield$_this16$reques = _context6.sent;
|
|
953
971
|
body = _yield$_this16$reques.body;
|
|
954
972
|
reactionObjects = body.children ? body.children.filter(function (child) {
|
|
955
973
|
return child.type === 'reactionSelfSummary' || child.type === 'reactionSummary';
|
|
956
974
|
}) : [];
|
|
957
|
-
return
|
|
975
|
+
return _context6.abrupt("return", reactionObjects);
|
|
958
976
|
case 6:
|
|
959
977
|
case "end":
|
|
960
|
-
return
|
|
978
|
+
return _context6.stop();
|
|
961
979
|
}
|
|
962
|
-
},
|
|
980
|
+
}, _callee6);
|
|
963
981
|
}))();
|
|
964
982
|
},
|
|
965
983
|
/**
|
|
@@ -1134,20 +1152,20 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
1134
1152
|
*/
|
|
1135
1153
|
listThreads: function listThreads(options) {
|
|
1136
1154
|
var _this20 = this;
|
|
1137
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1138
|
-
return _regenerator.default.wrap(function
|
|
1139
|
-
while (1) switch (
|
|
1155
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
1156
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
1157
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1140
1158
|
case 0:
|
|
1141
|
-
return
|
|
1159
|
+
return _context7.abrupt("return", _this20._list({
|
|
1142
1160
|
service: 'conversation',
|
|
1143
1161
|
resource: 'threads',
|
|
1144
1162
|
qs: (0, _lodash.omit)(options, 'showAllTypes')
|
|
1145
1163
|
}));
|
|
1146
1164
|
case 1:
|
|
1147
1165
|
case "end":
|
|
1148
|
-
return
|
|
1166
|
+
return _context7.stop();
|
|
1149
1167
|
}
|
|
1150
|
-
},
|
|
1168
|
+
}, _callee7);
|
|
1151
1169
|
}))();
|
|
1152
1170
|
},
|
|
1153
1171
|
/**
|
|
@@ -1714,20 +1732,20 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
1714
1732
|
* @returns {IGeneratorResponse}
|
|
1715
1733
|
*/
|
|
1716
1734
|
var jumpToActivity = /*#__PURE__*/function () {
|
|
1717
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1735
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(searchObject) {
|
|
1718
1736
|
var newUrl, searchOptions, _yield$threadOrderer$, searchResults;
|
|
1719
|
-
return _regenerator.default.wrap(function
|
|
1720
|
-
while (1) switch (
|
|
1737
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
1738
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
1721
1739
|
case 0:
|
|
1722
1740
|
if (searchObject) {
|
|
1723
|
-
|
|
1741
|
+
_context8.next = 2;
|
|
1724
1742
|
break;
|
|
1725
1743
|
}
|
|
1726
1744
|
throw new Error('Search must be an activity object from conversation service');
|
|
1727
1745
|
case 2:
|
|
1728
1746
|
newUrl = searchObject.target && searchObject.target.url;
|
|
1729
1747
|
if (newUrl) {
|
|
1730
|
-
|
|
1748
|
+
_context8.next = 5;
|
|
1731
1749
|
break;
|
|
1732
1750
|
}
|
|
1733
1751
|
throw new Error('Search object must have a target url!');
|
|
@@ -1738,20 +1756,20 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
1738
1756
|
search: searchObject
|
|
1739
1757
|
});
|
|
1740
1758
|
threadOrderer = _this30._listActivitiesThreadOrdered(searchOptions);
|
|
1741
|
-
|
|
1759
|
+
_context8.next = 9;
|
|
1742
1760
|
return threadOrderer.next(searchOptions);
|
|
1743
1761
|
case 9:
|
|
1744
|
-
_yield$threadOrderer$ =
|
|
1762
|
+
_yield$threadOrderer$ = _context8.sent;
|
|
1745
1763
|
searchResults = _yield$threadOrderer$.value;
|
|
1746
|
-
return
|
|
1764
|
+
return _context8.abrupt("return", {
|
|
1747
1765
|
done: true,
|
|
1748
1766
|
value: searchResults
|
|
1749
1767
|
});
|
|
1750
1768
|
case 12:
|
|
1751
1769
|
case "end":
|
|
1752
|
-
return
|
|
1770
|
+
return _context8.stop();
|
|
1753
1771
|
}
|
|
1754
|
-
},
|
|
1772
|
+
}, _callee8);
|
|
1755
1773
|
}));
|
|
1756
1774
|
return function jumpToActivity(_x) {
|
|
1757
1775
|
return _ref4.apply(this, arguments);
|
|
@@ -1763,28 +1781,28 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
1763
1781
|
* @returns {IGeneratorResponse}
|
|
1764
1782
|
*/
|
|
1765
1783
|
var getOlder = /*#__PURE__*/function () {
|
|
1766
|
-
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1784
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
1767
1785
|
var _yield$threadOrderer$2, _yield$threadOrderer$3, value, oldestInBatch, moreActivitiesExist;
|
|
1768
|
-
return _regenerator.default.wrap(function
|
|
1769
|
-
while (1) switch (
|
|
1786
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1787
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1770
1788
|
case 0:
|
|
1771
|
-
|
|
1789
|
+
_context9.next = 2;
|
|
1772
1790
|
return threadOrderer.next(olderOptions);
|
|
1773
1791
|
case 2:
|
|
1774
|
-
_yield$threadOrderer$2 =
|
|
1792
|
+
_yield$threadOrderer$2 = _context9.sent;
|
|
1775
1793
|
_yield$threadOrderer$3 = _yield$threadOrderer$2.value;
|
|
1776
1794
|
value = _yield$threadOrderer$3 === void 0 ? [] : _yield$threadOrderer$3;
|
|
1777
1795
|
oldestInBatch = value[0] && value[0].activity;
|
|
1778
1796
|
moreActivitiesExist = oldestInBatch && (0, _activities.getActivityType)(oldestInBatch) !== _activities.ACTIVITY_TYPES.CREATE;
|
|
1779
|
-
return
|
|
1797
|
+
return _context9.abrupt("return", {
|
|
1780
1798
|
done: !moreActivitiesExist,
|
|
1781
1799
|
value: value
|
|
1782
1800
|
});
|
|
1783
1801
|
case 8:
|
|
1784
1802
|
case "end":
|
|
1785
|
-
return
|
|
1803
|
+
return _context9.stop();
|
|
1786
1804
|
}
|
|
1787
|
-
},
|
|
1805
|
+
}, _callee9);
|
|
1788
1806
|
}));
|
|
1789
1807
|
return function getOlder() {
|
|
1790
1808
|
return _ref5.apply(this, arguments);
|
|
@@ -1796,28 +1814,28 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
1796
1814
|
* @returns {IGeneratorResponse}
|
|
1797
1815
|
*/
|
|
1798
1816
|
var getNewer = /*#__PURE__*/function () {
|
|
1799
|
-
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1817
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
1800
1818
|
var newerOptions, _yield$threadOrderer$4, value;
|
|
1801
|
-
return _regenerator.default.wrap(function
|
|
1802
|
-
while (1) switch (
|
|
1819
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
1820
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1803
1821
|
case 0:
|
|
1804
1822
|
newerOptions = _objectSpread(_objectSpread({}, baseOptions), {}, {
|
|
1805
1823
|
queryType: _activities.NEWER
|
|
1806
1824
|
});
|
|
1807
|
-
|
|
1825
|
+
_context10.next = 3;
|
|
1808
1826
|
return threadOrderer.next(newerOptions);
|
|
1809
1827
|
case 3:
|
|
1810
|
-
_yield$threadOrderer$4 =
|
|
1828
|
+
_yield$threadOrderer$4 = _context10.sent;
|
|
1811
1829
|
value = _yield$threadOrderer$4.value;
|
|
1812
|
-
return
|
|
1830
|
+
return _context10.abrupt("return", {
|
|
1813
1831
|
done: !value.length,
|
|
1814
1832
|
value: value
|
|
1815
1833
|
});
|
|
1816
1834
|
case 6:
|
|
1817
1835
|
case "end":
|
|
1818
|
-
return
|
|
1836
|
+
return _context10.stop();
|
|
1819
1837
|
}
|
|
1820
|
-
},
|
|
1838
|
+
}, _callee10);
|
|
1821
1839
|
}));
|
|
1822
1840
|
return function getNewer() {
|
|
1823
1841
|
return _ref6.apply(this, arguments);
|
|
@@ -1860,10 +1878,10 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
1860
1878
|
_listActivitiesThreadOrdered: function _listActivitiesThreadOrdered() {
|
|
1861
1879
|
var _this = this;
|
|
1862
1880
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1863
|
-
return (0, _wrapAsyncGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1881
|
+
return (0, _wrapAsyncGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
1864
1882
|
var _options$minActivitie, minActivities, _options$queryType, queryType, convoUrl, _options$search, search, includeChildren, _bookendManager, setBookends, getNewestAct, getOldestAct, defaultBatchSize, batchSize, _activityManager, getActivityHandlerByKey, getActivityByTypeAndParentId, query, _loop, _ret;
|
|
1865
|
-
return _regenerator.default.wrap(function
|
|
1866
|
-
while (1) switch (
|
|
1883
|
+
return _regenerator.default.wrap(function _callee11$(_context13) {
|
|
1884
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1867
1885
|
case 0:
|
|
1868
1886
|
// ***********************************************
|
|
1869
1887
|
// INSTANCE STATE VARIABLES
|
|
@@ -1887,8 +1905,8 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
1887
1905
|
/* eslint-disable no-loop-func */
|
|
1888
1906
|
_loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
|
|
1889
1907
|
var _rootActivityManager, getRootActivityHash, addNewRoot, _noMoreActivitiesMana, getNoMoreActs, checkAndSetNoMoreActs, checkAndSetNoOlderActs, checkAndSetNoNewerActs, getActivityHandlerByType, handleNewActivity, handleNewActivities, handleOlderQuery, handleNewerQuery, handleSearch, getQueryResponseHandler, incrementLoopCounter, _loop2, orderedActivities, getRepliesByParentId, orderedRoots, nextOptions, currentOldestPublishedDate, currentNewestPublishedDate;
|
|
1890
|
-
return _regenerator.default.wrap(function _loop$(
|
|
1891
|
-
while (1) switch (
|
|
1908
|
+
return _regenerator.default.wrap(function _loop$(_context12) {
|
|
1909
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1892
1910
|
case 0:
|
|
1893
1911
|
// ***********************************************
|
|
1894
1912
|
// EXECUTION STATE VARIABLES
|
|
@@ -1942,8 +1960,8 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
1942
1960
|
incrementLoopCounter = (0, _activityThreadOrdering.getLoopCounterFailsafe)();
|
|
1943
1961
|
_loop2 = /*#__PURE__*/_regenerator.default.mark(function _loop2() {
|
|
1944
1962
|
var allBatchActivitiesConfig, $allBatchActivitiesFetch, $fetchRequests, params, $parentsFetch, _yield$_awaitAsyncGen, _yield$_awaitAsyncGen2, allBatchActivities, _yield$_awaitAsyncGen3, parents, handler, _parents$reply, replyIds, _parents$edit, editIds, _parents$reaction, reactionIds, $reactionFetches, $replyFetches, $editFetches, _iterator4, _step4, activity, actId, childFetchOptions, _yield$_awaitAsyncGen4, _yield$_awaitAsyncGen5, reactions, replies, edits, newReplyReactions, allReactions, rootActivityHash, visibleActivitiesCount, _iterator5, _step5, rootActivity, rootId, repliesByRootId, currentOldestPublishedDate, currentNewestPublishedDate;
|
|
1945
|
-
return _regenerator.default.wrap(function _loop2$(
|
|
1946
|
-
while (1) switch (
|
|
1963
|
+
return _regenerator.default.wrap(function _loop2$(_context11) {
|
|
1964
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1947
1965
|
case 0:
|
|
1948
1966
|
// count loops and throw if we detect infinite loop
|
|
1949
1967
|
incrementLoopCounter();
|
|
@@ -1968,10 +1986,10 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
1968
1986
|
}
|
|
1969
1987
|
|
|
1970
1988
|
// we dont always need to fetch for parents
|
|
1971
|
-
|
|
1989
|
+
_context11.next = 7;
|
|
1972
1990
|
return (0, _awaitAsyncGenerator2.default)(_promise.default.all($fetchRequests));
|
|
1973
1991
|
case 7:
|
|
1974
|
-
_yield$_awaitAsyncGen =
|
|
1992
|
+
_yield$_awaitAsyncGen = _context11.sent;
|
|
1975
1993
|
_yield$_awaitAsyncGen2 = (0, _slicedToArray2.default)(_yield$_awaitAsyncGen, 2);
|
|
1976
1994
|
allBatchActivities = _yield$_awaitAsyncGen2[0];
|
|
1977
1995
|
_yield$_awaitAsyncGen3 = _yield$_awaitAsyncGen2[1];
|
|
@@ -1987,7 +2005,7 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
1987
2005
|
*/
|
|
1988
2006
|
_parents$reply = parents.reply, replyIds = _parents$reply === void 0 ? [] : _parents$reply, _parents$edit = parents.edit, editIds = _parents$edit === void 0 ? [] : _parents$edit, _parents$reaction = parents.reaction, reactionIds = _parents$reaction === void 0 ? [] : _parents$reaction; // if no parent IDs returned, do nothing
|
|
1989
2007
|
if (!(replyIds.length || editIds.length || reactionIds.length)) {
|
|
1990
|
-
|
|
2008
|
+
_context11.next = 35;
|
|
1991
2009
|
break;
|
|
1992
2010
|
}
|
|
1993
2011
|
$reactionFetches = [];
|
|
@@ -2028,15 +2046,15 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2028
2046
|
} finally {
|
|
2029
2047
|
_iterator4.f();
|
|
2030
2048
|
}
|
|
2031
|
-
|
|
2049
|
+
_context11.next = 23;
|
|
2032
2050
|
return (0, _awaitAsyncGenerator2.default)(_promise.default.all([_promise.default.all($reactionFetches), _promise.default.all($replyFetches), _promise.default.all($editFetches)]));
|
|
2033
2051
|
case 23:
|
|
2034
|
-
_yield$_awaitAsyncGen4 =
|
|
2052
|
+
_yield$_awaitAsyncGen4 = _context11.sent;
|
|
2035
2053
|
_yield$_awaitAsyncGen5 = (0, _slicedToArray2.default)(_yield$_awaitAsyncGen4, 3);
|
|
2036
2054
|
reactions = _yield$_awaitAsyncGen5[0];
|
|
2037
2055
|
replies = _yield$_awaitAsyncGen5[1];
|
|
2038
2056
|
edits = _yield$_awaitAsyncGen5[2];
|
|
2039
|
-
|
|
2057
|
+
_context11.next = 30;
|
|
2040
2058
|
return (0, _awaitAsyncGenerator2.default)(_promise.default.all(replies.filter(function (reply) {
|
|
2041
2059
|
return replyIds.includes(reply.id);
|
|
2042
2060
|
}).map(function (reply) {
|
|
@@ -2046,7 +2064,7 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2046
2064
|
});
|
|
2047
2065
|
})));
|
|
2048
2066
|
case 30:
|
|
2049
|
-
newReplyReactions =
|
|
2067
|
+
newReplyReactions = _context11.sent;
|
|
2050
2068
|
allReactions = [].concat((0, _toConsumableArray2.default)(reactions), (0, _toConsumableArray2.default)(newReplyReactions)); // stick them into activity hashes
|
|
2051
2069
|
replies.forEach(function (replyArr) {
|
|
2052
2070
|
return handleNewActivities(replyArr);
|
|
@@ -2078,10 +2096,10 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2078
2096
|
_iterator5.f();
|
|
2079
2097
|
}
|
|
2080
2098
|
if (!(visibleActivitiesCount >= minActivities)) {
|
|
2081
|
-
|
|
2099
|
+
_context11.next = 41;
|
|
2082
2100
|
break;
|
|
2083
2101
|
}
|
|
2084
|
-
return
|
|
2102
|
+
return _context11.abrupt("return", 1);
|
|
2085
2103
|
case 41:
|
|
2086
2104
|
checkAndSetNoMoreActs(queryType, visibleActivitiesCount, batchSize);
|
|
2087
2105
|
|
|
@@ -2118,24 +2136,24 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2118
2136
|
}
|
|
2119
2137
|
case 48:
|
|
2120
2138
|
case "end":
|
|
2121
|
-
return
|
|
2139
|
+
return _context11.stop();
|
|
2122
2140
|
}
|
|
2123
2141
|
}, _loop2);
|
|
2124
2142
|
});
|
|
2125
2143
|
case 11:
|
|
2126
2144
|
if (getNoMoreActs()) {
|
|
2127
|
-
|
|
2145
|
+
_context12.next = 17;
|
|
2128
2146
|
break;
|
|
2129
2147
|
}
|
|
2130
|
-
return
|
|
2148
|
+
return _context12.delegateYield(_loop2(), "t0", 13);
|
|
2131
2149
|
case 13:
|
|
2132
|
-
if (!
|
|
2133
|
-
|
|
2150
|
+
if (!_context12.t0) {
|
|
2151
|
+
_context12.next = 15;
|
|
2134
2152
|
break;
|
|
2135
2153
|
}
|
|
2136
|
-
return
|
|
2154
|
+
return _context12.abrupt("break", 17);
|
|
2137
2155
|
case 15:
|
|
2138
|
-
|
|
2156
|
+
_context12.next = 11;
|
|
2139
2157
|
break;
|
|
2140
2158
|
case 17:
|
|
2141
2159
|
orderedActivities = [];
|
|
@@ -2191,12 +2209,12 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2191
2209
|
return orderedActivities.push(reply);
|
|
2192
2210
|
});
|
|
2193
2211
|
});
|
|
2194
|
-
|
|
2212
|
+
_context12.next = 23;
|
|
2195
2213
|
return orderedActivities;
|
|
2196
2214
|
case 23:
|
|
2197
|
-
nextOptions =
|
|
2215
|
+
nextOptions = _context12.sent;
|
|
2198
2216
|
if (!nextOptions) {
|
|
2199
|
-
|
|
2217
|
+
_context12.next = 32;
|
|
2200
2218
|
break;
|
|
2201
2219
|
}
|
|
2202
2220
|
minActivities = nextOptions.minActivities || minActivities;
|
|
@@ -2209,39 +2227,39 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2209
2227
|
newestPublishedDate: currentNewestPublishedDate,
|
|
2210
2228
|
batchSize: batchSize
|
|
2211
2229
|
});
|
|
2212
|
-
|
|
2230
|
+
_context12.next = 33;
|
|
2213
2231
|
break;
|
|
2214
2232
|
case 32:
|
|
2215
|
-
return
|
|
2233
|
+
return _context12.abrupt("return", {
|
|
2216
2234
|
v: void 0
|
|
2217
2235
|
});
|
|
2218
2236
|
case 33:
|
|
2219
2237
|
case "end":
|
|
2220
|
-
return
|
|
2238
|
+
return _context12.stop();
|
|
2221
2239
|
}
|
|
2222
2240
|
}, _loop);
|
|
2223
2241
|
});
|
|
2224
2242
|
case 9:
|
|
2225
2243
|
if (!true) {
|
|
2226
|
-
|
|
2244
|
+
_context13.next = 16;
|
|
2227
2245
|
break;
|
|
2228
2246
|
}
|
|
2229
|
-
return
|
|
2247
|
+
return _context13.delegateYield(_loop(), "t0", 11);
|
|
2230
2248
|
case 11:
|
|
2231
|
-
_ret =
|
|
2249
|
+
_ret = _context13.t0;
|
|
2232
2250
|
if (!_ret) {
|
|
2233
|
-
|
|
2251
|
+
_context13.next = 14;
|
|
2234
2252
|
break;
|
|
2235
2253
|
}
|
|
2236
|
-
return
|
|
2254
|
+
return _context13.abrupt("return", _ret.v);
|
|
2237
2255
|
case 14:
|
|
2238
|
-
|
|
2256
|
+
_context13.next = 9;
|
|
2239
2257
|
break;
|
|
2240
2258
|
case 16:
|
|
2241
2259
|
case "end":
|
|
2242
|
-
return
|
|
2260
|
+
return _context13.stop();
|
|
2243
2261
|
}
|
|
2244
|
-
},
|
|
2262
|
+
}, _callee11);
|
|
2245
2263
|
}))();
|
|
2246
2264
|
},
|
|
2247
2265
|
/**
|
|
@@ -2307,10 +2325,10 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2307
2325
|
*/
|
|
2308
2326
|
_list: function _list(options) {
|
|
2309
2327
|
var _this31 = this;
|
|
2310
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2328
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
2311
2329
|
var res, list, limit, results, _iterator6, _step6, result, items;
|
|
2312
|
-
return _regenerator.default.wrap(function
|
|
2313
|
-
while (1) switch (
|
|
2330
|
+
return _regenerator.default.wrap(function _callee12$(_context14) {
|
|
2331
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
2314
2332
|
case 0:
|
|
2315
2333
|
options.qs = _objectSpread({
|
|
2316
2334
|
personRefresh: true,
|
|
@@ -2318,10 +2336,10 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2318
2336
|
activitiesLimit: 0,
|
|
2319
2337
|
participantsLimit: 0
|
|
2320
2338
|
}, options.qs);
|
|
2321
|
-
|
|
2339
|
+
_context14.next = 3;
|
|
2322
2340
|
return _this31.request(options);
|
|
2323
2341
|
case 3:
|
|
2324
|
-
res =
|
|
2342
|
+
res = _context14.sent;
|
|
2325
2343
|
if (!res.body || !res.body.items || res.body.items.length === 0) {
|
|
2326
2344
|
list = [];
|
|
2327
2345
|
} else {
|
|
@@ -2334,7 +2352,7 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2334
2352
|
// The user has more data in another cluster.
|
|
2335
2353
|
// Follow the 'additionalUrls' for that data.
|
|
2336
2354
|
if (!res.body.additionalUrls) {
|
|
2337
|
-
|
|
2355
|
+
_context14.next = 14;
|
|
2338
2356
|
break;
|
|
2339
2357
|
}
|
|
2340
2358
|
limit = 0; // If the user asked for a specific amount of data,
|
|
@@ -2350,10 +2368,10 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2350
2368
|
// If the limit is 0 for some reason,
|
|
2351
2369
|
// don't bother requesting from other clusters
|
|
2352
2370
|
if (!(!options.limit || limit !== 0)) {
|
|
2353
|
-
|
|
2371
|
+
_context14.next = 14;
|
|
2354
2372
|
break;
|
|
2355
2373
|
}
|
|
2356
|
-
|
|
2374
|
+
_context14.next = 11;
|
|
2357
2375
|
return _promise.default.all(res.body.additionalUrls.map(function (host) {
|
|
2358
2376
|
var url = "".concat(host, "/").concat(options.resource);
|
|
2359
2377
|
var newOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
@@ -2366,7 +2384,7 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2366
2384
|
return _this31.request(newOptions);
|
|
2367
2385
|
}));
|
|
2368
2386
|
case 11:
|
|
2369
|
-
results =
|
|
2387
|
+
results = _context14.sent;
|
|
2370
2388
|
_iterator6 = _createForOfIteratorHelper(results);
|
|
2371
2389
|
try {
|
|
2372
2390
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -2385,17 +2403,17 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2385
2403
|
_iterator6.f();
|
|
2386
2404
|
}
|
|
2387
2405
|
case 14:
|
|
2388
|
-
|
|
2406
|
+
_context14.next = 16;
|
|
2389
2407
|
return _promise.default.all(list.map(function (item) {
|
|
2390
2408
|
return _this31._recordUUIDs(item);
|
|
2391
2409
|
}));
|
|
2392
2410
|
case 16:
|
|
2393
|
-
return
|
|
2411
|
+
return _context14.abrupt("return", list);
|
|
2394
2412
|
case 17:
|
|
2395
2413
|
case "end":
|
|
2396
|
-
return
|
|
2414
|
+
return _context14.stop();
|
|
2397
2415
|
}
|
|
2398
|
-
},
|
|
2416
|
+
}, _callee12);
|
|
2399
2417
|
}))();
|
|
2400
2418
|
},
|
|
2401
2419
|
/**
|
|
@@ -2504,7 +2522,7 @@ var Conversation = _webexCore.WebexPlugin.extend({
|
|
|
2504
2522
|
});
|
|
2505
2523
|
}));
|
|
2506
2524
|
},
|
|
2507
|
-
version: "3.7.0-next.
|
|
2525
|
+
version: "3.7.0-next.3"
|
|
2508
2526
|
});
|
|
2509
2527
|
['favorite', 'hide', 'lock', 'mute', 'unfavorite', 'unhide', 'unlock', 'unmute'].forEach(function (verb) {
|
|
2510
2528
|
Conversation.prototype[verb] = function submitSimpleActivity(conversation, activity) {
|