add custom tool

This commit is contained in:
Henry
2023-06-21 18:31:53 +01:00
parent 8c880199cd
commit 70da39629c
28 changed files with 1346 additions and 43 deletions
+21 -1
View File
@@ -2,7 +2,18 @@
* Types
*/
export type NodeParamsType = 'options' | 'string' | 'number' | 'boolean' | 'password' | 'json' | 'code' | 'date' | 'file' | 'folder'
export type NodeParamsType =
| 'asyncOptions'
| 'options'
| 'string'
| 'number'
| 'boolean'
| 'password'
| 'json'
| 'code'
| 'date'
| 'file'
| 'folder'
export type CommonType = string | number | boolean | undefined | null
@@ -16,6 +27,10 @@ export interface ICommonObject {
[key: string]: any | CommonType | ICommonObject | CommonType[] | ICommonObject[]
}
export type IDatabaseEntity = {
[key: string]: any
}
export interface IAttachment {
content: string
contentType: string
@@ -50,6 +65,7 @@ export interface INodeParams {
placeholder?: string
fileType?: string
additionalParams?: boolean
loadMethod?: string
}
export interface INodeExecutionData {
@@ -74,6 +90,9 @@ export interface INodeProperties {
export interface INode extends INodeProperties {
inputs?: INodeParams[]
output?: INodeOutputsValue[]
loadMethods?: {
[key: string]: (nodeData: INodeData, options?: ICommonObject) => Promise<INodeOptionsValue[]>
}
init?(nodeData: INodeData, input: string, options?: ICommonObject): Promise<any>
run?(nodeData: INodeData, input: string, options?: ICommonObject): Promise<string | ICommonObject>
}
@@ -83,6 +102,7 @@ export interface INodeData extends INodeProperties {
inputs?: ICommonObject
outputs?: ICommonObject
instance?: any
loadMethod?: string // method to load async options
}
export interface IMessage {