import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient"; import * as core from "../../../../core"; import * as Extend from "../../../index"; export declare namespace ParseRunsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class ParseRunsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ParseRunsClient.Options); /** * List parse runs, with optional filters for status, batch ID, source, and file name. * * Returns a paginated list of parse runs. Use `GET /parse_runs/{id}` to retrieve the full result including output for a specific run. * * @param {Extend.ParseRunsListRequest} request * @param {ParseRunsClient.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.parseRuns.list({ * nextPageToken: "xK9mLPqRtN3vS8wF5hB2cQ==:zWvUxYjM4nKpL7aDgE9HbTcR2mAyX3/Q+CNkfBSw1dZ=" * }) */ list(request?: Extend.ParseRunsListRequest, requestOptions?: ParseRunsClient.RequestOptions): core.HttpResponsePromise; private __list; /** * Parse files to get cleaned, chunked target content (e.g. markdown). * * The Parse endpoint allows you to convert documents into structured, machine-readable formats with fine-grained control over the parsing process. This endpoint is ideal for extracting cleaned document content to be used as context for downstream processing, e.g. RAG pipelines, custom ingestion pipelines, embeddings classification, etc. * * The request returns immediately with a `PROCESSING` status. Use webhooks or poll the Get Parse Run endpoint for results. * * @param {Extend.ParseRunsCreateRequest} request * @param {ParseRunsClient.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.parseRuns.create({ * file: { * url: "https://example.com/bank_statement.pdf", * name: "bank_statement.pdf" * } * }) */ create(request: Extend.ParseRunsCreateRequest, requestOptions?: ParseRunsClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieve the status and results of a parse run. * * Use this endpoint to get results for a parse run that has already completed, or to check on the status of a parse run initiated by the [Create Parse Run](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/parse/create-parse-run) endpoint. * * @param {string} id - The unique identifier for the parse run. * * Example: `"pr_xK9mLPqRtN3vS8wF5hB2cQ"` * @param {Extend.ParseRunsRetrieveRequest} request * @param {ParseRunsClient.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.parseRuns.retrieve("parse_run_id_here") */ retrieve(id: string, request?: Extend.ParseRunsRetrieveRequest, requestOptions?: ParseRunsClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Delete a parse run 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 parse run to delete. * * Example: `"pr_xK9mLPqRtN3vS8wF5hB2cQ"` * @param {Extend.ParseRunsDeleteRequest} request * @param {ParseRunsClient.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.parseRuns.delete("parse_run_id_here") */ delete(id: string, request?: Extend.ParseRunsDeleteRequest, requestOptions?: ParseRunsClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Submit up to **1,000 files** for parsing in a single request. Each file is processed as an independent parse run using the same configuration. * * Unlike the single [Parse File (Async)](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/parse/create-parse-run) endpoint, this batch endpoint accepts an `inputs` array and immediately returns a `BatchRun` object containing a batch `id` and a `PENDING` status. The individual runs are then queued and processed asynchronously. * * **Monitoring results:** * - **Webhooks (recommended):** Subscribe to `batch_parse_run.processed` and `batch_parse_run.failed` events. The webhook payload indicates the batch has finished — fetch individual run results using `GET /parse_runs?batchId={id}`. * - **Polling:** Call `GET /batch_runs/{id}` to check the overall batch status, and use `GET /parse_runs?batchId={id}` to retrieve individual run results. * * **Notes:** * - `inputs` must contain between 1 and 1,000 items. * - File input supports URLs, Extend file IDs, and raw text strings. * * @param {Extend.ParseRunsCreateBatchRequest} request * @param {ParseRunsClient.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.parseRuns.createBatch({ * inputs: [{ * file: { * url: "https://example.com/document1.pdf" * }, * metadata: { * "customerId": "cust_abc123" * } * }, { * file: { * url: "https://example.com/document2.pdf" * }, * metadata: { * "customerId": "cust_def456" * } * }, { * file: { * text: "This is some raw text to parse." * }, * metadata: { * "source": "manual-entry" * } * }] * }) */ createBatch(request: Extend.ParseRunsCreateBatchRequest, requestOptions?: ParseRunsClient.RequestOptions): core.HttpResponsePromise; private __createBatch; }