/** * Table reads on legacy systems (BASIS < 7.50, e.g. ECC 6.0 EhP7). * * The ADT data-preview endpoints behind GetSqlQuery (/datapreview/freestyle) * and GetTableContents (/datapreview/ddic) do not exist there, so the client * library refuses both. This module answers the same requests through the * ZMCP_ADT_DISPATCH action TABLE_READ instead — a read-only, allow-listed * SELECT on one table (abap/zmcp_adt_dispatch_ecc.abap, FORM table_read). * * Only simple single-table statements are translated: * SELECT f1, f2 | * FROM tab [AS a] [WHERE ] [ORDER BY …] * The WHERE text is passed on as an Open SQL condition; the ABAP side rejects * sub-queries and any table outside its allow list. JOINs, UNION, GROUP BY and * aggregates are refused here with a clear message. */ import type { IAbapConnection } from '@babamba2/mcp-abap-adt-interfaces'; import type { SqlQueryResponse } from '../handlers/system/readonly/handleGetSqlQuery'; /** Tables the dispatcher's TABLE_READ accepts (keep in sync with the ABAP allow list). */ export declare const LEGACY_READABLE_TABLES: readonly ["MODACT", "MODATTR", "MODSAP", "GB31", "GB92", "GB93", "T001D", "T001Q", "TBE24", "TBE34", "TPS34", "TFRM", "TFRMT", "T100", "TSTC", "TSTCP", "DD03L", "DD04L"]; /** Row cap of the ABAP TABLE_READ action (FORM table_read: max_rows > 5000 → 5000). */ export declare const DISPATCH_MAX_ROWS = 5000; /** True for the client library's "not supported on this SAP system (legacy …)" refusal. */ export declare function isLegacyUnsupported(error: unknown): boolean; export interface SimpleSelect { table: string; fields: string[]; where: string; } /** * Parse a single-table SELECT into { table, fields, where }. Returns null for * anything else (joins, unions, aggregates, grouping, sub-selects). */ export declare function parseSimpleSelect(sql: string): SimpleSelect | null; /** * Read rows through ZMCP_ADT_DISPATCH TABLE_READ and return them in the * GetSqlQuery response shape. */ export declare function legacyTableRead(connection: IAbapConnection, req: { table: string; fields?: string[]; where?: string; maxRows: number; sqlQuery?: string; }): Promise; //# sourceMappingURL=legacyTableRead.d.ts.map