@delopay/sdk 0.1.4 → 0.1.6

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
@@ -187,12 +187,12 @@ var AuditLogs = class {
187
187
  this.request = request;
188
188
  }
189
189
  async list(params) {
190
- return this.request("GET", "/audit", {
190
+ return this.request("GET", "/admin-portal/audit", {
191
191
  query: params
192
192
  });
193
193
  }
194
194
  async retrieve(logId) {
195
- return this.request("GET", `/audit/${logId}`);
195
+ return this.request("GET", `/admin-portal/audit/${logId}`);
196
196
  }
197
197
  };
198
198
 
@@ -2439,14 +2439,11 @@ var Delopay = class {
2439
2439
  * Create a new Delopay client.
2440
2440
  *
2441
2441
  * @param apiKey - Your Delopay API key (e.g. `sk_live_...` or `sk_test_...`).
2442
+ * Pass an empty string or omit for JWT-only usage (e.g. dashboard apps).
2442
2443
  * @param options - Optional configuration (sandbox mode, base URL override, timeout).
2443
- * @throws {Error} When `apiKey` is empty or not provided.
2444
2444
  */
2445
2445
  constructor(apiKey, options) {
2446
- if (!apiKey) {
2447
- throw new Error("API key is required");
2448
- }
2449
- this.apiKey = apiKey;
2446
+ this.apiKey = apiKey ?? "";
2450
2447
  this.timeout = options?.timeout ?? 3e4;
2451
2448
  this.maxRetries = options?.maxRetries ?? 2;
2452
2449
  this.debug = options?.debug ?? false;
@@ -2545,7 +2542,7 @@ var Delopay = class {
2545
2542
  }
2546
2543
  }
2547
2544
  const headers = {
2548
- ...this.jwtToken ? { Authorization: `Bearer ${this.jwtToken}` } : { "api-key": this.apiKey },
2545
+ ...this.jwtToken ? { Authorization: `Bearer ${this.jwtToken}` } : this.apiKey ? { "api-key": this.apiKey } : {},
2549
2546
  ...options?.headers
2550
2547
  };
2551
2548
  if (options?.body) {