musora-content-services 1.6.9 → 1.7.2
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/.github/workflows/conventional-commits.yaml +0 -0
- package/.github/workflows/docs.js.yml +0 -0
- package/.github/workflows/node.js.yml +0 -0
- package/.github/workflows/sync-docs.yml +0 -0
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/CHANGELOG.md +16 -0
- package/README.md +0 -0
- package/babel.config.cjs +0 -0
- package/docs/algolia.js.html +0 -0
- package/docs/config.js.html +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/index.html +0 -0
- package/docs/module-Config.html +0 -0
- package/docs/module-Railcontent-Services.html +0 -0
- package/docs/module-Sanity-Services.html +0 -0
- package/docs/module-Search-Engine-Services.html +0 -0
- package/docs/railcontent.js.html +0 -0
- package/docs/sanity.js.html +0 -0
- package/docs/scripts/collapse.js +0 -0
- package/docs/scripts/commonNav.js +0 -0
- package/docs/scripts/linenumber.js +0 -0
- package/docs/scripts/nav.js +0 -0
- package/docs/scripts/polyfill.js +0 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
- package/docs/scripts/prettify/lang-css.js +0 -0
- package/docs/scripts/prettify/prettify.js +0 -0
- package/docs/scripts/search.js +0 -0
- package/docs/styles/jsdoc.css +0 -0
- package/docs/styles/prettify.css +0 -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 +3 -3
- 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 +286 -18
- 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 +94 -16
- 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/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/v2/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/v2/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/v2/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/v2/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/v2/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/v2/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/v2/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/v2/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/v2/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
- package/docs/v2/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/v2/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/v2/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/v2/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/v2/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
- package/docs/v2/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/v2/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/v2/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/v2/forums_categories.ts.html +22 -3
- package/docs/v2/forums_discussions.js.html +0 -0
- package/docs/v2/forums_forum.js.html +0 -0
- package/docs/v2/forums_forums.ts.html +41 -41
- package/docs/v2/forums_posts.ts.html +54 -28
- package/docs/v2/forums_threads.ts.html +23 -10
- package/docs/v2/gamification_awards.js.html +0 -0
- package/docs/v2/gamification_awards.ts.html +26 -12
- package/docs/v2/gamification_gamification.js.html +2 -2
- package/docs/v2/gamification_types.js.html +0 -0
- package/docs/v2/global.html +57 -9
- package/docs/v2/index.html +2 -2
- package/docs/v2/liveTesting.ts.html +4 -3
- 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-Categories.html +0 -0
- package/docs/v2/module-Config.html +5 -4
- package/docs/v2/module-Content-Services-V2.html +440 -9
- package/docs/v2/module-ForumCategories.html +0 -0
- package/docs/v2/module-ForumDiscussions.html +0 -0
- package/docs/v2/module-Forums.html +1398 -192
- package/docs/v2/module-Genre.html +981 -0
- package/docs/v2/module-GuidedCourses.html +2 -1198
- package/docs/v2/module-Instructor.html +929 -0
- package/docs/v2/module-Interests.html +2 -2
- package/docs/v2/module-LearningPaths.html +2424 -0
- package/docs/v2/module-Onboarding.html +217 -5
- package/docs/v2/module-Payments.html +148 -6
- package/docs/v2/module-Permissions.html +2 -2
- package/docs/v2/module-Playlists.html +2 -2
- package/docs/v2/module-ProgressRow.html +108 -0
- 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-Threads.html +0 -0
- 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 +184 -0
- package/docs/v2/railcontent.js.html +14 -125
- package/docs/v2/sanity.js.html +261 -325
- package/docs/v2/scripts/collapse.js +0 -0
- package/docs/v2/scripts/commonNav.js +0 -0
- package/docs/v2/scripts/linenumber.js +0 -0
- package/docs/v2/scripts/nav.js +0 -0
- package/docs/v2/scripts/polyfill.js +0 -0
- package/docs/v2/scripts/prettify/Apache-License-2.0.txt +0 -0
- package/docs/v2/scripts/prettify/lang-css.js +0 -0
- package/docs/v2/scripts/prettify/prettify.js +0 -0
- package/docs/v2/scripts/search.js +0 -0
- package/docs/v2/styles/jsdoc.css +0 -0
- package/docs/v2/styles/prettify.css +0 -0
- package/docs/v2/userActivity.js.html +191 -211
- package/docs/v2/user_account.ts.html +42 -14
- 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.js.html +0 -0
- 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 +148 -2
- package/docs/v2/user_payments.ts.html +54 -5
- 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/jsdoc.json +0 -0
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/contentMetaData.js +0 -0
- package/src/contentTypeConfig.js +2 -0
- package/src/filterBuilder.js +3 -1
- package/src/index.d.ts +0 -0
- package/src/index.js +0 -0
- package/src/services/algolia.js +0 -0
- package/src/services/config.js +0 -0
- package/src/services/contentLikes.js +0 -0
- package/src/services/contentProgress.js +0 -0
- package/src/services/dataContext.js +0 -0
- package/src/services/imageSRCBuilder.js +0 -0
- package/src/services/imageSRCVerify.js +0 -0
- package/src/services/lastUpdated.js +0 -0
- package/src/services/railcontent.js +0 -0
- package/src/services/recommendations.js +0 -0
- package/src/services/sanity.js +15 -6
- package/src/services/userPermissions.js +0 -0
- package/test/config.test.js +0 -0
- package/test/contentLikes.test.js +0 -0
- package/test/contentProgress.test.js +0 -0
- package/test/dataContext.test.js +0 -0
- package/test/imageSRCBuilder.test.js +0 -0
- package/test/imageSRCVerify.test.js +0 -0
- package/test/initializeTests.js +0 -0
- package/test/lastUpdated.test.js +0 -0
- package/test/live/contentProgressLive.test.js +0 -0
- package/test/live/railcontentLive.test.js +0 -0
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
- package/test/sanityQueryService.test.js +0 -0
- package/test/userPermissions.test.js +0 -0
- package/tools/generate-index.cjs +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><ul class='methods'><li data-type='method'><a href="module-GuidedCourses.html#~getActivePath">getActivePath</a></li><li data-type='method'><a href="module-GuidedCourses.html#~getDailySession">getDailySession</a></li><li data-type='method'><a href="module-GuidedCourses.html#~updateActivePath">updateActivePath</a></li><li data-type='method'><a href="module-GuidedCourses.html#~updateDailySession">updateDailySession</a></li></ul></li><li></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-Onboarding.html">Onboarding</a><ul class='methods'><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-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
|
|
|
@@ -67,20 +67,18 @@ import {
|
|
|
67
67
|
getFieldsForContentTypeWithFilteredChildren,
|
|
68
68
|
getChildFieldsForContentType,
|
|
69
69
|
SONG_TYPES,
|
|
70
|
+
SONG_TYPES_WITH_CHILDREN,
|
|
70
71
|
} from '../contentTypeConfig.js'
|
|
71
|
-
import {fetchSimilarItems, recommendations} from './recommendations.js'
|
|
72
|
+
import { fetchSimilarItems, recommendations } from './recommendations.js'
|
|
72
73
|
import { processMetadata, typeWithSortOrder } from '../contentMetaData.js'
|
|
73
74
|
|
|
74
75
|
import { globalConfig } from './config.js'
|
|
75
76
|
|
|
76
|
-
import {
|
|
77
|
-
fetchNextContentDataForParent,
|
|
78
|
-
fetchHandler,
|
|
79
|
-
} from './railcontent.js'
|
|
77
|
+
import { fetchNextContentDataForParent, fetchHandler } from './railcontent.js'
|
|
80
78
|
import { arrayToStringRepresentation, FilterBuilder } from '../filterBuilder.js'
|
|
81
|
-
import {
|
|
79
|
+
import { getPermissionsAdapter } from './permissions/index.ts'
|
|
82
80
|
import { getAllCompleted, getAllStarted, getAllStartedOrCompleted } from './contentProgress.js'
|
|
83
|
-
import {fetchRecentActivitiesActiveTabs} from
|
|
81
|
+
import { fetchRecentActivitiesActiveTabs } from './userActivity.js'
|
|
84
82
|
|
|
85
83
|
/**
|
|
86
84
|
* Exported functions that are excluded from index generation.
|
|
@@ -208,30 +206,6 @@ function getQueryFromPage(pageNumber, contentPerPage) {
|
|
|
208
206
|
return result
|
|
209
207
|
}
|
|
210
208
|
|
|
211
|
-
/**
|
|
212
|
-
* Fetch all artists with lessons available for a specific brand.
|
|
213
|
-
*
|
|
214
|
-
* @param {string} brand - The brand for which to fetch artists.
|
|
215
|
-
* @returns {Promise<Object|null>} - A promise that resolves to an array of artist objects or null if not found.
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
|
-
* fetchArtists('drumeo')
|
|
219
|
-
* .then(artists => console.log(artists))
|
|
220
|
-
* .catch(error => console.error(error));
|
|
221
|
-
*/
|
|
222
|
-
export async function fetchArtists(brand) {
|
|
223
|
-
const filter = await new FilterBuilder(
|
|
224
|
-
`_type == "song" && brand == "${brand}" && references(^._id)`,
|
|
225
|
-
{ bypassPermissions: true }
|
|
226
|
-
).buildFilter()
|
|
227
|
-
const query = `
|
|
228
|
-
*[_type == "artist"]{
|
|
229
|
-
name,
|
|
230
|
-
"lessonsCount": count(*[${filter}])
|
|
231
|
-
}[lessonsCount > 0] |order(lower(name)) `
|
|
232
|
-
return fetchSanity(query, true, { processNeedAccess: false })
|
|
233
|
-
}
|
|
234
|
-
|
|
235
209
|
/**
|
|
236
210
|
* Fetch current number of artists for songs within a brand.
|
|
237
211
|
* @param {string} brand - The current brand.
|
|
@@ -381,7 +355,7 @@ export async function fetchNewReleases(
|
|
|
381
355
|
web_url_path,
|
|
382
356
|
"permission_id": permission[]->railcontent_id,
|
|
383
357
|
`
|
|
384
|
-
const query = buildRawQuery(filter, fields, {sortOrder: sortOrder, start, end: end})
|
|
358
|
+
const query = buildRawQuery(filter, fields, { sortOrder: sortOrder, start, end: end })
|
|
385
359
|
return fetchSanity(query, true)
|
|
386
360
|
}
|
|
387
361
|
|
|
@@ -486,13 +460,11 @@ export async function fetchScheduledReleases(brand, { page = 1, limit = 10 }) {
|
|
|
486
460
|
* .catch(error => console.error(error));
|
|
487
461
|
*/
|
|
488
462
|
export async function fetchByRailContentId(id, contentType) {
|
|
489
|
-
const fields = await getFieldsForContentTypeWithFilteredChildren(contentType)
|
|
490
|
-
const lessonFields = getChildFieldsForContentType(contentType)
|
|
463
|
+
const fields = await getFieldsForContentTypeWithFilteredChildren(contentType, true)
|
|
491
464
|
const childrenFilter = await new FilterBuilder(``, { isChildrenFilter: true }).buildFilter()
|
|
492
465
|
const entityFieldsString = ` ${fields}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
'length_in_seconds': coalesce(
|
|
466
|
+
'child_count': coalesce(count(child[${childrenFilter}]->), 0) ,
|
|
467
|
+
'length_in_seconds': coalesce(
|
|
496
468
|
math::sum(
|
|
497
469
|
select(
|
|
498
470
|
child[${childrenFilter}]->length_in_seconds
|
|
@@ -524,17 +496,26 @@ export async function fetchByRailContentId(id, contentType) {
|
|
|
524
496
|
* .then(contents => console.log(contents))
|
|
525
497
|
* .catch(error => console.error(error));
|
|
526
498
|
*/
|
|
527
|
-
export async function fetchByRailContentIds(
|
|
499
|
+
export async function fetchByRailContentIds(
|
|
500
|
+
ids,
|
|
501
|
+
contentType = undefined,
|
|
502
|
+
brand = undefined,
|
|
503
|
+
includePermissionsAndStatusFilter = false
|
|
504
|
+
) {
|
|
528
505
|
if (!ids?.length) {
|
|
529
506
|
return []
|
|
530
507
|
}
|
|
531
|
-
ids = [...new Set(ids.filter(item => item !== null && item !== undefined))]
|
|
508
|
+
ids = [...new Set(ids.filter((item) => item !== null && item !== undefined))]
|
|
532
509
|
const idsString = ids.join(',')
|
|
533
510
|
const brandFilter = brand ? ` && brand == "${brand}"` : ''
|
|
534
|
-
const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`, {
|
|
511
|
+
const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`, {
|
|
512
|
+
pullFutureContent: true,
|
|
513
|
+
}).buildFilter()
|
|
535
514
|
const fields = await getFieldsForContentTypeWithFilteredChildren(contentType, true)
|
|
536
515
|
const baseFilter = `railcontent_id in [${idsString}]${brandFilter}`
|
|
537
|
-
const finalFilter = includePermissionsAndStatusFilter
|
|
516
|
+
const finalFilter = includePermissionsAndStatusFilter
|
|
517
|
+
? await new FilterBuilder(baseFilter).buildFilter()
|
|
518
|
+
: baseFilter
|
|
538
519
|
const query = `*[
|
|
539
520
|
${finalFilter}
|
|
540
521
|
]{
|
|
@@ -544,22 +525,22 @@ export async function fetchByRailContentIds(ids, contentType = undefined, brand
|
|
|
544
525
|
live_event_end_time,
|
|
545
526
|
}`
|
|
546
527
|
|
|
547
|
-
console.log('ids query', query)
|
|
548
528
|
const customPostProcess = (results) => {
|
|
549
|
-
const now = getSanityDate(new Date(), false)
|
|
529
|
+
const now = getSanityDate(new Date(), false)
|
|
550
530
|
const liveProcess = (result) => {
|
|
551
531
|
if (result.live_event_start_time && result.live_event_end_time) {
|
|
552
|
-
result.isLive =
|
|
553
|
-
result.live_event_start_time <= now &&
|
|
554
|
-
result.live_event_end_time >= now;
|
|
532
|
+
result.isLive = result.live_event_start_time <= now && result.live_event_end_time >= now
|
|
555
533
|
} else {
|
|
556
|
-
result.isLive = false
|
|
534
|
+
result.isLive = false
|
|
557
535
|
}
|
|
558
|
-
return result
|
|
559
|
-
}
|
|
560
|
-
return results.map(liveProcess)
|
|
536
|
+
return result
|
|
537
|
+
}
|
|
538
|
+
return results.map(liveProcess)
|
|
561
539
|
}
|
|
562
|
-
const results = await fetchSanity(query, true, {
|
|
540
|
+
const results = await fetchSanity(query, true, {
|
|
541
|
+
customPostProcess: customPostProcess,
|
|
542
|
+
processNeedAccess: true,
|
|
543
|
+
})
|
|
563
544
|
|
|
564
545
|
const sortFuction = function compare(a, b) {
|
|
565
546
|
const indexA = ids.indexOf(a['id'])
|
|
@@ -575,13 +556,18 @@ export async function fetchByRailContentIds(ids, contentType = undefined, brand
|
|
|
575
556
|
return sortedResults
|
|
576
557
|
}
|
|
577
558
|
|
|
578
|
-
export async function fetchContentRows(brand, pageName, contentRowSlug)
|
|
579
|
-
{
|
|
559
|
+
export async function fetchContentRows(brand, pageName, contentRowSlug) {
|
|
580
560
|
if (pageName === 'lessons') pageName = 'lesson'
|
|
581
561
|
if (pageName === 'songs') pageName = 'song'
|
|
582
562
|
const rowString = contentRowSlug ? ` && slug.current == "${contentRowSlug.toLowerCase()}"` : ''
|
|
583
|
-
const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`, {
|
|
584
|
-
|
|
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()
|
|
585
571
|
const query = `*[_type == 'recommended-content-row' && brand == '${brand}' && type == '${pageName}'${rowString}]{
|
|
586
572
|
brand,
|
|
587
573
|
name,
|
|
@@ -594,11 +580,9 @@ export async function fetchContentRows(brand, pageName, contentRowSlug)
|
|
|
594
580
|
'lesson_count': coalesce(count(*[${lessonCountFilter}]), 0),
|
|
595
581
|
},
|
|
596
582
|
}`
|
|
597
|
-
return fetchSanity(query, true)
|
|
583
|
+
return fetchSanity(query, true, { processNeedAccess: true })
|
|
598
584
|
}
|
|
599
585
|
|
|
600
|
-
|
|
601
|
-
|
|
602
586
|
/**
|
|
603
587
|
* Fetch all content for a specific brand and type with pagination, search, and grouping options.
|
|
604
588
|
* @param {string} brand - The brand for which to fetch content.
|
|
@@ -667,9 +651,7 @@ export async function fetchAll(
|
|
|
667
651
|
} else if (type === 'pack') {
|
|
668
652
|
typeFilter = `&& (_type == 'pack' || _type == 'semester-pack')`
|
|
669
653
|
} else {
|
|
670
|
-
typeFilter = type
|
|
671
|
-
? `&& _type == '${type}'`
|
|
672
|
-
: ''
|
|
654
|
+
typeFilter = type ? `&& _type == '${type}'` : ''
|
|
673
655
|
}
|
|
674
656
|
|
|
675
657
|
// Construct the search filter
|
|
@@ -788,7 +770,7 @@ async function getProgressFilter(progress, progressIds) {
|
|
|
788
770
|
return `&& (railcontent_id in [${ids.join(',')}])`
|
|
789
771
|
}
|
|
790
772
|
case 'incomplete': {
|
|
791
|
-
const ids = progressIds !== undefined ? progressIds :await getAllStarted()
|
|
773
|
+
const ids = progressIds !== undefined ? progressIds : await getAllStarted()
|
|
792
774
|
return `&& railcontent_id in [${ids.join(',')}]`
|
|
793
775
|
}
|
|
794
776
|
default:
|
|
@@ -887,7 +869,9 @@ export async function fetchAllFilterOptions(
|
|
|
887
869
|
|
|
888
870
|
const includedFieldsFilter = filters?.length ? filtersToGroq(filters) : undefined
|
|
889
871
|
const progressFilter = progressIds ? `&& railcontent_id in [${progressIds.join(',')}]` : ''
|
|
890
|
-
const
|
|
872
|
+
const adapter = getPermissionsAdapter()
|
|
873
|
+
const userPermissionsData = await adapter.fetchUserPermissions()
|
|
874
|
+
const isAdmin = adapter.isAdmin(userPermissionsData)
|
|
891
875
|
|
|
892
876
|
const constructCommonFilter = (excludeFilter) => {
|
|
893
877
|
const filterWithoutOption = excludeFilter
|
|
@@ -926,6 +910,7 @@ export async function fetchAllFilterOptions(
|
|
|
926
910
|
return includeTabs ? { ...results, tabs, catalogName } : results
|
|
927
911
|
}
|
|
928
912
|
|
|
913
|
+
//Daniel Nov 14 2025 note - keeping this for when we migrate foundations to packs, so we know what fields to use.
|
|
929
914
|
/**
|
|
930
915
|
* Fetch the Foundations 2019.
|
|
931
916
|
* @param {string} slug - The slug of the method.
|
|
@@ -951,6 +936,7 @@ export async function fetchFoundation(slug) {
|
|
|
951
936
|
* @param {string} slug - The slug of the method.
|
|
952
937
|
* @returns {Promise<Object|null>} - The fetched methods data or null if not found.
|
|
953
938
|
*/
|
|
939
|
+
//todo BEH-1446 depreciated. remove all old method functions
|
|
954
940
|
export async function fetchMethod(brand, slug) {
|
|
955
941
|
const childrenFilter = await new FilterBuilder(``, { isChildrenFilter: true }).buildFilter()
|
|
956
942
|
|
|
@@ -1154,7 +1140,11 @@ export async function jumpToContinueContent(railcontentId) {
|
|
|
1154
1140
|
* .catch(error => console.error(error));
|
|
1155
1141
|
*/
|
|
1156
1142
|
export async function fetchLessonContent(railContentId, { addParent = false } = {}) {
|
|
1157
|
-
const filterParams = {
|
|
1143
|
+
const filterParams = {
|
|
1144
|
+
isSingle: true,
|
|
1145
|
+
pullFutureContent: true,
|
|
1146
|
+
showMembershipRestrictedContent: true,
|
|
1147
|
+
}
|
|
1158
1148
|
|
|
1159
1149
|
const parentQuery = addParent
|
|
1160
1150
|
? `"parent_content_data": *[railcontent_id in [...(^.parent_content_data[].id)]]{
|
|
@@ -1215,7 +1205,7 @@ export async function fetchLessonContent(railContentId, { addParent = false } =
|
|
|
1215
1205
|
return result
|
|
1216
1206
|
}
|
|
1217
1207
|
|
|
1218
|
-
return fetchSanity(query, false, { customPostProcess: chapterProcess })
|
|
1208
|
+
return fetchSanity(query, false, { customPostProcess: chapterProcess, processNeedAccess: true })
|
|
1219
1209
|
}
|
|
1220
1210
|
|
|
1221
1211
|
/**
|
|
@@ -1294,7 +1284,7 @@ async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, cou
|
|
|
1294
1284
|
*[${filterSongTypesWithSameLicense}]->{${queryFields}}|order(published_on desc, title asc)[0...${count}],
|
|
1295
1285
|
}[0...1]`
|
|
1296
1286
|
const results = await fetchSanity(query, false)
|
|
1297
|
-
return results ? results['related_by_license'] ?? [] : []
|
|
1287
|
+
return results ? (results['related_by_license'] ?? []) : []
|
|
1298
1288
|
}
|
|
1299
1289
|
|
|
1300
1290
|
/**
|
|
@@ -1303,17 +1293,24 @@ async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, cou
|
|
|
1303
1293
|
* @param {string} brand - The current brand.
|
|
1304
1294
|
* @returns {Promise<Array<Object>|null>} - The fetched related lessons data or null if not found.
|
|
1305
1295
|
*/
|
|
1306
|
-
export async function fetchSiblingContent(railContentId, brand= null)
|
|
1307
|
-
{
|
|
1296
|
+
export async function fetchSiblingContent(railContentId, brand = null) {
|
|
1308
1297
|
const filterGetParent = await new FilterBuilder(`references(^._id) && _type == ^.parent_type`, {
|
|
1309
|
-
pullFutureContent: true
|
|
1310
|
-
}).buildFilter()
|
|
1311
|
-
const filterForParentList = await new FilterBuilder(`references(^._id) && _type == ^.parent_type`, {
|
|
1312
1298
|
pullFutureContent: true,
|
|
1313
|
-
|
|
1299
|
+
showMembershipRestrictedContent: true, // Show parent even without permissions
|
|
1314
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()
|
|
1315
1309
|
|
|
1316
|
-
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()
|
|
1317
1314
|
|
|
1318
1315
|
const brandString = brand ? ` && brand == "${brand}"` : ''
|
|
1319
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`
|
|
@@ -1327,7 +1324,7 @@ export async function fetchSiblingContent(railContentId, brand= null)
|
|
|
1327
1324
|
"related_lessons" : *[${filterGetParent}][0].child[${childrenFilter}]->{${queryFields}}
|
|
1328
1325
|
}`
|
|
1329
1326
|
|
|
1330
|
-
let result = await fetchSanity(query, false)
|
|
1327
|
+
let result = await fetchSanity(query, false, { processNeedAccess: true })
|
|
1331
1328
|
|
|
1332
1329
|
//there's no way in sanity to retrieve the index of an array, so we must calculate after fetch
|
|
1333
1330
|
if (result['for-calculations'] && result['for-calculations']['parents-list']) {
|
|
@@ -1351,15 +1348,16 @@ export async function fetchSiblingContent(railContentId, brand= null)
|
|
|
1351
1348
|
* @param {string} railContentId - The RailContent ID of the current lesson.
|
|
1352
1349
|
* @returns {Promise<Array<Object>|null>} - The fetched related lessons data or null if not found.
|
|
1353
1350
|
*/
|
|
1354
|
-
export async function fetchRelatedLessons(railContentId)
|
|
1355
|
-
{
|
|
1351
|
+
export async function fetchRelatedLessons(railContentId) {
|
|
1356
1352
|
const defaultFilterFields = `_type==^._type && brand == ^.brand && railcontent_id != ${railContentId}`
|
|
1357
1353
|
|
|
1358
1354
|
const filterSameArtist = await new FilterBuilder(
|
|
1359
|
-
`${defaultFilterFields} && references(^.artist->_id)
|
|
1355
|
+
`${defaultFilterFields} && references(^.artist->_id)`,
|
|
1356
|
+
{ showMembershipRestrictedContent: true }
|
|
1360
1357
|
).buildFilter()
|
|
1361
1358
|
const filterSameGenre = await new FilterBuilder(
|
|
1362
|
-
`${defaultFilterFields} && references(^.genre[]->_id)
|
|
1359
|
+
`${defaultFilterFields} && references(^.genre[]->_id)`,
|
|
1360
|
+
{ showMembershipRestrictedContent: true }
|
|
1363
1361
|
).buildFilter()
|
|
1364
1362
|
|
|
1365
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`
|
|
@@ -1371,7 +1369,7 @@ export async function fetchRelatedLessons(railContentId)
|
|
|
1371
1369
|
...(*[${filterSameGenre}]{${queryFields}}|order(published_on desc, title asc)[0...10]),
|
|
1372
1370
|
])[0...10]}`
|
|
1373
1371
|
|
|
1374
|
-
return await fetchSanity(query, false)
|
|
1372
|
+
return await fetchSanity(query, false, { processNeedAccess: true })
|
|
1375
1373
|
}
|
|
1376
1374
|
|
|
1377
1375
|
/**
|
|
@@ -1396,11 +1394,16 @@ export async function fetchAllPacks(
|
|
|
1396
1394
|
const start = (page - 1) * limit
|
|
1397
1395
|
const end = start + limit
|
|
1398
1396
|
|
|
1399
|
-
const query = await buildQuery(
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1397
|
+
const query = await buildQuery(
|
|
1398
|
+
filter,
|
|
1399
|
+
filterParams,
|
|
1400
|
+
await getFieldsForContentTypeWithFilteredChildren('pack'),
|
|
1401
|
+
{
|
|
1402
|
+
sortOrder: sortOrder,
|
|
1403
|
+
start,
|
|
1404
|
+
end,
|
|
1405
|
+
}
|
|
1406
|
+
)
|
|
1404
1407
|
return fetchSanity(query, true)
|
|
1405
1408
|
}
|
|
1406
1409
|
|
|
@@ -1506,45 +1509,6 @@ export async function fetchPackData(id) {
|
|
|
1506
1509
|
return fetchSanity(query, false)
|
|
1507
1510
|
}
|
|
1508
1511
|
|
|
1509
|
-
/**
|
|
1510
|
-
* Fetch the data needed for the coach screen.
|
|
1511
|
-
* @param {string} brand - The brand for which to fetch coach lessons
|
|
1512
|
-
* @param {string} id - The Railcontent ID of the coach
|
|
1513
|
-
* @returns {Promise<Object|null>} - The lessons for the instructor or null if not found.
|
|
1514
|
-
* @param {Object} params - Parameters for pagination, filtering and sorting.
|
|
1515
|
-
* @param {string} [params.sortOrder="-published_on"] - The field to sort the lessons by.
|
|
1516
|
-
* @param {string} [params.searchTerm=""] - The search term to filter content by title.
|
|
1517
|
-
* @param {number} [params.page=1] - The page number for pagination.
|
|
1518
|
-
* @param {number} [params.limit=10] - The number of items per page.
|
|
1519
|
-
* @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'].
|
|
1520
|
-
*
|
|
1521
|
-
* @example
|
|
1522
|
-
* fetchCoachLessons('coach123')
|
|
1523
|
-
* .then(lessons => console.log(lessons))
|
|
1524
|
-
* .catch(error => console.error(error));
|
|
1525
|
-
*/
|
|
1526
|
-
export async function fetchCoachLessons(
|
|
1527
|
-
brand,
|
|
1528
|
-
id,
|
|
1529
|
-
{ sortOrder = '-published_on', searchTerm = '', page = 1, limit = 20, includedFields = [] } = {}
|
|
1530
|
-
) {
|
|
1531
|
-
const fieldsString = getFieldsForContentType()
|
|
1532
|
-
const start = (page - 1) * limit
|
|
1533
|
-
const end = start + limit
|
|
1534
|
-
const searchFilter = searchTerm ? `&& title match "${searchTerm}*"` : ''
|
|
1535
|
-
const includedFieldsFilter = includedFields.length > 0 ? filtersToGroq(includedFields) : ''
|
|
1536
|
-
const filter = `brand == '${brand}' ${searchFilter} ${includedFieldsFilter} && references(*[_type=='instructor' && railcontent_id == ${id}]._id)`
|
|
1537
|
-
const filterWithRestrictions = await new FilterBuilder(filter).buildFilter()
|
|
1538
|
-
|
|
1539
|
-
sortOrder = getSortOrder(sortOrder, brand)
|
|
1540
|
-
const query = buildEntityAndTotalQuery(filterWithRestrictions, fieldsString, {
|
|
1541
|
-
sortOrder: sortOrder,
|
|
1542
|
-
start: start,
|
|
1543
|
-
end: end,
|
|
1544
|
-
})
|
|
1545
|
-
return fetchSanity(query, true)
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
1512
|
/**
|
|
1549
1513
|
* Fetch the data needed for the coach screen.
|
|
1550
1514
|
* @param {string} id - The Railcontent ID of the coach
|
|
@@ -1577,149 +1541,33 @@ export async function fetchByReference(
|
|
|
1577
1541
|
}
|
|
1578
1542
|
|
|
1579
1543
|
/**
|
|
1580
|
-
* Fetch the artist's lessons.
|
|
1581
|
-
* @param {string} brand - The brand for which to fetch lessons.
|
|
1582
|
-
* @param {string} name - The name of the artist
|
|
1583
|
-
* @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
|
|
1584
|
-
* @param {Object} params - Parameters for sorting, searching, pagination and filtering.
|
|
1585
|
-
* @param {string} [params.sort="-published_on"] - The field to sort the lessons by.
|
|
1586
|
-
* @param {string} [params.searchTerm=""] - The search term to filter the lessons.
|
|
1587
|
-
* @param {number} [params.page=1] - The page number for pagination.
|
|
1588
|
-
* @param {number} [params.limit=10] - The number of items per page.
|
|
1589
|
-
* @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'].
|
|
1590
|
-
* @param {Array<number>} [params.progressIds] - The ids of the lessons that are in progress or completed
|
|
1591
|
-
* @returns {Promise<Object|null>} - The lessons for the artist and some details about the artist (name and thumbnail).
|
|
1592
1544
|
*
|
|
1593
|
-
*
|
|
1594
|
-
*
|
|
1595
|
-
*
|
|
1596
|
-
* .catch(error => console.error(error));
|
|
1597
|
-
*/
|
|
1598
|
-
export async function fetchArtistLessons(
|
|
1599
|
-
brand,
|
|
1600
|
-
name,
|
|
1601
|
-
contentType,
|
|
1602
|
-
{
|
|
1603
|
-
sort = '-published_on',
|
|
1604
|
-
searchTerm = '',
|
|
1605
|
-
page = 1,
|
|
1606
|
-
limit = 10,
|
|
1607
|
-
includedFields = [],
|
|
1608
|
-
progressIds = undefined,
|
|
1609
|
-
} = {}
|
|
1610
|
-
) {
|
|
1611
|
-
const fieldsString = DEFAULT_FIELDS.join(',')
|
|
1612
|
-
const start = (page - 1) * limit
|
|
1613
|
-
const end = start + limit
|
|
1614
|
-
const searchFilter = searchTerm ? `&& title match "${searchTerm}*"` : ''
|
|
1615
|
-
const sortOrder = getSortOrder(sort, brand)
|
|
1616
|
-
const addType =
|
|
1617
|
-
contentType && Array.isArray(contentType)
|
|
1618
|
-
? `_type in ['${contentType.join("', '")}'] &&`
|
|
1619
|
-
: contentType
|
|
1620
|
-
? `_type == '${contentType}' && `
|
|
1621
|
-
: ''
|
|
1622
|
-
const includedFieldsFilter = includedFields.length > 0 ? filtersToGroq(includedFields) : ''
|
|
1623
|
-
|
|
1624
|
-
// limits the results to supplied progressIds for started & completed filters
|
|
1625
|
-
const progressFilter =
|
|
1626
|
-
progressIds !== undefined ? `&& railcontent_id in [${progressIds.join(',')}]` : ''
|
|
1627
|
-
const now = getSanityDate(new Date())
|
|
1628
|
-
const query = `{
|
|
1629
|
-
"entity":
|
|
1630
|
-
*[_type == 'artist' && name == '${name}']
|
|
1631
|
-
{'type': _type, name, 'thumbnail':thumbnail_url.asset->url,
|
|
1632
|
-
'lessons_count': count(*[${addType} brand == '${brand}' && references(^._id)]),
|
|
1633
|
-
'lessons': *[${addType} brand == '${brand}' && references(^._id) && (status in ['published'] || (status == 'scheduled' && defined(published_on) && published_on >= '${now}')) ${searchFilter} ${includedFieldsFilter} ${progressFilter}]{${fieldsString}}
|
|
1634
|
-
[${start}...${end}]}
|
|
1635
|
-
|order(${sortOrder})f
|
|
1636
|
-
}`
|
|
1637
|
-
return fetchSanity(query, true)
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* Fetch the genre's lessons.
|
|
1642
|
-
* @param {string} brand - The brand for which to fetch lessons.
|
|
1643
|
-
* @param {string} name - The name of the genre
|
|
1644
|
-
* @param {Object} params - Parameters for sorting, searching, pagination and filtering.
|
|
1645
|
-
* @param {string} [params.sort="-published_on"] - The field to sort the lessons by.
|
|
1646
|
-
* @param {string} [params.searchTerm=""] - The search term to filter the lessons.
|
|
1647
|
-
* @param {number} [params.page=1] - The page number for pagination.
|
|
1648
|
-
* @param {number} [params.limit=10] - The number of items per page.
|
|
1649
|
-
* @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'].
|
|
1650
|
-
* @param {Array<number>} [params.progressIds] - The ids of the lessons that are in progress or completed
|
|
1651
|
-
* @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
|
|
1652
1548
|
*
|
|
1653
|
-
* @
|
|
1654
|
-
*
|
|
1655
|
-
* .then(lessons => console.log(lessons))
|
|
1656
|
-
* .catch(error => console.error(error));
|
|
1549
|
+
* @param {int} railcontentId
|
|
1550
|
+
* @returns {Promise<int|null>}
|
|
1657
1551
|
*/
|
|
1658
|
-
export async function fetchGenreLessons(
|
|
1659
|
-
brand,
|
|
1660
|
-
name,
|
|
1661
|
-
contentType,
|
|
1662
|
-
{
|
|
1663
|
-
sort = '-published_on',
|
|
1664
|
-
searchTerm = '',
|
|
1665
|
-
page = 1,
|
|
1666
|
-
limit = 10,
|
|
1667
|
-
includedFields = [],
|
|
1668
|
-
progressIds = undefined,
|
|
1669
|
-
} = {}
|
|
1670
|
-
) {
|
|
1671
|
-
const fieldsString = DEFAULT_FIELDS.join(',')
|
|
1672
|
-
const start = (page - 1) * limit
|
|
1673
|
-
const end = start + limit
|
|
1674
|
-
const searchFilter = searchTerm ? `&& title match "${searchTerm}*"` : ''
|
|
1675
|
-
const sortOrder = getSortOrder(sort, brand)
|
|
1676
|
-
const addType = contentType ? `_type == '${contentType}' && ` : ''
|
|
1677
|
-
const includedFieldsFilter = includedFields.length > 0 ? filtersToGroq(includedFields) : ''
|
|
1678
|
-
// limits the results to supplied progressIds for started & completed filters
|
|
1679
|
-
const progressFilter =
|
|
1680
|
-
progressIds !== undefined ? `&& railcontent_id in [${progressIds.join(',')}]` : ''
|
|
1681
|
-
const now = getSanityDate(new Date())
|
|
1682
|
-
const query = `{
|
|
1683
|
-
"entity":
|
|
1684
|
-
*[_type == 'genre' && name == '${name}']
|
|
1685
|
-
{'type': _type, name, 'thumbnail':thumbnail_url.asset->url,
|
|
1686
|
-
'lessons_count': count(*[${addType} brand == '${brand}' && references(^._id)]),
|
|
1687
|
-
'lessons': *[${addType} brand == '${brand}' && references(^._id) && (status in ['published'] || (status == 'scheduled' && defined(published_on) && published_on >= '${now}')) ${searchFilter} ${includedFieldsFilter} ${progressFilter}]{${fieldsString}}
|
|
1688
|
-
[${start}...${end}]}
|
|
1689
|
-
|order(${sortOrder})
|
|
1690
|
-
}`
|
|
1691
|
-
return fetchSanity(query, true)
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
1552
|
export async function fetchTopLevelParentId(railcontentId) {
|
|
1553
|
+
const parentFilter = "railcontent_id in [...(^.parent_content_data[].id)]"
|
|
1695
1554
|
const statusFilter = "&& status in ['scheduled', 'published', 'archived', 'unlisted']"
|
|
1696
1555
|
|
|
1697
1556
|
const query = `*[railcontent_id == ${railcontentId}]{
|
|
1698
1557
|
railcontent_id,
|
|
1699
|
-
'parents': *[
|
|
1700
|
-
railcontent_id
|
|
1701
|
-
'parents': *[^._id in child[]._ref ${statusFilter}]{
|
|
1702
|
-
railcontent_id,
|
|
1703
|
-
'parents': *[^._id in child[]._ref ${statusFilter}]{
|
|
1704
|
-
railcontent_id,
|
|
1705
|
-
'parents': *[^._id in child[]._ref ${statusFilter}]{
|
|
1706
|
-
railcontent_id,
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1558
|
+
'parents': *[${parentFilter} ${statusFilter}]{
|
|
1559
|
+
railcontent_id
|
|
1710
1560
|
}
|
|
1711
1561
|
}`
|
|
1712
1562
|
let response = await fetchSanity(query, false, { processNeedAccess: false })
|
|
1713
1563
|
if (!response) return null
|
|
1714
|
-
let
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
return currentLevel['railcontent_id']
|
|
1720
|
-
}
|
|
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']
|
|
1721
1569
|
}
|
|
1722
|
-
return
|
|
1570
|
+
return response['railcontent_id']
|
|
1723
1571
|
}
|
|
1724
1572
|
|
|
1725
1573
|
export async function fetchHierarchy(railcontentId) {
|
|
@@ -1812,8 +1660,10 @@ export async function fetchCommentModContentData(ids) {
|
|
|
1812
1660
|
*
|
|
1813
1661
|
* @param {string} query - The GROQ query to execute against the Sanity API.
|
|
1814
1662
|
* @param {boolean} isList - Whether to return an array or a single result.
|
|
1815
|
-
* @param {
|
|
1816
|
-
* @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
|
|
1817
1667
|
* @returns {Promise<*|null>} - A promise that resolves to the fetched data or null if an error occurs or no results are found.
|
|
1818
1668
|
*
|
|
1819
1669
|
* @example
|
|
@@ -1826,7 +1676,7 @@ export async function fetchCommentModContentData(ids) {
|
|
|
1826
1676
|
export async function fetchSanity(
|
|
1827
1677
|
query,
|
|
1828
1678
|
isList,
|
|
1829
|
-
{ customPostProcess = null, processNeedAccess = true } = {}
|
|
1679
|
+
{ customPostProcess = null, processNeedAccess = true, processPageType = true } = {}
|
|
1830
1680
|
) {
|
|
1831
1681
|
// Check the config object before proceeding
|
|
1832
1682
|
if (!checkSanityConfig(globalConfig)) {
|
|
@@ -1848,13 +1698,13 @@ export async function fetchSanity(
|
|
|
1848
1698
|
body: JSON.stringify({ query: query }),
|
|
1849
1699
|
}
|
|
1850
1700
|
|
|
1701
|
+
const adapter = getPermissionsAdapter()
|
|
1851
1702
|
let promisesResult = await Promise.all([
|
|
1852
1703
|
fetch(url, options),
|
|
1853
|
-
processNeedAccess ? fetchUserPermissions() : null,
|
|
1704
|
+
processNeedAccess ? adapter.fetchUserPermissions() : null,
|
|
1854
1705
|
])
|
|
1855
1706
|
const response = promisesResult[0]
|
|
1856
|
-
const userPermissions = promisesResult[1]
|
|
1857
|
-
const isAdmin = promisesResult[1]?.isAdmin
|
|
1707
|
+
const userPermissions = promisesResult[1]
|
|
1858
1708
|
|
|
1859
1709
|
if (!response.ok) {
|
|
1860
1710
|
throw new Error(`Sanity API error: ${response.status} - ${response.statusText}`)
|
|
@@ -1865,64 +1715,74 @@ export async function fetchSanity(
|
|
|
1865
1715
|
if (!results) {
|
|
1866
1716
|
throw new Error('No results found')
|
|
1867
1717
|
}
|
|
1868
|
-
results = processNeedAccess
|
|
1869
|
-
|
|
1870
|
-
: 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
|
|
1882
|
-
if (globalConfig.sanityConfig.useDummyRailContentMethods) return results
|
|
1883
|
-
|
|
1884
|
-
userPermissions = new Set(userPermissions)
|
|
1885
|
-
|
|
1730
|
+
function contentResultsDecorator(results, fieldName, callback) {
|
|
1886
1731
|
if (Array.isArray(results)) {
|
|
1887
1732
|
results.forEach((result) => {
|
|
1888
|
-
|
|
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
|
+
}
|
|
1889
1744
|
})
|
|
1890
1745
|
} else if (results.entity && Array.isArray(results.entity)) {
|
|
1891
1746
|
// Group By
|
|
1892
1747
|
results.entity.forEach((result) => {
|
|
1893
1748
|
if (result.lessons) {
|
|
1894
1749
|
result.lessons.forEach((lesson) => {
|
|
1895
|
-
lesson[
|
|
1750
|
+
lesson[fieldName] = callback(lesson) // Updated to check lesson access
|
|
1896
1751
|
})
|
|
1897
1752
|
} else {
|
|
1898
|
-
result[
|
|
1753
|
+
result[fieldName] = callback(result)
|
|
1899
1754
|
}
|
|
1900
1755
|
})
|
|
1901
1756
|
} else if (results.related_lessons && Array.isArray(results.related_lessons)) {
|
|
1902
1757
|
results.related_lessons.forEach((result) => {
|
|
1903
|
-
result[
|
|
1758
|
+
result[fieldName] = callback(result)
|
|
1904
1759
|
})
|
|
1905
1760
|
} else {
|
|
1906
|
-
results[
|
|
1761
|
+
results[fieldName] = callback(results)
|
|
1907
1762
|
}
|
|
1908
1763
|
|
|
1909
1764
|
return results
|
|
1910
1765
|
}
|
|
1911
1766
|
|
|
1912
|
-
function
|
|
1913
|
-
|
|
1914
|
-
return
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1767
|
+
function pageTypeDecorator(results) {
|
|
1768
|
+
return contentResultsDecorator(results, 'page_type', function (content) {
|
|
1769
|
+
return SONG_TYPES_WITH_CHILDREN.includes(content['type']) ? 'song' : 'lesson'
|
|
1770
|
+
})
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
function needsAccessDecorator(results, userPermissions) {
|
|
1774
|
+
if (globalConfig.sanityConfig.useDummyRailContentMethods) return results
|
|
1775
|
+
const adapter = getPermissionsAdapter()
|
|
1776
|
+
return contentResultsDecorator(results, 'need_access', function (content) {
|
|
1777
|
+
return adapter.doesUserNeedAccess(content, userPermissions)
|
|
1778
|
+
})
|
|
1779
|
+
}
|
|
1780
|
+
|
|
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)
|
|
1926
1786
|
}
|
|
1927
1787
|
|
|
1928
1788
|
/**
|
|
@@ -1964,8 +1824,8 @@ export async function fetchShowsData(brand) {
|
|
|
1964
1824
|
* .catch(error => console.error(error));
|
|
1965
1825
|
*/
|
|
1966
1826
|
export async function fetchMetadata(brand, type) {
|
|
1967
|
-
let processedData =
|
|
1968
|
-
if(processedData?.onlyAvailableTabs === true) {
|
|
1827
|
+
let processedData = processMetadata(brand, type, true)
|
|
1828
|
+
if (processedData?.onlyAvailableTabs === true) {
|
|
1969
1829
|
const activeTabs = await fetchRecentActivitiesActiveTabs()
|
|
1970
1830
|
processedData.tabs = activeTabs
|
|
1971
1831
|
}
|
|
@@ -1991,7 +1851,7 @@ function arrayJoinWithQuotes(array, delimiter = ',') {
|
|
|
1991
1851
|
return wrapped.join(delimiter)
|
|
1992
1852
|
}
|
|
1993
1853
|
|
|
1994
|
-
function getSanityDate(date, roundToHourForCaching = true) {
|
|
1854
|
+
export function getSanityDate(date, roundToHourForCaching = true) {
|
|
1995
1855
|
if (roundToHourForCaching) {
|
|
1996
1856
|
// We need to set the published on filter date to be a round time so that it doesn't bypass the query cache
|
|
1997
1857
|
// with every request by changing the filter date every second. I've set it to one minute past the current hour
|
|
@@ -2065,13 +1925,19 @@ async function buildQuery(
|
|
|
2065
1925
|
return buildRawQuery(filter, fields, { sortOrder, start, end, isSingle })
|
|
2066
1926
|
}
|
|
2067
1927
|
|
|
2068
|
-
function buildEntityAndTotalQuery(
|
|
1928
|
+
export function buildEntityAndTotalQuery(
|
|
2069
1929
|
filter = '',
|
|
2070
1930
|
fields = '...',
|
|
2071
|
-
{
|
|
1931
|
+
{
|
|
1932
|
+
sortOrder = 'published_on desc',
|
|
1933
|
+
start = 0,
|
|
1934
|
+
end = 10,
|
|
1935
|
+
isSingle = false,
|
|
1936
|
+
withoutPagination = false,
|
|
1937
|
+
}
|
|
2072
1938
|
) {
|
|
2073
1939
|
const sortString = sortOrder ? ` | order(${sortOrder})` : ''
|
|
2074
|
-
const countString = isSingle ? '[0...1]' :
|
|
1940
|
+
const countString = isSingle ? '[0...1]' : withoutPagination ? `` : `[${start}...${end}]`
|
|
2075
1941
|
const query = `{
|
|
2076
1942
|
"entity": *[${filter}] ${sortString}${countString}
|
|
2077
1943
|
{
|
|
@@ -2188,6 +2054,7 @@ export async function fetchTabData(
|
|
|
2188
2054
|
includedFields = [],
|
|
2189
2055
|
progressIds = undefined,
|
|
2190
2056
|
progress = 'all',
|
|
2057
|
+
showMembershipRestrictedContent = false,
|
|
2191
2058
|
} = {}
|
|
2192
2059
|
) {
|
|
2193
2060
|
const start = (page - 1) * limit
|
|
@@ -2200,22 +2067,22 @@ export async function fetchTabData(
|
|
|
2200
2067
|
|
|
2201
2068
|
switch (progress) {
|
|
2202
2069
|
case 'recent':
|
|
2203
|
-
progressIds = await getAllStartedOrCompleted({ brand, onlyIds: true })
|
|
2204
|
-
sortOrder = null
|
|
2205
|
-
break
|
|
2070
|
+
progressIds = await getAllStartedOrCompleted({ brand, onlyIds: true })
|
|
2071
|
+
sortOrder = null
|
|
2072
|
+
break
|
|
2206
2073
|
case 'incomplete':
|
|
2207
|
-
progressIds = await getAllStarted()
|
|
2208
|
-
sortOrder = null
|
|
2209
|
-
break
|
|
2074
|
+
progressIds = await getAllStarted()
|
|
2075
|
+
sortOrder = null
|
|
2076
|
+
break
|
|
2210
2077
|
case 'completed':
|
|
2211
|
-
progressIds = await getAllCompleted()
|
|
2212
|
-
sortOrder = null
|
|
2213
|
-
break
|
|
2078
|
+
progressIds = await getAllCompleted()
|
|
2079
|
+
sortOrder = null
|
|
2080
|
+
break
|
|
2214
2081
|
}
|
|
2215
2082
|
|
|
2216
2083
|
// limits the results to supplied progressIds for started & completed filters
|
|
2217
2084
|
const progressFilter = await getProgressFilter(progress, progressIds)
|
|
2218
|
-
const fieldsString = getFieldsForContentType('tab-data')
|
|
2085
|
+
const fieldsString = getFieldsForContentType('tab-data')
|
|
2219
2086
|
const now = getSanityDate(new Date())
|
|
2220
2087
|
|
|
2221
2088
|
// Determine the group by clause
|
|
@@ -2223,12 +2090,14 @@ export async function fetchTabData(
|
|
|
2223
2090
|
let entityFieldsString = ''
|
|
2224
2091
|
let filter = ''
|
|
2225
2092
|
|
|
2226
|
-
filter = `brand == "${brand}" ${includedFieldsFilter} ${progressFilter}`
|
|
2227
|
-
const childrenFilter = await new FilterBuilder(``, {
|
|
2093
|
+
filter = `brand == "${brand}" && (defined(railcontent_id)) ${includedFieldsFilter} ${progressFilter}`
|
|
2094
|
+
const childrenFilter = await new FilterBuilder(``, {
|
|
2095
|
+
isChildrenFilter: true,
|
|
2096
|
+
showMembershipRestrictedContent: true,
|
|
2097
|
+
}).buildFilter()
|
|
2228
2098
|
const childrenFields = await getChildFieldsForContentType('tab-data')
|
|
2229
2099
|
const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`).buildFilter()
|
|
2230
|
-
entityFieldsString =
|
|
2231
|
-
` ${fieldsString}
|
|
2100
|
+
entityFieldsString = ` ${fieldsString}
|
|
2232
2101
|
'children': child[${childrenFilter}]->{ ${childrenFields} 'children': child[${childrenFilter}]->{ ${childrenFields} }, },
|
|
2233
2102
|
'isLive': live_event_start_time <= "${now}" && live_event_end_time >= "${now}",
|
|
2234
2103
|
'lesson_count': coalesce(count(*[${lessonCountFilter}]), 0),
|
|
@@ -2240,27 +2109,29 @@ export async function fetchTabData(
|
|
|
2240
2109
|
),
|
|
2241
2110
|
length_in_seconds
|
|
2242
2111
|
),`
|
|
2243
|
-
const filterWithRestrictions = await new FilterBuilder(filter, {
|
|
2112
|
+
const filterWithRestrictions = await new FilterBuilder(filter, {
|
|
2113
|
+
showMembershipRestrictedContent: true,
|
|
2114
|
+
}).buildFilter()
|
|
2244
2115
|
query = buildEntityAndTotalQuery(filterWithRestrictions, entityFieldsString, {
|
|
2245
2116
|
sortOrder: sortOrder,
|
|
2246
2117
|
start: start,
|
|
2247
|
-
end: end
|
|
2118
|
+
end: end,
|
|
2248
2119
|
})
|
|
2249
2120
|
|
|
2250
|
-
let results = await fetchSanity(query, true)
|
|
2121
|
+
let results = await fetchSanity(query, true, { processNeedAccess: true })
|
|
2251
2122
|
|
|
2252
2123
|
if (['recent', 'incomplete', 'completed'].includes(progress) && results.entity.length > 1) {
|
|
2253
2124
|
const orderMap = new Map(progressIds.map((id, index) => [id, index]))
|
|
2254
2125
|
results.entity = results.entity
|
|
2255
2126
|
.sort((a, b) => {
|
|
2256
|
-
const aIdx = orderMap.get(a.id) ?? Number.MAX_SAFE_INTEGER
|
|
2257
|
-
const bIdx = orderMap.get(b.id) ?? Number.MAX_SAFE_INTEGER
|
|
2258
|
-
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)
|
|
2259
2130
|
})
|
|
2260
|
-
.slice(start, end)
|
|
2131
|
+
.slice(start, end)
|
|
2261
2132
|
}
|
|
2262
2133
|
|
|
2263
|
-
return results
|
|
2134
|
+
return results
|
|
2264
2135
|
}
|
|
2265
2136
|
|
|
2266
2137
|
export async function fetchRecent(
|
|
@@ -2335,12 +2206,12 @@ export async function fetchShows(brand, type, sort = 'sort') {
|
|
|
2335
2206
|
* @returns {Promise<*|null>}
|
|
2336
2207
|
*/
|
|
2337
2208
|
export async function fetchMethodV2IntroVideo(brand) {
|
|
2338
|
-
const type =
|
|
2339
|
-
const filter = `_type == '${type}' && brand == '${brand}'
|
|
2340
|
-
const fields = getIntroVideoFields()
|
|
2209
|
+
const type = 'method-intro'
|
|
2210
|
+
const filter = `_type == '${type}' && brand == '${brand}'`
|
|
2211
|
+
const fields = getIntroVideoFields('method-v2')
|
|
2341
2212
|
|
|
2342
|
-
const query = `*[${filter}] { ${fields.join(
|
|
2343
|
-
return fetchSanity(query, false)
|
|
2213
|
+
const query = `*[${filter}] { ${fields.join(', ')} }`
|
|
2214
|
+
return fetchSanity(query, false)
|
|
2344
2215
|
}
|
|
2345
2216
|
|
|
2346
2217
|
/**
|
|
@@ -2349,16 +2220,81 @@ export async function fetchMethodV2IntroVideo(brand) {
|
|
|
2349
2220
|
* @returns {Promise<*|null>}
|
|
2350
2221
|
*/
|
|
2351
2222
|
export async function fetchMethodV2Structure(brand) {
|
|
2352
|
-
const _type =
|
|
2223
|
+
const _type = 'method-v2'
|
|
2353
2224
|
const query = `*[_type == '${_type}' && brand == '${brand}'][0...1]{
|
|
2354
2225
|
'sanity_id': _id,
|
|
2355
|
-
'
|
|
2226
|
+
'learning_paths': child[]->{
|
|
2227
|
+
'id': railcontent_id,
|
|
2228
|
+
'children': child[]->railcontent_id
|
|
2229
|
+
}
|
|
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[]->{
|
|
2356
2244
|
'id': railcontent_id,
|
|
2357
2245
|
'children': child[]->railcontent_id
|
|
2358
2246
|
}
|
|
2359
|
-
}
|
|
2247
|
+
}`
|
|
2360
2248
|
return await fetchSanity(query, false);
|
|
2361
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
|
+
}
|
|
2362
2298
|
</code></pre>
|
|
2363
2299
|
</article>
|
|
2364
2300
|
</section>
|
|
@@ -2373,7 +2309,7 @@ export async function fetchMethodV2Structure(brand) {
|
|
|
2373
2309
|
<br class="clear">
|
|
2374
2310
|
|
|
2375
2311
|
<footer>
|
|
2376
|
-
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.
|
|
2377
2313
|
</footer>
|
|
2378
2314
|
|
|
2379
2315
|
<script>prettyPrint();</script>
|