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.
Files changed (86) hide show
  1. package/.claude/settings.local.json +17 -0
  2. package/.github/workflows/conventional-commits.yaml +0 -0
  3. package/.github/workflows/node.js.yml +0 -0
  4. package/.prettierignore +0 -0
  5. package/.prettierrc +0 -0
  6. package/CHANGELOG.md +15 -0
  7. package/docs/v2/Content.html +269 -0
  8. package/docs/v2/ContentOrganization.html +2 -2
  9. package/docs/v2/Forums.html +2 -2
  10. package/docs/v2/Gamification.html +2 -2
  11. package/docs/v2/TestUser.html +2 -2
  12. package/docs/v2/UserManagementSystem.html +2 -2
  13. package/docs/v2/api_types.js.html +2 -2
  14. package/docs/v2/config.js.html +5 -2
  15. package/docs/v2/content-org_content-org.js.html +2 -2
  16. package/docs/v2/content-org_guided-courses.ts.html +2 -2
  17. package/docs/v2/content-org_learning-paths.ts.html +194 -59
  18. package/docs/v2/content-org_playlists-types.js.html +2 -2
  19. package/docs/v2/content-org_playlists.js.html +2 -2
  20. package/docs/v2/content.js.html +88 -10
  21. package/docs/v2/content_artist.ts.html +206 -0
  22. package/docs/v2/content_content.ts.html +77 -0
  23. package/docs/v2/content_genre.ts.html +209 -0
  24. package/docs/v2/content_instructor.ts.html +206 -0
  25. package/docs/v2/forums_categories.ts.html +22 -3
  26. package/docs/v2/forums_forums.ts.html +2 -2
  27. package/docs/v2/forums_posts.ts.html +22 -3
  28. package/docs/v2/forums_threads.ts.html +23 -10
  29. package/docs/v2/gamification_awards.ts.html +26 -12
  30. package/docs/v2/gamification_gamification.js.html +2 -2
  31. package/docs/v2/global.html +56 -8
  32. package/docs/v2/index.html +2 -2
  33. package/docs/v2/liveTesting.ts.html +2 -2
  34. package/docs/v2/module-Accounts.html +202 -13
  35. package/docs/v2/module-Artist.html +993 -0
  36. package/docs/v2/module-Awards.html +106 -6
  37. package/docs/v2/module-Config.html +5 -4
  38. package/docs/v2/module-Content-Services-V2.html +440 -9
  39. package/docs/v2/module-Forums.html +1398 -192
  40. package/docs/v2/module-Genre.html +981 -0
  41. package/docs/v2/module-GuidedCourses.html +2 -2
  42. package/docs/v2/module-Instructor.html +929 -0
  43. package/docs/v2/module-Interests.html +2 -2
  44. package/docs/v2/module-LearningPaths.html +1276 -182
  45. package/docs/v2/module-Onboarding.html +32 -8
  46. package/docs/v2/module-Payments.html +2 -2
  47. package/docs/v2/module-Permissions.html +2 -2
  48. package/docs/v2/module-Playlists.html +2 -2
  49. package/docs/v2/module-ProgressRow.html +2 -2
  50. package/docs/v2/module-Railcontent-Services.html +34 -626
  51. package/docs/v2/module-Sanity-Services.html +803 -1722
  52. package/docs/v2/module-Sessions.html +2 -2
  53. package/docs/v2/module-UserActivity.html +70 -116
  54. package/docs/v2/module-UserChat.html +2 -2
  55. package/docs/v2/module-UserManagement.html +2 -2
  56. package/docs/v2/module-UserMemberships.html +2 -2
  57. package/docs/v2/module-UserNotifications.html +2 -2
  58. package/docs/v2/module-UserProfile.html +2 -2
  59. package/docs/v2/progress-row_method-card.js.html +46 -47
  60. package/docs/v2/railcontent.js.html +14 -125
  61. package/docs/v2/sanity.js.html +247 -320
  62. package/docs/v2/userActivity.js.html +93 -169
  63. package/docs/v2/user_account.ts.html +41 -13
  64. package/docs/v2/user_chat.js.html +2 -2
  65. package/docs/v2/user_interests.js.html +2 -2
  66. package/docs/v2/user_management.js.html +2 -2
  67. package/docs/v2/user_memberships.ts.html +2 -2
  68. package/docs/v2/user_notifications.js.html +2 -2
  69. package/docs/v2/user_onboarding.ts.html +99 -4
  70. package/docs/v2/user_payments.ts.html +2 -2
  71. package/docs/v2/user_permissions.js.html +3 -3
  72. package/docs/v2/user_profile.js.html +2 -2
  73. package/docs/v2/user_sessions.js.html +2 -2
  74. package/docs/v2/user_types.js.html +4 -2
  75. package/docs/v2/user_user-management-system.js.html +2 -2
  76. package/jest.config.js +0 -0
  77. package/link_mcs.sh +0 -0
  78. package/package.json +1 -1
  79. package/src/services/imageSRCBuilder.js +1 -1
  80. package/src/services/imageSRCVerify.js +1 -1
  81. package/src/services/sanity.js +3 -3
  82. package/test/dataContext.test.js +0 -0
  83. package/test/imageSRCBuilder.test.js +1 -1
  84. package/test/imageSRCVerify.test.js +4 -4
  85. package/test/localStorageMock.js +0 -0
  86. package/test/log.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.7.0",
3
+ "version": "1.7.5",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -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-cdn.com/cdn-cgi/image/${optionsString}/${url}`
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-cdn.com/cdn-cgi/image/width=500,quality=95/https://cdn.sanity.io/images/4032r8py/staging/504c4e3393170f937a579de6f3c75c457b0c9e65-640x360.jpg');
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
@@ -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 == '${artist}'` : ''} ${progressFilter} ${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 == "${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 == '${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 == '${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}}
File without changes
@@ -30,7 +30,7 @@ describe('imageSRCBuilder', function () {
30
30
  height: height,
31
31
  })
32
32
 
33
- const expected = `https://www.musora-cdn.com/cdn-cgi/image/width=${width},height=${height},quality=${quality}/${url}`
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-cdn.com/cdn-cgi/image/width=500,quality=95/https://cdn.sanity.io/images/4032r8py/staging/504c4e3393170f937a579de6f3c75c457b0c9e65-640x360.jpg'
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-cdn.com/cdn-cgi/image/width=500,quality=95/https://cdn.sanity.io/images/4032r8py/staging/504c4e3393170f937a579de6f3c75c457b0c9e65-640x360.jpg?w=500&q=95'
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-cdn.com/cdn-cgi/image/width=500,quality=95/https://cdn.sanity.io/images/123/production/image.jpg'
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-cdn.com/cdn-cgi/image/width=500'
151
+ const malformedUrl = 'https://www.musora.com/cdn-cgi/image/width=500'
152
152
 
153
153
  // Act
154
154
  const result = extractSanityUrl(malformedUrl)
File without changes
package/test/log.js CHANGED
File without changes