@webex/internal-plugin-conversation 3.0.0-beta.9 → 3.0.0-beta.91
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/README.md +1 -3
- package/dist/activities.js +8 -69
- package/dist/activities.js.map +1 -1
- package/dist/activity-thread-ordering.js +19 -79
- package/dist/activity-thread-ordering.js.map +1 -1
- package/dist/config.js +1 -7
- package/dist/config.js.map +1 -1
- package/dist/constants.js +4 -5
- package/dist/constants.js.map +1 -1
- package/dist/conversation.js +790 -1199
- package/dist/conversation.js.map +1 -1
- package/dist/convo-error.js +0 -23
- package/dist/convo-error.js.map +1 -1
- package/dist/decryption-transforms.js +35 -98
- package/dist/decryption-transforms.js.map +1 -1
- package/dist/encryption-transforms.js +11 -48
- package/dist/encryption-transforms.js.map +1 -1
- package/dist/index.js +7 -50
- package/dist/index.js.map +1 -1
- package/dist/share-activity.js +40 -106
- package/dist/share-activity.js.map +1 -1
- package/dist/to-array.js +9 -11
- package/dist/to-array.js.map +1 -1
- package/package.json +15 -15
- package/src/activities.js +10 -7
- package/src/activity-thread-ordering.js +27 -30
- package/src/activity-threading.md +68 -49
- package/src/config.js +5 -5
- package/src/conversation.js +621 -589
- package/src/decryption-transforms.js +103 -62
- package/src/encryption-transforms.js +103 -83
- package/src/index.js +82 -66
- package/src/share-activity.js +64 -55
- package/src/to-array.js +2 -2
- package/test/integration/spec/create.js +184 -118
- package/test/integration/spec/encryption.js +250 -186
- package/test/integration/spec/get.js +761 -513
- package/test/integration/spec/mercury.js +37 -27
- package/test/integration/spec/share.js +292 -229
- package/test/integration/spec/verbs.js +628 -441
- package/test/unit/spec/conversation.js +265 -163
- package/test/unit/spec/decrypt-transforms.js +112 -131
- package/test/unit/spec/encryption-transforms.js +24 -18
- package/test/unit/spec/share-activity.js +37 -40
|
@@ -14,32 +14,35 @@ describe('plugin-conversation', function () {
|
|
|
14
14
|
describe('mercury processing', () => {
|
|
15
15
|
let kirk, mccoy, participants, webex;
|
|
16
16
|
|
|
17
|
-
before(() =>
|
|
18
|
-
.then((users) => {
|
|
17
|
+
before(() =>
|
|
18
|
+
testUsers.create({count: 3}).then((users) => {
|
|
19
19
|
[kirk, mccoy] = participants = users;
|
|
20
20
|
|
|
21
21
|
webex = new WebexCore({
|
|
22
22
|
credentials: {
|
|
23
|
-
authorization: mccoy.token
|
|
24
|
-
}
|
|
23
|
+
authorization: mccoy.token,
|
|
24
|
+
},
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
kirk.webex = new WebexCore({
|
|
28
28
|
credentials: {
|
|
29
|
-
authorization: kirk.token
|
|
30
|
-
}
|
|
29
|
+
authorization: kirk.token,
|
|
30
|
+
},
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
return Promise.all([
|
|
34
34
|
webex.internal.mercury.connect(),
|
|
35
|
-
kirk.webex.internal.mercury.connect()
|
|
35
|
+
kirk.webex.internal.mercury.connect(),
|
|
36
36
|
]);
|
|
37
|
-
})
|
|
37
|
+
})
|
|
38
|
+
);
|
|
38
39
|
|
|
39
|
-
after(() =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
after(() =>
|
|
41
|
+
Promise.all([
|
|
42
|
+
webex && webex.internal.mercury.disconnect(),
|
|
43
|
+
kirk && kirk.webex.internal.mercury.disconnect(),
|
|
44
|
+
])
|
|
45
|
+
);
|
|
43
46
|
|
|
44
47
|
let conversation;
|
|
45
48
|
|
|
@@ -48,8 +51,9 @@ describe('plugin-conversation', function () {
|
|
|
48
51
|
return Promise.resolve();
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
return webex.internal.conversation.create({participants})
|
|
52
|
-
|
|
54
|
+
return webex.internal.conversation.create({participants}).then((c) => {
|
|
55
|
+
conversation = c;
|
|
56
|
+
});
|
|
53
57
|
});
|
|
54
58
|
|
|
55
59
|
describe('when an activity is received', () => {
|
|
@@ -63,21 +67,27 @@ describe('plugin-conversation', function () {
|
|
|
63
67
|
});
|
|
64
68
|
});
|
|
65
69
|
|
|
66
|
-
const message =
|
|
70
|
+
const message = "Dammit Jim, I'm a Doctor not a brick-layer!";
|
|
67
71
|
|
|
68
|
-
webex.internal.conversation.post(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
webex.internal.conversation.post(
|
|
73
|
+
conversation,
|
|
74
|
+
{
|
|
75
|
+
displayName: message,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
clientTempId,
|
|
79
|
+
}
|
|
80
|
+
);
|
|
73
81
|
|
|
74
|
-
return promise
|
|
75
|
-
.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
return promise.then((event) => {
|
|
83
|
+
assert.isActivity(event.data.activity);
|
|
84
|
+
assert.isEncryptedActivity(event.data.activity);
|
|
85
|
+
assert.equal(
|
|
86
|
+
event.data.activity.encryptionKeyUrl,
|
|
87
|
+
conversation.defaultActivityEncryptionKeyUrl
|
|
88
|
+
);
|
|
89
|
+
assert.equal(event.data.activity.object.displayName, message);
|
|
90
|
+
});
|
|
81
91
|
});
|
|
82
92
|
});
|
|
83
93
|
});
|