@insignia-education/api-sdk-js 0.15.44 → 0.15.45

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.44",
3
+ "version": "0.15.45",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,23 @@
1
+ export default class Employee {
2
+ #client;
3
+
4
+ constructor(client) {
5
+ this.#client = client;
6
+ }
7
+
8
+ dashboard() {
9
+ const base = '/employee/dashboard';
10
+ return {
11
+ /** All teachers' sessions for a given date (YYYY-MM-DD). */
12
+ sessions: (date) => this.#client.get(`${base}/sessions`, { date }),
13
+ /** All sessions for one course_date, any teacher. */
14
+ courseDateSessions: (courseDateId) => this.#client.get(`${base}/course-dates/${courseDateId}/sessions`),
15
+ /** Mark a student's attendance on any teacher's session. */
16
+ markAttendance: (sessionId, studentId, present) =>
17
+ this.#client.patch(`${base}/sessions/${sessionId}/attendance`, { student_id: studentId, present }),
18
+ /** Mark whether the assigned teacher showed up to a session. */
19
+ markTeacherPresent: (sessionId, present) =>
20
+ this.#client.patch(`${base}/sessions/${sessionId}/teacher-present`, { present }),
21
+ };
22
+ }
23
+ }
@@ -136,6 +136,9 @@ export default class Users {
136
136
  /** GET /users/{orgId}/organization/members — members where manager_id = orgId. */
137
137
  organizationMembers(orgId) { return this.#client.get(`/users/${orgId}/organization/members`); }
138
138
 
139
+ /** GET /users/{orgId}/organization/students — distinct students with a course_count, for the Students tab list. */
140
+ organizationStudents(orgId) { return this.#client.get(`/users/${orgId}/organization/students`); }
141
+
139
142
  /** Employee-only: everything this user already owns (courses/sessions/quizzes). */
140
143
  ownedItems(userId) { return this.#client.get(`/users/${userId}/owned-items`); }
141
144
 
@@ -13,6 +13,7 @@ import Courses from './Courses.js';
13
13
  import Currencies from './Currencies.js';
14
14
  import Dashboard from './Dashboard.js';
15
15
  import EducationCenter from './EducationCenter.js';
16
+ import Employee from './Employee.js';
16
17
  import Files from './Files.js';
17
18
  import Forums from './Forums.js';
18
19
  import Hashes from './Hashes.js';
@@ -66,6 +67,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
66
67
  this.currencies = new Currencies(this);
67
68
  this.dashboard = new Dashboard(this);
68
69
  this.educationCenter = new EducationCenter(this);
70
+ this.employee = new Employee(this);
69
71
  this.files = new Files(this);
70
72
  this.forums = new Forums(this);
71
73
  this.hashes = new Hashes(this);