@insignia-education/api-sdk-js 0.15.77 → 0.15.80

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.77",
3
+ "version": "0.15.80",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,13 @@
1
+ export default class CompanySettings {
2
+ #client;
3
+
4
+ constructor(client) {
5
+ this.#client = client;
6
+ }
7
+
8
+ /** Admin-only: company name/address shown in email footers. */
9
+ get() { return this.#client.get('/company-settings'); }
10
+
11
+ /** Admin-only: update company name/address. */
12
+ edit(data) { return this.#client.patch('/company-settings', data); }
13
+ }
@@ -68,6 +68,15 @@ export default class Users {
68
68
  delete: (id) => client.del(`${base}/${id}`),
69
69
  /** Puts a soft-deleted attempt back. */
70
70
  restore: (id) => client.post(`${base}/${id}/restore`),
71
+ /** Full attempt detail (quiz.questions.answers eager-loaded) — staff-only (any seller/employee/admin, not just this quiz's course teacher). */
72
+ detail: (id) => client.get(`${base}/${id}/detail`),
73
+ /**
74
+ * Staff counterpart of Teacher.dashboard().gradeQuiz() — same grading semantics
75
+ * (open_grades, score_audio, score_session_percentage, teacher_graded_at, the
76
+ * comments_ fields, course_selected — see that method's doc), but any seller/
77
+ * employee/admin can grade any user's attempt, not just that quiz's own course teacher.
78
+ */
79
+ grade: (id, data) => client.patch(`${base}/${id}/grade`, data),
71
80
  /**
72
81
  * Upload the file a student attaches as their answer to a
73
82
  * document_upload (PDF) or audio_answer (recording) question
@@ -203,12 +212,13 @@ export default class Users {
203
212
  /** Sales-and-above: re-run the course/individual-session access reconciliation for this user on demand. */
204
213
  syncAccess(userId) { return this.#client.post(`/users/${userId}/sync-access`); }
205
214
 
206
- /** Read-only: notifications are created by internal services, not over the API. */
215
+ /** Notifications are created by internal services, not over the API — `resend()` is the one exception (sales-and-above). */
207
216
  notifications(userId) {
208
217
  const base = `/users/${userId}/notifications`;
209
218
  const client = this.#client;
210
219
  return {
211
220
  get: () => client.get(base),
221
+ resend: (id) => client.post(`${base}/${id}/resend`),
212
222
  };
213
223
  }
214
224
 
@@ -3,6 +3,7 @@ import Admin from './Admin.js';
3
3
  import Auth from './Auth.js';
4
4
  import Accounts from './Accounts.js';
5
5
  import Changelogs from './Changelogs.js';
6
+ import CompanySettings from './CompanySettings.js';
6
7
  import ContactForms from './ContactForms.js';
7
8
  import ConversationalTopics from './ConversationalTopics.js';
8
9
  import Countries from './Countries.js';
@@ -56,6 +57,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
56
57
  this.auth = new Auth(this);
57
58
  this.accounts = new Accounts(this);
58
59
  this.changelogs = new Changelogs(this);
60
+ this.companySettings = new CompanySettings(this);
59
61
  this.contactForms = new ContactForms(this);
60
62
  this.conversationalTopics = new ConversationalTopics(this);
61
63
  this.countries = new Countries(this);