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.
- package/CHANGELOG.md +14 -0
- package/docs/ContentOrganization.html +2 -2
- package/docs/Gamification.html +2 -2
- package/docs/UserManagementSystem.html +2 -2
- package/docs/api_types.js.html +2 -2
- package/docs/config.js.html +2 -8
- package/docs/content-org_content-org.js.html +2 -2
- package/docs/content-org_playlists-types.js.html +12 -2
- package/docs/content-org_playlists.js.html +16 -16
- package/docs/content.js.html +71 -39
- package/docs/gamification_awards.js.html +54 -35
- package/docs/gamification_gamification.js.html +2 -2
- package/docs/gamification_types.js.html +7 -25
- package/docs/global.html +298 -322
- package/docs/index.html +2 -2
- package/docs/module-Awards.html +2 -2
- package/docs/module-Config.html +4 -8
- package/docs/module-Content-Services-V2.html +455 -8
- package/docs/module-Interests.html +2 -2
- package/docs/module-Permissions.html +2 -2
- package/docs/module-Playlists.html +18 -17
- package/docs/module-Railcontent-Services.html +479 -35
- package/docs/module-Sanity-Services.html +45 -173
- package/docs/module-Sessions.html +2 -2
- package/docs/module-UserActivity.html +189 -21
- package/docs/module-UserChat.html +2 -2
- package/docs/module-UserManagement.html +410 -8
- package/docs/module-UserNotifications.html +203 -8
- package/docs/module-UserProfile.html +2 -2
- package/docs/railcontent.js.html +65 -37
- package/docs/sanity.js.html +120 -185
- package/docs/userActivity.js.html +448 -466
- package/docs/user_chat.js.html +2 -2
- package/docs/user_interests.js.html +2 -2
- package/docs/user_management.js.html +32 -2
- package/docs/user_notifications.js.html +27 -5
- package/docs/user_permissions.js.html +2 -2
- package/docs/user_profile.js.html +3 -9
- package/docs/user_sessions.js.html +2 -2
- package/docs/user_types.js.html +10 -2
- package/docs/user_user-management-system.js.html +2 -2
- package/package.json +1 -1
- package/src/contentTypeConfig.js +6 -1
- package/src/index.d.ts +6 -0
- package/src/index.js +6 -0
- package/src/services/sanity.js +14 -19
- package/src/services/user/management.js +30 -0
- 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
|
+
*/
|