musora-content-services 1.0.142 → 1.0.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.github/workflows/node.js.yml +0 -0
  2. package/CHANGELOG.md +4 -0
  3. package/README.md +0 -0
  4. package/babel.config.js +0 -0
  5. package/docs/config.js.html +8 -4
  6. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  7. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  8. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  9. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  10. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  11. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  12. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  14. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  15. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
  16. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  17. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  18. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  19. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  24. package/docs/index.html +2 -2
  25. package/docs/module-Config.html +30 -5
  26. package/docs/module-Railcontent-Services.html +2 -2
  27. package/docs/module-Sanity-Services.html +285 -46
  28. package/docs/railcontent.js.html +19 -2
  29. package/docs/sanity.js.html +79 -73
  30. package/docs/scripts/collapse.js +0 -0
  31. package/docs/scripts/commonNav.js +0 -0
  32. package/docs/scripts/linenumber.js +0 -0
  33. package/docs/scripts/nav.js +0 -0
  34. package/docs/scripts/polyfill.js +0 -0
  35. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
  36. package/docs/scripts/prettify/lang-css.js +0 -0
  37. package/docs/scripts/prettify/prettify.js +0 -0
  38. package/docs/scripts/search.js +0 -0
  39. package/docs/styles/jsdoc.css +0 -0
  40. package/docs/styles/prettify.css +0 -0
  41. package/jest.config.js +0 -0
  42. package/jsdoc.json +0 -0
  43. package/link_mcs.sh +0 -0
  44. package/package.json +1 -1
  45. package/src/contentMetaData.js +0 -0
  46. package/src/contentTypeConfig.js +1 -0
  47. package/src/filterBuilder.js +0 -0
  48. package/src/index.d.ts +6 -0
  49. package/src/index.js +6 -0
  50. package/src/services/config.js +0 -0
  51. package/src/services/contentLikes.js +0 -0
  52. package/src/services/dataContext.js +0 -0
  53. package/src/services/railcontent.js +17 -0
  54. package/src/services/sanity.js +55 -71
  55. package/test/contentLikes.test.js +0 -0
  56. package/test/localStorageMock.js +0 -0
  57. package/test/log.js +0 -0
  58. package/test/sanityQueryService.test.js +0 -0
  59. package/tools/generate-index.js +0 -0
  60. package/test/playlists.test.js +0 -86
