import { z, ZodError } from 'zod'; import { DateTime } from 'luxon'; declare const ApiErrorResponseSchema: z.ZodObject<{ code: z.ZodString; message: z.ZodString; }, z.core.$strip>; type ApiErrorResponse = z.infer; type ResultSuccess = { ok: true; data: T; }; type ResultError = { ok: false; error: E; }; type Result = ResultSuccess | ResultError; declare abstract class SdkError extends Error { abstract readonly type: string; abstract readonly retryable: boolean; readonly requestId?: string; readonly timestamp: Date; constructor(message: string, requestId?: string); } declare class NetworkError extends SdkError { readonly type: "network"; readonly cause: Error; readonly retryable: boolean; readonly statusCode?: number; constructor(cause: Error, statusCode?: number, requestId?: string); } declare class ApiError extends SdkError { readonly type: "api"; readonly subtype: "auth" | "rateLimit" | "notFound" | "unknown"; readonly code: string; readonly originalMessage: string; readonly retryable: boolean; readonly demo?: boolean; constructor(apiError: ApiErrorResponse, demo?: boolean, requestId?: string); } declare class ValidationError extends SdkError { readonly type: "validation"; readonly retryable = false; readonly issues: ZodError["issues"]; constructor(zodError: ZodError, requestId?: string); } declare class ConfigurationError extends SdkError { readonly type: "configuration"; readonly retryable = false; constructor(message: string); } interface BatchResult { successes: T[]; failures: SdkError[]; } declare function createBatchResult(results: Result[]): BatchResult; interface ParsedSuccessData { data: T; demo: boolean; } declare const ClientOptionsSchema: z.ZodObject<{ apiKey: z.ZodString; baseUrl: z.ZodOptional; logLevel: z.ZodOptional>; timeout: z.ZodOptional; retries: z.ZodOptional; maxContentLengthBytes: z.ZodOptional; maxBodyLengthBytes: z.ZodOptional; maxRedirects: z.ZodOptional; }, z.core.$strip>; type ClientOptions = z.infer; type RequestGetOptions = { method?: "GET"; headers?: Record; queryParams?: Record; publicEndpoint?: boolean; }; declare const RequestPostOptionsSchema: z.ZodObject<{ requestType: z.ZodLiteral<"simplePost">; method: z.ZodLiteral<"POST">; headers: z.ZodOptional, z.ZodLiteral<"Content-Length">, z.ZodLiteral<"User-Agent">, z.ZodLiteral<"Content-Encoding">, z.ZodLiteral<"Authorization">, z.ZodString]>, z.ZodUnion>>; queryParams: z.ZodOptional>>; }, z.core.$strip>; type RequestPostOptions = z.infer; declare const RequestPostJsonOptionsSchema: z.ZodObject<{ method: z.ZodLiteral<"POST">; headers: z.ZodOptional, z.ZodLiteral<"Content-Length">, z.ZodLiteral<"User-Agent">, z.ZodLiteral<"Content-Encoding">, z.ZodLiteral<"Authorization">, z.ZodString]>, z.ZodUnion>>; queryParams: z.ZodOptional>>; requestType: z.ZodLiteral<"postJson">; json: z.ZodRecord; }, z.core.$strip>; type RequestPostJsonOptions = z.infer; declare const RequestPostFormDataOptionsSchema: z.ZodObject<{ method: z.ZodLiteral<"POST">; headers: z.ZodOptional, z.ZodLiteral<"Content-Length">, z.ZodLiteral<"User-Agent">, z.ZodLiteral<"Content-Encoding">, z.ZodLiteral<"Authorization">, z.ZodString]>, z.ZodUnion>>; queryParams: z.ZodOptional>>; requestType: z.ZodLiteral<"postFormData">; formData: z.ZodUnion, z.ZodCustom]>; }, z.core.$strip>; type RequestPostFormDataOptions = z.infer; declare class AlldebridHttpClient { private baseUrl; private apiKey?; private timeout; private retries; private maxContentLengthBytes; private maxBodyLengthBytes; private maxRedirects; private normalizePath; private baseRequestSetup; private delay; configure(opts: ClientOptions): void; private executeRequest; getRequest(path: string, dataSchema: T, options?: RequestGetOptions): Promise>>; postRequest(path: string, dataSchema: T, options?: RequestPostOptions | RequestPostFormDataOptions | RequestPostJsonOptions): Promise>>; } declare const MagnetFileSchema: z.ZodObject<{ n: z.ZodString; s: z.ZodInt; l: z.ZodURL; }, z.core.$strip>; type MagnetFile = z.infer; declare const MagnetDirSchema: z.ZodObject<{ n: z.ZodString; e: z.ZodArray, z.ZodObject]>>; }, z.core.$strip>; type MagnetDir = z.infer; declare const MagnetListedReadySchema: z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; status: z.ZodLiteral<"Ready">; statusCode: z.ZodLiteral<4>; size: z.ZodInt; uploadDate: z.ZodPipe | DateTime, number>>; completionDate: z.ZodPipe | DateTime, number>>; nbLinks: z.ZodInt; }, z.core.$strip>; type MagnetListedReady = z.infer; declare const MagnetListedErrorSchema: z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; status: z.ZodString; statusCode: z.ZodUnion, z.ZodLiteral<6>, z.ZodLiteral<7>, z.ZodLiteral<8>, z.ZodLiteral<9>, z.ZodLiteral<10>, z.ZodLiteral<12>, z.ZodLiteral<13>, z.ZodLiteral<14>, z.ZodLiteral<15>]>; size: z.ZodPipe, z.ZodTransform>; uploadDate: z.ZodPipe | DateTime | undefined, number>>; completionDate: z.ZodPipe, z.ZodTransform | DateTime | undefined, number | undefined>>; }, z.core.$strip>; type MagnetListedError = z.infer; declare const MagnetListedExpiredSchema: z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; status: z.ZodString; uploadDate: z.ZodPipe | DateTime | undefined, number>>; completionDate: z.ZodPipe, z.ZodTransform | DateTime | undefined, number | undefined>>; statusCode: z.ZodLiteral<11>; size: z.ZodInt; }, z.core.$strip>; type MagnetListedExpired = z.infer; declare const MagnetListedSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; status: z.ZodLiteral<"Ready">; statusCode: z.ZodLiteral<4>; size: z.ZodInt; uploadDate: z.ZodPipe | DateTime, number>>; completionDate: z.ZodPipe | DateTime, number>>; nbLinks: z.ZodInt; }, z.core.$strip>, z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; downloaded: z.ZodInt; size: z.ZodInt; uploaded: z.ZodInt; seeders: z.ZodInt; downloadSpeed: z.ZodInt; processingPerc: z.ZodOptional; uploadSpeed: z.ZodInt; status: z.ZodLiteral<"In Queue">; statusCode: z.ZodLiteral<0>; uploadDate: z.ZodPipe | DateTime, number>>; completionDate: z.ZodPipe, z.ZodTransform>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; downloaded: z.ZodInt; size: z.ZodInt; uploaded: z.ZodInt; seeders: z.ZodInt; downloadSpeed: z.ZodInt; processingPerc: z.ZodOptional; uploadSpeed: z.ZodInt; uploadDate: z.ZodPipe | DateTime, number>>; completionDate: z.ZodPipe, z.ZodTransform>; status: z.ZodLiteral<"Downloading">; statusCode: z.ZodLiteral<1>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; downloaded: z.ZodInt; size: z.ZodInt; uploaded: z.ZodInt; seeders: z.ZodInt; downloadSpeed: z.ZodInt; processingPerc: z.ZodOptional; uploadSpeed: z.ZodInt; uploadDate: z.ZodPipe | DateTime, number>>; completionDate: z.ZodPipe, z.ZodTransform>; status: z.ZodLiteral<"Uploading">; statusCode: z.ZodLiteral<3>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; status: z.ZodString; uploadDate: z.ZodPipe | DateTime | undefined, number>>; completionDate: z.ZodPipe, z.ZodTransform | DateTime | undefined, number | undefined>>; statusCode: z.ZodLiteral<11>; size: z.ZodInt; }, z.core.$strip>, z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; status: z.ZodString; statusCode: z.ZodUnion, z.ZodLiteral<6>, z.ZodLiteral<7>, z.ZodLiteral<8>, z.ZodLiteral<9>, z.ZodLiteral<10>, z.ZodLiteral<12>, z.ZodLiteral<13>, z.ZodLiteral<14>, z.ZodLiteral<15>]>; size: z.ZodPipe, z.ZodTransform>; uploadDate: z.ZodPipe | DateTime | undefined, number>>; completionDate: z.ZodPipe, z.ZodTransform | DateTime | undefined, number | undefined>>; }, z.core.$strip>], "statusCode">; type MagnetListed = z.infer; declare const MagnetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; status: z.ZodLiteral<"Ready">; statusCode: z.ZodLiteral<4>; size: z.ZodInt; uploadDate: z.ZodPipe | DateTime, number>>; completionDate: z.ZodPipe | DateTime, number>>; nbLinks: z.ZodInt; files: z.ZodArray, z.ZodObject<{ n: z.ZodString; e: z.ZodArray, z.ZodObject]>>; }, z.core.$strip>]>>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; downloaded: z.ZodInt; size: z.ZodInt; uploaded: z.ZodInt; seeders: z.ZodInt; downloadSpeed: z.ZodInt; processingPerc: z.ZodOptional; uploadSpeed: z.ZodInt; status: z.ZodLiteral<"In Queue">; statusCode: z.ZodLiteral<0>; uploadDate: z.ZodPipe | DateTime, number>>; completionDate: z.ZodPipe, z.ZodTransform>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; downloaded: z.ZodInt; size: z.ZodInt; uploaded: z.ZodInt; seeders: z.ZodInt; downloadSpeed: z.ZodInt; processingPerc: z.ZodOptional; uploadSpeed: z.ZodInt; uploadDate: z.ZodPipe | DateTime, number>>; completionDate: z.ZodPipe, z.ZodTransform>; status: z.ZodLiteral<"Downloading">; statusCode: z.ZodLiteral<1>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; downloaded: z.ZodInt; size: z.ZodInt; uploaded: z.ZodInt; seeders: z.ZodInt; downloadSpeed: z.ZodInt; processingPerc: z.ZodOptional; uploadSpeed: z.ZodInt; uploadDate: z.ZodPipe | DateTime, number>>; completionDate: z.ZodPipe, z.ZodTransform>; status: z.ZodLiteral<"Uploading">; statusCode: z.ZodLiteral<3>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; status: z.ZodString; uploadDate: z.ZodPipe | DateTime | undefined, number>>; completionDate: z.ZodPipe, z.ZodTransform | DateTime | undefined, number | undefined>>; statusCode: z.ZodLiteral<11>; size: z.ZodInt; }, z.core.$strip>, z.ZodObject<{ id: z.ZodNumber; filename: z.ZodString; hash: z.ZodString; type: z.ZodOptional; notified: z.ZodOptional; version: z.ZodOptional; status: z.ZodString; statusCode: z.ZodUnion, z.ZodLiteral<6>, z.ZodLiteral<7>, z.ZodLiteral<8>, z.ZodLiteral<9>, z.ZodLiteral<10>, z.ZodLiteral<12>, z.ZodLiteral<13>, z.ZodLiteral<14>, z.ZodLiteral<15>]>; size: z.ZodPipe, z.ZodTransform>; uploadDate: z.ZodPipe | DateTime | undefined, number>>; completionDate: z.ZodPipe, z.ZodTransform | DateTime | undefined, number | undefined>>; }, z.core.$strip>], "statusCode">; type Magnet = z.infer; declare const UploadedMagnetSuccessSchema: z.ZodObject<{ name: z.ZodString; id: z.ZodInt; hash: z.ZodString; size: z.ZodInt; ready: z.ZodBoolean; magnet: z.ZodString; }, z.core.$strip>; type UploadedMagnetSuccess = z.infer; declare const UploadedFileSuccessSchema: z.ZodObject<{ name: z.ZodString; id: z.ZodInt; hash: z.ZodString; size: z.ZodInt; ready: z.ZodBoolean; file: z.ZodString; }, z.core.$strip>; type UploadedFileSuccess = z.infer; declare const UploadedMagnetErroredSchema: z.ZodObject<{ error: z.ZodObject<{ code: z.ZodEnum<{ MAGNET_NO_URI: "MAGNET_NO_URI"; MAGNET_INVALID_URI: "MAGNET_INVALID_URI"; MAGNET_MUST_BE_PREMIUM: "MAGNET_MUST_BE_PREMIUM"; MAGNET_NO_SERVER: "MAGNET_NO_SERVER"; MAGNET_TOO_MANY_ACTIVE: "MAGNET_TOO_MANY_ACTIVE"; }>; message: z.ZodString; }, z.core.$strip>; magnet: z.ZodString; }, z.core.$strip>; type UploadedMagnetErrored = z.infer; declare const UploadedFileErroredSchema: z.ZodObject<{ error: z.ZodObject<{ code: z.ZodEnum<{ MAGNET_NO_URI: "MAGNET_NO_URI"; MAGNET_INVALID_URI: "MAGNET_INVALID_URI"; MAGNET_MUST_BE_PREMIUM: "MAGNET_MUST_BE_PREMIUM"; MAGNET_NO_SERVER: "MAGNET_NO_SERVER"; MAGNET_TOO_MANY_ACTIVE: "MAGNET_TOO_MANY_ACTIVE"; }>; message: z.ZodString; }, z.core.$strip>; file: z.ZodString; }, z.core.$strip>; type UploadedFileErrored = z.infer; declare const DeleteMagnetResponseSchema: z.ZodObject<{ message: z.ZodString; }, z.core.$strip>; type DeleteMagnetResponse = z.infer; declare const RestartMagnetSuccessSchema: z.ZodObject<{ magnet: z.ZodString; message: z.ZodString; }, z.core.$strip>; type RestartMagnetSuccess = z.infer; declare const RestartMagnetErroredSchema: z.ZodObject<{ magnet: z.ZodString; error: z.ZodObject<{ code: z.ZodEnum<{ MAGNET_INVALID_ID: "MAGNET_INVALID_ID"; MAGNET_PROCESSING: "MAGNET_PROCESSING"; }>; message: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; type RestartMagnetErrored = z.infer; type InputTorrentFile = { fileName: string; blob: Blob; }; declare class MagnetResource { private readonly client; constructor(client: AlldebridHttpClient); list(status: "active"): Promise; list(status: "ready"): Promise; list(status: "expired"): Promise; list(status: "error"): Promise; list(): Promise; get(id: number): Promise; upload(magnets: string): Promise; upload(magnets: string[]): Promise>; uploadFile(torrentFiles: InputTorrentFile): Promise; uploadFile(torrentFiles: InputTorrentFile[]): Promise>; delete(id: number): Promise; restart(id: number): Promise; restart(ids: number[]): Promise<(RestartMagnetSuccess | RestartMagnetErrored)[]>; } declare const UserSchema: z.ZodObject<{ username: z.ZodString; email: z.ZodEmail; isPremium: z.ZodBoolean; isSubscribed: z.ZodBoolean; isTrial: z.ZodBoolean; premiumUntil: z.ZodPipe | DateTime | null, number>>; lang: z.ZodString; preferedDomain: z.ZodString; fidelityPoints: z.ZodInt; limitedHostersQuotas: z.ZodRecord; remainingTrialQuota: z.ZodOptional; notifications: z.ZodArray; }, z.core.$strip>; type User = z.infer; declare const UserHostSchema: z.ZodObject<{ name: z.ZodString; type: z.ZodEnum<{ premium: "premium"; free: "free"; }>; domains: z.ZodArray; regexps: z.ZodArray; regexp: z.ZodUnion]>; status: z.ZodOptional; quota: z.ZodOptional; quotaMax: z.ZodOptional; quotaType: z.ZodOptional; limitSimuDl: z.ZodOptional; }, z.core.$strip>; type UserHost = z.infer; declare const VerificationEmailStatusSchema: z.ZodObject<{ verif: z.ZodEnum<{ waiting: "waiting"; allowed: "allowed"; denied: "denied"; }>; resendable: z.ZodOptional; apikey: z.ZodOptional; }, z.core.$strip>; type VarificationEmailStatus = z.infer; declare const SavedLinkSchema: z.ZodObject<{ link: z.ZodURL; filename: z.ZodString; date: z.ZodPipe | DateTime | null, number>>; size: z.ZodInt; host: z.ZodString; }, z.core.$strip>; type SavedLink = z.infer; declare class UserResource { private readonly client; constructor(client: AlldebridHttpClient); get(): Promise; getHosts(): Promise>; checkVerificationToken(token: string): Promise; resendVerification(token: string): Promise<{ sent: boolean; }>; clearNotifications(code: string): Promise<{ code: string; cleared: boolean; }>; listSavedLinks(): Promise; saveLinks(links: string[]): Promise<{ saved: boolean; }>; deleteLinks(links: string[]): Promise<{ deleted: boolean; }>; listRecentLinks(): Promise; purgeRecentLinks(): Promise<{ deleted: boolean; }>; } declare const ListHostResponseSchema: z.ZodObject<{ hosts: z.ZodRecord; domains: z.ZodArray; regexps: z.ZodArray; regexp: z.ZodUnion]>; status: z.ZodOptional; }, z.core.$strip>>; streams: z.ZodRecord; domains: z.ZodArray; regexps: z.ZodArray; regexp: z.ZodUnion]>; status: z.ZodOptional; }, z.core.$strip>>; redirectors: z.ZodRecord; domains: z.ZodArray; regexps: z.ZodArray; regexp: z.ZodUnion]>; status: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; type ListHostResponse = z.infer; declare const ListDomainsResponseSchema: z.ZodObject<{ hosts: z.ZodArray; streams: z.ZodArray; redirectors: z.ZodArray; }, z.core.$strip>; type ListDomainsResponse = z.infer; declare class HostResource { private readonly client; constructor(client: AlldebridHttpClient); list(): Promise; listDomains(): Promise; listHostPriorities(): Promise>; } declare const LinkInfoSchema: z.ZodUnion, z.ZodObject<{ link: z.ZodURL; error: z.ZodObject<{ code: z.ZodString; message: z.ZodString; }, z.core.$strip>; }, z.core.$strip>]>; type LinkInfo = z.infer; declare const DebridLinkResponseSchema: z.ZodObject<{ link: z.ZodURL; filename: z.ZodString; host: z.ZodString; streaming: z.ZodOptional; filesize: z.ZodInt; proto: z.ZodString; name: z.ZodString; }, z.core.$strip>>>; paws: z.ZodOptional; filesize: z.ZodInt; id: z.ZodString; hostDomain: z.ZodString; delayed: z.ZodOptional; }, z.core.$strip>; type DebridLinkResponse = z.infer; declare class LinkResource { private readonly client; constructor(client: AlldebridHttpClient); getInfo(link: string, password?: string): Promise; getInfo(links: string[], password?: string): Promise; debrid(link: string, password?: string): Promise; } declare const HostSchema: z.ZodObject<{ name: z.ZodString; type: z.ZodEnum<{ premium: "premium"; free: "free"; }>; domains: z.ZodArray; regexps: z.ZodArray; regexp: z.ZodUnion]>; status: z.ZodOptional; }, z.core.$strip>; type Host = z.infer; declare class Alldebrid { private readonly httpClient; readonly magnet: MagnetResource; readonly user: UserResource; readonly host: HostResource; readonly link: LinkResource; constructor(opts: ClientOptions); } export { Alldebrid, ApiError, type BatchResult, type ClientOptions, ConfigurationError, type DebridLinkResponse, type DeleteMagnetResponse, type Host, type LinkInfo, type MagnetDir, type MagnetFile, type MagnetListed, type MagnetListedError, type MagnetListedExpired, type MagnetListedReady, NetworkError, type RestartMagnetErrored, type RestartMagnetSuccess, type SavedLink, SdkError, type UploadedFileErrored, type UploadedFileSuccess, type UploadedMagnetErrored, type UploadedMagnetSuccess, type User, type UserHost, ValidationError, type VarificationEmailStatus, createBatchResult };