import type { Blob } from "buffer"; import type * as fs from "fs"; import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient"; import * as core from "../../../../core"; import * as Extend from "../../../index"; export declare namespace FilesClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class FilesClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: FilesClient.Options); /** * List files. * * @param {Extend.FilesListRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.files.list({ * nextPageToken: "xK9mLPqRtN3vS8wF5hB2cQ==:zWvUxYjM4nKpL7aDgE9HbTcR2mAyX3/Q+CNkfBSw1dZ=" * }) */ list(request?: Extend.FilesListRequest, requestOptions?: FilesClient.RequestOptions): core.HttpResponsePromise; private __list; /** * Fetch a file by its ID. * * @param {string} id - ID for the file. It will always start with `"file_"`. * * Example: `"file_Xj8mK2pL9nR4vT7qY5wZ"` * @param {Extend.FilesRetrieveRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.files.retrieve("file_id_here") */ retrieve(id: string, request?: Extend.FilesRetrieveRequest, requestOptions?: FilesClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Delete a file and all associated data from Extend. This operation is permanent and cannot be undone. * * This endpoint can be used if you'd like to manage data retention on your own rather than automated data retention policies. Or make one-off deletions for your downstream customers. * * @param {string} id - The ID of the file to delete. * * Example: `"file_xK9mLPqRtN3vS8wF5hB2cQ"` * @param {Extend.FilesDeleteRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.files.delete("file_id_here") */ delete(id: string, request?: Extend.FilesDeleteRequest, requestOptions?: FilesClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Upload and create a new file in Extend. * * This endpoint accepts file contents and registers them as a File in Extend, which can be used for [running workflows](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/workflow/create-workflow-run), [creating evaluation set items](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/evaluation/create-evaluation-set-item), [parsing](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/parse/parse-file), etc. * * If an uploaded file is detected as a Word or PowerPoint document, it will be automatically converted to a PDF. * * Supported file types can be found [here](https://docs.extend.ai/2026-02-09/product/general/supported-file-types). * * This endpoint requires multipart form encoding. Most HTTP clients will handle this encoding automatically (see the examples). * * @param {File | fs.ReadStream | Blob} file * @param {Extend.FilesUploadRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * import { createReadStream } from "fs"; * await client.files.upload(createReadStream("path/to/file"), {}) */ upload(file: File | fs.ReadStream | Blob, request: Extend.FilesUploadRequest, requestOptions?: FilesClient.RequestOptions): core.HttpResponsePromise; private __upload; }