@insignia-education/api-sdk-js 0.15.87 → 0.15.92

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.87",
3
+ "version": "0.15.92",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/Client.js CHANGED
@@ -127,5 +127,5 @@ export default class InsigniaClient {
127
127
  post(path, body = null) { return this.#request('POST', path, body); }
128
128
  put(path, body = null) { return this.#request('PUT', path, body); }
129
129
  patch(path, body = null){ return this.#request('PATCH', path, body); }
130
- del(path) { return this.#request('DELETE', path); }
130
+ del(path, body = null) { return this.#request('DELETE', path, body); }
131
131
  }
@@ -21,4 +21,6 @@ export default class Auth {
21
21
  emailVerify(data) { return this.#client.post('/auth/email-verify', data); }
22
22
  /** Second login step when two_factor_required: exchange { pin } for a session. */
23
23
  twoFactor(data) { return this.#client.post('/auth/2fa', data); }
24
+ /** GDPR Art. 8 — clicked by the guardian from the consent email, not the account holder; no session is created. */
25
+ guardianConsentConfirm(hash) { return this.#client.post(`/guardian-consent/${hash}`); }
24
26
  }
@@ -0,0 +1,12 @@
1
+ /** Admin-only: IP blocks (the blocks table — ip-scoped only, see App\Models\Block). */
2
+ export default class Blocks {
3
+ #client;
4
+
5
+ constructor(client) {
6
+ this.#client = client;
7
+ }
8
+
9
+ get(id = null) { return id ? this.#client.get(`/blocks/${id}`) : this.#client.get('/blocks'); }
10
+ create(data) { return this.#client.put('/blocks', data); }
11
+ delete(id) { return this.#client.del(`/blocks/${id}`); }
12
+ }
@@ -27,6 +27,9 @@ export default class Employee {
27
27
  /** Reassign a single session's teacher (not the whole course_date — that's a course-config action). */
28
28
  changeSessionTeacher: (sessionId, teacherId) =>
29
29
  this.#client.patch(`${base}/sessions/${sessionId}/teacher`, { teacher_id: teacherId }),
30
+ /** Freeform Zoom meeting for the requesting employee (no course, no student roster). time is "HH:mm". */
31
+ createCustomMeeting: (topic, date, time, duration) =>
32
+ this.#client.post(`${base}/custom-meeting`, { topic, date, time, duration }),
30
33
  };
31
34
  }
32
35
  }
@@ -217,6 +217,18 @@ export default class Users {
217
217
  /** Sales-and-above: re-run the course/individual-session access reconciliation for this user on demand. */
218
218
  syncAccess(userId) { return this.#client.post(`/users/${userId}/sync-access`); }
219
219
 
220
+ /** Admin-only: total blockade — enforced on every authenticated route, not just new logins. */
221
+ block(userId, reason) { return this.#client.post(`/users/${userId}/block`, { reason }); }
222
+
223
+ /** Admin-only: lifts a hard block. */
224
+ unblock(userId) { return this.#client.post(`/users/${userId}/unblock`); }
225
+
226
+ /** GDPR erasure request — self-service or sales-and-above, always confirmed with the ACTOR's own current password. Soft-deletes now; the API permanently purges it after a 1-year retention window. */
227
+ delete(userId, password) { return this.#client.del(`/users/${userId}`, { password }); }
228
+
229
+ /** GDPR access/portability request (Art. 15/20) — self-service or sales-and-above. Runs synchronously and returns the DataRequest with `pdf_url`/`json_url` already populated. */
230
+ exportData(userId) { return this.#client.post(`/users/${userId}/data-export`); }
231
+
220
232
  /** Notifications are created by internal services, not over the API — `resend()` is the one exception (sales-and-above). */
221
233
  notifications(userId) {
222
234
  const base = `/users/${userId}/notifications`;
@@ -19,6 +19,7 @@ import Forums from './Forums.js';
19
19
  import Hashes from './Hashes.js';
20
20
  import Insignias from './Insignias.js';
21
21
  import Languages from './Languages.js';
22
+ import Blocks from './Blocks.js';
22
23
  import MailBlacklist from './MailBlacklist.js';
23
24
  import MailingLists from './MailingLists.js';
24
25
  import Offers from './Offers.js';
@@ -75,6 +76,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
75
76
  this.insignias = new Insignias(this);
76
77
  this.languages = new Languages(this);
77
78
  this.mailBlacklist = new MailBlacklist(this);
79
+ this.blocks = new Blocks(this);
78
80
  this.mailingLists = new MailingLists(this);
79
81
  this.offers = new Offers(this);
80
82
  this.organizations = new Organizations(this);