@secondlayer/sdk 15.1.0 → 15.2.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.d.ts CHANGED
@@ -3707,16 +3707,26 @@ declare class Webhooks extends BaseClient {
3707
3707
  * Built for the webhook's format and SSRF-guarded. Logged as a delivery
3708
3708
  * row, visible via `deliveries`. */
3709
3709
  test(id: string): Promise<WebhookTestResult>;
3710
- /** The last 100 delivery attempts, newest first. The server caps the window;
3711
- * there is nothing to page. */
3712
- deliveries(id: string): Promise<{
3710
+ /** The last 100 delivery attempts, newest first. The server caps the
3711
+ * result; there is nothing to page. Pass `window` (ISO timestamps, at most
3712
+ * 31 days wide) to read only the attempts dispatched in `[from, to)`, for
3713
+ * example one hour of the heat strip; `total` then counts that window. */
3714
+ deliveries(id: string, window?: {
3715
+ from: string;
3716
+ to: string;
3717
+ }): Promise<{
3718
+ total: number;
3713
3719
  data: DeliveryRow[];
3714
3720
  }>;
3715
3721
  /** Get a webhook's hourly delivery counts for the last 7 days.
3716
3722
  *
3717
3723
  * Each hour has delivered, waiting, and gave-up counts, plus the current
3718
- * queue depth. This is the events chart on the detail page. */
3719
- activity(id: string): Promise<WebhookActivity>;
3724
+ * queue depth, failed attempts per hour, and the usual band. Pass
3725
+ * `{ days: 30 }` to also get 30 daily totals. This is the events chart on
3726
+ * the detail page. */
3727
+ activity(id: string, opts?: {
3728
+ days?: 30;
3729
+ }): Promise<WebhookActivity>;
3720
3730
  /** Get one delivery attempt with its payload and response.
3721
3731
  *
3722
3732
  * Includes the outbox context (payload, response headers). This is the
package/dist/index.js CHANGED
@@ -2675,11 +2675,11 @@ class Webhooks extends BaseClient {
2675
2675
  async test(id) {
2676
2676
  return this.request("POST", `/api/webhooks/${seg(id)}/test`);
2677
2677
  }
2678
- async deliveries(id) {
2679
- return this.request("GET", `/api/webhooks/${seg(id)}/deliveries`);
2678
+ async deliveries(id, window) {
2679
+ return this.request("GET", `/api/webhooks/${seg(id)}/deliveries${buildQuery({ from: window?.from, to: window?.to })}`);
2680
2680
  }
2681
- async activity(id) {
2682
- return this.request("GET", `/api/webhooks/${seg(id)}/activity`);
2681
+ async activity(id, opts) {
2682
+ return this.request("GET", `/api/webhooks/${seg(id)}/activity${buildQuery({ days: opts?.days })}`);
2683
2683
  }
2684
2684
  async delivery(id, deliveryId) {
2685
2685
  return this.request("GET", `/api/webhooks/${seg(id)}/deliveries/${seg(deliveryId)}`);
@@ -3457,5 +3457,5 @@ export {
3457
3457
  verifyWebhookSignature
3458
3458
  };
3459
3459
 
3460
- //# debugId=1299ECB68A5C2FAD64756E2164756E21
3460
+ //# debugId=F33AE6538EA909C364756E2164756E21
3461
3461
  //# sourceMappingURL=index.js.map