@@ -64,8 +64,6 @@ import {
64
64
SecretsManagerClient ,
65
65
SecretsManagerClientConfig
66
66
} from '@aws-sdk/client-secrets-manager'
67
- import { checkStorage , updateStorageUsage } from './quotaUsage'
68
- import { UsageCacheManager } from '../UsageCacheManager'
69
67
70
68
export const QUESTION_VAR_PREFIX = 'question'
71
69
export const FILE_ATTACHMENT_PREFIX = 'file_attachment'
@@ -206,22 +204,6 @@ export const constructGraphs = (
206
204
return { graph, nodeDependencies }
207
205
}
208
206
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
-
225
207
/**
226
208
* Get starting nodes and check if flow is valid
227
209
* @param {INodeDependencies } graph
@@ -258,6 +240,22 @@ export const getStartingNodes = (graph: INodeDirectedGraph, endNodeId: string) =
258
240
return { startingNodeIds, depthQueue : depthQueueReversed }
259
241
}
260
242
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
+
261
259
/**
262
260
* Get all connected nodes from startnode
263
261
* @param {INodeDependencies } graph
@@ -503,8 +501,10 @@ type BuildFlowParams = {
503
501
orgId ?: string
504
502
workspaceId ?: string
505
503
subscriptionId ?: string
506
- usageCacheManager ?: UsageCacheManager
504
+ usageCacheManager ?: any
507
505
uploadedFilesContent ?: string
506
+ updateStorageUsage ?: ( orgId : string , workspaceId : string , totalSize : number , usageCacheManager ?: any ) => void
507
+ checkStorage ?: ( orgId : string , subscriptionId : string , usageCacheManager : any ) => Promise < any >
508
508
}
509
509
510
510
/**
@@ -539,7 +539,9 @@ export const buildFlow = async ({
539
539
orgId,
540
540
workspaceId,
541
541
subscriptionId,
542
- usageCacheManager
542
+ usageCacheManager,
543
+ updateStorageUsage,
544
+ checkStorage
543
545
} : BuildFlowParams ) => {
544
546
const flowNodes = cloneDeep ( reactFlowNodes )
545
547
@@ -1283,6 +1285,7 @@ export const findAvailableConfigs = (reactFlowNodes: IReactFlowNode[], component
1283
1285
for ( const flowNode of reactFlowNodes ) {
1284
1286
for ( const inputParam of flowNode . data . inputParams ) {
1285
1287
let obj : IOverrideConfig | undefined
1288
+
1286
1289
if ( inputParam . type === 'file' ) {
1287
1290
obj = {
1288
1291
node : flowNode . data . label ,
@@ -1521,6 +1524,7 @@ export const decryptCredentialData = async (
1521
1524
1522
1525
if ( USE_AWS_SECRETS_MANAGER && secretsManagerClient ) {
1523
1526
try {
1527
+ logger . info ( `[server]: Reading AWS Secret: ${ encryptedData } ` )
1524
1528
if ( encryptedData . startsWith ( 'FlowiseCredential_' ) ) {
1525
1529
const command = new GetSecretValueCommand ( { SecretId : encryptedData } )
1526
1530
const response = await secretsManagerClient . send ( command )
@@ -1824,7 +1828,7 @@ export const getUploadPath = (): string => {
1824
1828
: path . join ( getUserHome ( ) , '.flowise' , 'uploads' )
1825
1829
}
1826
1830
1827
- export function generateId ( ) {
1831
+ export const generateId = ( ) => {
1828
1832
return uuidv4 ( )
1829
1833
}
1830
1834
0 commit comments