@webhooks-cc/sdk 1.0.1 → 1.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.
@@ -2,6 +2,13 @@
2
2
  * A webhook endpoint that captures incoming HTTP requests.
3
3
  * Create endpoints via the dashboard or SDK to receive webhooks.
4
4
  */
5
+ /** Team sharing metadata for an endpoint. */
6
+ interface TeamShare {
7
+ /** Team identifier */
8
+ teamId: string;
9
+ /** Team display name */
10
+ teamName: string;
11
+ }
5
12
  interface Endpoint {
6
13
  /** Unique identifier for this endpoint */
7
14
  id: string;
@@ -17,6 +24,10 @@ interface Endpoint {
17
24
  expiresAt?: number;
18
25
  /** Unix timestamp (ms) when the endpoint was created */
19
26
  createdAt: number;
27
+ /** Teams this endpoint is shared with (present when you own it) */
28
+ sharedWith?: TeamShare[];
29
+ /** Team this endpoint was shared from (present when shared with you) */
30
+ fromTeam?: TeamShare;
20
31
  }
21
32
  /** Mock response returned by the receiver instead of the default 200 OK. */
22
33
  interface MockResponse {
@@ -131,7 +142,7 @@ interface SendOptions {
131
142
  /** Request body (will be JSON-serialized if not a string) */
132
143
  body?: unknown;
133
144
  }
134
- type TemplateProvider = "stripe" | "github" | "shopify" | "twilio" | "slack" | "paddle" | "linear" | "standard-webhooks";
145
+ type TemplateProvider = "stripe" | "github" | "shopify" | "twilio" | "slack" | "paddle" | "linear" | "sendgrid" | "clerk" | "discord" | "vercel" | "gitlab" | "standard-webhooks";
135
146
  /** Static metadata describing a supported template provider. */
136
147
  interface TemplateProviderInfo {
137
148
  /** Provider identifier used by sendTemplate()/sendTo() */
@@ -342,7 +353,7 @@ interface SignatureVerificationResult {
342
353
  valid: boolean;
343
354
  }
344
355
  /** Providers supported by verifySignature(). */
345
- type VerifyProvider = TemplateProvider | "discord";
356
+ type VerifyProvider = TemplateProvider;
346
357
  /**
347
358
  * Options for verifying a captured webhook signature.
348
359
  * For Twilio, `url` is required because the signature covers the full webhook URL.
@@ -700,4 +711,4 @@ type ComparableRequest = Pick<Request, "method" | "path" | "headers" | "body"> &
700
711
  */
701
712
  declare function diffRequests(left: ComparableRequest | SearchResult, right: ComparableRequest | SearchResult, options?: DiffRequestsOptions): DiffResult;
702
713
 
703
- export { type WebhookFlowVerifyOptions as $, ApiError as A, type BodyDiff as B, type ClearRequestsOptions as C, type DiffRequestsOptions as D, type Endpoint as E, type FormBodyValue as F, TimeoutError as G, type HarExport as H, type UpdateEndpointOptions as I, type JsonBodyDiff as J, type UsageInfo as K, type ListPaginatedRequestsOptions as L, type MockResponse as M, NotFoundError as N, type OperationDescription as O, type ParsedBody as P, type ValueDifference as Q, type Request as R, type SearchResult as S, type TemplateProvider as T, UnauthorizedError as U, type VerifySignatureOptions as V, type VerifyProvider as W, type WaitForAllOptions as X, type WaitForOptions as Y, WebhookFlowBuilder as Z, type WebhookFlowResult as _, type ParsedFormBody as a, WebhooksCC as a0, WebhooksCCError as a1, diffRequests as a2, type SignatureVerificationResult as b, type ClientHooks as c, type ClientOptions as d, type CreateEndpointOptions as e, type CurlExport as f, type DiffResult as g, type ErrorHookInfo as h, type ExportRequestsOptions as i, type HeaderDiff as j, type ListRequestsOptions as k, type PaginatedResult as l, RateLimitError as m, type RequestDifferences as n, type RequestHookInfo as o, type RequestsExport as p, type ResponseHookInfo as q, type RetryOptions as r, type SDKDescription as s, type SearchFilters as t, type SendOptions as u, type SendTemplateOptions as v, type SendToOptions as w, type SubscribeOptions as x, type TemplateProviderInfo as y, type TextBodyDiff as z };
714
+ export { type WebhookFlowResult as $, ApiError as A, type BodyDiff as B, type ClearRequestsOptions as C, type DiffRequestsOptions as D, type Endpoint as E, type FormBodyValue as F, type TextBodyDiff as G, type HarExport as H, TimeoutError as I, type JsonBodyDiff as J, type UpdateEndpointOptions as K, type ListPaginatedRequestsOptions as L, type MockResponse as M, NotFoundError as N, type OperationDescription as O, type ParsedBody as P, type UsageInfo as Q, type Request as R, type SearchResult as S, type TeamShare as T, UnauthorizedError as U, type VerifySignatureOptions as V, type ValueDifference as W, type VerifyProvider as X, type WaitForAllOptions as Y, type WaitForOptions as Z, WebhookFlowBuilder as _, type ParsedFormBody as a, type WebhookFlowVerifyOptions as a0, WebhooksCC as a1, WebhooksCCError as a2, diffRequests as a3, type SignatureVerificationResult as b, type ClientHooks as c, type ClientOptions as d, type CreateEndpointOptions as e, type CurlExport as f, type DiffResult as g, type ErrorHookInfo as h, type ExportRequestsOptions as i, type HeaderDiff as j, type ListRequestsOptions as k, type PaginatedResult as l, RateLimitError as m, type RequestDifferences as n, type RequestHookInfo as o, type RequestsExport as p, type ResponseHookInfo as q, type RetryOptions as r, type SDKDescription as s, type SearchFilters as t, type SendOptions as u, type SendTemplateOptions as v, type SendToOptions as w, type SubscribeOptions as x, type TemplateProvider as y, type TemplateProviderInfo as z };
@@ -2,6 +2,13 @@
2
2
  * A webhook endpoint that captures incoming HTTP requests.
3
3
  * Create endpoints via the dashboard or SDK to receive webhooks.
4
4
  */
5
+ /** Team sharing metadata for an endpoint. */
6
+ interface TeamShare {
7
+ /** Team identifier */
8
+ teamId: string;
9
+ /** Team display name */
10
+ teamName: string;
11
+ }
5
12
  interface Endpoint {
6
13
  /** Unique identifier for this endpoint */
7
14
  id: string;
@@ -17,6 +24,10 @@ interface Endpoint {
17
24
  expiresAt?: number;
18
25
  /** Unix timestamp (ms) when the endpoint was created */
19
26
  createdAt: number;
27
+ /** Teams this endpoint is shared with (present when you own it) */
28
+ sharedWith?: TeamShare[];
29
+ /** Team this endpoint was shared from (present when shared with you) */
30
+ fromTeam?: TeamShare;
20
31
  }
21
32
  /** Mock response returned by the receiver instead of the default 200 OK. */
22
33
  interface MockResponse {
@@ -131,7 +142,7 @@ interface SendOptions {
131
142
  /** Request body (will be JSON-serialized if not a string) */
132
143
  body?: unknown;
133
144
  }
134
- type TemplateProvider = "stripe" | "github" | "shopify" | "twilio" | "slack" | "paddle" | "linear" | "standard-webhooks";
145
+ type TemplateProvider = "stripe" | "github" | "shopify" | "twilio" | "slack" | "paddle" | "linear" | "sendgrid" | "clerk" | "discord" | "vercel" | "gitlab" | "standard-webhooks";
135
146
  /** Static metadata describing a supported template provider. */
136
147
  interface TemplateProviderInfo {
137
148
  /** Provider identifier used by sendTemplate()/sendTo() */
@@ -342,7 +353,7 @@ interface SignatureVerificationResult {
342
353
  valid: boolean;
343
354
  }
344
355
  /** Providers supported by verifySignature(). */
345
- type VerifyProvider = TemplateProvider | "discord";
356
+ type VerifyProvider = TemplateProvider;
346
357
  /**
347
358
  * Options for verifying a captured webhook signature.
348
359
  * For Twilio, `url` is required because the signature covers the full webhook URL.
@@ -700,4 +711,4 @@ type ComparableRequest = Pick<Request, "method" | "path" | "headers" | "body"> &
700
711
  */
701
712
  declare function diffRequests(left: ComparableRequest | SearchResult, right: ComparableRequest | SearchResult, options?: DiffRequestsOptions): DiffResult;
702
713
 
703
- export { type WebhookFlowVerifyOptions as $, ApiError as A, type BodyDiff as B, type ClearRequestsOptions as C, type DiffRequestsOptions as D, type Endpoint as E, type FormBodyValue as F, TimeoutError as G, type HarExport as H, type UpdateEndpointOptions as I, type JsonBodyDiff as J, type UsageInfo as K, type ListPaginatedRequestsOptions as L, type MockResponse as M, NotFoundError as N, type OperationDescription as O, type ParsedBody as P, type ValueDifference as Q, type Request as R, type SearchResult as S, type TemplateProvider as T, UnauthorizedError as U, type VerifySignatureOptions as V, type VerifyProvider as W, type WaitForAllOptions as X, type WaitForOptions as Y, WebhookFlowBuilder as Z, type WebhookFlowResult as _, type ParsedFormBody as a, WebhooksCC as a0, WebhooksCCError as a1, diffRequests as a2, type SignatureVerificationResult as b, type ClientHooks as c, type ClientOptions as d, type CreateEndpointOptions as e, type CurlExport as f, type DiffResult as g, type ErrorHookInfo as h, type ExportRequestsOptions as i, type HeaderDiff as j, type ListRequestsOptions as k, type PaginatedResult as l, RateLimitError as m, type RequestDifferences as n, type RequestHookInfo as o, type RequestsExport as p, type ResponseHookInfo as q, type RetryOptions as r, type SDKDescription as s, type SearchFilters as t, type SendOptions as u, type SendTemplateOptions as v, type SendToOptions as w, type SubscribeOptions as x, type TemplateProviderInfo as y, type TextBodyDiff as z };
714
+ export { type WebhookFlowResult as $, ApiError as A, type BodyDiff as B, type ClearRequestsOptions as C, type DiffRequestsOptions as D, type Endpoint as E, type FormBodyValue as F, type TextBodyDiff as G, type HarExport as H, TimeoutError as I, type JsonBodyDiff as J, type UpdateEndpointOptions as K, type ListPaginatedRequestsOptions as L, type MockResponse as M, NotFoundError as N, type OperationDescription as O, type ParsedBody as P, type UsageInfo as Q, type Request as R, type SearchResult as S, type TeamShare as T, UnauthorizedError as U, type VerifySignatureOptions as V, type ValueDifference as W, type VerifyProvider as X, type WaitForAllOptions as Y, type WaitForOptions as Z, WebhookFlowBuilder as _, type ParsedFormBody as a, type WebhookFlowVerifyOptions as a0, WebhooksCC as a1, WebhooksCCError as a2, diffRequests as a3, type SignatureVerificationResult as b, type ClientHooks as c, type ClientOptions as d, type CreateEndpointOptions as e, type CurlExport as f, type DiffResult as g, type ErrorHookInfo as h, type ExportRequestsOptions as i, type HeaderDiff as j, type ListRequestsOptions as k, type PaginatedResult as l, RateLimitError as m, type RequestDifferences as n, type RequestHookInfo as o, type RequestsExport as p, type ResponseHookInfo as q, type RetryOptions as r, type SDKDescription as s, type SearchFilters as t, type SendOptions as u, type SendTemplateOptions as v, type SendToOptions as w, type SubscribeOptions as x, type TemplateProvider as y, type TemplateProviderInfo as z };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as Request, P as ParsedBody, a as ParsedFormBody, S as SearchResult, V as VerifySignatureOptions, b as SignatureVerificationResult } from './diff-BlDnipA4.mjs';
2
- export { A as ApiError, B as BodyDiff, C as ClearRequestsOptions, c as ClientHooks, d as ClientOptions, e as CreateEndpointOptions, f as CurlExport, D as DiffRequestsOptions, g as DiffResult, E as Endpoint, h as ErrorHookInfo, i as ExportRequestsOptions, F as FormBodyValue, H as HarExport, j as HeaderDiff, J as JsonBodyDiff, L as ListPaginatedRequestsOptions, k as ListRequestsOptions, M as MockResponse, N as NotFoundError, O as OperationDescription, l as PaginatedResult, m as RateLimitError, n as RequestDifferences, o as RequestHookInfo, p as RequestsExport, q as ResponseHookInfo, r as RetryOptions, s as SDKDescription, t as SearchFilters, u as SendOptions, v as SendTemplateOptions, w as SendToOptions, x as SubscribeOptions, T as TemplateProvider, y as TemplateProviderInfo, z as TextBodyDiff, G as TimeoutError, U as UnauthorizedError, I as UpdateEndpointOptions, K as UsageInfo, Q as ValueDifference, W as VerifyProvider, X as WaitForAllOptions, Y as WaitForOptions, Z as WebhookFlowBuilder, _ as WebhookFlowResult, $ as WebhookFlowVerifyOptions, a0 as WebhooksCC, a1 as WebhooksCCError, a2 as diffRequests } from './diff-BlDnipA4.mjs';
1
+ import { R as Request, P as ParsedBody, a as ParsedFormBody, S as SearchResult, V as VerifySignatureOptions, b as SignatureVerificationResult } from './diff-DbTsOT_n.mjs';
2
+ export { A as ApiError, B as BodyDiff, C as ClearRequestsOptions, c as ClientHooks, d as ClientOptions, e as CreateEndpointOptions, f as CurlExport, D as DiffRequestsOptions, g as DiffResult, E as Endpoint, h as ErrorHookInfo, i as ExportRequestsOptions, F as FormBodyValue, H as HarExport, j as HeaderDiff, J as JsonBodyDiff, L as ListPaginatedRequestsOptions, k as ListRequestsOptions, M as MockResponse, N as NotFoundError, O as OperationDescription, l as PaginatedResult, m as RateLimitError, n as RequestDifferences, o as RequestHookInfo, p as RequestsExport, q as ResponseHookInfo, r as RetryOptions, s as SDKDescription, t as SearchFilters, u as SendOptions, v as SendTemplateOptions, w as SendToOptions, x as SubscribeOptions, T as TeamShare, y as TemplateProvider, z as TemplateProviderInfo, G as TextBodyDiff, I as TimeoutError, U as UnauthorizedError, K as UpdateEndpointOptions, Q as UsageInfo, W as ValueDifference, X as VerifyProvider, Y as WaitForAllOptions, Z as WaitForOptions, _ as WebhookFlowBuilder, $ as WebhookFlowResult, a0 as WebhookFlowVerifyOptions, a1 as WebhooksCC, a2 as WebhooksCCError, a3 as diffRequests } from './diff-DbTsOT_n.mjs';
3
3
 
4
4
  /**
5
5
  * Safely parse a JSON request body.
@@ -55,6 +55,26 @@ declare function isPaddleWebhook(request: Request): boolean;
55
55
  declare function isLinearWebhook(request: Request): boolean;
56
56
  /** Check if a request looks like a Discord interaction webhook. */
57
57
  declare function isDiscordWebhook(request: Request): boolean;
58
+ /**
59
+ * Check if a request looks like a SendGrid event webhook.
60
+ * Matches on the body being a JSON array with an sg_event_id field.
61
+ */
62
+ declare function isSendGridWebhook(request: Request): boolean;
63
+ /**
64
+ * Check if a request looks like a Clerk webhook.
65
+ * Matches on the `svix-id` header being present.
66
+ */
67
+ declare function isClerkWebhook(request: Request): boolean;
68
+ /**
69
+ * Check if a request looks like a Vercel webhook.
70
+ * Matches on the `x-vercel-signature` header being present.
71
+ */
72
+ declare function isVercelWebhook(request: Request): boolean;
73
+ /**
74
+ * Check if a request looks like a GitLab webhook.
75
+ * Matches on the `x-gitlab-event` or `x-gitlab-token` header being present.
76
+ */
77
+ declare function isGitLabWebhook(request: Request): boolean;
58
78
  /**
59
79
  * Check if a request looks like a Standard Webhooks request.
60
80
  * Matches on the presence of all three Standard Webhooks headers:
@@ -177,6 +197,42 @@ declare const TEMPLATE_METADATA: Readonly<{
177
197
  signatureHeader: "linear-signature";
178
198
  signatureAlgorithm: "hmac-sha256";
179
199
  }>;
200
+ sendgrid: Readonly<{
201
+ provider: "sendgrid";
202
+ templates: readonly ("delivered" | "open" | "bounce" | "spam_report")[];
203
+ defaultTemplate: "delivered";
204
+ secretRequired: false;
205
+ }>;
206
+ clerk: Readonly<{
207
+ provider: "clerk";
208
+ templates: readonly ("user.created" | "user.updated" | "user.deleted" | "session.created")[];
209
+ defaultTemplate: "user.created";
210
+ secretRequired: true;
211
+ signatureHeader: "webhook-signature";
212
+ signatureAlgorithm: "hmac-sha256";
213
+ }>;
214
+ discord: Readonly<{
215
+ provider: "discord";
216
+ templates: readonly ("interaction_create" | "ping" | "message_component")[];
217
+ defaultTemplate: "interaction_create";
218
+ secretRequired: false;
219
+ }>;
220
+ vercel: Readonly<{
221
+ provider: "vercel";
222
+ templates: readonly ("deployment.created" | "deployment.succeeded" | "deployment.error")[];
223
+ defaultTemplate: "deployment.created";
224
+ secretRequired: true;
225
+ signatureHeader: "x-vercel-signature";
226
+ signatureAlgorithm: "hmac-sha1";
227
+ }>;
228
+ gitlab: Readonly<{
229
+ provider: "gitlab";
230
+ templates: readonly ("push" | "merge_request")[];
231
+ defaultTemplate: "push";
232
+ secretRequired: true;
233
+ signatureHeader: "x-gitlab-token";
234
+ signatureAlgorithm: "token";
235
+ }>;
180
236
  "standard-webhooks": Readonly<{
181
237
  provider: "standard-webhooks";
182
238
  templates: readonly never[];
@@ -215,6 +271,21 @@ declare function verifyPaddleSignature(body: string | undefined, signatureHeader
215
271
  * Verify a Linear webhook signature against the raw request body.
216
272
  */
217
273
  declare function verifyLinearSignature(body: string | undefined, signatureHeader: string | null | undefined, secret: string): Promise<boolean>;
274
+ /**
275
+ * Verify a Vercel webhook signature against the raw request body.
276
+ * Vercel signs with HMAC-SHA1 and sends the hex-encoded signature in x-vercel-signature.
277
+ */
278
+ declare function verifyVercelSignature(body: string | undefined, signatureHeader: string | null | undefined, secret: string): Promise<boolean>;
279
+ /**
280
+ * Verify a GitLab webhook token against the x-gitlab-token header.
281
+ * GitLab sends the raw secret in the header — no HMAC involved.
282
+ */
283
+ declare function verifyGitLabSignature(_body: string | undefined, tokenHeader: string | null | undefined, secret: string): Promise<boolean>;
284
+ /**
285
+ * Verify a Clerk webhook signature using Standard Webhooks (Svix) signing.
286
+ * Delegates to verifyStandardWebhookSignature.
287
+ */
288
+ declare function verifyClerkSignature(body: string | undefined, headers: Record<string, string>, secret: string): Promise<boolean>;
218
289
  /**
219
290
  * Verify a Discord interaction signature using the application's Ed25519 public key.
220
291
  */
@@ -228,4 +299,4 @@ declare function verifyStandardWebhookSignature(body: string | undefined, header
228
299
  */
229
300
  declare function verifySignature(request: VerifyableRequest, options: VerifySignatureOptions): Promise<SignatureVerificationResult>;
230
301
 
231
- export { ParsedBody, ParsedFormBody, Request, type SSEFrame, SearchResult, SignatureVerificationResult, TEMPLATE_METADATA, VerifySignatureOptions, extractJsonField, isDiscordWebhook, isGitHubWebhook, isLinearWebhook, isPaddleWebhook, isShopifyWebhook, isSlackWebhook, isStandardWebhook, isStripeWebhook, isTwilioWebhook, matchAll, matchAny, matchBodyPath, matchBodySubset, matchContentType, matchHeader, matchJsonField, matchMethod, matchPath, matchQueryParam, parseBody, parseDuration, parseFormBody, parseJsonBody, parseSSE, verifyDiscordSignature, verifyGitHubSignature, verifyLinearSignature, verifyPaddleSignature, verifyShopifySignature, verifySignature, verifySlackSignature, verifyStandardWebhookSignature, verifyStripeSignature, verifyTwilioSignature };
302
+ export { ParsedBody, ParsedFormBody, Request, type SSEFrame, SearchResult, SignatureVerificationResult, TEMPLATE_METADATA, VerifySignatureOptions, extractJsonField, isClerkWebhook, isDiscordWebhook, isGitHubWebhook, isGitLabWebhook, isLinearWebhook, isPaddleWebhook, isSendGridWebhook, isShopifyWebhook, isSlackWebhook, isStandardWebhook, isStripeWebhook, isTwilioWebhook, isVercelWebhook, matchAll, matchAny, matchBodyPath, matchBodySubset, matchContentType, matchHeader, matchJsonField, matchMethod, matchPath, matchQueryParam, parseBody, parseDuration, parseFormBody, parseJsonBody, parseSSE, verifyClerkSignature, verifyDiscordSignature, verifyGitHubSignature, verifyGitLabSignature, verifyLinearSignature, verifyPaddleSignature, verifyShopifySignature, verifySignature, verifySlackSignature, verifyStandardWebhookSignature, verifyStripeSignature, verifyTwilioSignature, verifyVercelSignature };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as Request, P as ParsedBody, a as ParsedFormBody, S as SearchResult, V as VerifySignatureOptions, b as SignatureVerificationResult } from './diff-BlDnipA4.js';
2
- export { A as ApiError, B as BodyDiff, C as ClearRequestsOptions, c as ClientHooks, d as ClientOptions, e as CreateEndpointOptions, f as CurlExport, D as DiffRequestsOptions, g as DiffResult, E as Endpoint, h as ErrorHookInfo, i as ExportRequestsOptions, F as FormBodyValue, H as HarExport, j as HeaderDiff, J as JsonBodyDiff, L as ListPaginatedRequestsOptions, k as ListRequestsOptions, M as MockResponse, N as NotFoundError, O as OperationDescription, l as PaginatedResult, m as RateLimitError, n as RequestDifferences, o as RequestHookInfo, p as RequestsExport, q as ResponseHookInfo, r as RetryOptions, s as SDKDescription, t as SearchFilters, u as SendOptions, v as SendTemplateOptions, w as SendToOptions, x as SubscribeOptions, T as TemplateProvider, y as TemplateProviderInfo, z as TextBodyDiff, G as TimeoutError, U as UnauthorizedError, I as UpdateEndpointOptions, K as UsageInfo, Q as ValueDifference, W as VerifyProvider, X as WaitForAllOptions, Y as WaitForOptions, Z as WebhookFlowBuilder, _ as WebhookFlowResult, $ as WebhookFlowVerifyOptions, a0 as WebhooksCC, a1 as WebhooksCCError, a2 as diffRequests } from './diff-BlDnipA4.js';
1
+ import { R as Request, P as ParsedBody, a as ParsedFormBody, S as SearchResult, V as VerifySignatureOptions, b as SignatureVerificationResult } from './diff-DbTsOT_n.js';
2
+ export { A as ApiError, B as BodyDiff, C as ClearRequestsOptions, c as ClientHooks, d as ClientOptions, e as CreateEndpointOptions, f as CurlExport, D as DiffRequestsOptions, g as DiffResult, E as Endpoint, h as ErrorHookInfo, i as ExportRequestsOptions, F as FormBodyValue, H as HarExport, j as HeaderDiff, J as JsonBodyDiff, L as ListPaginatedRequestsOptions, k as ListRequestsOptions, M as MockResponse, N as NotFoundError, O as OperationDescription, l as PaginatedResult, m as RateLimitError, n as RequestDifferences, o as RequestHookInfo, p as RequestsExport, q as ResponseHookInfo, r as RetryOptions, s as SDKDescription, t as SearchFilters, u as SendOptions, v as SendTemplateOptions, w as SendToOptions, x as SubscribeOptions, T as TeamShare, y as TemplateProvider, z as TemplateProviderInfo, G as TextBodyDiff, I as TimeoutError, U as UnauthorizedError, K as UpdateEndpointOptions, Q as UsageInfo, W as ValueDifference, X as VerifyProvider, Y as WaitForAllOptions, Z as WaitForOptions, _ as WebhookFlowBuilder, $ as WebhookFlowResult, a0 as WebhookFlowVerifyOptions, a1 as WebhooksCC, a2 as WebhooksCCError, a3 as diffRequests } from './diff-DbTsOT_n.js';
3
3
 
4
4
  /**
5
5
  * Safely parse a JSON request body.
@@ -55,6 +55,26 @@ declare function isPaddleWebhook(request: Request): boolean;
55
55
  declare function isLinearWebhook(request: Request): boolean;
56
56
  /** Check if a request looks like a Discord interaction webhook. */
57
57
  declare function isDiscordWebhook(request: Request): boolean;
58
+ /**
59
+ * Check if a request looks like a SendGrid event webhook.
60
+ * Matches on the body being a JSON array with an sg_event_id field.
61
+ */
62
+ declare function isSendGridWebhook(request: Request): boolean;
63
+ /**
64
+ * Check if a request looks like a Clerk webhook.
65
+ * Matches on the `svix-id` header being present.
66
+ */
67
+ declare function isClerkWebhook(request: Request): boolean;
68
+ /**
69
+ * Check if a request looks like a Vercel webhook.
70
+ * Matches on the `x-vercel-signature` header being present.
71
+ */
72
+ declare function isVercelWebhook(request: Request): boolean;
73
+ /**
74
+ * Check if a request looks like a GitLab webhook.
75
+ * Matches on the `x-gitlab-event` or `x-gitlab-token` header being present.
76
+ */
77
+ declare function isGitLabWebhook(request: Request): boolean;
58
78
  /**
59
79
  * Check if a request looks like a Standard Webhooks request.
60
80
  * Matches on the presence of all three Standard Webhooks headers:
@@ -177,6 +197,42 @@ declare const TEMPLATE_METADATA: Readonly<{
177
197
  signatureHeader: "linear-signature";
178
198
  signatureAlgorithm: "hmac-sha256";
179
199
  }>;
200
+ sendgrid: Readonly<{
201
+ provider: "sendgrid";
202
+ templates: readonly ("delivered" | "open" | "bounce" | "spam_report")[];
203
+ defaultTemplate: "delivered";
204
+ secretRequired: false;
205
+ }>;
206
+ clerk: Readonly<{
207
+ provider: "clerk";
208
+ templates: readonly ("user.created" | "user.updated" | "user.deleted" | "session.created")[];
209
+ defaultTemplate: "user.created";
210
+ secretRequired: true;
211
+ signatureHeader: "webhook-signature";
212
+ signatureAlgorithm: "hmac-sha256";
213
+ }>;
214
+ discord: Readonly<{
215
+ provider: "discord";
216
+ templates: readonly ("interaction_create" | "ping" | "message_component")[];
217
+ defaultTemplate: "interaction_create";
218
+ secretRequired: false;
219
+ }>;
220
+ vercel: Readonly<{
221
+ provider: "vercel";
222
+ templates: readonly ("deployment.created" | "deployment.succeeded" | "deployment.error")[];
223
+ defaultTemplate: "deployment.created";
224
+ secretRequired: true;
225
+ signatureHeader: "x-vercel-signature";
226
+ signatureAlgorithm: "hmac-sha1";
227
+ }>;
228
+ gitlab: Readonly<{
229
+ provider: "gitlab";
230
+ templates: readonly ("push" | "merge_request")[];
231
+ defaultTemplate: "push";
232
+ secretRequired: true;
233
+ signatureHeader: "x-gitlab-token";
234
+ signatureAlgorithm: "token";
235
+ }>;
180
236
  "standard-webhooks": Readonly<{
181
237
  provider: "standard-webhooks";
182
238
  templates: readonly never[];
@@ -215,6 +271,21 @@ declare function verifyPaddleSignature(body: string | undefined, signatureHeader
215
271
  * Verify a Linear webhook signature against the raw request body.
216
272
  */
217
273
  declare function verifyLinearSignature(body: string | undefined, signatureHeader: string | null | undefined, secret: string): Promise<boolean>;
274
+ /**
275
+ * Verify a Vercel webhook signature against the raw request body.
276
+ * Vercel signs with HMAC-SHA1 and sends the hex-encoded signature in x-vercel-signature.
277
+ */
278
+ declare function verifyVercelSignature(body: string | undefined, signatureHeader: string | null | undefined, secret: string): Promise<boolean>;
279
+ /**
280
+ * Verify a GitLab webhook token against the x-gitlab-token header.
281
+ * GitLab sends the raw secret in the header — no HMAC involved.
282
+ */
283
+ declare function verifyGitLabSignature(_body: string | undefined, tokenHeader: string | null | undefined, secret: string): Promise<boolean>;
284
+ /**
285
+ * Verify a Clerk webhook signature using Standard Webhooks (Svix) signing.
286
+ * Delegates to verifyStandardWebhookSignature.
287
+ */
288
+ declare function verifyClerkSignature(body: string | undefined, headers: Record<string, string>, secret: string): Promise<boolean>;
218
289
  /**
219
290
  * Verify a Discord interaction signature using the application's Ed25519 public key.
220
291
  */
@@ -228,4 +299,4 @@ declare function verifyStandardWebhookSignature(body: string | undefined, header
228
299
  */
229
300
  declare function verifySignature(request: VerifyableRequest, options: VerifySignatureOptions): Promise<SignatureVerificationResult>;
230
301
 
231
- export { ParsedBody, ParsedFormBody, Request, type SSEFrame, SearchResult, SignatureVerificationResult, TEMPLATE_METADATA, VerifySignatureOptions, extractJsonField, isDiscordWebhook, isGitHubWebhook, isLinearWebhook, isPaddleWebhook, isShopifyWebhook, isSlackWebhook, isStandardWebhook, isStripeWebhook, isTwilioWebhook, matchAll, matchAny, matchBodyPath, matchBodySubset, matchContentType, matchHeader, matchJsonField, matchMethod, matchPath, matchQueryParam, parseBody, parseDuration, parseFormBody, parseJsonBody, parseSSE, verifyDiscordSignature, verifyGitHubSignature, verifyLinearSignature, verifyPaddleSignature, verifyShopifySignature, verifySignature, verifySlackSignature, verifyStandardWebhookSignature, verifyStripeSignature, verifyTwilioSignature };
302
+ export { ParsedBody, ParsedFormBody, Request, type SSEFrame, SearchResult, SignatureVerificationResult, TEMPLATE_METADATA, VerifySignatureOptions, extractJsonField, isClerkWebhook, isDiscordWebhook, isGitHubWebhook, isGitLabWebhook, isLinearWebhook, isPaddleWebhook, isSendGridWebhook, isShopifyWebhook, isSlackWebhook, isStandardWebhook, isStripeWebhook, isTwilioWebhook, isVercelWebhook, matchAll, matchAny, matchBodyPath, matchBodySubset, matchContentType, matchHeader, matchJsonField, matchMethod, matchPath, matchQueryParam, parseBody, parseDuration, parseFormBody, parseJsonBody, parseSSE, verifyClerkSignature, verifyDiscordSignature, verifyGitHubSignature, verifyGitLabSignature, verifyLinearSignature, verifyPaddleSignature, verifyShopifySignature, verifySignature, verifySlackSignature, verifyStandardWebhookSignature, verifyStripeSignature, verifyTwilioSignature, verifyVercelSignature };