musora-content-services 2.76.0 → 2.77.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.
Files changed (129) hide show
  1. package/.claude/settings.local.json +11 -0
  2. package/.coderabbit.yaml +0 -0
  3. package/.editorconfig +0 -0
  4. package/.github/pull_request_template.md +0 -0
  5. package/.github/workflows/conventional-commits.yaml +0 -0
  6. package/.github/workflows/docs.js.yml +0 -0
  7. package/.github/workflows/node.js.yml +0 -0
  8. package/.prettierignore +0 -0
  9. package/.prettierrc +0 -0
  10. package/.yarnrc.yml +1 -0
  11. package/CHANGELOG.md +36 -0
  12. package/README.md +0 -0
  13. package/babel.config.cjs +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  17. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  18. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  19. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  20. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  21. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  27. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  28. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
  29. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  30. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  31. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  32. package/docs/forums_discussions.js.html +0 -0
  33. package/docs/forums_forum.js.html +0 -0
  34. package/docs/gamification_awards.js.html +0 -0
  35. package/docs/gamification_types.js.html +0 -0
  36. package/docs/module-Categories.html +0 -0
  37. package/docs/module-ForumCategories.html +0 -0
  38. package/docs/module-ForumDiscussions.html +0 -0
  39. package/docs/module-Threads.html +0 -0
  40. package/docs/scripts/collapse.js +0 -0
  41. package/docs/scripts/commonNav.js +0 -0
  42. package/docs/scripts/linenumber.js +0 -0
  43. package/docs/scripts/nav.js +0 -0
  44. package/docs/scripts/polyfill.js +0 -0
  45. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
  46. package/docs/scripts/prettify/lang-css.js +0 -0
  47. package/docs/scripts/prettify/prettify.js +0 -0
  48. package/docs/scripts/search.js +0 -0
  49. package/docs/styles/jsdoc.css +0 -0
  50. package/docs/styles/prettify.css +0 -0
  51. package/docs/user_memberships.js.html +0 -0
  52. package/jest.config.js +0 -0
  53. package/jsdoc.json +0 -0
  54. package/package.json +1 -1
  55. package/src/contentMetaData.js +0 -0
  56. package/src/contentTypeConfig.js +1 -0
  57. package/src/filterBuilder.js +0 -0
  58. package/src/infrastructure/http/executors/FetchRequestExecutor.ts +0 -0
  59. package/src/infrastructure/http/index.ts +0 -0
  60. package/src/infrastructure/http/interfaces/HeaderProvider.ts +0 -0
  61. package/src/infrastructure/http/interfaces/HttpError.ts +0 -0
  62. package/src/infrastructure/http/interfaces/NetworkError.ts +0 -0
  63. package/src/infrastructure/http/interfaces/RequestExecutor.ts +0 -0
  64. package/src/infrastructure/http/interfaces/RequestOptions.ts +0 -0
  65. package/src/infrastructure/http/providers/DefaultHeaderProvider.ts +0 -0
  66. package/src/lib/httpHelper.js +0 -0
  67. package/src/lib/lastUpdated.js +0 -0
  68. package/src/services/api/types.js +0 -0
  69. package/src/services/api/types.ts +0 -0
  70. package/src/services/config.js +0 -0
  71. package/src/services/content-org/content-org.js +0 -0
  72. package/src/services/content-org/guided-courses.ts +0 -0
  73. package/src/services/content-org/playlists-types.js +0 -0
  74. package/src/services/content-org/playlists.js +0 -0
  75. package/src/services/content.js +0 -0
  76. package/src/services/contentLikes.js +0 -0
  77. package/src/services/contentProgress.js +2 -2
  78. package/src/services/dataContext.js +0 -0
  79. package/src/services/dateUtils.js +0 -0
  80. package/src/services/eventsAPI.js +0 -0
  81. package/src/services/forums/categories.ts +0 -0
  82. package/src/services/forums/forums.ts +0 -0
  83. package/src/services/forums/posts.ts +20 -1
  84. package/src/services/forums/threads.ts +14 -1
  85. package/src/services/forums/types.ts +1 -0
  86. package/src/services/gamification/awards.ts +0 -0
  87. package/src/services/gamification/gamification.js +0 -0
  88. package/src/services/imageSRCBuilder.js +0 -0
  89. package/src/services/imageSRCVerify.js +0 -0
  90. package/src/services/liveTesting.ts +0 -0
  91. package/src/services/railcontent.js +0 -0
  92. package/src/services/recommendations.js +0 -0
  93. package/src/services/types.js +0 -0
  94. package/src/services/user/chat.js +0 -0
  95. package/src/services/user/interests.js +0 -0
  96. package/src/services/user/management.js +0 -0
  97. package/src/services/user/memberships.ts +0 -0
  98. package/src/services/user/notifications.js +0 -0
  99. package/src/services/user/onboarding.ts +0 -0
  100. package/src/services/user/payments.ts +0 -0
  101. package/src/services/user/permissions.js +0 -0
  102. package/src/services/user/profile.js +0 -0
  103. package/src/services/user/sessions.js +0 -0
  104. package/src/services/user/user-management-system.js +0 -0
  105. package/test/HttpClient.test.js +0 -0
  106. package/test/content.test.js +0 -0
  107. package/test/contentLikes.test.js +0 -0
  108. package/test/contentProgress.test.js +0 -0
  109. package/test/dataContext.test.js +0 -0
  110. package/test/forum.test.js +0 -0
  111. package/test/imageSRCBuilder.test.js +0 -0
  112. package/test/imageSRCVerify.test.js +0 -0
  113. package/test/initializeTests.js +0 -0
  114. package/test/lib/lastUpdated.test.js +0 -0
  115. package/test/live/contentProgressLive.test.js +0 -0
  116. package/test/live/railcontentLive.test.js +0 -0
  117. package/test/localStorageMock.js +0 -0
  118. package/test/log.js +0 -0
  119. package/test/mockData/mockData_fetchByRailContentIds_one_content.json +0 -0
  120. package/test/mockData/mockData_progress_content.json +0 -0
  121. package/test/mockData/mockData_sanity_progress_content.json +0 -0
  122. package/test/mockData/mockData_user_practices.json +0 -0
  123. package/test/notifications.test.js +0 -0
  124. package/test/progressRows.test.js +0 -0
  125. package/test/sanityQueryService.test.js +0 -0
  126. package/test/streakMessage.test.js +0 -0
  127. package/test/user/permissions.test.js +0 -0
  128. package/test/userActivity.test.js +0 -0
  129. package/tools/generate-index.cjs +0 -0
