@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.d.cts CHANGED
@@ -1991,9 +1991,10 @@ declare class Customers {
1991
1991
  * @returns Array of customer objects.
1992
1992
  */
1993
1993
  list(params?: CustomerListParams): Promise<CustomerResponse[]>;
1994
- /** List customers with count. `GET /customers/list` with count flag. */
1994
+ /** List customers with count. `GET /customers/list_with_count` */
1995
1995
  listWithCount(params?: CustomerListParams): Promise<{
1996
1996
  count: number;
1997
+ total_count: number;
1997
1998
  data: CustomerResponse[];
1998
1999
  }>;
1999
2000
  /** List mandates for a customer. `GET /customers/{customerId}/mandates` */
package/dist/index.d.ts CHANGED
@@ -1991,9 +1991,10 @@ declare class Customers {
1991
1991
  * @returns Array of customer objects.
1992
1992
  */
1993
1993
  list(params?: CustomerListParams): Promise<CustomerResponse[]>;
1994
- /** List customers with count. `GET /customers/list` with count flag. */
1994
+ /** List customers with count. `GET /customers/list_with_count` */
1995
1995
  listWithCount(params?: CustomerListParams): Promise<{
1996
1996
  count: number;
1997
+ total_count: number;
1997
1998
  data: CustomerResponse[];
1998
1999
  }>;
1999
2000
  /** List mandates for a customer. `GET /customers/{customerId}/mandates` */
package/dist/index.js CHANGED
@@ -475,10 +475,10 @@ var Customers = class {
475
475
  });
476
476
  }
477
477
  // --- OLAP extensions (Task 4.6) ---
478
- /** List customers with count. `GET /customers/list` with count flag. */
478
+ /** List customers with count. `GET /customers/list_with_count` */
479
479
  async listWithCount(params) {
480
- return this.request("GET", "/customers/list", {
481
- query: { ...params, with_count: true }
480
+ return this.request("GET", "/customers/list_with_count", {
481
+ query: params
482
482
  });
483
483
  }
484
484
  /** List mandates for a customer. `GET /customers/{customerId}/mandates` */
@@ -2538,9 +2538,10 @@ var Delopay = class {
2538
2538
  }
2539
2539
  if (!response.ok) {
2540
2540
  const body = await response.json().catch(() => ({}));
2541
- const message = body.message ?? `Request failed with status ${response.status}`;
2542
- const code = body.code ?? "";
2543
- const type = body.error_type ?? "";
2541
+ const err = body.error ?? body;
2542
+ const message = err.message ?? `Request failed with status ${response.status}`;
2543
+ const code = err.code ?? "";
2544
+ const type = err.error_type ?? err.type ?? "";
2544
2545
  if (response.status === 401) {
2545
2546
  throw new DelopayAuthenticationError(message);
2546
2547
  }