@webex/internal-plugin-conversation 2.59.8 → 2.60.0-next.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 +26 -48
- package/dist/activities.js.map +1 -1
- package/dist/activity-thread-ordering.js +19 -34
- package/dist/activity-thread-ordering.js.map +1 -1
- package/dist/config.js +1 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +3 -6
- package/dist/constants.js.map +1 -1
- package/dist/conversation.js +87 -80
- 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 +9 -8
- package/dist/decryption-transforms.js.map +1 -1
- package/dist/encryption-transforms.js +27 -23
- package/dist/encryption-transforms.js.map +1 -1
- package/dist/index.js +11 -13
- package/dist/index.js.map +1 -1
- package/dist/share-activity.js +20 -25
- package/dist/share-activity.js.map +1 -1
- package/dist/to-array.js +7 -5
- package/dist/to-array.js.map +1 -1
- package/package.json +22 -21
- package/src/conversation.js +19 -6
- package/src/encryption-transforms.js +8 -0
- package/test/integration/spec/create.js +2 -3
- package/test/integration/spec/encryption.js +0 -1
- package/test/integration/spec/get.js +4 -2
- package/test/unit/spec/conversation.js +82 -0
- package/test/unit/spec/encryption-transforms.js +23 -0
|
@@ -154,6 +154,7 @@ 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')
|
|
157
158
|
})
|
|
158
159
|
.then((f) =>
|
|
159
160
|
fh.isMatchingFile(f, sampleImageSmallOnePng).then((result) => assert.isTrue(result))
|
|
@@ -467,7 +468,8 @@ describe('plugin-conversation', function () {
|
|
|
467
468
|
}));
|
|
468
469
|
});
|
|
469
470
|
|
|
470
|
-
|
|
471
|
+
// SPARK-413317
|
|
472
|
+
describe.skip('with conversation from remote clusters', () => {
|
|
471
473
|
let conversation3, conversation4;
|
|
472
474
|
|
|
473
475
|
before('create conversations in EU cluster', () =>
|
|
@@ -959,7 +961,7 @@ describe('plugin-conversation', function () {
|
|
|
959
961
|
.then(({edit}) => {
|
|
960
962
|
assert.include(edit, parent.id);
|
|
961
963
|
}));
|
|
962
|
-
|
|
964
|
+
|
|
963
965
|
it('retrieves parent IDs for reactions', () =>
|
|
964
966
|
webex.internal.conversation
|
|
965
967
|
.addReaction(conversation, 'heart', parent)
|
|
@@ -34,6 +34,88 @@ 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
|
+
|
|
37
119
|
describe('processInmeetingchatEvent()', () => {
|
|
38
120
|
beforeEach(() => {
|
|
39
121
|
webex.transform = sinon.stub().callsFake((obj) => Promise.resolve(obj));
|
|
@@ -36,6 +36,29 @@ 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
|
+
|
|
39
62
|
it('does transfom when created is not True', async () => {
|
|
40
63
|
const transform = transforms.find((t) => t.name === 'encryptActivity');
|
|
41
64
|
const transformStub = sinon.stub().resolves();
|