@insignia-education/api-sdk-js 0.15.18 → 0.15.19
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 +1 -1
- package/src/api/v1/Payments.js +13 -0
- package/src/api/v1/Premiums.js +12 -0
- package/src/api/v1/index.js +2 -0
package/package.json
CHANGED
package/src/api/v1/Payments.js
CHANGED
|
@@ -19,6 +19,19 @@ export default class Payments {
|
|
|
19
19
|
courses(paymentId) {
|
|
20
20
|
const base = `/payments/${paymentId}/courses`;
|
|
21
21
|
const client = this.#client;
|
|
22
|
+
return {
|
|
23
|
+
edit: (id, data) => client.patch(`${base}/${id}`, data),
|
|
24
|
+
/** Soft-deletes the line; it stays visible in the admin panel, flagged as removed. */
|
|
25
|
+
delete: (id) => client.del(`${base}/${id}`),
|
|
26
|
+
/** Puts a previously-removed line back on the payment. */
|
|
27
|
+
restore: (id) => client.post(`${base}/${id}/restore`),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Employee-only: a payment's premium line items. Amount is derived server-side from the selected premium's course price * percentage + fixed price. */
|
|
32
|
+
premiums(paymentId) {
|
|
33
|
+
const base = `/payments/${paymentId}/premiums`;
|
|
34
|
+
const client = this.#client;
|
|
22
35
|
return {
|
|
23
36
|
edit: (id, data) => client.patch(`${base}/${id}`, data),
|
|
24
37
|
};
|
package/src/api/v1/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import Payments from './Payments.js';
|
|
|
23
23
|
import Quizzes from './Quizzes.js';
|
|
24
24
|
import ShortLinks from './ShortLinks.js';
|
|
25
25
|
import Surveys from './Surveys.js';
|
|
26
|
+
import Premiums from './Premiums.js';
|
|
26
27
|
import Taxes from './Taxes.js';
|
|
27
28
|
import Teacher from './Teacher.js';
|
|
28
29
|
import Telegram from './Telegram.js';
|
|
@@ -70,6 +71,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
|
|
|
70
71
|
this.quizzes = new Quizzes(this);
|
|
71
72
|
this.shortLinks = new ShortLinks(this);
|
|
72
73
|
this.surveys = new Surveys(this);
|
|
74
|
+
this.premiums = new Premiums(this);
|
|
73
75
|
this.taxes = new Taxes(this);
|
|
74
76
|
this.teacher = new Teacher(this);
|
|
75
77
|
this.telegram = new Telegram(this);
|