PersistentAI API Documentation / @persistentai/fireflow-vfs / server / FileWorkflows
Class: FileWorkflows
Defined in: packages/fireflow-vfs/src/workflows/file-workflows.ts:37
File workflows class
Extends
ConfiguredInstance
Constructors
Constructor
new FileWorkflows(
db,name?):FileWorkflows
Defined in: packages/fireflow-vfs/src/workflows/file-workflows.ts:38
Parameters
db
name?
string = 'FileWorkflows'
Returns
FileWorkflows
Overrides
ConfiguredInstance.constructor
Properties
name
readonlyname:string
Defined in: node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@dbos-inc/dbos-sdk/dist/src/decorators.d.ts:126
Inherited from
ConfiguredInstance.name
Methods
copyFile()
copyFile(
workspaceId,branchName,fromPath,toPath,userId):Promise<void>
Defined in: packages/fireflow-vfs/src/workflows/file-workflows.ts:233
Copy file
Parameters
workspaceId
string
branchName
string
fromPath
string
toPath
string
userId
string
Returns
Promise<void>
createDirectory()
createDirectory(
workspaceId,branchName,path,userId):Promise<void>
Defined in: packages/fireflow-vfs/src/workflows/file-workflows.ts:303
Create directory (by creating a .keep file)
Idempotent: If directory already exists (has any content), returns success without changes.
Parameters
workspaceId
string
branchName
string
path
string
userId
string
Returns
Promise<void>
deleteFile()
deleteFile(
workspaceId,branchName,path,userId):Promise<void>
Defined in: packages/fireflow-vfs/src/workflows/file-workflows.ts:155
Delete file or directory from workspace
For directories (path ends with '/'), all objects under that prefix are deleted. In lakeFS, directories are virtual - they're just common prefixes. To delete a directory, we must delete all objects (files) under that prefix, including .keep files.
Steps:
- Check permissions
- Delete from lakeFS (single object or all objects under prefix)
- Emit event
Parameters
workspaceId
string
branchName
string
path
string
userId
string
Returns
Promise<void>
initialize()
initialize():
Promise<void>
Defined in: node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@dbos-inc/dbos-sdk/dist/src/decorators.d.ts:131
Override this method to perform async initialization between construction and DBOS.launch().
Returns
Promise<void>
Inherited from
ConfiguredInstance.initialize
readFile()
readFile(
workspaceId,ref,path,userId):Promise<string>
Defined in: packages/fireflow-vfs/src/workflows/file-workflows.ts:124
Read file from workspace
Steps:
- Check permissions
- Get from lakeFS
Parameters
workspaceId
string
ref
string
path
string
userId
string
Returns
Promise<string>
writeFile()
writeFile(
workspaceId,branchName,path,content,userId):Promise<ObjectStats>
Defined in: packages/fireflow-vfs/src/workflows/file-workflows.ts:51
Write file to workspace
Steps:
- Check permissions
- Upload to lakeFS
- Emit event
Parameters
workspaceId
string
branchName
string
path
string
content
string | Buffer<ArrayBufferLike>
userId
string
Returns
Promise<ObjectStats>