@fluidgrids/fe-sdk 0.0.0-stage → 2026.1203.7
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 +564 -2
- package/dist/ActivityOptionsFields-C2u-hY2U.js +142 -0
- package/dist/AiStudioPage-B_hNTj-_.js +1137 -0
- package/dist/ApprovalInboxPage-ClITra3n.js +1312 -0
- package/dist/ChoiceSelect-LkK-uS9J.js +65 -0
- package/dist/ConfirmActionDialog-DHWTDRbp.js +31 -0
- package/dist/ConnectionFormDialog-C0kDgcrZ.js +153 -0
- package/dist/CreateFluidgridsTagDocument-Dtp9KPLJ.js +1055 -0
- package/dist/DataSinkDashboardPage-b4ezeqa6.js +278 -0
- package/dist/DataTablesPage-C1d9YGHz.js +5575 -0
- package/dist/DateTimeField-B1qR4ruo.js +51 -0
- package/dist/Disclosure-BNKij7-v.js +45 -0
- package/dist/ElementLibraryPage-8jNO6YmE.js +2256 -0
- package/dist/ElementLibrarySequenceDocument-B-W8SPzn.js +3979 -0
- package/dist/EnsureThemeProvider-BvlNjAd0.js +24 -0
- package/dist/EntityTagBadge-1OlP6p0c.js +25 -0
- package/dist/EntityTagPicker-BBrU5cE0.js +137 -0
- package/dist/ExecuteStepDocument-B4j1mdRT.js +189 -0
- package/dist/ExecutionDetailDocument-D6QuM-kp.js +875 -0
- package/dist/ExecutionDetailPage-D4CBtFdo.js +12217 -0
- package/dist/ExecutionDetailPage-DvQ667OE.d.ts +10 -0
- package/dist/ExecutionStatusBadge-BsDVor9t.js +221 -0
- package/dist/ExecutionsListDocument-Dan7ZiqB.js +459 -0
- package/dist/ExecutionsListPage-B3XT8ITL.js +4307 -0
- package/dist/FailureTriagePanel-DOJMaJ0n.js +1285 -0
- package/dist/FileDownloadUrlDocument-CVOYKcL5.js +92 -0
- package/dist/FluidGridsDocsLink-bX0Hnhxr.js +66 -0
- package/dist/FluidGridsMark-CE2blT7K.js +74 -0
- package/dist/HeldLoadRegion-BtTxbvOW.js +34 -0
- package/dist/HistoryPage-BLoRpJ1R.d.ts +6 -0
- package/dist/HistoryPage-BSBISXoj.js +2835 -0
- package/dist/Icon-BtQ0HXLh.js +160 -0
- package/dist/InsightsPage-D7ybj8N9.js +11245 -0
- package/dist/IsolationSetting-vy911E8b.js +1153 -0
- package/dist/LibraryParts-DOeNgR8A.js +413 -0
- package/dist/ManagedAiPolicyAuthority-BxwJ3ptd.js +40 -0
- package/dist/ManagedAiPolicyAuthority-DM3t3wNr.d.ts +18 -0
- package/dist/ManagedAiPolicyAuthorityContext-CNkxIOZ1.js +10 -0
- package/dist/McpTriggerServers-BCPCAOWB.js +459 -0
- package/dist/MissingNodesInstallModal-rO_SEDrC.js +224 -0
- package/dist/NavigationV2Provider-DCDt35eG.js +17 -0
- package/dist/NodeSchemaIntrospectionDocument-C1vAIcHd.js +95 -0
- package/dist/NodesPage-DEbnz9iU.d.ts +6 -0
- package/dist/NodesPage-O7KeeKtd.js +653 -0
- package/dist/OfflineIcon-TwMKYWjA.js +207 -0
- package/dist/OpenTemplateAsCodeButton-BhWJWIF3.js +94 -0
- package/dist/PaidTemplateConfirm-_G3ag6S4.js +28 -0
- package/dist/PublishCustomNodeAction-CIySbK4c.js +134 -0
- package/dist/RecordTaskDialog-BkpCDvhR.js +2078 -0
- package/dist/RunActionsMenu-DodOgIQm.js +59 -0
- package/dist/RunnerStatusPill-C1v967iq.js +24 -0
- package/dist/RunnersPage-dB0RSdY_.js +1929 -0
- package/dist/SandboxRuntimeExhaustedNotice-BFOIF93C.js +120 -0
- package/dist/SchedulesPage-DPWr1yvf.js +1607 -0
- package/dist/SearchBox-BGtYjvfs.js +49 -0
- package/dist/SequenceEditor-CFiHeHkR.js +497 -0
- package/dist/SettingsPage-0CQBNPZV.js +8695 -0
- package/dist/StewardPages-DAJhepen.js +47 -0
- package/dist/StewardRunImportPanel-Kva2DO0u.js +2844 -0
- package/dist/StoreTemplateCardCompact-CHn5kP7A.js +2166 -0
- package/dist/TagFilterSelect-CyA8QrS7.js +42 -0
- package/dist/TaskQueuesPage-DdnDCyat.js +3571 -0
- package/dist/TechnicalDetails-B0Oi4aZw.js +19 -0
- package/dist/TemplateConfigurationModal-CdvCYJLM.js +332 -0
- package/dist/TemplateDetailPanel-CbiKciuB.js +222 -0
- package/dist/TemplatePreview-cx7-NOeG.js +868 -0
- package/dist/TemplatesPage-BG3H-6v6.d.ts +10 -0
- package/dist/TemplatesPage-BVQpGYIV.js +3251 -0
- package/dist/TerminateExecutionDocument-B_HKNVrN.js +581 -0
- package/dist/TranslationBridge-Bd4aJKMs.d.ts +11 -0
- package/dist/TranslationBridge-Da-TPgQm.js +68 -0
- package/dist/TriggerWorkflowDocument-D9Km2Vv2.js +460 -0
- package/dist/UiSequencePickerSequenceDocument-BSYnSDV7.js +607 -0
- package/dist/UiStepScreenshot-Qh4QMyUp.js +146 -0
- package/dist/UsageTimeSeriesDocument-DcInx9-z.js +177 -0
- package/dist/VariablesPage-ChfGuW22.js +2243 -0
- package/dist/VersionDiffDialog-Bd2AeUwf.js +1702 -0
- package/dist/VersionLifecycleBar-BBeWVtz-.js +143 -0
- package/dist/WebhookDeliveriesPage-D66bua0j.js +1563 -0
- package/dist/WorkflowBuilder-B6wQD1TK.js +539 -0
- package/dist/WorkflowBuilder-DR4ku8Tr.js +1611 -0
- package/dist/WorkflowDefinitionDocument-DZLbTPUZ.js +321 -0
- package/dist/WorkflowEmbed-BXfFGy0i.js +708 -0
- package/dist/WorkflowEmbed-Cbqe1s1z.d.ts +6 -0
- package/dist/WorkflowPinnedDataDocument-BODT5omd.js +782 -0
- package/dist/WorkflowProposalCard-BruukdeF.js +96 -0
- package/dist/WorkflowProposalDocument-BdUbsrd0.js +620 -0
- package/dist/WorkflowSearchRedirect-C7zJ2MKH.js +40 -0
- package/dist/WorkflowSettingsDrawer-MVU1BKfY.d.ts +18 -0
- package/dist/WorkflowSettingsDrawer-gazs97WR.js +196 -0
- package/dist/WorkflowShareDialog-e8jJtLjU.js +469 -0
- package/dist/WorkflowVersionsDocument-DRVOp8Uj.js +3213 -0
- package/dist/WorkflowsList--hR2_8gf.js +4593 -0
- package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
- package/dist/WorkflowsListPageDocument-CnzcQm_o.js +934 -0
- package/dist/addonCatalog-CbZS4deh.js +58 -0
- package/dist/addonCatalog-sjlonAmR.d.ts +15 -0
- package/dist/addons.d.ts +3 -0
- package/dist/addons.js +4 -0
- package/dist/agent-form-Bfvm32j1.js +83 -0
- package/dist/agent-tools.d.ts +3 -0
- package/dist/agent-tools.js +5 -0
- package/dist/agentTools-CyL7DLOF.js +320 -0
- package/dist/ai-usage-BrxDgvdR.js +240 -0
- package/dist/aiCreditsBridge-BuE92tKo.js +49 -0
- package/dist/api-BKq-nIOZ.js +2286 -0
- package/dist/api-Ol7I8NxE.js +8289 -0
- package/dist/apollo-type-policies.d.ts +11 -0
- package/dist/apollo-type-policies.js +64 -0
- package/dist/askAboutBridge-ByYsQams.js +106 -0
- package/dist/askQuestions-Cmx7VnMm.js +742 -0
- package/dist/assert-rules-lfYEMc99.js +318 -0
- package/dist/assistant.d.ts +94 -0
- package/dist/assistant.js +99 -0
- package/dist/attach-node-helpers-HDKQOtrD.js +32 -0
- package/dist/badge-CXfPhoMH.js +26 -0
- package/dist/basil.generated-BK-EHbwN.js +10 -0
- package/dist/browser-steps-DMpS5TyB.js +533 -0
- package/dist/builderTimings-pvGnK1m-.js +510 -0
- package/dist/button-DG7y_FVJ.js +48 -0
- package/dist/canvasNoteTools-BxuP_AYO.js +137 -0
- package/dist/card-Bomy_1UG.js +44 -0
- package/dist/catalogGrid-BOrfMgi-.js +41 -0
- package/dist/channel-CPyQ1NR1.js +212 -0
- package/dist/chips-CvNrYJZa.js +27 -0
- package/dist/client-holder-C0M5Cfwl.js +68 -0
- package/dist/cn-QqidFIgr.js +10 -0
- package/dist/code-editor-diagnostics-Zr0cIcx1.js +46 -0
- package/dist/code-editor-field-x_JrY8KR.js +113 -0
- package/dist/codec-client-DPuD6mw7.js +515 -0
- package/dist/conditionBuilder-DwfEF0Q-.js +1144 -0
- package/dist/config-DO68jw5k.js +322 -0
- package/dist/constants-DgbVc24O.d.ts +296 -0
- package/dist/constants-DlRnHBfQ.js +217 -0
- package/dist/convert-browser-action-pfecelF7.js +347 -0
- package/dist/convert-dialog-B_o22NiJ.js +382 -0
- package/dist/create-workflow-first-Azg3JUdX.js +120 -0
- package/dist/definition-canvas-Bsda-rDT.js +31 -0
- package/dist/dialog-BVd152GS.js +94 -0
- package/dist/durable-nodes-BXyYCLxT.js +91 -0
- package/dist/duration-CDb7-mT_.js +33 -0
- package/dist/edge-mapper-wEAdGVU2.js +4477 -0
- package/dist/element-library-DkSlg_VE.js +727 -0
- package/dist/entities-I_0kio3q.js +38 -0
- package/dist/error-advice-QLr5NCm7.js +65 -0
- package/dist/errors-ClKb5sEt.js +188 -0
- package/dist/executions.d.ts +3 -0
- package/dist/executions.js +5 -0
- package/dist/feature-flags-B2qetXKd.js +385 -0
- package/dist/field-label-DPZRmE_B.js +153 -0
- package/dist/firstWorkflow-C_h0KMB2.js +133 -0
- package/dist/flags.d.ts +3 -0
- package/dist/flags.js +4 -0
- package/dist/flow-builder-DIvLOhz0.js +28038 -0
- package/dist/flow-store-holder-CUN7Terz.js +52 -0
- package/dist/fluent.generated-CA_e6-4l.js +14 -0
- package/dist/fluidgridsEvents-bbEQbwU6.js +175 -0
- package/dist/fluidgridsTheme-DUhvOgoy.js +297 -0
- package/dist/global-client-BQPuFrFa.js +433 -0
- package/dist/global-operations-BG6YgxrM.js +136 -0
- package/dist/graphql-types-UTYtujY9.js +21358 -0
- package/dist/history.d.ts +3 -0
- package/dist/history.js +4 -0
- package/dist/index-AoJAa5vU.d.ts +164958 -0
- package/dist/index-DEMT3iAM.d.ts +120 -0
- package/dist/index-ROZzNGyY.d.ts +76 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +8123 -0
- package/dist/ion.generated-mbajjcAg.js +10 -0
- package/dist/label-Lzb8ZXf_.js +29 -0
- package/dist/labels-rXd9gYQz.js +1236 -0
- package/dist/liveCanvas-D5ytXDp8.js +103 -0
- package/dist/logos.generated-X6_0kjVR.js +21 -0
- package/dist/logs-panel-Cw0DkG0l.js +468 -0
- package/dist/lucide.generated-B6NVd3GT.js +29 -0
- package/dist/marksStore-a9oIMMot.js +175 -0
- package/dist/mcp-trigger-D0nRdvq5.js +307 -0
- package/dist/mdi.generated-D1BV74d6.js +292 -0
- package/dist/menus-CU3hDGYl.js +160 -0
- package/dist/mynaui.generated-DMWr5cXz.js +66 -0
- package/dist/navigation-v2.d.ts +3 -0
- package/dist/navigation-v2.js +5 -0
- package/dist/node-detail-view-Cgm5H1P-.js +1372 -0
- package/dist/node-editor-tab-body-CZ0fVuVP.js +187 -0
- package/dist/node-operation-selection-CdV3KI_V.js +3534 -0
- package/dist/node-registry-refresh-s3okf83X.js +27 -0
- package/dist/node-role-TMbnkmeP.js +132 -0
- package/dist/node-type-icon-BZa8n4iG.js +33 -0
- package/dist/nodes.d.ts +3 -0
- package/dist/nodes.js +4 -0
- package/dist/notesKey-5EaREBGA.js +12 -0
- package/dist/observability.d.ts +3 -0
- package/dist/observability.js +5 -0
- package/dist/offset-pages-zghoClB3.js +55 -0
- package/dist/operations-BBmT9ToP.js +663 -0
- package/dist/operations-WxRJWeqO.js +3133 -0
- package/dist/output-files-Ba8bu5lv.js +196 -0
- package/dist/page-operation-DrWuhd6Y.js +129 -0
- package/dist/page-twins.d.ts +13 -0
- package/dist/page-twins.js +186 -0
- package/dist/pageControlSpecs-DZJ9K37m.js +134 -0
- package/dist/pageControlsBridge-0pX9s-3k.js +54 -0
- package/dist/pageControlsBridge-DAuT3w7L.d.ts +36 -0
- package/dist/panels-PfBBAToE.js +346 -0
- package/dist/parts-B7fBcw-B.js +346 -0
- package/dist/popover-Dms9Vz3j.js +3389 -0
- package/dist/preloadable-lazy-Pp47mqQ9.js +65 -0
- package/dist/proactive.d.ts +66 -0
- package/dist/proactive.js +237 -0
- package/dist/quick-config-panel-DFd77xho.js +451 -0
- package/dist/quota-DeA_CJ2e.js +175 -0
- package/dist/quota.d.ts +3 -0
- package/dist/quota.js +4 -0
- package/dist/read-only-context-Dt9N9SIG.js +18 -0
- package/dist/relative-time-Dxt8ZIIu.js +55 -0
- package/dist/results-CwK_yDxK.js +325 -0
- package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
- package/dist/route-data.d.ts +12 -0
- package/dist/route-data.js +69 -0
- package/dist/route-match-C-0_EnAt.d.ts +5 -0
- package/dist/route-match-DMkUICYV.js +41 -0
- package/dist/route-preload-C4DlGoCd.js +120 -0
- package/dist/run-display-UjLAoYqQ.js +81 -0
- package/dist/run-history-arGiHzGU.js +285 -0
- package/dist/run-list-links-DJn4Mf1T.js +98 -0
- package/dist/run-mode-USmM0-Uo.js +82 -0
- package/dist/run-parity-CWXqEJqM.js +144 -0
- package/dist/runsQuota-B6SyTbne.js +100 -0
- package/dist/runsQuota-DsniKiSg.d.ts +20 -0
- package/dist/safe-expression-Cw7-SCsm.js +1251 -0
- package/dist/save-status-store-C7nEYpfb.js +631 -0
- package/dist/schedule-panel-B4GYXzXQ.js +13774 -0
- package/dist/schedule-rules-ggVKRkBH.js +358 -0
- package/dist/secrets-Re_wSiE3.js +153 -0
- package/dist/settings.d.ts +4 -0
- package/dist/settings.js +6 -0
- package/dist/shared-DAWGGMSM.js +177 -0
- package/dist/sidebar-node-editor-6eSSgCzc.js +178 -0
- package/dist/solar.generated-CGYuUQAC.js +10 -0
- package/dist/stableTabbedDialog-BBhrfXGe.js +20 -0
- package/dist/start-url-CT6Yz96K.js +24 -0
- package/dist/status-CessxGpm.js +55 -0
- package/dist/store-icon-OctYp5zP.js +155 -0
- package/dist/styles-WGmTnZ2n.js +26 -0
- package/dist/styles.css +139 -0
- package/dist/svg-spinners.generated-CIPT7IhM.js +10 -0
- package/dist/template-code-CzN6JWNV.js +191 -0
- package/dist/template-graph-DLF9dygU.js +20 -0
- package/dist/template-preview-DcIIKOOL.js +32 -0
- package/dist/template-price-CdUHZRMF.js +40 -0
- package/dist/templates.d.ts +3 -0
- package/dist/templates.js +5 -0
- package/dist/theme-provider-CntfC4_i.js +23 -0
- package/dist/transient-DgZfhDfN.js +57 -0
- package/dist/typed-calls-C5tO03wq.js +26 -0
- package/dist/ui-script-By74Guk3.js +1094 -0
- package/dist/ui-script-editor-CqPu2bCN.js +2447 -0
- package/dist/ui-step-fix-8uM2_Hft.js +67 -0
- package/dist/ui-step-fix-store-CcO1FdRx.js +19 -0
- package/dist/ui-step-run-context-o7bLE6KP.js +46 -0
- package/dist/ui-target-editor-D2JhB_lD.js +673 -0
- package/dist/uiMarkTools-CSznnO1i.js +1054 -0
- package/dist/upgradePrompt-BAFBKKW5.js +72 -0
- package/dist/use-bare-node-registry-O6mKJO_n.js +11498 -0
- package/dist/use-browser-available-hj8wc3Kb.js +241 -0
- package/dist/use-edge-mapper-schemas-Bonofxow.js +496 -0
- package/dist/use-extension-bridge-B9ZreOkQ.js +608 -0
- package/dist/use-mobile-BTqCUjzS.js +27 -0
- package/dist/use-sdk-query-C697xZVv.js +116 -0
- package/dist/use-workflow-code-editor-CFoRFrZ5.js +753 -0
- package/dist/useActionParam-B2tU2BlY.js +85 -0
- package/dist/useAgentTokenStream-Bko_J0d0.js +4217 -0
- package/dist/useBrowserClients-3v95-gSh.js +103 -0
- package/dist/useCodeWorkflowInsights-w0tz9Ap_.js +600 -0
- package/dist/useConnections-DsgEJs05.js +439 -0
- package/dist/useDebouncedValue-BFekcv6n.js +18 -0
- package/dist/useDurableParity-8fnMZmBc.js +1787 -0
- package/dist/useEntityTags-D0spL6Ut.js +460 -0
- package/dist/useExecutions-2u5nGJJk.js +681 -0
- package/dist/useFluidGridsAnalytics-VM8lAi2x.js +238 -0
- package/dist/useGlobalStoreClient-BTdhkA2I.js +24 -0
- package/dist/useHumanRequests-zlYDp3l1.js +221 -0
- package/dist/useNavigationV2-C2WeqN7d.js +29 -0
- package/dist/useNavigationV2-DANUmg12.d.ts +9 -0
- package/dist/useObservability-BRlQ0tOA.js +285 -0
- package/dist/useRequestedProposal-B7uPXfZB.js +51 -0
- package/dist/useRunHistory-CXCMUPyf.js +2759 -0
- package/dist/useRunLive-D0JvVZT2.js +1060 -0
- package/dist/useRunnerList-Dbi59i1K.js +446 -0
- package/dist/useRunners-URUc5quU.js +173 -0
- package/dist/useRunsPage-DG656UCK.js +2709 -0
- package/dist/useVariables-BIelxcWr.js +463 -0
- package/dist/useVersionHistoryData-CTjqVw7l.js +292 -0
- package/dist/useWorkflowCodeExport-pqxyLHD1.js +522 -0
- package/dist/useWorkflowListExport-hcZNvTaB.js +232 -0
- package/dist/useWorkflowOrganization-CpBbOrs7.js +1772 -0
- package/dist/useWorkflowProposal-BH0VdNMA.js +3280 -0
- package/dist/useWorkflows-Cvg-Z_IE.js +1606 -0
- package/dist/utils-fvBb5qOD.js +89 -0
- package/dist/webhook-deliveries-AvQujaZy.js +99 -0
- package/dist/workflow-builder-CJygVkVv.d.ts +2 -0
- package/dist/workflow-builder.d.ts +3 -0
- package/dist/workflow-builder.js +8 -0
- package/dist/workflow-code-transfer-Bsy0JKAZ.js +323 -0
- package/dist/workflow-embed.d.ts +3 -0
- package/dist/workflow-embed.js +4 -0
- package/dist/workflow-git-sync--K9ZsPDC.js +263 -0
- package/dist/workflow-host.d.ts +6 -0
- package/dist/workflow-host.js +11 -0
- package/dist/workflow-pages-D-7ByLTB.d.ts +68 -0
- package/dist/workflow-pages.d.ts +3 -0
- package/dist/workflow-pages.js +115 -0
- package/dist/workflow-preview-canvas-CO8yzdE3.js +848 -0
- package/dist/workflow-preview.d.ts +65 -0
- package/dist/workflow-preview.js +4 -0
- package/dist/workflow-route.d.ts +33 -0
- package/dist/workflow-route.js +4 -0
- package/dist/workflow-save-state-D0l-DkLf.js +767 -0
- package/dist/workflow-transfer-CQnQC-ke.js +104 -0
- package/dist/workflowRouteData-BkfVOc-O.js +169 -0
- package/dist/workflows-list.d.ts +10 -0
- package/dist/workflows-list.js +5 -0
- package/package.json +320 -4
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as cn } from "./cn-QqidFIgr.js";
|
|
3
|
+
import { cloneElement, createContext, forwardRef, useContext, useMemo } from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
6
|
+
|
|
7
|
+
// src/ui/tooltip.tsx
|
|
8
|
+
const TooltipProvider = TooltipPrimitive.Provider;
|
|
9
|
+
const Tooltip = TooltipPrimitive.Root;
|
|
10
|
+
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
11
|
+
const TooltipContent = forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Content, {
|
|
12
|
+
ref,
|
|
13
|
+
sideOffset,
|
|
14
|
+
className: cn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
|
|
15
|
+
...props
|
|
16
|
+
}));
|
|
17
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
18
|
+
|
|
19
|
+
// src/permissions/PermissionsBridge.tsx
|
|
20
|
+
/**
|
|
21
|
+
* FluidGrids Permissions Bridge
|
|
22
|
+
*
|
|
23
|
+
* The SDK never talks to the RBAC service itself and never imports
|
|
24
|
+
* @burdenoff/fe-libs (embed/standalone consumers have no shell providers).
|
|
25
|
+
* Instead, hosts that DO have real permission data (e.g. microfe-workflows,
|
|
26
|
+
* which wraps the SDK in the fe-libs PermissionProvider) bridge it in via
|
|
27
|
+
* FluidGridsPermissionsProvider.
|
|
28
|
+
*
|
|
29
|
+
* Without a provider the context defaults to allow-all (enforced: false):
|
|
30
|
+
* every surface renders enabled and the API gateway remains the enforcement
|
|
31
|
+
* point. This keeps /embed/workflow, /shared/:id and standalone embedders
|
|
32
|
+
* working unchanged.
|
|
33
|
+
*/
|
|
34
|
+
/** No-provider default: allow-all, unenforced (gateway remains the gate). */
|
|
35
|
+
const ALLOW_ALL_PERMISSIONS = {
|
|
36
|
+
hasPermission: () => true,
|
|
37
|
+
isLoading: false,
|
|
38
|
+
enforced: false
|
|
39
|
+
};
|
|
40
|
+
const FluidGridsPermissionsContext = createContext(ALLOW_ALL_PERMISSIONS);
|
|
41
|
+
function FluidGridsPermissionsProvider({ hasPermission, isLoading = false, children }) {
|
|
42
|
+
const value = useMemo(() => ({
|
|
43
|
+
hasPermission,
|
|
44
|
+
isLoading,
|
|
45
|
+
enforced: true
|
|
46
|
+
}), [hasPermission, isLoading]);
|
|
47
|
+
return /* @__PURE__ */ jsx(FluidGridsPermissionsContext.Provider, {
|
|
48
|
+
value,
|
|
49
|
+
children
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Pure gating semantics, extracted for unit testing: denied while loading
|
|
54
|
+
* (no flash of allowed UI), any-of across a permission list, allow-all when
|
|
55
|
+
* the context is the unenforced default.
|
|
56
|
+
*/
|
|
57
|
+
function evaluatePermissionCheck(ctx, permission) {
|
|
58
|
+
const permissions = typeof permission === "string" ? [permission] : permission;
|
|
59
|
+
return {
|
|
60
|
+
allowed: ctx.isLoading ? false : permissions.some((p) => ctx.hasPermission(p)),
|
|
61
|
+
isLoading: ctx.isLoading,
|
|
62
|
+
enforced: ctx.enforced
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/** The host's permission data as bridged (allow-all without a provider). */
|
|
66
|
+
function useFluidGridsPermissions() {
|
|
67
|
+
return useContext(FluidGridsPermissionsContext);
|
|
68
|
+
}
|
|
69
|
+
/** Accepts a single permission or an any-of list. */
|
|
70
|
+
function useFluidGridsPermission(permission) {
|
|
71
|
+
return evaluatePermissionCheck(useContext(FluidGridsPermissionsContext), permission);
|
|
72
|
+
}
|
|
73
|
+
const DEFAULT_DENIED_TOOLTIP = "You don't have permission to perform this action";
|
|
74
|
+
/**
|
|
75
|
+
* Wraps a single button-like element. When the permission is denied the
|
|
76
|
+
* child is disabled (with an explanatory tooltip) or hidden; while
|
|
77
|
+
* permissions load it renders disabled without the tooltip.
|
|
78
|
+
*/
|
|
79
|
+
function SdkPermissionButton({ permission, deniedBehavior = "disable", deniedTooltip = DEFAULT_DENIED_TOOLTIP, deniedTooltipClassName, children }) {
|
|
80
|
+
const { allowed, isLoading } = useFluidGridsPermission(permission);
|
|
81
|
+
if (allowed) return children;
|
|
82
|
+
if (deniedBehavior === "hide") return null;
|
|
83
|
+
const disabledChild = cloneElement(children, {
|
|
84
|
+
disabled: true,
|
|
85
|
+
onClick: void 0
|
|
86
|
+
});
|
|
87
|
+
if (isLoading) return disabledChild;
|
|
88
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
89
|
+
asChild: true,
|
|
90
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
91
|
+
className: "inline-flex cursor-not-allowed",
|
|
92
|
+
children: disabledChild
|
|
93
|
+
})
|
|
94
|
+
}), /* @__PURE__ */ jsx(TooltipContent, {
|
|
95
|
+
className: deniedTooltipClassName,
|
|
96
|
+
children: deniedTooltip
|
|
97
|
+
})] }) });
|
|
98
|
+
}
|
|
99
|
+
/** Renders children only when the permission is granted (and loaded). */
|
|
100
|
+
function SdkPermissionGate({ permission, fallback = null, children }) {
|
|
101
|
+
const { allowed } = useFluidGridsPermission(permission);
|
|
102
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: allowed ? children : fallback });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// src/permissions/constants.ts
|
|
106
|
+
/**
|
|
107
|
+
* FluidGrids Permission Constants
|
|
108
|
+
*
|
|
109
|
+
* Canonical permission strings for FluidGrids UI surfaces, matching the
|
|
110
|
+
* backend @rbac (resource, action) pairs. Format: '{resourceType}:{action}'.
|
|
111
|
+
*
|
|
112
|
+
* Hosts (e.g. microfe-workflows) bridge real permission data via
|
|
113
|
+
* FluidGridsPermissionsProvider; without a provider the SDK defaults to
|
|
114
|
+
* allow-all and the gateway remains the enforcement point.
|
|
115
|
+
*/
|
|
116
|
+
const FLUIDGRIDS_PERMISSIONS = {
|
|
117
|
+
WORKFLOW_LIST: "workflow:list",
|
|
118
|
+
WORKFLOW_READ: "workflow:read",
|
|
119
|
+
WORKFLOW_CREATE: "workflow:create",
|
|
120
|
+
WORKFLOW_UPDATE: "workflow:update",
|
|
121
|
+
WORKFLOW_DELETE: "workflow:delete",
|
|
122
|
+
WORKFLOW_EXECUTE: "workflow:execute",
|
|
123
|
+
/** Activating workflows; also turns failure triage on and off (BOFF-3698). */
|
|
124
|
+
WORKFLOW_PUBLISH: "workflow:publish",
|
|
125
|
+
/** Changing who a workflow is shared with (BOFF-9726); the service also checks the workflow. */
|
|
126
|
+
WORKFLOW_SHARE: "workflow:share",
|
|
127
|
+
WORKFLOW_RUN_LIST: "workflow-run:list",
|
|
128
|
+
WORKFLOW_RUN_READ: "workflow-run:read",
|
|
129
|
+
WORKFLOW_RUN_EXECUTE: "workflow-run:execute",
|
|
130
|
+
/** Terminating a durable-function run (terminateWorkflowRun, BOFF-9905). */
|
|
131
|
+
WORKFLOW_RUN_DELETE: "workflow-run:delete",
|
|
132
|
+
NODE_LIST: "node:list",
|
|
133
|
+
NODE_READ: "node:read",
|
|
134
|
+
NODE_CREATE: "node:create",
|
|
135
|
+
NODE_DELETE: "node:delete",
|
|
136
|
+
NODE_INSTALLATION_LIST: "node-installation:list",
|
|
137
|
+
NODE_INSTALLATION_READ: "node-installation:read",
|
|
138
|
+
NODE_INSTALLATION_CREATE: "node-installation:create",
|
|
139
|
+
NODE_INSTALLATION_UPDATE: "node-installation:update",
|
|
140
|
+
NODE_INSTALLATION_DELETE: "node-installation:delete",
|
|
141
|
+
NODE_ENDPOINT_CONFIG_LIST: "node-endpoint-config:list",
|
|
142
|
+
NODE_ENDPOINT_CONFIG_READ: "node-endpoint-config:read",
|
|
143
|
+
NODE_ENDPOINT_CONFIG_UPDATE: "node-endpoint-config:update",
|
|
144
|
+
NODE_ENDPOINT_CONFIG_DELETE: "node-endpoint-config:delete",
|
|
145
|
+
SCHEDULED_JOB_LIST: "scheduled-job:list",
|
|
146
|
+
SCHEDULED_JOB_READ: "scheduled-job:read",
|
|
147
|
+
SCHEDULED_JOB_CREATE: "scheduled-job:create",
|
|
148
|
+
SCHEDULED_JOB_UPDATE: "scheduled-job:update",
|
|
149
|
+
SCHEDULED_JOB_DELETE: "scheduled-job:delete",
|
|
150
|
+
AI_WORKFLOW_EXECUTE: "ai-workflow:execute",
|
|
151
|
+
AI_WORKFLOW_CREATE: "ai-workflow:create",
|
|
152
|
+
ARTIFACT_LIST: "artifact:list",
|
|
153
|
+
ARTIFACT_READ: "artifact:read",
|
|
154
|
+
ARTIFACT_DELETE: "artifact:delete",
|
|
155
|
+
CHAT_SESSION_LIST: "chat-session:list",
|
|
156
|
+
CHAT_SESSION_READ: "chat-session:read",
|
|
157
|
+
CHAT_SESSION_CREATE: "chat-session:create",
|
|
158
|
+
CHAT_SESSION_DELETE: "chat-session:delete",
|
|
159
|
+
SUBMISSION_LIST: "submission:list",
|
|
160
|
+
SUBMISSION_READ: "submission:read",
|
|
161
|
+
SUBMISSION_DELETE: "submission:delete",
|
|
162
|
+
SUBMISSION_EXECUTE: "submission:execute",
|
|
163
|
+
EVENT_REGISTRATION_LIST: "event-registration:list",
|
|
164
|
+
EVENT_REGISTRATION_READ: "event-registration:read",
|
|
165
|
+
EVENT_REGISTRATION_CREATE: "event-registration:create",
|
|
166
|
+
EVENT_REGISTRATION_UPDATE: "event-registration:update",
|
|
167
|
+
EVENT_REGISTRATION_DELETE: "event-registration:delete",
|
|
168
|
+
WEBHOOK_DELIVERY_READ: "webhook-delivery:read",
|
|
169
|
+
/** Retrying a delivery (retryWebhookDelivery). */
|
|
170
|
+
WEBHOOK_DELIVERY_EXECUTE: "webhook-delivery:execute",
|
|
171
|
+
USAGE_LIST: "usage:list",
|
|
172
|
+
USAGE_READ: "usage:read",
|
|
173
|
+
DASHBOARD_READ: "dashboard:read",
|
|
174
|
+
SYSTEM_CONFIG_READ: "system-config:read",
|
|
175
|
+
SYSTEM_CONFIG_UPDATE: "system-config:update",
|
|
176
|
+
SYSTEM_CONFIG_MANAGE: "system-config:manage",
|
|
177
|
+
VARIABLE_READ: "workflow-variable:read",
|
|
178
|
+
VARIABLE_CREATE: "workflow-variable:create",
|
|
179
|
+
VARIABLE_UPDATE: "workflow-variable:update",
|
|
180
|
+
VARIABLE_DELETE: "workflow-variable:delete",
|
|
181
|
+
VARIABLE_REVEAL: "workflow-variable:reveal",
|
|
182
|
+
SECRETS_PROVIDER_CONFIG_READ: "secrets-provider-config:read",
|
|
183
|
+
SECRETS_PROVIDER_CONFIG_UPDATE: "secrets-provider-config:update",
|
|
184
|
+
SECRETS_PROVIDER_CONFIG_TEST: "secrets-provider-config:test",
|
|
185
|
+
INTEGRATION_CONNECTION_CREATE: "integration-connection:create",
|
|
186
|
+
SANDBOX_READ: "sandbox:read",
|
|
187
|
+
SANDBOX_CREATE: "sandbox:create",
|
|
188
|
+
/** Rotating a runner's registration token (rotateSandboxRunnerToken). */
|
|
189
|
+
SANDBOX_UPDATE: "sandbox:update",
|
|
190
|
+
SANDBOX_DELETE: "sandbox:delete",
|
|
191
|
+
DATA_TABLE_CREATE: "data-table:create",
|
|
192
|
+
DATA_TABLE_UPDATE: "data-table:update",
|
|
193
|
+
DATA_TABLE_DELETE: "data-table:delete",
|
|
194
|
+
DATA_TABLE_ROW_CREATE: "data-table-row:create",
|
|
195
|
+
DATA_TABLE_ROW_UPDATE: "data-table-row:update",
|
|
196
|
+
DATA_TABLE_ROW_DELETE: "data-table-row:delete",
|
|
197
|
+
TASK_QUEUE_READ: "task-queue:read",
|
|
198
|
+
TASK_QUEUE_CREATE: "task-queue:create",
|
|
199
|
+
TASK_QUEUE_UPDATE: "task-queue:update",
|
|
200
|
+
TASK_QUEUE_DELETE: "task-queue:delete",
|
|
201
|
+
RUNNER_READ: "runner:read",
|
|
202
|
+
RUNNER_CREATE: "runner:create",
|
|
203
|
+
RUNNER_UPDATE: "runner:update",
|
|
204
|
+
RUNNER_DELETE: "runner:delete",
|
|
205
|
+
UI_ELEMENT_READ: "ui-element:read",
|
|
206
|
+
UI_ELEMENT_CREATE: "ui-element:create",
|
|
207
|
+
UI_ELEMENT_UPDATE: "ui-element:update",
|
|
208
|
+
UI_ELEMENT_DELETE: "ui-element:delete",
|
|
209
|
+
/** Applying an element version to workflows (applyUiElementVersionToWorkflows). */
|
|
210
|
+
UI_ELEMENT_PUBLISH: "ui-element:publish",
|
|
211
|
+
/** Replaying steps on stored snapshots (replayUiScriptOnSnapshots). */
|
|
212
|
+
UI_ELEMENT_TEST: "ui-element:test",
|
|
213
|
+
TOOL_APPROVAL_REQUEST_READ: "tool-approval-request:read",
|
|
214
|
+
TOOL_APPROVAL_REQUEST_EXECUTE: "tool-approval-request:execute"
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export { SdkPermissionGate as a, useFluidGridsPermissions as c, TooltipProvider as d, TooltipTrigger as f, SdkPermissionButton as i, Tooltip as l, ALLOW_ALL_PERMISSIONS as n, evaluatePermissionCheck as o, FluidGridsPermissionsProvider as r, useFluidGridsPermission as s, FLUIDGRIDS_PERMISSIONS as t, TooltipContent as u };
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { O as createConfiguredNode, c as ensureNodeTypeReady, f as getNodeConfig } from "./use-bare-node-registry-O6mKJO_n.js";
|
|
3
|
+
import { d as USE_BROWSER_INPUTS_PARAMETER, f as USE_BROWSER_NODE_TYPE, p as USE_BROWSER_SCRIPT_PARAMETER } from "./askQuestions-Cmx7VnMm.js";
|
|
4
|
+
import { a as browserStepActionSpec, d as holdsExpression, n as BROWSER_STEPS_PARAMETER, v as readBrowserStepsSetting, y as readsSecretRoot } from "./browser-steps-DMpS5TyB.js";
|
|
5
|
+
import { UiScriptError, fromBrowserActionSteps, parseUiScript } from "@burdenoff/ui-engine/script";
|
|
6
|
+
|
|
7
|
+
// src/builder/components/ndv/convert-to-use-browser/new-use-browser-node.ts
|
|
8
|
+
/**
|
|
9
|
+
* A new Use Browser node at `position`, pinned to its operation the way the
|
|
10
|
+
* palette places one, or null when its manifest cannot be loaded.
|
|
11
|
+
*/
|
|
12
|
+
async function newUseBrowserNode(position) {
|
|
13
|
+
if (!await ensureNodeTypeReady("internal:use-browser")) return null;
|
|
14
|
+
if (!getNodeConfig("internal:use-browser")) return null;
|
|
15
|
+
return createConfiguredNode(USE_BROWSER_NODE_TYPE, position);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// src/builder/lib/convert-browser-action.ts
|
|
19
|
+
/** The Run in options both nodes share, carried over as they are. */
|
|
20
|
+
const CARRIED_NODE_SETTINGS = [
|
|
21
|
+
"target",
|
|
22
|
+
"timeoutSeconds",
|
|
23
|
+
"onNoClient",
|
|
24
|
+
"allowUnattended"
|
|
25
|
+
];
|
|
26
|
+
function isRecord(value) {
|
|
27
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28
|
+
}
|
|
29
|
+
function filled(value) {
|
|
30
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
31
|
+
}
|
|
32
|
+
/** Whether a setting is present at all (an empty text counts as absent). */
|
|
33
|
+
function present(value) {
|
|
34
|
+
return value !== void 0 && value !== null && value !== "";
|
|
35
|
+
}
|
|
36
|
+
/** The step settings that take an expression through a script input. */
|
|
37
|
+
const LIFTED_KEYS = {
|
|
38
|
+
navigate: {
|
|
39
|
+
key: "url",
|
|
40
|
+
suffix: "url",
|
|
41
|
+
placeholder: "https://input.invalid/"
|
|
42
|
+
},
|
|
43
|
+
type: {
|
|
44
|
+
key: "value",
|
|
45
|
+
suffix: "text",
|
|
46
|
+
placeholder: "input"
|
|
47
|
+
},
|
|
48
|
+
select: {
|
|
49
|
+
key: "value",
|
|
50
|
+
suffix: "value",
|
|
51
|
+
placeholder: "input"
|
|
52
|
+
},
|
|
53
|
+
waitFor: {
|
|
54
|
+
key: "text",
|
|
55
|
+
suffix: "text",
|
|
56
|
+
placeholder: "input"
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
/** The setting of `step` whose expression becomes a script input, if any. */
|
|
60
|
+
function liftedKeyOf(step) {
|
|
61
|
+
const lifted = LIFTED_KEYS[step.action];
|
|
62
|
+
if (!lifted) return void 0;
|
|
63
|
+
if (step.action === "waitFor" && filled(step.selector)) return void 0;
|
|
64
|
+
return lifted;
|
|
65
|
+
}
|
|
66
|
+
/** Settings whose expression the adapter drops (it needs a number). */
|
|
67
|
+
const NUMBER_KEYS = /* @__PURE__ */ new Set([
|
|
68
|
+
"timeoutMs",
|
|
69
|
+
"maxItems",
|
|
70
|
+
"maxPages"
|
|
71
|
+
]);
|
|
72
|
+
/**
|
|
73
|
+
* Keys every step may carry besides its action's parameters: the worker and
|
|
74
|
+
* the adapter read a timeout on any step, not only on a wait.
|
|
75
|
+
*/
|
|
76
|
+
const COMMON_KEYS = /* @__PURE__ */ new Set([
|
|
77
|
+
"action",
|
|
78
|
+
"name",
|
|
79
|
+
"note",
|
|
80
|
+
"timeoutMs"
|
|
81
|
+
]);
|
|
82
|
+
/** Keys never checked for expressions: the action, and the author's note. */
|
|
83
|
+
const UNCHECKED_KEYS = /* @__PURE__ */ new Set(["action", "note"]);
|
|
84
|
+
/** The settings of a legacy step that its converted step does not keep. */
|
|
85
|
+
function droppedKeys(step, converted) {
|
|
86
|
+
const spec = browserStepActionSpec(step.action);
|
|
87
|
+
const known = /* @__PURE__ */ new Set([
|
|
88
|
+
...COMMON_KEYS,
|
|
89
|
+
...spec?.params.map((param) => param.key) ?? [],
|
|
90
|
+
...spec?.fields ? ["fields"] : []
|
|
91
|
+
]);
|
|
92
|
+
const dropped = Object.keys(step).filter((key) => !known.has(key) && present(step[key]));
|
|
93
|
+
const out = { ...converted };
|
|
94
|
+
for (const key of NUMBER_KEYS) if (known.has(key) && present(step[key]) && out[key] === void 0) dropped.push(key);
|
|
95
|
+
if (step.action === "screenshot" && step.fullPage === true) dropped.push("fullPage");
|
|
96
|
+
if ((step.action === "waitFor" || step.action === "click") && filled(step.selector) && filled(step.text)) dropped.push("text");
|
|
97
|
+
if (step.action === "scroll" && filled(step.selector) && present(step.to)) dropped.push("to");
|
|
98
|
+
return dropped;
|
|
99
|
+
}
|
|
100
|
+
/** The step with `ref` in the setting that holds a lifted value. */
|
|
101
|
+
function withInput(step, ref) {
|
|
102
|
+
switch (step.action) {
|
|
103
|
+
case "navigate": return {
|
|
104
|
+
...step,
|
|
105
|
+
url: ref
|
|
106
|
+
};
|
|
107
|
+
case "type": return {
|
|
108
|
+
...step,
|
|
109
|
+
text: ref
|
|
110
|
+
};
|
|
111
|
+
case "select": return {
|
|
112
|
+
...step,
|
|
113
|
+
values: [ref]
|
|
114
|
+
};
|
|
115
|
+
case "waitFor": return {
|
|
116
|
+
...step,
|
|
117
|
+
text: ref
|
|
118
|
+
};
|
|
119
|
+
default: return step;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** Where an engine error points: the Run in Browser step index. */
|
|
123
|
+
function engineStep(error) {
|
|
124
|
+
const match = /^(?:steps\.)?(\d+)(?:\.|$)/.exec(error.path ?? "");
|
|
125
|
+
return match?.[1] === void 0 ? void 0 : Number(match[1]);
|
|
126
|
+
}
|
|
127
|
+
/** Whether a field list holds an expression in a name, selector or attribute. */
|
|
128
|
+
function fieldsHoldExpression(fields) {
|
|
129
|
+
if (!Array.isArray(fields)) return holdsExpression(fields);
|
|
130
|
+
return fields.some((field) => isRecord(field) && (holdsExpression(field.name) || holdsExpression(field.selector) || holdsExpression(field.attribute)));
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Convert a Run in Browser step setting (an array, or the JSON text the form
|
|
134
|
+
* saved) to a UI script. Pure; the result says what moved, what was left out
|
|
135
|
+
* and, when `script` is null, why the conversion is refused.
|
|
136
|
+
*/
|
|
137
|
+
function convertBrowserActionSteps(setting) {
|
|
138
|
+
const read = readBrowserStepsSetting(setting);
|
|
139
|
+
const steps = read ?? [];
|
|
140
|
+
const result = {
|
|
141
|
+
script: null,
|
|
142
|
+
inputs: {},
|
|
143
|
+
lifted: [],
|
|
144
|
+
dropped: [],
|
|
145
|
+
droppedNodeSettings: [],
|
|
146
|
+
blocked: [],
|
|
147
|
+
steps
|
|
148
|
+
};
|
|
149
|
+
if (read === null) {
|
|
150
|
+
result.blocked.push({ kind: holdsExpression(setting) ? "mapped" : "unreadable" });
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
if (steps.length === 0) {
|
|
154
|
+
result.blocked.push({ kind: "noSteps" });
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
steps.forEach((step, index) => {
|
|
158
|
+
if (readsSecretRoot(step)) result.blocked.push({
|
|
159
|
+
kind: "secret",
|
|
160
|
+
step: index
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
if (result.blocked.length > 0) return result;
|
|
164
|
+
const prepared = steps.map((step, index) => {
|
|
165
|
+
const lifted = liftedKeyOf(step);
|
|
166
|
+
const value = lifted ? step[lifted.key] : void 0;
|
|
167
|
+
if (!lifted || typeof value !== "string" || !holdsExpression(value)) return step;
|
|
168
|
+
const input = `step${index + 1}_${lifted.suffix}`;
|
|
169
|
+
result.lifted.push({
|
|
170
|
+
step: index,
|
|
171
|
+
action: step.action,
|
|
172
|
+
key: lifted.key,
|
|
173
|
+
input,
|
|
174
|
+
value
|
|
175
|
+
});
|
|
176
|
+
result.inputs[input] = value;
|
|
177
|
+
return {
|
|
178
|
+
...step,
|
|
179
|
+
[lifted.key]: lifted.placeholder
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
let converted;
|
|
183
|
+
try {
|
|
184
|
+
converted = fromBrowserActionSteps(prepared);
|
|
185
|
+
} catch (error) {
|
|
186
|
+
if (!(error instanceof UiScriptError)) throw error;
|
|
187
|
+
const step = engineStep(error);
|
|
188
|
+
result.blocked.push({
|
|
189
|
+
kind: "engine",
|
|
190
|
+
...step === void 0 ? {} : { step },
|
|
191
|
+
detail: error.message
|
|
192
|
+
});
|
|
193
|
+
result.lifted = [];
|
|
194
|
+
result.inputs = {};
|
|
195
|
+
return result;
|
|
196
|
+
}
|
|
197
|
+
const liftedAt = new Map(result.lifted.map((item) => [item.step, item]));
|
|
198
|
+
steps.forEach((step, index) => {
|
|
199
|
+
const convertedStep = converted.steps[index];
|
|
200
|
+
if (!convertedStep) return;
|
|
201
|
+
const dropped = new Set(droppedKeys(step, convertedStep));
|
|
202
|
+
for (const key of dropped) result.dropped.push({
|
|
203
|
+
step: index,
|
|
204
|
+
action: step.action,
|
|
205
|
+
key
|
|
206
|
+
});
|
|
207
|
+
for (const key of Object.keys(step)) {
|
|
208
|
+
if (UNCHECKED_KEYS.has(key) || dropped.has(key) || NUMBER_KEYS.has(key)) continue;
|
|
209
|
+
if (liftedAt.get(index)?.key === key) continue;
|
|
210
|
+
if (key === "fields" ? fieldsHoldExpression(step.fields) : holdsExpression(step[key])) result.blocked.push({
|
|
211
|
+
kind: "expression",
|
|
212
|
+
step: index,
|
|
213
|
+
action: step.action,
|
|
214
|
+
key
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
if (result.blocked.length > 0) {
|
|
219
|
+
result.lifted = [];
|
|
220
|
+
result.inputs = {};
|
|
221
|
+
return result;
|
|
222
|
+
}
|
|
223
|
+
const inputs = result.lifted.map((item) => ({
|
|
224
|
+
name: item.input,
|
|
225
|
+
type: "text"
|
|
226
|
+
}));
|
|
227
|
+
const script = {
|
|
228
|
+
...converted,
|
|
229
|
+
...inputs.length > 0 ? { inputs } : {},
|
|
230
|
+
steps: converted.steps.map((step, index) => {
|
|
231
|
+
const lifted = liftedAt.get(index);
|
|
232
|
+
return lifted ? withInput(step, { input: lifted.input }) : step;
|
|
233
|
+
})
|
|
234
|
+
};
|
|
235
|
+
try {
|
|
236
|
+
result.script = parseUiScript(script);
|
|
237
|
+
} catch (error) {
|
|
238
|
+
if (!(error instanceof UiScriptError)) throw error;
|
|
239
|
+
const step = engineStep(error);
|
|
240
|
+
result.blocked.push({
|
|
241
|
+
kind: "engine",
|
|
242
|
+
...step === void 0 ? {} : { step },
|
|
243
|
+
detail: error.message
|
|
244
|
+
});
|
|
245
|
+
result.lifted = [];
|
|
246
|
+
result.inputs = {};
|
|
247
|
+
}
|
|
248
|
+
return result;
|
|
249
|
+
}
|
|
250
|
+
function nodeData(node) {
|
|
251
|
+
return isRecord(node.data) ? node.data : {};
|
|
252
|
+
}
|
|
253
|
+
function argsOf(data) {
|
|
254
|
+
return isRecord(data.args) ? data.args : {};
|
|
255
|
+
}
|
|
256
|
+
function stateOf(data) {
|
|
257
|
+
const state = argsOf(data).state;
|
|
258
|
+
return isRecord(state) ? state : {};
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Convert a Run in Browser node: its steps (see
|
|
262
|
+
* {@link convertBrowserActionSteps}), plus the node settings Use Browser has
|
|
263
|
+
* no place for. Refused while an incoming edge sets the steps, because a
|
|
264
|
+
* UI script is never set from earlier data.
|
|
265
|
+
*/
|
|
266
|
+
function convertBrowserActionNode(node, edges) {
|
|
267
|
+
const data = nodeData(node);
|
|
268
|
+
const state = stateOf(data);
|
|
269
|
+
const result = convertBrowserActionSteps(state[BROWSER_STEPS_PARAMETER]);
|
|
270
|
+
if (edges.some((edge) => {
|
|
271
|
+
const definition = edge.mapping?.definition;
|
|
272
|
+
return edge.target === node.id && isRecord(definition) && "steps" in definition;
|
|
273
|
+
})) {
|
|
274
|
+
result.blocked.unshift({ kind: "mapped" });
|
|
275
|
+
result.script = null;
|
|
276
|
+
result.lifted = [];
|
|
277
|
+
result.inputs = {};
|
|
278
|
+
}
|
|
279
|
+
if (present(state.tabId)) result.droppedNodeSettings.push("tabId");
|
|
280
|
+
const settings = data.executionSettings;
|
|
281
|
+
if (isRecord(settings) && isRecord(settings.runOn)) result.droppedNodeSettings.push("runOn");
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* The node data a node type owns: its manifest, operation, version and
|
|
286
|
+
* parameters. Everything else on `node.data` is a node setting (name, notes,
|
|
287
|
+
* enabled state, retry and error branch, execution settings) and moves to
|
|
288
|
+
* the converted node.
|
|
289
|
+
*/
|
|
290
|
+
const NODE_TYPE_DATA_KEYS = /* @__PURE__ */ new Set([
|
|
291
|
+
"args",
|
|
292
|
+
"nodeData",
|
|
293
|
+
"nodeType",
|
|
294
|
+
"operation_name",
|
|
295
|
+
"operation_type",
|
|
296
|
+
"operations",
|
|
297
|
+
"version"
|
|
298
|
+
]);
|
|
299
|
+
/** The parameter-level settings that are not node parameters (BOFF-7512). */
|
|
300
|
+
const STATE_SETTING_KEYS = ["errorConfig"];
|
|
301
|
+
/**
|
|
302
|
+
* The Use Browser node that replaces `original`, built on `fresh` (a new Use
|
|
303
|
+
* Browser node from the registry, which carries the manifest, the operation
|
|
304
|
+
* and the default settings). Keeps the id and place and every node setting:
|
|
305
|
+
* name, notes, enabled state, the retry and error-branch settings
|
|
306
|
+
* (`errorConfig`, on the node or in its state), the execution settings
|
|
307
|
+
* without a runner (Use Browser never takes one) and the shared Run in
|
|
308
|
+
* options. Throws when the conversion is blocked.
|
|
309
|
+
*/
|
|
310
|
+
function convertedUseBrowserNode(original, fresh, conversion) {
|
|
311
|
+
if (!conversion.script) throw new Error("A blocked conversion cannot replace the node");
|
|
312
|
+
const oldData = nodeData(original);
|
|
313
|
+
const freshData = nodeData(fresh);
|
|
314
|
+
const oldState = stateOf(oldData);
|
|
315
|
+
const carried = {};
|
|
316
|
+
for (const key of [...CARRIED_NODE_SETTINGS, ...STATE_SETTING_KEYS]) if (oldState[key] !== void 0) carried[key] = oldState[key];
|
|
317
|
+
const state = {
|
|
318
|
+
...stateOf(freshData),
|
|
319
|
+
...carried,
|
|
320
|
+
[USE_BROWSER_SCRIPT_PARAMETER]: conversion.script
|
|
321
|
+
};
|
|
322
|
+
if (Object.keys(conversion.inputs).length > 0) state[USE_BROWSER_INPUTS_PARAMETER] = { ...conversion.inputs };
|
|
323
|
+
const data = { ...freshData };
|
|
324
|
+
for (const [key, value] of Object.entries(oldData)) if (!NODE_TYPE_DATA_KEYS.has(key) && value !== void 0) data[key] = value;
|
|
325
|
+
data.args = {
|
|
326
|
+
...argsOf(freshData),
|
|
327
|
+
state
|
|
328
|
+
};
|
|
329
|
+
delete data.executionSettings;
|
|
330
|
+
if (isRecord(oldData.executionSettings)) {
|
|
331
|
+
const settings = { ...oldData.executionSettings };
|
|
332
|
+
delete settings.runOn;
|
|
333
|
+
if (Object.keys(settings).length > 0) data.executionSettings = settings;
|
|
334
|
+
}
|
|
335
|
+
return {
|
|
336
|
+
...fresh,
|
|
337
|
+
id: original.id,
|
|
338
|
+
type: USE_BROWSER_NODE_TYPE,
|
|
339
|
+
position: { ...original.position },
|
|
340
|
+
...original.parentId === void 0 ? {} : { parentId: original.parentId },
|
|
341
|
+
...original.extent === void 0 ? {} : { extent: original.extent },
|
|
342
|
+
selected: original.selected === true,
|
|
343
|
+
data
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export { newUseBrowserNode as i, convertBrowserActionSteps as n, convertedUseBrowserNode as r, convertBrowserActionNode as t };
|