@insignia-education/api-sdk-js 0.18.0 → 0.19.1

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.18.0",
3
+ "version": "0.19.1",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -20,6 +20,8 @@ export default class Quizzes {
20
20
  create(data) { return this.#client.put('/quizzes', data); }
21
21
  edit(id, data) { return this.#client.patch(`/quizzes/${id}`, data); }
22
22
  delete(id) { return this.#client.del(`/quizzes/${id}`); }
23
+ /** Undoes delete() — brings a soft-deleted quiz back into the normal list. */
24
+ restore(id) { return this.#client.post(`/quizzes/${id}/restore`); }
23
25
 
24
26
  questions(quizId) {
25
27
  const client = this.#client;
@@ -30,6 +32,8 @@ export default class Quizzes {
30
32
  create: (data) => client.put(base, data),
31
33
  edit: (id, data) => client.patch(`${base}/${id}`, data),
32
34
  delete: (id) => client.del(`${base}/${id}`),
35
+ /** Undoes delete() — brings a soft-deleted question back into the normal list. */
36
+ restore: (id) => client.post(`${base}/${id}/restore`),
33
37
  answers: (questionId) => {
34
38
  const aBase = `${base}/${questionId}/answers`;
35
39
  return {
@@ -37,6 +41,8 @@ export default class Quizzes {
37
41
  create: (data) => client.put(aBase, data),
38
42
  edit: (id, data) => client.patch(`${aBase}/${id}`, data),
39
43
  delete: (id) => client.del(`${aBase}/${id}`),
44
+ /** Undoes delete() — brings a soft-deleted answer back into the normal list. */
45
+ restore: (id) => client.post(`${aBase}/${id}/restore`),
40
46
  };
41
47
  },
42
48
  /** Grading-rubric criteria for one question — shown to the teacher while grading an open/audio/document/link answer. */
@@ -47,6 +53,8 @@ export default class Quizzes {
47
53
  create: (data) => client.put(cBase, data),
48
54
  edit: (id, data) => client.patch(`${cBase}/${id}`, data),
49
55
  delete: (id) => client.del(`${cBase}/${id}`),
56
+ /** Undoes delete() — brings a soft-deleted criteria row back into the normal list. */
57
+ restore: (id) => client.post(`${cBase}/${id}/restore`),
50
58
  };
51
59
  },
52
60
  };
@@ -76,6 +76,12 @@ export default class Users {
76
76
  fd.append('file', file);
77
77
  return client.upload(`${base}/${courseId}/certificate/upload`, fd);
78
78
  },
79
+ /**
80
+ * Employee-only: invalidate just this enrollment's certificate PDF on CloudFront —
81
+ * for when the S3 object was replaced (e.g. a legacy-certificate restore) but the
82
+ * CDN is still serving the old cached copy. Returns { invalidated: true }.
83
+ */
84
+ invalidateCertificateCache: (courseId) => client.post(`${base}/${courseId}/certificate/invalidate-cache`),
79
85
  };
80
86
  }
81
87