import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient"; import * as core from "../../../../core"; import * as Extend from "../../../index"; export declare namespace SplitRunsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class SplitRunsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: SplitRunsClient.Options); /** * List all split runs. * * Returns a summary of each run. Use `GET /split_runs/{id}` to retrieve the full object including `output` and `config`. * * @param {Extend.SplitRunsListRequest} request * @param {SplitRunsClient.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.splitRuns.list({ * nextPageToken: "xK9mLPqRtN3vS8wF5hB2cQ==:zWvUxYjM4nKpL7aDgE9HbTcR2mAyX3/Q+CNkfBSw1dZ=" * }) */ list(request?: Extend.SplitRunsListRequest, requestOptions?: SplitRunsClient.RequestOptions): core.HttpResponsePromise; private __list; /** * Split a document into multiple parts using an existing splitter or an inline configuration. * * The request returns immediately with a `PROCESSING` status. Use webhooks or poll the Get Split Run endpoint for results. * * @param {Extend.SplitRunsCreateRequest} request * @param {SplitRunsClient.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.splitRuns.create({ * splitter: { * id: "spl_1234567890" * }, * file: { * url: "https://example.com/multi-document.pdf" * } * }) */ create(request: Extend.SplitRunsCreateRequest, requestOptions?: SplitRunsClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieve details about a specific split run, including its status and outputs. * * A common use case for this endpoint is to poll for the status and final output of a split run when using the [Create Split Run](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/split/create-split-run) endpoint. For instance, if you do not want to not configure webhooks to receive the output via completion/failure events. * * @param {string} id - The unique identifier for this split run. * * Example: `"spl_Xj8mK2pL9nR4vT7qY5wZ"` * @param {Extend.SplitRunsRetrieveRequest} request * @param {SplitRunsClient.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.splitRuns.retrieve("split_run_id_here") */ retrieve(id: string, request?: Extend.SplitRunsRetrieveRequest, requestOptions?: SplitRunsClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Delete a split 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 split run. * @param {Extend.SplitRunsDeleteRequest} request * @param {SplitRunsClient.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.splitRuns.delete("id") */ delete(id: string, request?: Extend.SplitRunsDeleteRequest, requestOptions?: SplitRunsClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Cancel an in-progress split run. * * Note: Only split runs with a status of `"PROCESSING"` can be cancelled. Splitter runs that have already completed, failed, or been cancelled cannot be cancelled again. * * @param {string} id - The ID of the split run to cancel. * * Example: `"spl_Xj8mK2pL9nR4vT7qY5wZ"` * @param {Extend.SplitRunsCancelRequest} request * @param {SplitRunsClient.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.splitRuns.cancel("split_run_id_here") */ cancel(id: string, request?: Extend.SplitRunsCancelRequest, requestOptions?: SplitRunsClient.RequestOptions): core.HttpResponsePromise; private __cancel; /** * Submit up to **1,000 files** for splitting in a single request. Each file is processed as an independent split run using the same splitter and configuration. * * Unlike the single [Split File (Async)](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/split/create-split-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_processor_run.processed` and `batch_processor_run.failed` events. The webhook payload indicates the batch has finished — fetch individual run results using `GET /split_runs?batchId={id}`. * - **Polling:** Call `GET /batch_runs/{id}` to check the overall batch status, and use `GET /split_runs` filtered by `batchId` to retrieve individual run results. * * **Notes:** * - A processor reference (`splitter.id`) is required — inline `config` is not supported for batch requests. * - `inputs` must contain between 1 and 1,000 items. * - All inputs in a batch use the same splitter version and override config. * - Raw text input (`FileFromText`) is not supported for split runs. Use a URL or file ID. * * @param {Extend.SplitRunsCreateBatchRequest} request * @param {SplitRunsClient.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.splitRuns.createBatch({ * splitter: { * id: "spl_xK9mLPqRtN3vS8wF5hB2cQ" * }, * inputs: [{ * file: { * url: "https://example.com/multi-doc1.pdf" * }, * metadata: { * "customerId": "cust_abc123" * } * }, { * file: { * url: "https://example.com/multi-doc2.pdf" * }, * metadata: { * "customerId": "cust_def456" * } * }, { * file: { * url: "https://example.com/multi-doc3.pdf" * }, * metadata: { * "customerId": "cust_ghi789" * } * }] * }) */ createBatch(request: Extend.SplitRunsCreateBatchRequest, requestOptions?: SplitRunsClient.RequestOptions): core.HttpResponsePromise; private __createBatch; }