@iblai/data-layer 1.13.5 → 1.14.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/dist/index.d.ts +308 -2
- package/dist/index.esm.js +39 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +40 -1
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/user/__tests__/user-profile-summary.test.d.ts +1 -0
- package/dist/src/features/user/api-slice.d.ts +270 -1
- package/dist/src/features/user/constants.d.ts +5 -0
- package/dist/src/features/user/types.d.ts +35 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41001,11 +41001,19 @@ const USERS_ENDPOINTS = {
|
|
|
41001
41001
|
service: exports.SERVICES.DM,
|
|
41002
41002
|
path: () => `/api/core/users/platform-metadata/`,
|
|
41003
41003
|
},
|
|
41004
|
+
// Read-only profile-card allowlist served from DM-local data (no edX call).
|
|
41005
|
+
// Open to the user, DM admins, platform admins of the user and watchers of
|
|
41006
|
+
// the user, which the metadata endpoints above refuse.
|
|
41007
|
+
GET_USER_PROFILE_SUMMARY: {
|
|
41008
|
+
service: exports.SERVICES.DM,
|
|
41009
|
+
path: () => `/api/core/users/profile/summary/`,
|
|
41010
|
+
},
|
|
41004
41011
|
};
|
|
41005
41012
|
const USERS_QUERY_KEYS = {
|
|
41006
41013
|
GET_USER_METADATA: () => ['USER_METADATA'],
|
|
41007
41014
|
GET_USER_PLATFORM_METADATA: () => ['USER_PLATFORM_METADATA'],
|
|
41008
41015
|
GET_USER_METADATA_EDX: () => ['USER_METADATA_EDX'],
|
|
41016
|
+
GET_USER_PROFILE_SUMMARY: () => ['USER_PROFILE_SUMMARY'],
|
|
41009
41017
|
RESET_PASSWORD: () => ['RESET_PASSWORD'],
|
|
41010
41018
|
UPDATE_USER_ROLES: () => ['UPDATE_USER_ROLES'],
|
|
41011
41019
|
GET_USER_ROLES: () => ['USER_ROLES'],
|
|
@@ -41024,6 +41032,7 @@ const userApiSlice = react.createApi({
|
|
|
41024
41032
|
...USERS_QUERY_KEYS.GET_USER_METADATA_EDX(),
|
|
41025
41033
|
...USERS_QUERY_KEYS.GET_USER_PLATFORM_METADATA(),
|
|
41026
41034
|
...USERS_QUERY_KEYS.GET_USER_ROLES(),
|
|
41035
|
+
...USERS_QUERY_KEYS.GET_USER_PROFILE_SUMMARY(),
|
|
41027
41036
|
featureTags.PLATFORM_USERS,
|
|
41028
41037
|
],
|
|
41029
41038
|
endpoints: (builder) => ({
|
|
@@ -41125,6 +41134,34 @@ const userApiSlice = react.createApi({
|
|
|
41125
41134
|
}),
|
|
41126
41135
|
providesTags: USERS_QUERY_KEYS.GET_USER_METADATA_EDX(),
|
|
41127
41136
|
}),
|
|
41137
|
+
/**
|
|
41138
|
+
* A user's profile-card fields, read-only, from DM-local data. Unlike
|
|
41139
|
+
* `getUserMetadata` it is also served to watchers of the user, so use it
|
|
41140
|
+
* when previewing someone else's profile.
|
|
41141
|
+
*/
|
|
41142
|
+
getUserProfileSummary: builder.query({
|
|
41143
|
+
query: ({ username, email, userId, platformKey }) => {
|
|
41144
|
+
const params = {};
|
|
41145
|
+
if (username) {
|
|
41146
|
+
params.username = username;
|
|
41147
|
+
}
|
|
41148
|
+
if (email) {
|
|
41149
|
+
params.email = email;
|
|
41150
|
+
}
|
|
41151
|
+
if (userId !== undefined) {
|
|
41152
|
+
params.user_id = userId;
|
|
41153
|
+
}
|
|
41154
|
+
if (platformKey) {
|
|
41155
|
+
params.platform_key = platformKey;
|
|
41156
|
+
}
|
|
41157
|
+
return {
|
|
41158
|
+
url: USERS_ENDPOINTS.GET_USER_PROFILE_SUMMARY.path(),
|
|
41159
|
+
service: USERS_ENDPOINTS.GET_USER_PROFILE_SUMMARY.service,
|
|
41160
|
+
params,
|
|
41161
|
+
};
|
|
41162
|
+
},
|
|
41163
|
+
providesTags: USERS_QUERY_KEYS.GET_USER_PROFILE_SUMMARY(),
|
|
41164
|
+
}),
|
|
41128
41165
|
uploadProfileImage: builder.mutation({
|
|
41129
41166
|
query: ({ file, filename, username }) => {
|
|
41130
41167
|
const formData = new FormData();
|
|
@@ -41185,7 +41222,7 @@ const userApiSlice = react.createApi({
|
|
|
41185
41222
|
}),
|
|
41186
41223
|
}),
|
|
41187
41224
|
});
|
|
41188
|
-
const { useGetUserMetadataQuery, useLazyGetUserMetadataQuery, useUpdateUserMetadataMutation, useUpdateUserAccountMutation, useResetPasswordMutation, useUpdateUserRoleMutation, useGetUserRolesQuery, useLazyGetUserRolesQuery, useUploadProfileImageMutation, useRemoveProfileImageMutation, useGetUserMetadataEdxQuery, useLazyGetUserMetadataEdxQuery, useUpdateUserMetadataEdxMutation, useGetUserPlatformMetadataQuery, useLazyGetUserPlatformMetadataQuery, useUpdateUserPlatformMetadataMutation, } = userApiSlice;
|
|
41225
|
+
const { useGetUserMetadataQuery, useLazyGetUserMetadataQuery, useUpdateUserMetadataMutation, useUpdateUserAccountMutation, useResetPasswordMutation, useUpdateUserRoleMutation, useGetUserRolesQuery, useLazyGetUserRolesQuery, useUploadProfileImageMutation, useRemoveProfileImageMutation, useGetUserMetadataEdxQuery, useLazyGetUserMetadataEdxQuery, useGetUserProfileSummaryQuery, useLazyGetUserProfileSummaryQuery, useUpdateUserMetadataEdxMutation, useGetUserPlatformMetadataQuery, useLazyGetUserPlatformMetadataQuery, useUpdateUserPlatformMetadataMutation, } = userApiSlice;
|
|
41189
41226
|
|
|
41190
41227
|
/**
|
|
41191
41228
|
* Scope a role row applies to, read off its `org`/`course` fields:
|
|
@@ -49115,6 +49152,7 @@ exports.useGetUserMetadataQuery = useGetUserMetadataQuery;
|
|
|
49115
49152
|
exports.useGetUserMetricsPieChartQuery = useGetUserMetricsPieChartQuery;
|
|
49116
49153
|
exports.useGetUserMetricsQuery = useGetUserMetricsQuery;
|
|
49117
49154
|
exports.useGetUserPlatformMetadataQuery = useGetUserPlatformMetadataQuery;
|
|
49155
|
+
exports.useGetUserProfileSummaryQuery = useGetUserProfileSummaryQuery;
|
|
49118
49156
|
exports.useGetUserProjectDetailsQuery = useGetUserProjectDetailsQuery;
|
|
49119
49157
|
exports.useGetUserProjectsQuery = useGetUserProjectsQuery;
|
|
49120
49158
|
exports.useGetUserReportedSkillsQuery = useGetUserReportedSkillsQuery;
|
|
@@ -49325,6 +49363,7 @@ exports.useLazyGetUserMemorySettingsQuery = useLazyGetUserMemorySettingsQuery;
|
|
|
49325
49363
|
exports.useLazyGetUserMetadataEdxQuery = useLazyGetUserMetadataEdxQuery;
|
|
49326
49364
|
exports.useLazyGetUserMetadataQuery = useLazyGetUserMetadataQuery;
|
|
49327
49365
|
exports.useLazyGetUserPlatformMetadataQuery = useLazyGetUserPlatformMetadataQuery;
|
|
49366
|
+
exports.useLazyGetUserProfileSummaryQuery = useLazyGetUserProfileSummaryQuery;
|
|
49328
49367
|
exports.useLazyGetUserProjectDetailsQuery = useLazyGetUserProjectDetailsQuery;
|
|
49329
49368
|
exports.useLazyGetUserProjectsQuery = useLazyGetUserProjectsQuery;
|
|
49330
49369
|
exports.useLazyGetUserReportedSkillsQuery = useLazyGetUserReportedSkillsQuery;
|