@fluidgrids/fe-sdk 0.0.0-stage → 2026.1203.8
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,727 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as describeOperationError } from "./errors-ClKb5sEt.js";
|
|
3
|
+
import { fV as UiElementCreatedVia, mV as UiSnapshotOwnerKind } from "./graphql-types-UTYtujY9.js";
|
|
4
|
+
import { CombinedGraphQLErrors, ServerError } from "@apollo/client/errors";
|
|
5
|
+
|
|
6
|
+
// src/generated/documents/wspace/ElementLibraryReplayDocument.ts
|
|
7
|
+
const ElementLibraryReplayDocument = {
|
|
8
|
+
"kind": "Document",
|
|
9
|
+
"definitions": [{
|
|
10
|
+
"kind": "OperationDefinition",
|
|
11
|
+
"operation": "query",
|
|
12
|
+
"name": {
|
|
13
|
+
"kind": "Name",
|
|
14
|
+
"value": "ElementLibraryReplay"
|
|
15
|
+
},
|
|
16
|
+
"variableDefinitions": [{
|
|
17
|
+
"kind": "VariableDefinition",
|
|
18
|
+
"variable": {
|
|
19
|
+
"kind": "Variable",
|
|
20
|
+
"name": {
|
|
21
|
+
"kind": "Name",
|
|
22
|
+
"value": "input"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"type": {
|
|
26
|
+
"kind": "NonNullType",
|
|
27
|
+
"type": {
|
|
28
|
+
"kind": "NamedType",
|
|
29
|
+
"name": {
|
|
30
|
+
"kind": "Name",
|
|
31
|
+
"value": "ReplayUiScriptInput"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"directives": []
|
|
36
|
+
}],
|
|
37
|
+
"directives": [],
|
|
38
|
+
"selectionSet": {
|
|
39
|
+
"kind": "SelectionSet",
|
|
40
|
+
"selections": [{
|
|
41
|
+
"kind": "Field",
|
|
42
|
+
"name": {
|
|
43
|
+
"kind": "Name",
|
|
44
|
+
"value": "replayUiScriptOnSnapshots"
|
|
45
|
+
},
|
|
46
|
+
"arguments": [{
|
|
47
|
+
"kind": "Argument",
|
|
48
|
+
"name": {
|
|
49
|
+
"kind": "Name",
|
|
50
|
+
"value": "input"
|
|
51
|
+
},
|
|
52
|
+
"value": {
|
|
53
|
+
"kind": "Variable",
|
|
54
|
+
"name": {
|
|
55
|
+
"kind": "Name",
|
|
56
|
+
"value": "input"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}],
|
|
60
|
+
"directives": [],
|
|
61
|
+
"selectionSet": {
|
|
62
|
+
"kind": "SelectionSet",
|
|
63
|
+
"selections": [
|
|
64
|
+
{
|
|
65
|
+
"kind": "Field",
|
|
66
|
+
"name": {
|
|
67
|
+
"kind": "Name",
|
|
68
|
+
"value": "passed"
|
|
69
|
+
},
|
|
70
|
+
"arguments": [],
|
|
71
|
+
"directives": []
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"kind": "Field",
|
|
75
|
+
"name": {
|
|
76
|
+
"kind": "Name",
|
|
77
|
+
"value": "untested"
|
|
78
|
+
},
|
|
79
|
+
"arguments": [],
|
|
80
|
+
"directives": []
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"kind": "Field",
|
|
84
|
+
"name": {
|
|
85
|
+
"kind": "Name",
|
|
86
|
+
"value": "cpuMs"
|
|
87
|
+
},
|
|
88
|
+
"arguments": [],
|
|
89
|
+
"directives": []
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"kind": "Field",
|
|
93
|
+
"name": {
|
|
94
|
+
"kind": "Name",
|
|
95
|
+
"value": "snapshots"
|
|
96
|
+
},
|
|
97
|
+
"arguments": [],
|
|
98
|
+
"directives": [],
|
|
99
|
+
"selectionSet": {
|
|
100
|
+
"kind": "SelectionSet",
|
|
101
|
+
"selections": [
|
|
102
|
+
{
|
|
103
|
+
"kind": "Field",
|
|
104
|
+
"name": {
|
|
105
|
+
"kind": "Name",
|
|
106
|
+
"value": "snapshotId"
|
|
107
|
+
},
|
|
108
|
+
"arguments": [],
|
|
109
|
+
"directives": []
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"kind": "Field",
|
|
113
|
+
"name": {
|
|
114
|
+
"kind": "Name",
|
|
115
|
+
"value": "passed"
|
|
116
|
+
},
|
|
117
|
+
"arguments": [],
|
|
118
|
+
"directives": []
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"kind": "Field",
|
|
122
|
+
"name": {
|
|
123
|
+
"kind": "Name",
|
|
124
|
+
"value": "errorCode"
|
|
125
|
+
},
|
|
126
|
+
"arguments": [],
|
|
127
|
+
"directives": []
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"kind": "Field",
|
|
131
|
+
"name": {
|
|
132
|
+
"kind": "Name",
|
|
133
|
+
"value": "failedStepPath"
|
|
134
|
+
},
|
|
135
|
+
"arguments": [],
|
|
136
|
+
"directives": []
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
}]
|
|
144
|
+
}
|
|
145
|
+
}]
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// src/rpa/picked-element.ts
|
|
149
|
+
/** The longest snapshot accepted from the extension (its own cap is 192 KiB of gzip, base64 is 4/3 of that). */
|
|
150
|
+
const MAX_SNAPSHOT_BASE64 = 27e4;
|
|
151
|
+
const FILE_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
|
|
152
|
+
function isRecord$1(value) {
|
|
153
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
154
|
+
}
|
|
155
|
+
function bounds(value) {
|
|
156
|
+
if (!isRecord$1(value)) return null;
|
|
157
|
+
const { x, y, width, height } = value;
|
|
158
|
+
if (![
|
|
159
|
+
x,
|
|
160
|
+
y,
|
|
161
|
+
width,
|
|
162
|
+
height
|
|
163
|
+
].every((item) => typeof item === "number" && Number.isFinite(item))) return null;
|
|
164
|
+
return {
|
|
165
|
+
x,
|
|
166
|
+
y,
|
|
167
|
+
width,
|
|
168
|
+
height
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/** The pick event's data as a picked element, or null when it holds no usable target. */
|
|
172
|
+
function readPickedElement(data) {
|
|
173
|
+
const target = data.target;
|
|
174
|
+
if (!isRecord$1(target) || !Array.isArray(target.methods) || target.methods.length === 0) return null;
|
|
175
|
+
const snapshot = data.snapshot;
|
|
176
|
+
const tree = isRecord$1(snapshot) && snapshot.ownerKind === "ELEMENT_VERSION" && typeof snapshot.stepPath === "string" && typeof snapshot.treeGzipBase64 === "string" && snapshot.treeGzipBase64.length > 0 && snapshot.treeGzipBase64.length <= MAX_SNAPSHOT_BASE64 ? {
|
|
177
|
+
ownerKind: "ELEMENT_VERSION",
|
|
178
|
+
stepPath: snapshot.stepPath,
|
|
179
|
+
treeGzipBase64: snapshot.treeGzipBase64
|
|
180
|
+
} : null;
|
|
181
|
+
const name = typeof data.name === "string" && data.name.trim() ? data.name.trim().slice(0, 200) : null;
|
|
182
|
+
const fileId = typeof data.screenshotFileId === "string" && FILE_ID_PATTERN.test(data.screenshotFileId) ? data.screenshotFileId : null;
|
|
183
|
+
return {
|
|
184
|
+
target,
|
|
185
|
+
highlight: bounds(data.highlight),
|
|
186
|
+
name,
|
|
187
|
+
screenshotFileId: fileId,
|
|
188
|
+
snapshot: tree
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
/** Whether the target in a form is still the one the picker gave. */
|
|
192
|
+
function isPickedTarget(target, picked) {
|
|
193
|
+
return picked !== null && JSON.stringify(target) === JSON.stringify(picked.target);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// src/modules/element-library/lib/element-library.ts
|
|
197
|
+
/**
|
|
198
|
+
* The Element library page's rules that need no React (RPA plan P1-13, spec 19
|
|
199
|
+
* M4 and M5): reading the service's refusals, keys and URL patterns, health
|
|
200
|
+
* figures, where an element is used, the apply candidates, and the shared
|
|
201
|
+
* sequence as the step editor reads and writes it.
|
|
202
|
+
*
|
|
203
|
+
* Nothing here loads `@burdenoff/ui-engine`: the page's first load stays free
|
|
204
|
+
* of the engine, which only the lazily loaded step editor brings.
|
|
205
|
+
*/
|
|
206
|
+
const RPA_CODES = [
|
|
207
|
+
"RPA_DISABLED",
|
|
208
|
+
"NOT_FOUND",
|
|
209
|
+
"INVALID_STATE",
|
|
210
|
+
"IN_USE",
|
|
211
|
+
"INVALID_INPUT",
|
|
212
|
+
"LIMIT",
|
|
213
|
+
"TOO_LARGE"
|
|
214
|
+
];
|
|
215
|
+
function isRpaCode(code) {
|
|
216
|
+
return RPA_CODES.some((known) => known === code);
|
|
217
|
+
}
|
|
218
|
+
function isRecord(value) {
|
|
219
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
220
|
+
}
|
|
221
|
+
function bodyErrors(bodyText) {
|
|
222
|
+
try {
|
|
223
|
+
const parsed = JSON.parse(bodyText);
|
|
224
|
+
if (!isRecord(parsed) || !Array.isArray(parsed.errors)) return [];
|
|
225
|
+
return parsed.errors.filter((entry) => isRecord(entry) && typeof entry.message === "string");
|
|
226
|
+
} catch {
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/** The GraphQL errors behind anything an operation threw. */
|
|
231
|
+
function graphQLErrors(error) {
|
|
232
|
+
if (CombinedGraphQLErrors.is(error)) return error.errors;
|
|
233
|
+
if (ServerError.is(error)) return bodyErrors(error.bodyText);
|
|
234
|
+
if (error instanceof Error && error.cause !== void 0) return graphQLErrors(error.cause);
|
|
235
|
+
return [];
|
|
236
|
+
}
|
|
237
|
+
/** An extension of the first GraphQL error, when it is text. */
|
|
238
|
+
function extensionOf(error, name) {
|
|
239
|
+
const value = graphQLErrors(error)[0]?.extensions?.[name];
|
|
240
|
+
return typeof value === "string" ? value : void 0;
|
|
241
|
+
}
|
|
242
|
+
/** The element library's refusal code of an error, when it carries one. */
|
|
243
|
+
function rpaErrorCode(error) {
|
|
244
|
+
const code = extensionOf(error, "rpaCode");
|
|
245
|
+
return isRpaCode(code) ? code : void 0;
|
|
246
|
+
}
|
|
247
|
+
/** Whether the gateway refused the call for a missing permission. */
|
|
248
|
+
function isForbidden(error) {
|
|
249
|
+
return extensionOf(error, "code") === "FORBIDDEN";
|
|
250
|
+
}
|
|
251
|
+
/** The field an INVALID_INPUT refusal names, when it names one. */
|
|
252
|
+
function rpaErrorField(error) {
|
|
253
|
+
return extensionOf(error, "field");
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* What to tell the person about a refused or failed call. The codes the page
|
|
257
|
+
* expects get their own sentence; anything else shows the service's message.
|
|
258
|
+
*/
|
|
259
|
+
function libraryErrorText(error) {
|
|
260
|
+
switch (rpaErrorCode(error)) {
|
|
261
|
+
case "RPA_DISABLED": return {
|
|
262
|
+
key: "fluidgrids.elementLibrary.error.disabled",
|
|
263
|
+
fallback: "Browser automation is switched off for this workspace, so the Element library cannot be changed. You can still read it."
|
|
264
|
+
};
|
|
265
|
+
case "IN_USE": return {
|
|
266
|
+
key: "fluidgrids.elementLibrary.error.inUse",
|
|
267
|
+
fallback: "Workflows still use this. Remove it from those workflows first."
|
|
268
|
+
};
|
|
269
|
+
case "INVALID_STATE": return {
|
|
270
|
+
key: "fluidgrids.elementLibrary.error.stale",
|
|
271
|
+
fallback: "Someone saved a newer version while you were editing. Reload it and make your change again."
|
|
272
|
+
};
|
|
273
|
+
case "NOT_FOUND": return {
|
|
274
|
+
key: "fluidgrids.elementLibrary.error.notFound",
|
|
275
|
+
fallback: "It no longer exists, or you cannot open it."
|
|
276
|
+
};
|
|
277
|
+
case "LIMIT": return {
|
|
278
|
+
key: "fluidgrids.elementLibrary.error.limit",
|
|
279
|
+
fallback: "The workspace has reached the Element library limit."
|
|
280
|
+
};
|
|
281
|
+
case "TOO_LARGE": return {
|
|
282
|
+
key: "fluidgrids.elementLibrary.error.tooLarge",
|
|
283
|
+
fallback: "It is too large to save."
|
|
284
|
+
};
|
|
285
|
+
case "INVALID_INPUT": {
|
|
286
|
+
const field = rpaErrorField(error);
|
|
287
|
+
return field ? {
|
|
288
|
+
key: "fluidgrids.elementLibrary.error.invalidField",
|
|
289
|
+
fallback: "Check {{field}}: {{message}}",
|
|
290
|
+
vars: {
|
|
291
|
+
field,
|
|
292
|
+
message: describeOperationError(error)
|
|
293
|
+
}
|
|
294
|
+
} : {
|
|
295
|
+
key: "fluidgrids.elementLibrary.error.invalid",
|
|
296
|
+
fallback: "{{message}}",
|
|
297
|
+
vars: { message: describeOperationError(error) }
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
default:
|
|
301
|
+
if (isForbidden(error)) return {
|
|
302
|
+
key: "fluidgrids.elementLibrary.error.forbidden",
|
|
303
|
+
fallback: "You do not have permission to do this."
|
|
304
|
+
};
|
|
305
|
+
return {
|
|
306
|
+
key: "fluidgrids.elementLibrary.error.generic",
|
|
307
|
+
fallback: "{{message}}",
|
|
308
|
+
vars: { message: describeOperationError(error, "Something went wrong") }
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/** Application and screen keys: letters, digits, hyphen and underscore (1 to 64). */
|
|
313
|
+
const LIBRARY_KEY_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
|
|
314
|
+
/** Element and sequence keys: the engine's element key rule. */
|
|
315
|
+
const ELEMENT_KEY_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]{0,63}$/;
|
|
316
|
+
/**
|
|
317
|
+
* A key made from a name: lower case, words joined by `_`, at most 64
|
|
318
|
+
* characters. For an element key (`element`) it starts with a letter or `_`.
|
|
319
|
+
*/
|
|
320
|
+
function keyFromName(name, element = false) {
|
|
321
|
+
let key = name.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("_").slice(0, 64);
|
|
322
|
+
if (element && key && !/^[a-z_]/.test(key)) key = `_${key}`.slice(0, 64);
|
|
323
|
+
return key;
|
|
324
|
+
}
|
|
325
|
+
/** What a new element's target starts with: a role and its name. */
|
|
326
|
+
function newElementTarget() {
|
|
327
|
+
return { methods: [{
|
|
328
|
+
kind: "role",
|
|
329
|
+
role: "button",
|
|
330
|
+
name: ""
|
|
331
|
+
}] };
|
|
332
|
+
}
|
|
333
|
+
/** The dialog's first values: the element's, or a new element on `screenId`. */
|
|
334
|
+
function elementFormValues(element, screenId) {
|
|
335
|
+
return {
|
|
336
|
+
name: element?.name ?? "",
|
|
337
|
+
key: element ? element.key : null,
|
|
338
|
+
screen: element?.screenId ?? screenId ?? "",
|
|
339
|
+
controlType: element?.controlType ?? "",
|
|
340
|
+
notes: element?.notes ?? "",
|
|
341
|
+
note: "",
|
|
342
|
+
target: isRecord(element?.target) ? element.target : newElementTarget()
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
/** The key the dialog shows: typed, or made from the name. */
|
|
346
|
+
function elementFormKey(values) {
|
|
347
|
+
return values.key ?? keyFromName(values.name, true);
|
|
348
|
+
}
|
|
349
|
+
/** Whether saving would write a new version (a new element, or a changed target). */
|
|
350
|
+
function elementTargetChanged(values, element) {
|
|
351
|
+
return !element || JSON.stringify(values.target) !== JSON.stringify(element.target);
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* The save the dialog sends, or null while the values cannot be saved (no
|
|
355
|
+
* name, a key the engine refuses, no target). A changed target writes the
|
|
356
|
+
* next version, made by hand, with the note; otherwise only the element's
|
|
357
|
+
* own fields change. `expectedVersion` makes a stale save fail.
|
|
358
|
+
*/
|
|
359
|
+
function elementSaveInput(values, applicationId, element, picked = null) {
|
|
360
|
+
const key = elementFormKey(values);
|
|
361
|
+
if (!values.name.trim() || !ELEMENT_KEY_PATTERN.test(key)) return null;
|
|
362
|
+
if (!isRecord(values.target)) return null;
|
|
363
|
+
return {
|
|
364
|
+
id: element?.id ?? null,
|
|
365
|
+
applicationId,
|
|
366
|
+
key,
|
|
367
|
+
name: values.name.trim(),
|
|
368
|
+
screenId: values.screen || null,
|
|
369
|
+
controlType: values.controlType.trim() || null,
|
|
370
|
+
notes: values.notes.trim() || null,
|
|
371
|
+
expectedVersion: element?.currentVersion ?? null,
|
|
372
|
+
...elementTargetChanged(values, element) ? {
|
|
373
|
+
target: values.target,
|
|
374
|
+
note: values.note.trim() || null,
|
|
375
|
+
...isPickedTarget(values.target, picked) && picked ? {
|
|
376
|
+
createdVia: "PICKER",
|
|
377
|
+
...picked.highlight ? { highlight: picked.highlight } : {},
|
|
378
|
+
...picked.screenshotFileId ? { screenshotFileId: picked.screenshotFileId } : {},
|
|
379
|
+
...picked.snapshot ? { snapshot: {
|
|
380
|
+
ownerKind: "ELEMENT_VERSION",
|
|
381
|
+
stepPath: picked.snapshot.stepPath,
|
|
382
|
+
treeGzipBase64: picked.snapshot.treeGzipBase64
|
|
383
|
+
} } : {}
|
|
384
|
+
} : { createdVia: "MANUAL" }
|
|
385
|
+
} : {}
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
/** The elements of a screen (or of no screen, for `null`), in list order. */
|
|
389
|
+
function elementsOnScreen(elements, screenId) {
|
|
390
|
+
return elements.filter((element) => (element.screenId ?? null) === screenId);
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* The page a URL pattern starts at, for the picker's start page: the pattern
|
|
394
|
+
* up to its first `*` (`https://portal.example.com/*` gives
|
|
395
|
+
* `https://portal.example.com/`). Undefined when that is not a whole web
|
|
396
|
+
* address (a wildcard in the host).
|
|
397
|
+
*/
|
|
398
|
+
function pageOfUrlPattern(pattern) {
|
|
399
|
+
if (!pattern) return void 0;
|
|
400
|
+
const page = pattern.trim().split("*")[0] ?? "";
|
|
401
|
+
try {
|
|
402
|
+
const url = new URL(page);
|
|
403
|
+
return (url.protocol === "https:" || url.protocol === "http:") && url.hostname ? url.toString() : void 0;
|
|
404
|
+
} catch {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
/** URL patterns typed one per line (or separated by commas), trimmed and without repeats. */
|
|
409
|
+
function parseUrlPatterns(text) {
|
|
410
|
+
const patterns = /* @__PURE__ */ new Set();
|
|
411
|
+
for (const part of text.split(/[\n,]/)) {
|
|
412
|
+
const pattern = part.trim();
|
|
413
|
+
if (pattern) patterns.add(pattern);
|
|
414
|
+
}
|
|
415
|
+
return [...patterns];
|
|
416
|
+
}
|
|
417
|
+
/** A rate from 0 to 1 as a percentage with at most one decimal ("99.1%"). */
|
|
418
|
+
function percentText(rate) {
|
|
419
|
+
if (rate === null || rate === void 0 || !Number.isFinite(rate)) return "–";
|
|
420
|
+
return `${Math.round(rate * 1e3) / 10}%`;
|
|
421
|
+
}
|
|
422
|
+
/** Milliseconds as "180 ms" or "1.2 s". */
|
|
423
|
+
function durationText(ms) {
|
|
424
|
+
if (ms === null || ms === void 0 || !Number.isFinite(ms)) return "–";
|
|
425
|
+
if (ms < 1e3) return `${Math.round(ms)} ms`;
|
|
426
|
+
return `${Math.round(ms / 100) / 10} s`;
|
|
427
|
+
}
|
|
428
|
+
/** Which methods found the element, most used first. */
|
|
429
|
+
function methodShares(resolvedBy) {
|
|
430
|
+
const total = resolvedBy.reduce((sum, entry) => sum + entry.count, 0);
|
|
431
|
+
if (total <= 0) return [];
|
|
432
|
+
return resolvedBy.filter((entry) => entry.count > 0).map((entry) => ({
|
|
433
|
+
method: entry.method,
|
|
434
|
+
count: entry.count,
|
|
435
|
+
share: Math.round(entry.count / total * 100)
|
|
436
|
+
})).sort((a, b) => b.count - a.count || a.method.localeCompare(b.method));
|
|
437
|
+
}
|
|
438
|
+
/** Runs that a method other than the first enabled one found the element in. */
|
|
439
|
+
function fallbackRuns(daily) {
|
|
440
|
+
return daily.reduce((sum, day) => sum + day.fallbacks, 0);
|
|
441
|
+
}
|
|
442
|
+
/** The words for a target method kind of the engine schema. */
|
|
443
|
+
function methodText(method) {
|
|
444
|
+
switch (method) {
|
|
445
|
+
case "role":
|
|
446
|
+
case "css":
|
|
447
|
+
case "testId":
|
|
448
|
+
case "xpath": return {
|
|
449
|
+
key: "fluidgrids.elementLibrary.method.strict",
|
|
450
|
+
fallback: "Strict"
|
|
451
|
+
};
|
|
452
|
+
case "fuzzy": return {
|
|
453
|
+
key: "fluidgrids.elementLibrary.method.fuzzy",
|
|
454
|
+
fallback: "Fuzzy"
|
|
455
|
+
};
|
|
456
|
+
case "anchor": return {
|
|
457
|
+
key: "fluidgrids.elementLibrary.method.anchor",
|
|
458
|
+
fallback: "Anchor"
|
|
459
|
+
};
|
|
460
|
+
case "text": return {
|
|
461
|
+
key: "fluidgrids.elementLibrary.method.text",
|
|
462
|
+
fallback: "Text"
|
|
463
|
+
};
|
|
464
|
+
default: return {
|
|
465
|
+
key: "fluidgrids.elementLibrary.method.other",
|
|
466
|
+
fallback: "{{method}}",
|
|
467
|
+
vars: { method }
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
/** Compare two workflow versions ("1.10.0" after "1.9.2"). */
|
|
472
|
+
function compareVersions(a, b) {
|
|
473
|
+
return a.localeCompare(b, void 0, { numeric: true });
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* The "Where used" list, one entry per workflow: the version that runs today
|
|
477
|
+
* (the active one) when it pins the element, otherwise the newest version that
|
|
478
|
+
* does. Ordered by workflow name.
|
|
479
|
+
*/
|
|
480
|
+
function usageByWorkflow(rows) {
|
|
481
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
482
|
+
for (const row of rows) {
|
|
483
|
+
const list = byKey.get(row.workflowKey) ?? [];
|
|
484
|
+
list.push(row);
|
|
485
|
+
byKey.set(row.workflowKey, list);
|
|
486
|
+
}
|
|
487
|
+
const result = [];
|
|
488
|
+
for (const [workflowKey, list] of byKey) {
|
|
489
|
+
const active = list.filter((row) => row.isActive);
|
|
490
|
+
const pool = active.length > 0 ? active : list;
|
|
491
|
+
const newest = pool.reduce((best, row) => compareVersions(row.workflowVersion, best.workflowVersion) > 0 ? row : best);
|
|
492
|
+
const sameVersion = pool.filter((row) => row.workflowVersion === newest.workflowVersion);
|
|
493
|
+
result.push({
|
|
494
|
+
workflowKey,
|
|
495
|
+
workflowName: newest.workflowName,
|
|
496
|
+
workflowVersion: newest.workflowVersion,
|
|
497
|
+
isActive: newest.isActive,
|
|
498
|
+
elementVersion: Math.min(...sameVersion.map((row) => row.elementVersion)),
|
|
499
|
+
nodes: sameVersion.length
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
return result.sort((a, b) => a.workflowName.localeCompare(b.workflowName) || a.workflowKey.localeCompare(b.workflowKey));
|
|
503
|
+
}
|
|
504
|
+
/** The workflows an element version can be applied to: those that pin an older version. */
|
|
505
|
+
function applyCandidates(usage, version) {
|
|
506
|
+
return usage.filter((entry) => entry.elementVersion < version);
|
|
507
|
+
}
|
|
508
|
+
/** What happened to one workflow in an apply, in words. */
|
|
509
|
+
function applyItemText(item) {
|
|
510
|
+
if (item.status === "APPLIED") return item.activated ? {
|
|
511
|
+
key: "fluidgrids.elementLibrary.apply.appliedActive",
|
|
512
|
+
fallback: "Updated to v{{version}} and activated",
|
|
513
|
+
vars: { version: item.newVersion ?? "" }
|
|
514
|
+
} : {
|
|
515
|
+
key: "fluidgrids.elementLibrary.apply.applied",
|
|
516
|
+
fallback: "Updated to v{{version}}",
|
|
517
|
+
vars: { version: item.newVersion ?? "" }
|
|
518
|
+
};
|
|
519
|
+
switch (item.reason) {
|
|
520
|
+
case "REPLAY_FAILED": return {
|
|
521
|
+
key: "fluidgrids.elementLibrary.apply.replayFailed",
|
|
522
|
+
fallback: "Not updated: the snapshot test failed. Open the workflow to fix the step first."
|
|
523
|
+
};
|
|
524
|
+
case "UNTESTED": return {
|
|
525
|
+
key: "fluidgrids.elementLibrary.apply.untested",
|
|
526
|
+
fallback: "Not updated: no snapshot to test against. Tick the option below to apply it anyway."
|
|
527
|
+
};
|
|
528
|
+
case "FORBIDDEN": return {
|
|
529
|
+
key: "fluidgrids.elementLibrary.apply.forbidden",
|
|
530
|
+
fallback: "Not updated: you cannot create or activate versions of this workflow."
|
|
531
|
+
};
|
|
532
|
+
case "NOT_FOUND": return {
|
|
533
|
+
key: "fluidgrids.elementLibrary.apply.notFound",
|
|
534
|
+
fallback: "Not updated: you cannot open this workflow."
|
|
535
|
+
};
|
|
536
|
+
case "NOT_PINNED": return {
|
|
537
|
+
key: "fluidgrids.elementLibrary.apply.notPinned",
|
|
538
|
+
fallback: "Not updated: it does not pin an older version."
|
|
539
|
+
};
|
|
540
|
+
case "SAVE_FAILED": return {
|
|
541
|
+
key: "fluidgrids.elementLibrary.apply.saveFailed",
|
|
542
|
+
fallback: "Not updated: the workflow's checks refused the new version. Nothing was written."
|
|
543
|
+
};
|
|
544
|
+
default: return {
|
|
545
|
+
key: "fluidgrids.elementLibrary.apply.skipped",
|
|
546
|
+
fallback: "Not updated"
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function asList(value) {
|
|
551
|
+
if (Array.isArray(value)) return value;
|
|
552
|
+
if (typeof value === "string" && value.trim()) try {
|
|
553
|
+
const parsed = JSON.parse(value);
|
|
554
|
+
if (Array.isArray(parsed)) return parsed;
|
|
555
|
+
} catch {}
|
|
556
|
+
return [];
|
|
557
|
+
}
|
|
558
|
+
function asRecord(value) {
|
|
559
|
+
if (isRecord(value)) return value;
|
|
560
|
+
if (typeof value === "string" && value.trim()) try {
|
|
561
|
+
const parsed = JSON.parse(value);
|
|
562
|
+
if (isRecord(parsed)) return parsed;
|
|
563
|
+
} catch {}
|
|
564
|
+
return {};
|
|
565
|
+
}
|
|
566
|
+
/** The pins of a stored version's `elements`, keeping only well-formed ones. */
|
|
567
|
+
function sequencePins(elements) {
|
|
568
|
+
const pins = {};
|
|
569
|
+
for (const [key, pin] of Object.entries(asRecord(elements))) {
|
|
570
|
+
if (!isRecord(pin)) continue;
|
|
571
|
+
const { elementId, version } = pin;
|
|
572
|
+
if (typeof elementId === "string" && typeof version === "number") pins[key] = {
|
|
573
|
+
elementId,
|
|
574
|
+
version
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
return pins;
|
|
578
|
+
}
|
|
579
|
+
/** An empty sequence: what "New sequence" starts with. */
|
|
580
|
+
function emptySequenceDraft() {
|
|
581
|
+
return {
|
|
582
|
+
scriptVersion: 1,
|
|
583
|
+
steps: []
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
/** A stored sequence version as a draft for the step editor. */
|
|
587
|
+
function sequenceDraft(version, elementNames = {}) {
|
|
588
|
+
const pins = sequencePins(version.elements);
|
|
589
|
+
const elements = {};
|
|
590
|
+
for (const [key, pin] of Object.entries(pins)) {
|
|
591
|
+
const name = elementNames[pin.elementId];
|
|
592
|
+
elements[key] = name ? {
|
|
593
|
+
...pin,
|
|
594
|
+
name
|
|
595
|
+
} : { ...pin };
|
|
596
|
+
}
|
|
597
|
+
const args = asList(version.arguments);
|
|
598
|
+
const outputs = asList(version.outputs);
|
|
599
|
+
return {
|
|
600
|
+
scriptVersion: 1,
|
|
601
|
+
...args.length > 0 ? { inputs: args } : {},
|
|
602
|
+
...outputs.length > 0 ? { outputs } : {},
|
|
603
|
+
...Object.keys(elements).length > 0 ? { elements } : {},
|
|
604
|
+
steps: asList(version.steps)
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
/** Whether a value is a sequence draft as the step editor writes it. */
|
|
608
|
+
function isSequenceDraft(value) {
|
|
609
|
+
return isRecord(value) && value.scriptVersion === 1 && Array.isArray(value.steps);
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* The editor's value as a draft, or null when it is not one. A draft object
|
|
613
|
+
* is kept as it is (the editor compares identities); JSON text is parsed.
|
|
614
|
+
*/
|
|
615
|
+
function readSequenceDraft(value) {
|
|
616
|
+
if (isSequenceDraft(value)) return value;
|
|
617
|
+
const record = asRecord(value);
|
|
618
|
+
if (!Array.isArray(record.steps)) return null;
|
|
619
|
+
return {
|
|
620
|
+
...record,
|
|
621
|
+
scriptVersion: 1,
|
|
622
|
+
steps: record.steps
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
/** A draft as the fields of the next sequence version. */
|
|
626
|
+
function sequenceVersionFields(draft) {
|
|
627
|
+
return {
|
|
628
|
+
arguments: asList(draft.inputs),
|
|
629
|
+
outputs: asList(draft.outputs),
|
|
630
|
+
steps: asList(draft.steps),
|
|
631
|
+
elements: sequencePins(draft.elements)
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* A draft as a script to replay ("Test without a browser"): the steps with
|
|
636
|
+
* the sequence's arguments as inputs and its pins, nothing else.
|
|
637
|
+
*/
|
|
638
|
+
function replayScript(draft) {
|
|
639
|
+
const fields = sequenceVersionFields(draft);
|
|
640
|
+
return {
|
|
641
|
+
scriptVersion: 1,
|
|
642
|
+
...fields.arguments.length > 0 ? { inputs: fields.arguments } : {},
|
|
643
|
+
...fields.outputs.length > 0 ? { outputs: fields.outputs } : {},
|
|
644
|
+
elements: fields.elements,
|
|
645
|
+
steps: fields.steps
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
/** The pins of a draft, by key. */
|
|
649
|
+
function draftPins(draft) {
|
|
650
|
+
const named = asRecord(draft.elements);
|
|
651
|
+
return Object.entries(sequencePins(draft.elements)).map(([key, pin]) => {
|
|
652
|
+
const entry = asRecord(named[key]);
|
|
653
|
+
return {
|
|
654
|
+
key,
|
|
655
|
+
...pin,
|
|
656
|
+
...typeof entry.name === "string" ? { name: entry.name } : {}
|
|
657
|
+
};
|
|
658
|
+
}).sort((a, b) => a.key.localeCompare(b.key));
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* The draft with every pin's element name filled in from `names` (by element
|
|
662
|
+
* id), for the step sentences and the element chooser. The draft itself comes
|
|
663
|
+
* back when nothing changes, so the step editor keeps its identity.
|
|
664
|
+
*/
|
|
665
|
+
function withPinNames(draft, names) {
|
|
666
|
+
const elements = asRecord(draft.elements);
|
|
667
|
+
let changed = false;
|
|
668
|
+
const next = {};
|
|
669
|
+
for (const [key, entry] of Object.entries(elements)) {
|
|
670
|
+
const pin = asRecord(entry);
|
|
671
|
+
const name = typeof pin.elementId === "string" && Object.hasOwn(names, pin.elementId) ? names[pin.elementId] : void 0;
|
|
672
|
+
if (name !== void 0 && pin.name !== name) {
|
|
673
|
+
next[key] = {
|
|
674
|
+
...pin,
|
|
675
|
+
name
|
|
676
|
+
};
|
|
677
|
+
changed = true;
|
|
678
|
+
} else next[key] = entry;
|
|
679
|
+
}
|
|
680
|
+
return changed ? {
|
|
681
|
+
...draft,
|
|
682
|
+
elements: next
|
|
683
|
+
} : draft;
|
|
684
|
+
}
|
|
685
|
+
/** The draft with an element pinned under `key` (replacing an earlier pin of that key). */
|
|
686
|
+
function withPin(draft, key, pin) {
|
|
687
|
+
return {
|
|
688
|
+
...draft,
|
|
689
|
+
elements: {
|
|
690
|
+
...asRecord(draft.elements),
|
|
691
|
+
[key]: pin
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
/** Whether any step of the draft names `key` as its element (at any depth, in any target). */
|
|
696
|
+
function stepsUseKey(steps, key) {
|
|
697
|
+
if (Array.isArray(steps)) return steps.some((step) => stepsUseKey(step, key));
|
|
698
|
+
if (!isRecord(steps)) return false;
|
|
699
|
+
if (steps.element === key) return true;
|
|
700
|
+
return Object.values(steps).some((value) => stepsUseKey(value, key));
|
|
701
|
+
}
|
|
702
|
+
/** The draft without the pin of `key`. Refused (null) while a step still uses it. */
|
|
703
|
+
function withoutPin(draft, key) {
|
|
704
|
+
if (stepsUseKey(draft.steps, key) || stepsUseKey(draft.cleanup, key)) return null;
|
|
705
|
+
const elements = { ...asRecord(draft.elements) };
|
|
706
|
+
delete elements[key];
|
|
707
|
+
const next = {
|
|
708
|
+
...draft,
|
|
709
|
+
elements
|
|
710
|
+
};
|
|
711
|
+
if (Object.keys(elements).length === 0) delete next.elements;
|
|
712
|
+
return next;
|
|
713
|
+
}
|
|
714
|
+
/** The first key from `base` that the draft does not pin yet (`base`, `base_2`, …). */
|
|
715
|
+
function freePinKey(draft, base) {
|
|
716
|
+
const used = asRecord(draft.elements);
|
|
717
|
+
const free = (key) => !Object.hasOwn(used, key);
|
|
718
|
+
if (free(base)) return base;
|
|
719
|
+
for (let n = 2; n < 1e5; n++) {
|
|
720
|
+
const suffix = `_${n}`;
|
|
721
|
+
const key = `${base.slice(0, 64 - suffix.length)}${suffix}`;
|
|
722
|
+
if (free(key)) return key;
|
|
723
|
+
}
|
|
724
|
+
throw new Error("No free element key");
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
export { withPinNames as A, readSequenceDraft as C, sequenceVersionFields as D, sequenceDraft as E, isPickedTarget as M, readPickedElement as N, usageByWorkflow as O, ElementLibraryReplayDocument as P, percentText as S, rpaErrorCode as T, libraryErrorText as _, draftPins as a, pageOfUrlPattern as b, elementFormValues as c, elementsOnScreen as d, emptySequenceDraft as f, keyFromName as g, isForbidden as h, applyItemText as i, withoutPin as j, withPin as k, elementSaveInput as l, freePinKey as m, LIBRARY_KEY_PATTERN as n, durationText as o, fallbackRuns as p, applyCandidates as r, elementFormKey as s, ELEMENT_KEY_PATTERN as t, elementTargetChanged as u, methodShares as v, replayScript as w, parseUrlPatterns as x, methodText as y };
|