@webex/plugin-meetings 1.151.2 → 1.151.6

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.
@@ -32,11 +32,9 @@ var _webexCore = require("@webex/webex-core");
32
32
 
33
33
  var _constants = require("../constants");
34
34
 
35
- var _request = _interopRequireDefault(require("../meeting-info/request"));
36
-
37
35
  var _parameter = _interopRequireDefault(require("../common/errors/parameter"));
38
36
 
39
- var _request2 = _interopRequireDefault(require("./request"));
37
+ var _request = _interopRequireDefault(require("./request"));
40
38
 
41
39
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
42
40
 
@@ -109,12 +107,12 @@ var PersonalMeetingRoom = /*#__PURE__*/function (_StatelessWebexPlugin) {
109
107
  /**
110
108
  * The meeting info request server interface
111
109
  * @instance
112
- * @type {MeetingInfoRequest}
110
+ * @type {MeetingInfo}
113
111
  * @private
114
112
  * @memberof PersonalMeetingRoom
115
113
  */
116
114
 
117
- _this.meetingInfoRequest = new _request.default(options.parent);
115
+ _this.meetingInfo = attrs.meetingInfo;
118
116
  /**
119
117
  * The pmr server request interface
120
118
  * @instance
@@ -123,7 +121,7 @@ var PersonalMeetingRoom = /*#__PURE__*/function (_StatelessWebexPlugin) {
123
121
  * @memberof PersonalMeetingRoom
124
122
  */
125
123
 
126
- _this.personalMeetingRoomRequest = new _request2.default({}, options);
124
+ _this.personalMeetingRoomRequest = new _request.default({}, options);
127
125
  return _this;
128
126
  }
129
127
  /**
@@ -190,10 +188,9 @@ var PersonalMeetingRoom = /*#__PURE__*/function (_StatelessWebexPlugin) {
190
188
  var _this3 = this;
191
189
 
192
190
  var options = {
193
- type: _constants._PERSONAL_ROOM_,
194
- destination: this.webex.internal.device.userId
191
+ type: _constants._PERSONAL_ROOM_
195
192
  };
196
- return this.meetingInfoRequest.fetchMeetingInfo(options).then(function (pmr) {
193
+ return this.meetingInfo.fetchMeetingInfo(options).then(function (pmr) {
197
194
  if (pmr && pmr.body && pmr.body.isPmr) {
198
195
  _this3.set(pmr.body);
199
196
  } else {
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"names":["PersonalMeetingRoom","attrs","options","MEETINGS","pmr","sipUri","link","userId","name","meetingInfoRequest","MeetingInfoRequest","parent","personalMeetingRoomRequest","PersonalMeetingRoomRequest","pin","preferred","webex","internal","device","passcode","meetingAddress","claimPmr","then","body","set","reject","ParameterError","sipMeetingUri","meetingLink","webExMeetingLink","owner","meetingName","number","meetingNumber","type","_PERSONAL_ROOM_","destination","fetchMeetingInfo","isPmr","TypeError","StatelessWebexPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AAEA;;;;;;AAGA;AACA;AACA;IACqBA,mB;;;;;AAGnB;AACF;AACA;AACA;AACA;AACE,+BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA;AAC1B,8BAAM,EAAN,EAAUA,OAAV;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AAR8B,4FAPhBC,mBAOgB;AAS1B,UAAKC,GAAL,GAAW,IAAX;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,MAAL,GAAc,IAAd;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,IAAL,GAAY,IAAZ;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,MAAL,GAAc,IAAd;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,IAAL,GAAY,IAAZ;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,kBAAL,GAA0B,IAAIC,gBAAJ,C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ED;AACF;AACA;AACA;AACA;AACA;AACA;;;;WACE,eAAM;AAAA;;AACJ,UAAM/B,OAAO,GAAG;AACdgC,QAAAA,IAAI,EAAEC,0BADQ;AAEdC,QAAAA,WAAW,EAAE,KAAKpB,KAAL,CAAWC,QAAX,CAAoBC,MAApB,CAA2BX;AAF1B,OAAhB;AAKA,aAAO,KAAKE,kBAAL,CAAwB4B,gBAAxB,CAAyCnC,OAAzC,EAAkDoB,IAAlD,CAAuD,UAAClB,GAAD,EAAS;AACrE,YAAIA,GAAG,IAAIA,GAAG,CAACmB,IAAX,IAAmBnB,GAAG,CAACmB,IAAJ,CAASe,KAAhC,EAAuC;AACrC,UAAA,MAAI,CAACd,GAAL,CAASpB,GAAG,CAACmB,IAAb;AACD,SAFD,MAGK;AACH,iBAAO,iBAAQE,MAAR,CAAe,IAAIc,SAAJ,CAAc,qDAAd,CAAf,CAAP;AACD;;AAED,eAAOnC,GAAG,CAACmB,IAAX;AACD,OATM,CAAP;AAUD;;;EAvI8CiB,+B","sourcesContent":["import {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {MEETINGS, _PERSONAL_ROOM_} from '../constants';\nimport MeetingInfoRequest from '../meeting-info/request';\nimport ParameterError from '../common/errors/parameter';\n\nimport PersonalMeetingRoomRequest from './request';\n\n\n/**\n * @class PersonalMeetingRoom\n */\nexport default class PersonalMeetingRoom extends StatelessWebexPlugin {\n namespace = MEETINGS;\n\n /**\n *\n * @param {Object} attrs\n * @param {Object} options\n */\n constructor(attrs, options) {\n super({}, options);\n /**\n * The pmr server object\n * @instance\n * @type {Object}\n * @public\n * @memberof PersonalMeetingRoom\n */\n this.pmr = null;\n /**\n * The pmr sip Uri\n * @instance\n * @type {String}\n * @public\n * @memberof PersonalMeetingRoom\n */\n this.sipUri = null;\n /**\n * The pmr link\n * @instance\n * @type {String}\n * @public\n * @memberof PersonalMeetingRoom\n */\n this.link = null;\n /**\n * The pmr server object\n * @instance\n * @type {Object}\n * @public\n * @memberof PersonalMeetingRoom\n */\n this.userId = null;\n /**\n * The pmr name\n * @instance\n * @type {String}\n * @public\n * @memberof PersonalMeetingRoom\n */\n this.name = null;\n /**\n * The meeting info request server interface\n * @instance\n * @type {MeetingInfoRequest}\n * @private\n * @memberof PersonalMeetingRoom\n */\n this.meetingInfoRequest = new MeetingInfoRequest(options.parent);\n /**\n * The pmr server request interface\n * @instance\n * @type {Object}\n * @private\n * @memberof PersonalMeetingRoom\n */\n this.personalMeetingRoomRequest = new PersonalMeetingRoomRequest({}, options);\n }\n\n /**\n * claims a pmr and updates the cached PMR values\n * @param {String} link\n * @param {String} pin\n * @param {Boolean} [preferred] defaults to true to set this claimed PMR as the preferred\n * @returns {Promise}\n * @public\n * @memberof PersonalMeetingRoom\n */\n claim(link, pin, preferred = true) {\n const options = {\n userId: this.webex.internal.device.userId,\n passcode: pin,\n meetingAddress: link,\n preferred\n };\n\n return this.personalMeetingRoomRequest.claimPmr(options).then((pmr) => {\n if (pmr && pmr.body) {\n this.set(pmr.body);\n }\n else {\n return Promise.reject(new ParameterError('No PMR body provided. PMR values not updated.'));\n }\n\n return pmr.body;\n });\n }\n\n /**\n * @param {Object} body the response body from meeting info request\n * @returns {undefined}\n * @private\n * @memberof PersonalMeetingRoom\n */\n set(body) {\n this.pmr = body;\n this.sipUri = body.sipMeetingUri;\n this.meetingLink = body.webExMeetingLink || body.meetingLink;\n this.userId = body.owner;\n this.name = body.meetingName;\n this.number = body.meetingNumber;\n }\n\n /**\n * TODO: implement TTL for syncing and caching so to not request again and again\n * @param {Object} options\n * @returns {Promise}\n * @public\n * @memberof PersonalMeetingRoom\n */\n get() {\n const options = {\n type: _PERSONAL_ROOM_,\n destination: this.webex.internal.device.userId\n };\n\n return this.meetingInfoRequest.fetchMeetingInfo(options).then((pmr) => {\n if (pmr && pmr.body && pmr.body.isPmr) {\n this.set(pmr.body);\n }\n else {\n return Promise.reject(new TypeError('The PMR requested is NOT a PMR. PMR values not set.'));\n }\n\n return pmr.body;\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["index.js"],"names":["PersonalMeetingRoom","attrs","options","MEETINGS","pmr","sipUri","link","userId","name","meetingInfo","personalMeetingRoomRequest","PersonalMeetingRoomRequest","pin","preferred","webex","internal","device","passcode","meetingAddress","claimPmr","then","body","set","reject","ParameterError","sipMeetingUri","meetingLink","webExMeetingLink","owner","meetingName","number","meetingNumber","type","_PERSONAL_ROOM_","fetchMeetingInfo","isPmr","TypeError","StatelessWebexPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AAEA;;;;;;AAGA;AACA;AACA;IACqBA,mB;;;;;AAGnB;AACF;AACA;AACA;AACA;AACE,+BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA;AAC1B,8BAAM,EAAN,EAAUA,OAAV;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AAR8B,4FAPhBC,mBAOgB;AAS1B,UAAKC,GAAL,GAAW,IAAX;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,MAAL,GAAc,IAAd;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,IAAL,GAAY,IAAZ;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,MAAL,GAAc,IAAd;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,IAAL,GAAY,IAAZ;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,WAAL,GAAmBR,KAAK,CAACQ,WAAzB;AACA;AACJ;AACA;AACA;AACA;AACA;AACA;;AACI,UAAKC,0BAAL,GAAkC,IAAIC,gBAAJ,CAA+B,EAA/B,EAAmCT,OAAnC,CAAlC;AAzD0B;AA0D3B;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;WACE,eAAMI,IAAN,EAAYM,GAAZ,EAAmC;AAAA;;AAAA,UAAlBC,SAAkB,uEAAN,IAAM;AACjC,UAAM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AAhC,EAAuC;AACrC,UAAA,MAAI,CAACb,GAAL,CAASlB,GAAG,CAACiB,IAAb;AACD,SAFD,MAGK;AACH,iBAAO,iBAAQE,MAAR,CAAe,IAAIa,SAAJ,CAAc,qDAAd,CAAf,CAAP;AACD;;AAED,eAAOhC,GAAG,CAACiB,IAAX;AACD,OATM,CAAP;AAUD;;;EAvI8CgB,+B","sourcesContent":["import {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {MEETINGS, _PERSONAL_ROOM_} from '../constants';\nimport ParameterError from '../common/errors/parameter';\n\nimport PersonalMeetingRoomRequest from './request';\n\n\n/**\n * @class PersonalMeetingRoom\n */\nexport default class PersonalMeetingRoom extends StatelessWebexPlugin {\n namespace = MEETINGS;\n\n /**\n *\n * @param {Object} attrs\n * @param {Object} options\n */\n constructor(attrs, options) {\n super({}, options);\n /**\n * The pmr server object\n * @instance\n * @type {Object}\n * @public\n * @memberof PersonalMeetingRoom\n */\n this.pmr = null;\n /**\n * The pmr sip Uri\n * @instance\n * @type {String}\n * @public\n * @memberof PersonalMeetingRoom\n */\n this.sipUri = null;\n /**\n * The pmr link\n * @instance\n * @type {String}\n * @public\n * @memberof PersonalMeetingRoom\n */\n this.link = null;\n /**\n * The pmr server object\n * @instance\n * @type {Object}\n * @public\n * @memberof PersonalMeetingRoom\n */\n this.userId = null;\n /**\n * The pmr name\n * @instance\n * @type {String}\n * @public\n * @memberof PersonalMeetingRoom\n */\n this.name = null;\n /**\n * The meeting info request server interface\n * @instance\n * @type {MeetingInfo}\n * @private\n * @memberof PersonalMeetingRoom\n */\n this.meetingInfo = attrs.meetingInfo;\n /**\n * The pmr server request interface\n * @instance\n * @type {Object}\n * @private\n * @memberof PersonalMeetingRoom\n */\n this.personalMeetingRoomRequest = new PersonalMeetingRoomRequest({}, options);\n }\n\n /**\n * claims a pmr and updates the cached PMR values\n * @param {String} link\n * @param {String} pin\n * @param {Boolean} [preferred] defaults to true to set this claimed PMR as the preferred\n * @returns {Promise}\n * @public\n * @memberof PersonalMeetingRoom\n */\n claim(link, pin, preferred = true) {\n const options = {\n userId: this.webex.internal.device.userId,\n passcode: pin,\n meetingAddress: link,\n preferred\n };\n\n return this.personalMeetingRoomRequest.claimPmr(options).then((pmr) => {\n if (pmr && pmr.body) {\n this.set(pmr.body);\n }\n else {\n return Promise.reject(new ParameterError('No PMR body provided. PMR values not updated.'));\n }\n\n return pmr.body;\n });\n }\n\n /**\n * @param {Object} body the response body from meeting info request\n * @returns {undefined}\n * @private\n * @memberof PersonalMeetingRoom\n */\n set(body) {\n this.pmr = body;\n this.sipUri = body.sipMeetingUri;\n this.meetingLink = body.webExMeetingLink || body.meetingLink;\n this.userId = body.owner;\n this.name = body.meetingName;\n this.number = body.meetingNumber;\n }\n\n /**\n * TODO: implement TTL for syncing and caching so to not request again and again\n * @param {Object} options\n * @returns {Promise}\n * @public\n * @memberof PersonalMeetingRoom\n */\n get() {\n const options = {\n type: _PERSONAL_ROOM_\n\n };\n\n return this.meetingInfo.fetchMeetingInfo(options).then((pmr) => {\n if (pmr && pmr.body && pmr.body.isPmr) {\n this.set(pmr.body);\n }\n else {\n return Promise.reject(new TypeError('The PMR requested is NOT a PMR. PMR values not set.'));\n }\n\n return pmr.body;\n });\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "1.151.2",
3
+ "version": "1.151.6",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -24,18 +24,18 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@babel/runtime-corejs2": "^7.14.8",
27
- "@webex/webex-core": "1.151.2",
28
- "@webex/internal-plugin-mercury": "1.151.2",
27
+ "@webex/webex-core": "1.151.6",
28
+ "@webex/internal-plugin-mercury": "1.151.6",
29
29
  "webrtc-adapter": "^7.7.0",
30
30
  "lodash": "^4.17.21",
31
31
  "uuid": "^3.3.2",
32
32
  "global": "^4.4.0",
33
33
  "ip-anonymize": "^0.1.0",
34
- "@webex/common": "1.151.2",
34
+ "@webex/common": "1.151.6",
35
35
  "bowser": "^2.11.0",
36
36
  "sdp-transform": "^2.12.0",
37
37
  "readable-stream": "^3.6.0",
38
- "@webex/common-timers": "1.151.2",
38
+ "@webex/common-timers": "1.151.6",
39
39
  "btoa": "^1.2.1",
40
40
  "javascript-state-machine": "^3.1.0",
41
41
  "envify": "^4.1.0"
@@ -3787,7 +3787,7 @@ export default class Meeting extends StatelessWebexPlugin {
3787
3787
  const metricName = METRICS_OPERATIONAL_MEASURES.GET_USER_MEDIA_FAILURE;
3788
3788
  const data = {
3789
3789
  correlation_id: this.correlationId,
3790
- locus_id: this.locusUrl.split('/').pop(),
3790
+ locus_id: this.locusUrl?.split('/').pop(),
3791
3791
  reason: error.message,
3792
3792
  stack: error.stack
3793
3793
  };
@@ -4,7 +4,8 @@
4
4
 
5
5
  import {
6
6
  _MEETING_LINK_,
7
- _SIP_URI_
7
+ _SIP_URI_,
8
+ _PERSONAL_ROOM_
8
9
  } from '../constants';
9
10
  import LoggerProxy from '../common/logs/logger-proxy';
10
11
 
@@ -108,6 +109,10 @@ export default class MeetingInfo {
108
109
  * @memberof MeetingInfo
109
110
  */
110
111
  fetchMeetingInfo(destination, type = null) {
112
+ if (type === _PERSONAL_ROOM_ && !destination) {
113
+ destination = this.webex.internal.device.userId;
114
+ }
115
+
111
116
  return this.fetchInfoOptions(
112
117
  MeetingInfoUtil.extractDestination(destination, type),
113
118
  type
@@ -21,7 +21,8 @@ import {
21
21
  MEET,
22
22
  MEET_M,
23
23
  HTTPS_PROTOCOL,
24
- UUID_REG
24
+ UUID_REG,
25
+ VALID_EMAIL_ADDRESS
25
26
  } from '../constants';
26
27
  import ParameterError from '../common/errors/parameter';
27
28
  import LoggerProxy from '../common/logs/logger-proxy';
@@ -116,8 +117,27 @@ MeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) => webex.peopl
116
117
 
117
118
 
118
119
  MeetingInfoUtil.getDestinationType = async (from) => {
119
- const {destination, type, webex} = from;
120
+ const {type, webex} = from;
121
+ let {destination} = from;
122
+
123
+ if (type === _PERSONAL_ROOM_) { // this case checks if your type is personal room
124
+ if (!destination) { // if we are not getting anything in desination we fetch org and user ids from webex instance
125
+ destination = {
126
+ userId: webex.internal.device.userId,
127
+ orgId: webex.internal.device.orgId
128
+ };
129
+ }
130
+ else {
131
+ const options = VALID_EMAIL_ADDRESS.test(destination) ? {email: destination} : {id: destination};// we are assuming userId as default
132
+ const res = await webex.people.list(options);
133
+
134
+ let {orgId, id: userId} = res.items[0];
120
135
 
136
+ userId = deconstructHydraId(userId).id;
137
+ orgId = deconstructHydraId(orgId).id;
138
+ destination = {userId, orgId};
139
+ }
140
+ }
121
141
  if (type) {
122
142
  return {
123
143
  destination,
@@ -202,8 +222,8 @@ MeetingInfoUtil.getRequestBody = (options) => {
202
222
  body.sipUrl = destination;
203
223
  break;
204
224
  case _PERSONAL_ROOM_:
205
- body.userId = destination;
206
- body.orgId = ''; // TODO: when to use the org iD (fetch others PMR)
225
+ body.userId = destination.userId;
226
+ body.orgId = destination.orgId;
207
227
  break;
208
228
  case _MEETING_ID_:
209
229
  body.meetingKey = destination;
@@ -141,7 +141,7 @@ export default class Meetings extends WebexPlugin {
141
141
  * @public
142
142
  * @memberof Meetings
143
143
  */
144
- this.personalMeetingRoom = new PersonalMeetingRoom({}, {parent: this.webex});
144
+ this.personalMeetingRoom = null;
145
145
  /**
146
146
  * The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called
147
147
  * starts as null
@@ -174,6 +174,8 @@ export default class Meetings extends WebexPlugin {
174
174
  getSupportedDevice: Media.getSupportedDevice
175
175
  };
176
176
 
177
+ LoggerProxy.set(this.webex.logger);
178
+
177
179
  this.onReady();
178
180
  MeetingsUtil.checkH264Support({disableNotifications: true});
179
181
  Metrics.initialSetup(this.meetingCollection, this.webex);
@@ -371,7 +373,6 @@ export default class Meetings extends WebexPlugin {
371
373
  this.webex.once(READY, () => {
372
374
  StaticConfig.set(this.config);
373
375
  LoggerConfig.set(this.config.logging);
374
- LoggerProxy.set(this.webex.logger);
375
376
 
376
377
  /**
377
378
  * The MeetingInfo object to interact with server
@@ -381,6 +382,7 @@ export default class Meetings extends WebexPlugin {
381
382
  * @memberof Meetings
382
383
  */
383
384
  this.meetingInfo = this.config.experimental.enableUnifiedMeetings ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);
385
+ this.personalMeetingRoom = new PersonalMeetingRoom({meetingInfo: this.meetingInfo}, {parent: this.webex});
384
386
 
385
387
  Trigger.trigger(
386
388
  this,
@@ -1,7 +1,6 @@
1
1
  import {StatelessWebexPlugin} from '@webex/webex-core';
2
2
 
3
3
  import {MEETINGS, _PERSONAL_ROOM_} from '../constants';
4
- import MeetingInfoRequest from '../meeting-info/request';
5
4
  import ParameterError from '../common/errors/parameter';
6
5
 
7
6
  import PersonalMeetingRoomRequest from './request';
@@ -63,11 +62,11 @@ export default class PersonalMeetingRoom extends StatelessWebexPlugin {
63
62
  /**
64
63
  * The meeting info request server interface
65
64
  * @instance
66
- * @type {MeetingInfoRequest}
65
+ * @type {MeetingInfo}
67
66
  * @private
68
67
  * @memberof PersonalMeetingRoom
69
68
  */
70
- this.meetingInfoRequest = new MeetingInfoRequest(options.parent);
69
+ this.meetingInfo = attrs.meetingInfo;
71
70
  /**
72
71
  * The pmr server request interface
73
72
  * @instance
@@ -131,11 +130,11 @@ export default class PersonalMeetingRoom extends StatelessWebexPlugin {
131
130
  */
132
131
  get() {
133
132
  const options = {
134
- type: _PERSONAL_ROOM_,
135
- destination: this.webex.internal.device.userId
133
+ type: _PERSONAL_ROOM_
134
+
136
135
  };
137
136
 
138
- return this.meetingInfoRequest.fetchMeetingInfo(options).then((pmr) => {
137
+ return this.meetingInfo.fetchMeetingInfo(options).then((pmr) => {
139
138
  if (pmr && pmr.body && pmr.body.isPmr) {
140
139
  this.set(pmr.body);
141
140
  }
@@ -9,7 +9,8 @@ import Device from '@webex/internal-plugin-device';
9
9
  import Mercury from '@webex/internal-plugin-mercury';
10
10
  import Meetings from '@webex/plugin-meetings/src/meetings';
11
11
  import {
12
- _MEETING_ID_
12
+ _MEETING_ID_,
13
+ _PERSONAL_ROOM_
13
14
  } from '@webex/plugin-meetings/src/constants';
14
15
  import MeetingInfo from '@webex/plugin-meetings/src/meeting-info/meeting-info-v2';
15
16
  import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/utilv2';
@@ -32,7 +33,8 @@ describe('plugin-meetings', () => {
32
33
  device: {
33
34
  deviceType: 'FAKE_DEVICE',
34
35
  register: sinon.stub().returns(Promise.resolve()),
35
- unregister: sinon.stub().returns(Promise.resolve())
36
+ unregister: sinon.stub().returns(Promise.resolve()),
37
+ userId: '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e'
36
38
  },
37
39
  mercury: {
38
40
  connect: sinon.stub().returns(Promise.resolve()),
@@ -60,6 +62,21 @@ describe('plugin-meetings', () => {
60
62
  method: 'POST', service: 'webex-appapi-service', resource: 'meetingInfo', body: {meetingKey: '1234323'}
61
63
  });
62
64
 
65
+ MeetingInfoUtil.getDestinationType.restore();
66
+ MeetingInfoUtil.getRequestBody.restore();
67
+ });
68
+ it('should fetch meeting info for the personal meeting room type', async () => {
69
+ sinon.stub(MeetingInfoUtil, 'getDestinationType').returns(Promise.resolve({type: 'MEETING_ID', destination: '123456'}));
70
+ sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve({meetingKey: '1234323'}));
71
+
72
+ await meetingInfo.fetchMeetingInfo({
73
+ type: _PERSONAL_ROOM_
74
+ });
75
+
76
+ assert.calledWith(webex.request, {
77
+ method: 'POST', service: 'webex-appapi-service', resource: 'meetingInfo', body: {meetingKey: '1234323'}
78
+ });
79
+
63
80
  MeetingInfoUtil.getDestinationType.restore();
64
81
  MeetingInfoUtil.getRequestBody.restore();
65
82
  });
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
3
  */
4
4
 
5
- import {assert} from '@webex/test-helper-chai';
5
+ import {assert, expect} from '@webex/test-helper-chai';
6
6
  import sinon from 'sinon';
7
7
  import {
8
8
  _MEETING_ID_,
@@ -14,8 +14,23 @@ import {
14
14
  _MEETING_UUID_
15
15
  } from '@webex/plugin-meetings/src/constants';
16
16
  import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/utilv2';
17
+ import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
18
+ import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
17
19
 
18
20
  describe('plugin-meetings', () => {
21
+ const logger = {
22
+ log: () => {},
23
+ error: () => {},
24
+ warn: () => {},
25
+ trace: () => {},
26
+ debug: () => {}
27
+ };
28
+
29
+ beforeEach(() => {
30
+ LoggerConfig.set({verboseEvents: true, enable: false});
31
+ LoggerProxy.set(logger);
32
+ });
33
+
19
34
  describe('Meeting Info Utils V2', () => {
20
35
  beforeEach(() => {
21
36
  MeetingInfoUtil.getHydraId = sinon.stub().returns(false);
@@ -68,18 +83,78 @@ describe('plugin-meetings', () => {
68
83
  assert.equal(res.type, _CONVERSATION_URL_);
69
84
  assert.equal(res.destination, 'https://conv-a.wbx2.com/conversation/api/v1/conversations/bfb49280');
70
85
  });
86
+
87
+ describe('PMR', () => {
88
+ const mockedListReturn = {userId: '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e', orgId: '1eb65fdf-9643-417f-9974-ad72cae0e10f'};
89
+ const mockedList = {
90
+ items: [{
91
+ id: 'Y2lzY29zcGFyazovL3VzL1BFT1BMRS8wMTgyNGI5Yi1hZGVmLTRiMTAtYjVjMS04YTJmZTJmYjdjMGU',
92
+ orgId: 'Y2lzY29zcGFyazovL3VzL09SR0FOSVpBVElPTi8xZWI2NWZkZi05NjQzLTQxN2YtOTk3NC1hZDcyY2FlMGUxMGY'
93
+ }]
94
+
95
+ };
96
+
97
+ it('should return a userID and orgID without passing a destination', async () => {
98
+ const res = await MeetingInfoUtil.getDestinationType({
99
+ type: _PERSONAL_ROOM_,
100
+ webex: {
101
+ internal: {
102
+ device: {
103
+ userId: '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e',
104
+ orgId: '1eb65fdf-9643-417f-9974-ad72cae0e10f'
105
+ }
106
+ }
107
+ }
108
+ });
109
+
110
+ expect(res.destination.userId).to.equal('01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e');
111
+ expect(res.destination.orgId).to.equal('1eb65fdf-9643-417f-9974-ad72cae0e10f');
112
+ });
113
+
114
+ it('should return a userID and orgID when passing an email', async () => {
115
+ const res = await MeetingInfoUtil.getDestinationType({
116
+ type: _PERSONAL_ROOM_,
117
+ destination: 'amritesi@cisco.com',
118
+ webex: {
119
+ people: {list: sinon.stub().returns(mockedList)}
120
+
121
+ }
122
+ });
123
+ const {orgId, userId} = res.destination;
124
+
125
+ expect(userId).to.equal(mockedListReturn.userId);
126
+ expect(orgId).to.equal(mockedListReturn.orgId);
127
+ });
128
+
129
+ it('should return a userID and orgID when passing an id', async () => {
130
+ const res = await MeetingInfoUtil.getDestinationType({
131
+ type: _PERSONAL_ROOM_,
132
+ destination: '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e',
133
+ webex: {
134
+ people: {list: sinon.stub().returns(mockedList)}
135
+ }
136
+
137
+ });
138
+ const {orgId, userId} = res.destination;
139
+
140
+ expect(userId).to.equal(mockedListReturn.userId);
141
+ expect(orgId).to.equal(mockedListReturn.orgId);
142
+ });
143
+ });
71
144
  });
72
145
 
73
146
  describe('#getRequestBody', () => {
74
147
  it('for _PERSONAL_ROOM_', () => {
75
148
  const res = MeetingInfoUtil.getRequestBody({
76
149
  type: _PERSONAL_ROOM_,
77
- destination: 'userId_1234'
150
+ destination: {
151
+ userId: '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e',
152
+ orgId: '1eb65fdf-9643-417f-9974-ad72cae0e10f'
153
+ }
78
154
  });
79
155
 
80
- assert.equal(res.orgId, '');
81
- assert.equal(res.userId, 'userId_1234');
82
- assert.isTrue(res.supportHostKey);
156
+ assert.equal(res.orgId, '1eb65fdf-9643-417f-9974-ad72cae0e10f');
157
+ assert.equal(res.userId, '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e');
83
158
  });
84
159
 
85
160
  it('for _MEETING_ID_', () => {
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ import {assert} from '@webex/test-helper-chai';
6
+ import sinon from 'sinon';
7
+ import {
8
+ _PERSONAL_ROOM_
9
+ } from '@webex/plugin-meetings/src/constants';
10
+ import PersonalMeetingRoom from '@webex/plugin-meetings/src/personal-meeting-room';
11
+
12
+ describe('personal-meeting-room', () => {
13
+ let meetingInfo;
14
+ let pmr;
15
+
16
+ beforeEach(() => {
17
+ meetingInfo = {
18
+ fetchMeetingInfo: sinon.stub().returns(Promise.resolve(
19
+ {body: {isPmr: true}}
20
+ ))
21
+ };
22
+ pmr = new PersonalMeetingRoom({meetingInfo}, {parent: {}});
23
+ });
24
+
25
+
26
+ describe('#get()', () => {
27
+ it('returns personal meeting room info', async () => {
28
+ await pmr.get();
29
+ assert.calledOnce(meetingInfo.fetchMeetingInfo);
30
+ assert.calledWith(meetingInfo.fetchMeetingInfo, {type: _PERSONAL_ROOM_});
31
+ });
32
+ });
33
+ });