mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-28 08:02:43 +00:00
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
82 lines
3.8 KiB
TypeScript
82 lines
3.8 KiB
TypeScript
import type { Flow, OpenFlow } from '$lib/gen'
|
|
import type { StateStore } from '$lib/utils'
|
|
import type { FlowState } from './flows/flowState'
|
|
import type { Trigger } from './triggers/utils'
|
|
import type { DiffDrawerI } from './diff_drawer'
|
|
import type { FlowBuilderWhitelabelCustomUi } from './custom_ui'
|
|
import type { ScheduleTrigger } from './triggers'
|
|
import type { stepState } from './stepHistoryLoader.svelte'
|
|
import type { WorkspaceItem } from './workspacePicker'
|
|
|
|
export type FlowBuilderProps = {
|
|
initialPath?: string
|
|
/** The draft row's own path (the URL path). For a draft-only flow `initialPath` is
|
|
* re-seeded from the draft's `draft_path` so the topbar shows the pending name, so
|
|
* it can't be used to resolve what is actually deployed. */
|
|
userDraftPath?: string
|
|
/** Moves the draft's base to the head and keeps its content; offered in the diff
|
|
* drawer while the draft is behind, and called with the version the drawer shows
|
|
* as head. */
|
|
onTakeLatest?: (head?: string) => void | Promise<void>
|
|
pathStoreInit?: string | undefined
|
|
newFlow: boolean
|
|
selectedId: string | undefined
|
|
initialArgs?: Record<string, any>
|
|
loading?: boolean
|
|
flowStore: StateStore<OpenFlow>
|
|
flowStateStore: StateStore<FlowState>
|
|
savedFlow?: Flow & { no_deployed?: boolean }
|
|
diffDrawer?: DiffDrawerI | undefined
|
|
customUi?: FlowBuilderWhitelabelCustomUi
|
|
disableAi?: boolean
|
|
disabledFlowInputs?: boolean
|
|
savedPrimarySchedule?: ScheduleTrigger | undefined // used to set the primary schedule in the legacy primaryScheduleStore
|
|
version?: number | undefined
|
|
/** flow_version the draft was forked from (as text, like `draft_base`); when
|
|
* set, the deploy-time staleness check compares it (not the load-time head
|
|
* `version`) against the latest. */
|
|
draftBaseVersion?: string | undefined
|
|
draftTriggersFromUrl?: Trigger[] | undefined
|
|
selectedTriggerIndexFromUrl?: number | undefined
|
|
children?: import('svelte').Snippet
|
|
loadedFromHistoryFromUrl?: {
|
|
flowJobInitial: boolean | undefined
|
|
stepsState: Record<string, stepState>
|
|
}
|
|
noInitial?: boolean
|
|
liveEditorDraftStoragePath?: string
|
|
// Indicator-only draft key overrides. When the flow editor is embedded
|
|
// (e.g. the sessions preview) its autosave runs under a different
|
|
// (workspace, path) than `$workspaceStore`/`liveEditorDraftStoragePath`
|
|
// (a forked workspace, and a path this component doesn't own). These let
|
|
// the host point the `AutosaveIndicator` at the key its own autosave uses,
|
|
// WITHOUT repurposing `liveEditorDraftStoragePath` (which still drives this
|
|
// component's setLiveEditorDraft/flush). Undefined → fall back, so the
|
|
// full-page editor is unaffected.
|
|
autosaveWorkspace?: string
|
|
autosavePath?: string
|
|
onDeploy?: ({ path }: { path: string }) => void
|
|
onDeployError?: ({ error }: { error: any }) => void
|
|
onDetails?: ({ path }: { path: string }) => void
|
|
onHistoryRestore?: () => void
|
|
onNavigate?: (item: WorkspaceItem) => void
|
|
// Threaded to the `AutosaveIndicator` popover so its "Reset to
|
|
// deployed" button can do the same thing the load-time toast offers.
|
|
onResetToDeployed?: () => void | Promise<void>
|
|
// See ScriptBuilderProps — same semantics for the flow editor's
|
|
// indicator.
|
|
loadedFromDraft?: boolean
|
|
othersDraftsCount?: number
|
|
onOpenOthersDrafts?: () => void
|
|
// Fired whenever a test run is started from the flow editor, with the
|
|
// preview job id. Used by whitelabel embedders to track test jobs.
|
|
onTestJob?: (e: { jobId: string }) => void
|
|
// Condensed top bar: smaller (sm) buttons, a shorter bar, and the
|
|
// EditorHeader's path/breadcrumb row dropped (summary only). Used by the
|
|
// session preview to save vertical room.
|
|
condensedHeader?: boolean
|
|
/** The editor's path/summary and actions go to the route's page header instead of a bar of
|
|
* its own. Only the full-page editor sets it; embedders keep their own bar. */
|
|
ownsPageHeader?: boolean
|
|
}
|