musora-content-services 1.0.142 → 1.0.143
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/.github/workflows/node.js.yml +0 -0
- package/CHANGELOG.md +2 -0
- package/README.md +0 -0
- package/babel.config.js +0 -0
- package/docs/config.js.html +8 -4
- 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/index.html +2 -2
- package/docs/module-Config.html +30 -5
- package/docs/module-Railcontent-Services.html +2 -2
- package/docs/module-Sanity-Services.html +285 -46
- package/docs/railcontent.js.html +19 -2
- package/docs/sanity.js.html +79 -73
- 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/jest.config.js +0 -0
- package/jsdoc.json +0 -0
- package/package.json +1 -1
- package/src/contentMetaData.js +0 -0
- package/src/filterBuilder.js +0 -0
- package/src/index.d.ts +6 -0
- package/src/index.js +6 -0
- package/src/services/config.js +0 -0
- package/src/services/contentLikes.js +0 -0
- package/src/services/dataContext.js +0 -0
- package/src/services/railcontent.js +17 -0
- package/src/services/sanity.js +55 -71
- package/test/contentLikes.test.js +0 -0
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
- package/test/sanityQueryService.test.js +0 -0
- package/tools/generate-index.js +0 -0
- package/test/playlists.test.js +0 -86
package/docs/railcontent.js.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#~initializeService">initializeService</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedContent">fetchCompletedContent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllSongs">fetchAllSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtistLessons">fetchArtistLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByReference">fetchByReference</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCatalogMetadata">fetchCatalogMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChallengeOverview">fetchChallengeOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChildren">fetchChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCourseOverview">fetchCourseOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchGenreLessons">fetchGenreLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMetadata">fetchMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodNextLesson">fetchMethodNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethods">fetchMethods</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackChildren">fetchPackChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackData">fetchPackData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentByRailContentId">fetchParentByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedMethodLessons">fetchRelatedMethodLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchScheduledReleases">fetchScheduledReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchShowsData">fetchShowsData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongCount">fetchSongCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongFilterOptions">fetchSongFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchWorkouts">fetchWorkouts</a></li></ul></li></ul>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#~initializeService">initializeService</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedContent">fetchCompletedContent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllSongs">fetchAllSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtistLessons">fetchArtistLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByReference">fetchByReference</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCatalogMetadata">fetchCatalogMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChallengeOverview">fetchChallengeOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChildren">fetchChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCourseOverview">fetchCourseOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchGenreLessons">fetchGenreLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMetadata">fetchMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodNextLesson">fetchMethodNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethods">fetchMethods</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackChildren">fetchPackChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackData">fetchPackData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentByRailContentId">fetchParentByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentForDownload">fetchParentForDownload</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedMethodLessons">fetchRelatedMethodLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchScheduledReleases">fetchScheduledReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchShowsData">fetchShowsData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongCount">fetchSongCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongFilterOptions">fetchSongFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchWorkouts">fetchWorkouts</a></li></ul></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -325,6 +325,11 @@ export async function fetchChallengeMetadata(contentId) {
|
|
|
325
325
|
return await fetchHandler(url, 'get');
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
+
export async function fetchChallengeLessonData(contentId) {
|
|
329
|
+
let url = `/challenges/lessons/${contentId}`;
|
|
330
|
+
return await fetchHandler(url, 'get');
|
|
331
|
+
}
|
|
332
|
+
|
|
328
333
|
export async function fetchUserChallengeProgress(contentId) {
|
|
329
334
|
let url = `/challenges/user_data/${contentId}`;
|
|
330
335
|
return await fetchHandler(url, 'get');
|
|
@@ -355,6 +360,18 @@ export async function postChallengesLeave(contentId) {
|
|
|
355
360
|
return await fetchHandler(url, 'post');
|
|
356
361
|
}
|
|
357
362
|
|
|
363
|
+
export async function postChallengesEnrollmentNotification(contentId) {
|
|
364
|
+
let url = `/challenges/notifications/enrollment_open/${contentId}`;
|
|
365
|
+
return await fetchHandler(url, 'post');
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export async function postChallengesCommunityNotification(contentId) {
|
|
369
|
+
let url = `/challenges/notifications/community_reminders/${contentId}`;
|
|
370
|
+
return await fetchHandler(url, 'post');
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
358
375
|
function fetchAbsolute(url, params) {
|
|
359
376
|
if (globalConfig.railcontentConfig.baseUrl) {
|
|
360
377
|
if (url.startsWith('/')) {
|
|
@@ -376,7 +393,7 @@ function fetchAbsolute(url, params) {
|
|
|
376
393
|
<br class="clear">
|
|
377
394
|
|
|
378
395
|
<footer>
|
|
379
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on
|
|
396
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Thu Oct 24 2024 18:49:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
380
397
|
</footer>
|
|
381
398
|
|
|
382
399
|
<script>prettyPrint();</script>
|
package/docs/sanity.js.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#~initializeService">initializeService</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedContent">fetchCompletedContent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllSongs">fetchAllSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtistLessons">fetchArtistLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByReference">fetchByReference</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCatalogMetadata">fetchCatalogMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChallengeOverview">fetchChallengeOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChildren">fetchChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCourseOverview">fetchCourseOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchGenreLessons">fetchGenreLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMetadata">fetchMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodNextLesson">fetchMethodNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethods">fetchMethods</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackChildren">fetchPackChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackData">fetchPackData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentByRailContentId">fetchParentByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedMethodLessons">fetchRelatedMethodLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchScheduledReleases">fetchScheduledReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchShowsData">fetchShowsData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongCount">fetchSongCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongFilterOptions">fetchSongFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchWorkouts">fetchWorkouts</a></li></ul></li></ul>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#~initializeService">initializeService</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedContent">fetchCompletedContent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllSongs">fetchAllSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtistLessons">fetchArtistLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByReference">fetchByReference</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCatalogMetadata">fetchCatalogMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChallengeOverview">fetchChallengeOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChildren">fetchChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCourseOverview">fetchCourseOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchGenreLessons">fetchGenreLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMetadata">fetchMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodNextLesson">fetchMethodNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethods">fetchMethods</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackChildren">fetchPackChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackData">fetchPackData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentByRailContentId">fetchParentByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentForDownload">fetchParentForDownload</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedMethodLessons">fetchRelatedMethodLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchScheduledReleases">fetchScheduledReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchShowsData">fetchShowsData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongCount">fetchSongCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongFilterOptions">fetchSongFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchWorkouts">fetchWorkouts</a></li></ul></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -633,101 +633,84 @@ export function getSortOrder(sort= '-published_on', groupBy)
|
|
|
633
633
|
}
|
|
634
634
|
|
|
635
635
|
/**
|
|
636
|
-
* Fetches all available filter options based on
|
|
636
|
+
* Fetches all available filter options based on brand, filters, and various optional criteria.
|
|
637
637
|
*
|
|
638
638
|
* This function constructs a query to retrieve the total number of results and filter options such as difficulty, instrument type, and genre.
|
|
639
639
|
* The filter options are dynamically generated based on the provided filters, style, artist, and content type.
|
|
640
640
|
* If a coachId is provided, the content type must be 'coach-lessons'.
|
|
641
641
|
*
|
|
642
|
-
* @param {string} brand -
|
|
643
|
-
* @param {string[]} filters -
|
|
644
|
-
* @param {string} [style] - Optional style
|
|
645
|
-
* @param {string} [artist] - Optional artist name
|
|
646
|
-
* @param {string} contentType -
|
|
647
|
-
* @param {string} [term] - Optional search term
|
|
648
|
-
* @param {Array<string>} [progressIds
|
|
649
|
-
* @param {string} [coachId
|
|
650
|
-
* @
|
|
642
|
+
* @param {string} brand - Brand to filter.
|
|
643
|
+
* @param {string[]} filters - Key-value pairs to filter the query.
|
|
644
|
+
* @param {string} [style] - Optional style/genre filter.
|
|
645
|
+
* @param {string} [artist] - Optional artist name filter.
|
|
646
|
+
* @param {string} contentType - Content type (e.g., 'song', 'lesson').
|
|
647
|
+
* @param {string} [term] - Optional search term for title, album, artist, or genre.
|
|
648
|
+
* @param {Array<string>} [progressIds] - Optional array of progress IDs to filter by.
|
|
649
|
+
* @param {string} [coachId] - Optional coach ID (only valid if contentType is 'coach-lessons').
|
|
650
|
+
* @param {boolean} [includeTabs=false] - Whether to include tabs in the returned metadata.
|
|
651
|
+
* @returns {Promise<Object>} - The filter options and metadata.
|
|
652
|
+
* @throws {Error} If coachId is provided but contentType isn't 'coach-lessons'.
|
|
651
653
|
*
|
|
652
|
-
* @throws {Error} Will throw an error if coachId is provided but contentType is not 'coach-lessons'.
|
|
653
|
-
*
|
|
654
654
|
* @example
|
|
655
|
-
* //
|
|
656
|
-
* fetchAllFilterOptions('myBrand',
|
|
655
|
+
* // Fetch filter options for 'song' content type:
|
|
656
|
+
* fetchAllFilterOptions('myBrand', [], 'Rock', 'John Doe', 'song', 'Love')
|
|
657
657
|
* .then(options => console.log(options))
|
|
658
658
|
* .catch(error => console.error(error));
|
|
659
659
|
*
|
|
660
660
|
* @example
|
|
661
|
-
* //
|
|
662
|
-
* fetchAllFilterOptions('myBrand',
|
|
661
|
+
* // Fetch filter options for a coach's lessons with coachId:
|
|
662
|
+
* fetchAllFilterOptions('myBrand', [], 'Rock', 'John Doe', 'coach-lessons', 'Love', undefined, '123')
|
|
663
663
|
* .then(options => console.log(options))
|
|
664
664
|
* .catch(error => console.error(error));
|
|
665
665
|
*/
|
|
666
666
|
export async function fetchAllFilterOptions(
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
667
|
+
brand,
|
|
668
|
+
filters = [],
|
|
669
|
+
style,
|
|
670
|
+
artist,
|
|
671
|
+
contentType,
|
|
672
|
+
term,
|
|
673
|
+
progressIds,
|
|
674
|
+
coachId,
|
|
675
|
+
includeTabs = false,
|
|
675
676
|
) {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
filters = Array.isArray(filters) ? filters : [];
|
|
682
|
-
const includedFieldsFilter = filters?.length > 0 ? filtersToGroq(filters) : undefined;
|
|
683
|
-
|
|
684
|
-
const progressFilter = progressIds !== undefined ?
|
|
685
|
-
`&& railcontent_id in [${progressIds.join(',')}]` : "";
|
|
677
|
+
if (coachId && contentType !== 'coach-lessons') {
|
|
678
|
+
throw new Error(`Invalid contentType: '${contentType}' for coachId. It must be 'coach-lessons'.`);
|
|
679
|
+
}
|
|
686
680
|
|
|
687
|
-
|
|
688
|
-
|
|
681
|
+
const includedFieldsFilter = filters?.length ? filtersToGroq(filters) : undefined;
|
|
682
|
+
const progressFilter = progressIds ? `&& railcontent_id in [${progressIds.join(',')}]` : "";
|
|
689
683
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
}
|
|
684
|
+
const constructCommonFilter = (excludeFilter) => {
|
|
685
|
+
const filterWithoutOption = excludeFilter ? filtersToGroq(filters, excludeFilter) : includedFieldsFilter;
|
|
686
|
+
return coachId
|
|
687
|
+
? `brand == '${brand}' && references(*[_type=='instructor' && railcontent_id == ${coachId}]._id) ${filterWithoutOption || ''}`
|
|
688
|
+
: `_type == '${contentType}' && brand == "${brand}"${style && excludeFilter !== "style" ? ` && '${style}' in genre[]->name` : ''}${artist && excludeFilter !== "artist" ? ` && artist->name == '${artist}'` : ''} ${progressFilter} ${filterWithoutOption || ''}`;
|
|
689
|
+
};
|
|
697
690
|
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
691
|
+
const metaData = processMetadata(brand, contentType, true);
|
|
692
|
+
const allowableFilters = metaData?.allowableFilters || [];
|
|
693
|
+
const tabs = metaData?.tabs || [];
|
|
701
694
|
|
|
702
|
-
|
|
703
|
-
const dynamicFilterOptions = allowableFilters.map(filter => {
|
|
704
|
-
let includedFieldsFilterWithoutSelectedOption = filters?.length > 0 ? filtersToGroq(filters, filter) : undefined;
|
|
705
|
-
let commonFilterWithoutSelectedOption;
|
|
695
|
+
const dynamicFilterOptions = allowableFilters.map(filter => getFilterOptions(filter, constructCommonFilter(filter), contentType, brand)).join(' ');
|
|
706
696
|
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
697
|
+
const query = `
|
|
698
|
+
{
|
|
699
|
+
"meta": {
|
|
700
|
+
"totalResults": count(*[${constructCommonFilter()}
|
|
701
|
+
${term ? ` && (title match "${term}" || album match "${term}" || artist->name match "${term}" || genre[]->name match "${term}")` : ''}]),
|
|
702
|
+
"filterOptions": {
|
|
703
|
+
${dynamicFilterOptions}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}`;
|
|
713
707
|
|
|
714
|
-
|
|
715
|
-
return getFilterOptions(filter, commonFilterWithoutSelectedOption, contentType, brand);
|
|
716
|
-
}).join(' ');
|
|
708
|
+
const results = await fetchSanity(query, true, { processNeedAccess: false });
|
|
717
709
|
|
|
718
|
-
|
|
719
|
-
{
|
|
720
|
-
"meta": {
|
|
721
|
-
"totalResults": count(*[${commonFilter}
|
|
722
|
-
${term ? ` && (title match "${term}" || album match "${term}" || artist->name match "${term}" || genre[]->name match "${term}")` : ''}]),
|
|
723
|
-
"filterOptions": {
|
|
724
|
-
${dynamicFilterOptions}
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
}`;
|
|
728
|
-
return fetchSanity(query, true, {processNeedAccess:false});
|
|
710
|
+
return includeTabs ? { ...results, tabs } : results;
|
|
729
711
|
}
|
|
730
712
|
|
|
713
|
+
|
|
731
714
|
/**
|
|
732
715
|
* Fetch children content by Railcontent ID.
|
|
733
716
|
* @param {string} railcontentId - The Railcontent ID of the parent content.
|
|
@@ -1008,7 +991,8 @@ export async function fetchLessonContent(railContentId) {
|
|
|
1008
991
|
mp3_yes_drums_yes_click_url,
|
|
1009
992
|
"permission_id": permission[]->railcontent_id,
|
|
1010
993
|
parent_content_data,
|
|
1011
|
-
sort
|
|
994
|
+
sort,
|
|
995
|
+
xp`;
|
|
1012
996
|
const query = buildQuery(
|
|
1013
997
|
`railcontent_id == ${railContentId}`,
|
|
1014
998
|
filterParams,
|
|
@@ -1258,6 +1242,28 @@ export async function fetchCourseOverview(id) {
|
|
|
1258
1242
|
return fetchByRailContentId(id, 'course');
|
|
1259
1243
|
}
|
|
1260
1244
|
|
|
1245
|
+
/**
|
|
1246
|
+
* Fetch the data needed for the Course Overview screen.
|
|
1247
|
+
* @param {string} id - The Railcontent ID of the course
|
|
1248
|
+
* @returns {Promise<Object|null>} - The course information and lessons or null if not found.
|
|
1249
|
+
*
|
|
1250
|
+
* @example
|
|
1251
|
+
* fetchParentForDownload('course123')
|
|
1252
|
+
* .then(course => console.log(course))
|
|
1253
|
+
* .catch(error => console.error(error));
|
|
1254
|
+
*/
|
|
1255
|
+
export async function fetchParentForDownload(id) {
|
|
1256
|
+
const query = buildRawQuery(
|
|
1257
|
+
`railcontent_id == ${id}`,
|
|
1258
|
+
getFieldsForContentType('parent-download'),
|
|
1259
|
+
{
|
|
1260
|
+
isSingle: true,
|
|
1261
|
+
},
|
|
1262
|
+
);
|
|
1263
|
+
|
|
1264
|
+
return fetchSanity(query, false);
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1261
1267
|
/**
|
|
1262
1268
|
* Fetch the data needed for the coach screen.
|
|
1263
1269
|
* @param {string} id - The Railcontent ID of the coach
|
|
@@ -1783,7 +1789,7 @@ function cleanUpGroq(query) {
|
|
|
1783
1789
|
<br class="clear">
|
|
1784
1790
|
|
|
1785
1791
|
<footer>
|
|
1786
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on
|
|
1792
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Thu Oct 24 2024 18:49:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
1787
1793
|
</footer>
|
|
1788
1794
|
|
|
1789
1795
|
<script>prettyPrint();</script>
|
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/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/filterBuilder.js
CHANGED
|
File without changes
|
package/src/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
15
|
fetchAllCompletedStates,
|
|
16
|
+
fetchChallengeLessonData,
|
|
16
17
|
fetchChallengeMetadata,
|
|
17
18
|
fetchCompletedContent,
|
|
18
19
|
fetchCompletedState,
|
|
@@ -23,7 +24,9 @@ import {
|
|
|
23
24
|
fetchUserAward,
|
|
24
25
|
fetchUserChallengeProgress,
|
|
25
26
|
fetchUserPermissions,
|
|
27
|
+
postChallengesCommunityNotification,
|
|
26
28
|
postChallengesEnroll,
|
|
29
|
+
postChallengesEnrollmentNotification,
|
|
27
30
|
postChallengesLeave,
|
|
28
31
|
postChallengesSetStartDate,
|
|
29
32
|
postChallengesUnlock
|
|
@@ -90,6 +93,7 @@ declare module 'musora-content-services' {
|
|
|
90
93
|
fetchByRailContentIds,
|
|
91
94
|
fetchByReference,
|
|
92
95
|
fetchCatalogMetadata,
|
|
96
|
+
fetchChallengeLessonData,
|
|
93
97
|
fetchChallengeMetadata,
|
|
94
98
|
fetchChallengeOverview,
|
|
95
99
|
fetchChildren,
|
|
@@ -138,7 +142,9 @@ declare module 'musora-content-services' {
|
|
|
138
142
|
initializeService,
|
|
139
143
|
isContentLiked,
|
|
140
144
|
likeContent,
|
|
145
|
+
postChallengesCommunityNotification,
|
|
141
146
|
postChallengesEnroll,
|
|
147
|
+
postChallengesEnrollmentNotification,
|
|
142
148
|
postChallengesLeave,
|
|
143
149
|
postChallengesSetStartDate,
|
|
144
150
|
postChallengesUnlock,
|
package/src/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
15
|
fetchAllCompletedStates,
|
|
16
|
+
fetchChallengeLessonData,
|
|
16
17
|
fetchChallengeMetadata,
|
|
17
18
|
fetchCompletedContent,
|
|
18
19
|
fetchCompletedState,
|
|
@@ -23,7 +24,9 @@ import {
|
|
|
23
24
|
fetchUserAward,
|
|
24
25
|
fetchUserChallengeProgress,
|
|
25
26
|
fetchUserPermissions,
|
|
27
|
+
postChallengesCommunityNotification,
|
|
26
28
|
postChallengesEnroll,
|
|
29
|
+
postChallengesEnrollmentNotification,
|
|
27
30
|
postChallengesLeave,
|
|
28
31
|
postChallengesSetStartDate,
|
|
29
32
|
postChallengesUnlock
|
|
@@ -89,6 +92,7 @@ export {
|
|
|
89
92
|
fetchByRailContentIds,
|
|
90
93
|
fetchByReference,
|
|
91
94
|
fetchCatalogMetadata,
|
|
95
|
+
fetchChallengeLessonData,
|
|
92
96
|
fetchChallengeMetadata,
|
|
93
97
|
fetchChallengeOverview,
|
|
94
98
|
fetchChildren,
|
|
@@ -137,7 +141,9 @@ export {
|
|
|
137
141
|
initializeService,
|
|
138
142
|
isContentLiked,
|
|
139
143
|
likeContent,
|
|
144
|
+
postChallengesCommunityNotification,
|
|
140
145
|
postChallengesEnroll,
|
|
146
|
+
postChallengesEnrollmentNotification,
|
|
141
147
|
postChallengesLeave,
|
|
142
148
|
postChallengesSetStartDate,
|
|
143
149
|
postChallengesUnlock,
|
package/src/services/config.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -278,6 +278,11 @@ export async function fetchChallengeMetadata(contentId) {
|
|
|
278
278
|
return await fetchHandler(url, 'get');
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
+
export async function fetchChallengeLessonData(contentId) {
|
|
282
|
+
let url = `/challenges/lessons/${contentId}`;
|
|
283
|
+
return await fetchHandler(url, 'get');
|
|
284
|
+
}
|
|
285
|
+
|
|
281
286
|
export async function fetchUserChallengeProgress(contentId) {
|
|
282
287
|
let url = `/challenges/user_data/${contentId}`;
|
|
283
288
|
return await fetchHandler(url, 'get');
|
|
@@ -308,6 +313,18 @@ export async function postChallengesLeave(contentId) {
|
|
|
308
313
|
return await fetchHandler(url, 'post');
|
|
309
314
|
}
|
|
310
315
|
|
|
316
|
+
export async function postChallengesEnrollmentNotification(contentId) {
|
|
317
|
+
let url = `/challenges/notifications/enrollment_open/${contentId}`;
|
|
318
|
+
return await fetchHandler(url, 'post');
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export async function postChallengesCommunityNotification(contentId) {
|
|
322
|
+
let url = `/challenges/notifications/community_reminders/${contentId}`;
|
|
323
|
+
return await fetchHandler(url, 'post');
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
311
328
|
function fetchAbsolute(url, params) {
|
|
312
329
|
if (globalConfig.railcontentConfig.baseUrl) {
|
|
313
330
|
if (url.startsWith('/')) {
|