Flowise
1import { ICommonObject, IFileUpload, INode, INodeData as INodeDataFromComponent, INodeParams } from 'flowise-components'
2
3export type MessageType = 'apiMessage' | 'userMessage'
4
5export enum chatType {
6INTERNAL = 'INTERNAL',
7EXTERNAL = 'EXTERNAL'
8}
9
10export enum ChatMessageRatingType {
11THUMBS_UP = 'THUMBS_UP',
12THUMBS_DOWN = 'THUMBS_DOWN'
13}
14/**
15* Databases
16*/
17export interface IChatFlow {
18id: string
19name: string
20flowData: string
21updatedDate: Date
22createdDate: Date
23deployed?: boolean
24isPublic?: boolean
25apikeyid?: string
26analytic?: string
27chatbotConfig?: string
28apiConfig?: any
29}
30
31export interface IChatMessage {
32id: string
33role: MessageType
34content: string
35chatflowid: string
36sourceDocuments?: string
37usedTools?: string
38fileAnnotations?: string
39fileUploads?: string
40chatType: string
41chatId: string
42memoryType?: string
43sessionId?: string
44createdDate: Date
45leadEmail?: string
46}
47
48export interface IChatMessageFeedback {
49id: string
50content?: string
51chatflowid: string
52chatId: string
53messageId: string
54rating: ChatMessageRatingType
55createdDate: Date
56}
57
58export interface ITool {
59id: string
60name: string
61description: string
62color: string
63iconSrc?: string
64schema?: string
65func?: string
66updatedDate: Date
67createdDate: Date
68}
69
70export interface IAssistant {
71id: string
72details: string
73credential: string
74iconSrc?: string
75updatedDate: Date
76createdDate: Date
77}
78
79export interface ICredential {
80id: string
81name: string
82credentialName: string
83encryptedData: string
84updatedDate: Date
85createdDate: Date
86}
87
88export interface IVariable {
89id: string
90name: string
91value: string
92type: string
93updatedDate: Date
94createdDate: Date
95}
96
97export interface ILead {
98id: string
99name?: string
100email?: string
101phone?: string
102chatflowid: string
103chatId: string
104createdDate: Date
105}
106
107export interface IUpsertHistory {
108id: string
109chatflowid: string
110result: string
111flowData: string
112date: Date
113}
114
115export interface IComponentNodes {
116[key: string]: INode
117}
118
119export interface IComponentCredentials {
120[key: string]: INode
121}
122
123export interface IVariableDict {
124[key: string]: string
125}
126
127export interface INodeDependencies {
128[key: string]: number
129}
130
131export interface INodeDirectedGraph {
132[key: string]: string[]
133}
134
135export interface INodeData extends INodeDataFromComponent {
136inputAnchors: INodeParams[]
137inputParams: INodeParams[]
138outputAnchors: INodeParams[]
139}
140
141export interface IReactFlowNode {
142id: string
143position: {
144x: number
145y: number
146}
147type: string
148data: INodeData
149positionAbsolute: {
150x: number
151y: number
152}
153z: number
154handleBounds: {
155source: any
156target: any
157}
158width: number
159height: number
160selected: boolean
161dragging: boolean
162}
163
164export interface IReactFlowEdge {
165source: string
166sourceHandle: string
167target: string
168targetHandle: string
169type: string
170id: string
171data: {
172label: string
173}
174}
175
176export interface IReactFlowObject {
177nodes: IReactFlowNode[]
178edges: IReactFlowEdge[]
179viewport: {
180x: number
181y: number
182zoom: number
183}
184}
185
186export interface IExploredNode {
187[key: string]: {
188remainingLoop: number
189lastSeenDepth: number
190}
191}
192
193export interface INodeQueue {
194nodeId: string
195depth: number
196}
197
198export interface IDepthQueue {
199[key: string]: number
200}
201
202export interface IMessage {
203message: string
204type: MessageType
205}
206
207export interface IncomingInput {
208question: string
209overrideConfig?: ICommonObject
210socketIOClientId?: string
211chatId?: string
212stopNodeId?: string
213uploads?: IFileUpload[]
214leadEmail?: string
215}
216
217export interface IActiveChatflows {
218[key: string]: {
219startingNodes: IReactFlowNode[]
220endingNodeData?: INodeData
221inSync: boolean
222overrideConfig?: ICommonObject
223}
224}
225
226export interface IActiveCache {
227[key: string]: Map<any, any>
228}
229
230export interface IOverrideConfig {
231node: string
232nodeId: string
233label: string
234name: string
235type: string
236}
237
238export type ICredentialDataDecrypted = ICommonObject
239
240// Plain credential object sent to server
241export interface ICredentialReqBody {
242name: string
243credentialName: string
244plainDataObj: ICredentialDataDecrypted
245}
246
247// Decrypted credential object sent back to client
248export interface ICredentialReturnResponse extends ICredential {
249plainDataObj: ICredentialDataDecrypted
250}
251
252export interface IUploadFileSizeAndTypes {
253fileTypes: string[]
254maxUploadSize: number
255}
256
257// DocumentStore related
258export * from './Interface.DocumentStore'
259