@@ -64,8 +64,6 @@ import {
6464 SecretsManagerClient ,
6565 SecretsManagerClientConfig
6666} from '@aws-sdk/client-secrets-manager'
67- import { checkStorage , updateStorageUsage } from './quotaUsage'
68- import { UsageCacheManager } from '../UsageCacheManager'
6967
7068export const QUESTION_VAR_PREFIX = 'question'
7169export const FILE_ATTACHMENT_PREFIX = 'file_attachment'
@@ -206,22 +204,6 @@ export const constructGraphs = (
206204 return { graph, nodeDependencies }
207205}
208206
209- /**
210- * Get starting node and check if flow is valid
211- * @param {INodeDependencies } nodeDependencies
212- */
213- export const getStartingNode = ( nodeDependencies : INodeDependencies ) => {
214- // Find starting node
215- const startingNodeIds = [ ] as string [ ]
216- Object . keys ( nodeDependencies ) . forEach ( ( nodeId ) => {
217- if ( nodeDependencies [ nodeId ] === 0 ) {
218- startingNodeIds . push ( nodeId )
219- }
220- } )
221-
222- return { startingNodeIds }
223- }
224-
225207/**
226208 * Get starting nodes and check if flow is valid
227209 * @param {INodeDependencies } graph
@@ -258,6 +240,22 @@ export const getStartingNodes = (graph: INodeDirectedGraph, endNodeId: string) =
258240 return { startingNodeIds, depthQueue : depthQueueReversed }
259241}
260242
243+ /**
244+ * Get starting node and check if flow is valid
245+ * @param {INodeDependencies } nodeDependencies
246+ */
247+ export const getStartingNode = ( nodeDependencies : INodeDependencies ) => {
248+ // Find starting node
249+ const startingNodeIds = [ ] as string [ ]
250+ Object . keys ( nodeDependencies ) . forEach ( ( nodeId ) => {
251+ if ( nodeDependencies [ nodeId ] === 0 ) {
252+ startingNodeIds . push ( nodeId )
253+ }
254+ } )
255+
256+ return { startingNodeIds }
257+ }
258+
261259/**
262260 * Get all connected nodes from startnode
263261 * @param {INodeDependencies } graph
@@ -503,8 +501,10 @@ type BuildFlowParams = {
503501 orgId ?: string
504502 workspaceId ?: string
505503 subscriptionId ?: string
506- usageCacheManager ?: UsageCacheManager
504+ usageCacheManager ?: any
507505 uploadedFilesContent ?: string
506+ updateStorageUsage ?: ( orgId : string , workspaceId : string , totalSize : number , usageCacheManager ?: any ) => void
507+ checkStorage ?: ( orgId : string , subscriptionId : string , usageCacheManager : any ) => Promise < any >
508508}
509509
510510/**
@@ -539,7 +539,9 @@ export const buildFlow = async ({
539539 orgId,
540540 workspaceId,
541541 subscriptionId,
542- usageCacheManager
542+ usageCacheManager,
543+ updateStorageUsage,
544+ checkStorage
543545} : BuildFlowParams ) => {
544546 const flowNodes = cloneDeep ( reactFlowNodes )
545547
@@ -1283,6 +1285,7 @@ export const findAvailableConfigs = (reactFlowNodes: IReactFlowNode[], component
12831285 for ( const flowNode of reactFlowNodes ) {
12841286 for ( const inputParam of flowNode . data . inputParams ) {
12851287 let obj : IOverrideConfig | undefined
1288+
12861289 if ( inputParam . type === 'file' ) {
12871290 obj = {
12881291 node : flowNode . data . label ,
@@ -1521,6 +1524,7 @@ export const decryptCredentialData = async (
15211524
15221525 if ( USE_AWS_SECRETS_MANAGER && secretsManagerClient ) {
15231526 try {
1527+ logger . info ( `[server]: Reading AWS Secret: ${ encryptedData } ` )
15241528 if ( encryptedData . startsWith ( 'FlowiseCredential_' ) ) {
15251529 const command = new GetSecretValueCommand ( { SecretId : encryptedData } )
15261530 const response = await secretsManagerClient . send ( command )
@@ -1824,7 +1828,7 @@ export const getUploadPath = (): string => {
18241828 : path . join ( getUserHome ( ) , '.flowise' , 'uploads' )
18251829}
18261830
1827- export function generateId ( ) {
1831+ export const generateId = ( ) => {
18281832 return uuidv4 ( )
18291833}
18301834
0 commit comments