@delopay/sdk 0.1.0 → 0.1.2

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/dist/index.cjs CHANGED
@@ -525,10 +525,10 @@ var Customers = class {
525
525
  });
526
526
  }
527
527
  // --- OLAP extensions (Task 4.6) ---
528
- /** List customers with count. `GET /customers/list` with count flag. */
528
+ /** List customers with count. `GET /customers/list_with_count` */
529
529
  async listWithCount(params) {
530
- return this.request("GET", "/customers/list", {
531
- query: { ...params, with_count: true }
530
+ return this.request("GET", "/customers/list_with_count", {
531
+ query: params
532
532
  });
533
533
  }
534
534
  /** List mandates for a customer. `GET /customers/{customerId}/mandates` */
@@ -2588,9 +2588,10 @@ var Delopay = class {
2588
2588
  }
2589
2589
  if (!response.ok) {
2590
2590
  const body = await response.json().catch(() => ({}));
2591
- const message = body.message ?? `Request failed with status ${response.status}`;
2592
- const code = body.code ?? "";
2593
- const type = body.error_type ?? "";
2591
+ const err = body.error ?? body;
2592
+ const message = err.message ?? `Request failed with status ${response.status}`;
2593
+ const code = err.code ?? "";
2594
+ const type = err.error_type ?? err.type ?? "";
2594
2595
  if (response.status === 401) {
2595
2596
  throw new DelopayAuthenticationError(message);
2596
2597
  }