@insignia-education/api-sdk-js 0.16.3 → 0.16.5

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.16.3",
3
+ "version": "0.16.5",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -56,6 +56,8 @@ export default class Teacher {
56
56
  courseDateSessions: (courseDateId) => this.#client.get(`${base}/course-dates/${courseDateId}/sessions`),
57
57
  /** Enrolled roster ({id, name, email}) for one CourseDate, read straight off enrollment — shows up even before any session has been synced. Read-only: does not move students between dates. */
58
58
  courseDateStudents: (courseDateId) => this.#client.get(`${base}/course-dates/${courseDateId}/students`),
59
+ /** One student's quiz attempts in this CourseDate's course, every one of them - not just needs_teacher_correction=1 (auto-graded ones never show up in the "Quizzes por corregir" surfaces below). Each row carries `quiz.needs_teacher_correction`, `level`/`lesson`, `final_score_percentage`; filter by level/lesson client-side. */
60
+ courseDateStudentQuizzes: (courseDateId, studentId) => this.#client.get(`${base}/course-dates/${courseDateId}/students/${studentId}/quizzes`),
59
61
  /** { url, pending } — the zip archive of this group's course materials, or pending:true while it's (re)building. */
60
62
  courseDateContentDownload: (courseDateId) => this.#client.get(`${base}/course-dates/${courseDateId}/content-download`),
61
63
  /** Ungraded quiz submissions from one CourseDate's own students. */
@@ -61,6 +61,19 @@ export default class Users {
61
61
  * to clear the override. Returns the reloaded UserCourse, same shape as rebuildCertificate().
62
62
  */
63
63
  setCustomCertificate: (courseId, url) => client.post(`${base}/${courseId}/certificate/custom`, { url }),
64
+ /**
65
+ * Employee-only: upload a hand-made PDF as this enrollment's certificate, instead
66
+ * of picking one already in the File Manager (setCustomCertificate) or the
67
+ * auto-rendered one (rebuildCertificate). Backend requires the enrollment to
68
+ * already be completed (completed_at set) — same rule rebuildCertificate() and
69
+ * setCustomCertificate() are subject to. Returns the reloaded UserCourse, same
70
+ * shape as the other two.
71
+ */
72
+ uploadCertificate: (courseId, file) => {
73
+ const fd = new FormData();
74
+ fd.append('file', file);
75
+ return client.upload(`${base}/${courseId}/certificate/upload`, fd);
76
+ },
64
77
  };
65
78
  }
66
79