@webhooks-cc/sdk 1.1.0 → 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.
- package/dist/{diff-C6vrhcEq.d.mts → diff-DbTsOT_n.d.mts} +12 -1
- package/dist/{diff-C6vrhcEq.d.ts → diff-DbTsOT_n.d.ts} +12 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -1
- package/dist/index.mjs +5 -1
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/package.json +2 -2
|
@@ -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 {
|
|
@@ -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
|
|
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 {
|
|
@@ -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
|
|
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-
|
|
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
|
|
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.
|
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-
|
|
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
|
|
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.
|
package/dist/index.js
CHANGED
|
@@ -2472,7 +2472,11 @@ var WebhooksCC = class {
|
|
|
2472
2472
|
return this.request("POST", "/endpoints", body);
|
|
2473
2473
|
},
|
|
2474
2474
|
list: async () => {
|
|
2475
|
-
|
|
2475
|
+
const response = await this.request(
|
|
2476
|
+
"GET",
|
|
2477
|
+
"/endpoints"
|
|
2478
|
+
);
|
|
2479
|
+
return [...response.owned, ...response.shared];
|
|
2476
2480
|
},
|
|
2477
2481
|
get: async (slug) => {
|
|
2478
2482
|
validatePathSegment(slug, "slug");
|
package/dist/index.mjs
CHANGED
|
@@ -2331,7 +2331,11 @@ var WebhooksCC = class {
|
|
|
2331
2331
|
return this.request("POST", "/endpoints", body);
|
|
2332
2332
|
},
|
|
2333
2333
|
list: async () => {
|
|
2334
|
-
|
|
2334
|
+
const response = await this.request(
|
|
2335
|
+
"GET",
|
|
2336
|
+
"/endpoints"
|
|
2337
|
+
);
|
|
2338
|
+
return [...response.owned, ...response.shared];
|
|
2335
2339
|
},
|
|
2336
2340
|
get: async (slug) => {
|
|
2337
2341
|
validatePathSegment(slug, "slug");
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as DiffResult, e as CreateEndpointOptions, R as Request,
|
|
1
|
+
import { g as DiffResult, e as CreateEndpointOptions, R as Request, a1 as WebhooksCC, E as Endpoint } from './diff-DbTsOT_n.mjs';
|
|
2
2
|
|
|
3
3
|
type TestingClient = Pick<WebhooksCC, "endpoints" | "requests">;
|
|
4
4
|
interface AssertRequestExpectation {
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as DiffResult, e as CreateEndpointOptions, R as Request,
|
|
1
|
+
import { g as DiffResult, e as CreateEndpointOptions, R as Request, a1 as WebhooksCC, E as Endpoint } from './diff-DbTsOT_n.js';
|
|
2
2
|
|
|
3
3
|
type TestingClient = Pick<WebhooksCC, "endpoints" | "requests">;
|
|
4
4
|
interface AssertRequestExpectation {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webhooks-cc/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "TypeScript SDK for webhooks.cc — create endpoints, capture requests, assert in tests",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"tsup": "^8.5.1",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
|
-
"vitest": "^
|
|
42
|
+
"vitest": "^4.1.1"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsup --config tsup.config.ts",
|