@insignia-education/api-sdk-js 0.24.0 → 0.24.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insignia-education/api-sdk-js",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -28,6 +28,31 @@ export default class Admin {
28
28
  return this.#client.get('/admin/statistics/sales', { from_date: fromDate, to_date: toDate });
29
29
  }
30
30
 
31
+ /** Enrolled (non-teacher) students per course, biggest first — `[{ course_id, title, students }]`. Courses with no students are omitted. */
32
+ statisticsStudentsByCourse() {
33
+ return this.#client.get('/admin/statistics/students-by-course');
34
+ }
35
+
36
+ /** Enrolled students per birth country, biggest first — `[{ country_id, title, cod, students }]`. Students with no birth country set share one row with `country_id: null`. */
37
+ statisticsStudentsByBirthCountry() {
38
+ return this.#client.get('/admin/statistics/students-by-birth-country');
39
+ }
40
+
41
+ /** Same as statisticsStudentsByBirthCountry(), grouped by the students' current country instead. */
42
+ statisticsStudentsByCurrentCountry() {
43
+ return this.#client.get('/admin/statistics/students-by-current-country');
44
+ }
45
+
46
+ /** Enrolled students per age group (whole years as of today) — always all eight groups, in order, zero-filled: `[{ group: '0-17' | '18-24' | '25-34' | '35-44' | '45-54' | '55-64' | '65+' | 'unknown', students }]`. `unknown` = no birth date. */
47
+ statisticsStudentsByAgeGroup() {
48
+ return this.#client.get('/admin/statistics/students-by-age-group');
49
+ }
50
+
51
+ /** Average + count of the course survey ratings — `{ teacher, content, platform, ux, overall }`, each `{ average, count }` (`average` is `null` when nobody rated it). Counts are enrollments that answered that rating; `overall.average` spans every rating given and `overall.count` is enrollments with at least one. Teacher enrollments and deleted ones are excluded. */
52
+ statisticsCourseRatings() {
53
+ return this.#client.get('/admin/statistics/course-ratings');
54
+ }
55
+
31
56
  /** Claude (Anthropic) token usage/spend for a date range, plus account balance. Each half resolves `{ available: false }` (not an error) when its required config (admin key / account balance) isn't set. */
32
57
  statisticsClaudeUsage({ fromDate, toDate } = {}) {
33
58
  return this.#client.get('/admin/statistics/claude-usage', { from_date: fromDate, to_date: toDate });
@@ -16,6 +16,11 @@ export default class Sales {
16
16
  return this.#client.get('/sales/my-sales', { page, per_page: perPage });
17
17
  }
18
18
 
19
+ /** Paginated list of the current seller's clients — users whose `seller_id` is the seller (`id, name, username, email, phone, created_at`). */
20
+ myClients({ page, perPage } = {}) {
21
+ return this.#client.get('/sales/my-clients', { page, per_page: perPage });
22
+ }
23
+
19
24
  /** Sellers and above: users with all 3 KYC files uploaded but not yet verified. */
20
25
  kycPending() { return this.#client.get('/sales/kyc-pending'); }
21
26