From 794cbf57ebfbdd2772455b3f4826dd20623241ec Mon Sep 17 00:00:00 2001 From: Vladimir Berdnikov Date: Wed, 7 Aug 2024 11:15:05 +0300 Subject: [PATCH] ULMS-3230 Use external_id instead of scope in ulms methods --- package-lock.json | 4 ++-- package.json | 2 +- src/ulms.js | 42 ++++++++++++++++++------------------------ 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index d8802a1..1d6d887 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ulms/api-clients", - "version": "7.12.1", + "version": "7.11.0-dev.2-ULMS-3230", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ulms/api-clients", - "version": "7.12.1", + "version": "7.11.0-dev.2-ULMS-3230", "license": "MIT", "dependencies": { "axios": "1.6.2", diff --git a/package.json b/package.json index 4c99b90..4a4ffb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ulms/api-clients", - "version": "7.12.1", + "version": "7.11.0-dev.2-ULMS-3230", "description": "JavaScript API clients for ULMS platform", "keywords": [], "homepage": "https://github.com/foxford/ulms-api-clients-js#readme", diff --git a/src/ulms.js b/src/ulms.js index 62333ab..aa5ed9c 100644 --- a/src/ulms.js +++ b/src/ulms.js @@ -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() { @@ -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', @@ -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}`, ) } @@ -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, + }) } /** @@ -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) } /**