musora-content-services 2.9.3 → 2.9.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 (52) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/docs/ContentOrganization.html +0 -0
  3. package/docs/Gamification.html +0 -0
  4. package/docs/UserManagementSystem.html +0 -0
  5. package/docs/api_types.js.html +0 -0
  6. package/docs/config.js.html +0 -0
  7. package/docs/content-org_content-org.js.html +0 -0
  8. package/docs/content-org_playlists-types.js.html +0 -0
  9. package/docs/content-org_playlists.js.html +0 -0
  10. package/docs/content.js.html +0 -0
  11. package/docs/gamification_awards.js.html +0 -0
  12. package/docs/gamification_gamification.js.html +0 -0
  13. package/docs/gamification_types.js.html +0 -0
  14. package/docs/global.html +0 -0
  15. package/docs/index.html +0 -0
  16. package/docs/module-Awards.html +0 -0
  17. package/docs/module-Config.html +0 -0
  18. package/docs/module-Content-Services-V2.html +0 -0
  19. package/docs/module-Interests.html +0 -0
  20. package/docs/module-Permissions.html +0 -0
  21. package/docs/module-Playlists.html +0 -0
  22. package/docs/module-Railcontent-Services.html +0 -0
  23. package/docs/module-Sanity-Services.html +0 -0
  24. package/docs/module-Sessions.html +0 -0
  25. package/docs/module-UserActivity.html +0 -0
  26. package/docs/module-UserChat.html +0 -0
  27. package/docs/module-UserManagement.html +0 -0
  28. package/docs/module-UserNotifications.html +0 -0
  29. package/docs/module-UserProfile.html +0 -0
  30. package/docs/railcontent.js.html +0 -0
  31. package/docs/sanity.js.html +0 -0
  32. package/docs/userActivity.js.html +0 -0
  33. package/docs/user_chat.js.html +0 -0
  34. package/docs/user_interests.js.html +0 -0
  35. package/docs/user_management.js.html +0 -0
  36. package/docs/user_notifications.js.html +0 -0
  37. package/docs/user_permissions.js.html +0 -0
  38. package/docs/user_profile.js.html +0 -0
  39. package/docs/user_sessions.js.html +0 -0
  40. package/docs/user_types.js.html +0 -0
  41. package/docs/user_user-management-system.js.html +0 -0
  42. package/link_mcs.sh +0 -0
  43. package/package.json +1 -1
  44. package/src/index.d.ts +2 -0
  45. package/src/index.js +2 -0
  46. package/src/services/content-org/playlists-types.js +0 -0
  47. package/src/services/content-org/playlists.js +0 -0
  48. package/src/services/railcontent.js +0 -0
  49. package/src/services/sanity.js +2 -1
  50. package/src/services/user/chat.js +0 -0
  51. package/src/services/user/notifications.js +22 -0
  52. package/src/services/userActivity.js +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.9.5](https://github.com/railroadmedia/musora-content-services/compare/v2.9.4...v2.9.5) (2025-06-18)
6
+
7
+ ### [2.9.4](https://github.com/railroadmedia/musora-content-services/compare/v2.9.3...v2.9.4) (2025-06-17)
8
+
5
9
  ### [2.9.3](https://github.com/railroadmedia/musora-content-services/compare/v2.9.2...v2.9.3) (2025-06-16)
6
10
 
7
11
  ### [2.9.2](https://github.com/railroadmedia/musora-content-services/compare/v2.9.0...v2.9.2) (2025-06-16)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/docs/global.html CHANGED
File without changes
package/docs/index.html CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/link_mcs.sh CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.9.3",
3
+ "version": "2.9.5",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.d.ts CHANGED
@@ -237,6 +237,7 @@ import {
237
237
  import {
238
238
  deleteNotification,
239
239
  fetchNotifications,
240
+ fetchUnreadCount,
240
241
  markAllNotificationsAsRead,
241
242
  markNotificationAsRead,
242
243
  markNotificationAsUnread
@@ -383,6 +384,7 @@ declare module 'musora-content-services' {
383
384
  fetchTopComment,
384
385
  fetchTopLevelParentId,
385
386
  fetchUninterests,
387
+ fetchUnreadCount,
386
388
  fetchUpcomingEvents,
387
389
  fetchUserAward,
388
390
  fetchUserBadges,
package/src/index.js CHANGED
@@ -237,6 +237,7 @@ import {
237
237
  import {
238
238
  deleteNotification,
239
239
  fetchNotifications,
240
+ fetchUnreadCount,
240
241
  markAllNotificationsAsRead,
241
242
  markNotificationAsRead,
242
243
  markNotificationAsUnread
@@ -382,6 +383,7 @@ export {
382
383
  fetchTopComment,
383
384
  fetchTopLevelParentId,
384
385
  fetchUninterests,
386
+ fetchUnreadCount,
385
387
  fetchUpcomingEvents,
386
388
  fetchUserAward,
387
389
  fetchUserBadges,
File without changes
File without changes
File without changes
@@ -1307,11 +1307,12 @@ export async function fetchLessonContent(railContentId) {
1307
1307
  xp,
1308
1308
  stbs,ds2stbs, bdsStbs,
1309
1309
  ...select(
1310
- defined(live_event_start_time) && defined(live_event_end_time) => {
1310
+ defined(live_event_start_time) => {
1311
1311
  "live_event_start_time": live_event_start_time,
1312
1312
  "live_event_end_time": live_event_end_time,
1313
1313
  "live_event_youtube_id": live_event_youtube_id,
1314
1314
  "videoId": coalesce(live_event_youtube_id, video.external_id),
1315
+ "live_event_is_global": live_global_event == true
1315
1316
  }
1316
1317
  )`
1317
1318
  const query = await buildQuery(`railcontent_id == ${railContentId}`, filterParams, fields, {
File without changes
@@ -118,3 +118,25 @@ export async function deleteNotification(notificationId) {
118
118
  const url = `${baseUrl}/v1/${notificationId}`
119
119
  return fetchHandler(url, 'delete')
120
120
  }
121
+
122
+ /**
123
+ * Fetches the count of unread notifications for the current user in a given brand context.
124
+ *
125
+ * @param {Object} [options={}] - Options for fetching unread count.
126
+ * @param {string} options.brand - The brand to filter unread notifications by (required).
127
+ * @returns {Promise<Object>} - A promise that resolves to an object with the unread count.
128
+ *
129
+ * @throws {Error} If the brand is not provided.
130
+ *
131
+ * @example
132
+ * fetchUnreadCount({ brand: 'drumeo' })
133
+ * .then(data => console.log(data.unread_count))
134
+ * .catch(error => console.error(error));
135
+ */
136
+ export async function fetchUnreadCount({ brand = null} = {}) {
137
+ if (!brand) {
138
+ throw new Error('brand is required')
139
+ }
140
+ const url = `${baseUrl}/v1/unread-count?brand=${brand}`
141
+ return fetchHandler(url, 'get')
142
+ }
File without changes