@insignia-education/api-sdk-js 0.16.0 → 0.16.1

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.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -30,6 +30,13 @@ 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
+ /** Direct download link for the same PayPal transaction list (format: 'csv' | 'xlsx') — open with <a href>, same convention as reportsSalesExportUrl(). Downloads a headers-only file rather than erroring if the account isn't available. */
34
+ statisticsPaypalTransactionsExportUrl({ fromDate, toDate, slot, format = 'csv' } = {}) {
35
+ return Admin.#buildUrl(this.#client.baseUrl, '/admin/statistics/paypal-transactions/export', {
36
+ from_date: fromDate, to_date: toDate, slot, format,
37
+ });
38
+ }
39
+
33
40
  /** 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
41
  statisticsCryptoBalances() {
35
42
  return this.#client.get('/admin/statistics/crypto-balances');
@@ -45,6 +52,13 @@ export default class Admin {
45
52
  return this.#client.get('/admin/statistics/stripe-transactions', { from_date: fromDate, to_date: toDate });
46
53
  }
47
54
 
55
+ /** Direct download link for the same Stripe transaction list (format: 'csv' | 'xlsx'). */
56
+ statisticsStripeTransactionsExportUrl({ fromDate, toDate, format = 'csv' } = {}) {
57
+ return Admin.#buildUrl(this.#client.baseUrl, '/admin/statistics/stripe-transactions/export', {
58
+ from_date: fromDate, to_date: toDate, format,
59
+ });
60
+ }
61
+
48
62
  /**
49
63
  * Our Binance holdings and recent money movement — distinct from
50
64
  * statisticsCryptoBalances()' on-chain wallet balance. Resolves
@@ -72,6 +86,16 @@ export default class Admin {
72
86
  return this.#client.get('/admin/statistics/binance-balances');
73
87
  }
74
88
 
89
+ /**
90
+ * Direct download link for the same `transactions` list (format: 'csv' |
91
+ * 'xlsx') — no date-range params, unlike the PayPal/Stripe export links
92
+ * above: Binance's own API already caps history at 90 days, so this
93
+ * always exports the full set that's currently available.
94
+ */
95
+ statisticsBinanceTransactionsExportUrl({ format = 'csv' } = {}) {
96
+ return Admin.#buildUrl(this.#client.baseUrl, '/admin/statistics/binance-transactions/export', { format });
97
+ }
98
+
75
99
  /** Paginated sales-report rows for a date range, with optional course/seller/payment-method/currency filters. */
76
100
  reportsSales({ fromDate, toDate, courseId, sellerId, paymentMethodId, currencyId, page, perPage } = {}) {
77
101
  return this.#client.get('/admin/reports/sales', {