import type { components, paths } from '../generated/openapi.js'; import type { RequestOptions } from '../types.js'; import { BaseResource } from './base.js'; export type Webhook = components['schemas']['WebhookV1']; export type WebhookList = components['schemas']['WebhookList']; export type WebhookRotateSecret = components['schemas']['WebhookRotateSecret']; export type WebhookDelivery = components['schemas']['WebhookDeliveryV1']; export type WebhookDeliveryReplay = components['schemas']['WebhookDeliveryReplay']; export type WebhookEventItem = components['schemas']['WebhookEventItem']; export type CreateWebhookBody = NonNullable['content']['application/json']; export type UpdateWebhookBody = NonNullable['content']['application/json']; export type ListDeliveriesQuery = NonNullable; export type ListEventsQuery = paths['/v1/webhooks/events']['get']['parameters']['query']; export declare class WebhooksResource extends BaseResource { /** `GET /v1/webhooks` — list all webhook subscriptions for the calling account. */ list(opts?: RequestOptions): Promise; /** * `POST /v1/webhooks` — create a subscription. Plaintext `secret` is * returned ONCE in the create response; persist it then. Subsequent * GETs do not include it. */ create(body: CreateWebhookBody, opts?: RequestOptions): Promise; /** `GET /v1/webhooks/{id}` — fetch a single webhook subscription. */ get(id: string, opts?: RequestOptions): Promise; /** `PATCH /v1/webhooks/{id}` — partial update of url / events / line_ids / active flag. */ update(id: string, body: UpdateWebhookBody, opts?: RequestOptions): Promise; /** `DELETE /v1/webhooks/{id}` — delete a subscription. Returns 204. */ delete(id: string, opts?: RequestOptions): Promise; /** * `POST /v1/webhooks/{id}/rotate-secret` — mint a new `whs_*` secret. * Old secret stays valid for 5 minutes (`old_secret_expires_at`) so the * caller can roll their verification code without dropping events. * Plaintext secret is returned ONCE. */ rotateSecret(id: string, opts?: RequestOptions): Promise; /** * `GET /v1/webhooks/{id}/deliveries` — cursor-paginated AsyncIterable * over delivery attempts for a subscription. Filters: status (pending/ * success/failed), event type, since/until timestamps. */ deliveries(id: string, filters?: Omit, opts?: RequestOptions): AsyncIterable; /** * `POST /v1/webhooks/{id}/deliveries/{delivery_id}/replay` — re-fire a * past delivery. Server preserves the original `event_id` so consumers * still dedupe. */ replay(webhookId: string, deliveryId: string, opts?: RequestOptions): Promise; /** * `GET /v1/webhooks/events` — cursor-paginated reconciliation pull. * Returns events that would have been delivered to the caller's * subscriptions within the 72h retention window. Used to recover from * webhook outages without missing signal. * * `since` is required by the contract. */ events(filters: Omit, 'cursor'>, opts?: RequestOptions): AsyncIterable; } //# sourceMappingURL=webhooks.d.ts.map