@iblai/data-layer 1.12.7 → 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
@@ -41446,11 +41446,20 @@ const coreApiSlice = react.createApi({
41446
41446
  providesTags: ['LtiMentors'],
41447
41447
  }),
41448
41448
  getLtiMentorDetail: builder.query({
41449
- ...buildEndpointFromDmService(CoreService.coreLti1P3ProviderLtiMentorsRetrieve),
41449
+ // Cast to LtiAgentLink: the response carries the async-create `status`
41450
+ // fields the pinned generated client doesn't know about, and consumers
41451
+ // poll this endpoint to track link creation.
41452
+ ...buildEndpointFromDmService((args) => CoreService.coreLti1P3ProviderLtiMentorsRetrieve(args)),
41450
41453
  providesTags: ['LtiMentors'],
41451
41454
  }),
41452
41455
  createLtiMentor: builder.mutation({
41453
- ...buildEndpointFromDmService(CoreService.coreLti1P3ProviderLtiMentorsCreate),
41456
+ // Synchronous creation builds an edX course and regularly outlives the
41457
+ // 20s DM→edX proxy timeout. `async_create: true` makes the backend
41458
+ // return 202 immediately with `{ id, status: 'pending' }`; poll
41459
+ // getLtiMentorDetail with that id until status is 'ready' or 'failed'.
41460
+ ...buildEndpointFromDmService((args) => CoreService.coreLti1P3ProviderLtiMentorsCreate({
41461
+ requestBody: { ...args.requestBody, async_create: true },
41462
+ })),
41454
41463
  invalidatesTags: ['LtiMentors'],
41455
41464
  }),
