musora-content-services 2.167.5 → 2.168.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,15 @@
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.168.0](https://github.com/railroadmedia/musora-content-services/compare/v2.167.6...v2.168.0) (2026-07-30)
6
+
7
+
8
+ ### Features
9
+
10
+ * **BEHLTP-186:** split membership and subscriber data for membership controller- [#1414](https://github.com/railroadmedia/musora-content-services/issues/1414) ([#1022](https://github.com/railroadmedia/musora-content-services/issues/1022)) ([728f03a](https://github.com/railroadmedia/musora-content-services/commit/728f03ae25a8ddb0ee337a7dd6034bb65ba56297))
11
+
12
+ ### [2.167.6](https://github.com/railroadmedia/musora-content-services/compare/v2.167.5...v2.167.6) (2026-07-29)
13
+
5
14
  ### [2.167.5](https://github.com/railroadmedia/musora-content-services/compare/v2.167.4...v2.167.5) (2026-07-24)
6
15
 
7
16
  ### [2.167.4](https://github.com/railroadmedia/musora-content-services/compare/v2.167.3...v2.167.4) (2026-07-22)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.167.5",
3
+ "version": "2.168.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
@@ -17,6 +17,7 @@ import {
17
17
  } from './services/awards/award-query.js';
18
18
 
19
19
  import {
20
+ getMCSVersion,
20
21
  globalConfig,
21
22
  initializeEnvVar,
22
23
  initializeService
@@ -28,6 +29,11 @@ import {
28
29
  fetchArtists
29
30
  } from './services/content/artist.ts';
30
31
 
32
+ import {
33
+ fetchLearningPathCount,
34
+ fetchSongAndLessonCounts
35
+ } from './services/content/counts.ts';
36
+
31
37
  import {
32
38
  fetchGenreBySlug,
33
39
  fetchGenreLessons,
@@ -467,6 +473,11 @@ import {
467
473
  updatePlayerSettings
468
474
  } from './services/user/playerSettings.ts';
469
475
 
476
+ import {
477
+ fetchPracticeGoals,
478
+ updatePracticeGoals
479
+ } from './services/user/practiceGoals.ts';
480
+
470
481
  import {
471
482
  deleteProfilePicture,
472
483
  otherStats,
@@ -609,6 +620,7 @@ declare module 'musora-content-services' {
609
620
  fetchInvite,
610
621
  fetchLastSubscriptionPlatform,
611
622
  fetchLatestThreads,
623
+ fetchLearningPathCount,
612
624
  fetchLearningPathLessons,
613
625
  fetchLearningPathProgressCheckLessons,
614
626
  fetchLeaving,
@@ -636,6 +648,7 @@ declare module 'musora-content-services' {
636
648
  fetchPlaylistItems,
637
649
  fetchPost,
638
650
  fetchPosts,
651
+ fetchPracticeGoals,
639
652
  fetchRecent,
640
653
  fetchRecentActivitiesActiveTabs,
641
654
  fetchRecentUserActivities,
@@ -651,6 +664,7 @@ declare module 'musora-content-services' {
651
664
  fetchShowsData,
652
665
  fetchSiblingContent,
653
666
  fetchSimilarItems,
667
+ fetchSongAndLessonCounts,
654
668
  fetchSongArtistCount,
655
669
  fetchSongById,
656
670
  fetchTabData,
@@ -702,6 +716,7 @@ declare module 'musora-content-services' {
702
716
  getLearningPathLessonsByIds,
703
717
  getLegacyMethods,
704
718
  getLessonContentRows,
719
+ getMCSVersion,
705
720
  getMonday,
706
721
  getNavigateTo,
707
722
  getNavigateToForMethod,
@@ -854,6 +869,7 @@ declare module 'musora-content-services' {
854
869
  updatePlayerSettings,
855
870
  updatePlaylist,
856
871
  updatePost,
872
+ updatePracticeGoals,
857
873
  updatePracticeNotes,
858
874
  updateProfileVisibility,
859
875
  updateThread,
package/src/index.js CHANGED
@@ -21,6 +21,7 @@ import {
21
21
  } from './services/awards/award-query.js';
22
22
 
23
23
  import {
24
+ getMCSVersion,
24
25
  globalConfig,
25
26
  initializeEnvVar,
26
27
  initializeService
@@ -32,6 +33,11 @@ import {
32
33
  fetchArtists
33
34
  } from './services/content/artist.ts';
34
35
 
36
+ import {
37
+ fetchLearningPathCount,
38
+ fetchSongAndLessonCounts
39
+ } from './services/content/counts.ts';
40
+
35
41
  import {
36
42
  fetchGenreBySlug,
37
43
  fetchGenreLessons,
@@ -471,6 +477,11 @@ import {
471
477
  updatePlayerSettings
472
478
  } from './services/user/playerSettings.ts';
473
479
 
480
+ import {
481
+ fetchPracticeGoals,
482
+ updatePracticeGoals
483
+ } from './services/user/practiceGoals.ts';
484
+
474
485
  import {
475
486
  deleteProfilePicture,
476
487
  otherStats,
@@ -608,6 +619,7 @@ export {
608
619
  fetchInvite,
609
620
  fetchLastSubscriptionPlatform,
610
621
  fetchLatestThreads,
622
+ fetchLearningPathCount,
611
623
  fetchLearningPathLessons,
612
624
  fetchLearningPathProgressCheckLessons,
613
625
  fetchLeaving,
@@ -635,6 +647,7 @@ export {
635
647
  fetchPlaylistItems,
636
648
  fetchPost,
637
649
  fetchPosts,
650
+ fetchPracticeGoals,
638
651
  fetchRecent,
639
652
  fetchRecentActivitiesActiveTabs,
640
653
  fetchRecentUserActivities,
@@ -650,6 +663,7 @@ export {
650
663
  fetchShowsData,
651
664
  fetchSiblingContent,
652
665
  fetchSimilarItems,
666
+ fetchSongAndLessonCounts,
653
667
  fetchSongArtistCount,
654
668
  fetchSongById,
655
669
  fetchTabData,
@@ -701,6 +715,7 @@ export {
701
715
  getLearningPathLessonsByIds,
702
716
  getLegacyMethods,
703
717
  getLessonContentRows,
718
+ getMCSVersion,
704
719
  getMonday,
705
720
  getNavigateTo,
706
721
  getNavigateToForMethod,
@@ -853,6 +868,7 @@ export {
853
868
  updatePlayerSettings,
854
869
  updatePlaylist,
855
870
  updatePost,
871
+ updatePracticeGoals,
856
872
  updatePracticeNotes,
857
873
  updateProfileVisibility,
858
874
  updateThread,
@@ -45,3 +45,23 @@ export async function fetchSongAndLessonCounts(
45
45
 
46
46
  return { ...counts, total: counts.songs + counts.lessons }
47
47
  }
48
+
49
+ export interface LearningPathCount {
50
+ total: number
51
+ }
52
+
53
+ export async function fetchLearningPathCount(brand?: Brands | string): Promise<LearningPathCount> {
54
+ const learningPathFilter = f.combine(
55
+ f.typeIn(['learning-path-v2']),
56
+ f.statusIn(['published']),
57
+ f.defined('railcontent_id'),
58
+ brand ? f.brand(brand) : f.empty
59
+ )
60
+
61
+ const q = `{
62
+ "total": count(${query().and(learningPathFilter)})
63
+ }`
64
+
65
+ const count = (await sanityClient.executeQuery<LearningPathCount>(q)) ?? { total: 0 }
66
+ return count
67
+ }
@@ -27,6 +27,18 @@ export interface UserMembershipResponse {
27
27
  sub_account_data: MultiUserAccountResponse // post multiUserAccount data
28
28
  upgrade_options: UpgradeOption[] // post multiuser account data
29
29
  user_subscriber_data: {
30
+ active_subscription: {
31
+ subscribed_on: string
32
+ renews_on: string
33
+ plan: string
34
+ platform: 'web' | 'apple' | 'google'
35
+ product_sku: string
36
+ rc_product_ids: {
37
+ apple: string
38
+ google: string
39
+ }
40
+ tier_key: string
41
+ }
30
42
  has_had_apple_subscription: boolean
31
43
  has_had_google_subscription: boolean
32
44
  has_had_web_subscription: boolean
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @module PracticeGoals
3
+ */
4
+ import { HttpClient } from '../../infrastructure/http/HttpClient'
5
+ import { globalConfig } from '../config.js'
6
+ import type { PracticeGoals, UpdatePracticeGoalsData } from './types'
7
+
8
+ const baseUrl = '/api/user/practices/v1/goals'
9
+
10
+ /**
11
+ * @returns {Promise<PracticeGoals>}
12
+ * @throws {HttpError}
13
+ */
14
+ export async function fetchPracticeGoals(): Promise<PracticeGoals> {
15
+ const httpClient = new HttpClient(globalConfig.baseUrl, globalConfig.sessionConfig.token)
16
+ return httpClient.get<PracticeGoals>(baseUrl)
17
+ }
18
+
19
+ /**
20
+ * @param {UpdatePracticeGoalsData} data
21
+ * @returns {Promise<PracticeGoals>}
22
+ * @throws {HttpError}
23
+ */
24
+ export async function updatePracticeGoals(data: UpdatePracticeGoalsData): Promise<PracticeGoals> {
25
+ const httpClient = new HttpClient(globalConfig.baseUrl, globalConfig.sessionConfig.token)
26
+ return httpClient.patch<PracticeGoals>(baseUrl, data)
27
+ }
@@ -110,6 +110,17 @@ export interface UpdatePlayerSettingsData {
110
110
  playlist_auto_next?: boolean
111
111
  }
112
112
 
113
+ export interface PracticeGoals {
114
+ weekly_target_days: number | null
115
+ daily_target_minutes: number | null
116
+ updated_at: string | null
117
+ }
118
+
119
+ export interface UpdatePracticeGoalsData {
120
+ weekly_target_days?: number
121
+ daily_target_minutes?: number
122
+ }
123
+
113
124
  export interface StreakDTO {
114
125
  type: 'week' | 'day'
115
126
  length: number
@@ -1 +1 @@
1
- export const MCS_VERSION = '2.167.5'
1
+ export const MCS_VERSION = '2.168.0'