@marinoscar/platform-web 0.1.0-next.19 → 0.1.0-next.21
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/CHANGELOG.md +21 -0
- package/README.md +5 -3
- package/dist/alerts/headless/client.d.ts +134 -0
- package/dist/alerts/headless/client.d.ts.map +1 -0
- package/dist/alerts/headless/client.js +105 -0
- package/dist/alerts/headless/client.js.map +1 -0
- package/dist/alerts/headless/format.d.ts +95 -0
- package/dist/alerts/headless/format.d.ts.map +1 -0
- package/dist/alerts/headless/format.js +164 -0
- package/dist/alerts/headless/format.js.map +1 -0
- package/dist/alerts/headless/hooks.d.ts +245 -0
- package/dist/alerts/headless/hooks.d.ts.map +1 -0
- package/dist/alerts/headless/hooks.js +315 -0
- package/dist/alerts/headless/hooks.js.map +1 -0
- package/dist/alerts/headless/index.d.ts +9 -0
- package/dist/alerts/headless/index.d.ts.map +1 -0
- package/dist/alerts/headless/index.js +9 -0
- package/dist/alerts/headless/index.js.map +1 -0
- package/dist/alerts/headless/rule-draft.d.ts +175 -0
- package/dist/alerts/headless/rule-draft.d.ts.map +1 -0
- package/dist/alerts/headless/rule-draft.js +261 -0
- package/dist/alerts/headless/rule-draft.js.map +1 -0
- package/dist/alerts/ui/AlertIncidentDrawer.d.ts +30 -0
- package/dist/alerts/ui/AlertIncidentDrawer.d.ts.map +1 -0
- package/dist/alerts/ui/AlertIncidentDrawer.js +33 -0
- package/dist/alerts/ui/AlertIncidentDrawer.js.map +1 -0
- package/dist/alerts/ui/AlertRuleDialog.d.ts +47 -0
- package/dist/alerts/ui/AlertRuleDialog.d.ts.map +1 -0
- package/dist/alerts/ui/AlertRuleDialog.js +124 -0
- package/dist/alerts/ui/AlertRuleDialog.js.map +1 -0
- package/dist/alerts/ui/AlertRuleTestResult.d.ts +23 -0
- package/dist/alerts/ui/AlertRuleTestResult.d.ts.map +1 -0
- package/dist/alerts/ui/AlertRuleTestResult.js +30 -0
- package/dist/alerts/ui/AlertRuleTestResult.js.map +1 -0
- package/dist/alerts/ui/AlertsPage.d.ts +41 -0
- package/dist/alerts/ui/AlertsPage.d.ts.map +1 -0
- package/dist/alerts/ui/AlertsPage.js +238 -0
- package/dist/alerts/ui/AlertsPage.js.map +1 -0
- package/dist/alerts/ui/FiringAlertsBanner.d.ts +28 -0
- package/dist/alerts/ui/FiringAlertsBanner.d.ts.map +1 -0
- package/dist/alerts/ui/FiringAlertsBanner.js +45 -0
- package/dist/alerts/ui/FiringAlertsBanner.js.map +1 -0
- package/dist/alerts/ui/copy.d.ts +15 -0
- package/dist/alerts/ui/copy.d.ts.map +1 -0
- package/dist/alerts/ui/copy.js +14 -0
- package/dist/alerts/ui/copy.js.map +1 -0
- package/dist/alerts/ui/index.d.ts +14 -0
- package/dist/alerts/ui/index.d.ts.map +1 -0
- package/dist/alerts/ui/index.js +12 -0
- package/dist/alerts/ui/index.js.map +1 -0
- package/dist/alerts/ui/parts.d.ts +26 -0
- package/dist/alerts/ui/parts.d.ts.map +1 -0
- package/dist/alerts/ui/parts.js +27 -0
- package/dist/alerts/ui/parts.js.map +1 -0
- package/dist/alerts/ui/settings.d.ts +27 -0
- package/dist/alerts/ui/settings.d.ts.map +1 -0
- package/dist/alerts/ui/settings.js +37 -0
- package/dist/alerts/ui/settings.js.map +1 -0
- package/dist/nodes/headless/api.d.ts +3 -1
- package/dist/nodes/headless/api.d.ts.map +1 -1
- package/dist/nodes/headless/api.js +22 -0
- package/dist/nodes/headless/api.js.map +1 -1
- package/dist/nodes/headless/index.d.ts +7 -2
- package/dist/nodes/headless/index.d.ts.map +1 -1
- package/dist/nodes/headless/index.js +4 -1
- package/dist/nodes/headless/index.js.map +1 -1
- package/dist/nodes/headless/node-events.d.ts +43 -0
- package/dist/nodes/headless/node-events.d.ts.map +1 -0
- package/dist/nodes/headless/node-events.js +150 -0
- package/dist/nodes/headless/node-events.js.map +1 -0
- package/dist/nodes/headless/power.d.ts +43 -0
- package/dist/nodes/headless/power.d.ts.map +1 -0
- package/dist/nodes/headless/power.js +74 -0
- package/dist/nodes/headless/power.js.map +1 -0
- package/dist/nodes/headless/types.d.ts +40 -3
- package/dist/nodes/headless/types.d.ts.map +1 -1
- package/dist/nodes/headless/types.js +1 -1
- package/dist/nodes/headless/types.js.map +1 -1
- package/dist/nodes/headless/use-node-events.d.ts +59 -0
- package/dist/nodes/headless/use-node-events.d.ts.map +1 -0
- package/dist/nodes/headless/use-node-events.js +159 -0
- package/dist/nodes/headless/use-node-events.js.map +1 -0
- package/dist/nodes/ui/NodeEventsTimeline.d.ts +39 -0
- package/dist/nodes/ui/NodeEventsTimeline.d.ts.map +1 -0
- package/dist/nodes/ui/NodeEventsTimeline.js +63 -0
- package/dist/nodes/ui/NodeEventsTimeline.js.map +1 -0
- package/dist/nodes/ui/NodePowerBadge.d.ts +27 -0
- package/dist/nodes/ui/NodePowerBadge.d.ts.map +1 -0
- package/dist/nodes/ui/NodePowerBadge.js +48 -0
- package/dist/nodes/ui/NodePowerBadge.js.map +1 -0
- package/dist/nodes/ui/NodeVitalsDialog.d.ts +11 -1
- package/dist/nodes/ui/NodeVitalsDialog.d.ts.map +1 -1
- package/dist/nodes/ui/NodeVitalsDialog.js +14 -5
- package/dist/nodes/ui/NodeVitalsDialog.js.map +1 -1
- package/dist/nodes/ui/WorkersPage.d.ts.map +1 -1
- package/dist/nodes/ui/WorkersPage.js +2 -1
- package/dist/nodes/ui/WorkersPage.js.map +1 -1
- package/dist/nodes/ui/workerVitals.d.ts +17 -1
- package/dist/nodes/ui/workerVitals.d.ts.map +1 -1
- package/dist/nodes/ui/workerVitals.js +43 -0
- package/dist/nodes/ui/workerVitals.js.map +1 -1
- package/dist/nodes/ui/workersTable.d.ts.map +1 -1
- package/dist/nodes/ui/workersTable.js +2 -1
- package/dist/nodes/ui/workersTable.js.map +1 -1
- package/dist/telemetry/headless/hooks/useTelemetryDashboard.d.ts +1 -1
- package/dist/telemetry/ui/components/dashboard/metrics/MetricSections.d.ts +11 -0
- package/dist/telemetry/ui/components/dashboard/metrics/MetricSections.d.ts.map +1 -1
- package/dist/telemetry/ui/components/dashboard/metrics/MetricSections.js +17 -2
- package/dist/telemetry/ui/components/dashboard/metrics/MetricSections.js.map +1 -1
- package/dist/webhooks/headless/client.d.ts +101 -0
- package/dist/webhooks/headless/client.d.ts.map +1 -0
- package/dist/webhooks/headless/client.js +105 -0
- package/dist/webhooks/headless/client.js.map +1 -0
- package/dist/webhooks/headless/event-selection.d.ts +119 -0
- package/dist/webhooks/headless/event-selection.d.ts.map +1 -0
- package/dist/webhooks/headless/event-selection.js +225 -0
- package/dist/webhooks/headless/event-selection.js.map +1 -0
- package/dist/webhooks/headless/format.d.ts +84 -0
- package/dist/webhooks/headless/format.d.ts.map +1 -0
- package/dist/webhooks/headless/format.js +142 -0
- package/dist/webhooks/headless/format.js.map +1 -0
- package/dist/webhooks/headless/hooks.d.ts +199 -0
- package/dist/webhooks/headless/hooks.d.ts.map +1 -0
- package/dist/webhooks/headless/hooks.js +249 -0
- package/dist/webhooks/headless/hooks.js.map +1 -0
- package/dist/webhooks/headless/index.d.ts +9 -0
- package/dist/webhooks/headless/index.d.ts.map +1 -0
- package/dist/webhooks/headless/index.js +9 -0
- package/dist/webhooks/headless/index.js.map +1 -0
- package/dist/webhooks/ui/WebhookDeliveryDrawer.d.ts +32 -0
- package/dist/webhooks/ui/WebhookDeliveryDrawer.d.ts.map +1 -0
- package/dist/webhooks/ui/WebhookDeliveryDrawer.js +64 -0
- package/dist/webhooks/ui/WebhookDeliveryDrawer.js.map +1 -0
- package/dist/webhooks/ui/WebhookEndpointDetail.d.ts +21 -0
- package/dist/webhooks/ui/WebhookEndpointDetail.d.ts.map +1 -0
- package/dist/webhooks/ui/WebhookEndpointDetail.js +96 -0
- package/dist/webhooks/ui/WebhookEndpointDetail.js.map +1 -0
- package/dist/webhooks/ui/WebhookEndpointDialog.d.ts +39 -0
- package/dist/webhooks/ui/WebhookEndpointDialog.d.ts.map +1 -0
- package/dist/webhooks/ui/WebhookEndpointDialog.js +79 -0
- package/dist/webhooks/ui/WebhookEndpointDialog.js.map +1 -0
- package/dist/webhooks/ui/WebhookEventPicker.d.ts +30 -0
- package/dist/webhooks/ui/WebhookEventPicker.d.ts.map +1 -0
- package/dist/webhooks/ui/WebhookEventPicker.js +33 -0
- package/dist/webhooks/ui/WebhookEventPicker.js.map +1 -0
- package/dist/webhooks/ui/WebhookSecretDialog.d.ts +27 -0
- package/dist/webhooks/ui/WebhookSecretDialog.d.ts.map +1 -0
- package/dist/webhooks/ui/WebhookSecretDialog.js +52 -0
- package/dist/webhooks/ui/WebhookSecretDialog.js.map +1 -0
- package/dist/webhooks/ui/WebhookSignatureHelp.d.ts +18 -0
- package/dist/webhooks/ui/WebhookSignatureHelp.d.ts.map +1 -0
- package/dist/webhooks/ui/WebhookSignatureHelp.js +40 -0
- package/dist/webhooks/ui/WebhookSignatureHelp.js.map +1 -0
- package/dist/webhooks/ui/WebhooksPage.d.ts +47 -0
- package/dist/webhooks/ui/WebhooksPage.d.ts.map +1 -0
- package/dist/webhooks/ui/WebhooksPage.js +172 -0
- package/dist/webhooks/ui/WebhooksPage.js.map +1 -0
- package/dist/webhooks/ui/copy.d.ts +24 -0
- package/dist/webhooks/ui/copy.d.ts.map +1 -0
- package/dist/webhooks/ui/copy.js +34 -0
- package/dist/webhooks/ui/copy.js.map +1 -0
- package/dist/webhooks/ui/index.d.ts +15 -0
- package/dist/webhooks/ui/index.d.ts.map +1 -0
- package/dist/webhooks/ui/index.js +12 -0
- package/dist/webhooks/ui/index.js.map +1 -0
- package/dist/webhooks/ui/parts.d.ts +25 -0
- package/dist/webhooks/ui/parts.d.ts.map +1 -0
- package/dist/webhooks/ui/parts.js +28 -0
- package/dist/webhooks/ui/parts.js.map +1 -0
- package/dist/webhooks/ui/settings.d.ts +58 -0
- package/dist/webhooks/ui/settings.d.ts.map +1 -0
- package/dist/webhooks/ui/settings.js +79 -0
- package/dist/webhooks/ui/settings.js.map +1 -0
- package/package.json +18 -2
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// The signing secret, shown once (issue #1046)
|
|
4
|
+
// =============================================================================
|
|
5
|
+
//
|
|
6
|
+
// The same arrangement as the node credential and personal access token
|
|
7
|
+
// reveal dialogs: a warning first, a read-only monospace field with a copy
|
|
8
|
+
// button, one "Done". The API stores the secret in the credentials store and
|
|
9
|
+
// never returns it again, so the copy states the consequence plainly. The
|
|
10
|
+
// secret lives in the page's state only while this dialog is open.
|
|
11
|
+
// =============================================================================
|
|
12
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
13
|
+
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
|
|
14
|
+
import { Alert, Box, Button, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, InputAdornment, TextField, Tooltip, Typography, } from '@mui/material';
|
|
15
|
+
import { useState } from 'react';
|
|
16
|
+
import { formatDateTime, useDisplayTimeZone } from '../../core/index.js';
|
|
17
|
+
/**
|
|
18
|
+
* The one-time display of a webhook signing secret, with a copy button.
|
|
19
|
+
*
|
|
20
|
+
* @param props - see {@link WebhookSecretDialogProps}.
|
|
21
|
+
* @returns the dialog.
|
|
22
|
+
*
|
|
23
|
+
* @extensionPoint component
|
|
24
|
+
* @stability experimental
|
|
25
|
+
*/
|
|
26
|
+
export function WebhookSecretDialog({ secret, reason, previousSecretValidUntil, onClose }) {
|
|
27
|
+
useDisplayTimeZone();
|
|
28
|
+
const [copied, setCopied] = useState(false);
|
|
29
|
+
const copy = async () => {
|
|
30
|
+
if (!secret)
|
|
31
|
+
return;
|
|
32
|
+
try {
|
|
33
|
+
await navigator.clipboard.writeText(secret);
|
|
34
|
+
setCopied(true);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// Clipboard denied: the field stays complete and selectable.
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const close = () => {
|
|
41
|
+
setCopied(false);
|
|
42
|
+
onClose();
|
|
43
|
+
};
|
|
44
|
+
return (_jsxs(Dialog, { open: secret !== null, onClose: close, maxWidth: "sm", fullWidth: true, "aria-labelledby": "webhook-secret-title", children: [_jsx(DialogTitle, { id: "webhook-secret-title", children: reason === 'created' ? 'Endpoint created' : 'Secret rotated' }), _jsx(DialogContent, { children: _jsxs(Box, { sx: { pt: 1 }, children: [_jsx(Alert, { severity: "warning", sx: { mb: 2 }, children: "Copy this signing secret now. You won't see it again: if you lose it, rotate the secret to get a new one." }), _jsx(TextField, { label: "Signing secret", value: secret ?? '', fullWidth: true, slotProps: {
|
|
45
|
+
input: {
|
|
46
|
+
readOnly: true,
|
|
47
|
+
sx: { fontFamily: 'monospace' },
|
|
48
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(Tooltip, { title: copied ? 'Copied' : 'Copy secret', children: _jsx(IconButton, { onClick: () => void copy(), edge: "end", "aria-label": "Copy signing secret", sx: { width: 44, height: 44 }, children: copied ? _jsx(CheckIcon, { color: "success" }) : _jsx(ContentCopyIcon, {}) }) }) })),
|
|
49
|
+
},
|
|
50
|
+
} }), copied ? (_jsx(Alert, { severity: "success", sx: { mt: 1 }, children: "Secret copied to the clipboard" })) : null, _jsxs(Typography, { variant: "body2", color: "text.secondary", sx: { mt: 2 }, children: ["Your receiver uses it to verify the ", _jsx("code", { children: "webhook-signature" }), " header of every delivery."] }), reason === 'rotated' && previousSecretValidUntil ? (_jsxs(Typography, { variant: "body2", color: "text.secondary", sx: { mt: 1 }, children: ["Deliveries are signed with both the old and the new secret until ", formatDateTime(previousSecretValidUntil), ". Update your receiver before then."] })) : null] }) }), _jsx(DialogActions, { children: _jsx(Button, { variant: "contained", onClick: close, sx: { minHeight: 44 }, children: "Done" }) })] }));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=WebhookSecretDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookSecretD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CAAC,CAAC,IAAI,EACR,MAAC,UAAU,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,gBAAgB,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,qDAC1B,+CAA8B,kCACvD,EACZ,MAAM,KAAK,SAAS,IAAI,wBAAwB,CAAC,CAAC,CAAC,CAClD,MAAC,UAAU,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,gBAAgB,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,kFACI,cAAc,CAAC,wBAAwB,CAAC,2CAE/F,CACd,CAAC,CAAC,CAAC,IAAI,IACJ,GACQ,EAChB,KAAC,aAAa,cACZ,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,qBAExD,GACK,IACT,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The Node snippet the help panel shows: verify a delivery with
|
|
4
|
+
* `verifyWebhookSignature` from `@marinoscar/platform-contract/webhooks`.
|
|
5
|
+
*
|
|
6
|
+
* @stability experimental
|
|
7
|
+
*/
|
|
8
|
+
export declare const WEBHOOK_VERIFY_SNIPPET: string;
|
|
9
|
+
/**
|
|
10
|
+
* The collapsible "Verifying signatures" help panel.
|
|
11
|
+
*
|
|
12
|
+
* @returns the panel.
|
|
13
|
+
*
|
|
14
|
+
* @extensionPoint component
|
|
15
|
+
* @stability experimental
|
|
16
|
+
*/
|
|
17
|
+
export declare function WebhookSignatureHelp(): ReactElement;
|
|
18
|
+
//# sourceMappingURL=WebhookSignatureHelp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookSignatureHelp.d.ts","sourceRoot":"","sources":["../../../src/webhooks/ui/WebhookSignatureHelp.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,QAe/B,CAAC;AAEL;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,YAAY,CA8BnD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// "Verifying signatures" (issue #1046): how a receiver checks a delivery,
|
|
3
|
+
// with the contract's own helper. Static text; nothing is sent anywhere.
|
|
4
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
5
|
+
import { Accordion, AccordionDetails, AccordionSummary, Box, Typography } from '@mui/material';
|
|
6
|
+
import { WEBHOOK_HEADERS } from '@marinoscar/platform-contract/webhooks';
|
|
7
|
+
/**
|
|
8
|
+
* The Node snippet the help panel shows: verify a delivery with
|
|
9
|
+
* `verifyWebhookSignature` from `@marinoscar/platform-contract/webhooks`.
|
|
10
|
+
*
|
|
11
|
+
* @stability experimental
|
|
12
|
+
*/
|
|
13
|
+
export const WEBHOOK_VERIFY_SNIPPET = `import { verifyWebhookSignature } from '@marinoscar/platform-contract/webhooks';
|
|
14
|
+
|
|
15
|
+
// Read the RAW body: verify before parsing JSON.
|
|
16
|
+
app.post('/hook', express.raw({ type: 'application/json' }), async (req, res) => {
|
|
17
|
+
const ok = await verifyWebhookSignature({
|
|
18
|
+
secret: process.env.WEBHOOK_SECRET, // whsec_...
|
|
19
|
+
id: req.get('${WEBHOOK_HEADERS.ID}'),
|
|
20
|
+
timestamp: req.get('${WEBHOOK_HEADERS.TIMESTAMP}'),
|
|
21
|
+
signatureHeader: req.get('${WEBHOOK_HEADERS.SIGNATURE}'),
|
|
22
|
+
body: req.body.toString('utf8'),
|
|
23
|
+
});
|
|
24
|
+
if (!ok) return res.status(401).end();
|
|
25
|
+
const event = JSON.parse(req.body.toString('utf8'));
|
|
26
|
+
// Deduplicate on event.id: a retry carries the same id.
|
|
27
|
+
res.status(204).end();
|
|
28
|
+
});`;
|
|
29
|
+
/**
|
|
30
|
+
* The collapsible "Verifying signatures" help panel.
|
|
31
|
+
*
|
|
32
|
+
* @returns the panel.
|
|
33
|
+
*
|
|
34
|
+
* @extensionPoint component
|
|
35
|
+
* @stability experimental
|
|
36
|
+
*/
|
|
37
|
+
export function WebhookSignatureHelp() {
|
|
38
|
+
return (_jsxs(Accordion, { variant: "outlined", disableGutters: true, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, {}), "aria-controls": "webhook-signature-help", id: "webhook-signature-help-header", children: _jsx(Typography, { variant: "subtitle1", component: "h2", children: "Verifying signatures" }) }), _jsxs(AccordionDetails, { id: "webhook-signature-help", children: [_jsxs(Typography, { variant: "body2", sx: { mb: 1 }, children: ["Every delivery carries ", _jsx("code", { children: WEBHOOK_HEADERS.ID }), ", ", _jsx("code", { children: WEBHOOK_HEADERS.TIMESTAMP }), " and", ' ', _jsx("code", { children: WEBHOOK_HEADERS.SIGNATURE }), " headers (the Standard Webhooks scheme): an HMAC-SHA256 of", ' ', _jsx("code", { children: 'id.timestamp.body' }), " made with the endpoint's signing secret. While a rotated secret is still accepted, the signature header holds two entries; accept either."] }), _jsx(Typography, { variant: "body2", sx: { mb: 1 }, children: "Reject a delivery whose signature does not verify or whose timestamp is more than five minutes old, and deduplicate on the event id, which stays the same across retries." }), _jsx(Box, { component: "pre", "aria-label": "Signature verification example", tabIndex: 0, sx: { m: 0, p: 1.5, bgcolor: 'action.hover', borderRadius: 1, fontFamily: 'monospace', fontSize: 13, overflowX: 'auto' }, children: WEBHOOK_VERIFY_SNIPPET })] })] }));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=WebhookSignatureHelp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookSignatureHelp.js","sourceRoot":"","sources":["../../../src/webhooks/ui/WebhookSignatureHelp.tsx"],"names":[],"mappings":";AAA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,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,YAEvH,sBAAsB,GACnB,IACW,IACT,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { WebhookDelivery, WebhookScope } from '@marinoscar/platform-contract/webhooks';
|
|
3
|
+
import type { PageSlotsBase, TableSlots } from '../../core/index.js';
|
|
4
|
+
import { type DataTableColumn } from '../../datatable/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* The slots of {@link WebhooksPage}: the page-slot contract
|
|
7
|
+
* ({@link PageSlotsBase}) plus the deliveries table's slots (`Columns`,
|
|
8
|
+
* `RowActions`, `DetailPanel`, `Toolbar`), applied to an endpoint's
|
|
9
|
+
* deliveries.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <WebhooksPage scope="org" slots={{ BeforeContent: ReceiverPolicyNotice }} />
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @extensionPoint slot
|
|
17
|
+
* @stability experimental
|
|
18
|
+
*/
|
|
19
|
+
export interface WebhooksPageSlots extends PageSlotsBase, TableSlots<WebhookDelivery, DataTableColumn<WebhookDelivery>> {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Props of {@link WebhooksPage}.
|
|
23
|
+
*
|
|
24
|
+
* @stability experimental
|
|
25
|
+
*/
|
|
26
|
+
export interface WebhooksPageProps {
|
|
27
|
+
/** Which endpoints the page manages: the caller's (`user`), the organization's (`org`) or the deployment's (`system`). */
|
|
28
|
+
scope: WebhookScope;
|
|
29
|
+
/** Optional extension slots; omitted, the page renders exactly its own markup. */
|
|
30
|
+
slots?: WebhooksPageSlots;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The webhooks page of one scope.
|
|
34
|
+
*
|
|
35
|
+
* @param props - see {@link WebhooksPageProps}.
|
|
36
|
+
* @returns the page.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <Route path="/settings/webhooks" element={<WebhooksPage scope="user" />} />
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @extensionPoint component
|
|
44
|
+
* @stability experimental
|
|
45
|
+
*/
|
|
46
|
+
export declare function WebhooksPage({ scope, slots }: WebhooksPageProps): ReactElement;
|
|
47
|
+
//# sourceMappingURL=WebhooksPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhooksPage.d.ts","sourceRoot":"","sources":["../../../src/webhooks/ui/WebhooksPage.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAkC,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,KAAK,EAGV,eAAe,EAGf,YAAY,EACb,MAAM,wCAAwC,CAAC;AAGhD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAa,KAAK,eAAe,EAA2B,MAAM,0BAA0B,CAAC;AAmBpG;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa,EAAE,UAAU,CAAC,eAAe,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAAG;AAE1H;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,0HAA0H;IAC1H,KAAK,EAAE,YAAY,CAAC;IACpB,kFAAkF;IAClF,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B;AAWD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,iBAAiB,GAAG,YAAY,CA+R9E"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// WebhooksPage (issue #1046): one page, three scopes
|
|
4
|
+
// =============================================================================
|
|
5
|
+
//
|
|
6
|
+
// `scope="user"` at `/settings/webhooks` (the caller's own endpoints),
|
|
7
|
+
// `scope="org"` at `/admin/settings/organization-webhooks` (the organization's)
|
|
8
|
+
// and `scope="system"` at `/admin/settings/webhooks` (the deployment's). The
|
|
9
|
+
// list of endpoints, the detail of one with its deliveries, and every write
|
|
10
|
+
// (create, edit, send a test, rotate the secret, delete, redeliver). Write
|
|
11
|
+
// controls are drawn only for a viewer holding the scope's `:write`
|
|
12
|
+
// permission; the API enforces it either way.
|
|
13
|
+
// =============================================================================
|
|
14
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
15
|
+
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
16
|
+
import { Alert, Box, Button, Card, CardContent, Container, Link, Stack, Typography, } from '@mui/material';
|
|
17
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
18
|
+
import { PageSlotsFrame, useDisplayTimeZone, usePlatformViewer } from '../../core/index.js';
|
|
19
|
+
import { DataTable } from '../../datatable/index.js';
|
|
20
|
+
import { WEBHOOK_ALL_EVENTS, WEBHOOK_SCOPE_PERMISSIONS, useWebhookEndpoint, useWebhookEndpoints, useWebhookEventCatalog, useWebhookMutations, webhookEndpointStatus, webhookUrlHost, } from '../headless/index.js';
|
|
21
|
+
import { WEBHOOK_ROTATION_OVERLAP_HOURS, WEBHOOKS_PAGE_COPY } from './copy.js';
|
|
22
|
+
import { ConfirmDialog, EndpointStatusChip, when } from './parts.js';
|
|
23
|
+
import { WebhookDeliveryDrawer } from './WebhookDeliveryDrawer.js';
|
|
24
|
+
import { WebhookEndpointDetail } from './WebhookEndpointDetail.js';
|
|
25
|
+
import { WebhookEndpointDialog } from './WebhookEndpointDialog.js';
|
|
26
|
+
import { WebhookSecretDialog } from './WebhookSecretDialog.js';
|
|
27
|
+
import { WebhookSignatureHelp } from './WebhookSignatureHelp.js';
|
|
28
|
+
function eventsSummary(endpoint) {
|
|
29
|
+
if (endpoint.eventKeys.includes(WEBHOOK_ALL_EVENTS))
|
|
30
|
+
return 'All events';
|
|
31
|
+
const count = endpoint.eventKeys.length;
|
|
32
|
+
return count === 1 ? '1 event' : `${count} events`;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The webhooks page of one scope.
|
|
36
|
+
*
|
|
37
|
+
* @param props - see {@link WebhooksPageProps}.
|
|
38
|
+
* @returns the page.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <Route path="/settings/webhooks" element={<WebhooksPage scope="user" />} />
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @extensionPoint component
|
|
46
|
+
* @stability experimental
|
|
47
|
+
*/
|
|
48
|
+
export function WebhooksPage({ scope, slots }) {
|
|
49
|
+
useDisplayTimeZone();
|
|
50
|
+
const copy = WEBHOOKS_PAGE_COPY[scope];
|
|
51
|
+
const viewer = usePlatformViewer();
|
|
52
|
+
const canWrite = viewer.hasPermission(WEBHOOK_SCOPE_PERMISSIONS[scope].write);
|
|
53
|
+
const { endpoints, isLoading, error, refresh } = useWebhookEndpoints(scope);
|
|
54
|
+
const [selectedId, setSelectedId] = useState(null);
|
|
55
|
+
const selected = useWebhookEndpoint(scope, selectedId);
|
|
56
|
+
const mutations = useWebhookMutations(scope);
|
|
57
|
+
const [editing, setEditing] = useState(null);
|
|
58
|
+
const catalog = useWebhookEventCatalog(scope, { enabled: canWrite && editing !== null });
|
|
59
|
+
const [secret, setSecret] = useState(null);
|
|
60
|
+
const [confirm, setConfirm] = useState(null);
|
|
61
|
+
const [deliveryId, setDeliveryId] = useState(null);
|
|
62
|
+
const [reloadKey, setReloadKey] = useState(0);
|
|
63
|
+
const [notice, setNotice] = useState(null);
|
|
64
|
+
const resetMutations = mutations.reset;
|
|
65
|
+
const open = useCallback((id) => {
|
|
66
|
+
setNotice(null);
|
|
67
|
+
resetMutations();
|
|
68
|
+
setSelectedId(id);
|
|
69
|
+
}, [resetMutations]);
|
|
70
|
+
const back = () => {
|
|
71
|
+
setSelectedId(null);
|
|
72
|
+
setNotice(null);
|
|
73
|
+
mutations.reset();
|
|
74
|
+
void refresh();
|
|
75
|
+
};
|
|
76
|
+
const save = async (input) => {
|
|
77
|
+
if (editing === 'new') {
|
|
78
|
+
const created = await mutations.create(input);
|
|
79
|
+
if (!created)
|
|
80
|
+
return;
|
|
81
|
+
setEditing(null);
|
|
82
|
+
setSecret({ secret: created.secret, reason: 'created' });
|
|
83
|
+
await refresh();
|
|
84
|
+
setSelectedId(created.endpoint.id);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (!editing)
|
|
88
|
+
return;
|
|
89
|
+
const patch = {
|
|
90
|
+
name: input.name,
|
|
91
|
+
url: input.url,
|
|
92
|
+
description: input.description ?? null,
|
|
93
|
+
eventKeys: input.eventKeys,
|
|
94
|
+
...(input.enabled === undefined ? {} : { enabled: input.enabled }),
|
|
95
|
+
};
|
|
96
|
+
const updated = await mutations.update(editing.id, patch);
|
|
97
|
+
if (!updated)
|
|
98
|
+
return;
|
|
99
|
+
setEditing(null);
|
|
100
|
+
await selected.refresh();
|
|
101
|
+
};
|
|
102
|
+
const sendTest = async () => {
|
|
103
|
+
if (!selectedId)
|
|
104
|
+
return;
|
|
105
|
+
setNotice(null);
|
|
106
|
+
const result = await mutations.sendTest(selectedId);
|
|
107
|
+
if (!result)
|
|
108
|
+
return;
|
|
109
|
+
setNotice('Test event queued. It appears in the deliveries below within a few seconds.');
|
|
110
|
+
setReloadKey((key) => key + 1);
|
|
111
|
+
};
|
|
112
|
+
const rotate = async () => {
|
|
113
|
+
if (!selectedId)
|
|
114
|
+
return;
|
|
115
|
+
const result = await mutations.rotateSecret(selectedId);
|
|
116
|
+
setConfirm(null);
|
|
117
|
+
if (!result)
|
|
118
|
+
return;
|
|
119
|
+
setSecret({ secret: result.secret, reason: 'rotated', previousSecretValidUntil: result.previousSecretValidUntil });
|
|
120
|
+
await selected.refresh();
|
|
121
|
+
};
|
|
122
|
+
const remove = async () => {
|
|
123
|
+
if (!selectedId)
|
|
124
|
+
return;
|
|
125
|
+
const ok = await mutations.remove(selectedId);
|
|
126
|
+
setConfirm(null);
|
|
127
|
+
if (!ok)
|
|
128
|
+
return;
|
|
129
|
+
setSelectedId(null);
|
|
130
|
+
setNotice('Endpoint deleted.');
|
|
131
|
+
await refresh();
|
|
132
|
+
};
|
|
133
|
+
const redeliver = async (delivery) => {
|
|
134
|
+
const ok = await mutations.redeliver(delivery.id);
|
|
135
|
+
if (ok)
|
|
136
|
+
setReloadKey((key) => key + 1);
|
|
137
|
+
return ok;
|
|
138
|
+
};
|
|
139
|
+
const columns = useMemo(() => [
|
|
140
|
+
{
|
|
141
|
+
id: 'name',
|
|
142
|
+
label: 'Name',
|
|
143
|
+
priority: 'primary',
|
|
144
|
+
value: (row) => row.name,
|
|
145
|
+
render: (row) => (_jsx(Link, { component: "button", type: "button", variant: "body2", onClick: () => open(row.id), sx: { textAlign: 'left', fontWeight: 600 }, children: row.name })),
|
|
146
|
+
},
|
|
147
|
+
{ id: 'host', label: 'URL host', priority: 'primary', value: (row) => webhookUrlHost(row.url) },
|
|
148
|
+
{ id: 'events', label: 'Events', priority: 'secondary', value: (row) => eventsSummary(row) },
|
|
149
|
+
{
|
|
150
|
+
id: 'status',
|
|
151
|
+
label: 'Status',
|
|
152
|
+
priority: 'secondary',
|
|
153
|
+
value: (row) => webhookEndpointStatus(row).label,
|
|
154
|
+
render: (row) => _jsx(EndpointStatusChip, { endpoint: row }),
|
|
155
|
+
},
|
|
156
|
+
{ id: 'lastSuccessAt', label: 'Last success', priority: 'detail', value: (row) => when(row.lastSuccessAt) },
|
|
157
|
+
], [open]);
|
|
158
|
+
const rowActions = useMemo(() => [{ id: 'open', label: 'Open endpoint', icon: _jsx(ChevronRightIcon, {}), onClick: (row) => open(row.id) }], [open]);
|
|
159
|
+
const endpoint = selectedId ? selected.endpoint : null;
|
|
160
|
+
const pageError = error ?? (selectedId ? selected.error : null);
|
|
161
|
+
return (_jsxs(Container, { maxWidth: "lg", children: [_jsx(Box, { sx: { py: { xs: 2, sm: 4 } }, children: _jsxs(PageSlotsFrame, { slots: slots, headerProps: { title: copy.title, description: copy.description, readOnly: !canWrite, actions: null }, header: _jsxs(_Fragment, { children: [_jsxs(Typography, { variant: "h4", component: "h1", gutterBottom: true, children: [copy.title, canWrite ? null : ' (read-only)'] }), _jsx(Typography, { color: "text.secondary", sx: { mb: 3 }, children: copy.description })] }), children: [pageError ? (_jsx(Alert, { severity: "error", sx: { mb: 2 }, children: pageError })) : null, mutations.error && editing === null ? (_jsx(Alert, { severity: "error", sx: { mb: 2 }, onClose: mutations.reset, children: mutations.error })) : null, notice ? (_jsx(Alert, { severity: "success", sx: { mb: 2 }, onClose: () => setNotice(null), children: notice })) : null, selectedId ? (endpoint ? (_jsx(WebhookEndpointDetail, { scope: scope, endpoint: endpoint, canWrite: canWrite, busy: mutations.pending, reloadKey: reloadKey, ...(slots ? { slots } : {}), onBack: back, onEdit: () => {
|
|
162
|
+
mutations.reset();
|
|
163
|
+
setEditing(endpoint);
|
|
164
|
+
}, onSendTest: () => void sendTest(), onRotate: () => setConfirm('rotate'), onDelete: () => setConfirm('delete'), onOpenDelivery: (delivery) => setDeliveryId(delivery.id) })) : selected.isLoading ? (_jsx(Typography, { color: "text.secondary", children: "Loading the endpoint\u2026" })) : (_jsx(Button, { onClick: back, sx: { minHeight: 44 }, children: "All endpoints" }))) : (_jsxs(Stack, { spacing: 2, children: [canWrite ? (_jsx(Box, { children: _jsx(Button, { variant: "contained", startIcon: _jsx(AddIcon, {}), onClick: () => {
|
|
165
|
+
mutations.reset();
|
|
166
|
+
setEditing('new');
|
|
167
|
+
}, sx: { minHeight: 44 }, children: "New endpoint" }) })) : null, _jsx(Card, { variant: "outlined", children: _jsx(CardContent, { children: _jsx(DataTable, { tableId: `webhook-endpoints-${scope}`, ariaLabel: "Webhook endpoints", columns: columns, rows: endpoints, rowId: (row) => row.id, loading: isLoading, rowActions: rowActions, emptyState: _jsxs(Typography, { variant: "body2", color: "text.secondary", sx: { p: 2 }, children: ["No endpoints yet.", canWrite ? ' Create one to start receiving events.' : ''] }), disableExport: true }) }) })] })), _jsx(Box, { sx: { mt: 3 }, children: _jsx(WebhookSignatureHelp, {}) })] }) }), canWrite ? (_jsx(WebhookEndpointDialog, { open: editing !== null, endpoint: editing === 'new' ? null : editing, groups: catalog.groups, catalogLoading: catalog.isLoading, catalogError: catalog.error, saving: mutations.pending, error: editing !== null ? mutations.error : null, onSubmit: (input) => void save(input), onClose: () => {
|
|
168
|
+
setEditing(null);
|
|
169
|
+
mutations.reset();
|
|
170
|
+
} })) : null, _jsx(WebhookSecretDialog, { secret: secret?.secret ?? null, reason: secret?.reason ?? 'created', previousSecretValidUntil: secret?.previousSecretValidUntil ?? null, onClose: () => setSecret(null) }), _jsxs(ConfirmDialog, { open: confirm === 'rotate', title: "Rotate the signing secret?", confirmLabel: "Rotate secret", busy: mutations.pending, onConfirm: () => void rotate(), onClose: () => setConfirm(null), children: ["A new secret is created and shown once. For the next ", WEBHOOK_ROTATION_OVERLAP_HOURS, " hours every delivery is signed with both the old and the new secret, so you can update your receiver without missing an event. After that, only the new secret is accepted."] }), _jsxs(ConfirmDialog, { open: confirm === 'delete', title: "Delete this endpoint?", confirmLabel: "Delete endpoint", destructive: true, busy: mutations.pending, onConfirm: () => void remove(), onClose: () => setConfirm(null), children: [endpoint ? _jsx("strong", { children: endpoint.name }) : 'The endpoint', " stops receiving events now, and its delivery history is deleted with it. This cannot be undone."] }), _jsx(WebhookDeliveryDrawer, { scope: scope, deliveryId: deliveryId, canWrite: canWrite, onRedeliver: redeliver, redelivering: mutations.pending, onClose: () => setDeliveryId(null) })] }));
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=WebhooksPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAI,GAAU,CAAC,CAAC,CAAC,cAAc,wGAE/C,EAChB,KAAC,qBAAqB,IACpB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,SAAS,EACtB,YAAY,EAAE,SAAS,CAAC,OAAO,EAC/B,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,GAClC,IACQ,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { WebhookScope } from '@marinoscar/platform-contract/webhooks';
|
|
2
|
+
/**
|
|
3
|
+
* The title, description and route of the webhooks page of each scope: the
|
|
4
|
+
* registry card's text and the page's heading.
|
|
5
|
+
*
|
|
6
|
+
* @stability experimental
|
|
7
|
+
*/
|
|
8
|
+
export declare const WEBHOOKS_PAGE_COPY: Readonly<Record<WebhookScope, {
|
|
9
|
+
/** The card title and the page heading. */
|
|
10
|
+
readonly title: string;
|
|
11
|
+
/** The card text and the page lead. */
|
|
12
|
+
readonly description: string;
|
|
13
|
+
/** The route of the page. */
|
|
14
|
+
readonly path: string;
|
|
15
|
+
}>>;
|
|
16
|
+
/**
|
|
17
|
+
* The rotation overlap the confirm dialog promises, in hours (the API's
|
|
18
|
+
* default `rotationOverlapHours`). The dialog after rotating shows the exact
|
|
19
|
+
* time the API returned.
|
|
20
|
+
*
|
|
21
|
+
* @stability experimental
|
|
22
|
+
*/
|
|
23
|
+
export declare const WEBHOOK_ROTATION_OVERLAP_HOURS = 24;
|
|
24
|
+
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../src/webhooks/ui/copy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAE3E;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CACvC,MAAM,CACJ,YAAY,EACZ;IACE,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,6BAA6B;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CACF,CAkBC,CAAC;AAEL;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,KAAK,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// The webhooks UI's copy (issue #1046), in one place so a fork rewords it once.
|
|
2
|
+
// The card text and the page heading are the same words, per scope.
|
|
3
|
+
/**
|
|
4
|
+
* The title, description and route of the webhooks page of each scope: the
|
|
5
|
+
* registry card's text and the page's heading.
|
|
6
|
+
*
|
|
7
|
+
* @stability experimental
|
|
8
|
+
*/
|
|
9
|
+
export const WEBHOOKS_PAGE_COPY = Object.freeze({
|
|
10
|
+
user: Object.freeze({
|
|
11
|
+
title: 'Webhooks',
|
|
12
|
+
description: 'Send events about your own activity to HTTPS endpoints you control, signed so the receiver can verify them.',
|
|
13
|
+
path: '/settings/webhooks',
|
|
14
|
+
}),
|
|
15
|
+
org: Object.freeze({
|
|
16
|
+
title: 'Organization webhooks',
|
|
17
|
+
description: "Send your current organization's events to HTTPS endpoints its administrators manage, signed so the receiver can verify them.",
|
|
18
|
+
path: '/admin/settings/organization-webhooks',
|
|
19
|
+
}),
|
|
20
|
+
system: Object.freeze({
|
|
21
|
+
title: 'Webhooks',
|
|
22
|
+
description: "Send this deployment's operational events (offline nodes, failed jobs) to HTTPS endpoints, signed so the receiver can verify them.",
|
|
23
|
+
path: '/admin/settings/webhooks',
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* The rotation overlap the confirm dialog promises, in hours (the API's
|
|
28
|
+
* default `rotationOverlapHours`). The dialog after rotating shows the exact
|
|
29
|
+
* time the API returned.
|
|
30
|
+
*
|
|
31
|
+
* @stability experimental
|
|
32
|
+
*/
|
|
33
|
+
export const WEBHOOK_ROTATION_OVERLAP_HOURS = 24;
|
|
34
|
+
//# sourceMappingURL=copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../src/webhooks/ui/copy.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oEAAoE;AAIpE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAa7B,MAAM,CAAC,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QAClB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,6GAA6G;QAC1H,IAAI,EAAE,oBAAoB;KAC3B,CAAC;IACF,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;QACjB,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,+HAA+H;QAC5I,IAAI,EAAE,uCAAuC;KAC9C,CAAC;IACF,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;QACpB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,oIAAoI;QACjJ,IAAI,EAAE,0BAA0B;KACjC,CAAC;CACH,CAAC,CAAC;AAEL;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { WEBHOOK_ROTATION_OVERLAP_HOURS, WEBHOOKS_PAGE_COPY } from './copy.js';
|
|
2
|
+
export { webhooksAdminSections, webhooksUserSettingsSections } from './settings.js';
|
|
3
|
+
export type { WebhooksSettingsCard } from './settings.js';
|
|
4
|
+
export { WebhookDeliveryDrawer } from './WebhookDeliveryDrawer.js';
|
|
5
|
+
export type { WebhookDeliveryDrawerProps } from './WebhookDeliveryDrawer.js';
|
|
6
|
+
export { WebhookEndpointDialog } from './WebhookEndpointDialog.js';
|
|
7
|
+
export type { WebhookEndpointDialogProps } from './WebhookEndpointDialog.js';
|
|
8
|
+
export { WebhookEventPicker } from './WebhookEventPicker.js';
|
|
9
|
+
export type { WebhookEventPickerProps } from './WebhookEventPicker.js';
|
|
10
|
+
export { WebhookSecretDialog } from './WebhookSecretDialog.js';
|
|
11
|
+
export type { WebhookSecretDialogProps } from './WebhookSecretDialog.js';
|
|
12
|
+
export { WEBHOOK_VERIFY_SNIPPET, WebhookSignatureHelp } from './WebhookSignatureHelp.js';
|
|
13
|
+
export { WebhooksPage } from './WebhooksPage.js';
|
|
14
|
+
export type { WebhooksPageProps, WebhooksPageSlots } from './WebhooksPage.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webhooks/ui/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AACpF,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// `@marinoscar/platform-web/webhooks/ui`: the webhooks page of one scope, its
|
|
2
|
+
// dialogs, the delivery drawer and the settings cards as data, built on
|
|
3
|
+
// `/webhooks/headless` (issue #1046). Documented in ../README.md.
|
|
4
|
+
export { WEBHOOK_ROTATION_OVERLAP_HOURS, WEBHOOKS_PAGE_COPY } from './copy.js';
|
|
5
|
+
export { webhooksAdminSections, webhooksUserSettingsSections } from './settings.js';
|
|
6
|
+
export { WebhookDeliveryDrawer } from './WebhookDeliveryDrawer.js';
|
|
7
|
+
export { WebhookEndpointDialog } from './WebhookEndpointDialog.js';
|
|
8
|
+
export { WebhookEventPicker } from './WebhookEventPicker.js';
|
|
9
|
+
export { WebhookSecretDialog } from './WebhookSecretDialog.js';
|
|
10
|
+
export { WEBHOOK_VERIFY_SNIPPET, WebhookSignatureHelp } from './WebhookSignatureHelp.js';
|
|
11
|
+
export { WebhooksPage } from './WebhooksPage.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/webhooks/ui/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wEAAwE;AACxE,kEAAkE;AAElE,OAAO,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { WebhookDeliveryStatus, WebhookEndpoint } from '@marinoscar/platform-contract/webhooks';
|
|
3
|
+
/** The endpoint's status as a labelled chip (the words carry the meaning, not the colour). */
|
|
4
|
+
export declare function EndpointStatusChip({ endpoint }: {
|
|
5
|
+
endpoint: Pick<WebhookEndpoint, 'enabled' | 'disabledReason'>;
|
|
6
|
+
}): ReactElement;
|
|
7
|
+
/** A delivery's status as a labelled chip. */
|
|
8
|
+
export declare function DeliveryStatusChip({ status }: {
|
|
9
|
+
status: WebhookDeliveryStatus;
|
|
10
|
+
}): ReactElement;
|
|
11
|
+
/** A timestamp in the display zone, or a dash. */
|
|
12
|
+
export declare function when(iso: string | null): string;
|
|
13
|
+
export interface ConfirmDialogProps {
|
|
14
|
+
open: boolean;
|
|
15
|
+
title: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
confirmLabel: string;
|
|
18
|
+
destructive?: boolean;
|
|
19
|
+
busy?: boolean;
|
|
20
|
+
onConfirm: () => void;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
}
|
|
23
|
+
/** A yes/no dialog whose text says what will happen. */
|
|
24
|
+
export declare function ConfirmDialog({ open, title, children, confirmLabel, destructive, busy, onConfirm, onClose }: ConfirmDialogProps): ReactElement;
|
|
25
|
+
//# sourceMappingURL=parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../../src/webhooks/ui/parts.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAcrG,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,gBAAgB,CAAC,CAAA;CAAE,GAAG,YAAY,CAGhI;AAED,8CAA8C;AAC9C,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,qBAAqB,CAAA;CAAE,GAAG,YAAY,CAG9F;AAED,kDAAkD;AAClD,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAE/C;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,kBAAkB,GAAG,YAAY,CAuB9I"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Small building blocks of the webhooks UI (issue #1046): the status chips,
|
|
3
|
+
// the confirm dialog and the date text. Internal to the slice.
|
|
4
|
+
import { Button, Chip, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';
|
|
5
|
+
import { formatDateTime } from '../../core/index.js';
|
|
6
|
+
import { webhookDeliveryStatusLabel, webhookDeliveryStatusTone, webhookEndpointStatus, } from '../headless/index.js';
|
|
7
|
+
function chipColor(tone) {
|
|
8
|
+
return tone;
|
|
9
|
+
}
|
|
10
|
+
/** The endpoint's status as a labelled chip (the words carry the meaning, not the colour). */
|
|
11
|
+
export function EndpointStatusChip({ endpoint }) {
|
|
12
|
+
const status = webhookEndpointStatus(endpoint);
|
|
13
|
+
return _jsx(Chip, { size: "small", label: status.label, color: chipColor(status.tone), variant: status.tone === 'default' ? 'outlined' : 'filled' });
|
|
14
|
+
}
|
|
15
|
+
/** A delivery's status as a labelled chip. */
|
|
16
|
+
export function DeliveryStatusChip({ status }) {
|
|
17
|
+
const tone = webhookDeliveryStatusTone(status);
|
|
18
|
+
return _jsx(Chip, { size: "small", label: webhookDeliveryStatusLabel(status), color: chipColor(tone), variant: tone === 'default' ? 'outlined' : 'filled' });
|
|
19
|
+
}
|
|
20
|
+
/** A timestamp in the display zone, or a dash. */
|
|
21
|
+
export function when(iso) {
|
|
22
|
+
return iso ? formatDateTime(iso) : '—';
|
|
23
|
+
}
|
|
24
|
+
/** A yes/no dialog whose text says what will happen. */
|
|
25
|
+
export function ConfirmDialog({ open, title, children, confirmLabel, destructive, busy, onConfirm, onClose }) {
|
|
26
|
+
return (_jsxs(Dialog, { open: open, onClose: onClose, maxWidth: "xs", fullWidth: true, "aria-labelledby": "webhooks-confirm-title", children: [_jsx(DialogTitle, { id: "webhooks-confirm-title", children: title }), _jsx(DialogContent, { children: _jsx(DialogContentText, { component: "div", children: children }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: onClose, sx: { minHeight: 44 }, children: "Cancel" }), _jsx(Button, { variant: "contained", color: destructive ? 'error' : 'primary', onClick: onConfirm, disabled: busy, sx: { minHeight: 44 }, children: confirmLabel })] })] }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=parts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../../../src/webhooks/ui/parts.tsx"],"names":[],"mappings":";AAAA,4EAA4E;AAC5E,+DAA+D;AAE/D,OAAO,EAAE,MAAM,EAAE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,UAAU,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAsB;IAC9H,OAAO,CACL,MAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAC,IAAI,EAAC,SAAS,2BAAiB,wBAAwB,aACpG,KAAC,WAAW,IAAC,EAAE,EAAC,wBAAwB,YAAE,KAAK,GAAe,EAC9D,KAAC,aAAa,cACZ,KAAC,iBAAiB,IAAC,SAAS,EAAC,KAAK,YAAE,QAAQ,GAAqB,GACnD,EAChB,MAAC,aAAa,eACZ,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,uBAEtC,EACT,KAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACxC,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,IAAI,EACd,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,YAEpB,YAAY,GACN,IACK,IACT,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PlatformSettingsPage } from '../../core/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* One webhooks registry card: the `PlatformSettingsPage` card shape plus its
|
|
4
|
+
* icon, structurally a `SettingsCardDef` of the reference app.
|
|
5
|
+
*
|
|
6
|
+
* @stability experimental
|
|
7
|
+
*/
|
|
8
|
+
export type WebhooksSettingsCard = PlatformSettingsPage<'orgs'>['card'] & {
|
|
9
|
+
/** The card and rail icon (an MUI SvgIcon). */
|
|
10
|
+
Icon: PlatformSettingsPage['Icon'];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The per-user webhooks card, by section:
|
|
14
|
+
*
|
|
15
|
+
* - `integrations`: `Webhooks` (`/settings/webhooks`, `webhooks:read`).
|
|
16
|
+
*
|
|
17
|
+
* Route it to `<WebhooksPage scope="user" />`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // apps/web/src/config/userSettingsSections.tsx
|
|
22
|
+
* { label: 'Integrations', cards: [...webhooksUserSettingsSections.integrations] },
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @extensionPoint component
|
|
26
|
+
* @stability experimental
|
|
27
|
+
*/
|
|
28
|
+
export declare const webhooksUserSettingsSections: {
|
|
29
|
+
/** The Integrations section's cards. */
|
|
30
|
+
readonly integrations: readonly WebhooksSettingsCard[];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The admin webhooks cards, by the admin section they belong to:
|
|
34
|
+
*
|
|
35
|
+
* - `operations`: `Webhooks` (`/admin/settings/webhooks`,
|
|
36
|
+
* `system_webhooks:read`), the deployment's endpoints; route it to
|
|
37
|
+
* `<WebhooksPage scope="system" />`.
|
|
38
|
+
* - `organizations`: `Organization webhooks`
|
|
39
|
+
* (`/admin/settings/organization-webhooks`, `org_webhooks:read`,
|
|
40
|
+
* `feature: 'orgs'` like the other organization cards); route it to
|
|
41
|
+
* `<WebhooksPage scope="org" />`.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // apps/web/src/config/adminSections.tsx
|
|
46
|
+
* { label: 'Operations', cards: [...jobsAdminSections.operations, ...webhooksAdminSections.operations] },
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @extensionPoint component
|
|
50
|
+
* @stability experimental
|
|
51
|
+
*/
|
|
52
|
+
export declare const webhooksAdminSections: {
|
|
53
|
+
/** The Operations section's cards. */
|
|
54
|
+
readonly operations: readonly WebhooksSettingsCard[];
|
|
55
|
+
/** The Organizations section's cards. */
|
|
56
|
+
readonly organizations: readonly WebhooksSettingsCard[];
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/webhooks/ui/settings.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGhE;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG;IACxE,+CAA+C;IAC/C,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,EAAE;IACzC,wCAAwC;IACxC,QAAQ,CAAC,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;CASvD,CAAC;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,qBAAqB,EAAE;IAClC,sCAAsC;IACtC,QAAQ,CAAC,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACrD,yCAAyC;IACzC,QAAQ,CAAC,aAAa,EAAE,SAAS,oBAAoB,EAAE,CAAC;CAiBxD,CAAC"}
|