import { IIntegration } from '@metad/contracts'; import { ConfigService } from '@nestjs/config'; import { XpFileSystem } from '@xpert-ai/plugin-sdk'; import { AxiosResponse } from 'axios'; import { MinerUIntegrationOptions, MineruSelfHostedTaskResult, MinerUServerType } from './types.js'; interface CreateTaskOptions { url?: string; filePath?: string; fileName?: string; isOcr?: boolean; enableFormula?: boolean; enableTable?: boolean; language?: string; modelVersion?: string; dataId?: string; pageRanges?: string; extraFormats?: string[]; callbackUrl?: string; seed?: string; /** Optional parse method used by self-hosted MinerU deployments */ parseMethod?: string; /** Optional backend identifier used by self-hosted MinerU deployments */ backend?: string; /** Optional mineru backend server url (used when backend is VLM client) */ serverUrl?: string; /** Whether to request intermediate JSON payloads from self-hosted MinerU */ returnMiddleJson?: boolean; } interface CreateBatchTaskFile { url: string; isOcr?: boolean; dataId?: string; pageRanges?: string; } interface CreateBatchTaskOptions { files: CreateBatchTaskFile[]; enableFormula?: boolean; enableTable?: boolean; language?: string; modelVersion?: string; extraFormats?: string[]; callbackUrl?: string; seed?: string; } interface TaskResultOptions { enableFormula?: boolean; enableTable?: boolean; language?: string; } export declare class MinerUClient { private readonly configService; private readonly permissions?; private readonly logger; private readonly baseUrl; private readonly token?; readonly serverType: MinerUServerType; private readonly localTasks; get fileSystem(): XpFileSystem | undefined; constructor(configService: ConfigService, permissions?: { fileSystem?: XpFileSystem; integration?: Partial>; }); /** * Create a MinerU extraction task. For self-hosted deployments the file will be uploaded immediately * and the parsed result cached locally, while official deployments follow the async task lifecycle. */ createTask(options: CreateTaskOptions): Promise<{ taskId: string; }>; /** * Create a batch MinerU extraction task. Only supported for official MinerU deployments. */ createBatchTask(options: CreateBatchTaskOptions): Promise<{ batchId: string; fileUrls?: string[]; }>; getSelfHostedTask(taskId: string): MineruSelfHostedTaskResult | undefined; /** * Query offical task status or results. */ getTaskResult(taskId: string, options?: TaskResultOptions): Promise<{ full_zip_url?: string; full_url?: string; content?: string; status?: string; }>; /** * Query batch task results. Only supported for official MinerU deployments. */ getBatchResult(batchId: string): Promise; /** * Wait for a task to complete and return the result when available. */ waitForTask(taskId: string, timeoutMs?: number, intervalMs?: number): Promise; private ensureOfficial; private resolveServerType; private resolveCredentials; private readIntegrationOptions; private normalizeBaseUrl; private buildApiUrl; private getOfficialHeaders; private getSelfHostedHeaders; private createOfficialTask; private createSelfHostedTask; private invokeSelfHostedParse; private invokeSelfHostedParseV1; private isSelfHostedApiV1; private normalizeSelfHostedResponse; private normalizeSelfHostedFileResult; private normalizeImageMap; private parseJsonSafe; private buildLanguageList; private booleanToString; private downloadFile; private extractFileName; getSelfHostedOpenApiSpec(): Promise>; validateOfficialApiToken(): Promise; } export {}; //# sourceMappingURL=mineru.client.d.ts.map