@insignia-education/api-sdk-js 0.15.38 → 0.15.41

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.15.38",
3
+ "version": "0.15.41",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -27,6 +27,9 @@ export default class Courses {
27
27
  /** Users enrolled on this course as a teacher (user_courses.teacher = 1). */
28
28
  teachers(courseId) { return this.#client.get(`/courses/${courseId}/teachers`); }
29
29
 
30
+ /** Customer-facing session-credit pricing (no commission fields) for self-checkout. */
31
+ sessionsPricing(courseId) { return this.#client.get(`/courses/${courseId}/sessions/pricing`); }
32
+
30
33
  dates(courseId) {
31
34
  const base = `/courses/${courseId}/dates`;
32
35
  return {
@@ -0,0 +1,10 @@
1
+ export default class Sales {
2
+ #client;
3
+
4
+ constructor(client) {
5
+ this.#client = client;
6
+ }
7
+
8
+ /** Options for the UTM link generator: courses, session types, active coupons, known utm source/medium/campaign values. */
9
+ utmGeneratorOptions() { return this.#client.get('/sales/utm-generator/options'); }
10
+ }
@@ -6,6 +6,8 @@ export default class ShortLinks {
6
6
  }
7
7
 
8
8
  get(id = null) { return id ? this.#client.get(`/short-links/${id}`) : this.#client.get('/short-links'); }
9
+ /** Short links created by the current user. */
10
+ mine() { return this.#client.get('/short-links/mine'); }
9
11
  create(data) { return this.#client.put('/short-links', data); }
10
12
  edit(id, data) { return this.#client.patch(`/short-links/${id}`, data); }
11
13
  delete(id) { return this.#client.del(`/short-links/${id}`); }
@@ -50,6 +50,8 @@ export default class Teacher {
50
50
  sessions: (date) => this.#client.get(`${base}/sessions`, { date }),
51
51
  /** Ungraded quiz submissions grouped by course, for every course this teacher teaches. */
52
52
  ungradedQuizzes: () => this.#client.get(`${base}/quizzes/ungraded`),
53
+ /** Mark a student's attendance (present: true/false) on one of this teacher's own sessions. */
54
+ markAttendance: (sessionId, present) => this.#client.patch(`${base}/sessions/${sessionId}/attendance`, { present }),
53
55
  /** Attendance/substitution totals. Pass { from, to } (YYYY-MM-DD) to filter, omit for all-time. */
54
56
  stats: ({ from, to } = {}) => this.#client.get(`${base}/stats`, { from, to }),
55
57
  };
@@ -24,6 +24,7 @@ import Organizations from './Organizations.js';
24
24
  import PaymentMethods from './PaymentMethods.js';
25
25
  import Payments from './Payments.js';
26
26
  import Quizzes from './Quizzes.js';
27
+ import Sales from './Sales.js';
27
28
  import Search from './Search.js';
28
29
  import ShortLinks from './ShortLinks.js';
29
30
  import Surveys from './Surveys.js';
@@ -76,6 +77,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
76
77
  this.paymentMethods = new PaymentMethods(this);
77
78
  this.payments = new Payments(this);
78
79
  this.quizzes = new Quizzes(this);
80
+ this.sales = new Sales(this);
79
81
  this.search = new Search(this);
80
82
  this.shortLinks = new ShortLinks(this);
81
83
  this.surveys = new Surveys(this);