Skip to content

Commit

Permalink
ULMS-3209 Added agent_label to some requests
Browse files Browse the repository at this point in the history
  • Loading branch information
dkvovik committed Aug 1, 2024
1 parent 6800afd commit fa628f9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 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": "7.9.8",
"version": "7.9.9-dev.0-ULMS-3209",
"description": "JavaScript API clients for ULMS platform",
"keywords": [],
"homepage": "https://github.com/foxford/ulms-api-clients-js#readme",
Expand Down
43 changes: 34 additions & 9 deletions src/ulms.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ const eventEndpoints = {
*/

class ULMS extends BasicClient {
agentLabel

setAgentLabel(label) {
this.agentLabel = label
}

/**
* Scope kind enum
* @returns {{CHAT: string, MINIGROUP: string, P2P: string, WEBINAR: string}}
Expand Down Expand Up @@ -237,7 +243,9 @@ class ULMS extends BasicClient {
* @returns {Promise}
*/
createRtc(roomId) {
return this.post(this.url(`/conference_rooms/${roomId}/rtcs`))
return this.post(this.url(`/conference_rooms/${roomId}/rtcs`), {
agent_label: this.agentLabel,
})
}

/**
Expand All @@ -255,6 +263,7 @@ class ULMS extends BasicClient {
label,
) {
const payload = {
agent_label: this.agentLabel,
intent,
jsep,
label,
Expand Down Expand Up @@ -415,7 +424,11 @@ class ULMS extends BasicClient {
* @returns {Promise}
*/
readAgentReaderConfig(roomId) {
return this.get(this.url(`/conference_rooms/${roomId}/configs/reader`))
return this.get(
this.url(`/conference_rooms/${roomId}/configs/reader`, {
agent_label: this.agentLabel,
}),
)
}

/**
Expand All @@ -424,7 +437,11 @@ class ULMS extends BasicClient {
* @returns {Promise}
*/
readAgentWriterConfig(roomId) {
return this.get(this.url(`/conference_rooms/${roomId}/configs/writer`))
return this.get(
this.url(`/conference_rooms/${roomId}/configs/writer`, {
agent_label: this.agentLabel,
}),
)
}

/**
Expand Down Expand Up @@ -574,9 +591,12 @@ class ULMS extends BasicClient {
* @returns {Promise}
*/
readGroups(roomId, filterParameters) {
return this.get(
this.url(`/conference_rooms/${roomId}/groups`, filterParameters),
)
const parameters = {
agent_label: this.agentLabel,
...filterParameters,
}

return this.get(this.url(`/conference_rooms/${roomId}/groups`, parameters))
}

/**
Expand All @@ -592,11 +612,16 @@ class ULMS extends BasicClient {
/**
* Update Groups
* @param roomId
* @param {GroupConfig[]} payload
* @param {GroupConfig[]} groups
* @returns {Promise}
*/
updateGroups(roomId, payload) {
return this.post(this.url(`/conference_rooms/${roomId}/groups`), payload)
updateGroups(roomId, groups) {
const parameters = {
agent_label: this.agentLabel,
groups,
}

return this.post(this.url(`/conference_rooms/${roomId}/groups`), parameters)
}

/**
Expand Down

0 comments on commit fa628f9

Please sign in to comment.