@webex/internal-plugin-conversation 2.60.1-next.9 → 2.60.2
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/activities.js +48 -26
- package/dist/activities.js.map +1 -1
- package/dist/activity-thread-ordering.js +34 -19
- package/dist/activity-thread-ordering.js.map +1 -1
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js +6 -3
- package/dist/constants.js.map +1 -1
- package/dist/conversation.js +80 -87
- package/dist/conversation.js.map +1 -1
- package/dist/convo-error.js +5 -5
- package/dist/convo-error.js.map +1 -1
- package/dist/decryption-transforms.js +8 -9
- package/dist/decryption-transforms.js.map +1 -1
- package/dist/encryption-transforms.js +23 -27
- package/dist/encryption-transforms.js.map +1 -1
- package/dist/index.js +13 -11
- package/dist/index.js.map +1 -1
- package/dist/share-activity.js +25 -20
- package/dist/share-activity.js.map +1 -1
- package/dist/to-array.js +5 -7
- package/dist/to-array.js.map +1 -1
- package/package.json +21 -22
- package/src/conversation.js +6 -19
- package/src/encryption-transforms.js +0 -8
- package/test/integration/spec/create.js +3 -2
- package/test/integration/spec/encryption.js +1 -0
- package/test/integration/spec/get.js +2 -4
- package/test/unit/spec/conversation.js +0 -82
- package/test/unit/spec/encryption-transforms.js +0 -23
|
@@ -154,7 +154,6 @@ describe('plugin-conversation', function () {
|
|
|
154
154
|
scr: {
|
|
155
155
|
loc: makeLocalUrl('/sample-image-small-one.png'),
|
|
156
156
|
},
|
|
157
|
-
url: makeLocalUrl('/sample-image-small-one.png')
|
|
158
157
|
})
|
|
159
158
|
.then((f) =>
|
|
160
159
|
fh.isMatchingFile(f, sampleImageSmallOnePng).then((result) => assert.isTrue(result))
|
|
@@ -468,8 +467,7 @@ describe('plugin-conversation', function () {
|
|
|
468
467
|
}));
|
|
469
468
|
});
|
|
470
469
|
|
|
471
|
-
|
|
472
|
-
describe.skip('with conversation from remote clusters', () => {
|
|
470
|
+
describe('with conversation from remote clusters', () => {
|
|
473
471
|
let conversation3, conversation4;
|
|
474
472
|
|
|
475
473
|
before('create conversations in EU cluster', () =>
|
|
@@ -961,7 +959,7 @@ describe('plugin-conversation', function () {
|
|
|
961
959
|
.then(({edit}) => {
|
|
962
960
|
assert.include(edit, parent.id);
|
|
963
961
|
}));
|
|
964
|
-
|
|
962
|
+
|
|
965
963
|
it('retrieves parent IDs for reactions', () =>
|
|
966
964
|
webex.internal.conversation
|
|
967
965
|
.addReaction(conversation, 'heart', parent)
|
|
@@ -34,88 +34,6 @@ describe('plugin-conversation', () => {
|
|
|
34
34
|
webex.internal.services.getServiceUrlFromClusterId = sinon.stub().returns(convoUrl);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
describe('addReaction()', () => {
|
|
38
|
-
it('should add recipients to the payload if provided', () => {
|
|
39
|
-
const {conversation} = webex.internal;
|
|
40
|
-
const recipientId = 'example-recipient-id';
|
|
41
|
-
const expected = {items: [{id: recipientId, objectType: 'person'}]}
|
|
42
|
-
conversation.sendReaction = sinon.stub().returns(Promise.resolve())
|
|
43
|
-
conversation.createReactionHmac = sinon.stub().returns(Promise.resolve('hmac'))
|
|
44
|
-
|
|
45
|
-
return conversation.addReaction({}, 'example-display-name', {}, recipientId)
|
|
46
|
-
.then(() => {
|
|
47
|
-
assert.deepEqual(conversation.sendReaction.args[0][1].recipients, expected);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
describe('deleteReaction()', () => {
|
|
53
|
-
it('should add recipients to the payload if provided', () => {
|
|
54
|
-
const {conversation} = webex.internal;
|
|
55
|
-
const recipientId = 'example-recipient-id';
|
|
56
|
-
const expected = {items: [{id: recipientId, objectType: 'person'}]}
|
|
57
|
-
conversation.sendReaction = sinon.stub().returns(Promise.resolve())
|
|
58
|
-
|
|
59
|
-
return conversation.deleteReaction({}, 'example-reaction-id', recipientId)
|
|
60
|
-
.then(() => {
|
|
61
|
-
assert.deepEqual(conversation.sendReaction.args[0][1].recipients, expected);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
describe('prepare()', () => {
|
|
67
|
-
it('should ammend activity recipients to the returned object', () => {
|
|
68
|
-
const {conversation} = webex.internal;
|
|
69
|
-
const activity = { recipients: 'example-recipients' };
|
|
70
|
-
|
|
71
|
-
return conversation.prepare(activity)
|
|
72
|
-
.then((results) => {
|
|
73
|
-
assert.deepEqual(results.recipients, activity.recipients);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
describe('addReaction()', () => {
|
|
79
|
-
it('should add recipients to the payload if provided', () => {
|
|
80
|
-
const {conversation} = webex.internal;
|
|
81
|
-
const recipientId = 'example-recipient-id';
|
|
82
|
-
const expected = {items: [{id: recipientId, objectType: 'person'}]}
|
|
83
|
-
conversation.sendReaction = sinon.stub().returns(Promise.resolve())
|
|
84
|
-
conversation.createReactionHmac = sinon.stub().returns(Promise.resolve('hmac'))
|
|
85
|
-
|
|
86
|
-
return conversation.addReaction({}, 'example-display-name', {}, recipientId)
|
|
87
|
-
.then(() => {
|
|
88
|
-
assert.deepEqual(conversation.sendReaction.args[0][1].recipients, expected);
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
describe('deleteReaction()', () => {
|
|
94
|
-
it('should add recipients to the payload if provided', () => {
|
|
95
|
-
const {conversation} = webex.internal;
|
|
96
|
-
const recipientId = 'example-recipient-id';
|
|
97
|
-
const expected = {items: [{id: recipientId, objectType: 'person'}]}
|
|
98
|
-
conversation.sendReaction = sinon.stub().returns(Promise.resolve())
|
|
99
|
-
|
|
100
|
-
return conversation.deleteReaction({}, 'example-reaction-id', recipientId)
|
|
101
|
-
.then(() => {
|
|
102
|
-
assert.deepEqual(conversation.sendReaction.args[0][1].recipients, expected);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
describe('prepare()', () => {
|
|
108
|
-
it('should ammend activity recipients to the returned object', () => {
|
|
109
|
-
const {conversation} = webex.internal;
|
|
110
|
-
const activity = { recipients: 'example-recipients' };
|
|
111
|
-
|
|
112
|
-
return conversation.prepare(activity)
|
|
113
|
-
.then((results) => {
|
|
114
|
-
assert.deepEqual(results.recipients, activity.recipients);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
|
|
119
37
|
describe('processInmeetingchatEvent()', () => {
|
|
120
38
|
beforeEach(() => {
|
|
121
39
|
webex.transform = sinon.stub().callsFake((obj) => Promise.resolve(obj));
|
|
@@ -36,29 +36,6 @@ describe('plugin-conversation', () => {
|
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
it('does not transform when object type is "policies" for a "meetingContainer" activity', async () => {
|
|
40
|
-
const transform = transforms.find((t) => t.name === 'encryptActivity');
|
|
41
|
-
const transformStub = sinon.stub().resolves();
|
|
42
|
-
|
|
43
|
-
const ctx = {
|
|
44
|
-
transform: transformStub,
|
|
45
|
-
};
|
|
46
|
-
const key = null;
|
|
47
|
-
const activity = {
|
|
48
|
-
object: {
|
|
49
|
-
objectType: 'policies',
|
|
50
|
-
},
|
|
51
|
-
objectType: 'activity',
|
|
52
|
-
target: {
|
|
53
|
-
objectType: 'meetingContainer',
|
|
54
|
-
},
|
|
55
|
-
verb: 'update',
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const results = await transform.fn(ctx, key, activity);
|
|
59
|
-
assert.equal(results, undefined);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
39
|
it('does transfom when created is not True', async () => {
|
|
63
40
|
const transform = transforms.find((t) => t.name === 'encryptActivity');
|
|
64
41
|
const transformStub = sinon.stub().resolves();
|