@insignia-education/api-sdk-js 0.15.121 → 0.15.123

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.121",
3
+ "version": "0.15.123",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -20,6 +20,16 @@ export default class Admin {
20
20
  return this.#client.get('/admin/statistics/claude-usage', { from_date: fromDate, to_date: toDate });
21
21
  }
22
22
 
23
+ /** Both rotating PayPal accounts' real available balance, keyed "1"/"2". Each resolves `{ available: false }` (not an error) if that account's "Transaction Search" feature isn't enabled in PayPal's dashboard yet. */
24
+ statisticsPaypalBalance({ currency } = {}) {
25
+ return this.#client.get('/admin/statistics/paypal-balance', { currency });
26
+ }
27
+
28
+ /** Raw PayPal transaction list for a date range (max 31 days) against one account slot (1 or 2, default 1). Resolves `{ available: false }` the same way statisticsPaypalBalance() does when it can't be read. */
29
+ statisticsPaypalTransactions({ fromDate, toDate, slot } = {}) {
30
+ return this.#client.get('/admin/statistics/paypal-transactions', { from_date: fromDate, to_date: toDate, slot });
31
+ }
32
+
23
33
  /** Paginated sales-report rows for a date range, with optional course/seller/payment-method/currency filters. */
24
34
  reportsSales({ fromDate, toDate, courseId, sellerId, paymentMethodId, currencyId, page, perPage } = {}) {
25
35
  return this.#client.get('/admin/reports/sales', {
@@ -55,6 +55,12 @@ export default class Users {
55
55
  * reloaded UserCourse (with certificate_url set), same shape as rebuildInvoice().
56
56
  */
57
57
  rebuildCertificate: (courseId) => client.post(`${base}/${courseId}/certificate/rebuild`),
58
+ /**
59
+ * Employee-only: point the certificate at a file already picked from the general
60
+ * File Manager (MediaPickerModal), instead of an auto-rendered PDF. Pass url: null
61
+ * to clear the override. Returns the reloaded UserCourse, same shape as rebuildCertificate().
62
+ */
63
+ setCustomCertificate: (courseId, url) => client.post(`${base}/${courseId}/certificate/custom`, { url }),
58
64
  };
59
65
  }
60
66