musora-content-services 2.65.0 → 2.67.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.
@@ -0,0 +1,8 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(rg:*)"
5
+ ],
6
+ "deny": []
7
+ }
8
+ }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
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.67.0](https://github.com/railroadmedia/musora-content-services/compare/v2.66.0...v2.67.0) (2025-11-04)
6
+
7
+
8
+ ### Features
9
+
10
+ * **BEH-1377:** active path ([#533](https://github.com/railroadmedia/musora-content-services/issues/533)) ([1135271](https://github.com/railroadmedia/musora-content-services/commit/11352714d4228e21f5ac2974d59e6c2805fe900f))
11
+
12
+ ## [2.66.0](https://github.com/railroadmedia/musora-content-services/compare/v2.65.0...v2.66.0) (2025-11-03)
13
+
14
+
15
+ ### Features
16
+
17
+ * legacy methods function with mock data ([#534](https://github.com/railroadmedia/musora-content-services/issues/534)) ([76f74d2](https://github.com/railroadmedia/musora-content-services/commit/76f74d255ab6b6b35ef6422a7952b4f75b551b8c))
18
+
5
19
  ## [2.65.0](https://github.com/railroadmedia/musora-content-services/compare/v2.64.0...v2.65.0) (2025-11-03)
6
20
 
7
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.65.0",
3
+ "version": "2.67.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
@@ -13,7 +13,9 @@ import {
13
13
  } from './services/content-org/guided-courses.ts';
14
14
 
15
15
  import {
16
+ getActivePath,
16
17
  getDailySession,
18
+ updateActivePath,
17
19
  updateDailySession
18
20
  } from './services/content-org/learning-paths.ts';
19
21
 
@@ -37,6 +39,7 @@ import {
37
39
 
38
40
  import {
39
41
  getContentRows,
42
+ getLegacyMethods,
40
43
  getLessonContentRows,
41
44
  getNewAndUpcoming,
42
45
  getRecent,
@@ -513,6 +516,7 @@ declare module 'musora-content-services' {
513
516
  findIncompleteLesson,
514
517
  followThread,
515
518
  getActiveDiscussions,
519
+ getActivePath,
516
520
  getAllCompleted,
517
521
  getAllStarted,
518
522
  getAllStartedOrCompleted,
@@ -520,6 +524,7 @@ declare module 'musora-content-services' {
520
524
  getContentRows,
521
525
  getDailySession,
522
526
  getLastInteractedOf,
527
+ getLegacyMethods,
523
528
  getLessonContentRows,
524
529
  getMonday,
525
530
  getNavigateTo,
@@ -634,6 +639,7 @@ declare module 'musora-content-services' {
634
639
  unlockThread,
635
640
  unpinProgressRow,
636
641
  unpinThread,
642
+ updateActivePath,
637
643
  updateDailySession,
638
644
  updateDisplayName,
639
645
  updateForumCategory,
package/src/index.js CHANGED
@@ -13,7 +13,9 @@ import {
13
13
  } from './services/content-org/guided-courses.ts';
14
14
 
15
15
  import {
16
+ getActivePath,
16
17
  getDailySession,
18
+ updateActivePath,
17
19
  updateDailySession
18
20
  } from './services/content-org/learning-paths.ts';
19
21
 
@@ -37,6 +39,7 @@ import {
37
39
 
38
40
  import {
39
41
  getContentRows,
42
+ getLegacyMethods,
40
43
  getLessonContentRows,
41
44
  getNewAndUpcoming,
42
45
  getRecent,
@@ -512,6 +515,7 @@ export {
512
515
  findIncompleteLesson,
513
516
  followThread,
514
517
  getActiveDiscussions,
518
+ getActivePath,
515
519
  getAllCompleted,
516
520
  getAllStarted,
517
521
  getAllStartedOrCompleted,
@@ -519,6 +523,7 @@ export {
519
523
  getContentRows,
520
524
  getDailySession,
521
525
  getLastInteractedOf,
526
+ getLegacyMethods,
522
527
  getLessonContentRows,
523
528
  getMonday,
524
529
  getNavigateTo,
@@ -633,6 +638,7 @@ export {
633
638
  unlockThread,
634
639
  unpinProgressRow,
635
640
  unpinThread,
641
+ updateActivePath,
636
642
  updateDailySession,
637
643
  updateDisplayName,
638
644
  updateForumCategory,
@@ -29,3 +29,23 @@ export async function updateDailySession(brand: string, userDate: Date, keepFirs
29
29
  const body = { brand: brand, userDate: stringDate, keepFirstLearningPath: keepFirstLearningPath }
30
30
  return await fetchHandler(url, 'POST', null, body)
31
31
  }
32
+
33
+ /**
34
+ * Gets user's active learning path.
35
+ * @param brand
36
+ */
37
+ export async function getActivePath(brand: string) {
38
+ const url: string = `${BASE_PATH}/v1/user/learning-paths/active-path/get-or-create`
39
+ const body = { brand: brand }
40
+ return await fetchHandler(url, 'POST', null, body)
41
+ }
42
+
43
+ /**
44
+ * Updates user's active learning path.
45
+ * @param brand
46
+ */
47
+ export async function updateActivePath(brand: string) {
48
+ const url: string = `${BASE_PATH}/v1/user/learning-paths/active-path/update`
49
+ const body = { brand: brand }
50
+ return await fetchHandler(url, 'POST', null, body)
51
+ }
@@ -421,9 +421,34 @@ export async function getRecommendedForYou(brand, rowId = null, {
421
421
  }
422
422
 
423
423
 
424
+ /**
425
+ * Fetches legacy methods for a given brand by permission.
426
+ *
427
+ * @param {string} brand - The brand for which to fetch legacy methods.
428
+ * @returns {Promise<Object>} - A promise that resolves to an object containing legacy methods.
429
+ *
430
+ * @example
431
+ * // Fetch legacy methods for a brand by permission
432
+ * getLegacyMethods('drumeo')
433
+ * .then(content => console.log(content))
434
+ * .catch(error => console.error(error));
435
+ */
436
+ export async function getLegacyMethods(brand) {
424
437
 
425
-
426
-
427
-
428
-
429
-
438
+ // TODO: Replace with real data from Sanity when available with permissions
439
+
440
+ return [
441
+ {
442
+ id: 1,
443
+ title: '2020 Method',
444
+ type: 'pack',
445
+ child_count: 12,
446
+ },
447
+ {
448
+ id: 2,
449
+ title: '2016 Foundations',
450
+ type: 'pack',
451
+ child_count: 12,
452
+ },
453
+ ]
454
+ }