Skip to content

Commit

Permalink
ULMS-3230 Use external_id instead of scope in ulms methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dkvovik committed Aug 26, 2024
1 parent 28e494a commit 449df9e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 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.15.0",
"version": "7.16.0-dev.0-ULMS-3230",
"description": "JavaScript API clients for ULMS platform",
"keywords": [],
"homepage": "https://github.com/foxford/ulms-api-clients-js#readme",
Expand Down
42 changes: 18 additions & 24 deletions src/ulms.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class ULMS extends BasicClient {
}

/**
* Scope kind enum
* Classroom kind enum
* @returns {{CHAT: string, MINIGROUP: string, P2P: string, WEBINAR: string}}
*/
static get kind() {
Expand All @@ -131,10 +131,10 @@ class ULMS extends BasicClient {
}

/**
* Scope status enum
* Classroom status enum
* @returns {{REAL_TIME: string, CLOSED: string, FINISHED: string, ADJUSTED: string, TRANSCODED: string}}
*/
static get scopeStatus() {
static get classroomStatus() {
return {
REAL_TIME: 'real-time',
CLOSED: 'closed',
Expand Down Expand Up @@ -190,15 +190,14 @@ class ULMS extends BasicClient {
}

/**
* Commit edition by scope
* @param {string} audience
* @param {string} scope
* Commit edition by classroomId
* @param {string} classroomId
* @param {string} editionId
* @returns {Promise}
*/
commitEdition(audience, scope, editionId) {
commitEdition(classroomId, editionId) {
return this.post(
`${this.baseUrl}/audiences/${audience}/classes/${scope}/editions/${editionId}`,
`${this.baseUrl}/classrooms/${classroomId}/editions/${editionId}`,
)
}

Expand Down Expand Up @@ -488,18 +487,17 @@ class ULMS extends BasicClient {
}

/**
* Read ulms scope
* Read ulms classroom
* @param {string} kind
* @param {string} audience
* @param {string} scope
* @param {string} classroomId
* @param {object} options
* @returns {Promise}
*/
readScope(kind, audience, scope, options) {
return this.get(
this.url(`/audiences/${audience}/${kind}/${scope}`, options),
{ timeout: 10_000, retry: true },
)
readClassroom(kind, classroomId, options) {
return this.get(this.url(`/${kind}/${classroomId}`, options), {
timeout: 10_000,
retry: true,
})
}

/**
Expand Down Expand Up @@ -668,18 +666,14 @@ class ULMS extends BasicClient {
}

/**
* Update ulms scope
* Update ulms classroom
* @param {string} kind
* @param {string} audience
* @param {string} scope
* @param {string} classroomId
* @param {object} data
* @returns {Promise}
*/
updateScope(kind, audience, scope, data) {
return this.put(
`${this.baseUrl}/audiences/${audience}/${kind}/${scope}`,
data,
)
updateClassroom(kind, classroomId, data) {
return this.put(`${this.baseUrl}/${kind}/${classroomId}`, data)
}

/**
Expand Down

0 comments on commit 449df9e

Please sign in to comment.