musora-content-services 1.7.0 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +17 -0
- package/.github/workflows/conventional-commits.yaml +0 -0
- package/.github/workflows/node.js.yml +0 -0
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/CHANGELOG.md +15 -0
- package/docs/v2/Content.html +269 -0
- package/docs/v2/ContentOrganization.html +2 -2
- package/docs/v2/Forums.html +2 -2
- package/docs/v2/Gamification.html +2 -2
- package/docs/v2/TestUser.html +2 -2
- package/docs/v2/UserManagementSystem.html +2 -2
- package/docs/v2/api_types.js.html +2 -2
- package/docs/v2/config.js.html +5 -2
- package/docs/v2/content-org_content-org.js.html +2 -2
- package/docs/v2/content-org_guided-courses.ts.html +2 -2
- package/docs/v2/content-org_learning-paths.ts.html +194 -59
- package/docs/v2/content-org_playlists-types.js.html +2 -2
- package/docs/v2/content-org_playlists.js.html +2 -2
- package/docs/v2/content.js.html +88 -10
- package/docs/v2/content_artist.ts.html +206 -0
- package/docs/v2/content_content.ts.html +77 -0
- package/docs/v2/content_genre.ts.html +209 -0
- package/docs/v2/content_instructor.ts.html +206 -0
- package/docs/v2/forums_categories.ts.html +22 -3
- package/docs/v2/forums_forums.ts.html +2 -2
- package/docs/v2/forums_posts.ts.html +22 -3
- package/docs/v2/forums_threads.ts.html +23 -10
- package/docs/v2/gamification_awards.ts.html +26 -12
- package/docs/v2/gamification_gamification.js.html +2 -2
- package/docs/v2/global.html +56 -8
- package/docs/v2/index.html +2 -2
- package/docs/v2/liveTesting.ts.html +2 -2
- package/docs/v2/module-Accounts.html +202 -13
- package/docs/v2/module-Artist.html +993 -0
- package/docs/v2/module-Awards.html +106 -6
- package/docs/v2/module-Config.html +5 -4
- package/docs/v2/module-Content-Services-V2.html +440 -9
- package/docs/v2/module-Forums.html +1398 -192
- package/docs/v2/module-Genre.html +981 -0
- package/docs/v2/module-GuidedCourses.html +2 -2
- package/docs/v2/module-Instructor.html +929 -0
- package/docs/v2/module-Interests.html +2 -2
- package/docs/v2/module-LearningPaths.html +1276 -182
- package/docs/v2/module-Onboarding.html +32 -8
- package/docs/v2/module-Payments.html +2 -2
- package/docs/v2/module-Permissions.html +2 -2
- package/docs/v2/module-Playlists.html +2 -2
- package/docs/v2/module-ProgressRow.html +2 -2
- package/docs/v2/module-Railcontent-Services.html +34 -626
- package/docs/v2/module-Sanity-Services.html +803 -1722
- package/docs/v2/module-Sessions.html +2 -2
- package/docs/v2/module-UserActivity.html +70 -116
- package/docs/v2/module-UserChat.html +2 -2
- package/docs/v2/module-UserManagement.html +2 -2
- package/docs/v2/module-UserMemberships.html +2 -2
- package/docs/v2/module-UserNotifications.html +2 -2
- package/docs/v2/module-UserProfile.html +2 -2
- package/docs/v2/progress-row_method-card.js.html +46 -47
- package/docs/v2/railcontent.js.html +14 -125
- package/docs/v2/sanity.js.html +247 -320
- package/docs/v2/userActivity.js.html +93 -169
- package/docs/v2/user_account.ts.html +41 -13
- package/docs/v2/user_chat.js.html +2 -2
- package/docs/v2/user_interests.js.html +2 -2
- package/docs/v2/user_management.js.html +2 -2
- package/docs/v2/user_memberships.ts.html +2 -2
- package/docs/v2/user_notifications.js.html +2 -2
- package/docs/v2/user_onboarding.ts.html +99 -4
- package/docs/v2/user_payments.ts.html +2 -2
- package/docs/v2/user_permissions.js.html +3 -3
- package/docs/v2/user_profile.js.html +2 -2
- package/docs/v2/user_sessions.js.html +2 -2
- package/docs/v2/user_types.js.html +4 -2
- package/docs/v2/user_user-management-system.js.html +2 -2
- package/jest.config.js +0 -0
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/services/imageSRCBuilder.js +1 -1
- package/src/services/imageSRCVerify.js +1 -1
- package/src/services/sanity.js +3 -3
- package/test/dataContext.test.js +0 -0
- package/test/imageSRCBuilder.test.js +1 -1
- package/test/imageSRCVerify.test.js +4 -4
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
package/package.json
CHANGED
|
@@ -137,5 +137,5 @@ export function applyCloudflareWrapper(url, options) {
|
|
|
137
137
|
|
|
138
138
|
const optionsString = cloudflareOptions.length > 0 ? cloudflareOptions.join(',') : ''
|
|
139
139
|
|
|
140
|
-
return `https://www.musora
|
|
140
|
+
return `https://www.musora.com/cdn-cgi/image/${optionsString}/${url}`
|
|
141
141
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* // Check a Sanity URL inside a Cloudflare URL
|
|
17
|
-
* verifyImageSRC('https://www.musora
|
|
17
|
+
* verifyImageSRC('https://www.musora.com/cdn-cgi/image/width=500,quality=95/https://cdn.sanity.io/images/4032r8py/staging/504c4e3393170f937a579de6f3c75c457b0c9e65-640x360.jpg');
|
|
18
18
|
*/
|
|
19
19
|
export function verifyImageSRC(src) {
|
|
20
20
|
// Exit early if the URL is empty
|
package/src/services/sanity.js
CHANGED
|
@@ -979,7 +979,7 @@ export async function fetchAllFilterOptions(
|
|
|
979
979
|
|
|
980
980
|
return coachId
|
|
981
981
|
? `brand == '${brand}' && status == "published" && references(*[_type=='instructor' && railcontent_id == ${coachId}]._id) ${filterWithoutOption || ''} ${term ? ` && (title match "${term}" || album match "${term}" || artist->name match "${term}" || genre[]->name match "${term}")` : ''}`
|
|
982
|
-
: `_type == '${contentType}' && brand == "${brand}"${includeStatusFilter ? statusFilter : ''}${style && excludeFilter !== 'style' ? ` && '${style}' in genre[]->name` : ''}${artist && excludeFilter !== 'artist' ? ` && artist->name ==
|
|
982
|
+
: `_type == '${contentType}' && brand == "${brand}"${includeStatusFilter ? statusFilter : ''}${style && excludeFilter !== 'style' ? ` && '${style}' in genre[]->name` : ''}${artist && excludeFilter !== 'artist' ? ` && artist->name == "${artist}"` : ''} ${progressFilter} ${filterWithoutOption || ''} ${term ? ` && (title match "${term}" || album match "${term}" || artist->name match "${term}" || genre[]->name match "${term}")` : ''}`
|
|
983
983
|
}
|
|
984
984
|
|
|
985
985
|
const metaData = processMetadata(brand, contentType, true)
|
|
@@ -1743,7 +1743,7 @@ export async function fetchArtistLessons(
|
|
|
1743
1743
|
const now = getSanityDate(new Date())
|
|
1744
1744
|
const query = `{
|
|
1745
1745
|
"entity":
|
|
1746
|
-
*[_type == 'artist' && name ==
|
|
1746
|
+
*[_type == 'artist' && name == "${name}"]
|
|
1747
1747
|
{'type': _type, name, 'thumbnail_url':thumbnail_url.asset->url,
|
|
1748
1748
|
'lessons_count': count(*[${addType} brand == '${brand}' && references(^._id)]),
|
|
1749
1749
|
'lessons': *[${addType} brand == '${brand}' && references(^._id) && (status in ['published'] || (status == 'scheduled' && defined(published_on) && published_on >= '${now}')) ${searchFilter} ${includedFieldsFilter} ${progressFilter}]{${fieldsString}}
|
|
@@ -1797,7 +1797,7 @@ export async function fetchGenreLessons(
|
|
|
1797
1797
|
const now = getSanityDate(new Date())
|
|
1798
1798
|
const query = `{
|
|
1799
1799
|
"entity":
|
|
1800
|
-
*[_type == 'genre' && name ==
|
|
1800
|
+
*[_type == 'genre' && name == "${name}"]
|
|
1801
1801
|
{'type': _type, name, 'thumbnail_url':thumbnail_url.asset->url,
|
|
1802
1802
|
'lessons_count': count(*[${addType} brand == '${brand}' && references(^._id)]),
|
|
1803
1803
|
'lessons': *[${addType} brand == '${brand}' && references(^._id) && (status in ['published'] || (status == 'scheduled' && defined(published_on) && published_on >= '${now}')) ${searchFilter} ${includedFieldsFilter} ${progressFilter}]{${fieldsString}}
|
package/test/dataContext.test.js
CHANGED
|
File without changes
|
|
@@ -30,7 +30,7 @@ describe('imageSRCBuilder', function () {
|
|
|
30
30
|
height: height,
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
-
const expected = `https://www.musora
|
|
33
|
+
const expected = `https://www.musora.com/cdn-cgi/image/width=${width},height=${height},quality=${quality}/${url}`
|
|
34
34
|
|
|
35
35
|
expect(resultingURL).toStrictEqual(expected)
|
|
36
36
|
})
|
|
@@ -81,7 +81,7 @@ describe('Image URL Verification', () => {
|
|
|
81
81
|
test('should extract and validate Sanity URL from Cloudflare wrapper', () => {
|
|
82
82
|
// Arrange
|
|
83
83
|
const url =
|
|
84
|
-
'https://www.musora
|
|
84
|
+
'https://www.musora.com/cdn-cgi/image/width=500,quality=95/https://cdn.sanity.io/images/4032r8py/staging/504c4e3393170f937a579de6f3c75c457b0c9e65-640x360.jpg'
|
|
85
85
|
|
|
86
86
|
// Act
|
|
87
87
|
verifyImageSRC(url)
|
|
@@ -96,7 +96,7 @@ describe('Image URL Verification', () => {
|
|
|
96
96
|
test('should not warn for Cloudflare wrapped Sanity URL with parameters', () => {
|
|
97
97
|
// Arrange
|
|
98
98
|
const url =
|
|
99
|
-
'https://www.musora
|
|
99
|
+
'https://www.musora.com/cdn-cgi/image/width=500,quality=95/https://cdn.sanity.io/images/4032r8py/staging/504c4e3393170f937a579de6f3c75c457b0c9e65-640x360.jpg?w=500&q=95'
|
|
100
100
|
|
|
101
101
|
// Act
|
|
102
102
|
verifyImageSRC(url)
|
|
@@ -125,7 +125,7 @@ describe('Image URL Verification', () => {
|
|
|
125
125
|
test('should extract Sanity URL from Cloudflare wrapper', () => {
|
|
126
126
|
// Arrange
|
|
127
127
|
const wrappedUrl =
|
|
128
|
-
'https://www.musora
|
|
128
|
+
'https://www.musora.com/cdn-cgi/image/width=500,quality=95/https://cdn.sanity.io/images/123/production/image.jpg'
|
|
129
129
|
const expectedExtracted = 'https://cdn.sanity.io/images/123/production/image.jpg'
|
|
130
130
|
|
|
131
131
|
// Act
|
|
@@ -148,7 +148,7 @@ describe('Image URL Verification', () => {
|
|
|
148
148
|
|
|
149
149
|
test('should handle malformed Cloudflare URLs gracefully', () => {
|
|
150
150
|
// Arrange
|
|
151
|
-
const malformedUrl = 'https://www.musora
|
|
151
|
+
const malformedUrl = 'https://www.musora.com/cdn-cgi/image/width=500'
|
|
152
152
|
|
|
153
153
|
// Act
|
|
154
154
|
const result = extractSanityUrl(malformedUrl)
|
package/test/localStorageMock.js
CHANGED
|
File without changes
|
package/test/log.js
CHANGED
|
File without changes
|