@insignia-education/api-sdk-js 0.15.31 → 0.15.34

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.31",
3
+ "version": "0.15.34",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -40,6 +40,12 @@ export default class Courses {
40
40
  createTelegramGroup: (id) => this.#client.post(`${base}/${id}/telegram-group`),
41
41
  /** Re-copy this date's telegram_link/telegram_id onto every UserCourse assigned to it. */
42
42
  syncTelegramToUsers: (id) => this.#client.post(`${base}/${id}/sync-user-courses`),
43
+ /** Bootstrap this date's recurring sessions (owned by its teacher) from the config set's weekly schedule. */
44
+ generateSessions: (id) => this.#client.post(`${base}/${id}/generate-sessions`),
45
+ /** Sessions already generated for this date. */
46
+ sessions: (id) => this.#client.get(`${base}/${id}/sessions`),
47
+ /** Create a Zoom meeting for one of this date's generated sessions. */
48
+ generateZoomMeeting: (id, sessionId) => this.#client.post(`${base}/${id}/sessions/${sessionId}/zoom-meeting`),
43
49
  };
44
50
  }
45
51
 
@@ -5,7 +5,18 @@ export default class Quizzes {
5
5
  this.#client = client;
6
6
  }
7
7
 
8
- get(id = null) { return id ? this.#client.get(`/quizzes/${id}`) : this.#client.get('/quizzes'); }
8
+ /**
9
+ * With no id: full unpaginated list by default (used by course/coupon/offer
10
+ * pickers). Pass search/page/perPage to get a paginated + searchable page
11
+ * instead (used by the admin Quizzes list).
12
+ */
13
+ get(id = null, { search = null, page = null, perPage = null } = {}) {
14
+ if (id) return this.#client.get(`/quizzes/${id}`);
15
+ if (search != null || page != null || perPage != null) {
16
+ return this.#client.get('/quizzes', { search, page, per_page: perPage ?? 15 });
17
+ }
18
+ return this.#client.get('/quizzes');
19
+ }
9
20
  create(data) { return this.#client.put('/quizzes', data); }
10
21
  edit(id, data) { return this.#client.patch(`/quizzes/${id}`, data); }
11
22
  delete(id) { return this.#client.del(`/quizzes/${id}`); }