41456
41465
  updateLtiMentor: builder.mutation({
@@ -44557,6 +44566,10 @@ const MEMSEARCH_ENDPOINTS = {
44557
44566
  service: exports.SERVICES.AXD,
44558
44567
  path: (org, userId) => `/api/ai-mentor/orgs/${org}/users/${userId}/global-memories/`,
44559
44568
  },
44569
+ UPDATE_GLOBAL_MEMORY: {
44570
+ service: exports.SERVICES.AXD,
44571
+ path: (org, userId, memoryId) => `/api/ai-mentor/orgs/${org}/users/${userId}/global-memories/${memoryId}/`,
44572
+ },
44560
44573
  DELETE_GLOBAL_MEMORY: {
44561
44574
  service: exports.SERVICES.AXD,
44562
44575
  path: (org, userId, memoryId) => `/api/ai-mentor/orgs/${org}/users/${userId}/global-memories/${memoryId}/`,
@@ -44667,6 +44680,15 @@ const memoryApiSlice = react.createApi({
44667
44680
  }),
44668
44681
  invalidatesTags: MEMORY_QUERY_KEYS.MEMSEARCH_GLOBAL_MEMORIES(),
44669
44682
  }),
44683
+ updateGlobalMemory: builder.mutation({
44684
+ query: (args) => ({
44685
+ url: MEMSEARCH_ENDPOINTS.UPDATE_GLOBAL_MEMORY.path(args.org, args.userId, args.memoryId),
44686
+ service: MEMSEARCH_ENDPOINTS.UPDATE_GLOBAL_MEMORY.service,
44687
+ method: 'PATCH',
44688
+ body: { content: args.content },
44689
+ }),
44690
+ invalidatesTags: MEMORY_QUERY_KEYS.MEMSEARCH_GLOBAL_MEMORIES(),
44691
+ }),
44670
44692
  deleteGlobalMemory: builder.mutation({
44671
44693
  query: (args) => ({
44672
44694
  url: MEMSEARCH_ENDPOINTS.DELETE_GLOBAL_MEMORY.path(args.org, args.userId, args.memoryId),
@@ -44787,7 +44809,7 @@ const memoryApiSlice = react.createApi({
44787
44809
  }),
44788
44810
  }),
44789
44811
  });
44790
- const { useGetUserMemorySettingsQuery, useLazyGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useLazyGetGlobalMemoriesQuery, useCreateGlobalMemoryMutation, useDeleteGlobalMemoryMutation, useGetMentorMemoriesQuery, useLazyGetMentorMemoriesQuery, useGetMentorMemoriesListQuery, useLazyGetMentorMemoriesListQuery, useGetAllMentorMemoriesQuery, useLazyGetAllMentorMemoriesQuery, useCreateMentorMemoryMutation, useUpdateMentorMemoryMutation, useDeleteMentorMemoryMutation, useGetMemoryCategoriesAdminQuery, useLazyGetMemoryCategoriesAdminQuery, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useGetMemsearchConfigQuery, useLazyGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetMemsearchStatusQuery, useLazyGetMemsearchStatusQuery, } = memoryApiSlice;
44812
+ const { useGetUserMemorySettingsQuery, useLazyGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useLazyGetGlobalMemoriesQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useDeleteGlobalMemoryMutation, useGetMentorMemoriesQuery, useLazyGetMentorMemoriesQuery, useGetMentorMemoriesListQuery, useLazyGetMentorMemoriesListQuery, useGetAllMentorMemoriesQuery, useLazyGetAllMentorMemoriesQuery, useCreateMentorMemoryMutation, useUpdateMentorMemoryMutation, useDeleteMentorMemoryMutation, useGetMemoryCategoriesAdminQuery, useLazyGetMemoryCategoriesAdminQuery, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useGetMemsearchConfigQuery, useLazyGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetMemsearchStatusQuery, useLazyGetMemsearchStatusQuery, } = memoryApiSlice;
44791
44813
 
44792
44814
  const MCP_REDUCER_PATH = 'mcpApiSlice';
44793
44815
  const MCP_ENDPOINTS = {
@@ -47779,6 +47801,130 @@ const watchedGroupsApiSlice = react.createApi({
47779
47801
  });
47780
47802
  const { useGetWatchedGroupsQuery, useLazyGetWatchedGroupsQuery, useGetWatchedGroupQuery, useLazyGetWatchedGroupQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useGetWatchedUsersQuery, useLazyGetWatchedUsersQuery, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useGetWatchersQuery, useLazyGetWatchersQuery, useAddWatcherMutation, useGetWatcherQuery, useUpdateWatcherMutation, useDeleteWatcherMutation, } = watchedGroupsApiSlice;
47781
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
+
47782
47928
  const mentorReducer = {
47783
47929
  [mentorApiSlice.reducerPath]: mentorApiSlice.reducer,
47784
47930
  [tenantApiSlice.reducerPath]: tenantApiSlice.reducer,
@@ -47840,6 +47986,7 @@ const mentorReducer = {
47840
47986
  [supportTicketsApiSlice.reducerPath]: supportTicketsApiSlice.reducer,
47841
47987
  [gradingApiSlice.reducerPath]: gradingApiSlice.reducer,
47842
47988
  [spendCapsApiSlice.reducerPath]: spendCapsApiSlice.reducer,
47989
+ [userChatHistoryApiSlice.reducerPath]: userChatHistoryApiSlice.reducer,
47843
47990
  };
47844
47991
  const mentorMiddleware = [
47845
47992
  mentorApiSlice.middleware,
@@ -47902,6 +48049,7 @@ const mentorMiddleware = [
47902
48049
  supportTicketsApiSlice.middleware,
47903
48050
  gradingApiSlice.middleware,
47904
48051
  spendCapsApiSlice.middleware,
48052
+ userChatHistoryApiSlice.middleware,
47905
48053
  ];
47906
48054
 
47907
48055
  const skillsReducer = {
@@ -47947,6 +48095,7 @@ const skillsReducer = {
47947
48095
  [spendCapsApiSlice.reducerPath]: spendCapsApiSlice.reducer,
47948
48096
  [chatPrivacyApiSlice.reducerPath]: chatPrivacyApiSlice.reducer,
47949
48097
  [agentSkillsApiSlice.reducerPath]: agentSkillsApiSlice.reducer,
48098
+ [userChatHistoryApiSlice.reducerPath]: userChatHistoryApiSlice.reducer,
47950
48099
  };
47951
48100
  const skillsMiddleware = [
47952
48101
  perLearnerApiSlice.middleware,
@@ -47991,6 +48140,7 @@ const skillsMiddleware = [
47991
48140
  spendCapsApiSlice.middleware,
47992
48141
  chatPrivacyApiSlice.middleware,
47993
48142
  agentSkillsApiSlice.middleware,
48143
+ userChatHistoryApiSlice.middleware,
47994
48144
  ];
47995
48145
 
47996
48146
  const initializeDataLayer = (dmUrl, lmsUrl, legacyLmsUrl, storageService, httpErrorHandler = {}, studioUrl) => {
@@ -48094,6 +48244,10 @@ exports.TENANT_LOGO_ENDPOINTS = TENANT_LOGO_ENDPOINTS;
48094
48244
  exports.TENANT_LOGO_QUERY_KEYS = TENANT_LOGO_QUERY_KEYS;
48095
48245
  exports.TENANT_LOGO_REDUCER_PATH = TENANT_LOGO_REDUCER_PATH;
48096
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;
48097
48251
  exports.USER_PROGRESS_DATA_POINTS = USER_PROGRESS_DATA_POINTS;
48098
48252
  exports.USER_PROGRESS_SUMMARY_TYPE = USER_PROGRESS_SUMMARY_TYPE;
48099
48253
  exports.WATCHED_GROUPS_ENDPOINTS = WATCHED_GROUPS_ENDPOINTS;
@@ -48283,6 +48437,7 @@ exports.useCreateStudioCourseMutation = useCreateStudioCourseMutation;
48283
48437
  exports.useCreateStudioXblockMutation = useCreateStudioXblockMutation;
48284
48438
  exports.useCreateSupportTicketMessageMutation = useCreateSupportTicketMessageMutation;
48285
48439
  exports.useCreateTrainingDocumentRetrainScheduleMutation = useCreateTrainingDocumentRetrainScheduleMutation;
48440
+ exports.useCreateUserChatHistoryReportMutation = useCreateUserChatHistoryReportMutation;
48286
48441
  exports.useCreateUserCompanyMutation = useCreateUserCompanyMutation;
48287
48442
  exports.useCreateUserEducationMutation = useCreateUserEducationMutation;
48288
48443
  exports.useCreateUserExperienceMutation = useCreateUserExperienceMutation;
@@ -48580,6 +48735,11 @@ exports.useGetUserAppsQuery = useGetUserAppsQuery;
48580
48735
  exports.useGetUserAssignedCoursesQuery = useGetUserAssignedCoursesQuery;
48581
48736
  exports.useGetUserAssignedPathwaysQuery = useGetUserAssignedPathwaysQuery;
48582
48737
  exports.useGetUserCatalogPathwaysQuery = useGetUserCatalogPathwaysQuery;
48738
+ exports.useGetUserChatHistoryFilterQuery = useGetUserChatHistoryFilterQuery;
48739
+ exports.useGetUserChatHistoryQuery = useGetUserChatHistoryQuery;
48740
+ exports.useGetUserChatHistoryReportStatusQuery = useGetUserChatHistoryReportStatusQuery;
48741
+ exports.useGetUserChatHistoryReportsQuery = useGetUserChatHistoryReportsQuery;
48742
+ exports.useGetUserChatHistorySessionQuery = useGetUserChatHistorySessionQuery;
48583
48743
  exports.useGetUserChatPrivacySettingsQuery = useGetUserChatPrivacySettingsQuery;
48584
48744
  exports.useGetUserCohortsOverTimeQuery = useGetUserCohortsOverTimeQuery;
48585
48745
  exports.useGetUserCompaniesQuery = useGetUserCompaniesQuery;
@@ -48788,6 +48948,11 @@ exports.useLazyGetUserAppsQuery = useLazyGetUserAppsQuery;
48788
48948
  exports.useLazyGetUserAssignedCoursesQuery = useLazyGetUserAssignedCoursesQuery;
48789
48949
  exports.useLazyGetUserAssignedPathwaysQuery = useLazyGetUserAssignedPathwaysQuery;
48790
48950
  exports.useLazyGetUserCatalogPathwaysQuery = useLazyGetUserCatalogPathwaysQuery;
48951
+ exports.useLazyGetUserChatHistoryFilterQuery = useLazyGetUserChatHistoryFilterQuery;
48952
+ exports.useLazyGetUserChatHistoryQuery = useLazyGetUserChatHistoryQuery;
48953
+ exports.useLazyGetUserChatHistoryReportStatusQuery = useLazyGetUserChatHistoryReportStatusQuery;
48954
+ exports.useLazyGetUserChatHistoryReportsQuery = useLazyGetUserChatHistoryReportsQuery;
48955
+ exports.useLazyGetUserChatHistorySessionQuery = useLazyGetUserChatHistorySessionQuery;
48791
48956
  exports.useLazyGetUserChatPrivacySettingsQuery = useLazyGetUserChatPrivacySettingsQuery;
48792
48957
  exports.useLazyGetUserCompaniesQuery = useLazyGetUserCompaniesQuery;
48793
48958
  exports.useLazyGetUserCredentialsQuery = useLazyGetUserCredentialsQuery;
@@ -48929,6 +49094,7 @@ exports.useUpdateCredentialMutation = useUpdateCredentialMutation;
48929
49094
  exports.useUpdateDisclaimerMutation = useUpdateDisclaimerMutation;
48930
49095
  exports.useUpdateEvalDatasetItemMutation = useUpdateEvalDatasetItemMutation;
48931
49096
  exports.useUpdateExamAttemptMutation = useUpdateExamAttemptMutation;
49097
+ exports.useUpdateGlobalMemoryMutation = useUpdateGlobalMemoryMutation;
48932
49098
  exports.useUpdateGraderCriterionMutation = useUpdateGraderCriterionMutation;
48933
49099
  exports.useUpdateIntegrationCredentialMutation = useUpdateIntegrationCredentialMutation;
48934
49100
  exports.useUpdateLtiKeyMutation = useUpdateLtiKeyMutation;
@@ -48997,6 +49163,7 @@ exports.useUsersGradesPassedQuery = useUsersGradesPassedQuery;
48997
49163
  exports.useValidateWorkflowMutation = useValidateWorkflowMutation;
48998
49164
  exports.useWithdrawApplicationMutation = useWithdrawApplicationMutation;
48999
49165
  exports.userApiSlice = userApiSlice;
49166
+ exports.userChatHistoryApiSlice = userChatHistoryApiSlice;
49000
49167
  exports.userInvitationsApiSlice = userInvitationsApiSlice;
49001
49168
  exports.watchedGroupsApiSlice = watchedGroupsApiSlice;
49002
49169
  exports.workflowsApiSlice = workflowsApiSlice;