MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / getAllFiles

Function getAllFiles

packages/server/src/controllers/files/index.ts:9–28  ·  view source on GitHub ↗
(req: Request, res: Response, next: NextFunction)

Source from the content-addressed store, hash-verified

7import { getRunningExpressApp } from '../../utils/getRunningExpressApp'
8
9const getAllFiles = async (req: Request, res: Response, next: NextFunction) => {
10 try {
11 const activeOrganizationId = req.user?.activeOrganizationId
12 if (!activeOrganizationId) {
13 throw new InternalFlowiseError(
14 StatusCodes.NOT_FOUND,
15 `Error: filesController.getAllFiles - organization ${activeOrganizationId} not found!`
16 )
17 }
18 const apiResponse = await getFilesListFromStorage(activeOrganizationId)
19 const filesList = apiResponse.map((file: any) => ({
20 ...file,
21 // replace org id because we don't want to expose it
22 path: file.path.replace(getStoragePath(), '').replace(`${path.sep}${activeOrganizationId}${path.sep}`, '')
23 }))
24 return res.json(filesList)
25 } catch (error) {
26 next(error)
27 }
28}
29
30const deleteFile = async (req: Request, res: Response, next: NextFunction) => {
31 try {

Callers

nothing calls this directly

Calls 2

getFilesListFromStorageFunction · 0.85
getStoragePathFunction · 0.50

Tested by

no test coverage detected