musora-content-services 2.86.1 → 2.88.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/.claude/settings.local.json +14 -0
- 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/.yarnrc.yml +1 -0
- package/CHANGELOG.md +16 -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/index.d.ts +8 -3
- package/src/index.js +8 -3
- 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 +12 -23
- 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/reporting/README.md +316 -0
- package/src/services/reporting/reporting.ts +189 -0
- package/src/services/reporting/types.ts +56 -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/reporting.test.js +132 -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/.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,22 @@
|
|
|
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.0](https://github.com/railroadmedia/musora-content-services/compare/v2.86.1...v2.88.0) (2025-11-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **BEH-1418:** refactor learning path endpoints ([#589](https://github.com/railroadmedia/musora-content-services/issues/589)) ([e3637f6](https://github.com/railroadmedia/musora-content-services/commit/e3637f6359ddf8f4295eead890de6457b942b4ea))
|
|
11
|
+
* Implement unified user reporting system ([7aa42ab](https://github.com/railroadmedia/musora-content-services/commit/7aa42ab8dcee09ce3f293d9fbb1a203dcbe94414))
|
|
12
|
+
* **MU2-1250:** Implement unified user reporting system ([3303282](https://github.com/railroadmedia/musora-content-services/commit/33032829b729efa9f9b1e40f31179127c8c74f9d))
|
|
13
|
+
|
|
14
|
+
## [2.87.0](https://github.com/railroadmedia/musora-content-services/compare/v2.86.1...v2.87.0) (2025-11-26)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **BEH-1418:** refactor learning path endpoints ([#589](https://github.com/railroadmedia/musora-content-services/issues/589)) ([e3637f6](https://github.com/railroadmedia/musora-content-services/commit/e3637f6359ddf8f4295eead890de6457b942b4ea))
|
|
20
|
+
|
|
5
21
|
### [2.86.1](https://github.com/railroadmedia/musora-content-services/compare/v2.86.0...v2.86.1) (2025-11-25)
|
|
6
22
|
|
|
7
23
|
|
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
|
package/src/index.d.ts
CHANGED
|
@@ -41,7 +41,6 @@ import {
|
|
|
41
41
|
mapContentToParent,
|
|
42
42
|
resetAllLearningPaths,
|
|
43
43
|
startLearningPath,
|
|
44
|
-
updateActivePath,
|
|
45
44
|
updateDailySession
|
|
46
45
|
} from './services/content-org/learning-paths.ts';
|
|
47
46
|
|
|
@@ -243,6 +242,11 @@ import {
|
|
|
243
242
|
recommendations
|
|
244
243
|
} from './services/recommendations.js';
|
|
245
244
|
|
|
245
|
+
import {
|
|
246
|
+
getReportIssueOptions,
|
|
247
|
+
report
|
|
248
|
+
} from './services/reporting/reporting.ts';
|
|
249
|
+
|
|
246
250
|
import {
|
|
247
251
|
buildEntityAndTotalQuery,
|
|
248
252
|
fetchAll,
|
|
@@ -413,7 +417,7 @@ import {
|
|
|
413
417
|
} from './services/userActivity.js';
|
|
414
418
|
|
|
415
419
|
import {
|
|
416
|
-
default as EventsAPI
|
|
420
|
+
default as EventsAPI
|
|
417
421
|
} from './services/eventsAPI';
|
|
418
422
|
|
|
419
423
|
declare module 'musora-content-services' {
|
|
@@ -598,6 +602,7 @@ declare module 'musora-content-services' {
|
|
|
598
602
|
getRecent,
|
|
599
603
|
getRecentActivity,
|
|
600
604
|
getRecommendedForYou,
|
|
605
|
+
getReportIssueOptions,
|
|
601
606
|
getResumeTimeSeconds,
|
|
602
607
|
getResumeTimeSecondsByIds,
|
|
603
608
|
getSanityDate,
|
|
@@ -663,6 +668,7 @@ declare module 'musora-content-services' {
|
|
|
663
668
|
removeContentAsNotInterested,
|
|
664
669
|
removeUserPractice,
|
|
665
670
|
replyToComment,
|
|
671
|
+
report,
|
|
666
672
|
reportComment,
|
|
667
673
|
reportPlaylist,
|
|
668
674
|
requestEmailChange,
|
|
@@ -702,7 +708,6 @@ declare module 'musora-content-services' {
|
|
|
702
708
|
unlockThread,
|
|
703
709
|
unpinProgressRow,
|
|
704
710
|
unpinThread,
|
|
705
|
-
updateActivePath,
|
|
706
711
|
updateDailySession,
|
|
707
712
|
updateDisplayName,
|
|
708
713
|
updateForumCategory,
|
package/src/index.js
CHANGED
|
@@ -41,7 +41,6 @@ import {
|
|
|
41
41
|
mapContentToParent,
|
|
42
42
|
resetAllLearningPaths,
|
|
43
43
|
startLearningPath,
|
|
44
|
-
updateActivePath,
|
|
45
44
|
updateDailySession
|
|
46
45
|
} from './services/content-org/learning-paths.ts';
|
|
47
46
|
|
|
@@ -243,6 +242,11 @@ import {
|
|
|
243
242
|
recommendations
|
|
244
243
|
} from './services/recommendations.js';
|
|
245
244
|
|
|
245
|
+
import {
|
|
246
|
+
getReportIssueOptions,
|
|
247
|
+
report
|
|
248
|
+
} from './services/reporting/reporting.ts';
|
|
249
|
+
|
|
246
250
|
import {
|
|
247
251
|
buildEntityAndTotalQuery,
|
|
248
252
|
fetchAll,
|
|
@@ -413,7 +417,7 @@ import {
|
|
|
413
417
|
} from './services/userActivity.js';
|
|
414
418
|
|
|
415
419
|
import {
|
|
416
|
-
default as EventsAPI
|
|
420
|
+
default as EventsAPI
|
|
417
421
|
} from './services/eventsAPI';
|
|
418
422
|
|
|
419
423
|
export {
|
|
@@ -597,6 +601,7 @@ export {
|
|
|
597
601
|
getRecent,
|
|
598
602
|
getRecentActivity,
|
|
599
603
|
getRecommendedForYou,
|
|
604
|
+
getReportIssueOptions,
|
|
600
605
|
getResumeTimeSeconds,
|
|
601
606
|
getResumeTimeSecondsByIds,
|
|
602
607
|
getSanityDate,
|
|
@@ -662,6 +667,7 @@ export {
|
|
|
662
667
|
removeContentAsNotInterested,
|
|
663
668
|
removeUserPractice,
|
|
664
669
|
replyToComment,
|
|
670
|
+
report,
|
|
665
671
|
reportComment,
|
|
666
672
|
reportPlaylist,
|
|
667
673
|
requestEmailChange,
|
|
@@ -701,7 +707,6 @@ export {
|
|
|
701
707
|
unlockThread,
|
|
702
708
|
unpinProgressRow,
|
|
703
709
|
unpinThread,
|
|
704
|
-
updateActivePath,
|
|
705
710
|
updateDailySession,
|
|
706
711
|
updateDisplayName,
|
|
707
712
|
updateForumCategory,
|
|
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
|
|
@@ -32,9 +32,9 @@ interface ActiveLearningPathResponse {
|
|
|
32
32
|
*/
|
|
33
33
|
export async function getDailySession(brand: string, userDate: Date) {
|
|
34
34
|
const stringDate = userDate.toISOString().split('T')[0]
|
|
35
|
-
const url: string = `${LEARNING_PATHS_PATH}/daily-session/get
|
|
35
|
+
const url: string = `${LEARNING_PATHS_PATH}/daily-session/get`
|
|
36
36
|
const body = { brand: brand, userDate: stringDate }
|
|
37
|
-
return await fetchHandler(url, '
|
|
37
|
+
return await fetchHandler(url, 'GET', null, body)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -49,7 +49,7 @@ export async function updateDailySession(
|
|
|
49
49
|
keepFirstLearningPath: boolean
|
|
50
50
|
) {
|
|
51
51
|
const stringDate = userDate.toISOString().split('T')[0]
|
|
52
|
-
const url: string = `${LEARNING_PATHS_PATH}/daily-session/
|
|
52
|
+
const url: string = `${LEARNING_PATHS_PATH}/daily-session/create`
|
|
53
53
|
const body = { brand: brand, userDate: stringDate, keepFirstLearningPath: keepFirstLearningPath }
|
|
54
54
|
return await fetchHandler(url, 'POST', null, body)
|
|
55
55
|
}
|
|
@@ -59,30 +59,18 @@ export async function updateDailySession(
|
|
|
59
59
|
* @param brand
|
|
60
60
|
*/
|
|
61
61
|
export async function getActivePath(brand: string) {
|
|
62
|
-
const url: string = `${LEARNING_PATHS_PATH}/active-path/get
|
|
63
|
-
const body = { brand: brand }
|
|
64
|
-
return await fetchHandler(url, 'POST', null, body)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// todo this should be removed once we handle active path gen only through
|
|
68
|
-
// finish method intro or complete current active path
|
|
69
|
-
/**
|
|
70
|
-
* Updates user's active learning path.
|
|
71
|
-
* @param brand
|
|
72
|
-
*/
|
|
73
|
-
export async function updateActivePath(brand: string) {
|
|
74
|
-
const url: string = `${LEARNING_PATHS_PATH}/active-path/update`
|
|
62
|
+
const url: string = `${LEARNING_PATHS_PATH}/active-path/get`
|
|
75
63
|
const body = { brand: brand }
|
|
76
|
-
return await fetchHandler(url, '
|
|
64
|
+
return await fetchHandler(url, 'GET', null, body)
|
|
77
65
|
}
|
|
78
66
|
|
|
79
67
|
/**
|
|
80
|
-
*
|
|
68
|
+
* Sets a new learning path as the user's active learning path.
|
|
81
69
|
* @param brand
|
|
82
70
|
* @param learningPathId
|
|
83
71
|
*/
|
|
84
72
|
export async function startLearningPath(brand: string, learningPathId: number) {
|
|
85
|
-
const url: string = `${LEARNING_PATHS_PATH}/
|
|
73
|
+
const url: string = `${LEARNING_PATHS_PATH}/active-path/set`
|
|
86
74
|
const body = { brand: brand, learning_path_id: learningPathId }
|
|
87
75
|
return await fetchHandler(url, 'POST', null, body)
|
|
88
76
|
}
|
|
@@ -172,10 +160,11 @@ export async function fetchLearningPathLessons(
|
|
|
172
160
|
brand: string,
|
|
173
161
|
userDate: Date
|
|
174
162
|
) {
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
163
|
+
const learningPath = await getEnrichedLearningPath(learningPathId)
|
|
164
|
+
let dailySession = await getDailySession(brand, userDate)
|
|
165
|
+
if (!dailySession) {
|
|
166
|
+
dailySession = await updateDailySession(brand, userDate, false)
|
|
167
|
+
}
|
|
179
168
|
|
|
180
169
|
const isActiveLearningPath = (dailySession?.active_learning_path_id || 0) == learningPathId
|
|
181
170
|
if (!isActiveLearningPath) {
|
|
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
|