musora-content-services 1.0.19 → 1.0.21

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 (71) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/docs/config.js.html +124 -0
  3. package/docs/index.html +2 -2
  4. package/docs/module-Config.html +669 -0
  5. package/docs/module-Railcontent-Services.html +751 -0
  6. package/docs/{global.html → module-Sanity-Services.html} +52 -501
  7. package/docs/railcontent.js.html +178 -0
  8. package/docs/sanity.js.html +994 -0
  9. package/jsdoc.json +1 -1
  10. package/package.json +1 -1
  11. package/src/contentTypeConfig.js +30 -0
  12. package/src/index.d.ts +2 -2
  13. package/src/index.js +32 -1029
  14. package/src/services/config.js +52 -0
  15. package/src/services/railcontent.js +106 -0
  16. package/src/services/sanity.js +922 -0
  17. package/test/sanityQueryService.test.js +37 -2
  18. package/docs/data/search.json +0 -1
  19. package/docs/fonts/Inconsolata-Regular.ttf +0 -0
  20. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  21. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
  22. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  23. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  24. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  25. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  26. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  27. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
  28. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  29. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  30. package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
  31. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  32. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  33. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  34. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  35. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  36. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
  37. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  38. package/docs/fonts/OpenSans-Regular.ttf +0 -0
  39. package/docs/fonts/OpenSans-Semibold-webfont.eot +0 -0
  40. package/docs/fonts/OpenSans-Semibold-webfont.svg +0 -1830
  41. package/docs/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  42. package/docs/fonts/OpenSans-Semibold-webfont.woff +0 -0
  43. package/docs/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  44. package/docs/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
  45. package/docs/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  46. package/docs/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  47. package/docs/fonts/WorkSans-Bold.ttf +0 -0
  48. package/docs/index.js.html +0 -1122
  49. package/docs/scripts/core.js +0 -726
  50. package/docs/scripts/core.min.js +0 -23
  51. package/docs/scripts/resize.js +0 -90
  52. package/docs/scripts/search.min.js +0 -6
  53. package/docs/scripts/third-party/Apache-License-2.0.txt +0 -202
  54. package/docs/scripts/third-party/fuse.js +0 -9
  55. package/docs/scripts/third-party/hljs-line-num-original.js +0 -369
  56. package/docs/scripts/third-party/hljs-line-num.js +0 -1
  57. package/docs/scripts/third-party/hljs-original.js +0 -5171
  58. package/docs/scripts/third-party/hljs.js +0 -1
  59. package/docs/scripts/third-party/popper.js +0 -5
  60. package/docs/scripts/third-party/tippy.js +0 -1
  61. package/docs/scripts/third-party/tocbot.js +0 -672
  62. package/docs/scripts/third-party/tocbot.min.js +0 -1
  63. package/docs/styles/clean-jsdoc-theme-base.css +0 -1159
  64. package/docs/styles/clean-jsdoc-theme-dark.css +0 -412
  65. package/docs/styles/clean-jsdoc-theme-light.css +0 -482
  66. package/docs/styles/clean-jsdoc-theme-scrollbar.css +0 -30
  67. package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -1
  68. package/docs/styles/clean-jsdoc-theme.min.css +0 -1
  69. package/docs/styles/jsdoc-default.css +0 -692
  70. package/docs/styles/prettify-jsdoc.css +0 -111
  71. package/docs/styles/prettify-tomorrow.css +0 -132
@@ -1,5 +1,5 @@
1
1
  const {
2
- initializeSanityService,
2
+ initializeService,
3
3
  fetchSongById,
4
4
  fetchArtists,
5
5
  fetchSongArtistCount,
@@ -33,7 +33,7 @@ describe('Sanity Queries', function () {
33
33
  version: '2021-06-07',
34
34
  debug: process.env.DEBUG || false
35
35
  };
36
- initializeSanityService(config);
36
+ initializeService(config);
37
37
  });
38
38
 
