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

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.123",
3
+ "version": "0.15.125",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -30,6 +30,21 @@ export default class Admin {
30
30
  return this.#client.get('/admin/statistics/paypal-transactions', { from_date: fromDate, to_date: toDate, slot });
31
31
  }
32
32
 
33
+ /** Our wallet's live on-chain balance for every crypto asset/chain we accept payment in — [{ asset, chain, balance }]. Read straight from the chain, not a sum of recorded payments. */
34
+ statisticsCryptoBalances() {
35
+ return this.#client.get('/admin/statistics/crypto-balances');
36
+ }
37
+
38
+ /** Our Stripe account's current available/pending balance, broken down per currency. Resolves `{ available: false }` (not an error) if the account can't be read. */
39
+ statisticsStripeBalance() {
40
+ return this.#client.get('/admin/statistics/stripe-balance');
41
+ }
42
+
43
+ /** Raw Stripe balance-transaction list (charges, refunds, fees, payouts) for a date range. Resolves `{ available: false }` the same way statisticsStripeBalance() does. */
44
+ statisticsStripeTransactions({ fromDate, toDate } = {}) {
45
+ return this.#client.get('/admin/statistics/stripe-transactions', { from_date: fromDate, to_date: toDate });
46
+ }
47
+
33
48
  /** Paginated sales-report rows for a date range, with optional course/seller/payment-method/currency filters. */
34
49
  reportsSales({ fromDate, toDate, courseId, sellerId, paymentMethodId, currencyId, page, perPage } = {}) {
35
50
  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. */