mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
Merge branch 'FlowiseAI:main' into feature/winston-logging-clean
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -16,6 +16,9 @@ export class Tool implements ITool {
|
||||
@Column()
|
||||
color: string
|
||||
|
||||
@Column({ nullable: true })
|
||||
iconSrc?: string
|
||||
|
||||
@Column({ nullable: true })
|
||||
schema?: string
|
||||
|
||||
|
||||
@@ -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
|
||||
// ----------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user