@@ -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 Wed Oct 16 2024 19:36:10 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
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>
@@ -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 various criteria such as brand, filters, style, artist, content type, and search term.
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 - The brand for which to fetch the filter options.
643
- * @param {string[]} filters - Additional filters to apply to the query in the format of a key,value array. eg. ['difficulty,Intermediate', 'genre,rock']
644
- * @param {string} [style] - Optional style or genre to filter the results. If provided, the query will check if the style exists in the genre array.
645
- * @param {string} [artist] - Optional artist name to filter the results. If provided, the query will check if the artist's name matches.
646
- * @param {string} contentType - The content type to fetch (e.g., 'song', 'lesson').
647
- * @param {string} [term] - Optional search term to match against various fields such as title, album, artist name, and genre.
648
- * @param {Array&lt;string>} [progressIds=undefined] - An array of railcontent IDs to filter the results by. Used for filtering by progress.
649
- * @param {string} [coachId=undefined] - Optional coach ID to filter the results by a specific coach. If provided, contentType must be 'coach-lessons'.
650
- * @returns {Promise&lt;Object|null>} - A promise that resolves to an object containing the total results and filter options, or null if the query fails.
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&lt;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&lt;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
- * // Example usage:
656
- * fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
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
- * // Example usage with coachId:
662
- * fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'coach-lessons', 'Love', undefined, '123')
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
- brand,
668
- filters = [],
669
- style,
670
- artist,
671
- contentType,
672
- term,
673
- progressIds = undefined,
674
- coachId = undefined, // New parameter for coach ID
667
+ brand,
668
+ filters = [],
669
+ style,
670
+ artist,
671
+ contentType,
672
+ term,
673
+ progressIds,
674
+ coachId,
675
+ includeTabs = false,
675
676
  ) {
676
- console.log('brand', brand)
677
- if (coachId &amp;&amp; contentType !== 'coach-lessons') {
678
- throw new Error(`Invalid contentType: '${contentType}' for coachId. It must be 'coach-lessons'.`);
679
- }
680
-
681
- filters = Array.isArray(filters) ? filters : [];
682
- const includedFieldsFilter = filters?.length > 0 ? filtersToGroq(filters) : undefined;
683
-
684
- const progressFilter = progressIds !== undefined ?
685
- `&amp;&amp; railcontent_id in [${progressIds.join(',')}]` : "";
677
+ if (coachId &amp;&amp; contentType !== 'coach-lessons') {
678
+ throw new Error(`Invalid contentType: '${contentType}' for coachId. It must be 'coach-lessons'.`);
679
+ }
686
680
 
687
- // General common filter logic
688
- let commonFilter;
681
+ const includedFieldsFilter = filters?.length ? filtersToGroq(filters) : undefined;
682
+ const progressFilter = progressIds ? `&amp;&amp; railcontent_id in [${progressIds.join(',')}]` : "";
689
683
 
690
- if (coachId) {
691
- // Coach-specific filtering
692
- commonFilter = `brand == '${brand}' &amp;&amp; references(*[_type=='instructor' &amp;&amp; railcontent_id == ${coachId}]._id) ${includedFieldsFilter ? includedFieldsFilter : ''}`;
693
- } else {
694
- // Regular content filtering
695
- commonFilter = `_type == '${contentType}' &amp;&amp; brand == "${brand}"${style ? ` &amp;&amp; '${style}' in genre[]->name` : ''}${artist ? ` &amp;&amp; artist->name == '${artist}'` : ''} ${progressFilter} ${includedFieldsFilter ? includedFieldsFilter : ''}`;
696
- }
684
+ const constructCommonFilter = (excludeFilter) => {
685
+ const filterWithoutOption = excludeFilter ? filtersToGroq(filters, excludeFilter) : includedFieldsFilter;
686
+ return coachId
687
+ ? `brand == '${brand}' &amp;&amp; references(*[_type=='instructor' &amp;&amp; railcontent_id == ${coachId}]._id) ${filterWithoutOption || ''}`
688
+ : `_type == '${contentType}' &amp;&amp; brand == "${brand}"${style &amp;&amp; excludeFilter !== "style" ? ` &amp;&amp; '${style}' in genre[]->name` : ''}${artist &amp;&amp; excludeFilter !== "artist" ? ` &amp;&amp; artist->name == '${artist}'` : ''} ${progressFilter} ${filterWithoutOption || ''}`;
689
+ };
697
690
 
698
- // Determine metadata and allowable filters (handle coach lessons if coachId exists)
699
- const metaData = processMetadata(brand, contentType, true);
700
- const allowableFilters = metaData?.allowableFilters || [];
691
+ const metaData = processMetadata(brand, contentType, true);
692
+ const allowableFilters = metaData?.allowableFilters || [];
693
+ const tabs = metaData?.tabs || [];
701
694
 
702
- // Dynamic filter options construction
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
- if (coachId) {
708
- commonFilterWithoutSelectedOption = `brand == '${brand}' &amp;&amp; references(*[_type=='instructor' &amp;&amp; railcontent_id == ${coachId}]._id) ${includedFieldsFilterWithoutSelectedOption ? includedFieldsFilterWithoutSelectedOption : ''}`;
709
- } else {
710
- // Regular content filter without the selected option
711
- commonFilterWithoutSelectedOption = `_type == '${contentType}' &amp;&amp; brand == "${brand}"${(style &amp;&amp; filter !== "style") ? ` &amp;&amp; '${style}' in genre[]->name` : ''}${(artist &amp;&amp; filter !== "artist") ? ` &amp;&amp; artist->name == '${artist}'` : ''} ${includedFieldsFilterWithoutSelectedOption ? includedFieldsFilterWithoutSelectedOption : ''}`;
712
- }
697
+ const query = `
698
+ {
699
+ "meta": {
700
+ "totalResults": count(*[${constructCommonFilter()}
701
+ ${term ? ` &amp;&amp; (title match "${term}" || album match "${term}" || artist->name match "${term}" || genre[]->name match "${term}")` : ''}]),
702
+ "filterOptions": {
703
+ ${dynamicFilterOptions}
704
+ }
705
+ }
706
+ }`;
713
707
 
714
- // Call getFilterOptions with the modified common filter
715
- return getFilterOptions(filter, commonFilterWithoutSelectedOption, contentType, brand);
716
- }).join(' ');
708
+ const results = await fetchSanity(query, true, { processNeedAccess: false });
717
709
 
718
- const query = `
719
- {
720
- "meta": {
721
- "totalResults": count(*[${commonFilter}
722
- ${term ? ` &amp;&amp; (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&lt;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 Wed Oct 16 2024 19:36:10 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
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>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/jest.config.js CHANGED
File without changes
package/jsdoc.json CHANGED
File without changes
package/link_mcs.sh CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.0.142",
3
+ "version": "1.0.144",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
File without changes
@@ -143,6 +143,7 @@ let contentTypeConfig = {
143
143
  'resource',
144
144
  'xp',
145
145
  'total_xp',
146
+ '"thumbnail_url":thumbnail.asset->url',
146
147
  `"lessons": child[]->{
147
148
  "id": railcontent_id,
148
149
  title,
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,
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('/')) {