Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.smokeball.com/llms.txt

Use this file to discover all available pages before exploring further.

@smokeballdev/smokeball-client-sdk

Interface: Api

Entry point for files in Smokeball.

Methods

add()

add(request): Promise<UploadMatterFileResponse>
Adds a new file to the specified Matter. Returns upload details including upload URL.

Parameters

request
AddMatterFileRequest

Returns

Promise<UploadMatterFileResponse>

Example

const request: AddMatterFileRequest = {
 matterId: '410f2b2b-7adf-436e-a5fd-dab1733d3fba',
 fileName: 'New Document.docx',
 folderPath: '/Folder/Subfolder'
}
const uploadDetails = await sdk.files.add(request);

download()

download(request): Promise<MatterFileDownloadDetails[]>
Returns download details including download URL for the specified files. Limit of 10 files per request.

Parameters

request
DownloadMatterFilesRequest

Returns

Promise<MatterFileDownloadDetails[]>

Example

const downloadUrls = await sdk.files.download({
  files: [
    {
      matterId: matterId,
      id: fileId
    }
  ]
});

get()

get(request): Promise<FileDetails>
Returns a file from the given Matter and File Id.

Parameters

request
GetMatterFileRequest

Returns

Promise<FileDetails>

Example

const request: GetMatterFileRequest = {
 matterId: '410f2b2b-7adf-436e-a5fd-dab1733d3fba',
 fileId: 'da06e491-3a68-4da1-be1c-7e734491bbe6'
}
const fileDetails = sdk.files.get(request);

getMany()

getMany(request): Promise<GetMatterFilesResponse>
Returns a page of files from the given Matter and Folder.

Parameters

request
GetMatterFilesRequest

Returns

Promise<GetMatterFilesResponse>

Example

const request: GetMatterFilesRequest = {
 matterId: '410f2b2b-7adf-436e-a5fd-dab1733d3fba',
 // The folder id can be left empty and will default to the root directory.
 folderId: '410f2b2b-7adf-436e-a5fd-dab1733d3fbb',
 limit: 10,
 offset: 0
}
const files = sdk.files.getMany(request);

open()

open(request): void
Opens the specified file in the native app.

Parameters

request
FileRequest

Returns

void

Example

const request: FileRequest = {
 id: 'da06e491-3a68-4da1-be1c-7e734491bbe6',
 versionId: '410f2b2b-7adf-436e-a5fd-dab1733d3fba'
}
sdk.files.open(request);

select()

select(request): Promise<File[]>
Opens a file picker to select files from a matter. Returns the selected files.

Parameters

request
SelectFilesRequest

Returns

Promise<File[]>

Example

const request: SelectFilesRequest = {
 confirmationText: 'SELECT',
 fileSelectionLimit: 2,
 showEmails: false,
}
sdk.files.select(request);

selectItems()

selectItems(request): Promise<SelectItemsResponse>
Opens a file and/or folder picker to select files and folders from a matter. Folders can be selected in addition to files if the allowFolderSelection flag is set to true in the request. If allowFolderSelection is false or unset, only files can be selected and the picker will function the same as the select method. Returns the selected files and folders.

Parameters

request
SelectItemsRequest

Returns

Promise<SelectItemsResponse>

Example

const request: SelectItemsRequest = {
 confirmationText: 'SELECT',
 fileSelectionLimit: 2,
 showEmails: false,,
 allowFolderSelection: true
}
sdk.files.selectItems(request);

update()

update(request): Promise<UploadMatterFileResponse>
Updates an existing file in the specified Matter. Returns upload details including upload URL.

Parameters

request
UpdateMatterFileRequest

Returns

Promise<UploadMatterFileResponse>

Example

const request: UpdateMatterFileRequest = {
 matterId: '410f2b2b-7adf-436e-a5fd-dab1733d3fba',
 fileId: 'da06e491-3a68-4da1-be1c-7e734491bbe6',
 fileName: 'Updated Document.docx'
}
const uploadDetails = await sdk.files.update(request);