@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,17 +1,17 @@
|
|
|
1
1
|
import { i as __require, o as __toESM, t as __commonJSMin } from "./rolldown-runtime-BMI-E3GI.mjs";
|
|
2
2
|
import { c as planFromAuth, o as packageFromConnectorId, r as connectorIdForPiece } from "./piece-auth-BS5CtQOG.mjs";
|
|
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-BM6I7dDA.mjs";
|
|
4
|
+
import { y as actions } from "./module-BsqRZox1.mjs";
|
|
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-BMnBzXcA.mjs";
|
|
6
|
+
import { A as REACTOR_CONNECTOR_ID, y as actions$1 } from "./module-BlT-atBQ.mjs";
|
|
7
|
+
import { t as useConnectionDocumentById } from "./connection-BxJoL8js.mjs";
|
|
8
|
+
import { t as useSelectedWorkflowDocument } from "./workflow-BpfdBHyS.mjs";
|
|
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-DZFudcoD.mjs";
|
|
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-78ZhfT-b.mjs";
|
|
11
11
|
import React, { Fragment, Suspense, createContext, forwardRef, lazy, memo, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
12
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { generateId } from "document-model";
|
|
14
|
-
import { addDocument, useFileNodesInSelectedDrive, useSelectedDocumentId, useSelectedDriveId } from "@powerhousedao/reactor-browser";
|
|
14
|
+
import { addDocument, dispatchActions, useDocumentModelModules, useFileNodesInSelectedDrive, useSelectedDocumentId, useSelectedDriveId } from "@powerhousedao/reactor-browser";
|
|
15
15
|
import { createPortal } from "react-dom";
|
|
16
16
|
//#region editors/workflow-editor/undo-policy.ts
|
|
17
17
|
function placesBlock(edit, id) {
|
|
@@ -97,7 +97,24 @@ function toModel(state) {
|
|
|
97
97
|
version: state.version,
|
|
98
98
|
published: state.published ? {
|
|
99
99
|
version: state.published.version,
|
|
100
|
-
publishedAt: state.published.publishedAt
|
|
100
|
+
publishedAt: state.published.publishedAt,
|
|
101
|
+
blocks: [...state.published.trigger ? [{
|
|
102
|
+
id: state.published.trigger.id,
|
|
103
|
+
label: "Trigger",
|
|
104
|
+
pieceName: state.published.trigger.pieceName,
|
|
105
|
+
pieceVersion: state.published.trigger.pieceVersion,
|
|
106
|
+
kind: "trigger",
|
|
107
|
+
name: state.published.trigger.triggerName,
|
|
108
|
+
reactorConnectionId: state.published.trigger.reactorConnectionId ?? null
|
|
109
|
+
}] : [], ...state.published.steps.map((step) => ({
|
|
110
|
+
id: step.id,
|
|
111
|
+
label: step.name || step.key,
|
|
112
|
+
pieceName: step.pieceName,
|
|
113
|
+
pieceVersion: step.pieceVersion,
|
|
114
|
+
kind: "action",
|
|
115
|
+
name: step.actionName,
|
|
116
|
+
reactorConnectionId: step.reactorConnectionId ?? null
|
|
117
|
+
}))]
|
|
101
118
|
} : null,
|
|
102
119
|
readOnly: false,
|
|
103
120
|
trigger: state.trigger ? {
|
|
@@ -107,6 +124,7 @@ function toModel(state) {
|
|
|
107
124
|
triggerName: state.trigger.triggerName,
|
|
108
125
|
config: state.trigger.config,
|
|
109
126
|
connectionId: state.trigger.connectionId ?? null,
|
|
127
|
+
reactorConnectionId: state.trigger.reactorConnectionId ?? null,
|
|
110
128
|
...blockState(state.trigger)
|
|
111
129
|
} : null,
|
|
112
130
|
steps: state.steps.map((step) => ({
|
|
@@ -117,6 +135,7 @@ function toModel(state) {
|
|
|
117
135
|
pieceVersion: step.pieceVersion,
|
|
118
136
|
actionName: step.actionName,
|
|
119
137
|
connectionId: step.connectionId ?? null,
|
|
138
|
+
reactorConnectionId: step.reactorConnectionId ?? null,
|
|
120
139
|
config: step.config,
|
|
121
140
|
retry: step.retry ? {
|
|
122
141
|
maxAttempts: step.retry.maxAttempts,
|
|
@@ -173,6 +192,7 @@ function useWorkflowModel() {
|
|
|
173
192
|
triggerName: input.triggerName,
|
|
174
193
|
config: input.config,
|
|
175
194
|
connectionId: input.connectionId,
|
|
195
|
+
reactorConnectionId: input.reactorConnectionId,
|
|
176
196
|
...input.propertySettings ? { propertySettings: settingsInput(input.propertySettings) } : {}
|
|
177
197
|
}), group));
|
|
178
198
|
return {
|
|
@@ -291,6 +311,7 @@ function useWorkflowModel() {
|
|
|
291
311
|
pieceVersion: step.pieceVersion,
|
|
292
312
|
actionName: step.actionName,
|
|
293
313
|
connectionId: step.connectionId,
|
|
314
|
+
reactorConnectionId: step.reactorConnectionId,
|
|
294
315
|
config: step.config,
|
|
295
316
|
retry: step.retry,
|
|
296
317
|
timeoutSeconds: step.timeoutSeconds,
|
|
@@ -340,7 +361,8 @@ function useWorkflowModel() {
|
|
|
340
361
|
pieceVersion: trigger.pieceVersion,
|
|
341
362
|
triggerName: trigger.triggerName,
|
|
342
363
|
config: plan.config,
|
|
343
|
-
connectionId: trigger.connectionId
|
|
364
|
+
connectionId: trigger.connectionId,
|
|
365
|
+
reactorConnectionId: trigger.reactorConnectionId
|
|
344
366
|
})] : plan.config ? [actions.setStepConfig({
|
|
345
367
|
id: added.id,
|
|
346
368
|
config: plan.config
|
|
@@ -370,6 +392,70 @@ function findBlock(state, added) {
|
|
|
370
392
|
} : void 0;
|
|
371
393
|
}
|
|
372
394
|
//#endregion
|
|
395
|
+
//#region editors/workflow-editor/ui/document-shape.ts
|
|
396
|
+
const MAX_DEPTH$1 = 6;
|
|
397
|
+
const normalize = (name) => name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
398
|
+
function typeName(node, kind) {
|
|
399
|
+
if (node.kind === kind.NON_NULL_TYPE) {
|
|
400
|
+
const inner = typeName(node.type, kind);
|
|
401
|
+
return {
|
|
402
|
+
name: inner.name,
|
|
403
|
+
display: `${inner.display}!`
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
if (node.kind === kind.LIST_TYPE) {
|
|
407
|
+
const inner = typeName(node.type, kind);
|
|
408
|
+
return {
|
|
409
|
+
name: inner.name,
|
|
410
|
+
display: `[${inner.display}]`
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
return {
|
|
414
|
+
name: node.name.value,
|
|
415
|
+
display: node.name.value
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
async function stateFieldsFromSdl(model) {
|
|
419
|
+
if (!model.schema) return {};
|
|
420
|
+
const { Kind, parse } = await import("./graphql-BGVLRhC1.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
|
|
421
|
+
let definitions;
|
|
422
|
+
try {
|
|
423
|
+
definitions = parse(model.schema).definitions;
|
|
424
|
+
} catch {
|
|
425
|
+
return {};
|
|
426
|
+
}
|
|
427
|
+
const types = /* @__PURE__ */ new Map();
|
|
428
|
+
for (const def of definitions) {
|
|
429
|
+
if (def.kind !== Kind.OBJECT_TYPE_DEFINITION && def.kind !== Kind.INPUT_OBJECT_TYPE_DEFINITION) continue;
|
|
430
|
+
types.set(normalize(def.name.value), (def.fields ?? []).map((field) => ({
|
|
431
|
+
name: field.name.value,
|
|
432
|
+
type: field.type
|
|
433
|
+
})));
|
|
434
|
+
}
|
|
435
|
+
const root = [`${normalize(model.name)}state`, `${normalize(model.name)}globalstate`].map((candidate) => types.get(candidate)).find((fields) => fields !== void 0);
|
|
436
|
+
const build = (fields, depth) => Object.fromEntries(fields.map((field) => {
|
|
437
|
+
const { name, display } = typeName(field.type, Kind);
|
|
438
|
+
const inner = types.get(normalize(name));
|
|
439
|
+
return [field.name, inner && inner.length > 0 && depth < MAX_DEPTH$1 ? build(inner, depth + 1) : display];
|
|
440
|
+
}));
|
|
441
|
+
return root ? build(root, 0) : {};
|
|
442
|
+
}
|
|
443
|
+
function documentShape(reference, globalState) {
|
|
444
|
+
return {
|
|
445
|
+
header: {
|
|
446
|
+
id: reference.documentId,
|
|
447
|
+
documentType: reference.documentType,
|
|
448
|
+
name: "String",
|
|
449
|
+
slug: "String",
|
|
450
|
+
branch: reference.branch,
|
|
451
|
+
revision: reference.revision,
|
|
452
|
+
createdAtUtcIso: "DateTime!",
|
|
453
|
+
lastModifiedAtUtcIso: "DateTime!"
|
|
454
|
+
},
|
|
455
|
+
state: { global: globalState }
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
373
459
|
//#region editors/workflow-editor/ui/variable-types.ts
|
|
374
460
|
const VARIABLE_TYPE_LABEL = {
|
|
375
461
|
TEXT: "Text",
|
|
@@ -494,8 +580,22 @@ function formatRunTime(startedAt, now = /* @__PURE__ */ new Date()) {
|
|
|
494
580
|
})} ${time}`;
|
|
495
581
|
}
|
|
496
582
|
const hasOutput = (step) => (step.status === "SUCCEEDED" || step.status === "REPLAYED") && step.output !== void 0 && step.output !== null;
|
|
583
|
+
async function withDocuments(value, documentOutput) {
|
|
584
|
+
const references = documentRefsIn(value);
|
|
585
|
+
if (references.length === 0) return value;
|
|
586
|
+
const key = (reference) => `${reference.branch}:${reference.documentId}`;
|
|
587
|
+
const shapeOf = async (reference) => {
|
|
588
|
+
try {
|
|
589
|
+
if (documentOutput) return await documentOutput(reference);
|
|
590
|
+
} catch {}
|
|
591
|
+
return documentShape(reference, {});
|
|
592
|
+
};
|
|
593
|
+
const shapes = new Map(await Promise.all(references.map(async (reference) => [key(reference), await shapeOf(reference)])));
|
|
594
|
+
return expandDocumentRefs(value, (reference) => shapes.get(key(reference)));
|
|
595
|
+
}
|
|
497
596
|
async function buildExpressionScope(options) {
|
|
498
597
|
const { model, latestRun } = options;
|
|
598
|
+
const documents = (value) => withDocuments(value, options.documentOutput);
|
|
499
599
|
const runCaption = latestRun ? `from run ${formatRunTime(latestRun.startedAt, options.now)}` : void 0;
|
|
500
600
|
const runSteps = new Map((latestRun?.steps ?? []).filter(hasOutput).map((step) => [step.stepKey, step]));
|
|
501
601
|
const value = {};
|
|
@@ -505,10 +605,10 @@ async function buildExpressionScope(options) {
|
|
|
505
605
|
if (model.trigger) {
|
|
506
606
|
const sample = await tested(model.trigger);
|
|
507
607
|
if (sample) {
|
|
508
|
-
value.trigger = { payload: capValue(sample.value) };
|
|
608
|
+
value.trigger = { payload: capValue(await documents(sample.value)) };
|
|
509
609
|
captions["trigger.payload"] = testCaption(sample);
|
|
510
610
|
} else if (runCaption && latestRun?.triggerPayload !== void 0 && latestRun.triggerPayload !== null) {
|
|
511
|
-
value.trigger = { payload: capValue(latestRun.triggerPayload) };
|
|
611
|
+
value.trigger = { payload: capValue(await documents(latestRun.triggerPayload)) };
|
|
512
612
|
captions["trigger.payload"] = runCaption;
|
|
513
613
|
} else {
|
|
514
614
|
value.trigger = { payload: await options.authoredOutput(triggerBlock(model.trigger), model.trigger.config) };
|
|
@@ -520,13 +620,13 @@ async function buildExpressionScope(options) {
|
|
|
520
620
|
await Promise.all(model.steps.filter((step) => upstream.has(step.id)).map(async (step) => {
|
|
521
621
|
const sample = await tested(step);
|
|
522
622
|
if (sample) {
|
|
523
|
-
steps[step.key] = { output: capValue(sample.value) };
|
|
623
|
+
steps[step.key] = { output: capValue(await documents(sample.value)) };
|
|
524
624
|
captions[`steps.${step.key}.output`] = testCaption(sample);
|
|
525
625
|
return;
|
|
526
626
|
}
|
|
527
627
|
const journaled = runSteps.get(step.key);
|
|
528
628
|
if (runCaption && journaled && journaled.pieceName === step.pieceName && journaled.blockName === step.actionName) {
|
|
529
|
-
steps[step.key] = { output: capValue(journaled.output) };
|
|
629
|
+
steps[step.key] = { output: capValue(await documents(journaled.output)) };
|
|
530
630
|
captions[`steps.${step.key}.output`] = runCaption;
|
|
531
631
|
return;
|
|
532
632
|
}
|
|
@@ -1404,7 +1504,8 @@ function CreateConnectionModal(props) {
|
|
|
1404
1504
|
}), state && callbacks ? /* @__PURE__ */ jsx(ConnectionForm, {
|
|
1405
1505
|
state,
|
|
1406
1506
|
callbacks,
|
|
1407
|
-
connectionId: props.connectionId
|
|
1507
|
+
connectionId: props.connectionId,
|
|
1508
|
+
offerReactor: false
|
|
1408
1509
|
}) : /* @__PURE__ */ jsx("p", {
|
|
1409
1510
|
className: "text-xs text-muted-foreground/80",
|
|
1410
1511
|
children: "Loading the new connection document…"
|
|
@@ -1482,8 +1583,8 @@ function CreateRow(props) {
|
|
|
1482
1583
|
})]
|
|
1483
1584
|
});
|
|
1484
1585
|
}
|
|
1485
|
-
const LINK_ATTEMPTS = 30;
|
|
1486
|
-
const LINK_INTERVAL_MS = 500;
|
|
1586
|
+
const LINK_ATTEMPTS$1 = 30;
|
|
1587
|
+
const LINK_INTERVAL_MS$1 = 500;
|
|
1487
1588
|
function ConnectionField(props) {
|
|
1488
1589
|
const { form } = useBlockForm(props.block);
|
|
1489
1590
|
const { connections, refetch, invalidate, fetchNow } = useConnectionList();
|
|
@@ -1548,8 +1649,8 @@ function ConnectionField(props) {
|
|
|
1548
1649
|
pick(connectionId);
|
|
1549
1650
|
};
|
|
1550
1651
|
fetchNow().then((result) => {
|
|
1551
|
-
if (result.some((connection) => connection.id === connectionId && packageFromConnectorId(connection.connectorId) === props.block.pieceName) || attempt >= LINK_ATTEMPTS) done();
|
|
1552
|
-
else setTimeout(() => poll(attempt + 1), LINK_INTERVAL_MS);
|
|
1652
|
+
if (result.some((connection) => connection.id === connectionId && packageFromConnectorId(connection.connectorId) === props.block.pieceName) || attempt >= LINK_ATTEMPTS$1) done();
|
|
1653
|
+
else setTimeout(() => poll(attempt + 1), LINK_INTERVAL_MS$1);
|
|
1553
1654
|
}, () => done());
|
|
1554
1655
|
};
|
|
1555
1656
|
poll(0);
|
|
@@ -1668,6 +1769,139 @@ function ConnectionField(props) {
|
|
|
1668
1769
|
});
|
|
1669
1770
|
}
|
|
1670
1771
|
//#endregion
|
|
1772
|
+
//#region editors/workflow-editor/ui/reactor-connection-create.ts
|
|
1773
|
+
function newReactorConnectionActions(name, requireReactor) {
|
|
1774
|
+
return [
|
|
1775
|
+
actions$1.setConnectionName({ name }),
|
|
1776
|
+
actions$1.setName(name),
|
|
1777
|
+
actions$1.setConnector({
|
|
1778
|
+
connectorId: REACTOR_CONNECTOR_ID,
|
|
1779
|
+
authType: "REACTOR"
|
|
1780
|
+
}),
|
|
1781
|
+
actions$1.setConfig({ config: requireReactor === "read" ? {
|
|
1782
|
+
endpoint: "local",
|
|
1783
|
+
access: "read"
|
|
1784
|
+
} : { endpoint: "local" } }),
|
|
1785
|
+
actions$1.recordCheckResult({
|
|
1786
|
+
status: "OK",
|
|
1787
|
+
checkedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1788
|
+
})
|
|
1789
|
+
];
|
|
1790
|
+
}
|
|
1791
|
+
//#endregion
|
|
1792
|
+
//#region editors/workflow-editor/ui/ReactorConnectionField.tsx
|
|
1793
|
+
const LINK_ATTEMPTS = 30;
|
|
1794
|
+
const LINK_INTERVAL_MS = 500;
|
|
1795
|
+
const DECLARED = {
|
|
1796
|
+
read: "Reads documents only",
|
|
1797
|
+
write: "Reads and writes documents"
|
|
1798
|
+
};
|
|
1799
|
+
function ReactorConnectionField(props) {
|
|
1800
|
+
const { form } = useBlockForm(props.block);
|
|
1801
|
+
const { connections, refetch, invalidate } = useConnectionList();
|
|
1802
|
+
const driveId = useSelectedDriveId();
|
|
1803
|
+
const gate = useSignInGate();
|
|
1804
|
+
const { publisher, loading } = usePublisher(props.workflowId, props.publishedVersion);
|
|
1805
|
+
const runsAs = runsAsText(publisher, loading, gate.access?.reactorIdentity?.address);
|
|
1806
|
+
const [creating, setCreating] = useState(false);
|
|
1807
|
+
const refetchRef = useRef(refetch);
|
|
1808
|
+
useEffect(() => {
|
|
1809
|
+
refetchRef.current = refetch;
|
|
1810
|
+
});
|
|
1811
|
+
const [error, setError] = useState(null);
|
|
1812
|
+
const linking = props.value || null;
|
|
1813
|
+
const listed = connections.some((connection) => connection.id === linking);
|
|
1814
|
+
useEffect(() => {
|
|
1815
|
+
if (!linking || listed) return;
|
|
1816
|
+
let attempts = 0;
|
|
1817
|
+
const timer = setInterval(() => {
|
|
1818
|
+
if (++attempts > LINK_ATTEMPTS) clearInterval(timer);
|
|
1819
|
+
else refetchRef.current();
|
|
1820
|
+
}, LINK_INTERVAL_MS);
|
|
1821
|
+
return () => clearInterval(timer);
|
|
1822
|
+
}, [linking, listed]);
|
|
1823
|
+
const declared = form && form !== "loading" ? form.requireReactor : void 0;
|
|
1824
|
+
if (!declared && !props.value) return null;
|
|
1825
|
+
const options = reactorConnections(connections).map((connection) => ({
|
|
1826
|
+
value: connection.id,
|
|
1827
|
+
label: connection.name || connection.id,
|
|
1828
|
+
description: connection.status === "REVOKED" ? "Revoked" : void 0
|
|
1829
|
+
}));
|
|
1830
|
+
const create = () => {
|
|
1831
|
+
if (!driveId || creating) return;
|
|
1832
|
+
setCreating(true);
|
|
1833
|
+
setError(null);
|
|
1834
|
+
const name = "Reactor access";
|
|
1835
|
+
addDocument(driveId, name, CONNECTION_TYPE).then(async (node) => {
|
|
1836
|
+
let failure;
|
|
1837
|
+
await dispatchActions(newReactorConnectionActions(name, declared ?? "write"), node.id, (errors) => {
|
|
1838
|
+
failure = errors[0]?.message;
|
|
1839
|
+
});
|
|
1840
|
+
if (failure) throw new Error(failure);
|
|
1841
|
+
invalidate();
|
|
1842
|
+
setCreating(false);
|
|
1843
|
+
props.onChange(node.id);
|
|
1844
|
+
}).catch((cause) => {
|
|
1845
|
+
setCreating(false);
|
|
1846
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
1847
|
+
});
|
|
1848
|
+
};
|
|
1849
|
+
const known = options.some((option) => option.value === props.value);
|
|
1850
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1851
|
+
className: "flex flex-col gap-3",
|
|
1852
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [
|
|
1853
|
+
/* @__PURE__ */ jsx(FieldLabel, {
|
|
1854
|
+
label: "Reactor connection",
|
|
1855
|
+
needsValue: Boolean(declared) && !props.value,
|
|
1856
|
+
action: props.value ? /* @__PURE__ */ jsx("button", {
|
|
1857
|
+
type: "button",
|
|
1858
|
+
className: "rounded px-1 text-xs text-muted-foreground hover:text-foreground",
|
|
1859
|
+
onClick: () => props.onChange(null),
|
|
1860
|
+
children: "Clear"
|
|
1861
|
+
}) : void 0
|
|
1862
|
+
}),
|
|
1863
|
+
/* @__PURE__ */ jsx("div", {
|
|
1864
|
+
onPointerDown: refetch,
|
|
1865
|
+
children: /* @__PURE__ */ jsx(Select, {
|
|
1866
|
+
ariaLabel: "Reactor connection",
|
|
1867
|
+
value: props.value,
|
|
1868
|
+
options,
|
|
1869
|
+
invalid: Boolean(declared) && !props.value,
|
|
1870
|
+
placeholder: creating ? "Creating connection…" : "Choose a reactor connection",
|
|
1871
|
+
emptyText: "No reactor connection in this drive yet.",
|
|
1872
|
+
disabled: creating,
|
|
1873
|
+
onChange: (id) => props.onChange(id || null),
|
|
1874
|
+
actions: driveId && declared ? [{
|
|
1875
|
+
label: "New reactor connection",
|
|
1876
|
+
icon: "plus",
|
|
1877
|
+
onSelect: create
|
|
1878
|
+
}] : void 0
|
|
1879
|
+
})
|
|
1880
|
+
}),
|
|
1881
|
+
declared ? /* @__PURE__ */ jsxs(Hint, { children: [
|
|
1882
|
+
DECLARED[declared],
|
|
1883
|
+
", within what the connection allows.",
|
|
1884
|
+
runsAs ? /* @__PURE__ */ jsx("span", {
|
|
1885
|
+
className: "block",
|
|
1886
|
+
"aria-label": "Runs as",
|
|
1887
|
+
children: runsAs
|
|
1888
|
+
}) : null
|
|
1889
|
+
] }) : /* @__PURE__ */ jsx(Hint, { children: "This block takes no reactor connection." }),
|
|
1890
|
+
props.value && connections.length > 0 && !known ? /* @__PURE__ */ jsx("p", {
|
|
1891
|
+
className: "mt-1.5 text-xs text-wf-warn",
|
|
1892
|
+
children: "Not a reactor connection in this drive."
|
|
1893
|
+
}) : null,
|
|
1894
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
1895
|
+
className: "mt-1.5 text-xs font-medium text-wf-fail",
|
|
1896
|
+
children: error
|
|
1897
|
+
}) : null
|
|
1898
|
+
] }), !props.value ? /* @__PURE__ */ jsx(SignInPrompt, {
|
|
1899
|
+
gate,
|
|
1900
|
+
reason: "Sign in so the workflow runs as you when it reaches documents."
|
|
1901
|
+
}) : null]
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
//#endregion
|
|
1671
1905
|
//#region editors/workflow-editor/ui/secret-ref.ts
|
|
1672
1906
|
const SECRET_REF_PREFIX = "secret://v1:";
|
|
1673
1907
|
function useSecretRef(options) {
|
|
@@ -2601,7 +2835,7 @@ function PropField(props) {
|
|
|
2601
2835
|
active: field.active,
|
|
2602
2836
|
onFocusField: field.focus
|
|
2603
2837
|
}) : void 0;
|
|
2604
|
-
const dynamicLoad = props.loadOptions && prop.hasDynamicResolver ? () => props.loadOptions(prop.name) : void 0;
|
|
2838
|
+
const dynamicLoad = props.loadOptions && prop.hasDynamicResolver && !props.optionsBlocked ? () => props.loadOptions(prop.name) : void 0;
|
|
2605
2839
|
const isDropdown = prop.type === "DROPDOWN" || prop.type === "MULTI_SELECT_DROPDOWN";
|
|
2606
2840
|
const dropdown = useResolvedProp({
|
|
2607
2841
|
kind: "options",
|
|
@@ -2640,7 +2874,8 @@ function PropField(props) {
|
|
|
2640
2874
|
disabled: state.kind === "loading",
|
|
2641
2875
|
onClick: reload
|
|
2642
2876
|
});
|
|
2643
|
-
const
|
|
2877
|
+
const blocked = prop.hasDynamicResolver ? props.optionsBlocked : void 0;
|
|
2878
|
+
const loadError = (state) => blocked ?? (state.kind === "error" ? props.explainOptionsError?.(state.message) ?? state.message : null);
|
|
2644
2879
|
const textInput = (extra) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
2645
2880
|
className: "flex items-center gap-1",
|
|
2646
2881
|
children: /* @__PURE__ */ jsx("input", {
|
|
@@ -2935,7 +3170,7 @@ function PropField(props) {
|
|
|
2935
3170
|
}
|
|
2936
3171
|
}],
|
|
2937
3172
|
emptyText: result?.placeholder ?? "Nothing to choose from yet. Some lists need a connection first.",
|
|
2938
|
-
placeholder: optionsUnavailable ? "Options for nested fields are available soon" : result?.placeholder ?? prop.placeholder ?? "Choose…"
|
|
3173
|
+
placeholder: optionsUnavailable ? "Options for nested fields are available soon" : dropdown.syncing ? "Waiting for the Switchboard…" : result?.placeholder ?? prop.placeholder ?? "Choose…"
|
|
2939
3174
|
})
|
|
2940
3175
|
});
|
|
2941
3176
|
}
|
|
@@ -3212,7 +3447,7 @@ function PropertyForm(props) {
|
|
|
3212
3447
|
for (const prop of props.props) {
|
|
3213
3448
|
if (prop.type !== "DYNAMIC") continue;
|
|
3214
3449
|
if (settingFor(next, prop.name)?.mode === "EXPRESSION") continue;
|
|
3215
|
-
const fields = readDynamic(resolverInputFor(props.block ?? NO_BLOCK, prop, config, props.connectionId));
|
|
3450
|
+
const fields = readDynamic(resolverInputFor(props.block ?? NO_BLOCK, prop, config, props.connectionId, props.reactorConnectionId));
|
|
3216
3451
|
if (!fields) continue;
|
|
3217
3452
|
const schema = stripOptions(fields);
|
|
3218
3453
|
const stored = settingFor(next, prop.name)?.schema ?? null;
|
|
@@ -3261,7 +3496,9 @@ function PropertyForm(props) {
|
|
|
3261
3496
|
config: current,
|
|
3262
3497
|
secrets: props.secrets,
|
|
3263
3498
|
scopeStepId: props.scopeStepId,
|
|
3264
|
-
|
|
3499
|
+
optionsBlocked: props.optionsBlocked,
|
|
3500
|
+
explainOptionsError: props.explainOptionsError,
|
|
3501
|
+
resolverInput: resolverInputFor(props.block ?? NO_BLOCK, prop, current, props.connectionId, props.reactorConnectionId),
|
|
3265
3502
|
waitingOn: props.props.find((sibling) => prop.refreshers?.includes(sibling.name) && isEmptyValue(current[sibling.name]))?.displayName,
|
|
3266
3503
|
nested: props.nested,
|
|
3267
3504
|
webhookUrl: props.webhookUrl
|
|
@@ -3900,7 +4137,7 @@ function configOf(block) {
|
|
|
3900
4137
|
function unknownDynamic(block, form) {
|
|
3901
4138
|
if (!form || form === "loading" || block.skip) return [];
|
|
3902
4139
|
const config = configOf(block);
|
|
3903
|
-
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));
|
|
4140
|
+
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));
|
|
3904
4141
|
}
|
|
3905
4142
|
function withIssues(missing, issues) {
|
|
3906
4143
|
if (issues.length === 0) return missing;
|
|
@@ -3918,6 +4155,7 @@ function useBlockCheck(block) {
|
|
|
3918
4155
|
block: block.block,
|
|
3919
4156
|
config: block.config,
|
|
3920
4157
|
connectionId: block.connectionId,
|
|
4158
|
+
reactorConnectionId: block.reactorConnectionId,
|
|
3921
4159
|
propertySettings: block.propertySettings,
|
|
3922
4160
|
skip: block.skip,
|
|
3923
4161
|
resolveDynamic: lookup
|
|
@@ -3964,6 +4202,7 @@ function useWorkflowCheck(model) {
|
|
|
3964
4202
|
block: block.block,
|
|
3965
4203
|
config: block.config,
|
|
3966
4204
|
connectionId: block.connectionId,
|
|
4205
|
+
reactorConnectionId: block.reactorConnectionId,
|
|
3967
4206
|
propertySettings: block.propertySettings,
|
|
3968
4207
|
skip: block.skip,
|
|
3969
4208
|
resolveDynamic: lookup
|
|
@@ -4056,7 +4295,11 @@ function FormSkeleton() {
|
|
|
4056
4295
|
function ConfigSection(props) {
|
|
4057
4296
|
const { form } = props;
|
|
4058
4297
|
const designTime = useDesignTime();
|
|
4298
|
+
const gate = useSignInGate();
|
|
4059
4299
|
const configRecord = props.config ?? {};
|
|
4300
|
+
const declared = form && form !== "loading" ? form.requireReactor : void 0;
|
|
4301
|
+
const optionsBlocked = declared && gate.required ? "Sign in to load options" : void 0;
|
|
4302
|
+
const explainOptionsError = declared && !props.reactorConnectionId ? (message) => `Bind a reactor connection first. ${message}` : void 0;
|
|
4060
4303
|
if (form === "loading") return /* @__PURE__ */ jsx(FormSkeleton, {});
|
|
4061
4304
|
return /* @__PURE__ */ jsxs("div", {
|
|
4062
4305
|
className: "flex flex-col gap-5",
|
|
@@ -4087,10 +4330,13 @@ function ConfigSection(props) {
|
|
|
4087
4330
|
writesSettings: props.writesSettings,
|
|
4088
4331
|
scopeStepId: props.scopeStepId,
|
|
4089
4332
|
connectionId: props.connectionId,
|
|
4333
|
+
reactorConnectionId: props.reactorConnectionId,
|
|
4334
|
+
optionsBlocked,
|
|
4335
|
+
explainOptionsError,
|
|
4090
4336
|
secrets: designTime?.secrets,
|
|
4091
4337
|
block: props.block,
|
|
4092
4338
|
webhookUrl: props.webhookUrl,
|
|
4093
|
-
loadOptions: designTime ? (propName, current, searchValue) => designTime.loadOptions(props.block, propName, current, props.connectionId, searchValue) : void 0
|
|
4339
|
+
loadOptions: designTime ? (propName, current, searchValue) => designTime.loadOptions(props.block, propName, current, props.connectionId, searchValue, props.reactorConnectionId) : void 0
|
|
4094
4340
|
}) : null,
|
|
4095
4341
|
form && form.props.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
4096
4342
|
className: "text-[13px] text-muted-foreground",
|
|
@@ -4749,10 +4995,7 @@ function LastRunSection(props) {
|
|
|
4749
4995
|
relativeTime(run.startedAt)
|
|
4750
4996
|
]
|
|
4751
4997
|
}),
|
|
4752
|
-
step?.error ? /* @__PURE__ */ jsx(
|
|
4753
|
-
className: "overflow-auto whitespace-pre-wrap rounded-md bg-wf-fail/10 p-2.5 text-xs text-wf-fail",
|
|
4754
|
-
children: step.error
|
|
4755
|
-
}) : null,
|
|
4998
|
+
step?.error ? /* @__PURE__ */ jsx(StepError, { error: step.error }) : null,
|
|
4756
4999
|
step ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DataViewer, {
|
|
4757
5000
|
label: "Received",
|
|
4758
5001
|
value: step.input
|
|
@@ -4785,6 +5028,7 @@ function settingsCustomised(step, model) {
|
|
|
4785
5028
|
}
|
|
4786
5029
|
function StepPanel(props) {
|
|
4787
5030
|
const { step, callbacks } = props;
|
|
5031
|
+
const designTime = useDesignTime();
|
|
4788
5032
|
const [tab, setTab] = useState("setup");
|
|
4789
5033
|
const block = stepBlock(step);
|
|
4790
5034
|
const meta = useBlockMeta(block);
|
|
@@ -4866,6 +5110,16 @@ function StepPanel(props) {
|
|
|
4866
5110
|
connectionId
|
|
4867
5111
|
})
|
|
4868
5112
|
}, `${step.id}-conn`),
|
|
5113
|
+
/* @__PURE__ */ jsx(ReactorConnectionField, {
|
|
5114
|
+
block,
|
|
5115
|
+
value: step.reactorConnectionId ?? "",
|
|
5116
|
+
workflowId: designTime?.workflowId,
|
|
5117
|
+
publishedVersion: props.model.published?.version,
|
|
5118
|
+
onChange: (reactorConnectionId) => callbacks.updateStep({
|
|
5119
|
+
id: step.id,
|
|
5120
|
+
reactorConnectionId
|
|
5121
|
+
})
|
|
5122
|
+
}, `${step.id}-reactor`),
|
|
4869
5123
|
/* @__PURE__ */ jsx(ConfigSection, {
|
|
4870
5124
|
block,
|
|
4871
5125
|
form,
|
|
@@ -4875,6 +5129,7 @@ function StepPanel(props) {
|
|
|
4875
5129
|
onChange: (config, settings) => callbacks.setStepConfig(step.id, config, writes ? { propertySettings: settings } : void 0),
|
|
4876
5130
|
writesSettings: writes,
|
|
4877
5131
|
connectionId: step.connectionId ?? void 0,
|
|
5132
|
+
reactorConnectionId: step.reactorConnectionId ?? void 0,
|
|
4878
5133
|
scopeStepId: step.id
|
|
4879
5134
|
}, `${step.id}-config`),
|
|
4880
5135
|
writes ? /* @__PURE__ */ jsx(Section, {
|
|
@@ -5047,10 +5302,12 @@ function TriggerPanel(props) {
|
|
|
5047
5302
|
const setTrigger = (patch) => {
|
|
5048
5303
|
const config = patch.config === void 0 ? trigger.config : patch.config;
|
|
5049
5304
|
const connectionId = patch.connectionId === void 0 ? trigger.connectionId : patch.connectionId;
|
|
5305
|
+
const reactorConnectionId = patch.reactorConnectionId === void 0 ? trigger.reactorConnectionId : patch.reactorConnectionId;
|
|
5050
5306
|
callbacks.setTrigger({
|
|
5051
5307
|
...triggerFields(block),
|
|
5052
5308
|
config,
|
|
5053
5309
|
connectionId,
|
|
5310
|
+
reactorConnectionId,
|
|
5054
5311
|
...writes ? { propertySettings: patch.settings } : {}
|
|
5055
5312
|
});
|
|
5056
5313
|
};
|
|
@@ -5072,6 +5329,13 @@ function TriggerPanel(props) {
|
|
|
5072
5329
|
value: trigger.connectionId ?? "",
|
|
5073
5330
|
onChange: (connectionId) => setTrigger({ connectionId })
|
|
5074
5331
|
}, `${trigger.id}-conn`) : null,
|
|
5332
|
+
isPieceTrigger ? /* @__PURE__ */ jsx(ReactorConnectionField, {
|
|
5333
|
+
block,
|
|
5334
|
+
value: trigger.reactorConnectionId ?? "",
|
|
5335
|
+
workflowId: designTime?.workflowId,
|
|
5336
|
+
publishedVersion: props.publishedVersion,
|
|
5337
|
+
onChange: (reactorConnectionId) => setTrigger({ reactorConnectionId })
|
|
5338
|
+
}, `${trigger.id}-reactor`) : null,
|
|
5075
5339
|
form !== "loading" && form?.display === "schedule" ? /* @__PURE__ */ jsx(ScheduleBuilder, {
|
|
5076
5340
|
config: trigger.config,
|
|
5077
5341
|
onChange: (config) => setTrigger({ config })
|
|
@@ -5087,6 +5351,7 @@ function TriggerPanel(props) {
|
|
|
5087
5351
|
}),
|
|
5088
5352
|
writesSettings: writes,
|
|
5089
5353
|
connectionId: trigger.connectionId ?? void 0,
|
|
5354
|
+
reactorConnectionId: trigger.reactorConnectionId ?? void 0,
|
|
5090
5355
|
webhookUrl: endpoint.kind === "ready" ? endpoint.endpoint.url : void 0
|
|
5091
5356
|
}, trigger.id),
|
|
5092
5357
|
/* @__PURE__ */ jsx(LastRunSection, {}),
|
|
@@ -5099,6 +5364,7 @@ function TriggerPanel(props) {
|
|
|
5099
5364
|
pieceVersion,
|
|
5100
5365
|
config: trigger.config,
|
|
5101
5366
|
connectionId: trigger.connectionId,
|
|
5367
|
+
reactorConnectionId: trigger.reactorConnectionId,
|
|
5102
5368
|
propertySettings: trigger.propertySettings ?? void 0
|
|
5103
5369
|
}) : void 0
|
|
5104
5370
|
}),
|
|
@@ -17066,6 +17332,8 @@ function WorkflowEditorApp(props) {
|
|
|
17066
17332
|
const selectedTrigger = model.trigger && model.trigger.id === selectedId ? model.trigger : null;
|
|
17067
17333
|
const showVariables = selectedId === VARIABLES_VIEW;
|
|
17068
17334
|
const workflowId = useDesignTime()?.workflowId ?? "";
|
|
17335
|
+
const signIn = useSignInGate();
|
|
17336
|
+
const denial = useReactorAccessDenial(workflowId || void 0, `${model.published?.version ?? 0}:${model.status}`);
|
|
17069
17337
|
const trigger = useMemo(() => model.trigger ? triggerBlock(model.trigger) : void 0, [model.trigger]);
|
|
17070
17338
|
const blocks = useMemo(() => [...model.trigger && trigger ? [{
|
|
17071
17339
|
id: model.trigger.id,
|
|
@@ -17079,6 +17347,16 @@ function WorkflowEditorApp(props) {
|
|
|
17079
17347
|
model.steps
|
|
17080
17348
|
]);
|
|
17081
17349
|
const resolutions = useBlockResolutions(workflowId, blocks);
|
|
17350
|
+
const publishedBlocks = useMemo(() => model.published?.blocks ?? [], [model.published]);
|
|
17351
|
+
const publishedForms = useBlockForms(publishedBlocks);
|
|
17352
|
+
const publishedMissing = missingInPublished(publishedBlocks.map((block) => {
|
|
17353
|
+
const form = publishedForms.get(blockRefKey(block));
|
|
17354
|
+
return {
|
|
17355
|
+
label: block.label,
|
|
17356
|
+
reactorConnectionId: block.reactorConnectionId,
|
|
17357
|
+
requireReactor: form && form !== "loading" ? form.requireReactor : null
|
|
17358
|
+
};
|
|
17359
|
+
}));
|
|
17082
17360
|
const draftBlocks = useMemo(() => blocks.map((entry) => entry.block), [blocks]);
|
|
17083
17361
|
const stepBlocks = useMemo(() => Object.fromEntries(model.steps.map((step) => [step.key, stepBlock(step)])), [model.steps]);
|
|
17084
17362
|
return /* @__PURE__ */ jsx(BlockResolutionsProvider, {
|
|
@@ -17087,7 +17365,7 @@ function WorkflowEditorApp(props) {
|
|
|
17087
17365
|
children: /* @__PURE__ */ jsxs("div", {
|
|
17088
17366
|
className: "flex min-h-0 flex-1 flex-col",
|
|
17089
17367
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
17090
|
-
className: "flex items-center gap-3 border-b border-solid border-foreground/10 bg-background px-4 py-2",
|
|
17368
|
+
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",
|
|
17091
17369
|
children: [
|
|
17092
17370
|
props.leading ? /* @__PURE__ */ jsxs(Fragment$1, { children: [props.leading, /* @__PURE__ */ jsx("span", {
|
|
17093
17371
|
"aria-hidden": true,
|
|
@@ -17095,7 +17373,7 @@ function WorkflowEditorApp(props) {
|
|
|
17095
17373
|
})] }) : null,
|
|
17096
17374
|
/* @__PURE__ */ jsx("input", {
|
|
17097
17375
|
"aria-label": "Workflow name",
|
|
17098
|
-
className: "min-w-
|
|
17376
|
+
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",
|
|
17099
17377
|
defaultValue: model.name,
|
|
17100
17378
|
placeholder: "Untitled workflow",
|
|
17101
17379
|
spellCheck: false,
|
|
@@ -17112,6 +17390,8 @@ function WorkflowEditorApp(props) {
|
|
|
17112
17390
|
children: ["v", model.version]
|
|
17113
17391
|
}),
|
|
17114
17392
|
/* @__PURE__ */ jsx(PublishState, { model }),
|
|
17393
|
+
/* @__PURE__ */ jsx(PublishedMissingNote, { missing: publishedMissing }),
|
|
17394
|
+
/* @__PURE__ */ jsx(ReactorDenialNote, { denial }),
|
|
17115
17395
|
/* @__PURE__ */ jsx(VersionSummary, {
|
|
17116
17396
|
resolutions,
|
|
17117
17397
|
onSelect: setSelectedId
|
|
@@ -17157,7 +17437,8 @@ function WorkflowEditorApp(props) {
|
|
|
17157
17437
|
readiness,
|
|
17158
17438
|
publishing,
|
|
17159
17439
|
onPublish: publish,
|
|
17160
|
-
onSelect: setSelectedId
|
|
17440
|
+
onSelect: setSelectedId,
|
|
17441
|
+
signIn
|
|
17161
17442
|
})
|
|
17162
17443
|
]
|
|
17163
17444
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -17178,7 +17459,8 @@ function WorkflowEditorApp(props) {
|
|
|
17178
17459
|
error: publishError,
|
|
17179
17460
|
onPublish: publish,
|
|
17180
17461
|
onDiscard: callbacks.discardChanges,
|
|
17181
|
-
onSelect: setSelectedId
|
|
17462
|
+
onSelect: setSelectedId,
|
|
17463
|
+
signIn
|
|
17182
17464
|
})
|
|
17183
17465
|
})]
|
|
17184
17466
|
}),
|
|
@@ -17208,7 +17490,8 @@ function WorkflowEditorApp(props) {
|
|
|
17208
17490
|
trigger: selectedTrigger,
|
|
17209
17491
|
callbacks,
|
|
17210
17492
|
onClose: () => setSelectedId(null),
|
|
17211
|
-
readOnly: model.readOnly
|
|
17493
|
+
readOnly: model.readOnly,
|
|
17494
|
+
publishedVersion: model.published?.version
|
|
17212
17495
|
}, selectedTrigger.id) : null]
|
|
17213
17496
|
}), /* @__PURE__ */ jsx(ExpressionPickerPopup, {})]
|
|
17214
17497
|
})
|
|
@@ -17241,7 +17524,7 @@ function LastRunFact(props) {
|
|
|
17241
17524
|
if (runs.status === "pending") return null;
|
|
17242
17525
|
const run = runs.data?.at(0) ?? null;
|
|
17243
17526
|
if (run === null) return /* @__PURE__ */ jsx("span", {
|
|
17244
|
-
className: "text-xs text-muted-foreground",
|
|
17527
|
+
className: "whitespace-nowrap text-xs text-muted-foreground",
|
|
17245
17528
|
children: "Not run yet"
|
|
17246
17529
|
});
|
|
17247
17530
|
const tone = toneOf(RUN_TONE, run.status);
|
|
@@ -17268,6 +17551,7 @@ function WorkflowEditor() {
|
|
|
17268
17551
|
const { model, callbacks } = useWorkflowModel();
|
|
17269
17552
|
const [document] = useSelectedWorkflowDocument();
|
|
17270
17553
|
const workflowId = document.header.id;
|
|
17554
|
+
const modules = useDocumentModelModules();
|
|
17271
17555
|
const driveNodes = useFileNodesInSelectedDrive();
|
|
17272
17556
|
const driveId = useSelectedDriveId() ?? void 0;
|
|
17273
17557
|
const driveConnections = driveNodes ? driveNodes.filter((node) => node.documentType === "powerhouse/connection").map((node) => node.id).join(",") : null;
|
|
@@ -17316,6 +17600,13 @@ function WorkflowEditor() {
|
|
|
17316
17600
|
client,
|
|
17317
17601
|
queryClient
|
|
17318
17602
|
}, block, config),
|
|
17603
|
+
documentOutput: async (reference) => {
|
|
17604
|
+
const referenced = modules?.filter((module) => module.documentModel.global.id === reference.documentType).sort((a, b) => (b.version ?? 1) - (a.version ?? 1)).at(0)?.documentModel.global;
|
|
17605
|
+
return documentShape(reference, referenced ? await stateFieldsFromSdl({
|
|
17606
|
+
name: referenced.name,
|
|
17607
|
+
schema: referenced.specifications.at(-1)?.state.global.schema ?? null
|
|
17608
|
+
}) : {});
|
|
17609
|
+
},
|
|
17319
17610
|
testOutput: async (blockId) => {
|
|
17320
17611
|
const block = model.trigger?.id === blockId ? model.trigger : model.steps.find((step) => step.id === blockId);
|
|
17321
17612
|
const tree = await queryClient.fetchQuery(stepOutputTreeQuery(client, workflowId, blockId, block?.lastTest?.testedAt ?? null));
|
|
@@ -17329,7 +17620,8 @@ function WorkflowEditor() {
|
|
|
17329
17620
|
client,
|
|
17330
17621
|
queryClient,
|
|
17331
17622
|
model,
|
|
17332
|
-
workflowId
|
|
17623
|
+
workflowId,
|
|
17624
|
+
modules
|
|
17333
17625
|
]);
|
|
17334
17626
|
return /* @__PURE__ */ jsx(DesignTimeProvider, {
|
|
17335
17627
|
service: designTime,
|
|
@@ -17362,4 +17654,4 @@ function Editor() {
|
|
|
17362
17654
|
//#endregion
|
|
17363
17655
|
export { Editor as default };
|
|
17364
17656
|
|
|
17365
|
-
//# sourceMappingURL=editor-
|
|
17657
|
+
//# sourceMappingURL=editor-NUaiiO4B.mjs.map
|