@powerhousedao/workflow 6.2.3-dev.44 → 6.2.3-dev.45
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-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/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,10 +1,10 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { Rt as blockKey, zt as compareVersions } from "./module-
|
|
1
|
+
import { $ as isCoreBlock, A as keepPreviousData, B as Subscribable, C as infiniteQueryBehavior, D as focusManager, E as pendingThenable, F as resolveStaleTime, G as BRANCH_BLOCK, H as createRuntimeClient, I as shallowEqualObjects, L as shouldThrowError, M as replaceData, N as replaceEqualDeep, O as isServer, P as resolveEnabled, Q as WEBHOOK_TRIGGER, R as timeUntilStale, S as hasPreviousPage, T as notifyManager, U as isSyncingError, W as ASSERT_BLOCK, Y as SCHEDULE_TRIGGER, _ as runtimeKeys, a as pieceActionsQuery, b as QueryClient, c as runQuery, d as secretStatQuery, et as pinBlock, g as queryKind, gt as scheduleConfigIssue, h as blockRefKey, j as noop, k as isValidTimeout, lt as checkTriggerStrategy, m as SHARED_STALE_MS, n as catalogQuery, nt as stepBlock, o as pieceTriggersQuery, p as RESOLVER_STALE_MS, q as MANUAL_TRIGGER, r as createRuntimeQueryClient, s as runPagesQuery, u as runsQuery, w as fetchState, x as hasNextPage, z as timeoutManager } from "./runtime-queries-BM6I7dDA.mjs";
|
|
2
|
+
import { Rt as blockKey, zt as compareVersions } from "./module-BsqRZox1.mjs";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { Component, Fragment, createContext, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { DEFAULT_SWITCHBOARD_URL, parseDriveUrl, subgraphUrlFromGraphqlUrl, useDefaultDrivesUrl, useSelectedDriveSafe, useSyncList } from "@powerhousedao/reactor-browser";
|
|
7
|
-
import
|
|
7
|
+
import "@powerhousedao/shared/document-model";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
//#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
10
10
|
var QueryObserver = class extends Subscribable {
|
|
@@ -5307,54 +5307,6 @@ function parseParameter(param) {
|
|
|
5307
5307
|
return parseValueExpression(param);
|
|
5308
5308
|
}
|
|
5309
5309
|
//#endregion
|
|
5310
|
-
//#region ../reactor/dist/forwarding-logger-BKDP4JnD.js
|
|
5311
|
-
const DRIVE_COLLECTION_PREFIX = "drive.";
|
|
5312
|
-
/**
|
|
5313
|
-
* Identifies the collection a remote synchronizes. Collections are drive-level
|
|
5314
|
-
* abstractions (document-drive and reactor-drive), so a collection id is the
|
|
5315
|
-
* drive document id plus the branch it scopes to rather than an opaque string.
|
|
5316
|
-
*
|
|
5317
|
-
* The canonical string form (`drive.${branch}.${driveId}`) is produced only by
|
|
5318
|
-
* `key` and parsed only by `fromKey`; that string is the wire and storage
|
|
5319
|
-
* representation and is byte-for-byte identical to the legacy
|
|
5320
|
-
* `driveCollectionId(branch, driveId)` output, so existing `document_collections`
|
|
5321
|
-
* rows and persisted remotes remain valid without migration.
|
|
5322
|
-
*/
|
|
5323
|
-
var DriveCollectionId = class DriveCollectionId {
|
|
5324
|
-
driveId;
|
|
5325
|
-
branch;
|
|
5326
|
-
constructor(driveId, branch) {
|
|
5327
|
-
this.driveId = driveId;
|
|
5328
|
-
this.branch = branch;
|
|
5329
|
-
}
|
|
5330
|
-
static forDrive(driveId, branch = "main") {
|
|
5331
|
-
return new DriveCollectionId(driveId, branch);
|
|
5332
|
-
}
|
|
5333
|
-
/**
|
|
5334
|
-
* The single deserializer for the wire/storage form. `branch` may contain
|
|
5335
|
-
* dots, while `driveId` is a dot-free document id, so the drive id is the
|
|
5336
|
-
* final dot-delimited segment.
|
|
5337
|
-
*/
|
|
5338
|
-
static fromKey(key) {
|
|
5339
|
-
if (!key.startsWith(DRIVE_COLLECTION_PREFIX)) throw new Error(`Unsupported collection id: ${key}`);
|
|
5340
|
-
const rest = key.slice(6);
|
|
5341
|
-
const lastDot = rest.lastIndexOf(".");
|
|
5342
|
-
if (lastDot === -1 || lastDot === rest.length - 1) throw new Error(`Malformed drive collection id: ${key}`);
|
|
5343
|
-
return new DriveCollectionId(rest.slice(lastDot + 1), rest.slice(0, lastDot));
|
|
5344
|
-
}
|
|
5345
|
-
get key() {
|
|
5346
|
-
return `${DRIVE_COLLECTION_PREFIX}${this.branch}.${this.driveId}`;
|
|
5347
|
-
}
|
|
5348
|
-
toString() {
|
|
5349
|
-
return this.key;
|
|
5350
|
-
}
|
|
5351
|
-
equals(other) {
|
|
5352
|
-
return this.driveId === other.driveId && this.branch === other.branch;
|
|
5353
|
-
}
|
|
5354
|
-
};
|
|
5355
|
-
new Set([...DOCUMENT_SCOPE_ACTION_TYPES].filter((type) => type !== "CREATE_DOCUMENT"));
|
|
5356
|
-
sql`action->>'type' = 'DELETE_DOCUMENT' and coalesce(error, '') = '' and coalesce("deniedReason", '') = ''`;
|
|
5357
|
-
//#endregion
|
|
5358
5310
|
//#region editors/shared/DocumentErrorBoundary.tsx
|
|
5359
5311
|
/** Best-effort message for anything thrown, without stringifying an object. */
|
|
5360
5312
|
function errorMessage(error) {
|
|
@@ -5976,7 +5928,7 @@ function persistRuntimeQueries(queryClient, url, store, now = Date.now) {
|
|
|
5976
5928
|
queryKey,
|
|
5977
5929
|
data: state.data,
|
|
5978
5930
|
updatedAt: state.dataUpdatedAt,
|
|
5979
|
-
version:
|
|
5931
|
+
version: 2
|
|
5980
5932
|
}).catch(() => void 0);
|
|
5981
5933
|
})
|
|
5982
5934
|
};
|
|
@@ -5989,7 +5941,7 @@ async function hydrate(queryClient, url, store, at) {
|
|
|
5989
5941
|
return;
|
|
5990
5942
|
}
|
|
5991
5943
|
for (const entry of entries) {
|
|
5992
|
-
if (entry.version !==
|
|
5944
|
+
if (entry.version !== 2 || at - entry.updatedAt > 6048e5 || !shouldPersistQuery(entry.queryKey)) {
|
|
5993
5945
|
store.remove(entry.id).catch(() => void 0);
|
|
5994
5946
|
continue;
|
|
5995
5947
|
}
|
|
@@ -6046,6 +5998,53 @@ function usePieceSource() {
|
|
|
6046
5998
|
return useContext(PieceSourceContext);
|
|
6047
5999
|
}
|
|
6048
6000
|
//#endregion
|
|
6001
|
+
//#region ../reactor/dist/drive-container-types-CifLQjd3.js
|
|
6002
|
+
const DRIVE_COLLECTION_PREFIX = "drive.";
|
|
6003
|
+
/**
|
|
6004
|
+
* Identifies the collection a remote synchronizes. Collections are drive-level
|
|
6005
|
+
* abstractions (document-drive and reactor-drive), so a collection id is the
|
|
6006
|
+
* drive document id plus the branch it scopes to rather than an opaque string.
|
|
6007
|
+
*
|
|
6008
|
+
* The canonical string form (`drive.${branch}.${driveId}`) is produced only by
|
|
6009
|
+
* `key` and parsed only by `fromKey`; that string is the wire and storage
|
|
6010
|
+
* representation and is byte-for-byte identical to the legacy
|
|
6011
|
+
* `driveCollectionId(branch, driveId)` output, so existing `document_collections`
|
|
6012
|
+
* rows and persisted remotes remain valid without migration.
|
|
6013
|
+
*/
|
|
6014
|
+
var DriveCollectionId = class DriveCollectionId {
|
|
6015
|
+
driveId;
|
|
6016
|
+
branch;
|
|
6017
|
+
constructor(driveId, branch) {
|
|
6018
|
+
this.driveId = driveId;
|
|
6019
|
+
this.branch = branch;
|
|
6020
|
+
}
|
|
6021
|
+
static forDrive(driveId, branch = "main") {
|
|
6022
|
+
return new DriveCollectionId(driveId, branch);
|
|
6023
|
+
}
|
|
6024
|
+
/**
|
|
6025
|
+
* The single deserializer for the wire/storage form. `branch` may contain
|
|
6026
|
+
* dots, while `driveId` is a dot-free document id, so the drive id is the
|
|
6027
|
+
* final dot-delimited segment.
|
|
6028
|
+
*/
|
|
6029
|
+
static fromKey(key) {
|
|
6030
|
+
if (!key.startsWith(DRIVE_COLLECTION_PREFIX)) throw new Error(`Unsupported collection id: ${key}`);
|
|
6031
|
+
const rest = key.slice(6);
|
|
6032
|
+
const lastDot = rest.lastIndexOf(".");
|
|
6033
|
+
if (lastDot === -1 || lastDot === rest.length - 1) throw new Error(`Malformed drive collection id: ${key}`);
|
|
6034
|
+
return new DriveCollectionId(rest.slice(lastDot + 1), rest.slice(0, lastDot));
|
|
6035
|
+
}
|
|
6036
|
+
get key() {
|
|
6037
|
+
return `${DRIVE_COLLECTION_PREFIX}${this.branch}.${this.driveId}`;
|
|
6038
|
+
}
|
|
6039
|
+
toString() {
|
|
6040
|
+
return this.key;
|
|
6041
|
+
}
|
|
6042
|
+
equals(other) {
|
|
6043
|
+
return this.driveId === other.driveId && this.branch === other.branch;
|
|
6044
|
+
}
|
|
6045
|
+
};
|
|
6046
|
+
sql`action->>'type' = 'DELETE_DOCUMENT' and coalesce(error, '') = '' and coalesce("deniedReason", '') = ''`;
|
|
6047
|
+
//#endregion
|
|
6049
6048
|
//#region editors/workflow-editor/use-runtime-url.ts
|
|
6050
6049
|
const SUBGRAPH_NAME = "workflow-runtime";
|
|
6051
6050
|
function baseFromChannelUrl(channelUrl) {
|
|
@@ -6221,362 +6220,62 @@ function useRuntimeActions() {
|
|
|
6221
6220
|
}, [client, queryClient]);
|
|
6222
6221
|
}
|
|
6223
6222
|
//#endregion
|
|
6224
|
-
//#region editors/workflow-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
"
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
const TONE_TEXT = {
|
|
6231
|
-
ok: "text-wf-ok",
|
|
6232
|
-
fail: "text-wf-fail",
|
|
6233
|
-
warn: "text-wf-warn",
|
|
6234
|
-
run: "text-wf-run",
|
|
6235
|
-
idle: "text-muted-foreground"
|
|
6236
|
-
};
|
|
6237
|
-
const TONE_DOT = {
|
|
6238
|
-
ok: "bg-wf-ok",
|
|
6239
|
-
fail: "bg-wf-fail",
|
|
6240
|
-
warn: "bg-wf-warn",
|
|
6241
|
-
run: "bg-wf-run",
|
|
6242
|
-
idle: "bg-muted-foreground/40"
|
|
6243
|
-
};
|
|
6244
|
-
const RUN_TONE = {
|
|
6245
|
-
SUCCEEDED: "ok",
|
|
6246
|
-
FAILED: "fail",
|
|
6247
|
-
RUNNING: "run",
|
|
6248
|
-
WAITING: "run",
|
|
6249
|
-
PENDING: "idle",
|
|
6250
|
-
PARKED: "warn",
|
|
6251
|
-
CANCELLED: "idle"
|
|
6252
|
-
};
|
|
6253
|
-
const STEP_TONE = {
|
|
6254
|
-
...RUN_TONE,
|
|
6255
|
-
SKIPPED: "idle",
|
|
6256
|
-
REPLAYED: "run"
|
|
6257
|
-
};
|
|
6258
|
-
function runTone(run) {
|
|
6259
|
-
if (run.status === "SUCCEEDED" && (run.warningNotes?.length ?? 0) > 0) return "warn";
|
|
6260
|
-
return toneOf(RUN_TONE, run.status);
|
|
6261
|
-
}
|
|
6262
|
-
function runStatusLabel(run) {
|
|
6263
|
-
const count = run.warningNotes?.length ?? 0;
|
|
6264
|
-
const label = statusLabel(run.status);
|
|
6265
|
-
if (run.status !== "SUCCEEDED" || count === 0) return label;
|
|
6266
|
-
return `${label}, ${count} ${count === 1 ? "warning" : "warnings"}`;
|
|
6267
|
-
}
|
|
6268
|
-
function workflowHealth(status, lastRunStatus, published) {
|
|
6269
|
-
if (!published) return {
|
|
6270
|
-
tone: "idle",
|
|
6271
|
-
hollow: true,
|
|
6272
|
-
label: "Not published yet"
|
|
6273
|
-
};
|
|
6274
|
-
const label = (status === "ENABLED" ? "" : `${statusLabel(status ?? "DISABLED")}, `) + (lastRunStatus ? `last run ${statusLabel(lastRunStatus).toLowerCase()}` : "not run yet");
|
|
6275
|
-
return {
|
|
6276
|
-
tone: toneOf(RUN_TONE, lastRunStatus),
|
|
6277
|
-
hollow: false,
|
|
6278
|
-
label: label.charAt(0).toUpperCase() + label.slice(1)
|
|
6279
|
-
};
|
|
6280
|
-
}
|
|
6281
|
-
const CONNECTION_TONE = {
|
|
6282
|
-
OK: "ok",
|
|
6283
|
-
ERROR: "fail",
|
|
6284
|
-
REVOKED: "fail",
|
|
6285
|
-
UNCONFIGURED: "warn"
|
|
6286
|
-
};
|
|
6287
|
-
function toneOf(map, status) {
|
|
6288
|
-
return (status ? map[status] : void 0) ?? "idle";
|
|
6223
|
+
//#region editors/workflow-editor/ui/validation.ts
|
|
6224
|
+
function isEmptyValue(value) {
|
|
6225
|
+
if (value === void 0 || value === null) return true;
|
|
6226
|
+
if (typeof value === "string") return value.trim() === "";
|
|
6227
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
6228
|
+
return false;
|
|
6289
6229
|
}
|
|
6290
|
-
function
|
|
6291
|
-
|
|
6230
|
+
function isPropVisible(prop, config) {
|
|
6231
|
+
const rule = prop.showWhen;
|
|
6232
|
+
if (!rule) return true;
|
|
6233
|
+
return rule.oneOf.includes(config[rule.prop] ?? void 0);
|
|
6292
6234
|
}
|
|
6293
|
-
function
|
|
6294
|
-
|
|
6295
|
-
return formatMs(new Date(endedAt).getTime() - new Date(startedAt).getTime());
|
|
6235
|
+
function asRecord(config) {
|
|
6236
|
+
return config !== null && typeof config === "object" && !Array.isArray(config) ? config : {};
|
|
6296
6237
|
}
|
|
6297
|
-
function
|
|
6298
|
-
const
|
|
6299
|
-
|
|
6300
|
-
const total = Math.max(...ends) - start;
|
|
6301
|
-
const spans = /* @__PURE__ */ new Map();
|
|
6302
|
-
if (total <= 0) return spans;
|
|
6303
|
-
for (const step of run.steps) {
|
|
6304
|
-
if (!step.startedAt || !step.endedAt) continue;
|
|
6305
|
-
const from = new Date(step.startedAt).getTime() - start;
|
|
6306
|
-
const ms = new Date(step.endedAt).getTime() - new Date(step.startedAt).getTime();
|
|
6307
|
-
spans.set(step.stepId, {
|
|
6308
|
-
offset: Math.min(Math.max(from / total, 0), 1),
|
|
6309
|
-
width: Math.min(Math.max(ms / total, 0), 1),
|
|
6310
|
-
ms
|
|
6311
|
-
});
|
|
6312
|
-
}
|
|
6313
|
-
return spans;
|
|
6238
|
+
function missingRequired(props, config) {
|
|
6239
|
+
const record = asRecord(config);
|
|
6240
|
+
return props.filter((prop) => prop.required && prop.type !== "MARKDOWN" && isPropVisible(prop, record) && isEmptyValue(record[prop.name])).map((prop) => prop.displayName);
|
|
6314
6241
|
}
|
|
6315
|
-
function
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6242
|
+
function resolverInputFor(block, prop, config, connectionId, reactorConnectionId) {
|
|
6243
|
+
const refreshers = (prop.refreshers ?? []).filter((name) => name !== "auth");
|
|
6244
|
+
return {
|
|
6245
|
+
block,
|
|
6246
|
+
propName: prop.name,
|
|
6247
|
+
refreshers: refreshers.map((name) => config[name] ?? null),
|
|
6248
|
+
connectionId: connectionId ?? null,
|
|
6249
|
+
...reactorConnectionId ? { reactorConnectionId } : {}
|
|
6250
|
+
};
|
|
6321
6251
|
}
|
|
6322
|
-
function
|
|
6323
|
-
|
|
6324
|
-
return new Date(endedAt).getTime() - new Date(startedAt).getTime();
|
|
6252
|
+
function settingFor(settings, prop) {
|
|
6253
|
+
return settings?.find((setting) => setting.prop === prop);
|
|
6325
6254
|
}
|
|
6326
|
-
function
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
if (diff < 36e5) return `${Math.floor(diff / 6e4)}m ago`;
|
|
6330
|
-
if (diff < 864e5) return `${Math.floor(diff / 36e5)}h ago`;
|
|
6331
|
-
return new Date(startedAt).toLocaleDateString();
|
|
6255
|
+
function parsePropList(result) {
|
|
6256
|
+
if (!Array.isArray(result)) throw new Error("Unexpected properties result");
|
|
6257
|
+
return result.filter((entry) => entry !== null && typeof entry === "object" && typeof entry.name === "string");
|
|
6332
6258
|
}
|
|
6333
|
-
function
|
|
6334
|
-
|
|
6259
|
+
function storedSchema(settings, prop) {
|
|
6260
|
+
const schema = settingFor(settings, prop)?.schema;
|
|
6261
|
+
if (!Array.isArray(schema)) return void 0;
|
|
6262
|
+
return schema.filter((entry) => entry !== null && typeof entry === "object" && typeof entry.name === "string");
|
|
6335
6263
|
}
|
|
6336
|
-
function
|
|
6337
|
-
return
|
|
6264
|
+
function stripOptions(props) {
|
|
6265
|
+
return props.map((prop) => {
|
|
6266
|
+
const { staticOptions: _options, properties, ...rest } = prop;
|
|
6267
|
+
return properties ? {
|
|
6268
|
+
...rest,
|
|
6269
|
+
properties: stripOptions(properties)
|
|
6270
|
+
} : rest;
|
|
6271
|
+
});
|
|
6338
6272
|
}
|
|
6339
|
-
function
|
|
6340
|
-
const
|
|
6341
|
-
const
|
|
6342
|
-
const
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
succeeded,
|
|
6346
|
-
failed,
|
|
6347
|
-
running: runs.filter((run) => run.status === "RUNNING").length,
|
|
6348
|
-
lastRun: runs[0],
|
|
6349
|
-
successRate: finished === 0 ? null : Math.round(succeeded / finished * 100)
|
|
6350
|
-
};
|
|
6351
|
-
}
|
|
6352
|
-
//#endregion
|
|
6353
|
-
//#region editors/workflow-editor/ui/block-meta.ts
|
|
6354
|
-
const CORE_META = {
|
|
6355
|
-
[blockKey(MANUAL_TRIGGER)]: {
|
|
6356
|
-
displayName: "Manual",
|
|
6357
|
-
subtitle: "Trigger",
|
|
6358
|
-
glyph: "▶"
|
|
6359
|
-
},
|
|
6360
|
-
[blockKey(SCHEDULE_TRIGGER)]: {
|
|
6361
|
-
displayName: "Schedule",
|
|
6362
|
-
subtitle: "Trigger",
|
|
6363
|
-
glyph: "◷"
|
|
6364
|
-
},
|
|
6365
|
-
[blockKey(WEBHOOK_TRIGGER)]: {
|
|
6366
|
-
displayName: "Webhook",
|
|
6367
|
-
subtitle: "Trigger",
|
|
6368
|
-
glyph: "⇲"
|
|
6369
|
-
},
|
|
6370
|
-
[blockKey(BRANCH_BLOCK)]: {
|
|
6371
|
-
displayName: "Branch",
|
|
6372
|
-
subtitle: "Core",
|
|
6373
|
-
glyph: "⑂"
|
|
6374
|
-
},
|
|
6375
|
-
[blockKey(ASSERT_BLOCK)]: {
|
|
6376
|
-
displayName: "Assert",
|
|
6377
|
-
subtitle: "Core",
|
|
6378
|
-
glyph: "!"
|
|
6379
|
-
}
|
|
6380
|
-
};
|
|
6381
|
-
function shortPieceName(packageName) {
|
|
6382
|
-
return packageName.split("/").pop()?.replace(/^piece-/, "") ?? "";
|
|
6383
|
-
}
|
|
6384
|
-
const pieceLogos = /* @__PURE__ */ new Map();
|
|
6385
|
-
const pieceNames = /* @__PURE__ */ new Map();
|
|
6386
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
6387
|
-
let logoRevision = 0;
|
|
6388
|
-
function registerPieceLogos(entries) {
|
|
6389
|
-
let changed = false;
|
|
6390
|
-
for (const entry of entries) {
|
|
6391
|
-
if (!entry.name) continue;
|
|
6392
|
-
if (entry.displayName && pieceNames.get(entry.name) !== entry.displayName) {
|
|
6393
|
-
pieceNames.set(entry.name, entry.displayName);
|
|
6394
|
-
changed = true;
|
|
6395
|
-
}
|
|
6396
|
-
if (!entry.logoUrl || pieceLogos.get(entry.name) === entry.logoUrl) continue;
|
|
6397
|
-
pieceLogos.set(entry.name, entry.logoUrl);
|
|
6398
|
-
changed = true;
|
|
6399
|
-
}
|
|
6400
|
-
if (!changed) return;
|
|
6401
|
-
logoRevision += 1;
|
|
6402
|
-
for (const listener of listeners) listener();
|
|
6403
|
-
}
|
|
6404
|
-
function pieceLogo(packageName) {
|
|
6405
|
-
return pieceLogos.get(packageName);
|
|
6406
|
-
}
|
|
6407
|
-
function pieceDisplayName(packageName) {
|
|
6408
|
-
return pieceNames.get(packageName);
|
|
6409
|
-
}
|
|
6410
|
-
const blockNames = /* @__PURE__ */ new Map();
|
|
6411
|
-
const namesRequested = /* @__PURE__ */ new Set();
|
|
6412
|
-
const namesPending = /* @__PURE__ */ new Set();
|
|
6413
|
-
function registerBlockNames(entries) {
|
|
6414
|
-
let changed = false;
|
|
6415
|
-
for (const entry of entries) {
|
|
6416
|
-
const key = blockKey(entry);
|
|
6417
|
-
if (!entry.displayName || blockNames.get(key) === entry.displayName) continue;
|
|
6418
|
-
blockNames.set(key, entry.displayName);
|
|
6419
|
-
changed = true;
|
|
6420
|
-
}
|
|
6421
|
-
if (!changed) return;
|
|
6422
|
-
logoRevision += 1;
|
|
6423
|
-
for (const listener of listeners) listener();
|
|
6424
|
-
}
|
|
6425
|
-
function requestBlockNames(packageName) {
|
|
6426
|
-
if (!namesRequested.has(packageName)) namesPending.add(packageName);
|
|
6427
|
-
}
|
|
6428
|
-
function loadPendingBlockNames(source) {
|
|
6429
|
-
for (const packageName of namesPending) loadBlockNames(source, packageName);
|
|
6430
|
-
namesPending.clear();
|
|
6431
|
-
}
|
|
6432
|
-
function loadBlockNames(source, packageName) {
|
|
6433
|
-
if (namesRequested.has(packageName)) return;
|
|
6434
|
-
namesRequested.add(packageName);
|
|
6435
|
-
Promise.all([source.loadActions(packageName), source.loadTriggers(packageName)]).then(([actions, triggers]) => registerBlockNames([...actions.map((entry) => ({
|
|
6436
|
-
...entry,
|
|
6437
|
-
kind: "action"
|
|
6438
|
-
})), ...triggers.map((entry) => ({
|
|
6439
|
-
...entry,
|
|
6440
|
-
kind: "trigger"
|
|
6441
|
-
}))])).catch(() => namesRequested.delete(packageName));
|
|
6442
|
-
}
|
|
6443
|
-
function subscribePieceLogos(listener) {
|
|
6444
|
-
listeners.add(listener);
|
|
6445
|
-
return () => listeners.delete(listener);
|
|
6446
|
-
}
|
|
6447
|
-
function pieceLogoRevision() {
|
|
6448
|
-
return logoRevision;
|
|
6449
|
-
}
|
|
6450
|
-
const logoMisses = /* @__PURE__ */ new Set();
|
|
6451
|
-
let catalogLoads = /* @__PURE__ */ new WeakMap();
|
|
6452
|
-
const retryTimers = /* @__PURE__ */ new Set();
|
|
6453
|
-
const CATALOG_RETRY_MS = 2e3;
|
|
6454
|
-
function notify() {
|
|
6455
|
-
logoRevision += 1;
|
|
6456
|
-
for (const listener of listeners) listener();
|
|
6457
|
-
}
|
|
6458
|
-
function scheduleRetry(state) {
|
|
6459
|
-
if (state.attempts >= 5) return;
|
|
6460
|
-
const timer = setTimeout(() => {
|
|
6461
|
-
retryTimers.delete(timer);
|
|
6462
|
-
state.load = void 0;
|
|
6463
|
-
notify();
|
|
6464
|
-
}, CATALOG_RETRY_MS * 2 ** (state.attempts - 1));
|
|
6465
|
-
retryTimers.add(timer);
|
|
6466
|
-
}
|
|
6467
|
-
function ensurePieceLogos(source) {
|
|
6468
|
-
if (!source) return Promise.resolve();
|
|
6469
|
-
let state = catalogLoads.get(source);
|
|
6470
|
-
if (!state) {
|
|
6471
|
-
state = { attempts: 0 };
|
|
6472
|
-
catalogLoads.set(source, state);
|
|
6473
|
-
}
|
|
6474
|
-
if (state.load) return state.load;
|
|
6475
|
-
const current = state;
|
|
6476
|
-
const request = current.attempts > 0 && source.reloadCatalog ? source.reloadCatalog() : source.loadCatalog();
|
|
6477
|
-
current.attempts += 1;
|
|
6478
|
-
current.load = request.then((pieces) => {
|
|
6479
|
-
registerPieceLogos(pieces);
|
|
6480
|
-
const listed = new Set(pieces.map((piece) => piece.name));
|
|
6481
|
-
if ([...logoMisses].some((name) => !listed.has(name) && !pieceLogos.has(name))) scheduleRetry(current);
|
|
6482
|
-
}, () => scheduleRetry(current));
|
|
6483
|
-
return current.load;
|
|
6484
|
-
}
|
|
6485
|
-
function blockMeta(block) {
|
|
6486
|
-
const key = blockKey(block);
|
|
6487
|
-
const core = CORE_META[key];
|
|
6488
|
-
if (core) return core;
|
|
6489
|
-
if (isCoreBlock(block)) return {
|
|
6490
|
-
displayName: titleCase(block.name),
|
|
6491
|
-
subtitle: "Core",
|
|
6492
|
-
glyph: "?"
|
|
6493
|
-
};
|
|
6494
|
-
const packageName = block.pieceName;
|
|
6495
|
-
const short = shortPieceName(packageName);
|
|
6496
|
-
const pieceLabel = pieceNames.get(packageName) ?? titleCase(short);
|
|
6497
|
-
const known = blockNames.get(key);
|
|
6498
|
-
if (!known) requestBlockNames(packageName);
|
|
6499
|
-
const logoUrl = pieceLogo(packageName);
|
|
6500
|
-
if (!logoUrl) logoMisses.add(packageName);
|
|
6501
|
-
return {
|
|
6502
|
-
displayName: known ?? titleCase(block.name),
|
|
6503
|
-
subtitle: block.kind === "trigger" ? `${pieceLabel} · Trigger` : pieceLabel,
|
|
6504
|
-
logoUrl,
|
|
6505
|
-
glyph: short.slice(0, 1).toUpperCase() || "?"
|
|
6506
|
-
};
|
|
6507
|
-
}
|
|
6508
|
-
function titleCase(value) {
|
|
6509
|
-
return value.replaceAll(/[-_]/g, " ").replace(/^\w/, (char) => char.toUpperCase());
|
|
6510
|
-
}
|
|
6511
|
-
function usePieceLogos() {
|
|
6512
|
-
const source = usePieceSource();
|
|
6513
|
-
const revision = useSyncExternalStore(subscribePieceLogos, pieceLogoRevision, pieceLogoRevision);
|
|
6514
|
-
useEffect(() => {
|
|
6515
|
-
ensurePieceLogos(source);
|
|
6516
|
-
if (source && namesPending.size > 0) loadPendingBlockNames(source);
|
|
6517
|
-
});
|
|
6518
|
-
return revision;
|
|
6519
|
-
}
|
|
6520
|
-
function useBlockMeta(block) {
|
|
6521
|
-
usePieceLogos();
|
|
6522
|
-
return blockMeta(block);
|
|
6523
|
-
}
|
|
6524
|
-
//#endregion
|
|
6525
|
-
//#region editors/workflow-editor/ui/validation.ts
|
|
6526
|
-
function isEmptyValue(value) {
|
|
6527
|
-
if (value === void 0 || value === null) return true;
|
|
6528
|
-
if (typeof value === "string") return value.trim() === "";
|
|
6529
|
-
if (Array.isArray(value)) return value.length === 0;
|
|
6530
|
-
return false;
|
|
6531
|
-
}
|
|
6532
|
-
function isPropVisible(prop, config) {
|
|
6533
|
-
const rule = prop.showWhen;
|
|
6534
|
-
if (!rule) return true;
|
|
6535
|
-
return rule.oneOf.includes(config[rule.prop] ?? void 0);
|
|
6536
|
-
}
|
|
6537
|
-
function asRecord(config) {
|
|
6538
|
-
return config !== null && typeof config === "object" && !Array.isArray(config) ? config : {};
|
|
6539
|
-
}
|
|
6540
|
-
function missingRequired(props, config) {
|
|
6541
|
-
const record = asRecord(config);
|
|
6542
|
-
return props.filter((prop) => prop.required && prop.type !== "MARKDOWN" && isPropVisible(prop, record) && isEmptyValue(record[prop.name])).map((prop) => prop.displayName);
|
|
6543
|
-
}
|
|
6544
|
-
function resolverInputFor(block, prop, config, connectionId) {
|
|
6545
|
-
const refreshers = (prop.refreshers ?? []).filter((name) => name !== "auth");
|
|
6546
|
-
return {
|
|
6547
|
-
block,
|
|
6548
|
-
propName: prop.name,
|
|
6549
|
-
refreshers: refreshers.map((name) => config[name] ?? null),
|
|
6550
|
-
connectionId: connectionId ?? null
|
|
6551
|
-
};
|
|
6552
|
-
}
|
|
6553
|
-
function settingFor(settings, prop) {
|
|
6554
|
-
return settings?.find((setting) => setting.prop === prop);
|
|
6555
|
-
}
|
|
6556
|
-
function parsePropList(result) {
|
|
6557
|
-
if (!Array.isArray(result)) throw new Error("Unexpected properties result");
|
|
6558
|
-
return result.filter((entry) => entry !== null && typeof entry === "object" && typeof entry.name === "string");
|
|
6559
|
-
}
|
|
6560
|
-
function storedSchema(settings, prop) {
|
|
6561
|
-
const schema = settingFor(settings, prop)?.schema;
|
|
6562
|
-
if (!Array.isArray(schema)) return void 0;
|
|
6563
|
-
return schema.filter((entry) => entry !== null && typeof entry === "object" && typeof entry.name === "string");
|
|
6564
|
-
}
|
|
6565
|
-
function stripOptions(props) {
|
|
6566
|
-
return props.map((prop) => {
|
|
6567
|
-
const { staticOptions: _options, properties, ...rest } = prop;
|
|
6568
|
-
return properties ? {
|
|
6569
|
-
...rest,
|
|
6570
|
-
properties: stripOptions(properties)
|
|
6571
|
-
} : rest;
|
|
6572
|
-
});
|
|
6573
|
-
}
|
|
6574
|
-
function withSetting(settings, prop, patch) {
|
|
6575
|
-
const list = [...settings ?? []];
|
|
6576
|
-
const index = list.findIndex((setting) => setting.prop === prop);
|
|
6577
|
-
const current = index >= 0 ? list[index] : {
|
|
6578
|
-
prop,
|
|
6579
|
-
mode: "MANUAL"
|
|
6273
|
+
function withSetting(settings, prop, patch) {
|
|
6274
|
+
const list = [...settings ?? []];
|
|
6275
|
+
const index = list.findIndex((setting) => setting.prop === prop);
|
|
6276
|
+
const current = index >= 0 ? list[index] : {
|
|
6277
|
+
prop,
|
|
6278
|
+
mode: "MANUAL"
|
|
6580
6279
|
};
|
|
6581
6280
|
const next = {
|
|
6582
6281
|
prop,
|
|
@@ -6587,6 +6286,7 @@ function withSetting(settings, prop, patch) {
|
|
|
6587
6286
|
else list.push(next);
|
|
6588
6287
|
return list;
|
|
6589
6288
|
}
|
|
6289
|
+
const REACTOR_CONNECTION_LABEL = "Reactor connection";
|
|
6590
6290
|
function blockMissing(input) {
|
|
6591
6291
|
if (input.skip) return [];
|
|
6592
6292
|
const { form } = input;
|
|
@@ -6595,6 +6295,7 @@ function blockMissing(input) {
|
|
|
6595
6295
|
const missing = [];
|
|
6596
6296
|
let unknown = false;
|
|
6597
6297
|
if (form.auth === "required" && !input.connectionId) missing.push("Connection");
|
|
6298
|
+
if (form.requireReactor && !input.reactorConnectionId) missing.push(REACTOR_CONNECTION_LABEL);
|
|
6598
6299
|
for (const prop of form.props) {
|
|
6599
6300
|
if (prop.type === "MARKDOWN" || !isPropVisible(prop, record)) continue;
|
|
6600
6301
|
const value = record[prop.name];
|
|
@@ -6603,7 +6304,7 @@ function blockMissing(input) {
|
|
|
6603
6304
|
if (prop.required && isEmptyValue(value)) missing.push(prop.displayName);
|
|
6604
6305
|
continue;
|
|
6605
6306
|
}
|
|
6606
|
-
const children = input.resolveDynamic?.(resolverInputFor(input.block, prop, record, input.connectionId)) ?? storedSchema(input.propertySettings, prop.name);
|
|
6307
|
+
const children = input.resolveDynamic?.(resolverInputFor(input.block, prop, record, input.connectionId, input.reactorConnectionId)) ?? storedSchema(input.propertySettings, prop.name);
|
|
6607
6308
|
if (children === void 0) {
|
|
6608
6309
|
unknown = true;
|
|
6609
6310
|
continue;
|
|
@@ -6748,6 +6449,15 @@ function keyHash(value) {
|
|
|
6748
6449
|
return String(value);
|
|
6749
6450
|
}
|
|
6750
6451
|
}
|
|
6452
|
+
const SYNC_REFUSAL = /forbidden|document\b.*not found|was not found/i;
|
|
6453
|
+
const SYNC_RETRIES_MAX = 4;
|
|
6454
|
+
function retryWhileSyncing(input) {
|
|
6455
|
+
if (!input.reactorConnectionId) return {};
|
|
6456
|
+
return {
|
|
6457
|
+
retry: (failures, error) => failures < SYNC_RETRIES_MAX && SYNC_REFUSAL.test(messageOf(error)),
|
|
6458
|
+
retryDelay: 1e3
|
|
6459
|
+
};
|
|
6460
|
+
}
|
|
6751
6461
|
function useSettled(value, ms) {
|
|
6752
6462
|
const hash = keyHash(value);
|
|
6753
6463
|
const latest = useRef(value);
|
|
@@ -6788,34 +6498,41 @@ function useResolvedProp(options) {
|
|
|
6788
6498
|
return current.parse(await current.load());
|
|
6789
6499
|
},
|
|
6790
6500
|
enabled,
|
|
6791
|
-
staleTime: RESOLVER_STALE_MS
|
|
6501
|
+
staleTime: RESOLVER_STALE_MS,
|
|
6502
|
+
...retryWhileSyncing(input)
|
|
6792
6503
|
}, queryClient);
|
|
6793
6504
|
const reload = () => void query.refetch();
|
|
6505
|
+
const syncing = query.isFetching && query.failureCount > 0;
|
|
6794
6506
|
if (!enabled) return {
|
|
6795
6507
|
state: { kind: "idle" },
|
|
6796
|
-
reload
|
|
6508
|
+
reload,
|
|
6509
|
+
syncing: false
|
|
6797
6510
|
};
|
|
6798
6511
|
if (query.isFetching) return {
|
|
6799
6512
|
state: { kind: "loading" },
|
|
6800
|
-
reload
|
|
6513
|
+
reload,
|
|
6514
|
+
syncing
|
|
6801
6515
|
};
|
|
6802
6516
|
if (query.status === "error") return {
|
|
6803
6517
|
state: {
|
|
6804
6518
|
kind: "error",
|
|
6805
6519
|
message: messageOf(query.error)
|
|
6806
6520
|
},
|
|
6807
|
-
reload
|
|
6521
|
+
reload,
|
|
6522
|
+
syncing
|
|
6808
6523
|
};
|
|
6809
6524
|
if (query.status === "success") return {
|
|
6810
6525
|
state: {
|
|
6811
6526
|
kind: "ready",
|
|
6812
6527
|
result: query.data
|
|
6813
6528
|
},
|
|
6814
|
-
reload
|
|
6529
|
+
reload,
|
|
6530
|
+
syncing
|
|
6815
6531
|
};
|
|
6816
6532
|
return {
|
|
6817
6533
|
state: { kind: "loading" },
|
|
6818
|
-
reload
|
|
6534
|
+
reload,
|
|
6535
|
+
syncing
|
|
6819
6536
|
};
|
|
6820
6537
|
}
|
|
6821
6538
|
function useOptionSearch(options) {
|
|
@@ -6838,6 +6555,7 @@ function useOptionSearch(options) {
|
|
|
6838
6555
|
},
|
|
6839
6556
|
enabled: Boolean(options.load) && settled !== "" && typed !== "",
|
|
6840
6557
|
staleTime: RESOLVER_STALE_MS,
|
|
6558
|
+
...retryWhileSyncing(options.input),
|
|
6841
6559
|
placeholderData: keepPreviousData
|
|
6842
6560
|
}, queryClient);
|
|
6843
6561
|
return typed === "" ? null : query.data ?? null;
|
|
@@ -6851,8 +6569,9 @@ function useDynamicPrefetch() {
|
|
|
6851
6569
|
if (!service) return;
|
|
6852
6570
|
queryClient.prefetchQuery({
|
|
6853
6571
|
queryKey: runtimeKeys.dynamic(scope, input),
|
|
6854
|
-
queryFn: () => service.loadOptions(input.block, input.propName, config, input.connectionId ?? void 0).then(parsePropList),
|
|
6855
|
-
staleTime: RESOLVER_STALE_MS
|
|
6572
|
+
queryFn: () => service.loadOptions(input.block, input.propName, config, input.connectionId ?? void 0, void 0, input.reactorConnectionId ?? void 0).then(parsePropList),
|
|
6573
|
+
staleTime: RESOLVER_STALE_MS,
|
|
6574
|
+
...retryWhileSyncing(input)
|
|
6856
6575
|
});
|
|
6857
6576
|
}, [
|
|
6858
6577
|
service,
|
|
@@ -7000,6 +6719,307 @@ function useBlockResolutions(workflowId, blocks) {
|
|
|
7000
6719
|
}
|
|
7001
6720
|
const EMPTY_RESOLUTIONS = [];
|
|
7002
6721
|
//#endregion
|
|
6722
|
+
//#region editors/workflow-studio/components/run-format.ts
|
|
6723
|
+
const RUN_STATUSES = [
|
|
6724
|
+
"RUNNING",
|
|
6725
|
+
"SUCCEEDED",
|
|
6726
|
+
"FAILED"
|
|
6727
|
+
];
|
|
6728
|
+
const TONE_TEXT = {
|
|
6729
|
+
ok: "text-wf-ok",
|
|
6730
|
+
fail: "text-wf-fail",
|
|
6731
|
+
warn: "text-wf-warn",
|
|
6732
|
+
run: "text-wf-run",
|
|
6733
|
+
idle: "text-muted-foreground"
|
|
6734
|
+
};
|
|
6735
|
+
const TONE_DOT = {
|
|
6736
|
+
ok: "bg-wf-ok",
|
|
6737
|
+
fail: "bg-wf-fail",
|
|
6738
|
+
warn: "bg-wf-warn",
|
|
6739
|
+
run: "bg-wf-run",
|
|
6740
|
+
idle: "bg-muted-foreground/40"
|
|
6741
|
+
};
|
|
6742
|
+
const RUN_TONE = {
|
|
6743
|
+
SUCCEEDED: "ok",
|
|
6744
|
+
FAILED: "fail",
|
|
6745
|
+
RUNNING: "run",
|
|
6746
|
+
WAITING: "run",
|
|
6747
|
+
PENDING: "idle",
|
|
6748
|
+
PARKED: "warn",
|
|
6749
|
+
CANCELLED: "idle"
|
|
6750
|
+
};
|
|
6751
|
+
const STEP_TONE = {
|
|
6752
|
+
...RUN_TONE,
|
|
6753
|
+
SKIPPED: "idle",
|
|
6754
|
+
REPLAYED: "run"
|
|
6755
|
+
};
|
|
6756
|
+
function runTone(run) {
|
|
6757
|
+
if (run.status === "SUCCEEDED" && (run.warningNotes?.length ?? 0) > 0) return "warn";
|
|
6758
|
+
return toneOf(RUN_TONE, run.status);
|
|
6759
|
+
}
|
|
6760
|
+
function runStatusLabel(run) {
|
|
6761
|
+
const count = run.warningNotes?.length ?? 0;
|
|
6762
|
+
const label = statusLabel(run.status);
|
|
6763
|
+
if (run.status !== "SUCCEEDED" || count === 0) return label;
|
|
6764
|
+
return `${label}, ${count} ${count === 1 ? "warning" : "warnings"}`;
|
|
6765
|
+
}
|
|
6766
|
+
function workflowHealth(status, lastRunStatus, published) {
|
|
6767
|
+
if (!published) return {
|
|
6768
|
+
tone: "idle",
|
|
6769
|
+
hollow: true,
|
|
6770
|
+
label: "Not published yet"
|
|
6771
|
+
};
|
|
6772
|
+
const label = (status === "ENABLED" ? "" : `${statusLabel(status ?? "DISABLED")}, `) + (lastRunStatus ? `last run ${statusLabel(lastRunStatus).toLowerCase()}` : "not run yet");
|
|
6773
|
+
return {
|
|
6774
|
+
tone: toneOf(RUN_TONE, lastRunStatus),
|
|
6775
|
+
hollow: false,
|
|
6776
|
+
label: label.charAt(0).toUpperCase() + label.slice(1)
|
|
6777
|
+
};
|
|
6778
|
+
}
|
|
6779
|
+
const CONNECTION_TONE = {
|
|
6780
|
+
OK: "ok",
|
|
6781
|
+
ERROR: "fail",
|
|
6782
|
+
REVOKED: "fail",
|
|
6783
|
+
UNCONFIGURED: "warn"
|
|
6784
|
+
};
|
|
6785
|
+
function toneOf(map, status) {
|
|
6786
|
+
return (status ? map[status] : void 0) ?? "idle";
|
|
6787
|
+
}
|
|
6788
|
+
function statusLabel(status) {
|
|
6789
|
+
return status.charAt(0) + status.slice(1).toLowerCase();
|
|
6790
|
+
}
|
|
6791
|
+
function formatDuration(startedAt, endedAt) {
|
|
6792
|
+
if (!endedAt) return "…";
|
|
6793
|
+
return formatMs(new Date(endedAt).getTime() - new Date(startedAt).getTime());
|
|
6794
|
+
}
|
|
6795
|
+
function runTimeline(run) {
|
|
6796
|
+
const start = new Date(run.startedAt).getTime();
|
|
6797
|
+
const ends = run.steps.map((step) => step.endedAt ? new Date(step.endedAt).getTime() : 0).concat(run.endedAt ? new Date(run.endedAt).getTime() : 0);
|
|
6798
|
+
const total = Math.max(...ends) - start;
|
|
6799
|
+
const spans = /* @__PURE__ */ new Map();
|
|
6800
|
+
if (total <= 0) return spans;
|
|
6801
|
+
for (const step of run.steps) {
|
|
6802
|
+
if (!step.startedAt || !step.endedAt) continue;
|
|
6803
|
+
const from = new Date(step.startedAt).getTime() - start;
|
|
6804
|
+
const ms = new Date(step.endedAt).getTime() - new Date(step.startedAt).getTime();
|
|
6805
|
+
spans.set(step.stepId, {
|
|
6806
|
+
offset: Math.min(Math.max(from / total, 0), 1),
|
|
6807
|
+
width: Math.min(Math.max(ms / total, 0), 1),
|
|
6808
|
+
ms
|
|
6809
|
+
});
|
|
6810
|
+
}
|
|
6811
|
+
return spans;
|
|
6812
|
+
}
|
|
6813
|
+
function formatMs(ms) {
|
|
6814
|
+
if (ms < 1e3) return `${ms}ms`;
|
|
6815
|
+
const tenths = Math.round(ms / 100);
|
|
6816
|
+
if (tenths < 600) return `${(tenths / 10).toFixed(1)}s`;
|
|
6817
|
+
const seconds = Math.round(ms / 1e3);
|
|
6818
|
+
return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
|
|
6819
|
+
}
|
|
6820
|
+
function durationMs(startedAt, endedAt) {
|
|
6821
|
+
if (!endedAt) return null;
|
|
6822
|
+
return new Date(endedAt).getTime() - new Date(startedAt).getTime();
|
|
6823
|
+
}
|
|
6824
|
+
function formatWhen(startedAt) {
|
|
6825
|
+
const diff = Date.now() - new Date(startedAt).getTime();
|
|
6826
|
+
if (diff < 6e4) return "just now";
|
|
6827
|
+
if (diff < 36e5) return `${Math.floor(diff / 6e4)}m ago`;
|
|
6828
|
+
if (diff < 864e5) return `${Math.floor(diff / 36e5)}h ago`;
|
|
6829
|
+
return new Date(startedAt).toLocaleDateString();
|
|
6830
|
+
}
|
|
6831
|
+
function formatAbsolute(iso) {
|
|
6832
|
+
return new Date(iso).toLocaleString();
|
|
6833
|
+
}
|
|
6834
|
+
function formatTrigger(kind) {
|
|
6835
|
+
return kind.replace(/[-_]/g, " ").toLowerCase();
|
|
6836
|
+
}
|
|
6837
|
+
function runStats(runs) {
|
|
6838
|
+
const succeeded = runs.filter((run) => run.status === "SUCCEEDED").length;
|
|
6839
|
+
const failed = runs.filter((run) => run.status === "FAILED").length;
|
|
6840
|
+
const finished = succeeded + failed;
|
|
6841
|
+
return {
|
|
6842
|
+
total: runs.length,
|
|
6843
|
+
succeeded,
|
|
6844
|
+
failed,
|
|
6845
|
+
running: runs.filter((run) => run.status === "RUNNING").length,
|
|
6846
|
+
lastRun: runs[0],
|
|
6847
|
+
successRate: finished === 0 ? null : Math.round(succeeded / finished * 100)
|
|
6848
|
+
};
|
|
6849
|
+
}
|
|
6850
|
+
//#endregion
|
|
6851
|
+
//#region editors/workflow-editor/ui/block-meta.ts
|
|
6852
|
+
const CORE_META = {
|
|
6853
|
+
[blockKey(MANUAL_TRIGGER)]: {
|
|
6854
|
+
displayName: "Manual",
|
|
6855
|
+
subtitle: "Trigger",
|
|
6856
|
+
glyph: "▶"
|
|
6857
|
+
},
|
|
6858
|
+
[blockKey(SCHEDULE_TRIGGER)]: {
|
|
6859
|
+
displayName: "Schedule",
|
|
6860
|
+
subtitle: "Trigger",
|
|
6861
|
+
glyph: "◷"
|
|
6862
|
+
},
|
|
6863
|
+
[blockKey(WEBHOOK_TRIGGER)]: {
|
|
6864
|
+
displayName: "Webhook",
|
|
6865
|
+
subtitle: "Trigger",
|
|
6866
|
+
glyph: "⇲"
|
|
6867
|
+
},
|
|
6868
|
+
[blockKey(BRANCH_BLOCK)]: {
|
|
6869
|
+
displayName: "Branch",
|
|
6870
|
+
subtitle: "Core",
|
|
6871
|
+
glyph: "⑂"
|
|
6872
|
+
},
|
|
6873
|
+
[blockKey(ASSERT_BLOCK)]: {
|
|
6874
|
+
displayName: "Assert",
|
|
6875
|
+
subtitle: "Core",
|
|
6876
|
+
glyph: "!"
|
|
6877
|
+
}
|
|
6878
|
+
};
|
|
6879
|
+
function shortPieceName(packageName) {
|
|
6880
|
+
return packageName.split("/").pop()?.replace(/^piece-/, "") ?? "";
|
|
6881
|
+
}
|
|
6882
|
+
const pieceLogos = /* @__PURE__ */ new Map();
|
|
6883
|
+
const pieceNames = /* @__PURE__ */ new Map();
|
|
6884
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
6885
|
+
let logoRevision = 0;
|
|
6886
|
+
function registerPieceLogos(entries) {
|
|
6887
|
+
let changed = false;
|
|
6888
|
+
for (const entry of entries) {
|
|
6889
|
+
if (!entry.name) continue;
|
|
6890
|
+
if (entry.displayName && pieceNames.get(entry.name) !== entry.displayName) {
|
|
6891
|
+
pieceNames.set(entry.name, entry.displayName);
|
|
6892
|
+
changed = true;
|
|
6893
|
+
}
|
|
6894
|
+
if (!entry.logoUrl || pieceLogos.get(entry.name) === entry.logoUrl) continue;
|
|
6895
|
+
pieceLogos.set(entry.name, entry.logoUrl);
|
|
6896
|
+
changed = true;
|
|
6897
|
+
}
|
|
6898
|
+
if (!changed) return;
|
|
6899
|
+
logoRevision += 1;
|
|
6900
|
+
for (const listener of listeners) listener();
|
|
6901
|
+
}
|
|
6902
|
+
function pieceLogo(packageName) {
|
|
6903
|
+
return pieceLogos.get(packageName);
|
|
6904
|
+
}
|
|
6905
|
+
function pieceDisplayName(packageName) {
|
|
6906
|
+
return pieceNames.get(packageName);
|
|
6907
|
+
}
|
|
6908
|
+
const blockNames = /* @__PURE__ */ new Map();
|
|
6909
|
+
const namesRequested = /* @__PURE__ */ new Set();
|
|
6910
|
+
const namesPending = /* @__PURE__ */ new Set();
|
|
6911
|
+
function registerBlockNames(entries) {
|
|
6912
|
+
let changed = false;
|
|
6913
|
+
for (const entry of entries) {
|
|
6914
|
+
const key = blockKey(entry);
|
|
6915
|
+
if (!entry.displayName || blockNames.get(key) === entry.displayName) continue;
|
|
6916
|
+
blockNames.set(key, entry.displayName);
|
|
6917
|
+
changed = true;
|
|
6918
|
+
}
|
|
6919
|
+
if (!changed) return;
|
|
6920
|
+
logoRevision += 1;
|
|
6921
|
+
for (const listener of listeners) listener();
|
|
6922
|
+
}
|
|
6923
|
+
function requestBlockNames(packageName) {
|
|
6924
|
+
if (!namesRequested.has(packageName)) namesPending.add(packageName);
|
|
6925
|
+
}
|
|
6926
|
+
function loadPendingBlockNames(source) {
|
|
6927
|
+
for (const packageName of namesPending) loadBlockNames(source, packageName);
|
|
6928
|
+
namesPending.clear();
|
|
6929
|
+
}
|
|
6930
|
+
function loadBlockNames(source, packageName) {
|
|
6931
|
+
if (namesRequested.has(packageName)) return;
|
|
6932
|
+
namesRequested.add(packageName);
|
|
6933
|
+
Promise.all([source.loadActions(packageName), source.loadTriggers(packageName)]).then(([actions, triggers]) => registerBlockNames([...actions.map((entry) => ({
|
|
6934
|
+
...entry,
|
|
6935
|
+
kind: "action"
|
|
6936
|
+
})), ...triggers.map((entry) => ({
|
|
6937
|
+
...entry,
|
|
6938
|
+
kind: "trigger"
|
|
6939
|
+
}))])).catch(() => namesRequested.delete(packageName));
|
|
6940
|
+
}
|
|
6941
|
+
function subscribePieceLogos(listener) {
|
|
6942
|
+
listeners.add(listener);
|
|
6943
|
+
return () => listeners.delete(listener);
|
|
6944
|
+
}
|
|
6945
|
+
function pieceLogoRevision() {
|
|
6946
|
+
return logoRevision;
|
|
6947
|
+
}
|
|
6948
|
+
const logoMisses = /* @__PURE__ */ new Set();
|
|
6949
|
+
let catalogLoads = /* @__PURE__ */ new WeakMap();
|
|
6950
|
+
const retryTimers = /* @__PURE__ */ new Set();
|
|
6951
|
+
const CATALOG_RETRY_MS = 2e3;
|
|
6952
|
+
function notify() {
|
|
6953
|
+
logoRevision += 1;
|
|
6954
|
+
for (const listener of listeners) listener();
|
|
6955
|
+
}
|
|
6956
|
+
function scheduleRetry(state) {
|
|
6957
|
+
if (state.attempts >= 5) return;
|
|
6958
|
+
const timer = setTimeout(() => {
|
|
6959
|
+
retryTimers.delete(timer);
|
|
6960
|
+
state.load = void 0;
|
|
6961
|
+
notify();
|
|
6962
|
+
}, CATALOG_RETRY_MS * 2 ** (state.attempts - 1));
|
|
6963
|
+
retryTimers.add(timer);
|
|
6964
|
+
}
|
|
6965
|
+
function ensurePieceLogos(source) {
|
|
6966
|
+
if (!source) return Promise.resolve();
|
|
6967
|
+
let state = catalogLoads.get(source);
|
|
6968
|
+
if (!state) {
|
|
6969
|
+
state = { attempts: 0 };
|
|
6970
|
+
catalogLoads.set(source, state);
|
|
6971
|
+
}
|
|
6972
|
+
if (state.load) return state.load;
|
|
6973
|
+
const current = state;
|
|
6974
|
+
const request = current.attempts > 0 && source.reloadCatalog ? source.reloadCatalog() : source.loadCatalog();
|
|
6975
|
+
current.attempts += 1;
|
|
6976
|
+
current.load = request.then((pieces) => {
|
|
6977
|
+
registerPieceLogos(pieces);
|
|
6978
|
+
const listed = new Set(pieces.map((piece) => piece.name));
|
|
6979
|
+
if ([...logoMisses].some((name) => !listed.has(name) && !pieceLogos.has(name))) scheduleRetry(current);
|
|
6980
|
+
}, () => scheduleRetry(current));
|
|
6981
|
+
return current.load;
|
|
6982
|
+
}
|
|
6983
|
+
function blockMeta(block) {
|
|
6984
|
+
const key = blockKey(block);
|
|
6985
|
+
const core = CORE_META[key];
|
|
6986
|
+
if (core) return core;
|
|
6987
|
+
if (isCoreBlock(block)) return {
|
|
6988
|
+
displayName: titleCase(block.name),
|
|
6989
|
+
subtitle: "Core",
|
|
6990
|
+
glyph: "?"
|
|
6991
|
+
};
|
|
6992
|
+
const packageName = block.pieceName;
|
|
6993
|
+
const short = shortPieceName(packageName);
|
|
6994
|
+
const pieceLabel = pieceNames.get(packageName) ?? titleCase(short);
|
|
6995
|
+
const known = blockNames.get(key);
|
|
6996
|
+
if (!known) requestBlockNames(packageName);
|
|
6997
|
+
const logoUrl = pieceLogo(packageName);
|
|
6998
|
+
if (!logoUrl) logoMisses.add(packageName);
|
|
6999
|
+
return {
|
|
7000
|
+
displayName: known ?? titleCase(block.name),
|
|
7001
|
+
subtitle: block.kind === "trigger" ? `${pieceLabel} · Trigger` : pieceLabel,
|
|
7002
|
+
logoUrl,
|
|
7003
|
+
glyph: short.slice(0, 1).toUpperCase() || "?"
|
|
7004
|
+
};
|
|
7005
|
+
}
|
|
7006
|
+
function titleCase(value) {
|
|
7007
|
+
return value.replaceAll(/[-_]/g, " ").replace(/^\w/, (char) => char.toUpperCase());
|
|
7008
|
+
}
|
|
7009
|
+
function usePieceLogos() {
|
|
7010
|
+
const source = usePieceSource();
|
|
7011
|
+
const revision = useSyncExternalStore(subscribePieceLogos, pieceLogoRevision, pieceLogoRevision);
|
|
7012
|
+
useEffect(() => {
|
|
7013
|
+
ensurePieceLogos(source);
|
|
7014
|
+
if (source && namesPending.size > 0) loadPendingBlockNames(source);
|
|
7015
|
+
});
|
|
7016
|
+
return revision;
|
|
7017
|
+
}
|
|
7018
|
+
function useBlockMeta(block) {
|
|
7019
|
+
usePieceLogos();
|
|
7020
|
+
return blockMeta(block);
|
|
7021
|
+
}
|
|
7022
|
+
//#endregion
|
|
7003
7023
|
//#region editors/workflow-editor/ui/version-badge.tsx
|
|
7004
7024
|
function resolutionText(resolution) {
|
|
7005
7025
|
if (resolution.note) return resolution.note;
|
|
@@ -7610,6 +7630,6 @@ function BlockSelector(props) {
|
|
|
7610
7630
|
});
|
|
7611
7631
|
}
|
|
7612
7632
|
//#endregion
|
|
7613
|
-
export {
|
|
7633
|
+
export { blockMissing as $, runTone as A, Tooltip as At, useCachedBlockForm as B, formatDuration as C, Hint as Ct, runStats as D, Switch as Dt, formatWhen as E, Select as Et, useBlockForm as F, isIconName as Ft, useDynamicPrefetch as G, useDesignTime as H, useBlockFormLoader as I, DocumentErrorBoundary as It, useResolvedProp as J, useLatestRun as K, useBlockForms as L, DocumentLoadError as Lt, toneOf as M, textAreaClass as Mt, workflowHealth as N, textInputClass as Nt, runStatusLabel as O, Tabs as Ot, DesignTimeProvider as P, Icon as Pt, useWebhookEndpoint as Q, useBlockPorts as R, errorMessage as Rt, formatAbsolute as S, FieldLabel as St, formatTrigger as T, Segmented as Tt, useDynamicCache as U, useConnectionList as V, useDynamicLookup as W, useTestStepRunner as X, useRunById as Y, useTestTrigger as Z, RUN_TONE as _, useRuntime as _t, resolutionText as a, storedSchema as at, TONE_TEXT as b, Button as bt, useResolution as c, withSetting as ct, pieceDisplayName as d, useOAuthAttempt as dt, isEmptyValue as et, pieceLogo as f, useOAuthRedirectUri as ft, RUN_STATUSES as g, useRunsQuery as gt, CONNECTION_TONE as h, useRunQuery as ht, VersionSummary as i, settingFor as it, statusLabel as j, invalidClass as jt, runTimeline as k, Toggle as kt, versionBadge as l, workflowReadiness as lt, usePieceLogos as m, useRunPagesQuery as mt, BlockSelector as n, parsePropList as nt, runsDifferentVersion as o, stripOptions as ot, useBlockMeta as p, usePieceCatalog as pt, useOptionSearch as q, BlockResolutionsProvider as r, resolverInputFor as rt, updateVersion as s, undeclaredPortIssues as st, BlockLogo as t, isPropVisible as tt, blockMeta as u, WorkflowRuntimeProvider as ut, STEP_TONE as v, useRuntimeActions as vt, formatMs as w, IconButton as wt, durationMs as x, FieldError as xt, TONE_DOT as y, useSecretStat as yt, useBlockResolutions as z, useQuery as zt };
|
|
7614
7634
|
|
|
7615
|
-
//# sourceMappingURL=BlockSelector-
|
|
7635
|
+
//# sourceMappingURL=BlockSelector-BMnBzXcA.mjs.map
|