/* tslint:disable */ /* eslint-disable */ export class IsolationForest { free(): void; [Symbol.dispose](): void; anomaly_score(point: any): number; decision_function(data: any): any; fit(data: any): void; static from_json(state: any): IsolationForest; is_anomaly(point: any, thresh?: number | null): boolean; constructor(config?: any | null); predict(data: any): any; retrain(data: any): void; score_samples(data: any): any; to_json(): any; } export class KeywordMatcher { free(): void; [Symbol.dispose](): void; first_match(path: string): string | undefined; constructor(keywords: any); } /** * Explicit stateful request engine. No JavaScript policy fallback. */ export class NativeRequestPipeline { free(): void; [Symbol.dispose](): void; begin(request: string): string; clear_model(): void; diagnostics(): string; finish(context: string, status: number, elapsed_ms: number, now: number): string; inspect_body(context: string, payload: string, exhausted: boolean, authenticated: boolean, now: number): string; inspect_payload(payload: string): string; constructor(profile: string); set_model(model: IsolationForest): void; /** * Whether this build supports an optional request fact. Adapters check before relying on one, * so they keep working with older published builds: "rate_overrides" is path-rule rate limits. */ supports(feature: string): boolean; } /** * Pure Rust receipt engine; the host persists snapshots under a shared lock. */ export class NativeTrainingEvidence { free(): void; [Symbol.dispose](): void; can_block(ip: string): boolean; commit(ip: string): void; committed_state(ip: string): string; fresh_indices(records: string): string; constructor(state: string); readonly had_history: boolean; } export class RouteMatcher { free(): void; [Symbol.dispose](): void; match_index(path: string): number | undefined; constructor(prefixes: any); } /** * Route-specific checks compiled from a manifest's saved audit findings. */ export class RouteRiskChecker { free(): void; [Symbol.dispose](): void; /** * Returns the matches as a JSON array of {route, sink, input, rule, confidence}. */ inspect(path: string, query: string, body: Uint8Array): string; /** * Compiles a manifest given as JSON text. Text that isn't a manifest gives no checks. */ constructor(manifest_json: string); /** * Reviews a request against its route's saved inputs, after the general check found * `found` (or ""). Returns JSON: {"action":"mismatch","route","input","type"}, * {"action":"unexpected","route","input"}, * {"action":"relax","route","rule"}, or null to keep the general check's answer. */ review(path: string, query: string, body: Uint8Array, max_bytes: number, found: string): string; /** * As `review`, for a request with this method: strict inputs check the names that method * reads when the manifest saved them. */ review_method(method: string, path: string, query: string, body: Uint8Array, max_bytes: number, found: string): string; /** * Reviews a finding from the URL path against its route's parameters, as `review` does. */ review_path(path: string, max_bytes: number, found: string): string; readonly empty: boolean; /** * Whether the manifest turned strict inputs on (its `strict_inputs` key). An engine * without this getter is too old to check them. */ readonly strict: boolean; /** * Whether this engine skips strict inputs' exempt paths; an older one would check them. */ readonly strict_exempt: boolean; } /** * Trusted proxy networks, parsed once. `resolve` runs per request; the JavaScript adapter reads * the setting, expands shortcut names such as "cloudflare" and logs the warning. */ export class TrustedProxySet { free(): void; [Symbol.dispose](): void; ignored_header(): string | undefined; /** * Entries that aren't an address or a CIDR range. They never widen trust. */ invalid(): any; is_empty(): boolean; constructor(entries: any); /** * The client address. Afterwards, `ignored_header` names the proxy header an untrusted * peer sent, if any. */ resolve(peer: string, forwarded_for: string, real_ip: string): string; } export function analyze_recent_behavior(entries: any, static_keywords: any): any; export function build_records(parsed: any, ip_404: any, path_exists_fn: any, path_exempt_fn: any, status_idx_list: any): any; export function extract_features(records: any, static_keywords: any): any; export function extract_features_batch_with_state(records: any, static_keywords: any, state: any): any; export function extract_raw_training_features(records: any, static_keywords: any, status_indices: any): any; export function extract_training_features(records: any, static_keywords: any): any; export function finalize_feature_state(): any; export function python_feature_from_record(record: any, ip_times: any, static_keywords: any): any; export function python_features_batched(records: any, ip_times: any, static_keywords: any, _iter_batches_fn: any, batch_size: number, _parallel_enabled: boolean, _parallel_chunk_size: number, _max_workers: number): any; /** * Returns the first route-check rule for this operation that matches the value, or undefined. */ export function route_rule(sink: string, value: string): string | undefined; export function rust_payload_from_records(records: any): any; /** * Checks a request's raw query string and buffered body for SQL injection. Returns * `{"rule": ..., "status": 403 | 413}` as JSON, or `null`. */ export function sql_inspect(query: Uint8Array, body: Uint8Array, max_bytes: number): string; /** * Checks request headers for SQL injection: cookie names and values, the Referer's query * string and path, and any other header except those holding credentials, framing or * browser-set values. Takes a * JSON array of [name, value] pairs and returns JSON like `sql_inspect`. */ export function sql_inspect_headers(headers_json: string, max_bytes: number): string; /** * Checks a URL path for SQL injection, one segment at a time. Returns JSON {rule, status} or null. */ export function sql_inspect_path(path: string, max_bytes: number): string; /** * Returns the SQL tokenizer's rule for one value, or undefined. */ export function sql_tokenizer(value: string): string | undefined; export function validate_content(content: string): any; export function validate_headers(headers: any): any; /** * `max_user_agent_length` is the app's AIWAF_MAX_USER_AGENT_LENGTH; by default 500. */ export function validate_headers_with_config(headers: any, required_headers: any, min_score: any, max_user_agent_length: any): any; export function validate_url(url: string): any;