Merge branch 'FlowiseAI:main' into feature/winston-logging-clean

This commit is contained in:
Matthias Platzer
2023-07-06 11:26:09 +02:00
committed by GitHub
53 changed files with 582 additions and 79 deletions
+3 -1
View File
@@ -9,9 +9,10 @@ export interface IChatFlow {
id: string
name: string
flowData: string
isPublic: boolean
updatedDate: Date
createdDate: Date
deployed?: boolean
isPublic?: boolean
apikeyid?: string
chatbotConfig?: string
}
@@ -30,6 +31,7 @@ export interface ITool {
name: string
description: string
color: string
iconSrc?: string
schema?: string
func?: string
updatedDate: Date
+5 -2
View File
@@ -13,8 +13,11 @@ export class ChatFlow implements IChatFlow {
@Column()
flowData: string
@Column()
isPublic: boolean
@Column({ nullable: true })
deployed?: boolean
@Column({ nullable: true })
isPublic?: boolean
@Column({ nullable: true })
apikeyid?: string
+3
View File
@@ -16,6 +16,9 @@ export class Tool implements ITool {
@Column()
color: string
@Column({ nullable: true })
iconSrc?: string
@Column({ nullable: true })
schema?: string
+22 -3
View File
@@ -467,12 +467,12 @@ export class App {
// ----------------------------------------
// Get all chatflows for marketplaces
this.app.get('/api/v1/marketplaces', async (req: Request, res: Response) => {
const marketplaceDir = path.join(__dirname, '..', 'marketplaces')
this.app.get('/api/v1/marketplaces/chatflows', async (req: Request, res: Response) => {
const marketplaceDir = path.join(__dirname, '..', 'marketplaces', 'chatflows')
const jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json')
const templates: any[] = []
jsonsInDir.forEach((file, index) => {
const filePath = path.join(__dirname, '..', 'marketplaces', file)
const filePath = path.join(__dirname, '..', 'marketplaces', 'chatflows', file)
const fileData = fs.readFileSync(filePath)
const fileDataObj = JSON.parse(fileData.toString())
const template = {
@@ -486,6 +486,25 @@ export class App {
return res.json(templates)
})
// Get all tools for marketplaces
this.app.get('/api/v1/marketplaces/tools', async (req: Request, res: Response) => {
const marketplaceDir = path.join(__dirname, '..', 'marketplaces', 'tools')
const jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json')
const templates: any[] = []
jsonsInDir.forEach((file, index) => {
const filePath = path.join(__dirname, '..', 'marketplaces', 'tools', file)
const fileData = fs.readFileSync(filePath)
const fileDataObj = JSON.parse(fileData.toString())
const template = {
...fileDataObj,
id: index,
templateName: file.split('.json')[0]
}
templates.push(template)
})
return res.json(templates)
})
// ----------------------------------------
// API Keys
// ----------------------------------------