@insignia-education/api-sdk-js 0.15.129 → 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 +1 -1
- package/src/api/v1/Admin.js +24 -0
- package/src/api/v1/Blocks.js +8 -4
package/package.json
CHANGED
package/src/api/v1/Admin.js
CHANGED
|
@@ -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', {
|
package/src/api/v1/Blocks.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Sales-and-above: IP blocks (the blocks table — ip-scoped only, see App\Models\Block). */
|
|
2
2
|
export default class Blocks {
|
|
3
3
|
#client;
|
|
4
4
|
|
|
@@ -6,7 +6,11 @@ export default class Blocks {
|
|
|
6
6
|
this.#client = client;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/** `id` fetches one block; omitted fetches the paginated list — `{ page, perPage }` control that page. */
|
|
10
|
+
get(id = null, { page, perPage } = {}) {
|
|
11
|
+
return id ? this.#client.get(`/blocks/${id}`) : this.#client.get('/blocks', { page, per_page: perPage });
|
|
12
|
+
}
|
|
13
|
+
create(data) { return this.#client.put('/blocks', data); }
|
|
14
|
+
edit(id, data) { return this.#client.patch(`/blocks/${id}`, data); }
|
|
15
|
+
delete(id) { return this.#client.del(`/blocks/${id}`); }
|
|
12
16
|
}
|