@webex/plugin-rooms 2.29.3 → 2.29.5

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/rooms.js CHANGED
@@ -183,7 +183,7 @@ var Rooms = _webexCore.WebexPlugin.extend({
183
183
 
184
184
  /**
185
185
  * Returns a list of rooms. In most cases the results will only contain rooms
186
- * that the authentiated user is a member of.
186
+ * that the authenticated user is a member of.
187
187
  * @instance
188
188
  * @memberof Rooms
189
189
  * @param {Object} options
@@ -227,11 +227,11 @@ var Rooms = _webexCore.WebexPlugin.extend({
227
227
 
228
228
  /**
229
229
  * Returns a list of rooms with details about the data of the last
230
- * actvity in the room, and the date of the users last presences in
230
+ * activity in the room, and the date of the users last presences in
231
231
  * the room. The list is sorted with this with most recent activity first
232
232
  *
233
233
  * For rooms where lastActivityDate > lastSeenDate the space
234
- * can be considerd to be "unread"
234
+ * can be considered to be "unread"
235
235
  *
236
236
  * This differs from the rooms.list() function in the following ways:
237
237
  * -- when called with no parameters it returns an array of all
@@ -241,7 +241,7 @@ var Rooms = _webexCore.WebexPlugin.extend({
241
241
  * -- For users with hundreds of spaces, this API can take some time to
242
242
  * to return, for this reason it supports an optional maxRecent parameter.
243
243
  * If set this will return only the specified number of spaces with activity
244
- * in the last two weeks. Reccomended value is 30. Max supported is 100.
244
+ * in the last two weeks. Recommended value is 30. Max supported is 100.
245
245
  * -- only "id", "type", "lastActivityDate", and "lastSeenDate" are
246
246
  * guaranteed to be available for each room in the list
247
247
  * -- "title" is usually returned, but not guaranteed
@@ -259,7 +259,7 @@ var Rooms = _webexCore.WebexPlugin.extend({
259
259
  * Not all spaces may be returned, for example when users in more than 1000
260
260
  * spaces, or when a new spaces is added after this function is called,
261
261
  * but before it returns. Custom clients should be prepared to gracefully
262
- * andle cases where an event occurs in a space not returned by this call,
262
+ * handle cases where an event occurs in a space not returned by this call,
263
263
  * by querying rooms.getWithReadStatus() with the id of the room in question
264
264
  *
265
265
  * This function may be deprecated when this info is provided in the membership
@@ -324,11 +324,11 @@ var Rooms = _webexCore.WebexPlugin.extend({
324
324
 
325
325
  /**
326
326
  * Returns a single room object with details about the data of the last
327
- * actvity in the room, and the date of the users last presence in
327
+ * activity in the room, and the date of the users last presence in
328
328
  * the room.
329
329
  *
330
330
  * For rooms where lastActivityDate > lastSeenDate the room
331
- * can be considerd to be "unread"
331
+ * can be considered to be "unread"
332
332
  *
333
333
  * This differs from the rooms.get() function in the following ways:
334
334
  * -- it takes a single roomId parameter to fetch
@@ -496,7 +496,7 @@ var Rooms = _webexCore.WebexPlugin.extend({
496
496
 
497
497
  /**
498
498
  * Constructs the data object for an event on the rooms resource,
499
- * adhering to Hydra's Webehook data structure.
499
+ * adhering to Hydra's Webhook data structure.
500
500
  * External users of the SDK should not call this function
501
501
  * @private
502
502
  * @memberof Rooms
@@ -550,7 +550,7 @@ var Rooms = _webexCore.WebexPlugin.extend({
550
550
  return null;
551
551
  }
552
552
  },
553
- version: "2.29.3"
553
+ version: "2.29.5"
554
554
  });
555
555
 
556
556
  var _default = Rooms;
package/dist/rooms.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["debug","require","Rooms","WebexPlugin","extend","listen","createEventEnvelope","webex","SDK_EVENT","EXTERNAL","RESOURCE","ROOMS","then","envelope","eventEnvelope","internal","mercury","connect","listenTo","INTERNAL","WEBEX_ACTIVITY","event","onWebexApiEvent","create","room","request","method","service","resource","body","res","get","options","id","qs","items","list","Page","listWithReadStatus","maxRecent","now","Date","activitiesLimit","computeTitleIfEmpty","conversationsLimit","isActive","sinceDate","setDate","getDate","reject","Error","services","waitForCatalog","conversation","conversations","buildRoomInfoList","getWithReadStatus","roomId","deconstructedId","deconstructHydraId","cluster","convo","buildRoomInfo","remove","statusCode","undefined","update","activity","data","verb","ACTIVITY_VERB","CREATE","roomCreatedEvent","getRoomEvent","EVENT_TYPE","CREATED","trigger","UPDATE","LOCK","UNLOCK","roomUpdatedEvent","UPDATED","sdkEvent","getHydraClusterString","url","tags","object","created","published","actorId","buildHydraPersonId","actor","entryUUID","buildHydraRoomId","target","creatorId","lastActivity","creatorUUID","type","getHydraRoomType","isLocked","includes","ACTIVITY_TAG","LOCKED","e","logger","error","message","title","displayName","computedTitle","lastActivityDate","lastReadableActivityDate","lastRelevantActivityDate","roomInfo","lastSeenActivityDate","toISOString","resolve","roomReadInfo","roomInfoPromises","push","all","roomInfoList","sort","a","b"],"sources":["rooms.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin, Page} from '@webex/webex-core';\nimport {cloneDeep} from 'lodash';\nimport {\n SDK_EVENT,\n createEventEnvelope,\n buildHydraPersonId,\n buildHydraRoomId,\n getHydraClusterString,\n getHydraRoomType,\n deconstructHydraId\n} from '@webex/common';\n\nconst debug = require('debug')('rooms');\n\n/**\n * @typedef {Object} RoomObject\n * @property {string} id - (server generated) Unique identifier for the room\n * @property {string} title - The display name for the room. All room members\n * will see the title so make it something good\n * @property {string} teamId - (optional) The ID of the team to which the room\n * belongs\n * @property {isoDate} created - (server generated) The date and time that the\n * room was created\n */\n\n/**\n * Rooms are virtual meeting places for getting stuff done. This resource\n * represents the room itself. Check out the {@link Memberships} API to learn\n * how to add and remove people from rooms and the {@link Messages} API for\n * posting and managing content.\n * @class\n * @name Rooms\n */\nconst Rooms = WebexPlugin.extend({\n /**\n * Register to listen for incoming rooms events\n * This is an alternate approach to registering for rooms webhooks.\n * The events passed to any registered handlers will be similar to the webhook JSON,\n * but will omit webhook specific fields such as name, secret, url, etc.\n * To utilize the `listen()` method, the authorization token used\n * will need to have `spark:all` and `spark:kms` scopes enabled.\n * Note that by configuring your application to enable or disable `spark:all`\n * via its configuration page will also enable or disable `spark:kms`.\n * See the <a href=\"https://webex.github.io/webex-js-sdk/samples/browser-socket/\">Sample App</a>\n * for more details.\n * @instance\n * @memberof Rooms\n * @returns {Promise}\n * @example\n * webex.rooms.listen()\n * .then(() => {\n * console.log('listening to room events');\n * webex.rooms.on('created', (event) => console.log(`Got a room:created event:\\n${event}`);\n * webex.rooms.on('updated', (event) => console.log(`Got a room:updated event:\\n${event}`);\n * })\n * .catch((e) => console.error(`Unable to register for room events: ${e}`));\n * // Some app logic...\n * // WHen it is time to cleanup\n * webex.rooms.stopListening();\n * webex.rooms.off('created');\n * webex.rooms.off('updated');\n */\n listen() {\n return createEventEnvelope(this.webex, SDK_EVENT.EXTERNAL.RESOURCE.ROOMS)\n .then((envelope) => {\n this.eventEnvelope = envelope;\n\n return this.webex.internal.mercury.connect().then(() => {\n this.listenTo(this.webex.internal.mercury,\n SDK_EVENT.INTERNAL.WEBEX_ACTIVITY,\n (event) => this.onWebexApiEvent(event));\n });\n });\n },\n\n /**\n * Creates a new room. The authenticated user is automatically added as a\n * member of the room. See the {@link Memberships} API to learn how to add\n * more people to the room.\n * @instance\n * @memberof Rooms\n * @param {RoomObject} room\n * @returns {Promise<RoomObject>}\n * @example\n * webex.rooms.create({title: 'Create Room Example'})\n * .then(function(room) {\n * var assert = require('assert')\n * assert(typeof room.created === 'string');\n * assert(typeof room.id === 'string');\n * assert(room.title === 'Create Room Example');\n * console.log(room.title);\n * return 'success';\n * });\n * // => success\n */\n create(room) {\n return this.request({\n method: 'POST',\n service: 'hydra',\n resource: 'rooms',\n body: room\n })\n .then((res) => res.body);\n },\n\n /**\n * Returns a single room.\n * @instance\n * @memberof Rooms\n * @param {RoomObject|string} room\n * @param {Object} options\n * @returns {Promise<RoomObject>}\n * @example\n * var room;\n * webex.rooms.create({title: 'Get Room Example'})\n * .then(function(r) {\n * room = r\n * return webex.rooms.get(room.id)\n * })\n * .then(function(r) {\n * var assert = require('assert');\n * assert.deepEqual(r, room);\n * return 'success';\n * });\n * // => success\n */\n get(room, options) {\n const id = room.id || room;\n\n return this.request({\n service: 'hydra',\n resource: `rooms/${id}`,\n qs: options\n })\n .then((res) => res.body.items || res.body);\n },\n\n /**\n * Returns a list of rooms. In most cases the results will only contain rooms\n * that the authentiated user is a member of.\n * @instance\n * @memberof Rooms\n * @param {Object} options\n * @param {Object} options.max Limit the maximum number of rooms in the\n * response.\n * @returns {Promise<Page<RoomObject>>}\n * @example\n * var createdRooms;\n * Promise.all([\n * webex.rooms.create({title: 'List Rooms Example 1'}),\n * webex.rooms.create({title: 'List Rooms Example 2'}),\n * webex.rooms.create({title: 'List Rooms Example 3'})\n * ])\n * .then(function(r) {\n * createdRooms = r;\n * return webex.rooms.list({max: 3})\n * .then(function(rooms) {\n * var assert = require('assert');\n * assert(rooms.length === 3);\n * for (var i = 0; i < rooms.items.length; i+= 1) {\n * assert(createdRooms.filter(function(room) {\n * return room.id === rooms.items[i].id;\n * }).length === 1);\n * }\n * return 'success';\n * });\n * });\n * // => success\n */\n list(options) {\n return this.request({\n service: 'hydra',\n resource: 'rooms/',\n qs: options\n })\n .then((res) => new Page(res, this.webex));\n },\n\n /**\n * Returns a list of rooms with details about the data of the last\n * actvity in the room, and the date of the users last presences in\n * the room. The list is sorted with this with most recent activity first\n *\n * For rooms where lastActivityDate > lastSeenDate the space\n * can be considerd to be \"unread\"\n *\n * This differs from the rooms.list() function in the following ways:\n * -- when called with no parameters it returns an array of all\n * spaces, up to 1000, that the user is a member of\n * -- pagination is not supported. ALL rooms are returned which\n * can result in a large payload\n * -- For users with hundreds of spaces, this API can take some time to\n * to return, for this reason it supports an optional maxRecent parameter.\n * If set this will return only the specified number of spaces with activity\n * in the last two weeks. Reccomended value is 30. Max supported is 100.\n * -- only \"id\", \"type\", \"lastActivityDate\", and \"lastSeenDate\" are\n * guaranteed to be available for each room in the list\n * -- \"title\" is usually returned, but not guaranteed\n *\n * In general this function should be used only when the client needs to\n * access read status info, for example on startup.\n * After startup, clients should track message and membership:seen events\n * to maintain read status client side.\n *\n * Since this API can take some time to return up to 1000 spaces, it is\n * recommended that custom clients call this first with the maxRecent parameter\n * set to 30, so that they can display some of the more recents spaces. Calling\n * this API a second time with no parameters will return all the spaces.\n *\n * Not all spaces may be returned, for example when users in more than 1000\n * spaces, or when a new spaces is added after this function is called,\n * but before it returns. Custom clients should be prepared to gracefully\n * andle cases where an event occurs in a space not returned by this call,\n * by querying rooms.getWithReadStatus() with the id of the room in question\n *\n * This function may be deprecated when this info is provided in the membership\n * objects returned in the list function.\n * @instance\n * @param {int} maxRecent\n * @memberof Rooms\n * @returns {Promise<RoomInfoObjectList>}\n */\n async listWithReadStatus(maxRecent = 0) {\n const now = new Date();\n const options = {\n activitiesLimit: 0,\n computeTitleIfEmpty: true,\n conversationsLimit: 1000,\n isActive: true\n };\n\n if (maxRecent > 0) {\n options.conversationsLimit = maxRecent;\n options.sinceDate = now.setDate(now.getDate() - 14);\n }\n else if ((maxRecent < 0) || (maxRecent > 100)) {\n return Promise.reject(new Error('rooms.listWithReadStatus: ' +\n 'optional maxRecent parameter must be an integer between 1 and 100'));\n }\n\n return this.webex.internal.services.waitForCatalog('postauth')\n .then(() => this.webex.internal.conversation.list(options))\n .then((conversations) => buildRoomInfoList(this.webex, conversations));\n },\n\n /**\n * Returns a single room object with details about the data of the last\n * actvity in the room, and the date of the users last presence in\n * the room.\n *\n * For rooms where lastActivityDate > lastSeenDate the room\n * can be considerd to be \"unread\"\n *\n * This differs from the rooms.get() function in the following ways:\n * -- it takes a single roomId parameter to fetch\n * -- no other options are considered\n * -- only \"id\", \"type\", \"lastActivityDate\", and \"lastSeenDate\" are\n * guaranteed to be available in the return object\n * -- \"title\" is usually returned, but not guaranteed\n *\n * In general clients should use the listWithReadStatus() method on startup\n * to get the initial roomStatus and then update their client side copy by\n * responding to message, membership and room events.\n\n * This function allows a custom client to be \"nimble\" if it is responding\n * to an event with a roomId that was not in the original fetch. The\n * anticipated behavior is that getWithReadStats is called \"just in time\",\n * with the resulting room object being added to the list of cached room\n * objects on the client side.\n *\n * This function may be deprecated when this info is provided in the room\n * object returned in the get function.\n * @instance\n * @memberof Rooms\n * @param {string} roomId\n * @returns {Promise<RoomInfoObject>}\n */\n getWithReadStatus(roomId) {\n const deconstructedId = deconstructHydraId(roomId);\n const conversation = {\n id: deconstructedId.id,\n cluster: deconstructedId.cluster\n };\n\n return this.webex.internal.services.waitForCatalog('postauth')\n .then(() => this.webex.internal.conversation.get(conversation,\n {\n computeTitleIfEmpty: true,\n activitiesLimit: 0 // don't send the whole history of activity\n })\n .then((convo) => buildRoomInfo(this.webex, convo)));\n },\n\n /**\n * Deletes a single room.\n * @instance\n * @memberof Rooms\n * @param {RoomObject|string} room\n * @returns {Promise}\n * @example\n * var room;\n * webex.rooms.create({title: 'Remove Room Example'})\n * .then(function(r) {\n * room = r;\n * return webex.rooms.remove(room.id);\n * })\n * .then(function() {\n * return webex.rooms.get(room.id);\n * })\n * .then(function() {\n * var assert = require('assert');\n * assert(false, 'the previous get should have failed');\n * })\n * .catch(function(reason) {\n * var assert = require('assert');\n * assert.equal(reason.statusCode, 404);\n * return 'success'\n * });\n * // => success\n */\n remove(room) {\n const id = room.id || room;\n\n return this.request({\n method: 'DELETE',\n service: 'hydra',\n resource: `rooms/${id}`\n })\n .then((res) => {\n // Firefox has some issues with 204s and/or DELETE. This should move to\n // http-core\n if (res.statusCode === 204) {\n return undefined;\n }\n\n return res.body;\n });\n },\n\n /**\n * Used to update a single room's properties.\n * @instance\n * @memberof Rooms\n * @param {RoomObject} room\n * @returns {Promise<RoomObject>}\n * @example\n * var room;\n * webex.rooms.update({title: 'Update Room Example'})\n * .then(function(r) {\n * room = r;\n * room.title = 'Update Room Example (Updated Title)';\n * return webex.rooms.update(room);\n * })\n * .then(function() {\n * return webex.rooms.get(room.id);\n * })\n * .then(function(room) {\n * var assert = require('assert');\n * assert.equal(room.title, 'Update Room Example (Updated Title)');\n * return 'success';\n * });\n * // => success\n */\n update(room) {\n const {id} = room;\n\n return this.request({\n method: 'PUT',\n service: 'hydra',\n resource: `rooms/${id}`,\n body: room\n })\n .then((res) => res.body);\n },\n\n /**\n * This function is called when an internal membership events fires,\n * if the user registered for these events with the listen() function.\n * External users of the SDK should not call this function\n * @private\n * @memberof Rooms\n * @param {Object} event\n * @returns {void}\n */\n onWebexApiEvent(event) {\n const {activity} = event.data;\n\n /* eslint-disable no-case-declarations */\n switch (activity.verb) {\n case SDK_EVENT.INTERNAL.ACTIVITY_VERB.CREATE:\n const roomCreatedEvent =\n this.getRoomEvent(this.webex, activity, SDK_EVENT.EXTERNAL.EVENT_TYPE.CREATED);\n\n if (roomCreatedEvent) {\n debug(`room \"created\" payload: \\\n ${JSON.stringify(roomCreatedEvent)}`);\n this.trigger(SDK_EVENT.EXTERNAL.EVENT_TYPE.CREATED, roomCreatedEvent);\n }\n break;\n\n case SDK_EVENT.INTERNAL.ACTIVITY_VERB.UPDATE:\n case SDK_EVENT.INTERNAL.ACTIVITY_VERB.LOCK:\n case SDK_EVENT.INTERNAL.ACTIVITY_VERB.UNLOCK:\n debug(`generating a rooms:updated based on ${activity.verb} activity`);\n const roomUpdatedEvent =\n this.getRoomEvent(this.webex, activity, SDK_EVENT.EXTERNAL.EVENT_TYPE.UPDATED);\n\n if (roomUpdatedEvent) {\n debug(`room \"updated\" payload: \\\n ${JSON.stringify(roomUpdatedEvent)}`);\n this.trigger(SDK_EVENT.EXTERNAL.EVENT_TYPE.UPDATED, roomUpdatedEvent);\n }\n break;\n\n default:\n break;\n }\n },\n\n /**\n * Constructs the data object for an event on the rooms resource,\n * adhering to Hydra's Webehook data structure.\n * External users of the SDK should not call this function\n * @private\n * @memberof Rooms\n * @param {Object} webex sdk instance\n * @param {Object} activity from mercury\n * @param {Object} event type of \"webhook\" event\n * @returns {Object} constructed event\n */\n getRoomEvent(webex, activity, event) {\n try {\n const sdkEvent = cloneDeep(this.eventEnvelope);\n const cluster = getHydraClusterString(webex, activity.url);\n let {tags} = activity.object;\n\n sdkEvent.event = event;\n sdkEvent.data.created = activity.published;\n sdkEvent.actorId = buildHydraPersonId(activity.actor.entryUUID, cluster);\n if (activity.object.id) {\n sdkEvent.data.id = buildHydraRoomId(activity.object.id, cluster);\n }\n else {\n sdkEvent.data.id = buildHydraRoomId(activity.target.id, cluster);\n }\n\n if (event === SDK_EVENT.EXTERNAL.EVENT_TYPE.CREATED) {\n sdkEvent.data.creatorId = buildHydraPersonId(activity.actor.entryUUID, cluster);\n sdkEvent.data.lastActivity = activity.published;\n }\n else if (event === SDK_EVENT.EXTERNAL.EVENT_TYPE.UPDATED) {\n if (activity.verb === 'update') {\n // For some reason the tags are not in the object for an update activity\n tags = activity.target.tags;\n }\n if (activity.object.creatorUUID) {\n // This seems to be set in lock/unlock activities but not updated...\n debug(`Found a creatorId: ${activity.object.creatorUUID} in a ${activity.verb} event`);\n sdkEvent.data.creatorId = buildHydraPersonId(activity.object.creatorUUID, cluster);\n }\n // Webhook engine team sets this based on lastReadableActivityDate\n // in the activity.target object. See: hydra/HydraRoom.java#L51\n // This elements seems to be missing from the activity that the SDK is getting\n // sdkEvent.data.lastActivity = activity.target.lastReadableActivityDate;\n }\n else {\n throw new Error('unexpected event type');\n }\n sdkEvent.data.type = getHydraRoomType(tags);\n sdkEvent.data.isLocked =\n tags.includes(SDK_EVENT.INTERNAL.ACTIVITY_TAG.LOCKED);\n\n return sdkEvent;\n }\n catch (e) {\n this.webex.logger.error(`Unable to generate SDK event from mercury socket activity for rooms:${event} event: ${e.message}`);\n\n return null;\n }\n }\n\n});\n\nexport default Rooms;\n\n/**\n * Helper method to build a roomInfo object from a conversation object\n * @param {Object} webex sdk object\n * @param {Conversation~ConversationObject} conversation\n * @returns {Promise<RoomInfoObject>}\n */\nasync function buildRoomInfo(webex, conversation) {\n try {\n const type = getHydraRoomType(conversation.tags);\n const cluster = getHydraClusterString(webex, conversation.url);\n const title = conversation.displayName ?\n conversation.displayName : conversation.computedTitle;\n const lastActivityDate = conversation.lastReadableActivityDate ?\n conversation.lastReadableActivityDate :\n conversation.lastRelevantActivityDate;\n\n const roomInfo = {\n id: buildHydraRoomId(conversation.id, cluster),\n type,\n ...(title && {title: conversation.displayName}),\n ...(lastActivityDate && {lastActivityDate}),\n lastSeenActivityDate: conversation.lastSeenActivityDate ?\n conversation.lastSeenActivityDate :\n // If user has never been seen set the date to \"a long time ago\"\n new Date(0).toISOString()\n };\n\n return Promise.resolve(roomInfo);\n }\n catch (e) {\n return Promise.reject(e);\n }\n}\n\n/**\n * Helper method to build a list of roomInfo object from conversation list\n * @param {Object} webex sdk object\n * @param {Conversation~ConversationObjectList} conversations\n * @returns {Promise<RoomInfoList>}\n */\nasync function buildRoomInfoList(webex, conversations) {\n // Convert each Conversation into a roomInfo object\n const roomReadInfo = {items: []};\n const roomInfoPromises = [];\n\n for (const conversation of conversations) {\n roomInfoPromises.push(buildRoomInfo(webex, conversation));\n }\n\n return Promise.all(roomInfoPromises)\n .then((roomInfoList) => {\n roomReadInfo.items = roomInfoList;\n roomReadInfo.items.sort((a, b) => (a.lastActivityDate < b.lastActivityDate ? 1 : -1));\n\n return roomReadInfo;\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;;;;;;;;;;;AAUA,IAAMA,KAAK,GAAGC,OAAO,CAAC,OAAD,CAAP,CAAiB,OAAjB,CAAd;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,IAAMC,KAAK,GAAGC,sBAAA,CAAYC,MAAZ,CAAmB;EAC/B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,MA7B+B,oBA6BtB;IAAA;;IACP,OAAO,IAAAC,2BAAA,EAAoB,KAAKC,KAAzB,EAAgCC,iBAAA,CAAUC,QAAV,CAAmBC,QAAnB,CAA4BC,KAA5D,EACJC,IADI,CACC,UAACC,QAAD,EAAc;MAClB,KAAI,CAACC,aAAL,GAAqBD,QAArB;MAEA,OAAO,KAAI,CAACN,KAAL,CAAWQ,Q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AAIC,CAAJ;gBAAA,OAAWD,CAAC,CAACb,gBAAF,GAAqBc,CAAC,CAACd,gBAAvB,GAA0C,CAA1C,GAA8C,CAAC,CAA1D;cAAA,CAAxB;cAEA,OAAOO,YAAP;YACD,CANI,CATT;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C"}
1
+ {"version":3,"names":["debug","require","Rooms","WebexPlugin","extend","listen","createEventEnvelope","webex","SDK_EVENT","EXTERNAL","RESOURCE","ROOMS","then","envelope","eventEnvelope","internal","mercury","connect","listenTo","INTERNAL","WEBEX_ACTIVITY","event","onWebexApiEvent","create","room","request","method","service","resource","body","res","get","options","id","qs","items","list","Page","listWithReadStatus","maxRecent","now","Date","activitiesLimit","computeTitleIfEmpty","conversationsLimit","isActive","sinceDate","setDate","getDate","reject","Error","services","waitForCatalog","conversation","conversations","buildRoomInfoList","getWithReadStatus","roomId","deconstructedId","deconstructHydraId","cluster","convo","buildRoomInfo","remove","statusCode","undefined","update","activity","data","verb","ACTIVITY_VERB","CREATE","roomCreatedEvent","getRoomEvent","EVENT_TYPE","CREATED","trigger","UPDATE","LOCK","UNLOCK","roomUpdatedEvent","UPDATED","sdkEvent","getHydraClusterString","url","tags","object","created","published","actorId","buildHydraPersonId","actor","entryUUID","buildHydraRoomId","target","creatorId","lastActivity","creatorUUID","type","getHydraRoomType","isLocked","includes","ACTIVITY_TAG","LOCKED","e","logger","error","message","title","displayName","computedTitle","lastActivityDate","lastReadableActivityDate","lastRelevantActivityDate","roomInfo","lastSeenActivityDate","toISOString","resolve","roomReadInfo","roomInfoPromises","push","all","roomInfoList","sort","a","b"],"sources":["rooms.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin, Page} from '@webex/webex-core';\nimport {cloneDeep} from 'lodash';\nimport {\n SDK_EVENT,\n createEventEnvelope,\n buildHydraPersonId,\n buildHydraRoomId,\n getHydraClusterString,\n getHydraRoomType,\n deconstructHydraId\n} from '@webex/common';\n\nconst debug = require('debug')('rooms');\n\n/**\n * @typedef {Object} RoomObject\n * @property {string} id - (server generated) Unique identifier for the room\n * @property {string} title - The display name for the room. All room members\n * will see the title so make it something good\n * @property {string} teamId - (optional) The ID of the team to which the room\n * belongs\n * @property {isoDate} created - (server generated) The date and time that the\n * room was created\n */\n\n/**\n * Rooms are virtual meeting places for getting stuff done. This resource\n * represents the room itself. Check out the {@link Memberships} API to learn\n * how to add and remove people from rooms and the {@link Messages} API for\n * posting and managing content.\n * @class\n * @name Rooms\n */\nconst Rooms = WebexPlugin.extend({\n /**\n * Register to listen for incoming rooms events\n * This is an alternate approach to registering for rooms webhooks.\n * The events passed to any registered handlers will be similar to the webhook JSON,\n * but will omit webhook specific fields such as name, secret, url, etc.\n * To utilize the `listen()` method, the authorization token used\n * will need to have `spark:all` and `spark:kms` scopes enabled.\n * Note that by configuring your application to enable or disable `spark:all`\n * via its configuration page will also enable or disable `spark:kms`.\n * See the <a href=\"https://webex.github.io/webex-js-sdk/samples/browser-socket/\">Sample App</a>\n * for more details.\n * @instance\n * @memberof Rooms\n * @returns {Promise}\n * @example\n * webex.rooms.listen()\n * .then(() => {\n * console.log('listening to room events');\n * webex.rooms.on('created', (event) => console.log(`Got a room:created event:\\n${event}`);\n * webex.rooms.on('updated', (event) => console.log(`Got a room:updated event:\\n${event}`);\n * })\n * .catch((e) => console.error(`Unable to register for room events: ${e}`));\n * // Some app logic...\n * // WHen it is time to cleanup\n * webex.rooms.stopListening();\n * webex.rooms.off('created');\n * webex.rooms.off('updated');\n */\n listen() {\n return createEventEnvelope(this.webex, SDK_EVENT.EXTERNAL.RESOURCE.ROOMS)\n .then((envelope) => {\n this.eventEnvelope = envelope;\n\n return this.webex.internal.mercury.connect().then(() => {\n this.listenTo(this.webex.internal.mercury,\n SDK_EVENT.INTERNAL.WEBEX_ACTIVITY,\n (event) => this.onWebexApiEvent(event));\n });\n });\n },\n\n /**\n * Creates a new room. The authenticated user is automatically added as a\n * member of the room. See the {@link Memberships} API to learn how to add\n * more people to the room.\n * @instance\n * @memberof Rooms\n * @param {RoomObject} room\n * @returns {Promise<RoomObject>}\n * @example\n * webex.rooms.create({title: 'Create Room Example'})\n * .then(function(room) {\n * var assert = require('assert')\n * assert(typeof room.created === 'string');\n * assert(typeof room.id === 'string');\n * assert(room.title === 'Create Room Example');\n * console.log(room.title);\n * return 'success';\n * });\n * // => success\n */\n create(room) {\n return this.request({\n method: 'POST',\n service: 'hydra',\n resource: 'rooms',\n body: room\n })\n .then((res) => res.body);\n },\n\n /**\n * Returns a single room.\n * @instance\n * @memberof Rooms\n * @param {RoomObject|string} room\n * @param {Object} options\n * @returns {Promise<RoomObject>}\n * @example\n * var room;\n * webex.rooms.create({title: 'Get Room Example'})\n * .then(function(r) {\n * room = r\n * return webex.rooms.get(room.id)\n * })\n * .then(function(r) {\n * var assert = require('assert');\n * assert.deepEqual(r, room);\n * return 'success';\n * });\n * // => success\n */\n get(room, options) {\n const id = room.id || room;\n\n return this.request({\n service: 'hydra',\n resource: `rooms/${id}`,\n qs: options\n })\n .then((res) => res.body.items || res.body);\n },\n\n /**\n * Returns a list of rooms. In most cases the results will only contain rooms\n * that the authenticated user is a member of.\n * @instance\n * @memberof Rooms\n * @param {Object} options\n * @param {Object} options.max Limit the maximum number of rooms in the\n * response.\n * @returns {Promise<Page<RoomObject>>}\n * @example\n * var createdRooms;\n * Promise.all([\n * webex.rooms.create({title: 'List Rooms Example 1'}),\n * webex.rooms.create({title: 'List Rooms Example 2'}),\n * webex.rooms.create({title: 'List Rooms Example 3'})\n * ])\n * .then(function(r) {\n * createdRooms = r;\n * return webex.rooms.list({max: 3})\n * .then(function(rooms) {\n * var assert = require('assert');\n * assert(rooms.length === 3);\n * for (var i = 0; i < rooms.items.length; i+= 1) {\n * assert(createdRooms.filter(function(room) {\n * return room.id === rooms.items[i].id;\n * }).length === 1);\n * }\n * return 'success';\n * });\n * });\n * // => success\n */\n list(options) {\n return this.request({\n service: 'hydra',\n resource: 'rooms/',\n qs: options\n })\n .then((res) => new Page(res, this.webex));\n },\n\n /**\n * Returns a list of rooms with details about the data of the last\n * activity in the room, and the date of the users last presences in\n * the room. The list is sorted with this with most recent activity first\n *\n * For rooms where lastActivityDate > lastSeenDate the space\n * can be considered to be \"unread\"\n *\n * This differs from the rooms.list() function in the following ways:\n * -- when called with no parameters it returns an array of all\n * spaces, up to 1000, that the user is a member of\n * -- pagination is not supported. ALL rooms are returned which\n * can result in a large payload\n * -- For users with hundreds of spaces, this API can take some time to\n * to return, for this reason it supports an optional maxRecent parameter.\n * If set this will return only the specified number of spaces with activity\n * in the last two weeks. Recommended value is 30. Max supported is 100.\n * -- only \"id\", \"type\", \"lastActivityDate\", and \"lastSeenDate\" are\n * guaranteed to be available for each room in the list\n * -- \"title\" is usually returned, but not guaranteed\n *\n * In general this function should be used only when the client needs to\n * access read status info, for example on startup.\n * After startup, clients should track message and membership:seen events\n * to maintain read status client side.\n *\n * Since this API can take some time to return up to 1000 spaces, it is\n * recommended that custom clients call this first with the maxRecent parameter\n * set to 30, so that they can display some of the more recents spaces. Calling\n * this API a second time with no parameters will return all the spaces.\n *\n * Not all spaces may be returned, for example when users in more than 1000\n * spaces, or when a new spaces is added after this function is called,\n * but before it returns. Custom clients should be prepared to gracefully\n * handle cases where an event occurs in a space not returned by this call,\n * by querying rooms.getWithReadStatus() with the id of the room in question\n *\n * This function may be deprecated when this info is provided in the membership\n * objects returned in the list function.\n * @instance\n * @param {int} maxRecent\n * @memberof Rooms\n * @returns {Promise<RoomInfoObjectList>}\n */\n async listWithReadStatus(maxRecent = 0) {\n const now = new Date();\n const options = {\n activitiesLimit: 0,\n computeTitleIfEmpty: true,\n conversationsLimit: 1000,\n isActive: true\n };\n\n if (maxRecent > 0) {\n options.conversationsLimit = maxRecent;\n options.sinceDate = now.setDate(now.getDate() - 14);\n }\n else if ((maxRecent < 0) || (maxRecent > 100)) {\n return Promise.reject(new Error('rooms.listWithReadStatus: ' +\n 'optional maxRecent parameter must be an integer between 1 and 100'));\n }\n\n return this.webex.internal.services.waitForCatalog('postauth')\n .then(() => this.webex.internal.conversation.list(options))\n .then((conversations) => buildRoomInfoList(this.webex, conversations));\n },\n\n /**\n * Returns a single room object with details about the data of the last\n * activity in the room, and the date of the users last presence in\n * the room.\n *\n * For rooms where lastActivityDate > lastSeenDate the room\n * can be considered to be \"unread\"\n *\n * This differs from the rooms.get() function in the following ways:\n * -- it takes a single roomId parameter to fetch\n * -- no other options are considered\n * -- only \"id\", \"type\", \"lastActivityDate\", and \"lastSeenDate\" are\n * guaranteed to be available in the return object\n * -- \"title\" is usually returned, but not guaranteed\n *\n * In general clients should use the listWithReadStatus() method on startup\n * to get the initial roomStatus and then update their client side copy by\n * responding to message, membership and room events.\n\n * This function allows a custom client to be \"nimble\" if it is responding\n * to an event with a roomId that was not in the original fetch. The\n * anticipated behavior is that getWithReadStats is called \"just in time\",\n * with the resulting room object being added to the list of cached room\n * objects on the client side.\n *\n * This function may be deprecated when this info is provided in the room\n * object returned in the get function.\n * @instance\n * @memberof Rooms\n * @param {string} roomId\n * @returns {Promise<RoomInfoObject>}\n */\n getWithReadStatus(roomId) {\n const deconstructedId = deconstructHydraId(roomId);\n const conversation = {\n id: deconstructedId.id,\n cluster: deconstructedId.cluster\n };\n\n return this.webex.internal.services.waitForCatalog('postauth')\n .then(() => this.webex.internal.conversation.get(conversation,\n {\n computeTitleIfEmpty: true,\n activitiesLimit: 0 // don't send the whole history of activity\n })\n .then((convo) => buildRoomInfo(this.webex, convo)));\n },\n\n /**\n * Deletes a single room.\n * @instance\n * @memberof Rooms\n * @param {RoomObject|string} room\n * @returns {Promise}\n * @example\n * var room;\n * webex.rooms.create({title: 'Remove Room Example'})\n * .then(function(r) {\n * room = r;\n * return webex.rooms.remove(room.id);\n * })\n * .then(function() {\n * return webex.rooms.get(room.id);\n * })\n * .then(function() {\n * var assert = require('assert');\n * assert(false, 'the previous get should have failed');\n * })\n * .catch(function(reason) {\n * var assert = require('assert');\n * assert.equal(reason.statusCode, 404);\n * return 'success'\n * });\n * // => success\n */\n remove(room) {\n const id = room.id || room;\n\n return this.request({\n method: 'DELETE',\n service: 'hydra',\n resource: `rooms/${id}`\n })\n .then((res) => {\n // Firefox has some issues with 204s and/or DELETE. This should move to\n // http-core\n if (res.statusCode === 204) {\n return undefined;\n }\n\n return res.body;\n });\n },\n\n /**\n * Used to update a single room's properties.\n * @instance\n * @memberof Rooms\n * @param {RoomObject} room\n * @returns {Promise<RoomObject>}\n * @example\n * var room;\n * webex.rooms.update({title: 'Update Room Example'})\n * .then(function(r) {\n * room = r;\n * room.title = 'Update Room Example (Updated Title)';\n * return webex.rooms.update(room);\n * })\n * .then(function() {\n * return webex.rooms.get(room.id);\n * })\n * .then(function(room) {\n * var assert = require('assert');\n * assert.equal(room.title, 'Update Room Example (Updated Title)');\n * return 'success';\n * });\n * // => success\n */\n update(room) {\n const {id} = room;\n\n return this.request({\n method: 'PUT',\n service: 'hydra',\n resource: `rooms/${id}`,\n body: room\n })\n .then((res) => res.body);\n },\n\n /**\n * This function is called when an internal membership events fires,\n * if the user registered for these events with the listen() function.\n * External users of the SDK should not call this function\n * @private\n * @memberof Rooms\n * @param {Object} event\n * @returns {void}\n */\n onWebexApiEvent(event) {\n const {activity} = event.data;\n\n /* eslint-disable no-case-declarations */\n switch (activity.verb) {\n case SDK_EVENT.INTERNAL.ACTIVITY_VERB.CREATE:\n const roomCreatedEvent =\n this.getRoomEvent(this.webex, activity, SDK_EVENT.EXTERNAL.EVENT_TYPE.CREATED);\n\n if (roomCreatedEvent) {\n debug(`room \"created\" payload: \\\n ${JSON.stringify(roomCreatedEvent)}`);\n this.trigger(SDK_EVENT.EXTERNAL.EVENT_TYPE.CREATED, roomCreatedEvent);\n }\n break;\n\n case SDK_EVENT.INTERNAL.ACTIVITY_VERB.UPDATE:\n case SDK_EVENT.INTERNAL.ACTIVITY_VERB.LOCK:\n case SDK_EVENT.INTERNAL.ACTIVITY_VERB.UNLOCK:\n debug(`generating a rooms:updated based on ${activity.verb} activity`);\n const roomUpdatedEvent =\n this.getRoomEvent(this.webex, activity, SDK_EVENT.EXTERNAL.EVENT_TYPE.UPDATED);\n\n if (roomUpdatedEvent) {\n debug(`room \"updated\" payload: \\\n ${JSON.stringify(roomUpdatedEvent)}`);\n this.trigger(SDK_EVENT.EXTERNAL.EVENT_TYPE.UPDATED, roomUpdatedEvent);\n }\n break;\n\n default:\n break;\n }\n },\n\n /**\n * Constructs the data object for an event on the rooms resource,\n * adhering to Hydra's Webhook data structure.\n * External users of the SDK should not call this function\n * @private\n * @memberof Rooms\n * @param {Object} webex sdk instance\n * @param {Object} activity from mercury\n * @param {Object} event type of \"webhook\" event\n * @returns {Object} constructed event\n */\n getRoomEvent(webex, activity, event) {\n try {\n const sdkEvent = cloneDeep(this.eventEnvelope);\n const cluster = getHydraClusterString(webex, activity.url);\n let {tags} = activity.object;\n\n sdkEvent.event = event;\n sdkEvent.data.created = activity.published;\n sdkEvent.actorId = buildHydraPersonId(activity.actor.entryUUID, cluster);\n if (activity.object.id) {\n sdkEvent.data.id = buildHydraRoomId(activity.object.id, cluster);\n }\n else {\n sdkEvent.data.id = buildHydraRoomId(activity.target.id, cluster);\n }\n\n if (event === SDK_EVENT.EXTERNAL.EVENT_TYPE.CREATED) {\n sdkEvent.data.creatorId = buildHydraPersonId(activity.actor.entryUUID, cluster);\n sdkEvent.data.lastActivity = activity.published;\n }\n else if (event === SDK_EVENT.EXTERNAL.EVENT_TYPE.UPDATED) {\n if (activity.verb === 'update') {\n // For some reason the tags are not in the object for an update activity\n tags = activity.target.tags;\n }\n if (activity.object.creatorUUID) {\n // This seems to be set in lock/unlock activities but not updated...\n debug(`Found a creatorId: ${activity.object.creatorUUID} in a ${activity.verb} event`);\n sdkEvent.data.creatorId = buildHydraPersonId(activity.object.creatorUUID, cluster);\n }\n // Webhook engine team sets this based on lastReadableActivityDate\n // in the activity.target object. See: hydra/HydraRoom.java#L51\n // This elements seems to be missing from the activity that the SDK is getting\n // sdkEvent.data.lastActivity = activity.target.lastReadableActivityDate;\n }\n else {\n throw new Error('unexpected event type');\n }\n sdkEvent.data.type = getHydraRoomType(tags);\n sdkEvent.data.isLocked =\n tags.includes(SDK_EVENT.INTERNAL.ACTIVITY_TAG.LOCKED);\n\n return sdkEvent;\n }\n catch (e) {\n this.webex.logger.error(`Unable to generate SDK event from mercury socket activity for rooms:${event} event: ${e.message}`);\n\n return null;\n }\n }\n\n});\n\nexport default Rooms;\n\n/**\n * Helper method to build a roomInfo object from a conversation object\n * @param {Object} webex sdk object\n * @param {Conversation~ConversationObject} conversation\n * @returns {Promise<RoomInfoObject>}\n */\nasync function buildRoomInfo(webex, conversation) {\n try {\n const type = getHydraRoomType(conversation.tags);\n const cluster = getHydraClusterString(webex, conversation.url);\n const title = conversation.displayName ?\n conversation.displayName : conversation.computedTitle;\n const lastActivityDate = conversation.lastReadableActivityDate ?\n conversation.lastReadableActivityDate :\n conversation.lastRelevantActivityDate;\n\n const roomInfo = {\n id: buildHydraRoomId(conversation.id, cluster),\n type,\n ...(title && {title: conversation.displayName}),\n ...(lastActivityDate && {lastActivityDate}),\n lastSeenActivityDate: conversation.lastSeenActivityDate ?\n conversation.lastSeenActivityDate :\n // If user has never been seen set the date to \"a long time ago\"\n new Date(0).toISOString()\n };\n\n return Promise.resolve(roomInfo);\n }\n catch (e) {\n return Promise.reject(e);\n }\n}\n\n/**\n * Helper method to build a list of roomInfo object from conversation list\n * @param {Object} webex sdk object\n * @param {Conversation~ConversationObjectList} conversations\n * @returns {Promise<RoomInfoList>}\n */\nasync function buildRoomInfoList(webex, conversations) {\n // Convert each Conversation into a roomInfo object\n const roomReadInfo = {items: []};\n const roomInfoPromises = [];\n\n for (const conversation of conversations) {\n roomInfoPromises.push(buildRoomInfo(webex, conversation));\n }\n\n return Promise.all(roomInfoPromises)\n .then((roomInfoList) => {\n roomReadInfo.items = roomInfoList;\n roomReadInfo.items.sort((a, b) => (a.lastActivityDate < b.lastActivityDate ? 1 : -1));\n\n return roomReadInfo;\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;;;;;;;;;;;AAUA,IAAMA,KAAK,GAAGC,OAAO,CAAC,OAAD,CAAP,CAAiB,OAAjB,CAAd;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,IAAMC,KAAK,GAAGC,sBAAA,CAAYC,MAAZ,CAAmB;EAC/B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,MA7B+B,oBA6BtB;IAAA;;IACP,OAAO,IAAAC,2BAAA,EAAoB,KAAKC,KAAzB,EAAgCC,iBAAA,CAAUC,QAAV,CAAmBC,QAAnB,CAA4BC,KAA5D,EACJC,IADI,CACC,UAACC,QAAD,EAAc;MAClB,KAAI,CAACC,aAAL,GAAqBD,QAArB;MAEA,OAAO,KAAI,CAACN,KAAL,CAAWQ,QAAX,CAAoBC,OAApB,CAA4BC,OAA5B,GAAsCL,IAAtC,CAA2C,YAAM;QACtD,KAAI,CAACM,QAAL,CAAc,KAAI,CAACX,KAAL,CAAWQ,QAAX,CAAoBC,OAAlC,EACER,iBAAA,CAAUW,QAAV,CAAmBC,cADrB,EAEE,UAACC,KAAD;UAAA,OAAW,KAAI,CAACC,eAAL,CAAqBD,KAArB,CAAX;QAAA,CAFF;MAGD,CAJM,CAAP;IAKD,CATI,CAAP;EAUD,CAxC8B;;EA0C/B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,MA9D+B,kBA8DxBC,IA9DwB,EA8DlB;IACX,OAAO,KAAKC,OAAL,CAAa;MAClBC,MAAM,EAAE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,EAAY2E,WAAZ;YAlBR;YAAA,kCAqBW,iBAAQC,OAAR,CAAgBH,QAAhB,CArBX;;UAAA;YAAA;YAAA;YAAA,kCAwBW,iBAAQjE,MAAR,cAxBX;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C;;;;SAkCeM,iB;;;;;+FAAf,kBAAiChD,KAAjC,EAAwC+C,aAAxC;IAAA;;IAAA;MAAA;QAAA;UAAA;YACE;YACMgE,YAFR,GAEuB;cAACnF,KAAK,EAAE;YAAR,CAFvB;YAGQoF,gBAHR,GAG2B,EAH3B;YAAA,uCAK6BjE,aAL7B;;YAAA;cAKE,oDAA0C;gBAA/BD,YAA+B;gBACxCkE,gBAAgB,CAACC,IAAjB,CAAsB1D,aAAa,CAACvD,KAAD,EAAQ8C,YAAR,CAAnC;cACD;YAPH;cAAA;YAAA;cAAA;YAAA;;YAAA,kCASS,iBAAQoE,GAAR,CAAYF,gBAAZ,EACJ3G,IADI,CACC,UAAC8G,YAAD,EAAkB;cACtBJ,YAAY,CAACnF,KAAb,GAAqBuF,YAArB;cACAJ,YAAY,CAACnF,KAAb,CAAmBwF,IAAnB,CAAwB,UAACC,CAAD,EAAIC,CAAJ;gBAAA,OAAWD,CAAC,CAACb,gBAAF,GAAqBc,CAAC,CAACd,gBAAvB,GAA0C,CAA1C,GAA8C,CAAC,CAA1D;cAAA,CAAxB;cAEA,OAAOO,YAAP;YACD,CANI,CATT;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C"}
package/package.json CHANGED
@@ -1,28 +1,36 @@
1
1
  {
2
- "name": "@webex/plugin-rooms",
3
- "version": "2.29.3",
4
- "description": "",
5
- "license": "MIT",
6
- "author": "Ian W. Remmel <iremmel@cisco.com>",
7
- "main": "dist/index.js",
8
- "devMain": "src/index.js",
9
- "repository": "https://github.com/webex/webex-js-sdk/tree/master/packages/node_modules/@webex/plugin-rooms",
10
- "engines": {
11
- "node": ">=8"
12
- },
13
- "browserify": {
14
- "transform": [
15
- "envify"
16
- ]
17
- },
18
- "dependencies": {
19
- "@babel/runtime-corejs2": "^7.14.8",
20
- "@webex/internal-plugin-conversation": "2.29.3",
21
- "@webex/internal-plugin-mercury": "2.29.3",
22
- "@webex/webex-core": "2.29.3",
23
- "lodash": "^4.17.21",
24
- "@webex/common": "2.29.3",
25
- "debug": "^4.3.4",
26
- "envify": "^4.1.0"
27
- }
2
+ "name": "@webex/plugin-rooms",
3
+ "version": "2.29.5",
4
+ "description": "",
5
+ "license": "MIT",
6
+ "main": "dist/index.js",
7
+ "devMain": "src/index.js",
8
+ "repository": "https://github.com/webex/webex-js-sdk/tree/master/packages/@webex/plugin-rooms",
9
+ "engines": {
10
+ "node": ">=14"
11
+ },
12
+ "browserify": {
13
+ "transform": [
14
+ "babelify",
15
+ "envify"
16
+ ]
17
+ },
18
+ "devDependencies": {
19
+ "@webex/test-helper-chai": "workspace:^",
20
+ "@webex/test-helper-test-users": "workspace:^",
21
+ "sinon": "^9.2.4"
22
+ },
23
+ "dependencies": {
24
+ "@webex/common": "workspace:^",
25
+ "@webex/internal-plugin-conversation": "workspace:^",
26
+ "@webex/internal-plugin-mercury": "workspace:^",
27
+ "@webex/plugin-logger": "workspace:^",
28
+ "@webex/plugin-memberships": "workspace:^",
29
+ "@webex/plugin-messages": "workspace:^",
30
+ "@webex/plugin-people": "workspace:^",
31
+ "@webex/plugin-rooms": "workspace:^",
32
+ "@webex/webex-core": "workspace:^",
33
+ "debug": "^4.3.4",
34
+ "lodash": "^4.17.21"
35
+ }
28
36
  }
package/src/rooms.js CHANGED
@@ -141,7 +141,7 @@ const Rooms = WebexPlugin.extend({
141
141
 
142
142
  /**
143
143
  * Returns a list of rooms. In most cases the results will only contain rooms
144
- * that the authentiated user is a member of.
144
+ * that the authenticated user is a member of.
145
145
  * @instance
146
146
  * @memberof Rooms
147
147
  * @param {Object} options
@@ -182,11 +182,11 @@ const Rooms = WebexPlugin.extend({
182
182
 
183
183
  /**
184
184
  * Returns a list of rooms with details about the data of the last
185
- * actvity in the room, and the date of the users last presences in
185
+ * activity in the room, and the date of the users last presences in
186
186
  * the room. The list is sorted with this with most recent activity first
187
187
  *
188
188
  * For rooms where lastActivityDate > lastSeenDate the space
189
- * can be considerd to be "unread"
189
+ * can be considered to be "unread"
190
190
  *
191
191
  * This differs from the rooms.list() function in the following ways:
192
192
  * -- when called with no parameters it returns an array of all
@@ -196,7 +196,7 @@ const Rooms = WebexPlugin.extend({
196
196
  * -- For users with hundreds of spaces, this API can take some time to
197
197
  * to return, for this reason it supports an optional maxRecent parameter.
198
198
  * If set this will return only the specified number of spaces with activity
199
- * in the last two weeks. Reccomended value is 30. Max supported is 100.
199
+ * in the last two weeks. Recommended value is 30. Max supported is 100.
200
200
  * -- only "id", "type", "lastActivityDate", and "lastSeenDate" are
201
201
  * guaranteed to be available for each room in the list
202
202
  * -- "title" is usually returned, but not guaranteed
@@ -214,7 +214,7 @@ const Rooms = WebexPlugin.extend({
214
214
  * Not all spaces may be returned, for example when users in more than 1000
215
215
  * spaces, or when a new spaces is added after this function is called,
216
216
  * but before it returns. Custom clients should be prepared to gracefully
217
- * andle cases where an event occurs in a space not returned by this call,
217
+ * handle cases where an event occurs in a space not returned by this call,
218
218
  * by querying rooms.getWithReadStatus() with the id of the room in question
219
219
  *
220
220
  * This function may be deprecated when this info is provided in the membership
@@ -249,11 +249,11 @@ const Rooms = WebexPlugin.extend({
249
249
 
250
250
  /**
251
251
  * Returns a single room object with details about the data of the last
252
- * actvity in the room, and the date of the users last presence in
252
+ * activity in the room, and the date of the users last presence in
253
253
  * the room.
254
254
  *
255
255
  * For rooms where lastActivityDate > lastSeenDate the room
256
- * can be considerd to be "unread"
256
+ * can be considered to be "unread"
257
257
  *
258
258
  * This differs from the rooms.get() function in the following ways:
259
259
  * -- it takes a single roomId parameter to fetch
@@ -423,7 +423,7 @@ const Rooms = WebexPlugin.extend({
423
423
 
424
424
  /**
425
425
  * Constructs the data object for an event on the rooms resource,
426
- * adhering to Hydra's Webehook data structure.
426
+ * adhering to Hydra's Webhook data structure.
427
427
  * External users of the SDK should not call this function
428
428
  * @private
429
429
  * @memberof Rooms