@webex/internal-plugin-calendar 2.60.0-next.1 → 2.60.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/calendar.js +69 -50
- package/dist/calendar.js.map +1 -1
- package/package.json +10 -10
- package/src/calendar.js +34 -12
- package/test/unit/spec/calendar.js +49 -0
package/dist/calendar.js
CHANGED
|
@@ -75,33 +75,52 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
75
75
|
* Cache KMS encryptionKeyUrl
|
|
76
76
|
* */
|
|
77
77
|
encryptionKeyUrl: null,
|
|
78
|
+
/**
|
|
79
|
+
* Pre-fetch a KMS encryption key url to improve performance.
|
|
80
|
+
* Waits for the user to be authorized and skips if an unverified guest.
|
|
81
|
+
* @private
|
|
82
|
+
* @returns {void}
|
|
83
|
+
*/
|
|
84
|
+
prefetchEncryptionKey: function prefetchEncryptionKey() {
|
|
85
|
+
var _this = this;
|
|
86
|
+
if (!this.webex.canAuthorize) {
|
|
87
|
+
this.listenToOnce(this.webex, 'change:canAuthorize', function () {
|
|
88
|
+
_this.prefetchEncryptionKey();
|
|
89
|
+
});
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (this.webex.credentials.isUnverifiedGuest) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this.webex.internal.encryption.kms.createUnboundKeys({
|
|
96
|
+
count: 1
|
|
97
|
+
}).then(function (keys) {
|
|
98
|
+
var key = (0, _lodash.isArray)(keys) ? keys[0] : keys;
|
|
99
|
+
_this.encryptionKeyUrl = key ? key.uri : null;
|
|
100
|
+
_this.logger.info('calendar->bind a KMS encryption key url');
|
|
101
|
+
_this.webex.internal.encryption.getKey(_this.encryptionKeyUrl, {
|
|
102
|
+
onBehalfOf: null
|
|
103
|
+
}).then(function (retrievedKey) {
|
|
104
|
+
_this.encryptionKeyUrl = retrievedKey ? retrievedKey.uri : null;
|
|
105
|
+
_this.logger.info('calendar->retrieve the KMS encryption key url and cache it');
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
},
|
|
78
109
|
/**
|
|
79
110
|
* WebexPlugin initialize method. This triggers once Webex has completed its
|
|
80
111
|
* initialization workflow.
|
|
81
112
|
*
|
|
82
113
|
* If the plugin is meant to perform startup actions, place them in this
|
|
83
114
|
* `initialize()` method instead of the `constructor()` method.
|
|
115
|
+
* @private
|
|
84
116
|
* @returns {void}
|
|
85
117
|
*/
|
|
86
118
|
initialize: function initialize() {
|
|
87
|
-
var
|
|
119
|
+
var _this2 = this;
|
|
88
120
|
// Used to perform actions after webex is fully qualified and ready for
|
|
89
121
|
// operation.
|
|
90
122
|
this.listenToOnce(this.webex, 'ready', function () {
|
|
91
|
-
|
|
92
|
-
_this.webex.internal.encryption.kms.createUnboundKeys({
|
|
93
|
-
count: 1
|
|
94
|
-
}).then(function (keys) {
|
|
95
|
-
var key = (0, _lodash.isArray)(keys) ? keys[0] : keys;
|
|
96
|
-
_this.encryptionKeyUrl = key ? key.uri : null;
|
|
97
|
-
_this.logger.info('calendar->bind a KMS encryption key url');
|
|
98
|
-
_this.webex.internal.encryption.getKey(_this.encryptionKeyUrl, {
|
|
99
|
-
onBehalfOf: null
|
|
100
|
-
}).then(function (retrievedKey) {
|
|
101
|
-
_this.encryptionKeyUrl = retrievedKey ? retrievedKey.uri : null;
|
|
102
|
-
_this.logger.info('calendar->retrieve the KMS encryption key url and cache it');
|
|
103
|
-
});
|
|
104
|
-
});
|
|
123
|
+
_this2.prefetchEncryptionKey();
|
|
105
124
|
});
|
|
106
125
|
},
|
|
107
126
|
/**
|
|
@@ -112,7 +131,7 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
112
131
|
* @memberof Calendar
|
|
113
132
|
*/
|
|
114
133
|
register: function register() {
|
|
115
|
-
var
|
|
134
|
+
var _this3 = this;
|
|
116
135
|
if (!this.webex.canAuthorize) {
|
|
117
136
|
this.logger.error('calendar->register#ERROR, Unable to register, SDK cannot authorize');
|
|
118
137
|
return _promise.default.reject(new Error('SDK cannot authorize'));
|
|
@@ -122,13 +141,13 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
122
141
|
return _promise.default.resolve();
|
|
123
142
|
}
|
|
124
143
|
return this.webex.internal.device.register().then(function () {
|
|
125
|
-
return
|
|
144
|
+
return _this3.webex.internal.mercury.connect();
|
|
126
145
|
}).then(function () {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
146
|
+
_this3.listenForEvents();
|
|
147
|
+
_this3.trigger(_constants.CALENDAR_REGISTERED);
|
|
148
|
+
_this3.registered = true;
|
|
130
149
|
}).catch(function (error) {
|
|
131
|
-
|
|
150
|
+
_this3.logger.error("calendar->register#ERROR, Unable to register, ".concat(error.message));
|
|
132
151
|
return _promise.default.reject(error);
|
|
133
152
|
});
|
|
134
153
|
},
|
|
@@ -141,17 +160,17 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
141
160
|
* @memberof Calendar
|
|
142
161
|
*/
|
|
143
162
|
unregister: function unregister() {
|
|
144
|
-
var
|
|
163
|
+
var _this4 = this;
|
|
145
164
|
if (!this.registered) {
|
|
146
165
|
this.logger.info('calendar->unregister#INFO, Calendar plugin already unregistered');
|
|
147
166
|
return _promise.default.resolve();
|
|
148
167
|
}
|
|
149
168
|
this.stopListeningForEvents();
|
|
150
169
|
return this.webex.internal.mercury.disconnect().then(function () {
|
|
151
|
-
return
|
|
170
|
+
return _this4.webex.internal.device.unregister();
|
|
152
171
|
}).then(function () {
|
|
153
|
-
|
|
154
|
-
|
|
172
|
+
_this4.trigger(_constants.CALENDAR_UNREGISTERED);
|
|
173
|
+
_this4.registered = false;
|
|
155
174
|
});
|
|
156
175
|
},
|
|
157
176
|
/**
|
|
@@ -160,25 +179,25 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
160
179
|
* @private
|
|
161
180
|
*/
|
|
162
181
|
listenForEvents: function listenForEvents() {
|
|
163
|
-
var
|
|
182
|
+
var _this5 = this;
|
|
164
183
|
// Calendar mercury events listener
|
|
165
184
|
this.webex.internal.mercury.on('event:calendar.meeting.create', function (envelope) {
|
|
166
|
-
|
|
185
|
+
_this5._handleCreate(envelope.data);
|
|
167
186
|
});
|
|
168
187
|
this.webex.internal.mercury.on('event:calendar.meeting.update', function (envelope) {
|
|
169
|
-
|
|
188
|
+
_this5._handleUpdate(envelope.data);
|
|
170
189
|
});
|
|
171
190
|
this.webex.internal.mercury.on('event:calendar.meeting.create.minimal', function (envelope) {
|
|
172
|
-
|
|
191
|
+
_this5._handleCreate(envelope.data);
|
|
173
192
|
});
|
|
174
193
|
this.webex.internal.mercury.on('event:calendar.meeting.update.minimal', function (envelope) {
|
|
175
|
-
|
|
194
|
+
_this5._handleUpdate(envelope.data);
|
|
176
195
|
});
|
|
177
196
|
this.webex.internal.mercury.on('event:calendar.meeting.delete', function (envelope) {
|
|
178
|
-
|
|
197
|
+
_this5._handleDelete(envelope.data);
|
|
179
198
|
});
|
|
180
199
|
this.webex.internal.mercury.on('event:calendar.free_busy', function (envelope) {
|
|
181
|
-
|
|
200
|
+
_this5._handleFreeBusy(envelope.data);
|
|
182
201
|
});
|
|
183
202
|
},
|
|
184
203
|
/**
|
|
@@ -231,20 +250,20 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
231
250
|
* @private
|
|
232
251
|
*/
|
|
233
252
|
_handleFreeBusy: function _handleFreeBusy(data) {
|
|
234
|
-
var
|
|
253
|
+
var _this6 = this;
|
|
235
254
|
_calendarDecrypt.default.decryptFreeBusyResponse(this, data).then(function () {
|
|
236
255
|
var response = {};
|
|
237
256
|
if (data && data.calendarFreeBusyScheduleResponse) {
|
|
238
257
|
response = data.calendarFreeBusyScheduleResponse;
|
|
239
258
|
}
|
|
240
|
-
if (response && response.requestId && response.requestId in
|
|
241
|
-
|
|
259
|
+
if (response && response.requestId && response.requestId in _this6.rpcEventRequests) {
|
|
260
|
+
_this6.logger.log("webex.internal.calendar - receive requests, requestId: ".concat(response.requestId));
|
|
242
261
|
delete response.encryptionKeyUrl;
|
|
243
|
-
var resolve =
|
|
262
|
+
var resolve = _this6.rpcEventRequests[response.requestId].resolve;
|
|
244
263
|
resolve(response);
|
|
245
|
-
delete
|
|
264
|
+
delete _this6.rpcEventRequests[response.requestId];
|
|
246
265
|
} else {
|
|
247
|
-
|
|
266
|
+
_this6.logger.log('webex.internal.calendar - receive other requests.');
|
|
248
267
|
}
|
|
249
268
|
});
|
|
250
269
|
},
|
|
@@ -340,7 +359,7 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
340
359
|
* @returns {Promise} Resolves with an array of meetings
|
|
341
360
|
*/
|
|
342
361
|
list: function list(options) {
|
|
343
|
-
var
|
|
362
|
+
var _this7 = this;
|
|
344
363
|
options = options || {};
|
|
345
364
|
return this.webex.request({
|
|
346
365
|
method: 'GET',
|
|
@@ -352,7 +371,7 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
352
371
|
var promises = [];
|
|
353
372
|
meetingObjects.forEach(function (meeting) {
|
|
354
373
|
if (!meeting.encryptedParticipants) {
|
|
355
|
-
promises.push(
|
|
374
|
+
promises.push(_this7.getParticipants(meeting.participantsUrl).then(function (notesResponse) {
|
|
356
375
|
meeting.encryptedParticipants = notesResponse.body.encryptedParticipants;
|
|
357
376
|
}));
|
|
358
377
|
}
|
|
@@ -369,9 +388,9 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
369
388
|
* @returns {Promise} Resolves with creating calendar event response
|
|
370
389
|
* */
|
|
371
390
|
createCalendarEvent: function createCalendarEvent(data, query) {
|
|
372
|
-
var
|
|
391
|
+
var _this8 = this;
|
|
373
392
|
return _calendarEncrypt.default.encryptCalendarEventRequest(this, data).then(function () {
|
|
374
|
-
return
|
|
393
|
+
return _this8.request({
|
|
375
394
|
method: 'POST',
|
|
376
395
|
service: 'calendar',
|
|
377
396
|
body: data,
|
|
@@ -388,9 +407,9 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
388
407
|
* @returns {Promise} Resolves with updating calendar event response
|
|
389
408
|
* */
|
|
390
409
|
updateCalendarEvent: function updateCalendarEvent(id, data, query) {
|
|
391
|
-
var
|
|
410
|
+
var _this9 = this;
|
|
392
411
|
return _calendarEncrypt.default.encryptCalendarEventRequest(this, data).then(function () {
|
|
393
|
-
return
|
|
412
|
+
return _this9.request({
|
|
394
413
|
method: 'PATCH',
|
|
395
414
|
service: 'calendar',
|
|
396
415
|
body: data,
|
|
@@ -435,14 +454,14 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
435
454
|
* @returns {Promise} Resolves with a decrypted scheduler data
|
|
436
455
|
* */
|
|
437
456
|
getSchedulerData: function getSchedulerData(query) {
|
|
438
|
-
var
|
|
457
|
+
var _this10 = this;
|
|
439
458
|
return this.request({
|
|
440
459
|
method: 'GET',
|
|
441
460
|
service: 'calendar',
|
|
442
461
|
resource: 'schedulerData',
|
|
443
462
|
qs: query || {}
|
|
444
463
|
}).then(function (response) {
|
|
445
|
-
return _calendarDecrypt.default.decryptSchedulerDataResponse(
|
|
464
|
+
return _calendarDecrypt.default.decryptSchedulerDataResponse(_this10, response.body).then(function () {
|
|
446
465
|
return response;
|
|
447
466
|
});
|
|
448
467
|
});
|
|
@@ -454,9 +473,9 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
454
473
|
* @returns {Promise} Resolves with a decrypted response
|
|
455
474
|
* */
|
|
456
475
|
getFreeBusy: function getFreeBusy(data, query) {
|
|
457
|
-
var
|
|
476
|
+
var _this11 = this;
|
|
458
477
|
return _calendarEncrypt.default.encryptFreeBusyRequest(this, data).then(function () {
|
|
459
|
-
return
|
|
478
|
+
return _this11.request({
|
|
460
479
|
method: 'POST',
|
|
461
480
|
service: 'calendar',
|
|
462
481
|
body: data,
|
|
@@ -465,7 +484,7 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
465
484
|
});
|
|
466
485
|
}).then(function () {
|
|
467
486
|
return new _promise.default(function (resolve, reject) {
|
|
468
|
-
|
|
487
|
+
_this11.rpcEventRequests[data.requestId] = {
|
|
469
488
|
resolve: resolve,
|
|
470
489
|
reject: reject
|
|
471
490
|
};
|
|
@@ -474,7 +493,7 @@ var Calendar = _webexCore.WebexPlugin.extend({
|
|
|
474
493
|
throw error;
|
|
475
494
|
});
|
|
476
495
|
},
|
|
477
|
-
version: "2.60.0-next.
|
|
496
|
+
version: "2.60.0-next.3"
|
|
478
497
|
});
|
|
479
498
|
var _default = exports.default = Calendar;
|
|
480
499
|
//# sourceMappingURL=calendar.js.map
|
package/dist/calendar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lodash","require","_common","_webexCore","_collection","_interopRequireDefault","_constants","_calendarEncrypt","_calendarDecrypt","Calendar","WebexPlugin","extend","namespace","registered","rpcEventRequests","encryptionKeyUrl","initialize","_this","listenToOnce","webex","internal","encryption","kms","createUnboundKeys","count","then","keys","key","isArray","uri","logger","info","getKey","onBehalfOf","retrievedKey","register","_this2","canAuthorize","error","_promise","default","reject","Error","resolve","device","mercury","connect","listenForEvents","trigger","CALENDAR_REGISTERED","catch","concat","message","unregister","_this3","stopListeningForEvents","disconnect","CALENDAR_UNREGISTERED","_this4","on","envelope","_handleCreate","data","_handleUpdate","_handleDelete","_handleFreeBusy","off","id","CalendarCollection","set","calendarMeetingExternal","CALENDAR_UPDATED","get","CALENDAR_CREATE","item","remove","CALENDAR_DELETE","_this5","DecryptHelper","decryptFreeBusyResponse","response","calendarFreeBusyScheduleResponse","requestId","log","syncCalendar","options","arguments","length","undefined","fromDate","config","toDate","list","res","setAll","getAll","getByType","value","includes","getBy","processMeetingEvent","event","transform","getParticipants","participantsUrl","request","method","getNotesByUrl","notesUrl","getNotes","service","resource","base64","encode","_this6","qs","meetingObjects","body","items","promises","forEach","meeting","encryptedParticipants","push","notesResponse","all","createCalendarEvent","query","_this7","EncryptHelper","encryptCalendarEventRequest","updateCalendarEvent","_this8","deleteCalendarEvent","getSchedulerData","_this9","decryptSchedulerDataResponse","getFreeBusy","_this10","encryptFreeBusyRequest","version","_default","exports"],"sources":["calendar.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * Calendar Item Create Event\n * Emitted when a calendar item has been added\n * @event calendar:meeting:create\n * @instance\n * @memberof Calendar\n */\n\n/**\n * Calendar Item Update Event\n * Emitted when a calendar item has been updated\n * @event calendar:meeting:update\n * @instance\n * @memberof Calendar\n */\n\n/**\n * Calendar Item Update Event\n * Emitted when a calendar item has been deleted\n * @event calendar:meeting:delete\n * @instance\n * @memberof Calendar\n */\n\n/**\n * Calendar Registered Event\n * Emitted when the calendar instance has been registered and listening\n * @event calendar:registered\n * @instance\n * @memberof Calendar\n */\n\n/**\n * Calendar Registered Event\n * Emitted when the calendar instance has been registered and listening\n * @event calendar:unregistered\n * @instance\n * @memberof Calendar\n */\nimport {isArray} from 'lodash';\nimport {base64} from '@webex/common';\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport CalendarCollection from './collection';\nimport {\n CALENDAR_REGISTERED,\n CALENDAR_UNREGISTERED,\n CALENDAR_DELETE,\n CALENDAR_CREATE,\n CALENDAR_UPDATED,\n} from './constants';\n\nimport EncryptHelper from './calendar.encrypt.helper';\nimport DecryptHelper from './calendar.decrypt.helper';\n\nconst Calendar = WebexPlugin.extend({\n namespace: 'Calendar',\n\n /**\n * registered value indicating events registration is successful\n * @instance\n * @type {Boolean}\n * @memberof Calendar\n */\n registered: false,\n\n /**\n * Cache all rpc event request locally\n * */\n rpcEventRequests: [],\n\n /**\n * Cache KMS encryptionKeyUrl\n * */\n encryptionKeyUrl: null,\n\n /**\n * WebexPlugin initialize method. This triggers once Webex has completed its\n * initialization workflow.\n *\n * If the plugin is meant to perform startup actions, place them in this\n * `initialize()` method instead of the `constructor()` method.\n * @returns {void}\n */\n initialize() {\n // Used to perform actions after webex is fully qualified and ready for\n // operation.\n this.listenToOnce(this.webex, 'ready', () => {\n // Pre-fetch a KMS encryption key url to improve performance\n this.webex.internal.encryption.kms.createUnboundKeys({count: 1}).then((keys) => {\n const key = isArray(keys) ? keys[0] : keys;\n this.encryptionKeyUrl = key ? key.uri : null;\n this.logger.info('calendar->bind a KMS encryption key url');\n this.webex.internal.encryption\n .getKey(this.encryptionKeyUrl, {onBehalfOf: null})\n .then((retrievedKey) => {\n this.encryptionKeyUrl = retrievedKey ? retrievedKey.uri : null;\n this.logger.info('calendar->retrieve the KMS encryption key url and cache it');\n });\n });\n });\n },\n\n /**\n * Explicitly sets up the calendar plugin by registering\n * the device, connecting to mercury, and listening for calendar events.\n * @returns {Promise}\n * @public\n * @memberof Calendar\n */\n register() {\n if (!this.webex.canAuthorize) {\n this.logger.error('calendar->register#ERROR, Unable to register, SDK cannot authorize');\n\n return Promise.reject(new Error('SDK cannot authorize'));\n }\n\n if (this.registered) {\n this.logger.info('calendar->register#INFO, Calendar plugin already registered');\n\n return Promise.resolve();\n }\n\n return this.webex.internal.device\n .register()\n .then(() => this.webex.internal.mercury.connect())\n .then(() => {\n this.listenForEvents();\n this.trigger(CALENDAR_REGISTERED);\n this.registered = true;\n })\n .catch((error) => {\n this.logger.error(`calendar->register#ERROR, Unable to register, ${error.message}`);\n\n return Promise.reject(error);\n });\n },\n\n /**\n * Explicitly tears down the calendar plugin by deregistering\n * the device, disconnecting from mercury, and stops listening to calendar events\n *\n * @returns {Promise}\n * @public\n * @memberof Calendar\n */\n unregister() {\n if (!this.registered) {\n this.logger.info('calendar->unregister#INFO, Calendar plugin already unregistered');\n\n return Promise.resolve();\n }\n\n this.stopListeningForEvents();\n\n return this.webex.internal.mercury\n .disconnect()\n .then(() => this.webex.internal.device.unregister())\n .then(() => {\n this.trigger(CALENDAR_UNREGISTERED);\n this.registered = false;\n });\n },\n\n /**\n * registers for calendar events through mercury\n * @returns {undefined}\n * @private\n */\n listenForEvents() {\n // Calendar mercury events listener\n this.webex.internal.mercury.on('event:calendar.meeting.create', (envelope) => {\n this._handleCreate(envelope.data);\n });\n this.webex.internal.mercury.on('event:calendar.meeting.update', (envelope) => {\n this._handleUpdate(envelope.data);\n });\n this.webex.internal.mercury.on('event:calendar.meeting.create.minimal', (envelope) => {\n this._handleCreate(envelope.data);\n });\n this.webex.internal.mercury.on('event:calendar.meeting.update.minimal', (envelope) => {\n this._handleUpdate(envelope.data);\n });\n this.webex.internal.mercury.on('event:calendar.meeting.delete', (envelope) => {\n this._handleDelete(envelope.data);\n });\n this.webex.internal.mercury.on('event:calendar.free_busy', (envelope) => {\n this._handleFreeBusy(envelope.data);\n });\n },\n\n /**\n * unregisteres all the calendar events from mercury\n * @returns {undefined}\n * @private\n */\n stopListeningForEvents() {\n this.webex.internal.mercury.off('event:calendar.meeting.create');\n this.webex.internal.mercury.off('event:calendar.meeting.create.minimal');\n this.webex.internal.mercury.off('event:calendar.meeting.update');\n this.webex.internal.mercury.off('event:calendar.meeting.update.minimal');\n this.webex.internal.mercury.off('event:calendar.meeting.delete');\n this.webex.internal.mercury.off('event:calendar.free_busy');\n },\n\n /**\n * handles update events, triggers after collection updates\n * @param {Object} data\n * @returns {undefined}\n * @private\n */\n _handleUpdate(data) {\n const id = CalendarCollection.set(data.calendarMeetingExternal);\n\n this.trigger(CALENDAR_UPDATED, CalendarCollection.get(id));\n },\n\n /**\n * handles create events, triggers after collection updates\n * @param {Object} data\n * @returns {undefined}\n * @private\n */\n _handleCreate(data) {\n const id = CalendarCollection.set(data.calendarMeetingExternal);\n\n this.trigger(CALENDAR_CREATE, CalendarCollection.get(id));\n },\n\n /**\n * handles delete events, triggers after collection updates\n * @param {Object} data\n * @returns {undefined}\n * @private\n */\n _handleDelete(data) {\n const item = CalendarCollection.remove(data.calendarMeetingExternal.id);\n\n this.trigger(CALENDAR_DELETE, item);\n },\n\n /**\n * handles free_busy events\n * @param {Object} data\n * @returns {undefined}\n * @private\n */\n _handleFreeBusy(data) {\n DecryptHelper.decryptFreeBusyResponse(this, data).then(() => {\n let response = {};\n if (data && data.calendarFreeBusyScheduleResponse) {\n response = data.calendarFreeBusyScheduleResponse;\n }\n if (response && response.requestId && response.requestId in this.rpcEventRequests) {\n this.logger.log(\n `webex.internal.calendar - receive requests, requestId: ${response.requestId}`\n );\n delete response.encryptionKeyUrl;\n const {resolve} = this.rpcEventRequests[response.requestId];\n resolve(response);\n delete this.rpcEventRequests[response.requestId];\n } else {\n this.logger.log('webex.internal.calendar - receive other requests.');\n }\n });\n },\n\n /**\n * Retrieves a collection of calendars based on the request parameters\n * Defaults to 1 day before and 7 days ahead\n * @param {Object} options\n * @param {Date} options.fromDate the start of the time range\n * @param {Date} options.toDate the end of the time range\n * @returns {Promise} Resolves with an array of calendars\n */\n syncCalendar(options = {fromDate: this.config.fromDate, toDate: this.config.toDate}) {\n return this.list({fromDate: options.fromDate, toDate: options.toDate}).then((res) => {\n CalendarCollection.setAll(res);\n\n return CalendarCollection.getAll();\n });\n },\n /**\n * get the calendar item that has a matching value\n * @param {String} key meeting property\n * @param {Any} value the meeting property to match\n * @returns {Object}\n */\n getByType(key, value) {\n if (['spaceURI', 'spaceMeetURL', 'conversationId'].includes(key)) {\n return CalendarCollection.getBy(key, value);\n }\n throw new Error('key must be one of, spaceURI, spaceMeetURL, or conversationId');\n },\n\n /**\n * gets all the calendar items that have been populated\n * @returns {Object}\n */\n getAll() {\n return CalendarCollection.getAll();\n },\n\n /**\n * Decrypts an encrypted incoming calendar event\n * @param {Object} event\n * @returns {Promise} Resolves with a decrypted calendar event\n */\n processMeetingEvent(event) {\n return this.webex.transform('inbound', event).then(() => event);\n },\n\n /**\n * Retrieves an array of meeting participants for the meeting participantsUrl\n * @param {String} participantsUrl\n * @returns {Promise} Resolves with an object of meeting participants\n */\n getParticipants(participantsUrl) {\n return this.request({\n method: 'GET',\n uri: participantsUrl,\n });\n },\n\n /**\n * get meeting notes using notesUrl from meeting object.\n * @param {String} notesUrl\n * @returns {Promise} Resolves with an object of meeting notes\n */\n getNotesByUrl(notesUrl) {\n return this.request({\n method: 'GET',\n uri: notesUrl,\n });\n },\n\n /**\n * Retrieves a collection of meetings based on the request parameters\n * @param {String} id\n * @returns {Promise} Resolves with an object of meeting notes\n */\n getNotes(id) {\n return this.request({\n method: 'GET',\n service: 'calendar',\n resource: `calendarEvents/${base64.encode(id)}/notes`,\n });\n },\n\n /**\n * Retrieves a collection of meetings based on the request parameters\n * @param {Object} options\n * @param {Date} options.fromDate the start of the time range\n * @param {Date} options.toDate the end of the time range\n * @returns {Promise} Resolves with an array of meetings\n */\n list(options) {\n options = options || {};\n\n return this.webex\n .request({\n method: 'GET',\n service: 'calendar',\n resource: 'calendarEvents',\n qs: options,\n })\n .then((res) => {\n const meetingObjects = res.body.items;\n const promises = [];\n\n meetingObjects.forEach((meeting) => {\n if (!meeting.encryptedParticipants) {\n promises.push(\n this.getParticipants(meeting.participantsUrl).then((notesResponse) => {\n meeting.encryptedParticipants = notesResponse.body.encryptedParticipants;\n })\n );\n }\n });\n\n return Promise.all(promises).then(() => meetingObjects);\n });\n },\n\n /**\n * Create calendar event\n * @param {object} [data] meeting payload data\n * @param {object} [query] the query parameters for specific usage\n * @returns {Promise} Resolves with creating calendar event response\n * */\n createCalendarEvent(data, query) {\n return EncryptHelper.encryptCalendarEventRequest(this, data).then(() =>\n this.request({\n method: 'POST',\n service: 'calendar',\n body: data,\n resource: 'calendarEvents/sync',\n qs: query || {},\n })\n );\n },\n\n /**\n * Update calendar event\n * @param {string} [id] calendar event id\n * @param {object} [data] meeting payload data\n * @param {object} [query] the query parameters for specific usage\n * @returns {Promise} Resolves with updating calendar event response\n * */\n updateCalendarEvent(id, data, query) {\n return EncryptHelper.encryptCalendarEventRequest(this, data).then(() =>\n this.request({\n method: 'PATCH',\n service: 'calendar',\n body: data,\n resource: `calendarEvents/${base64.encode(id)}/sync`,\n qs: query || {},\n })\n );\n },\n\n /**\n * Delete calendar event\n * @param {string} [id] calendar event id\n * @param {object} [query] the query parameters for specific usage\n * @returns {Promise} Resolves with deleting calendar event response\n * */\n deleteCalendarEvent(id, query) {\n return this.request({\n method: 'DELETE',\n service: 'calendar',\n resource: `calendarEvents/${base64.encode(id)}/sync`,\n qs: query || {},\n });\n },\n\n /**\n * @typedef QuerySchedulerDataOptions\n * @param {string} [siteName] it is site full url, must have. Example: ccctest.dmz.webex.com\n * @param {string} [id] it is seriesOrOccurrenceId. If present, the series/occurrence meeting ID to fetch data for.\n * Example: 040000008200E00074C5B7101A82E008000000004A99F11A0841D9010000000000000000100000009EE499D4A71C1A46B51494C70EC7BFE5\n * @param {string} [clientMeetingId] If present, the client meeting UUID to fetch data for.\n * Example: 7f318aa9-887c-6e94-802a-8dc8e6eb1a0a\n * @param {string} [scheduleTemplateId] it template id.\n * @param {string} [sessionTypeId] it session type id.\n * @param {string} [organizerCIUserId] required in schedule-on-behalf case. It is the organizer's CI UUID.\n * @param {boolean} [usmPreference]\n * @param {string} [webexMeetingId] webex side meeting UUID\n * @param {string} [eventId] event ID.\n * @param {string} [icalUid] icalendar UUID.\n * @param {string} [thirdPartyType] third part type, such as: Microsoft\n */\n /**\n * Get scheduler data from calendar service\n * @param {QuerySchedulerDataOptions} [query] the command parameters for fetching scheduler data.\n * @returns {Promise} Resolves with a decrypted scheduler data\n * */\n getSchedulerData(query) {\n return this.request({\n method: 'GET',\n service: 'calendar',\n resource: 'schedulerData',\n qs: query || {},\n }).then((response) => {\n return DecryptHelper.decryptSchedulerDataResponse(this, response.body).then(() => response);\n });\n },\n\n /**\n * Get free busy status from calendar service\n * @param {Object} [data] the command parameters for fetching free busy status.\n * @param {object} [query] the query parameters for specific usage\n * @returns {Promise} Resolves with a decrypted response\n * */\n getFreeBusy(data, query) {\n return EncryptHelper.encryptFreeBusyRequest(this, data)\n .then(() => {\n return this.request({\n method: 'POST',\n service: 'calendar',\n body: data,\n resource: 'freebusy',\n qs: query || {},\n });\n })\n .then(() => {\n return new Promise((resolve, reject) => {\n this.rpcEventRequests[data.requestId] = {resolve, reject};\n });\n })\n .catch((error) => {\n throw error;\n });\n },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MACpB,OAAOF,wBAAa,CAAC0D,4BAA4B,CAACD,MAAI,EAAEvD,QAAQ,CAACqC,IAAI,CAAC,CAAC5F,IAAI,CAAC;QAAA,OAAMuD,QAAQ;MAAA,EAAC;IAC7F,CAAC,CAAC;EACJ,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEyD,WAAW,WAAAA,YAAC3E,IAAI,EAAEiE,KAAK,EAAE;IAAA,IAAAW,OAAA;IACvB,OAAOT,wBAAa,CAACU,sBAAsB,CAAC,IAAI,EAAE7E,IAAI,CAAC,CACpDrC,IAAI,CAAC,YAAM;MACV,OAAOiH,OAAI,CAACjC,OAAO,CAAC;QAClBC,MAAM,EAAE,MAAM;QACdI,OAAO,EAAE,UAAU;QACnBO,IAAI,EAAEvD,IAAI;QACViD,QAAQ,EAAE,UAAU;QACpBI,EAAE,EAAEY,KAAK,IAAI,CAAC;MAChB,CAAC,CAAC;IACJ,CAAC,CAAC,CACDtG,IAAI,CAAC,YAAM;MACV,OAAO,IAAAc,QAAA,CAAAC,OAAA,CAAY,UAACG,OAAO,EAAEF,MAAM,EAAK;QACtCiG,OAAI,CAAC5H,gBAAgB,CAACgD,IAAI,CAACoB,SAAS,CAAC,GAAG;UAACvC,OAAO,EAAPA,OAAO;UAAEF,MAAM,EAANA;QAAM,CAAC;MAC3D,CAAC,CAAC;IACJ,CAAC,CAAC,CACDS,KAAK,CAAC,UAACZ,KAAK,EAAK;MAChB,MAAMA,KAAK;IACb,CAAC,CAAC;EACN,CAAC;EAAAsG,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAtG,OAAA,GAEY/B,QAAQ"}
|
|
1
|
+
{"version":3,"names":["_lodash","require","_common","_webexCore","_collection","_interopRequireDefault","_constants","_calendarEncrypt","_calendarDecrypt","Calendar","WebexPlugin","extend","namespace","registered","rpcEventRequests","encryptionKeyUrl","prefetchEncryptionKey","_this","webex","canAuthorize","listenToOnce","credentials","isUnverifiedGuest","internal","encryption","kms","createUnboundKeys","count","then","keys","key","isArray","uri","logger","info","getKey","onBehalfOf","retrievedKey","initialize","_this2","register","_this3","error","_promise","default","reject","Error","resolve","device","mercury","connect","listenForEvents","trigger","CALENDAR_REGISTERED","catch","concat","message","unregister","_this4","stopListeningForEvents","disconnect","CALENDAR_UNREGISTERED","_this5","on","envelope","_handleCreate","data","_handleUpdate","_handleDelete","_handleFreeBusy","off","id","CalendarCollection","set","calendarMeetingExternal","CALENDAR_UPDATED","get","CALENDAR_CREATE","item","remove","CALENDAR_DELETE","_this6","DecryptHelper","decryptFreeBusyResponse","response","calendarFreeBusyScheduleResponse","requestId","log","syncCalendar","options","arguments","length","undefined","fromDate","config","toDate","list","res","setAll","getAll","getByType","value","includes","getBy","processMeetingEvent","event","transform","getParticipants","participantsUrl","request","method","getNotesByUrl","notesUrl","getNotes","service","resource","base64","encode","_this7","qs","meetingObjects","body","items","promises","forEach","meeting","encryptedParticipants","push","notesResponse","all","createCalendarEvent","query","_this8","EncryptHelper","encryptCalendarEventRequest","updateCalendarEvent","_this9","deleteCalendarEvent","getSchedulerData","_this10","decryptSchedulerDataResponse","getFreeBusy","_this11","encryptFreeBusyRequest","version","_default","exports"],"sources":["calendar.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * Calendar Item Create Event\n * Emitted when a calendar item has been added\n * @event calendar:meeting:create\n * @instance\n * @memberof Calendar\n */\n\n/**\n * Calendar Item Update Event\n * Emitted when a calendar item has been updated\n * @event calendar:meeting:update\n * @instance\n * @memberof Calendar\n */\n\n/**\n * Calendar Item Update Event\n * Emitted when a calendar item has been deleted\n * @event calendar:meeting:delete\n * @instance\n * @memberof Calendar\n */\n\n/**\n * Calendar Registered Event\n * Emitted when the calendar instance has been registered and listening\n * @event calendar:registered\n * @instance\n * @memberof Calendar\n */\n\n/**\n * Calendar Registered Event\n * Emitted when the calendar instance has been registered and listening\n * @event calendar:unregistered\n * @instance\n * @memberof Calendar\n */\nimport {isArray} from 'lodash';\nimport {base64} from '@webex/common';\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport CalendarCollection from './collection';\nimport {\n CALENDAR_REGISTERED,\n CALENDAR_UNREGISTERED,\n CALENDAR_DELETE,\n CALENDAR_CREATE,\n CALENDAR_UPDATED,\n} from './constants';\n\nimport EncryptHelper from './calendar.encrypt.helper';\nimport DecryptHelper from './calendar.decrypt.helper';\n\nconst Calendar = WebexPlugin.extend({\n namespace: 'Calendar',\n\n /**\n * registered value indicating events registration is successful\n * @instance\n * @type {Boolean}\n * @memberof Calendar\n */\n registered: false,\n\n /**\n * Cache all rpc event request locally\n * */\n rpcEventRequests: [],\n\n /**\n * Cache KMS encryptionKeyUrl\n * */\n encryptionKeyUrl: null,\n\n /**\n * Pre-fetch a KMS encryption key url to improve performance.\n * Waits for the user to be authorized and skips if an unverified guest.\n * @private\n * @returns {void}\n */\n prefetchEncryptionKey() {\n if (!this.webex.canAuthorize) {\n this.listenToOnce(this.webex, 'change:canAuthorize', () => {\n this.prefetchEncryptionKey();\n });\n\n return;\n }\n\n if (this.webex.credentials.isUnverifiedGuest) {\n return;\n }\n\n this.webex.internal.encryption.kms.createUnboundKeys({count: 1}).then((keys) => {\n const key = isArray(keys) ? keys[0] : keys;\n this.encryptionKeyUrl = key ? key.uri : null;\n this.logger.info('calendar->bind a KMS encryption key url');\n this.webex.internal.encryption\n .getKey(this.encryptionKeyUrl, {onBehalfOf: null})\n .then((retrievedKey) => {\n this.encryptionKeyUrl = retrievedKey ? retrievedKey.uri : null;\n this.logger.info('calendar->retrieve the KMS encryption key url and cache it');\n });\n });\n },\n\n /**\n * WebexPlugin initialize method. This triggers once Webex has completed its\n * initialization workflow.\n *\n * If the plugin is meant to perform startup actions, place them in this\n * `initialize()` method instead of the `constructor()` method.\n * @private\n * @returns {void}\n */\n initialize() {\n // Used to perform actions after webex is fully qualified and ready for\n // operation.\n this.listenToOnce(this.webex, 'ready', () => {\n this.prefetchEncryptionKey();\n });\n },\n\n /**\n * Explicitly sets up the calendar plugin by registering\n * the device, connecting to mercury, and listening for calendar events.\n * @returns {Promise}\n * @public\n * @memberof Calendar\n */\n register() {\n if (!this.webex.canAuthorize) {\n this.logger.error('calendar->register#ERROR, Unable to register, SDK cannot authorize');\n\n return Promise.reject(new Error('SDK cannot authorize'));\n }\n\n if (this.registered) {\n this.logger.info('calendar->register#INFO, Calendar plugin already registered');\n\n return Promise.resolve();\n }\n\n return this.webex.internal.device\n .register()\n .then(() => this.webex.internal.mercury.connect())\n .then(() => {\n this.listenForEvents();\n this.trigger(CALENDAR_REGISTERED);\n this.registered = true;\n })\n .catch((error) => {\n this.logger.error(`calendar->register#ERROR, Unable to register, ${error.message}`);\n\n return Promise.reject(error);\n });\n },\n\n /**\n * Explicitly tears down the calendar plugin by deregistering\n * the device, disconnecting from mercury, and stops listening to calendar events\n *\n * @returns {Promise}\n * @public\n * @memberof Calendar\n */\n unregister() {\n if (!this.registered) {\n this.logger.info('calendar->unregister#INFO, Calendar plugin already unregistered');\n\n return Promise.resolve();\n }\n\n this.stopListeningForEvents();\n\n return this.webex.internal.mercury\n .disconnect()\n .then(() => this.webex.internal.device.unregister())\n .then(() => {\n this.trigger(CALENDAR_UNREGISTERED);\n this.registered = false;\n });\n },\n\n /**\n * registers for calendar events through mercury\n * @returns {undefined}\n * @private\n */\n listenForEvents() {\n // Calendar mercury events listener\n this.webex.internal.mercury.on('event:calendar.meeting.create', (envelope) => {\n this._handleCreate(envelope.data);\n });\n this.webex.internal.mercury.on('event:calendar.meeting.update', (envelope) => {\n this._handleUpdate(envelope.data);\n });\n this.webex.internal.mercury.on('event:calendar.meeting.create.minimal', (envelope) => {\n this._handleCreate(envelope.data);\n });\n this.webex.internal.mercury.on('event:calendar.meeting.update.minimal', (envelope) => {\n this._handleUpdate(envelope.data);\n });\n this.webex.internal.mercury.on('event:calendar.meeting.delete', (envelope) => {\n this._handleDelete(envelope.data);\n });\n this.webex.internal.mercury.on('event:calendar.free_busy', (envelope) => {\n this._handleFreeBusy(envelope.data);\n });\n },\n\n /**\n * unregisteres all the calendar events from mercury\n * @returns {undefined}\n * @private\n */\n stopListeningForEvents() {\n this.webex.internal.mercury.off('event:calendar.meeting.create');\n this.webex.internal.mercury.off('event:calendar.meeting.create.minimal');\n this.webex.internal.mercury.off('event:calendar.meeting.update');\n this.webex.internal.mercury.off('event:calendar.meeting.update.minimal');\n this.webex.internal.mercury.off('event:calendar.meeting.delete');\n this.webex.internal.mercury.off('event:calendar.free_busy');\n },\n\n /**\n * handles update events, triggers after collection updates\n * @param {Object} data\n * @returns {undefined}\n * @private\n */\n _handleUpdate(data) {\n const id = CalendarCollection.set(data.calendarMeetingExternal);\n\n this.trigger(CALENDAR_UPDATED, CalendarCollection.get(id));\n },\n\n /**\n * handles create events, triggers after collection updates\n * @param {Object} data\n * @returns {undefined}\n * @private\n */\n _handleCreate(data) {\n const id = CalendarCollection.set(data.calendarMeetingExternal);\n\n this.trigger(CALENDAR_CREATE, CalendarCollection.get(id));\n },\n\n /**\n * handles delete events, triggers after collection updates\n * @param {Object} data\n * @returns {undefined}\n * @private\n */\n _handleDelete(data) {\n const item = CalendarCollection.remove(data.calendarMeetingExternal.id);\n\n this.trigger(CALENDAR_DELETE, item);\n },\n\n /**\n * handles free_busy events\n * @param {Object} data\n * @returns {undefined}\n * @private\n */\n _handleFreeBusy(data) {\n DecryptHelper.decryptFreeBusyResponse(this, data).then(() => {\n let response = {};\n if (data && data.calendarFreeBusyScheduleResponse) {\n response = data.calendarFreeBusyScheduleResponse;\n }\n if (response && response.requestId && response.requestId in this.rpcEventRequests) {\n this.logger.log(\n `webex.internal.calendar - receive requests, requestId: ${response.requestId}`\n );\n delete response.encryptionKeyUrl;\n const {resolve} = this.rpcEventRequests[response.requestId];\n resolve(response);\n delete this.rpcEventRequests[response.requestId];\n } else {\n this.logger.log('webex.internal.calendar - receive other requests.');\n }\n });\n },\n\n /**\n * Retrieves a collection of calendars based on the request parameters\n * Defaults to 1 day before and 7 days ahead\n * @param {Object} options\n * @param {Date} options.fromDate the start of the time range\n * @param {Date} options.toDate the end of the time range\n * @returns {Promise} Resolves with an array of calendars\n */\n syncCalendar(options = {fromDate: this.config.fromDate, toDate: this.config.toDate}) {\n return this.list({fromDate: options.fromDate, toDate: options.toDate}).then((res) => {\n CalendarCollection.setAll(res);\n\n return CalendarCollection.getAll();\n });\n },\n /**\n * get the calendar item that has a matching value\n * @param {String} key meeting property\n * @param {Any} value the meeting property to match\n * @returns {Object}\n */\n getByType(key, value) {\n if (['spaceURI', 'spaceMeetURL', 'conversationId'].includes(key)) {\n return CalendarCollection.getBy(key, value);\n }\n throw new Error('key must be one of, spaceURI, spaceMeetURL, or conversationId');\n },\n\n /**\n * gets all the calendar items that have been populated\n * @returns {Object}\n */\n getAll() {\n return CalendarCollection.getAll();\n },\n\n /**\n * Decrypts an encrypted incoming calendar event\n * @param {Object} event\n * @returns {Promise} Resolves with a decrypted calendar event\n */\n processMeetingEvent(event) {\n return this.webex.transform('inbound', event).then(() => event);\n },\n\n /**\n * Retrieves an array of meeting participants for the meeting participantsUrl\n * @param {String} participantsUrl\n * @returns {Promise} Resolves with an object of meeting participants\n */\n getParticipants(participantsUrl) {\n return this.request({\n method: 'GET',\n uri: participantsUrl,\n });\n },\n\n /**\n * get meeting notes using notesUrl from meeting object.\n * @param {String} notesUrl\n * @returns {Promise} Resolves with an object of meeting notes\n */\n getNotesByUrl(notesUrl) {\n return this.request({\n method: 'GET',\n uri: notesUrl,\n });\n },\n\n /**\n * Retrieves a collection of meetings based on the request parameters\n * @param {String} id\n * @returns {Promise} Resolves with an object of meeting notes\n */\n getNotes(id) {\n return this.request({\n method: 'GET',\n service: 'calendar',\n resource: `calendarEvents/${base64.encode(id)}/notes`,\n });\n },\n\n /**\n * Retrieves a collection of meetings based on the request parameters\n * @param {Object} options\n * @param {Date} options.fromDate the start of the time range\n * @param {Date} options.toDate the end of the time range\n * @returns {Promise} Resolves with an array of meetings\n */\n list(options) {\n options = options || {};\n\n return this.webex\n .request({\n method: 'GET',\n service: 'calendar',\n resource: 'calendarEvents',\n qs: options,\n })\n .then((res) => {\n const meetingObjects = res.body.items;\n const promises = [];\n\n meetingObjects.forEach((meeting) => {\n if (!meeting.encryptedParticipants) {\n promises.push(\n this.getParticipants(meeting.participantsUrl).then((notesResponse) => {\n meeting.encryptedParticipants = notesResponse.body.encryptedParticipants;\n })\n );\n }\n });\n\n return Promise.all(promises).then(() => meetingObjects);\n });\n },\n\n /**\n * Create calendar event\n * @param {object} [data] meeting payload data\n * @param {object} [query] the query parameters for specific usage\n * @returns {Promise} Resolves with creating calendar event response\n * */\n createCalendarEvent(data, query) {\n return EncryptHelper.encryptCalendarEventRequest(this, data).then(() =>\n this.request({\n method: 'POST',\n service: 'calendar',\n body: data,\n resource: 'calendarEvents/sync',\n qs: query || {},\n })\n );\n },\n\n /**\n * Update calendar event\n * @param {string} [id] calendar event id\n * @param {object} [data] meeting payload data\n * @param {object} [query] the query parameters for specific usage\n * @returns {Promise} Resolves with updating calendar event response\n * */\n updateCalendarEvent(id, data, query) {\n return EncryptHelper.encryptCalendarEventRequest(this, data).then(() =>\n this.request({\n method: 'PATCH',\n service: 'calendar',\n body: data,\n resource: `calendarEvents/${base64.encode(id)}/sync`,\n qs: query || {},\n })\n );\n },\n\n /**\n * Delete calendar event\n * @param {string} [id] calendar event id\n * @param {object} [query] the query parameters for specific usage\n * @returns {Promise} Resolves with deleting calendar event response\n * */\n deleteCalendarEvent(id, query) {\n return this.request({\n method: 'DELETE',\n service: 'calendar',\n resource: `calendarEvents/${base64.encode(id)}/sync`,\n qs: query || {},\n });\n },\n\n /**\n * @typedef QuerySchedulerDataOptions\n * @param {string} [siteName] it is site full url, must have. Example: ccctest.dmz.webex.com\n * @param {string} [id] it is seriesOrOccurrenceId. If present, the series/occurrence meeting ID to fetch data for.\n * Example: 040000008200E00074C5B7101A82E008000000004A99F11A0841D9010000000000000000100000009EE499D4A71C1A46B51494C70EC7BFE5\n * @param {string} [clientMeetingId] If present, the client meeting UUID to fetch data for.\n * Example: 7f318aa9-887c-6e94-802a-8dc8e6eb1a0a\n * @param {string} [scheduleTemplateId] it template id.\n * @param {string} [sessionTypeId] it session type id.\n * @param {string} [organizerCIUserId] required in schedule-on-behalf case. It is the organizer's CI UUID.\n * @param {boolean} [usmPreference]\n * @param {string} [webexMeetingId] webex side meeting UUID\n * @param {string} [eventId] event ID.\n * @param {string} [icalUid] icalendar UUID.\n * @param {string} [thirdPartyType] third part type, such as: Microsoft\n */\n /**\n * Get scheduler data from calendar service\n * @param {QuerySchedulerDataOptions} [query] the command parameters for fetching scheduler data.\n * @returns {Promise} Resolves with a decrypted scheduler data\n * */\n getSchedulerData(query) {\n return this.request({\n method: 'GET',\n service: 'calendar',\n resource: 'schedulerData',\n qs: query || {},\n }).then((response) => {\n return DecryptHelper.decryptSchedulerDataResponse(this, response.body).then(() => response);\n });\n },\n\n /**\n * Get free busy status from calendar service\n * @param {Object} [data] the command parameters for fetching free busy status.\n * @param {object} [query] the query parameters for specific usage\n * @returns {Promise} Resolves with a decrypted response\n * */\n getFreeBusy(data, query) {\n return EncryptHelper.encryptFreeBusyRequest(this, data)\n .then(() => {\n return this.request({\n method: 'POST',\n service: 'calendar',\n body: data,\n resource: 'freebusy',\n qs: query || {},\n });\n })\n .then(() => {\n return new Promise((resolve, reject) => {\n this.rpcEventRequests[data.requestId] = {resolve, reject};\n });\n })\n .catch((error) => {\n throw error;\n });\n },\n});\n\nexport default Calendar;\n"],"mappings":";;;;;;;;;AA2CA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAQA,IAAAM,gBAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,gBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAzDA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y": "^0.0.0",
|
|
27
27
|
"@webex/legacy-tools": "^0.0.0",
|
|
28
|
-
"@webex/test-helper-chai": "^2.60.0-next.
|
|
29
|
-
"@webex/test-helper-mocha": "^2.60.0-next.
|
|
30
|
-
"@webex/test-helper-mock-webex": "^2.60.0-next.
|
|
31
|
-
"@webex/test-helper-retry": "^2.60.0-next.
|
|
32
|
-
"@webex/test-helper-test-users": "^2.60.0-next.
|
|
28
|
+
"@webex/test-helper-chai": "^2.60.0-next.3",
|
|
29
|
+
"@webex/test-helper-mocha": "^2.60.0-next.3",
|
|
30
|
+
"@webex/test-helper-mock-webex": "^2.60.0-next.3",
|
|
31
|
+
"@webex/test-helper-retry": "^2.60.0-next.3",
|
|
32
|
+
"@webex/test-helper-test-users": "^2.60.0-next.3",
|
|
33
33
|
"eslint": "^8.24.0",
|
|
34
34
|
"prettier": "^2.7.1",
|
|
35
35
|
"sinon": "^9.2.4"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@webex/internal-plugin-conversation": "^2.60.0-next.
|
|
39
|
-
"@webex/internal-plugin-device": "^2.60.0-next.
|
|
40
|
-
"@webex/internal-plugin-encryption": "^2.60.0-next.
|
|
41
|
-
"@webex/webex-core": "^2.60.0-next.
|
|
38
|
+
"@webex/internal-plugin-conversation": "^2.60.0-next.3",
|
|
39
|
+
"@webex/internal-plugin-device": "^2.60.0-next.3",
|
|
40
|
+
"@webex/internal-plugin-encryption": "^2.60.0-next.3",
|
|
41
|
+
"@webex/webex-core": "^2.60.0-next.3",
|
|
42
42
|
"lodash": "^4.17.21",
|
|
43
43
|
"uuid": "^3.3.2"
|
|
44
44
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"test:style": "eslint ./src/**/*.*",
|
|
53
53
|
"test:unit": "webex-legacy-tools test --unit --runner jest"
|
|
54
54
|
},
|
|
55
|
-
"version": "2.60.0-next.
|
|
55
|
+
"version": "2.60.0-next.3"
|
|
56
56
|
}
|
package/src/calendar.js
CHANGED
|
@@ -78,30 +78,52 @@ const Calendar = WebexPlugin.extend({
|
|
|
78
78
|
* */
|
|
79
79
|
encryptionKeyUrl: null,
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Pre-fetch a KMS encryption key url to improve performance.
|
|
83
|
+
* Waits for the user to be authorized and skips if an unverified guest.
|
|
84
|
+
* @private
|
|
85
|
+
* @returns {void}
|
|
86
|
+
*/
|
|
87
|
+
prefetchEncryptionKey() {
|
|
88
|
+
if (!this.webex.canAuthorize) {
|
|
89
|
+
this.listenToOnce(this.webex, 'change:canAuthorize', () => {
|
|
90
|
+
this.prefetchEncryptionKey();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (this.webex.credentials.isUnverifiedGuest) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
this.webex.internal.encryption.kms.createUnboundKeys({count: 1}).then((keys) => {
|
|
101
|
+
const key = isArray(keys) ? keys[0] : keys;
|
|
102
|
+
this.encryptionKeyUrl = key ? key.uri : null;
|
|
103
|
+
this.logger.info('calendar->bind a KMS encryption key url');
|
|
104
|
+
this.webex.internal.encryption
|
|
105
|
+
.getKey(this.encryptionKeyUrl, {onBehalfOf: null})
|
|
106
|
+
.then((retrievedKey) => {
|
|
107
|
+
this.encryptionKeyUrl = retrievedKey ? retrievedKey.uri : null;
|
|
108
|
+
this.logger.info('calendar->retrieve the KMS encryption key url and cache it');
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
|
|
81
113
|
/**
|
|
82
114
|
* WebexPlugin initialize method. This triggers once Webex has completed its
|
|
83
115
|
* initialization workflow.
|
|
84
116
|
*
|
|
85
117
|
* If the plugin is meant to perform startup actions, place them in this
|
|
86
118
|
* `initialize()` method instead of the `constructor()` method.
|
|
119
|
+
* @private
|
|
87
120
|
* @returns {void}
|
|
88
121
|
*/
|
|
89
122
|
initialize() {
|
|
90
123
|
// Used to perform actions after webex is fully qualified and ready for
|
|
91
124
|
// operation.
|
|
92
125
|
this.listenToOnce(this.webex, 'ready', () => {
|
|
93
|
-
|
|
94
|
-
this.webex.internal.encryption.kms.createUnboundKeys({count: 1}).then((keys) => {
|
|
95
|
-
const key = isArray(keys) ? keys[0] : keys;
|
|
96
|
-
this.encryptionKeyUrl = key ? key.uri : null;
|
|
97
|
-
this.logger.info('calendar->bind a KMS encryption key url');
|
|
98
|
-
this.webex.internal.encryption
|
|
99
|
-
.getKey(this.encryptionKeyUrl, {onBehalfOf: null})
|
|
100
|
-
.then((retrievedKey) => {
|
|
101
|
-
this.encryptionKeyUrl = retrievedKey ? retrievedKey.uri : null;
|
|
102
|
-
this.logger.info('calendar->retrieve the KMS encryption key url and cache it');
|
|
103
|
-
});
|
|
104
|
-
});
|
|
126
|
+
this.prefetchEncryptionKey();
|
|
105
127
|
});
|
|
106
128
|
},
|
|
107
129
|
|
|
@@ -58,6 +58,55 @@ describe('internal-plugin-calendar', () => {
|
|
|
58
58
|
};
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
+
describe('Private API', () => {
|
|
62
|
+
describe('#prefetchEncryptionKey', () => {
|
|
63
|
+
it('waits for the ability to authorize before doing anything', () => {
|
|
64
|
+
webex.canAuthorize = false;
|
|
65
|
+
|
|
66
|
+
webex.internal.calendar.prefetchEncryptionKey();
|
|
67
|
+
|
|
68
|
+
assert.notCalled(webex.internal.encryption.kms.createUnboundKeys);
|
|
69
|
+
|
|
70
|
+
// Behaviour when the user can authorize is tested elsewhere, so just ensure it gets called again
|
|
71
|
+
const prefetchEncryptionKeyStub = sinon.stub(webex.internal.calendar, 'prefetchEncryptionKey');
|
|
72
|
+
|
|
73
|
+
webex.trigger('change:canAuthorize');
|
|
74
|
+
|
|
75
|
+
assert.calledOnce(prefetchEncryptionKeyStub);
|
|
76
|
+
assert.calledWith(prefetchEncryptionKeyStub);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('does nothing when the current user is an unverified guest', () => {
|
|
80
|
+
webex.credentials.isUnverifiedGuest = true;
|
|
81
|
+
|
|
82
|
+
webex.internal.calendar.prefetchEncryptionKey();
|
|
83
|
+
|
|
84
|
+
assert.notCalled(webex.internal.encryption.kms.createUnboundKeys);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('creates an encryption key when the current user can authorize', () => {
|
|
88
|
+
webex.internal.calendar.prefetchEncryptionKey();
|
|
89
|
+
|
|
90
|
+
assert.calledOnce(webex.internal.encryption.kms.createUnboundKeys);
|
|
91
|
+
assert.calledWith(webex.internal.encryption.kms.createUnboundKeys, {count: 1});
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe('#initialize', () => {
|
|
96
|
+
it('adds relevant handlers when webex is ready', () => {
|
|
97
|
+
const prefetchEncryptionKeyStub = sinon.stub(webex.internal.calendar, 'prefetchEncryptionKey');
|
|
98
|
+
|
|
99
|
+
assert.notCalled(prefetchEncryptionKeyStub);
|
|
100
|
+
|
|
101
|
+
// Initialize should have already run, so there should be an event handler already
|
|
102
|
+
webex.trigger('ready');
|
|
103
|
+
|
|
104
|
+
assert.calledOnce(prefetchEncryptionKeyStub);
|
|
105
|
+
assert.calledWith(prefetchEncryptionKeyStub);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
61
110
|
describe('Public Api Contract', () => {
|
|
62
111
|
describe('#register()', () => {
|
|
63
112
|
it('on calendar register call mercury registration', async () => {
|