@insignia-education/api-sdk-js 0.25.4 → 0.25.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
|
@@ -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
|
|
11
|
+
/** Admin-only: update company name/address. */
|
|
12
12
|
edit(data) { return this.#client.patch('/company-settings', data); }
|
|
13
13
|
}
|
package/src/api/v1/Users.js
CHANGED
|
@@ -387,7 +387,7 @@ export default class Users {
|
|
|
387
387
|
return this.#client.post(`/users/emails/verify/${hash}`);
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
/** Verified Telegram account linking for this user. Owner or staff only. */
|
|
390
|
+
/** Verified Telegram account linking for this user. Owner or staff only (purge: admins only). */
|
|
391
391
|
telegram(userId) {
|
|
392
392
|
const base = `/users/${userId}/telegram`;
|
|
393
393
|
const client = this.#client;
|
|
@@ -398,6 +398,8 @@ export default class Users {
|
|
|
398
398
|
connect: (data) => client.post(`${base}/connect`, data),
|
|
399
399
|
/** Undoes connect()/linkToken() — clears telegram/telegram_chat_id/telegram_verified_at, so the account reads as never-connected. */
|
|
400
400
|
disconnect: () => client.del(base),
|
|
401
|
+
/** Admin-only: removes this user from every Telegram group and deletes all their messages there. Runs in the background — resolves { queued: true } right away; 422 if Telegram isn't connected. */
|
|
402
|
+
purge: () => client.post(`${base}/purge`),
|
|
401
403
|
};
|
|
402
404
|
}
|
|
403
405
|
}
|
package/src/api/v1/index.js
CHANGED
|
@@ -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);
|