@insignia-education/api-sdk-js 0.15.122 → 0.15.124

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.122",
3
+ "version": "0.15.124",
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', {
@@ -151,6 +151,8 @@ export default class Users {
151
151
  quote: (data) => client.post(`${base}/quote`, data),
152
152
  /** Creates a Stripe PaymentIntent for this cart; returns { client_secret, publishable_key, amount } to mount Stripe Elements with. */
153
153
  stripeIntent: (data) => client.post(`${base}/stripe/intent`, data),
154
+ /** Which enabled payment methods currently have an active offer for these course ids — { [payment_method_id]: { percentage, offer_id } }. Preview for the cart's payment-method selector, before any one method is chosen. */
155
+ offerBadges: (courseIds) => client.post(`${base}/offer-badges`, { course_ids: courseIds }),
154
156
  /** Direct link to the invoice PDF (application/pdf, inline) — not a fetch: open/href this URL directly, same as support_file. Auth is via the ambient JWT cookie. */
155
157
  invoiceUrl: (id) => `${client.baseUrl}${base}/${id}/invoice`,
156
158
  /** Employee-only: force a fresh render + S3 re-upload of an already-numbered payment's invoice PDF, re-notifying the buyer. Returns the reloaded payment. */