@insignia-education/api-sdk-js 0.15.119 → 0.15.121

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.119",
3
+ "version": "0.15.121",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,9 @@
1
+ export default class ContactTypes {
2
+ #client;
3
+
4
+ constructor(client) {
5
+ this.#client = client;
6
+ }
7
+
8
+ get() { return this.#client.get('/contact-types'); }
9
+ }
@@ -66,6 +66,9 @@ export default class Users {
66
66
 
67
67
  courseNotes(userId) { return this.#nested(userId, 'course-notes'); }
68
68
 
69
+ /** Additional social/contact links (Facebook, WhatsApp, YouTube, etc.) — each row's contact_id points at a ContactTypes.get() entry. */
70
+ contacts(userId) { return this.#nested(userId, 'contacts'); }
71
+
69
72
  /** get() accepts optional { courseId, withTrashed } filters — withTrashed also returns soft-deleted attempts. */
70
73
  quizzes(userId) {
71
74
  const base = `/users/${userId}/quizzes`;
@@ -242,13 +245,15 @@ export default class Users {
242
245
  /** GDPR access/portability request (Art. 15/20) — self-service or sales-and-above. Runs synchronously and returns the DataRequest with `pdf_url`/`json_url` already populated. */
243
246
  exportData(userId) { return this.#client.post(`/users/${userId}/data-export`); }
244
247
 
245
- /** Notifications are created by internal services, not over the API — `resend()` is the one exception (sales-and-above). */
248
+ /** Notifications are created by internal services, not over the API — `resend()` and `send()` (both sales-and-above) are the exceptions. */
246
249
  notifications(userId) {
247
250
  const base = `/users/${userId}/notifications`;
248
251
  const client = this.#client;
249
252
  return {
250
253
  get: () => client.get(base),
251
254
  resend: (id) => client.post(`${base}/${id}/resend`),
255
+ /** Composes and sends (or schedules) a one-off message to this user. data: { subject, content, channels, include_signature?, scheduled_at? }. */
256
+ send: (data) => client.post(`${base}/send`, data),
252
257
  };
253
258
  }
254
259
 
@@ -6,6 +6,7 @@ import Certificates from './Certificates.js';
6
6
  import Changelogs from './Changelogs.js';
7
7
  import CompanySettings from './CompanySettings.js';
8
8
  import ContactForms from './ContactForms.js';
9
+ import ContactTypes from './ContactTypes.js';
9
10
  import ConversationalTopics from './ConversationalTopics.js';
10
11
  import Countries from './Countries.js';
11
12
  import Coupons from './Coupons.js';
@@ -62,6 +63,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
62
63
  this.changelogs = new Changelogs(this);
63
64
  this.companySettings = new CompanySettings(this);
64
65
  this.contactForms = new ContactForms(this);
66
+ this.contactTypes = new ContactTypes(this);
65
67
  this.conversationalTopics = new ConversationalTopics(this);
66
68
  this.countries = new Countries(this);
67
69
  this.coupons = new Coupons(this);