musora-content-services 1.0.160 → 1.0.162
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/CHANGELOG.md +4 -0
- package/docs/config.js.html +2 -2
- package/docs/index.html +2 -2
- package/docs/module-Config.html +2 -2
- package/docs/module-Railcontent-Services.html +3557 -978
- package/docs/module-Sanity-Services.html +6 -6
- package/docs/railcontent.js.html +239 -17
- package/docs/sanity.js.html +73 -2
- package/package.json +1 -1
- package/src/index.d.ts +4 -0
- package/src/index.js +4 -0
- package/src/services/contentProgress.js +4 -3
- package/src/services/railcontent.js +75 -0
|
@@ -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#.createPlaylist">createPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylist">deletePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylistItem">deletePlaylistItem</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylistLike">deletePlaylistLike</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.duplicatePlaylist">duplicatePlaylist</a></li><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#.fetchPlaylist">fetchPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPlaylistItem">fetchPlaylistItem</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPlaylistItems">fetchPlaylistItems</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserPlaylists">fetchUserPlaylists</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.likePlaylist">likePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.updatePlaylist">updatePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.updatePlaylistItem">updatePlaylistItem</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>
|
|
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#.addItemToPlaylist">addItemToPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.countAssignmentsAndLessons">countAssignmentsAndLessons</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.createPlaylist">createPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylist">deletePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylistItem">deletePlaylistItem</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylistLike">deletePlaylistLike</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.duplicatePlaylist">duplicatePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeIndexMetadata">fetchChallengeIndexMetadata</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeLessonData">fetchChallengeLessonData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeMetadata">fetchChallengeMetadata</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#.fetchPlaylist">fetchPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPlaylistItem">fetchPlaylistItem</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPlaylistItems">fetchPlaylistItems</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserAward">fetchUserAward</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserChallengeProgress">fetchUserChallengeProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserPlaylists">fetchUserPlaylists</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.likePlaylist">likePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesCommunityNotification">postChallengesCommunityNotification</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesEnroll">postChallengesEnroll</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesEnrollmentNotification">postChallengesEnrollmentNotification</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesLeave">postChallengesLeave</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesSetStartDate">postChallengesSetStartDate</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesUnlock">postChallengesUnlock</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postCompleteLesson">postCompleteLesson</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.updatePlaylist">updatePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.updatePlaylistItem">updatePlaylistItem</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
|
|
|
@@ -3350,7 +3350,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
3350
3350
|
|
|
3351
3351
|
<dt class="tag-source">Source:</dt>
|
|
3352
3352
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
3353
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
3353
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line1561">line 1561</a>
|
|
3354
3354
|
</li></ul></dd>
|
|
3355
3355
|
|
|
3356
3356
|
|
|
@@ -5294,7 +5294,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
5294
5294
|
|
|
5295
5295
|
<dt class="tag-source">Source:</dt>
|
|
5296
5296
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
5297
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
5297
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line1611">line 1611</a>
|
|
5298
5298
|
</li></ul></dd>
|
|
5299
5299
|
|
|
5300
5300
|
|
|
@@ -8174,7 +8174,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
8174
8174
|
|
|
8175
8175
|
<dt class="tag-source">Source:</dt>
|
|
8176
8176
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
8177
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
8177
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line1452">line 1452</a>
|
|
8178
8178
|
</li></ul></dd>
|
|
8179
8179
|
|
|
8180
8180
|
|
|
@@ -8640,7 +8640,7 @@ fetchSanity(query, true)
|
|
|
8640
8640
|
|
|
8641
8641
|
<dt class="tag-source">Source:</dt>
|
|
8642
8642
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
8643
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
8643
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line1586">line 1586</a>
|
|
8644
8644
|
</li></ul></dd>
|
|
8645
8645
|
|
|
8646
8646
|
|
|
@@ -9776,7 +9776,7 @@ It also includes completion status and progress percentage for each workout by f
|
|
|
9776
9776
|
<br class="clear">
|
|
9777
9777
|
|
|
9778
9778
|
<footer>
|
|
9779
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri Nov
|
|
9779
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri Nov 08 2024 14:13:46 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
9780
9780
|
</footer>
|
|
9781
9781
|
|
|
9782
9782
|
<script>prettyPrint();</script>
|
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#.createPlaylist">createPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylist">deletePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylistItem">deletePlaylistItem</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylistLike">deletePlaylistLike</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.duplicatePlaylist">duplicatePlaylist</a></li><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#.fetchPlaylist">fetchPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPlaylistItem">fetchPlaylistItem</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPlaylistItems">fetchPlaylistItems</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserPlaylists">fetchUserPlaylists</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.likePlaylist">likePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.updatePlaylist">updatePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.updatePlaylistItem">updatePlaylistItem</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>
|
|
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#.addItemToPlaylist">addItemToPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.countAssignmentsAndLessons">countAssignmentsAndLessons</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.createPlaylist">createPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylist">deletePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylistItem">deletePlaylistItem</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylistLike">deletePlaylistLike</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.duplicatePlaylist">duplicatePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeIndexMetadata">fetchChallengeIndexMetadata</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeLessonData">fetchChallengeLessonData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeMetadata">fetchChallengeMetadata</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#.fetchPlaylist">fetchPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPlaylistItem">fetchPlaylistItem</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPlaylistItems">fetchPlaylistItems</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserAward">fetchUserAward</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserChallengeProgress">fetchUserChallengeProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserPlaylists">fetchUserPlaylists</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.likePlaylist">likePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesCommunityNotification">postChallengesCommunityNotification</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesEnroll">postChallengesEnroll</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesEnrollmentNotification">postChallengesEnrollmentNotification</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesLeave">postChallengesLeave</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesSetStartDate">postChallengesSetStartDate</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesUnlock">postChallengesUnlock</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postCompleteLesson">postCompleteLesson</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.updatePlaylist">updatePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.updatePlaylistItem">updatePlaylistItem</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
|
|
|
@@ -56,7 +56,15 @@ const {globalConfig} = require('./config');
|
|
|
56
56
|
*
|
|
57
57
|
* @type {string[]}
|
|
58
58
|
*/
|
|
59
|
-
const excludeFromGeneratedIndex = [
|
|
59
|
+
const excludeFromGeneratedIndex = [
|
|
60
|
+
'fetchUserLikes',
|
|
61
|
+
'postContentLiked',
|
|
62
|
+
'postContentUnliked',
|
|
63
|
+
'postRecordWatchSession',
|
|
64
|
+
'postContentStarted',
|
|
65
|
+
'postContentCompleted',
|
|
66
|
+
'postContentReset'
|
|
67
|
+
];
|
|
60
68
|
|
|
61
69
|
|
|
62
70
|
/**
|
|
@@ -285,6 +293,10 @@ async function fetchDataHandler(url, dataVersion, method = "get") {
|
|
|
285
293
|
return fetchHandler(url, method, dataVersion);
|
|
286
294
|
}
|
|
287
295
|
|
|
296
|
+
async function postDataHandler(url, data) {
|
|
297
|
+
return fetchHandler(url, 'post', data);
|
|
298
|
+
}
|
|
299
|
+
|
|
288
300
|
export async function fetchHandler(url, method = "get", dataVersion = null, body = null) {
|
|
289
301
|
let headers = {
|
|
290
302
|
'Content-Type': 'application/json',
|
|
@@ -319,64 +331,181 @@ export async function fetchUserLikes(currentVersion) {
|
|
|
319
331
|
|
|
320
332
|
export async function postContentLiked(contentId) {
|
|
321
333
|
let url = `/content/user/likes/like/${contentId}`;
|
|
322
|
-
return await
|
|
334
|
+
return await postDataHandler(url);
|
|
323
335
|
}
|
|
324
336
|
|
|
325
337
|
export async function postContentUnliked(contentId) {
|
|
326
338
|
let url = `/content/user/likes/unlike/${contentId}`;
|
|
327
|
-
return await
|
|
339
|
+
return await postDataHandler(url);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export async function fetchContentProgress(currentVersion) {
|
|
343
|
+
let url = `/content/user/progress/all`;
|
|
344
|
+
return fetchDataHandler(url, currentVersion);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export async function postRecordWatchSession({
|
|
348
|
+
mediaId,
|
|
349
|
+
mediaType,
|
|
350
|
+
mediaCategory,
|
|
351
|
+
watchPosition,
|
|
352
|
+
totalDuration,
|
|
353
|
+
sessionToken,
|
|
354
|
+
brand,
|
|
355
|
+
contentId = null
|
|
356
|
+
}) {
|
|
357
|
+
let url = `/railtracker/media-playback-session`;
|
|
358
|
+
return postDataHandler(url, {
|
|
359
|
+
mediaId,
|
|
360
|
+
mediaType,
|
|
361
|
+
mediaCategory,
|
|
362
|
+
watchPosition,
|
|
363
|
+
totalDuration,
|
|
364
|
+
sessionToken,
|
|
365
|
+
brand,
|
|
366
|
+
contentId
|
|
367
|
+
});
|
|
328
368
|
}
|
|
329
369
|
|
|
370
|
+
/**
|
|
371
|
+
* Fetch enrolled user data for a given challenge. Intended to be used in the enrolled modal
|
|
372
|
+
*
|
|
373
|
+
* @param contentId - railcontent id of the challenge
|
|
374
|
+
* @returns {Promise<any|null>}
|
|
375
|
+
*/
|
|
330
376
|
export async function fetchChallengeMetadata(contentId) {
|
|
331
377
|
let url = `/challenges/${contentId}`;
|
|
332
378
|
return await fetchHandler(url, 'get');
|
|
333
379
|
}
|
|
334
380
|
|
|
381
|
+
/**
|
|
382
|
+
* Fetch lesson, user, and challenge data for a given lesson
|
|
383
|
+
*
|
|
384
|
+
* @param contentId - railcontent id of the lesson
|
|
385
|
+
* @returns {Promise<any|null>}
|
|
386
|
+
*/
|
|
335
387
|
export async function fetchChallengeLessonData(contentId) {
|
|
336
388
|
let url = `/challenges/lessons/${contentId}`;
|
|
337
389
|
return await fetchHandler(url, 'get');
|
|
338
390
|
}
|
|
339
391
|
|
|
392
|
+
/**
|
|
393
|
+
* Fetch challenge, lesson, and user metadata for a given challenge
|
|
394
|
+
*
|
|
395
|
+
* @param contentId - railcontent id of the challenge
|
|
396
|
+
* @returns {Promise<any|null>}
|
|
397
|
+
*/
|
|
340
398
|
export async function fetchUserChallengeProgress(contentId) {
|
|
341
399
|
let url = `/challenges/user_data/${contentId}`;
|
|
342
400
|
return await fetchHandler(url, 'get');
|
|
343
401
|
}
|
|
344
402
|
|
|
403
|
+
/**
|
|
404
|
+
* Fetch the user's best award for this challenge
|
|
405
|
+
*
|
|
406
|
+
* @param contentId - railcontent id of the challenge
|
|
407
|
+
* @returns {Promise<any|null>} - streamed PDF
|
|
408
|
+
*/
|
|
345
409
|
export async function fetchUserAward(contentId) {
|
|
346
410
|
let url = `/challenges/download_award/${contentId}`;
|
|
347
411
|
return await fetchHandler(url, 'get');
|
|
348
412
|
}
|
|
349
413
|
|
|
414
|
+
/**
|
|
415
|
+
* Get challange duration, user progress, and status for the list of challenges
|
|
416
|
+
* Intended to be used on the index page for challenges
|
|
417
|
+
*
|
|
418
|
+
* @param {array} contentIds - arary of railcontent ids of the challenges
|
|
419
|
+
* @returns {Promise<any|null>}
|
|
420
|
+
*/
|
|
421
|
+
export async function fetchChallengeIndexMetadata(contentIds) {
|
|
422
|
+
let idsString = contentIds.toString();
|
|
423
|
+
let url = `/challenges/user_progress_for_index_page/get?content_ids=${idsString}`;
|
|
424
|
+
return await fetchHandler(url, 'get');
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Enroll a user in a challenge and set the start date of the challenge to the provided day.
|
|
429
|
+
* Clears any existing progress data for this challenge
|
|
430
|
+
*
|
|
431
|
+
* @param {int|string} contentId - railcontent id of the challenge
|
|
432
|
+
* @param {string} startDate - prefered format YYYYMMDD, but any Carbon parsable string will do.
|
|
433
|
+
* @returns {Promise<any|null>}
|
|
434
|
+
*/
|
|
350
435
|
export async function postChallengesSetStartDate(contentId, startDate) {
|
|
351
436
|
let url = `/challenges/set_start_date/${contentId}?start_date=${startDate}`;
|
|
352
437
|
return await fetchHandler(url, 'post');
|
|
353
438
|
}
|
|
354
439
|
|
|
440
|
+
/**
|
|
441
|
+
* Enroll the user in the provided challenge and set to unlocked
|
|
442
|
+
* Clears any current progress data for this challenge
|
|
443
|
+
*
|
|
444
|
+
* @param {int|string} contentId - railcontent id of the challenge
|
|
445
|
+
* @returns {Promise<any|null>}
|
|
446
|
+
*/
|
|
355
447
|
export async function postChallengesUnlock(contentId) {
|
|
356
448
|
let url = `/challenges/unlock/${contentId}`;
|
|
357
449
|
return await fetchHandler(url, 'post');
|
|
358
450
|
}
|
|
359
451
|
|
|
452
|
+
/**
|
|
453
|
+
* Enroll the user in the given challenge on the challenge published_on date
|
|
454
|
+
* Clears any current progress data for this challenge
|
|
455
|
+
*
|
|
456
|
+
* @param {int|string} contentId - railcontent id of the challenge
|
|
457
|
+
* @returns {Promise<any|null>}
|
|
458
|
+
*/
|
|
360
459
|
export async function postChallengesEnroll(contentId) {
|
|
361
460
|
let url = `/challenges/enroll/${contentId}`;
|
|
362
461
|
return await fetchHandler(url, 'post');
|
|
363
462
|
}
|
|
364
463
|
|
|
464
|
+
/**
|
|
465
|
+
* Remove the user from the provided challenge
|
|
466
|
+
* Clears any current progress data for this challenge
|
|
467
|
+
*
|
|
468
|
+
* @param {int|string} contentId - railcontent id of the challenge
|
|
469
|
+
* @returns {Promise<any|null>}
|
|
470
|
+
*/
|
|
365
471
|
export async function postChallengesLeave(contentId) {
|
|
366
472
|
let url = `/challenges/leave/${contentId}`;
|
|
367
473
|
return await fetchHandler(url, 'post');
|
|
368
474
|
}
|
|
369
475
|
|
|
476
|
+
/**
|
|
477
|
+
* Enable enrollment notifications for the provided challenge
|
|
478
|
+
*
|
|
479
|
+
* @param {int|string} contentId - railcontent id of the challenge
|
|
480
|
+
* @returns {Promise<any|null>}
|
|
481
|
+
*/
|
|
370
482
|
export async function postChallengesEnrollmentNotification(contentId) {
|
|
371
483
|
let url = `/challenges/notifications/enrollment_open/${contentId}`;
|
|
372
484
|
return await fetchHandler(url, 'post');
|
|
373
485
|
}
|
|
374
486
|
|
|
487
|
+
/**
|
|
488
|
+
* Enable community notifications for the provided challenge
|
|
489
|
+
*
|
|
490
|
+
* @param {int|string} contentId - railcontent id of the challenge
|
|
491
|
+
* @returns {Promise<any|null>}
|
|
492
|
+
*/
|
|
375
493
|
export async function postChallengesCommunityNotification(contentId) {
|
|
376
494
|
let url = `/challenges/notifications/community_reminders/${contentId}`;
|
|
377
495
|
return await fetchHandler(url, 'post');
|
|
378
496
|
}
|
|
379
497
|
|
|
498
|
+
/**
|
|
499
|
+
* Complete the challenge lesson and update challenge progress
|
|
500
|
+
*
|
|
501
|
+
* @param {int|string} contentId - railcontent id of the challenge
|
|
502
|
+
* @returns {Promise<any|null>} - Modal data to display
|
|
503
|
+
*/
|
|
504
|
+
export async function postCompleteLesson(contentId) {
|
|
505
|
+
let url = `/challenges/complete_lesson/${contentId}`;
|
|
506
|
+
return await fetchHandler(url, 'post');
|
|
507
|
+
}
|
|
508
|
+
|
|
380
509
|
/**
|
|
381
510
|
* Fetches user playlists for a specific brand.
|
|
382
511
|
*
|
|
@@ -462,9 +591,8 @@ export async function duplicatePlaylist(playlistId, playlistData) {
|
|
|
462
591
|
* .catch(error => console.error('Error deleting playlist:', error));
|
|
463
592
|
*/
|
|
464
593
|
export async function deletePlaylist(playlistId) {
|
|
465
|
-
let url = `/playlists/playlist`;
|
|
466
|
-
|
|
467
|
-
return await fetchHandler(url, "delete", null, payload);
|
|
594
|
+
let url = `/playlists/playlist/${playlistId}`;
|
|
595
|
+
return await fetchHandler(url, "delete");
|
|
468
596
|
}
|
|
469
597
|
|
|
470
598
|
/**
|
|
@@ -610,7 +738,7 @@ export async function deletePlaylistLike(playlistId) {
|
|
|
610
738
|
* .catch(error => console.error('Error fetching playlist:', error));
|
|
611
739
|
*/
|
|
612
740
|
export async function fetchPlaylist(playlistId) {
|
|
613
|
-
const url = `/playlists/playlist
|
|
741
|
+
const url = `/playlists/playlist/${playlistId}`;
|
|
614
742
|
return await fetchHandler(url, "GET");
|
|
615
743
|
}
|
|
616
744
|
|
|
@@ -713,21 +841,23 @@ export async function deletePlaylistItem(payload) {
|
|
|
713
841
|
* Fetches detailed data for a specific playlist item, including associated Sanity and Assignment information if available.
|
|
714
842
|
*
|
|
715
843
|
* @param {Object} payload - The request payload containing necessary parameters.
|
|
716
|
-
* @param {number} payload.user_playlist_item_id - The ID of the playlist item to fetch.
|
|
717
|
-
* @returns {Promise<Object|null>} - A promise that resolves to an object
|
|
718
|
-
* - `success` (boolean): Indicates if the retrieval was successful (`true`
|
|
719
|
-
* - `data` (Object):
|
|
844
|
+
* @param {number} payload.user_playlist_item_id - The unique ID of the playlist item to fetch.
|
|
845
|
+
* @returns {Promise<Object|null>} - A promise that resolves to an object with the fetched playlist item data, including:
|
|
846
|
+
* - `success` (boolean): Indicates if the data retrieval was successful (`true` on success).
|
|
847
|
+
* - `data` (Object): Contains the detailed playlist item data enriched with Sanity and Assignment details, if available.
|
|
720
848
|
*
|
|
721
849
|
* Resolves to `null` if the request fails.
|
|
722
|
-
* @throws {Error} - Throws an error if the request
|
|
850
|
+
* @throws {Error} - Throws an error if the request encounters issues during retrieval.
|
|
723
851
|
*
|
|
724
852
|
* @example
|
|
725
853
|
* const payload = { user_playlist_item_id: 123 };
|
|
726
854
|
*
|
|
727
855
|
* fetchPlaylistItem(payload)
|
|
728
856
|
* .then(response => {
|
|
729
|
-
* if (response
|
|
857
|
+
* if (response?.success) {
|
|
730
858
|
* console.log("Fetched playlist item data:", response.data);
|
|
859
|
+
* } else {
|
|
860
|
+
* console.log("Failed to fetch playlist item data.");
|
|
731
861
|
* }
|
|
732
862
|
* })
|
|
733
863
|
* .catch(error => {
|
|
@@ -735,10 +865,102 @@ export async function deletePlaylistItem(payload) {
|
|
|
735
865
|
* });
|
|
736
866
|
*/
|
|
737
867
|
export async function fetchPlaylistItem(payload) {
|
|
738
|
-
const
|
|
739
|
-
|
|
868
|
+
const playlistItemId = payload.user_playlist_item_id;
|
|
869
|
+
const url = `/playlists/item/${playlistItemId}`;
|
|
870
|
+
return await fetchHandler(url);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
export async function postContentStarted(contentId) {
|
|
874
|
+
let url = `/content/${contentId}/started`;
|
|
875
|
+
return postDataHandler(url);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
export async function postContentCompleted(contentId) {
|
|
879
|
+
let url = `/content/${contentId}/completed`;
|
|
880
|
+
return postDataHandler(url);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
export async function postContentReset(contentId) {
|
|
884
|
+
let url = `/content/${contentId}/reset`;
|
|
885
|
+
return postDataHandler(url);
|
|
740
886
|
}
|
|
741
887
|
|
|
888
|
+
/**
|
|
889
|
+
* Adds an item to one or more playlists by making a POST request to the `/playlists/add-item` endpoint.
|
|
890
|
+
*
|
|
891
|
+
* @param {Object} payload - The request payload containing necessary parameters.
|
|
892
|
+
* @param {number} payload.content_id - The ID of the content to add to the playlist(s).
|
|
893
|
+
* @param {Array<number>} payload.playlist_id - An array of playlist IDs where the content should be added.
|
|
894
|
+
* @param {boolean} [payload.import_full_soundslice_assignment=false] - Flag to include full Soundslice assignments.
|
|
895
|
+
* @param {boolean} [payload.import_instrumentless_soundslice_assignment=false] - Flag to include instrumentless Soundslice assignments.
|
|
896
|
+
* @param {boolean} [payload.import_high_routine=false] - Flag to include high routine content.
|
|
897
|
+
* @param {boolean} [payload.import_low_routine=false] - Flag to include low routine content.
|
|
898
|
+
* @param {boolean} [payload.import_all_assignments=false] - Flag to include all Soundslice assignments if true.
|
|
899
|
+
*
|
|
900
|
+
* @returns {Promise<Object|null>} - A promise that resolves to an object with the response data, including:
|
|
901
|
+
* - `success` (boolean): Indicates if the items were added successfully (`true` on success).
|
|
902
|
+
* - `limit_excedeed` (Array): A list of playlists where the item limit was exceeded, if any.
|
|
903
|
+
* - `successful` (Array): A list of successfully added items (empty if none).
|
|
904
|
+
*
|
|
905
|
+
* Resolves to `null` if the request fails.
|
|
906
|
+
* @throws {Error} - Throws an error if the request encounters issues during the operation.
|
|
907
|
+
*
|
|
908
|
+
* @example
|
|
909
|
+
* const payload = {
|
|
910
|
+
* content_id: 123,
|
|
911
|
+
* playlist_id: [1, 2, 3],
|
|
912
|
+
* import_all_assignments: true
|
|
913
|
+
* };
|
|
914
|
+
*
|
|
915
|
+
* addItemToPlaylist(payload)
|
|
916
|
+
* .then(response => {
|
|
917
|
+
* if (response?.success) {
|
|
918
|
+
* console.log("Item(s) added to playlist successfully");
|
|
919
|
+
* }
|
|
920
|
+
* if (response?.limit_excedeed) {
|
|
921
|
+
* console.warn("Some playlists exceeded the item limit:", response.limit_excedeed);
|
|
922
|
+
* }
|
|
923
|
+
* })
|
|
924
|
+
* .catch(error => {
|
|
925
|
+
* console.error("Error adding item to playlist:", error);
|
|
926
|
+
* });
|
|
927
|
+
*/
|
|
928
|
+
export async function addItemToPlaylist(payload) {
|
|
929
|
+
const url = `/playlists/add-item`;
|
|
930
|
+
return await fetchHandler(url, "POST", null, payload);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* Retrieves the count of lessons and assignments associated with a specific content ID.
|
|
935
|
+
*
|
|
936
|
+
* @param {number} contentId - The ID of the content for which to count lessons and assignments.
|
|
937
|
+
*
|
|
938
|
+
* @returns {Promise<Object|null>} - A promise that resolves to an object containing the counts:
|
|
939
|
+
* - `lessons_count` (number): The number of lessons associated with the content.
|
|
940
|
+
* - `soundslice_assignments_count` (number): The number of Soundslice assignments associated with the content.
|
|
941
|
+
*
|
|
942
|
+
* @example
|
|
943
|
+
* const contentId = 123;
|
|
944
|
+
*
|
|
945
|
+
* countAssignmentsAndLessons(contentId)
|
|
946
|
+
* .then(response => {
|
|
947
|
+
* if (response) {
|
|
948
|
+
* console.log("Lessons count:", response.lessons_count);
|
|
949
|
+
* console.log("Soundslice assignments count:", response.soundslice_assignments_count);
|
|
950
|
+
* } else {
|
|
951
|
+
* console.log("Failed to retrieve counts.");
|
|
952
|
+
* }
|
|
953
|
+
* })
|
|
954
|
+
* .catch(error => {
|
|
955
|
+
* console.error("Error fetching assignments and lessons count:", error);
|
|
956
|
+
* });
|
|
957
|
+
*/
|
|
958
|
+
export async function countAssignmentsAndLessons(contentId) {
|
|
959
|
+
const url = `/playlists/count-lessons-and-assignments/${contentId}`;
|
|
960
|
+
return await fetchHandler(url);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
|
|
742
964
|
function fetchAbsolute(url, params) {
|
|
743
965
|
if (globalConfig.railcontentConfig.baseUrl) {
|
|
744
966
|
if (url.startsWith('/')) {
|
|
@@ -761,7 +983,7 @@ function fetchAbsolute(url, params) {
|
|
|
761
983
|
<br class="clear">
|
|
762
984
|
|
|
763
985
|
<footer>
|
|
764
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri Nov
|
|
986
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri Nov 08 2024 14:13:46 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
765
987
|
</footer>
|
|
766
988
|
|
|
767
989
|
<script>prettyPrint();</script>
|