@webex/internal-plugin-calendar 3.0.0-beta.9 → 3.0.0-bnr.0

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 CHANGED
@@ -21,14 +21,12 @@ npm install --save @webex/internal-plugin-calendar
21
21
  ## Usage
22
22
 
23
23
  ```js
24
-
25
24
  import '@webex/internal-plugin-calendar';
26
25
 
27
26
  import WebexCore from '@webex/webex-core';
28
27
 
29
28
  const webex = new WebexCore();
30
- webex.internal.calendar.WHATEVER
31
-
29
+ webex.internal.calendar.WHATEVER;
32
30
  ```
33
31
 
34
32
  ## Maintainers
package/dist/calendar.js CHANGED
@@ -1,52 +1,43 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
-
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
8
  exports.default = void 0;
12
-
13
9
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
14
-
15
10
  var _btoa = _interopRequireDefault(require("btoa"));
16
-
17
11
  var _webexCore = require("@webex/webex-core");
18
-
19
12
  var _collection = _interopRequireDefault(require("./collection"));
20
-
21
13
  var _constants = require("./constants");
22
-
23
14
  /*!
24
15
  * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
25
16
  */
26
17
 
27
18
  /**
28
- * Calendar Item Create Event
29
- * Emitted when a calendar item has been added
30
- * @event calendar:meeting:create
31
- * @instance
32
- * @memberof Calendar
33
- */
19
+ * Calendar Item Create Event
20
+ * Emitted when a calendar item has been added
21
+ * @event calendar:meeting:create
22
+ * @instance
23
+ * @memberof Calendar
24
+ */
34
25
 
35
26
  /**
36
- * Calendar Item Update Event
37
- * Emitted when a calendar item has been updated
38
- * @event calendar:meeting:update
39
- * @instance
40
- * @memberof Calendar
41
- */
27
+ * Calendar Item Update Event
28
+ * Emitted when a calendar item has been updated
29
+ * @event calendar:meeting:update
30
+ * @instance
31
+ * @memberof Calendar
32
+ */
42
33
 
43
34
  /**
44
- * Calendar Item Update Event
45
- * Emitted when a calendar item has been deleted
46
- * @event calendar:meeting:delete
47
- * @instance
48
- * @memberof Calendar
49
- */
35
+ * Calendar Item Update Event
36
+ * Emitted when a calendar item has been deleted
37
+ * @event calendar:meeting:delete
38
+ * @instance
39
+ * @memberof Calendar
40
+ */
50
41
 
51
42
  /**
52
43
  * Calendar Registered Event
@@ -63,9 +54,9 @@ var _constants = require("./constants");
63
54
  * @instance
64
55
  * @memberof Calendar
65
56
  */
