/** * Typed SmartForm RFC client. * * Wraps callDispatch (ZMCP_ADT_DISPATCH SAP-side) with typed TypeScript * functions for the three SSF_* actions (EXISTS, DOWNLOAD, UPLOAD). * * Lives in Layer 2 (vendor MCP) for now — packaged with the existing RFC * backend. Future refactor may extract this into Layer 1 * (@babamba2/mcp-abap-adt-clients) once the clients library has its own * SOAP RFC dispatcher. */ import type { IAbapConnection } from '@babamba2/mcp-abap-adt-interfaces'; /** * Output of SSF_EXISTS — full meta block from Z_MCP_SSF_EXISTS. * * Nested ABAP STXFADM fields are surfaced as snake_case strings (no type * coercion) — the caller decides what to do with empty / placeholder values * for non-existent forms. */ export interface SmartFormExistsMeta { form_name: string; exists: boolean; runtime_fm: string; master_language: string; devclass: string; version: string; form_type: string; created_by: string; created_at: string; last_changed_by: string; last_changed_at: string; } /** * Output of SSF_DOWNLOAD — full DTO envelope. * * `strn` mirrors the ABAP DDIC structure EFG_STRN_SMARTFORM (deep — * includes header, language vector, T_XML lines). Treated as opaque by * most callers; only the round-trip to UPLOAD relies on byte-identity of * t_xml. The header sub-structure can be inspected for non-binary metadata. */ export interface SmartFormDownloadDto { schema_version: string; meta: { form_name: string; language: string; runtime_fm: string; }; strn: SmartFormStrn; } /** * Mirror of EFG_STRN_SMARTFORM — kept loose because the ABAP structure is * deep + evolves with kernel patches. Only the fields we actively read or * override are typed; everything else passes through opaquely. */ export interface SmartFormStrn { header?: { formname?: string; caption?: string; formtype?: string; masterlang?: string; devclass?: string; [k: string]: unknown; }; /** XML lines table — opaque, must round-trip byte-for-byte to UPLOAD. */ t_xml?: unknown[]; [k: string]: unknown; } export interface UploadSmartFormOptions { /** Target form name. Overrides the source form name embedded in dto.strn.header.formname. */ formName: string; /** Master language (1-char). Default 'E'. */ language?: string; /** Target package. Default '$TMP'. */ devclass?: string; /** Transport request (only required for non-$TMP devclass). */ transport?: string; /** When true, replaces existing form (mode='MODIFY'); when false, fails if exists. Default false. */ overwrite?: boolean; } export interface SmartFormUploadResult { generated_fm: string; transport: string; } /** * SSF_EXISTS — check if a Smart Form exists and return meta. * * Always returns successfully (even for non-existent forms). The caller * inspects `meta.exists` to determine presence. Throws only on RFC channel * errors (auth, network, dispatcher subrc != 0). */ export declare function smartFormExists(connection: IAbapConnection, formName: string): Promise; /** * SSF_DOWNLOAD — read a Smart Form into the round-trip DTO envelope. * * Throws if the form does not exist (subrc=1 from dispatcher). Use * smartFormExists() first if existence is uncertain. * * @param language 1-char ABAP language key (default 'E'). The form's master * language is read regardless; this controls only language- * keyed text variants. */ export declare function smartFormDownload(connection: IAbapConnection, formName: string, language?: string): Promise; /** * SSF_UPLOAD — create or replace a Smart Form from a DTO envelope. * * The DTO is typically the output of smartFormDownload() (round-trip) or * a synthetically-built one (image-to-form generation path). The * form name in the DTO is overridden by options.formName before save. * * @returns The runtime FM name generated for the saved form, plus the * transport assignment (empty string for $TMP). */ export declare function smartFormUpload(connection: IAbapConnection, dto: SmartFormDownloadDto, options: UploadSmartFormOptions): Promise; //# sourceMappingURL=smartForm.d.ts.map