@webhooks-cc/sdk 1.0.0 → 1.0.1

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.
@@ -26,6 +26,8 @@ interface MockResponse {
26
26
  body: string;
27
27
  /** Response headers */
28
28
  headers: Record<string, string>;
29
+ /** Response delay in milliseconds (0-30000). The receiver caps at 30s. */
30
+ delay?: number;
29
31
  }
30
32
  /**
31
33
  * A captured webhook request with full HTTP details.
@@ -26,6 +26,8 @@ interface MockResponse {
26
26
  body: string;
27
27
  /** Response headers */
28
28
  headers: Record<string, string>;
29
+ /** Response delay in milliseconds (0-30000). The receiver caps at 30s. */
30
+ delay?: number;
29
31
  }
30
32
  /**
31
33
  * A captured webhook request with full HTTP details.
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-Dn4j4B_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 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-Dn4j4B_n.mjs';
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';
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-Dn4j4B_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 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-Dn4j4B_n.js';
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';
3
3
 
4
4
  /**
5
5
  * Safely parse a JSON request body.
package/dist/index.js CHANGED
@@ -1949,10 +1949,13 @@ async function collectMatchingRequests(fetchRequests, options) {
1949
1949
  throw new TimeoutError(timeout);
1950
1950
  }
1951
1951
  function validateMockResponse(mockResponse, fieldName) {
1952
- const { status } = mockResponse;
1952
+ const { status, delay } = mockResponse;
1953
1953
  if (!Number.isInteger(status) || status < 100 || status > 599) {
1954
1954
  throw new Error(`Invalid ${fieldName} status: ${status}. Must be an integer 100-599.`);
1955
1955
  }
1956
+ if (delay !== void 0 && (!Number.isInteger(delay) || delay < 0 || delay > 3e4)) {
1957
+ throw new Error(`Invalid ${fieldName} delay: ${delay}. Must be an integer 0-30000.`);
1958
+ }
1956
1959
  }
1957
1960
  var WebhooksCC = class {
1958
1961
  constructor(options) {
package/dist/index.mjs CHANGED
@@ -1815,10 +1815,13 @@ async function collectMatchingRequests(fetchRequests, options) {
1815
1815
  throw new TimeoutError(timeout);
1816
1816
  }
1817
1817
  function validateMockResponse(mockResponse, fieldName) {
1818
- const { status } = mockResponse;
1818
+ const { status, delay } = mockResponse;
1819
1819
  if (!Number.isInteger(status) || status < 100 || status > 599) {
1820
1820
  throw new Error(`Invalid ${fieldName} status: ${status}. Must be an integer 100-599.`);
1821
1821
  }
1822
+ if (delay !== void 0 && (!Number.isInteger(delay) || delay < 0 || delay > 3e4)) {
1823
+ throw new Error(`Invalid ${fieldName} delay: ${delay}. Must be an integer 0-30000.`);
1824
+ }
1822
1825
  }
1823
1826
  var WebhooksCC = class {
1824
1827
  constructor(options) {
@@ -1,4 +1,4 @@
1
- import { g as DiffResult, e as CreateEndpointOptions, R as Request, a0 as WebhooksCC, E as Endpoint } from './diff-Dn4j4B_n.mjs';
1
+ import { g as DiffResult, e as CreateEndpointOptions, R as Request, a0 as WebhooksCC, E as Endpoint } from './diff-BlDnipA4.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, a0 as WebhooksCC, E as Endpoint } from './diff-Dn4j4B_n.js';
1
+ import { g as DiffResult, e as CreateEndpointOptions, R as Request, a0 as WebhooksCC, E as Endpoint } from './diff-BlDnipA4.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.0.0",
3
+ "version": "1.0.1",
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",