@iblai/data-layer 1.12.106 → 1.12.107

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.js CHANGED
@@ -47801,6 +47801,130 @@ const watchedGroupsApiSlice = react.createApi({
47801
47801
  });
47802
47802
  const { useGetWatchedGroupsQuery, useLazyGetWatchedGroupsQuery, useGetWatchedGroupQuery, useLazyGetWatchedGroupQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useGetWatchedUsersQuery, useLazyGetWatchedUsersQuery, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useGetWatchersQuery, useLazyGetWatchersQuery, useAddWatcherMutation, useGetWatcherQuery, useUpdateWatcherMutation, useDeleteWatcherMutation, } = watchedGroupsApiSlice;
47803
47803
 
47804
+ const USER_CHAT_HISTORY_REDUCER_PATH = 'userChatHistoryApiSlice';
47805
+ const USER_CHAT_HISTORY_QUERY_KEYS = {
47806
+ GET_USER_CHAT_HISTORY: () => ['USER_CHAT_HISTORY'],
47807
+ GET_USER_CHAT_HISTORY_SESSION: () => ['USER_CHAT_HISTORY_SESSION'],
47808
+ GET_USER_CHAT_HISTORY_FILTER: () => ['USER_CHAT_HISTORY_FILTER'],
47809
+ GET_USER_CHAT_HISTORY_REPORTS: () => ['USER_CHAT_HISTORY_REPORTS'],
47810
+ GET_USER_CHAT_HISTORY_REPORT_STATUS: () => ['USER_CHAT_HISTORY_REPORT_STATUS'],
47811
+ };
47812
+ /**
47813
+ * User-scoped chat history endpoints (`my-chat-history*`). Unlike the admin
47814
+ * `chat-history` family these require no RBAC permissions — the backend only
47815
+ * allows the authenticated user to read their own data, enforced through the
47816
+ * `{userId}` path segment.
47817
+ */
47818
+ const USER_CHAT_HISTORY_ENDPOINTS = {
47819
+ GET_USER_CHAT_HISTORY: {
47820
+ service: exports.SERVICES.DM,
47821
+ path: (org, userId) => `/api/ai-analytics/orgs/${org}/users/${userId}/my-chat-history/`,
47822
+ },
47823
+ GET_USER_CHAT_HISTORY_SESSION: {
47824
+ service: exports.SERVICES.DM,
47825
+ path: (org, userId, sessionId) => `/api/ai-analytics/orgs/${org}/users/${userId}/my-chat-history/${sessionId}/`,
47826
+ },
47827
+ GET_USER_CHAT_HISTORY_FILTER: {
47828
+ service: exports.SERVICES.DM,
47829
+ path: (org, userId) => `/api/ai-analytics/orgs/${org}/users/${userId}/my-chat-history-filter/`,
47830
+ },
47831
+ USER_CHAT_HISTORY_REPORT: {
47832
+ service: exports.SERVICES.DM,
47833
+ path: (org, userId) => `/api/ai-analytics/orgs/${org}/users/${userId}/my-chat-history-report/`,
47834
+ },
47835
+ USER_CHAT_HISTORY_REPORT_STATUS: {
47836
+ service: exports.SERVICES.DM,
47837
+ path: (org, userId, taskId) => `/api/ai-analytics/orgs/${org}/users/${userId}/my-chat-history-report/${taskId}/`,
47838
+ },
47839
+ USER_CHAT_HISTORY_REPORT_DOWNLOAD: {
47840
+ service: exports.SERVICES.DM,
47841
+ path: (org, userId, taskId) => `/api/ai-analytics/orgs/${org}/users/${userId}/my-chat-history-report/${taskId}/download/`,
47842
+ },
47843
+ };
47844
+
47845
+ const userChatHistoryApiSlice = react.createApi({
47846
+ reducerPath: USER_CHAT_HISTORY_REDUCER_PATH,
47847
+ tagTypes: [
47848
+ ...USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY(),
47849
+ ...USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY_SESSION(),
47850
+ ...USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY_FILTER(),
47851
+ ...USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY_REPORTS(),
47852
+ ...USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY_REPORT_STATUS(),
47853
+ ],
47854
+ baseQuery: iblFetchBaseQuery,
47855
+ endpoints: (builder) => ({
47856
+ getUserChatHistory: builder.query({
47857
+ query: (args) => ({
47858
+ url: USER_CHAT_HISTORY_ENDPOINTS.GET_USER_CHAT_HISTORY.path(args.org, args.userId),
47859
+ service: USER_CHAT_HISTORY_ENDPOINTS.GET_USER_CHAT_HISTORY.service,
47860
+ params: args.params,
47861
+ }),
47862
+ providesTags: USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY(),
47863
+ }),
47864
+ getUserChatHistorySession: builder.query({
47865
+ query: (args) => ({
47866
+ url: USER_CHAT_HISTORY_ENDPOINTS.GET_USER_CHAT_HISTORY_SESSION.path(args.org, args.userId, args.sessionId),
47867
+ service: USER_CHAT_HISTORY_ENDPOINTS.GET_USER_CHAT_HISTORY_SESSION.service,
47868
+ }),
47869
+ providesTags: (result, error, args) => [
47870
+ {
47871
+ type: USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY_SESSION()[0],
47872
+ id: args.sessionId,
47873
+ },
47874
+ ],
47875
+ }),
47876
+ getUserChatHistoryFilter: builder.query({
47877
+ query: (args) => ({
47878
+ url: USER_CHAT_HISTORY_ENDPOINTS.GET_USER_CHAT_HISTORY_FILTER.path(args.org, args.userId),
47879
+ service: USER_CHAT_HISTORY_ENDPOINTS.GET_USER_CHAT_HISTORY_FILTER.service,
47880
+ params: args.params,
47881
+ }),
47882
+ providesTags: USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY_FILTER(),
47883
+ }),
47884
+ getUserChatHistoryReports: builder.query({
47885
+ query: (args) => ({
47886
+ url: USER_CHAT_HISTORY_ENDPOINTS.USER_CHAT_HISTORY_REPORT.path(args.org, args.userId),
47887
+ service: USER_CHAT_HISTORY_ENDPOINTS.USER_CHAT_HISTORY_REPORT.service,
47888
+ }),
47889
+ providesTags: USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY_REPORTS(),
47890
+ }),
47891
+ createUserChatHistoryReport: builder.mutation({
47892
+ query: (args) => {
47893
+ var _a;
47894
+ return ({
47895
+ url: USER_CHAT_HISTORY_ENDPOINTS.USER_CHAT_HISTORY_REPORT.path(args.org, args.userId),
47896
+ service: USER_CHAT_HISTORY_ENDPOINTS.USER_CHAT_HISTORY_REPORT.service,
47897
+ method: 'POST',
47898
+ body: (_a = args.body) !== null && _a !== void 0 ? _a : {},
47899
+ });
47900
+ },
47901
+ invalidatesTags: USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY_REPORTS(),
47902
+ }),
47903
+ getUserChatHistoryReportStatus: builder.query({
47904
+ query: (args) => ({
47905
+ url: USER_CHAT_HISTORY_ENDPOINTS.USER_CHAT_HISTORY_REPORT_STATUS.path(args.org, args.userId, args.taskId),
47906
+ service: USER_CHAT_HISTORY_ENDPOINTS.USER_CHAT_HISTORY_REPORT_STATUS.service,
47907
+ }),
47908
+ providesTags: (result, error, args) => [
47909
+ {
47910
+ type: USER_CHAT_HISTORY_QUERY_KEYS.GET_USER_CHAT_HISTORY_REPORT_STATUS()[0],
47911
+ id: args.taskId,
47912
+ },
47913
+ ],
47914
+ }),
47915
+ }),
47916
+ });
47917
+ const { useGetUserChatHistoryQuery, useLazyGetUserChatHistoryQuery, useGetUserChatHistorySessionQuery, useLazyGetUserChatHistorySessionQuery, useGetUserChatHistoryFilterQuery, useLazyGetUserChatHistoryFilterQuery, useGetUserChatHistoryReportsQuery, useLazyGetUserChatHistoryReportsQuery, useCreateUserChatHistoryReportMutation, useGetUserChatHistoryReportStatusQuery, useLazyGetUserChatHistoryReportStatusQuery, } = userChatHistoryApiSlice;
47918
+
47919
+ /** States in which a report task can still reach `completed`. */
47920
+ const USER_CHAT_HISTORY_REPORT_ACTIVE_STATES = [
47921
+ 'pending',
47922
+ 'running',
47923
+ 'accumulating',
47924
+ 'processing',
47925
+ 'storing',
47926
+ ];
47927
+
47804
47928
  const mentorReducer = {
47805
47929
  [mentorApiSlice.reducerPath]: mentorApiSlice.reducer,
47806
47930
  [tenantApiSlice.reducerPath]: tenantApiSlice.reducer,
@@ -47862,6 +47986,7 @@ const mentorReducer = {
47862
47986
  [supportTicketsApiSlice.reducerPath]: supportTicketsApiSlice.reducer,
47863
47987
  [gradingApiSlice.reducerPath]: gradingApiSlice.reducer,
47864
47988
  [spendCapsApiSlice.reducerPath]: spendCapsApiSlice.reducer,
47989
+ [userChatHistoryApiSlice.reducerPath]: userChatHistoryApiSlice.reducer,
47865
47990
  };
47866
47991
  const mentorMiddleware = [
47867
47992
  mentorApiSlice.middleware,
@@ -47924,6 +48049,7 @@ const mentorMiddleware = [
47924
48049
  supportTicketsApiSlice.middleware,
47925
48050
  gradingApiSlice.middleware,
47926
48051
  spendCapsApiSlice.middleware,
48052
+ userChatHistoryApiSlice.middleware,
47927
48053
  ];
47928
48054
 
47929
48055
  const skillsReducer = {
@@ -47969,6 +48095,7 @@ const skillsReducer = {
47969
48095
  [spendCapsApiSlice.reducerPath]: spendCapsApiSlice.reducer,
47970
48096
  [chatPrivacyApiSlice.reducerPath]: chatPrivacyApiSlice.reducer,
47971
48097
  [agentSkillsApiSlice.reducerPath]: agentSkillsApiSlice.reducer,
48098
+ [userChatHistoryApiSlice.reducerPath]: userChatHistoryApiSlice.reducer,
47972
48099
  };
47973
48100
  const skillsMiddleware = [
47974
48101
  perLearnerApiSlice.middleware,
@@ -48013,6 +48140,7 @@ const skillsMiddleware = [
48013
48140
  spendCapsApiSlice.middleware,
48014
48141
  chatPrivacyApiSlice.middleware,
48015
48142
  agentSkillsApiSlice.middleware,
48143
+ userChatHistoryApiSlice.middleware,
48016
48144
  ];
48017
48145
 
48018
48146
  const initializeDataLayer = (dmUrl, lmsUrl, legacyLmsUrl, storageService, httpErrorHandler = {}, studioUrl) => {
@@ -48116,6 +48244,10 @@ exports.TENANT_LOGO_ENDPOINTS = TENANT_LOGO_ENDPOINTS;
48116
48244
  exports.TENANT_LOGO_QUERY_KEYS = TENANT_LOGO_QUERY_KEYS;
48117
48245
  exports.TENANT_LOGO_REDUCER_PATH = TENANT_LOGO_REDUCER_PATH;
48118
48246
  exports.URL_PATTERNS = URL_PATTERNS;
48247
+ exports.USER_CHAT_HISTORY_ENDPOINTS = USER_CHAT_HISTORY_ENDPOINTS;
48248
+ exports.USER_CHAT_HISTORY_QUERY_KEYS = USER_CHAT_HISTORY_QUERY_KEYS;
48249
+ exports.USER_CHAT_HISTORY_REDUCER_PATH = USER_CHAT_HISTORY_REDUCER_PATH;
48250
+ exports.USER_CHAT_HISTORY_REPORT_ACTIVE_STATES = USER_CHAT_HISTORY_REPORT_ACTIVE_STATES;
48119
48251
  exports.USER_PROGRESS_DATA_POINTS = USER_PROGRESS_DATA_POINTS;
48120
48252
  exports.USER_PROGRESS_SUMMARY_TYPE = USER_PROGRESS_SUMMARY_TYPE;
48121
48253
  exports.WATCHED_GROUPS_ENDPOINTS = WATCHED_GROUPS_ENDPOINTS;
@@ -48305,6 +48437,7 @@ exports.useCreateStudioCourseMutation = useCreateStudioCourseMutation;
48305
48437
  exports.useCreateStudioXblockMutation = useCreateStudioXblockMutation;
48306
48438
  exports.useCreateSupportTicketMessageMutation = useCreateSupportTicketMessageMutation;
48307
48439
  exports.useCreateTrainingDocumentRetrainScheduleMutation = useCreateTrainingDocumentRetrainScheduleMutation;
48440
+ exports.useCreateUserChatHistoryReportMutation = useCreateUserChatHistoryReportMutation;
48308
48441
  exports.useCreateUserCompanyMutation = useCreateUserCompanyMutation;
48309
48442
  exports.useCreateUserEducationMutation = useCreateUserEducationMutation;
48310
48443
  exports.useCreateUserExperienceMutation = useCreateUserExperienceMutation;
@@ -48602,6 +48735,11 @@ exports.useGetUserAppsQuery = useGetUserAppsQuery;
48602
48735
  exports.useGetUserAssignedCoursesQuery = useGetUserAssignedCoursesQuery;
48603
48736
  exports.useGetUserAssignedPathwaysQuery = useGetUserAssignedPathwaysQuery;
48604
48737
  exports.useGetUserCatalogPathwaysQuery = useGetUserCatalogPathwaysQuery;
48738
+ exports.useGetUserChatHistoryFilterQuery = useGetUserChatHistoryFilterQuery;
48739
+ exports.useGetUserChatHistoryQuery = useGetUserChatHistoryQuery;
48740
+ exports.useGetUserChatHistoryReportStatusQuery = useGetUserChatHistoryReportStatusQuery;
48741
+ exports.useGetUserChatHistoryReportsQuery = useGetUserChatHistoryReportsQuery;
48742
+ exports.useGetUserChatHistorySessionQuery = useGetUserChatHistorySessionQuery;
48605
48743
  exports.useGetUserChatPrivacySettingsQuery = useGetUserChatPrivacySettingsQuery;
48606
48744
  exports.useGetUserCohortsOverTimeQuery = useGetUserCohortsOverTimeQuery;
48607
48745
  exports.useGetUserCompaniesQuery = useGetUserCompaniesQuery;
@@ -48810,6 +48948,11 @@ exports.useLazyGetUserAppsQuery = useLazyGetUserAppsQuery;
48810
48948
  exports.useLazyGetUserAssignedCoursesQuery = useLazyGetUserAssignedCoursesQuery;
48811
48949
  exports.useLazyGetUserAssignedPathwaysQuery = useLazyGetUserAssignedPathwaysQuery;
48812
48950
  exports.useLazyGetUserCatalogPathwaysQuery = useLazyGetUserCatalogPathwaysQuery;
48951
+ exports.useLazyGetUserChatHistoryFilterQuery = useLazyGetUserChatHistoryFilterQuery;
48952
+ exports.useLazyGetUserChatHistoryQuery = useLazyGetUserChatHistoryQuery;
48953
+ exports.useLazyGetUserChatHistoryReportStatusQuery = useLazyGetUserChatHistoryReportStatusQuery;
48954
+ exports.useLazyGetUserChatHistoryReportsQuery = useLazyGetUserChatHistoryReportsQuery;
48955
+ exports.useLazyGetUserChatHistorySessionQuery = useLazyGetUserChatHistorySessionQuery;
48813
48956
  exports.useLazyGetUserChatPrivacySettingsQuery = useLazyGetUserChatPrivacySettingsQuery;
48814
48957
  exports.useLazyGetUserCompaniesQuery = useLazyGetUserCompaniesQuery;
48815
48958
  exports.useLazyGetUserCredentialsQuery = useLazyGetUserCredentialsQuery;
@@ -49020,6 +49163,7 @@ exports.useUsersGradesPassedQuery = useUsersGradesPassedQuery;
49020
49163
  exports.useValidateWorkflowMutation = useValidateWorkflowMutation;
49021
49164
  exports.useWithdrawApplicationMutation = useWithdrawApplicationMutation;
49022
49165
  exports.userApiSlice = userApiSlice;
49166
+ exports.userChatHistoryApiSlice = userChatHistoryApiSlice;
49023
49167
  exports.userInvitationsApiSlice = userInvitationsApiSlice;
49024
49168
  exports.watchedGroupsApiSlice = watchedGroupsApiSlice;
49025
49169
  exports.workflowsApiSlice = workflowsApiSlice;