musora-content-services 1.6.6 → 1.6.8
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 +9 -0
- package/docs/v2/ContentOrganization.html +2 -2
- package/docs/v2/Forums.html +269 -0
- package/docs/v2/Gamification.html +2 -2
- package/docs/v2/UserManagementSystem.html +2 -2
- package/docs/v2/api_types.js.html +2 -2
- package/docs/v2/config.js.html +2 -8
- package/docs/v2/content-org_content-org.js.html +2 -2
- package/docs/v2/content-org_guided-courses.ts.html +110 -0
- package/docs/v2/content-org_playlists-types.js.html +14 -2
- package/docs/v2/content-org_playlists.js.html +39 -17
- package/docs/v2/content.js.html +120 -64
- package/docs/v2/forums_categories.ts.html +137 -0
- package/docs/v2/forums_discussions.js.html +95 -0
- package/docs/v2/forums_forum.js.html +95 -0
- package/docs/v2/forums_forums.ts.html +77 -0
- package/docs/v2/forums_posts.ts.html +158 -0
- package/docs/v2/forums_threads.ts.html +271 -0
- package/docs/v2/gamification_awards.js.html +35 -534
- package/docs/v2/gamification_awards.ts.html +181 -0
- package/docs/v2/gamification_gamification.js.html +2 -2
- package/docs/v2/gamification_types.js.html +7 -25
- package/docs/v2/global.html +296 -492
- package/docs/v2/index.html +2 -3
- package/docs/v2/module-Accounts.html +1471 -0
- package/docs/v2/module-Awards.html +396 -14
- package/docs/v2/module-Categories.html +711 -0
- package/docs/v2/module-Config.html +4 -8
- package/docs/v2/module-Content-Services-V2.html +460 -46
- package/docs/v2/module-ForumCategories.html +687 -0
- package/docs/v2/module-ForumDiscussions.html +370 -0
- package/docs/v2/module-Forums.html +11961 -0
- package/docs/v2/module-GuidedCourses.html +108 -0
- package/docs/v2/module-Interests.html +2 -2
- package/docs/v2/module-Payments.html +250 -0
- package/docs/v2/module-Permissions.html +2 -2
- package/docs/v2/module-Playlists.html +212 -44
- package/docs/v2/module-Railcontent-Services.html +691 -2177
- package/docs/v2/module-Sanity-Services.html +200 -941
- package/docs/v2/module-Sessions.html +3 -3
- package/docs/v2/module-Threads.html +1119 -0
- package/docs/v2/module-UserActivity.html +193 -23
- package/docs/v2/module-UserChat.html +410 -0
- package/docs/v2/module-UserManagement.html +585 -12
- package/docs/v2/module-UserMemberships.html +556 -0
- package/docs/v2/module-UserNotifications.html +1399 -27
- package/docs/v2/module-UserProfile.html +106 -2
- package/docs/v2/railcontent.js.html +105 -235
- package/docs/v2/sanity.js.html +263 -415
- package/docs/v2/userActivity.js.html +532 -451
- package/docs/v2/user_account.ts.html +190 -0
- package/docs/v2/user_chat.js.html +98 -0
- package/docs/v2/user_interests.js.html +2 -2
- package/docs/v2/user_management.js.html +45 -2
- package/docs/v2/user_memberships.js.html +144 -0
- package/docs/v2/user_notifications.js.html +203 -21
- package/docs/v2/user_payments.ts.html +97 -0
- package/docs/v2/user_permissions.js.html +2 -2
- package/docs/v2/user_profile.js.html +12 -2
- package/docs/v2/user_sessions.js.html +33 -2
- package/docs/v2/user_types.js.html +10 -2
- package/docs/v2/user_user-management-system.js.html +2 -2
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/contentTypeConfig.js +3 -3
- package/src/services/sanity.js +5 -2
- package/docs/v2/Content-Organization.html +0 -245
- package/docs/v2/UserManagement.html +0 -269
- package/docs/v2/global.html#User +0 -293
- package/docs/v2/module-Notifications.html +0 -1183
- package/docs/v2/module-Session-Management.html +0 -575
- package/docs/v2/module-User-Activity.html +0 -4410
- package/docs/v2/module-User-Management.html +0 -490
- package/docs/v2/module-User-Permissions.html +0 -406
- package/docs/v2/types.js.html +0 -122
- package/docs/v2/user_user-management.js.html +0 -78
|
@@ -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-Awards.html">Awards</a><ul class='methods'><li data-type='method'><a href="module-Awards.html#.fetchAwardsForUser">fetchAwardsForUser</a></li></ul></li><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-Content-Services-V2.html">Content-Services-V2</a><ul class='methods'><li data-type='method'><a href="module-Content-Services-V2.html#.getContentRows">getContentRows</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getNewAndUpcoming">getNewAndUpcoming</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecent">getRecent</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecommendedForYou">getRecommendedForYou</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getScheduleContentRows">getScheduleContentRows</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getTabResults">getTabResults</a></li></ul></li><li><a href="module-Interests.html">Interests</a><ul class='methods'><li data-type='method'><a href="module-Interests.html#.fetchInterests">fetchInterests</a></li><li data-type='method'><a href="module-Interests.html#.fetchUninterests">fetchUninterests</a></li><li data-type='method'><a href="module-Interests.html#.markContentAsInterested">markContentAsInterested</a></li><li data-type='method'><a href="module-Interests.html#.markContentAsNotInterested">markContentAsNotInterested</a></li><li data-type='method'><a href="module-Interests.html#.removeContentAsInterested">removeContentAsInterested</a></li><li data-type='method'><a href="module-Interests.html#.removeContentAsNotInterested">removeContentAsNotInterested</a></li></ul></li><li><a href="module-Permissions.html">Permissions</a><ul class='methods'><li data-type='method'><a href="module-Permissions.html#.fetchUserPermissions">fetchUserPermissions</a></li><li data-type='method'><a href="module-Permissions.html#.reset">reset</a></li></ul></li><li><a href="module-Playlists.html">Playlists</a><ul class='methods'><li data-type='method'><a href="module-Playlists.html#.addItemToPlaylist">addItemToPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.createPlaylist">createPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.deletePlaylist">deletePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.duplicatePlaylist">duplicatePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.fetchPlaylist">fetchPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.fetchPlaylistItems">fetchPlaylistItems</a></li><li data-type='method'><a href="module-Playlists.html#.fetchUserPlaylists">fetchUserPlaylists</a></li><li data-type='method'><a href="module-Playlists.html#.togglePlaylistPrivate">togglePlaylistPrivate</a></li><li data-type='method'><a href="module-Playlists.html#.undeletePlaylist">undeletePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.updatePlaylist">updatePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~likePlaylist">likePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~reportPlaylist">reportPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~togglePlaylistPrivate">togglePlaylistPrivate</a></li><li data-type='method'><a href="module-Playlists.html#~unlikePlaylist">unlikePlaylist</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#.assignModeratorToComment">assignModeratorToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.closeComment">closeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.createComment">createComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deleteComment">deleteComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.editComment">editComment</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#.fetchCarouselCardData">fetchCarouselCardData</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#.fetchChallengeUserActiveChallenges">fetchChallengeUserActiveChallenges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCommentRelies">fetchCommentRelies</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchComments">fetchComments</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedChallenges">fetchCompletedChallenges</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#.fetchNextContentDataForParent">fetchNextContentDataForParent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchOwnedChallenges">fetchOwnedChallenges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchRecentUserActivities">fetchRecentUserActivities</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#.fetchTopComment">fetchTopComment</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#.fetchUserBadges">fetchUserBadges</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#.fetchUserPracticeNotes">fetchUserPracticeNotes</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.likeComment">likeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.openComment">openComment</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#.postChallengesHideCompletedBanner">postChallengesHideCompletedBanner</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#.postChallengesSoloNotification">postChallengesSoloNotification</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#.replyToComment">replyToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.reportComment">reportComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.setStudentViewForUser">setStudentViewForUser</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unassignModeratorToComment">unassignModeratorToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unlikeComment">unlikeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#~fetchLastInteractedChild">fetchLastInteractedChild</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#.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#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchComingSoon">fetchComingSoon</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCommentModContentData">fetchCommentModContentData</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#.fetchLeaving">fetchLeaving</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#.fetchLessonsFeaturingThisContent">fetchLessonsFeaturingThisContent</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#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</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#.fetchOtherSongVersions">fetchOtherSongVersions</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#.fetchPackData">fetchPackData</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#.fetchRelatedRecommendedContent">fetchRelatedRecommendedContent</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#.fetchReturning">fetchReturning</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#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.jumpToContinueContent">jumpToContinueContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#~fetchRelatedByLicense">fetchRelatedByLicense</a></li><li data-type='method'><a href="module-Sanity-Services.html#~getNextAndPreviousQuarterDates">getNextAndPreviousQuarterDates</a></li><li data-type='method'><a href="module-Sanity-Services.html#~getQueryFromPage">getQueryFromPage</a></li><li data-type='method'><a href="module-Sanity-Services.html#~handleCustomFetchAll">handleCustomFetchAll</a></li></ul></li><li><a href="module-Sessions.html">Sessions</a><ul class='methods'><li data-type='method'><a href="module-Sessions.html#.login">login</a></li><li data-type='method'><a href="module-Sessions.html#.logout">logout</a></li></ul></li><li><a href="module-UserActivity.html">UserActivity</a><ul class='methods'><li data-type='method'><a href="module-UserActivity.html#.calculateLongestStreaks">calculateLongestStreaks</a></li><li data-type='method'><a href="module-UserActivity.html#.createPracticeNotes">createPracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.deletePracticeSession">deletePracticeSession</a></li><li data-type='method'><a href="module-UserActivity.html#.deleteUserActivity">deleteUserActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.getPracticeNotes">getPracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.getPracticeSessions">getPracticeSessions</a></li><li data-type='method'><a href="module-UserActivity.html#.getProgressRows">getProgressRows</a></li><li data-type='method'><a href="module-UserActivity.html#.getRecentActivity">getRecentActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.getUserMonthlyStats">getUserMonthlyStats</a></li><li data-type='method'><a href="module-UserActivity.html#.getUserWeeklyStats">getUserWeeklyStats</a></li><li data-type='method'><a href="module-UserActivity.html#.pinProgressRow">pinProgressRow</a></li><li data-type='method'><a href="module-UserActivity.html#.recordUserActivity">recordUserActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.recordUserPractice">recordUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.removeUserPractice">removeUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.restorePracticeSession">restorePracticeSession</a></li><li data-type='method'><a href="module-UserActivity.html#.restoreUserPractice">restoreUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.unpinProgressRow">unpinProgressRow</a></li><li data-type='method'><a href="module-UserActivity.html#.updatePracticeNotes">updatePracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.updateUserPractice">updateUserPractice</a></li></ul></li><li><a href="module-UserChat.html">UserChat</a><ul class='methods'><li data-type='method'><a href="module-UserChat.html#.fetchChatSettings">fetchChatSettings</a></li></ul></li><li><a href="module-UserManagement.html">UserManagement</a><ul class='methods'><li data-type='method'><a href="module-UserManagement.html#.blockUser">blockUser</a></li><li data-type='method'><a href="module-UserManagement.html#.deletePicture">deletePicture</a></li><li data-type='method'><a href="module-UserManagement.html#.unblockUser">unblockUser</a></li><li data-type='method'><a href="module-UserManagement.html#.uploadPicture">uploadPicture</a></li><li data-type='method'><a href="module-UserManagement.html#.uploadPictureFromS3">uploadPictureFromS3</a></li></ul></li><li><a href="module-UserNotifications.html">UserNotifications</a><ul class='methods'><li data-type='method'><a href="module-UserNotifications.html#.deleteNotification">deleteNotification</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchNotifications">fetchNotifications</a></li><li data-type='method'><a href="module-UserNotifications.html#.markAllNotificationsAsRead">markAllNotificationsAsRead</a></li><li data-type='method'><a href="module-UserNotifications.html#.markNotificationAsRead">markNotificationAsRead</a></li><li data-type='method'><a href="module-UserNotifications.html#.markNotificationAsUnread">markNotificationAsUnread</a></li></ul></li><li><a href="module-UserProfile.html">UserProfile</a><ul class='methods'><li data-type='method'><a href="module-UserProfile.html#.otherStats">otherStats</a></li></ul></li></ul><h3>Namespaces</h3><ul><li><a href="ContentOrganization.html">ContentOrganization</a></li><li><a href="Gamification.html">Gamification</a></li><li><a href="UserManagementSystem.html">UserManagementSystem</a></li></ul><h3><a href="global.html">Global</a></h3>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Accounts.html">Accounts</a><ul class='methods'><li data-type='method'><a href="module-Accounts.html#~confirmEmailChange">confirmEmailChange</a></li><li data-type='method'><a href="module-Accounts.html#~requestEmailChange">requestEmailChange</a></li><li data-type='method'><a href="module-Accounts.html#~resetPassword">resetPassword</a></li><li data-type='method'><a href="module-Accounts.html#~sendAccountSetupEmail">sendAccountSetupEmail</a></li><li data-type='method'><a href="module-Accounts.html#~sendPasswordResetEmail">sendPasswordResetEmail</a></li><li data-type='method'><a href="module-Accounts.html#~setupAccount">setupAccount</a></li><li data-type='method'><a href="module-Accounts.html#~status">status</a></li></ul></li><li><a href="module-Awards.html">Awards</a><ul class='methods'><li data-type='method'><a href="module-Awards.html#~fetchAwardsForUser">fetchAwardsForUser</a></li><li data-type='method'><a href="module-Awards.html#~fetchCertificate">fetchCertificate</a></li><li data-type='method'><a href="module-Awards.html#~getAwardDataForGuidedContent">getAwardDataForGuidedContent</a></li></ul></li><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-Content-Services-V2.html">Content-Services-V2</a><ul class='methods'><li data-type='method'><a href="module-Content-Services-V2.html#.getContentRows">getContentRows</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getNewAndUpcoming">getNewAndUpcoming</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecent">getRecent</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecentForTab">getRecentForTab</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecommendedForYou">getRecommendedForYou</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getScheduleContentRows">getScheduleContentRows</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getTabResults">getTabResults</a></li></ul></li><li><a href="module-Forums.html">Forums</a><ul class='methods'><li data-type='method'><a href="module-Forums.html#~createForumCategory">createForumCategory</a></li><li data-type='method'><a href="module-Forums.html#~createPost">createPost</a></li><li data-type='method'><a href="module-Forums.html#~createThread">createThread</a></li><li data-type='method'><a href="module-Forums.html#~deletePost">deletePost</a></li><li data-type='method'><a href="module-Forums.html#~deleteThread">deleteThread</a></li><li data-type='method'><a href="module-Forums.html#~fetchCommunityGuidelines">fetchCommunityGuidelines</a></li><li data-type='method'><a href="module-Forums.html#~fetchFollowedThreads">fetchFollowedThreads</a></li><li data-type='method'><a href="module-Forums.html#~fetchForumCategories">fetchForumCategories</a></li><li data-type='method'><a href="module-Forums.html#~fetchLatestThreads">fetchLatestThreads</a></li><li data-type='method'><a href="module-Forums.html#~fetchPosts">fetchPosts</a></li><li data-type='method'><a href="module-Forums.html#~fetchThreads">fetchThreads</a></li><li data-type='method'><a href="module-Forums.html#~followThread">followThread</a></li><li data-type='method'><a href="module-Forums.html#~lockThread">lockThread</a></li><li data-type='method'><a href="module-Forums.html#~pinThread">pinThread</a></li><li data-type='method'><a href="module-Forums.html#~unfollowThread">unfollowThread</a></li><li data-type='method'><a href="module-Forums.html#~unlockThread">unlockThread</a></li><li data-type='method'><a href="module-Forums.html#~unpinThread">unpinThread</a></li><li data-type='method'><a href="module-Forums.html#~updateForumCategory">updateForumCategory</a></li><li data-type='method'><a href="module-Forums.html#~updateThread">updateThread</a></li></ul></li><li></li><li></li><li><a href="module-GuidedCourses.html">GuidedCourses</a></li><li><a href="module-Interests.html">Interests</a><ul class='methods'><li data-type='method'><a href="module-Interests.html#.fetchInterests">fetchInterests</a></li><li data-type='method'><a href="module-Interests.html#.fetchUninterests">fetchUninterests</a></li><li data-type='method'><a href="module-Interests.html#.markContentAsInterested">markContentAsInterested</a></li><li data-type='method'><a href="module-Interests.html#.markContentAsNotInterested">markContentAsNotInterested</a></li><li data-type='method'><a href="module-Interests.html#.removeContentAsInterested">removeContentAsInterested</a></li><li data-type='method'><a href="module-Interests.html#.removeContentAsNotInterested">removeContentAsNotInterested</a></li></ul></li><li><a href="module-Payments.html">Payments</a><ul class='methods'><li data-type='method'><a href="module-Payments.html#~fetchCustomerPayments">fetchCustomerPayments</a></li></ul></li><li><a href="module-Permissions.html">Permissions</a><ul class='methods'><li data-type='method'><a href="module-Permissions.html#.fetchUserPermissions">fetchUserPermissions</a></li><li data-type='method'><a href="module-Permissions.html#.reset">reset</a></li></ul></li><li><a href="module-Playlists.html">Playlists</a><ul class='methods'><li data-type='method'><a href="module-Playlists.html#.addItemToPlaylist">addItemToPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.createPlaylist">createPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.deletePlaylist">deletePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.duplicatePlaylist">duplicatePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.fetchPlaylist">fetchPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.fetchPlaylistItems">fetchPlaylistItems</a></li><li data-type='method'><a href="module-Playlists.html#.fetchUserPlaylists">fetchUserPlaylists</a></li><li data-type='method'><a href="module-Playlists.html#.togglePlaylistPrivate">togglePlaylistPrivate</a></li><li data-type='method'><a href="module-Playlists.html#.undeletePlaylist">undeletePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.updatePlaylist">updatePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~deleteItemsFromPlaylist">deleteItemsFromPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~likePlaylist">likePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~reportPlaylist">reportPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~restoreItemFromPlaylist">restoreItemFromPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~unlikePlaylist">unlikePlaylist</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#.assignModeratorToComment">assignModeratorToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.closeComment">closeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.createComment">createComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deleteComment">deleteComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.editComment">editComment</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#.fetchCarouselCardData">fetchCarouselCardData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchComment">fetchComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCommentRelies">fetchCommentRelies</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchComments">fetchComments</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#.fetchNextContentDataForParent">fetchNextContentDataForParent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchRecentUserActivities">fetchRecentUserActivities</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#.fetchTopComment">fetchTopComment</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#.fetchUserBadges">fetchUserBadges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserPracticeNotes">fetchUserPracticeNotes</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.likeComment">likeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.openComment">openComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postContentComplete">postContentComplete</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postContentReset">postContentReset</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postContentRestore">postContentRestore</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postContentStart">postContentStart</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.replyToComment">replyToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.reportComment">reportComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.restoreComment">restoreComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.setStudentViewForUser">setStudentViewForUser</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unassignModeratorToComment">unassignModeratorToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unlikeComment">unlikeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#~fetchLastInteractedChild">fetchLastInteractedChild</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#.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#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchComingSoon">fetchComingSoon</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCommentModContentData">fetchCommentModContentData</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#.fetchLeaving">fetchLeaving</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#.fetchLessonsFeaturingThisContent">fetchLessonsFeaturingThisContent</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#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</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#.fetchOtherSongVersions">fetchOtherSongVersions</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#.fetchPackData">fetchPackData</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#.fetchRelatedRecommendedContent">fetchRelatedRecommendedContent</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#.fetchReturning">fetchReturning</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#.fetchSiblingContent">fetchSiblingContent</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#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.jumpToContinueContent">jumpToContinueContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#~fetchRelatedByLicense">fetchRelatedByLicense</a></li><li data-type='method'><a href="module-Sanity-Services.html#~getQueryFromPage">getQueryFromPage</a></li></ul></li><li><a href="module-Sessions.html">Sessions</a><ul class='methods'><li data-type='method'><a href="module-Sessions.html#.login">login</a></li><li data-type='method'><a href="module-Sessions.html#.logout">logout</a></li></ul></li><li><a href="module-UserActivity.html">UserActivity</a><ul class='methods'><li data-type='method'><a href="module-UserActivity.html#.calculateLongestStreaks">calculateLongestStreaks</a></li><li data-type='method'><a href="module-UserActivity.html#.createPracticeNotes">createPracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.deletePracticeSession">deletePracticeSession</a></li><li data-type='method'><a href="module-UserActivity.html#.deleteUserActivity">deleteUserActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.getPracticeNotes">getPracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.getPracticeSessions">getPracticeSessions</a></li><li data-type='method'><a href="module-UserActivity.html#.getProgressRows">getProgressRows</a></li><li data-type='method'><a href="module-UserActivity.html#.getRecentActivity">getRecentActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.getUserMonthlyStats">getUserMonthlyStats</a></li><li data-type='method'><a href="module-UserActivity.html#.getUserWeeklyStats">getUserWeeklyStats</a></li><li data-type='method'><a href="module-UserActivity.html#.pinProgressRow">pinProgressRow</a></li><li data-type='method'><a href="module-UserActivity.html#.recordUserActivity">recordUserActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.recordUserPractice">recordUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.removeUserPractice">removeUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.restorePracticeSession">restorePracticeSession</a></li><li data-type='method'><a href="module-UserActivity.html#.restoreUserActivity">restoreUserActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.restoreUserPractice">restoreUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.unpinProgressRow">unpinProgressRow</a></li><li data-type='method'><a href="module-UserActivity.html#.updatePracticeNotes">updatePracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.updateUserPractice">updateUserPractice</a></li></ul></li><li><a href="module-UserChat.html">UserChat</a><ul class='methods'><li data-type='method'><a href="module-UserChat.html#.fetchChatSettings">fetchChatSettings</a></li></ul></li><li><a href="module-UserManagement.html">UserManagement</a><ul class='methods'><li data-type='method'><a href="module-UserManagement.html#.blockUser">blockUser</a></li><li data-type='method'><a href="module-UserManagement.html#.blockedUsers">blockedUsers</a></li><li data-type='method'><a href="module-UserManagement.html#.deletePicture">deletePicture</a></li><li data-type='method'><a href="module-UserManagement.html#.getUserData">getUserData</a></li><li data-type='method'><a href="module-UserManagement.html#.isDisplayNameAvailable">isDisplayNameAvailable</a></li><li data-type='method'><a href="module-UserManagement.html#.unblockUser">unblockUser</a></li><li data-type='method'><a href="module-UserManagement.html#.updateDisplayName">updateDisplayName</a></li><li data-type='method'><a href="module-UserManagement.html#.uploadPicture">uploadPicture</a></li><li data-type='method'><a href="module-UserManagement.html#.uploadPictureFromS3">uploadPictureFromS3</a></li></ul></li><li><a href="module-UserMemberships.html">UserMemberships</a><ul class='methods'><li data-type='method'><a href="module-UserMemberships.html#.fetchMemberships">fetchMemberships</a></li><li data-type='method'><a href="module-UserMemberships.html#.fetchRechargeTokens">fetchRechargeTokens</a></li><li data-type='method'><a href="module-UserMemberships.html#.upgradeSubscription">upgradeSubscription</a></li></ul></li><li><a href="module-UserNotifications.html">UserNotifications</a><ul class='methods'><li data-type='method'><a href="module-UserNotifications.html#.deleteNotification">deleteNotification</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchLiveEventPollingState">fetchLiveEventPollingState</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchNotificationSettings">fetchNotificationSettings</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchNotifications">fetchNotifications</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchUnreadCount">fetchUnreadCount</a></li><li data-type='method'><a href="module-UserNotifications.html#.markAllNotificationsAsRead">markAllNotificationsAsRead</a></li><li data-type='method'><a href="module-UserNotifications.html#.markNotificationAsRead">markNotificationAsRead</a></li><li data-type='method'><a href="module-UserNotifications.html#.markNotificationAsUnread">markNotificationAsUnread</a></li><li data-type='method'><a href="module-UserNotifications.html#.pauseLiveEventPolling">pauseLiveEventPolling</a></li><li data-type='method'><a href="module-UserNotifications.html#.restoreNotification">restoreNotification</a></li><li data-type='method'><a href="module-UserNotifications.html#.startLiveEventPolling">startLiveEventPolling</a></li><li data-type='method'><a href="module-UserNotifications.html#.updateNotificationSetting">updateNotificationSetting</a></li></ul></li><li><a href="module-UserProfile.html">UserProfile</a><ul class='methods'><li data-type='method'><a href="module-UserProfile.html#.deleteProfilePicture">deleteProfilePicture</a></li><li data-type='method'><a href="module-UserProfile.html#.otherStats">otherStats</a></li></ul></li></ul><h3>Namespaces</h3><ul><li><a href="ContentOrganization.html">ContentOrganization</a></li><li><a href="Forums.html">Forums</a></li><li><a href="Gamification.html">Gamification</a></li><li><a href="UserManagementSystem.html">UserManagementSystem</a></li></ul><h3><a href="global.html">Global</a></h3>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
*/
|
|
51
51
|
import { globalConfig } from './config.js'
|
|
52
52
|
import { fetchJSONHandler } from '../lib/httpHelper.js'
|
|
53
|
-
import { convertToTimeZone } from './dateUtils.js';
|
|
54
53
|
|
|
55
54
|
/**
|
|
56
55
|
* Exported functions that are excluded from index generation.
|
|
@@ -68,8 +67,6 @@ const excludeFromGeneratedIndex = [
|
|
|
68
67
|
'fetchUserPermissionsData',
|
|
69
68
|
]
|
|
70
69
|
|
|
71
|
-
let challengeIndexMetaDataPromise = null
|
|
72
|
-
|
|
73
70
|
/**
|
|
74
71
|
* Fetches the completion status of a specific lesson for the current user.
|
|
75
72
|
*
|
|
@@ -333,8 +330,8 @@ async function postDataHandler(url, data) {
|
|
|
333
330
|
return fetchHandler(url, 'post', null, data)
|
|
334
331
|
}
|
|
335
332
|
|
|
336
|
-
async function
|
|
337
|
-
|
|
333
|
+
async function patchDataHandler_depreciated(url, data) {
|
|
334
|
+
throw Error('PATCH verb throws a CORS error on the FEW. Use PATCH instead')
|
|
338
335
|
}
|
|
339
336
|
|
|
340
337
|
async function putDataHandler(url, data) {
|
|
@@ -345,8 +342,8 @@ async function deleteDataHandler(url, data) {
|
|
|
345
342
|
return fetchHandler(url, 'delete')
|
|
346
343
|
}
|
|
347
344
|
|
|
348
|
-
export async function fetchLikeCount(contendId){
|
|
349
|
-
const url
|
|
345
|
+
export async function fetchLikeCount(contendId) {
|
|
346
|
+
const url = `/api/content/v1/content/like_count/${contendId}`
|
|
350
347
|
return await fetchDataHandler(url)
|
|
351
348
|
}
|
|
352
349
|
|
|
@@ -370,6 +367,11 @@ export async function fetchContentProgress(currentVersion) {
|
|
|
370
367
|
return fetchDataHandler(url, currentVersion)
|
|
371
368
|
}
|
|
372
369
|
|
|
370
|
+
export async function postPlaylistContentEngaged(playlistItemId) {
|
|
371
|
+
let url = `/railtracker/v1/last-engaged/${playlistItemId}`
|
|
372
|
+
return postDataHandler(url)
|
|
373
|
+
}
|
|
374
|
+
|
|
373
375
|
export async function postRecordWatchSession(
|
|
374
376
|
contentId,
|
|
375
377
|
mediaTypeId,
|
|
@@ -389,67 +391,6 @@ export async function postRecordWatchSession(
|
|
|
389
391
|
})
|
|
390
392
|
}
|
|
391
393
|
|
|
392
|
-
/**
|
|
393
|
-
* Fetch enrolled user data for a given challenge. Intended to be used in the enrolled modal
|
|
394
|
-
*
|
|
395
|
-
* @param contentId - railcontent id of the challenge
|
|
396
|
-
* @returns {Promise<any|null>}
|
|
397
|
-
*/
|
|
398
|
-
export async function fetchChallengeMetadata(contentId) {
|
|
399
|
-
let url = `/challenges/${contentId}`
|
|
400
|
-
return await fetchHandler(url, 'get')
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* Fetch lesson, user, and challenge data for a given lesson
|
|
405
|
-
*
|
|
406
|
-
* @param contentId - railcontent id of the lesson
|
|
407
|
-
* @returns {Promise<any|null>}
|
|
408
|
-
*/
|
|
409
|
-
export async function fetchChallengeLessonData(contentId) {
|
|
410
|
-
let url = `/challenges/lessons/${contentId}`
|
|
411
|
-
return await fetchHandler(url, 'get')
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Fetch all owned brand challenges for user
|
|
416
|
-
* @param {string|null} brand - brand
|
|
417
|
-
* @param {int} page - page of data to pull
|
|
418
|
-
* @param {int} limit - number of elements to pull
|
|
419
|
-
* @returns {Promise<any|null>}
|
|
420
|
-
*/
|
|
421
|
-
export async function fetchOwnedChallenges(brand = null, page, limit) {
|
|
422
|
-
let brandParam = brand ? `&brand=${brand}` : ''
|
|
423
|
-
let pageAndLimit = `?page=${page}&limit=${limit}`
|
|
424
|
-
let url = `/challenges/tab_owned/get${pageAndLimit}${brandParam}`
|
|
425
|
-
return await fetchHandler(url, 'get')
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* Fetch all completed brand challenges for user
|
|
430
|
-
* @param {string|null} brand - brand
|
|
431
|
-
* @param {int} page - page of data to pull
|
|
432
|
-
* @param {int} limit - number of elements to pull
|
|
433
|
-
* @returns {Promise<any|null>}
|
|
434
|
-
*/
|
|
435
|
-
export async function fetchCompletedChallenges(brand = null, page, limit) {
|
|
436
|
-
let brandParam = brand ? `&brand=${brand}` : ''
|
|
437
|
-
let pageAndLimit = `?page=${page}&limit=${limit}`
|
|
438
|
-
let url = `/challenges/tab_completed/get${pageAndLimit}${brandParam}`
|
|
439
|
-
return await fetchHandler(url, 'get')
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* Fetch challenge, lesson, and user metadata for a given challenge
|
|
444
|
-
*
|
|
445
|
-
* @param contentId - railcontent id of the challenge
|
|
446
|
-
* @returns {Promise<any|null>}
|
|
447
|
-
*/
|
|
448
|
-
export async function fetchUserChallengeProgress(contentId) {
|
|
449
|
-
let url = `/challenges/user_data/${contentId}`
|
|
450
|
-
return await fetchHandler(url, 'get')
|
|
451
|
-
}
|
|
452
|
-
|
|
453
394
|
/**
|
|
454
395
|
* Fetch the user's best award for this challenge
|
|
455
396
|
*
|
|
@@ -461,44 +402,6 @@ export async function fetchUserAward(contentId) {
|
|
|
461
402
|
return await fetchHandler(url, 'get')
|
|
462
403
|
}
|
|
463
404
|
|
|
464
|
-
/**
|
|
465
|
-
* Get challenge duration, user progress, and status for the list of challenges
|
|
466
|
-
* Intended to be used on the index page for challenges
|
|
467
|
-
*
|
|
468
|
-
* @param {array} contentIds - arary of railcontent ids of the challenges
|
|
469
|
-
* @returns {Promise<any|null>}
|
|
470
|
-
*/
|
|
471
|
-
export async function fetchChallengeIndexMetadata(contentIds) {
|
|
472
|
-
if (!challengeIndexMetaDataPromise) {
|
|
473
|
-
challengeIndexMetaDataPromise = getChallengeIndexMetadataPromise()
|
|
474
|
-
}
|
|
475
|
-
let results = await challengeIndexMetaDataPromise
|
|
476
|
-
if (Array.isArray(contentIds)) {
|
|
477
|
-
results = results.filter(function (challenge) {
|
|
478
|
-
return contentIds.includes(challenge.content_id)
|
|
479
|
-
})
|
|
480
|
-
}
|
|
481
|
-
return results
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
async function getChallengeIndexMetadataPromise() {
|
|
485
|
-
let url = `/challenges/user_progress_for_index_page/get`
|
|
486
|
-
const result = await fetchHandler(url, 'get')
|
|
487
|
-
challengeIndexMetaDataPromise = null
|
|
488
|
-
return result
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* Get active brand challenges for the authorized user
|
|
493
|
-
*
|
|
494
|
-
* @returns {Promise<any|null>}
|
|
495
|
-
*/
|
|
496
|
-
export async function fetchChallengeUserActiveChallenges(brand = null) {
|
|
497
|
-
let brandParam = brand ? `?brand=${brand}` : ''
|
|
498
|
-
let url = `/challenges/user_active_challenges/get${brandParam}`
|
|
499
|
-
return await fetchHandler(url, 'get')
|
|
500
|
-
}
|
|
501
|
-
|
|
502
405
|
/**
|
|
503
406
|
* Fetch All Carousel Card Data
|
|
504
407
|
*
|
|
@@ -523,105 +426,42 @@ export async function fetchUserBadges(brand = null) {
|
|
|
523
426
|
}
|
|
524
427
|
|
|
525
428
|
/**
|
|
526
|
-
*
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
* @param {int|string} contentId - railcontent id of the challenge
|
|
530
|
-
* @param {string} startDate - prefered format YYYYMMDD, but any Carbon parsable string will do.
|
|
531
|
-
* @returns {Promise<any|null>}
|
|
532
|
-
*/
|
|
533
|
-
export async function postChallengesSetStartDate(contentId, startDate) {
|
|
534
|
-
let url = `/challenges/set_start_date/${contentId}?start_date=${startDate}`
|
|
535
|
-
return await fetchHandler(url, 'post')
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* Enroll the user in the provided challenge and set to unlocked
|
|
540
|
-
* Clears any current progress data for this challenge
|
|
541
|
-
*
|
|
542
|
-
* @param {int|string} contentId - railcontent id of the challenge
|
|
543
|
-
* @returns {Promise<any|null>}
|
|
544
|
-
*/
|
|
545
|
-
export async function postChallengesUnlock(contentId) {
|
|
546
|
-
let url = `/challenges/unlock/${contentId}`
|
|
547
|
-
return await fetchHandler(url, 'post')
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* Enroll the user in the given challenge on the challenge published_on date
|
|
552
|
-
* Clears any current progress data for this challenge
|
|
553
|
-
*
|
|
554
|
-
* @param {int|string} contentId - railcontent id of the challenge
|
|
555
|
-
* @returns {Promise<any|null>}
|
|
556
|
-
*/
|
|
557
|
-
export async function postChallengesEnroll(contentId) {
|
|
558
|
-
let url = `/challenges/enroll/${contentId}`
|
|
559
|
-
return await fetchHandler(url, 'post')
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* Remove the user from the provided challenge
|
|
564
|
-
* Clears any current progress data for this challenge
|
|
565
|
-
*
|
|
566
|
-
* @param {int|string} contentId - railcontent id of the challenge
|
|
567
|
-
* @returns {Promise<any|null>}
|
|
568
|
-
*/
|
|
569
|
-
export async function postChallengesLeave(contentId) {
|
|
570
|
-
let url = `/challenges/leave/${contentId}`
|
|
571
|
-
return await fetchHandler(url, 'post')
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* Enable enrollment notifications for the provided challenge
|
|
576
|
-
*
|
|
577
|
-
* @param {int|string} contentId - railcontent id of the challenge
|
|
578
|
-
* @returns {Promise<any|null>}
|
|
429
|
+
* complete a content's progress for a given user
|
|
430
|
+
* @param contentId
|
|
431
|
+
* @returns {Promise<any|string|null>}
|
|
579
432
|
*/
|
|
580
|
-
export async function
|
|
581
|
-
let url = `/
|
|
582
|
-
return
|
|
433
|
+
export async function postContentComplete(contentId) {
|
|
434
|
+
let url = `/api/content/v1/user/progress/complete/${contentId}`
|
|
435
|
+
return postDataHandler(url)
|
|
583
436
|
}
|
|
584
437
|
|
|
585
438
|
/**
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
* @
|
|
589
|
-
* @returns {Promise<any|null>}
|
|
439
|
+
* start the user's progress on a content
|
|
440
|
+
* @param contentId
|
|
441
|
+
* @returns {Promise<any|string|null>}
|
|
590
442
|
*/
|
|
591
|
-
export async function
|
|
592
|
-
let url = `/
|
|
593
|
-
return
|
|
443
|
+
export async function postContentStart(contentId) {
|
|
444
|
+
let url = `/api/content/v1/user/progress/start/${contentId}`
|
|
445
|
+
return postDataHandler(url)
|
|
594
446
|
}
|
|
595
447
|
|
|
596
448
|
/**
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
* @
|
|
600
|
-
* @returns {Promise<any|null>}
|
|
449
|
+
* resets the user's progress on a content
|
|
450
|
+
* @param contentId
|
|
451
|
+
* @returns {Promise<any|string|null>}
|
|
601
452
|
*/
|
|
602
|
-
export async function
|
|
603
|
-
let url = `/
|
|
604
|
-
return
|
|
453
|
+
export async function postContentReset(contentId) {
|
|
454
|
+
let url = `/api/content/v1/user/progress/reset/${contentId}`
|
|
455
|
+
return postDataHandler(url)
|
|
605
456
|
}
|
|
606
457
|
|
|
607
458
|
/**
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
* @
|
|
611
|
-
* @returns {Promise<any|null>}
|
|
459
|
+
* restores the user's progress on a content
|
|
460
|
+
* @param contentId
|
|
461
|
+
* @returns {Promise<any|string|null>}
|
|
612
462
|
*/
|
|
613
|
-
export async function
|
|
614
|
-
let url = `/
|
|
615
|
-
return await fetchHandler(url, 'post')
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
export async function postContentComplete(contentId) {
|
|
619
|
-
let url = `/api/content/v1/user/progress/complete/${contentId}`
|
|
620
|
-
return postDataHandler(url)
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
export async function postContentReset(contentId) {
|
|
624
|
-
let url = `/api/content/v1/user/progress/reset/${contentId}`
|
|
463
|
+
export async function postContentRestore(contentId) {
|
|
464
|
+
let url = `/api/content/v1/user/progress/restore/${contentId}`
|
|
625
465
|
return postDataHandler(url)
|
|
626
466
|
}
|
|
627
467
|
|
|
@@ -635,7 +475,7 @@ export async function postContentReset(contentId) {
|
|
|
635
475
|
export async function setStudentViewForUser(userId, enable) {
|
|
636
476
|
let url = `/user-management-system/user/update/${userId}`
|
|
637
477
|
let data = { use_student_view: enable ? 1 : 0 }
|
|
638
|
-
return await
|
|
478
|
+
return await putDataHandler(url, data)
|
|
639
479
|
}
|
|
640
480
|
|
|
641
481
|
/**
|
|
@@ -682,6 +522,15 @@ export async function deleteComment(commentId) {
|
|
|
682
522
|
return await fetchHandler(url, 'DELETE')
|
|
683
523
|
}
|
|
684
524
|
|
|
525
|
+
/**
|
|
526
|
+
* @param {int} commentId
|
|
527
|
+
* @returns {Promise<*|null>}
|
|
528
|
+
*/
|
|
529
|
+
export async function restoreComment(commentId) {
|
|
530
|
+
const url = `/api/content/v1/comments/restore/${commentId}`
|
|
531
|
+
return await fetchHandler(url, 'POST')
|
|
532
|
+
}
|
|
533
|
+
|
|
685
534
|
/**
|
|
686
535
|
* @param {int} commentId
|
|
687
536
|
* @param {string} comment
|
|
@@ -752,7 +601,7 @@ export async function closeComment(commentId) {
|
|
|
752
601
|
const data = {
|
|
753
602
|
conversation_status: 'closed',
|
|
754
603
|
}
|
|
755
|
-
return await
|
|
604
|
+
return await putDataHandler(url, data)
|
|
756
605
|
}
|
|
757
606
|
|
|
758
607
|
/**
|
|
@@ -764,7 +613,7 @@ export async function openComment(commentId) {
|
|
|
764
613
|
const data = {
|
|
765
614
|
conversation_status: 'open',
|
|
766
615
|
}
|
|
767
|
-
return await
|
|
616
|
+
return await putDataHandler(url, data)
|
|
768
617
|
}
|
|
769
618
|
|
|
770
619
|
/**
|
|
@@ -793,46 +642,54 @@ export async function reportComment(commentId, issue) {
|
|
|
793
642
|
return await postDataHandler(url, data)
|
|
794
643
|
}
|
|
795
644
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
645
|
+
/**
|
|
646
|
+
* Fetches a single comment by its ID.
|
|
647
|
+
*
|
|
648
|
+
* @param {number|string} commentId - The ID of the comment to fetch.
|
|
649
|
+
* @returns {Promise<Object|null>} - A promise that resolves to the comment object if found, otherwise null.
|
|
650
|
+
*
|
|
651
|
+
* @example
|
|
652
|
+
* fetchComment(123)
|
|
653
|
+
* .then(comment => console.log(comment))
|
|
654
|
+
* .catch(error => console.error(error));
|
|
655
|
+
*/
|
|
656
|
+
export async function fetchComment(commentId) {
|
|
657
|
+
const url = `/api/content/v1/comments/${commentId}`
|
|
658
|
+
const comment = await fetchHandler(url)
|
|
659
|
+
return comment.parent ? comment.parent : comment
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
export async function fetchUserPractices(currentVersion = 0, { userId } = {}) {
|
|
663
|
+
const params = new URLSearchParams()
|
|
664
|
+
if (userId) params.append('user_id', userId)
|
|
665
|
+
const query = params.toString() ? `?${params.toString()}` : ''
|
|
666
|
+
const url = `/api/user/practices/v1/practices${query}`
|
|
667
|
+
const response = await fetchDataHandler(url, currentVersion)
|
|
668
|
+
const { data, version } = response
|
|
669
|
+
const userPractices = data
|
|
670
|
+
if (!userPractices) {
|
|
671
|
+
return { data: { practices: {} }, version }
|
|
672
|
+
}
|
|
807
673
|
|
|
808
674
|
const formattedPractices = userPractices.reduce((acc, practice) => {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
const localDate = convertToTimeZone(utcDate, userTimeZone);
|
|
812
|
-
|
|
813
|
-
const userTimeZoneDay =
|
|
814
|
-
localDate.getFullYear() + '-' +
|
|
815
|
-
String(localDate.getMonth() + 1).padStart(2, '0') + '-' +
|
|
816
|
-
String(localDate.getDate()).padStart(2, '0');
|
|
817
|
-
|
|
818
|
-
if (!acc[userTimeZoneDay]) {
|
|
819
|
-
acc[userTimeZoneDay] = [];
|
|
675
|
+
if (!acc[practice.day]) {
|
|
676
|
+
acc[practice.day] = []
|
|
820
677
|
}
|
|
821
678
|
|
|
822
|
-
acc[
|
|
679
|
+
acc[practice.day].push({
|
|
823
680
|
id: practice.id,
|
|
824
681
|
duration_seconds: practice.duration_seconds,
|
|
825
|
-
})
|
|
682
|
+
})
|
|
826
683
|
|
|
827
|
-
return acc
|
|
828
|
-
}, {})
|
|
684
|
+
return acc
|
|
685
|
+
}, {})
|
|
829
686
|
|
|
830
687
|
return {
|
|
831
688
|
data: {
|
|
832
689
|
practices: formattedPractices,
|
|
833
690
|
},
|
|
834
691
|
version,
|
|
835
|
-
}
|
|
692
|
+
}
|
|
836
693
|
}
|
|
837
694
|
|
|
838
695
|
export async function logUserPractice(practiceDetails) {
|
|
@@ -843,11 +700,11 @@ export async function fetchUserPracticeMeta(practiceIds, userId = null) {
|
|
|
843
700
|
if (practiceIds.length == 0) {
|
|
844
701
|
return []
|
|
845
702
|
}
|
|
846
|
-
const params = new URLSearchParams()
|
|
847
|
-
practiceIds.forEach(id => params.append('practice_ids[]', id))
|
|
703
|
+
const params = new URLSearchParams()
|
|
704
|
+
practiceIds.forEach((id) => params.append('practice_ids[]', id))
|
|
848
705
|
|
|
849
706
|
if (userId !== null) {
|
|
850
|
-
params.append('user_id', userId)
|
|
707
|
+
params.append('user_id', userId)
|
|
851
708
|
}
|
|
852
709
|
const url = `/api/user/practices/v1/practices?${params.toString()}`
|
|
853
710
|
return await fetchHandler(url, 'GET', null)
|
|
@@ -868,6 +725,24 @@ export async function fetchUserPracticeNotes(date) {
|
|
|
868
725
|
return await fetchHandler(url, 'GET', null)
|
|
869
726
|
}
|
|
870
727
|
|
|
728
|
+
export async function fetchRecent(brand, { status, types } = {}, {
|
|
729
|
+
page = 1,
|
|
730
|
+
limit = 10
|
|
731
|
+
} = {}) {
|
|
732
|
+
const query = new URLSearchParams()
|
|
733
|
+
query.append('brand', brand)
|
|
734
|
+
if (status) query.append('status', status)
|
|
735
|
+
if (types) {
|
|
736
|
+
types.forEach((type) => query.append('types[]', type))
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
query.append('page', page)
|
|
740
|
+
query.append('limit', limit)
|
|
741
|
+
|
|
742
|
+
const url = `/api/content-org/v1/user/recent?${query.toString()}`
|
|
743
|
+
const response = await fetchHandler(url, 'GET', null)
|
|
744
|
+
return response ? response.result : []
|
|
745
|
+
}
|
|
871
746
|
|
|
872
747
|
/**
|
|
873
748
|
* Get the id and slug of last interacted child. Only valid for certain content types
|
|
@@ -889,8 +764,8 @@ export async function fetchUserPracticeNotes(date) {
|
|
|
889
764
|
* }
|
|
890
765
|
*/
|
|
891
766
|
export async function fetchLastInteractedChild(content_ids) {
|
|
892
|
-
const params = new URLSearchParams()
|
|
893
|
-
content_ids.forEach(id => params.append('content_ids[]', id))
|
|
767
|
+
const params = new URLSearchParams()
|
|
768
|
+
content_ids.forEach((id) => params.append('content_ids[]', id))
|
|
894
769
|
const url = `/api/content/v1/user/last_interacted_child?${params.toString()}`
|
|
895
770
|
return await fetchHandler(url, 'GET', null)
|
|
896
771
|
}
|
|
@@ -923,18 +798,13 @@ export async function fetchLastInteractedChild(content_ids) {
|
|
|
923
798
|
* .then(activities => console.log(activities))
|
|
924
799
|
* .catch(error => console.error(error));
|
|
925
800
|
*/
|
|
926
|
-
export async function fetchRecentUserActivities({
|
|
927
|
-
page = 1,
|
|
928
|
-
limit = 5,
|
|
929
|
-
tabName = null
|
|
930
|
-
} = {}) {
|
|
801
|
+
export async function fetchRecentUserActivities({ page = 1, limit = 5, tabName = null } = {}) {
|
|
931
802
|
let pageAndLimit = `?page=${page}&limit=${limit}`
|
|
932
803
|
let tabParam = tabName ? `&tabName=${tabName}` : ''
|
|
933
804
|
const url = `/api/user-management-system/v1/activities/all${pageAndLimit}${tabParam}`
|
|
934
805
|
return await fetchHandler(url, 'GET', null)
|
|
935
806
|
}
|
|
936
807
|
|
|
937
|
-
|
|
938
808
|
function fetchAbsolute(url, params) {
|
|
939
809
|
if (globalConfig.sessionConfig.authToken) {
|
|
940
810
|
params.headers['Authorization'] = `Bearer ${globalConfig.sessionConfig.authToken}`
|
|
@@ -971,7 +841,7 @@ export async function fetchHandler(url, method = 'get', dataVersion = null, body
|
|
|
971
841
|
<br class="clear">
|
|
972
842
|
|
|
973
843
|
<footer>
|
|
974
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on
|
|
844
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Thu Oct 02 2025 11:46:05 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
975
845
|
</footer>
|
|
976
846
|
|
|
977
847
|
<script>prettyPrint();</script>
|