musora-content-services 2.24.0 → 2.25.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/.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 +9 -0
- package/README.md +0 -0
- package/babel.config.cjs +0 -0
- package/docs/Content-Organization.html +0 -0
- package/docs/UserManagement.html +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/global.html#User +0 -0
- package/docs/module-Notifications.html +0 -0
- package/docs/module-Session-Management.html +0 -0
- package/docs/module-User-Activity.html +0 -0
- package/docs/module-User-Management.html +0 -0
- package/docs/module-User-Permissions.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/types.js.html +0 -0
- package/docs/user_user-management.js.html +0 -0
- package/jest.config.js +0 -0
- package/jsdoc.json +0 -0
- package/package.json +1 -1
- package/src/contentMetaData.js +0 -0
- package/src/contentTypeConfig.js +1 -1
- package/src/filterBuilder.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/lib/lastUpdated.js +0 -0
- package/src/services/api/types.js +0 -0
- package/src/services/config.js +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/playlists-types.js +0 -0
- package/src/services/content-org/playlists.js +0 -0
- package/src/services/content.js +19 -12
- package/src/services/contentAggregator.js +0 -0
- package/src/services/contentLikes.js +0 -0
- package/src/services/contentProgress.js +0 -4
- package/src/services/dataContext.js +0 -0
- package/src/services/dateUtils.js +0 -0
- package/src/services/forum.js +2 -2
- package/src/services/gamification/awards.js +1 -1
- package/src/services/gamification/gamification.js +0 -0
- package/src/services/gamification/types.js +0 -0
- package/src/services/imageSRCBuilder.js +0 -0
- package/src/services/railcontent.js +0 -0
- package/src/services/recommendations.js +0 -0
- package/src/services/sanity.js +4 -1
- package/src/services/types.js +0 -0
- package/src/services/user/account.ts +0 -0
- package/src/services/user/chat.js +0 -0
- package/src/services/user/interests.js +0 -0
- package/src/services/user/notifications.js +0 -0
- package/src/services/user/permissions.js +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/content.test.js +0 -0
- package/test/contentLikes.test.js +0 -0
- package/test/contentProgress.test.js +0 -0
- package/test/dataContext.test.js +0 -0
- package/test/forum.test.js +0 -0
- package/test/imageSRCBuilder.test.js +0 -0
- package/test/imageSRCVerify.test.js +0 -0
- package/test/initializeTests.js +0 -0
- package/test/lib/lastUpdated.test.js +0 -0
- package/test/live/contentProgressLive.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/tools/generate-index.cjs +0 -0
- package/.yarnrc.yml +0 -1
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,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.25.0](https://github.com/railroadmedia/musora-content-services/compare/v2.24.1...v2.25.0) (2025-07-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **BEH-38:** add context data to tab results ([#344](https://github.com/railroadmedia/musora-content-services/issues/344)) ([02fe932](https://github.com/railroadmedia/musora-content-services/commit/02fe9321dfa56e74d7c73cb7a80e54f5818d1427))
|
|
11
|
+
|
|
12
|
+
### [2.24.1](https://github.com/railroadmedia/musora-content-services/compare/v2.24.0...v2.24.1) (2025-07-16)
|
|
13
|
+
|
|
5
14
|
## [2.24.0](https://github.com/railroadmedia/musora-content-services/compare/v2.21.3...v2.24.0) (2025-07-16)
|
|
6
15
|
|
|
7
16
|
|
package/README.md
CHANGED
|
File without changes
|
package/babel.config.cjs
CHANGED
|
File without changes
|
|
File without changes
|
package/docs/UserManagement.html
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
|
package/docs/global.html#User
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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
|
package/docs/types.js.html
CHANGED
|
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
package/src/contentMetaData.js
CHANGED
|
File without changes
|
package/src/contentTypeConfig.js
CHANGED
|
@@ -206,7 +206,7 @@ export const filterTypes = {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
export const recentTypes = {
|
|
209
|
-
lessons: [...individualLessonsTypes, 'course-part', 'pack-bundle-lesson', 'challenge-part', 'guided-course-part'],
|
|
209
|
+
lessons: [...individualLessonsTypes, 'course-part', 'pack-bundle-lesson', 'challenge-part', 'guided-course-part', 'quick-tips'],
|
|
210
210
|
songs: [...tutorialsLessonTypes, ...transcriptionsLessonTypes, ...playAlongLessonTypes],
|
|
211
211
|
home: [...individualLessonsTypes, ...tutorialsLessonTypes, ...transcriptionsLessonTypes, ...playAlongLessonTypes,
|
|
212
212
|
'guided-course', 'learning-path', 'live']
|
package/src/filterBuilder.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
|
package/src/lib/lastUpdated.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/services/config.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/services/content.js
CHANGED
|
@@ -66,7 +66,6 @@ export async function getTabResults(brand, pageName, tabName, {
|
|
|
66
66
|
sort = 'recommended',
|
|
67
67
|
selectedFilters = []
|
|
68
68
|
} = {}) {
|
|
69
|
-
|
|
70
69
|
// Extract and handle 'progress' filter separately
|
|
71
70
|
const progressFilter = selectedFilters.find(f => f.startsWith('progress,')) || 'progress,all';
|
|
72
71
|
const progressValue = progressFilter.split(',')[1].toLowerCase();
|
|
@@ -76,9 +75,23 @@ export async function getTabResults(brand, pageName, tabName, {
|
|
|
76
75
|
const mergedIncludedFields = [...filteredSelectedFilters, `tab,${tabName.toLowerCase()}`];
|
|
77
76
|
|
|
78
77
|
// Fetch data
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
let results
|
|
79
|
+
if( tabName === Tabs.ForYou.name ) {
|
|
80
|
+
results = await addContextToContent(getLessonContentRows, brand, pageName, {
|
|
81
|
+
dataField: 'items',
|
|
82
|
+
addNextLesson: true,
|
|
83
|
+
addProgressPercentage: true,
|
|
84
|
+
addProgressStatus: true
|
|
85
|
+
})
|
|
86
|
+
} else {
|
|
87
|
+
let temp = await fetchTabData(brand, pageName, { page, limit, sort, includedFields: mergedIncludedFields, progress: progressValue });
|
|
88
|
+
results = await addContextToContent(() => temp.entity, {
|
|
89
|
+
addNextLesson: true,
|
|
90
|
+
addProgressPercentage: true,
|
|
91
|
+
addProgressStatus: true
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
82
95
|
|
|
83
96
|
// Fetch metadata
|
|
84
97
|
const metaData = await fetchMetadata(brand, pageName);
|
|
@@ -108,7 +121,7 @@ export async function getTabResults(brand, pageName, tabName, {
|
|
|
108
121
|
|
|
109
122
|
return {
|
|
110
123
|
type: tabName === Tabs.ForYou.name ? TabResponseType.SECTIONS : TabResponseType.CATALOG,
|
|
111
|
-
data: results
|
|
124
|
+
data: results,
|
|
112
125
|
meta: { filters, sort: sortOptions }
|
|
113
126
|
};
|
|
114
127
|
}
|
|
@@ -173,13 +186,7 @@ export async function getContentRows(brand, pageName, contentRowSlug = null, {
|
|
|
173
186
|
page = 1,
|
|
174
187
|
limit = 10
|
|
175
188
|
} = {}) {
|
|
176
|
-
const sanityData = await
|
|
177
|
-
dataField: 'content',
|
|
178
|
-
dataField_parentIsArray: true,
|
|
179
|
-
addProgressStatus: true,
|
|
180
|
-
addProgressPercentage: true,
|
|
181
|
-
addNextLesson: true
|
|
182
|
-
})
|
|
189
|
+
const sanityData = await fetchContentRows(brand, pageName, contentRowSlug)
|
|
183
190
|
if (!sanityData) {
|
|
184
191
|
return []
|
|
185
192
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -79,12 +79,8 @@ export async function getNextLesson(data)
|
|
|
79
79
|
nextLessonData[content.id] = findIncompleteLesson(childrenStates, lastInteracted, content.type)
|
|
80
80
|
} else if (content.type === 'pack') {
|
|
81
81
|
const packBundles = content.children ?? []
|
|
82
|
-
console.log('pack', content)
|
|
83
|
-
console.log('bundles', packBundles)
|
|
84
82
|
const packBundleProgressData = await getNextLesson(packBundles)
|
|
85
83
|
const parentId = await getLastInteractedOf(packBundles.map(bundle => bundle.id));
|
|
86
|
-
console.log('parentId', parentId)
|
|
87
|
-
console.log('bundleprogressData', packBundleProgressData)
|
|
88
84
|
nextLessonData[content.id] = packBundleProgressData[parentId];
|
|
89
85
|
}
|
|
90
86
|
}
|
|
File without changes
|
|
File without changes
|
package/src/services/forum.js
CHANGED
|
@@ -10,7 +10,7 @@ export async function getActiveDiscussions(brand, { page = 1, limit = 10 } = {})
|
|
|
10
10
|
{
|
|
11
11
|
id: 11,
|
|
12
12
|
url: 'https://forum.example.com/post/11',
|
|
13
|
-
title: 'How to Progress',
|
|
13
|
+
title: 'How to Progress.',
|
|
14
14
|
post: "I use the 20-80 formula. 20% of the time on rudiments, skill, technique. 80% of the time working on songs or just playing along to the radio. Since it's a percentage, it fits any amount of time whether it's ten minutes or two hours. My neighbors would be p*ssed if I played two hours a day broken up over the whole day. They prefer I get my practice done in one shot. An hour a day works well for me.",
|
|
15
15
|
author: {
|
|
16
16
|
id: 123,
|
|
@@ -32,7 +32,7 @@ export async function getActiveDiscussions(brand, { page = 1, limit = 10 } = {})
|
|
|
32
32
|
{
|
|
33
33
|
id: 13,
|
|
34
34
|
url: 'https://forum.example.com/post/13',
|
|
35
|
-
title: 'Introduce yourself to the Drumeo Community',
|
|
35
|
+
title: 'Introduce yourself to the Drumeo Community...',
|
|
36
36
|
post: "Hi drummer forum 1. I'm 67 and retired plus an adjunct professor at community college currently 2. Enjoying an Alesis with Nitro Max practice drum set and on 9th day going through Domino Santantonio's 30 day challenge. Domino is wonderful and energetic. 3. I like any kind of alt-rock, rock, old gaelic style drumming, and jazz drumming",
|
|
37
37
|
author: {
|
|
38
38
|
id: 125,
|
|
@@ -21,7 +21,7 @@ export async function fetchAwardsForUser(userId, brand, page = 1, limit = 20) {
|
|
|
21
21
|
username: 'Alexandre Severo',
|
|
22
22
|
streak: 22,
|
|
23
23
|
minutes_practiced: 350,
|
|
24
|
-
date_completed: '
|
|
24
|
+
date_completed: 'Jul 27, 2025',
|
|
25
25
|
challenge_title: '30-Day Drummer',
|
|
26
26
|
award_text:
|
|
27
27
|
'Through this challenge, you’ve sharpened your drumming skills, improved your timing, and built a solid practice routine.',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/services/sanity.js
CHANGED
|
@@ -551,7 +551,10 @@ export async function fetchContentRows(brand, pageName, contentRowSlug)
|
|
|
551
551
|
brand,
|
|
552
552
|
name,
|
|
553
553
|
'slug': slug.current,
|
|
554
|
-
'content': content[]->{
|
|
554
|
+
'content': content[]->{
|
|
555
|
+
'children': child[]->{ 'id': railcontent_id, 'children': child[]->{'id': railcontent_id}, },
|
|
556
|
+
${getFieldsForContentType('tab-data')}
|
|
557
|
+
},
|
|
555
558
|
}`, true)
|
|
556
559
|
}
|
|
557
560
|
|
package/src/services/types.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/test/HttpClient.test.js
CHANGED
|
File without changes
|
package/test/content.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/dataContext.test.js
CHANGED
|
File without changes
|
package/test/forum.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/initializeTests.js
CHANGED
|
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/tools/generate-index.cjs
CHANGED
|
File without changes
|
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|