57
+
66
58
  var Calendar = _webexCore.WebexPlugin.extend({
67
59
  namespace: 'Calendar',
68
-
69
60
  /**
70
61
  * registered value indicating events registration is successful
71
62
  * @instance
@@ -73,7 +64,6 @@ var Calendar = _webexCore.WebexPlugin.extend({
73
64
  * @memberof Calendar
74
65
  */
75
66
  registered: false,
76
-
77
67
  /**
78
68
  * Explicitly sets up the calendar plugin by registering
79
69
  * the device, connecting to mercury, and listening for calendar events.
@@ -83,32 +73,25 @@ var Calendar = _webexCore.WebexPlugin.extend({
83
73
  */
84
74
  register: function register() {
85
75
  var _this = this;
86
-
87
76
  if (!this.webex.canAuthorize) {
88
77
  this.logger.error('calendar->register#ERROR, Unable to register, SDK cannot authorize');
89
78
  return _promise.default.reject(new Error('SDK cannot authorize'));
90
79
  }
91
-
92
80
  if (this.registered) {
93
81
  this.logger.info('calendar->register#INFO, Calendar plugin already registered');
94
82
  return _promise.default.resolve();
95
83
  }
96
-
97
84
  return this.webex.internal.device.register().then(function () {
98
85
  return _this.webex.internal.mercury.connect();
99
86
  }).then(function () {
100
87
  _this.listenForEvents();
101
-
102
88
  _this.trigger(_constants.CALENDAR_REGISTERED);
103
-
104
89
  _this.registered = true;
105
90
  }).catch(function (error) {
106
91
  _this.logger.error("calendar->register#ERROR, Unable to register, ".concat(error.message));
107
-
108
92
  return _promise.default.reject(error);
109
93
  });
110
94
  },
111
-
112
95
  /**
113
96
  * Explicitly tears down the calendar plugin by deregistering
114
97
  * the device, disconnecting from mercury, and stops listening to calendar events
@@ -119,22 +102,18 @@ var Calendar = _webexCore.WebexPlugin.extend({
119
102
  */
120
103
  unregister: function unregister() {
121
104
  var _this2 = this;
122
-
123
105
  if (!this.registered) {
124
106
  this.logger.info('calendar->unregister#INFO, Calendar plugin already unregistered');
125
107
  return _promise.default.resolve();
126
108
  }
127
-
128
109
  this.stopListeningForEvents();
129
110
  return this.webex.internal.mercury.disconnect().then(function () {
130
111
  return _this2.webex.internal.device.unregister();
131
112
  }).then(function () {
132
113
  _this2.trigger(_constants.CALENDAR_UNREGISTERED);
133
-
134
114
  _this2.registered = false;
135
115
  });
136
116
  },
137
-
138
117
  /**
139
118
  * registers for calendar events through mercury
140
119
  * @returns {undefined}
@@ -142,7 +121,6 @@ var Calendar = _webexCore.WebexPlugin.extend({
142
121
  */
143
122
  listenForEvents: function listenForEvents() {
144
123
  var _this3 = this;
145
-
146
124
  // Calendar mercury events listener
147
125
  this.webex.internal.mercury.on('event:calendar.meeting.create', function (envelope) {
148
126
  _this3._handleCreate(envelope.data);
@@ -160,7 +138,6 @@ var Calendar = _webexCore.WebexPlugin.extend({
160
138
  _this3._handleDelete(envelope.data);
161
139
  });
162
140
  },
163
-
164
141
  /**
165
142
  * unregisteres all the calendar events from mercury
166
143
  * @returns {undefined}
@@ -173,7 +150,6 @@ var Calendar = _webexCore.WebexPlugin.extend({
173
150
  this.webex.internal.mercury.off('event:calendar.meeting.update.minimal');
174
151
  this.webex.internal.mercury.off('event:calendar.meeting.delete');
175
152
  },
176
-
177
153
  /**
178
154
  * handles update events, triggers after collection updates
179
155
  * @param {Object} data
@@ -182,10 +158,8 @@ var Calendar = _webexCore.WebexPlugin.extend({
182
158
  */
183
159
  _handleUpdate: function _handleUpdate(data) {
184
160
  var id = _collection.default.set(data.calendarMeetingExternal);
185
-
186
161
  this.trigger(_constants.CALENDAR_UPDATED, _collection.default.get(id));
187
162
  },
188
-
189
163
  /**
190
164
  * handles create events, triggers after collection updates
191
165
  * @param {Object} data
@@ -194,10 +168,8 @@ var Calendar = _webexCore.WebexPlugin.extend({
194
168
  */
195
169
  _handleCreate: function _handleCreate(data) {
196
170
  var id = _collection.default.set(data.calendarMeetingExternal);
197
-
198
171
  this.trigger(_constants.CALENDAR_CREATE, _collection.default.get(id));
199
172
  },
200
-
201
173
  /**
202
174
  * handles delete events, triggers after collection updates
203
175
  * @param {Object} data
@@ -206,10 +178,8 @@ var Calendar = _webexCore.WebexPlugin.extend({
206
178
  */
207
179
  _handleDelete: function _handleDelete(data) {
208
180
  var item = _collection.default.remove(data.calendarMeetingExternal.id);
209
-
210
181
  this.trigger(_constants.CALENDAR_DELETE, item);
211
182
  },
212
-
213
183
  /**
214
184
  * Retrieves a collection of calendars based on the request parameters
215
185
  * Defaults to 1 day before and 7 days ahead
@@ -228,11 +198,9 @@ var Calendar = _webexCore.WebexPlugin.extend({
228
198
  toDate: options.toDate
229
199
  }).then(function (res) {
230
200
  _collection.default.setAll(res);
231
-
232
201
  return _collection.default.getAll();
233
202
  });
234
203
  },
235
-
236
204
  /**
237
205
  * get the calendar item that has a matching value
238
206
  * @param {String} key meeting property
@@ -243,10 +211,8 @@ var Calendar = _webexCore.WebexPlugin.extend({
243
211
  if (['spaceURI', 'spaceMeetURL', 'conversationId'].includes(key)) {
244
212
  return _collection.default.getBy(key, value);
245
213
  }
246
-
247
214
  throw new Error('key must be one of, spaceURI, spaceMeetURL, or conversationId');
248
215
  },
249
-
250
216
  /**
251
217
  * gets all the calendar items that have been populated
252
218
  * @returns {Object}
@@ -254,7 +220,6 @@ var Calendar = _webexCore.WebexPlugin.extend({
254
220
  getAll: function getAll() {
255
221
  return _collection.default.getAll();
256
222
  },
257
-
258
223
  /**
259
224
  * Decrypts an encrypted incoming calendar event
260
225
  * @param {Object} event
@@ -265,7 +230,6 @@ var Calendar = _webexCore.WebexPlugin.extend({
265
230
  return event;
266
231
  });
267
232
  },
268
-
269
233
  /**
270
234
  * Retrieves an array of meeting participants for the meeting id
271
235
  * @param {String} id
@@ -278,7 +242,6 @@ var Calendar = _webexCore.WebexPlugin.extend({
278
242
  resource: "calendarEvents/".concat((0, _btoa.default)(id), "/participants")
279
243
  });
280
244
  },
281
-
282
245
  /**
283
246
  * Retrieves a collection of meetings based on the request parameters
284
247
  * @param {String} id
@@ -291,7 +254,6 @@ var Calendar = _webexCore.WebexPlugin.extend({
291
254
  resource: "calendarEvents/".concat((0, _btoa.default)(id), "/notes")
292
255
  });
293
256
  },
294
-
295
257
  /**
296
258
  * Retrieves a collection of meetings based on the request parameters
297
259
  * @param {Object} options
@@ -301,7 +263,6 @@ var Calendar = _webexCore.WebexPlugin.extend({
301
263
  */
302
264
  list: function list(options) {
303
265
  var _this4 = this;
304
-
305
266
  options = options || {};
306
267
  return this.webex.request({
307
268
  method: 'GET',
@@ -317,7 +278,6 @@ var Calendar = _webexCore.WebexPlugin.extend({
317
278
  meeting.encryptedNotes = notesResponse.body && notesResponse.body.encryptedNotes;
318
279
  }));
319
280
  }
320
-
321
281
  if (!meeting.encryptedParticipants) {
322
282
  promises.push(_this4.getParticipants(meeting.id).then(function (notesResponse) {
323
283
  meeting.encryptedParticipants = notesResponse.body.encryptedParticipants;
@@ -329,9 +289,8 @@ var Calendar = _webexCore.WebexPlugin.extend({
329
289
  });
330
290
  });
331
291
  },
332
- version: "3.0.0-beta.9"
292
+ version: "3.0.0-bnr.0"
333
293
  });
334
-
335
294
  var _default = Calendar;
336
295
  exports.default = _default;
337
296
  //# sourceMappingURL=calendar.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Calendar","WebexPlugin","extend","namespace","registered","register","webex","canAuthorize","logger","error","reject","Error","info","resolve","internal","device","then","mercury","connect","listenForEvents","trigger","CALENDAR_REGISTERED","catch","message","unregister","stopListeningForEvents","disconnect","CALENDAR_UNREGISTERED","on","envelope","_handleCreate","data","_handleUpdate","_handleDelete","off","id","CalendarCollection","set","calendarMeetingExternal","CALENDAR_UPDATED","get","CALENDAR_CREATE","item","remove","CALENDAR_DELETE","syncCalendar","options","fromDate","config","toDate","list","res","setAll","getAll","getByType","key","value","includes","getBy","processMeetingEvent","event","transform","getParticipants","request","method","service","resource","btoa","getNotes","qs","meetingObjects","body","items","promises","forEach","meeting","encryptedNotes","push","notesResponse","encryptedParticipants","all"],"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 */\n\nimport btoa from 'btoa';\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport CalendarCollection from './collection';\nimport {CALENDAR_REGISTERED, CALENDAR_UNREGISTERED, CALENDAR_DELETE, CALENDAR_CREATE, CALENDAR_UPDATED} from './constants';\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 * 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.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.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 },\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 },\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 * 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)\n .then(() => event);\n },\n\n /**\n * Retrieves an array of meeting participants for the meeting id\n * @param {String} id\n * @returns {Promise} Resolves with an object of meeting participants\n */\n getParticipants(id) {\n return this.request({\n method: 'GET',\n service: 'calendar',\n resource: `calendarEvents/${btoa(id)}/participants`\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/${btoa(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.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.encryptedNotes) {\n promises.push(\n this.getNotes(meeting.id)\n .then((notesResponse) => {\n meeting.encryptedNotes = notesResponse.body && notesResponse.body.encryptedNotes;\n })\n );\n }\n\n if (!meeting.encryptedParticipants) {\n promises.push(\n this.getParticipants(meeting.id)\n .then((notesResponse) => {\n meeting.encryptedParticipants = notesResponse.body.encryptedParticipants;\n })\n );\n }\n });\n\n return Promise.all(promises)\n .then(() => meetingObjects);\n });\n }\n});\n\nexport default Calendar;\n"],"mappings":";;;;;;;;;;;;;;AA4CA;;AACA;;AAEA;;AACA;;AAhDA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA,IAAMA,QAAQ,GAAGC,sBAAA,CAAYC,MAAZ,CAAmB;EAClCC,SAAS,EAAE,UADuB;;EAGlC;AACF;AACA;AACA;AACA;AACA;EACEC,UAAU,EAAE,KATsB;;EAWlC;AACF;AAC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CAlBD;MAoBA,OAAO,iBAAQC,GAAR,CAAYP,QAAZ,EACJzD,IADI,CACC;QAAA,OAAMsD,cAAN;MAAA,CADD,CAAP;IAED,CAhCI,CAAP;EAiCD,CAlQiC;EAAA;AAAA,CAAnB,CAAjB;;eAqQetE,Q"}
1
+ {"version":3,"names":["Calendar","WebexPlugin","extend","namespace","registered","register","webex","canAuthorize","logger","error","reject","Error","info","resolve","internal","device","then","mercury","connect","listenForEvents","trigger","CALENDAR_REGISTERED","catch","message","unregister","stopListeningForEvents","disconnect","CALENDAR_UNREGISTERED","on","envelope","_handleCreate","data","_handleUpdate","_handleDelete","off","id","CalendarCollection","set","calendarMeetingExternal","CALENDAR_UPDATED","get","CALENDAR_CREATE","item","remove","CALENDAR_DELETE","syncCalendar","options","fromDate","config","toDate","list","res","setAll","getAll","getByType","key","value","includes","getBy","processMeetingEvent","event","transform","getParticipants","request","method","service","resource","btoa","getNotes","qs","meetingObjects","body","items","promises","forEach","meeting","encryptedNotes","push","notesResponse","encryptedParticipants","all"],"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 */\n\nimport btoa from 'btoa';\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\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 * 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 },\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 },\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 * 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 id\n * @param {String} id\n * @returns {Promise} Resolves with an object of meeting participants\n */\n getParticipants(id) {\n return this.request({\n method: 'GET',\n service: 'calendar',\n resource: `calendarEvents/${btoa(id)}/participants`,\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/${btoa(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.encryptedNotes) {\n promises.push(\n this.getNotes(meeting.id).then((notesResponse) => {\n meeting.encryptedNotes = notesResponse.body && notesResponse.body.encryptedNotes;\n })\n );\n }\n\n if (!meeting.encryptedParticipants) {\n promises.push(\n this.getParticipants(meeting.id).then((notesResponse) => {\n meeting.encryptedParticipants = notesResponse.body.encryptedParticipants;\n })\n );\n }\n });\n\n return Promise.all(promises).then(() => meetingObjects);\n });\n },\n});\n\nexport default Calendar;\n"],"mappings":";;;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AAGE,aAAa,CAACP,IAAI,IAAIO,aAAa,CAACP,IAAI,CAACK,cAAc;UAClF,CAAC,CAAC,CACH;QACH;QAEA,IAAI,CAACD,OAAO,CAACI,qBAAqB,EAAE;UAClCN,QAAQ,CAACI,IAAI,CACX,MAAI,CAACf,eAAe,CAACa,OAAO,CAACxC,EAAE,CAAC,CAACnB,IAAI,CAAC,UAAC8D,aAAa,EAAK;YACvDH,OAAO,CAACI,qBAAqB,GAAGD,aAAa,CAACP,IAAI,CAACQ,qBAAqB;UAC1E,CAAC,CAAC,CACH;QACH;MACF,CAAC,CAAC;MAEF,OAAO,iBAAQC,GAAG,CAACP,QAAQ,CAAC,CAACzD,IAAI,CAAC;QAAA,OAAMsD,cAAc;MAAA,EAAC;IACzD,CAAC,CAAC;EACN,CAAC;EAAA;AACH,CAAC,CAAC;AAAC,eAEYtE,QAAQ;AAAA"}
@@ -1,30 +1,21 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
-
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
8
  exports.default = void 0;
12
-
13
9
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
14
-
15
10
  var _find2 = _interopRequireDefault(require("lodash/find"));
16
-
17
11
  var _util = _interopRequireDefault(require("./util"));
18
-
19
12
  var _constants = require("./constants");
20
-
21
13
  /**
22
14
  * @class CalendarCollection
23
15
  */
24
16
  var CalendarCollection = {
25
17
  namespace: _constants.CALENDAR,
26
18
  items: {},
27
-
28
19
  /**
29
20
  * @param {String} id calendar ID
30
21
  * @returns {Any} Calendar Item specifc to that id
@@ -34,7 +25,6 @@ var CalendarCollection = {
34
25
  get: function get(id) {
35
26
  return this.items[id];
36
27
  },
37
-
38
28
  /**
39
29
  * @param {String} key any key and the corresponding calendar Item
40
30
  * @param {String} value any values corresponding to calendar item
@@ -48,10 +38,8 @@ var CalendarCollection = {
48
38
  return item[key] === value;
49
39
  });
50
40
  }
51
-
52
41
  return null;
53
42
  },
54
-
55
43
  /**
56
44
  * @param {Object} item CalendarObject passed to the collection
57
45
  * @returns {Any} returns calender id whats get set
@@ -60,13 +48,10 @@ var CalendarCollection = {
60
48
  */
61
49
  set: function set(item) {
62
50
  var itemId = item.id;
63
-
64
51
  var meeting = _util.default.calculateEndTime(item);
65
-
66
52
  this.items[itemId] = meeting;
67
53
  return itemId;
68
54
  },
69
-
70
55
  /**
71
56
  * resets all the values in the calendarcollection
72
57
  * @returns {undefined}
@@ -76,7 +61,6 @@ var CalendarCollection = {
76
61
  reset: function reset() {
77
62
  this.items = {};
78
63
  },
79
-
80
64
  /**
81
65
  * @param {Id} id is the id for the calendar item to be removed
82
66
  * @returns {Any} calendar item which got removed
@@ -88,7 +72,6 @@ var CalendarCollection = {
88
72
  delete this.items[id];
89
73
  return meeting;
90
74
  },
91
-
92
75
  /**
93
76
  * sets all the item passed to the collection
94
77
  * @param {Array} items array of calendar items
@@ -98,12 +81,10 @@ var CalendarCollection = {
98
81
  */
99
82
  setAll: function setAll(items) {
100
83
  var _this = this;
101
-
102
84
  items.forEach(function (item) {
103
85
  _this.set(item);
104
86
  });
105
87
  },
106
-
107
88
  /**
108
89
  * gets all the calendar stored in the collection
109
90
  * @param {Array} items array of calendar items
@@ -1 +1 @@
1
- {"version":3,"names":["CalendarCollection","namespace","CALENDAR","items","get","id","getBy","key","value","item","set","itemId","meeting","CalendarUtil","calculateEndTime","reset","remove","setAll","forEach","getAll"],"sources":["collection.js"],"sourcesContent":["import {find} from 'lodash';\n\nimport CalendarUtil from './util';\nimport {CALENDAR} from './constants';\n/**\n * @class CalendarCollection\n */\nconst CalendarCollection = {\n namespace: CALENDAR,\n items: {},\n /**\n * @param {String} id calendar ID\n * @returns {Any} Calendar Item specifc to that id\n * @private\n * @memberof CalendarCollection\n */\n get(id) {\n return this.items[id];\n },\n\n /**\n * @param {String} key any key and the corresponding calendar Item\n * @param {String} value any values corresponding to calendar item\n * @returns {Any} returns whatever is being stuffed into the collection\n * @private\n * @memberof CalendarCollection\n */\n getBy(key, value) {\n if (key && value) {\n return find(this.items, (item) => (item[key] === value));\n }\n\n return null;\n },\n\n /**\n * @param {Object} item CalendarObject passed to the collection\n * @returns {Any} returns calender id whats get set\n * @private\n * @memberof CalendarCollection\n */\n set(item) {\n const itemId = item.id;\n const meeting = CalendarUtil.calculateEndTime(item);\n\n this.items[itemId] = meeting;\n\n return itemId;\n },\n\n /**\n * resets all the values in the calendarcollection\n * @returns {undefined}\n * @private\n * @memberof CalendarCollection\n */\n reset() {\n this.items = {};\n },\n\n\n /**\n * @param {Id} id is the id for the calendar item to be removed\n * @returns {Any} calendar item which got removed\n * @private\n * @memberof CalendarCollection\n */\n remove(id) {\n const meeting = this.get(id);\n\n delete this.items[id];\n\n return meeting;\n },\n\n /**\n * sets all the item passed to the collection\n * @param {Array} items array of calendar items\n * @private\n * @returns {undefined}\n * @memberof CalendarCollection\n */\n setAll(items) {\n items.forEach((item) => {\n this.set(item);\n });\n },\n\n /**\n * gets all the calendar stored in the collection\n * @param {Array} items array of calendar items\n * @private\n * @returns {Array} returns an array of calendar items\n * @memberof CalendarCollection\n */\n getAll() {\n return Object.values(this.items);\n }\n\n};\n\nexport default CalendarCollection;\n"],"mappings":";;;;;;;;;;;;;;;;AAEA;;AACA;;AACA;AACA;AACA;AACA,IAAMA,kBAAkB,GAAG;EACzBC,SAAS,EAAEC,mBADc;EAEzBC,KAAK,EAAE,EAFkB;;EAGzB;AACF;AACA;AACA;AACA;AACA;EACEC,GATyB,eASrBC,EATqB,EASjB;IACN,OAAO,KAAKF,KAAL,CAAWE,EAAX,CAAP;EACD,CAXwB;;EAazB;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,KApByB,iBAoBnBC,GApBmB,EAoBdC,KApBc,EAoBP;IAChB,IAAID,GAAG,IAAIC,KAAX,EAAkB;MAChB,OAAO,oBAAK,KAAKL,KAAV,EAAiB,UAACM,IAAD;QAAA,OAAWA,IAAI,CAACF,GAAD,CAAJ,KAAcC,KAAzB;MAAA,CAAjB,CAAP;IACD;;IAED,OAAO,IAAP;EACD,CA1BwB;;EA4BzB;AACF;AACA;AACA;AACA;AACA;EACEE,GAlCyB,eAkCrBD,IAlCqB,EAkCf;IACR,IAAME,MAAM,GAAGF,IAAI,CAACJ,EAApB;;IACA,IAAMO,OAAO,GAAGC,aAAA,CAAaC,gBAAb,CAA8BL,IAA9B,CAAhB;;IAEA,KAAKN,KAAL,CAAWQ,MAAX,IAAqBC,OAArB;IAEA,OAAOD,MAAP;EACD,CAzCwB;;EA2CzB;AACF;AACA;AACA;AACA;AACA;EACEI,KAjDyB,mBAiDjB;IACN,KAAKZ,KAAL,GAAa,EAAb;EACD,CAnDwB;;EAsDzB;AACF;AACA;AACA;AACA;AACA;EACEa,MA5DyB,kBA4DlBX,EA5DkB,EA4Dd;IACT,IAAMO,OAAO,GAAG,KAAKR,GAAL,CAASC,EAAT,CAAhB;IAEA,OAAO,KAAKF,KAAL,CAAWE,EAAX,CAAP;IAEA,OAAOO,OAAP;EACD,CAlEwB;;EAoEzB;AACF;AACA;AACA;AACA;AACA;AACA;EACEK,MA3EyB,kBA2ElBd,KA3EkB,EA2EX;IAAA;;IACZA,KAAK,CAACe,OAAN,CAAc,UAACT,IAAD,EAAU;MACtB,KAAI,CAACC,GAAL,CAASD,IAAT;IACD,CAFD;EAGD,CA/EwB;;EAiFzB;AACF;AACA;AACA;AACA;AACA;AACA;EACEU,MAxFyB,oBAwFhB;IACP,OAAO,qBAAc,KAAKhB,KAAnB,CAAP;EACD;AA1FwB,CAA3B;eA8FeH,kB"}
1
+ {"version":3,"names":["CalendarCollection","namespace","CALENDAR","items","get","id","getBy","key","value","item","set","itemId","meeting","CalendarUtil","calculateEndTime","reset","remove","setAll","forEach","getAll"],"sources":["collection.js"],"sourcesContent":["import {find} from 'lodash';\n\nimport CalendarUtil from './util';\nimport {CALENDAR} from './constants';\n/**\n * @class CalendarCollection\n */\nconst CalendarCollection = {\n namespace: CALENDAR,\n items: {},\n /**\n * @param {String} id calendar ID\n * @returns {Any} Calendar Item specifc to that id\n * @private\n * @memberof CalendarCollection\n */\n get(id) {\n return this.items[id];\n },\n\n /**\n * @param {String} key any key and the corresponding calendar Item\n * @param {String} value any values corresponding to calendar item\n * @returns {Any} returns whatever is being stuffed into the collection\n * @private\n * @memberof CalendarCollection\n */\n getBy(key, value) {\n if (key && value) {\n return find(this.items, (item) => item[key] === value);\n }\n\n return null;\n },\n\n /**\n * @param {Object} item CalendarObject passed to the collection\n * @returns {Any} returns calender id whats get set\n * @private\n * @memberof CalendarCollection\n */\n set(item) {\n const itemId = item.id;\n const meeting = CalendarUtil.calculateEndTime(item);\n\n this.items[itemId] = meeting;\n\n return itemId;\n },\n\n /**\n * resets all the values in the calendarcollection\n * @returns {undefined}\n * @private\n * @memberof CalendarCollection\n */\n reset() {\n this.items = {};\n },\n\n /**\n * @param {Id} id is the id for the calendar item to be removed\n * @returns {Any} calendar item which got removed\n * @private\n * @memberof CalendarCollection\n */\n remove(id) {\n const meeting = this.get(id);\n\n delete this.items[id];\n\n return meeting;\n },\n\n /**\n * sets all the item passed to the collection\n * @param {Array} items array of calendar items\n * @private\n * @returns {undefined}\n * @memberof CalendarCollection\n */\n setAll(items) {\n items.forEach((item) => {\n this.set(item);\n });\n },\n\n /**\n * gets all the calendar stored in the collection\n * @param {Array} items array of calendar items\n * @private\n * @returns {Array} returns an array of calendar items\n * @memberof CalendarCollection\n */\n getAll() {\n return Object.values(this.items);\n },\n};\n\nexport default CalendarCollection;\n"],"mappings":";;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAMA,kBAAkB,GAAG;EACzBC,SAAS,EAAEC,mBAAQ;EACnBC,KAAK,EAAE,CAAC,CAAC;EACT;AACF;AACA;AACA;AACA;AACA;EACEC,GAAG,eAACC,EAAE,EAAE;IACN,OAAO,IAAI,CAACF,KAAK,CAACE,EAAE,CAAC;EACvB,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,KAAK,iBAACC,GAAG,EAAEC,KAAK,EAAE;IAChB,IAAID,GAAG,IAAIC,KAAK,EAAE;MAChB,OAAO,oBAAK,IAAI,CAACL,KAAK,EAAE,UAACM,IAAI;QAAA,OAAKA,IAAI,CAACF,GAAG,CAAC,KAAKC,KAAK;MAAA,EAAC;IACxD;IAEA,OAAO,IAAI;EACb,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEE,GAAG,eAACD,IAAI,EAAE;IACR,IAAME,MAAM,GAAGF,IAAI,CAACJ,EAAE;IACtB,IAAMO,OAAO,GAAGC,aAAY,CAACC,gBAAgB,CAACL,IAAI,CAAC;IAEnD,IAAI,CAACN,KAAK,CAACQ,MAAM,CAAC,GAAGC,OAAO;IAE5B,OAAOD,MAAM;EACf,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEI,KAAK,mBAAG;IACN,IAAI,CAACZ,KAAK,GAAG,CAAC,CAAC;EACjB,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEa,MAAM,kBAACX,EAAE,EAAE;IACT,IAAMO,OAAO,GAAG,IAAI,CAACR,GAAG,CAACC,EAAE,CAAC;IAE5B,OAAO,IAAI,CAACF,KAAK,CAACE,EAAE,CAAC;IAErB,OAAOO,OAAO;EAChB,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEK,MAAM,kBAACd,KAAK,EAAE;IAAA;IACZA,KAAK,CAACe,OAAO,CAAC,UAACT,IAAI,EAAK;MACtB,KAAI,CAACC,GAAG,CAACD,IAAI,CAAC;IAChB,CAAC,CAAC;EACJ,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEU,MAAM,oBAAG;IACP,OAAO,qBAAc,IAAI,CAAChB,KAAK,CAAC;EAClC;AACF,CAAC;AAAC,eAEaH,kBAAkB;AAAA"}
package/dist/config.js CHANGED
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  _Object$defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
-
9
7
  exports.default = void 0;
10
-
11
8
  /*!
12
9
  * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
13
10
  */
@@ -1 +1 @@
1
- {"version":3,"names":["calendar","fromDate","Date","setDate","getDate","toDate"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n calendar: {\n fromDate: new Date(new Date().setDate(new Date().getDate() - 1)),\n toDate: new Date(new Date().setDate(new Date().getDate() + 7))\n }\n};\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;eAEe;EACbA,QAAQ,EAAE;IACRC,QAAQ,EAAE,IAAIC,IAAJ,CAAS,IAAIA,IAAJ,GAAWC,OAAX,CAAmB,IAAID,IAAJ,GAAWE,OAAX,KAAuB,CAA1C,CAAT,CADF;IAERC,MAAM,EAAE,IAAIH,IAAJ,CAAS,IAAIA,IAAJ,GAAWC,OAAX,CAAmB,IAAID,IAAJ,GAAWE,OAAX,KAAuB,CAA1C,CAAT;EAFA;AADG,C"}
1
+ {"version":3,"names":["calendar","fromDate","Date","setDate","getDate","toDate"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n calendar: {\n fromDate: new Date(new Date().setDate(new Date().getDate() - 1)),\n toDate: new Date(new Date().setDate(new Date().getDate() + 7)),\n },\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,eAIe;EACbA,QAAQ,EAAE;IACRC,QAAQ,EAAE,IAAIC,IAAI,CAAC,IAAIA,IAAI,EAAE,CAACC,OAAO,CAAC,IAAID,IAAI,EAAE,CAACE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IAChEC,MAAM,EAAE,IAAIH,IAAI,CAAC,IAAIA,IAAI,EAAE,CAACC,OAAO,CAAC,IAAID,IAAI,EAAE,CAACE,OAAO,EAAE,GAAG,CAAC,CAAC;EAC/D;AACF,CAAC;AAAA"}
package/dist/constants.js CHANGED
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  _Object$defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
-
9
7
  exports.CALENDAR_UPDATED = exports.CALENDAR_UNREGISTERED = exports.CALENDAR_REGISTERED = exports.CALENDAR_DELETE = exports.CALENDAR_CREATE = exports.CALENDAR = void 0;
10
8
  var CALENDAR_REGISTERED = 'calendar:registered';
11
9
  exports.CALENDAR_REGISTERED = CALENDAR_REGISTERED;
@@ -1 +1 @@
1
- {"version":3,"names":["CALENDAR_REGISTERED","CALENDAR_UNREGISTERED","CALENDAR_UPDATED","CALENDAR_DELETE","CALENDAR_CREATE","CALENDAR"],"sources":["constants.js"],"sourcesContent":["export const CALENDAR_REGISTERED = 'calendar:registered';\nexport const CALENDAR_UNREGISTERED = 'calendar:unregistered';\nexport const CALENDAR_UPDATED = 'calendar:update';\nexport const CALENDAR_DELETE = 'calendar:delete';\nexport const CALENDAR_CREATE = 'calendar:create';\nexport const CALENDAR = 'CALENDAR';\n"],"mappings":";;;;;;;;;AAAO,IAAMA,mBAAmB,GAAG,qBAA5B;;AACA,IAAMC,qBAAqB,GAAG,uBAA9B;;AACA,IAAMC,gBAAgB,GAAG,iBAAzB;;AACA,IAAMC,eAAe,GAAG,iBAAxB;;AACA,IAAMC,eAAe,GAAG,iBAAxB;;AACA,IAAMC,QAAQ,GAAG,UAAjB"}
1
+ {"version":3,"names":["CALENDAR_REGISTERED","CALENDAR_UNREGISTERED","CALENDAR_UPDATED","CALENDAR_DELETE","CALENDAR_CREATE","CALENDAR"],"sources":["constants.js"],"sourcesContent":["export const CALENDAR_REGISTERED = 'calendar:registered';\nexport const CALENDAR_UNREGISTERED = 'calendar:unregistered';\nexport const CALENDAR_UPDATED = 'calendar:update';\nexport const CALENDAR_DELETE = 'calendar:delete';\nexport const CALENDAR_CREATE = 'calendar:create';\nexport const CALENDAR = 'CALENDAR';\n"],"mappings":";;;;;;;AAAO,IAAMA,mBAAmB,GAAG,qBAAqB;AAAC;AAClD,IAAMC,qBAAqB,GAAG,uBAAuB;AAAC;AACtD,IAAMC,gBAAgB,GAAG,iBAAiB;AAAC;AAC3C,IAAMC,eAAe,GAAG,iBAAiB;AAAC;AAC1C,IAAMC,eAAe,GAAG,iBAAiB;AAAC;AAC1C,IAAMC,QAAQ,GAAG,UAAU;AAAC"}
package/dist/index.js CHANGED
@@ -1,39 +1,28 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
-
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
8
  _Object$defineProperty(exports, "default", {
12
9
  enumerable: true,
13
10
  get: function get() {
14
11
  return _calendar.default;
15
12
  }
16
13
  });
17
-
18
14
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
19
-
20
15
  var _has2 = _interopRequireDefault(require("lodash/has"));
21
-
22
16
  require("@webex/internal-plugin-device");
23
-
24
17
  require("@webex/internal-plugin-encryption");
25
-
26
18
  require("@webex/internal-plugin-conversation");
27
-
28
19
  var _webexCore = require("@webex/webex-core");
29
-
30
20
  var _calendar = _interopRequireDefault(require("./calendar"));
31
-
32
21
  var _config = _interopRequireDefault(require("./config"));
33
-
34
22
  /*!
35
23
  * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
36
24
  */
25
+
37
26
  (0, _webexCore.registerInternalPlugin)('calendar', _calendar.default, {
38
27
  config: _config.default,
39
28
  payloadTransformer: {
@@ -97,16 +86,16 @@ var _config = _interopRequireDefault(require("./config"));
97
86
  if (!object) {
98
87
  return _promise.default.resolve();
99
88
  }
100
-
101
89
  if (!object.encryptionKeyUrl) {
102
90
  return _promise.default.resolve();
103
- } // Decrypt participant properties if meeting object contains participants
104
-
91
+ }
105
92
 
93
+ // Decrypt participant properties if meeting object contains participants
106
94
  var decryptedParticipants = object.encryptedParticipants ? object.encryptedParticipants.map(function (participant) {
107
95
  return _promise.default.all([ctx.transform('decryptTextProp', 'encryptedEmailAddress', object.encryptionKeyUrl, participant), ctx.transform('decryptTextProp', 'encryptedName', object.encryptionKeyUrl, participant)]);
108
- }) : []; // Decrypt meetingJoinInfo properties if meeting object contains meetingJoinInfo
96
+ }) : [];
109
97
 
98
+ // Decrypt meetingJoinInfo properties if meeting object contains meetingJoinInfo
110
99
  var decryptedMeetingJoinInfo = object.meetingJoinInfo ? _promise.default.all([ctx.transform('decryptTextProp', 'meetingJoinURI', object.encryptionKeyUrl, object.meetingJoinInfo), ctx.transform('decryptTextProp', 'meetingJoinURL', object.encryptionKeyUrl, object.meetingJoinInfo)]) : [];
111
100
  var decryptedOrganizer = object.encryptedOrganizer ? _promise.default.all([ctx.transform('decryptTextProp', 'encryptedEmailAddress', object.encryptionKeyUrl, object.encryptedOrganizer), ctx.transform('decryptTextProp', 'encryptedName', object.encryptionKeyUrl, object.encryptedOrganizer)]) : [];
112
101
  return _promise.default.all([ctx.transform('decryptTextProp', 'encryptedSubject', object.encryptionKeyUrl, object), ctx.transform('decryptTextProp', 'encryptedLocation', object.encryptionKeyUrl, object), ctx.transform('decryptTextProp', 'encryptedNotes', object.encryptionKeyUrl, object), ctx.transform('decryptTextProp', 'webexURI', object.encryptionKeyUrl, object), ctx.transform('decryptTextProp', 'webexURL', object.encryptionKeyUrl, object), ctx.transform('decryptTextProp', 'spaceMeetURL', object.encryptionKeyUrl, object), ctx.transform('decryptTextProp', 'spaceURI', object.encryptionKeyUrl, object), ctx.transform('decryptTextProp', 'spaceURL', object.encryptionKeyUrl, object)].concat(decryptedOrganizer, decryptedParticipants, decryptedMeetingJoinInfo));
@@ -118,11 +107,9 @@ var _config = _interopRequireDefault(require("./config"));
118
107
  if (!object) {
119
108
  return _promise.default.resolve();
120
109
  }
121
-
122
110
  if (!object.encryptionKeyUrl) {
123
111
  return _promise.default.resolve();
124
112
  }
125
-
126
113
  return _promise.default.all([ctx.transform('decryptTextProp', 'encryptedNotes', object.encryptionKeyUrl, object)]);
127
114
  }
128
115
  }, {
@@ -132,12 +119,11 @@ var _config = _interopRequireDefault(require("./config"));
132
119
  if (!object) {
133
120
  return _promise.default.resolve();
134
121
  }
135
-
136
122
  if (!object.encryptionKeyUrl || !object.encryptedParticipants) {
137
123
  return _promise.default.resolve();
138
- } // Decrypt participant properties
139
-
124
+ }
140
125
 
126
+ // Decrypt participant properties
141
127
  var decryptedParticipants = object.encryptedParticipants.map(function (participant) {
142
128
  return _promise.default.all([ctx.transform('decryptTextProp', 'encryptedEmailAddress', object.encryptionKeyUrl, participant), ctx.transform('decryptTextProp', 'encryptedName', object.encryptionKeyUrl, participant)]);
143
129
  });