/** * HTTP client for the Austrian RIS (Rechtsinformationssystem) API v2.6. * * This module provides a client for querying the Austrian legal information * system API, which includes federal law, state law, case law, and other legal * documents. * * API Documentation: https://data.bka.gv.at/ris/api/v2.6/ */ import type { NormalizedSearchResults } from './types.js'; /** * Base exception for RIS API errors. */ export declare class RISAPIError extends Error { readonly statusCode?: number; constructor(message: string, statusCode?: number); } /** * Raised when a request to the RIS API times out. */ export declare class RISTimeoutError extends RISAPIError { constructor(message?: string); } /** * Raised when JSON parsing fails. */ export declare class RISParsingError extends RISAPIError { readonly originalError?: Error; constructor(message: string, originalError?: Error); } /** * Validate that a URL points to an allowed RIS domain (HTTPS only). */ export declare function isAllowedUrl(url: string): boolean; /** * Search federal law (Bundesrecht). */ export declare function searchBundesrecht(params: Record, timeout?: number, signal?: AbortSignal): Promise; /** * Search state/provincial law (Landesrecht). */ export declare function searchLandesrecht(params: Record, timeout?: number, signal?: AbortSignal): Promise; /** * Search case law/jurisprudence (Judikatur). */ export declare function searchJudikatur(params: Record, timeout?: number, signal?: AbortSignal): Promise; /** * Search district administrative authorities (Bezirke). */ export declare function searchBezirke(params: Record, timeout?: number, signal?: AbortSignal): Promise; /** * Search municipal law (Gemeinden). */ export declare function searchGemeinden(params: Record, timeout?: number, signal?: AbortSignal): Promise; /** * Search miscellaneous legal collections (Sonstige). */ export declare function searchSonstige(params: Record, timeout?: number, signal?: AbortSignal): Promise; /** * Search document change history (History). */ export declare function searchHistory(params: Record, timeout?: number, signal?: AbortSignal): Promise; /** * Fetch HTML content from a document URL. */ export declare function getDocumentContent(url: string, timeout?: number, signal?: AbortSignal): Promise; /** * Validate dokumentnummer contains only safe characters. * Defense-in-depth check in addition to Zod schema. * * Valid dokumentnummern: * - Start with uppercase letter * - Contain only uppercase letters, digits, and underscores * - Length between 5 and 50 characters * * Examples: NOR40052761, BVWG_W123_2000000_1_00 */ export declare function isValidDokumentnummer(dokumentnummer: string): boolean; /** * RIS search endpoint used for the fallback search when direct URL fetch fails. */ export type DocumentEndpoint = 'Bundesrecht' | 'Landesrecht' | 'Judikatur' | 'Sonstige' | 'Bezirke'; /** * Routing information for a Dokumentnummer prefix. */ export interface DocumentRoute { /** Folder segment in the ris.bka.gv.at/Dokumente// direct URL. */ urlFolder: string; /** Search endpoint used for the fallback search. */ endpoint: DocumentEndpoint; /** `Applikation` API parameter for the fallback search. */ applikation: string; } /** * Look up the routing information for a Dokumentnummer by its prefix. * * @param dokumentnummer - The RIS document number (e.g., "NOR12019037") * @returns The matching route, or null if the prefix is unknown */ export declare function getDocumentRoute(dokumentnummer: string): DocumentRoute | null; /** * Construct a direct document URL based on the Dokumentnummer prefix. * * @param dokumentnummer - The RIS document number (e.g., "NOR12019037") * @returns The constructed URL or null if prefix is unknown or dokumentnummer is invalid */ export declare function constructDocumentUrl(dokumentnummer: string): string | null; /** * Result type for direct document fetch. */ export type DirectDocumentResult = { success: true; html: string; url: string; } | { success: false; error: string; statusCode?: number; }; /** * Attempt to fetch a document directly by its Dokumentnummer using URL construction. * * This bypasses the search API and fetches the document directly if the * Dokumentnummer prefix is known. * * @param dokumentnummer - The RIS document number (e.g., "NOR12019037") * @param timeout - Request timeout in milliseconds * @param signal - Caller's cancellation signal; a cancellation is thrown rather * than reported as an unsuccessful fetch, so callers do not fall back to a search * @returns Result object with HTML content on success, or error details on failure */ export declare function getDocumentByNumber(dokumentnummer: string, timeout?: number, signal?: AbortSignal): Promise; //# sourceMappingURL=client.d.ts.map