@manta-eu/react 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/components/chart/AreaChart.d.ts.map +1 -1
- package/dist/components/chart/AreaChart.js +4 -6
- package/dist/components/chart/BarChart.d.ts.map +1 -1
- package/dist/components/chart/BarChart.js +5 -6
- package/dist/components/chart/ComposedChart.d.ts.map +1 -1
- package/dist/components/chart/ComposedChart.js +15 -7
- package/dist/components/chart/LineChart.d.ts.map +1 -1
- package/dist/components/chart/LineChart.js +4 -6
- package/dist/components/chart/annotations.d.ts +4 -0
- package/dist/components/chart/annotations.d.ts.map +1 -1
- package/dist/components/chart/annotations.js +10 -2
- package/dist/components/chart/chart-schemas.d.ts +1960 -54
- package/dist/components/chart/chart-schemas.d.ts.map +1 -1
- package/dist/components/chart/chart-schemas.js +137 -15
- package/dist/components/chart/series.d.ts +28 -0
- package/dist/components/chart/series.d.ts.map +1 -0
- package/dist/components/chart/series.js +61 -0
- package/dist/components/chart/stacks.d.ts +9 -0
- package/dist/components/chart/stacks.d.ts.map +1 -0
- package/dist/components/chart/stacks.js +11 -0
- package/dist/components/chat-view/ChatHeaders.d.ts.map +1 -1
- package/dist/components/chat-view/ChatHeaders.js +2 -2
- package/dist/components/layouts/Sidebar.d.ts.map +1 -1
- package/dist/components/layouts/Sidebar.js +14 -3
- package/dist/components/planning/ActioningView.d.ts +1 -0
- package/dist/components/planning/ActioningView.d.ts.map +1 -1
- package/dist/components/planning/ActioningView.js +15 -52
- package/dist/components/planning/ExecutionSectionItem.d.ts +6 -4
- package/dist/components/planning/ExecutionSectionItem.d.ts.map +1 -1
- package/dist/components/planning/ExecutionSectionItem.js +2 -2
- package/dist/components/planning/ExecutionSections.d.ts +6 -4
- package/dist/components/planning/ExecutionSections.d.ts.map +1 -1
- package/dist/components/planning/ExecutionSections.js +2 -2
- package/dist/components/planning/ManualActionCard.d.ts +14 -8
- package/dist/components/planning/ManualActionCard.d.ts.map +1 -1
- package/dist/components/planning/ManualActionCard.js +44 -24
- package/dist/components/planning/ManualActionList.d.ts +22 -0
- package/dist/components/planning/ManualActionList.d.ts.map +1 -0
- package/dist/components/planning/ManualActionList.js +35 -0
- package/dist/components/planning/manual-action-targets.d.ts +4 -0
- package/dist/components/planning/manual-action-targets.d.ts.map +1 -0
- package/dist/components/planning/manual-action-targets.js +19 -0
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +4 -1
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/sidebar/index.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +1 -0
- package/dist/components/sidebar/nav-user.d.ts +1 -1
- package/dist/components/sidebar/nav-user.d.ts.map +1 -1
- package/dist/components/sidebar/nav-user.js +3 -3
- package/dist/components/sidebar/user-avatar.d.ts +7 -0
- package/dist/components/sidebar/user-avatar.d.ts.map +1 -0
- package/dist/components/sidebar/user-avatar.js +9 -0
- package/dist/globals.css +6 -13
- package/dist/hooks/use-connection-problems.d.ts.map +1 -1
- package/dist/hooks/use-manual-actions.d.ts +13 -3
- package/dist/hooks/use-manual-actions.d.ts.map +1 -1
- package/dist/hooks/use-manual-actions.js +16 -10
- package/dist/hooks/useAuth.d.ts +1 -0
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +7 -1
- package/dist/hooks/useConversations.d.ts +1 -0
- package/dist/hooks/useConversations.d.ts.map +1 -1
- package/dist/hooks/useResolveManualAction.d.ts +14 -0
- package/dist/hooks/useResolveManualAction.d.ts.map +1 -0
- package/dist/hooks/useResolveManualAction.js +47 -0
- package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
- package/dist/ldo-ui.d.ts +2 -1
- package/dist/ldo-ui.d.ts.map +1 -1
- package/dist/ldo-ui.js +2 -1
- package/dist/lib/build-config.d.ts +2 -0
- package/dist/lib/build-config.d.ts.map +1 -1
- package/dist/lib/build-config.js +2 -0
- package/dist/lib/chat-types.d.ts +1 -0
- package/dist/lib/chat-types.d.ts.map +1 -1
- package/dist/lib/datastore-route-table.d.ts +2 -0
- package/dist/lib/datastore-route-table.d.ts.map +1 -1
- package/dist/lib/datastore-route-table.js +3 -1
- package/dist/lib/datastore-routes.d.ts +7 -1
- package/dist/lib/datastore-routes.d.ts.map +1 -1
- package/dist/lib/datastore-routes.js +7 -2
- package/dist/lib/decode-chart-entities.d.ts.map +1 -1
- package/dist/lib/decode-chart-entities.js +5 -1
- package/dist/lib/manual-actions.d.ts +1 -0
- package/dist/lib/manual-actions.d.ts.map +1 -1
- package/dist/lib/manual-actions.js +4 -1
- package/dist/lib/structured-data/types.d.ts +7 -2
- package/dist/lib/structured-data/types.d.ts.map +1 -1
- package/dist/providers/ChatManagerProvider.d.ts.map +1 -1
- package/dist/providers/ChatManagerProvider.js +18 -16
- package/dist/providers/NavExtrasProvider.d.ts +23 -0
- package/dist/providers/NavExtrasProvider.d.ts.map +1 -0
- package/dist/providers/NavExtrasProvider.js +10 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +1 -0
- package/dist/routes/explain/ExplainEmpty.d.ts.map +1 -1
- package/dist/routes/explain/ExplainEmpty.js +2 -1
- package/dist/routes/integrations/catalog-shape.d.ts +2 -1
- package/dist/routes/integrations/catalog-shape.d.ts.map +1 -1
- package/dist/routes/integrations/components/AddIntegrationModal.d.ts.map +1 -1
- package/dist/routes/integrations/components/AddIntegrationModal.js +1 -1
- package/dist/routes/integrations/components/MantaSyncPluginDownload.d.ts +13 -0
- package/dist/routes/integrations/components/MantaSyncPluginDownload.d.ts.map +1 -0
- package/dist/routes/integrations/components/MantaSyncPluginDownload.js +23 -0
- package/dist/routes/integrations/components/connect-forms/ConnectFormHeader.d.ts +1 -1
- package/dist/routes/integrations/components/connect-forms/ConnectFormHeader.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/ConnectWizardShell.d.ts +1 -1
- package/dist/routes/integrations/components/connect-forms/ConnectWizardShell.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/ConnectionStringInput.d.ts +11 -0
- package/dist/routes/integrations/components/connect-forms/ConnectionStringInput.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/ConnectionStringInput.js +49 -0
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.d.ts +7 -0
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.js +87 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionConnectForm.d.ts +20 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionConnectForm.js +144 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionFieldInputs.d.ts +8 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionFieldInputs.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionFieldInputs.js +44 -0
- package/dist/routes/integrations/components/connect-forms/FigmaConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/FigmaConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/FigmaConnectForm.js +20 -0
- package/dist/routes/integrations/components/connect-forms/GmailConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/GmailConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/GmailConnectForm.js +11 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.js +37 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.js +37 -0
- package/dist/routes/integrations/components/connect-forms/ImportStartedNotice.d.ts +21 -0
- package/dist/routes/integrations/components/connect-forms/ImportStartedNotice.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/ImportStartedNotice.js +25 -0
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts +45 -0
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.js +188 -0
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.d.ts +6 -0
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.js +68 -0
- package/dist/routes/integrations/components/connect-forms/LinkedinConnectForm.d.ts +10 -0
- package/dist/routes/integrations/components/connect-forms/LinkedinConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/LinkedinConnectForm.js +124 -0
- package/dist/routes/integrations/components/connect-forms/MetaAdsConnectForm.d.ts +14 -0
- package/dist/routes/integrations/components/connect-forms/MetaAdsConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/MetaAdsConnectForm.js +183 -0
- package/dist/routes/integrations/components/connect-forms/OAuthConnectLink.d.ts +10 -0
- package/dist/routes/integrations/components/connect-forms/OAuthConnectLink.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/OAuthConnectLink.js +17 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts +45 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.js +136 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSingleAccountConnectForm.d.ts +23 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSingleAccountConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSingleAccountConnectForm.js +63 -0
- package/dist/routes/integrations/components/connect-forms/ShopifyConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/ShopifyConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/ShopifyConnectForm.js +14 -0
- package/dist/routes/integrations/components/connect-forms/SlackConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/SlackConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/SlackConnectForm.js +10 -0
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.d.ts +5 -0
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.js +35 -0
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.d.ts +5 -0
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.js +47 -0
- package/dist/routes/integrations/components/connect-forms/connection-string-fields.d.ts +13 -0
- package/dist/routes/integrations/components/connect-forms/connection-string-fields.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/connection-string-fields.js +110 -0
- package/dist/routes/integrations/components/connect-forms/dash-folder-tree.d.ts +6 -0
- package/dist/routes/integrations/components/connect-forms/dash-folder-tree.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/dash-folder-tree.js +14 -0
- package/dist/routes/integrations/components/connect-forms/data-connection-fields.d.ts +35 -0
- package/dist/routes/integrations/components/connect-forms/data-connection-fields.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/data-connection-fields.js +88 -0
- package/dist/routes/integrations/components/connect-forms/google-ads-account-tree.d.ts +11 -0
- package/dist/routes/integrations/components/connect-forms/google-ads-account-tree.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/google-ads-account-tree.js +36 -0
- package/dist/routes/integrations/components/connect-forms/google-analytics-property-tree.d.ts +6 -0
- package/dist/routes/integrations/components/connect-forms/google-analytics-property-tree.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/google-analytics-property-tree.js +34 -0
- package/dist/routes/integrations/components/connect-forms/oauth-setup-phase.d.ts +12 -0
- package/dist/routes/integrations/components/connect-forms/oauth-setup-phase.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/oauth-setup-phase.js +33 -0
- package/dist/routes/integrations/components/connect-forms/setup-account-unavailable-reason.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/setup-account-unavailable-reason.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/setup-account-unavailable-reason.js +8 -0
- package/dist/routes/integrations/components/connect-forms/types.d.ts +5 -1
- package/dist/routes/integrations/components/connect-forms/types.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/useConnectWizard.d.ts +19 -0
- package/dist/routes/integrations/components/connect-forms/useConnectWizard.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/useConnectWizard.js +28 -0
- package/dist/routes/integrations/components/connect-forms/useConnectedExternalIds.d.ts +4 -0
- package/dist/routes/integrations/components/connect-forms/useConnectedExternalIds.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/useConnectedExternalIds.js +17 -0
- package/dist/routes/integrations/components/connect-forms/useWindowFocusPoll.d.ts +7 -0
- package/dist/routes/integrations/components/connect-forms/useWindowFocusPoll.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/useWindowFocusPoll.js +18 -0
- package/dist/routes/integrations/connect-forms.d.ts +16 -0
- package/dist/routes/integrations/connect-forms.d.ts.map +1 -0
- package/dist/routes/integrations/connect-forms.js +14 -0
- package/dist/routes/integrations/filter-connected-providers.d.ts +3 -0
- package/dist/routes/integrations/filter-connected-providers.d.ts.map +1 -0
- package/dist/routes/integrations/filter-connected-providers.js +15 -0
- package/dist/routes/integrations/overview.d.ts +3 -0
- package/dist/routes/integrations/overview.d.ts.map +1 -0
- package/dist/routes/integrations/overview.js +2 -0
- package/dist/routes/integrations/use-connected-account-entities.d.ts +10 -0
- package/dist/routes/integrations/use-connected-account-entities.d.ts.map +1 -0
- package/dist/routes/integrations/use-connected-account-entities.js +29 -0
- package/dist/routes/memories/components/EmptyStates.d.ts.map +1 -1
- package/dist/routes/memories/components/EmptyStates.js +2 -1
- package/dist/routes/plans/components/ActionPlanPage.d.ts +1 -0
- package/dist/routes/plans/components/ActionPlanPage.d.ts.map +1 -1
- package/dist/routes/plans/components/ActionPlanPage.js +9 -5
- package/dist/routes/plans/components/actionPlansTableConfig.d.ts +12 -12
- package/dist/rules/datalog-ast/DatalogBodyFormulaComponent.d.ts.map +1 -1
- package/dist/rules/datalog-ast/DatalogBodyFormulaComponent.js +4 -1
- package/dist/rules/rule-narrative-aggregates.d.ts +1 -0
- package/dist/rules/rule-narrative-aggregates.d.ts.map +1 -1
- package/dist/rules/rule-narrative-aggregates.js +20 -0
- package/dist/rules/rule-narrative-context.d.ts.map +1 -1
- package/dist/rules/rule-narrative-context.js +3 -9
- package/dist/rules/rule-narrative-format.d.ts +1 -1
- package/dist/rules/rule-narrative.d.ts.map +1 -1
- package/dist/rules/rule-narrative.js +22 -7
- package/package.json +47 -8
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
3
|
+
import { useCreateDataConnectionMutation, useDataConnectorTypesQuery, useUpdateDataConnectionMutation, } from "@manta-eu/client";
|
|
4
|
+
import { parseError } from "@manta-eu/client/shared/error-utils";
|
|
5
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
6
|
+
import { Fragment, useMemo, useState } from "react";
|
|
7
|
+
import { useForm } from "react-hook-form";
|
|
8
|
+
import { toast } from "sonner";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { acceptsConnectionString } from "./connection-string-fields.js";
|
|
11
|
+
import { ConnectionStringInput } from "./ConnectionStringInput.js";
|
|
12
|
+
import { ConnectWizardShell } from "./ConnectWizardShell.js";
|
|
13
|
+
import { blankValues, changedSettings, editableFields, formSchema, nameKey, nameSchema, pickSettings, settingsSchema, storedValues, } from "./data-connection-fields.js";
|
|
14
|
+
import { inputId, renderFields, renderOptionalFields } from "./DataConnectionFieldInputs.js";
|
|
15
|
+
import { ImportStartedStep } from "./ImportStartedNotice.js";
|
|
16
|
+
import { useConnectWizard } from "./useConnectWizard.js";
|
|
17
|
+
import { Input } from "#components/input/index";
|
|
18
|
+
import { useMantaClient } from "#providers/index";
|
|
19
|
+
function nameStep(providerName) {
|
|
20
|
+
return {
|
|
21
|
+
id: "name",
|
|
22
|
+
title: "Name this connection",
|
|
23
|
+
description: `Used to identify this ${providerName} database in Manta.`,
|
|
24
|
+
schema: z.object({ [nameKey]: nameSchema }),
|
|
25
|
+
continueLabel: "Continue",
|
|
26
|
+
render: (form) => (_jsx(Input, { id: inputId(nameKey), label: "Name", placeholder: "Warehouse", autoComplete: "off", error: form.formState.errors[nameKey]?.message?.toString(), ...form.register(nameKey) })),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function connectionStep(args) {
|
|
30
|
+
const { providerName, connectorType, stepFields, allFields, editing } = args;
|
|
31
|
+
return {
|
|
32
|
+
id: "connection",
|
|
33
|
+
title: "Enter the connection details",
|
|
34
|
+
description: editing
|
|
35
|
+
? "Manta tests new settings before it uses them. Until then, the stored settings keep syncing."
|
|
36
|
+
: `Manta tests the connection before it syncs the ${providerName} tables.`,
|
|
37
|
+
schema: settingsSchema(stepFields),
|
|
38
|
+
continueLabel: "Continue",
|
|
39
|
+
render: (form) => (_jsxs("div", { className: "grid gap-4", children: [acceptsConnectionString(connectorType) && (_jsx(ConnectionStringInput, { form: form, connectorType: connectorType, allFields: allFields, stepFields: stepFields })), renderFields(form, stepFields, editing)] })),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function optionalStep(fields, editing) {
|
|
43
|
+
return {
|
|
44
|
+
id: "optional",
|
|
45
|
+
title: "Optional settings",
|
|
46
|
+
description: editing ? "Leave a secret blank to keep its stored value." : "Leave a field blank to use its default.",
|
|
47
|
+
schema: settingsSchema(fields),
|
|
48
|
+
continueLabel: "Continue",
|
|
49
|
+
render: (form) => renderOptionalFields(form, fields, editing),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function withSubmitLabel(steps, label) {
|
|
53
|
+
return steps.map((step, index) => (index === steps.length - 1 ? { ...step, continueLabel: label } : step));
|
|
54
|
+
}
|
|
55
|
+
export function createSteps(providerName, connectorType, fields, editing = false) {
|
|
56
|
+
const required = fields.filter((field) => field.required);
|
|
57
|
+
const optional = fields.filter((field) => !field.required);
|
|
58
|
+
const steps = [
|
|
59
|
+
nameStep(providerName),
|
|
60
|
+
connectionStep({ providerName, connectorType, stepFields: required, allFields: fields, editing }),
|
|
61
|
+
...(isPresent(optional) ? [optionalStep(optional, editing)] : []),
|
|
62
|
+
];
|
|
63
|
+
return withSubmitLabel(steps, editing ? "Save" : "Connect");
|
|
64
|
+
}
|
|
65
|
+
function DataConnectionWizard(props) {
|
|
66
|
+
const { provider, connectorType, fields, stored, status, onBack, onChanged, onDismiss, importNotice } = props;
|
|
67
|
+
const editing = stored !== undefined;
|
|
68
|
+
const showsImportNotice = !editing && importNotice !== undefined;
|
|
69
|
+
const [created, setCreated] = useState(false);
|
|
70
|
+
const formFields = useMemo(() => (editing ? editableFields(fields) : fields), [editing, fields]);
|
|
71
|
+
const steps = useMemo(() => createSteps(provider.name, connectorType, formFields, editing), [provider.name, connectorType, formFields, editing]);
|
|
72
|
+
const fullSchema = useMemo(() => formSchema(formFields), [formFields]);
|
|
73
|
+
const { mantaClient } = useMantaClient();
|
|
74
|
+
const createMutation = useCreateDataConnectionMutation(mantaClient);
|
|
75
|
+
const updateMutation = useUpdateDataConnectionMutation(mantaClient);
|
|
76
|
+
const form = useForm({
|
|
77
|
+
resolver: zodResolver(fullSchema),
|
|
78
|
+
defaultValues: stored ? storedValues(stored, fields) : blankValues(fields),
|
|
79
|
+
mode: "onChange",
|
|
80
|
+
});
|
|
81
|
+
async function create(values) {
|
|
82
|
+
await createMutation.mutateAsync({
|
|
83
|
+
input: { name: values[nameKey], connectorType, settings: pickSettings(values, fields) },
|
|
84
|
+
});
|
|
85
|
+
toast.success(`${provider.name} added`, { description: "Manta is testing the connection." });
|
|
86
|
+
}
|
|
87
|
+
async function update(values, connection) {
|
|
88
|
+
const changed = changedSettings(values, fields, connection);
|
|
89
|
+
await updateMutation.mutateAsync({
|
|
90
|
+
input: { id: connection.id, name: values[nameKey], settings: isPresent(changed) ? changed : undefined },
|
|
91
|
+
});
|
|
92
|
+
toast.success(`${provider.name} saved`, {
|
|
93
|
+
description: isPresent(changed) ? "Manta is testing the new settings." : undefined,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
async function onValid(values) {
|
|
97
|
+
try {
|
|
98
|
+
await (stored ? update(values, stored) : create(values));
|
|
99
|
+
onChanged();
|
|
100
|
+
if (showsImportNotice)
|
|
101
|
+
setCreated(true);
|
|
102
|
+
else
|
|
103
|
+
onDismiss();
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
const info = parseError(err, `Failed to save ${provider.name}`);
|
|
107
|
+
toast.error(info.message, { description: info.description });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const { stepIndex, currentStep, canAdvance, handleContinue, handleBack } = useConnectWizard({
|
|
111
|
+
steps,
|
|
112
|
+
form,
|
|
113
|
+
fullSchema,
|
|
114
|
+
onSubmit: onValid,
|
|
115
|
+
onBack,
|
|
116
|
+
});
|
|
117
|
+
if (created && importNotice) {
|
|
118
|
+
return (_jsx(ImportStartedStep, { provider: provider, notice: importNotice, status: "Testing", title: `Testing your ${provider.name} connection`, totalSteps: steps.length + 1, onDone: onDismiss }));
|
|
119
|
+
}
|
|
120
|
+
return (_jsx(ConnectWizardShell, { provider: provider, status: status, totalSteps: showsImportNotice ? steps.length + 1 : steps.length, currentStep: stepIndex + 1, stepTitle: currentStep.title, stepDescription: currentStep.description, onBack: handleBack, onContinue: handleContinue, continueLabel: currentStep.continueLabel, continueDisabled: !canAdvance, isSubmitting: createMutation.isPending || updateMutation.isPending, children: _jsx(Fragment, { children: currentStep.render(form) }, currentStep.id) }));
|
|
121
|
+
}
|
|
122
|
+
function ConnectorLoader(props) {
|
|
123
|
+
const { provider, connectorType, onBack, children } = props;
|
|
124
|
+
const { mantaClient } = useMantaClient();
|
|
125
|
+
const { data, error, isLoading } = useDataConnectorTypesQuery(mantaClient);
|
|
126
|
+
const connector = data?.dataConnectorTypes.find((type) => type.connectorType === connectorType);
|
|
127
|
+
if (connector)
|
|
128
|
+
return children(connector.fields);
|
|
129
|
+
const message = isLoading
|
|
130
|
+
? "Loading the connection settings…"
|
|
131
|
+
: parseError(error, `Manta does not support ${provider.name} connections here.`).message;
|
|
132
|
+
return (_jsx(ConnectWizardShell, { provider: provider, totalSteps: 1, currentStep: 1, stepTitle: provider.name, onBack: onBack, continueLabel: "Continue", continueDisabled: true, children: _jsx("p", { role: "status", "aria-live": "polite", className: "typography-caption text-muted-foreground", children: message }) }));
|
|
133
|
+
}
|
|
134
|
+
export function DataConnectionConnectForm(props) {
|
|
135
|
+
const { provider, dataConnectorType, onBack } = props;
|
|
136
|
+
if (!dataConnectorType) {
|
|
137
|
+
throw new Error(`${provider.name} is missing its data connector type`);
|
|
138
|
+
}
|
|
139
|
+
return (_jsx(ConnectorLoader, { provider: provider, connectorType: dataConnectorType, onBack: onBack, children: (fields) => _jsx(DataConnectionWizard, { ...props, connectorType: dataConnectorType, fields: fields }) }));
|
|
140
|
+
}
|
|
141
|
+
export function DataConnectionEditForm(props) {
|
|
142
|
+
const { provider, connectorType, stored, status, onChanged, onDismiss } = props;
|
|
143
|
+
return (_jsx(ConnectorLoader, { provider: provider, connectorType: connectorType, onBack: onDismiss, children: (fields) => (_jsx(DataConnectionWizard, { provider: provider, connectorType: connectorType, fields: fields, stored: stored, status: status, onBack: onDismiss, onChanged: onChanged, onDismiss: onDismiss })) }));
|
|
144
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type UseFormReturn } from "react-hook-form";
|
|
2
|
+
import { type ConnectorField, type DataConnectionValues } from "./data-connection-fields.js";
|
|
3
|
+
export type FormOf = UseFormReturn<DataConnectionValues>;
|
|
4
|
+
export declare function inputId(key: string): string;
|
|
5
|
+
export declare function choiceToValue(choice: string): string;
|
|
6
|
+
export declare function renderFields(form: FormOf, fields: readonly ConnectorField[], editing: boolean): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function renderOptionalFields(form: FormOf, fields: readonly ConnectorField[], editing: boolean): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=DataConnectionFieldInputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataConnectionFieldInputs.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/DataConnectionFieldInputs.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAMlC,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAIzD,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAKD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAwDD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,2CAE7F;AAwBD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,2CAUrG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
3
|
+
import { ChevronRight } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { Controller } from "react-hook-form";
|
|
6
|
+
import { choices, hasCustomValue, isCloudSqlField, } from "./data-connection-fields.js";
|
|
7
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "#components/collapsible/index";
|
|
8
|
+
import { Input } from "#components/input/index";
|
|
9
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "#components/select/index";
|
|
10
|
+
import { cn } from "#lib/utils";
|
|
11
|
+
const keepSecretHint = "Leave blank to keep the stored value";
|
|
12
|
+
export function inputId(key) {
|
|
13
|
+
return `data-connection-${key}`;
|
|
14
|
+
}
|
|
15
|
+
// Radix Select refuses an empty item value, so this marker stands for the blank that keeps the connector default.
|
|
16
|
+
const defaultChoice = "__connector-default__";
|
|
17
|
+
export function choiceToValue(choice) {
|
|
18
|
+
return choice === defaultChoice ? "" : choice;
|
|
19
|
+
}
|
|
20
|
+
function defaultChoiceLabel(field) {
|
|
21
|
+
return isPresent(field.default) ? `Default (${field.default})` : "Default";
|
|
22
|
+
}
|
|
23
|
+
function renderChoiceField(form, field, options) {
|
|
24
|
+
return (_jsx(Controller, { control: form.control, name: field.key, render: ({ field: control, fieldState }) => (_jsxs(Select, { value: control.value ?? "", onValueChange: (choice) => control.onChange(choiceToValue(choice)), children: [_jsx(SelectTrigger, { label: field.title, id: inputId(field.key), className: "w-full h-10", error: fieldState.error?.message, children: _jsx(SelectValue, { placeholder: field.required ? "Select a value" : defaultChoiceLabel(field) }) }), _jsxs(SelectContent, { children: [!field.required && _jsx(SelectItem, { value: defaultChoice, children: defaultChoiceLabel(field) }), options.map((option) => (_jsx(SelectItem, { value: option, children: option }, option)))] })] })) }, field.key));
|
|
25
|
+
}
|
|
26
|
+
function renderField(form, field, editing) {
|
|
27
|
+
const options = choices(field);
|
|
28
|
+
if (options)
|
|
29
|
+
return renderChoiceField(form, field, options);
|
|
30
|
+
return (_jsx(Input, { id: inputId(field.key), label: field.title, description: field.description ?? undefined, descriptionInLabelTooltip: true, type: field.secret ? "password" : undefined, placeholder: editing && field.secret ? keepSecretHint : (field.default ?? undefined), autoComplete: "off", error: form.formState.errors[field.key]?.message?.toString(), ...form.register(field.key) }, field.key));
|
|
31
|
+
}
|
|
32
|
+
export function renderFields(form, fields, editing) {
|
|
33
|
+
return _jsx("div", { className: "grid gap-3", children: fields.map((field) => renderField(form, field, editing)) });
|
|
34
|
+
}
|
|
35
|
+
function CloudSqlSettings(props) {
|
|
36
|
+
const { form, fields, editing } = props;
|
|
37
|
+
const [open, setOpen] = useState(() => hasCustomValue(form.getValues(), fields));
|
|
38
|
+
return (_jsxs(Collapsible, { open: open, onOpenChange: setOpen, className: "grid gap-3", children: [_jsxs(CollapsibleTrigger, { className: "flex items-center gap-2 typography-body text-default-foreground", children: [_jsx(ChevronRight, { "aria-hidden": true, className: cn("size-4 transition-transform", open && "rotate-90") }), "Google Cloud SQL", _jsx("span", { className: "typography-caption text-muted-foreground", children: "Only for a database in Google Cloud SQL" })] }), _jsx(CollapsibleContent, { children: renderFields(form, fields, editing) })] }));
|
|
39
|
+
}
|
|
40
|
+
export function renderOptionalFields(form, fields, editing) {
|
|
41
|
+
const cloudSql = fields.filter(isCloudSqlField);
|
|
42
|
+
const plain = fields.filter((field) => !isCloudSqlField(field));
|
|
43
|
+
return (_jsxs("div", { className: "grid gap-4", children: [renderFields(form, plain, editing), isPresent(cloudSql) && _jsx(CloudSqlSettings, { form: form, fields: cloudSql, editing: editing })] }));
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FigmaConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/FigmaConnectForm.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAShD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,2CAyBvD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { GQLIntegration } from "@manta-eu/client";
|
|
3
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
4
|
+
import { MantaSyncPluginStep } from "../MantaSyncPluginDownload.js";
|
|
5
|
+
import { OAuthSingleAccountConnectForm } from "./OAuthSingleAccountConnectForm.js";
|
|
6
|
+
import { mantaSyncPluginPath } from "#lib/build-config";
|
|
7
|
+
const figmaPermissions = [
|
|
8
|
+
"Read the contents of the files you grant access to.",
|
|
9
|
+
"Read comments on those files.",
|
|
10
|
+
"Post comments back on those files.",
|
|
11
|
+
];
|
|
12
|
+
export function FigmaConnectForm(props) {
|
|
13
|
+
return (_jsx(OAuthSingleAccountConnectForm, { ...props, integration: GQLIntegration.Figma, startHref: "/oauth/figma/start", ctaLabel: "Continue with Figma", stepTitle: "Connect your Figma account", stepDescription: "Manta will take you to Figma to ask for permission, then bring you back here.", supportingInfo: "You'll be taken to Figma to approve access. You can revoke it any time from your Figma account settings.", permissions: figmaPermissions, waitingLabel: "Waiting for you to finish connecting to Figma\u2026", connectedToastLabel: "Figma connected", successStep: isPresent(mantaSyncPluginPath)
|
|
14
|
+
? {
|
|
15
|
+
title: "Install the Manta Sync plugin",
|
|
16
|
+
description: "Manta Sync brings campaign plans onto your canvas, with the reasoning behind each change attached.",
|
|
17
|
+
content: _jsx(MantaSyncPluginStep, { path: mantaSyncPluginPath }),
|
|
18
|
+
}
|
|
19
|
+
: undefined }));
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GmailConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/GmailConnectForm.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,2CAuBvD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { withDatastoreQueryParam } from "@manta-eu/client/shared/datastore-path";
|
|
3
|
+
import { ConnectWizardShell } from "./ConnectWizardShell.js";
|
|
4
|
+
import { useMantaClient } from "#providers/index";
|
|
5
|
+
export function GmailConnectForm(props) {
|
|
6
|
+
const { onBack, provider } = props;
|
|
7
|
+
const { datastoreId } = useMantaClient();
|
|
8
|
+
return (_jsx(ConnectWizardShell, { provider: provider, totalSteps: 1, currentStep: 1, stepTitle: "Connect your Gmail account", stepDescription: "You'll be redirected to Google to grant access, then brought back here.", onBack: onBack, onContinue: () => {
|
|
9
|
+
window.location.href = withDatastoreQueryParam("/oauth/gmail/start", datastoreId);
|
|
10
|
+
}, continueLabel: "Continue with Google", children: _jsx("p", { className: "typography-caption text-muted-foreground", children: "Manta requests read-only Gmail access (gmail.readonly) to ingest inbound email into your knowledge graph. You can revoke it any time from your Google account." }) }));
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleAdsConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/GoogleAdsConnectForm.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAqChD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,2CAa3D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { GQLIntegration, useGoogleSetupConnectMutation, useGoogleSetupProgressQuery, } from "@manta-eu/client";
|
|
3
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { googleAdsTreeItems } from "./google-ads-account-tree.js";
|
|
5
|
+
import { OAuthSetupConnectForm } from "./OAuthSetupConnectForm.js";
|
|
6
|
+
import { useMantaClient } from "#providers/index";
|
|
7
|
+
const copy = {
|
|
8
|
+
providerName: "Google Ads",
|
|
9
|
+
identityProviderName: "Google",
|
|
10
|
+
entitySingular: "account",
|
|
11
|
+
entityPlural: "accounts",
|
|
12
|
+
signInDescription: "We'll take you to Google sign-in so you can grant Manta access to your Google Ads accounts.",
|
|
13
|
+
pickTitle: "Pick the Google Ads accounts to connect",
|
|
14
|
+
pickDescription: "Choose the accounts whose campaigns Manta should manage. Manager accounts hold no campaigns, so only their client accounts can be connected.",
|
|
15
|
+
noEntitiesLabel: "We couldn't find any Google Ads accounts on this Google identity. Sign in with a different account or check your Google Ads access.",
|
|
16
|
+
noneConnectableLabel: "No connectable Google Ads accounts remain on this Google identity — they are already connected, managers, or unavailable. Sign in with a different Google account to connect a new one.",
|
|
17
|
+
};
|
|
18
|
+
function useGoogleAdsSetup() {
|
|
19
|
+
const { mantaClient } = useMantaClient();
|
|
20
|
+
const queryClient = useQueryClient();
|
|
21
|
+
const progressQuery = useGoogleSetupProgressQuery(mantaClient, undefined, { staleTime: 0 });
|
|
22
|
+
const connectMutation = useGoogleSetupConnectMutation(mantaClient);
|
|
23
|
+
const progress = progressQuery.data?.googleSetupProgress;
|
|
24
|
+
return {
|
|
25
|
+
progress: progress && { state: progress.state, rows: progress.accounts, lastError: progress.lastError },
|
|
26
|
+
refetchProgress: progressQuery.refetch,
|
|
27
|
+
resetProgress: () => queryClient.setQueryData(useGoogleSetupProgressQuery.getKey(), {
|
|
28
|
+
googleSetupProgress: { state: [], accounts: null, lastError: null },
|
|
29
|
+
}),
|
|
30
|
+
connect: (accountIds) => connectMutation.mutateAsync({ accountIds }),
|
|
31
|
+
isConnecting: connectMutation.isPending,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function GoogleAdsConnectForm(props) {
|
|
35
|
+
const setup = useGoogleAdsSetup();
|
|
36
|
+
return (_jsx(OAuthSetupConnectForm, { ...props, integration: GQLIntegration.Google, oauthStartPath: "/oauth/google-ads/start", copy: copy, setup: setup, treeItems: googleAdsTreeItems }));
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleAnalyticsConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAsChD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,gBAAgB,2CAajE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { GQLIntegration, useGoogleAnalyticsSetupConnectMutation, useGoogleAnalyticsSetupProgressQuery, } from "@manta-eu/client";
|
|
3
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { googleAnalyticsTreeItems } from "./google-analytics-property-tree.js";
|
|
5
|
+
import { OAuthSetupConnectForm } from "./OAuthSetupConnectForm.js";
|
|
6
|
+
import { useMantaClient } from "#providers/index";
|
|
7
|
+
const copy = {
|
|
8
|
+
providerName: "Google Analytics",
|
|
9
|
+
identityProviderName: "Google",
|
|
10
|
+
entitySingular: "property",
|
|
11
|
+
entityPlural: "properties",
|
|
12
|
+
signInDescription: "We'll take you to Google sign-in so you can grant Manta access to your Google Analytics properties.",
|
|
13
|
+
pickTitle: "Pick the GA4 properties to connect",
|
|
14
|
+
pickDescription: "Choose the properties whose reports Manta should pull. Accounts only group their properties, so only properties can be connected.",
|
|
15
|
+
noEntitiesLabel: "We couldn't find any Google Analytics properties on this Google identity. Sign in with a different account or check your Google Analytics access.",
|
|
16
|
+
noneConnectableLabel: "No connectable Google Analytics properties remain on this Google identity — they are already connected or unavailable. Sign in with a different Google account to connect a new one.",
|
|
17
|
+
};
|
|
18
|
+
function useGoogleAnalyticsSetup() {
|
|
19
|
+
const { mantaClient } = useMantaClient();
|
|
20
|
+
const queryClient = useQueryClient();
|
|
21
|
+
const progressQuery = useGoogleAnalyticsSetupProgressQuery(mantaClient, undefined, { staleTime: 0 });
|
|
22
|
+
const connectMutation = useGoogleAnalyticsSetupConnectMutation(mantaClient);
|
|
23
|
+
const progress = progressQuery.data?.googleAnalyticsSetupProgress;
|
|
24
|
+
return {
|
|
25
|
+
progress: progress && { state: progress.state, rows: progress.properties, lastError: progress.lastError },
|
|
26
|
+
refetchProgress: progressQuery.refetch,
|
|
27
|
+
resetProgress: () => queryClient.setQueryData(useGoogleAnalyticsSetupProgressQuery.getKey(), {
|
|
28
|
+
googleAnalyticsSetupProgress: { state: [], properties: null, lastError: null },
|
|
29
|
+
}),
|
|
30
|
+
connect: (propertyIds) => connectMutation.mutateAsync({ propertyIds }),
|
|
31
|
+
isConnecting: connectMutation.isPending,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function GoogleAnalyticsConnectForm(props) {
|
|
35
|
+
const setup = useGoogleAnalyticsSetup();
|
|
36
|
+
return (_jsx(OAuthSetupConnectForm, { ...props, integration: GQLIntegration.GoogleAnalytics, oauthStartPath: "/oauth/google-analytics/start", copy: copy, setup: setup, treeItems: googleAnalyticsTreeItems }));
|
|
37
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ProviderPresentation } from "../../types.js";
|
|
2
|
+
import type { ConnectSuccessStep } from "./OAuthSingleAccountConnectForm.js";
|
|
3
|
+
import type { ImportNotice } from "./types.js";
|
|
4
|
+
export declare function importStartedTitle(providerName: string): string;
|
|
5
|
+
export declare function importStartedSuccessStep(providerName: string, notice: ImportNotice): ConnectSuccessStep;
|
|
6
|
+
type ImportStartedNoticeProps = {
|
|
7
|
+
providerName: string;
|
|
8
|
+
notice: ImportNotice;
|
|
9
|
+
};
|
|
10
|
+
export declare function ImportStartedNotice(props: ImportStartedNoticeProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
type ImportStartedStepProps = {
|
|
12
|
+
provider: ProviderPresentation<string>;
|
|
13
|
+
notice: ImportNotice;
|
|
14
|
+
totalSteps: number;
|
|
15
|
+
onDone: () => void;
|
|
16
|
+
status?: string;
|
|
17
|
+
title?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function ImportStartedStep(props: ImportStartedStepProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=ImportStartedNotice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImportStartedNotice.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/ImportStartedNotice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAM5C,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE/D;AAMD,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,kBAAkB,CAMvG;AAED,KAAK,wBAAwB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAYlE;AAED,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CA2B9D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ConnectWizardShell } from "./ConnectWizardShell.js";
|
|
3
|
+
import { Button } from "#components/button/index";
|
|
4
|
+
const importTimingNote = "The first import can take a while, depending on how much data there is. You can close this dialog and keep using Manta. Your data will appear once the import finishes.";
|
|
5
|
+
export function importStartedTitle(providerName) {
|
|
6
|
+
return `Importing your ${providerName} data`;
|
|
7
|
+
}
|
|
8
|
+
function ImportTimingNote() {
|
|
9
|
+
return _jsx("p", { className: "typography-caption text-muted-foreground", children: importTimingNote });
|
|
10
|
+
}
|
|
11
|
+
export function importStartedSuccessStep(providerName, notice) {
|
|
12
|
+
return {
|
|
13
|
+
title: importStartedTitle(providerName),
|
|
14
|
+
description: notice.description,
|
|
15
|
+
content: _jsx(ImportTimingNote, {}),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function ImportStartedNotice(props) {
|
|
19
|
+
const { providerName, notice } = props;
|
|
20
|
+
return (_jsxs("div", { className: "grid gap-4", children: [_jsxs("div", { className: "grid gap-1", children: [_jsx("h2", { className: "typography-large-body-semibold text-default-foreground", children: importStartedTitle(providerName) }), _jsx("p", { className: "typography-caption text-muted-foreground", children: notice.description })] }), _jsx(ImportTimingNote, {})] }));
|
|
21
|
+
}
|
|
22
|
+
export function ImportStartedStep(props) {
|
|
23
|
+
const { provider, notice, totalSteps, onDone, status = "Connected", title = importStartedTitle(provider.name), } = props;
|
|
24
|
+
return (_jsx(ConnectWizardShell, { provider: provider, status: status, totalSteps: totalSteps, currentStep: totalSteps, stepTitle: title, stepDescription: notice.description, primaryAction: _jsx(Button, { variant: "secondary", onClick: onDone, children: "Done" }), children: _jsx(ImportTimingNote, {}) }));
|
|
25
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { GQLInferalLocation, type GQLInferalProviderInput } from "@manta-eu/client";
|
|
2
|
+
import type { ConnectFormProps, ProviderSetupInstructions, StepConfig } from "./types.js";
|
|
3
|
+
export type CredentialField<Key extends string = string> = {
|
|
4
|
+
key: Key;
|
|
5
|
+
label: string;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
requiredMessage: string;
|
|
8
|
+
secret?: boolean;
|
|
9
|
+
validate?: {
|
|
10
|
+
check: (value: string) => boolean;
|
|
11
|
+
message: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type CredentialStep<Key extends string = string> = {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
fields: readonly CredentialField<Key>[];
|
|
18
|
+
};
|
|
19
|
+
export type InferalCredentialFormConfig<Key extends string = string> = {
|
|
20
|
+
providerName: string;
|
|
21
|
+
fieldIdPrefix: string;
|
|
22
|
+
identifier: CredentialField<Key> & {
|
|
23
|
+
stepTitle: string;
|
|
24
|
+
stepDescription: string;
|
|
25
|
+
};
|
|
26
|
+
secrets: CredentialStep<Key>;
|
|
27
|
+
settings?: CredentialStep<Key>;
|
|
28
|
+
streamNamePlaceholder: string;
|
|
29
|
+
locationStepDescription: string;
|
|
30
|
+
buildProviderInput: (credentials: Record<Key, string>) => GQLInferalProviderInput;
|
|
31
|
+
};
|
|
32
|
+
export declare function fieldId(prefix: string, key: string): string;
|
|
33
|
+
type Values = {
|
|
34
|
+
streamName: string;
|
|
35
|
+
location: GQLInferalLocation;
|
|
36
|
+
[credential: string]: string;
|
|
37
|
+
};
|
|
38
|
+
export declare function shouldAutofillStreamName(changedField: string | undefined, identifierKey: string, streamNameDirty: boolean): boolean;
|
|
39
|
+
export declare function createSteps<Key extends string>(config: InferalCredentialFormConfig<Key>, locationLabels: Readonly<Record<GQLInferalLocation, string>>, setup?: ProviderSetupInstructions): StepConfig<Values>[];
|
|
40
|
+
export type InferalCredentialConnectFormProps<Key extends string> = ConnectFormProps & {
|
|
41
|
+
config: InferalCredentialFormConfig<Key>;
|
|
42
|
+
};
|
|
43
|
+
export declare function InferalCredentialConnectForm<Key extends string>(props: InferalCredentialConnectFormProps<Key>): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=InferalCredentialConnectForm.d.ts.map
|
package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InferalCredentialConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/InferalCredentialConnectForm.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAElB,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAW1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMvF,MAAM,MAAM,eAAe,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI;IACzD,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACnE,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,2BAA2B,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI;IACrE,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,eAAe,CAAC,GAAG,CAAC,GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC;IAClF,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAE7B,QAAQ,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,uBAAuB,CAAC;CACnF,CAAC;AAKF,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3D;AAcD,KAAK,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAC;IAAC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AASjG,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,OAAO,GACvB,OAAO,CAET;AA6DD,wBAAgB,WAAW,CAAC,GAAG,SAAS,MAAM,EAC5C,MAAM,EAAE,2BAA2B,CAAC,GAAG,CAAC,EACxC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,EAC5D,KAAK,CAAC,EAAE,yBAAyB,GAChC,UAAU,CAAC,MAAM,CAAC,EAAE,CAqFtB;AAED,MAAM,MAAM,iCAAiC,CAAC,GAAG,SAAS,MAAM,IAAI,gBAAgB,GAAG;IACrF,MAAM,EAAE,2BAA2B,CAAC,GAAG,CAAC,CAAC;CAC1C,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,GAAG,SAAS,MAAM,EAAE,KAAK,EAAE,iCAAiC,CAAC,GAAG,CAAC,2CAmG7G"}
|