musora-content-services 2.88.0 → 2.88.1
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/.coderabbit.yaml +0 -0
- package/.editorconfig +0 -0
- package/.github/pull_request_template.md +0 -0
- package/.github/workflows/conventional-commits.yaml +0 -0
- package/.github/workflows/docs.js.yml +0 -0
- package/.github/workflows/node.js.yml +0 -0
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/CHANGELOG.md +7 -0
- package/README.md +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/forums_discussions.js.html +0 -0
- package/docs/forums_forum.js.html +0 -0
- package/docs/gamification_awards.js.html +0 -0
- package/docs/gamification_types.js.html +0 -0
- package/docs/module-Categories.html +0 -0
- package/docs/module-ForumCategories.html +0 -0
- package/docs/module-ForumDiscussions.html +0 -0
- package/docs/module-Threads.html +0 -0
- package/docs/scripts/collapse.js +0 -0
- package/docs/scripts/commonNav.js +0 -0
- package/docs/scripts/linenumber.js +0 -0
- package/docs/scripts/nav.js +0 -0
- package/docs/scripts/polyfill.js +0 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
- package/docs/scripts/prettify/lang-css.js +0 -0
- package/docs/scripts/prettify/prettify.js +0 -0
- package/docs/scripts/search.js +0 -0
- package/docs/styles/jsdoc.css +0 -0
- package/docs/styles/prettify.css +0 -0
- package/docs/user_memberships.js.html +0 -0
- package/jest.config.js +0 -0
- package/package.json +1 -1
- package/src/contentMetaData.js +0 -0
- package/src/infrastructure/http/HttpClient.ts +0 -0
- package/src/infrastructure/http/executors/FetchRequestExecutor.ts +0 -0
- package/src/infrastructure/http/index.ts +0 -0
- package/src/infrastructure/http/interfaces/HeaderProvider.ts +0 -0
- package/src/infrastructure/http/interfaces/HttpError.ts +0 -0
- package/src/infrastructure/http/interfaces/NetworkError.ts +0 -0
- package/src/infrastructure/http/interfaces/RequestExecutor.ts +0 -0
- package/src/infrastructure/http/interfaces/RequestOptions.ts +0 -0
- package/src/infrastructure/http/providers/DefaultHeaderProvider.ts +0 -0
- package/src/lib/httpHelper.js +0 -0
- package/src/services/api/types.js +0 -0
- package/src/services/api/types.ts +0 -0
- package/src/services/content-org/content-org.js +0 -0
- package/src/services/content-org/guided-courses.ts +0 -0
- package/src/services/content-org/learning-paths.ts +5 -12
- package/src/services/content-org/playlists-types.js +0 -0
- package/src/services/content-org/playlists.js +0 -0
- package/src/services/dateUtils.js +0 -0
- package/src/services/eventsAPI.js +0 -0
- package/src/services/forums/forums.ts +0 -0
- package/src/services/forums/posts.ts +0 -0
- package/src/services/gamification/awards.ts +0 -0
- package/src/services/gamification/gamification.js +0 -0
- package/src/services/imageSRCBuilder.js +0 -0
- package/src/services/imageSRCVerify.js +0 -0
- package/src/services/liveTesting.ts +0 -0
- package/src/services/progress-row/method-card.js +0 -0
- package/src/services/recommendations.js +0 -0
- package/src/services/user/chat.js +0 -0
- package/src/services/user/interests.js +0 -0
- package/src/services/user/management.js +0 -0
- package/src/services/user/memberships.ts +0 -0
- package/src/services/user/notifications.js +0 -0
- package/src/services/user/payments.ts +0 -0
- package/src/services/user/profile.js +0 -0
- package/src/services/user/sessions.js +0 -0
- package/src/services/user/types.js +0 -0
- package/src/services/user/user-management-system.js +0 -0
- package/test/HttpClient.test.js +0 -0
- package/test/contentLikes.test.js +0 -0
- package/test/dataContext.test.js +0 -0
- package/test/imageSRCBuilder.test.js +0 -0
- package/test/imageSRCVerify.test.js +0 -0
- package/test/learningPaths.test.js +0 -0
- package/test/lib/lastUpdated.test.js +0 -0
- package/test/live/railcontentLive.test.js +0 -0
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
- package/test/mockData/mockData_fetchByRailContentIds_one_content.json +0 -0
- package/test/mockData/mockData_progress_content.json +0 -0
- package/test/mockData/mockData_sanity_progress_content.json +0 -0
- package/test/mockData/mockData_user_practices.json +0 -0
- package/test/notifications.test.js +0 -0
- package/test/progressRows.test.js +0 -0
- package/test/sanityQueryService.test.js +0 -0
- package/test/streakMessage.test.js +0 -0
- package/test/user/permissions.test.js +0 -0
- package/test/userActivity.test.js +0 -0
- package/.claude/settings.local.json +0 -14
- package/.yarnrc.yml +0 -1
- package/test/reporting.test.js +0 -132
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/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.88.1](https://github.com/railroadmedia/musora-content-services/compare/v2.88.0...v2.88.1) (2025-11-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add queries in get daily session and get active path ([#593](https://github.com/railroadmedia/musora-content-services/issues/593)) ([91f3974](https://github.com/railroadmedia/musora-content-services/commit/91f3974c530ca695fa87f5bfe14066e5a473db79))
|
|
11
|
+
|
|
5
12
|
## [2.88.0](https://github.com/railroadmedia/musora-content-services/compare/v2.86.1...v2.88.0) (2025-11-26)
|
|
6
13
|
|
|
7
14
|
|
package/README.md
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
|
package/docs/module-Threads.html
CHANGED
|
File without changes
|
package/docs/scripts/collapse.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/scripts/nav.js
CHANGED
|
File without changes
|
package/docs/scripts/polyfill.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/scripts/search.js
CHANGED
|
File without changes
|
package/docs/styles/jsdoc.css
CHANGED
|
File without changes
|
package/docs/styles/prettify.css
CHANGED
|
File without changes
|
|
File without changes
|
package/jest.config.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/contentMetaData.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
|
package/src/lib/httpHelper.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { fetchHandler } from '../railcontent.js'
|
|
6
|
-
import { fetchByRailContentId,
|
|
6
|
+
import { fetchByRailContentId, fetchMethodV2Structure } from '../sanity.js'
|
|
7
7
|
import { addContextToContent } from '../contentAggregator.js'
|
|
8
8
|
import {
|
|
9
9
|
contentStatusCompleted,
|
|
10
10
|
contentStatusReset,
|
|
11
11
|
getProgressState,
|
|
12
|
-
getProgressStateByIds
|
|
13
12
|
} from '../contentProgress.js'
|
|
14
13
|
|
|
15
14
|
const BASE_PATH: string = `/api/content-org`
|
|
@@ -21,10 +20,6 @@ interface ActiveLearningPathResponse {
|
|
|
21
20
|
active_learning_path_id: number,
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
23
|
/**
|
|
29
24
|
* Gets today's daily session for the user.
|
|
30
25
|
* @param brand
|
|
@@ -32,9 +27,8 @@ interface ActiveLearningPathResponse {
|
|
|
32
27
|
*/
|
|
33
28
|
export async function getDailySession(brand: string, userDate: Date) {
|
|
34
29
|
const stringDate = userDate.toISOString().split('T')[0]
|
|
35
|
-
const url: string = `${LEARNING_PATHS_PATH}/daily-session/get`
|
|
36
|
-
|
|
37
|
-
return await fetchHandler(url, 'GET', null, body)
|
|
30
|
+
const url: string = `${LEARNING_PATHS_PATH}/daily-session/get?brand=${brand}&userDate=${userDate}`
|
|
31
|
+
return await fetchHandler(url, 'GET', null, null)
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
/**
|
|
@@ -59,9 +53,8 @@ export async function updateDailySession(
|
|
|
59
53
|
* @param brand
|
|
60
54
|
*/
|
|
61
55
|
export async function getActivePath(brand: string) {
|
|
62
|
-
const url: string = `${LEARNING_PATHS_PATH}/active-path/get`
|
|
63
|
-
|
|
64
|
-
return await fetchHandler(url, 'GET', null, body)
|
|
56
|
+
const url: string = `${LEARNING_PATHS_PATH}/active-path/get?brand=${brand}`
|
|
57
|
+
return await fetchHandler(url, 'GET', null, null)
|
|
65
58
|
}
|
|
66
59
|
|
|
67
60
|
/**
|
|
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/HttpClient.test.js
CHANGED
|
File without changes
|
|
File without changes
|
package/test/dataContext.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/localStorageMock.js
CHANGED
|
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
|
|
File without changes
|
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|
package/test/reporting.test.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for Reporting Service
|
|
3
|
-
*
|
|
4
|
-
* Note: These tests use mocked HTTP calls. For integration tests,
|
|
5
|
-
* ensure the backend API is running at the configured baseUrl.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { initializeTestService } from './initializeTests.js'
|
|
9
|
-
import {
|
|
10
|
-
reportContent,
|
|
11
|
-
reportForumPost,
|
|
12
|
-
submitReport
|
|
13
|
-
} from '../src/services/reporting/reporting.ts'
|
|
14
|
-
|
|
15
|
-
// Mock HttpClient to avoid actual API calls in tests
|
|
16
|
-
jest.mock('../src/infrastructure/http/HttpClient', () => {
|
|
17
|
-
return {
|
|
18
|
-
HttpClient: jest.fn().mockImplementation(() => ({
|
|
19
|
-
post: jest.fn().mockResolvedValue({
|
|
20
|
-
report_id: 12345,
|
|
21
|
-
message: 'Report submitted successfully',
|
|
22
|
-
is_duplicate: false
|
|
23
|
-
})
|
|
24
|
-
}))
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
describe('Reporting Service', () => {
|
|
29
|
-
beforeEach(() => {
|
|
30
|
-
initializeTestService()
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
describe('reportContent', () => {
|
|
34
|
-
test('should submit a content report with video_not_working category', async () => {
|
|
35
|
-
const result = await reportContent({
|
|
36
|
-
contentId: 123,
|
|
37
|
-
category: 'video_not_working',
|
|
38
|
-
description: 'Video freezes at 2:30'
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
expect(result).toBeDefined()
|
|
42
|
-
expect(result.report_id).toBe(12345)
|
|
43
|
-
expect(result.message).toBe('Report submitted successfully')
|
|
44
|
-
expect(result.is_duplicate).toBe(false)
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
test('should submit a content report without description', async () => {
|
|
48
|
-
const result = await reportContent({
|
|
49
|
-
contentId: 456,
|
|
50
|
-
category: 'incorrect_content'
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
expect(result).toBeDefined()
|
|
54
|
-
expect(result.report_id).toBeDefined()
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
test('should submit a content report with other category and description', async () => {
|
|
58
|
-
const result = await reportContent({
|
|
59
|
-
contentId: 789,
|
|
60
|
-
category: 'other',
|
|
61
|
-
description: 'Audio quality is very poor'
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
expect(result).toBeDefined()
|
|
65
|
-
expect(result.report_id).toBeDefined()
|
|
66
|
-
expect(result.message).toBeDefined()
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
describe('reportForumPost', () => {
|
|
71
|
-
test('should submit a forum post report with required brand', async () => {
|
|
72
|
-
const result = await reportForumPost({
|
|
73
|
-
postId: 555,
|
|
74
|
-
brand: 'drumeo',
|
|
75
|
-
category: 'spam'
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
expect(result).toBeDefined()
|
|
79
|
-
expect(result.report_id).toBeDefined()
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
test('should submit a forum post report with description', async () => {
|
|
83
|
-
const result = await reportForumPost({
|
|
84
|
-
postId: 666,
|
|
85
|
-
brand: 'pianote',
|
|
86
|
-
category: 'harassment',
|
|
87
|
-
description: 'User is harassing other members'
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
expect(result).toBeDefined()
|
|
91
|
-
expect(result.report_id).toBeDefined()
|
|
92
|
-
expect(result.message).toBeDefined()
|
|
93
|
-
})
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
describe('submitReport', () => {
|
|
97
|
-
test('should submit a generic report for content', async () => {
|
|
98
|
-
const result = await submitReport({
|
|
99
|
-
reportableType: 'content',
|
|
100
|
-
reportableId: 999,
|
|
101
|
-
category: 'technical_issue',
|
|
102
|
-
description: 'Page not loading'
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
expect(result).toBeDefined()
|
|
106
|
-
expect(result.report_id).toBeDefined()
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
test('should submit a generic report for playlist', async () => {
|
|
110
|
-
const result = await submitReport({
|
|
111
|
-
reportableType: 'playlist',
|
|
112
|
-
reportableId: 777,
|
|
113
|
-
category: 'incorrect_content'
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
expect(result).toBeDefined()
|
|
117
|
-
expect(result.report_id).toBeDefined()
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
test('should submit a generic report for comment', async () => {
|
|
121
|
-
const result = await submitReport({
|
|
122
|
-
reportableType: 'comment',
|
|
123
|
-
reportableId: 888,
|
|
124
|
-
category: 'inappropriate',
|
|
125
|
-
description: 'Comment contains offensive language'
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
expect(result).toBeDefined()
|
|
129
|
-
expect(result.report_id).toBeDefined()
|
|
130
|
-
})
|
|
131
|
-
})
|
|
132
|
-
})
|