musora-content-services 1.7.0 → 1.7.5
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/.claude/settings.local.json +17 -0
- package/.github/workflows/conventional-commits.yaml +0 -0
- package/.github/workflows/node.js.yml +0 -0
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/CHANGELOG.md +15 -0
- package/docs/v2/Content.html +269 -0
- package/docs/v2/ContentOrganization.html +2 -2
- package/docs/v2/Forums.html +2 -2
- package/docs/v2/Gamification.html +2 -2
- package/docs/v2/TestUser.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 +5 -2
- package/docs/v2/content-org_content-org.js.html +2 -2
- package/docs/v2/content-org_guided-courses.ts.html +2 -2
- package/docs/v2/content-org_learning-paths.ts.html +194 -59
- package/docs/v2/content-org_playlists-types.js.html +2 -2
- package/docs/v2/content-org_playlists.js.html +2 -2
- package/docs/v2/content.js.html +88 -10
- package/docs/v2/content_artist.ts.html +206 -0
- package/docs/v2/content_content.ts.html +77 -0
- package/docs/v2/content_genre.ts.html +209 -0
- package/docs/v2/content_instructor.ts.html +206 -0
- package/docs/v2/forums_categories.ts.html +22 -3
- package/docs/v2/forums_forums.ts.html +2 -2
- package/docs/v2/forums_posts.ts.html +22 -3
- package/docs/v2/forums_threads.ts.html +23 -10
- package/docs/v2/gamification_awards.ts.html +26 -12
- package/docs/v2/gamification_gamification.js.html +2 -2
- package/docs/v2/global.html +56 -8
- package/docs/v2/index.html +2 -2
- package/docs/v2/liveTesting.ts.html +2 -2
- package/docs/v2/module-Accounts.html +202 -13
- package/docs/v2/module-Artist.html +993 -0
- package/docs/v2/module-Awards.html +106 -6
- package/docs/v2/module-Config.html +5 -4
- package/docs/v2/module-Content-Services-V2.html +440 -9
- package/docs/v2/module-Forums.html +1398 -192
- package/docs/v2/module-Genre.html +981 -0
- package/docs/v2/module-GuidedCourses.html +2 -2
- package/docs/v2/module-Instructor.html +929 -0
- package/docs/v2/module-Interests.html +2 -2
- package/docs/v2/module-LearningPaths.html +1276 -182
- package/docs/v2/module-Onboarding.html +32 -8
- package/docs/v2/module-Payments.html +2 -2
- package/docs/v2/module-Permissions.html +2 -2
- package/docs/v2/module-Playlists.html +2 -2
- package/docs/v2/module-ProgressRow.html +2 -2
- package/docs/v2/module-Railcontent-Services.html +34 -626
- package/docs/v2/module-Sanity-Services.html +803 -1722
- package/docs/v2/module-Sessions.html +2 -2
- package/docs/v2/module-UserActivity.html +70 -116
- package/docs/v2/module-UserChat.html +2 -2
- package/docs/v2/module-UserManagement.html +2 -2
- package/docs/v2/module-UserMemberships.html +2 -2
- package/docs/v2/module-UserNotifications.html +2 -2
- package/docs/v2/module-UserProfile.html +2 -2
- package/docs/v2/progress-row_method-card.js.html +46 -47
- package/docs/v2/railcontent.js.html +14 -125
- package/docs/v2/sanity.js.html +247 -320
- package/docs/v2/userActivity.js.html +93 -169
- package/docs/v2/user_account.ts.html +41 -13
- package/docs/v2/user_chat.js.html +2 -2
- package/docs/v2/user_interests.js.html +2 -2
- package/docs/v2/user_management.js.html +2 -2
- package/docs/v2/user_memberships.ts.html +2 -2
- package/docs/v2/user_notifications.js.html +2 -2
- package/docs/v2/user_onboarding.ts.html +99 -4
- package/docs/v2/user_payments.ts.html +2 -2
- package/docs/v2/user_permissions.js.html +3 -3
- package/docs/v2/user_profile.js.html +2 -2
- package/docs/v2/user_sessions.js.html +2 -2
- package/docs/v2/user_types.js.html +4 -2
- package/docs/v2/user_user-management-system.js.html +2 -2
- package/jest.config.js +0 -0
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/services/imageSRCBuilder.js +1 -1
- package/src/services/imageSRCVerify.js +1 -1
- package/src/services/sanity.js +3 -3
- package/test/dataContext.test.js +0 -0
- package/test/imageSRCBuilder.test.js +1 -1
- package/test/imageSRCVerify.test.js +4 -4
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
package/docs/v2/sanity.js.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-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#~deleteAccount">deleteAccount</a></li><li data-type='method'><a href="module-Accounts.html#~numberOfActiveUsers">numberOfActiveUsers</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#.getLegacyMethods">getLegacyMethods</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-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#~jumpToPost">jumpToPost</a></li><li data-type='method'><a href="module-Forums.html#~likePost">likePost</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#~search">search</a></li><li data-type='method'><a href="module-Forums.html#~unfollowThread">unfollowThread</a></li><li data-type='method'><a href="module-Forums.html#~unlikePost">unlikePost</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#~updatePost">updatePost</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-LearningPaths.html">LearningPaths</a><ul class='methods'><li data-type='method'><a href="module-LearningPaths.html#~fetchLearningPathLessons">fetchLearningPathLessons</a></li><li data-type='method'><a href="module-LearningPaths.html#~getActivePath">getActivePath</a></li><li data-type='method'><a href="module-LearningPaths.html#~getDailySession">getDailySession</a></li><li data-type='method'><a href="module-LearningPaths.html#~resetAllLearningPaths">resetAllLearningPaths</a></li><li data-type='method'><a href="module-LearningPaths.html#~startLearningPath">startLearningPath</a></li><li data-type='method'><a href="module-LearningPaths.html#~updateActivePath">updateActivePath</a></li><li data-type='method'><a href="module-LearningPaths.html#~updateDailySession">updateDailySession</a></li></ul></li><li><a href="module-Onboarding.html">Onboarding</a><ul class='methods'><li data-type='method'><a href="module-Onboarding.html#~getOnboardingRecommendedContent">getOnboardingRecommendedContent</a></li><li data-type='method'><a href="module-Onboarding.html#~startOnboarding">startOnboarding</a></li><li data-type='method'><a href="module-Onboarding.html#~updateOnboarding">updateOnboarding</a></li><li data-type='method'><a href="module-Onboarding.html#~userOnboardingForBrand">userOnboardingForBrand</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-ProgressRow.html">ProgressRow</a></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#.fetchMethodV2IntroVideo">fetchMethodV2IntroVideo</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodV2Structure">fetchMethodV2Structure</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#.getUserSignature">getUserSignature</a></li><li data-type='method'><a href="module-UserManagement.html#.isUsernameAvailable">isUsernameAvailable</a></li><li data-type='method'><a href="module-UserManagement.html#.setUserSignature">setUserSignature</a></li><li data-type='method'><a href="module-UserManagement.html#.toggleSignaturePrivate">toggleSignaturePrivate</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#~restorePurchases">restorePurchases</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>Interfaces</h3><ul><li><a href="TestUser.html">TestUser</a></li></ul><h3>Global</h3><ul><li><a href="global.html#createTestUser">createTestUser</a></li></ul>
|
|
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#~deleteAccount">deleteAccount</a></li><li data-type='method'><a href="module-Accounts.html#~numberOfActiveUsers">numberOfActiveUsers</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><li data-type='method'><a href="module-Accounts.html#~toggleStudentView">toggleStudentView</a></li></ul></li><li><a href="module-Artist.html">Artist</a><ul class='methods'><li data-type='method'><a href="module-Artist.html#~fetchArtistBySlug">fetchArtistBySlug</a></li><li data-type='method'><a href="module-Artist.html#~fetchArtistLessons">fetchArtistLessons</a></li><li data-type='method'><a href="module-Artist.html#~fetchArtists">fetchArtists</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#.getLegacyMethods">getLegacyMethods</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#.getOwnedContent">getOwnedContent</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-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#~deleteForumCategory">deleteForumCategory</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#~jumpToPost">jumpToPost</a></li><li data-type='method'><a href="module-Forums.html#~likePost">likePost</a></li><li data-type='method'><a href="module-Forums.html#~lockThread">lockThread</a></li><li data-type='method'><a href="module-Forums.html#~markThreadAsRead">markThreadAsRead</a></li><li data-type='method'><a href="module-Forums.html#~pinThread">pinThread</a></li><li data-type='method'><a href="module-Forums.html#~search">search</a></li><li data-type='method'><a href="module-Forums.html#~unfollowThread">unfollowThread</a></li><li data-type='method'><a href="module-Forums.html#~unlikePost">unlikePost</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#~updatePost">updatePost</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-Genre.html">Genre</a><ul class='methods'><li data-type='method'><a href="module-Genre.html#~fetchGenreBySlug">fetchGenreBySlug</a></li><li data-type='method'><a href="module-Genre.html#~fetchGenreLessons">fetchGenreLessons</a></li><li data-type='method'><a href="module-Genre.html#~fetchGenres">fetchGenres</a></li></ul></li><li><a href="module-GuidedCourses.html">GuidedCourses</a></li><li><a href="module-Instructor.html">Instructor</a><ul class='methods'><li data-type='method'><a href="module-Instructor.html#~fetchInstructorBySlug">fetchInstructorBySlug</a></li><li data-type='method'><a href="module-Instructor.html#~fetchInstructorLessons">fetchInstructorLessons</a></li><li data-type='method'><a href="module-Instructor.html#~fetchInstructors">fetchInstructors</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-LearningPaths.html">LearningPaths</a><ul class='methods'><li data-type='method'><a href="module-LearningPaths.html#~completeLearningPathIntroVideo">completeLearningPathIntroVideo</a></li><li data-type='method'><a href="module-LearningPaths.html#~completeMethodIntroVideo">completeMethodIntroVideo</a></li><li data-type='method'><a href="module-LearningPaths.html#~fetchLearningPathLessons">fetchLearningPathLessons</a></li><li data-type='method'><a href="module-LearningPaths.html#~fetchLearningPathProgressCheckLessons">fetchLearningPathProgressCheckLessons</a></li><li data-type='method'><a href="module-LearningPaths.html#~getActivePath">getActivePath</a></li><li data-type='method'><a href="module-LearningPaths.html#~getDailySession">getDailySession</a></li><li data-type='method'><a href="module-LearningPaths.html#~getEnrichedLearningPath">getEnrichedLearningPath</a></li><li data-type='method'><a href="module-LearningPaths.html#~getLearningPathLessonsByIds">getLearningPathLessonsByIds</a></li><li data-type='method'><a href="module-LearningPaths.html#~mapContentToParent">mapContentToParent</a></li><li data-type='method'><a href="module-LearningPaths.html#~resetAllLearningPaths">resetAllLearningPaths</a></li><li data-type='method'><a href="module-LearningPaths.html#~startLearningPath">startLearningPath</a></li><li data-type='method'><a href="module-LearningPaths.html#~updateDailySession">updateDailySession</a></li></ul></li><li><a href="module-Onboarding.html">Onboarding</a><ul class='methods'><li data-type='method'><a href="module-Onboarding.html#~getOnboardingRecommendedContent">getOnboardingRecommendedContent</a></li><li data-type='method'><a href="module-Onboarding.html#~startOnboarding">startOnboarding</a></li><li data-type='method'><a href="module-Onboarding.html#~updateOnboarding">updateOnboarding</a></li><li data-type='method'><a href="module-Onboarding.html#~userOnboardingForBrand">userOnboardingForBrand</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-ProgressRow.html">ProgressRow</a></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#.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#.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#.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#.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#.fetchMethodV2IntroVideo">fetchMethodV2IntroVideo</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodV2Structure">fetchMethodV2Structure</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodV2StructureFromId">fetchMethodV2StructureFromId</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#.fetchOwnedContent">fetchOwnedContent</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#.fetchTopLevelParentId">fetchTopLevelParentId</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#.getUserSignature">getUserSignature</a></li><li data-type='method'><a href="module-UserManagement.html#.isUsernameAvailable">isUsernameAvailable</a></li><li data-type='method'><a href="module-UserManagement.html#.setUserSignature">setUserSignature</a></li><li data-type='method'><a href="module-UserManagement.html#.toggleSignaturePrivate">toggleSignaturePrivate</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#~restorePurchases">restorePurchases</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>Interfaces</h3><ul><li><a href="TestUser.html">TestUser</a></li></ul><h3>Global</h3><ul><li><a href="global.html#createTestUser">createTestUser</a></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -69,19 +69,16 @@ import {
|
|
|
69
69
|
SONG_TYPES,
|
|
70
70
|
SONG_TYPES_WITH_CHILDREN,
|
|
71
71
|
} from '../contentTypeConfig.js'
|
|
72
|
-
import {fetchSimilarItems, recommendations} from './recommendations.js'
|
|
72
|
+
import { fetchSimilarItems, recommendations } from './recommendations.js'
|
|
73
73
|
import { processMetadata, typeWithSortOrder } from '../contentMetaData.js'
|
|
74
74
|
|
|
75
75
|
import { globalConfig } from './config.js'
|
|
76
76
|
|
|
77
|
-
import {
|
|
78
|
-
fetchNextContentDataForParent,
|
|
79
|
-
fetchHandler,
|
|
80
|
-
} from './railcontent.js'
|
|
77
|
+
import { fetchNextContentDataForParent, fetchHandler } from './railcontent.js'
|
|
81
78
|
import { arrayToStringRepresentation, FilterBuilder } from '../filterBuilder.js'
|
|
82
|
-
import {
|
|
79
|
+
import { getPermissionsAdapter } from './permissions/index.ts'
|
|
83
80
|
import { getAllCompleted, getAllStarted, getAllStartedOrCompleted } from './contentProgress.js'
|
|
84
|
-
import {fetchRecentActivitiesActiveTabs} from
|
|
81
|
+
import { fetchRecentActivitiesActiveTabs } from './userActivity.js'
|
|
85
82
|
|
|
86
83
|
/**
|
|
87
84
|
* Exported functions that are excluded from index generation.
|
|
@@ -209,30 +206,6 @@ function getQueryFromPage(pageNumber, contentPerPage) {
|
|
|
209
206
|
return result
|
|
210
207
|
}
|
|
211
208
|
|
|
212
|
-
/**
|
|
213
|
-
* Fetch all artists with lessons available for a specific brand.
|
|
214
|
-
*
|
|
215
|
-
* @param {string} brand - The brand for which to fetch artists.
|
|
216
|
-
* @returns {Promise<Object|null>} - A promise that resolves to an array of artist objects or null if not found.
|
|
217
|
-
*
|
|
218
|
-
* @example
|
|
219
|
-
* fetchArtists('drumeo')
|
|
220
|
-
* .then(artists => console.log(artists))
|
|
221
|
-
* .catch(error => console.error(error));
|
|
222
|
-
*/
|
|
223
|
-
export async function fetchArtists(brand) {
|
|
224
|
-
const filter = await new FilterBuilder(
|
|
225
|
-
`_type == "song" && brand == "${brand}" && references(^._id)`,
|
|
226
|
-
{ bypassPermissions: true }
|
|
227
|
-
).buildFilter()
|
|
228
|
-
const query = `
|
|
229
|
-
*[_type == "artist"]{
|
|
230
|
-
name,
|
|
231
|
-
"lessonsCount": count(*[${filter}])
|
|
232
|
-
}[lessonsCount > 0] |order(lower(name)) `
|
|
233
|
-
return fetchSanity(query, true, { processNeedAccess: false })
|
|
234
|
-
}
|
|
235
|
-
|
|
236
209
|
/**
|
|
237
210
|
* Fetch current number of artists for songs within a brand.
|
|
238
211
|
* @param {string} brand - The current brand.
|
|
@@ -382,7 +355,7 @@ export async function fetchNewReleases(
|
|
|
382
355
|
web_url_path,
|
|
383
356
|
"permission_id": permission[]->railcontent_id,
|
|
384
357
|
`
|
|
385
|
-
const query = buildRawQuery(filter, fields, {sortOrder: sortOrder, start, end: end})
|
|
358
|
+
const query = buildRawQuery(filter, fields, { sortOrder: sortOrder, start, end: end })
|
|
386
359
|
return fetchSanity(query, true)
|
|
387
360
|
}
|
|
388
361
|
|
|
@@ -523,17 +496,26 @@ export async function fetchByRailContentId(id, contentType) {
|
|
|
523
496
|
* .then(contents => console.log(contents))
|
|
524
497
|
* .catch(error => console.error(error));
|
|
525
498
|
*/
|
|
526
|
-
export async function fetchByRailContentIds(
|
|
499
|
+
export async function fetchByRailContentIds(
|
|
500
|
+
ids,
|
|
501
|
+
contentType = undefined,
|
|
502
|
+
brand = undefined,
|
|
503
|
+
includePermissionsAndStatusFilter = false
|
|
504
|
+
) {
|
|
527
505
|
if (!ids?.length) {
|
|
528
506
|
return []
|
|
529
507
|
}
|
|
530
|
-
ids = [...new Set(ids.filter(item => item !== null && item !== undefined))]
|
|
508
|
+
ids = [...new Set(ids.filter((item) => item !== null && item !== undefined))]
|
|
531
509
|
const idsString = ids.join(',')
|
|
532
510
|
const brandFilter = brand ? ` && brand == "${brand}"` : ''
|
|
533
|
-
const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`, {
|
|
511
|
+
const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`, {
|
|
512
|
+
pullFutureContent: true,
|
|
513
|
+
}).buildFilter()
|
|
534
514
|
const fields = await getFieldsForContentTypeWithFilteredChildren(contentType, true)
|
|
535
515
|
const baseFilter = `railcontent_id in [${idsString}]${brandFilter}`
|
|
536
|
-
const finalFilter = includePermissionsAndStatusFilter
|
|
516
|
+
const finalFilter = includePermissionsAndStatusFilter
|
|
517
|
+
? await new FilterBuilder(baseFilter).buildFilter()
|
|
518
|
+
: baseFilter
|
|
537
519
|
const query = `*[
|
|
538
520
|
${finalFilter}
|
|
539
521
|
]{
|
|
@@ -543,22 +525,22 @@ export async function fetchByRailContentIds(ids, contentType = undefined, brand
|
|
|
543
525
|
live_event_end_time,
|
|
544
526
|
}`
|
|
545
527
|
|
|
546
|
-
console.log('ids query', query)
|
|
547
528
|
const customPostProcess = (results) => {
|
|
548
|
-
const now = getSanityDate(new Date(), false)
|
|
529
|
+
const now = getSanityDate(new Date(), false)
|
|
549
530
|
const liveProcess = (result) => {
|
|
550
531
|
if (result.live_event_start_time && result.live_event_end_time) {
|
|
551
|
-
result.isLive =
|
|
552
|
-
result.live_event_start_time <= now &&
|
|
553
|
-
result.live_event_end_time >= now;
|
|
532
|
+
result.isLive = result.live_event_start_time <= now && result.live_event_end_time >= now
|
|
554
533
|
} else {
|
|
555
|
-
result.isLive = false
|
|
534
|
+
result.isLive = false
|
|
556
535
|
}
|
|
557
|
-
return result
|
|
558
|
-
}
|
|
559
|
-
return results.map(liveProcess)
|
|
536
|
+
return result
|
|
537
|
+
}
|
|
538
|
+
return results.map(liveProcess)
|
|
560
539
|
}
|
|
561
|
-
const results = await fetchSanity(query, true, {
|
|
540
|
+
const results = await fetchSanity(query, true, {
|
|
541
|
+
customPostProcess: customPostProcess,
|
|
542
|
+
processNeedAccess: true,
|
|
543
|
+
})
|
|
562
544
|
|
|
563
545
|
const sortFuction = function compare(a, b) {
|
|
564
546
|
const indexA = ids.indexOf(a['id'])
|
|
@@ -574,13 +556,18 @@ export async function fetchByRailContentIds(ids, contentType = undefined, brand
|
|
|
574
556
|
return sortedResults
|
|
575
557
|
}
|
|
576
558
|
|
|
577
|
-
export async function fetchContentRows(brand, pageName, contentRowSlug)
|
|
578
|
-
{
|
|
559
|
+
export async function fetchContentRows(brand, pageName, contentRowSlug) {
|
|
579
560
|
if (pageName === 'lessons') pageName = 'lesson'
|
|
580
561
|
if (pageName === 'songs') pageName = 'song'
|
|
581
562
|
const rowString = contentRowSlug ? ` && slug.current == "${contentRowSlug.toLowerCase()}"` : ''
|
|
582
|
-
const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`, {
|
|
583
|
-
|
|
563
|
+
const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`, {
|
|
564
|
+
pullFutureContent: true,
|
|
565
|
+
showMembershipRestrictedContent: true,
|
|
566
|
+
}).buildFilter()
|
|
567
|
+
const childFilter = await new FilterBuilder('', {
|
|
568
|
+
isChildrenFilter: true,
|
|
569
|
+
showMembershipRestrictedContent: true,
|
|
570
|
+
}).buildFilter()
|
|
584
571
|
const query = `*[_type == 'recommended-content-row' && brand == '${brand}' && type == '${pageName}'${rowString}]{
|
|
585
572
|
brand,
|
|
586
573
|
name,
|
|
@@ -593,11 +580,9 @@ export async function fetchContentRows(brand, pageName, contentRowSlug)
|
|
|
593
580
|
'lesson_count': coalesce(count(*[${lessonCountFilter}]), 0),
|
|
594
581
|
},
|
|
595
582
|
}`
|
|
596
|
-
return fetchSanity(query, true)
|
|
583
|
+
return fetchSanity(query, true, { processNeedAccess: true })
|
|
597
584
|
}
|
|
598
585
|
|
|
599
|
-
|
|
600
|
-
|
|
601
586
|
/**
|
|
602
587
|
* Fetch all content for a specific brand and type with pagination, search, and grouping options.
|
|
603
588
|
* @param {string} brand - The brand for which to fetch content.
|
|
@@ -666,9 +651,7 @@ export async function fetchAll(
|
|
|
666
651
|
} else if (type === 'pack') {
|
|
667
652
|
typeFilter = `&& (_type == 'pack' || _type == 'semester-pack')`
|
|
668
653
|
} else {
|
|
669
|
-
typeFilter = type
|
|
670
|
-
? `&& _type == '${type}'`
|
|
671
|
-
: ''
|
|
654
|
+
typeFilter = type ? `&& _type == '${type}'` : ''
|
|
672
655
|
}
|
|
673
656
|
|
|
674
657
|
// Construct the search filter
|
|
@@ -787,7 +770,7 @@ async function getProgressFilter(progress, progressIds) {
|
|
|
787
770
|
return `&& (railcontent_id in [${ids.join(',')}])`
|
|
788
771
|
}
|
|
789
772
|
case 'incomplete': {
|
|
790
|
-
const ids = progressIds !== undefined ? progressIds :await getAllStarted()
|
|
773
|
+
const ids = progressIds !== undefined ? progressIds : await getAllStarted()
|
|
791
774
|
return `&& railcontent_id in [${ids.join(',')}]`
|
|
792
775
|
}
|
|
793
776
|
default:
|
|
@@ -886,7 +869,9 @@ export async function fetchAllFilterOptions(
|
|
|
886
869
|
|
|
887
870
|
const includedFieldsFilter = filters?.length ? filtersToGroq(filters) : undefined
|
|
888
871
|
const progressFilter = progressIds ? `&& railcontent_id in [${progressIds.join(',')}]` : ''
|
|
889
|
-
const
|
|
872
|
+
const adapter = getPermissionsAdapter()
|
|
873
|
+
const userPermissionsData = await adapter.fetchUserPermissions()
|
|
874
|
+
const isAdmin = adapter.isAdmin(userPermissionsData)
|
|
890
875
|
|
|
891
876
|
const constructCommonFilter = (excludeFilter) => {
|
|
892
877
|
const filterWithoutOption = excludeFilter
|
|
@@ -925,6 +910,7 @@ export async function fetchAllFilterOptions(
|
|
|
925
910
|
return includeTabs ? { ...results, tabs, catalogName } : results
|
|
926
911
|
}
|
|
927
912
|
|
|
913
|
+
//Daniel Nov 14 2025 note - keeping this for when we migrate foundations to packs, so we know what fields to use.
|
|
928
914
|
/**
|
|
929
915
|
* Fetch the Foundations 2019.
|
|
930
916
|
* @param {string} slug - The slug of the method.
|
|
@@ -950,6 +936,7 @@ export async function fetchFoundation(slug) {
|
|
|
950
936
|
* @param {string} slug - The slug of the method.
|
|
951
937
|
* @returns {Promise<Object|null>} - The fetched methods data or null if not found.
|
|
952
938
|
*/
|
|
939
|
+
//todo BEH-1446 depreciated. remove all old method functions
|
|
953
940
|
export async function fetchMethod(brand, slug) {
|
|
954
941
|
const childrenFilter = await new FilterBuilder(``, { isChildrenFilter: true }).buildFilter()
|
|
955
942
|
|
|
@@ -1153,7 +1140,11 @@ export async function jumpToContinueContent(railcontentId) {
|
|
|
1153
1140
|
* .catch(error => console.error(error));
|
|
1154
1141
|
*/
|
|
1155
1142
|
export async function fetchLessonContent(railContentId, { addParent = false } = {}) {
|
|
1156
|
-
const filterParams = {
|
|
1143
|
+
const filterParams = {
|
|
1144
|
+
isSingle: true,
|
|
1145
|
+
pullFutureContent: true,
|
|
1146
|
+
showMembershipRestrictedContent: true,
|
|
1147
|
+
}
|
|
1157
1148
|
|
|
1158
1149
|
const parentQuery = addParent
|
|
1159
1150
|
? `"parent_content_data": *[railcontent_id in [...(^.parent_content_data[].id)]]{
|
|
@@ -1214,7 +1205,7 @@ export async function fetchLessonContent(railContentId, { addParent = false } =
|
|
|
1214
1205
|
return result
|
|
1215
1206
|
}
|
|
1216
1207
|
|
|
1217
|
-
return fetchSanity(query, false, { customPostProcess: chapterProcess })
|
|
1208
|
+
return fetchSanity(query, false, { customPostProcess: chapterProcess, processNeedAccess: true })
|
|
1218
1209
|
}
|
|
1219
1210
|
|
|
1220
1211
|
/**
|
|
@@ -1293,7 +1284,7 @@ async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, cou
|
|
|
1293
1284
|
*[${filterSongTypesWithSameLicense}]->{${queryFields}}|order(published_on desc, title asc)[0...${count}],
|
|
1294
1285
|
}[0...1]`
|
|
1295
1286
|
const results = await fetchSanity(query, false)
|
|
1296
|
-
return results ? results['related_by_license'] ?? [] : []
|
|
1287
|
+
return results ? (results['related_by_license'] ?? []) : []
|
|
1297
1288
|
}
|
|
1298
1289
|
|
|
1299
1290
|
/**
|
|
@@ -1302,17 +1293,24 @@ async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, cou
|
|
|
1302
1293
|
* @param {string} brand - The current brand.
|
|
1303
1294
|
* @returns {Promise<Array<Object>|null>} - The fetched related lessons data or null if not found.
|
|
1304
1295
|
*/
|
|
1305
|
-
export async function fetchSiblingContent(railContentId, brand= null)
|
|
1306
|
-
{
|
|
1296
|
+
export async function fetchSiblingContent(railContentId, brand = null) {
|
|
1307
1297
|
const filterGetParent = await new FilterBuilder(`references(^._id) && _type == ^.parent_type`, {
|
|
1308
|
-
pullFutureContent: true
|
|
1309
|
-
}).buildFilter()
|
|
1310
|
-
const filterForParentList = await new FilterBuilder(`references(^._id) && _type == ^.parent_type`, {
|
|
1311
1298
|
pullFutureContent: true,
|
|
1312
|
-
|
|
1299
|
+
showMembershipRestrictedContent: true, // Show parent even without permissions
|
|
1313
1300
|
}).buildFilter()
|
|
1301
|
+
const filterForParentList = await new FilterBuilder(
|
|
1302
|
+
`references(^._id) && _type == ^.parent_type`,
|
|
1303
|
+
{
|
|
1304
|
+
pullFutureContent: true,
|
|
1305
|
+
isParentFilter: true,
|
|
1306
|
+
showMembershipRestrictedContent: true, // Show parent even without permissions
|
|
1307
|
+
}
|
|
1308
|
+
).buildFilter()
|
|
1314
1309
|
|
|
1315
|
-
const childrenFilter = await new FilterBuilder(``, {
|
|
1310
|
+
const childrenFilter = await new FilterBuilder(``, {
|
|
1311
|
+
isChildrenFilter: true,
|
|
1312
|
+
showMembershipRestrictedContent: true, // Show all lessons in sidebar, need_access applied on individual page
|
|
1313
|
+
}).buildFilter()
|
|
1316
1314
|
|
|
1317
1315
|
const brandString = brand ? ` && brand == "${brand}"` : ''
|
|
1318
1316
|
const queryFields = `_id, "id":railcontent_id, published_on, "instructor": instructor[0]->name, title, "thumbnail":thumbnail.asset->url, length_in_seconds, status, "type": _type, difficulty, difficulty_string, artist->, "permission_id": permission[]->railcontent_id, "genre": genre[]->name, "parent_id": parent_content_data[0].id`
|
|
@@ -1326,7 +1324,7 @@ export async function fetchSiblingContent(railContentId, brand= null)
|
|
|
1326
1324
|
"related_lessons" : *[${filterGetParent}][0].child[${childrenFilter}]->{${queryFields}}
|
|
1327
1325
|
}`
|
|
1328
1326
|
|
|
1329
|
-
let result = await fetchSanity(query, false)
|
|
1327
|
+
let result = await fetchSanity(query, false, { processNeedAccess: true })
|
|
1330
1328
|
|
|
1331
1329
|
//there's no way in sanity to retrieve the index of an array, so we must calculate after fetch
|
|
1332
1330
|
if (result['for-calculations'] && result['for-calculations']['parents-list']) {
|
|
@@ -1350,15 +1348,16 @@ export async function fetchSiblingContent(railContentId, brand= null)
|
|
|
1350
1348
|
* @param {string} railContentId - The RailContent ID of the current lesson.
|
|
1351
1349
|
* @returns {Promise<Array<Object>|null>} - The fetched related lessons data or null if not found.
|
|
1352
1350
|
*/
|
|
1353
|
-
export async function fetchRelatedLessons(railContentId)
|
|
1354
|
-
{
|
|
1351
|
+
export async function fetchRelatedLessons(railContentId) {
|
|
1355
1352
|
const defaultFilterFields = `_type==^._type && brand == ^.brand && railcontent_id != ${railContentId}`
|
|
1356
1353
|
|
|
1357
1354
|
const filterSameArtist = await new FilterBuilder(
|
|
1358
|
-
`${defaultFilterFields} && references(^.artist->_id)
|
|
1355
|
+
`${defaultFilterFields} && references(^.artist->_id)`,
|
|
1356
|
+
{ showMembershipRestrictedContent: true }
|
|
1359
1357
|
).buildFilter()
|
|
1360
1358
|
const filterSameGenre = await new FilterBuilder(
|
|
1361
|
-
`${defaultFilterFields} && references(^.genre[]->_id)
|
|
1359
|
+
`${defaultFilterFields} && references(^.genre[]->_id)`,
|
|
1360
|
+
{ showMembershipRestrictedContent: true }
|
|
1362
1361
|
).buildFilter()
|
|
1363
1362
|
|
|
1364
1363
|
const queryFields = `_id, "id":railcontent_id, published_on, "instructor": instructor[0]->name, title, "thumbnail":thumbnail.asset->url, length_in_seconds, status, "type": _type, difficulty, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type, "genre": genre[]->name`
|
|
@@ -1370,7 +1369,7 @@ export async function fetchRelatedLessons(railContentId)
|
|
|
1370
1369
|
...(*[${filterSameGenre}]{${queryFields}}|order(published_on desc, title asc)[0...10]),
|
|
1371
1370
|
])[0...10]}`
|
|
1372
1371
|
|
|
1373
|
-
return await fetchSanity(query, false)
|
|
1372
|
+
return await fetchSanity(query, false, { processNeedAccess: true })
|
|
1374
1373
|
}
|
|
1375
1374
|
|
|
1376
1375
|
/**
|
|
@@ -1395,11 +1394,16 @@ export async function fetchAllPacks(
|
|
|
1395
1394
|
const start = (page - 1) * limit
|
|
1396
1395
|
const end = start + limit
|
|
1397
1396
|
|
|
1398
|
-
const query = await buildQuery(
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1397
|
+
const query = await buildQuery(
|
|
1398
|
+
filter,
|
|
1399
|
+
filterParams,
|
|
1400
|
+
await getFieldsForContentTypeWithFilteredChildren('pack'),
|
|
1401
|
+
{
|
|
1402
|
+
sortOrder: sortOrder,
|
|
1403
|
+
start,
|
|
1404
|
+
end,
|
|
1405
|
+
}
|
|
1406
|
+
)
|
|
1403
1407
|
return fetchSanity(query, true)
|
|
1404
1408
|
}
|
|
1405
1409
|
|
|
@@ -1505,45 +1509,6 @@ export async function fetchPackData(id) {
|
|
|
1505
1509
|
return fetchSanity(query, false)
|
|
1506
1510
|
}
|
|
1507
1511
|
|
|
1508
|
-
/**
|
|
1509
|
-
* Fetch the data needed for the coach screen.
|
|
1510
|
-
* @param {string} brand - The brand for which to fetch coach lessons
|
|
1511
|
-
* @param {string} id - The Railcontent ID of the coach
|
|
1512
|
-
* @returns {Promise<Object|null>} - The lessons for the instructor or null if not found.
|
|
1513
|
-
* @param {Object} params - Parameters for pagination, filtering and sorting.
|
|
1514
|
-
* @param {string} [params.sortOrder="-published_on"] - The field to sort the lessons by.
|
|
1515
|
-
* @param {string} [params.searchTerm=""] - The search term to filter content by title.
|
|
1516
|
-
* @param {number} [params.page=1] - The page number for pagination.
|
|
1517
|
-
* @param {number} [params.limit=10] - The number of items per page.
|
|
1518
|
-
* @param {Array<string>} [params.includedFields=[]] - Additional filters to apply to the query in the format of a key,value array. eg. ['difficulty,Intermediate', 'genre,rock'].
|
|
1519
|
-
*
|
|
1520
|
-
* @example
|
|
1521
|
-
* fetchCoachLessons('coach123')
|
|
1522
|
-
* .then(lessons => console.log(lessons))
|
|
1523
|
-
* .catch(error => console.error(error));
|
|
1524
|
-
*/
|
|
1525
|
-
export async function fetchCoachLessons(
|
|
1526
|
-
brand,
|
|
1527
|
-
id,
|
|
1528
|
-
{ sortOrder = '-published_on', searchTerm = '', page = 1, limit = 20, includedFields = [] } = {}
|
|
1529
|
-
) {
|
|
1530
|
-
const fieldsString = getFieldsForContentType()
|
|
1531
|
-
const start = (page - 1) * limit
|
|
1532
|
-
const end = start + limit
|
|
1533
|
-
const searchFilter = searchTerm ? `&& title match "${searchTerm}*"` : ''
|
|
1534
|
-
const includedFieldsFilter = includedFields.length > 0 ? filtersToGroq(includedFields) : ''
|
|
1535
|
-
const filter = `brand == '${brand}' ${searchFilter} ${includedFieldsFilter} && references(*[_type=='instructor' && railcontent_id == ${id}]._id)`
|
|
1536
|
-
const filterWithRestrictions = await new FilterBuilder(filter).buildFilter()
|
|
1537
|
-
|
|
1538
|
-
sortOrder = getSortOrder(sortOrder, brand)
|
|
1539
|
-
const query = buildEntityAndTotalQuery(filterWithRestrictions, fieldsString, {
|
|
1540
|
-
sortOrder: sortOrder,
|
|
1541
|
-
start: start,
|
|
1542
|
-
end: end,
|
|
1543
|
-
})
|
|
1544
|
-
return fetchSanity(query, true)
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
1512
|
/**
|
|
1548
1513
|
* Fetch the data needed for the coach screen.
|
|
1549
1514
|
* @param {string} id - The Railcontent ID of the coach
|
|
@@ -1576,149 +1541,33 @@ export async function fetchByReference(
|
|
|
1576
1541
|
}
|
|
1577
1542
|
|
|
1578
1543
|
/**
|
|
1579
|
-
* Fetch the artist's lessons.
|
|
1580
|
-
* @param {string} brand - The brand for which to fetch lessons.
|
|
1581
|
-
* @param {string} name - The name of the artist
|
|
1582
|
-
* @param {string} contentType - The type of the lessons we need to get from the artist. If not defined, groq will get lessons from all content types
|
|
1583
|
-
* @param {Object} params - Parameters for sorting, searching, pagination and filtering.
|
|
1584
|
-
* @param {string} [params.sort="-published_on"] - The field to sort the lessons by.
|
|
1585
|
-
* @param {string} [params.searchTerm=""] - The search term to filter the lessons.
|
|
1586
|
-
* @param {number} [params.page=1] - The page number for pagination.
|
|
1587
|
-
* @param {number} [params.limit=10] - The number of items per page.
|
|
1588
|
-
* @param {Array<string>} [params.includedFields=[]] - Additional filters to apply to the query in the format of a key,value array. eg. ['difficulty,Intermediate', 'genre,rock'].
|
|
1589
|
-
* @param {Array<number>} [params.progressIds] - The ids of the lessons that are in progress or completed
|
|
1590
|
-
* @returns {Promise<Object|null>} - The lessons for the artist and some details about the artist (name and thumbnail).
|
|
1591
1544
|
*
|
|
1592
|
-
*
|
|
1593
|
-
*
|
|
1594
|
-
*
|
|
1595
|
-
* .catch(error => console.error(error));
|
|
1596
|
-
*/
|
|
1597
|
-
export async function fetchArtistLessons(
|
|
1598
|
-
brand,
|
|
1599
|
-
name,
|
|
1600
|
-
contentType,
|
|
1601
|
-
{
|
|
1602
|
-
sort = '-published_on',
|
|
1603
|
-
searchTerm = '',
|
|
1604
|
-
page = 1,
|
|
1605
|
-
limit = 10,
|
|
1606
|
-
includedFields = [],
|
|
1607
|
-
progressIds = undefined,
|
|
1608
|
-
} = {}
|
|
1609
|
-
) {
|
|
1610
|
-
const fieldsString = DEFAULT_FIELDS.join(',')
|
|
1611
|
-
const start = (page - 1) * limit
|
|
1612
|
-
const end = start + limit
|
|
1613
|
-
const searchFilter = searchTerm ? `&& title match "${searchTerm}*"` : ''
|
|
1614
|
-
const sortOrder = getSortOrder(sort, brand)
|
|
1615
|
-
const addType =
|
|
1616
|
-
contentType && Array.isArray(contentType)
|
|
1617
|
-
? `_type in ['${contentType.join("', '")}'] &&`
|
|
1618
|
-
: contentType
|
|
1619
|
-
? `_type == '${contentType}' && `
|
|
1620
|
-
: ''
|
|
1621
|
-
const includedFieldsFilter = includedFields.length > 0 ? filtersToGroq(includedFields) : ''
|
|
1622
|
-
|
|
1623
|
-
// limits the results to supplied progressIds for started & completed filters
|
|
1624
|
-
const progressFilter =
|
|
1625
|
-
progressIds !== undefined ? `&& railcontent_id in [${progressIds.join(',')}]` : ''
|
|
1626
|
-
const now = getSanityDate(new Date())
|
|
1627
|
-
const query = `{
|
|
1628
|
-
"entity":
|
|
1629
|
-
*[_type == 'artist' && name == '${name}']
|
|
1630
|
-
{'type': _type, name, 'thumbnail':thumbnail_url.asset->url,
|
|
1631
|
-
'lessons_count': count(*[${addType} brand == '${brand}' && references(^._id)]),
|
|
1632
|
-
'lessons': *[${addType} brand == '${brand}' && references(^._id) && (status in ['published'] || (status == 'scheduled' && defined(published_on) && published_on >= '${now}')) ${searchFilter} ${includedFieldsFilter} ${progressFilter}]{${fieldsString}}
|
|
1633
|
-
[${start}...${end}]}
|
|
1634
|
-
|order(${sortOrder})f
|
|
1635
|
-
}`
|
|
1636
|
-
return fetchSanity(query, true)
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
/**
|
|
1640
|
-
* Fetch the genre's lessons.
|
|
1641
|
-
* @param {string} brand - The brand for which to fetch lessons.
|
|
1642
|
-
* @param {string} name - The name of the genre
|
|
1643
|
-
* @param {Object} params - Parameters for sorting, searching, pagination and filtering.
|
|
1644
|
-
* @param {string} [params.sort="-published_on"] - The field to sort the lessons by.
|
|
1645
|
-
* @param {string} [params.searchTerm=""] - The search term to filter the lessons.
|
|
1646
|
-
* @param {number} [params.page=1] - The page number for pagination.
|
|
1647
|
-
* @param {number} [params.limit=10] - The number of items per page.
|
|
1648
|
-
* @param {Array<string>} [params.includedFields=[]] - Additional filters to apply to the query in the format of a key,value array. eg. ['difficulty,Intermediate', 'genre,rock'].
|
|
1649
|
-
* @param {Array<number>} [params.progressIds] - The ids of the lessons that are in progress or completed
|
|
1650
|
-
* @returns {Promise<Object|null>} - The lessons for the artist and some details about the artist (name and thumbnail).
|
|
1545
|
+
* Return the top level parent content railcontent_id.
|
|
1546
|
+
* Ignores learning-path-v2 parents.
|
|
1547
|
+
* ex: if railcontentId is of type 'skill-pack-lesson', return the corresponding 'skill-pack' railcontent_id
|
|
1651
1548
|
*
|
|
1652
|
-
* @
|
|
1653
|
-
*
|
|
1654
|
-
* .then(lessons => console.log(lessons))
|
|
1655
|
-
* .catch(error => console.error(error));
|
|
1549
|
+
* @param {int} railcontentId
|
|
1550
|
+
* @returns {Promise<int|null>}
|
|
1656
1551
|
*/
|
|
1657
|
-
export async function fetchGenreLessons(
|
|
1658
|
-
brand,
|
|
1659
|
-
name,
|
|
1660
|
-
contentType,
|
|
1661
|
-
{
|
|
1662
|
-
sort = '-published_on',
|
|
1663
|
-
searchTerm = '',
|
|
1664
|
-
page = 1,
|
|
1665
|
-
limit = 10,
|
|
1666
|
-
includedFields = [],
|
|
1667
|
-
progressIds = undefined,
|
|
1668
|
-
} = {}
|
|
1669
|
-
) {
|
|
1670
|
-
const fieldsString = DEFAULT_FIELDS.join(',')
|
|
1671
|
-
const start = (page - 1) * limit
|
|
1672
|
-
const end = start + limit
|
|
1673
|
-
const searchFilter = searchTerm ? `&& title match "${searchTerm}*"` : ''
|
|
1674
|
-
const sortOrder = getSortOrder(sort, brand)
|
|
1675
|
-
const addType = contentType ? `_type == '${contentType}' && ` : ''
|
|
1676
|
-
const includedFieldsFilter = includedFields.length > 0 ? filtersToGroq(includedFields) : ''
|
|
1677
|
-
// limits the results to supplied progressIds for started & completed filters
|
|
1678
|
-
const progressFilter =
|
|
1679
|
-
progressIds !== undefined ? `&& railcontent_id in [${progressIds.join(',')}]` : ''
|
|
1680
|
-
const now = getSanityDate(new Date())
|
|
1681
|
-
const query = `{
|
|
1682
|
-
"entity":
|
|
1683
|
-
*[_type == 'genre' && name == '${name}']
|
|
1684
|
-
{'type': _type, name, 'thumbnail':thumbnail_url.asset->url,
|
|
1685
|
-
'lessons_count': count(*[${addType} brand == '${brand}' && references(^._id)]),
|
|
1686
|
-
'lessons': *[${addType} brand == '${brand}' && references(^._id) && (status in ['published'] || (status == 'scheduled' && defined(published_on) && published_on >= '${now}')) ${searchFilter} ${includedFieldsFilter} ${progressFilter}]{${fieldsString}}
|
|
1687
|
-
[${start}...${end}]}
|
|
1688
|
-
|order(${sortOrder})
|
|
1689
|
-
}`
|
|
1690
|
-
return fetchSanity(query, true)
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
1552
|
export async function fetchTopLevelParentId(railcontentId) {
|
|
1553
|
+
const parentFilter = "railcontent_id in [...(^.parent_content_data[].id)]"
|
|
1694
1554
|
const statusFilter = "&& status in ['scheduled', 'published', 'archived', 'unlisted']"
|
|
1695
1555
|
|
|
1696
1556
|
const query = `*[railcontent_id == ${railcontentId}]{
|
|
1697
1557
|
railcontent_id,
|
|
1698
|
-
'parents': *[
|
|
1699
|
-
railcontent_id
|
|
1700
|
-
'parents': *[^._id in child[]._ref ${statusFilter}]{
|
|
1701
|
-
railcontent_id,
|
|
1702
|
-
'parents': *[^._id in child[]._ref ${statusFilter}]{
|
|
1703
|
-
railcontent_id,
|
|
1704
|
-
'parents': *[^._id in child[]._ref ${statusFilter}]{
|
|
1705
|
-
railcontent_id,
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1558
|
+
'parents': *[${parentFilter} ${statusFilter}]{
|
|
1559
|
+
railcontent_id
|
|
1709
1560
|
}
|
|
1710
1561
|
}`
|
|
1711
1562
|
let response = await fetchSanity(query, false, { processNeedAccess: false })
|
|
1712
1563
|
if (!response) return null
|
|
1713
|
-
let
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
return currentLevel['railcontent_id']
|
|
1719
|
-
}
|
|
1564
|
+
let parents = response['parents']
|
|
1565
|
+
let parentsLength = parents ? response['parents'].length : 0
|
|
1566
|
+
if (parentsLength > 0) {
|
|
1567
|
+
// return the last parent
|
|
1568
|
+
return parents[parentsLength - 1]['railcontent_id']
|
|
1720
1569
|
}
|
|
1721
|
-
return
|
|
1570
|
+
return response['railcontent_id']
|
|
1722
1571
|
}
|
|
1723
1572
|
|
|
1724
1573
|
export async function fetchHierarchy(railcontentId) {
|
|
@@ -1811,8 +1660,10 @@ export async function fetchCommentModContentData(ids) {
|
|
|
1811
1660
|
*
|
|
1812
1661
|
* @param {string} query - The GROQ query to execute against the Sanity API.
|
|
1813
1662
|
* @param {boolean} isList - Whether to return an array or a single result.
|
|
1814
|
-
* @param {
|
|
1815
|
-
* @param {
|
|
1663
|
+
* @param {Object} options - Additional options for fetching data.
|
|
1664
|
+
* @param {Function} [options.customPostProcess=null] - custom post process callback
|
|
1665
|
+
* @param {boolean} [options.processNeedAccess=true] - execute the needs_access callback
|
|
1666
|
+
* @param {boolean} [options.processPageType=true] - execute the page_type callback
|
|
1816
1667
|
* @returns {Promise<*|null>} - A promise that resolves to the fetched data or null if an error occurs or no results are found.
|
|
1817
1668
|
*
|
|
1818
1669
|
* @example
|
|
@@ -1825,7 +1676,7 @@ export async function fetchCommentModContentData(ids) {
|
|
|
1825
1676
|
export async function fetchSanity(
|
|
1826
1677
|
query,
|
|
1827
1678
|
isList,
|
|
1828
|
-
{ customPostProcess = null, processNeedAccess = true } = {}
|
|
1679
|
+
{ customPostProcess = null, processNeedAccess = true, processPageType = true } = {}
|
|
1829
1680
|
) {
|
|
1830
1681
|
// Check the config object before proceeding
|
|
1831
1682
|
if (!checkSanityConfig(globalConfig)) {
|
|
@@ -1847,13 +1698,13 @@ export async function fetchSanity(
|
|
|
1847
1698
|
body: JSON.stringify({ query: query }),
|
|
1848
1699
|
}
|
|
1849
1700
|
|
|
1701
|
+
const adapter = getPermissionsAdapter()
|
|
1850
1702
|
let promisesResult = await Promise.all([
|
|
1851
1703
|
fetch(url, options),
|
|
1852
|
-
processNeedAccess ? fetchUserPermissions() : null,
|
|
1704
|
+
processNeedAccess ? adapter.fetchUserPermissions() : null,
|
|
1853
1705
|
])
|
|
1854
1706
|
const response = promisesResult[0]
|
|
1855
|
-
const userPermissions = promisesResult[1]
|
|
1856
|
-
const isAdmin = promisesResult[1]?.isAdmin
|
|
1707
|
+
const userPermissions = promisesResult[1]
|
|
1857
1708
|
|
|
1858
1709
|
if (!response.ok) {
|
|
1859
1710
|
throw new Error(`Sanity API error: ${response.status} - ${response.statusText}`)
|
|
@@ -1864,25 +1715,32 @@ export async function fetchSanity(
|
|
|
1864
1715
|
if (!results) {
|
|
1865
1716
|
throw new Error('No results found')
|
|
1866
1717
|
}
|
|
1867
|
-
results = processNeedAccess
|
|
1868
|
-
|
|
1869
|
-
: results
|
|
1870
|
-
results = pageTypeDecorator(results)
|
|
1718
|
+
results = processNeedAccess ? await needsAccessDecorator(results, userPermissions) : results
|
|
1719
|
+
results = processPageType ? pageTypeDecorator(results) : results
|
|
1871
1720
|
return customPostProcess ? customPostProcess(results) : results
|
|
1872
1721
|
} else {
|
|
1873
1722
|
throw new Error('No results found')
|
|
1874
1723
|
}
|
|
1875
1724
|
} catch (error) {
|
|
1876
|
-
console.error('fetchSanity: Fetch error:', {error, query})
|
|
1725
|
+
console.error('fetchSanity: Fetch error:', { error, query })
|
|
1877
1726
|
return null
|
|
1878
1727
|
}
|
|
1879
1728
|
}
|
|
1880
1729
|
|
|
1881
|
-
function contentResultsDecorator(results, fieldName, callback)
|
|
1882
|
-
{
|
|
1730
|
+
function contentResultsDecorator(results, fieldName, callback) {
|
|
1883
1731
|
if (Array.isArray(results)) {
|
|
1884
1732
|
results.forEach((result) => {
|
|
1885
|
-
|
|
1733
|
+
// Check if this is a content row structure
|
|
1734
|
+
if (result.content && Array.isArray(result.content)) {
|
|
1735
|
+
// Content rows structure: array of rows, each with a content array
|
|
1736
|
+
result.content.forEach((contentItem) => {
|
|
1737
|
+
if (contentItem) {
|
|
1738
|
+
contentItem[fieldName] = callback(contentItem)
|
|
1739
|
+
}
|
|
1740
|
+
})
|
|
1741
|
+
} else {
|
|
1742
|
+
result[fieldName] = callback(result)
|
|
1743
|
+
}
|
|
1886
1744
|
})
|
|
1887
1745
|
} else if (results.entity && Array.isArray(results.entity)) {
|
|
1888
1746
|
// Group By
|
|
@@ -1906,32 +1764,25 @@ function contentResultsDecorator(results, fieldName, callback)
|
|
|
1906
1764
|
return results
|
|
1907
1765
|
}
|
|
1908
1766
|
|
|
1909
|
-
function pageTypeDecorator(results)
|
|
1910
|
-
{
|
|
1911
|
-
|
|
1767
|
+
function pageTypeDecorator(results) {
|
|
1768
|
+
return contentResultsDecorator(results, 'page_type', function (content) {
|
|
1769
|
+
return SONG_TYPES_WITH_CHILDREN.includes(content['type']) ? 'song' : 'lesson'
|
|
1770
|
+
})
|
|
1912
1771
|
}
|
|
1913
1772
|
|
|
1914
|
-
|
|
1915
|
-
function needsAccessDecorator(results, userPermissions, isAdmin) {
|
|
1773
|
+
function needsAccessDecorator(results, userPermissions) {
|
|
1916
1774
|
if (globalConfig.sanityConfig.useDummyRailContentMethods) return results
|
|
1917
|
-
|
|
1918
|
-
return contentResultsDecorator(results, 'need_access', function (content) {
|
|
1775
|
+
const adapter = getPermissionsAdapter()
|
|
1776
|
+
return contentResultsDecorator(results, 'need_access', function (content) {
|
|
1777
|
+
return adapter.doesUserNeedAccess(content, userPermissions)
|
|
1778
|
+
})
|
|
1919
1779
|
}
|
|
1920
1780
|
|
|
1921
|
-
function doesUserNeedAccessToContent(result, userPermissions
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
if (permissions.size === 0) {
|
|
1927
|
-
return false
|
|
1928
|
-
}
|
|
1929
|
-
for (let permission of permissions) {
|
|
1930
|
-
if (userPermissions.has(permission)) {
|
|
1931
|
-
return false
|
|
1932
|
-
}
|
|
1933
|
-
}
|
|
1934
|
-
return true
|
|
1781
|
+
function doesUserNeedAccessToContent(result, userPermissions) {
|
|
1782
|
+
// Legacy function - now delegates to adapter
|
|
1783
|
+
// Kept for backwards compatibility if used elsewhere
|
|
1784
|
+
const adapter = getPermissionsAdapter()
|
|
1785
|
+
return adapter.doesUserNeedAccess(result, userPermissions)
|
|
1935
1786
|
}
|
|
1936
1787
|
|
|
1937
1788
|
/**
|
|
@@ -1973,8 +1824,8 @@ export async function fetchShowsData(brand) {
|
|
|
1973
1824
|
* .catch(error => console.error(error));
|
|
1974
1825
|
*/
|
|
1975
1826
|
export async function fetchMetadata(brand, type) {
|
|
1976
|
-
let processedData =
|
|
1977
|
-
if(processedData?.onlyAvailableTabs === true) {
|
|
1827
|
+
let processedData = processMetadata(brand, type, true)
|
|
1828
|
+
if (processedData?.onlyAvailableTabs === true) {
|
|
1978
1829
|
const activeTabs = await fetchRecentActivitiesActiveTabs()
|
|
1979
1830
|
processedData.tabs = activeTabs
|
|
1980
1831
|
}
|
|
@@ -2000,7 +1851,7 @@ function arrayJoinWithQuotes(array, delimiter = ',') {
|
|
|
2000
1851
|
return wrapped.join(delimiter)
|
|
2001
1852
|
}
|
|
2002
1853
|
|
|
2003
|
-
function getSanityDate(date, roundToHourForCaching = true) {
|
|
1854
|
+
export function getSanityDate(date, roundToHourForCaching = true) {
|
|
2004
1855
|
if (roundToHourForCaching) {
|
|
2005
1856
|
// We need to set the published on filter date to be a round time so that it doesn't bypass the query cache
|
|
2006
1857
|
// with every request by changing the filter date every second. I've set it to one minute past the current hour
|
|
@@ -2074,13 +1925,19 @@ async function buildQuery(
|
|
|
2074
1925
|
return buildRawQuery(filter, fields, { sortOrder, start, end, isSingle })
|
|
2075
1926
|
}
|
|
2076
1927
|
|
|
2077
|
-
function buildEntityAndTotalQuery(
|
|
1928
|
+
export function buildEntityAndTotalQuery(
|
|
2078
1929
|
filter = '',
|
|
2079
1930
|
fields = '...',
|
|
2080
|
-
{
|
|
1931
|
+
{
|
|
1932
|
+
sortOrder = 'published_on desc',
|
|
1933
|
+
start = 0,
|
|
1934
|
+
end = 10,
|
|
1935
|
+
isSingle = false,
|
|
1936
|
+
withoutPagination = false,
|
|
1937
|
+
}
|
|
2081
1938
|
) {
|
|
2082
1939
|
const sortString = sortOrder ? ` | order(${sortOrder})` : ''
|
|
2083
|
-
const countString = isSingle ? '[0...1]' :
|
|
1940
|
+
const countString = isSingle ? '[0...1]' : withoutPagination ? `` : `[${start}...${end}]`
|
|
2084
1941
|
const query = `{
|
|
2085
1942
|
"entity": *[${filter}] ${sortString}${countString}
|
|
2086
1943
|
{
|
|
@@ -2197,6 +2054,7 @@ export async function fetchTabData(
|
|
|
2197
2054
|
includedFields = [],
|
|
2198
2055
|
progressIds = undefined,
|
|
2199
2056
|
progress = 'all',
|
|
2057
|
+
showMembershipRestrictedContent = false,
|
|
2200
2058
|
} = {}
|
|
2201
2059
|
) {
|
|
2202
2060
|
const start = (page - 1) * limit
|
|
@@ -2209,22 +2067,22 @@ export async function fetchTabData(
|
|
|
2209
2067
|
|
|
2210
2068
|
switch (progress) {
|
|
2211
2069
|
case 'recent':
|
|
2212
|
-
progressIds = await getAllStartedOrCompleted({ brand, onlyIds: true })
|
|
2213
|
-
sortOrder = null
|
|
2214
|
-
break
|
|
2070
|
+
progressIds = await getAllStartedOrCompleted({ brand, onlyIds: true })
|
|
2071
|
+
sortOrder = null
|
|
2072
|
+
break
|
|
2215
2073
|
case 'incomplete':
|
|
2216
|
-
progressIds = await getAllStarted()
|
|
2217
|
-
sortOrder = null
|
|
2218
|
-
break
|
|
2074
|
+
progressIds = await getAllStarted()
|
|
2075
|
+
sortOrder = null
|
|
2076
|
+
break
|
|
2219
2077
|
case 'completed':
|
|
2220
|
-
progressIds = await getAllCompleted()
|
|
2221
|
-
sortOrder = null
|
|
2222
|
-
break
|
|
2078
|
+
progressIds = await getAllCompleted()
|
|
2079
|
+
sortOrder = null
|
|
2080
|
+
break
|
|
2223
2081
|
}
|
|
2224
2082
|
|
|
2225
2083
|
// limits the results to supplied progressIds for started & completed filters
|
|
2226
2084
|
const progressFilter = await getProgressFilter(progress, progressIds)
|
|
2227
|
-
const fieldsString = getFieldsForContentType('tab-data')
|
|
2085
|
+
const fieldsString = getFieldsForContentType('tab-data')
|
|
2228
2086
|
const now = getSanityDate(new Date())
|
|
2229
2087
|
|
|
2230
2088
|
// Determine the group by clause
|
|
@@ -2233,11 +2091,13 @@ export async function fetchTabData(
|
|
|
2233
2091
|
let filter = ''
|
|
2234
2092
|
|
|
2235
2093
|
filter = `brand == "${brand}" && (defined(railcontent_id)) ${includedFieldsFilter} ${progressFilter}`
|
|
2236
|
-
const childrenFilter = await new FilterBuilder(``, {
|
|
2094
|
+
const childrenFilter = await new FilterBuilder(``, {
|
|
2095
|
+
isChildrenFilter: true,
|
|
2096
|
+
showMembershipRestrictedContent: true,
|
|
2097
|
+
}).buildFilter()
|
|
2237
2098
|
const childrenFields = await getChildFieldsForContentType('tab-data')
|
|
2238
2099
|
const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`).buildFilter()
|
|
2239
|
-
entityFieldsString =
|
|
2240
|
-
` ${fieldsString}
|
|
2100
|
+
entityFieldsString = ` ${fieldsString}
|
|
2241
2101
|
'children': child[${childrenFilter}]->{ ${childrenFields} 'children': child[${childrenFilter}]->{ ${childrenFields} }, },
|
|
2242
2102
|
'isLive': live_event_start_time <= "${now}" && live_event_end_time >= "${now}",
|
|
2243
2103
|
'lesson_count': coalesce(count(*[${lessonCountFilter}]), 0),
|
|
@@ -2249,27 +2109,29 @@ export async function fetchTabData(
|
|
|
2249
2109
|
),
|
|
2250
2110
|
length_in_seconds
|
|
2251
2111
|
),`
|
|
2252
|
-
const filterWithRestrictions = await new FilterBuilder(filter, {
|
|
2112
|
+
const filterWithRestrictions = await new FilterBuilder(filter, {
|
|
2113
|
+
showMembershipRestrictedContent: true,
|
|
2114
|
+
}).buildFilter()
|
|
2253
2115
|
query = buildEntityAndTotalQuery(filterWithRestrictions, entityFieldsString, {
|
|
2254
2116
|
sortOrder: sortOrder,
|
|
2255
2117
|
start: start,
|
|
2256
|
-
end: end
|
|
2118
|
+
end: end,
|
|
2257
2119
|
})
|
|
2258
2120
|
|
|
2259
|
-
let results = await fetchSanity(query, true)
|
|
2121
|
+
let results = await fetchSanity(query, true, { processNeedAccess: true })
|
|
2260
2122
|
|
|
2261
2123
|
if (['recent', 'incomplete', 'completed'].includes(progress) && results.entity.length > 1) {
|
|
2262
2124
|
const orderMap = new Map(progressIds.map((id, index) => [id, index]))
|
|
2263
2125
|
results.entity = results.entity
|
|
2264
2126
|
.sort((a, b) => {
|
|
2265
|
-
const aIdx = orderMap.get(a.id) ?? Number.MAX_SAFE_INTEGER
|
|
2266
|
-
const bIdx = orderMap.get(b.id) ?? Number.MAX_SAFE_INTEGER
|
|
2267
|
-
return aIdx - bIdx || new Date(b.published_on) - new Date(a.published_on)
|
|
2127
|
+
const aIdx = orderMap.get(a.id) ?? Number.MAX_SAFE_INTEGER
|
|
2128
|
+
const bIdx = orderMap.get(b.id) ?? Number.MAX_SAFE_INTEGER
|
|
2129
|
+
return aIdx - bIdx || new Date(b.published_on) - new Date(a.published_on)
|
|
2268
2130
|
})
|
|
2269
|
-
.slice(start, end)
|
|
2131
|
+
.slice(start, end)
|
|
2270
2132
|
}
|
|
2271
2133
|
|
|
2272
|
-
return results
|
|
2134
|
+
return results
|
|
2273
2135
|
}
|
|
2274
2136
|
|
|
2275
2137
|
export async function fetchRecent(
|
|
@@ -2344,12 +2206,12 @@ export async function fetchShows(brand, type, sort = 'sort') {
|
|
|
2344
2206
|
* @returns {Promise<*|null>}
|
|
2345
2207
|
*/
|
|
2346
2208
|
export async function fetchMethodV2IntroVideo(brand) {
|
|
2347
|
-
const type =
|
|
2348
|
-
const filter = `_type == '${type}' && brand == '${brand}'
|
|
2349
|
-
const fields = getIntroVideoFields()
|
|
2209
|
+
const type = 'method-intro'
|
|
2210
|
+
const filter = `_type == '${type}' && brand == '${brand}'`
|
|
2211
|
+
const fields = getIntroVideoFields('method-v2')
|
|
2350
2212
|
|
|
2351
|
-
const query = `*[${filter}] { ${fields.join(
|
|
2352
|
-
return fetchSanity(query, false)
|
|
2213
|
+
const query = `*[${filter}] { ${fields.join(', ')} }`
|
|
2214
|
+
return fetchSanity(query, false)
|
|
2353
2215
|
}
|
|
2354
2216
|
|
|
2355
2217
|
/**
|
|
@@ -2358,16 +2220,81 @@ export async function fetchMethodV2IntroVideo(brand) {
|
|
|
2358
2220
|
* @returns {Promise<*|null>}
|
|
2359
2221
|
*/
|
|
2360
2222
|
export async function fetchMethodV2Structure(brand) {
|
|
2361
|
-
const _type =
|
|
2223
|
+
const _type = 'method-v2'
|
|
2362
2224
|
const query = `*[_type == '${_type}' && brand == '${brand}'][0...1]{
|
|
2363
2225
|
'sanity_id': _id,
|
|
2364
|
-
'
|
|
2226
|
+
'learning_paths': child[]->{
|
|
2365
2227
|
'id': railcontent_id,
|
|
2366
2228
|
'children': child[]->railcontent_id
|
|
2367
2229
|
}
|
|
2368
|
-
}
|
|
2230
|
+
}`
|
|
2231
|
+
return await fetchSanity(query, false)
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
/**
|
|
2235
|
+
* Fetch the structure (just ids) of the Method of a given learning path or learning path lesson.
|
|
2236
|
+
* @param contentId
|
|
2237
|
+
* @returns {Promise<*|null>}
|
|
2238
|
+
*/
|
|
2239
|
+
export async function fetchMethodV2StructureFromId(contentId) {
|
|
2240
|
+
const _type = "method-v2";
|
|
2241
|
+
const query = `*[_type == '${_type}' && brand == *[railcontent_id == ${contentId}][0].brand][0...1]{
|
|
2242
|
+
'sanity_id': _id,
|
|
2243
|
+
'learning_paths': child[]->{
|
|
2244
|
+
'id': railcontent_id,
|
|
2245
|
+
'children': child[]->railcontent_id
|
|
2246
|
+
}
|
|
2247
|
+
}`
|
|
2369
2248
|
return await fetchSanity(query, false);
|
|
2370
2249
|
}
|
|
2250
|
+
|
|
2251
|
+
/**
|
|
2252
|
+
* Fetch content owned by the user (excluding membership content).
|
|
2253
|
+
* Shows only content accessible through purchases/entitlements, not through membership.
|
|
2254
|
+
*
|
|
2255
|
+
* @param {string} brand - The brand to filter content by
|
|
2256
|
+
* @param {Object} options - Fetch options
|
|
2257
|
+
* @param {Array<string>} options.type - Content type(s) to filter (optional array, default: [])
|
|
2258
|
+
* @param {number} options.page - Page number (default: 1)
|
|
2259
|
+
* @param {number} options.limit - Items per page (default: 10)
|
|
2260
|
+
* @param {string} options.sort - Sort field and direction (default: '-published_on')
|
|
2261
|
+
* @returns {Promise<Object>} Object with 'entity' (content array) and 'total' (count)
|
|
2262
|
+
*/
|
|
2263
|
+
export async function fetchOwnedContent(
|
|
2264
|
+
brand,
|
|
2265
|
+
{ type = [], page = 1, limit = 10, sort = '-published_on' } = {}
|
|
2266
|
+
) {
|
|
2267
|
+
const start = (page - 1) * limit
|
|
2268
|
+
const end = start + limit
|
|
2269
|
+
|
|
2270
|
+
// Determine the sort order
|
|
2271
|
+
const sortOrder = getSortOrder(sort, brand)
|
|
2272
|
+
|
|
2273
|
+
// Build the type filter
|
|
2274
|
+
let typeFilter = ''
|
|
2275
|
+
if (type.length > 0) {
|
|
2276
|
+
const typesString = type.map((t) => `'${t}'`).join(', ')
|
|
2277
|
+
typeFilter = `&& _type in [${typesString}]`
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2280
|
+
// Build the base filter
|
|
2281
|
+
const filter = `brand == "${brand}" ${typeFilter}`
|
|
2282
|
+
|
|
2283
|
+
// Apply owned content filter
|
|
2284
|
+
const filterWithRestrictions = await new FilterBuilder(filter, {
|
|
2285
|
+
showOnlyOwnedContent: true, // Key parameter: exclude membership content
|
|
2286
|
+
}).buildFilter()
|
|
2287
|
+
|
|
2288
|
+
const fieldsString = DEFAULT_FIELDS.join(',')
|
|
2289
|
+
|
|
2290
|
+
const query = buildEntityAndTotalQuery(filterWithRestrictions, fieldsString, {
|
|
2291
|
+
sortOrder: sortOrder,
|
|
2292
|
+
start: start,
|
|
2293
|
+
end: end,
|
|
2294
|
+
})
|
|
2295
|
+
|
|
2296
|
+
return fetchSanity(query, true)
|
|
2297
|
+
}
|
|
2371
2298
|
</code></pre>
|
|
2372
2299
|
</article>
|
|
2373
2300
|
</section>
|
|
@@ -2382,7 +2309,7 @@ export async function fetchMethodV2Structure(brand) {
|
|
|
2382
2309
|
<br class="clear">
|
|
2383
2310
|
|
|
2384
2311
|
<footer>
|
|
2385
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on
|
|
2312
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri Nov 28 2025 11:22:56 GMT-0800 (Pacific Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
2386
2313
|
</footer>
|
|
2387
2314
|
|
|
2388
2315
|
<script>prettyPrint();</script>
|