Appearance
Function: getDataStoreFile()
ts
function getDataStoreFile(ctx: Context, params: {
dataStoreFileId: string;
version?: number;
sessionTokens?: string[];
}): Promise<DataStoreFileDownload>;Defined in: src/data-store/index.ts:202
Get a specific file from a data store.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | Current execution context. |
params | { dataStoreFileId: string; version?: number; sessionTokens?: string[]; } | Query parameters. |
params.dataStoreFileId | string | The ID of the data store file. |
params.version? | number | Optional version number. If omitted, fetches the latest version. |
params.sessionTokens? | string[] | Optional session tokens. |
Returns
Promise<DataStoreFileDownload>
The file download info.
Example
ts
const file = await getDataStoreFile(ctx, { dataStoreFileId: 'file-456' });
console.log(file.name, file.url);
// Fetch a specific version
const v2 = await getDataStoreFile(ctx, { dataStoreFileId: 'file-456', version: 2 });