@iblai/data-layer 1.13.5 → 1.14.1
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 +662 -2
- package/dist/index.esm.js +73 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +76 -2
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/analytics/api-slice.d.ts +278 -1
- package/dist/src/features/analytics/constants.d.ts +11 -1
- package/dist/src/features/analytics/types.d.ts +77 -0
- 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/tests/features/analytics/api-slice-endpoints.test.d.ts +1 -0
- package/dist/tests/features/analytics/financial-stats-deprecated.test.d.ts +1 -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:
|
|
@@ -42935,6 +42972,16 @@ const NON_AI_ANALYTICS_ENDPOINTS = {
|
|
|
42935
42972
|
service: exports.SERVICES.DM,
|
|
42936
42973
|
path: (platform_key, mentor_unique_id, date_filter, start_date, end_date) => `/api/analytics/ratings/?${date_filter ? `date_filter=${date_filter}&` : ''}platform_key=${platform_key}${mentor_unique_id ? `&mentor_unique_id=${mentor_unique_id}` : ''}${start_date ? `&start_date=${start_date}` : ''}${end_date ? `&end_date=${end_date}` : ''}`,
|
|
42937
42974
|
},
|
|
42975
|
+
/** @deprecated Superseded by the Clickhouse cost endpoints. Still routed by the DM. */
|
|
42976
|
+
GET_FINANCIAL_STATS: {
|
|
42977
|
+
service: exports.SERVICES.DM,
|
|
42978
|
+
path: (args) => `/api/analytics/financial/?metric=${args.metric}&${args.all_time ? `all_time=${args.all_time}&` : ''}${args.date_filter ? `date_filter=${args.date_filter}&` : ''}platform_key=${args.platform_key}${args.mentor_unique_id ? `&mentor_unique_id=${args.mentor_unique_id}` : ''}${args.start_date ? `&start_date=${args.start_date}` : ''}${args.end_date ? `&end_date=${args.end_date}` : ''}${buildUsergroupIdsQuery(args.usergroup_ids)}`,
|
|
42979
|
+
},
|
|
42980
|
+
/** @deprecated Superseded by the Clickhouse cost endpoints. Still routed by the DM. */
|
|
42981
|
+
GET_DETAILED_FINANCIAL_STATS: {
|
|
42982
|
+
service: exports.SERVICES.DM,
|
|
42983
|
+
path: (args) => `/api/analytics/financial/details/?${args.metric ? `metric=${args.metric}&` : ''}${args.metrics ? `metrics=${args.metrics}&` : ''}group_by=${args.group_by}&date_filter=${args.date_filter}&platform_key=${args.platform_key}${args.mentor_unique_id ? `&mentor_unique_id=${args.mentor_unique_id}` : ''}${args.start_date ? `&start_date=${args.start_date}` : ''}${args.end_date ? `&end_date=${args.end_date}` : ''}${args.page ? `&page=${args.page}` : ''}${args.limit ? `&limit=${args.limit}` : ''}${args.search ? `&search=${args.search}` : ''}${buildUsergroupIdsQuery(args.usergroup_ids)}`,
|
|
42984
|
+
},
|
|
42938
42985
|
GET_TRANSCRIPTS_MESSAGES: {
|
|
42939
42986
|
service: exports.SERVICES.DM,
|
|
42940
42987
|
path: (args) => `/api/analytics/messages/?platform_key=${args.platform_key}${args.mentor_unique_id ? `&mentor_unique_id=${args.mentor_unique_id}` : ''}${args.search ? `&search=${args.search}` : ''}${args.topic ? `&topic=${args.topic}` : ''}${args.page ? `&page=${args.page}` : ''}${args.limit ? `&limit=${args.limit}` : ''}${buildUsergroupIdsQuery(args.usergroup_ids)}`,
|
|
@@ -43293,6 +43340,18 @@ const analyticsApiSlice = react.createApi({
|
|
|
43293
43340
|
};
|
|
43294
43341
|
},
|
|
43295
43342
|
}),
|
|
43343
|
+
getFinancialStats: builder.query({
|
|
43344
|
+
query: (args) => ({
|
|
43345
|
+
url: NON_AI_ANALYTICS_ENDPOINTS.GET_FINANCIAL_STATS.path(args),
|
|
43346
|
+
service: NON_AI_ANALYTICS_ENDPOINTS.GET_FINANCIAL_STATS.service,
|
|
43347
|
+
}),
|
|
43348
|
+
}),
|
|
43349
|
+
getDetailedFinancialStats: builder.query({
|
|
43350
|
+
query: (args) => ({
|
|
43351
|
+
url: NON_AI_ANALYTICS_ENDPOINTS.GET_DETAILED_FINANCIAL_STATS.path(args),
|
|
43352
|
+
service: NON_AI_ANALYTICS_ENDPOINTS.GET_DETAILED_FINANCIAL_STATS.service,
|
|
43353
|
+
}),
|
|
43354
|
+
}),
|
|
43296
43355
|
getTranscriptsMessages: builder.query({
|
|
43297
43356
|
query: (args) => ({
|
|
43298
43357
|
url: NON_AI_ANALYTICS_ENDPOINTS.GET_TRANSCRIPTS_MESSAGES.path(args),
|
|
@@ -43368,7 +43427,18 @@ const analyticsApiSlice = react.createApi({
|
|
|
43368
43427
|
}),
|
|
43369
43428
|
}),
|
|
43370
43429
|
});
|
|
43371
|
-
const { useGetOverviewSummaryQuery, useGetConversationQuery, useGetMostDiscussedTopicsQuery, useGetAverageMessagesPerSessionQuery, useGetRegisteredUsersTrendQuery, useGetUserMetricsQuery, useGetUserMetricsPieChartQuery, useGetUserCohortsOverTimeQuery, useGetTopStudentsByChatMessagesQuery, useGetTopicOverviewQuery, useGetTopicsSummaryQuery, useGetTopicStatisticsQuery, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetAverageRatingQuery, useGetTenantCostQuery, useGetAgentCostQuery, useGetModelCostsQuery, useGetPerUserCostsQuery,
|
|
43430
|
+
const { useGetOverviewSummaryQuery, useGetConversationQuery, useGetMostDiscussedTopicsQuery, useGetAverageMessagesPerSessionQuery, useGetRegisteredUsersTrendQuery, useGetUserMetricsQuery, useGetUserMetricsPieChartQuery, useGetUserCohortsOverTimeQuery, useGetTopStudentsByChatMessagesQuery, useGetTopicOverviewQuery, useGetTopicsSummaryQuery, useGetTopicStatisticsQuery, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetAverageRatingQuery, useGetTenantCostQuery, useGetAgentCostQuery, useGetModelCostsQuery, useGetPerUserCostsQuery,
|
|
43431
|
+
/**
|
|
43432
|
+
* @deprecated Use `useGetTenantCostQuery` / `useGetAgentCostQuery`. Retained because
|
|
43433
|
+
* `@iblai/web-containers` <= 1.19.11 imports this name, and data-layer is a singleton
|
|
43434
|
+
* peer dependency — removing it breaks those consumers' builds. See iblai/vibe#176.
|
|
43435
|
+
*/
|
|
43436
|
+
useGetFinancialStatsQuery,
|
|
43437
|
+
/**
|
|
43438
|
+
* @deprecated Use `useGetModelCostsQuery` / `useGetPerUserCostsQuery`.
|
|
43439
|
+
* See {@link useGetFinancialStatsQuery}.
|
|
43440
|
+
*/
|
|
43441
|
+
useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesQuery, useGetTranscriptsMessagesDetailsQuery, useTimeTrackingMutation, useGetTranscriptsConversationHeadlineQuery, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetLearnerDetailsQuery, useGetLlmUsageMetricsQuery, useGetLlmUsageTracesQuery, useGetLlmUsageObservationsQuery, } = analyticsApiSlice;
|
|
43372
43442
|
|
|
43373
43443
|
const useLazyGetDownloadReportFromURLQuery = () => {
|
|
43374
43444
|
const fetchReportBlob = react$1.useCallback(({ url }) => {
|
|
@@ -48936,6 +49006,7 @@ exports.useGetCustomMentorsQuery = useGetCustomMentorsQuery;
|
|
|
48936
49006
|
exports.useGetDatasetsQuery = useGetDatasetsQuery;
|
|
48937
49007
|
exports.useGetDepartmentMemberCheckQuery = useGetDepartmentMemberCheckQuery;
|
|
48938
49008
|
exports.useGetDesiredSkillsQuery = useGetDesiredSkillsQuery;
|
|
49009
|
+
exports.useGetDetailedFinancialStatsQuery = useGetDetailedFinancialStatsQuery;
|
|
48939
49010
|
exports.useGetDisclaimersQuery = useGetDisclaimersQuery;
|
|
48940
49011
|
exports.useGetEdxSSOTokenQuery = useGetEdxSSOTokenQuery;
|
|
48941
49012
|
exports.useGetEnrollmentCourseSearchQuery = useGetEnrollmentCourseSearchQuery;
|
|
@@ -48945,6 +49016,7 @@ exports.useGetEvalTaskStatusQuery = useGetEvalTaskStatusQuery;
|
|
|
48945
49016
|
exports.useGetExamInfoQuery = useGetExamInfoQuery;
|
|
48946
49017
|
exports.useGetExternalMappingQuery = useGetExternalMappingQuery;
|
|
48947
49018
|
exports.useGetFileUploadUrlMutation = useGetFileUploadUrlMutation;
|
|
49019
|
+
exports.useGetFinancialStatsQuery = useGetFinancialStatsQuery;
|
|
48948
49020
|
exports.useGetFreeUsageCountQuery = useGetFreeUsageCountQuery;
|
|
48949
49021
|
exports.useGetGlobalMemoriesQuery = useGetGlobalMemoriesQuery;
|
|
48950
49022
|
exports.useGetGradeResultQuery = useGetGradeResultQuery;
|
|
@@ -49115,6 +49187,7 @@ exports.useGetUserMetadataQuery = useGetUserMetadataQuery;
|
|
|
49115
49187
|
exports.useGetUserMetricsPieChartQuery = useGetUserMetricsPieChartQuery;
|
|
49116
49188
|
exports.useGetUserMetricsQuery = useGetUserMetricsQuery;
|
|
49117
49189
|
exports.useGetUserPlatformMetadataQuery = useGetUserPlatformMetadataQuery;
|
|
49190
|
+
exports.useGetUserProfileSummaryQuery = useGetUserProfileSummaryQuery;
|
|
49118
49191
|
exports.useGetUserProjectDetailsQuery = useGetUserProjectDetailsQuery;
|
|
49119
49192
|
exports.useGetUserProjectsQuery = useGetUserProjectsQuery;
|
|
49120
49193
|
exports.useGetUserReportedSkillsQuery = useGetUserReportedSkillsQuery;
|
|
@@ -49325,6 +49398,7 @@ exports.useLazyGetUserMemorySettingsQuery = useLazyGetUserMemorySettingsQuery;
|
|
|
49325
49398
|
exports.useLazyGetUserMetadataEdxQuery = useLazyGetUserMetadataEdxQuery;
|
|
49326
49399
|
exports.useLazyGetUserMetadataQuery = useLazyGetUserMetadataQuery;
|
|
49327
49400
|
exports.useLazyGetUserPlatformMetadataQuery = useLazyGetUserPlatformMetadataQuery;
|
|
49401
|
+
exports.useLazyGetUserProfileSummaryQuery = useLazyGetUserProfileSummaryQuery;
|
|
49328
49402
|
exports.useLazyGetUserProjectDetailsQuery = useLazyGetUserProjectDetailsQuery;
|
|
49329
49403
|
exports.useLazyGetUserProjectsQuery = useLazyGetUserProjectsQuery;
|
|
49330
49404
|
exports.useLazyGetUserReportedSkillsQuery = useLazyGetUserReportedSkillsQuery;
|