@mcp-abap-adt/interfaces 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +17 -1
- package/dist/connection/IWebSocketTransport.d.ts +87 -0
- package/dist/connection/IWebSocketTransport.d.ts.map +1 -0
- package/dist/connection/IWebSocketTransport.js +8 -0
- package/dist/execution/IExecutor.d.ts +10 -0
- package/dist/execution/IExecutor.d.ts.map +1 -0
- package/dist/execution/IExecutor.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.5.0] - 2026-02-14
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Added execution contract interface:
|
|
14
|
+
- `IExecutor<TTarget, TResult, TRunWithProfilerOptions, TRunWithProfilingOptions, TRunWithProfilingResult>`
|
|
15
|
+
- Exported `IExecutor` from package root (`@mcp-abap-adt/interfaces`).
|
|
16
|
+
|
|
17
|
+
## [2.4.0] - 2026-02-13
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
- Added generic realtime WebSocket transport contracts in connection domain:
|
|
21
|
+
- `IWebSocketTransport`
|
|
22
|
+
- `IWebSocketConnectOptions`
|
|
23
|
+
- `IWebSocketCloseInfo`
|
|
24
|
+
- `IWebSocketMessageEnvelope`
|
|
25
|
+
- `IWebSocketMessageHandler`
|
|
26
|
+
- Exported all new WebSocket contracts from package root.
|
|
27
|
+
|
|
10
28
|
## [2.3.0] - 2026-02-10
|
|
11
29
|
|
|
12
30
|
### Added
|
package/README.md
CHANGED
|
@@ -19,7 +19,8 @@ This package contains all interfaces organized by domain:
|
|
|
19
19
|
- **`token/`** - Token-related interfaces (token provider, results, options)
|
|
20
20
|
- **`session/`** - Session storage interface
|
|
21
21
|
- **`serviceKey/`** - Service key storage interface
|
|
22
|
-
- **`connection/`** - Connection interfaces (AbapConnection, request options)
|
|
22
|
+
- **`connection/`** - Connection and realtime transport interfaces (AbapConnection, request options, WebSocket transport contracts)
|
|
23
|
+
- **`execution/`** - Execution contracts for runnable entities (`IExecutor`)
|
|
23
24
|
- **`sap/`** - SAP-specific configuration (SapConfig, SapAuthType)
|
|
24
25
|
- **`storage/`** - Storage interfaces (session storage, state)
|
|
25
26
|
- **`logging/`** - Logging interfaces (ILogger, LogLevel enum)
|
|
@@ -44,6 +45,9 @@ import {
|
|
|
44
45
|
IServiceKeyStore,
|
|
45
46
|
ITokenProvider,
|
|
46
47
|
IAbapConnection,
|
|
48
|
+
IExecutor,
|
|
49
|
+
IWebSocketTransport,
|
|
50
|
+
IWebSocketMessageEnvelope,
|
|
47
51
|
ISapConfig,
|
|
48
52
|
ILogger,
|
|
49
53
|
TOKEN_PROVIDER_ERROR_CODES,
|
|
@@ -185,11 +189,23 @@ This package is responsible for:
|
|
|
185
189
|
- For JWT: token refresh handled internally via `ITokenRefresher`
|
|
186
190
|
- For Basic: no token refresh needed
|
|
187
191
|
- `IAdtResponse` - Minimal response shape returned by `makeAdtRequest()`
|
|
192
|
+
- `IWebSocketTransport` - Generic realtime transport contract for WS-based flows
|
|
193
|
+
- Methods: `connect()`, `disconnect()`, `send()`, `onMessage()`, `onOpen()`, `onError()`, `onClose()`, `isConnected()`
|
|
194
|
+
- `IWebSocketConnectOptions` - WS connect options (`protocols`, `headers`, timeouts, heartbeat)
|
|
195
|
+
- `IWebSocketMessageEnvelope` - Generic request/response/event/error message shape with correlation id
|
|
196
|
+
- `IWebSocketCloseInfo` / `IWebSocketMessageHandler` - Close payload and message callback contracts
|
|
188
197
|
- `IAbapConnectionExtended` - Deprecated, for backward compatibility
|
|
189
198
|
- Extends `IAbapConnection` with: `getConfig()`, `getAuthHeaders()`, `connect()`, `reset()`
|
|
190
199
|
- Will be removed in next major version
|
|
191
200
|
- `IAbapRequestOptions` - Request options for ADT operations
|
|
192
201
|
|
|
202
|
+
### Execution Domain (`execution/`)
|
|
203
|
+
- `IExecutor<TTarget, TResult, TRunWithProfilerOptions, TRunWithProfilingOptions, TRunWithProfilingResult>`
|
|
204
|
+
- Generic contract for entities that support:
|
|
205
|
+
- `run(target)`
|
|
206
|
+
- `runWithProfiler(target, options)`
|
|
207
|
+
- `runWithProfiling(target, options?)`
|
|
208
|
+
|
|
193
209
|
### SAP Domain (`sap/`)
|
|
194
210
|
- `ISapConfig` - SAP connection configuration
|
|
195
211
|
- `SapAuthType` - Authentication type: `"basic" | "jwt"`
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic WebSocket transport contracts.
|
|
3
|
+
*
|
|
4
|
+
* This interface is intentionally domain-agnostic and can be reused by
|
|
5
|
+
* debugger, tracing, and any other realtime ADT flows.
|
|
6
|
+
*/
|
|
7
|
+
export interface IWebSocketConnectOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Optional subprotocols for the WS handshake.
|
|
10
|
+
*/
|
|
11
|
+
protocols?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Request headers used during connection handshake.
|
|
14
|
+
*/
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
|
+
/**
|
|
17
|
+
* Connection timeout in milliseconds.
|
|
18
|
+
*/
|
|
19
|
+
connectTimeoutMs?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Optional heartbeat interval in milliseconds.
|
|
22
|
+
*/
|
|
23
|
+
heartbeatIntervalMs?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface IWebSocketCloseInfo {
|
|
26
|
+
code: number;
|
|
27
|
+
reason?: string;
|
|
28
|
+
wasClean?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface IWebSocketMessageEnvelope<T = unknown> {
|
|
31
|
+
/**
|
|
32
|
+
* Message category. Keep generic to support different realtime domains.
|
|
33
|
+
*/
|
|
34
|
+
kind: 'request' | 'response' | 'event' | 'error';
|
|
35
|
+
/**
|
|
36
|
+
* Optional correlation id for request/response matching.
|
|
37
|
+
*/
|
|
38
|
+
correlationId?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Optional operation name (for example: "debugger.listen", "trace.stream").
|
|
41
|
+
*/
|
|
42
|
+
operation?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Message payload.
|
|
45
|
+
*/
|
|
46
|
+
payload?: T;
|
|
47
|
+
/**
|
|
48
|
+
* Unix timestamp in milliseconds.
|
|
49
|
+
*/
|
|
50
|
+
timestamp?: number;
|
|
51
|
+
}
|
|
52
|
+
export type IWebSocketMessageHandler<T = unknown> = (message: IWebSocketMessageEnvelope<T>) => void | Promise<void>;
|
|
53
|
+
export interface IWebSocketTransport {
|
|
54
|
+
/**
|
|
55
|
+
* Establish WS connection.
|
|
56
|
+
*/
|
|
57
|
+
connect(url: string, options?: IWebSocketConnectOptions): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Close WS connection.
|
|
60
|
+
*/
|
|
61
|
+
disconnect(code?: number, reason?: string): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Send one message to the connected endpoint.
|
|
64
|
+
*/
|
|
65
|
+
send<T = unknown>(message: IWebSocketMessageEnvelope<T>): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Register message handler.
|
|
68
|
+
*/
|
|
69
|
+
onMessage<T = unknown>(handler: IWebSocketMessageHandler<T>): void;
|
|
70
|
+
/**
|
|
71
|
+
* Register one-shot or persistent open callback.
|
|
72
|
+
*/
|
|
73
|
+
onOpen(handler: () => void | Promise<void>): void;
|
|
74
|
+
/**
|
|
75
|
+
* Register error callback.
|
|
76
|
+
*/
|
|
77
|
+
onError(handler: (error: Error) => void | Promise<void>): void;
|
|
78
|
+
/**
|
|
79
|
+
* Register close callback.
|
|
80
|
+
*/
|
|
81
|
+
onClose(handler: (info: IWebSocketCloseInfo) => void | Promise<void>): void;
|
|
82
|
+
/**
|
|
83
|
+
* Transport state indicator.
|
|
84
|
+
*/
|
|
85
|
+
isConnected(): boolean;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=IWebSocketTransport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IWebSocketTransport.d.ts","sourceRoot":"","sources":["../../src/connection/IWebSocketTransport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC,GAAG,OAAO;IACpD;;OAEG;IACH,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;IAEjD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC;IAEZ;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,wBAAwB,CAAC,CAAC,GAAG,OAAO,IAAI,CAClD,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,KAClC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;OAEG;IACH,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1D;;OAEG;IACH,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;OAEG;IACH,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEnE;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAElD;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAE/D;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAE5E;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generic WebSocket transport contracts.
|
|
4
|
+
*
|
|
5
|
+
* This interface is intentionally domain-agnostic and can be reused by
|
|
6
|
+
* debugger, tracing, and any other realtime ADT flows.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAdtResponse } from '../connection/IAbapConnection';
|
|
2
|
+
/**
|
|
3
|
+
* Generic execution contract for executable ADT entities.
|
|
4
|
+
*/
|
|
5
|
+
export interface IExecutor<TTarget, TResult = IAdtResponse, TRunWithProfilerOptions = unknown, TRunWithProfilingOptions = unknown, TRunWithProfilingResult = unknown> {
|
|
6
|
+
run(target: TTarget): Promise<TResult>;
|
|
7
|
+
runWithProfiler(target: TTarget, options: TRunWithProfilerOptions): Promise<TResult>;
|
|
8
|
+
runWithProfiling(target: TTarget, options?: TRunWithProfilingOptions): Promise<TRunWithProfilingResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=IExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IExecutor.d.ts","sourceRoot":"","sources":["../../src/execution/IExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,SAAS,CACxB,OAAO,EACP,OAAO,GAAG,YAAY,EACtB,uBAAuB,GAAG,OAAO,EACjC,wBAAwB,GAAG,OAAO,EAClC,uBAAuB,GAAG,OAAO;IAEjC,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,eAAe,CACb,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,gBAAgB,CACd,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACrC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,8 +13,10 @@ export type { IConfig } from './auth/IConfig';
|
|
|
13
13
|
export type { IConnectionConfig } from './auth/IConnectionConfig';
|
|
14
14
|
export type { IAbapConnection, IAdtResponse, } from './connection/IAbapConnection';
|
|
15
15
|
export type { IAbapRequestOptions } from './connection/IAbapRequestOptions';
|
|
16
|
+
export type { IWebSocketCloseInfo, IWebSocketConnectOptions, IWebSocketMessageEnvelope, IWebSocketMessageHandler, IWebSocketTransport, } from './connection/IWebSocketTransport';
|
|
16
17
|
export type { NetworkErrorCode } from './connection/NetworkErrors';
|
|
17
18
|
export { isNetworkError, NETWORK_ERROR_CODES, } from './connection/NetworkErrors';
|
|
19
|
+
export type { IExecutor } from './execution/IExecutor';
|
|
18
20
|
export * from './Headers';
|
|
19
21
|
export type { ILogger } from './logging/ILogger';
|
|
20
22
|
export { LogLevel } from './logging/LogLevel';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/E,YAAY,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEhE,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,YAAY,EACV,eAAe,EACf,YAAY,GACb,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACL,cAAc,EACd,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAk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