@invect/webhooks 0.0.1 → 0.0.3
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/README.md +79 -0
- package/dist/backend/index.cjs +12 -3
- package/dist/backend/index.cjs.map +1 -1
- package/dist/backend/index.d.cts +115 -0
- package/dist/backend/index.d.cts.map +1 -0
- package/dist/backend/index.d.mts +115 -0
- package/dist/backend/index.d.mts.map +1 -0
- package/dist/backend/index.d.ts +1 -1
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.mjs +12 -3
- package/dist/backend/index.mjs.map +1 -1
- package/dist/backend/plugin.d.ts +9 -2
- package/dist/backend/plugin.d.ts.map +1 -1
- package/dist/backend/webhook-dedup.service.d.ts.map +1 -1
- package/dist/backend/webhook-signature.service.d.ts.map +1 -1
- package/dist/frontend/components/CreateWebhookModal.d.ts.map +1 -1
- package/dist/frontend/components/WebhookDetailPanel.d.ts.map +1 -1
- package/dist/frontend/components/WebhooksPage.d.ts.map +1 -1
- package/dist/frontend/hooks/useWebhookQueries.d.ts +1 -1
- package/dist/frontend/hooks/useWebhookQueries.d.ts.map +1 -1
- package/dist/frontend/index.cjs +46 -46
- package/dist/frontend/index.cjs.map +1 -1
- package/dist/frontend/index.d.cts +70 -0
- package/dist/frontend/index.d.cts.map +1 -0
- package/dist/frontend/index.d.mts +70 -0
- package/dist/frontend/index.d.mts.map +1 -0
- package/dist/frontend/index.d.ts +2 -2
- package/dist/frontend/index.d.ts.map +1 -1
- package/dist/frontend/index.mjs +28 -28
- package/dist/frontend/index.mjs.map +1 -1
- package/dist/frontend/plugins/webhooksFrontendPlugin.d.ts +2 -2
- package/dist/frontend/plugins/webhooksFrontendPlugin.d.ts.map +1 -1
- package/dist/shared/types.d.cts +2 -0
- package/dist/shared/types.d.mts +2 -0
- package/dist/types-cBOT0AqR.d.cts +83 -0
- package/dist/types-cBOT0AqR.d.cts.map +1 -0
- package/dist/types-zH7xu7mA.d.mts +83 -0
- package/dist/types-zH7xu7mA.d.mts.map +1 -0
- package/package.json +49 -50
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { InvectPluginDefinition } from "@invect/core";
|
|
2
|
+
|
|
3
|
+
//#region src/backend/plugin.d.ts
|
|
4
|
+
interface WebhooksPluginOptions {
|
|
5
|
+
/** Base URL for webhook endpoints (e.g. "https://example.com/api/invect") */
|
|
6
|
+
webhookBaseUrl?: string;
|
|
7
|
+
/** Rate limit: max requests per window. @default 60 */
|
|
8
|
+
rateLimitMaxRequests?: number;
|
|
9
|
+
/** Rate limit: window size in ms. @default 60000 */
|
|
10
|
+
rateLimitWindowMs?: number;
|
|
11
|
+
/** Dedup TTL in ms. @default 86400000 (24h) */
|
|
12
|
+
dedupTtlMs?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Frontend plugin (sidebar, routes) for the webhooks UI.
|
|
15
|
+
*
|
|
16
|
+
* Import from `@invect/webhooks/ui` and pass here.
|
|
17
|
+
* Omit for backend-only setups.
|
|
18
|
+
*/
|
|
19
|
+
frontend?: unknown;
|
|
20
|
+
}
|
|
21
|
+
declare function webhooks(options?: WebhooksPluginOptions): InvectPluginDefinition;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/backend/webhook-signature.service.d.ts
|
|
24
|
+
/**
|
|
25
|
+
* Webhook Signature Verification Service
|
|
26
|
+
*
|
|
27
|
+
* Validates HMAC signatures from webhook providers (GitHub, Slack, Stripe, Linear, etc.).
|
|
28
|
+
* Moved from @invect/core to the webhooks plugin.
|
|
29
|
+
*/
|
|
30
|
+
interface WebhookProviderSignatureConfig {
|
|
31
|
+
signatureHeader: string;
|
|
32
|
+
algorithm: 'sha256' | 'sha1';
|
|
33
|
+
signaturePrefix: string;
|
|
34
|
+
deliveryIdHeader?: string;
|
|
35
|
+
eventTypeHeader?: string;
|
|
36
|
+
}
|
|
37
|
+
declare const WEBHOOK_PROVIDER_SIGNATURES: Record<string, WebhookProviderSignatureConfig>;
|
|
38
|
+
type LoggerLike = {
|
|
39
|
+
warn: (msg: string, meta?: unknown) => void;
|
|
40
|
+
error: (msg: string, meta?: unknown) => void;
|
|
41
|
+
};
|
|
42
|
+
declare class WebhookSignatureService {
|
|
43
|
+
private readonly logger;
|
|
44
|
+
constructor(logger: LoggerLike);
|
|
45
|
+
verify(provider: string, secret: string, rawBody: string | Buffer, headers: Record<string, string>): {
|
|
46
|
+
valid: boolean;
|
|
47
|
+
error?: string;
|
|
48
|
+
};
|
|
49
|
+
getDeliveryId(provider: string, headers: Record<string, string>): string | undefined;
|
|
50
|
+
getEventType(provider: string, headers: Record<string, string>): string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Verify a custom HMAC signature where the user specifies the header name and secret.
|
|
53
|
+
* Supports hex-encoded SHA-256 signatures, with or without a `sha256=` prefix.
|
|
54
|
+
*/
|
|
55
|
+
verifyCustomHmac(secret: string, headerName: string, rawBody: string | Buffer, headers: Record<string, string>): {
|
|
56
|
+
valid: boolean;
|
|
57
|
+
error?: string;
|
|
58
|
+
};
|
|
59
|
+
private verifyHmac;
|
|
60
|
+
private verifySlack;
|
|
61
|
+
private verifyStripe;
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/backend/webhook-rate-limiter.d.ts
|
|
65
|
+
/**
|
|
66
|
+
* Webhook Rate Limiter — sliding-window in-memory rate limiter.
|
|
67
|
+
* Moved from @invect/core to the webhooks plugin.
|
|
68
|
+
*/
|
|
69
|
+
interface RateLimiterOptions {
|
|
70
|
+
maxRequests?: number;
|
|
71
|
+
windowMs?: number;
|
|
72
|
+
}
|
|
73
|
+
declare class WebhookRateLimiter {
|
|
74
|
+
private readonly maxRequests;
|
|
75
|
+
private readonly windowMs;
|
|
76
|
+
private readonly windows;
|
|
77
|
+
private cleanupTimer;
|
|
78
|
+
constructor(options?: RateLimiterOptions);
|
|
79
|
+
check(key: string): {
|
|
80
|
+
allowed: boolean;
|
|
81
|
+
retryAfterMs?: number;
|
|
82
|
+
remaining?: number;
|
|
83
|
+
};
|
|
84
|
+
private cleanup;
|
|
85
|
+
dispose(): void;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/backend/webhook-dedup.service.d.ts
|
|
89
|
+
/**
|
|
90
|
+
* Webhook Dedup Service — prevents duplicate webhook events.
|
|
91
|
+
* Moved from @invect/core to the webhooks plugin.
|
|
92
|
+
*/
|
|
93
|
+
interface WebhookDedupOptions {
|
|
94
|
+
ttlMs?: number;
|
|
95
|
+
maxEntries?: number;
|
|
96
|
+
}
|
|
97
|
+
interface DedupEntry {
|
|
98
|
+
createdAt: number;
|
|
99
|
+
flowRunIds: string[];
|
|
100
|
+
}
|
|
101
|
+
declare class WebhookDedupService {
|
|
102
|
+
private readonly ttlMs;
|
|
103
|
+
private readonly maxEntries;
|
|
104
|
+
private readonly entries;
|
|
105
|
+
private cleanupTimer;
|
|
106
|
+
constructor(options?: WebhookDedupOptions);
|
|
107
|
+
private key;
|
|
108
|
+
check(webhookPath: string, deliveryId: string | undefined): DedupEntry | null;
|
|
109
|
+
record(webhookPath: string, deliveryId: string | undefined, flowRunIds: string[]): void;
|
|
110
|
+
private cleanup;
|
|
111
|
+
dispose(): void;
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { WEBHOOK_PROVIDER_SIGNATURES, WebhookDedupService, type WebhookProviderSignatureConfig, WebhookRateLimiter, WebhookSignatureService, type WebhooksPluginOptions, webhooks };
|
|
115
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/backend/plugin.ts","../../src/backend/webhook-signature.service.ts","../../src/backend/webhook-rate-limiter.ts","../../src/backend/webhook-dedup.service.ts"],"mappings":";;;UA4BiB,qBAAA;EAQf;EANA,cAAA;EAcQ;EAZR,oBAAA;EA6Ec;EA3Ed,iBAAA;;EAEA,UAAA;EAyEiC;;;;;;EAjEjC,QAAA;AAAA;AAAA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QACT,YAAA;cAEI,OAAA,GAAU,mBAAA;EAAA,QAUd,GAAA;EAIR,KAAA,CAAM,WAAA,UAAqB,UAAA,uBAAiC,UAAA;EAmB5D,MAAA,CAAO,WAAA,UAAqB,UAAA,sBAAgC,UAAA;EAAA,QAiBpD,OAAA;EASR,OAAA,CAAA;AAAA"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { InvectPluginDefinition } from "@invect/core";
|
|
2
|
+
|
|
3
|
+
//#region src/backend/plugin.d.ts
|
|
4
|
+
interface WebhooksPluginOptions {
|
|
5
|
+
/** Base URL for webhook endpoints (e.g. "https://example.com/api/invect") */
|
|
6
|
+
webhookBaseUrl?: string;
|
|
7
|
+
/** Rate limit: max requests per window. @default 60 */
|
|
8
|
+
rateLimitMaxRequests?: number;
|
|
9
|
+
/** Rate limit: window size in ms. @default 60000 */
|
|
10
|
+
rateLimitWindowMs?: number;
|
|
11
|
+
/** Dedup TTL in ms. @default 86400000 (24h) */
|
|
12
|
+
dedupTtlMs?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Frontend plugin (sidebar, routes) for the webhooks UI.
|
|
15
|
+
*
|
|
16
|
+
* Import from `@invect/webhooks/ui` and pass here.
|
|
17
|
+
* Omit for backend-only setups.
|
|
18
|
+
*/
|
|
19
|
+
frontend?: unknown;
|
|
20
|
+
}
|
|
21
|
+
declare function webhooks(options?: WebhooksPluginOptions): InvectPluginDefinition;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/backend/webhook-signature.service.d.ts
|
|
24
|
+
/**
|
|
25
|
+
* Webhook Signature Verification Service
|
|
26
|
+
*
|
|
27
|
+
* Validates HMAC signatures from webhook providers (GitHub, Slack, Stripe, Linear, etc.).
|
|
28
|
+
* Moved from @invect/core to the webhooks plugin.
|
|
29
|
+
*/
|
|
30
|
+
interface WebhookProviderSignatureConfig {
|
|
31
|
+
signatureHeader: string;
|
|
32
|
+
algorithm: 'sha256' | 'sha1';
|
|
33
|
+
signaturePrefix: string;
|
|
34
|
+
deliveryIdHeader?: string;
|
|
35
|
+
eventTypeHeader?: string;
|
|
36
|
+
}
|
|
37
|
+
declare const WEBHOOK_PROVIDER_SIGNATURES: Record<string, WebhookProviderSignatureConfig>;
|
|
38
|
+
type LoggerLike = {
|
|
39
|
+
warn: (msg: string, meta?: unknown) => void;
|
|
40
|
+
error: (msg: string, meta?: unknown) => void;
|
|
41
|
+
};
|
|
42
|
+
declare class WebhookSignatureService {
|
|
43
|
+
private readonly logger;
|
|
44
|
+
constructor(logger: LoggerLike);
|
|
45
|
+
verify(provider: string, secret: string, rawBody: string | Buffer, headers: Record<string, string>): {
|
|
46
|
+
valid: boolean;
|
|
47
|
+
error?: string;
|
|
48
|
+
};
|
|
49
|
+
getDeliveryId(provider: string, headers: Record<string, string>): string | undefined;
|
|
50
|
+
getEventType(provider: string, headers: Record<string, string>): string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Verify a custom HMAC signature where the user specifies the header name and secret.
|
|
53
|
+
* Supports hex-encoded SHA-256 signatures, with or without a `sha256=` prefix.
|
|
54
|
+
*/
|
|
55
|
+
verifyCustomHmac(secret: string, headerName: string, rawBody: string | Buffer, headers: Record<string, string>): {
|
|
56
|
+
valid: boolean;
|
|
57
|
+
error?: string;
|
|
58
|
+
};
|
|
59
|
+
private verifyHmac;
|
|
60
|
+
private verifySlack;
|
|
61
|
+
private verifyStripe;
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/backend/webhook-rate-limiter.d.ts
|
|
65
|
+
/**
|
|
66
|
+
* Webhook Rate Limiter — sliding-window in-memory rate limiter.
|
|
67
|
+
* Moved from @invect/core to the webhooks plugin.
|
|
68
|
+
*/
|
|
69
|
+
interface RateLimiterOptions {
|
|
70
|
+
maxRequests?: number;
|
|
71
|
+
windowMs?: number;
|
|
72
|
+
}
|
|
73
|
+
declare class WebhookRateLimiter {
|
|
74
|
+
private readonly maxRequests;
|
|
75
|
+
private readonly windowMs;
|
|
76
|
+
private readonly windows;
|
|
77
|
+
private cleanupTimer;
|
|
78
|
+
constructor(options?: RateLimiterOptions);
|
|
79
|
+
check(key: string): {
|
|
80
|
+
allowed: boolean;
|
|
81
|
+
retryAfterMs?: number;
|
|
82
|
+
remaining?: number;
|
|
83
|
+
};
|
|
84
|
+
private cleanup;
|
|
85
|
+
dispose(): void;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/backend/webhook-dedup.service.d.ts
|
|
89
|
+
/**
|
|
90
|
+
* Webhook Dedup Service — prevents duplicate webhook events.
|
|
91
|
+
* Moved from @invect/core to the webhooks plugin.
|
|
92
|
+
*/
|
|
93
|
+
interface WebhookDedupOptions {
|
|
94
|
+
ttlMs?: number;
|
|
95
|
+
maxEntries?: number;
|
|
96
|
+
}
|
|
97
|
+
interface DedupEntry {
|
|
98
|
+
createdAt: number;
|
|
99
|
+
flowRunIds: string[];
|
|
100
|
+
}
|
|
101
|
+
declare class WebhookDedupService {
|
|
102
|
+
private readonly ttlMs;
|
|
103
|
+
private readonly maxEntries;
|
|
104
|
+
private readonly entries;
|
|
105
|
+
private cleanupTimer;
|
|
106
|
+
constructor(options?: WebhookDedupOptions);
|
|
107
|
+
private key;
|
|
108
|
+
check(webhookPath: string, deliveryId: string | undefined): DedupEntry | null;
|
|
109
|
+
record(webhookPath: string, deliveryId: string | undefined, flowRunIds: string[]): void;
|
|
110
|
+
private cleanup;
|
|
111
|
+
dispose(): void;
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { WEBHOOK_PROVIDER_SIGNATURES, WebhookDedupService, type WebhookProviderSignatureConfig, WebhookRateLimiter, WebhookSignatureService, type WebhooksPluginOptions, webhooks };
|
|
115
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/backend/plugin.ts","../../src/backend/webhook-signature.service.ts","../../src/backend/webhook-rate-limiter.ts","../../src/backend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AA;EACf,KAAA;EACA,UAAA;AAAA;AAAA,UAGQ,UAAA;EACR,SAAA;EACA,UAAA;AAAA;AAAA,cAGW,mBAAA;EAAA,iBACM,KAAA;EAAA,iBACA,UAAA;EAAA,iBACA,OAAA;EAAA,QACT,YAAA;cAEI,OAAA,GAAU,mBAAA;EAAA,QAUd,GAAA;EAIR,KAAA,CAAM,WAAA,UAAqB,UAAA,uBAAiC,UAAA;EAmB5D,MAAA,CAAO,WAAA,UAAqB,UAAA,sBAAgC,UAAA;EAAA,QAiBpD,OAAA;EASR,OAAA,CAAA;AAAA"}
|
package/dist/backend/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @invect/webhooks — Backend Entry Point
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
4
|
+
export { webhooks } from './plugin';
|
|
5
5
|
export type { WebhooksPluginOptions } from './plugin';
|
|
6
6
|
export { WebhookSignatureService, WEBHOOK_PROVIDER_SIGNATURES } from './webhook-signature.service';
|
|
7
7
|
export type { WebhookProviderSignatureConfig } from './webhook-signature.service';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,YAAY,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AACnG,YAAY,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/backend/index.mjs
CHANGED
|
@@ -3249,7 +3249,16 @@ function generateWebhookPath() {
|
|
|
3249
3249
|
for (let i = 0; i < 24; i++) path += chars[Math.floor(Math.random() * 36)];
|
|
3250
3250
|
return path;
|
|
3251
3251
|
}
|
|
3252
|
-
function
|
|
3252
|
+
function webhooks(options) {
|
|
3253
|
+
const { frontend, ...backendOptions } = options ?? {};
|
|
3254
|
+
return {
|
|
3255
|
+
id: "webhooks",
|
|
3256
|
+
name: "Webhooks",
|
|
3257
|
+
backend: _webhooksBackendPlugin(backendOptions),
|
|
3258
|
+
frontend
|
|
3259
|
+
};
|
|
3260
|
+
}
|
|
3261
|
+
function _webhooksBackendPlugin(options) {
|
|
3253
3262
|
let state = null;
|
|
3254
3263
|
function createEndpoints() {
|
|
3255
3264
|
return [
|
|
@@ -3475,10 +3484,10 @@ function webhooksPlugin(options) {
|
|
|
3475
3484
|
state = null;
|
|
3476
3485
|
}
|
|
3477
3486
|
},
|
|
3478
|
-
setupInstructions: "Run `npx invect generate` to generate the webhook_triggers table schema, then `npx invect migrate` to apply it."
|
|
3487
|
+
setupInstructions: "Run `npx invect-cli generate` to generate the webhook_triggers table schema, then `npx invect-cli migrate` to apply it."
|
|
3479
3488
|
};
|
|
3480
3489
|
}
|
|
3481
3490
|
//#endregion
|
|
3482
|
-
export { WEBHOOK_PROVIDER_SIGNATURES, WebhookDedupService, WebhookRateLimiter, WebhookSignatureService,
|
|
3491
|
+
export { WEBHOOK_PROVIDER_SIGNATURES, WebhookDedupService, WebhookRateLimiter, WebhookSignatureService, webhooks };
|
|
3483
3492
|
|
|
3484
3493
|
//# sourceMappingURL=index.mjs.map
|