@insignia-education/api-sdk-js 0.17.2 → 0.18.0

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.17.2",
3
+ "version": "0.18.0",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -17,6 +17,8 @@ export default class Users {
17
17
  assignable() { return this.#client.get('/users/assignable'); }
18
18
  /** Employee-only: users assignable as a course teacher (super-admins, admins, employees, teachers). */
19
19
  assignableTeachers() { return this.#client.get('/users/assignable-teachers'); }
20
+ /** Employee-only: employee-tier users (super-admins, admins, employees), for the bug report "assign to" picker. */
21
+ assignableEmployees() { return this.#client.get('/users/assignable-employees'); }
20
22
  /** Employee-only: paginated list of teacher-type users, for the admin Teachers view. */
21
23
  teachers({ page = 1, perPage = 15 } = {}) {
22
24
  return this.#client.get('/users/teachers', { page, per_page: perPage });
@@ -202,6 +204,22 @@ export default class Users {
202
204
  };
203
205
  }
204
206
 
207
+ /**
208
+ * Logged-in devices/sessions. Rows are only ever created by the auth flow
209
+ * itself (a real login/refresh) — this is read + revoke, never create.
210
+ */
211
+ devices(userId) {
212
+ const base = `/users/${userId}/devices`;
213
+ const client = this.#client;
214
+ return {
215
+ get: () => client.get(base),
216
+ /** Revoke one device by its id — that device's token stops being accepted immediately. */
217
+ delete: (id) => client.del(`${base}/${id}`),
218
+ /** "Log out all other devices" — keeps the caller's own current session intact. */
219
+ deleteAll: () => client.del(base),
220
+ };
221
+ }
222
+
205
223
  experiences(userId) {
206
224
  const base = `/users/${userId}/experiences`;
207
225
  const client = this.#client;