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 2, 2024
1 parent 6800afd commit 9385a84
Show file tree
Hide file tree
Showing 3 changed files with 38 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.1-ULMS-3209",
"description": "JavaScript API clients for ULMS platform",
"keywords": [],
"homepage": "https://github.com/foxford/ulms-api-clients-js#readme",
Expand Down
44 changes: 35 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 @@ -187,6 +193,7 @@ class ULMS extends BasicClient {
*/
createEvent(roomId, type, data, eventParameters = {}) {
const parameters = {
agent_label: this.agentLabel,
...eventParameters,
data,
type,
Expand Down Expand Up @@ -237,7 +244,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 +264,7 @@ class ULMS extends BasicClient {
label,
) {
const payload = {
agent_label: this.agentLabel,
intent,
jsep,
label,
Expand Down Expand Up @@ -415,7 +425,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 +438,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 +592,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 +613,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 9385a84

Please sign in to comment.