@powerhousedao/workflow 6.2.3-dev.44 → 6.2.3-dev.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{BlockSelector-C-C56Wcf.js → BlockSelector-B41mSc0W.js} +431 -411
- package/dist/browser/BlockSelector-B41mSc0W.js.map +1 -0
- package/dist/browser/assets/{entry-KqlcH_wb.js → entry-CtB3hwiW.js} +99 -3
- package/dist/browser/assets/{projection-entry-CumnZXAR.js → projection-entry-Cd33KgnS.js} +2 -3
- package/dist/browser/{connection-BUum0hJI.js → connection-BP17lpt3.js} +2 -2
- package/dist/browser/{connection-BUum0hJI.js.map → connection-BP17lpt3.js.map} +1 -1
- package/dist/browser/{connection-form-C9iDnI6H.js → connection-form-CkRzKggD.js} +524 -13
- package/dist/browser/connection-form-CkRzKggD.js.map +1 -0
- package/dist/browser/{data-tree-B4W7ZUmG.js → data-tree-BugZMgLk.js} +2 -2
- package/dist/browser/{data-tree-B4W7ZUmG.js.map → data-tree-BugZMgLk.js.map} +1 -1
- package/dist/browser/document-models/connection/index.js +3 -3
- package/dist/browser/document-models/index.js +3 -3
- package/dist/browser/document-models/workflow/index.js +2 -2
- package/dist/browser/{document-models-C1ZgIZyV.js → document-models-B7IwLbfO.js} +3 -3
- package/dist/browser/{document-models-C1ZgIZyV.js.map → document-models-B7IwLbfO.js.map} +1 -1
- package/dist/browser/{editor-cEmJfc9W.js → editor-9eSmoDTm.js} +331 -39
- package/dist/browser/editor-9eSmoDTm.js.map +1 -0
- package/dist/browser/{editor-4BJf6hN7.js → editor-DvK4LPwF.js} +7 -10
- package/dist/browser/editor-DvK4LPwF.js.map +1 -0
- package/dist/browser/{editor-Crt3ZeGd.js → editor-ldDYxtLV.js} +166 -43
- package/dist/browser/editor-ldDYxtLV.js.map +1 -0
- package/dist/browser/editors/connection-editor/module.js +1 -1
- package/dist/browser/editors/workflow-editor/module.js +1 -1
- package/dist/browser/editors/workflow-studio/module.js +1 -1
- package/dist/browser/graphql-Cr1ia6fo.js +2474 -0
- package/dist/browser/graphql-Cr1ia6fo.js.map +1 -0
- package/dist/browser/index.js +9 -5
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/{module-jDZ4pq3W.js → module-B2BMwu5E.js} +129 -17
- package/dist/browser/module-B2BMwu5E.js.map +1 -0
- package/dist/browser/{module-DU2vb3FH.js → module-D4UiG9ii.js} +13 -5
- package/dist/browser/module-D4UiG9ii.js.map +1 -0
- package/dist/browser/reactor/index.js +2 -2
- package/dist/browser/{runtime-queries-Ds2kk-Ow.js → runtime-queries-IZG_nonR.js} +85 -11
- package/dist/browser/runtime-queries-IZG_nonR.js.map +1 -0
- package/dist/browser/{trigger-text-5CT870cu.js → trigger-text-C37YRggR.js} +142 -20
- package/dist/browser/trigger-text-C37YRggR.js.map +1 -0
- package/dist/browser/upgrade-manifests-C_9cyumV.js +8 -0
- package/dist/browser/{upgrade-manifests-BpakVE9l.js.map → upgrade-manifests-C_9cyumV.js.map} +1 -1
- package/dist/browser/{workflow-BxShRhVy.js → workflow-DFLQ2cFr.js} +2 -2
- package/dist/browser/{workflow-BxShRhVy.js.map → workflow-DFLQ2cFr.js.map} +1 -1
- package/dist/node/{BlockSelector-C9_1wbx4.mjs → BlockSelector-BMnBzXcA.mjs} +431 -411
- package/dist/node/BlockSelector-BMnBzXcA.mjs.map +1 -0
- package/dist/node/{connection-D544oqVW.mjs → connection-BxJoL8js.mjs} +2 -2
- package/dist/node/{connection-D544oqVW.mjs.map → connection-BxJoL8js.mjs.map} +1 -1
- package/dist/node/{connection-form-DUOXUqBz.mjs → connection-form-DZFudcoD.mjs} +524 -13
- package/dist/node/connection-form-DZFudcoD.mjs.map +1 -0
- package/dist/node/{data-tree-CoV-swZZ.mjs → data-tree-CR8IOshA.mjs} +2 -2
- package/dist/node/{data-tree-CoV-swZZ.mjs.map → data-tree-CR8IOshA.mjs.map} +1 -1
- package/dist/node/document-models/connection/index.mjs +3 -3
- package/dist/node/document-models/index.mjs +3 -3
- package/dist/node/document-models/workflow/index.mjs +2 -2
- package/dist/node/{editor-BFDE4Q3v.mjs → editor-BV5CYmUI.mjs} +7 -10
- package/dist/node/editor-BV5CYmUI.mjs.map +1 -0
- package/dist/node/{editor-D2jRtRNl.mjs → editor-D_P9-st9.mjs} +166 -43
- package/dist/node/editor-D_P9-st9.mjs.map +1 -0
- package/dist/node/{editor-BwOQIwVw.mjs → editor-NUaiiO4B.mjs} +331 -39
- package/dist/node/editor-NUaiiO4B.mjs.map +1 -0
- package/dist/node/editors/connection-editor/module.mjs +1 -1
- package/dist/node/editors/workflow-editor/module.mjs +1 -1
- package/dist/node/editors/workflow-studio/module.mjs +1 -1
- package/dist/node/graphql-BGVLRhC1.mjs +14554 -0
- package/dist/node/graphql-BGVLRhC1.mjs.map +1 -0
- package/dist/node/index.mjs +9 -6
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/{module-BMwJQh65.mjs → module-BlT-atBQ.mjs} +129 -17
- package/dist/node/module-BlT-atBQ.mjs.map +1 -0
- package/dist/node/{module-Dhe5E-VA.mjs → module-BsqRZox1.mjs} +13 -5
- package/dist/node/module-BsqRZox1.mjs.map +1 -0
- package/dist/node/pieces/reactor/descriptor.json +34 -17
- package/dist/node/pieces/reactor/index.mjs +67 -67
- package/dist/node/pieces/reactor/package.json +1 -1
- package/dist/node/{runtime-queries-D5EGaCrH.mjs → runtime-queries-BM6I7dDA.mjs} +85 -11
- package/dist/node/runtime-queries-BM6I7dDA.mjs.map +1 -0
- package/dist/node/{trigger-text-CXnnanWC.mjs → trigger-text-78ZhfT-b.mjs} +142 -20
- package/dist/node/trigger-text-78ZhfT-b.mjs.map +1 -0
- package/dist/node/upgrade-manifests-CYZfts3a.mjs +8 -0
- package/dist/node/{upgrade-manifests-CmNd742Y.mjs.map → upgrade-manifests-CYZfts3a.mjs.map} +1 -1
- package/dist/node/{workflow-CGzYGZnr.mjs → workflow-BpfdBHyS.mjs} +2 -2
- package/dist/node/{workflow-CGzYGZnr.mjs.map → workflow-BpfdBHyS.mjs.map} +1 -1
- package/dist/powerhouse.manifest.json +1 -1
- package/dist/style.css +44 -0
- package/dist/types/ai/workflow-tools.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/config/error.d.ts +15 -1
- package/dist/types/document-models/connection/v1/gen/config/error.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/connection/error.d.ts +13 -1
- package/dist/types/document-models/connection/v1/gen/connection/error.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/document-model.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/reducer.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/schema/types.d.ts +11 -2
- package/dist/types/document-models/connection/v1/gen/schema/types.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/schema/zod.d.ts +3 -1
- package/dist/types/document-models/connection/v1/gen/schema/zod.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/src/reactor-connection.d.ts +17 -0
- package/dist/types/document-models/connection/v1/src/reactor-connection.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/src/reducers/config.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/src/reducers/connection.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/src/utils.d.ts +1 -1
- package/dist/types/document-models/connection/v1/src/utils.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/tests/reactor-connection.test.d.ts +2 -0
- package/dist/types/document-models/connection/v1/tests/reactor-connection.test.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts +7 -0
- package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/src/reducers/steps.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/src/reducers/trigger.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/tests/reactor-connection.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/reactor-connection.test.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/ConnectionToolbar.d.ts +1 -1
- package/dist/types/editors/connection-editor/ConnectionToolbar.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/ReactorBindings.d.ts +6 -0
- package/dist/types/editors/connection-editor/ReactorBindings.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/ReactorConnectionSettings.d.ts +7 -0
- package/dist/types/editors/connection-editor/ReactorConnectionSettings.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/connection-callbacks.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/connection-form.d.ts +4 -1
- package/dist/types/editors/connection-editor/connection-form.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/connection-usage.d.ts +13 -3
- package/dist/types/editors/connection-editor/connection-usage.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/editor.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/status.d.ts.map +1 -1
- package/dist/types/editors/shared/data-viewer.d.ts.map +1 -1
- package/dist/types/editors/shared/document-ref.d.ts +5 -0
- package/dist/types/editors/shared/document-ref.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/document/useWorkflowModel.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/editor.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/reactor-hooks.d.ts +25 -0
- package/dist/types/editors/workflow-editor/reactor-hooks.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/runtime-client.d.ts +16 -1
- package/dist/types/editors/workflow-editor/runtime-client.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/runtime-contract.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/runtime-contract.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/runtime-persist.d.ts +1 -1
- package/dist/types/editors/workflow-editor/ui/CreateConnectionModal.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts +3 -0
- package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts +13 -0
- package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/ReactorConnectionField.d.ts +9 -0
- package/dist/types/editors/workflow-editor/ui/ReactorConnectionField.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/SignInPrompt.d.ts +6 -0
- package/dist/types/editors/workflow-editor/ui/SignInPrompt.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/StepError.d.ts +4 -0
- package/dist/types/editors/workflow-editor/ui/StepError.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts +1 -0
- package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/SwitchboardGrants.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/SwitchboardGrants.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/design-time.d.ts +1 -0
- package/dist/types/editors/workflow-editor/ui/design-time.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/document-options.d.ts +24 -0
- package/dist/types/editors/workflow-editor/ui/document-options.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/document-options.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/document-options.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/document-shape.d.ts +8 -0
- package/dist/types/editors/workflow-editor/ui/document-shape.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/document-shape.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/document-shape.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/expression-scope.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/expression-scope.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/forms.d.ts +5 -1
- package/dist/types/editors/workflow-editor/ui/forms.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/model.d.ts +14 -0
- package/dist/types/editors/workflow-editor/ui/model.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/query-keys.d.ts +6 -3
- package/dist/types/editors/workflow-editor/ui/query-keys.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/reactor-access.d.ts +43 -0
- package/dist/types/editors/workflow-editor/ui/reactor-access.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-access.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/reactor-access.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-connection-create.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/reactor-connection-create.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-connection-create.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/reactor-connection-create.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-view.d.ts +25 -0
- package/dist/types/editors/workflow-editor/ui/reactor-view.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-view.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/reactor-view.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/use-validity.d.ts +1 -0
- package/dist/types/editors/workflow-editor/ui/use-validity.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/validation.d.ts +3 -1
- package/dist/types/editors/workflow-editor/ui/validation.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/RunsTable.d.ts.map +1 -1
- package/dist/types/pieces/reactor/index.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/actions/document-create.d.ts +4 -3
- package/dist/types/pieces/reactor/lib/actions/document-create.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/actions/document-dispatch.d.ts +2 -2
- package/dist/types/pieces/reactor/lib/actions/document-dispatch.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/actions/document-find.d.ts +3 -2
- package/dist/types/pieces/reactor/lib/actions/document-find.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/actions/document-get.d.ts +2 -2
- package/dist/types/pieces/reactor/lib/actions/document-get.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/actions/document-schema.d.ts +2 -2
- package/dist/types/pieces/reactor/lib/actions/document-schema.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/actions/document-types.d.ts +1 -1
- package/dist/types/pieces/reactor/lib/actions/document-types.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/documents.d.ts +32 -0
- package/dist/types/pieces/reactor/lib/documents.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/parse.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/reactor.d.ts +15 -4
- package/dist/types/pieces/reactor/lib/reactor.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/triggers/document-event.d.ts +6 -6
- package/dist/types/pieces/reactor/lib/triggers/document-event.d.ts.map +1 -1
- package/dist/types/pieces/reactor/reactor.test.d.ts +2 -0
- package/dist/types/pieces/reactor/reactor.test.d.ts.map +1 -0
- package/dist/types/pieces/reactor/test-signer.d.ts +3 -0
- package/dist/types/pieces/reactor/test-signer.d.ts.map +1 -0
- package/dist/types/scripts/ui-stack.d.ts +4 -1
- package/dist/types/scripts/ui-stack.d.ts.map +1 -1
- package/dist/types/test/drive-window.d.ts +6 -0
- package/dist/types/test/drive-window.d.ts.map +1 -0
- package/dist/types/test/runtime-schema.d.ts +17 -0
- package/dist/types/test/runtime-schema.d.ts.map +1 -0
- package/dist/types/test/ui/reactor-connection.spec.d.ts +2 -0
- package/dist/types/test/ui/reactor-connection.spec.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/browser/BlockSelector-C-C56Wcf.js.map +0 -1
- package/dist/browser/connection-form-C9iDnI6H.js.map +0 -1
- package/dist/browser/editor-4BJf6hN7.js.map +0 -1
- package/dist/browser/editor-Crt3ZeGd.js.map +0 -1
- package/dist/browser/editor-cEmJfc9W.js.map +0 -1
- package/dist/browser/module-DU2vb3FH.js.map +0 -1
- package/dist/browser/module-jDZ4pq3W.js.map +0 -1
- package/dist/browser/runtime-queries-Ds2kk-Ow.js.map +0 -1
- package/dist/browser/trigger-text-5CT870cu.js.map +0 -1
- package/dist/browser/upgrade-manifests-BpakVE9l.js +0 -8
- package/dist/node/BlockSelector-C9_1wbx4.mjs.map +0 -1
- package/dist/node/connection-form-DUOXUqBz.mjs.map +0 -1
- package/dist/node/editor-BFDE4Q3v.mjs.map +0 -1
- package/dist/node/editor-BwOQIwVw.mjs.map +0 -1
- package/dist/node/editor-D2jRtRNl.mjs.map +0 -1
- package/dist/node/module-BMwJQh65.mjs.map +0 -1
- package/dist/node/module-Dhe5E-VA.mjs.map +0 -1
- package/dist/node/runtime-queries-D5EGaCrH.mjs.map +0 -1
- package/dist/node/trigger-text-CXnnanWC.mjs.map +0 -1
- package/dist/node/upgrade-manifests-CmNd742Y.mjs +0 -8
- package/dist/types/pieces/reactor/lib/actions/dispatch-outcome.test.d.ts +0 -2
- package/dist/types/pieces/reactor/lib/actions/dispatch-outcome.test.d.ts.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DC62tzP2.js";
|
|
2
2
|
import { c as planFromAuth, o as packageFromConnectorId, r as connectorIdForPiece } from "./piece-auth-BS5CtQOG.js";
|
|
3
|
-
import {
|
|
4
|
-
import { y as actions } from "./module-
|
|
5
|
-
import { $ as
|
|
6
|
-
import { y as actions$1 } from "./module-
|
|
7
|
-
import { t as useConnectionDocumentById } from "./connection-
|
|
8
|
-
import { t as useSelectedWorkflowDocument } from "./workflow-
|
|
9
|
-
import { a as
|
|
10
|
-
import { a as
|
|
3
|
+
import { $ as isCoreBlock, X as STEP_PRESETS, Z as TRIGGER_PRESETS, at as triggerFields, dt as expandDocumentRefs, f as stepOutputTreeQuery, ft as flowPorts, gt as scheduleConfigIssue, h as blockRefKey, ht as parseScheduleConfig, i as outputTreeQuery, it as triggerBlock, mt as knownPorts, n as catalogQuery, nt as stepBlock, rt as stepFields, tt as sameBlock, u as runsQuery, ut as documentRefsIn, v as TEST_TRIGGER_KIND, y as realRuns } from "./runtime-queries-IZG_nonR.js";
|
|
4
|
+
import { y as actions } from "./module-D4UiG9ii.js";
|
|
5
|
+
import { $ as blockMissing, B as useCachedBlockForm, C as formatDuration, Ct as Hint, Dt as Switch, E as formatWhen, Et as Select, F as useBlockForm, Ft as isIconName, G as useDynamicPrefetch, H as useDesignTime, I as useBlockFormLoader, It as DocumentErrorBoundary, J as useResolvedProp, K as useLatestRun, L as useBlockForms, M as toneOf, Mt as textAreaClass, Nt as textInputClass, Ot as Tabs, P as DesignTimeProvider, Pt as Icon, Q as useWebhookEndpoint, R as useBlockPorts, S as formatAbsolute, St as FieldLabel, Tt as Segmented, U as useDynamicCache, V as useConnectionList, W as useDynamicLookup, X as useTestStepRunner, Y as useRunById, Z as useTestTrigger, _ as RUN_TONE, _t as useRuntime, a as resolutionText, at as storedSchema, b as TONE_TEXT, bt as Button, c as useResolution, ct as withSetting, d as pieceDisplayName, et as isEmptyValue, f as pieceLogo, gt as useRunsQuery, i as VersionSummary, it as settingFor, jt as invalidClass, l as versionBadge, lt as workflowReadiness, m as usePieceLogos, n as BlockSelector, nt as parsePropList, o as runsDifferentVersion, ot as stripOptions, p as useBlockMeta, q as useOptionSearch, r as BlockResolutionsProvider, rt as resolverInputFor, s as updateVersion, st as undeclaredPortIssues, t as BlockLogo, tt as isPropVisible, u as blockMeta, ut as WorkflowRuntimeProvider, vt as useRuntimeActions, wt as IconButton, xt as FieldError, y as TONE_DOT, z as useBlockResolutions } from "./BlockSelector-B41mSc0W.js";
|
|
6
|
+
import { A as REACTOR_CONNECTOR_ID, y as actions$1 } from "./module-B2BMwu5E.js";
|
|
7
|
+
import { t as useConnectionDocumentById } from "./connection-BP17lpt3.js";
|
|
8
|
+
import { t as useSelectedWorkflowDocument } from "./workflow-DFLQ2cFr.js";
|
|
9
|
+
import { a as useSignInGate, f as connectionCallbacks, g as newUndoGroup, h as groupedAction, i as useReactorAccessDenial, l as reactorConnections, m as UndoRedo, n as SignInPrompt, o as missingInPublished, p as BackButton, r as usePublisher, s as runsAsText, t as ConnectionForm } from "./connection-form-CkRzKggD.js";
|
|
10
|
+
import { a as StepError, c as PublishButton, d as ReactorDenialNote, f as StatusToggle, g as uniqueStepKey, h as hasDraftChanges, i as DataViewer, l as PublishState, m as VARIABLES_VIEW, n as describeSchedule, o as Modal, p as usePublish, r as describeTrigger, s as DraftBanner, t as describeCron, u as PublishedMissingNote } from "./trigger-text-C37YRggR.js";
|
|
11
11
|
import * as m from "react";
|
|
12
12
|
import React, { Fragment, Suspense, createContext, forwardRef, lazy, memo, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
13
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { generateId } from "document-model";
|
|
15
|
-
import { addDocument, useFileNodesInSelectedDrive, useSelectedDocumentId, useSelectedDriveId } from "@powerhousedao/reactor-browser";
|
|
15
|
+
import { addDocument, dispatchActions, useDocumentModelModules, useFileNodesInSelectedDrive, useSelectedDocumentId, useSelectedDriveId } from "@powerhousedao/reactor-browser";
|
|
16
16
|
import { createPortal } from "react-dom";
|
|
17
17
|
//#region editors/workflow-editor/undo-policy.ts
|
|
18
18
|
function placesBlock(edit, id) {
|
|
@@ -98,7 +98,24 @@ function toModel(state) {
|
|
|
98
98
|
version: state.version,
|
|
99
99
|
published: state.published ? {
|
|
100
100
|
version: state.published.version,
|
|
101
|
-
publishedAt: state.published.publishedAt
|
|
101
|
+
publishedAt: state.published.publishedAt,
|
|
102
|
+
blocks: [...state.published.trigger ? [{
|
|
103
|
+
id: state.published.trigger.id,
|
|
104
|
+
label: "Trigger",
|
|
105
|
+
pieceName: state.published.trigger.pieceName,
|
|
106
|
+
pieceVersion: state.published.trigger.pieceVersion,
|
|
107
|
+
kind: "trigger",
|
|
108
|
+
name: state.published.trigger.triggerName,
|
|
109
|
+
reactorConnectionId: state.published.trigger.reactorConnectionId ?? null
|
|
110
|
+
}] : [], ...state.published.steps.map((step) => ({
|
|
111
|
+
id: step.id,
|
|
112
|
+
label: step.name || step.key,
|
|
113
|
+
pieceName: step.pieceName,
|
|
114
|
+
pieceVersion: step.pieceVersion,
|
|
115
|
+
kind: "action",
|
|
116
|
+
name: step.actionName,
|
|
117
|
+
reactorConnectionId: step.reactorConnectionId ?? null
|
|
118
|
+
}))]
|
|
102
119
|
} : null,
|
|
103
120
|
readOnly: false,
|
|
104
121
|
trigger: state.trigger ? {
|
|
@@ -108,6 +125,7 @@ function toModel(state) {
|
|
|
108
125
|
triggerName: state.trigger.triggerName,
|
|
109
126
|
config: state.trigger.config,
|
|
110
127
|
connectionId: state.trigger.connectionId ?? null,
|
|
128
|
+
reactorConnectionId: state.trigger.reactorConnectionId ?? null,
|
|
111
129
|
...blockState(state.trigger)
|
|
112
130
|
} : null,
|
|
113
131
|
steps: state.steps.map((step) => ({
|
|
@@ -118,6 +136,7 @@ function toModel(state) {
|
|
|
118
136
|
pieceVersion: step.pieceVersion,
|
|
119
137
|
actionName: step.actionName,
|
|
120
138
|
connectionId: step.connectionId ?? null,
|
|
139
|
+
reactorConnectionId: step.reactorConnectionId ?? null,
|
|
121
140
|
config: step.config,
|
|
122
141
|
retry: step.retry ? {
|
|
123
142
|
maxAttempts: step.retry.maxAttempts,
|
|
@@ -174,6 +193,7 @@ function useWorkflowModel() {
|
|
|
174
193
|
triggerName: input.triggerName,
|
|
175
194
|
config: input.config,
|
|
176
195
|
connectionId: input.connectionId,
|
|
196
|
+
reactorConnectionId: input.reactorConnectionId,
|
|
177
197
|
...input.propertySettings ? { propertySettings: settingsInput(input.propertySettings) } : {}
|
|
178
198
|
}), group));
|
|
179
199
|
return {
|
|
@@ -292,6 +312,7 @@ function useWorkflowModel() {
|
|
|
292
312
|
pieceVersion: step.pieceVersion,
|
|
293
313
|
actionName: step.actionName,
|
|
294
314
|
connectionId: step.connectionId,
|
|
315
|
+
reactorConnectionId: step.reactorConnectionId,
|
|
295
316
|
config: step.config,
|
|
296
317
|
retry: step.retry,
|
|
297
318
|
timeoutSeconds: step.timeoutSeconds,
|
|
@@ -341,7 +362,8 @@ function useWorkflowModel() {
|
|
|
341
362
|
pieceVersion: trigger.pieceVersion,
|
|
342
363
|
triggerName: trigger.triggerName,
|
|
343
364
|
config: plan.config,
|
|
344
|
-
connectionId: trigger.connectionId
|
|
365
|
+
connectionId: trigger.connectionId,
|
|
366
|
+
reactorConnectionId: trigger.reactorConnectionId
|
|
345
367
|
})] : plan.config ? [actions.setStepConfig({
|
|
346
368
|
id: added.id,
|
|
347
369
|
config: plan.config
|
|
@@ -371,6 +393,70 @@ function findBlock(state, added) {
|
|
|
371
393
|
} : void 0;
|
|
372
394
|
}
|
|
373
395
|
//#endregion
|
|
396
|
+
//#region editors/workflow-editor/ui/document-shape.ts
|
|
397
|
+
const MAX_DEPTH$1 = 6;
|
|
398
|
+
const normalize = (name) => name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
399
|
+
function typeName(node, kind) {
|
|
400
|
+
if (node.kind === kind.NON_NULL_TYPE) {
|
|
401
|
+
const inner = typeName(node.type, kind);
|
|
402
|
+
return {
|
|
403
|
+
name: inner.name,
|
|
404
|
+
display: `${inner.display}!`
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
if (node.kind === kind.LIST_TYPE) {
|
|
408
|
+
const inner = typeName(node.type, kind);
|
|
409
|
+
return {
|
|
410
|
+
name: inner.name,
|
|
411
|
+
display: `[${inner.display}]`
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
return {
|
|
415
|
+
name: node.name.value,
|
|
416
|
+
display: node.name.value
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
async function stateFieldsFromSdl(model) {
|
|
420
|
+
if (!model.schema) return {};
|
|
421
|
+
const { Kind, parse } = await import("./graphql-Cr1ia6fo.js");
|
|
422
|
+
let definitions;
|
|
423
|
+
try {
|
|
424
|
+
definitions = parse(model.schema).definitions;
|
|
425
|
+
} catch {
|
|
426
|
+
return {};
|
|
427
|
+
}
|
|
428
|
+
const types = /* @__PURE__ */ new Map();
|
|
429
|
+
for (const def of definitions) {
|
|
430
|
+
if (def.kind !== Kind.OBJECT_TYPE_DEFINITION && def.kind !== Kind.INPUT_OBJECT_TYPE_DEFINITION) continue;
|
|
431
|
+
types.set(normalize(def.name.value), (def.fields ?? []).map((field) => ({
|
|
432
|
+
name: field.name.value,
|
|
433
|
+
type: field.type
|
|
434
|
+
})));
|
|
435
|
+
}
|
|
436
|
+
const root = [`${normalize(model.name)}state`, `${normalize(model.name)}globalstate`].map((candidate) => types.get(candidate)).find((fields) => fields !== void 0);
|
|
437
|
+
const build = (fields, depth) => Object.fromEntries(fields.map((field) => {
|
|
438
|
+
const { name, display } = typeName(field.type, Kind);
|
|
439
|
+
const inner = types.get(normalize(name));
|
|
440
|
+
return [field.name, inner && inner.length > 0 && depth < MAX_DEPTH$1 ? build(inner, depth + 1) : display];
|
|
441
|
+
}));
|
|
442
|
+
return root ? build(root, 0) : {};
|
|
443
|
+
}
|
|
444
|
+
function documentShape(reference, globalState) {
|
|
445
|
+
return {
|
|
446
|
+
header: {
|
|
447
|
+
id: reference.documentId,
|
|
448
|
+
documentType: reference.documentType,
|
|
449
|
+
name: "String",
|
|
450
|
+
slug: "String",
|
|
451
|
+
branch: reference.branch,
|
|
452
|
+
revision: reference.revision,
|
|
453
|
+
createdAtUtcIso: "DateTime!",
|
|
454
|
+
lastModifiedAtUtcIso: "DateTime!"
|
|
455
|
+
},
|
|
456
|
+
state: { global: globalState }
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
//#endregion
|
|
374
460
|
//#region editors/workflow-editor/ui/variable-types.ts
|
|
375
461
|
const VARIABLE_TYPE_LABEL = {
|
|
376
462
|
TEXT: "Text",
|
|
@@ -495,8 +581,22 @@ function formatRunTime(startedAt, now = /* @__PURE__ */ new Date()) {
|
|
|
495
581
|
})} ${time}`;
|
|
496
582
|
}
|
|
497
583
|
const hasOutput = (step) => (step.status === "SUCCEEDED" || step.status === "REPLAYED") && step.output !== void 0 && step.output !== null;
|
|
584
|
+
async function withDocuments(value, documentOutput) {
|
|
585
|
+
const references = documentRefsIn(value);
|
|
586
|
+
if (references.length === 0) return value;
|
|
587
|
+
const key = (reference) => `${reference.branch}:${reference.documentId}`;
|
|
588
|
+
const shapeOf = async (reference) => {
|
|
589
|
+
try {
|
|
590
|
+
if (documentOutput) return await documentOutput(reference);
|
|
591
|
+
} catch {}
|
|
592
|
+
return documentShape(reference, {});
|
|
593
|
+
};
|
|
594
|
+
const shapes = new Map(await Promise.all(references.map(async (reference) => [key(reference), await shapeOf(reference)])));
|
|
595
|
+
return expandDocumentRefs(value, (reference) => shapes.get(key(reference)));
|
|
596
|
+
}
|
|
498
597
|
async function buildExpressionScope(options) {
|
|
499
598
|
const { model, latestRun } = options;
|
|
599
|
+
const documents = (value) => withDocuments(value, options.documentOutput);
|
|
500
600
|
const runCaption = latestRun ? `from run ${formatRunTime(latestRun.startedAt, options.now)}` : void 0;
|
|
501
601
|
const runSteps = new Map((latestRun?.steps ?? []).filter(hasOutput).map((step) => [step.stepKey, step]));
|
|
502
602
|
const value = {};
|
|
@@ -506,10 +606,10 @@ async function buildExpressionScope(options) {
|
|
|
506
606
|
if (model.trigger) {
|
|
507
607
|
const sample = await tested(model.trigger);
|
|
508
608
|
if (sample) {
|
|
509
|
-
value.trigger = { payload: capValue(sample.value) };
|
|
609
|
+
value.trigger = { payload: capValue(await documents(sample.value)) };
|
|
510
610
|
captions["trigger.payload"] = testCaption(sample);
|
|
511
611
|
} else if (runCaption && latestRun?.triggerPayload !== void 0 && latestRun.triggerPayload !== null) {
|
|
512
|
-
value.trigger = { payload: capValue(latestRun.triggerPayload) };
|
|
612
|
+
value.trigger = { payload: capValue(await documents(latestRun.triggerPayload)) };
|
|
513
613
|
captions["trigger.payload"] = runCaption;
|
|
514
614
|
} else {
|
|
515
615
|
value.trigger = { payload: await options.authoredOutput(triggerBlock(model.trigger), model.trigger.config) };
|
|
@@ -521,13 +621,13 @@ async function buildExpressionScope(options) {
|
|
|
521
621
|
await Promise.all(model.steps.filter((step) => upstream.has(step.id)).map(async (step) => {
|
|
522
622
|
const sample = await tested(step);
|
|
523
623
|
if (sample) {
|
|
524
|
-
steps[step.key] = { output: capValue(sample.value) };
|
|
624
|
+
steps[step.key] = { output: capValue(await documents(sample.value)) };
|
|
525
625
|
captions[`steps.${step.key}.output`] = testCaption(sample);
|
|
526
626
|
return;
|
|
527
627
|
}
|
|
528
628
|
const journaled = runSteps.get(step.key);
|
|
529
629
|
if (runCaption && journaled && journaled.pieceName === step.pieceName && journaled.blockName === step.actionName) {
|
|
530
|
-
steps[step.key] = { output: capValue(journaled.output) };
|
|
630
|
+
steps[step.key] = { output: capValue(await documents(journaled.output)) };
|
|
531
631
|
captions[`steps.${step.key}.output`] = runCaption;
|
|
532
632
|
return;
|
|
533
633
|
}
|
|
@@ -1405,7 +1505,8 @@ function CreateConnectionModal(props) {
|
|
|
1405
1505
|
}), state && callbacks ? /* @__PURE__ */ jsx(ConnectionForm, {
|
|
1406
1506
|
state,
|
|
1407
1507
|
callbacks,
|
|
1408
|
-
connectionId: props.connectionId
|
|
1508
|
+
connectionId: props.connectionId,
|
|
1509
|
+
offerReactor: false
|
|
1409
1510
|
}) : /* @__PURE__ */ jsx("p", {
|
|
1410
1511
|
className: "text-xs text-muted-foreground/80",
|
|
1411
1512
|
children: "Loading the new connection document…"
|
|
@@ -1483,8 +1584,8 @@ function CreateRow(props) {
|
|
|
1483
1584
|
})]
|
|
1484
1585
|
});
|
|
1485
1586
|
}
|
|
1486
|
-
const LINK_ATTEMPTS = 30;
|
|
1487
|
-
const LINK_INTERVAL_MS = 500;
|
|
1587
|
+
const LINK_ATTEMPTS$1 = 30;
|
|
1588
|
+
const LINK_INTERVAL_MS$1 = 500;
|
|
1488
1589
|
function ConnectionField(props) {
|
|
1489
1590
|
const { form } = useBlockForm(props.block);
|
|
1490
1591
|
const { connections, refetch, invalidate, fetchNow } = useConnectionList();
|
|
@@ -1549,8 +1650,8 @@ function ConnectionField(props) {
|
|
|
1549
1650
|
pick(connectionId);
|
|
1550
1651
|
};
|
|
1551
1652
|
fetchNow().then((result) => {
|
|
1552
|
-
if (result.some((connection) => connection.id === connectionId && packageFromConnectorId(connection.connectorId) === props.block.pieceName) || attempt >= LINK_ATTEMPTS) done();
|
|
1553
|
-
else setTimeout(() => poll(attempt + 1), LINK_INTERVAL_MS);
|
|
1653
|
+
if (result.some((connection) => connection.id === connectionId && packageFromConnectorId(connection.connectorId) === props.block.pieceName) || attempt >= LINK_ATTEMPTS$1) done();
|
|
1654
|
+
else setTimeout(() => poll(attempt + 1), LINK_INTERVAL_MS$1);
|
|
1554
1655
|
}, () => done());
|
|
1555
1656
|
};
|
|
1556
1657
|
poll(0);
|
|
@@ -1669,6 +1770,139 @@ function ConnectionField(props) {
|
|
|
1669
1770
|
});
|
|
1670
1771
|
}
|
|
1671
1772
|
//#endregion
|
|
1773
|
+
//#region editors/workflow-editor/ui/reactor-connection-create.ts
|
|
1774
|
+
function newReactorConnectionActions(name, requireReactor) {
|
|
1775
|
+
return [
|
|
1776
|
+
actions$1.setConnectionName({ name }),
|
|
1777
|
+
actions$1.setName(name),
|
|
1778
|
+
actions$1.setConnector({
|
|
1779
|
+
connectorId: REACTOR_CONNECTOR_ID,
|
|
1780
|
+
authType: "REACTOR"
|
|
1781
|
+
}),
|
|
1782
|
+
actions$1.setConfig({ config: requireReactor === "read" ? {
|
|
1783
|
+
endpoint: "local",
|
|
1784
|
+
access: "read"
|
|
1785
|
+
} : { endpoint: "local" } }),
|
|
1786
|
+
actions$1.recordCheckResult({
|
|
1787
|
+
status: "OK",
|
|
1788
|
+
checkedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1789
|
+
})
|
|
1790
|
+
];
|
|
1791
|
+
}
|
|
1792
|
+
//#endregion
|
|
1793
|
+
//#region editors/workflow-editor/ui/ReactorConnectionField.tsx
|
|
1794
|
+
const LINK_ATTEMPTS = 30;
|
|
1795
|
+
const LINK_INTERVAL_MS = 500;
|
|
1796
|
+
const DECLARED = {
|
|
1797
|
+
read: "Reads documents only",
|
|
1798
|
+
write: "Reads and writes documents"
|
|
1799
|
+
};
|
|
1800
|
+
function ReactorConnectionField(props) {
|
|
1801
|
+
const { form } = useBlockForm(props.block);
|
|
1802
|
+
const { connections, refetch, invalidate } = useConnectionList();
|
|
1803
|
+
const driveId = useSelectedDriveId();
|
|
1804
|
+
const gate = useSignInGate();
|
|
1805
|
+
const { publisher, loading } = usePublisher(props.workflowId, props.publishedVersion);
|
|
1806
|
+
const runsAs = runsAsText(publisher, loading, gate.access?.reactorIdentity?.address);
|
|
1807
|
+
const [creating, setCreating] = useState(false);
|
|
1808
|
+
const refetchRef = useRef(refetch);
|
|
1809
|
+
useEffect(() => {
|
|
1810
|
+
refetchRef.current = refetch;
|
|
1811
|
+
});
|
|
1812
|
+
const [error, setError] = useState(null);
|
|
1813
|
+
const linking = props.value || null;
|
|
1814
|
+
const listed = connections.some((connection) => connection.id === linking);
|
|
1815
|
+
useEffect(() => {
|
|
1816
|
+
if (!linking || listed) return;
|
|
1817
|
+
let attempts = 0;
|
|
1818
|
+
const timer = setInterval(() => {
|
|
1819
|
+
if (++attempts > LINK_ATTEMPTS) clearInterval(timer);
|
|
1820
|
+
else refetchRef.current();
|
|
1821
|
+
}, LINK_INTERVAL_MS);
|
|
1822
|
+
return () => clearInterval(timer);
|
|
1823
|
+
}, [linking, listed]);
|
|
1824
|
+
const declared = form && form !== "loading" ? form.requireReactor : void 0;
|
|
1825
|
+
if (!declared && !props.value) return null;
|
|
1826
|
+
const options = reactorConnections(connections).map((connection) => ({
|
|
1827
|
+
value: connection.id,
|
|
1828
|
+
label: connection.name || connection.id,
|
|
1829
|
+
description: connection.status === "REVOKED" ? "Revoked" : void 0
|
|
1830
|
+
}));
|
|
1831
|
+
const create = () => {
|
|
1832
|
+
if (!driveId || creating) return;
|
|
1833
|
+
setCreating(true);
|
|
1834
|
+
setError(null);
|
|
1835
|
+
const name = "Reactor access";
|
|
1836
|
+
addDocument(driveId, name, CONNECTION_TYPE).then(async (node) => {
|
|
1837
|
+
let failure;
|
|
1838
|
+
await dispatchActions(newReactorConnectionActions(name, declared ?? "write"), node.id, (errors) => {
|
|
1839
|
+
failure = errors[0]?.message;
|
|
1840
|
+
});
|
|
1841
|
+
if (failure) throw new Error(failure);
|
|
1842
|
+
invalidate();
|
|
1843
|
+
setCreating(false);
|
|
1844
|
+
props.onChange(node.id);
|
|
1845
|
+
}).catch((cause) => {
|
|
1846
|
+
setCreating(false);
|
|
1847
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
1848
|
+
});
|
|
1849
|
+
};
|
|
1850
|
+
const known = options.some((option) => option.value === props.value);
|
|
1851
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1852
|
+
className: "flex flex-col gap-3",
|
|
1853
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [
|
|
1854
|
+
/* @__PURE__ */ jsx(FieldLabel, {
|
|
1855
|
+
label: "Reactor connection",
|
|
1856
|
+
needsValue: Boolean(declared) && !props.value,
|
|
1857
|
+
action: props.value ? /* @__PURE__ */ jsx("button", {
|
|
1858
|
+
type: "button",
|
|
1859
|
+
className: "rounded px-1 text-xs text-muted-foreground hover:text-foreground",
|
|
1860
|
+
onClick: () => props.onChange(null),
|
|
1861
|
+
children: "Clear"
|
|
1862
|
+
}) : void 0
|
|
1863
|
+
}),
|
|
1864
|
+
/* @__PURE__ */ jsx("div", {
|
|
1865
|
+
onPointerDown: refetch,
|
|
1866
|
+
children: /* @__PURE__ */ jsx(Select, {
|
|
1867
|
+
ariaLabel: "Reactor connection",
|
|
1868
|
+
value: props.value,
|
|
1869
|
+
options,
|
|
1870
|
+
invalid: Boolean(declared) && !props.value,
|
|
1871
|
+
placeholder: creating ? "Creating connection…" : "Choose a reactor connection",
|
|
1872
|
+
emptyText: "No reactor connection in this drive yet.",
|
|
1873
|
+
disabled: creating,
|
|
1874
|
+
onChange: (id) => props.onChange(id || null),
|
|
1875
|
+
actions: driveId && declared ? [{
|
|
1876
|
+
label: "New reactor connection",
|
|
1877
|
+
icon: "plus",
|
|
1878
|
+
onSelect: create
|
|
1879
|
+
}] : void 0
|
|
1880
|
+
})
|
|
1881
|
+
}),
|
|
1882
|
+
declared ? /* @__PURE__ */ jsxs(Hint, { children: [
|
|
1883
|
+
DECLARED[declared],
|
|
1884
|
+
", within what the connection allows.",
|
|
1885
|
+
runsAs ? /* @__PURE__ */ jsx("span", {
|
|
1886
|
+
className: "block",
|
|
1887
|
+
"aria-label": "Runs as",
|
|
1888
|
+
children: runsAs
|
|
1889
|
+
}) : null
|
|
1890
|
+
] }) : /* @__PURE__ */ jsx(Hint, { children: "This block takes no reactor connection." }),
|
|
1891
|
+
props.value && connections.length > 0 && !known ? /* @__PURE__ */ jsx("p", {
|
|
1892
|
+
className: "mt-1.5 text-xs text-wf-warn",
|
|
1893
|
+
children: "Not a reactor connection in this drive."
|
|
1894
|
+
}) : null,
|
|
1895
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
1896
|
+
className: "mt-1.5 text-xs font-medium text-wf-fail",
|
|
1897
|
+
children: error
|
|
1898
|
+
}) : null
|
|
1899
|
+
] }), !props.value ? /* @__PURE__ */ jsx(SignInPrompt, {
|
|
1900
|
+
gate,
|
|
1901
|
+
reason: "Sign in so the workflow runs as you when it reaches documents."
|
|
1902
|
+
}) : null]
|
|
1903
|
+
});
|
|
1904
|
+
}
|
|
1905
|
+
//#endregion
|
|
1672
1906
|
//#region editors/workflow-editor/ui/secret-ref.ts
|
|
1673
1907
|
const SECRET_REF_PREFIX = "secret://v1:";
|
|
1674
1908
|
function useSecretRef(options) {
|
|
@@ -2602,7 +2836,7 @@ function PropField(props) {
|
|
|
2602
2836
|
active: field.active,
|
|
2603
2837
|
onFocusField: field.focus
|
|
2604
2838
|
}) : void 0;
|
|
2605
|
-
const dynamicLoad = props.loadOptions && prop.hasDynamicResolver ? () => props.loadOptions(prop.name) : void 0;
|
|
2839
|
+
const dynamicLoad = props.loadOptions && prop.hasDynamicResolver && !props.optionsBlocked ? () => props.loadOptions(prop.name) : void 0;
|
|
2606
2840
|
const isDropdown = prop.type === "DROPDOWN" || prop.type === "MULTI_SELECT_DROPDOWN";
|
|
2607
2841
|
const dropdown = useResolvedProp({
|
|
2608
2842
|
kind: "options",
|
|
@@ -2641,7 +2875,8 @@ function PropField(props) {
|
|
|
2641
2875
|
disabled: state.kind === "loading",
|
|
2642
2876
|
onClick: reload
|
|
2643
2877
|
});
|
|
2644
|
-
const
|
|
2878
|
+
const blocked = prop.hasDynamicResolver ? props.optionsBlocked : void 0;
|
|
2879
|
+
const loadError = (state) => blocked ?? (state.kind === "error" ? props.explainOptionsError?.(state.message) ?? state.message : null);
|
|
2645
2880
|
const textInput = (extra) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
2646
2881
|
className: "flex items-center gap-1",
|
|
2647
2882
|
children: /* @__PURE__ */ jsx("input", {
|
|
@@ -2936,7 +3171,7 @@ function PropField(props) {
|
|
|
2936
3171
|
}
|
|
2937
3172
|
}],
|
|
2938
3173
|
emptyText: result?.placeholder ?? "Nothing to choose from yet. Some lists need a connection first.",
|
|
2939
|
-
placeholder: optionsUnavailable ? "Options for nested fields are available soon" : result?.placeholder ?? prop.placeholder ?? "Choose…"
|
|
3174
|
+
placeholder: optionsUnavailable ? "Options for nested fields are available soon" : dropdown.syncing ? "Waiting for the Switchboard…" : result?.placeholder ?? prop.placeholder ?? "Choose…"
|
|
2940
3175
|
})
|
|
2941
3176
|
});
|
|
2942
3177
|
}
|
|
@@ -3213,7 +3448,7 @@ function PropertyForm(props) {
|
|
|
3213
3448
|
for (const prop of props.props) {
|
|
3214
3449
|
if (prop.type !== "DYNAMIC") continue;
|
|
3215
3450
|
if (settingFor(next, prop.name)?.mode === "EXPRESSION") continue;
|
|
3216
|
-
const fields = readDynamic(resolverInputFor(props.block ?? NO_BLOCK, prop, config, props.connectionId));
|
|
3451
|
+
const fields = readDynamic(resolverInputFor(props.block ?? NO_BLOCK, prop, config, props.connectionId, props.reactorConnectionId));
|
|
3217
3452
|
if (!fields) continue;
|
|
3218
3453
|
const schema = stripOptions(fields);
|
|
3219
3454
|
const stored = settingFor(next, prop.name)?.schema ?? null;
|
|
@@ -3262,7 +3497,9 @@ function PropertyForm(props) {
|
|
|
3262
3497
|
config: current,
|
|
3263
3498
|
secrets: props.secrets,
|
|
3264
3499
|
scopeStepId: props.scopeStepId,
|
|
3265
|
-
|
|
3500
|
+
optionsBlocked: props.optionsBlocked,
|
|
3501
|
+
explainOptionsError: props.explainOptionsError,
|
|
3502
|
+
resolverInput: resolverInputFor(props.block ?? NO_BLOCK, prop, current, props.connectionId, props.reactorConnectionId),
|
|
3266
3503
|
waitingOn: props.props.find((sibling) => prop.refreshers?.includes(sibling.name) && isEmptyValue(current[sibling.name]))?.displayName,
|
|
3267
3504
|
nested: props.nested,
|
|
3268
3505
|
webhookUrl: props.webhookUrl
|
|
@@ -3901,7 +4138,7 @@ function configOf(block) {
|
|
|
3901
4138
|
function unknownDynamic(block, form) {
|
|
3902
4139
|
if (!form || form === "loading" || block.skip) return [];
|
|
3903
4140
|
const config = configOf(block);
|
|
3904
|
-
return form.props.filter((prop) => prop.type === "DYNAMIC" && isPropVisible(prop, config) && settingFor(block.propertySettings, prop.name)?.mode !== "EXPRESSION" && !storedSchema(block.propertySettings, prop.name)).map((prop) => resolverInputFor(block.block, prop, config, block.connectionId));
|
|
4141
|
+
return form.props.filter((prop) => prop.type === "DYNAMIC" && isPropVisible(prop, config) && settingFor(block.propertySettings, prop.name)?.mode !== "EXPRESSION" && !storedSchema(block.propertySettings, prop.name)).map((prop) => resolverInputFor(block.block, prop, config, block.connectionId, block.reactorConnectionId));
|
|
3905
4142
|
}
|
|
3906
4143
|
function withIssues(missing, issues) {
|
|
3907
4144
|
if (issues.length === 0) return missing;
|
|
@@ -3919,6 +4156,7 @@ function useBlockCheck(block) {
|
|
|
3919
4156
|
block: block.block,
|
|
3920
4157
|
config: block.config,
|
|
3921
4158
|
connectionId: block.connectionId,
|
|
4159
|
+
reactorConnectionId: block.reactorConnectionId,
|
|
3922
4160
|
propertySettings: block.propertySettings,
|
|
3923
4161
|
skip: block.skip,
|
|
3924
4162
|
resolveDynamic: lookup
|
|
@@ -3965,6 +4203,7 @@ function useWorkflowCheck(model) {
|
|
|
3965
4203
|
block: block.block,
|
|
3966
4204
|
config: block.config,
|
|
3967
4205
|
connectionId: block.connectionId,
|
|
4206
|
+
reactorConnectionId: block.reactorConnectionId,
|
|
3968
4207
|
propertySettings: block.propertySettings,
|
|
3969
4208
|
skip: block.skip,
|
|
3970
4209
|
resolveDynamic: lookup
|
|
@@ -4057,7 +4296,11 @@ function FormSkeleton() {
|
|
|
4057
4296
|
function ConfigSection(props) {
|
|
4058
4297
|
const { form } = props;
|
|
4059
4298
|
const designTime = useDesignTime();
|
|
4299
|
+
const gate = useSignInGate();
|
|
4060
4300
|
const configRecord = props.config ?? {};
|
|
4301
|
+
const declared = form && form !== "loading" ? form.requireReactor : void 0;
|
|
4302
|
+
const optionsBlocked = declared && gate.required ? "Sign in to load options" : void 0;
|
|
4303
|
+
const explainOptionsError = declared && !props.reactorConnectionId ? (message) => `Bind a reactor connection first. ${message}` : void 0;
|
|
4061
4304
|
if (form === "loading") return /* @__PURE__ */ jsx(FormSkeleton, {});
|
|
4062
4305
|
return /* @__PURE__ */ jsxs("div", {
|
|
4063
4306
|
className: "flex flex-col gap-5",
|
|
@@ -4088,10 +4331,13 @@ function ConfigSection(props) {
|
|
|
4088
4331
|
writesSettings: props.writesSettings,
|
|
4089
4332
|
scopeStepId: props.scopeStepId,
|
|
4090
4333
|
connectionId: props.connectionId,
|
|
4334
|
+
reactorConnectionId: props.reactorConnectionId,
|
|
4335
|
+
optionsBlocked,
|
|
4336
|
+
explainOptionsError,
|
|
4091
4337
|
secrets: designTime?.secrets,
|
|
4092
4338
|
block: props.block,
|
|
4093
4339
|
webhookUrl: props.webhookUrl,
|
|
4094
|
-
loadOptions: designTime ? (propName, current, searchValue) => designTime.loadOptions(props.block, propName, current, props.connectionId, searchValue) : void 0
|
|
4340
|
+
loadOptions: designTime ? (propName, current, searchValue) => designTime.loadOptions(props.block, propName, current, props.connectionId, searchValue, props.reactorConnectionId) : void 0
|
|
4095
4341
|
}) : null,
|
|
4096
4342
|
form && form.props.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
4097
4343
|
className: "text-[13px] text-muted-foreground",
|
|
@@ -4750,10 +4996,7 @@ function LastRunSection(props) {
|
|
|
4750
4996
|
relativeTime(run.startedAt)
|
|
4751
4997
|
]
|
|
4752
4998
|
}),
|
|
4753
|
-
step?.error ? /* @__PURE__ */ jsx(
|
|
4754
|
-
className: "overflow-auto whitespace-pre-wrap rounded-md bg-wf-fail/10 p-2.5 text-xs text-wf-fail",
|
|
4755
|
-
children: step.error
|
|
4756
|
-
}) : null,
|
|
4999
|
+
step?.error ? /* @__PURE__ */ jsx(StepError, { error: step.error }) : null,
|
|
4757
5000
|
step ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DataViewer, {
|
|
4758
5001
|
label: "Received",
|
|
4759
5002
|
value: step.input
|
|
@@ -4786,6 +5029,7 @@ function settingsCustomised(step, model) {
|
|
|
4786
5029
|
}
|
|
4787
5030
|
function StepPanel(props) {
|
|
4788
5031
|
const { step, callbacks } = props;
|
|
5032
|
+
const designTime = useDesignTime();
|
|
4789
5033
|
const [tab, setTab] = useState("setup");
|
|
4790
5034
|
const block = stepBlock(step);
|
|
4791
5035
|
const meta = useBlockMeta(block);
|
|
@@ -4867,6 +5111,16 @@ function StepPanel(props) {
|
|
|
4867
5111
|
connectionId
|
|
4868
5112
|
})
|
|
4869
5113
|
}, `${step.id}-conn`),
|
|
5114
|
+
/* @__PURE__ */ jsx(ReactorConnectionField, {
|
|
5115
|
+
block,
|
|
5116
|
+
value: step.reactorConnectionId ?? "",
|
|
5117
|
+
workflowId: designTime?.workflowId,
|
|
5118
|
+
publishedVersion: props.model.published?.version,
|
|
5119
|
+
onChange: (reactorConnectionId) => callbacks.updateStep({
|
|
5120
|
+
id: step.id,
|
|
5121
|
+
reactorConnectionId
|
|
5122
|
+
})
|
|
5123
|
+
}, `${step.id}-reactor`),
|
|
4870
5124
|
/* @__PURE__ */ jsx(ConfigSection, {
|
|
4871
5125
|
block,
|
|
4872
5126
|
form,
|
|
@@ -4876,6 +5130,7 @@ function StepPanel(props) {
|
|
|
4876
5130
|
onChange: (config, settings) => callbacks.setStepConfig(step.id, config, writes ? { propertySettings: settings } : void 0),
|
|
4877
5131
|
writesSettings: writes,
|
|
4878
5132
|
connectionId: step.connectionId ?? void 0,
|
|
5133
|
+
reactorConnectionId: step.reactorConnectionId ?? void 0,
|
|
4879
5134
|
scopeStepId: step.id
|
|
4880
5135
|
}, `${step.id}-config`),
|
|
4881
5136
|
writes ? /* @__PURE__ */ jsx(Section, {
|
|
@@ -5048,10 +5303,12 @@ function TriggerPanel(props) {
|
|
|
5048
5303
|
const setTrigger = (patch) => {
|
|
5049
5304
|
const config = patch.config === void 0 ? trigger.config : patch.config;
|
|
5050
5305
|
const connectionId = patch.connectionId === void 0 ? trigger.connectionId : patch.connectionId;
|
|
5306
|
+
const reactorConnectionId = patch.reactorConnectionId === void 0 ? trigger.reactorConnectionId : patch.reactorConnectionId;
|
|
5051
5307
|
callbacks.setTrigger({
|
|
5052
5308
|
...triggerFields(block),
|
|
5053
5309
|
config,
|
|
5054
5310
|
connectionId,
|
|
5311
|
+
reactorConnectionId,
|
|
5055
5312
|
...writes ? { propertySettings: patch.settings } : {}
|
|
5056
5313
|
});
|
|
5057
5314
|
};
|
|
@@ -5073,6 +5330,13 @@ function TriggerPanel(props) {
|
|
|
5073
5330
|
value: trigger.connectionId ?? "",
|
|
5074
5331
|
onChange: (connectionId) => setTrigger({ connectionId })
|
|
5075
5332
|
}, `${trigger.id}-conn`) : null,
|
|
5333
|
+
isPieceTrigger ? /* @__PURE__ */ jsx(ReactorConnectionField, {
|
|
5334
|
+
block,
|
|
5335
|
+
value: trigger.reactorConnectionId ?? "",
|
|
5336
|
+
workflowId: designTime?.workflowId,
|
|
5337
|
+
publishedVersion: props.publishedVersion,
|
|
5338
|
+
onChange: (reactorConnectionId) => setTrigger({ reactorConnectionId })
|
|
5339
|
+
}, `${trigger.id}-reactor`) : null,
|
|
5076
5340
|
form !== "loading" && form?.display === "schedule" ? /* @__PURE__ */ jsx(ScheduleBuilder, {
|
|
5077
5341
|
config: trigger.config,
|
|
5078
5342
|
onChange: (config) => setTrigger({ config })
|
|
@@ -5088,6 +5352,7 @@ function TriggerPanel(props) {
|
|
|
5088
5352
|
}),
|
|
5089
5353
|
writesSettings: writes,
|
|
5090
5354
|
connectionId: trigger.connectionId ?? void 0,
|
|
5355
|
+
reactorConnectionId: trigger.reactorConnectionId ?? void 0,
|
|
5091
5356
|
webhookUrl: endpoint.kind === "ready" ? endpoint.endpoint.url : void 0
|
|
5092
5357
|
}, trigger.id),
|
|
5093
5358
|
/* @__PURE__ */ jsx(LastRunSection, {}),
|
|
@@ -5100,6 +5365,7 @@ function TriggerPanel(props) {
|
|
|
5100
5365
|
pieceVersion,
|
|
5101
5366
|
config: trigger.config,
|
|
5102
5367
|
connectionId: trigger.connectionId,
|
|
5368
|
+
reactorConnectionId: trigger.reactorConnectionId,
|
|
5103
5369
|
propertySettings: trigger.propertySettings ?? void 0
|
|
5104
5370
|
}) : void 0
|
|
5105
5371
|
}),
|
|
@@ -16935,6 +17201,8 @@ function WorkflowEditorApp(props) {
|
|
|
16935
17201
|
const selectedTrigger = model.trigger && model.trigger.id === selectedId ? model.trigger : null;
|
|
16936
17202
|
const showVariables = selectedId === VARIABLES_VIEW;
|
|
16937
17203
|
const workflowId = useDesignTime()?.workflowId ?? "";
|
|
17204
|
+
const signIn = useSignInGate();
|
|
17205
|
+
const denial = useReactorAccessDenial(workflowId || void 0, `${model.published?.version ?? 0}:${model.status}`);
|
|
16938
17206
|
const trigger = useMemo(() => model.trigger ? triggerBlock(model.trigger) : void 0, [model.trigger]);
|
|
16939
17207
|
const blocks = useMemo(() => [...model.trigger && trigger ? [{
|
|
16940
17208
|
id: model.trigger.id,
|
|
@@ -16948,6 +17216,16 @@ function WorkflowEditorApp(props) {
|
|
|
16948
17216
|
model.steps
|
|
16949
17217
|
]);
|
|
16950
17218
|
const resolutions = useBlockResolutions(workflowId, blocks);
|
|
17219
|
+
const publishedBlocks = useMemo(() => model.published?.blocks ?? [], [model.published]);
|
|
17220
|
+
const publishedForms = useBlockForms(publishedBlocks);
|
|
17221
|
+
const publishedMissing = missingInPublished(publishedBlocks.map((block) => {
|
|
17222
|
+
const form = publishedForms.get(blockRefKey(block));
|
|
17223
|
+
return {
|
|
17224
|
+
label: block.label,
|
|
17225
|
+
reactorConnectionId: block.reactorConnectionId,
|
|
17226
|
+
requireReactor: form && form !== "loading" ? form.requireReactor : null
|
|
17227
|
+
};
|
|
17228
|
+
}));
|
|
16951
17229
|
const draftBlocks = useMemo(() => blocks.map((entry) => entry.block), [blocks]);
|
|
16952
17230
|
const stepBlocks = useMemo(() => Object.fromEntries(model.steps.map((step) => [step.key, stepBlock(step)])), [model.steps]);
|
|
16953
17231
|
return /* @__PURE__ */ jsx(BlockResolutionsProvider, {
|
|
@@ -16956,7 +17234,7 @@ function WorkflowEditorApp(props) {
|
|
|
16956
17234
|
children: /* @__PURE__ */ jsxs("div", {
|
|
16957
17235
|
className: "flex min-h-0 flex-1 flex-col",
|
|
16958
17236
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
16959
|
-
className: "flex items-center gap-3 border-b border-solid border-foreground/10 bg-background px-4 py-2",
|
|
17237
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-solid border-foreground/10 bg-background px-4 py-2",
|
|
16960
17238
|
children: [
|
|
16961
17239
|
props.leading ? /* @__PURE__ */ jsxs(Fragment$1, { children: [props.leading, /* @__PURE__ */ jsx("span", {
|
|
16962
17240
|
"aria-hidden": true,
|
|
@@ -16964,7 +17242,7 @@ function WorkflowEditorApp(props) {
|
|
|
16964
17242
|
})] }) : null,
|
|
16965
17243
|
/* @__PURE__ */ jsx("input", {
|
|
16966
17244
|
"aria-label": "Workflow name",
|
|
16967
|
-
className: "min-w-
|
|
17245
|
+
className: "min-w-16 max-w-72 shrink rounded-md border border-solid border-transparent bg-transparent px-1.5 py-1 text-[15px] font-semibold text-foreground hover:border-foreground/15 focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring/25",
|
|
16968
17246
|
defaultValue: model.name,
|
|
16969
17247
|
placeholder: "Untitled workflow",
|
|
16970
17248
|
spellCheck: false,
|
|
@@ -16981,6 +17259,8 @@ function WorkflowEditorApp(props) {
|
|
|
16981
17259
|
children: ["v", model.version]
|
|
16982
17260
|
}),
|
|
16983
17261
|
/* @__PURE__ */ jsx(PublishState, { model }),
|
|
17262
|
+
/* @__PURE__ */ jsx(PublishedMissingNote, { missing: publishedMissing }),
|
|
17263
|
+
/* @__PURE__ */ jsx(ReactorDenialNote, { denial }),
|
|
16984
17264
|
/* @__PURE__ */ jsx(VersionSummary, {
|
|
16985
17265
|
resolutions,
|
|
16986
17266
|
onSelect: setSelectedId
|
|
@@ -17026,7 +17306,8 @@ function WorkflowEditorApp(props) {
|
|
|
17026
17306
|
readiness,
|
|
17027
17307
|
publishing,
|
|
17028
17308
|
onPublish: publish,
|
|
17029
|
-
onSelect: setSelectedId
|
|
17309
|
+
onSelect: setSelectedId,
|
|
17310
|
+
signIn
|
|
17030
17311
|
})
|
|
17031
17312
|
]
|
|
17032
17313
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -17047,7 +17328,8 @@ function WorkflowEditorApp(props) {
|
|
|
17047
17328
|
error: publishError,
|
|
17048
17329
|
onPublish: publish,
|
|
17049
17330
|
onDiscard: callbacks.discardChanges,
|
|
17050
|
-
onSelect: setSelectedId
|
|
17331
|
+
onSelect: setSelectedId,
|
|
17332
|
+
signIn
|
|
17051
17333
|
})
|
|
17052
17334
|
})]
|
|
17053
17335
|
}),
|
|
@@ -17077,7 +17359,8 @@ function WorkflowEditorApp(props) {
|
|
|
17077
17359
|
trigger: selectedTrigger,
|
|
17078
17360
|
callbacks,
|
|
17079
17361
|
onClose: () => setSelectedId(null),
|
|
17080
|
-
readOnly: model.readOnly
|
|
17362
|
+
readOnly: model.readOnly,
|
|
17363
|
+
publishedVersion: model.published?.version
|
|
17081
17364
|
}, selectedTrigger.id) : null]
|
|
17082
17365
|
}), /* @__PURE__ */ jsx(ExpressionPickerPopup, {})]
|
|
17083
17366
|
})
|
|
@@ -17110,7 +17393,7 @@ function LastRunFact(props) {
|
|
|
17110
17393
|
if (runs.status === "pending") return null;
|
|
17111
17394
|
const run = runs.data?.at(0) ?? null;
|
|
17112
17395
|
if (run === null) return /* @__PURE__ */ jsx("span", {
|
|
17113
|
-
className: "text-xs text-muted-foreground",
|
|
17396
|
+
className: "whitespace-nowrap text-xs text-muted-foreground",
|
|
17114
17397
|
children: "Not run yet"
|
|
17115
17398
|
});
|
|
17116
17399
|
const tone = toneOf(RUN_TONE, run.status);
|
|
@@ -17137,6 +17420,7 @@ function WorkflowEditor() {
|
|
|
17137
17420
|
const { model, callbacks } = useWorkflowModel();
|
|
17138
17421
|
const [document] = useSelectedWorkflowDocument();
|
|
17139
17422
|
const workflowId = document.header.id;
|
|
17423
|
+
const modules = useDocumentModelModules();
|
|
17140
17424
|
const driveNodes = useFileNodesInSelectedDrive();
|
|
17141
17425
|
const driveId = useSelectedDriveId() ?? void 0;
|
|
17142
17426
|
const driveConnections = driveNodes ? driveNodes.filter((node) => node.documentType === "powerhouse/connection").map((node) => node.id).join(",") : null;
|
|
@@ -17185,6 +17469,13 @@ function WorkflowEditor() {
|
|
|
17185
17469
|
client,
|
|
17186
17470
|
queryClient
|
|
17187
17471
|
}, block, config),
|
|
17472
|
+
documentOutput: async (reference) => {
|
|
17473
|
+
const referenced = modules?.filter((module) => module.documentModel.global.id === reference.documentType).sort((a, b) => (b.version ?? 1) - (a.version ?? 1)).at(0)?.documentModel.global;
|
|
17474
|
+
return documentShape(reference, referenced ? await stateFieldsFromSdl({
|
|
17475
|
+
name: referenced.name,
|
|
17476
|
+
schema: referenced.specifications.at(-1)?.state.global.schema ?? null
|
|
17477
|
+
}) : {});
|
|
17478
|
+
},
|
|
17188
17479
|
testOutput: async (blockId) => {
|
|
17189
17480
|
const block = model.trigger?.id === blockId ? model.trigger : model.steps.find((step) => step.id === blockId);
|
|
17190
17481
|
const tree = await queryClient.fetchQuery(stepOutputTreeQuery(client, workflowId, blockId, block?.lastTest?.testedAt ?? null));
|
|
@@ -17198,7 +17489,8 @@ function WorkflowEditor() {
|
|
|
17198
17489
|
client,
|
|
17199
17490
|
queryClient,
|
|
17200
17491
|
model,
|
|
17201
|
-
workflowId
|
|
17492
|
+
workflowId,
|
|
17493
|
+
modules
|
|
17202
17494
|
]);
|
|
17203
17495
|
return /* @__PURE__ */ jsx(DesignTimeProvider, {
|
|
17204
17496
|
service: designTime,
|
|
@@ -17231,4 +17523,4 @@ function Editor() {
|
|
|
17231
17523
|
//#endregion
|
|
17232
17524
|
export { Editor as default };
|
|
17233
17525
|
|
|
17234
|
-
//# sourceMappingURL=editor-
|
|
17526
|
+
//# sourceMappingURL=editor-9eSmoDTm.js.map
|