mirror of
https://github.com/langgenius/dify.git
synced 2026-01-08 07:14:14 +00:00
feat: add default and utils
This commit is contained in:
14
web/app/components/workflow/nodes/code/default.ts
Normal file
14
web/app/components/workflow/nodes/code/default.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { CodeNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<CodeNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
5
web/app/components/workflow/nodes/code/utils.ts
Normal file
5
web/app/components/workflow/nodes/code/utils.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { CodeNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: CodeNodeType) => {
|
||||
return true
|
||||
}
|
||||
14
web/app/components/workflow/nodes/direct-answer/default.ts
Normal file
14
web/app/components/workflow/nodes/direct-answer/default.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { DirectAnswerNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<DirectAnswerNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
5
web/app/components/workflow/nodes/direct-answer/utils.ts
Normal file
5
web/app/components/workflow/nodes/direct-answer/utils.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { DirectAnswerNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: DirectAnswerNodeType) => {
|
||||
return true
|
||||
}
|
||||
14
web/app/components/workflow/nodes/end/default.ts
Normal file
14
web/app/components/workflow/nodes/end/default.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { EndNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<EndNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
5
web/app/components/workflow/nodes/end/utils.ts
Normal file
5
web/app/components/workflow/nodes/end/utils.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { EndNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: EndNodeType) => {
|
||||
return true
|
||||
}
|
||||
14
web/app/components/workflow/nodes/http/default.ts
Normal file
14
web/app/components/workflow/nodes/http/default.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { HttpNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<HttpNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
5
web/app/components/workflow/nodes/http/utils.ts
Normal file
5
web/app/components/workflow/nodes/http/utils.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { HttpNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: HttpNodeType) => {
|
||||
return true
|
||||
}
|
||||
14
web/app/components/workflow/nodes/if-else/default.ts
Normal file
14
web/app/components/workflow/nodes/if-else/default.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { IfElseNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<IfElseNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
@@ -1,5 +1,10 @@
|
||||
import type { IfElseNodeType } from './types'
|
||||
import { ComparisonOperator } from './types'
|
||||
|
||||
export const isEmptyRelatedOperator = (operator: ComparisonOperator) => {
|
||||
return [ComparisonOperator.empty, ComparisonOperator.notEmpty, ComparisonOperator.isNull, ComparisonOperator.isNotNull].includes(operator)
|
||||
}
|
||||
|
||||
export const checkNodeValid = (payload: IfElseNodeType) => {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { KnowledgeRetrievalNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<KnowledgeRetrievalNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { KnowledgeRetrievalNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: KnowledgeRetrievalNodeType) => {
|
||||
return true
|
||||
}
|
||||
14
web/app/components/workflow/nodes/llm/default.ts
Normal file
14
web/app/components/workflow/nodes/llm/default.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { LLMNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<LLMNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
5
web/app/components/workflow/nodes/llm/utils.ts
Normal file
5
web/app/components/workflow/nodes/llm/utils.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { LLMNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: LLMNodeType) => {
|
||||
return true
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { QuestionClassifierNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<QuestionClassifierNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { QuestionClassifierNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: QuestionClassifierNodeType) => {
|
||||
return true
|
||||
}
|
||||
14
web/app/components/workflow/nodes/start/default.ts
Normal file
14
web/app/components/workflow/nodes/start/default.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { StartNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<StartNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
5
web/app/components/workflow/nodes/start/utils.ts
Normal file
5
web/app/components/workflow/nodes/start/utils.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { StartNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: StartNodeType) => {
|
||||
return true
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { TemplateTransformNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<TemplateTransformNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { TemplateTransformNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: TemplateTransformNodeType) => {
|
||||
return true
|
||||
}
|
||||
14
web/app/components/workflow/nodes/tool/default.ts
Normal file
14
web/app/components/workflow/nodes/tool/default.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { NodeDefault } from '../../types'
|
||||
import type { ToolNodeType } from './types'
|
||||
|
||||
const nodeDefault: NodeDefault<ToolNodeType> = {
|
||||
defaultValue: {},
|
||||
getAvailablePrevNodes() {
|
||||
return []
|
||||
},
|
||||
getAvailableNextNodes() {
|
||||
return []
|
||||
},
|
||||
}
|
||||
|
||||
export default nodeDefault
|
||||
5
web/app/components/workflow/nodes/tool/utils.ts
Normal file
5
web/app/components/workflow/nodes/tool/utils.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { ToolNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: ToolNodeType) => {
|
||||
return true
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { VariableAssignerNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (node: VariableAssignerNodeType) => {
|
||||
export const checkNodeValid = (payload: VariableAssignerNodeType) => {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user