@galaxy-io/filament-ui 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/queries/pipelines.d.ts +15 -0
- package/dist/api/queries/pipelines.js +8 -2
- package/dist/api/queries/runs.js +3 -0
- package/dist/api/queries/webhooks.d.ts +61 -0
- package/dist/api/queries/webhooks.js +41 -0
- package/dist/components/connections/ConnectorPreviewChip.js +4 -3
- package/dist/components/webhooks/WebhookDeliveryUrlCopyButton.d.ts +8 -0
- package/dist/components/webhooks/WebhookDeliveryUrlCopyButton.js +33 -0
- package/dist/components/webhooks/WebhookEndpointErrorLayout.d.ts +7 -0
- package/dist/components/webhooks/WebhookEndpointErrorLayout.js +26 -0
- package/dist/components/webhooks/WebhookEndpointStatusBeacon.d.ts +7 -0
- package/dist/components/webhooks/WebhookEndpointStatusBeacon.js +20 -0
- package/dist/components/webhooks/WebhookEndpointStatusCallout.d.ts +8 -0
- package/dist/components/webhooks/WebhookEndpointStatusCallout.js +11 -0
- package/dist/components/webhooks/constants.d.ts +10 -0
- package/dist/components/webhooks/constants.js +36 -0
- package/dist/components/webhooks/hooks/useWebhookEndpointSync.d.ts +8 -0
- package/dist/components/webhooks/hooks/useWebhookEndpointSync.js +112 -0
- package/dist/components/webhooks/types.d.ts +9 -0
- package/dist/components/webhooks/types.js +13 -0
- package/dist/components/webhooks/utils.d.ts +21 -0
- package/dist/components/webhooks/utils.js +47 -0
- package/dist/gen/ingestion/v1/connectors_pb.d.ts +6 -0
- package/dist/gen/ingestion/v1/connectors_pb.js +1 -1
- package/dist/gen/ingestion/v1/runs_pb.d.ts +2 -1
- package/dist/gen/ingestion/v1/service_pb.d.ts +19 -0
- package/dist/gen/ingestion/v1/service_pb.js +4 -2
- package/dist/gen/ingestion/v1/webhooks_pb.d.ts +177 -0
- package/dist/gen/ingestion/v1/webhooks_pb.js +23 -0
- package/dist/hooks/useConfirm.d.ts +1 -1
- package/dist/pages/connections/ConnectionsPage.js +0 -4
- package/dist/pages/connections/components/card/ConnectionCard.d.ts +0 -1
- package/dist/pages/connections/components/card/ConnectionCard.js +4 -9
- package/dist/pages/connections/components/create/configure/CreateConnectionConfigure.js +48 -11
- package/dist/pages/connections/components/drawer/ConnectionDrawer.js +6 -1
- package/dist/pages/connections/components/drawer/ConnectionDrawerSection.js +1 -1
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhook.d.ts +7 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhook.js +105 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhookSecrets.d.ts +7 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhookSecrets.js +40 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhookSigningKey.d.ts +9 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhookSigningKey.js +120 -0
- package/dist/pages/connections/components/form/ConnectionFormSigningKeyModal.d.ts +9 -0
- package/dist/pages/connections/components/form/ConnectionFormSigningKeyModal.js +66 -0
- package/dist/pages/connections/components/form/ConnectionFormWrapper.d.ts +1 -0
- package/dist/pages/connections/components/form/ConnectionFormWrapper.js +2 -1
- package/dist/pages/connections/components/form/types.d.ts +5 -0
- package/dist/pages/connections/hooks/useConnectionWebhookKeyMint.d.ts +12 -0
- package/dist/pages/connections/hooks/useConnectionWebhookKeyMint.js +27 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasPanelResourceOptions.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/PipelineCanvasPanelOverview.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/node/PipelineCanvasPanelNodeDetail.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceDetail.js +11 -0
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceEndpoint.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceSection.js +4 -1
- package/dist/pages/pipelines/canvas/routes/hooks/usePipelineCanvasRoutes.js +1 -1
- package/dist/pages/pipelines/components/create/components/CreatePipelineModalFooter.js +7 -1
- package/dist/pages/pipelines/components/create/hooks/useCreatePipelineResources.js +1 -1
- package/dist/pages/pipelines/components/create/steps/CreatePipelineModalResources.js +5 -2
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesTable.js +15 -2
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesUrlCell.d.ts +7 -0
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesUrlCell.js +27 -0
- package/dist/pages/pipelines/components/header/PipelinePageEditActions.js +10 -0
- package/dist/pages/pipelines/components/resource/PipelineResourceCreateForm.d.ts +1 -0
- package/dist/pages/pipelines/components/resource/PipelineResourceCreateForm.js +10 -3
- package/dist/pages/pipelines/components/run/PipelineRunModal.js +7 -4
- package/dist/pages/pipelines/components/run/PipelineRunModalResourcesPane.d.ts +1 -0
- package/dist/pages/pipelines/components/run/PipelineRunModalResourcesPane.js +5 -4
- package/dist/pages/pipelines/components/run/utils.d.ts +1 -0
- package/dist/pages/pipelines/components/run/utils.js +2 -1
- package/dist/pages/pipelines/settings/PipelineSettingsPageGeneral.js +1 -1
- package/dist/utils/errors.d.ts +2 -0
- package/dist/utils/errors.js +6 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Connection } from '../../../../gen/ingestion/v1/connections_pb';
|
|
3
|
+
interface ConnectionDrawerWebhookSecretsProps {
|
|
4
|
+
connection: Connection;
|
|
5
|
+
}
|
|
6
|
+
declare const ConnectionDrawerWebhookSecrets: FC<ConnectionDrawerWebhookSecretsProps>;
|
|
7
|
+
export default ConnectionDrawerWebhookSecrets;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isNotFoundError } from "../../../../utils/errors.js";
|
|
2
|
+
import { createGetWebhookEndpointInput, useGetWebhookEndpointQuery } from "../../../../api/queries/webhooks.js";
|
|
3
|
+
import ConnectionDrawerSection from "./ConnectionDrawerSection.js";
|
|
4
|
+
import WebhookEndpointErrorLayout from "../../../../components/webhooks/WebhookEndpointErrorLayout.js";
|
|
5
|
+
import ConnectionDrawerWebhookSigningKey from "./ConnectionDrawerWebhookSigningKey.js";
|
|
6
|
+
import { KeyIcon } from "@phosphor-icons/react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import Box from "@galaxy-io/dls/layout/Box";
|
|
9
|
+
import Skeleton from "@galaxy-io/dls/feedback/Skeleton";
|
|
10
|
+
//#region src/pages/connections/components/drawer/ConnectionDrawerWebhookSecrets.tsx
|
|
11
|
+
var ConnectionDrawerWebhookSecrets = ({ connection }) => {
|
|
12
|
+
const { data, error, isError, isLoading } = useGetWebhookEndpointQuery({
|
|
13
|
+
input: createGetWebhookEndpointInput(connection.id),
|
|
14
|
+
options: { retry: false }
|
|
15
|
+
});
|
|
16
|
+
const endpoint = data?.endpoint;
|
|
17
|
+
const isFailed = isError && !isNotFoundError(error);
|
|
18
|
+
const renderContent = () => {
|
|
19
|
+
if (isLoading) return /* @__PURE__ */ jsx(Box, {
|
|
20
|
+
padding: 12,
|
|
21
|
+
children: /* @__PURE__ */ jsx(Skeleton, { lines: 2 })
|
|
22
|
+
});
|
|
23
|
+
if (isFailed) return /* @__PURE__ */ jsx(WebhookEndpointErrorLayout, { error });
|
|
24
|
+
return /* @__PURE__ */ jsx(ConnectionDrawerWebhookSigningKey, {
|
|
25
|
+
connection,
|
|
26
|
+
endpoint
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ jsx(ConnectionDrawerSection, {
|
|
30
|
+
header: "Secrets",
|
|
31
|
+
icon: KeyIcon,
|
|
32
|
+
count: endpoint?.hasSigningSecret ? 1 : void 0,
|
|
33
|
+
emptyHeader: "No secrets",
|
|
34
|
+
emptyMessage: "This connection has no secret references.",
|
|
35
|
+
isFlush: true,
|
|
36
|
+
children: renderContent()
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ConnectionDrawerWebhookSecrets as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Connection } from '../../../../gen/ingestion/v1/connections_pb';
|
|
3
|
+
import { WebhookEndpointConfig } from '../../../../gen/ingestion/v1/webhooks_pb';
|
|
4
|
+
interface ConnectionDrawerWebhookSigningKeyProps {
|
|
5
|
+
connection: Connection;
|
|
6
|
+
endpoint: WebhookEndpointConfig | undefined;
|
|
7
|
+
}
|
|
8
|
+
declare const ConnectionDrawerWebhookSigningKey: FC<ConnectionDrawerWebhookSigningKeyProps>;
|
|
9
|
+
export default ConnectionDrawerWebhookSigningKey;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { formatTimestamp } from "../../../../utils/format.js";
|
|
2
|
+
import { isWebhookPreviousKeyActive } from "../../../../components/webhooks/utils.js";
|
|
3
|
+
import { getErrorMessage } from "../../../../utils/errors.js";
|
|
4
|
+
import ConnectionFormSigningKeyModal from "../form/ConnectionFormSigningKeyModal.js";
|
|
5
|
+
import { useConnectionWebhookKeyMint } from "../../hooks/useConnectionWebhookKeyMint.js";
|
|
6
|
+
import { useConfirm } from "../../../../hooks/useConfirm.js";
|
|
7
|
+
import Button, { ButtonSize } from "@galaxy-io/dls/buttons/Button";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import Flex, { AlignItems, FlexDirection, JustifyContent } from "@galaxy-io/dls/layout/Flex";
|
|
11
|
+
import { ToastVariant } from "@galaxy-io/dls/toast/Toast";
|
|
12
|
+
import { useToast } from "@galaxy-io/dls/toast/useToast";
|
|
13
|
+
import Text, { TextSize, TextVariant, TextWeight } from "@galaxy-io/dls/text/Text";
|
|
14
|
+
import Divider from "@galaxy-io/dls/layout/Divider";
|
|
15
|
+
import ConfirmDialog from "@galaxy-io/dls/modal/ConfirmDialog";
|
|
16
|
+
//#region src/pages/connections/components/drawer/ConnectionDrawerWebhookSigningKey.tsx
|
|
17
|
+
var ConnectionDrawerWebhookSigningKey = ({ connection, endpoint }) => {
|
|
18
|
+
const { toast } = useToast();
|
|
19
|
+
const [reveal, setReveal] = useState();
|
|
20
|
+
const { mintKey, isPending } = useConnectionWebhookKeyMint();
|
|
21
|
+
const hasKey = !!endpoint?.hasSigningSecret;
|
|
22
|
+
const isPreviousKeyActive = isWebhookPreviousKeyActive(endpoint);
|
|
23
|
+
const previousKeyExpiry = formatTimestamp(endpoint?.previousKeyExpiresAt ?? 0n);
|
|
24
|
+
const mintSigningKey = (callbacks) => mintKey(connection, endpoint, {
|
|
25
|
+
onSuccess: (reveal) => {
|
|
26
|
+
setReveal(reveal);
|
|
27
|
+
callbacks.onSuccess();
|
|
28
|
+
},
|
|
29
|
+
onError: callbacks.onError
|
|
30
|
+
});
|
|
31
|
+
const rotateConfirm = useConfirm({
|
|
32
|
+
entityLabel: "Signing key",
|
|
33
|
+
messages: {
|
|
34
|
+
successHeader: "Signing key rotated",
|
|
35
|
+
errorHeader: "Rotate failed",
|
|
36
|
+
errorFallback: "Could not rotate the signing key"
|
|
37
|
+
},
|
|
38
|
+
onConfirm: (_, callbacks) => mintSigningKey(callbacks)
|
|
39
|
+
});
|
|
40
|
+
const handleGenerate = () => mintSigningKey({
|
|
41
|
+
onSuccess: () => void 0,
|
|
42
|
+
onError: (error) => toast({
|
|
43
|
+
variant: ToastVariant.ERROR,
|
|
44
|
+
header: "Generate failed",
|
|
45
|
+
description: getErrorMessage(error, "Could not generate a signing key")
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
49
|
+
/* @__PURE__ */ jsxs(Flex, {
|
|
50
|
+
alignItems: AlignItems.STRETCH,
|
|
51
|
+
direction: FlexDirection.COLUMN,
|
|
52
|
+
fillWidth: true,
|
|
53
|
+
children: [/* @__PURE__ */ jsxs(Flex, {
|
|
54
|
+
alignItems: AlignItems.CENTER,
|
|
55
|
+
justifyContent: JustifyContent.SPACE_BETWEEN,
|
|
56
|
+
gap: 12,
|
|
57
|
+
height: 40,
|
|
58
|
+
padding: [0, 12],
|
|
59
|
+
fillWidth: true,
|
|
60
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
61
|
+
size: TextSize.BODY_SM,
|
|
62
|
+
weight: TextWeight.MEDIUM,
|
|
63
|
+
children: "Signing key"
|
|
64
|
+
}), /* @__PURE__ */ jsxs(Flex, {
|
|
65
|
+
alignItems: AlignItems.CENTER,
|
|
66
|
+
gap: 12,
|
|
67
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
68
|
+
size: TextSize.BODY_SM,
|
|
69
|
+
variant: TextVariant.SECONDARY,
|
|
70
|
+
children: hasKey ? "HMAC-SHA256" : "Not set"
|
|
71
|
+
}), hasKey ? /* @__PURE__ */ jsx(Button, {
|
|
72
|
+
label: "Rotate",
|
|
73
|
+
size: ButtonSize.SMALL,
|
|
74
|
+
isDisabled: isPreviousKeyActive,
|
|
75
|
+
tooltip: isPreviousKeyActive ? `Rotate again after ${previousKeyExpiry}` : void 0,
|
|
76
|
+
onClick: () => rotateConfirm.handleOpen(connection)
|
|
77
|
+
}) : /* @__PURE__ */ jsx(Button, {
|
|
78
|
+
label: "Generate",
|
|
79
|
+
size: ButtonSize.SMALL,
|
|
80
|
+
isLoading: isPending,
|
|
81
|
+
onClick: handleGenerate
|
|
82
|
+
})]
|
|
83
|
+
})]
|
|
84
|
+
}), isPreviousKeyActive && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Divider, {}), /* @__PURE__ */ jsxs(Flex, {
|
|
85
|
+
alignItems: AlignItems.CENTER,
|
|
86
|
+
justifyContent: JustifyContent.SPACE_BETWEEN,
|
|
87
|
+
gap: 12,
|
|
88
|
+
height: 40,
|
|
89
|
+
padding: [0, 12],
|
|
90
|
+
fillWidth: true,
|
|
91
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
92
|
+
size: TextSize.BODY_SM,
|
|
93
|
+
weight: TextWeight.MEDIUM,
|
|
94
|
+
children: "Previous key"
|
|
95
|
+
}), /* @__PURE__ */ jsxs(Text, {
|
|
96
|
+
size: TextSize.BODY_SM,
|
|
97
|
+
variant: TextVariant.SECONDARY,
|
|
98
|
+
children: ["Works until ", previousKeyExpiry]
|
|
99
|
+
})]
|
|
100
|
+
})] })]
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ jsx(ConfirmDialog, {
|
|
103
|
+
isOpen: rotateConfirm.isOpen,
|
|
104
|
+
onOpenChange: (isOpen) => {
|
|
105
|
+
if (!isOpen) rotateConfirm.handleClose();
|
|
106
|
+
},
|
|
107
|
+
onConfirm: rotateConfirm.handleConfirm,
|
|
108
|
+
header: "Rotate signing key?",
|
|
109
|
+
description: "Filament creates a new key and shows it once. The current key keeps working for 72 hours.",
|
|
110
|
+
label: "Rotate key"
|
|
111
|
+
}),
|
|
112
|
+
reveal && /* @__PURE__ */ jsx(ConnectionFormSigningKeyModal, {
|
|
113
|
+
isOpen: true,
|
|
114
|
+
reveal,
|
|
115
|
+
onDone: () => setReveal(void 0)
|
|
116
|
+
})
|
|
117
|
+
] });
|
|
118
|
+
};
|
|
119
|
+
//#endregion
|
|
120
|
+
export { ConnectionDrawerWebhookSigningKey as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ConnectionFormSigningKeyReveal } from './types';
|
|
3
|
+
interface ConnectionFormSigningKeyModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
reveal: ConnectionFormSigningKeyReveal;
|
|
6
|
+
onDone: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const ConnectionFormSigningKeyModal: FC<ConnectionFormSigningKeyModalProps>;
|
|
9
|
+
export default ConnectionFormSigningKeyModal;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import ConnectionFormHeader from "./ConnectionFormHeader.js";
|
|
2
|
+
import ConnectionFormWrapper from "./ConnectionFormWrapper.js";
|
|
3
|
+
import Button from "@galaxy-io/dls/buttons/Button";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import Flex, { AlignItems, FlexDirection, JustifyContent } from "@galaxy-io/dls/layout/Flex";
|
|
7
|
+
import Alert, { AlertVariant } from "@galaxy-io/dls/feedback/Alert";
|
|
8
|
+
import Text from "@galaxy-io/dls/text/Text";
|
|
9
|
+
import CheckboxInput from "@galaxy-io/dls/inputs/CheckboxInput";
|
|
10
|
+
import { FontFamily } from "@galaxy-io/dls/theme/enums";
|
|
11
|
+
import CopyInput from "@galaxy-io/dls/inputs/CopyInput";
|
|
12
|
+
//#region src/pages/connections/components/form/ConnectionFormSigningKeyModal.tsx
|
|
13
|
+
var ConnectionFormSigningKeyModal = ({ isOpen, reveal: { connection, signingKey, deliveryUrl }, onDone }) => {
|
|
14
|
+
const [isStored, setIsStored] = useState(false);
|
|
15
|
+
return /* @__PURE__ */ jsx(ConnectionFormWrapper, {
|
|
16
|
+
isOpen,
|
|
17
|
+
isDismissable: isStored,
|
|
18
|
+
header: /* @__PURE__ */ jsx(ConnectionFormHeader, {
|
|
19
|
+
connectorName: connection.connector,
|
|
20
|
+
connectorKind: connection.kind,
|
|
21
|
+
title: `${connection.name} signing key`
|
|
22
|
+
}),
|
|
23
|
+
footer: /* @__PURE__ */ jsxs(Flex, {
|
|
24
|
+
alignItems: AlignItems.CENTER,
|
|
25
|
+
justifyContent: JustifyContent.SPACE_BETWEEN,
|
|
26
|
+
fillWidth: true,
|
|
27
|
+
children: [/* @__PURE__ */ jsx(CheckboxInput, {
|
|
28
|
+
label: "I stored this key",
|
|
29
|
+
isChecked: isStored,
|
|
30
|
+
onChange: setIsStored
|
|
31
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
32
|
+
label: "Done",
|
|
33
|
+
isDisabled: !isStored,
|
|
34
|
+
onClick: onDone
|
|
35
|
+
})]
|
|
36
|
+
}),
|
|
37
|
+
onClose: onDone,
|
|
38
|
+
children: /* @__PURE__ */ jsxs(Flex, {
|
|
39
|
+
alignItems: AlignItems.STRETCH,
|
|
40
|
+
direction: FlexDirection.COLUMN,
|
|
41
|
+
gap: 16,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ jsx(Alert, {
|
|
44
|
+
variant: AlertVariant.WARNING,
|
|
45
|
+
header: "Save this key now. It will not be shown again.",
|
|
46
|
+
children: "Add it to the sender that signs your deliveries."
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx(CopyInput, {
|
|
49
|
+
label: "Signing key",
|
|
50
|
+
value: signingKey,
|
|
51
|
+
family: FontFamily.MONO,
|
|
52
|
+
fillWidth: true
|
|
53
|
+
}),
|
|
54
|
+
deliveryUrl ? /* @__PURE__ */ jsx(CopyInput, {
|
|
55
|
+
label: "Delivery URL",
|
|
56
|
+
labelTooltip: "Send each delivery to this URL followed by a resource name, such as /orders. Resources are named in the pipeline that reads this source.",
|
|
57
|
+
value: deliveryUrl,
|
|
58
|
+
family: FontFamily.MONO,
|
|
59
|
+
fillWidth: true
|
|
60
|
+
}) : /* @__PURE__ */ jsx(Text, { children: "Delivery URL unavailable. Configure WEBHOOK_PUBLIC_BASE_URL." })
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { ConnectionFormSigningKeyModal as default };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import Modal from "@galaxy-io/dls/modal/Modal";
|
|
3
3
|
//#region src/pages/connections/components/form/ConnectionFormWrapper.tsx
|
|
4
|
-
var ConnectionFormWrapper = ({ isOpen, header, footer, onClose, children }) => /* @__PURE__ */ jsx(Modal, {
|
|
4
|
+
var ConnectionFormWrapper = ({ isOpen, header, footer, isDismissable = true, onClose, children }) => /* @__PURE__ */ jsx(Modal, {
|
|
5
5
|
isOpen,
|
|
6
6
|
header,
|
|
7
7
|
footer,
|
|
8
|
+
isDismissable,
|
|
8
9
|
onOpenChange: (isOpen) => {
|
|
9
10
|
if (!isOpen) onClose();
|
|
10
11
|
},
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Connection } from '../../../gen/ingestion/v1/connections_pb';
|
|
2
|
+
import { WebhookEndpointConfig } from '../../../gen/ingestion/v1/webhooks_pb';
|
|
3
|
+
import { ConnectionFormSigningKeyReveal } from '../components/form/types';
|
|
4
|
+
interface ConnectionWebhookKeyMintCallbacks {
|
|
5
|
+
onSuccess: (reveal: ConnectionFormSigningKeyReveal) => void;
|
|
6
|
+
onError: (error: unknown) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useConnectionWebhookKeyMint: () => {
|
|
9
|
+
mintKey: (connection: Connection, endpoint: WebhookEndpointConfig | undefined, { onSuccess, onError }: ConnectionWebhookKeyMintCallbacks) => void;
|
|
10
|
+
isPending: boolean;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createPutWebhookEndpointRequest, createWebhookDeliveryBaseUrl } from "../../../components/webhooks/utils.js";
|
|
2
|
+
import { usePutWebhookEndpointMutation } from "../../../api/queries/webhooks.js";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
//#region src/pages/connections/hooks/useConnectionWebhookKeyMint.ts
|
|
5
|
+
var useConnectionWebhookKeyMint = () => {
|
|
6
|
+
const { mutate: putEndpoint, reset, isPending } = usePutWebhookEndpointMutation();
|
|
7
|
+
return {
|
|
8
|
+
mintKey: useCallback((connection, endpoint, { onSuccess, onError }) => putEndpoint(createPutWebhookEndpointRequest({
|
|
9
|
+
sourceConnectionId: connection.id,
|
|
10
|
+
endpoint,
|
|
11
|
+
mintSecret: true
|
|
12
|
+
}), {
|
|
13
|
+
onSuccess: (response) => {
|
|
14
|
+
reset();
|
|
15
|
+
onSuccess({
|
|
16
|
+
connection,
|
|
17
|
+
signingKey: response.mintedSecret,
|
|
18
|
+
deliveryUrl: createWebhookDeliveryBaseUrl(response.endpoint?.deliveryUrl)
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
onError
|
|
22
|
+
}), [putEndpoint, reset]),
|
|
23
|
+
isPending
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { useConnectionWebhookKeyMint };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConnectorKind, ReadMode, WriteMode } from "../../../../gen/ingestion/v1/common_pb.js";
|
|
2
2
|
import { PipelineEdgeSchema, PipelineGraphSchema, PipelineNodeSchema } from "../../../../gen/ingestion/v1/pipelines_pb.js";
|
|
3
3
|
import { ValidatePipelineRequestSchema } from "../../../../gen/ingestion/v1/capabilities_pb.js";
|
|
4
|
-
import { useValidatePipelineQuery } from "../../../../api/queries/capabilities.js";
|
|
5
4
|
import { PROBE_QUERY_OPTIONS } from "../../../../api/queries/constants.js";
|
|
5
|
+
import { useValidatePipelineQuery } from "../../../../api/queries/capabilities.js";
|
|
6
6
|
import { getEdgeModeOptions, isConnectionNode } from "../utils.js";
|
|
7
7
|
import { usePipelineCanvasState } from "../providers/canvas/PipelineCanvasProvider.js";
|
|
8
8
|
import { usePipelineCanvasConnections } from "./usePipelineCanvasConnections.js";
|
|
@@ -9,9 +9,9 @@ import { createGetPipelineInput, useSuspenseGetPipelineQuery } from "../../../..
|
|
|
9
9
|
import { PIPELINE_CANVAS_NODE_TYPE_TO_CONNECTOR_KIND_MAP } from "../../constants.js";
|
|
10
10
|
import { isConnectionNode } from "../../utils.js";
|
|
11
11
|
import { usePipelineCanvasState } from "../../providers/canvas/PipelineCanvasProvider.js";
|
|
12
|
+
import { usePipelineCanvasConnections } from "../../hooks/usePipelineCanvasConnections.js";
|
|
12
13
|
import { usePipelinePreviewVersion } from "../../../hooks/usePipelinePreviewVersion.js";
|
|
13
14
|
import { usePipelineCanvasSelection } from "../../hooks/usePipelineCanvasSelection.js";
|
|
14
|
-
import { usePipelineCanvasConnections } from "../../hooks/usePipelineCanvasConnections.js";
|
|
15
15
|
import PipelineCanvasPanelItem from "./PipelineCanvasPanelItem.js";
|
|
16
16
|
import PipelineCanvasPanelSection from "../PipelineCanvasPanelSection.js";
|
|
17
17
|
import PipelineCanvasPanelResourceSection from "./resource/PipelineCanvasPanelResourceSection.js";
|
|
@@ -10,8 +10,8 @@ import PipelineNodeConfigFields from "../../../../components/node/PipelineNodeCo
|
|
|
10
10
|
import { formatIdentifier } from "../../../../../../utils/naming.js";
|
|
11
11
|
import { PIPELINE_CANVAS_NODE_TYPE_TO_CONNECTOR_KIND_MAP } from "../../../constants.js";
|
|
12
12
|
import { usePipelineCanvasActions, usePipelineCanvasReadOnly, usePipelineCanvasState } from "../../../providers/canvas/PipelineCanvasProvider.js";
|
|
13
|
-
import { usePipelineCanvasSelection } from "../../../hooks/usePipelineCanvasSelection.js";
|
|
14
13
|
import { usePipelineCanvasConnections } from "../../../hooks/usePipelineCanvasConnections.js";
|
|
14
|
+
import { usePipelineCanvasSelection } from "../../../hooks/usePipelineCanvasSelection.js";
|
|
15
15
|
import PipelineCanvasPanelSection from "../../PipelineCanvasPanelSection.js";
|
|
16
16
|
import PipelineCanvasPanelResourceSection from "../resource/PipelineCanvasPanelResourceSection.js";
|
|
17
17
|
import PipelineCanvasPanelHeader from "../../PipelineCanvasPanelHeader.js";
|
package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceDetail.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ConnectorKind, ReadMode, WriteMode } from "../../../../../../gen/ingestion/v1/common_pb.js";
|
|
2
2
|
import { getEnumSelectValue, mapOptionIdToEnum } from "../../../../../../utils/select.js";
|
|
3
|
+
import { isWebhookConnector } from "../../../../../../components/webhooks/utils.js";
|
|
3
4
|
import KeyValueList from "../../../../../../components/KeyValueList.js";
|
|
4
5
|
import KeyValueListRow from "../../../../../../components/KeyValueListRow.js";
|
|
6
|
+
import WebhookDeliveryUrlCopyButton from "../../../../../../components/webhooks/WebhookDeliveryUrlCopyButton.js";
|
|
5
7
|
import { PipelineResourceStatusField } from "../../../../components/resource/types.js";
|
|
6
8
|
import { createResourceColumnSelections, createResourcePartitionSelections, getEffectiveColumnSelection, getEffectivePartitionSelection, getLockedColumnNames } from "../../../../components/resource/utils.js";
|
|
7
9
|
import "../../../constants.js";
|
|
8
10
|
import { getDefaultDestinationResource, getEdgeFieldError, getEdgeResourceStatus } from "../../../utils.js";
|
|
9
11
|
import { usePipelineCanvasActions, usePipelineCanvasReadOnly } from "../../../providers/canvas/PipelineCanvasProvider.js";
|
|
12
|
+
import { usePipelineCanvasConnections } from "../../../hooks/usePipelineCanvasConnections.js";
|
|
10
13
|
import { usePipelineCanvasSelection } from "../../../hooks/usePipelineCanvasSelection.js";
|
|
11
14
|
import PipelineCanvasPanelSection from "../../PipelineCanvasPanelSection.js";
|
|
12
15
|
import PipelineCanvasPanelHeader from "../../PipelineCanvasPanelHeader.js";
|
|
@@ -39,6 +42,7 @@ var PipelineCanvasPanelResourceDetail = ({ edge }) => {
|
|
|
39
42
|
const isReadOnly = usePipelineCanvasReadOnly();
|
|
40
43
|
const { clearSelection, setShowPanel } = usePipelineCanvasSelection();
|
|
41
44
|
const { setEdgeConfig, applyEdgeChanges } = usePipelineCanvasActions();
|
|
45
|
+
const sourceConnection = usePipelineCanvasConnections().get(edge.source);
|
|
42
46
|
const options = usePipelineCanvasPanelResourceOptions(edge);
|
|
43
47
|
const { isContinuous, hasReadLevers, isTransformable, isLoading, isLoadingColumns, sourceConnectionId, resource, columns, verdict, readModeOptions, writeModeOptions, effectiveReadMode, effectiveWriteMode, cursorOptions, defaultCursor, isManagedIncremental, isColumnSelectable, partitions } = options;
|
|
44
48
|
const { configuredReadMode, configuredWriteMode, readMode, writeMode, cursors, cursor, readModeSelectOptions, writeModeSelectOptions, handleReadModeChange, handleWriteModeChange, handleCursorChange } = usePipelineCanvasEdgeConfig(edge, {
|
|
@@ -158,6 +162,13 @@ var PipelineCanvasPanelResourceDetail = ({ edge }) => {
|
|
|
158
162
|
children: resource
|
|
159
163
|
})
|
|
160
164
|
}),
|
|
165
|
+
sourceConnection && isWebhookConnector(sourceConnection.connector) && /* @__PURE__ */ jsx(KeyValueListRow, {
|
|
166
|
+
label: "Endpoint",
|
|
167
|
+
value: /* @__PURE__ */ jsx(WebhookDeliveryUrlCopyButton, {
|
|
168
|
+
sourceConnectionId: sourceConnection.id,
|
|
169
|
+
resource
|
|
170
|
+
})
|
|
171
|
+
}),
|
|
161
172
|
/* @__PURE__ */ jsx(KeyValueListRow, {
|
|
162
173
|
label: "Sink",
|
|
163
174
|
value: /* @__PURE__ */ jsx(PipelineCanvasPanelResourceEndpoint, {
|
package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceEndpoint.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectorTileSize } from "../../../../../../components/connections/types.js";
|
|
2
2
|
import ConnectorTile from "../../../../../../components/connections/ConnectorTile.js";
|
|
3
|
-
import { usePipelineCanvasSelection } from "../../../hooks/usePipelineCanvasSelection.js";
|
|
4
3
|
import { usePipelineCanvasConnections } from "../../../hooks/usePipelineCanvasConnections.js";
|
|
4
|
+
import { usePipelineCanvasSelection } from "../../../hooks/usePipelineCanvasSelection.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import Text, { TextSize } from "@galaxy-io/dls/text/Text";
|
package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceSection.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConnectorKind, ExecutionMode } from "../../../../../../gen/ingestion/v1/common_pb.js";
|
|
2
2
|
import { PipelineCanvasNodeType } from "../../../types.js";
|
|
3
|
+
import { isWebhookConnector } from "../../../../../../components/webhooks/utils.js";
|
|
3
4
|
import { ConnectorTileSize } from "../../../../../../components/connections/types.js";
|
|
4
5
|
import ConnectorTile from "../../../../../../components/connections/ConnectorTile.js";
|
|
5
6
|
import PipelineResourceCreateForm from "../../../../components/resource/PipelineResourceCreateForm.js";
|
|
@@ -8,10 +9,10 @@ import { isConnectionNode } from "../../../utils.js";
|
|
|
8
9
|
import { getCanvasEdgeResource } from "../../../graph/serialize.js";
|
|
9
10
|
import { canConnectEdge } from "../../../graph/rules.js";
|
|
10
11
|
import { usePipelineCanvasActions, usePipelineCanvasReadOnly, usePipelineCanvasState } from "../../../providers/canvas/PipelineCanvasProvider.js";
|
|
12
|
+
import { usePipelineCanvasConnections } from "../../../hooks/usePipelineCanvasConnections.js";
|
|
11
13
|
import { usePipelineCanvasSelection } from "../../../hooks/usePipelineCanvasSelection.js";
|
|
12
14
|
import PipelineTransformFieldsMarker from "../../../../components/transform/PipelineTransformFieldsMarker.js";
|
|
13
15
|
import { PIPELINE_CANVAS_NODE_TYPE_TO_RESOURCE_EMPTY_MESSAGE_MAP } from "../../constants.js";
|
|
14
|
-
import { usePipelineCanvasConnections } from "../../../hooks/usePipelineCanvasConnections.js";
|
|
15
16
|
import PipelineCanvasPanelItem from "../PipelineCanvasPanelItem.js";
|
|
16
17
|
import PipelineCanvasPanelSection from "../../PipelineCanvasPanelSection.js";
|
|
17
18
|
import { usePipelineExecutionMode } from "../../../../hooks/usePipelineExecutionMode.js";
|
|
@@ -45,6 +46,7 @@ var PipelineCanvasPanelResourceSection = ({ edges, nodeId, nodeType = PipelineCa
|
|
|
45
46
|
const sourceNode = connectionNodes.find((node) => node.type === PipelineCanvasNodeType.SOURCE);
|
|
46
47
|
const sinkNodes = connectionNodes.filter((node) => node.type === PipelineCanvasNodeType.SINK && (nodeType !== PipelineCanvasNodeType.SINK || node.id === nodeId));
|
|
47
48
|
const canCreate = isContinuous && !isReadOnly && !!sourceNode && sinkNodes.length > 0;
|
|
49
|
+
const isWebhook = isWebhookConnector(sourceNode ? connectionByNodeId.get(sourceNode.id)?.connector : void 0);
|
|
48
50
|
const getCreateError = ({ resource, sinkId }) => sourceNode && canConnectEdge({
|
|
49
51
|
source: sourceNode.id,
|
|
50
52
|
sourceHandle: resource,
|
|
@@ -95,6 +97,7 @@ var PipelineCanvasPanelResourceSection = ({ edges, nodeId, nodeType = PipelineCa
|
|
|
95
97
|
})),
|
|
96
98
|
getError: getCreateError,
|
|
97
99
|
onSave: handleCreate,
|
|
100
|
+
isWebhook,
|
|
98
101
|
onCancel: () => setLocalState((prev) => ({
|
|
99
102
|
...prev,
|
|
100
103
|
isCreating: false
|
|
@@ -3,8 +3,8 @@ import { PipelineCanvasValidationIssueKind } from "../../types.js";
|
|
|
3
3
|
import { getTransformStepCount } from "../../utils.js";
|
|
4
4
|
import { getCanvasEdgeResource } from "../../graph/serialize.js";
|
|
5
5
|
import { usePipelineCanvasState } from "../../providers/canvas/PipelineCanvasProvider.js";
|
|
6
|
-
import { usePipelineCanvasValidation } from "../../hooks/usePipelineCanvasValidation.js";
|
|
7
6
|
import { usePipelineCanvasConnections } from "../../hooks/usePipelineCanvasConnections.js";
|
|
7
|
+
import { usePipelineCanvasValidation } from "../../hooks/usePipelineCanvasValidation.js";
|
|
8
8
|
import { usePipelineExecutionMode } from "../../../hooks/usePipelineExecutionMode.js";
|
|
9
9
|
import { getPipelineCanvasRouteGroupKey } from "../utils.js";
|
|
10
10
|
import { useMemo } from "react";
|
|
@@ -3,6 +3,7 @@ import { useFilamentNavigate } from "../../../../../module/hooks.js";
|
|
|
3
3
|
import { getErrorMessage } from "../../../../../utils/errors.js";
|
|
4
4
|
import { useCreatePipelineMutation } from "../../../../../api/queries/pipelines.js";
|
|
5
5
|
import { useCreatePipelineModalActions, useCreatePipelineModalState } from "../CreatePipelineModalProvider.js";
|
|
6
|
+
import { useWebhookEndpointSync } from "../../../../../components/webhooks/hooks/useWebhookEndpointSync.js";
|
|
6
7
|
import { mapCreatePipelineNotifierToRequest, mapCreatePipelineStateToRequest, mapCreatePipelineStateToVersionRequest } from "../serialize.js";
|
|
7
8
|
import { useCreatePipelineNotifierMutation } from "../../../../../api/queries/notifiers.js";
|
|
8
9
|
import { useCreatePipelineVersionMutation } from "../../../../../api/queries/pipeline_versions.js";
|
|
@@ -23,6 +24,7 @@ var CreatePipelineModalFooter = () => {
|
|
|
23
24
|
const { mutate: createPipeline } = useCreatePipelineMutation();
|
|
24
25
|
const { mutate: createPipelineVersion } = useCreatePipelineVersionMutation();
|
|
25
26
|
const { mutateAsync: createPipelineNotifier } = useCreatePipelineNotifierMutation();
|
|
27
|
+
const syncWebhookEndpoint = useWebhookEndpointSync();
|
|
26
28
|
const { isBackVisible, isLastStep, isNextDisabled, isSubmitting, hints } = state;
|
|
27
29
|
const handleNavigateToCanvas = (pipelineId) => {
|
|
28
30
|
navigate({
|
|
@@ -62,11 +64,15 @@ var CreatePipelineModalFooter = () => {
|
|
|
62
64
|
pipelineId
|
|
63
65
|
});
|
|
64
66
|
createPipelineVersion(versionRequest, {
|
|
65
|
-
onSuccess: () => {
|
|
67
|
+
onSuccess: async () => {
|
|
66
68
|
toast({
|
|
67
69
|
variant: ToastVariant.SUCCESS,
|
|
68
70
|
header: "Pipeline created"
|
|
69
71
|
});
|
|
72
|
+
await syncWebhookEndpoint({
|
|
73
|
+
sourceConnection: state.sourceConnection,
|
|
74
|
+
pipelineId
|
|
75
|
+
});
|
|
70
76
|
handleFinish(pipelineId, state.notifiers);
|
|
71
77
|
},
|
|
72
78
|
onError: (error) => {
|
|
@@ -3,8 +3,8 @@ import { PipelineEdgeSchema, PipelineGraphSchema, PipelineNodeSchema, ResourceCo
|
|
|
3
3
|
import { DiscoverResourcesRequestSchema, GetResourceColumnsRequestSchema, ResourceSchema } from "../../../../../gen/ingestion/v1/connectors_pb.js";
|
|
4
4
|
import { ValidatePipelineRequestSchema } from "../../../../../gen/ingestion/v1/capabilities_pb.js";
|
|
5
5
|
import { useDiscoverResourcesQuery, useGetResourceColumnsQuery } from "../../../../../api/queries/connectors.js";
|
|
6
|
-
import { useValidatePipelineQuery } from "../../../../../api/queries/capabilities.js";
|
|
7
6
|
import { PROBE_QUERY_OPTIONS } from "../../../../../api/queries/constants.js";
|
|
7
|
+
import { useValidatePipelineQuery } from "../../../../../api/queries/capabilities.js";
|
|
8
8
|
import { CREATE_PIPELINE_MODAL_DEFAULT_WRITE_MODE } from "../constants.js";
|
|
9
9
|
import { PipelineResourceStatusField } from "../../resource/types.js";
|
|
10
10
|
import { createResourceRowsBySink, createSinkRows, getIssuesBySink, getSelectedCountBySink, isResourceSelected } from "../rows.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExecutionMode } from "../../../../../gen/ingestion/v1/common_pb.js";
|
|
2
2
|
import { IS_DEBUG } from "../../../../../constants.js";
|
|
3
|
+
import { isWebhookConnector } from "../../../../../components/webhooks/utils.js";
|
|
3
4
|
import { useCreatePipelineModalActions, useCreatePipelineModalState } from "../CreatePipelineModalProvider.js";
|
|
4
5
|
import CreatePipelineModalResourcesTable from "./components/CreatePipelineModalResourcesTable.js";
|
|
5
6
|
import CreatePipelineModalResourcesTabs from "./components/CreatePipelineModalResourcesTabs.js";
|
|
@@ -21,10 +22,11 @@ var DEFAULT_RESOURCES_STATE = {
|
|
|
21
22
|
isCreating: false
|
|
22
23
|
};
|
|
23
24
|
var CreatePipelineModalResources = ({ activeRow, onActiveResourceChange }) => {
|
|
24
|
-
const { rowsBySink, sinks, activeSinkId, discoverError, executionMode } = useCreatePipelineModalState();
|
|
25
|
+
const { rowsBySink, sinks, activeSinkId, discoverError, executionMode, sourceConnection } = useCreatePipelineModalState();
|
|
25
26
|
const { addResource } = useCreatePipelineModalActions();
|
|
26
27
|
const [localState, setLocalState] = useState(DEFAULT_RESOURCES_STATE);
|
|
27
28
|
const isContinuous = executionMode === ExecutionMode.CONTINUOUS;
|
|
29
|
+
const isWebhook = isWebhookConnector(sourceConnection?.connector);
|
|
28
30
|
const rows = rowsBySink[activeSinkId] ?? [];
|
|
29
31
|
const filteredRows = useMemo(() => rows.filter((row) => isSearchMatch(localState.search, row.displayName)), [rows, localState.search]);
|
|
30
32
|
const activeSink = sinks.find((sink) => sink.connection.id === activeSinkId);
|
|
@@ -97,7 +99,8 @@ var CreatePipelineModalResources = ({ activeRow, onActiveResourceChange }) => {
|
|
|
97
99
|
getError: getCreateError,
|
|
98
100
|
onSave: handleCreate,
|
|
99
101
|
onCancel: () => setCreating(false),
|
|
100
|
-
variant: WidgetVariant.PRIMARY
|
|
102
|
+
variant: WidgetVariant.PRIMARY,
|
|
103
|
+
isWebhook
|
|
101
104
|
}), /* @__PURE__ */ jsx(Divider, {})] }),
|
|
102
105
|
/* @__PURE__ */ jsx(CreatePipelineModalResourcesTable, {
|
|
103
106
|
rows: filteredRows,
|
package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesTable.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { isWebhookConnector } from "../../../../../../components/webhooks/utils.js";
|
|
1
2
|
import { useCreatePipelineModalActions, useCreatePipelineModalState } from "../../CreatePipelineModalProvider.js";
|
|
2
3
|
import CreatePipelineModalResourcesCursorCell from "./CreatePipelineModalResourcesCursorCell.js";
|
|
3
4
|
import CreatePipelineModalResourcesReadModeCell from "./CreatePipelineModalResourcesReadModeCell.js";
|
|
5
|
+
import CreatePipelineModalResourcesUrlCell from "./CreatePipelineModalResourcesUrlCell.js";
|
|
4
6
|
import CreatePipelineModalResourcesWriteModeCell from "./CreatePipelineModalResourcesWriteModeCell.js";
|
|
5
7
|
import PipelineResourceColumnsChip from "../../../resource/PipelineResourceColumnsChip.js";
|
|
6
8
|
import { CaretRightIcon, MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
@@ -59,6 +61,11 @@ var OPEN_COLUMN_PINNED = {
|
|
|
59
61
|
pin: Side.RIGHT
|
|
60
62
|
};
|
|
61
63
|
var RESOURCE_COLUMNS_BASE = [NAME_COLUMN];
|
|
64
|
+
var RESOURCE_COLUMNS_WEBHOOK = [NAME_COLUMN, {
|
|
65
|
+
id: "receivesAt",
|
|
66
|
+
header: "Endpoint",
|
|
67
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(CreatePipelineModalResourcesUrlCell, { row })
|
|
68
|
+
}];
|
|
62
69
|
var RESOURCE_COLUMNS_WITH_LEVERS = [
|
|
63
70
|
NAME_COLUMN,
|
|
64
71
|
{
|
|
@@ -84,7 +91,7 @@ var RESOURCE_COLUMNS_WITH_LEVERS = [
|
|
|
84
91
|
}
|
|
85
92
|
];
|
|
86
93
|
var CreatePipelineModalResourcesTable = ({ rows, activeRow, onActiveResourceChange }) => {
|
|
87
|
-
const { activeSinkId, hasReadLevers, isLoading } = useCreatePipelineModalState();
|
|
94
|
+
const { activeSinkId, hasReadLevers, isLoading, sourceConnection } = useCreatePipelineModalState();
|
|
88
95
|
const { setResourceSelection } = useCreatePipelineModalActions();
|
|
89
96
|
const selectedNames = useMemo(() => rows.filter((row) => row.isSelected).map((row) => row.name), [rows]);
|
|
90
97
|
const handleSelectionChange = (names) => setResourceSelection({
|
|
@@ -97,10 +104,16 @@ var CreatePipelineModalResourcesTable = ({ rows, activeRow, onActiveResourceChan
|
|
|
97
104
|
onActiveResourceChange(row.name === activeRow?.name ? void 0 : row.name);
|
|
98
105
|
};
|
|
99
106
|
const hasColumnSelection = rows.some((row) => row.isColumnSelectable);
|
|
107
|
+
const isWebhook = isWebhookConnector(sourceConnection?.connector);
|
|
100
108
|
const columns = useMemo(() => {
|
|
109
|
+
if (isWebhook) return RESOURCE_COLUMNS_WEBHOOK;
|
|
101
110
|
if (!hasColumnSelection) return hasReadLevers ? RESOURCE_COLUMNS_WITH_LEVERS : RESOURCE_COLUMNS_BASE;
|
|
102
111
|
return hasReadLevers ? [...RESOURCE_COLUMNS_WITH_LEVERS, OPEN_COLUMN_PINNED] : [...RESOURCE_COLUMNS_BASE, OPEN_COLUMN];
|
|
103
|
-
}, [
|
|
112
|
+
}, [
|
|
113
|
+
hasReadLevers,
|
|
114
|
+
hasColumnSelection,
|
|
115
|
+
isWebhook
|
|
116
|
+
]);
|
|
104
117
|
return /* @__PURE__ */ jsx(FlexItem, {
|
|
105
118
|
grow: 1,
|
|
106
119
|
basis: 0,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CreatePipelineModalResourceRow } from '../../types';
|
|
3
|
+
interface CreatePipelineModalResourcesUrlCellProps {
|
|
4
|
+
row: CreatePipelineModalResourceRow;
|
|
5
|
+
}
|
|
6
|
+
declare const CreatePipelineModalResourcesUrlCell: FC<CreatePipelineModalResourcesUrlCellProps>;
|
|
7
|
+
export default CreatePipelineModalResourcesUrlCell;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createWebhookDeliveryUrl } from "../../../../../../components/webhooks/utils.js";
|
|
2
|
+
import { createGetWebhookEndpointInput, useGetWebhookEndpointQuery } from "../../../../../../api/queries/webhooks.js";
|
|
3
|
+
import { useCreatePipelineModalState } from "../../CreatePipelineModalProvider.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import Text, { TextSize, TextVariant } from "@galaxy-io/dls/text/Text";
|
|
6
|
+
import { FontFamily } from "@galaxy-io/dls/theme/enums";
|
|
7
|
+
//#region src/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesUrlCell.tsx
|
|
8
|
+
var CreatePipelineModalResourcesUrlCell = ({ row }) => {
|
|
9
|
+
const { sourceConnection } = useCreatePipelineModalState();
|
|
10
|
+
const sourceConnectionId = sourceConnection?.id ?? "";
|
|
11
|
+
const { data } = useGetWebhookEndpointQuery({
|
|
12
|
+
input: createGetWebhookEndpointInput(sourceConnectionId),
|
|
13
|
+
options: {
|
|
14
|
+
enabled: sourceConnectionId !== "",
|
|
15
|
+
retry: false
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
19
|
+
size: TextSize.BODY_SM,
|
|
20
|
+
variant: TextVariant.SECONDARY,
|
|
21
|
+
family: FontFamily.MONO,
|
|
22
|
+
lineClamp: 1,
|
|
23
|
+
children: createWebhookDeliveryUrl(row.name, data?.endpoint?.deliveryUrl) ?? "URL unavailable"
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { CreatePipelineModalResourcesUrlCell as default };
|