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

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.4",
3
+ "version": "0.25.5",
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 CompanySalesGoals {
2
+ #client;
3
+
4
+ constructor(client) {
5
+ this.#client = client;
6
+ }
7
+
8
+ /** Admin-only: the company's 12 monthly sales goals for a year (`{ month, amount }[]`, 0 where unset). */
9
+ get(year = new Date().getFullYear()) { return this.#client.get('/company-sales-goals', { year }); }
10
+
11
+ /** Admin-only: upserts the given months of a year's company sales goals; resolves the full 12-month list. */
12
+ edit(year, goals) { return this.#client.put('/company-sales-goals', { year, goals }); }
13
+ }
@@ -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 and `monthly_sales_goal` (the company target shown in the daily sales email). */
11
+ /** Admin-only: update company name/address. */
12
12
  edit(data) { return this.#client.patch('/company-settings', data); }
13
13
  }
@@ -5,6 +5,7 @@ import Auth from './Auth.js';
5
5
  import Accounts from './Accounts.js';
6
6
  import Certificates from './Certificates.js';
7
7
  import Changelogs from './Changelogs.js';
8
+ import CompanySalesGoals from './CompanySalesGoals.js';
8
9
  import CompanySettings from './CompanySettings.js';
9
10
  import ContactForms from './ContactForms.js';
10
11
  import ContactTypes from './ContactTypes.js';
@@ -65,6 +66,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
65
66
  this.accounts = new Accounts(this);
66
67
  this.certificates = new Certificates(this);
67
68
  this.changelogs = new Changelogs(this);
69
+ this.companySalesGoals = new CompanySalesGoals(this);
68
70
  this.companySettings = new CompanySettings(this);
69
71
  this.contactForms = new ContactForms(this);
70
72
  this.contactTypes = new ContactTypes(this);