@iblai/iblai-api 4.316.1-core → 4.317.1-core

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.
@@ -252,14 +252,23 @@ export class AiAnalyticsService {
252
252
  }
253
253
  /**
254
254
  *
255
- * Retrieve a holistic snapshot of a learner across catalog enrollments, mentor
255
+ * Retrieve a holistic snapshot of a user across catalog enrollments, agent
256
256
  * engagement, skills, credentials, and time spent data. The `metrics` query parameter controls
257
- * which sections are returned and defaults to `courses` when omitted.
257
+ * which sections are returned and defaults to `courses` when omitted. A user can call this
258
+ * endpoint for themselves without passing `username`; admins pass `username` to target a
259
+ * user in their scope.
260
+ *
261
+ * The `mentors` section lists every agent the user has engaged, sourced from both their
262
+ * sessions and saved agents. Each agent's `interactions` block reports engagement depth
263
+ * (`session_count`, `conversation_count`, human/AI message counts, `avg_messages_per_session`),
264
+ * recency and stickiness (`first_interaction`, `latest_interaction`, `active_days`),
265
+ * affinity (`rating`, `is_starred`), and spend (`cost_usd`, in USD). The user's total
266
+ * agent spend is `user.total_agent_cost_usd`.
258
267
  *
259
268
  * Optional `course_id` / `program_id` / `pathway_id` scope the matching section to a
260
- * single item (empty list if the learner is not enrolled — never a 404); omitting them
269
+ * single item (empty list if the user is not enrolled — never a 404); omitting them
261
270
  * returns the full list unchanged. When `course_id` is set, the course block is also
262
- * enriched with the learner's live edX Progress data under `edx_progress` (completion
271
+ * enriched with the user's live edX Progress data under `edx_progress` (completion
263
272
  * summary, grade, grade summary) unless `include_edx_progress=false`. The edX call is
264
273
  * best-effort: on failure `edx_progress` is null and the DM data is still returned.
265
274
  * `program_id` / `pathway_id` get scoping only — no edX enrichment.
@@ -268,7 +277,6 @@ export class AiAnalyticsService {
268
277
  * @throws ApiError
269
278
  */