39
39
  test('fetchSongById', async () => {
@@ -79,6 +79,41 @@ describe('Sanity Queries', function () {
79
79
  expect(response.railcontent_id).toBe(id);
80
80
  });
81
81
 
82
+ test('fetchAllSongs', async () => {
83
+ const response = await fetchAllSongs('drumeo', {});
84
+ console.log(response);
85
+ expect(response.entity[0].soundslice).toBeDefined();
86
+ expect(response.entity[0].artist_name).toBeDefined();
87
+ expect(response.entity[0].instrumentless).toBeDefined();
88
+ });
89
+
90
+ test('fetchAllSongsGroupByArtist', async () => {
91
+ const response = await fetchAllSongs('drumeo', {groupBy:"artist"});
92
+ expect(response.entity[0].lessons[0].soundslice).toBeDefined();
93
+ expect(response.entity[0].lessons[0].artist_name).toBeDefined();
94
+ expect(response.entity[0].lessons[0].instrumentless).toBeDefined();
95
+ }, 100000);
96
+
97
+
98
+ test('fetchAllWorkouts', async () => {
99
+ const response = await fetchAll('drumeo', 'workout',{});
100
+ console.log(response);
101
+ expect(response.entity[0].railcontent_id).toBeDefined();
102
+ });
103
+
104
+ test('fetchAllChallenges', async () => {
105
+ const response = await fetchAll('drumeo', 'challenge',{});
106
+ console.log(response);
107
+ expect(response.entity[0].registration_url).toBeDefined();
108
+ expect(response.entity[0].enrollment_start_time).toBeDefined();
109
+ expect(response.entity[0].enrollment_end_time).toBeDefined();
110
+
111
+ expect(response.entity[0].lesson_count).toBeDefined();
112
+ expect(response.entity[0].primary_cta_text).toBeDefined();
113
+ expect(response.entity[0].challenge_state).toBeDefined();
114
+ expect(response.entity[0].challenge_state_text).toBeDefined();
115
+
116
+ });
82
117
  // test('fetchRelatedLessons', async () => {
83
118
  // const id = 380094;
84
119
  // const response = await fetchRelatedLessons(id, 'singeo', 'song');
@@ -1 +0,0 @@
1
- {"list":[{"title":"fetchAll","link":"<a href=\"global.html#fetchAll\">fetchAll</a>","description":"Fetch all content for a specific brand and type with pagination, search, and grouping options."},{"title":"fetchAllSongs","link":"<a href=\"global.html#fetchAllSongs\">fetchAllSongs</a>","description":"Fetch all songs for a specific brand with pagination and search options."},{"title":"fetchArtists","link":"<a href=\"global.html#fetchArtists\">fetchArtists</a>","description":"Fetch all artists with lessons available for a specific brand."},{"title":"fetchByRailContentId","link":"<a href=\"global.html#fetchByRailContentId\">fetchByRailContentId</a>","description":"Fetch content by a specific Railcontent ID."},{"title":"fetchByRailContentIds","link":"<a href=\"global.html#fetchByRailContentIds\">fetchByRailContentIds</a>","description":"Fetch content by an array of Railcontent IDs."},{"title":"fetchChildren","link":"<a href=\"global.html#fetchChildren\">fetchChildren</a>","description":"Fetch children content by Railcontent ID."},{"title":"fetchFilterOptions","link":"<a href=\"global.html#fetchFilterOptions\">fetchFilterOptions</a>","description":"Fetch filter options for a specific brand."},{"title":"fetchMethodChildren","link":"<a href=\"global.html#fetchMethodChildren\">fetchMethodChildren</a>","description":"Fetch all children of a specific method by Railcontent ID."},{"title":"fetchMethodNextLesson","link":"<a href=\"global.html#fetchMethodNextLesson\">fetchMethodNextLesson</a>","description":"Fetch the next lesson for a specific method by Railcontent ID."},{"title":"fetchNewReleases","link":"<a href=\"global.html#fetchNewReleases\">fetchNewReleases</a>","description":"Fetch the latest new releases for a specific brand."},{"title":"fetchNextPreviousLesson","link":"<a href=\"global.html#fetchNextPreviousLesson\">fetchNextPreviousLesson</a>","description":"Fetch the next and previous lessons for a specific lesson by Railcontent ID."},{"title":"fetchPackAll","link":"<a href=\"global.html#fetchPackAll\">fetchPackAll</a>","description":"Fetch all content for a specific pack by Railcontent ID."},{"title":"fetchPackChildren","link":"<a href=\"global.html#fetchPackChildren\">fetchPackChildren</a>","description":"Fetch all children of a specific pack by Railcontent ID."},{"title":"fetchRelatedLessons","link":"<a href=\"global.html#fetchRelatedLessons\">fetchRelatedLessons</a>","description":"Fetch related lessons for a specific lesson by Railcontent ID and type."},{"title":"fetchRelatedSongs","link":"<a href=\"global.html#fetchRelatedSongs\">fetchRelatedSongs</a>","description":"Fetch related songs for a specific brand and song ID."},{"title":"fetchSanity","link":"<a href=\"global.html#fetchSanity\">fetchSanity</a>","description":"Fetch data from the Sanity API based on a provided query."},{"title":"fetchSongById","link":"<a href=\"global.html#fetchSongById\">fetchSongById</a>","description":"Fetch a song by its document ID from Sanity."},{"title":"fetchSongCount","link":"<a href=\"global.html#fetchSongCount\">fetchSongCount</a>","description":"Fetch the total count of songs for a specific brand."},{"title":"fetchUpcomingEvents","link":"<a href=\"global.html#fetchUpcomingEvents\">fetchUpcomingEvents</a>","description":"Fetch upcoming events for a specific brand."},{"title":"fetchWorkouts","link":"<a href=\"global.html#fetchWorkouts\">fetchWorkouts</a>","description":"Fetch the latest workouts for the home page of a specific brand."}]}
Binary file