UNPKG

@composio/core

Version:

![Composio Banner](https://github.com/user-attachments/assets/9ba0e9c1-85a4-4b51-ae60-f9fe7992e819)

51 lines (49 loc) 1.42 kB
import { n as FileUploadData, t as FileDownloadData } from "../files.types-nK6eTNnc.cjs"; import ComposioClient from "@composio/client"; //#region src/models/Files.node.d.ts declare class Files { private readonly client; constructor(client: ComposioClient); /** * Upload a file and return the file data. * * @param params - The upload parameters. * @param {File | string} params.file - The path to the file to upload, a URL of the file, or a File object. * @param {string} params.toolSlug - The slug of the tool that is uploading the file. * @param {string} params.toolkitSlug - The slug of the toolkit that is uploading the file. * @returns {Promise<FileUploadData>} The uploaded file data. * * @example * * const fileData = await composio.files.upload({ * file: 'path/to/file.pdf', * toolSlug: 'google_drive_upload', * toolkitSlug: 'google_drive' * }); * */ upload({ file, toolSlug, toolkitSlug }: { file: File | string; toolSlug: string; toolkitSlug: string; }): Promise<FileUploadData>; /** * Download a file from S3 and return the file data. * @param s3key - The S3 key of the file to download. * @returns The file data. */ download({ toolSlug, s3Url, mimeType }: { s3Url: string; toolSlug: string; mimeType: string; }): Promise<FileDownloadData>; } //#endregion export { Files };