@insignia-education/api-sdk-js 0.15.49 → 0.15.50

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.49",
3
+ "version": "0.15.50",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -11,17 +11,24 @@ export default class Organizations {
11
11
  ? this.#client.get(`/organizations/${id}`)
12
12
  : this.#client.get('/organizations', { page, per_page: perPage });
13
13
  }
14
- /** Employee-only. */
14
+ /** Organization-and-above (owner creates their own org; employee-and-above may pass user_id to set another owner). */
15
15
  create(data) { return this.#client.put('/organizations', data); }
16
16
  /** user_id (owner reassignment) is applied only when the caller is employee-and-above. */
17
17
  edit(id, data) { return this.#client.patch(`/organizations/${id}`, data); }
18
18
 
19
+ /** Confirms a pending member invite from the emailed link — logs the user in on success. */
20
+ confirmInvite(id, { username, hash }) { return this.#client.post(`/organizations/${id}/members/invite/confirm`, { username, hash }); }
21
+
19
22
  members(id) {
20
23
  const base = `/organizations/${id}/members`;
21
24
  const client = this.#client;
22
25
  return {
23
26
  get: () => client.get(base),
24
27
  courses: (userId) => client.get(`${base}/${userId}/courses`),
28
+ /** Users matching `q` not already invited/members — for the invite search box. */
29
+ search: (q) => client.get(`${base}/search`, { q }),
30
+ /** Creates a pending invite and emails the user a confirm link. */
31
+ invite: (userId) => client.post(`${base}/invite`, { user_id: userId }),
25
32
  /** Creates a real UserPayment for this member — same payload shape as users(id).payments().create(). */
26
33
  createPayment: (userId, data) => client.put(`${base}/${userId}/payments`, data),
27
34
  };