@insignia-education/api-sdk-js 0.24.3 → 0.24.4

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.24.3",
3
+ "version": "0.24.4",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,7 +23,7 @@ export default class Admin {
23
23
  });
24
24
  }
25
25
 
26
- /** Date-range sales report: totals by status (pending/approved/rejected), and the same split by course, payment method and currency. */
26
+ /** Date-range sales report: totals by status (pending/approved/rejected), and the same split by course, payment method, currency, owner and seller (`by_seller`: `[{ seller: { id|null, name, username }, pending, approved, rejected, total }]`). */
27
27
  statisticsSales({ fromDate, toDate } = {}) {
28
28
  return this.#client.get('/admin/statistics/sales', { from_date: fromDate, to_date: toDate });
29
29
  }
@@ -188,6 +188,20 @@ export default class Admin {
188
188
  });
189
189
  }
190
190
 
191
+ /** Paginated per-seller sales report for a date range: line count and base-currency amount per status (pending/approved/rejected) and in total, biggest first. Payments with no seller are one row with `seller_id: null`. */
192
+ reportsSalesBySeller({ fromDate, toDate, page, perPage } = {}) {
193
+ return this.#client.get('/admin/reports/sales-by-seller', {
194
+ from_date: fromDate, to_date: toDate, page, per_page: perPage,
195
+ });
196
+ }
197
+
198
+ /** Direct download link for the sales-by-seller report (format: 'csv' | 'xlsx'). */
199
+ reportsSalesBySellerExportUrl({ fromDate, toDate, format = 'csv' } = {}) {
200
+ return Admin.#buildUrl(this.#client.baseUrl, '/admin/reports/sales-by-seller/export', {
201
+ from_date: fromDate, to_date: toDate, format,
202
+ });
203
+ }
204
+
191
205
  /** Organization-wide OpenAI completion usage, model breakdown and spend for a date range. Resolves `{ available: false }` when the API server has no valid OpenAI Admin API key. */
192
206
  reportsOpenAiUsage({ fromDate, toDate } = {}) {
193
207
  return this.#client.get('/admin/reports/openai-usage', {