/** * @fileoverview Domain types for OpenAlex API interactions. * @module services/openalex/types */ export declare const ENTITY_TYPES: readonly ['works', 'authors', 'sources', 'institutions', 'topics', 'keywords', 'publishers', 'funders']; export type EntityType = (typeof ENTITY_TYPES)[number]; /** * Default `select` fields applied to search queries (not single-entity lookups) when the caller * doesn't specify `select`. Prevents 20-70KB-per-record responses from blowing up context windows. */ export declare const DEFAULT_SELECT: Record; export interface SearchParams { cursor?: string | undefined; entityType: EntityType; filters?: Record | undefined; id?: string | undefined; perPage?: number | undefined; query?: string | undefined; sample?: number | undefined; searchMode?: 'keyword' | 'exact' | 'semantic' | undefined; seed?: string | undefined; select?: string[] | undefined; sort?: string | undefined; } export interface SearchResult { meta: { count: number; per_page: number; next_cursor: string | null; }; results: EntityRecord[]; } export interface AnalyzeParams { cursor?: string | undefined; entityType: EntityType; filters?: Record | undefined; groupBy: string; includeUnknown?: boolean | undefined; /** * Sort order for groups. Omit (or `"count"`) for count-descending — the top-N groups by * count, matching OpenAlex's native default. Pass `"key"` to enumerate all distinct values * in key-ascending order with cursor pagination. */ order?: 'count' | 'key' | undefined; perPage?: number | undefined; } export interface AnalyzeResult { groups: GroupRecord[]; meta: { count: number; groups_count: number | null; next_cursor: string | null; }; } export interface AutocompleteParams { entityType?: EntityType | undefined; filters?: Record | undefined; query: string; } export interface AutocompleteResult { results: AutocompleteRecord[]; } export interface EntityRecord { /** * Null on records OpenAlex chose not to title — paratext works and other untitled entries, * roughly 0.5% of works. A page containing one is data, not a failure, so the type and the * tool output schemas both admit null rather than rejecting the whole page. */ display_name: string | null; id: string; [key: string]: unknown; } export interface GroupRecord { count: number; key: string; key_display_name: string; } export interface AutocompleteRecord { cited_by_count: number; /** * Never null from the autocomplete endpoint, which matches on this field. Null is reachable * only through the identifier path, which fetches the entity record directly and so inherits * `EntityRecord`'s untitled case. */ display_name: string | null; entity_type: string; external_id: string | null; hint: string | null; id: string; works_count: number | null; } //# sourceMappingURL=types.d.ts.map