Skip to content

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

DB

name?

string = 'FileWorkflows'

Returns

FileWorkflows

Overrides

ConfiguredInstance.constructor

Properties

name

readonly name: string

Defined in: node_modules/.pnpm/@dbos-inc+dbos-sdk@4.7.9_bufferutil@4.0.9_pg-native@3.5.2_utf-8-validate@5.0.10/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:

  1. Check permissions
  2. Delete from lakeFS (single object or all objects under prefix)
  3. Emit event

Parameters

workspaceId

string

branchName

string

path

string

userId

string

Returns

Promise<void>


initialize()

initialize(): Promise<void>

Defined in: node_modules/.pnpm/@dbos-inc+dbos-sdk@4.7.9_bufferutil@4.0.9_pg-native@3.5.2_utf-8-validate@5.0.10/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:

  1. Check permissions
  2. 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:

  1. Check permissions
  2. Upload to lakeFS
  3. Emit event

Parameters

workspaceId

string

branchName

string

path

string

content

string | Buffer<ArrayBufferLike>

userId

string

Returns

Promise<ObjectStats>

Licensed under BUSL-1.1