@iblai/data-layer 1.8.4 → 1.8.6

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
@@ -39241,6 +39241,13 @@ const buildEndpointFromDmService = (serviceFn, options) => buildEndpointFromServ
39241
39241
  * Shortcut for building an endpoint using the AXD service.
39242
39242
  */
39243
39243
  const buildEndpointFromAxdService = (serviceFn, options) => buildEndpointFromService(exports.SERVICES.AXD, serviceFn, options);
39244
+ /**
39245
+ * Build an endpoint from a hand-assembled URL (rather than a generated service
39246
+ * method), routed through `iblFetchBaseQuery`. Defaults to the DM service.
39247
+ */
39248
+ const buildEndpointFromDmUrl = (buildUrl, service = exports.SERVICES.DM) => ({
39249
+ queryFn: async (args, api, extraOptions) => iblFetchBaseQuery({ url: buildUrl(args), service }, api, extraOptions),
39250
+ });
39244
39251
  const isErrorObject = (data) => {
39245
39252
  return (typeof data === 'object' &&
39246
39253
  data !== null &&
@@ -41703,6 +41710,23 @@ const stripeApiSlice = react.createApi({
41703
41710
  });
41704
41711
  const { useGetStripeContextQuery, useLazyGetStripeContextQuery, useGetStripePricingPageSessionQuery, useLazyGetStripePricingPageSessionQuery, useCreateStripeCheckoutSessionMutation, } = stripeApiSlice;
41705
41712
 
41713
+ const CHAT_HISTORY_PAGE_SIZE = 10;
41714
+ const CHAT_HISTORY_PAGE_PARAM = 'page';
41715
+ const CHAT_HISTORY_PAGE_SIZE_PARAM = 'page_size';
41716
+
41717
+ const buildChatHistoryQuery = (page, pageSize) => {
41718
+ const params = new URLSearchParams();
41719
+ if (page !== undefined)
41720
+ params.append(CHAT_HISTORY_PAGE_PARAM, page.toString());
41721
+ if (pageSize !== undefined) {
41722
+ params.append(CHAT_HISTORY_PAGE_SIZE_PARAM, pageSize.toString());
41723
+ }
41724
+ const queryString = params.toString();
41725
+ return queryString ? `?${queryString}` : '';
41726
+ };
41727
+ const buildSessionRetrieveUrl = ({ org, sessionId, userId, page, pageSize, }) => `/api/ai-mentor/orgs/${org}/users/${userId !== null && userId !== void 0 ? userId : ''}/sessions/${sessionId}/${buildChatHistoryQuery(page, pageSize)}`;
41728
+ const buildSharedSessionRetrieveUrl = ({ org, sessionId, userId, page, pageSize, }) => `/api/ai-mentor/orgs/${org}/users/${userId}/sessions/${sessionId}/shared/${buildChatHistoryQuery(page, pageSize)}`;
41729
+
41706
41730
  const sessionApiSlice = react.createApi({
41707
41731
  reducerPath: 'sessionApiSlice',
41708
41732
  baseQuery: iblFakeBaseQuery,
@@ -41713,11 +41737,11 @@ const sessionApiSlice = react.createApi({
41713
41737
  invalidatesTags: ['sessionId'],
41714
41738
  }),
41715
41739
  getSessionId: builder.query({
41716
- ...buildEndpointFromDmService(AiMentorService.aiMentorOrgsUsersSessionsRetrieve),
41740
+ ...buildEndpointFromDmUrl(buildSessionRetrieveUrl),
41717
41741
  providesTags: ['sessionId'],
41718
41742
  }),
41719
41743
  getSharedSessionId: builder.query({
41720
- ...buildEndpointFromDmService(AiMentorService.aiMentorOrgsUsersSessionsSharedRetrieve),
41744
+ ...buildEndpointFromDmUrl(buildSharedSessionRetrieveUrl),
41721
41745
  providesTags: ['sessionId'],
41722
41746
  }),
41723
41747
  editSession: builder.mutation({
@@ -41870,6 +41894,10 @@ const NON_AI_ANALYTICS_ENDPOINTS = {
41870
41894
  service: exports.SERVICES.DM,
41871
41895
  path: (content_id) => `/api/analytics/content/details/${content_id}/`,
41872
41896
  },
41897
+ GET_LEARNER_DETAILS: {
41898
+ service: exports.SERVICES.DM,
41899
+ path: (username, platform_key, metrics, course_id, include_edx_progress, program_id) => `/api/analytics/learner/details?username=${username}&platform_key=${platform_key}&metrics=${metrics}${course_id ? `&course_id=${encodeURIComponent(course_id)}` : ''}${program_id ? `&program_id=${encodeURIComponent(program_id)}` : ''}${include_edx_progress !== undefined ? `&include_edx_progress=${include_edx_progress}` : ''}`,
41900
+ },
41873
41901
  };
41874
41902
  const ANALYTICS_REDUCER_PATH = 'analyticsApiSlice';
41875
41903
 
@@ -42168,9 +42196,15 @@ const analyticsApiSlice = react.createApi({
42168
42196
  params: args,
42169
42197
  }),
42170
42198
  }),
42199
+ getLearnerDetails: builder.query({
42200
+ query: (args) => ({
42201
+ url: NON_AI_ANALYTICS_ENDPOINTS.GET_LEARNER_DETAILS.path(args.username, args.platform_key, args.metrics, args.course_id, args.include_edx_progress, args.program_id),
42202
+ service: NON_AI_ANALYTICS_ENDPOINTS.GET_LEARNER_DETAILS.service,
42203
+ }),
42204
+ }),
42171
42205
  }),
42172
42206
  });
