mirror of
https://github.com/langgenius/dify.git
synced 2025-07-16 13:50:18 +00:00
26 lines
599 B
TypeScript
26 lines
599 B
TypeScript
![]() |
import type { VarInInspect } from '@/types/workflow'
|
||
|
import { VarInInspectType } from '@/types/workflow'
|
||
|
import { VarType } from '../types'
|
||
|
|
||
|
type OutputToVarInInspectParams = {
|
||
|
nodeId: string
|
||
|
name: string
|
||
|
value: any
|
||
|
}
|
||
|
export const outputToVarInInspect = ({
|
||
|
nodeId,
|
||
|
name,
|
||
|
value,
|
||
|
}: OutputToVarInInspectParams): VarInInspect => {
|
||
|
return {
|
||
|
id: `${Date.now()}`, // TODO: wait for api
|
||
|
type: VarInInspectType.node,
|
||
|
name,
|
||
|
description: '',
|
||
|
selector: [nodeId, name],
|
||
|
value_type: VarType.string, // TODO: wait for api or get from node
|
||
|
value,
|
||
|
edited: false,
|
||
|
}
|
||
|
}
|