Knowtation web client
    Preparing search index...

    Variable clientConst

    client: {
        acceptRequest: (
            id: string,
        ) => Promise<
            {
                created_at: string;
                dataset_id: string;
                dataset_name: string;
                from_user: { display_name: string; username: string };
                id: string;
                kind: string;
                status: string;
                to_user: { display_name: string; username: string };
            },
        >;
        addLlmKey: (
            body: { key: string; provider: "anthropic" | "google" | "openai" },
        ) => Promise<
            {
                created_at: string;
                hint: string;
                last_checked_at?: string
                | null;
                last_error?: string | null;
                provider: string;
                readable: boolean;
            },
        >;
        approveDrafts: (
            id: string,
            body: {
                draft_version: number | null;
                licence: string;
                name: string;
                yaml: string | null;
            },
        ) => Promise<
            {
                content_hash: string;
                created_at: string;
                editable: boolean;
                name: string;
                owner?: string
                | null;
                public: boolean;
                version: string;
                warnings?: string[];
            },
        >;
        archiveRun: (
            runId: string,
        ) => Promise<
            {
                archived_at?: string
                | null;
                archived_by?: string | null;
                created_at: string;
                dataset_id: string;
                error?: string | null;
                finished_at?: string | null;
                id: string;
                progress?: { cached: number; done: number; total: number } | null;
                record?:
                    | {
                        dataset_hash?: string
                        | null;
                        finished_at?: string | null;
                        id: string;
                        llm_model?: string | null;
                        llm_usage?:
                            | {
                                cached_calls?: number
                                | null;
                                calls?: number | null;
                                cost_usd?: number | null;
                                input_tokens?: number | null;
                                output_tokens?: number | null;
                                saved_input_tokens?: number | null;
                                saved_output_tokens?: number | null;
                                skipped_calls?: number | null;
                            }
                            | null;
                        policy_hash?: string
                        | null;
                        policy_id?: string | null;
                        policy_version?: string | null;
                        prompt_version?: string | null;
                        rule_set_hash?: string | null;
                        rule_set_id?: string | null;
                        rule_set_version?: string | null;
                        rule_sets?:
                            | { hash?: string
                            | null; id: string; version: string }[]
                            | null;
                        settings?: string | null;
                        started_at?: string | null;
                        status?: "failed" | "done" | "running" | "pending" | null;
                        warnings?: string[] | null;
                    }
                    | null;
                request: { [key: string]: unknown };
                started_by?: string | null;
                status: string;
            },
        >;
        clearLlmCache: () => Promise<{ deleted: number }>;
        createUser: (
            body: { display_name: string; password: string; username: string },
        ) => Promise<
            {
                created_at: string;
                display_name: string;
                is_admin: boolean;
                last_login_at?: string
                | null;
                llm_max_usd_per_run?: number | null;
                may_use_server_llm: boolean;
                status: string;
                username: string;
            },
        >;
        datasetRequests: (
            id: string,
        ) => Promise<
            {
                created_at: string;
                dataset_id: string;
                dataset_name: string;
                from_user: { display_name: string; username: string };
                id: string;
                kind: string;
                status: string;
                to_user: { display_name: string; username: string };
            }[],
        >;
        declineRequest: (
            id: string,
        ) => Promise<
            {
                created_at: string;
                dataset_id: string;
                dataset_name: string;
                from_user: { display_name: string; username: string };
                id: string;
                kind: string;
                status: string;
                to_user: { display_name: string; username: string };
            },
        >;
        deleteLlmKey: (provider: string) => Promise<void>;
        directory: (
            q: string,
        ) => Promise<{ display_name: string; username: string }[]>;
        discardDrafts: (id: string) => Promise<void>;
        documentUrl: (id: string, format: string, version?: number) => string;
        exportDataset: (
            id: string,
            profile: string,
            version?: number,
        ) => Promise<
            {
                document: { [key: string]: unknown };
                profile: string;
                report: string[];
                valid: boolean;
                version: number;
            },
        >;
        fromSource: (
            body: {
                collections?: string[] | null;
                endpoint?: string | null;
                key_env?: string | null;
                kind: "url" | "ogcapi" | "openapi";
                name?: string | null;
                params?: { [key: string]: string } | null;
                url: string;
            },
        ) => Promise<
            {
                access: string;
                created_at: string;
                dataset: {
                    citation?: string
                    | null;
                    creators?: string[] | null;
                    description?: string | null;
                    doi?: string | null;
                    id: string;
                    keywords?: string[] | null;
                    licence?: string | null;
                    publisher?: string | null;
                    resources?:
                        | {
                            description?: string
                            | null;
                            elements?:
                                | {
                                    aggregation?: ...;
                                    code_list?: ...;
                                    data_type?: ...;
                                    description?: ...;
                                    examples?: ...;
                                    id: ...;
                                    missing_values?: ...;
                                    name: ...;
                                    path: ...;
                                    references?: ...;
                                    required?: ...;
                                    role?: ...;
                                    spatial?: ...;
                                    statistics?: ...;
                                    temporal?: ...;
                                    text?: ...;
                                    title?: ...;
                                    unique?: ...;
                                    unit?: ...;
                                    unit_from?: ...;
                                }[]
                                | null;
                            error?: string
                            | null;
                            field_groups?:
                                | { id: ...; members?: ...; pattern: ...; varying?: ... }[]
                                | null;
                            format?: string | null;
                            id: string;
                            keywords?: string[] | null;
                            kind:
                                | "text"
                                | "media"
                                | "tabular"
                                | "hierarchical"
                                | "geospatial"
                                | "feed"
                                | "gridded";
                            licence?: string
                            | null;
                            location?: string | null;
                            media?:
                                | {
                                    captured_at?: (...)
                                    | (...)
                                    | (...);
                                    codec?: (...) | (...) | (...);
                                    duration_s?: (...) | (...) | (...);
                                    format?: (...) | (...) | (...);
                                    height?: (...) | (...) | (...);
                                    width?: (...) | (...) | (...);
                                }
                                | null;
                            name: string;
                            overlaps?: | {
                                codes?: ...;
                                distinct: ...;
                                from_element: ...;
                                matched: ...;
                                names_similar?: ...;
                                to_element: ...;
                                unmatched_examples?: ...;
                            }[]
                            | null;
                            publisher?: string
                            | null;
                            qualitative?:
                                | {
                                    codebook?: (...)
                                    | (...)
                                    | (...);
                                    consent_notes?: (...) | (...) | (...);
                                    speakers?: (...) | (...) | (...);
                                }
                                | null;
                            relationships?: | { from_element: ...; kind?: ...; to_element: ... }[]
                            | null;
                            role?: "data" | "lookup" | null;
                            row_count?: number | null;
                            sampled_rows?: number | null;
                            sha256?: string | null;
                            size_bytes?: number | null;
                            spatial?:
                                | {
                                    bbox?: (...)
                                    | (...)
                                    | (...);
                                    crs?: (...) | (...) | (...);
                                    feature_count?: (...) | (...) | (...);
                                    geometry_type?: (...) | (...) | (...);
                                }
                                | null;
                            standard?: string
                            | null;
                            status?: "ok" | "failed" | null;
                            structure?: "wide" | "long_series" | "events" | "indicator" | null;
                            temporal?:
                                | {
                                    end?: (...)
                                    | (...)
                                    | (...);
                                    format?: (...) | (...) | (...);
                                    resolution?: (...) | (...) | (...);
                                    start?: (...) | (...) | (...);
                                    time_zone?: (...) | (...) | (...);
                                }
                                | null;
                            text?: | {
                                encoding?: (...)
                                | (...)
                                | (...);
                                language?: (...) | (...) | (...);
                                length?: (...) | (...) | (...);
                                passages?: (...) | (...) | (...);
                                sections?: (...) | (...) | (...);
                            }
                            | null;
                            title?: string
                            | null;
                        }[]
                        | null;
                    source?: string
                    | null;
                    spatial?:
                        | {
                            bbox?: number[]
                            | null;
                            crs?: string | null;
                            feature_count?: number | null;
                            geometry_type?: string | null;
                        }
                        | null;
                    temporal?: | {
                        end?: string
                        | null;
                        format?: string | null;
                        resolution?: string | null;
                        start?: string | null;
                        time_zone?: string | null;
                    }
                    | null;
                    title?: string
                    | null;
                };
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                source: { [key: string]: unknown };
                status: string;
                warnings?: string[];
            },
        >;
        getDataset: (
            id: string,
        ) => Promise<
            {
                access: string;
                created_at: string;
                dataset: {
                    citation?: string
                    | null;
                    creators?: string[] | null;
                    description?: string | null;
                    doi?: string | null;
                    id: string;
                    keywords?: string[] | null;
                    licence?: string | null;
                    publisher?: string | null;
                    resources?:
                        | {
                            description?: string
                            | null;
                            elements?:
                                | {
                                    aggregation?: ...;
                                    code_list?: ...;
                                    data_type?: ...;
                                    description?: ...;
                                    examples?: ...;
                                    id: ...;
                                    missing_values?: ...;
                                    name: ...;
                                    path: ...;
                                    references?: ...;
                                    required?: ...;
                                    role?: ...;
                                    spatial?: ...;
                                    statistics?: ...;
                                    temporal?: ...;
                                    text?: ...;
                                    title?: ...;
                                    unique?: ...;
                                    unit?: ...;
                                    unit_from?: ...;
                                }[]
                                | null;
                            error?: string
                            | null;
                            field_groups?:
                                | { id: ...; members?: ...; pattern: ...; varying?: ... }[]
                                | null;
                            format?: string | null;
                            id: string;
                            keywords?: string[] | null;
                            kind:
                                | "text"
                                | "media"
                                | "tabular"
                                | "hierarchical"
                                | "geospatial"
                                | "feed"
                                | "gridded";
                            licence?: string
                            | null;
                            location?: string | null;
                            media?:
                                | {
                                    captured_at?: (...)
                                    | (...)
                                    | (...);
                                    codec?: (...) | (...) | (...);
                                    duration_s?: (...) | (...) | (...);
                                    format?: (...) | (...) | (...);
                                    height?: (...) | (...) | (...);
                                    width?: (...) | (...) | (...);
                                }
                                | null;
                            name: string;
                            overlaps?: | {
                                codes?: ...;
                                distinct: ...;
                                from_element: ...;
                                matched: ...;
                                names_similar?: ...;
                                to_element: ...;
                                unmatched_examples?: ...;
                            }[]
                            | null;
                            publisher?: string
                            | null;
                            qualitative?:
                                | {
                                    codebook?: (...)
                                    | (...)
                                    | (...);
                                    consent_notes?: (...) | (...) | (...);
                                    speakers?: (...) | (...) | (...);
                                }
                                | null;
                            relationships?: | { from_element: ...; kind?: ...; to_element: ... }[]
                            | null;
                            role?: "data" | "lookup" | null;
                            row_count?: number | null;
                            sampled_rows?: number | null;
                            sha256?: string | null;
                            size_bytes?: number | null;
                            spatial?:
                                | {
                                    bbox?: (...)
                                    | (...)
                                    | (...);
                                    crs?: (...) | (...) | (...);
                                    feature_count?: (...) | (...) | (...);
                                    geometry_type?: (...) | (...) | (...);
                                }
                                | null;
                            standard?: string
                            | null;
                            status?: "ok" | "failed" | null;
                            structure?: "wide" | "long_series" | "events" | "indicator" | null;
                            temporal?:
                                | {
                                    end?: (...)
                                    | (...)
                                    | (...);
                                    format?: (...) | (...) | (...);
                                    resolution?: (...) | (...) | (...);
                                    start?: (...) | (...) | (...);
                                    time_zone?: (...) | (...) | (...);
                                }
                                | null;
                            text?: | {
                                encoding?: (...)
                                | (...)
                                | (...);
                                language?: (...) | (...) | (...);
                                length?: (...) | (...) | (...);
                                passages?: (...) | (...) | (...);
                                sections?: (...) | (...) | (...);
                            }
                            | null;
                            title?: string
                            | null;
                        }[]
                        | null;
                    source?: string
                    | null;
                    spatial?:
                        | {
                            bbox?: number[]
                            | null;
                            crs?: string | null;
                            feature_count?: number | null;
                            geometry_type?: string | null;
                        }
                        | null;
                    temporal?: | {
                        end?: string
                        | null;
                        format?: string | null;
                        resolution?: string | null;
                        start?: string | null;
                        time_zone?: string | null;
                    }
                    | null;
                    title?: string
                    | null;
                };
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                source: { [key: string]: unknown };
                status: string;
                warnings?: string[];
            },
        >;
        getDrafts: (
            id: string,
        ) => Promise<
            {
                decision: | {
                    rule_set?: string
                    | null;
                    status: string;
                    username: string;
                }
                | null;
                rules: {
                    columns: string[];
                    id: string;
                    pattern: string;
                    property: string;
                    source: string;
                    value: string;
                    weight: number;
                }[];
                version: number
                | null;
                yaml: string | null;
            },
        >;
        getPolicy: (
            name: string,
            version: string,
        ) => Promise<
            {
                content: { [key: string]: unknown };
                content_hash: string;
                created_at: string;
                editable: boolean;
                name: string;
                owner?: string | null;
                public: boolean;
                version: string;
                warnings?: string[];
            },
        >;
        getPolicyYaml: (name: string, version: string) => Promise<string>;
        getReference: () => Promise<LinkMLSchema>;
        getReferenceMarkdown: () => Promise<string>;
        getReferenceYaml: () => Promise<string>;
        getRuleSet: (
            name: string,
            version: string,
        ) => Promise<
            {
                content: { [key: string]: unknown };
                content_hash: string;
                created_at: string;
                editable: boolean;
                name: string;
                owner?: string | null;
                public: boolean;
                version: string;
                warnings?: string[];
            },
        >;
        getRuleSetYaml: (name: string, version: string) => Promise<string>;
        getRun: (
            runId: string,
        ) => Promise<
            {
                archived_at?: string
                | null;
                archived_by?: string | null;
                created_at: string;
                dataset_id: string;
                error?: string | null;
                finished_at?: string | null;
                id: string;
                progress?: { cached: number; done: number; total: number } | null;
                record?:
                    | {
                        dataset_hash?: string
                        | null;
                        finished_at?: string | null;
                        id: string;
                        llm_model?: string | null;
                        llm_usage?:
                            | {
                                cached_calls?: number
                                | null;
                                calls?: number | null;
                                cost_usd?: number | null;
                                input_tokens?: number | null;
                                output_tokens?: number | null;
                                saved_input_tokens?: number | null;
                                saved_output_tokens?: number | null;
                                skipped_calls?: number | null;
                            }
                            | null;
                        policy_hash?: string
                        | null;
                        policy_id?: string | null;
                        policy_version?: string | null;
                        prompt_version?: string | null;
                        rule_set_hash?: string | null;
                        rule_set_id?: string | null;
                        rule_set_version?: string | null;
                        rule_sets?:
                            | { hash?: string
                            | null; id: string; version: string }[]
                            | null;
                        settings?: string | null;
                        started_at?: string | null;
                        status?: "failed" | "done" | "running" | "pending" | null;
                        warnings?: string[] | null;
                    }
                    | null;
                request: { [key: string]: unknown };
                started_by?: string | null;
                status: string;
            },
        >;
        getTrial: (
            trialId: string,
        ) => Promise<
            {
                created_at: string;
                dataset_id: string;
                error?: string
                | null;
                finished_at?: string | null;
                id: string;
                progress?: { cached: number; done: number; total: number } | null;
                result?:
                    | {
                        analysis: {
                            conflicts: {
                                property: string;
                                target: string;
                                votes: { [key: string]: (...)[] };
                            }[];
                            elements: number;
                            gaps?: { patterns: (...)[]; property: string; uncovered: number }[];
                            rule_sets: string[];
                            rules: {
                                accuracy?: number | null;
                                conflicts: number;
                                conflicts_with: { [key: string]: number };
                                coverage: number;
                                overlaps: number;
                                rule: string;
                                votes: number;
                            }[];
                        };
                        llm_model?: string
                        | null;
                        llm_usage?:
                            | {
                                cached_calls?: number
                                | null;
                                calls?: number | null;
                                cost_usd?: number | null;
                                input_tokens?: number | null;
                                output_tokens?: number | null;
                                saved_input_tokens?: number | null;
                                saved_output_tokens?: number | null;
                                skipped_calls?: number | null;
                            }
                            | null;
                        policy: string;
                        proposals: {
                            band?: string
                            | null;
                            chosen: boolean;
                            confidence?: number | null;
                            human_verified?: boolean | null;
                            id: string;
                            property: string;
                            provenance?: "observed" | "declared" | "inferred" | "reviewed" | null;
                            rationale?: string | null;
                            raw_score?: number | null;
                            source_id?: string | null;
                            source_kind: "profiler" | "rule" | "recogniser" | "llm" | "human";
                            source_version?: string | null;
                            status?: "proposed" | "accepted" | "edited" | "rejected" | null;
                            target: string;
                            value: string;
                        }[];
                        rule_sets: string[];
                        warnings?: string[];
                    }
                    | null;
                status: string;
            },
        >;
        health: () => Promise<
            { database: string; status: string; version: string },
        >;
        history: (
            id: string,
            target?: string,
        ) => Promise<
            {
                author: string;
                changes?: {
                    action: | "proposed"
                    | "accepted"
                    | "edited"
                    | "rejected"
                    | "kept"
                    | "kept_rejected";
                    after?: string
                    | null;
                    before?: string | null;
                    confidence?: number | null;
                    property: string;
                    proposal_id?: string | null;
                    reviewed_in?: number | null;
                    target: string;
                    value: string;
                }[];
                created_at: string;
                kind: "review"
                | "run";
                note?: string | null;
                reconstructed: boolean;
                version: number;
            }[],
        >;
        importPolicy: (
            yaml: string,
        ) => Promise<
            {
                content_hash: string;
                created_at: string;
                editable: boolean;
                name: string;
                owner?: string
                | null;
                public: boolean;
                version: string;
                warnings?: string[];
            },
        >;
        importRuleSet: (
            yaml: string,
        ) => Promise<
            {
                content_hash: string;
                created_at: string;
                editable: boolean;
                name: string;
                owner?: string
                | null;
                public: boolean;
                version: string;
                warnings?: string[];
            },
        >;
        inbox: () => Promise<
            {
                created_at: string;
                dataset_id: string;
                dataset_name: string;
                from_user: { display_name: string; username: string };
                id: string;
                kind: string;
                status: string;
                to_user: { display_name: string; username: string };
            }[],
        >;
        invite: (
            id: string,
            kind: "review" | "co_owner" | "transfer",
            username: string,
        ) => Promise<
            {
                created_at: string;
                dataset_id: string;
                dataset_name: string;
                from_user: { display_name: string; username: string };
                id: string;
                kind: string;
                status: string;
                to_user: { display_name: string; username: string };
            },
        >;
        listDatasets: () => Promise<
            {
                access: string;
                created_at: string;
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                status: string;
            }[],
        >;
        listLlmModels: () => Promise<
            {
                columns_per_call: number;
                groups: {
                    error?: string
                    | null;
                    key: "server" | "own";
                    label: string;
                    models: {
                        id: string;
                        label: string;
                        suggested: boolean;
                        usd_per_call?: number | null;
                    }[];
                    provider: string;
                }[];
                max_usd: number;
                may_use_server: boolean;
                own_max_usd: number;
            },
        >;
        listPolicies: () => Promise<
            {
                content_hash: string;
                created_at: string;
                editable: boolean;
                name: string;
                owner?: string
                | null;
                public: boolean;
                version: string;
                warnings?: string[];
            }[],
        >;
        listProfiles: () => Promise<{ id: string; title: string }[]>;
        listRuleSets: () => Promise<
            {
                content_hash: string;
                created_at: string;
                editable: boolean;
                name: string;
                owner?: string
                | null;
                public: boolean;
                version: string;
                warnings?: string[];
            }[],
        >;
        listRuns: (
            id: string,
        ) => Promise<
            {
                archived_at?: string
                | null;
                archived_by?: string | null;
                created_at: string;
                dataset_id: string;
                error?: string | null;
                finished_at?: string | null;
                id: string;
                progress?: { cached: number; done: number; total: number } | null;
                record?:
                    | {
                        dataset_hash?: string
                        | null;
                        finished_at?: string | null;
                        id: string;
                        llm_model?: string | null;
                        llm_usage?:
                            | {
                                cached_calls?: number
                                | null;
                                calls?: number | null;
                                cost_usd?: number | null;
                                input_tokens?: number | null;
                                output_tokens?: number | null;
                                saved_input_tokens?: number | null;
                                saved_output_tokens?: number | null;
                                skipped_calls?: number | null;
                            }
                            | null;
                        policy_hash?: string
                        | null;
                        policy_id?: string | null;
                        policy_version?: string | null;
                        prompt_version?: string | null;
                        rule_set_hash?: string | null;
                        rule_set_id?: string | null;
                        rule_set_version?: string | null;
                        rule_sets?:
                            | { hash?: (...)
                            | (...)
                            | (...); id: string; version: string }[]
                            | null;
                        settings?: string | null;
                        started_at?: string | null;
                        status?: "failed" | "done" | "running" | "pending" | null;
                        warnings?: string[] | null;
                    }
                    | null;
                request: { [key: string]: unknown };
                started_by?: string | null;
                status: string;
            }[],
        >;
        listUsers: () => Promise<
            {
                created_at: string;
                display_name: string;
                is_admin: boolean;
                last_login_at?: string
                | null;
                llm_max_usd_per_run?: number | null;
                may_use_server_llm: boolean;
                status: string;
                username: string;
            }[],
        >;
        listVersions: (
            id: string,
        ) => Promise<
            {
                author: string;
                created_at: string;
                note?: string
                | null;
                parent?: number | null;
                run_id?: string | null;
                version: number;
            }[],
        >;
        llmEstimate: (
            id: string,
            model: string,
            key?: "server" | "own",
        ) => Promise<
            {
                cached_calls: number;
                calls: number;
                cost_usd?: number
                | null;
                fits_calls: number;
                input_tokens: number;
                max_usd: number;
                model: string;
                output_tokens: number;
            },
        >;
        llmSpending: (
            month?: string,
        ) => Promise<
            {
                by_key?: {
                    calls: number;
                    cost_usd: number;
                    input_tokens: number;
                    name: string;
                    output_tokens: number;
                    runs: number;
                }[];
                by_model: {
                    calls: number;
                    cost_usd: number;
                    input_tokens: number;
                    name: string;
                    output_tokens: number;
                    runs: number;
                }[];
                by_user: {
                    calls: number;
                    cost_usd: number;
                    input_tokens: number;
                    name: string;
                    output_tokens: number;
                    runs: number;
                }[];
                month: string;
                months: string[];
                total_usd: number;
                unpriced_runs: number;
            },
        >;
        llmSpendingCsvUrl: (month: string) => string;
        login: (
            username: string,
            password: string,
        ) => Promise<
            {
                default_llm_max_usd: number;
                display_name: string;
                has_token: boolean;
                is_admin: boolean;
                llm_max_usd_per_run?: number
                | null;
                may_use_server_llm: boolean;
                must_change_password: boolean;
                own_llm_max_usd_per_run?: number | null;
                pending_requests: number;
                token_created_at?: string | null;
                username: string;
            },
        >;
        members: (
            id: string,
        ) => Promise<
            {
                members: { display_name: string; role: string; username: string }[];
                owner: { display_name: string; username: string };
            },
        >;
        modelSettings: () => Promise<
            {
                models: {
                    hidden: boolean;
                    model: string;
                    usd_per_mtok_in?: number
                    | null;
                    usd_per_mtok_out?: number | null;
                }[];
                prices: {
                    error?: string
                    | null;
                    source: "built-in" | "downloaded";
                    updated_at?: string | null;
                    version: string;
                };
                server_models?: {
                    hidden: boolean;
                    id: string;
                    label: string;
                    provider: string;
                    usd_per_call?: number
                    | null;
                }[];
            },
        >;
        myLlmKeys: () => Promise<
            {
                created_at: string;
                hint: string;
                last_checked_at?: string
                | null;
                last_error?: string | null;
                provider: string;
                readable: boolean;
            }[],
        >;
        mySpending: (
            month?: string,
        ) => Promise<
            {
                by_key?: {
                    calls: number;
                    cost_usd: number;
                    input_tokens: number;
                    name: string;
                    output_tokens: number;
                    runs: number;
                }[];
                by_model: {
                    calls: number;
                    cost_usd: number;
                    input_tokens: number;
                    name: string;
                    output_tokens: number;
                    runs: number;
                }[];
                by_user: {
                    calls: number;
                    cost_usd: number;
                    input_tokens: number;
                    name: string;
                    output_tokens: number;
                    runs: number;
                }[];
                month: string;
                months: string[];
                total_usd: number;
                unpriced_runs: number;
            },
        >;
        mySpendingCsvUrl: (month: string) => string;
        ownership: (
            username: string,
        ) => Promise<
            {
                datasets: { id: string; name: string }[];
                policies: string[];
                rule_sets: string[];
            },
        >;
        refreshLlmModels: () => Promise<
            {
                columns_per_call: number;
                groups: {
                    error?: string
                    | null;
                    key: "server" | "own";
                    label: string;
                    models: {
                        id: string;
                        label: string;
                        suggested: boolean;
                        usd_per_call?: number | null;
                    }[];
                    provider: string;
                }[];
                max_usd: number;
                may_use_server: boolean;
                own_max_usd: number;
            },
        >;
        regenerateToken: () => Promise<string>;
        renameDataset: (
            id: string,
            name: string,
        ) => Promise<
            {
                access: string;
                created_at: string;
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                status: string;
            },
        >;
        resetModelSetting: (model: string) => Promise<void>;
        restoreRun: (
            runId: string,
        ) => Promise<
            {
                archived_at?: string
                | null;
                archived_by?: string | null;
                created_at: string;
                dataset_id: string;
                error?: string | null;
                finished_at?: string | null;
                id: string;
                progress?: { cached: number; done: number; total: number } | null;
                record?:
                    | {
                        dataset_hash?: string
                        | null;
                        finished_at?: string | null;
                        id: string;
                        llm_model?: string | null;
                        llm_usage?:
                            | {
                                cached_calls?: number
                                | null;
                                calls?: number | null;
                                cost_usd?: number | null;
                                input_tokens?: number | null;
                                output_tokens?: number | null;
                                saved_input_tokens?: number | null;
                                saved_output_tokens?: number | null;
                                skipped_calls?: number | null;
                            }
                            | null;
                        policy_hash?: string
                        | null;
                        policy_id?: string | null;
                        policy_version?: string | null;
                        prompt_version?: string | null;
                        rule_set_hash?: string | null;
                        rule_set_id?: string | null;
                        rule_set_version?: string | null;
                        rule_sets?:
                            | { hash?: string
                            | null; id: string; version: string }[]
                            | null;
                        settings?: string | null;
                        started_at?: string | null;
                        status?: "failed" | "done" | "running" | "pending" | null;
                        warnings?: string[] | null;
                    }
                    | null;
                request: { [key: string]: unknown };
                started_by?: string | null;
                status: string;
            },
        >;
        retrySource: (
            id: string,
            url?: string,
        ) => Promise<
            {
                access: string;
                created_at: string;
                dataset: {
                    citation?: string
                    | null;
                    creators?: string[] | null;
                    description?: string | null;
                    doi?: string | null;
                    id: string;
                    keywords?: string[] | null;
                    licence?: string | null;
                    publisher?: string | null;
                    resources?:
                        | {
                            description?: string
                            | null;
                            elements?:
                                | {
                                    aggregation?: ...;
                                    code_list?: ...;
                                    data_type?: ...;
                                    description?: ...;
                                    examples?: ...;
                                    id: ...;
                                    missing_values?: ...;
                                    name: ...;
                                    path: ...;
                                    references?: ...;
                                    required?: ...;
                                    role?: ...;
                                    spatial?: ...;
                                    statistics?: ...;
                                    temporal?: ...;
                                    text?: ...;
                                    title?: ...;
                                    unique?: ...;
                                    unit?: ...;
                                    unit_from?: ...;
                                }[]
                                | null;
                            error?: string
                            | null;
                            field_groups?:
                                | { id: ...; members?: ...; pattern: ...; varying?: ... }[]
                                | null;
                            format?: string | null;
                            id: string;
                            keywords?: string[] | null;
                            kind:
                                | "text"
                                | "media"
                                | "tabular"
                                | "hierarchical"
                                | "geospatial"
                                | "feed"
                                | "gridded";
                            licence?: string
                            | null;
                            location?: string | null;
                            media?:
                                | {
                                    captured_at?: (...)
                                    | (...)
                                    | (...);
                                    codec?: (...) | (...) | (...);
                                    duration_s?: (...) | (...) | (...);
                                    format?: (...) | (...) | (...);
                                    height?: (...) | (...) | (...);
                                    width?: (...) | (...) | (...);
                                }
                                | null;
                            name: string;
                            overlaps?: | {
                                codes?: ...;
                                distinct: ...;
                                from_element: ...;
                                matched: ...;
                                names_similar?: ...;
                                to_element: ...;
                                unmatched_examples?: ...;
                            }[]
                            | null;
                            publisher?: string
                            | null;
                            qualitative?:
                                | {
                                    codebook?: (...)
                                    | (...)
                                    | (...);
                                    consent_notes?: (...) | (...) | (...);
                                    speakers?: (...) | (...) | (...);
                                }
                                | null;
                            relationships?: | { from_element: ...; kind?: ...; to_element: ... }[]
                            | null;
                            role?: "data" | "lookup" | null;
                            row_count?: number | null;
                            sampled_rows?: number | null;
                            sha256?: string | null;
                            size_bytes?: number | null;
                            spatial?:
                                | {
                                    bbox?: (...)
                                    | (...)
                                    | (...);
                                    crs?: (...) | (...) | (...);
                                    feature_count?: (...) | (...) | (...);
                                    geometry_type?: (...) | (...) | (...);
                                }
                                | null;
                            standard?: string
                            | null;
                            status?: "ok" | "failed" | null;
                            structure?: "wide" | "long_series" | "events" | "indicator" | null;
                            temporal?:
                                | {
                                    end?: (...)
                                    | (...)
                                    | (...);
                                    format?: (...) | (...) | (...);
                                    resolution?: (...) | (...) | (...);
                                    start?: (...) | (...) | (...);
                                    time_zone?: (...) | (...) | (...);
                                }
                                | null;
                            text?: | {
                                encoding?: (...)
                                | (...)
                                | (...);
                                language?: (...) | (...) | (...);
                                length?: (...) | (...) | (...);
                                passages?: (...) | (...) | (...);
                                sections?: (...) | (...) | (...);
                            }
                            | null;
                            title?: string
                            | null;
                        }[]
                        | null;
                    source?: string
                    | null;
                    spatial?:
                        | {
                            bbox?: number[]
                            | null;
                            crs?: string | null;
                            feature_count?: number | null;
                            geometry_type?: string | null;
                        }
                        | null;
                    temporal?: | {
                        end?: string
                        | null;
                        format?: string | null;
                        resolution?: string | null;
                        start?: string | null;
                        time_zone?: string | null;
                    }
                    | null;
                    title?: string
                    | null;
                };
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                source: { [key: string]: unknown };
                status: string;
                warnings?: string[];
            },
        >;
        review: (
            id: string,
            body: {
                edits: {
                    action: "accept" | "edit" | "reject";
                    property: string;
                    proposal_id?: string | null;
                    target: string;
                    value?: string | null;
                }[];
                note?: string
                | null;
                parent: number;
            },
        ) => Promise<
            {
                author: string;
                content: {
                    citation?: string
                    | null;
                    creators?: string[] | null;
                    description?: string | null;
                    doi?: string | null;
                    id: string;
                    keywords?: string[] | null;
                    licence?: string | null;
                    publisher?: string | null;
                    resources?:
                        | {
                            description?: string
                            | null;
                            elements?:
                                | {
                                    aggregation?: ...;
                                    code_list?: ...;
                                    data_type?: ...;
                                    description?: ...;
                                    examples?: ...;
                                    id: ...;
                                    missing_values?: ...;
                                    name: ...;
                                    path: ...;
                                    references?: ...;
                                    required?: ...;
                                    role?: ...;
                                    spatial?: ...;
                                    statistics?: ...;
                                    temporal?: ...;
                                    text?: ...;
                                    title?: ...;
                                    unique?: ...;
                                    unit?: ...;
                                    unit_from?: ...;
                                }[]
                                | null;
                            error?: string
                            | null;
                            field_groups?:
                                | { id: ...; members?: ...; pattern: ...; varying?: ... }[]
                                | null;
                            format?: string | null;
                            id: string;
                            keywords?: string[] | null;
                            kind:
                                | "text"
                                | "media"
                                | "tabular"
                                | "hierarchical"
                                | "geospatial"
                                | "feed"
                                | "gridded";
                            licence?: string
                            | null;
                            location?: string | null;
                            media?:
                                | {
                                    captured_at?: (...)
                                    | (...)
                                    | (...);
                                    codec?: (...) | (...) | (...);
                                    duration_s?: (...) | (...) | (...);
                                    format?: (...) | (...) | (...);
                                    height?: (...) | (...) | (...);
                                    width?: (...) | (...) | (...);
                                }
                                | null;
                            name: string;
                            overlaps?: | {
                                codes?: ...;
                                distinct: ...;
                                from_element: ...;
                                matched: ...;
                                names_similar?: ...;
                                to_element: ...;
                                unmatched_examples?: ...;
                            }[]
                            | null;
                            publisher?: string
                            | null;
                            qualitative?:
                                | {
                                    codebook?: (...)
                                    | (...)
                                    | (...);
                                    consent_notes?: (...) | (...) | (...);
                                    speakers?: (...) | (...) | (...);
                                }
                                | null;
                            relationships?: | { from_element: ...; kind?: ...; to_element: ... }[]
                            | null;
                            role?: "data" | "lookup" | null;
                            row_count?: number | null;
                            sampled_rows?: number | null;
                            sha256?: string | null;
                            size_bytes?: number | null;
                            spatial?:
                                | {
                                    bbox?: (...)
                                    | (...)
                                    | (...);
                                    crs?: (...) | (...) | (...);
                                    feature_count?: (...) | (...) | (...);
                                    geometry_type?: (...) | (...) | (...);
                                }
                                | null;
                            standard?: string
                            | null;
                            status?: "ok" | "failed" | null;
                            structure?: "wide" | "long_series" | "events" | "indicator" | null;
                            temporal?:
                                | {
                                    end?: (...)
                                    | (...)
                                    | (...);
                                    format?: (...) | (...) | (...);
                                    resolution?: (...) | (...) | (...);
                                    start?: (...) | (...) | (...);
                                    time_zone?: (...) | (...) | (...);
                                }
                                | null;
                            text?: | {
                                encoding?: (...)
                                | (...)
                                | (...);
                                language?: (...) | (...) | (...);
                                length?: (...) | (...) | (...);
                                passages?: (...) | (...) | (...);
                                sections?: (...) | (...) | (...);
                            }
                            | null;
                            title?: string
                            | null;
                        }[]
                        | null;
                    source?: string
                    | null;
                    spatial?:
                        | {
                            bbox?: number[]
                            | null;
                            crs?: string | null;
                            feature_count?: number | null;
                            geometry_type?: string | null;
                        }
                        | null;
                    temporal?: | {
                        end?: string
                        | null;
                        format?: string | null;
                        resolution?: string | null;
                        start?: string | null;
                        time_zone?: string | null;
                    }
                    | null;
                    title?: string
                    | null;
                };
                created_at: string;
                dataset_id: string;
                note?: string
                | null;
                parent?: number | null;
                proposals: {
                    band?: string | null;
                    chosen: boolean;
                    confidence?: number | null;
                    human_verified?: boolean | null;
                    id: string;
                    property: string;
                    provenance?: "observed" | "declared" | "inferred" | "reviewed" | null;
                    rationale?: string | null;
                    raw_score?: number | null;
                    source_id?: string | null;
                    source_kind: "profiler" | "rule" | "recogniser" | "llm" | "human";
                    source_version?: string | null;
                    status?: "proposed" | "accepted" | "edited" | "rejected" | null;
                    target: string;
                    value: string;
                }[];
                run_id?: string
                | null;
                version: number;
            },
        >;
        reviewLogUrl: (id: string) => string;
        setDefaultVersion: (
            id: string,
            version: number | null,
        ) => Promise<
            {
                access: string;
                created_at: string;
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                status: string;
            },
        >;
        setModelSetting: (
            model: string,
            body: {
                hidden: boolean;
                usd_per_mtok_in?: number | null;
                usd_per_mtok_out?: number | null;
            },
        ) => Promise<
            {
                hidden: boolean;
                model: string;
                usd_per_mtok_in?: number
                | null;
                usd_per_mtok_out?: number | null;
            },
        >;
        setOwnCap: (
            usd: number | null,
        ) => Promise<
            {
                default_llm_max_usd: number;
                display_name: string;
                has_token: boolean;
                is_admin: boolean;
                llm_max_usd_per_run?: number
                | null;
                may_use_server_llm: boolean;
                must_change_password: boolean;
                own_llm_max_usd_per_run?: number | null;
                pending_requests: number;
                token_created_at?: string | null;
                username: string;
            },
        >;
        setPolicyPublic: (
            name: string,
            isPublic: boolean,
        ) => Promise<
            {
                content_hash: string;
                created_at: string;
                editable: boolean;
                name: string;
                owner?: string
                | null;
                public: boolean;
                version: string;
                warnings?: string[];
            }[],
        >;
        setPublic: (
            id: string,
            isPublic: boolean,
        ) => Promise<
            {
                access: string;
                created_at: string;
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                status: string;
            },
        >;
        setRuleSetPublic: (
            name: string,
            isPublic: boolean,
        ) => Promise<
            {
                content_hash: string;
                created_at: string;
                editable: boolean;
                name: string;
                owner?: string
                | null;
                public: boolean;
                version: string;
                warnings?: string[];
            }[],
        >;
        startRun: (
            id: string,
            body: {
                llm_key?: "server" | "own" | null;
                llm_model?: string | null;
                llm_refresh: boolean;
                policy?: { name: string; version?: string | null } | null;
                rule_set?: { name: string; version?: string | null } | null;
                rule_sets?: { name: string; version?: string | null }[] | null;
                start_fresh: boolean;
            },
        ) => Promise<
            {
                archived_at?: string
                | null;
                archived_by?: string | null;
                created_at: string;
                dataset_id: string;
                error?: string | null;
                finished_at?: string | null;
                id: string;
                progress?: { cached: number; done: number; total: number } | null;
                record?:
                    | {
                        dataset_hash?: string
                        | null;
                        finished_at?: string | null;
                        id: string;
                        llm_model?: string | null;
                        llm_usage?:
                            | {
                                cached_calls?: number
                                | null;
                                calls?: number | null;
                                cost_usd?: number | null;
                                input_tokens?: number | null;
                                output_tokens?: number | null;
                                saved_input_tokens?: number | null;
                                saved_output_tokens?: number | null;
                                skipped_calls?: number | null;
                            }
                            | null;
                        policy_hash?: string
                        | null;
                        policy_id?: string | null;
                        policy_version?: string | null;
                        prompt_version?: string | null;
                        rule_set_hash?: string | null;
                        rule_set_id?: string | null;
                        rule_set_version?: string | null;
                        rule_sets?:
                            | { hash?: string
                            | null; id: string; version: string }[]
                            | null;
                        settings?: string | null;
                        started_at?: string | null;
                        status?: "failed" | "done" | "running" | "pending" | null;
                        warnings?: string[] | null;
                    }
                    | null;
                request: { [key: string]: unknown };
                started_by?: string | null;
                status: string;
            },
        >;
        startTrial: (
            id: string,
            body: {
                llm_key?: "server" | "own" | null;
                llm_model?: string | null;
                llm_refresh: boolean;
                policy?: { name: string; version?: string | null } | null;
                rule_set?: { name: string; version?: string | null } | null;
                rule_sets?: { name: string; version?: string | null }[] | null;
                start_fresh: boolean;
            },
        ) => Promise<
            {
                created_at: string;
                dataset_id: string;
                error?: string
                | null;
                finished_at?: string | null;
                id: string;
                progress?: { cached: number; done: number; total: number } | null;
                result?:
                    | {
                        analysis: {
                            conflicts: {
                                property: string;
                                target: string;
                                votes: { [key: string]: (...)[] };
                            }[];
                            elements: number;
                            gaps?: { patterns: (...)[]; property: string; uncovered: number }[];
                            rule_sets: string[];
                            rules: {
                                accuracy?: number | null;
                                conflicts: number;
                                conflicts_with: { [key: string]: number };
                                coverage: number;
                                overlaps: number;
                                rule: string;
                                votes: number;
                            }[];
                        };
                        llm_model?: string
                        | null;
                        llm_usage?:
                            | {
                                cached_calls?: number
                                | null;
                                calls?: number | null;
                                cost_usd?: number | null;
                                input_tokens?: number | null;
                                output_tokens?: number | null;
                                saved_input_tokens?: number | null;
                                saved_output_tokens?: number | null;
                                skipped_calls?: number | null;
                            }
                            | null;
                        policy: string;
                        proposals: {
                            band?: string
                            | null;
                            chosen: boolean;
                            confidence?: number | null;
                            human_verified?: boolean | null;
                            id: string;
                            property: string;
                            provenance?: "observed" | "declared" | "inferred" | "reviewed" | null;
                            rationale?: string | null;
                            raw_score?: number | null;
                            source_id?: string | null;
                            source_kind: "profiler" | "rule" | "recogniser" | "llm" | "human";
                            source_version?: string | null;
                            status?: "proposed" | "accepted" | "edited" | "rejected" | null;
                            target: string;
                            value: string;
                        }[];
                        rule_sets: string[];
                        warnings?: string[];
                    }
                    | null;
                status: string;
            },
        >;
        storage: () => Promise<
            {
                datasets: {
                    database_bytes: number;
                    files_bytes: number;
                    id: string;
                    name: string;
                    owner?: string
                    | null;
                    runs: number;
                    versions: number;
                }[];
                total_database_bytes: number;
                total_files_bytes: number;
            },
        >;
        testLlmKey: (
            provider: string,
        ) => Promise<
            {
                created_at: string;
                hint: string;
                last_checked_at?: string
                | null;
                last_error?: string | null;
                provider: string;
                readable: boolean;
            },
        >;
        tryDrafts: (
            id: string,
            body: { also_on: string[]; yaml: string | null },
        ) => Promise<
            {
                results: {
                    agree: number;
                    covered: number;
                    dataset_id: string;
                    disagree: string[][];
                    name: string;
                }[];
            },
        >;
        updateMe: (
            display_name: string,
        ) => Promise<
            {
                default_llm_max_usd: number;
                display_name: string;
                has_token: boolean;
                is_admin: boolean;
                llm_max_usd_per_run?: number
                | null;
                may_use_server_llm: boolean;
                must_change_password: boolean;
                own_llm_max_usd_per_run?: number | null;
                pending_requests: number;
                token_created_at?: string | null;
                username: string;
            },
        >;
        updateUser: (
            username: string,
            body: {
                display_name?: string | null;
                llm_max_usd_per_run?: number | null;
                may_use_server_llm?: boolean | null;
                password?: string | null;
                status?: "active" | "disabled" | null;
            },
        ) => Promise<
            {
                created_at: string;
                display_name: string;
                is_admin: boolean;
                last_login_at?: string
                | null;
                llm_max_usd_per_run?: number | null;
                may_use_server_llm: boolean;
                status: string;
                username: string;
            },
        >;
        cancelRequest(requestId: string): Promise<void>;
        changePassword(current: string, next: string): Promise<void>;
        deleteDataset(id: string): Promise<void>;
        deletePolicyVersion(name: string, version: string): Promise<void>;
        deleteRuleSetVersion(name: string, version: string): Promise<void>;
        deleteUser(
            username: string,
            body: { delete_datasets?: string[]; transfer_to?: string | null },
        ): Promise<void>;
        getDictionary(
            id: string,
            version?: number,
        ): Promise<
            | {
                author: string;
                content: {
                    citation?: string
                    | null;
                    creators?: string[] | null;
                    description?: string | null;
                    doi?: string | null;
                    id: string;
                    keywords?: string[] | null;
                    licence?: string | null;
                    publisher?: string | null;
                    resources?:
                        | {
                            description?: string
                            | null;
                            elements?:
                                | {
                                    aggregation?: ...;
                                    code_list?: ...;
                                    data_type?: ...;
                                    description?: ...;
                                    examples?: ...;
                                    id: ...;
                                    missing_values?: ...;
                                    name: ...;
                                    path: ...;
                                    references?: ...;
                                    required?: ...;
                                    role?: ...;
                                    spatial?: ...;
                                    statistics?: ...;
                                    temporal?: ...;
                                    text?: ...;
                                    title?: ...;
                                    unique?: ...;
                                    unit?: ...;
                                    unit_from?: ...;
                                }[]
                                | null;
                            error?: string
                            | null;
                            field_groups?:
                                | { id: ...; members?: ...; pattern: ...; varying?: ... }[]
                                | null;
                            format?: string | null;
                            id: string;
                            keywords?: string[] | null;
                            kind:
                                | "text"
                                | "media"
                                | "tabular"
                                | "hierarchical"
                                | "geospatial"
                                | "feed"
                                | "gridded";
                            licence?: string
                            | null;
                            location?: string | null;
                            media?:
                                | {
                                    captured_at?: (...)
                                    | (...)
                                    | (...);
                                    codec?: (...) | (...) | (...);
                                    duration_s?: (...) | (...) | (...);
                                    format?: (...) | (...) | (...);
                                    height?: (...) | (...) | (...);
                                    width?: (...) | (...) | (...);
                                }
                                | null;
                            name: string;
                            overlaps?: | {
                                codes?: ...;
                                distinct: ...;
                                from_element: ...;
                                matched: ...;
                                names_similar?: ...;
                                to_element: ...;
                                unmatched_examples?: ...;
                            }[]
                            | null;
                            publisher?: string
                            | null;
                            qualitative?:
                                | {
                                    codebook?: (...)
                                    | (...)
                                    | (...);
                                    consent_notes?: (...) | (...) | (...);
                                    speakers?: (...) | (...) | (...);
                                }
                                | null;
                            relationships?: | { from_element: ...; kind?: ...; to_element: ... }[]
                            | null;
                            role?: "data" | "lookup" | null;
                            row_count?: number | null;
                            sampled_rows?: number | null;
                            sha256?: string | null;
                            size_bytes?: number | null;
                            spatial?:
                                | {
                                    bbox?: (...)
                                    | (...)
                                    | (...);
                                    crs?: (...) | (...) | (...);
                                    feature_count?: (...) | (...) | (...);
                                    geometry_type?: (...) | (...) | (...);
                                }
                                | null;
                            standard?: string
                            | null;
                            status?: "ok" | "failed" | null;
                            structure?: "wide" | "long_series" | "events" | "indicator" | null;
                            temporal?:
                                | {
                                    end?: (...)
                                    | (...)
                                    | (...);
                                    format?: (...) | (...) | (...);
                                    resolution?: (...) | (...) | (...);
                                    start?: (...) | (...) | (...);
                                    time_zone?: (...) | (...) | (...);
                                }
                                | null;
                            text?: | {
                                encoding?: (...)
                                | (...)
                                | (...);
                                language?: (...) | (...) | (...);
                                length?: (...) | (...) | (...);
                                passages?: (...) | (...) | (...);
                                sections?: (...) | (...) | (...);
                            }
                            | null;
                            title?: string
                            | null;
                        }[]
                        | null;
                    source?: string
                    | null;
                    spatial?:
                        | {
                            bbox?: number[]
                            | null;
                            crs?: string | null;
                            feature_count?: number | null;
                            geometry_type?: string | null;
                        }
                        | null;
                    temporal?: | {
                        end?: string
                        | null;
                        format?: string | null;
                        resolution?: string | null;
                        start?: string | null;
                        time_zone?: string | null;
                    }
                    | null;
                    title?: string
                    | null;
                };
                created_at: string;
                dataset_id: string;
                note?: string
                | null;
                parent?: number | null;
                proposals: {
                    band?: string | null;
                    chosen: boolean;
                    confidence?: number | null;
                    human_verified?: boolean | null;
                    id: string;
                    property: string;
                    provenance?: "observed" | "declared" | "inferred" | "reviewed" | null;
                    rationale?: string | null;
                    raw_score?: number | null;
                    source_id?: string | null;
                    source_kind: "profiler" | "rule" | "recogniser" | "llm" | "human";
                    source_version?: string | null;
                    status?: "proposed" | "accepted" | "edited" | "rejected" | null;
                    target: string;
                    value: string;
                }[];
                run_id?: string
                | null;
                version: number;
            }
            | null,
        >;
        logout(): Promise<void>;
        me(): Promise<
            | {
                default_llm_max_usd: number;
                display_name: string;
                has_token: boolean;
                is_admin: boolean;
                llm_max_usd_per_run?: number
                | null;
                may_use_server_llm: boolean;
                must_change_password: boolean;
                own_llm_max_usd_per_run?: number | null;
                pending_requests: number;
                token_created_at?: string | null;
                username: string;
            }
            | null,
        >;
        removeMember(id: string, username: string): Promise<void>;
        replaceFiles(
            id: string,
            files: File[],
        ): Promise<
            {
                access: string;
                created_at: string;
                dataset: {
                    citation?: string
                    | null;
                    creators?: string[] | null;
                    description?: string | null;
                    doi?: string | null;
                    id: string;
                    keywords?: string[] | null;
                    licence?: string | null;
                    publisher?: string | null;
                    resources?:
                        | {
                            description?: string
                            | null;
                            elements?:
                                | {
                                    aggregation?: | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...);
                                    code_list?: (...) | (...) | (...);
                                    data_type?:
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...);
                                    description?: (...) | (...) | (...);
                                    examples?: (...) | (...) | (...);
                                    id: string;
                                    missing_values?: (...) | (...) | (...);
                                    name: string;
                                    path: string;
                                    references?: (...) | (...) | (...);
                                    required?: (...) | (...) | (...) | (...);
                                    role?:
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...);
                                    spatial?: (...) | (...) | (...);
                                    statistics?: (...) | (...) | (...);
                                    temporal?: (...) | (...) | (...);
                                    text?: (...) | (...) | (...);
                                    title?: (...) | (...) | (...);
                                    unique?: (...) | (...) | (...) | (...);
                                    unit?: (...) | (...) | (...);
                                    unit_from?: (...) | (...) | (...);
                                }[]
                                | null;
                            error?: string
                            | null;
                            field_groups?:
                                | {
                                    id: string;
                                    members?: (...)
                                    | (...)
                                    | (...);
                                    pattern: string;
                                    varying?: (...) | (...) | (...);
                                }[]
                                | null;
                            format?: string
                            | null;
                            id: string;
                            keywords?: string[] | null;
                            kind:
                                | "text"
                                | "media"
                                | "tabular"
                                | "hierarchical"
                                | "geospatial"
                                | "feed"
                                | "gridded";
                            licence?: string
                            | null;
                            location?: string | null;
                            media?:
                                | {
                                    captured_at?: string
                                    | null;
                                    codec?: string | null;
                                    duration_s?: number | null;
                                    format?: string | null;
                                    height?: number | null;
                                    width?: number | null;
                                }
                                | null;
                            name: string;
                            overlaps?: | {
                                codes?: (...)
                                | (...)
                                | (...);
                                distinct: number;
                                from_element: string;
                                matched: number;
                                names_similar?: (...) | (...) | (...) | (...);
                                to_element: string;
                                unmatched_examples?: (...) | (...) | (...);
                            }[]
                            | null;
                            publisher?: string
                            | null;
                            qualitative?:
                                | {
                                    codebook?: (...)[]
                                    | null;
                                    consent_notes?: string | null;
                                    speakers?: (...)[] | null;
                                }
                                | null;
                            relationships?: | {
                                from_element: string;
                                kind?: (...)
                                | (...)
                                | (...)
                                | (...);
                                to_element: string;
                            }[]
                            | null;
                            role?: "data"
                            | "lookup"
                            | null;
                            row_count?: number | null;
                            sampled_rows?: number | null;
                            sha256?: string | null;
                            size_bytes?: number | null;
                            spatial?:
                                | {
                                    bbox?: (...)[]
                                    | null;
                                    crs?: string | null;
                                    feature_count?: number | null;
                                    geometry_type?: string | null;
                                }
                                | null;
                            standard?: string
                            | null;
                            status?: "ok" | "failed" | null;
                            structure?: "wide" | "long_series" | "events" | "indicator" | null;
                            temporal?:
                                | {
                                    end?: string
                                    | null;
                                    format?: string | null;
                                    resolution?: string | null;
                                    start?: string | null;
                                    time_zone?: string | null;
                                }
                                | null;
                            text?: | {
                                encoding?: string
                                | null;
                                language?: string | null;
                                length?: number | null;
                                passages?: (...)[] | null;
                                sections?: (...)[] | null;
                            }
                            | null;
                            title?: string
                            | null;
                        }[]
                        | null;
                    source?: string
                    | null;
                    spatial?:
                        | {
                            bbox?: number[]
                            | null;
                            crs?: string | null;
                            feature_count?: number | null;
                            geometry_type?: string | null;
                        }
                        | null;
                    temporal?: | {
                        end?: string
                        | null;
                        format?: string | null;
                        resolution?: string | null;
                        start?: string | null;
                        time_zone?: string | null;
                    }
                    | null;
                    title?: string
                    | null;
                };
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                source: { [key: string]: unknown };
                status: string;
                warnings?: string[];
            },
        >;
        revokeToken(): Promise<void>;
        savePack(
            id: string,
            body: {
                attribution?: string | null;
                dry_run: boolean;
                licence: string;
                name: string;
                source_url?: string | null;
                version: string;
            },
        ): Promise<
            {
                saved?: | {
                    content_hash: string;
                    created_at: string;
                    editable: boolean;
                    name: string;
                    owner?: string
                    | null;
                    public: boolean;
                    version: string;
                    warnings?: string[];
                }
                | null;
                yaml: string;
            },
        >;
        upload(
            files: File[],
            name?: string,
        ): Promise<
            {
                access: string;
                created_at: string;
                dataset: {
                    citation?: string
                    | null;
                    creators?: string[] | null;
                    description?: string | null;
                    doi?: string | null;
                    id: string;
                    keywords?: string[] | null;
                    licence?: string | null;
                    publisher?: string | null;
                    resources?:
                        | {
                            description?: string
                            | null;
                            elements?:
                                | {
                                    aggregation?: | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...);
                                    code_list?: (...) | (...) | (...);
                                    data_type?:
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...);
                                    description?: (...) | (...) | (...);
                                    examples?: (...) | (...) | (...);
                                    id: string;
                                    missing_values?: (...) | (...) | (...);
                                    name: string;
                                    path: string;
                                    references?: (...) | (...) | (...);
                                    required?: (...) | (...) | (...) | (...);
                                    role?:
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...);
                                    spatial?: (...) | (...) | (...);
                                    statistics?: (...) | (...) | (...);
                                    temporal?: (...) | (...) | (...);
                                    text?: (...) | (...) | (...);
                                    title?: (...) | (...) | (...);
                                    unique?: (...) | (...) | (...) | (...);
                                    unit?: (...) | (...) | (...);
                                    unit_from?: (...) | (...) | (...);
                                }[]
                                | null;
                            error?: string
                            | null;
                            field_groups?:
                                | {
                                    id: string;
                                    members?: (...)
                                    | (...)
                                    | (...);
                                    pattern: string;
                                    varying?: (...) | (...) | (...);
                                }[]
                                | null;
                            format?: string
                            | null;
                            id: string;
                            keywords?: string[] | null;
                            kind:
                                | "text"
                                | "media"
                                | "tabular"
                                | "hierarchical"
                                | "geospatial"
                                | "feed"
                                | "gridded";
                            licence?: string
                            | null;
                            location?: string | null;
                            media?:
                                | {
                                    captured_at?: string
                                    | null;
                                    codec?: string | null;
                                    duration_s?: number | null;
                                    format?: string | null;
                                    height?: number | null;
                                    width?: number | null;
                                }
                                | null;
                            name: string;
                            overlaps?: | {
                                codes?: (...)
                                | (...)
                                | (...);
                                distinct: number;
                                from_element: string;
                                matched: number;
                                names_similar?: (...) | (...) | (...) | (...);
                                to_element: string;
                                unmatched_examples?: (...) | (...) | (...);
                            }[]
                            | null;
                            publisher?: string
                            | null;
                            qualitative?:
                                | {
                                    codebook?: (...)[]
                                    | null;
                                    consent_notes?: string | null;
                                    speakers?: (...)[] | null;
                                }
                                | null;
                            relationships?: | {
                                from_element: string;
                                kind?: (...)
                                | (...)
                                | (...)
                                | (...);
                                to_element: string;
                            }[]
                            | null;
                            role?: "data"
                            | "lookup"
                            | null;
                            row_count?: number | null;
                            sampled_rows?: number | null;
                            sha256?: string | null;
                            size_bytes?: number | null;
                            spatial?:
                                | {
                                    bbox?: (...)[]
                                    | null;
                                    crs?: string | null;
                                    feature_count?: number | null;
                                    geometry_type?: string | null;
                                }
                                | null;
                            standard?: string
                            | null;
                            status?: "ok" | "failed" | null;
                            structure?: "wide" | "long_series" | "events" | "indicator" | null;
                            temporal?:
                                | {
                                    end?: string
                                    | null;
                                    format?: string | null;
                                    resolution?: string | null;
                                    start?: string | null;
                                    time_zone?: string | null;
                                }
                                | null;
                            text?: | {
                                encoding?: string
                                | null;
                                language?: string | null;
                                length?: number | null;
                                passages?: (...)[] | null;
                                sections?: (...)[] | null;
                            }
                            | null;
                            title?: string
                            | null;
                        }[]
                        | null;
                    source?: string
                    | null;
                    spatial?:
                        | {
                            bbox?: number[]
                            | null;
                            crs?: string | null;
                            feature_count?: number | null;
                            geometry_type?: string | null;
                        }
                        | null;
                    temporal?: | {
                        end?: string
                        | null;
                        format?: string | null;
                        resolution?: string | null;
                        start?: string | null;
                        time_zone?: string | null;
                    }
                    | null;
                    title?: string
                    | null;
                };
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                source: { [key: string]: unknown };
                status: string;
                warnings?: string[];
            },
        >;
    } = ...

    Type Declaration

    • acceptRequest: (
          id: string,
      ) => Promise<
          {
              created_at: string;
              dataset_id: string;
              dataset_name: string;
              from_user: { display_name: string; username: string };
              id: string;
              kind: string;
              status: string;
              to_user: { display_name: string; username: string };
          },
      >
    • addLlmKey: (
          body: { key: string; provider: "anthropic" | "google" | "openai" },
      ) => Promise<
          {
              created_at: string;
              hint: string;
              last_checked_at?: string
              | null;
              last_error?: string | null;
              provider: string;
              readable: boolean;
          },
      >
    • approveDrafts: (
          id: string,
          body: {
              draft_version: number | null;
              licence: string;
              name: string;
              yaml: string | null;
          },
      ) => Promise<
          {
              content_hash: string;
              created_at: string;
              editable: boolean;
              name: string;
              owner?: string
              | null;
              public: boolean;
              version: string;
              warnings?: string[];
          },
      >

      Save the draft (or an edited one) as my private rule set.

    • archiveRun: (
          runId: string,
      ) => Promise<
          {
              archived_at?: string
              | null;
              archived_by?: string | null;
              created_at: string;
              dataset_id: string;
              error?: string | null;
              finished_at?: string | null;
              id: string;
              progress?: { cached: number; done: number; total: number } | null;
              record?:
                  | {
                      dataset_hash?: string
                      | null;
                      finished_at?: string | null;
                      id: string;
                      llm_model?: string | null;
                      llm_usage?:
                          | {
                              cached_calls?: number
                              | null;
                              calls?: number | null;
                              cost_usd?: number | null;
                              input_tokens?: number | null;
                              output_tokens?: number | null;
                              saved_input_tokens?: number | null;
                              saved_output_tokens?: number | null;
                              skipped_calls?: number | null;
                          }
                          | null;
                      policy_hash?: string
                      | null;
                      policy_id?: string | null;
                      policy_version?: string | null;
                      prompt_version?: string | null;
                      rule_set_hash?: string | null;
                      rule_set_id?: string | null;
                      rule_set_version?: string | null;
                      rule_sets?:
                          | { hash?: string
                          | null; id: string; version: string }[]
                          | null;
                      settings?: string | null;
                      started_at?: string | null;
                      status?: "failed" | "done" | "running" | "pending" | null;
                      warnings?: string[] | null;
                  }
                  | null;
              request: { [key: string]: unknown };
              started_by?: string | null;
              status: string;
          },
      >

      Hide a run from the history by default; nothing is deleted.

    • clearLlmCache: () => Promise<{ deleted: number }>
    • createUser: (
          body: { display_name: string; password: string; username: string },
      ) => Promise<
          {
              created_at: string;
              display_name: string;
              is_admin: boolean;
              last_login_at?: string
              | null;
              llm_max_usd_per_run?: number | null;
              may_use_server_llm: boolean;
              status: string;
              username: string;
          },
      >
    • datasetRequests: (
          id: string,
      ) => Promise<
          {
              created_at: string;
              dataset_id: string;
              dataset_name: string;
              from_user: { display_name: string; username: string };
              id: string;
              kind: string;
              status: string;
              to_user: { display_name: string; username: string };
          }[],
      >

      Requests about this dataset still waiting for an answer (owners and co-owners).

    • declineRequest: (
          id: string,
      ) => Promise<
          {
              created_at: string;
              dataset_id: string;
              dataset_name: string;
              from_user: { display_name: string; username: string };
              id: string;
              kind: string;
              status: string;
              to_user: { display_name: string; username: string };
          },
      >
    • deleteLlmKey: (provider: string) => Promise<void>
    • directory: (q: string) => Promise<{ display_name: string; username: string }[]>

      Active users matching q, for inviting.

    • discardDrafts: (id: string) => Promise<void>

      Set the latest version's draft aside.

    • documentUrl: (id: string, format: string, version?: number) => string
    • exportDataset: (
          id: string,
          profile: string,
          version?: number,
      ) => Promise<
          {
              document: { [key: string]: unknown };
              profile: string;
              report: string[];
              valid: boolean;
              version: number;
          },
      >
    • fromSource: (
          body: {
              collections?: string[] | null;
              endpoint?: string | null;
              key_env?: string | null;
              kind: "url" | "ogcapi" | "openapi";
              name?: string | null;
              params?: { [key: string]: string } | null;
              url: string;
          },
      ) => Promise<
          {
              access: string;
              created_at: string;
              dataset: {
                  citation?: string
                  | null;
                  creators?: string[] | null;
                  description?: string | null;
                  doi?: string | null;
                  id: string;
                  keywords?: string[] | null;
                  licence?: string | null;
                  publisher?: string | null;
                  resources?:
                      | {
                          description?: string
                          | null;
                          elements?:
                              | {
                                  aggregation?: ...;
                                  code_list?: ...;
                                  data_type?: ...;
                                  description?: ...;
                                  examples?: ...;
                                  id: ...;
                                  missing_values?: ...;
                                  name: ...;
                                  path: ...;
                                  references?: ...;
                                  required?: ...;
                                  role?: ...;
                                  spatial?: ...;
                                  statistics?: ...;
                                  temporal?: ...;
                                  text?: ...;
                                  title?: ...;
                                  unique?: ...;
                                  unit?: ...;
                                  unit_from?: ...;
                              }[]
                              | null;
                          error?: string
                          | null;
                          field_groups?:
                              | { id: ...; members?: ...; pattern: ...; varying?: ... }[]
                              | null;
                          format?: string | null;
                          id: string;
                          keywords?: string[] | null;
                          kind:
                              | "text"
                              | "media"
                              | "tabular"
                              | "hierarchical"
                              | "geospatial"
                              | "feed"
                              | "gridded";
                          licence?: string
                          | null;
                          location?: string | null;
                          media?:
                              | {
                                  captured_at?: (...)
                                  | (...)
                                  | (...);
                                  codec?: (...) | (...) | (...);
                                  duration_s?: (...) | (...) | (...);
                                  format?: (...) | (...) | (...);
                                  height?: (...) | (...) | (...);
                                  width?: (...) | (...) | (...);
                              }
                              | null;
                          name: string;
                          overlaps?: | {
                              codes?: ...;
                              distinct: ...;
                              from_element: ...;
                              matched: ...;
                              names_similar?: ...;
                              to_element: ...;
                              unmatched_examples?: ...;
                          }[]
                          | null;
                          publisher?: string
                          | null;
                          qualitative?:
                              | {
                                  codebook?: (...)
                                  | (...)
                                  | (...);
                                  consent_notes?: (...) | (...) | (...);
                                  speakers?: (...) | (...) | (...);
                              }
                              | null;
                          relationships?: | { from_element: ...; kind?: ...; to_element: ... }[]
                          | null;
                          role?: "data" | "lookup" | null;
                          row_count?: number | null;
                          sampled_rows?: number | null;
                          sha256?: string | null;
                          size_bytes?: number | null;
                          spatial?:
                              | {
                                  bbox?: (...)
                                  | (...)
                                  | (...);
                                  crs?: (...) | (...) | (...);
                                  feature_count?: (...) | (...) | (...);
                                  geometry_type?: (...) | (...) | (...);
                              }
                              | null;
                          standard?: string
                          | null;
                          status?: "ok" | "failed" | null;
                          structure?: "wide" | "long_series" | "events" | "indicator" | null;
                          temporal?:
                              | {
                                  end?: (...)
                                  | (...)
                                  | (...);
                                  format?: (...) | (...) | (...);
                                  resolution?: (...) | (...) | (...);
                                  start?: (...) | (...) | (...);
                                  time_zone?: (...) | (...) | (...);
                              }
                              | null;
                          text?: | {
                              encoding?: (...)
                              | (...)
                              | (...);
                              language?: (...) | (...) | (...);
                              length?: (...) | (...) | (...);
                              passages?: (...) | (...) | (...);
                              sections?: (...) | (...) | (...);
                          }
                          | null;
                          title?: string
                          | null;
                      }[]
                      | null;
                  source?: string
                  | null;
                  spatial?:
                      | {
                          bbox?: number[]
                          | null;
                          crs?: string | null;
                          feature_count?: number | null;
                          geometry_type?: string | null;
                      }
                      | null;
                  temporal?: | {
                      end?: string
                      | null;
                      format?: string | null;
                      resolution?: string | null;
                      start?: string | null;
                      time_zone?: string | null;
                  }
                  | null;
                  title?: string
                  | null;
              };
              default_version?: number
              | null;
              error?: string | null;
              id: string;
              latest_version?: number | null;
              name: string;
              owner?: string | null;
              progress?: { bytes: number; stage: string; total?: number | null } | null;
              public: boolean;
              resource_count: number;
              source: { [key: string]: unknown };
              status: string;
              warnings?: string[];
          },
      >
    • getDataset: (
          id: string,
      ) => Promise<
          {
              access: string;
              created_at: string;
              dataset: {
                  citation?: string
                  | null;
                  creators?: string[] | null;
                  description?: string | null;
                  doi?: string | null;
                  id: string;
                  keywords?: string[] | null;
                  licence?: string | null;
                  publisher?: string | null;
                  resources?:
                      | {
                          description?: string
                          | null;
                          elements?:
                              | {
                                  aggregation?: ...;
                                  code_list?: ...;
                                  data_type?: ...;
                                  description?: ...;
                                  examples?: ...;
                                  id: ...;
                                  missing_values?: ...;
                                  name: ...;
                                  path: ...;
                                  references?: ...;
                                  required?: ...;
                                  role?: ...;
                                  spatial?: ...;
                                  statistics?: ...;
                                  temporal?: ...;
                                  text?: ...;
                                  title?: ...;
                                  unique?: ...;
                                  unit?: ...;
                                  unit_from?: ...;
                              }[]
                              | null;
                          error?: string
                          | null;
                          field_groups?:
                              | { id: ...; members?: ...; pattern: ...; varying?: ... }[]
                              | null;
                          format?: string | null;
                          id: string;
                          keywords?: string[] | null;
                          kind:
                              | "text"
                              | "media"
                              | "tabular"
                              | "hierarchical"
                              | "geospatial"
                              | "feed"
                              | "gridded";
                          licence?: string
                          | null;
                          location?: string | null;
                          media?:
                              | {
                                  captured_at?: (...)
                                  | (...)
                                  | (...);
                                  codec?: (...) | (...) | (...);
                                  duration_s?: (...) | (...) | (...);
                                  format?: (...) | (...) | (...);
                                  height?: (...) | (...) | (...);
                                  width?: (...) | (...) | (...);
                              }
                              | null;
                          name: string;
                          overlaps?: | {
                              codes?: ...;
                              distinct: ...;
                              from_element: ...;
                              matched: ...;
                              names_similar?: ...;
                              to_element: ...;
                              unmatched_examples?: ...;
                          }[]
                          | null;
                          publisher?: string
                          | null;
                          qualitative?:
                              | {
                                  codebook?: (...)
                                  | (...)
                                  | (...);
                                  consent_notes?: (...) | (...) | (...);
                                  speakers?: (...) | (...) | (...);
                              }
                              | null;
                          relationships?: | { from_element: ...; kind?: ...; to_element: ... }[]
                          | null;
                          role?: "data" | "lookup" | null;
                          row_count?: number | null;
                          sampled_rows?: number | null;
                          sha256?: string | null;
                          size_bytes?: number | null;
                          spatial?:
                              | {
                                  bbox?: (...)
                                  | (...)
                                  | (...);
                                  crs?: (...) | (...) | (...);
                                  feature_count?: (...) | (...) | (...);
                                  geometry_type?: (...) | (...) | (...);
                              }
                              | null;
                          standard?: string
                          | null;
                          status?: "ok" | "failed" | null;
                          structure?: "wide" | "long_series" | "events" | "indicator" | null;
                          temporal?:
                              | {
                                  end?: (...)
                                  | (...)
                                  | (...);
                                  format?: (...) | (...) | (...);
                                  resolution?: (...) | (...) | (...);
                                  start?: (...) | (...) | (...);
                                  time_zone?: (...) | (...) | (...);
                              }
                              | null;
                          text?: | {
                              encoding?: (...)
                              | (...)
                              | (...);
                              language?: (...) | (...) | (...);
                              length?: (...) | (...) | (...);
                              passages?: (...) | (...) | (...);
                              sections?: (...) | (...) | (...);
                          }
                          | null;
                          title?: string
                          | null;
                      }[]
                      | null;
                  source?: string
                  | null;
                  spatial?:
                      | {
                          bbox?: number[]
                          | null;
                          crs?: string | null;
                          feature_count?: number | null;
                          geometry_type?: string | null;
                      }
                      | null;
                  temporal?: | {
                      end?: string
                      | null;
                      format?: string | null;
                      resolution?: string | null;
                      start?: string | null;
                      time_zone?: string | null;
                  }
                  | null;
                  title?: string
                  | null;
              };
              default_version?: number
              | null;
              error?: string | null;
              id: string;
              latest_version?: number | null;
              name: string;
              owner?: string | null;
              progress?: { bytes: number; stage: string; total?: number | null } | null;
              public: boolean;
              resource_count: number;
              source: { [key: string]: unknown };
              status: string;
              warnings?: string[];
          },
      >
    • getDrafts: (
          id: string,
      ) => Promise<
          {
              decision: | {
                  rule_set?: string
                  | null;
                  status: string;
                  username: string;
              }
              | null;
              rules: {
                  columns: string[];
                  id: string;
                  pattern: string;
                  property: string;
                  source: string;
                  value: string;
                  weight: number;
              }[];
              version: number
              | null;
              yaml: string | null;
          },
      >

      The latest version's draft rules, and any decision on them.

    • getPolicy: (
          name: string,
          version: string,
      ) => Promise<
          {
              content: { [key: string]: unknown };
              content_hash: string;
              created_at: string;
              editable: boolean;
              name: string;
              owner?: string | null;
              public: boolean;
              version: string;
              warnings?: string[];
          },
      >
    • getPolicyYaml: (name: string, version: string) => Promise<string>
    • getReference: () => Promise<LinkMLSchema>
    • getReferenceMarkdown: () => Promise<string>
    • getReferenceYaml: () => Promise<string>
    • getRuleSet: (
          name: string,
          version: string,
      ) => Promise<
          {
              content: { [key: string]: unknown };
              content_hash: string;
              created_at: string;
              editable: boolean;
              name: string;
              owner?: string | null;
              public: boolean;
              version: string;
              warnings?: string[];
          },
      >
    • getRuleSetYaml: (name: string, version: string) => Promise<string>
    • getRun: (
          runId: string,
      ) => Promise<
          {
              archived_at?: string
              | null;
              archived_by?: string | null;
              created_at: string;
              dataset_id: string;
              error?: string | null;
              finished_at?: string | null;
              id: string;
              progress?: { cached: number; done: number; total: number } | null;
              record?:
                  | {
                      dataset_hash?: string
                      | null;
                      finished_at?: string | null;
                      id: string;
                      llm_model?: string | null;
                      llm_usage?:
                          | {
                              cached_calls?: number
                              | null;
                              calls?: number | null;
                              cost_usd?: number | null;
                              input_tokens?: number | null;
                              output_tokens?: number | null;
                              saved_input_tokens?: number | null;
                              saved_output_tokens?: number | null;
                              skipped_calls?: number | null;
                          }
                          | null;
                      policy_hash?: string
                      | null;
                      policy_id?: string | null;
                      policy_version?: string | null;
                      prompt_version?: string | null;
                      rule_set_hash?: string | null;
                      rule_set_id?: string | null;
                      rule_set_version?: string | null;
                      rule_sets?:
                          | { hash?: string
                          | null; id: string; version: string }[]
                          | null;
                      settings?: string | null;
                      started_at?: string | null;
                      status?: "failed" | "done" | "running" | "pending" | null;
                      warnings?: string[] | null;
                  }
                  | null;
              request: { [key: string]: unknown };
              started_by?: string | null;
              status: string;
          },
      >
    • getTrial: (
          trialId: string,
      ) => Promise<
          {
              created_at: string;
              dataset_id: string;
              error?: string
              | null;
              finished_at?: string | null;
              id: string;
              progress?: { cached: number; done: number; total: number } | null;
              result?:
                  | {
                      analysis: {
                          conflicts: {
                              property: string;
                              target: string;
                              votes: { [key: string]: (...)[] };
                          }[];
                          elements: number;
                          gaps?: { patterns: (...)[]; property: string; uncovered: number }[];
                          rule_sets: string[];
                          rules: {
                              accuracy?: number | null;
                              conflicts: number;
                              conflicts_with: { [key: string]: number };
                              coverage: number;
                              overlaps: number;
                              rule: string;
                              votes: number;
                          }[];
                      };
                      llm_model?: string
                      | null;
                      llm_usage?:
                          | {
                              cached_calls?: number
                              | null;
                              calls?: number | null;
                              cost_usd?: number | null;
                              input_tokens?: number | null;
                              output_tokens?: number | null;
                              saved_input_tokens?: number | null;
                              saved_output_tokens?: number | null;
                              skipped_calls?: number | null;
                          }
                          | null;
                      policy: string;
                      proposals: {
                          band?: string
                          | null;
                          chosen: boolean;
                          confidence?: number | null;
                          human_verified?: boolean | null;
                          id: string;
                          property: string;
                          provenance?: "observed" | "declared" | "inferred" | "reviewed" | null;
                          rationale?: string | null;
                          raw_score?: number | null;
                          source_id?: string | null;
                          source_kind: "profiler" | "rule" | "recogniser" | "llm" | "human";
                          source_version?: string | null;
                          status?: "proposed" | "accepted" | "edited" | "rejected" | null;
                          target: string;
                          value: string;
                      }[];
                      rule_sets: string[];
                      warnings?: string[];
                  }
                  | null;
              status: string;
          },
      >
    • health: () => Promise<{ database: string; status: string; version: string }>

      The API's health and the Knowtation version.

    • history: (
          id: string,
          target?: string,
      ) => Promise<
          {
              author: string;
              changes?: {
                  action: | "proposed"
                  | "accepted"
                  | "edited"
                  | "rejected"
                  | "kept"
                  | "kept_rejected";
                  after?: string
                  | null;
                  before?: string | null;
                  confidence?: number | null;
                  property: string;
                  proposal_id?: string | null;
                  reviewed_in?: number | null;
                  target: string;
                  value: string;
              }[];
              created_at: string;
              kind: "review"
              | "run";
              note?: string | null;
              reconstructed: boolean;
              version: number;
          }[],
      >

      Every version, newest first, with each review's changes; with a target, one element's history.

    • importPolicy: (
          yaml: string,
      ) => Promise<
          {
              content_hash: string;
              created_at: string;
              editable: boolean;
              name: string;
              owner?: string
              | null;
              public: boolean;
              version: string;
              warnings?: string[];
          },
      >
    • importRuleSet: (
          yaml: string,
      ) => Promise<
          {
              content_hash: string;
              created_at: string;
              editable: boolean;
              name: string;
              owner?: string
              | null;
              public: boolean;
              version: string;
              warnings?: string[];
          },
      >
    • inbox: () => Promise<
          {
              created_at: string;
              dataset_id: string;
              dataset_name: string;
              from_user: { display_name: string; username: string };
              id: string;
              kind: string;
              status: string;
              to_user: { display_name: string; username: string };
          }[],
      >

      Requests waiting for your answer (review and co-owner invitations, ownership offers).

    • invite: (
          id: string,
          kind: "review" | "co_owner" | "transfer",
          username: string,
      ) => Promise<
          {
              created_at: string;
              dataset_id: string;
              dataset_name: string;
              from_user: { display_name: string; username: string };
              id: string;
              kind: string;
              status: string;
              to_user: { display_name: string; username: string };
          },
      >
    • listDatasets: () => Promise<
          {
              access: string;
              created_at: string;
              default_version?: number
              | null;
              error?: string | null;
              id: string;
              latest_version?: number | null;
              name: string;
              owner?: string | null;
              progress?: { bytes: number; stage: string; total?: number | null } | null;
              public: boolean;
              resource_count: number;
              status: string;
          }[],
      >
    • listLlmModels: () => Promise<
          {
              columns_per_call: number;
              groups: {
                  error?: string
                  | null;
                  key: "server" | "own";
                  label: string;
                  models: {
                      id: string;
                      label: string;
                      suggested: boolean;
                      usd_per_call?: number | null;
                  }[];
                  provider: string;
              }[];
              max_usd: number;
              may_use_server: boolean;
              own_max_usd: number;
          },
      >

      The models whose provider key is set, cheapest first, and the run cap.

    • listPolicies: () => Promise<
          {
              content_hash: string;
              created_at: string;
              editable: boolean;
              name: string;
              owner?: string
              | null;
              public: boolean;
              version: string;
              warnings?: string[];
          }[],
      >
    • listProfiles: () => Promise<{ id: string; title: string }[]>
    • listRuleSets: () => Promise<
          {
              content_hash: string;
              created_at: string;
              editable: boolean;
              name: string;
              owner?: string
              | null;
              public: boolean;
              version: string;
              warnings?: string[];
          }[],
      >
    • listRuns: (
          id: string,
      ) => Promise<
          {
              archived_at?: string
              | null;
              archived_by?: string | null;
              created_at: string;
              dataset_id: string;
              error?: string | null;
              finished_at?: string | null;
              id: string;
              progress?: { cached: number; done: number; total: number } | null;
              record?:
                  | {
                      dataset_hash?: string
                      | null;
                      finished_at?: string | null;
                      id: string;
                      llm_model?: string | null;
                      llm_usage?:
                          | {
                              cached_calls?: number
                              | null;
                              calls?: number | null;
                              cost_usd?: number | null;
                              input_tokens?: number | null;
                              output_tokens?: number | null;
                              saved_input_tokens?: number | null;
                              saved_output_tokens?: number | null;
                              skipped_calls?: number | null;
                          }
                          | null;
                      policy_hash?: string
                      | null;
                      policy_id?: string | null;
                      policy_version?: string | null;
                      prompt_version?: string | null;
                      rule_set_hash?: string | null;
                      rule_set_id?: string | null;
                      rule_set_version?: string | null;
                      rule_sets?:
                          | { hash?: (...)
                          | (...)
                          | (...); id: string; version: string }[]
                          | null;
                      settings?: string | null;
                      started_at?: string | null;
                      status?: "failed" | "done" | "running" | "pending" | null;
                      warnings?: string[] | null;
                  }
                  | null;
              request: { [key: string]: unknown };
              started_by?: string | null;
              status: string;
          }[],
      >
    • listUsers: () => Promise<
          {
              created_at: string;
              display_name: string;
              is_admin: boolean;
              last_login_at?: string
              | null;
              llm_max_usd_per_run?: number | null;
              may_use_server_llm: boolean;
              status: string;
              username: string;
          }[],
      >
    • listVersions: (
          id: string,
      ) => Promise<
          {
              author: string;
              created_at: string;
              note?: string
              | null;
              parent?: number | null;
              run_id?: string | null;
              version: number;
          }[],
      >
    • llmEstimate: (
          id: string,
          model: string,
          key?: "server" | "own",
      ) => Promise<
          {
              cached_calls: number;
              calls: number;
              cost_usd?: number
              | null;
              fits_calls: number;
              input_tokens: number;
              max_usd: number;
              model: string;
              output_tokens: number;
          },
      >

      Calls, cached batches, tokens and cost a run with this model would have.

    • llmSpending: (
          month?: string,
      ) => Promise<
          {
              by_key?: {
                  calls: number;
                  cost_usd: number;
                  input_tokens: number;
                  name: string;
                  output_tokens: number;
                  runs: number;
              }[];
              by_model: {
                  calls: number;
                  cost_usd: number;
                  input_tokens: number;
                  name: string;
                  output_tokens: number;
                  runs: number;
              }[];
              by_user: {
                  calls: number;
                  cost_usd: number;
                  input_tokens: number;
                  name: string;
                  output_tokens: number;
                  runs: number;
              }[];
              month: string;
              months: string[];
              total_usd: number;
              unpriced_runs: number;
          },
      >

      A month's estimated LLM spending by person and model (admin).

    • llmSpendingCsvUrl: (month: string) => string

      The month's spending as CSV, one line per run or trial.

    • login: (
          username: string,
          password: string,
      ) => Promise<
          {
              default_llm_max_usd: number;
              display_name: string;
              has_token: boolean;
              is_admin: boolean;
              llm_max_usd_per_run?: number
              | null;
              may_use_server_llm: boolean;
              must_change_password: boolean;
              own_llm_max_usd_per_run?: number | null;
              pending_requests: number;
              token_created_at?: string | null;
              username: string;
          },
      >
    • members: (
          id: string,
      ) => Promise<
          {
              members: { display_name: string; role: string; username: string }[];
              owner: { display_name: string; username: string };
          },
      >
    • modelSettings: () => Promise<
          {
              models: {
                  hidden: boolean;
                  model: string;
                  usd_per_mtok_in?: number
                  | null;
                  usd_per_mtok_out?: number | null;
              }[];
              prices: {
                  error?: string
                  | null;
                  source: "built-in" | "downloaded";
                  updated_at?: string | null;
                  version: string;
              };
              server_models?: {
                  hidden: boolean;
                  id: string;
                  label: string;
                  provider: string;
                  usd_per_call?: number
                  | null;
              }[];
          },
      >

      Where LLM prices come from, and the models the admin priced or hid (admin).

    • myLlmKeys: () => Promise<
          {
              created_at: string;
              hint: string;
              last_checked_at?: string
              | null;
              last_error?: string | null;
              provider: string;
              readable: boolean;
          }[],
      >

      Your own LLM keys (never the key itself).

    • mySpending: (
          month?: string,
      ) => Promise<
          {
              by_key?: {
                  calls: number;
                  cost_usd: number;
                  input_tokens: number;
                  name: string;
                  output_tokens: number;
                  runs: number;
              }[];
              by_model: {
                  calls: number;
                  cost_usd: number;
                  input_tokens: number;
                  name: string;
                  output_tokens: number;
                  runs: number;
              }[];
              by_user: {
                  calls: number;
                  cost_usd: number;
                  input_tokens: number;
                  name: string;
                  output_tokens: number;
                  runs: number;
              }[];
              month: string;
              months: string[];
              total_usd: number;
              unpriced_runs: number;
          },
      >

      Your own estimated LLM spending in a month.

    • mySpendingCsvUrl: (month: string) => string
    • ownership: (
          username: string,
      ) => Promise<
          {
              datasets: { id: string; name: string }[];
              policies: string[];
              rule_sets: string[];
          },
      >
    • refreshLlmModels: () => Promise<
          {
              columns_per_call: number;
              groups: {
                  error?: string
                  | null;
                  key: "server" | "own";
                  label: string;
                  models: {
                      id: string;
                      label: string;
                      suggested: boolean;
                      usd_per_call?: number | null;
                  }[];
                  provider: string;
              }[];
              max_usd: number;
              may_use_server: boolean;
              own_max_usd: number;
          },
      >

      Ask the providers for their models again (your keys, and the server's for the admin).

    • regenerateToken: () => Promise<string>
    • renameDataset: (
          id: string,
          name: string,
      ) => Promise<
          {
              access: string;
              created_at: string;
              default_version?: number
              | null;
              error?: string | null;
              id: string;
              latest_version?: number | null;
              name: string;
              owner?: string | null;
              progress?: { bytes: number; stage: string; total?: number | null } | null;
              public: boolean;
              resource_count: number;
              status: string;
          },
      >
    • resetModelSetting: (model: string) => Promise<void>
    • restoreRun: (
          runId: string,
      ) => Promise<
          {
              archived_at?: string
              | null;
              archived_by?: string | null;
              created_at: string;
              dataset_id: string;
              error?: string | null;
              finished_at?: string | null;
              id: string;
              progress?: { cached: number; done: number; total: number } | null;
              record?:
                  | {
                      dataset_hash?: string
                      | null;
                      finished_at?: string | null;
                      id: string;
                      llm_model?: string | null;
                      llm_usage?:
                          | {
                              cached_calls?: number
                              | null;
                              calls?: number | null;
                              cost_usd?: number | null;
                              input_tokens?: number | null;
                              output_tokens?: number | null;
                              saved_input_tokens?: number | null;
                              saved_output_tokens?: number | null;
                              skipped_calls?: number | null;
                          }
                          | null;
                      policy_hash?: string
                      | null;
                      policy_id?: string | null;
                      policy_version?: string | null;
                      prompt_version?: string | null;
                      rule_set_hash?: string | null;
                      rule_set_id?: string | null;
                      rule_set_version?: string | null;
                      rule_sets?:
                          | { hash?: string
                          | null; id: string; version: string }[]
                          | null;
                      settings?: string | null;
                      started_at?: string | null;
                      status?: "failed" | "done" | "running" | "pending" | null;
                      warnings?: string[] | null;
                  }
                  | null;
              request: { [key: string]: unknown };
              started_by?: string | null;
              status: string;
          },
      >

      Show an archived run again.

    • retrySource: (
          id: string,
          url?: string,
      ) => Promise<
          {
              access: string;
              created_at: string;
              dataset: {
                  citation?: string
                  | null;
                  creators?: string[] | null;
                  description?: string | null;
                  doi?: string | null;
                  id: string;
                  keywords?: string[] | null;
                  licence?: string | null;
                  publisher?: string | null;
                  resources?:
                      | {
                          description?: string
                          | null;
                          elements?:
                              | {
                                  aggregation?: ...;
                                  code_list?: ...;
                                  data_type?: ...;
                                  description?: ...;
                                  examples?: ...;
                                  id: ...;
                                  missing_values?: ...;
                                  name: ...;
                                  path: ...;
                                  references?: ...;
                                  required?: ...;
                                  role?: ...;
                                  spatial?: ...;
                                  statistics?: ...;
                                  temporal?: ...;
                                  text?: ...;
                                  title?: ...;
                                  unique?: ...;
                                  unit?: ...;
                                  unit_from?: ...;
                              }[]
                              | null;
                          error?: string
                          | null;
                          field_groups?:
                              | { id: ...; members?: ...; pattern: ...; varying?: ... }[]
                              | null;
                          format?: string | null;
                          id: string;
                          keywords?: string[] | null;
                          kind:
                              | "text"
                              | "media"
                              | "tabular"
                              | "hierarchical"
                              | "geospatial"
                              | "feed"
                              | "gridded";
                          licence?: string
                          | null;
                          location?: string | null;
                          media?:
                              | {
                                  captured_at?: (...)
                                  | (...)
                                  | (...);
                                  codec?: (...) | (...) | (...);
                                  duration_s?: (...) | (...) | (...);
                                  format?: (...) | (...) | (...);
                                  height?: (...) | (...) | (...);
                                  width?: (...) | (...) | (...);
                              }
                              | null;
                          name: string;
                          overlaps?: | {
                              codes?: ...;
                              distinct: ...;
                              from_element: ...;
                              matched: ...;
                              names_similar?: ...;
                              to_element: ...;
                              unmatched_examples?: ...;
                          }[]
                          | null;
                          publisher?: string
                          | null;
                          qualitative?:
                              | {
                                  codebook?: (...)
                                  | (...)
                                  | (...);
                                  consent_notes?: (...) | (...) | (...);
                                  speakers?: (...) | (...) | (...);
                              }
                              | null;
                          relationships?: | { from_element: ...; kind?: ...; to_element: ... }[]
                          | null;
                          role?: "data" | "lookup" | null;
                          row_count?: number | null;
                          sampled_rows?: number | null;
                          sha256?: string | null;
                          size_bytes?: number | null;
                          spatial?:
                              | {
                                  bbox?: (...)
                                  | (...)
                                  | (...);
                                  crs?: (...) | (...) | (...);
                                  feature_count?: (...) | (...) | (...);
                                  geometry_type?: (...) | (...) | (...);
                              }
                              | null;
                          standard?: string
                          | null;
                          status?: "ok" | "failed" | null;
                          structure?: "wide" | "long_series" | "events" | "indicator" | null;
                          temporal?:
                              | {
                                  end?: (...)
                                  | (...)
                                  | (...);
                                  format?: (...) | (...) | (...);
                                  resolution?: (...) | (...) | (...);
                                  start?: (...) | (...) | (...);
                                  time_zone?: (...) | (...) | (...);
                              }
                              | null;
                          text?: | {
                              encoding?: (...)
                              | (...)
                              | (...);
                              language?: (...) | (...) | (...);
                              length?: (...) | (...) | (...);
                              passages?: (...) | (...) | (...);
                              sections?: (...) | (...) | (...);
                          }
                          | null;
                          title?: string
                          | null;
                      }[]
                      | null;
                  source?: string
                  | null;
                  spatial?:
                      | {
                          bbox?: number[]
                          | null;
                          crs?: string | null;
                          feature_count?: number | null;
                          geometry_type?: string | null;
                      }
                      | null;
                  temporal?: | {
                      end?: string
                      | null;
                      format?: string | null;
                      resolution?: string | null;
                      start?: string | null;
                      time_zone?: string | null;
                  }
                  | null;
                  title?: string
                  | null;
              };
              default_version?: number
              | null;
              error?: string | null;
              id: string;
              latest_version?: number | null;
              name: string;
              owner?: string | null;
              progress?: { bytes: number; stage: string; total?: number | null } | null;
              public: boolean;
              resource_count: number;
              source: { [key: string]: unknown };
              status: string;
              warnings?: string[];
          },
      >

      Read a dataset's source again in the background (a URL source may get a fresh link).

    • review: (
          id: string,
          body: {
              edits: {
                  action: "accept" | "edit" | "reject";
                  property: string;
                  proposal_id?: string | null;
                  target: string;
                  value?: string | null;
              }[];
              note?: string
              | null;
              parent: number;
          },
      ) => Promise<
          {
              author: string;
              content: {
                  citation?: string
                  | null;
                  creators?: string[] | null;
                  description?: string | null;
                  doi?: string | null;
                  id: string;
                  keywords?: string[] | null;
                  licence?: string | null;
                  publisher?: string | null;
                  resources?:
                      | {
                          description?: string
                          | null;
                          elements?:
                              | {
                                  aggregation?: ...;
                                  code_list?: ...;
                                  data_type?: ...;
                                  description?: ...;
                                  examples?: ...;
                                  id: ...;
                                  missing_values?: ...;
                                  name: ...;
                                  path: ...;
                                  references?: ...;
                                  required?: ...;
                                  role?: ...;
                                  spatial?: ...;
                                  statistics?: ...;
                                  temporal?: ...;
                                  text?: ...;
                                  title?: ...;
                                  unique?: ...;
                                  unit?: ...;
                                  unit_from?: ...;
                              }[]
                              | null;
                          error?: string
                          | null;
                          field_groups?:
                              | { id: ...; members?: ...; pattern: ...; varying?: ... }[]
                              | null;
                          format?: string | null;
                          id: string;
                          keywords?: string[] | null;
                          kind:
                              | "text"
                              | "media"
                              | "tabular"
                              | "hierarchical"
                              | "geospatial"
                              | "feed"
                              | "gridded";
                          licence?: string
                          | null;
                          location?: string | null;
                          media?:
                              | {
                                  captured_at?: (...)
                                  | (...)
                                  | (...);
                                  codec?: (...) | (...) | (...);
                                  duration_s?: (...) | (...) | (...);
                                  format?: (...) | (...) | (...);
                                  height?: (...) | (...) | (...);
                                  width?: (...) | (...) | (...);
                              }
                              | null;
                          name: string;
                          overlaps?: | {
                              codes?: ...;
                              distinct: ...;
                              from_element: ...;
                              matched: ...;
                              names_similar?: ...;
                              to_element: ...;
                              unmatched_examples?: ...;
                          }[]
                          | null;
                          publisher?: string
                          | null;
                          qualitative?:
                              | {
                                  codebook?: (...)
                                  | (...)
                                  | (...);
                                  consent_notes?: (...) | (...) | (...);
                                  speakers?: (...) | (...) | (...);
                              }
                              | null;
                          relationships?: | { from_element: ...; kind?: ...; to_element: ... }[]
                          | null;
                          role?: "data" | "lookup" | null;
                          row_count?: number | null;
                          sampled_rows?: number | null;
                          sha256?: string | null;
                          size_bytes?: number | null;
                          spatial?:
                              | {
                                  bbox?: (...)
                                  | (...)
                                  | (...);
                                  crs?: (...) | (...) | (...);
                                  feature_count?: (...) | (...) | (...);
                                  geometry_type?: (...) | (...) | (...);
                              }
                              | null;
                          standard?: string
                          | null;
                          status?: "ok" | "failed" | null;
                          structure?: "wide" | "long_series" | "events" | "indicator" | null;
                          temporal?:
                              | {
                                  end?: (...)
                                  | (...)
                                  | (...);
                                  format?: (...) | (...) | (...);
                                  resolution?: (...) | (...) | (...);
                                  start?: (...) | (...) | (...);
                                  time_zone?: (...) | (...) | (...);
                              }
                              | null;
                          text?: | {
                              encoding?: (...)
                              | (...)
                              | (...);
                              language?: (...) | (...) | (...);
                              length?: (...) | (...) | (...);
                              passages?: (...) | (...) | (...);
                              sections?: (...) | (...) | (...);
                          }
                          | null;
                          title?: string
                          | null;
                      }[]
                      | null;
                  source?: string
                  | null;
                  spatial?:
                      | {
                          bbox?: number[]
                          | null;
                          crs?: string | null;
                          feature_count?: number | null;
                          geometry_type?: string | null;
                      }
                      | null;
                  temporal?: | {
                      end?: string
                      | null;
                      format?: string | null;
                      resolution?: string | null;
                      start?: string | null;
                      time_zone?: string | null;
                  }
                  | null;
                  title?: string
                  | null;
              };
              created_at: string;
              dataset_id: string;
              note?: string
              | null;
              parent?: number | null;
              proposals: {
                  band?: string | null;
                  chosen: boolean;
                  confidence?: number | null;
                  human_verified?: boolean | null;
                  id: string;
                  property: string;
                  provenance?: "observed" | "declared" | "inferred" | "reviewed" | null;
                  rationale?: string | null;
                  raw_score?: number | null;
                  source_id?: string | null;
                  source_kind: "profiler" | "rule" | "recogniser" | "llm" | "human";
                  source_version?: string | null;
                  status?: "proposed" | "accepted" | "edited" | "rejected" | null;
                  target: string;
                  value: string;
              }[];
              run_id?: string
              | null;
              version: number;
          },
      >
    • reviewLogUrl: (id: string) => string
    • setDefaultVersion: (
          id: string,
          version: number | null,
      ) => Promise<
          {
              access: string;
              created_at: string;
              default_version?: number
              | null;
              error?: string | null;
              id: string;
              latest_version?: number | null;
              name: string;
              owner?: string | null;
              progress?: { bytes: number; stage: string; total?: number | null } | null;
              public: boolean;
              resource_count: number;
              status: string;
          },
      >

      Choose the version shown and exported by default (null: the latest).

    • setModelSetting: (
          model: string,
          body: {
              hidden: boolean;
              usd_per_mtok_in?: number | null;
              usd_per_mtok_out?: number | null;
          },
      ) => Promise<
          {
              hidden: boolean;
              model: string;
              usd_per_mtok_in?: number
              | null;
              usd_per_mtok_out?: number | null;
          },
      >
    • setOwnCap: (
          usd: number | null,
      ) => Promise<
          {
              default_llm_max_usd: number;
              display_name: string;
              has_token: boolean;
              is_admin: boolean;
              llm_max_usd_per_run?: number
              | null;
              may_use_server_llm: boolean;
              must_change_password: boolean;
              own_llm_max_usd_per_run?: number | null;
              pending_requests: number;
              token_created_at?: string | null;
              username: string;
          },
      >

      Your cap per run on your own LLM keys, in US dollars (null: the server's).

    • setPolicyPublic: (
          name: string,
          isPublic: boolean,
      ) => Promise<
          {
              content_hash: string;
              created_at: string;
              editable: boolean;
              name: string;
              owner?: string
              | null;
              public: boolean;
              version: string;
              warnings?: string[];
          }[],
      >
    • setPublic: (
          id: string,
          isPublic: boolean,
      ) => Promise<
          {
              access: string;
              created_at: string;
              default_version?: number
              | null;
              error?: string | null;
              id: string;
              latest_version?: number | null;
              name: string;
              owner?: string | null;
              progress?: { bytes: number; stage: string; total?: number | null } | null;
              public: boolean;
              resource_count: number;
              status: string;
          },
      >
    • setRuleSetPublic: (
          name: string,
          isPublic: boolean,
      ) => Promise<
          {
              content_hash: string;
              created_at: string;
              editable: boolean;
              name: string;
              owner?: string
              | null;
              public: boolean;
              version: string;
              warnings?: string[];
          }[],
      >

      Make every version of your rule set public or private.

    • startRun: (
          id: string,
          body: {
              llm_key?: "server" | "own" | null;
              llm_model?: string | null;
              llm_refresh: boolean;
              policy?: { name: string; version?: string | null } | null;
              rule_set?: { name: string; version?: string | null } | null;
              rule_sets?: { name: string; version?: string | null }[] | null;
              start_fresh: boolean;
          },
      ) => Promise<
          {
              archived_at?: string
              | null;
              archived_by?: string | null;
              created_at: string;
              dataset_id: string;
              error?: string | null;
              finished_at?: string | null;
              id: string;
              progress?: { cached: number; done: number; total: number } | null;
              record?:
                  | {
                      dataset_hash?: string
                      | null;
                      finished_at?: string | null;
                      id: string;
                      llm_model?: string | null;
                      llm_usage?:
                          | {
                              cached_calls?: number
                              | null;
                              calls?: number | null;
                              cost_usd?: number | null;
                              input_tokens?: number | null;
                              output_tokens?: number | null;
                              saved_input_tokens?: number | null;
                              saved_output_tokens?: number | null;
                              skipped_calls?: number | null;
                          }
                          | null;
                      policy_hash?: string
                      | null;
                      policy_id?: string | null;
                      policy_version?: string | null;
                      prompt_version?: string | null;
                      rule_set_hash?: string | null;
                      rule_set_id?: string | null;
                      rule_set_version?: string | null;
                      rule_sets?:
                          | { hash?: string
                          | null; id: string; version: string }[]
                          | null;
                      settings?: string | null;
                      started_at?: string | null;
                      status?: "failed" | "done" | "running" | "pending" | null;
                      warnings?: string[] | null;
                  }
                  | null;
              request: { [key: string]: unknown };
              started_by?: string | null;
              status: string;
          },
      >
    • startTrial: (
          id: string,
          body: {
              llm_key?: "server" | "own" | null;
              llm_model?: string | null;
              llm_refresh: boolean;
              policy?: { name: string; version?: string | null } | null;
              rule_set?: { name: string; version?: string | null } | null;
              rule_sets?: { name: string; version?: string | null }[] | null;
              start_fresh: boolean;
          },
      ) => Promise<
          {
              created_at: string;
              dataset_id: string;
              error?: string
              | null;
              finished_at?: string | null;
              id: string;
              progress?: { cached: number; done: number; total: number } | null;
              result?:
                  | {
                      analysis: {
                          conflicts: {
                              property: string;
                              target: string;
                              votes: { [key: string]: (...)[] };
                          }[];
                          elements: number;
                          gaps?: { patterns: (...)[]; property: string; uncovered: number }[];
                          rule_sets: string[];
                          rules: {
                              accuracy?: number | null;
                              conflicts: number;
                              conflicts_with: { [key: string]: number };
                              coverage: number;
                              overlaps: number;
                              rule: string;
                              votes: number;
                          }[];
                      };
                      llm_model?: string
                      | null;
                      llm_usage?:
                          | {
                              cached_calls?: number
                              | null;
                              calls?: number | null;
                              cost_usd?: number | null;
                              input_tokens?: number | null;
                              output_tokens?: number | null;
                              saved_input_tokens?: number | null;
                              saved_output_tokens?: number | null;
                              skipped_calls?: number | null;
                          }
                          | null;
                      policy: string;
                      proposals: {
                          band?: string
                          | null;
                          chosen: boolean;
                          confidence?: number | null;
                          human_verified?: boolean | null;
                          id: string;
                          property: string;
                          provenance?: "observed" | "declared" | "inferred" | "reviewed" | null;
                          rationale?: string | null;
                          raw_score?: number | null;
                          source_id?: string | null;
                          source_kind: "profiler" | "rule" | "recogniser" | "llm" | "human";
                          source_version?: string | null;
                          status?: "proposed" | "accepted" | "edited" | "rejected" | null;
                          target: string;
                          value: string;
                      }[];
                      rule_sets: string[];
                      warnings?: string[];
                  }
                  | null;
              status: string;
          },
      >

      Start trying rule sets, a policy and an LLM; nothing is stored. Poll with getTrial.

    • storage: () => Promise<
          {
              datasets: {
                  database_bytes: number;
                  files_bytes: number;
                  id: string;
                  name: string;
                  owner?: string
                  | null;
                  runs: number;
                  versions: number;
              }[];
              total_database_bytes: number;
              total_files_bytes: number;
          },
      >

      Every dataset's files and database space, biggest first (admin).

    • testLlmKey: (
          provider: string,
      ) => Promise<
          {
              created_at: string;
              hint: string;
              last_checked_at?: string
              | null;
              last_error?: string | null;
              provider: string;
              readable: boolean;
          },
      >
    • tryDrafts: (
          id: string,
          body: { also_on: string[]; yaml: string | null },
      ) => Promise<
          {
              results: {
                  agree: number;
                  covered: number;
                  dataset_id: string;
                  disagree: string[][];
                  name: string;
              }[];
          },
      >

      Run the draft (or an edited one) here and on other datasets; nothing is saved.

    • updateMe: (
          display_name: string,
      ) => Promise<
          {
              default_llm_max_usd: number;
              display_name: string;
              has_token: boolean;
              is_admin: boolean;
              llm_max_usd_per_run?: number
              | null;
              may_use_server_llm: boolean;
              must_change_password: boolean;
              own_llm_max_usd_per_run?: number | null;
              pending_requests: number;
              token_created_at?: string | null;
              username: string;
          },
      >
    • updateUser: (
          username: string,
          body: {
              display_name?: string | null;
              llm_max_usd_per_run?: number | null;
              may_use_server_llm?: boolean | null;
              password?: string | null;
              status?: "active" | "disabled" | null;
          },
      ) => Promise<
          {
              created_at: string;
              display_name: string;
              is_admin: boolean;
              last_login_at?: string
              | null;
              llm_max_usd_per_run?: number | null;
              may_use_server_llm: boolean;
              status: string;
              username: string;
          },
      >
    • cancelRequest: function
      • Parameters

        • requestId: string

        Returns Promise<void>

    • changePassword: function
      • Parameters

        • current: string
        • next: string

        Returns Promise<void>

    • deleteDataset: function
      • Delete a dataset with its runs, versions and files.

        Parameters

        • id: string

        Returns Promise<void>

    • deletePolicyVersion: function
      • Parameters

        • name: string
        • version: string

        Returns Promise<void>

    • deleteRuleSetVersion: function
      • Parameters

        • name: string
        • version: string

        Returns Promise<void>

    • deleteUser: function
      • Parameters

        • username: string
        • body: { delete_datasets?: string[]; transfer_to?: string | null }
          • Optionaldelete_datasets?: string[]

            Delete Datasets

          • Optionaltransfer_to?: string | null

            Transfer To

        Returns Promise<void>

    • getDictionary: function
      • The dictionary, or null when no run has produced one yet.

        Parameters

        • id: string
        • Optionalversion: number

        Returns Promise<
            | {
                author: string;
                content: {
                    citation?: string
                    | null;
                    creators?: string[] | null;
                    description?: string | null;
                    doi?: string | null;
                    id: string;
                    keywords?: string[] | null;
                    licence?: string | null;
                    publisher?: string | null;
                    resources?:
                        | {
                            description?: string
                            | null;
                            elements?:
                                | {
                                    aggregation?: ...;
                                    code_list?: ...;
                                    data_type?: ...;
                                    description?: ...;
                                    examples?: ...;
                                    id: ...;
                                    missing_values?: ...;
                                    name: ...;
                                    path: ...;
                                    references?: ...;
                                    required?: ...;
                                    role?: ...;
                                    spatial?: ...;
                                    statistics?: ...;
                                    temporal?: ...;
                                    text?: ...;
                                    title?: ...;
                                    unique?: ...;
                                    unit?: ...;
                                    unit_from?: ...;
                                }[]
                                | null;
                            error?: string
                            | null;
                            field_groups?:
                                | { id: ...; members?: ...; pattern: ...; varying?: ... }[]
                                | null;
                            format?: string | null;
                            id: string;
                            keywords?: string[] | null;
                            kind:
                                | "text"
                                | "media"
                                | "tabular"
                                | "hierarchical"
                                | "geospatial"
                                | "feed"
                                | "gridded";
                            licence?: string
                            | null;
                            location?: string | null;
                            media?:
                                | {
                                    captured_at?: (...)
                                    | (...)
                                    | (...);
                                    codec?: (...) | (...) | (...);
                                    duration_s?: (...) | (...) | (...);
                                    format?: (...) | (...) | (...);
                                    height?: (...) | (...) | (...);
                                    width?: (...) | (...) | (...);
                                }
                                | null;
                            name: string;
                            overlaps?: | {
                                codes?: ...;
                                distinct: ...;
                                from_element: ...;
                                matched: ...;
                                names_similar?: ...;
                                to_element: ...;
                                unmatched_examples?: ...;
                            }[]
                            | null;
                            publisher?: string
                            | null;
                            qualitative?:
                                | {
                                    codebook?: (...)
                                    | (...)
                                    | (...);
                                    consent_notes?: (...) | (...) | (...);
                                    speakers?: (...) | (...) | (...);
                                }
                                | null;
                            relationships?: | { from_element: ...; kind?: ...; to_element: ... }[]
                            | null;
                            role?: "data" | "lookup" | null;
                            row_count?: number | null;
                            sampled_rows?: number | null;
                            sha256?: string | null;
                            size_bytes?: number | null;
                            spatial?:
                                | {
                                    bbox?: (...)
                                    | (...)
                                    | (...);
                                    crs?: (...) | (...) | (...);
                                    feature_count?: (...) | (...) | (...);
                                    geometry_type?: (...) | (...) | (...);
                                }
                                | null;
                            standard?: string
                            | null;
                            status?: "ok" | "failed" | null;
                            structure?: "wide" | "long_series" | "events" | "indicator" | null;
                            temporal?:
                                | {
                                    end?: (...)
                                    | (...)
                                    | (...);
                                    format?: (...) | (...) | (...);
                                    resolution?: (...) | (...) | (...);
                                    start?: (...) | (...) | (...);
                                    time_zone?: (...) | (...) | (...);
                                }
                                | null;
                            text?: | {
                                encoding?: (...)
                                | (...)
                                | (...);
                                language?: (...) | (...) | (...);
                                length?: (...) | (...) | (...);
                                passages?: (...) | (...) | (...);
                                sections?: (...) | (...) | (...);
                            }
                            | null;
                            title?: string
                            | null;
                        }[]
                        | null;
                    source?: string
                    | null;
                    spatial?:
                        | {
                            bbox?: number[]
                            | null;
                            crs?: string | null;
                            feature_count?: number | null;
                            geometry_type?: string | null;
                        }
                        | null;
                    temporal?: | {
                        end?: string
                        | null;
                        format?: string | null;
                        resolution?: string | null;
                        start?: string | null;
                        time_zone?: string | null;
                    }
                    | null;
                    title?: string
                    | null;
                };
                created_at: string;
                dataset_id: string;
                note?: string
                | null;
                parent?: number | null;
                proposals: {
                    band?: string | null;
                    chosen: boolean;
                    confidence?: number | null;
                    human_verified?: boolean | null;
                    id: string;
                    property: string;
                    provenance?: "observed" | "declared" | "inferred" | "reviewed" | null;
                    rationale?: string | null;
                    raw_score?: number | null;
                    source_id?: string | null;
                    source_kind: "profiler" | "rule" | "recogniser" | "llm" | "human";
                    source_version?: string | null;
                    status?: "proposed" | "accepted" | "edited" | "rejected" | null;
                    target: string;
                    value: string;
                }[];
                run_id?: string
                | null;
                version: number;
            }
            | null,
        >

    • logout: function
      • Returns Promise<void>

    • me: function
      • The signed-in user, or null when signed out (a 401 here is the normal answer, not an error).

        Returns Promise<
            | {
                default_llm_max_usd: number;
                display_name: string;
                has_token: boolean;
                is_admin: boolean;
                llm_max_usd_per_run?: number
                | null;
                may_use_server_llm: boolean;
                must_change_password: boolean;
                own_llm_max_usd_per_run?: number | null;
                pending_requests: number;
                token_created_at?: string | null;
                username: string;
            }
            | null,
        >

    • removeMember: function
      • Parameters

        • id: string
        • username: string

        Returns Promise<void>

    • replaceFiles: function
      • Replace a dataset's files with new uploads, read in the background.

        Parameters

        • id: string
        • files: File[]

        Returns Promise<
            {
                access: string;
                created_at: string;
                dataset: {
                    citation?: string
                    | null;
                    creators?: string[] | null;
                    description?: string | null;
                    doi?: string | null;
                    id: string;
                    keywords?: string[] | null;
                    licence?: string | null;
                    publisher?: string | null;
                    resources?:
                        | {
                            description?: string
                            | null;
                            elements?:
                                | {
                                    aggregation?: | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...);
                                    code_list?: (...) | (...) | (...);
                                    data_type?:
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...);
                                    description?: (...) | (...) | (...);
                                    examples?: (...) | (...) | (...);
                                    id: string;
                                    missing_values?: (...) | (...) | (...);
                                    name: string;
                                    path: string;
                                    references?: (...) | (...) | (...);
                                    required?: (...) | (...) | (...) | (...);
                                    role?:
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...);
                                    spatial?: (...) | (...) | (...);
                                    statistics?: (...) | (...) | (...);
                                    temporal?: (...) | (...) | (...);
                                    text?: (...) | (...) | (...);
                                    title?: (...) | (...) | (...);
                                    unique?: (...) | (...) | (...) | (...);
                                    unit?: (...) | (...) | (...);
                                    unit_from?: (...) | (...) | (...);
                                }[]
                                | null;
                            error?: string
                            | null;
                            field_groups?:
                                | {
                                    id: string;
                                    members?: (...)
                                    | (...)
                                    | (...);
                                    pattern: string;
                                    varying?: (...) | (...) | (...);
                                }[]
                                | null;
                            format?: string
                            | null;
                            id: string;
                            keywords?: string[] | null;
                            kind:
                                | "text"
                                | "media"
                                | "tabular"
                                | "hierarchical"
                                | "geospatial"
                                | "feed"
                                | "gridded";
                            licence?: string
                            | null;
                            location?: string | null;
                            media?:
                                | {
                                    captured_at?: string
                                    | null;
                                    codec?: string | null;
                                    duration_s?: number | null;
                                    format?: string | null;
                                    height?: number | null;
                                    width?: number | null;
                                }
                                | null;
                            name: string;
                            overlaps?: | {
                                codes?: (...)
                                | (...)
                                | (...);
                                distinct: number;
                                from_element: string;
                                matched: number;
                                names_similar?: (...) | (...) | (...) | (...);
                                to_element: string;
                                unmatched_examples?: (...) | (...) | (...);
                            }[]
                            | null;
                            publisher?: string
                            | null;
                            qualitative?:
                                | {
                                    codebook?: (...)[]
                                    | null;
                                    consent_notes?: string | null;
                                    speakers?: (...)[] | null;
                                }
                                | null;
                            relationships?: | {
                                from_element: string;
                                kind?: (...)
                                | (...)
                                | (...)
                                | (...);
                                to_element: string;
                            }[]
                            | null;
                            role?: "data"
                            | "lookup"
                            | null;
                            row_count?: number | null;
                            sampled_rows?: number | null;
                            sha256?: string | null;
                            size_bytes?: number | null;
                            spatial?:
                                | {
                                    bbox?: (...)[]
                                    | null;
                                    crs?: string | null;
                                    feature_count?: number | null;
                                    geometry_type?: string | null;
                                }
                                | null;
                            standard?: string
                            | null;
                            status?: "ok" | "failed" | null;
                            structure?: "wide" | "long_series" | "events" | "indicator" | null;
                            temporal?:
                                | {
                                    end?: string
                                    | null;
                                    format?: string | null;
                                    resolution?: string | null;
                                    start?: string | null;
                                    time_zone?: string | null;
                                }
                                | null;
                            text?: | {
                                encoding?: string
                                | null;
                                language?: string | null;
                                length?: number | null;
                                passages?: (...)[] | null;
                                sections?: (...)[] | null;
                            }
                            | null;
                            title?: string
                            | null;
                        }[]
                        | null;
                    source?: string
                    | null;
                    spatial?:
                        | {
                            bbox?: number[]
                            | null;
                            crs?: string | null;
                            feature_count?: number | null;
                            geometry_type?: string | null;
                        }
                        | null;
                    temporal?: | {
                        end?: string
                        | null;
                        format?: string | null;
                        resolution?: string | null;
                        start?: string | null;
                        time_zone?: string | null;
                    }
                    | null;
                    title?: string
                    | null;
                };
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                source: { [key: string]: unknown };
                status: string;
                warnings?: string[];
            },
        >

    • revokeToken: function
      • Returns Promise<void>

    • savePack: function
      • Preview (dry_run) or save the latest version's reviewed code lists as a rule pack.

        Parameters

        • id: string
        • body: {
              attribution?: string | null;
              dry_run: boolean;
              licence: string;
              name: string;
              source_url?: string | null;
              version: string;
          }
          • Optionalattribution?: string | null

            Attribution

          • dry_run: boolean

            Dry Run

            Return the YAML without saving.

            false
            
          • licence: string

            Licence

            SPDX identifier of the codes' source licence.

          • name: string

            Name

            Pack name, e.g. world-bank-countries.

          • Optionalsource_url?: string | null

            Source Url

          • version: string

            Version

            Pack version, e.g. today's date 2026.10.23.

        Returns Promise<
            {
                saved?: | {
                    content_hash: string;
                    created_at: string;
                    editable: boolean;
                    name: string;
                    owner?: string
                    | null;
                    public: boolean;
                    version: string;
                    warnings?: string[];
                }
                | null;
                yaml: string;
            },
        >

    • upload: function
      • Parameters

        • files: File[]
        • Optionalname: string

        Returns Promise<
            {
                access: string;
                created_at: string;
                dataset: {
                    citation?: string
                    | null;
                    creators?: string[] | null;
                    description?: string | null;
                    doi?: string | null;
                    id: string;
                    keywords?: string[] | null;
                    licence?: string | null;
                    publisher?: string | null;
                    resources?:
                        | {
                            description?: string
                            | null;
                            elements?:
                                | {
                                    aggregation?: | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...)
                                    | (...);
                                    code_list?: (...) | (...) | (...);
                                    data_type?:
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...);
                                    description?: (...) | (...) | (...);
                                    examples?: (...) | (...) | (...);
                                    id: string;
                                    missing_values?: (...) | (...) | (...);
                                    name: string;
                                    path: string;
                                    references?: (...) | (...) | (...);
                                    required?: (...) | (...) | (...) | (...);
                                    role?:
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...);
                                    spatial?: (...) | (...) | (...);
                                    statistics?: (...) | (...) | (...);
                                    temporal?: (...) | (...) | (...);
                                    text?: (...) | (...) | (...);
                                    title?: (...) | (...) | (...);
                                    unique?: (...) | (...) | (...) | (...);
                                    unit?: (...) | (...) | (...);
                                    unit_from?: (...) | (...) | (...);
                                }[]
                                | null;
                            error?: string
                            | null;
                            field_groups?:
                                | {
                                    id: string;
                                    members?: (...)
                                    | (...)
                                    | (...);
                                    pattern: string;
                                    varying?: (...) | (...) | (...);
                                }[]
                                | null;
                            format?: string
                            | null;
                            id: string;
                            keywords?: string[] | null;
                            kind:
                                | "text"
                                | "media"
                                | "tabular"
                                | "hierarchical"
                                | "geospatial"
                                | "feed"
                                | "gridded";
                            licence?: string
                            | null;
                            location?: string | null;
                            media?:
                                | {
                                    captured_at?: string
                                    | null;
                                    codec?: string | null;
                                    duration_s?: number | null;
                                    format?: string | null;
                                    height?: number | null;
                                    width?: number | null;
                                }
                                | null;
                            name: string;
                            overlaps?: | {
                                codes?: (...)
                                | (...)
                                | (...);
                                distinct: number;
                                from_element: string;
                                matched: number;
                                names_similar?: (...) | (...) | (...) | (...);
                                to_element: string;
                                unmatched_examples?: (...) | (...) | (...);
                            }[]
                            | null;
                            publisher?: string
                            | null;
                            qualitative?:
                                | {
                                    codebook?: (...)[]
                                    | null;
                                    consent_notes?: string | null;
                                    speakers?: (...)[] | null;
                                }
                                | null;
                            relationships?: | {
                                from_element: string;
                                kind?: (...)
                                | (...)
                                | (...)
                                | (...);
                                to_element: string;
                            }[]
                            | null;
                            role?: "data"
                            | "lookup"
                            | null;
                            row_count?: number | null;
                            sampled_rows?: number | null;
                            sha256?: string | null;
                            size_bytes?: number | null;
                            spatial?:
                                | {
                                    bbox?: (...)[]
                                    | null;
                                    crs?: string | null;
                                    feature_count?: number | null;
                                    geometry_type?: string | null;
                                }
                                | null;
                            standard?: string
                            | null;
                            status?: "ok" | "failed" | null;
                            structure?: "wide" | "long_series" | "events" | "indicator" | null;
                            temporal?:
                                | {
                                    end?: string
                                    | null;
                                    format?: string | null;
                                    resolution?: string | null;
                                    start?: string | null;
                                    time_zone?: string | null;
                                }
                                | null;
                            text?: | {
                                encoding?: string
                                | null;
                                language?: string | null;
                                length?: number | null;
                                passages?: (...)[] | null;
                                sections?: (...)[] | null;
                            }
                            | null;
                            title?: string
                            | null;
                        }[]
                        | null;
                    source?: string
                    | null;
                    spatial?:
                        | {
                            bbox?: number[]
                            | null;
                            crs?: string | null;
                            feature_count?: number | null;
                            geometry_type?: string | null;
                        }
                        | null;
                    temporal?: | {
                        end?: string
                        | null;
                        format?: string | null;
                        resolution?: string | null;
                        start?: string | null;
                        time_zone?: string | null;
                    }
                    | null;
                    title?: string
                    | null;
                };
                default_version?: number
                | null;
                error?: string | null;
                id: string;
                latest_version?: number | null;
                name: string;
                owner?: string | null;
                progress?: { bytes: number; stage: string; total?: number | null } | null;
                public: boolean;
                resource_count: number;
                source: { [key: string]: unknown };
                status: string;
                warnings?: string[];
            },
        >