@mcp-abap-adt/connection
Version:
ABAP connection layer for MCP ABAP ADT server
49 lines • 1.93 kB
TypeScript
import type { IAbapRequestOptions, IAdtResponse } from '@mcp-abap-adt/interfaces';
import type { SapConfig } from '../config/sapConfig.js';
import type { ILogger } from '../logger.js';
import type { AbapConnection } from './AbapConnection.js';
/**
* RFC-based connection for on-premise SAP systems.
*
* Uses node-rfc to call SADT_REST_RFC_ENDPOINT — the same standard SAP FM
* that Eclipse ADT uses for all on-premise ADT operations via JCo.
*
* RFC connections are inherently stateful: one ABAP session persists for the
* entire connection lifetime. This solves the HTTP 423 "invalid lock handle"
* problem on legacy systems (BASIS < 7.50) where HTTP stateful sessions
* are not supported.
*
* Connection parameters are derived from the standard ISapConfig.url field:
* http://saphost:8000 → ashost=saphost, sysnr=00
*
* Prerequisites:
* - SAP NW RFC SDK installed on the machine
* - node-rfc package installed: npm install node-rfc
*/
export declare class RfcAbapConnection implements AbapConnection {
private readonly config;
private readonly logger;
private rfcClient;
private readonly sessionId;
private readonly baseUrl;
private readonly rfcParams;
private sessionType;
private sessionCookie;
constructor(config: SapConfig, logger?: ILogger | null);
connect(): Promise<void>;
getBaseUrl(): Promise<string>;
getSessionId(): string | null;
setSessionType(type: 'stateful' | 'stateless'): void;
makeAdtRequest<T = any, D = any>(options: IAbapRequestOptions): Promise<IAdtResponse<T, D>>;
/**
* Reset the connection — for RFC this closes the session.
* Provides interface compatibility with HTTP connections.
*/
reset(): void;
/**
* Close the RFC connection and release the ABAP session.
*/
close(): Promise<void>;
private static validateConfig;
}
//# sourceMappingURL=RfcAbapConnection.d.ts.map