@insignia-education/api-sdk-js 0.25.9 → 0.25.10

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/README.md CHANGED
@@ -387,6 +387,8 @@ await v1.users.courses(1).get();
387
387
  await v1.users.courseNotes(1).get();
388
388
  await v1.users.quizzes(1).get();
389
389
  await v1.users.sessions(1).get();
390
+ await v1.users.sessions(1).rate(10, { clarity_rating: 5, correction_rating: 4, motivation_rating: 5 });
391
+ await v1.users.topRatedTeachers();
390
392
  await v1.users.surveys(1).get();
391
393
  await v1.users.cart(1).get();
392
394
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insignia-education/api-sdk-js",
3
- "version": "0.25.9",
3
+ "version": "0.25.10",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -53,6 +53,11 @@ export default class Admin {
53
53
  return this.#client.get('/admin/statistics/course-ratings');
54
54
  }
55
55
 
56
+ /** Teachers ranked by average session rating (best first): `[{ teacher_id, name, teacher_average, clarity_average, correction_average, motivation_average, ratings }]` (`teacher_average` = mean of the three). `from`/`to` (`YYYY-MM-DD`, both optional) limit it to ratings made in that period; omit both for all time. Employee-only. */
57
+ statisticsTeacherRatings({ from, to } = {}) {
58
+ return this.#client.get('/admin/statistics/teacher-ratings', { from, to });
59
+ }
60
+
56
61
  /** Claude (Anthropic) token usage/spend for a date range, plus account balance. Each half resolves `{ available: false }` (not an error) when its required config (admin key / account balance) isn't set. */
57
62
  statisticsClaudeUsage({ fromDate, toDate } = {}) {
58
63
  return this.#client.get('/admin/statistics/claude-usage', { from_date: fromDate, to_date: toDate });
@@ -160,9 +160,23 @@ export default class Users {
160
160
  * session starts; a seller-and-above may reset any time.
161
161
  */
162
162
  reset: (id) => client.post(`${base}/${id}/reset`),
163
+ /**
164
+ * Student rates a finished session they attended — one-time, locked afterwards.
165
+ * `{ clarity_rating, correction_rating, motivation_rating }` (clear explanations / helpful respectful
166
+ * corrections / motivates speaking English), each an integer 1-5. Only the student themself
167
+ * (not staff) can submit it. 422 if the session hasn't ended / has no teacher, 403 if the
168
+ * student wasn't marked present, 409 if already rated. The booking list rows carry the
169
+ * submitted rating as `my_rating` (or null).
170
+ */
171
+ rate: (id, data) => client.post(`${base}/${id}/rating`, data),
163
172
  };
164
173
  }
165
174
 
175
+ /** Top 3 teachers by overall average session rating (all time), visible to any authenticated user: `[{ teacher_id, name, teacher_average, ratings }]` (`teacher_average` = mean of the three questions). */
176
+ topRatedTeachers() {
177
+ return this.#client.get('/teachers/top-rated');
178
+ }
179
+
166
180
  surveys(userId) { return this.#nested(userId, 'surveys'); }
167
181
  cart(userId) { return this.#nested(userId, 'cart'); }
168
182