Skip to content

Commit

Permalink
ULMS-2213 Added methods for reading and updating groups (Conference)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkonst committed Jan 25, 2023
1 parent 36b3239 commit b76ad74
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ulms/api-clients",
"version": "5.11.0",
"version": "5.12.0",
"description": "JavaScript API clients for ULMS platform",
"keywords": [],
"homepage": "https://github.com/foxford/ulms-api-clients-js#readme",
Expand Down
2 changes: 2 additions & 0 deletions src/conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Conference extends Service {
* Conference events enum
* @returns {{
* AGENT_WRITER_CONFIG_UPDATE: string,
* GROUP_UPDATE: string,
* ROOM_CLOSE: string,
* ROOM_ENTER: string,
* ROOM_LEAVE: string,
Expand All @@ -35,6 +36,7 @@ class Conference extends Service {
static get events() {
return {
AGENT_WRITER_CONFIG_UPDATE: 'agent_writer_config.update',
GROUP_UPDATE: 'group.update',
ROOM_CLOSE: 'room.close',
ROOM_ENTER: 'room.enter',
ROOM_LEAVE: 'room.leave',
Expand Down
37 changes: 37 additions & 0 deletions src/http-conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ import BasicClient from './basic-client'
* @property {number} offset
*/

/**
* Group configuration
* @name GroupConfig
* @type {object}
* @property {number} number
* @property {string[]} agents
*/

/**
* Extended parameters to filter listing requests of rtc streams
* @name RtcStreamFilterParameters
Expand All @@ -36,11 +44,19 @@ import BasicClient from './basic-client'
* @property {[number | null, number | null]} time
*/

/**
* Filter parameters for groups read requests
* @name GroupsFilterParameters
* @type {object}
* @property {number} within_group
*/

class HTTPConference extends BasicClient {
/**
* Conference events enum
* @returns {{
* AGENT_WRITER_CONFIG_UPDATE: string,
* GROUP_UPDATE: string,
* ROOM_CLOSE: string,
* ROOM_ENTER: string,
* ROOM_LEAVE: string,
Expand All @@ -52,6 +68,7 @@ class HTTPConference extends BasicClient {
static get events() {
return {
AGENT_WRITER_CONFIG_UPDATE: 'agent_writer_config.update',
GROUP_UPDATE: 'group.update',
ROOM_CLOSE: 'room.close',
ROOM_ENTER: 'room.enter',
ROOM_LEAVE: 'room.leave',
Expand Down Expand Up @@ -252,6 +269,16 @@ class HTTPConference extends BasicClient {
return this.get(this.url(`/rooms/${roomId}/configs/writer`))
}

/**
* Read Groups
* @param roomId
* @param {GroupsFilterParameters|Object} filterParameters
* @returns {Promise}
*/
readGroups(roomId, filterParameters) {
return this.get(this.url(`/rooms/${roomId}/groups`, filterParameters))
}

/**
* Update AgentReaderConfig
* @param roomId
Expand All @@ -275,6 +302,16 @@ class HTTPConference extends BasicClient {

return this.post(this.url(`/rooms/${roomId}/configs/writer`), payload)
}

/**
* Update Groups
* @param roomId
* @param {GroupConfig[]} payload
* @returns {Promise}
*/
updateGroups(roomId, payload) {
return this.post(this.url(`/rooms/${roomId}/groups`), payload)
}
}

export default HTTPConference

0 comments on commit b76ad74

Please sign in to comment.