42173
- const { useGetOverviewSummaryQuery, useGetConversationQuery, useGetMostDiscussedTopicsQuery, useGetAverageMessagesPerSessionQuery, useGetRegisteredUsersTrendQuery, useGetUserMetricsQuery, useGetUserMetricsPieChartQuery, useGetUserCohortsOverTimeQuery, useGetTopStudentsByChatMessagesQuery, useGetTopicOverviewQuery, useGetTopicsSummaryQuery, useGetTopicStatisticsQuery, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetAverageRatingQuery, useGetFinancialStatsQuery, useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesQuery, useGetTranscriptsMessagesDetailsQuery, useTimeTrackingMutation, useGetTranscriptsConversationHeadlineQuery, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, } = analyticsApiSlice;
42207
+ const { useGetOverviewSummaryQuery, useGetConversationQuery, useGetMostDiscussedTopicsQuery, useGetAverageMessagesPerSessionQuery, useGetRegisteredUsersTrendQuery, useGetUserMetricsQuery, useGetUserMetricsPieChartQuery, useGetUserCohortsOverTimeQuery, useGetTopStudentsByChatMessagesQuery, useGetTopicOverviewQuery, useGetTopicsSummaryQuery, useGetTopicStatisticsQuery, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetAverageRatingQuery, useGetFinancialStatsQuery, useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesQuery, useGetTranscriptsMessagesDetailsQuery, useTimeTrackingMutation, useGetTranscriptsConversationHeadlineQuery, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetLearnerDetailsQuery, } = analyticsApiSlice;
42174
42208
 
42175
42209
  const analyticsCustomSlice = react.createApi({
42176
42210
  reducerPath: 'analyticsCustomApiSlice',
@@ -45740,6 +45774,9 @@ exports.AUDIT_LOGS_REDUCER_PATH = AUDIT_LOGS_REDUCER_PATH;
45740
45774
  exports.CALL_CONFIGURATIONS_ENDPOINTS = CALL_CONFIGURATIONS_ENDPOINTS;
45741
45775
  exports.CALL_CONFIGURATIONS_REDUCER_PATH = CALL_CONFIGURATIONS_REDUCER_PATH;
45742
45776
  exports.CALL_CONFIGURATIONS_TAGS = CALL_CONFIGURATIONS_TAGS;
45777
+ exports.CHAT_HISTORY_PAGE_PARAM = CHAT_HISTORY_PAGE_PARAM;
45778
+ exports.CHAT_HISTORY_PAGE_SIZE = CHAT_HISTORY_PAGE_SIZE;
45779
+ exports.CHAT_HISTORY_PAGE_SIZE_PARAM = CHAT_HISTORY_PAGE_SIZE_PARAM;
45743
45780
  exports.CHAT_PRIVACY_MODES = CHAT_PRIVACY_MODES;
45744
45781
  exports.CLAW_ENDPOINTS = CLAW_ENDPOINTS;
45745
45782
  exports.CLAW_REDUCER_PATH = CLAW_REDUCER_PATH;
@@ -45818,6 +45855,8 @@ exports.auditLogsApiSlice = auditLogsApiSlice;
45818
45855
  exports.authApiSlice = authApiSlice;
45819
45856
  exports.billingApiSlice = billingApiSlice;
45820
45857
  exports.billingCustomSlice = billingCustomSlice;
45858
+ exports.buildSessionRetrieveUrl = buildSessionRetrieveUrl;
45859
+ exports.buildSharedSessionRetrieveUrl = buildSharedSessionRetrieveUrl;
45821
45860
  exports.callConfigurationsApiReducer = callConfigurationsApiReducer;
45822
45861
  exports.callConfigurationsApiSlice = callConfigurationsApiSlice;
45823
45862
  exports.careerApiSlice = careerApiSlice;
@@ -46077,6 +46116,7 @@ exports.useGetIntegrationCredentialsSchemaQuery = useGetIntegrationCredentialsSc
46077
46116
  exports.useGetIssuersQuery = useGetIssuersQuery;
46078
46117
  exports.useGetItemSubscriptionQuery = useGetItemSubscriptionQuery;
46079
46118
  exports.useGetLLMCredentialsQuery = useGetLLMCredentialsQuery;
46119
+ exports.useGetLearnerDetailsQuery = useGetLearnerDetailsQuery;
46080
46120
  exports.useGetLlmsQuery = useGetLlmsQuery;
46081
46121
  exports.useGetMCPServerConnectionsQuery = useGetMCPServerConnectionsQuery;
46082
46122
  exports.useGetMCPServerQuery = useGetMCPServerQuery;