@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
package/dist/backend/plugin.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* system — the core flow_triggers table handles execution wiring, while
|
|
7
7
|
* this plugin adds the management layer.
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
9
|
+
import type { InvectPluginDefinition } from '@invect/core';
|
|
10
10
|
export interface WebhooksPluginOptions {
|
|
11
11
|
/** Base URL for webhook endpoints (e.g. "https://example.com/api/invect") */
|
|
12
12
|
webhookBaseUrl?: string;
|
|
@@ -16,6 +16,13 @@ export interface WebhooksPluginOptions {
|
|
|
16
16
|
rateLimitWindowMs?: number;
|
|
17
17
|
/** Dedup TTL in ms. @default 86400000 (24h) */
|
|
18
18
|
dedupTtlMs?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Frontend plugin (sidebar, routes) for the webhooks UI.
|
|
21
|
+
*
|
|
22
|
+
* Import from `@invect/webhooks/ui` and pass here.
|
|
23
|
+
* Omit for backend-only setups.
|
|
24
|
+
*/
|
|
25
|
+
frontend?: unknown;
|
|
19
26
|
}
|
|
20
|
-
export declare function
|
|
27
|
+
export declare function webhooks(options?: WebhooksPluginOptions): InvectPluginDefinition;
|
|
21
28
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/backend/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/backend/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAEV,sBAAsB,EAIvB,MAAM,cAAc,CAAC;AAatB,MAAM,WAAW,qBAAqB;IACpC,6EAA6E;IAC7E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oDAAoD;IACpD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAgED,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,sBAAsB,CAQhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-dedup.service.d.ts","sourceRoot":"","sources":["../../src/backend/webhook-dedup.service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,UAAU;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD,OAAO,CAAC,YAAY,CAA+C;gBAEvD,OAAO,CAAC,EAAE,mBAAmB;IAUzC,OAAO,CAAC,GAAG;IAIX,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"webhook-dedup.service.d.ts","sourceRoot":"","sources":["../../src/backend/webhook-dedup.service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,UAAU;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,qBA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K,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;IAsCrC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS;IAWpF,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS;IAWnF;;;OAGG;IACH,gBAAgB,CACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;IAkCrC,OAAO,CAAC,UAAU;IAqBlB,OAAO,CAAC,WAAW;IAiCnB,OAAO,CAAC,YAAY;CA6BrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateWebhookModal.d.ts","sourceRoot":"","sources":["../../../src/frontend/components/CreateWebhookModal.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CreateWebhookModal.d.ts","sourceRoot":"","sources":["../../../src/frontend/components/CreateWebhookModal.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS1D,UAAU,uBAAuB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7C,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CA0Q1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebhookDetailPanel.d.ts","sourceRoot":"","sources":["../../../src/frontend/components/WebhookDetailPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WebhookDetailPanel.d.ts","sourceRoot":"","sources":["../../../src/frontend/components/WebhookDetailPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAe1C,OAAO,KAAK,EAAE,cAAc,EAA6B,MAAM,oBAAoB,CAAC;AAqDpF,UAAU,uBAAuB;IAC/B,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAmF1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebhooksPage.d.ts","sourceRoot":"","sources":["../../../src/frontend/components/WebhooksPage.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAoB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WebhooksPage.d.ts","sourceRoot":"","sources":["../../../src/frontend/components/WebhooksPage.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAoB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAwIlD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAgLjD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* React hooks for the webhooks plugin API.
|
|
3
3
|
*
|
|
4
|
-
* Uses @invect/
|
|
4
|
+
* Uses @invect/ui's ApiContext for the base URL.
|
|
5
5
|
*/
|
|
6
6
|
import type { WebhookTrigger, CreateWebhookTriggerInput, UpdateWebhookTriggerInput, WebhookTriggerInfo } from '../../shared/types';
|
|
7
7
|
export declare function useWebhookTriggers(): import("@tanstack/react-query").UseQueryResult<WebhookTrigger[], Error>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebhookQueries.d.ts","sourceRoot":"","sources":["../../../src/frontend/hooks/useWebhookQueries.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AA4B5B,wBAAgB,kBAAkB,4EASjC;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,yEAOvD;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"useWebhookQueries.d.ts","sourceRoot":"","sources":["../../../src/frontend/hooks/useWebhookQueries.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AA4B5B,wBAAgB,kBAAkB,4EASjC;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,yEAOvD;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,6EAO3D;AAID,wBAAgB,uBAAuB;cAKK,MAAM;8CAMjD;AAED,wBAAgB,uBAAuB;QAI8B,MAAM;YAU1E;AAED,wBAAgB,uBAAuB;aAKb,OAAO;2BAKhC;AAED,wBAAgB,qBAAqB;YAIZ,MAAM;;QADS,MAAM;cAAY,OAAO;YAMhE"}
|
package/dist/frontend/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let lucide_react = require("lucide-react");
|
|
3
3
|
let react = require("react");
|
|
4
|
-
let
|
|
4
|
+
let _invect_ui = require("@invect/ui");
|
|
5
5
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
//#region src/frontend/hooks/useWebhookQueries.ts
|
|
8
8
|
/**
|
|
9
9
|
* React hooks for the webhooks plugin API.
|
|
10
10
|
*
|
|
11
|
-
* Uses @invect/
|
|
11
|
+
* Uses @invect/ui's ApiContext for the base URL.
|
|
12
12
|
*/
|
|
13
13
|
async function apiFetch(baseUrl, path, init) {
|
|
14
14
|
const res = await fetch(`${baseUrl}${path}`, {
|
|
@@ -40,14 +40,14 @@ const keys = {
|
|
|
40
40
|
]
|
|
41
41
|
};
|
|
42
42
|
function useWebhookTriggers() {
|
|
43
|
-
const baseUrl = (0,
|
|
43
|
+
const baseUrl = (0, _invect_ui.useApiBaseURL)();
|
|
44
44
|
return (0, _tanstack_react_query.useQuery)({
|
|
45
45
|
queryKey: keys.list(),
|
|
46
46
|
queryFn: () => apiFetch(baseUrl, "/plugins/webhooks/triggers").then((r) => r.data)
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
function useWebhookTrigger(id) {
|
|
50
|
-
const baseUrl = (0,
|
|
50
|
+
const baseUrl = (0, _invect_ui.useApiBaseURL)();
|
|
51
51
|
return (0, _tanstack_react_query.useQuery)({
|
|
52
52
|
queryKey: keys.detail(id ?? ""),
|
|
53
53
|
queryFn: () => apiFetch(baseUrl, `/plugins/webhooks/triggers/${id}`),
|
|
@@ -55,7 +55,7 @@ function useWebhookTrigger(id) {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
function useWebhookTriggerInfo(id) {
|
|
58
|
-
const baseUrl = (0,
|
|
58
|
+
const baseUrl = (0, _invect_ui.useApiBaseURL)();
|
|
59
59
|
return (0, _tanstack_react_query.useQuery)({
|
|
60
60
|
queryKey: keys.info(id ?? ""),
|
|
61
61
|
queryFn: () => apiFetch(baseUrl, `/plugins/webhooks/triggers/${id}/info`),
|
|
@@ -63,7 +63,7 @@ function useWebhookTriggerInfo(id) {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function useCreateWebhookTrigger() {
|
|
66
|
-
const baseUrl = (0,
|
|
66
|
+
const baseUrl = (0, _invect_ui.useApiBaseURL)();
|
|
67
67
|
const qc = (0, _tanstack_react_query.useQueryClient)();
|
|
68
68
|
return (0, _tanstack_react_query.useMutation)({
|
|
69
69
|
mutationFn: (input) => apiFetch(baseUrl, "/plugins/webhooks/triggers", {
|
|
@@ -74,7 +74,7 @@ function useCreateWebhookTrigger() {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
function useUpdateWebhookTrigger() {
|
|
77
|
-
const baseUrl = (0,
|
|
77
|
+
const baseUrl = (0, _invect_ui.useApiBaseURL)();
|
|
78
78
|
const qc = (0, _tanstack_react_query.useQueryClient)();
|
|
79
79
|
return (0, _tanstack_react_query.useMutation)({
|
|
80
80
|
mutationFn: ({ id, ...input }) => apiFetch(baseUrl, `/plugins/webhooks/triggers/${id}`, {
|
|
@@ -88,7 +88,7 @@ function useUpdateWebhookTrigger() {
|
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
function useDeleteWebhookTrigger() {
|
|
91
|
-
const baseUrl = (0,
|
|
91
|
+
const baseUrl = (0, _invect_ui.useApiBaseURL)();
|
|
92
92
|
const qc = (0, _tanstack_react_query.useQueryClient)();
|
|
93
93
|
return (0, _tanstack_react_query.useMutation)({
|
|
94
94
|
mutationFn: (id) => apiFetch(baseUrl, `/plugins/webhooks/triggers/${id}`, { method: "DELETE" }),
|
|
@@ -96,7 +96,7 @@ function useDeleteWebhookTrigger() {
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
function useTestWebhookTrigger() {
|
|
99
|
-
const baseUrl = (0,
|
|
99
|
+
const baseUrl = (0, _invect_ui.useApiBaseURL)();
|
|
100
100
|
return (0, _tanstack_react_query.useMutation)({ mutationFn: ({ id, payload }) => apiFetch(baseUrl, `/plugins/webhooks/triggers/${id}/test`, {
|
|
101
101
|
method: "POST",
|
|
102
102
|
body: JSON.stringify(payload ?? { test: true })
|
|
@@ -187,21 +187,21 @@ const CreateWebhookModal = ({ open, onClose, containerRef, flowId, nodeId }) =>
|
|
|
187
187
|
setCreatedUrl(null);
|
|
188
188
|
onClose();
|
|
189
189
|
};
|
|
190
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
190
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_invect_ui.Dialog, {
|
|
191
191
|
open,
|
|
192
192
|
onOpenChange: (v) => {
|
|
193
193
|
if (!v) handleClose();
|
|
194
194
|
},
|
|
195
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
195
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_invect_ui.DialogContent, {
|
|
196
196
|
container: containerRef?.current,
|
|
197
197
|
className: "max-w-md gap-0 p-0 overflow-hidden",
|
|
198
198
|
showCloseButton: true,
|
|
199
199
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
200
200
|
className: "px-6 pt-6 pb-4",
|
|
201
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
201
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_invect_ui.DialogHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_invect_ui.DialogTitle, {
|
|
202
202
|
className: "text-base",
|
|
203
203
|
children: createdUrl ? "Webhook Created" : "Create Webhook"
|
|
204
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
204
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_invect_ui.DialogDescription, { children: createdUrl ? "Copy the URL below and configure it in your external service." : "Set up a generic endpoint to receive webhook events from any external system." })] })
|
|
205
205
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
206
206
|
className: "px-6 pb-6 space-y-4",
|
|
207
207
|
children: createdUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -444,17 +444,17 @@ const WebhookDetailPanel = ({ trigger, flowName, onClose }) => {
|
|
|
444
444
|
};
|
|
445
445
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
446
446
|
className: "px-6 pt-6 pb-0",
|
|
447
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
447
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_invect_ui.DialogHeader, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
448
448
|
className: "flex items-center gap-3",
|
|
449
449
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
450
450
|
className: "flex items-center justify-center w-10 h-10 rounded-lg bg-muted/60 shrink-0",
|
|
451
451
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Globe, { className: "w-5 h-5 text-muted-foreground" })
|
|
452
452
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
453
453
|
className: "flex-1 min-w-0",
|
|
454
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
454
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_invect_ui.DialogTitle, {
|
|
455
455
|
className: "text-base",
|
|
456
456
|
children: trigger.name
|
|
457
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
457
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_invect_ui.DialogDescription, {
|
|
458
458
|
className: "flex items-center gap-2 mt-0.5 text-xs",
|
|
459
459
|
children: [
|
|
460
460
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -467,7 +467,7 @@ const WebhookDetailPanel = ({ trigger, flowName, onClose }) => {
|
|
|
467
467
|
})]
|
|
468
468
|
})]
|
|
469
469
|
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
470
|
-
className: "flex gap-1
|
|
470
|
+
className: "flex gap-1 px-6 mt-4 -mx-6 border-b",
|
|
471
471
|
children: [{
|
|
472
472
|
key: "overview",
|
|
473
473
|
label: "Overview"
|
|
@@ -481,7 +481,7 @@ const WebhookDetailPanel = ({ trigger, flowName, onClose }) => {
|
|
|
481
481
|
}, key))
|
|
482
482
|
})]
|
|
483
483
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
484
|
-
className: "flex-1
|
|
484
|
+
className: "flex-1 px-6 pb-6 overflow-y-auto",
|
|
485
485
|
children: section === "overview" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverviewSection, {
|
|
486
486
|
trigger,
|
|
487
487
|
flowName,
|
|
@@ -501,24 +501,24 @@ const OverviewSection = ({ trigger, flowName, onToggleEnabled, onDelete, isToggl
|
|
|
501
501
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
502
502
|
className: "space-y-1",
|
|
503
503
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
504
|
-
className: "text-xs font-medium text-muted-foreground
|
|
504
|
+
className: "text-xs font-medium tracking-wide uppercase text-muted-foreground",
|
|
505
505
|
children: "Webhook URL"
|
|
506
506
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyableField, { value: `/plugins/webhooks/receive/${trigger.webhookPath}` })]
|
|
507
507
|
}),
|
|
508
508
|
trigger.hmacEnabled && trigger.hmacHeaderName && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
509
509
|
className: "space-y-1",
|
|
510
510
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
511
|
-
className: "text-xs font-medium text-muted-foreground
|
|
511
|
+
className: "text-xs font-medium tracking-wide uppercase text-muted-foreground",
|
|
512
512
|
children: "HMAC Authentication"
|
|
513
513
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
514
|
-
className: "rounded-lg
|
|
514
|
+
className: "p-3 space-y-1 border rounded-lg bg-muted/30",
|
|
515
515
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
516
516
|
className: "flex items-center justify-between",
|
|
517
517
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
518
518
|
className: "text-xs text-muted-foreground",
|
|
519
519
|
children: "Signature Header"
|
|
520
520
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
521
|
-
className: "text-sm
|
|
521
|
+
className: "font-mono text-sm",
|
|
522
522
|
children: trigger.hmacHeaderName
|
|
523
523
|
})]
|
|
524
524
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -536,12 +536,12 @@ const OverviewSection = ({ trigger, flowName, onToggleEnabled, onDelete, isToggl
|
|
|
536
536
|
trigger.allowedIps && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
537
537
|
className: "space-y-1",
|
|
538
538
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
539
|
-
className: "text-xs font-medium text-muted-foreground
|
|
539
|
+
className: "text-xs font-medium tracking-wide uppercase text-muted-foreground",
|
|
540
540
|
children: "IP Whitelist"
|
|
541
541
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
542
|
-
className: "rounded-lg
|
|
542
|
+
className: "p-3 border rounded-lg bg-muted/30",
|
|
543
543
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
544
|
-
className: "text-sm
|
|
544
|
+
className: "font-mono text-sm break-all",
|
|
545
545
|
children: trigger.allowedIps
|
|
546
546
|
})
|
|
547
547
|
})]
|
|
@@ -550,21 +550,21 @@ const OverviewSection = ({ trigger, flowName, onToggleEnabled, onDelete, isToggl
|
|
|
550
550
|
className: "grid grid-cols-2 gap-4 py-2",
|
|
551
551
|
children: [
|
|
552
552
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
553
|
-
className: "text-xs text-muted-foreground
|
|
553
|
+
className: "block mb-1 text-xs text-muted-foreground",
|
|
554
554
|
children: "Methods"
|
|
555
555
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
556
|
-
className: "text-sm
|
|
556
|
+
className: "font-mono text-sm",
|
|
557
557
|
children: trigger.allowedMethods
|
|
558
558
|
})] }),
|
|
559
559
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
560
|
-
className: "text-xs text-muted-foreground
|
|
560
|
+
className: "block mb-1 text-xs text-muted-foreground",
|
|
561
561
|
children: "Authentication"
|
|
562
562
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
563
563
|
className: "text-sm",
|
|
564
564
|
children: getAuthModeConfig$1(trigger).label
|
|
565
565
|
})] }),
|
|
566
566
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
567
|
-
className: "text-xs text-muted-foreground
|
|
567
|
+
className: "block mb-1 text-xs text-muted-foreground",
|
|
568
568
|
children: "Created"
|
|
569
569
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
570
570
|
className: "text-sm",
|
|
@@ -601,29 +601,29 @@ const OverviewSection = ({ trigger, flowName, onToggleEnabled, onDelete, isToggl
|
|
|
601
601
|
]
|
|
602
602
|
}),
|
|
603
603
|
trigger.flowId && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
604
|
-
className: "rounded-lg
|
|
604
|
+
className: "p-3 border rounded-lg bg-muted/30",
|
|
605
605
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
606
606
|
className: "flex items-center gap-2",
|
|
607
607
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Workflow, { className: "w-4 h-4 text-muted-foreground shrink-0" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
608
608
|
className: "flex-1 min-w-0",
|
|
609
609
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
610
|
-
className: "text-xs text-muted-foreground
|
|
610
|
+
className: "block text-xs text-muted-foreground",
|
|
611
611
|
children: "Linked Flow"
|
|
612
612
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
613
613
|
href: `/invect/flow/${trigger.flowId}`,
|
|
614
|
-
className: "text-sm font-medium text-primary hover:underline
|
|
614
|
+
className: "inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline",
|
|
615
615
|
children: [flowName ?? trigger.flowId, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ExternalLink, { className: "w-3 h-3" })]
|
|
616
616
|
})]
|
|
617
617
|
})]
|
|
618
618
|
})
|
|
619
619
|
}),
|
|
620
|
-
trigger.lastPayload
|
|
620
|
+
trigger.lastPayload !== null && trigger.lastPayload !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
621
621
|
className: "space-y-1",
|
|
622
622
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
623
|
-
className: "text-xs font-medium text-muted-foreground
|
|
623
|
+
className: "text-xs font-medium tracking-wide uppercase text-muted-foreground",
|
|
624
624
|
children: "Last Payload"
|
|
625
625
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
626
|
-
className: "
|
|
626
|
+
className: "p-3 overflow-auto font-mono text-xs rounded-lg bg-muted max-h-32",
|
|
627
627
|
children: JSON.stringify(trigger.lastPayload, null, 2)
|
|
628
628
|
})]
|
|
629
629
|
}),
|
|
@@ -637,7 +637,7 @@ const OverviewSection = ({ trigger, flowName, onToggleEnabled, onDelete, isToggl
|
|
|
637
637
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
638
638
|
onClick: onDelete,
|
|
639
639
|
disabled: isDeleting,
|
|
640
|
-
className: "inline-flex items-center gap-2
|
|
640
|
+
className: "inline-flex items-center h-8 gap-2 px-3 text-sm font-medium text-imp-destructive transition-colors border border-imp-destructive/30 rounded-md hover:bg-imp-destructive/10",
|
|
641
641
|
children: [isDeleting ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Trash2, { className: "w-3.5 h-3.5" }), "Delete"]
|
|
642
642
|
})]
|
|
643
643
|
})
|
|
@@ -702,7 +702,7 @@ const EditSection = ({ trigger, onSuccess }) => {
|
|
|
702
702
|
})]
|
|
703
703
|
}),
|
|
704
704
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
705
|
-
className: "space-y-3 rounded-lg border
|
|
705
|
+
className: "p-3 space-y-3 border rounded-lg border-border bg-muted/30",
|
|
706
706
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
707
707
|
className: "flex items-center justify-between",
|
|
708
708
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -718,7 +718,7 @@ const EditSection = ({ trigger, onSuccess }) => {
|
|
|
718
718
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform ${hmacEnabled ? "translate-x-4" : "translate-x-0"}` })
|
|
719
719
|
})]
|
|
720
720
|
}), hmacEnabled && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
721
|
-
className: "space-y-3
|
|
721
|
+
className: "pt-1 space-y-3",
|
|
722
722
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
723
723
|
className: "space-y-1.5",
|
|
724
724
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
@@ -808,12 +808,12 @@ const EditSection = ({ trigger, onSuccess }) => {
|
|
|
808
808
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
809
809
|
type: "button",
|
|
810
810
|
onClick: onSuccess,
|
|
811
|
-
className: "inline-flex items-center justify-center
|
|
811
|
+
className: "inline-flex items-center justify-center h-8 px-3 text-sm font-medium transition-colors border rounded-md shadow-xs bg-background hover:bg-accent",
|
|
812
812
|
children: "Cancel"
|
|
813
813
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
814
814
|
type: "submit",
|
|
815
815
|
disabled: !name.trim() || updateMutation.isPending,
|
|
816
|
-
className: "inline-flex items-center justify-center
|
|
816
|
+
className: "inline-flex items-center justify-center h-8 px-3 text-sm font-medium transition-colors rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
|
|
817
817
|
children: updateMutation.isPending ? "Saving…" : "Save Changes"
|
|
818
818
|
})]
|
|
819
819
|
})
|
|
@@ -926,7 +926,7 @@ const WebhooksPage = () => {
|
|
|
926
926
|
const [searchQuery, setSearchQuery] = (0, react.useState)("");
|
|
927
927
|
const [statusFilter, setStatusFilter] = (0, react.useState)("all");
|
|
928
928
|
const { data: triggers, isLoading, error } = useWebhookTriggers();
|
|
929
|
-
const { data: flowsResponse } = (0,
|
|
929
|
+
const { data: flowsResponse } = (0, _invect_ui.useFlows)();
|
|
930
930
|
const flowNameMap = /* @__PURE__ */ new Map();
|
|
931
931
|
for (const flow of flowsResponse?.data ?? []) flowNameMap.set(flow.id, flow.name);
|
|
932
932
|
const filtered = (triggers ?? []).filter((t) => {
|
|
@@ -943,7 +943,7 @@ const WebhooksPage = () => {
|
|
|
943
943
|
const enabledCount = (triggers ?? []).filter((t) => t.isEnabled).length;
|
|
944
944
|
const disabledCount = (triggers ?? []).filter((t) => !t.isEnabled).length;
|
|
945
945
|
const liveTrigger = selectedTrigger ? (triggers ?? []).find((t) => t.id === selectedTrigger.id) ?? selectedTrigger : null;
|
|
946
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
946
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_invect_ui.PageLayout, {
|
|
947
947
|
title: "Webhooks",
|
|
948
948
|
subtitle: "Receive events from external systems and route them into your flows.",
|
|
949
949
|
icon: lucide_react.Globe,
|
|
@@ -1026,12 +1026,12 @@ const WebhooksPage = () => {
|
|
|
1026
1026
|
})
|
|
1027
1027
|
})]
|
|
1028
1028
|
}),
|
|
1029
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1029
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_invect_ui.Dialog, {
|
|
1030
1030
|
open: !!selectedTrigger,
|
|
1031
1031
|
onOpenChange: (open) => {
|
|
1032
1032
|
if (!open) setSelectedTrigger(null);
|
|
1033
1033
|
},
|
|
1034
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1034
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_invect_ui.DialogContent, {
|
|
1035
1035
|
container: containerRef.current,
|
|
1036
1036
|
className: "max-w-2xl h-[32rem] flex flex-col gap-0 p-0 overflow-hidden",
|
|
1037
1037
|
showCloseButton: true,
|
|
@@ -1056,7 +1056,7 @@ const WebhooksPage = () => {
|
|
|
1056
1056
|
* Webhooks Frontend Plugin — registers the sidebar item and route
|
|
1057
1057
|
* for webhook management.
|
|
1058
1058
|
*/
|
|
1059
|
-
const
|
|
1059
|
+
const webhooksFrontend = {
|
|
1060
1060
|
id: "webhooks",
|
|
1061
1061
|
name: "Webhooks",
|
|
1062
1062
|
sidebar: [{
|
|
@@ -1182,6 +1182,6 @@ exports.useUpdateWebhookTrigger = useUpdateWebhookTrigger;
|
|
|
1182
1182
|
exports.useWebhookTrigger = useWebhookTrigger;
|
|
1183
1183
|
exports.useWebhookTriggerInfo = useWebhookTriggerInfo;
|
|
1184
1184
|
exports.useWebhookTriggers = useWebhookTriggers;
|
|
1185
|
-
exports.
|
|
1185
|
+
exports.webhooksFrontend = webhooksFrontend;
|
|
1186
1186
|
|
|
1187
1187
|
//# sourceMappingURL=index.cjs.map
|