(chatflow: IChatFlow)
| 2000 | } |
| 2001 | |
| 2002 | export const getAPIOverrideConfig = (chatflow: IChatFlow) => { |
| 2003 | try { |
| 2004 | const apiConfig = chatflow.apiConfig ? JSON.parse(chatflow.apiConfig) : {} |
| 2005 | const nodeOverrides: INodeOverrides = |
| 2006 | apiConfig.overrideConfig && apiConfig.overrideConfig.nodes ? apiConfig.overrideConfig.nodes : {} |
| 2007 | const variableOverrides: IVariableOverride[] = |
| 2008 | apiConfig.overrideConfig && apiConfig.overrideConfig.variables ? apiConfig.overrideConfig.variables : [] |
| 2009 | const apiOverrideStatus: boolean = |
| 2010 | apiConfig.overrideConfig && apiConfig.overrideConfig.status ? apiConfig.overrideConfig.status : false |
| 2011 | |
| 2012 | return { nodeOverrides, variableOverrides, apiOverrideStatus } |
| 2013 | } catch (error) { |
| 2014 | return { nodeOverrides: {}, variableOverrides: [], apiOverrideStatus: false } |
| 2015 | } |
| 2016 | } |
| 2017 | |
| 2018 | export const getUploadPath = (): string => { |
| 2019 | return process.env.BLOB_STORAGE_PATH |
no test coverage detected