@webex/internal-plugin-calendar 3.0.0-beta.4 → 3.0.0-beta.41
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/calendar.js +20 -61
- package/dist/calendar.js.map +1 -1
- package/dist/collection.js +0 -19
- package/dist/collection.js.map +1 -1
- package/dist/config.js +0 -3
- package/dist/config.js.map +1 -1
- package/dist/constants.js +0 -2
- package/dist/constants.js.map +1 -1
- package/dist/index.js +7 -21
- package/dist/index.js.map +1 -1
- package/dist/util.js +0 -13
- package/dist/util.js.map +1 -1
- package/package.json +10 -10
- package/src/calendar.js +47 -42
- package/src/collection.js +2 -4
- package/src/config.js +2 -2
- package/src/index.js +97 -40
- package/src/util.js +5 -3
- package/test/integration/spec/calendar.js +379 -271
- package/test/unit/spec/calendar.js +115 -74
- package/test/unit/spec/utils.js +4 -1
|
@@ -11,7 +11,6 @@ import retry from '@webex/test-helper-retry';
|
|
|
11
11
|
import testUsers from '@webex/test-helper-test-users';
|
|
12
12
|
import uuid from 'uuid';
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
/**
|
|
16
15
|
* produces a mock meeting object
|
|
17
16
|
* @param {Object} params
|
|
@@ -30,8 +29,8 @@ function makeMockMeetingPayload(params) {
|
|
|
30
29
|
links: [
|
|
31
30
|
{
|
|
32
31
|
href: `https://calendar-example.com/calendar/api/v1/${params.locusId}`,
|
|
33
|
-
rel: 'self'
|
|
34
|
-
}
|
|
32
|
+
rel: 'self',
|
|
33
|
+
},
|
|
35
34
|
],
|
|
36
35
|
encryptedNotes: params.body,
|
|
37
36
|
encryptedLocation: params.location,
|
|
@@ -42,7 +41,7 @@ function makeMockMeetingPayload(params) {
|
|
|
42
41
|
spaceURL: params.spaceURL,
|
|
43
42
|
meetingJoinInfo: {
|
|
44
43
|
meetingJoinURI: params.meetingJoinInfo.meetingJoinURI,
|
|
45
|
-
meetingJoinURL: params.meetingJoinInfo.meetingJoinURI
|
|
44
|
+
meetingJoinURL: params.meetingJoinInfo.meetingJoinURI,
|
|
46
45
|
},
|
|
47
46
|
encryptedParticipants: [
|
|
48
47
|
{
|
|
@@ -52,7 +51,7 @@ function makeMockMeetingPayload(params) {
|
|
|
52
51
|
participantType: 'OPTIONAL',
|
|
53
52
|
orgId: params.participants.participant1.orgId,
|
|
54
53
|
encryptedEmailAddress: params.participants.participant1.emailAddress,
|
|
55
|
-
encryptedName: params.participants.participant1.name
|
|
54
|
+
encryptedName: params.participants.participant1.name,
|
|
56
55
|
},
|
|
57
56
|
{
|
|
58
57
|
id: params.participants.participant2.id,
|
|
@@ -61,9 +60,9 @@ function makeMockMeetingPayload(params) {
|
|
|
61
60
|
participantType: 'REQUIRED',
|
|
62
61
|
orgId: params.participants.participant2.orgId,
|
|
63
62
|
encryptedEmailAddress: params.participants.participant2.emailAddress,
|
|
64
|
-
encryptedName: params.participants.participant2.name
|
|
65
|
-
}
|
|
66
|
-
]
|
|
63
|
+
encryptedName: params.participants.participant2.name,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
67
66
|
};
|
|
68
67
|
|
|
69
68
|
return payload;
|
|
@@ -81,10 +80,10 @@ function makeMockNotesPayload(params) {
|
|
|
81
80
|
links: [
|
|
82
81
|
{
|
|
83
82
|
href: `https://calendar-example.com/calendar/api/v1/${params.locusId}`,
|
|
84
|
-
rel: 'self'
|
|
85
|
-
}
|
|
83
|
+
rel: 'self',
|
|
84
|
+
},
|
|
86
85
|
],
|
|
87
|
-
encryptedNotes: params.meetingNotes
|
|
86
|
+
encryptedNotes: params.meetingNotes,
|
|
88
87
|
};
|
|
89
88
|
|
|
90
89
|
return payload;
|
|
@@ -102,8 +101,8 @@ function makeMockParticipantsPayload(params) {
|
|
|
102
101
|
links: [
|
|
103
102
|
{
|
|
104
103
|
href: `https://calendar-example.com/calendar/api/v1/${params.locusId}`,
|
|
105
|
-
rel: 'self'
|
|
106
|
-
}
|
|
104
|
+
rel: 'self',
|
|
105
|
+
},
|
|
107
106
|
],
|
|
108
107
|
encryptedParticipants: [
|
|
109
108
|
{
|
|
@@ -113,7 +112,7 @@ function makeMockParticipantsPayload(params) {
|
|
|
113
112
|
participantType: 'OPTIONAL',
|
|
114
113
|
orgId: params.participants.participant1.orgId,
|
|
115
114
|
encryptedEmailAddress: params.participants.participant1.emailAddress,
|
|
116
|
-
encryptedName: params.participants.participant1.name
|
|
115
|
+
encryptedName: params.participants.participant1.name,
|
|
117
116
|
},
|
|
118
117
|
{
|
|
119
118
|
id: params.participants.participant2.id,
|
|
@@ -122,62 +121,77 @@ function makeMockParticipantsPayload(params) {
|
|
|
122
121
|
participantType: 'REQUIRED',
|
|
123
122
|
orgId: params.participants.participant2.orgId,
|
|
124
123
|
encryptedEmailAddress: params.participants.participant2.emailAddress,
|
|
125
|
-
encryptedName: params.participants.participant2.name
|
|
126
|
-
}
|
|
127
|
-
]
|
|
124
|
+
encryptedName: params.participants.participant2.name,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
128
127
|
};
|
|
129
128
|
|
|
130
129
|
return payload;
|
|
131
130
|
}
|
|
132
131
|
|
|
133
132
|
function postToWhistler(webex, type, payload) {
|
|
134
|
-
return retry(() =>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
133
|
+
return retry(() =>
|
|
134
|
+
webex
|
|
135
|
+
.request({
|
|
136
|
+
method: 'POST',
|
|
137
|
+
uri: `${process.env.WHISTLER_API_SERVICE_URL}/calendarEvent`,
|
|
138
|
+
body: payload,
|
|
139
|
+
qs: {
|
|
140
|
+
changeType: type,
|
|
141
|
+
useProduction:
|
|
142
|
+
typeof process.env.WDM_SERVICE_URL === 'undefined' ||
|
|
143
|
+
process.env.WDM_SERVICE_URL.includes('wdm-a.wbx2.com'),
|
|
144
|
+
},
|
|
145
|
+
})
|
|
146
|
+
.then((res) => {
|
|
147
|
+
// Test response is using our parameters
|
|
148
|
+
const createdMeeting = res.body;
|
|
149
|
+
|
|
150
|
+
assert.isDefined(createdMeeting);
|
|
151
|
+
assert.equal(createdMeeting.meeting.itemId, payload.id);
|
|
152
|
+
assert.equal(createdMeeting.userUUID, payload.organizer);
|
|
153
|
+
assert.equal(createdMeeting.meeting.startDate, payload.start);
|
|
154
|
+
assert.equal(createdMeeting.meeting.duration, payload.durationMinutes);
|
|
155
|
+
|
|
156
|
+
return res;
|
|
157
|
+
})
|
|
158
|
+
);
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
function postNotesToWhistler(webex, type, payload) {
|
|
158
|
-
return retry(() =>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
return retry(() =>
|
|
163
|
+
webex
|
|
164
|
+
.request({
|
|
165
|
+
method: 'POST',
|
|
166
|
+
uri: `${process.env.WHISTLER_API_SERVICE_URL}/calendarEvent`,
|
|
167
|
+
body: payload,
|
|
168
|
+
qs: {
|
|
169
|
+
changeType: type,
|
|
170
|
+
useProduction:
|
|
171
|
+
typeof process.env.WDM_SERVICE_URL === 'undefined' ||
|
|
172
|
+
process.env.WDM_SERVICE_URL.includes('wdm-a.wbx2.com'),
|
|
173
|
+
},
|
|
174
|
+
})
|
|
175
|
+
.then((res) => res.body)
|
|
176
|
+
);
|
|
168
177
|
}
|
|
169
178
|
|
|
170
179
|
function postParticipantsToWhistler(webex, type, payload) {
|
|
171
|
-
return retry(() =>
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
return retry(() =>
|
|
181
|
+
webex
|
|
182
|
+
.request({
|
|
183
|
+
method: 'POST',
|
|
184
|
+
uri: `${process.env.WHISTLER_API_SERVICE_URL}/calendarEvent`,
|
|
185
|
+
body: payload,
|
|
186
|
+
qs: {
|
|
187
|
+
changeType: type,
|
|
188
|
+
useProduction:
|
|
189
|
+
typeof process.env.WDM_SERVICE_URL === 'undefined' ||
|
|
190
|
+
process.env.WDM_SERVICE_URL.includes('wdm-a.wbx2.com'),
|
|
191
|
+
},
|
|
192
|
+
})
|
|
193
|
+
.then((res) => res.body)
|
|
194
|
+
);
|
|
181
195
|
}
|
|
182
196
|
|
|
183
197
|
describe.skip('plugin-calendar', () => {
|
|
@@ -186,41 +200,49 @@ describe.skip('plugin-calendar', () => {
|
|
|
186
200
|
this.timeout(retry.timeout(20000));
|
|
187
201
|
let creator, mccoy, webex, spock;
|
|
188
202
|
|
|
189
|
-
before('create test users', () =>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
'sparkCompliance',
|
|
194
|
-
'sparkAdmin',
|
|
195
|
-
'spark',
|
|
196
|
-
'squaredCallInitiation',
|
|
197
|
-
'squaredRoomModeration',
|
|
198
|
-
'squaredInviter',
|
|
199
|
-
'webExSquared',
|
|
200
|
-
'squaredFusionCal'
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
})
|
|
204
|
-
.then((users) => {
|
|
205
|
-
[creator, spock, mccoy] = users;
|
|
206
|
-
|
|
207
|
-
webex = new WebexCore({
|
|
208
|
-
credentials: {
|
|
209
|
-
authorization: creator.token
|
|
210
|
-
},
|
|
203
|
+
before('create test users', () =>
|
|
204
|
+
testUsers
|
|
205
|
+
.create({
|
|
206
|
+
count: 3,
|
|
211
207
|
config: {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
208
|
+
entitlements: [
|
|
209
|
+
'sparkCompliance',
|
|
210
|
+
'sparkAdmin',
|
|
211
|
+
'spark',
|
|
212
|
+
'squaredCallInitiation',
|
|
213
|
+
'squaredRoomModeration',
|
|
214
|
+
'squaredInviter',
|
|
215
|
+
'webExSquared',
|
|
216
|
+
'squaredFusionCal',
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
})
|
|
220
|
+
.then((users) => {
|
|
221
|
+
[creator, spock, mccoy] = users;
|
|
222
|
+
|
|
223
|
+
webex = new WebexCore({
|
|
224
|
+
credentials: {
|
|
225
|
+
authorization: creator.token,
|
|
226
|
+
},
|
|
227
|
+
config: {
|
|
228
|
+
device: {
|
|
229
|
+
preDiscoveryServices: {
|
|
230
|
+
whistlerServiceUrl:
|
|
231
|
+
process.env.WHISTLER_API_SERVICE_URL ||
|
|
232
|
+
'https://calendar-whistler.allnint.ciscospark.com:8084/api/v1',
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
})
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
before('register to wdm, set features, and connect to mercury', () =>
|
|
241
|
+
webex.internal.device
|
|
242
|
+
.register()
|
|
243
|
+
.then(() => webex.internal.feature.setFeature('developer', 'calsvc_calendar_view', true))
|
|
244
|
+
.then(() => webex.internal.mercury.connect())
|
|
245
|
+
);
|
|
224
246
|
|
|
225
247
|
after(() => webex && webex.internal.mercury.disconnect());
|
|
226
248
|
|
|
@@ -233,7 +255,6 @@ describe.skip('plugin-calendar', () => {
|
|
|
233
255
|
const seriesID = uuid.v4();
|
|
234
256
|
|
|
235
257
|
const meetingParams = {
|
|
236
|
-
|
|
237
258
|
meetingId: meetingID,
|
|
238
259
|
seriesId: seriesID,
|
|
239
260
|
start: startInterval,
|
|
@@ -245,55 +266,78 @@ describe.skip('plugin-calendar', () => {
|
|
|
245
266
|
organizer: creator,
|
|
246
267
|
participants: {
|
|
247
268
|
participant1: mccoy,
|
|
248
|
-
participant2: spock
|
|
269
|
+
participant2: spock,
|
|
249
270
|
},
|
|
250
271
|
location: '@webex',
|
|
251
|
-
body: 'Test Agenda'
|
|
272
|
+
body: 'Test Agenda',
|
|
252
273
|
};
|
|
253
274
|
|
|
254
|
-
return postToWhistler(webex, 'CREATE', makeMockMeetingPayload(meetingParams))
|
|
255
|
-
|
|
275
|
+
return postToWhistler(webex, 'CREATE', makeMockMeetingPayload(meetingParams)).then(
|
|
276
|
+
(res) => {
|
|
256
277
|
const createdMeeting = res.body;
|
|
257
278
|
|
|
258
|
-
return webex.internal.calendar.list()
|
|
259
|
-
.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
279
|
+
return webex.internal.calendar.list().then((meetings) => {
|
|
280
|
+
const testMeeting = meetings.find(
|
|
281
|
+
(meeting) => meeting.seriesId === createdMeeting.meeting.meetingSeriesId
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
assert.isDefined(testMeeting);
|
|
285
|
+
assert.equal(createdMeeting.meeting.meetingSeriesId, testMeeting.seriesId);
|
|
286
|
+
assert.equal(createdMeeting.userUUID, testMeeting.organizer);
|
|
287
|
+
assert.equal(createdMeeting.meeting.startDate, testMeeting.start);
|
|
288
|
+
assert.equal(
|
|
289
|
+
Math.round(
|
|
290
|
+
(new Date(createdMeeting.meeting.endDate).getTime() -
|
|
291
|
+
new Date(createdMeeting.meeting.startDate).getTime()) /
|
|
292
|
+
60000
|
|
293
|
+
),
|
|
294
|
+
testMeeting.durationMinutes
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
// Validate decryption of subject, location and agenda
|
|
298
|
+
assert.isDefined(testMeeting.encryptedSubject);
|
|
299
|
+
assert.equal(meetingParams.title, testMeeting.encryptedSubject);
|
|
300
|
+
assert.isDefined(testMeeting.encryptedLocation);
|
|
301
|
+
assert.equal(meetingParams.location, testMeeting.encryptedLocation);
|
|
302
|
+
assert.isDefined(testMeeting.encryptedNotes);
|
|
303
|
+
assert.equal(meetingParams.body, testMeeting.encryptedNotes);
|
|
304
|
+
assert.isDefined(testMeeting.webexURI);
|
|
305
|
+
assert.equal(meetingParams.location, testMeeting.webexURI);
|
|
306
|
+
assert.isDefined(testMeeting.webexURL);
|
|
307
|
+
assert.equal(meetingParams.location, testMeeting.webexURL);
|
|
308
|
+
assert.isDefined(testMeeting.spaceMeetURL);
|
|
309
|
+
assert.equal(meetingParams.location, testMeeting.spaceMeetURL);
|
|
310
|
+
assert.isDefined(testMeeting.spaceURI);
|
|
311
|
+
assert.equal(meetingParams.location, testMeeting.spaceURI);
|
|
312
|
+
assert.isDefined(testMeeting.spaceURL);
|
|
313
|
+
assert.equal(meetingParams.location, testMeeting.spaceURL);
|
|
314
|
+
assert.isDefined(testMeeting.encryptedParticipants);
|
|
315
|
+
const encryptedParticipant1 = testMeeting.encryptedParticipants.find(
|
|
316
|
+
(participant) => participant.id === meetingParams.participants.participant1.id
|
|
317
|
+
);
|
|
318
|
+
const encryptedParticipant2 = testMeeting.encryptedParticipants.find(
|
|
319
|
+
(participant) => participant.id === meetingParams.participants.participant2.id
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
assert.equal(
|
|
323
|
+
meetingParams.participants.participant1.emailAddress,
|
|
324
|
+
encryptedParticipant1.encryptedEmailAddress
|
|
325
|
+
);
|
|
326
|
+
assert.equal(
|
|
327
|
+
meetingParams.participants.participant1.name,
|
|
328
|
+
encryptedParticipant1.encryptedName
|
|
329
|
+
);
|
|
330
|
+
assert.equal(
|
|
331
|
+
meetingParams.participants.participant2.emailAddress,
|
|
332
|
+
encryptedParticipant2.encryptedEmailAddress
|
|
333
|
+
);
|
|
334
|
+
assert.equal(
|
|
335
|
+
meetingParams.participants.participant2.name,
|
|
336
|
+
encryptedParticipant2.encryptedName
|
|
337
|
+
);
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
);
|
|
297
341
|
});
|
|
298
342
|
|
|
299
343
|
it('receives a mercury event for a new meeting', () => {
|
|
@@ -305,7 +349,6 @@ describe.skip('plugin-calendar', () => {
|
|
|
305
349
|
const seriesID = uuid.v4();
|
|
306
350
|
|
|
307
351
|
const meetingParams = {
|
|
308
|
-
|
|
309
352
|
meetingId: meetingID,
|
|
310
353
|
seriesId: seriesID,
|
|
311
354
|
start: startInterval,
|
|
@@ -317,10 +360,10 @@ describe.skip('plugin-calendar', () => {
|
|
|
317
360
|
organizer: creator,
|
|
318
361
|
participants: {
|
|
319
362
|
participant1: mccoy,
|
|
320
|
-
participant2: spock
|
|
363
|
+
participant2: spock,
|
|
321
364
|
},
|
|
322
365
|
location: '@webex',
|
|
323
|
-
body: 'Test Agenda'
|
|
366
|
+
body: 'Test Agenda',
|
|
324
367
|
};
|
|
325
368
|
|
|
326
369
|
const mercuryPromise = new Promise((resolve) => {
|
|
@@ -329,91 +372,129 @@ describe.skip('plugin-calendar', () => {
|
|
|
329
372
|
});
|
|
330
373
|
});
|
|
331
374
|
|
|
332
|
-
return postToWhistler(webex, 'CREATE', makeMockMeetingPayload(meetingParams))
|
|
333
|
-
|
|
375
|
+
return postToWhistler(webex, 'CREATE', makeMockMeetingPayload(meetingParams)).then(
|
|
376
|
+
(res) => {
|
|
334
377
|
const createdMeeting = res.body;
|
|
335
378
|
|
|
336
|
-
return mercuryPromise
|
|
337
|
-
.
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
379
|
+
return mercuryPromise.then((calendarMeetingExternal) => {
|
|
380
|
+
assert.equal(
|
|
381
|
+
createdMeeting.meeting.meetingSeriesId,
|
|
382
|
+
calendarMeetingExternal.seriesId
|
|
383
|
+
);
|
|
384
|
+
assert.equal(createdMeeting.userUUID, calendarMeetingExternal.organizer);
|
|
385
|
+
assert.equal(createdMeeting.meeting.startDate, calendarMeetingExternal.start);
|
|
386
|
+
assert.equal(
|
|
387
|
+
Math.round(
|
|
388
|
+
(new Date(createdMeeting.meeting.endDate).getTime() -
|
|
389
|
+
new Date(createdMeeting.meeting.startDate).getTime()) /
|
|
390
|
+
60000
|
|
391
|
+
),
|
|
392
|
+
calendarMeetingExternal.durationMinutes
|
|
393
|
+
);
|
|
394
|
+
|
|
395
|
+
// Validate decryption of subject, location and agenda
|
|
396
|
+
assert.isDefined(calendarMeetingExternal.encryptedSubject);
|
|
397
|
+
assert.equal(meetingParams.title, calendarMeetingExternal.encryptedSubject);
|
|
398
|
+
assert.isDefined(calendarMeetingExternal.encryptedLocation);
|
|
399
|
+
assert.equal(meetingParams.location, calendarMeetingExternal.encryptedLocation);
|
|
400
|
+
assert.isDefined(calendarMeetingExternal.encryptedNotes);
|
|
401
|
+
assert.equal(meetingParams.body, calendarMeetingExternal.encryptedNotes);
|
|
402
|
+
assert.isDefined(calendarMeetingExternal.webexURI);
|
|
403
|
+
assert.equal(meetingParams.body, calendarMeetingExternal.webexURI);
|
|
404
|
+
assert.isDefined(calendarMeetingExternal.webexURL);
|
|
405
|
+
assert.equal(meetingParams.body, calendarMeetingExternal.webexURL);
|
|
406
|
+
assert.isDefined(calendarMeetingExternal.spaceMeetURL);
|
|
407
|
+
assert.equal(meetingParams.body, calendarMeetingExternal.spaceMeetURL);
|
|
408
|
+
assert.isDefined(calendarMeetingExternal.spaceURI);
|
|
409
|
+
assert.equal(meetingParams.body, calendarMeetingExternal.spaceURI);
|
|
410
|
+
assert.isDefined(calendarMeetingExternal.spaceURL);
|
|
411
|
+
assert.equal(meetingParams.body, calendarMeetingExternal.spaceURL);
|
|
412
|
+
assert.isDefined(calendarMeetingExternal.meetingJoinInfo.meetingJoinURI);
|
|
413
|
+
assert.equal(
|
|
414
|
+
meetingParams.body,
|
|
415
|
+
calendarMeetingExternal.meetingJoinInfo.meetingJoinURI
|
|
416
|
+
);
|
|
417
|
+
assert.isDefined(calendarMeetingExternal.meetingJoinInfo.meetingJoinURL);
|
|
418
|
+
assert.equal(
|
|
419
|
+
meetingParams.body,
|
|
420
|
+
calendarMeetingExternal.meetingJoinInfo.meetingJoinURL
|
|
421
|
+
);
|
|
422
|
+
assert.isDefined(calendarMeetingExternal.encryptedParticipants);
|
|
423
|
+
const encryptedParticipant1 = calendarMeetingExternal.encryptedParticipants.find(
|
|
424
|
+
(participant) => participant.id === meetingParams.participants.participant1.id
|
|
425
|
+
);
|
|
426
|
+
const encryptedParticipant2 = calendarMeetingExternal.encryptedParticipants.find(
|
|
427
|
+
(participant) => participant.id === meetingParams.participants.participant2.id
|
|
428
|
+
);
|
|
429
|
+
|
|
430
|
+
assert.equal(
|
|
431
|
+
meetingParams.participants.participant1.emailAddress,
|
|
432
|
+
encryptedParticipant1.encryptedEmailAddress
|
|
433
|
+
);
|
|
434
|
+
assert.equal(
|
|
435
|
+
meetingParams.participants.participant1.name,
|
|
436
|
+
encryptedParticipant1.encryptedName
|
|
437
|
+
);
|
|
438
|
+
assert.equal(
|
|
439
|
+
meetingParams.participants.participant2.emailAddress,
|
|
440
|
+
encryptedParticipant2.encryptedEmailAddress
|
|
441
|
+
);
|
|
442
|
+
assert.equal(
|
|
443
|
+
meetingParams.participants.participant2.name,
|
|
444
|
+
encryptedParticipant2.encryptedName
|
|
445
|
+
);
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
);
|
|
376
449
|
});
|
|
377
450
|
});
|
|
378
451
|
|
|
379
452
|
describe('#getNotes()', () => {
|
|
380
453
|
let creator, webex;
|
|
381
454
|
|
|
382
|
-
before('create test users', () =>
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
'sparkCompliance',
|
|
387
|
-
'sparkAdmin',
|
|
388
|
-
'spark',
|
|
389
|
-
'squaredCallInitiation',
|
|
390
|
-
'squaredRoomModeration',
|
|
391
|
-
'squaredInviter',
|
|
392
|
-
'webExSquared',
|
|
393
|
-
'squaredFusionCal'
|
|
394
|
-
]
|
|
395
|
-
}
|
|
396
|
-
})
|
|
397
|
-
.then((users) => {
|
|
398
|
-
[creator] = users;
|
|
399
|
-
|
|
400
|
-
webex = new WebexCore({
|
|
401
|
-
credentials: {
|
|
402
|
-
authorization: creator.token
|
|
403
|
-
},
|
|
455
|
+
before('create test users', () =>
|
|
456
|
+
testUsers
|
|
457
|
+
.create({
|
|
458
|
+
count: 3,
|
|
404
459
|
config: {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
460
|
+
entitlements: [
|
|
461
|
+
'sparkCompliance',
|
|
462
|
+
'sparkAdmin',
|
|
463
|
+
'spark',
|
|
464
|
+
'squaredCallInitiation',
|
|
465
|
+
'squaredRoomModeration',
|
|
466
|
+
'squaredInviter',
|
|
467
|
+
'webExSquared',
|
|
468
|
+
'squaredFusionCal',
|
|
469
|
+
],
|
|
470
|
+
},
|
|
471
|
+
})
|
|
472
|
+
.then((users) => {
|
|
473
|
+
[creator] = users;
|
|
474
|
+
|
|
475
|
+
webex = new WebexCore({
|
|
476
|
+
credentials: {
|
|
477
|
+
authorization: creator.token,
|
|
478
|
+
},
|
|
479
|
+
config: {
|
|
480
|
+
services: {
|
|
481
|
+
discovery: {
|
|
482
|
+
whistlerServiceUrl:
|
|
483
|
+
process.env.WHISTLER_API_SERVICE_URL ||
|
|
484
|
+
'https://calendar-whistler.allnint.ciscospark.com:8084/api/v1',
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
});
|
|
489
|
+
})
|
|
490
|
+
);
|
|
491
|
+
|
|
492
|
+
before('register to wdm, set features, and connect to mercury', () =>
|
|
493
|
+
webex.internal.device
|
|
494
|
+
.register()
|
|
495
|
+
.then(() => webex.internal.feature.setFeature('developer', 'calsvc_calendar_view', true))
|
|
496
|
+
.then(() => webex.internal.mercury.connect())
|
|
497
|
+
);
|
|
417
498
|
|
|
418
499
|
after(() => webex && webex.internal.mercury.disconnect());
|
|
419
500
|
|
|
@@ -427,56 +508,65 @@ describe.skip('plugin-calendar', () => {
|
|
|
427
508
|
meetingId: meetingID,
|
|
428
509
|
seriesId: seriesID,
|
|
429
510
|
locusId: locusID,
|
|
430
|
-
meetingNotes
|
|
511
|
+
meetingNotes,
|
|
431
512
|
};
|
|
432
513
|
|
|
433
|
-
return postNotesToWhistler(webex, 'CREATE', makeMockNotesPayload(meetingParams))
|
|
434
|
-
|
|
435
|
-
.then((response) => {
|
|
514
|
+
return postNotesToWhistler(webex, 'CREATE', makeMockNotesPayload(meetingParams)).then(
|
|
515
|
+
(createdMeeting) =>
|
|
516
|
+
webex.internal.calendar.getNotes(meetingID).then((response) => {
|
|
436
517
|
assert.equal(createdMeeting.meeting.meetingSeriesId, response.seriesId);
|
|
437
518
|
assert.equal(meetingParams.meetingNotes, response.encryptedNotes);
|
|
438
|
-
})
|
|
519
|
+
})
|
|
520
|
+
);
|
|
439
521
|
});
|
|
440
522
|
});
|
|
441
523
|
|
|
442
524
|
describe('#getParticipants()', () => {
|
|
443
525
|
let creator, mccoy, webex, spock;
|
|
444
526
|
|
|
445
|
-
before('create test users', () =>
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
'sparkCompliance',
|
|
450
|
-
'sparkAdmin',
|
|
451
|
-
'spark',
|
|
452
|
-
'squaredCallInitiation',
|
|
453
|
-
'squaredRoomModeration',
|
|
454
|
-
'squaredInviter',
|
|
455
|
-
'webExSquared',
|
|
456
|
-
'squaredFusionCal'
|
|
457
|
-
]
|
|
458
|
-
}
|
|
459
|
-
})
|
|
460
|
-
.then((users) => {
|
|
461
|
-
[creator, spock, mccoy] = users;
|
|
462
|
-
|
|
463
|
-
webex = new WebexCore({
|
|
464
|
-
credentials: {
|
|
465
|
-
authorization: creator.token
|
|
466
|
-
},
|
|
527
|
+
before('create test users', () =>
|
|
528
|
+
testUsers
|
|
529
|
+
.create({
|
|
530
|
+
count: 3,
|
|
467
531
|
config: {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
532
|
+
entitlements: [
|
|
533
|
+
'sparkCompliance',
|
|
534
|
+
'sparkAdmin',
|
|
535
|
+
'spark',
|
|
536
|
+
'squaredCallInitiation',
|
|
537
|
+
'squaredRoomModeration',
|
|
538
|
+
'squaredInviter',
|
|
539
|
+
'webExSquared',
|
|
540
|
+
'squaredFusionCal',
|
|
541
|
+
],
|
|
542
|
+
},
|
|
543
|
+
})
|
|
544
|
+
.then((users) => {
|
|
545
|
+
[creator, spock, mccoy] = users;
|
|
546
|
+
|
|
547
|
+
webex = new WebexCore({
|
|
548
|
+
credentials: {
|
|
549
|
+
authorization: creator.token,
|
|
550
|
+
},
|
|
551
|
+
config: {
|
|
552
|
+
services: {
|
|
553
|
+
discovery: {
|
|
554
|
+
whistlerServiceUrl:
|
|
555
|
+
process.env.WHISTLER_API_SERVICE_URL ||
|
|
556
|
+
'https://calendar-whistler.allnint.ciscospark.com:8084/api/v1',
|
|
557
|
+
},
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
});
|
|
561
|
+
})
|
|
562
|
+
);
|
|
563
|
+
|
|
564
|
+
before('register to wdm, set features, and connect to mercury', () =>
|
|
565
|
+
webex.internal.device
|
|
566
|
+
.register()
|
|
567
|
+
.then(() => webex.internal.feature.setFeature('developer', 'calsvc_calendar_view', true))
|
|
568
|
+
.then(() => webex.internal.mercury.connect())
|
|
569
|
+
);
|
|
480
570
|
|
|
481
571
|
after(() => webex && webex.internal.mercury.disconnect());
|
|
482
572
|
|
|
@@ -491,25 +581,43 @@ describe.skip('plugin-calendar', () => {
|
|
|
491
581
|
locusId: locusID,
|
|
492
582
|
participants: {
|
|
493
583
|
participant1: mccoy,
|
|
494
|
-
participant2: spock
|
|
495
|
-
}
|
|
584
|
+
participant2: spock,
|
|
585
|
+
},
|
|
496
586
|
};
|
|
497
587
|
|
|
498
|
-
return postParticipantsToWhistler(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
588
|
+
return postParticipantsToWhistler(
|
|
589
|
+
webex,
|
|
590
|
+
'CREATE',
|
|
591
|
+
makeMockParticipantsPayload(meetingParams)
|
|
592
|
+
).then((createdMeeting) =>
|
|
593
|
+
webex.internal.calendar.getParticipants(meetingID).then((response) => {
|
|
594
|
+
assert.equal(createdMeeting.meeting.meetingSeriesId, response.seriesId);
|
|
595
|
+
|
|
596
|
+
const encryptedParticipant1 = response.encryptedParticipants.find(
|
|
597
|
+
(participant) => participant.id === meetingParams.participants.participant1.id
|
|
598
|
+
);
|
|
599
|
+
const encryptedParticipant2 = response.encryptedParticipants.find(
|
|
600
|
+
(participant) => participant.id === meetingParams.participants.participant2.id
|
|
601
|
+
);
|
|
602
|
+
|
|
603
|
+
assert.equal(
|
|
604
|
+
meetingParams.participants.participant1.emailAddress,
|
|
605
|
+
encryptedParticipant1.encryptedEmailAddress
|
|
606
|
+
);
|
|
607
|
+
assert.equal(
|
|
608
|
+
meetingParams.participants.participant1.name,
|
|
609
|
+
encryptedParticipant1.encryptedName
|
|
610
|
+
);
|
|
611
|
+
assert.equal(
|
|
612
|
+
meetingParams.participants.participant2.emailAddress,
|
|
613
|
+
encryptedParticipant2.encryptedEmailAddress
|
|
614
|
+
);
|
|
615
|
+
assert.equal(
|
|
616
|
+
meetingParams.participants.participant2.name,
|
|
617
|
+
encryptedParticipant2.encryptedName
|
|
618
|
+
);
|
|
619
|
+
})
|
|
620
|
+
);
|
|
513
621
|
});
|
|
514
622
|
});
|
|
515
623
|
});
|