@delopay/sdk 0.16.0 → 0.18.0

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
@@ -47,6 +47,7 @@ var DelopayError = class extends Error {
47
47
  this.type = options.type;
48
48
  if (options.requestId !== void 0) this.requestId = options.requestId;
49
49
  if (options.rawBody !== void 0) this.rawBody = options.rawBody;
50
+ if (options.data !== void 0) this.data = options.data;
50
51
  }
51
52
  };
52
53
  var DelopayAuthenticationError = class extends DelopayError {
@@ -59,7 +60,8 @@ var DelopayAuthenticationError = class extends DelopayError {
59
60
  code: options?.code || "AUTH_01",
60
61
  type: options?.type || "authentication_error",
61
62
  requestId: options?.requestId,
62
- rawBody: options?.rawBody
63
+ rawBody: options?.rawBody,
64
+ data: options?.data
63
65
  });
64
66
  Object.setPrototypeOf(this, new.target.prototype);
65
67
  this.name = "DelopayAuthenticationError";
@@ -2412,6 +2414,15 @@ var FeatureMatrix = class {
2412
2414
  async retrieve() {
2413
2415
  return this.request("GET", "/feature_matrix");
2414
2416
  }
2417
+ /**
2418
+ * Retrieve the feature matrix scoped to a merchant. Beta connectors
2419
+ * are filtered against the merchant's allowlist so the dashboard only
2420
+ * surfaces connectors the merchant can actually attach.
2421
+ * `GET /feature_matrix/{merchantId}`
2422
+ */
2423
+ async retrieveForMerchant(merchantId) {
2424
+ return this.request("GET", `/feature_matrix/${encodeURIComponent(merchantId)}`);
2425
+ }
2415
2426
  };
2416
2427
 
2417
2428
  // src/resources/files.ts
@@ -2797,13 +2808,15 @@ var Delopay = class {
2797
2808
  const message = err.message ?? `Request failed with status ${response.status}`;
2798
2809
  const code = err.code ?? "";
2799
2810
  const type = err.error_type ?? err.type ?? "";
2811
+ const data = err.data && typeof err.data === "object" && !Array.isArray(err.data) ? err.data : void 0;
2800
2812
  const truncatedRaw = truncateRawBody(rawBody);
2801
2813
  if (response.status === 401) {
2802
2814
  throw new DelopayAuthenticationError(message, {
2803
2815
  code,
2804
2816
  type,
2805
2817
  requestId,
2806
- rawBody: truncatedRaw
2818
+ rawBody: truncatedRaw,
2819
+ data
2807
2820
  });
2808
2821
  }
2809
2822
  const error = new DelopayError(message, {
@@ -2811,7 +2824,8 @@ var Delopay = class {
2811
2824
  code,
2812
2825
  type,
2813
2826
  requestId,
2814
- rawBody: truncatedRaw
2827
+ rawBody: truncatedRaw,
2828
+ data
2815
2829
  });
2816
2830
  const isTransientStatus = response.status >= 500 || response.status === 429;
2817
2831
  if (isTransientStatus && isRetryable && attempt < this.maxRetries) {