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