musora-content-services 2.31.2 → 2.32.0

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 (48) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/docs/ContentOrganization.html +2 -2
  3. package/docs/Gamification.html +2 -2
  4. package/docs/UserManagementSystem.html +2 -2
  5. package/docs/api_types.js.html +2 -2
  6. package/docs/config.js.html +2 -8
  7. package/docs/content-org_content-org.js.html +2 -2
  8. package/docs/content-org_playlists-types.js.html +12 -2
  9. package/docs/content-org_playlists.js.html +16 -16
  10. package/docs/content.js.html +71 -39
  11. package/docs/gamification_awards.js.html +54 -35
  12. package/docs/gamification_gamification.js.html +2 -2
  13. package/docs/gamification_types.js.html +7 -25
  14. package/docs/global.html +298 -322
  15. package/docs/index.html +2 -2
  16. package/docs/module-Awards.html +2 -2
  17. package/docs/module-Config.html +4 -8
  18. package/docs/module-Content-Services-V2.html +455 -8
  19. package/docs/module-Interests.html +2 -2
  20. package/docs/module-Permissions.html +2 -2
  21. package/docs/module-Playlists.html +18 -17
  22. package/docs/module-Railcontent-Services.html +479 -35
  23. package/docs/module-Sanity-Services.html +45 -173
  24. package/docs/module-Sessions.html +2 -2
  25. package/docs/module-UserActivity.html +189 -21
  26. package/docs/module-UserChat.html +2 -2
  27. package/docs/module-UserManagement.html +410 -8
  28. package/docs/module-UserNotifications.html +203 -8
  29. package/docs/module-UserProfile.html +2 -2
  30. package/docs/railcontent.js.html +65 -37
  31. package/docs/sanity.js.html +120 -185
  32. package/docs/userActivity.js.html +448 -466
  33. package/docs/user_chat.js.html +2 -2
  34. package/docs/user_interests.js.html +2 -2
  35. package/docs/user_management.js.html +32 -2
  36. package/docs/user_notifications.js.html +27 -5
  37. package/docs/user_permissions.js.html +2 -2
  38. package/docs/user_profile.js.html +3 -9
  39. package/docs/user_sessions.js.html +2 -2
  40. package/docs/user_types.js.html +10 -2
  41. package/docs/user_user-management-system.js.html +2 -2
  42. package/package.json +1 -1
  43. package/src/contentTypeConfig.js +6 -1
  44. package/src/index.d.ts +6 -0
  45. package/src/index.js +6 -0
  46. package/src/services/sanity.js +14 -19
  47. package/src/services/user/management.js +30 -0
  48. package/src/services/user/types.js +8 -0
@@ -9,6 +9,16 @@ import { HttpClient } from '../../infrastructure/http/HttpClient'
9
9
 
10
10
  const baseUrl = `/api/user-management-system`
11
11
 
12
+ /**
13
+ * Fetches the blocked users for the current user.
14
+ * @returns {Promise<Array<BlockedUsersDTO>>}
15
+ */
16
+ export async function blockedUsers() {
17
+ const url = `${baseUrl}/v1/users/${globalConfig.sessionConfig.userId}/blocked`
18
+ const httpClient = new HttpClient(globalConfig.baseUrl, globalConfig.sessionConfig.token)
19
+ return httpClient.get(url)
20
+ }
21
+
12
22
  /**
13
23
  * Block the provided user
14
24
  * @param userId
@@ -116,3 +126,23 @@ export async function getUserData(userId = globalConfig.sessionConfig.userId) {
116
126
  const httpClient = new HttpClient(globalConfig.baseUrl, globalConfig.sessionConfig.token)
117
127
  return httpClient.get(apiUrl)
118
128
  }
129
+
130
+ /**
131
+ * @param displayName - The display name to check for availability.
132
+ * @returns {Promise<{ available: boolean }>} - An object indicating if the display name is available.
133
+ */
134
+ export async function isDisplayNameAvailable(displayName) {
135
+ const apiUrl = `${baseUrl}/v1/users/display-names/available?display_name=${encodeURIComponent(displayName)}`
136
+ const httpClient = new HttpClient(globalConfig.baseUrl, globalConfig.sessionConfig.token)
137
+ return httpClient.get(apiUrl)
138
+ }
139
+
140
+ /**
141
+ * @param newDisplayName - The new display name to set for the user.
142
+ * @returns {Promise<User>} - A promise that resolves when the display name is updated.
143
+ */
144
+ export async function updateDisplayName(newDisplayName) {
145
+ const apiUrl = `${baseUrl}/v1/users/${globalConfig.sessionConfig.userId}/display-name`
146
+ const httpClient = new HttpClient(globalConfig.baseUrl, globalConfig.sessionConfig.token)
147
+ return httpClient.put(apiUrl, { display_name: newDisplayName })
148
+ }
@@ -134,3 +134,11 @@
134
134
  * @property {number} forum_post_likes
135
135
  * @property {number} experience_points
136
136
  */
137
+
138
+ /**
139
+ * @typedef {Object} BlockedUsersDTO
140
+ *
141
+ * @property {number} id
142
+ * @property {string} display_name
143
+ * @property {string|null} profile_picture_url
144
+ */