musora-content-services 2.13.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [2.14.0](https://github.com/railroadmedia/musora-content-services/compare/v2.13.0...v2.14.0) (2025-06-26)
6
+
7
+
8
+ ### Features
9
+
10
+ * **BEH-541:** guided course enrollment page endpoint ([#311](https://github.com/railroadmedia/musora-content-services/issues/311)) ([0e7aace](https://github.com/railroadmedia/musora-content-services/commit/0e7aacec67ea769f15d826ed9542d4af1bae228d))
11
+
5
12
  ## [2.13.0](https://github.com/railroadmedia/musora-content-services/compare/v2.12.0...v2.13.0) (2025-06-26)
6
13
 
7
14
 
package/link_mcs.sh CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.d.ts CHANGED
@@ -5,6 +5,12 @@ import {
5
5
  initializeService
6
6
  } from './services/config.js';
7
7
 
8
+ import {
9
+ enrollUserInGuidedCourse,
10
+ fetchEnrollmentPageMetadata,
11
+ unEnrollUserInGuidedCourse
12
+ } from './services/content-org/guided-courses.js';
13
+
8
14
  import {
9
15
  addItemToPlaylist,
10
16
  createPlaylist,
@@ -309,6 +315,7 @@ declare module 'musora-content-services' {
309
315
  deleteUserActivity,
310
316
  duplicatePlaylist,
311
317
  editComment,
318
+ enrollUserInGuidedCourse,
312
319
  extractSanityUrl,
313
320
  fetchAll,
314
321
  fetchAllCompletedStates,
@@ -338,6 +345,7 @@ declare module 'musora-content-services' {
338
345
  fetchContentInProgress,
339
346
  fetchContentPageUserData,
340
347
  fetchContentProgress,
348
+ fetchEnrollmentPageMetadata,
341
349
  fetchFoundation,
342
350
  fetchGenreLessons,
343
351
  fetchHandler,
@@ -481,6 +489,7 @@ declare module 'musora-content-services' {
481
489
  restoreUserPractice,
482
490
  setStudentViewForUser,
483
491
  togglePlaylistPrivate,
492
+ unEnrollUserInGuidedCourse,
484
493
  unassignModeratorToComment,
485
494
  unblockUser,
486
495
  undeletePlaylist,
package/src/index.js CHANGED
@@ -5,6 +5,12 @@ import {
5
5
  initializeService
6
6
  } from './services/config.js';
7
7
 
8
+ import {
9
+ enrollUserInGuidedCourse,
10
+ fetchEnrollmentPageMetadata,
11
+ unEnrollUserInGuidedCourse
12
+ } from './services/content-org/guided-courses.js';
13
+
8
14
  import {
9
15
  addItemToPlaylist,
10
16
  createPlaylist,
@@ -308,6 +314,7 @@ export {
308
314
  deleteUserActivity,
309
315
  duplicatePlaylist,
310
316
  editComment,
317
+ enrollUserInGuidedCourse,
311
318
  extractSanityUrl,
312
319
  fetchAll,
313
320
  fetchAllCompletedStates,
@@ -337,6 +344,7 @@ export {
337
344
  fetchContentInProgress,
338
345
  fetchContentPageUserData,
339
346
  fetchContentProgress,
347
+ fetchEnrollmentPageMetadata,
340
348
  fetchFoundation,
341
349
  fetchGenreLessons,
342
350
  fetchHandler,
@@ -480,6 +488,7 @@ export {
480
488
  restoreUserPractice,
481
489
  setStudentViewForUser,
482
490
  togglePlaylistPrivate,
491
+ unEnrollUserInGuidedCourse,
483
492
  unassignModeratorToComment,
484
493
  unblockUser,
485
494
  undeletePlaylist,
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @module GuidedCourses
3
+ */
4
+ import { globalConfig } from '../config.js'
5
+ import { fetchHandler } from '../railcontent.js'
6
+ import './playlists-types.js'
7
+
8
+
9
+ const excludeFromGeneratedIndex: string[] = []
10
+
11
+ const BASE_PATH: string = `/api/content-org`
12
+
13
+ export async function enrollUserInGuidedCourse(guidedCourse) {
14
+ const url: string = `${BASE_PATH}/v1/user/guided-courses/enroll-user/${guidedCourse}`
15
+ return await fetchHandler(url, 'POST')
16
+ }
17
+
18
+ export async function unEnrollUserInGuidedCourse(guidedCourse) {
19
+ const url: string = `${BASE_PATH}/v1/user/guided-courses/un-enroll-user/${guidedCourse}`
20
+ return await fetchHandler(url, 'POST')
21
+ }
22
+
23
+ export async function fetchEnrollmentPageMetadata(guidedCourse) {
24
+ const url: string = `${BASE_PATH}/v1/user/guided-courses/enrollment/${guidedCourse}`
25
+ return await fetchHandler(url, 'GET')
26
+ }
@@ -198,7 +198,7 @@ export async function assignmentStatusCompleted(assignmentId, parentContentId) {
198
198
  }
199
199
 
200
200
  export async function contentStatusCompleted(contentId) {
201
- await dataContext.update(
201
+ return await dataContext.update(
202
202
  async function (localContext) {
203
203
  let hierarchy = await fetchHierarchy(contentId)
204
204
  completeStatusInLocalContext(localContext, contentId, hierarchy)
@@ -361,7 +361,7 @@ function getMediaTypeId(mediaType, mediaCategory) {
361
361
  case 'practice_play-alongs':
362
362
  return 4
363
363
  case 'video_soundslice':
364
- return 6
364
+ return 6
365
365
  default:
366
366
  return 5
367
367
  }
File without changes