@insignia-education/api-sdk-js 0.15.19 → 0.15.20

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.15.19",
3
+ "version": "0.15.20",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -21,10 +21,21 @@ export default class Payments {
21
21
  const client = this.#client;
22
22
  return {
23
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`),
24
+ };
25
+ }
26
+
27
+ /**
28
+ * Employee-only: remove/restore any of a payment's line items. Removal is a
29
+ * soft delete — the line stays visible in the admin panel flagged as removed,
30
+ * and restore() puts it back. `type` is one of 'courses' | 'sessions' |
31
+ * 'quizzes' | 'premiums' | 'taxes'.
32
+ */
33
+ items(paymentId) {
34
+ const base = `/payments/${paymentId}`;
35
+ const client = this.#client;
36
+ return {
37
+ delete: (type, id) => client.del(`${base}/${type}/${id}`),
38
+ restore: (type, id) => client.post(`${base}/${type}/${id}/restore`),
28
39
  };
29
40
  }
30
41