Kaizen
Browse modulesStorageInterfaces

Interface: FileStore

Defined in: server/forms/deps.ts:22

Port describing the file-storage backend the forms feature needs.

Consumers implement this against S3, GCS, local disk, etc. Only a few operations are required — uploads go through a signed-URL flow and downloads go through getDownloadUrl.

Methods

generateUploadUrl()

generateUploadUrl(input: {
  actorId: string;
  contentType: string;
  context: string;
  filename: string;
}): Promise<{
  fields?: Record<string, string>;
  fileId: string;
  uploadUrl: string;
}>;

Defined in: server/forms/deps.ts:23

Parameters

ParameterType
input{ actorId: string; contentType: string; context: string; filename: string; }
input.actorIdstring
input.contentTypestring
input.contextstring
input.filenamestring

Returns

Promise<{ fields?: Record<string, string>; fileId: string; uploadUrl: string; }>


getDownloadUrl()

getDownloadUrl(fileId: string): Promise<string>;

Defined in: server/forms/deps.ts:38

Parameters

ParameterType
fileIdstring

Returns

Promise<string>


getMetadata()?

optional getMetadata(fileId: string): Promise<{
  contentType: string;
  filename: string;
  sizeBytes: number;
}>;

Defined in: server/forms/deps.ts:39

Parameters

ParameterType
fileIdstring

Returns

Promise<{ contentType: string; filename: string; sizeBytes: number; }>


verifyOwnership()

verifyOwnership(input: {
  actorId: string;
  context: string;
  fileIds: string[];
}): Promise<{
  verified: string[];
}>;

Defined in: server/forms/deps.ts:33

Parameters

ParameterType
input{ actorId: string; context: string; fileIds: string[]; }
input.actorIdstring
input.contextstring
input.fileIdsstring[]

Returns

Promise<{ verified: string[]; }>

On this page