webhookadmin 0.1.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/LICENSE +21 -0
- package/README.md +162 -0
- package/dist/index.cjs +586 -0
- package/dist/index.d.cts +430 -0
- package/dist/index.d.ts +430 -0
- package/dist/index.js +569 -0
- package/package.json +63 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
/** One page of a list. */
|
|
2
|
+
interface Page<T> {
|
|
3
|
+
items: T[];
|
|
4
|
+
/** Pass as `cursor` to get the next page. `null` on the last page. */
|
|
5
|
+
next_cursor: string | null;
|
|
6
|
+
}
|
|
7
|
+
type MessageStatus = 'pending' | 'retrying' | 'success' | 'failed';
|
|
8
|
+
/** `held` means the endpoint is paused; sent when it is set back to `active`. */
|
|
9
|
+
type DeliveryStatus = 'pending' | 'held' | 'retrying' | 'success' | 'failed';
|
|
10
|
+
type EndpointStatus = 'active' | 'paused' | 'disabled';
|
|
11
|
+
interface ConsumerRef {
|
|
12
|
+
id: string;
|
|
13
|
+
external_id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
/** A message in a list. */
|
|
17
|
+
interface MessageSummary {
|
|
18
|
+
id: string;
|
|
19
|
+
event_type: string;
|
|
20
|
+
consumer: ConsumerRef;
|
|
21
|
+
/** Unix milliseconds. */
|
|
22
|
+
created_at: number;
|
|
23
|
+
status: MessageStatus;
|
|
24
|
+
attempts: number;
|
|
25
|
+
/** URL of the first endpoint, or `null` when the consumer had no endpoint. */
|
|
26
|
+
endpoint_url: string | null;
|
|
27
|
+
}
|
|
28
|
+
interface Attempt {
|
|
29
|
+
id: string;
|
|
30
|
+
/** Unix milliseconds. */
|
|
31
|
+
at: number;
|
|
32
|
+
response_status: number | null;
|
|
33
|
+
/** First 1024 bytes of the response body. */
|
|
34
|
+
response_head: string | null;
|
|
35
|
+
duration_ms: number;
|
|
36
|
+
error: string | null;
|
|
37
|
+
via: 'direct' | 'relay';
|
|
38
|
+
/** Static IP used when sent through the relay. `null` for direct sends. */
|
|
39
|
+
source_ip: string | null;
|
|
40
|
+
}
|
|
41
|
+
interface Delivery {
|
|
42
|
+
id: string;
|
|
43
|
+
endpoint_id: string;
|
|
44
|
+
url: string;
|
|
45
|
+
status: DeliveryStatus;
|
|
46
|
+
attempt_count: number;
|
|
47
|
+
/** Unix milliseconds, or `null` when no retry is scheduled. */
|
|
48
|
+
next_attempt_at: number | null;
|
|
49
|
+
attempts: Attempt[];
|
|
50
|
+
}
|
|
51
|
+
interface Message {
|
|
52
|
+
id: string;
|
|
53
|
+
event_type: string;
|
|
54
|
+
consumer: ConsumerRef;
|
|
55
|
+
created_at: number;
|
|
56
|
+
status: MessageStatus;
|
|
57
|
+
idempotency_key: string | null;
|
|
58
|
+
/** The payload as sent. `null` if it is no longer stored. */
|
|
59
|
+
payload: unknown;
|
|
60
|
+
deliveries: Delivery[];
|
|
61
|
+
}
|
|
62
|
+
interface SendMessageParams {
|
|
63
|
+
/** Your customer's ID (`external_id`). A consumer is created if it does not exist. */
|
|
64
|
+
consumer: string;
|
|
65
|
+
/** Event type, such as `invoice.paid`. */
|
|
66
|
+
event_type: string;
|
|
67
|
+
/** Any JSON value, up to 1 MB. Delivered as `data`. */
|
|
68
|
+
payload: unknown;
|
|
69
|
+
}
|
|
70
|
+
interface SendMessageResponse {
|
|
71
|
+
id: string;
|
|
72
|
+
/** Number of endpoints the message is delivered to. */
|
|
73
|
+
deliveries: number;
|
|
74
|
+
}
|
|
75
|
+
interface MessageListParams {
|
|
76
|
+
status?: MessageStatus;
|
|
77
|
+
event_type?: string;
|
|
78
|
+
/** Matches the message ID, event type, consumer external_id, or payload text (3+ characters). */
|
|
79
|
+
q?: string;
|
|
80
|
+
/** 1 to 100. Default 50. */
|
|
81
|
+
limit?: number;
|
|
82
|
+
cursor?: string;
|
|
83
|
+
}
|
|
84
|
+
interface Consumer {
|
|
85
|
+
id: string;
|
|
86
|
+
external_id: string;
|
|
87
|
+
name: string;
|
|
88
|
+
created_at: number;
|
|
89
|
+
endpoint_count: number;
|
|
90
|
+
}
|
|
91
|
+
interface ConsumerCreateParams {
|
|
92
|
+
external_id: string;
|
|
93
|
+
name?: string;
|
|
94
|
+
}
|
|
95
|
+
interface ConsumerListParams {
|
|
96
|
+
/** 1 to 100. Default 50. */
|
|
97
|
+
limit?: number;
|
|
98
|
+
cursor?: string;
|
|
99
|
+
}
|
|
100
|
+
interface Endpoint {
|
|
101
|
+
id: string;
|
|
102
|
+
consumer_id: string;
|
|
103
|
+
url: string;
|
|
104
|
+
description: string;
|
|
105
|
+
/** Event types sent to this endpoint. `null` means all. */
|
|
106
|
+
event_types: string[] | null;
|
|
107
|
+
/** Sent through the static-IP relay. */
|
|
108
|
+
fixed_ip: boolean;
|
|
109
|
+
status: EndpointStatus;
|
|
110
|
+
disabled_reason: string | null;
|
|
111
|
+
/** Unix milliseconds since failures started, or `null`. */
|
|
112
|
+
failing_since: number | null;
|
|
113
|
+
created_at: number;
|
|
114
|
+
}
|
|
115
|
+
interface EndpointWithSecret extends Endpoint {
|
|
116
|
+
/** Signing secret (`whsec_…`). Returned only when the endpoint is created. */
|
|
117
|
+
secret: string;
|
|
118
|
+
}
|
|
119
|
+
interface EndpointDetail extends Endpoint {
|
|
120
|
+
/** Latest attempts to this endpoint this month (up to 20). */
|
|
121
|
+
recent: Attempt[];
|
|
122
|
+
/** Deliveries waiting for a retry. */
|
|
123
|
+
retrying_count: number;
|
|
124
|
+
}
|
|
125
|
+
interface EndpointCreateParams {
|
|
126
|
+
consumer_id: string;
|
|
127
|
+
/** https (port 443 or 8443). */
|
|
128
|
+
url: string;
|
|
129
|
+
/** Omit or `null` to receive all event types. */
|
|
130
|
+
event_types?: string[] | null;
|
|
131
|
+
fixed_ip?: boolean;
|
|
132
|
+
description?: string;
|
|
133
|
+
}
|
|
134
|
+
interface EndpointUpdateParams {
|
|
135
|
+
url?: string;
|
|
136
|
+
event_types?: string[] | null;
|
|
137
|
+
/** `active` also re-enables a disabled endpoint and sends messages held while paused. */
|
|
138
|
+
status?: 'active' | 'paused';
|
|
139
|
+
description?: string;
|
|
140
|
+
}
|
|
141
|
+
interface EndpointListParams {
|
|
142
|
+
consumer_id?: string;
|
|
143
|
+
}
|
|
144
|
+
interface EndpointSendTestParams {
|
|
145
|
+
/** Default `webhook.test`. */
|
|
146
|
+
event_type?: string;
|
|
147
|
+
}
|
|
148
|
+
interface RotateSecretResponse {
|
|
149
|
+
/** New signing secret. The previous one keeps signing for 24 hours. */
|
|
150
|
+
secret: string;
|
|
151
|
+
}
|
|
152
|
+
interface SendTestResponse {
|
|
153
|
+
message_id: string;
|
|
154
|
+
}
|
|
155
|
+
interface PortalLinkParams {
|
|
156
|
+
/** Origin of the page that embeds the portal in an iframe, such as `https://app.example.com`. */
|
|
157
|
+
frame_origin?: string;
|
|
158
|
+
locale?: 'ja' | 'en';
|
|
159
|
+
}
|
|
160
|
+
interface PortalLink {
|
|
161
|
+
/** One-time URL of the consumer portal. */
|
|
162
|
+
url: string;
|
|
163
|
+
/** Unix milliseconds. The link is valid for 15 minutes. */
|
|
164
|
+
expires_at: number;
|
|
165
|
+
}
|
|
166
|
+
/** Per-request options. */
|
|
167
|
+
interface RequestOptions {
|
|
168
|
+
/** Milliseconds. Overrides the client's `timeout`. */
|
|
169
|
+
timeout?: number;
|
|
170
|
+
/** Overrides the client's `maxRetries`. */
|
|
171
|
+
maxRetries?: number;
|
|
172
|
+
signal?: AbortSignal;
|
|
173
|
+
}
|
|
174
|
+
interface SendMessageOptions extends RequestOptions {
|
|
175
|
+
/**
|
|
176
|
+
* 1 to 256 characters. The same key returns the same message for 24 hours.
|
|
177
|
+
* Generated when omitted, and reused across retries.
|
|
178
|
+
*/
|
|
179
|
+
idempotencyKey?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
type Fetch = (input: string, init: RequestInit) => Promise<Response>;
|
|
183
|
+
type HttpConfig = {
|
|
184
|
+
apiKey: string;
|
|
185
|
+
baseUrl: string;
|
|
186
|
+
timeout: number;
|
|
187
|
+
maxRetries: number;
|
|
188
|
+
fetch: Fetch;
|
|
189
|
+
};
|
|
190
|
+
type Query = Record<string, string | number | undefined>;
|
|
191
|
+
type HttpRequest = {
|
|
192
|
+
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
193
|
+
path: string;
|
|
194
|
+
query?: Query;
|
|
195
|
+
body?: unknown;
|
|
196
|
+
headers?: Record<string, string>;
|
|
197
|
+
/**
|
|
198
|
+
* Safe to send twice. 5xx and network errors are retried only for these.
|
|
199
|
+
* 429 is always retried: the API rejects it before doing anything.
|
|
200
|
+
*/
|
|
201
|
+
idempotent: boolean;
|
|
202
|
+
};
|
|
203
|
+
declare class Http {
|
|
204
|
+
readonly config: HttpConfig;
|
|
205
|
+
constructor(config: HttpConfig);
|
|
206
|
+
url(path: string, query?: Query): string;
|
|
207
|
+
request<T>(req: HttpRequest, options?: RequestOptions): Promise<T>;
|
|
208
|
+
private once;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Result of a `list()` call.
|
|
213
|
+
* `await` it for the first page, or iterate with `for await` to walk every item across pages.
|
|
214
|
+
*/
|
|
215
|
+
declare class PagePromise<T> implements PromiseLike<Page<T>>, AsyncIterable<T> {
|
|
216
|
+
private readonly fetchPage;
|
|
217
|
+
private readonly cursor;
|
|
218
|
+
private first;
|
|
219
|
+
/** @internal */
|
|
220
|
+
constructor(fetchPage: (cursor: string | undefined) => Promise<Page<T>>, cursor: string | undefined);
|
|
221
|
+
private firstPage;
|
|
222
|
+
then<A = Page<T>, B = never>(onfulfilled?: ((value: Page<T>) => A | PromiseLike<A>) | null, onrejected?: ((reason: any) => B | PromiseLike<B>) | null): Promise<A | B>;
|
|
223
|
+
catch<B = never>(onrejected?: ((reason: any) => B | PromiseLike<B>) | null): Promise<Page<T> | B>;
|
|
224
|
+
finally(onfinally?: (() => void) | null): Promise<Page<T>>;
|
|
225
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
declare class Consumers {
|
|
229
|
+
private readonly http;
|
|
230
|
+
/** @internal */
|
|
231
|
+
constructor(http: Http);
|
|
232
|
+
/** Creates a consumer. A duplicate `external_id` throws `ConflictError`. Requires `consumers:write`. */
|
|
233
|
+
create(params: ConsumerCreateParams, options?: RequestOptions): Promise<Consumer>;
|
|
234
|
+
/** Lists consumers. Requires `logs:read`. */
|
|
235
|
+
list(params?: ConsumerListParams, options?: RequestOptions): PagePromise<Consumer>;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
declare class Deliveries {
|
|
239
|
+
private readonly http;
|
|
240
|
+
/** @internal */
|
|
241
|
+
constructor(http: Http);
|
|
242
|
+
/**
|
|
243
|
+
* Sends a finished delivery again. A delivery still being sent throws `ConflictError`.
|
|
244
|
+
* Requires `messages:retry`.
|
|
245
|
+
*/
|
|
246
|
+
retry(deliveryId: string, options?: RequestOptions): Promise<void>;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
declare class Endpoints {
|
|
250
|
+
private readonly http;
|
|
251
|
+
/** @internal */
|
|
252
|
+
constructor(http: Http);
|
|
253
|
+
/** Creates an endpoint. The signing secret is returned only here. Requires `endpoints:write`. */
|
|
254
|
+
create(params: EndpointCreateParams, options?: RequestOptions): Promise<EndpointWithSecret>;
|
|
255
|
+
/** Lists endpoints, optionally for one consumer. All endpoints come in one page. Requires `logs:read`. */
|
|
256
|
+
list(params?: EndpointListParams, options?: RequestOptions): PagePromise<Endpoint>;
|
|
257
|
+
/** Gets an endpoint with its latest attempts. Requires `logs:read`. */
|
|
258
|
+
get(endpointId: string, options?: RequestOptions): Promise<EndpointDetail>;
|
|
259
|
+
/** Updates an endpoint. Set `status: 'active'` to resume a paused or disabled endpoint. Requires `endpoints:write`. */
|
|
260
|
+
update(endpointId: string, params: EndpointUpdateParams, options?: RequestOptions): Promise<Endpoint>;
|
|
261
|
+
/** Deletes an endpoint. Requires `endpoints:write`. */
|
|
262
|
+
delete(endpointId: string, options?: RequestOptions): Promise<void>;
|
|
263
|
+
/** Issues a new signing secret. The previous one keeps signing for 24 hours. Requires `endpoints:write`. */
|
|
264
|
+
rotateSecret(endpointId: string, options?: RequestOptions): Promise<RotateSecretResponse>;
|
|
265
|
+
/** Sends a test message to this endpoint only. Not counted in usage. Requires `messages:send`. */
|
|
266
|
+
sendTest(endpointId: string, params?: EndpointSendTestParams, options?: RequestOptions): Promise<SendTestResponse>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare class Messages {
|
|
270
|
+
private readonly http;
|
|
271
|
+
/** @internal */
|
|
272
|
+
constructor(http: Http);
|
|
273
|
+
/**
|
|
274
|
+
* Sends a message to every active endpoint of the consumer that accepts the event type.
|
|
275
|
+
* Requires the `messages:send` scope.
|
|
276
|
+
*/
|
|
277
|
+
send(params: SendMessageParams, options?: SendMessageOptions): Promise<SendMessageResponse>;
|
|
278
|
+
/** Lists messages, newest first. Requires `logs:read`. */
|
|
279
|
+
list(params?: MessageListParams, options?: RequestOptions): PagePromise<MessageSummary>;
|
|
280
|
+
/** Gets a message with its deliveries and attempts. Requires `logs:read`. */
|
|
281
|
+
get(messageId: string, options?: RequestOptions): Promise<Message>;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
declare class Portal {
|
|
285
|
+
private readonly http;
|
|
286
|
+
/** @internal */
|
|
287
|
+
constructor(http: Http);
|
|
288
|
+
/**
|
|
289
|
+
* Creates a 15-minute link to the consumer portal, where your customer manages their own endpoints.
|
|
290
|
+
* Starter plan or above. Requires `endpoints:write`.
|
|
291
|
+
*/
|
|
292
|
+
createLink(consumerId: string, params?: PortalLinkParams, options?: RequestOptions): Promise<PortalLink>;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
interface ClientOptions {
|
|
296
|
+
/** Default `https://api.webhookadmin.com`. */
|
|
297
|
+
baseUrl?: string;
|
|
298
|
+
/** Milliseconds per attempt. Default 30000. */
|
|
299
|
+
timeout?: number;
|
|
300
|
+
/** Retries after the first attempt. Default 2. `0` disables retries. */
|
|
301
|
+
maxRetries?: number;
|
|
302
|
+
/** Custom `fetch`. Default `globalThis.fetch`. */
|
|
303
|
+
fetch?: Fetch;
|
|
304
|
+
}
|
|
305
|
+
/** Client for the Webhook Admin API (`/v1`). */
|
|
306
|
+
declare class WebhookAdmin {
|
|
307
|
+
readonly messages: Messages;
|
|
308
|
+
readonly consumers: Consumers;
|
|
309
|
+
readonly endpoints: Endpoints;
|
|
310
|
+
readonly deliveries: Deliveries;
|
|
311
|
+
readonly portal: Portal;
|
|
312
|
+
readonly baseUrl: string;
|
|
313
|
+
/**
|
|
314
|
+
* @param apiKey `sk_live_…` or `sk_test_…`. Defaults to the `WEBHOOK_ADMIN_API_KEY` environment variable.
|
|
315
|
+
*/
|
|
316
|
+
constructor(apiKey?: string, options?: ClientOptions);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
type ErrorOptions = {
|
|
320
|
+
status?: number;
|
|
321
|
+
code?: string;
|
|
322
|
+
fields?: Record<string, string>;
|
|
323
|
+
requestId?: string;
|
|
324
|
+
cause?: unknown;
|
|
325
|
+
};
|
|
326
|
+
/** Base class for every error thrown by the SDK. */
|
|
327
|
+
declare class WebhookAdminError extends Error {
|
|
328
|
+
name: string;
|
|
329
|
+
/** HTTP status. Undefined when no response was received. */
|
|
330
|
+
readonly status: number | undefined;
|
|
331
|
+
/** API error code, such as `invalid` or `not_found`. */
|
|
332
|
+
readonly code: string | undefined;
|
|
333
|
+
/** Per-field messages for validation errors. */
|
|
334
|
+
readonly fields: Record<string, string> | undefined;
|
|
335
|
+
/** Request ID (`x-request-id`, or Cloudflare's `cf-ray`) to quote when contacting support. */
|
|
336
|
+
readonly requestId: string | undefined;
|
|
337
|
+
constructor(message: string, options?: ErrorOptions);
|
|
338
|
+
}
|
|
339
|
+
/** 401: the API key is missing, wrong, revoked or expired. */
|
|
340
|
+
declare class AuthenticationError extends WebhookAdminError {
|
|
341
|
+
name: string;
|
|
342
|
+
}
|
|
343
|
+
/** 403: the API key does not have the scope for this operation. */
|
|
344
|
+
declare class PermissionError extends WebhookAdminError {
|
|
345
|
+
name: string;
|
|
346
|
+
}
|
|
347
|
+
/** 404: the resource does not exist in the key's environment. */
|
|
348
|
+
declare class NotFoundError extends WebhookAdminError {
|
|
349
|
+
name: string;
|
|
350
|
+
}
|
|
351
|
+
/** 400, 413 or 422: the request body or parameters are invalid. See `fields`. */
|
|
352
|
+
declare class ValidationError extends WebhookAdminError {
|
|
353
|
+
name: string;
|
|
354
|
+
}
|
|
355
|
+
/** 402: the plan's limit was reached (monthly messages, or a feature not in the plan). */
|
|
356
|
+
declare class PlanLimitError extends WebhookAdminError {
|
|
357
|
+
name: string;
|
|
358
|
+
}
|
|
359
|
+
/** 409: conflicts with the current state (duplicate external_id, delivery still in progress). */
|
|
360
|
+
declare class ConflictError extends WebhookAdminError {
|
|
361
|
+
name: string;
|
|
362
|
+
}
|
|
363
|
+
/** 429: too many requests. Thrown after retries are used up. */
|
|
364
|
+
declare class RateLimitError extends WebhookAdminError {
|
|
365
|
+
name: string;
|
|
366
|
+
/** Seconds to wait before retrying, from `retry-after`. */
|
|
367
|
+
readonly retryAfter: number | undefined;
|
|
368
|
+
constructor(message: string, options?: ErrorOptions & {
|
|
369
|
+
retryAfter?: number;
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
/** Any other error response, including 5xx. */
|
|
373
|
+
declare class ApiError extends WebhookAdminError {
|
|
374
|
+
name: string;
|
|
375
|
+
}
|
|
376
|
+
/** The request could not reach the API (DNS, TCP, TLS) or was aborted. */
|
|
377
|
+
declare class ConnectionError extends WebhookAdminError {
|
|
378
|
+
name: string;
|
|
379
|
+
}
|
|
380
|
+
/** The request did not complete within `timeout`. */
|
|
381
|
+
declare class TimeoutError extends ConnectionError {
|
|
382
|
+
name: string;
|
|
383
|
+
}
|
|
384
|
+
/** Signature verification of an incoming webhook failed. */
|
|
385
|
+
declare class WebhookVerificationError extends WebhookAdminError {
|
|
386
|
+
name: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/** SDK version. Kept equal to package.json by a test. */
|
|
390
|
+
declare const VERSION = "0.1.0";
|
|
391
|
+
|
|
392
|
+
/** Headers as a `Headers` object or a plain object (Node's `req.headers`). Names are case-insensitive. */
|
|
393
|
+
type WebhookHeaders = {
|
|
394
|
+
get(name: string): string | null;
|
|
395
|
+
} | Record<string, string | string[] | undefined>;
|
|
396
|
+
/** Raw request body. `Buffer` is a `Uint8Array`. */
|
|
397
|
+
type WebhookPayload = string | Uint8Array | ArrayBuffer;
|
|
398
|
+
/** Body of a webhook sent by Webhook Admin. */
|
|
399
|
+
interface WebhookEvent<T = unknown> {
|
|
400
|
+
type: string;
|
|
401
|
+
/** ISO 8601. */
|
|
402
|
+
timestamp: string;
|
|
403
|
+
data: T;
|
|
404
|
+
}
|
|
405
|
+
interface WebhookOptions {
|
|
406
|
+
/** Allowed clock difference in seconds, both ways. Default 300. */
|
|
407
|
+
tolerance?: number;
|
|
408
|
+
}
|
|
409
|
+
/** Verifies webhooks sent by Webhook Admin (Standard Webhooks). */
|
|
410
|
+
declare class Webhook {
|
|
411
|
+
private readonly key;
|
|
412
|
+
private readonly tolerance;
|
|
413
|
+
private cryptoKey;
|
|
414
|
+
/** @param secret The endpoint's signing secret (`whsec_…`). */
|
|
415
|
+
constructor(secret: string, options?: WebhookOptions);
|
|
416
|
+
private importKey;
|
|
417
|
+
/**
|
|
418
|
+
* Verifies the signature and timestamp, then returns the parsed body.
|
|
419
|
+
* Throws `WebhookVerificationError` when verification fails.
|
|
420
|
+
* @param payload The raw request body, exactly as received.
|
|
421
|
+
*/
|
|
422
|
+
verify<T = WebhookEvent>(payload: WebhookPayload, headers: WebhookHeaders): Promise<T>;
|
|
423
|
+
/**
|
|
424
|
+
* Computes the `webhook-signature` value (`v1,<base64>`). Useful for tests.
|
|
425
|
+
* @param timestamp A `Date` or Unix seconds.
|
|
426
|
+
*/
|
|
427
|
+
sign(msgId: string, timestamp: Date | number, payload: WebhookPayload): Promise<string>;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export { ApiError, type Attempt, AuthenticationError, type ClientOptions, ConflictError, ConnectionError, type Consumer, type ConsumerCreateParams, type ConsumerListParams, type ConsumerRef, Consumers, Deliveries, type Delivery, type DeliveryStatus, type Endpoint, type EndpointCreateParams, type EndpointDetail, type EndpointListParams, type EndpointSendTestParams, type EndpointStatus, type EndpointUpdateParams, type EndpointWithSecret, Endpoints, type Fetch, type Message, type MessageListParams, type MessageStatus, type MessageSummary, Messages, NotFoundError, type Page, PagePromise, PermissionError, PlanLimitError, Portal, type PortalLink, type PortalLinkParams, RateLimitError, type RequestOptions, type RotateSecretResponse, type SendMessageOptions, type SendMessageParams, type SendMessageResponse, type SendTestResponse, TimeoutError, VERSION, ValidationError, Webhook, WebhookAdmin, WebhookAdminError, type WebhookEvent, type WebhookHeaders, type WebhookOptions, type WebhookPayload, WebhookVerificationError };
|