mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +03:00
Merge branch 'main' into feature/Zapier
This commit is contained in:
@@ -9,10 +9,10 @@ export interface IChatFlow {
|
||||
id: string
|
||||
name: string
|
||||
flowData: string
|
||||
apikeyid: string
|
||||
deployed: boolean
|
||||
isPublic: boolean
|
||||
updatedDate: Date
|
||||
createdDate: Date
|
||||
apikeyid?: string
|
||||
chatbotConfig?: string
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface IChatMessage {
|
||||
content: string
|
||||
chatflowid: string
|
||||
createdDate: Date
|
||||
sourceDocuments: string
|
||||
sourceDocuments?: string
|
||||
}
|
||||
|
||||
export interface ITool {
|
||||
@@ -30,8 +30,8 @@ export interface ITool {
|
||||
name: string
|
||||
description: string
|
||||
color: string
|
||||
schema: string
|
||||
func: string
|
||||
schema?: string
|
||||
func?: string
|
||||
updatedDate: Date
|
||||
createdDate: Date
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ export class ChatFlow implements IChatFlow {
|
||||
@Column()
|
||||
flowData: string
|
||||
|
||||
@Column({ nullable: true })
|
||||
apikeyid: string
|
||||
|
||||
@Column()
|
||||
deployed: boolean
|
||||
isPublic: boolean
|
||||
|
||||
@Column({ nullable: true })
|
||||
apikeyid?: string
|
||||
|
||||
@Column({ nullable: true })
|
||||
chatbotConfig?: string
|
||||
|
||||
@@ -18,7 +18,7 @@ export class ChatMessage implements IChatMessage {
|
||||
content: string
|
||||
|
||||
@Column({ nullable: true })
|
||||
sourceDocuments: string
|
||||
sourceDocuments?: string
|
||||
|
||||
@CreateDateColumn()
|
||||
createdDate: Date
|
||||
|
||||
@@ -17,10 +17,10 @@ export class Tool implements ITool {
|
||||
color: string
|
||||
|
||||
@Column({ nullable: true })
|
||||
schema: string
|
||||
schema?: string
|
||||
|
||||
@Column({ nullable: true })
|
||||
func: string
|
||||
func?: string
|
||||
|
||||
@CreateDateColumn()
|
||||
createdDate: Date
|
||||
|
||||
@@ -211,6 +211,16 @@ export class App {
|
||||
return res.status(404).send(`Chatflow ${req.params.id} not found`)
|
||||
})
|
||||
|
||||
// Get specific chatflow via id (PUBLIC endpoint, used when sharing chatbot link)
|
||||
this.app.get('/api/v1/public-chatflows/:id', async (req: Request, res: Response) => {
|
||||
const chatflow = await this.AppDataSource.getRepository(ChatFlow).findOneBy({
|
||||
id: req.params.id
|
||||
})
|
||||
if (chatflow && chatflow.isPublic) return res.json(chatflow)
|
||||
else if (chatflow && !chatflow.isPublic) return res.status(401).send(`Unauthorized`)
|
||||
return res.status(404).send(`Chatflow ${req.params.id} not found`)
|
||||
})
|
||||
|
||||
// Save chatflow
|
||||
this.app.post('/api/v1/chatflows', async (req: Request, res: Response) => {
|
||||
const body = req.body
|
||||
|
||||
@@ -463,7 +463,7 @@ export const isSameOverrideConfig = (
|
||||
* @returns {string}
|
||||
*/
|
||||
export const getAPIKeyPath = (): string => {
|
||||
return path.join(__dirname, '..', '..', 'api.json')
|
||||
return process.env.APIKEY_PATH ? path.join(process.env.APIKEY_PATH, 'api.json') : path.join(__dirname, '..', '..', 'api.json')
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user