@insignia-education/api-sdk-js 0.15.24 → 0.15.26

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.24",
3
+ "version": "0.15.26",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -5,7 +5,7 @@ export default class Auth {
5
5
  this.#client = client;
6
6
  }
7
7
 
8
- loginOrRegister(email, turnstile_token) { return this.#client.get(`/auth/login-register-check?email=${encodeURIComponent(email)}&turnstile_token=${encodeURIComponent(turnstile_token)}`); }
8
+ loginOrRegister(email, captcha_token) { return this.#client.get(`/auth/login-register-check?email=${encodeURIComponent(email)}&captcha_token=${encodeURIComponent(captcha_token)}`); }
9
9
  register(data) { return this.#client.put('/auth/register', data); }
10
10
  /** May resolve to { two_factor_required: true } — then call twoFactor({ pin }). */
11
11
  login(data) { return this.#client.post('/auth/login', data); }
@@ -13,7 +13,7 @@ export default class Auth {
13
13
  refresh() { return this.#client.post('/auth/refresh'); }
14
14
  logout() { return this.#client.post('/auth/logout'); }
15
15
  user() { return this.#client.get('/auth/user'); }
16
- forgotPassword(email, turnstile_token) { return this.#client.post('/auth/forgot-password', { email, turnstile_token }); }
16
+ forgotPassword(email, captcha_token) { return this.#client.post('/auth/forgot-password', { email, captcha_token }); }
17
17
  resetPassword(data) { return this.#client.post('/auth/reset-password', data); }
18
18
  magicLinkSend(email) { return this.#client.post('/auth/magic-link/send', { email }); }
19
19
  magicLinkVerify(data) { return this.#client.post('/auth/magic-link/verify', data); }
@@ -136,4 +136,16 @@ export default class Users {
136
136
 
137
137
  /** Employee-only: everything this user already owns (courses/sessions/quizzes). */
138
138
  ownedItems(userId) { return this.#client.get(`/users/${userId}/owned-items`); }
139
+
140
+ /** Sales-and-above: mint a one-time login link that logs the browser in as this user. */
141
+ phantom(userId) { return this.#client.post(`/users/${userId}/phantom`); }
142
+
143
+ /** Read-only: notifications are created by internal services, not over the API. */
144
+ notifications(userId) {
145
+ const base = `/users/${userId}/notifications`;
146
+ const client = this.#client;
147
+ return {
148
+ get: () => client.get(base),
149
+ };
150
+ }
139
151
  }