@insignia-education/api-sdk-js 0.25.7 → 0.25.9
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,16 @@
|
|
|
1
|
+
export default class CompanyCelebrations {
|
|
2
|
+
#client;
|
|
3
|
+
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.#client = client;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Admin-only: a year of celebratory media, one entry per month (`{ month, media: { url, kind }[] }[]`, empty `media` where unset). */
|
|
9
|
+
get(year = new Date().getFullYear()) { return this.#client.get('/company-celebrations', { year }); }
|
|
10
|
+
|
|
11
|
+
/** Admin-only: replaces one month's media list (`kind` is `image` or `video`; `[]` clears it); resolves the full year. */
|
|
12
|
+
edit(year, month, media) { return this.#client.put('/company-celebrations', { year, month, media }); }
|
|
13
|
+
|
|
14
|
+
/** Sellers-and-above: the celebration to show right now — `{ active, year, month, media }`, `active` only in the month's first week. */
|
|
15
|
+
current() { return this.#client.get('/sales/celebration'); }
|
|
16
|
+
}
|
|
@@ -10,5 +10,10 @@ export default class MailingLists {
|
|
|
10
10
|
delete(id) { return this.#client.del(`/mailing-lists/${id}`); }
|
|
11
11
|
preview(filters) { return this.#client.post('/mailing-lists/preview', { filters }); }
|
|
12
12
|
send(data) { return this.#client.post('/mailing-lists/send', data); }
|
|
13
|
+
/** Direct download link for the audience matching `filters` (format: 'csv' | 'xlsx') — open with <a href>, not fetch (cookie-authenticated, same convention as Admin.js's export URLs). */
|
|
14
|
+
exportUrl(filters, format = 'csv') {
|
|
15
|
+
const qs = new URLSearchParams({ filters: JSON.stringify(filters), format }).toString();
|
|
16
|
+
return `${this.#client.baseUrl}/mailing-lists/export?${qs}`;
|
|
17
|
+
}
|
|
13
18
|
sent() { return this.#client.get('/mailing-lists/sent'); }
|
|
14
19
|
}
|
package/src/api/v1/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import Accounts from './Accounts.js';
|
|
|
6
6
|
import Certificates from './Certificates.js';
|
|
7
7
|
import Changelogs from './Changelogs.js';
|
|
8
8
|
import CompanySalesGoals from './CompanySalesGoals.js';
|
|
9
|
+
import CompanyCelebrations from './CompanyCelebrations.js';
|
|
9
10
|
import CompanySettings from './CompanySettings.js';
|
|
10
11
|
import ContactForms from './ContactForms.js';
|
|
11
12
|
import ContactTypes from './ContactTypes.js';
|
|
@@ -67,6 +68,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
|
|
|
67
68
|
this.certificates = new Certificates(this);
|
|
68
69
|
this.changelogs = new Changelogs(this);
|
|
69
70
|
this.companySalesGoals = new CompanySalesGoals(this);
|
|
71
|
+
this.companyCelebrations = new CompanyCelebrations(this);
|
|
70
72
|
this.companySettings = new CompanySettings(this);
|
|
71
73
|
this.contactForms = new ContactForms(this);
|
|
72
74
|
this.contactTypes = new ContactTypes(this);
|