(fileName: string, mime: string, options: ICommonObject)
| 60 | |
| 61 | /** Reads a file from storage and returns a base64 data-URL string. */ |
| 62 | const storedFileToBase64 = async (fileName: string, mime: string, options: ICommonObject): Promise<string> => { |
| 63 | const contents = await getFileFromStorage(fileName, options.orgId, options.chatflowid, options.chatId) |
| 64 | return 'data:' + mime + ';base64,' + contents.toString('base64') |
| 65 | } |
| 66 | |
| 67 | /** Saves raw base64 data to storage as a file. Returns the file path, name, and size. */ |
| 68 | const saveImageToStorage = async ( |
no test coverage detected