@insignia-education/api-sdk-js 0.9.31 → 0.9.33

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.9.31",
3
+ "version": "0.9.33",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -12,4 +12,6 @@ export default class Auth {
12
12
  refresh() { return this.#client.post('/auth/refresh'); }
13
13
  logout() { return this.#client.post('/auth/logout'); }
14
14
  user() { return this.#client.get('/auth/user'); }
15
+ forgotPassword(email) { return this.#client.post('/auth/forgot-password', { email }); }
16
+ resetPassword(data) { return this.#client.post('/auth/reset-password', data); }
15
17
  }
@@ -22,7 +22,18 @@ export default class Users {
22
22
  };
23
23
  }
24
24
 
25
- courses(userId) { return this.#nested(userId, 'courses'); }
25
+ courses(userId) {
26
+ const base = `/users/${userId}/courses`;
27
+ const client = this.#client;
28
+ return {
29
+ get: (id = null) => id ? client.get(`${base}/${id}`) : client.get(base),
30
+ create: (data) => client.put(base, data),
31
+ edit: (id, data) => client.patch(`${base}/${id}`, data),
32
+ delete: (id) => client.del(`${base}/${id}`),
33
+ /** Submit the four-dimension completion survey (0–5 each). */
34
+ survey: (id, data) => client.patch(`${base}/${id}/survey`, data),
35
+ };
36
+ }
26
37
  courseNotes(userId) { return this.#nested(userId, 'course-notes'); }
27
38
  quizzes(userId) { return this.#nested(userId, 'quizzes'); }
28
39
  sessions(userId) { return this.#nested(userId, 'sessions'); }