@insignia-education/api-sdk-js 0.16.4 → 0.16.6

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.4",
3
+ "version": "0.16.6",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -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