Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ULMS-3230 Use external_id instead of scope in ulms methods #148

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.20.0",
"version": "7.21.0",
"description": "JavaScript API clients for ULMS platform",
"keywords": [],
"homepage": "https://github.com/foxford/ulms-api-clients-js#readme",
Expand Down
36 changes: 15 additions & 21 deletions src/ulms.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,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 @@ -137,10 +137,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 @@ -196,15 +196,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 @@ -505,16 +504,15 @@ 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) {
readClassroom(kind, classroomId, options) {
return this.get(
this.url(`/audiences/${audience}/${kind}/${scope}`, options),
this.url(`/${kind}/${classroomId}`, options),
requestOptionsWithRetryAndTimeout,
)
}
Expand Down Expand Up @@ -685,18 +683,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