270
279
  public static analyticsLearnerDetailsRetrieve({
271
- username,
272
280
  courseId,
273
281
  dateFilter = 'today',
274
282
  endDate,
@@ -281,8 +289,8 @@ export class AiAnalyticsService {
281
289
  programId,
282
290
  startDate,
283
291
  usergroupIds,
292
+ username,
284
293
  }: {
285
- username: string,
286
294
  /**
287
295
  * Scope the `courses` and `time_spent` sections to a single course. When set, also enriches the course with live edX progress (see `include_edx_progress`).
288
296
  */
@@ -308,6 +316,9 @@ export class AiAnalyticsService {
308
316
  * When `course_id` is set, fold the learner's live edX Progress-page data (completion summary, grade, grade summary) into the course block. Defaults to true; set false to skip the edX round-trip.
309
317
  */
310
318
  includeEdxProgress?: boolean,
319
+ /**
320
+ * Comma-separated sections to return: courses, programs, pathways, agents, skills, credentials, time_spent. `agents` is an alias for the agent (mentor) section. Defaults to courses when omitted.
321
+ */
311
322
  metrics?: string,
312
323
  /**
313
324
  * Include overtime metrics for time_spent data (default: false)
@@ -327,6 +338,7 @@ export class AiAnalyticsService {
327
338
  * Optional list of usergroup IDs to filter results
328
339
  */
329
340
  usergroupIds?: Array<number> | null,
341
+ username?: string,
330
342
  }): CancelablePromise<LearnerDetailsResponse> {
331
343
  return __request(OpenAPI, {
332
344
  method: 'GET',
@@ -671,6 +683,121 @@ export class AiAnalyticsService {
671
683
  },
672
684
  });
673
685
  }
686
+ /**
687
+ *
688
+ * Retrieve a holistic snapshot of a user across catalog enrollments, agent
689
+ * engagement, skills, credentials, and time spent data. The `metrics` query parameter controls
690
+ * which sections are returned and defaults to `courses` when omitted. A user can call this
691
+ * endpoint for themselves without passing `username`; admins pass `username` to target a
692
+ * user in their scope.
693
+ *
694
+ * The `mentors` section lists every agent the user has engaged, sourced from both their
695
+ * sessions and saved agents. Each agent's `interactions` block reports engagement depth
696
+ * (`session_count`, `conversation_count`, human/AI message counts, `avg_messages_per_session`),
697
+ * recency and stickiness (`first_interaction`, `latest_interaction`, `active_days`),
698
+ * affinity (`rating`, `is_starred`), and spend (`cost_usd`, in USD). The user's total
699
+ * agent spend is `user.total_agent_cost_usd`.
700
+ *
701
+ * Optional `course_id` / `program_id` / `pathway_id` scope the matching section to a
702
+ * single item (empty list if the user is not enrolled — never a 404); omitting them
703
+ * returns the full list unchanged. When `course_id` is set, the course block is also
704
+ * enriched with the user's live edX Progress data under `edx_progress` (completion
705
+ * summary, grade, grade summary) unless `include_edx_progress=false`. The edX call is
706
+ * best-effort: on failure `edx_progress` is null and the DM data is still returned.
707
+ * `program_id` / `pathway_id` get scoping only — no edX enrichment.
708
+ *
709
+ * @returns LearnerDetailsResponse Learner profile with requested analytics data
710
+ * @throws ApiError
711
+ */
712
+ public static analyticsUserRetrieve({
713
+ courseId,
714
+ dateFilter = 'today',
715
+ endDate,
716
+ granularity = 'hour',
717
+ includeEdxProgress = true,
718
+ metrics,
719
+ overtime = false,
720
+ pathwayId,
721
+ platformKey,
722
+ programId,
723
+ startDate,
724
+ usergroupIds,
725
+ username,
726
+ }: {
727
+ /**
728
+ * Scope the `courses` and `time_spent` sections to a single course. When set, also enriches the course with live edX progress (see `include_edx_progress`).
729
+ */
730
+ courseId?: string,
731
+ /**
732
+ * * `today` - Today only
733
+ * * `7d` - Last 7 days
734
+ * * `30d` - Last 30 days
735
+ * * `90d` - Last 90 days
736
+ * * `all_time` - All time
737
+ * * `custom` - Custom date range
738
+ */
739
+ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
740
+ endDate?: string,
741
+ /**
742
+ * * `day` - day
743
+ * * `hour` - hour
744
+ * * `week` - week
745
+ * * `month` - month
746
+ */
747
+ granularity?: 'day' | 'hour' | 'week' | 'month',
748
+ /**
749
+ * When `course_id` is set, fold the learner's live edX Progress-page data (completion summary, grade, grade summary) into the course block. Defaults to true; set false to skip the edX round-trip.
750
+ */
751
+ includeEdxProgress?: boolean,
752
+ /**
753
+ * Comma-separated sections to return: courses, programs, pathways, agents, skills, credentials, time_spent. `agents` is an alias for the agent (mentor) section. Defaults to courses when omitted.
754
+ */
755
+ metrics?: string,
756
+ /**
757
+ * Include overtime metrics for time_spent data (default: false)
758
+ */
759
+ overtime?: boolean,
760
+ /**
761
+ * Scope the `pathways` section to a single pathway.
762
+ */
763
+ pathwayId?: string,
764
+ platformKey?: string,
765
+ /**
766
+ * Scope the `programs` section to a single program.
767
+ */
768
+ programId?: string,
769
+ startDate?: string,
770
+ /**
771
+ * Optional list of usergroup IDs to filter results
772
+ */
773
+ usergroupIds?: Array<number> | null,
774
+ username?: string,
775
+ }): CancelablePromise<LearnerDetailsResponse> {
776
+ return __request(OpenAPI, {
777
+ method: 'GET',
778
+ url: '/api/analytics/user',
779
+ query: {
780
+ 'course_id': courseId,
781
+ 'date_filter': dateFilter,
782
+ 'end_date': endDate,
783
+ 'granularity': granularity,
784
+ 'include_edx_progress': includeEdxProgress,
785
+ 'metrics': metrics,
786
+ 'overtime': overtime,
787
+ 'pathway_id': pathwayId,
788
+ 'platform_key': platformKey,
789
+ 'program_id': programId,
790
+ 'start_date': startDate,
791
+ 'usergroup_ids': usergroupIds,
792
+ 'username': username,
793
+ },
794
+ errors: {
795
+ 400: `Bad Request - Invalid parameters supplied`,
796
+ 404: `Learner not found`,
797
+ 500: `Unexpected error`,
798
+ },
799
+ });
800
+ }
674
801
  /**
675
802
  * Get active user counts over time.
676
803
  *