Feat/environment variables in workflow (#6515)

Co-authored-by: JzoNg <jzongcode@gmail.com>
This commit is contained in:
-LAN- 2024-07-22 15:29:39 +08:00 • committed by GitHub
commit 5e6fc58db3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
146 changed files with 2486 additions and 746 deletions

View file

@ -12,6 +12,7 @@ import type {
import type { VariableAssignerNodeType } from './nodes/variable-assigner/types'
import type {
Edge,
EnvironmentVariable,
HistoryWorkflowData,
Node,
RunFile,
@ -59,6 +60,7 @@ type Shape = {
edges: Edge[]
viewport: Viewport
features: Record<string, any>
environmentVariables: EnvironmentVariable[]
}
setBackupDraft: (backupDraft?: Shape['backupDraft']) => void
notInitialWorkflow: boolean
@ -82,6 +84,12 @@ type Shape = {
setShortcutsDisabled: (shortcutsDisabled: boolean) => void
showDebugAndPreviewPanel: boolean
setShowDebugAndPreviewPanel: (showDebugAndPreviewPanel: boolean) => void
showEnvPanel: boolean
setShowEnvPanel: (showEnvPanel: boolean) => void
environmentVariables: EnvironmentVariable[]
setEnvironmentVariables: (environmentVariables: EnvironmentVariable[]) => void
envSecrets: Record<string, string>
setEnvSecrets: (envSecrets: Record<string, string>) => void
selection: null | { x1: number; y1: number; x2: number; y2: number }
setSelection: (selection: Shape['selection']) => void
bundleNodeSize: { width: number; height: number } | null
@ -190,6 +198,12 @@ export const createWorkflowStore = () => {
setShortcutsDisabled: shortcutsDisabled => set(() => ({ shortcutsDisabled })),
showDebugAndPreviewPanel: false,
setShowDebugAndPreviewPanel: showDebugAndPreviewPanel => set(() => ({ showDebugAndPreviewPanel })),
showEnvPanel: false,
setShowEnvPanel: showEnvPanel => set(() => ({ showEnvPanel })),
environmentVariables: [],
setEnvironmentVariables: environmentVariables => set(() => ({ environmentVariables })),
envSecrets: {},
setEnvSecrets: envSecrets => set(() => ({ envSecrets })),
selection: null,
setSelection: selection => set(() => ({ selection })),
bundleNodeSize: null,