@@ -0,0 +1,11 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Read(//app/musora-platform-backend/**)",
5
+ "Read(//app/musora-platform-frontend/**)",
6
+ "Bash(find:*)"
7
+ ],
8
+ "deny": [],
9
+ "ask": []
10
+ }
11
+ }
package/.coderabbit.yaml CHANGED
File without changes
package/.editorconfig CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
package/.prettierignore CHANGED
File without changes
package/.prettierrc CHANGED
File without changes
package/.yarnrc.yml ADDED
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
package/CHANGELOG.md CHANGED
@@ -2,6 +2,42 @@
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.77.0](https://github.com/railroadmedia/musora-content-services/compare/v2.64.0...v2.77.0) (2025-11-13)
6
+
7
+
8
+ ### Features
9
+
10
+ * returning data updates in fetchLearningPathLessons ([#550](https://github.com/railroadmedia/musora-content-services/issues/550)) ([1753d75](https://github.com/railroadmedia/musora-content-services/commit/1753d754d620fafc387e700f114d67ec7fc9043f))
11
+ * add fields for learning path v2 ([#537](https://github.com/railroadmedia/musora-content-services/issues/537)) ([b2bcbd2](https://github.com/railroadmedia/musora-content-services/commit/b2bcbd2306afa730e5c61d6ee34fe082212dfdbb))
12
+ * Add learning path lessons endpoint ([#538](https://github.com/railroadmedia/musora-content-services/issues/538)) ([372a871](https://github.com/railroadmedia/musora-content-services/commit/372a8718eb354dfee6faef69077f00b7285a0a19))
13
+ * **BEH-1377:** active path ([#533](https://github.com/railroadmedia/musora-content-services/issues/533)) ([1135271](https://github.com/railroadmedia/musora-content-services/commit/11352714d4228e21f5ac2974d59e6c2805fe900f))
14
+ * **forums:** automatically mark threads as read when viewing posts ([7c721e8](https://github.com/railroadmedia/musora-content-services/commit/7c721e898c445076092bdad34b4df054b1d589f1))
15
+ * 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))
16
+ * method card progress row ([#553](https://github.com/railroadmedia/musora-content-services/issues/553)) ([a124cfc](https://github.com/railroadmedia/musora-content-services/commit/a124cfcedb4dacf3b6e6a4c435c4301b3eefa55e))
17
+ * **MU2-1211:** Add is_admin to UserResource ([c8ec392](https://github.com/railroadmedia/musora-content-services/commit/c8ec392bd56874dac495dc731118bcb3298aa80c))
18
+ * **MU2-1211:** Add show_admin_toggle to user resource ([46e1d55](https://github.com/railroadmedia/musora-content-services/commit/46e1d5559badf8822d0351c3483d8a55b781be32))
19
+ * **MU2-1211:** Update docs ([58e973e](https://github.com/railroadmedia/musora-content-services/commit/58e973e43125b1220d00aaf7d03c32639a0f3f64))
20
+ * **MU2-1211:** Update HttpClient methods (get, post, etc.) to capitilized to alleviate browser/cors issue, adding use_student_view to usertype, function to toggle student/admin view ([a2662c2](https://github.com/railroadmedia/musora-content-services/commit/a2662c22f706ac924c755b5be8643fdd17f4ebe4))
21
+ * **MU2E1-168:** onboarding status function ([#530](https://github.com/railroadmedia/musora-content-services/issues/530)) ([1e1cf78](https://github.com/railroadmedia/musora-content-services/commit/1e1cf78afb452792a859ab808d3c0ff1d59ddc6f))
22
+ * update children fields in fetchByRailContentId ([#544](https://github.com/railroadmedia/musora-content-services/issues/544)) ([8bdf7d6](https://github.com/railroadmedia/musora-content-services/commit/8bdf7d68b219f83a6e18fed439046e3ffca11642))
23
+ * update fetch learning path lessons ([#551](https://github.com/railroadmedia/musora-content-services/issues/551)) ([a434076](https://github.com/railroadmedia/musora-content-services/commit/a434076a8281af61043c1ec3e09798e7981ff8f3))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * active user count endpoint ([#542](https://github.com/railroadmedia/musora-content-services/issues/542)) ([be65c1f](https://github.com/railroadmedia/musora-content-services/commit/be65c1f62b4c828772aade616ddd5d7063d83aa3))
29
+ * add all lessons to fetchLearningPathLessons endpoint ([#548](https://github.com/railroadmedia/musora-content-services/issues/548)) ([acdda67](https://github.com/railroadmedia/musora-content-services/commit/acdda67ffa9eb8e44f7239e3ac21c7bda96166b6))
30
+ * Add is_content and page_type to all content ([#507](https://github.com/railroadmedia/musora-content-services/issues/507)) ([174706b](https://github.com/railroadmedia/musora-content-services/commit/174706b736540b9d24ceaee11539df9203d2d135))
31
+ * Add skill-pack support for navigateTo and nextLesson functionality ([d1682d2](https://github.com/railroadmedia/musora-content-services/commit/d1682d237e548c14f9e3d9f90dea08f6dc752d93))
32
+ * changes to how learning path intro video is stored ([#556](https://github.com/railroadmedia/musora-content-services/issues/556)) ([d3ceb76](https://github.com/railroadmedia/musora-content-services/commit/d3ceb764394cd9450d05c0153aac475022822f48))
33
+ * endpoint for followThread ([719adc8](https://github.com/railroadmedia/musora-content-services/commit/719adc8fa73cdcfb7434d132445b93323ecf4b6e))
34
+ * fetch learning path lessons ([69ac2e1](https://github.com/railroadmedia/musora-content-services/commit/69ac2e1e0982289b26e7148cc17d19f1ba389484))
35
+ * **live-testing:** add email as optional parameter for user creation ([#539](https://github.com/railroadmedia/musora-content-services/issues/539)) ([2289707](https://github.com/railroadmedia/musora-content-services/commit/2289707702a8acbe88c2c7f2acbe97459f876451))
36
+ * **live-testing:** post request url ([#543](https://github.com/railroadmedia/musora-content-services/issues/543)) ([b5463f9](https://github.com/railroadmedia/musora-content-services/commit/b5463f9627c11a4df6257995e1deec5a275ef2c8))
37
+ * **T3PS-864:** Remove sneaky console.log ([19a22ee](https://github.com/railroadmedia/musora-content-services/commit/19a22ee560af64448b7a40a6784d4bba9d0794b4))
38
+ * **T3Ps:** Update fetchCustomerPayments with paginate parameters ([c9c784d](https://github.com/railroadmedia/musora-content-services/commit/c9c784da6995f7ff836c0453c1d0ff353535a53e))
39
+ * update video field for method objects ([#541](https://github.com/railroadmedia/musora-content-services/issues/541)) ([a2120f6](https://github.com/railroadmedia/musora-content-services/commit/a2120f63bfa99d9b9ae96712e879161ad4add441))
40
+
5
41
  ## [2.76.0](https://github.com/railroadmedia/musora-content-services/compare/v2.75.0...v2.76.0) (2025-11-12)
6
42
 
7
43
 
package/README.md CHANGED
File without changes
package/babel.config.cjs CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/jest.config.js CHANGED
File without changes
package/jsdoc.json CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.76.0",
3
+ "version": "2.77.0",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
File without changes
@@ -278,6 +278,7 @@ export const getNextLessonLessonParentTypes = [
278
278
  'pack-bundle',
279
279
  'song-tutorial',
280
280
  'learning-path-v2',
281
+ 'skill-pack'
281
282
  ]
282
283
 
283
284
  export const progressTypesMapping = {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -67,7 +67,7 @@ export async function getNextLesson(data) {
67
67
  const lastInteractedStatus = childrenStates[lastInteracted]
68
68
 
69
69
  //different nextLesson behaviour for different content types
70
- if (content.type === 'course' || content.type === 'pack-bundle') {
70
+ if (content.type === 'course' || content.type === 'pack-bundle' || content.type === 'skill-pack') {
71
71
  if (lastInteractedStatus === STATE_STARTED) {
72
72
  nextLessonData[content.id] = lastInteracted
73
73
  } else {
@@ -123,7 +123,7 @@ export async function getNavigateTo(data) {
123
123
  const lastInteracted = await getLastInteractedOf(childrenIds)
124
124
  const lastInteractedStatus = childrenStates[lastInteracted]
125
125
 
126
- if (content.type === 'course' || content.type === 'pack-bundle') {
126
+ if (content.type === 'course' || content.type === 'pack-bundle' || content.type === 'skill-pack') {
127
127
  if (lastInteractedStatus === STATE_STARTED) {
128
128
  navigateToData[content.id] = buildNavigateTo(children.get(lastInteracted))
129
129
  } else {
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,6 +5,7 @@ import { HttpClient } from '../../infrastructure/http/HttpClient'
5
5
  import { globalConfig } from '../config.js'
6
6
  import { ForumPost } from './types'
7
7
  import { PaginatedResponse } from '../api/types'
8
+ import { markThreadAsRead } from './threads'
8
9
 
9
10
  const baseUrl = `/api/forums`
10
11
 
@@ -47,6 +48,7 @@ export interface FetchPostParams {
47
48
  }
48
49
  /**
49
50
  * Fetches posts for the given thread.
51
+ * Automatically marks the thread as read when posts are fetched.
50
52
  *
51
53
  * @param {number} threadId - The ID of the forum thread.
52
54
  * @param {string} brand - The brand context (e.g., "drumeo", "singeo").
@@ -71,6 +73,12 @@ export async function fetchPosts(
71
73
  const query = new URLSearchParams(queryObj).toString()
72
74
 
73
75
  const url = `${baseUrl}/v1/threads/${threadId}/posts?${query}`
76
+
77
+ // Mark thread as read in background (non-blocking)
78
+ markThreadAsRead(threadId, brand).catch(error => {
79
+ console.error('Failed to mark thread as read:', error)
80
+ })
81
+
74
82
  return httpClient.get<PaginatedResponse<ForumPost>>(url)
75
83
  }
76
84
 
@@ -165,6 +173,7 @@ export async function search(
165
173
 
166
174
  /**
167
175
  * Fetches posts for the given post, jumping to the post's location in the thread.
176
+ * Automatically marks the thread as read when posts are fetched.
168
177
  *
169
178
  * @param {number} postId - The ID of the forum post.
170
179
  * @param {string} brand - The brand context (e.g., "drumeo", "singeo").
@@ -189,5 +198,15 @@ export async function jumpToPost(
189
198
  const query = new URLSearchParams(queryObj).toString()
190
199
 
191
200
  const url = `${baseUrl}/v1/posts/${postId}/jump?${query}`
192
- return httpClient.get<PaginatedResponse<ForumPost>>(url)
201
+ const response = await httpClient.get<PaginatedResponse<ForumPost>>(url)
202
+
203
+ // Mark thread as read in background (non-blocking)
204
+ // Extract thread from first post if available
205
+ if (response.data.length > 0 && response.data[0].thread?.id) {
206
+ markThreadAsRead(response.data[0].thread.id, brand).catch(error => {
207
+ console.error('Failed to mark thread as read:', error)
208
+ })
209
+ }
210
+
211
+ return response
193
212
  }
@@ -59,7 +59,7 @@ export async function updateThread(
59
59
  */
60
60
  export async function followThread(threadId: number, brand: string): Promise<void> {
61
61
  const httpClient = new HttpClient(globalConfig.baseUrl)
62
- return httpClient.post<void>(`${baseUrl}/v1/threads/${threadId}/follow`, { brand })
62
+ return httpClient.put<void>(`${baseUrl}/v1/threads/${threadId}/follow`, { brand })
63
63
  }
64
64
 
65
65
  /**
@@ -75,6 +75,19 @@ export async function unfollowThread(threadId: number, brand: string): Promise<v
75
75
  return httpClient.delete<void>(`${baseUrl}/v1/threads/${threadId}/follow?brand=${brand}`)
76
76
  }
77
77
 
78
+ /**
79
+ * Marks a thread as read for the authenticated user.
80
+ *
81
+ * @param {number} threadId - The ID of the thread to mark as read.
82
+ * @param {string} brand - The brand context (e.g., "drumeo", "singeo").
83
+ * @return {Promise<void>} - A promise that resolves when the thread is marked as read.
84
+ * @throws {HttpError} - If the request fails.
85
+ */
86
+ export async function markThreadAsRead(threadId: number, brand: string): Promise<void> {
87
+ const httpClient = new HttpClient(globalConfig.baseUrl)
88
+ return httpClient.put<void>(`${baseUrl}/v1/threads/${threadId}/read?brand=${brand}`, {})
89
+ }
90
+
78
91
  export interface FetchThreadParams {
79
92
  is_followed?: boolean,
80
93
  page?: number,
@@ -13,6 +13,7 @@ export interface ForumPost {
13
13
  author: ForumUser | null
14
14
  like_count: number
15
15
  is_liked: boolean
16
+ thread?: { id: number; title?: string; slug?: string }
16
17
  }
17
18
 
18
19
  export interface ForumThread {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/test/log.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes