@insignia-education/api-sdk-js 0.25.3 → 0.25.4

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.25.3",
3
+ "version": "0.25.4",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -8,6 +8,6 @@ export default class CompanySettings {
8
8
  /** Admin-only: company name/address shown in email footers. */
9
9
  get() { return this.#client.get('/company-settings'); }
10
10
 
11
- /** Admin-only: update company name/address. */
11
+ /** Admin-only: update company name/address and `monthly_sales_goal` (the company target shown in the daily sales email). */
12
12
  edit(data) { return this.#client.patch('/company-settings', data); }
13
13
  }
@@ -93,6 +93,16 @@ export default class Users {
93
93
 
94
94
  courseNotes(userId) { return this.#nested(userId, 'course-notes'); }
95
95
 
96
+ /** Admin-only, seller-type users only: the 12 monthly sales goals for a year (`{ month, amount }[]`). edit() upserts the given months. */
97
+ salesGoals(userId) {
98
+ const base = `/users/${userId}/sales-goals`;
99
+ const client = this.#client;
100
+ return {
101
+ get: (year = new Date().getFullYear()) => client.get(base, { year }),
102
+ edit: (year, goals) => client.put(base, { year, goals }),
103
+ };
104
+ }
105
+
96
106
  /** Additional social/contact links (Facebook, WhatsApp, YouTube, etc.) — each row's contact_id points at a ContactTypes.get() entry. */
97
107
  contacts(userId) { return this.#nested(userId, 'contacts'); }
98
108