@mcp-abap-adt/adt-clients 43.1.0 → 44.0.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/README.md
CHANGED
|
@@ -157,7 +157,7 @@ This package interacts with external packages **ONLY through interfaces**:
|
|
|
157
157
|
| package | what this package takes from it |
|
|
158
158
|
|---|---|
|
|
159
159
|
| [`@mcp-abap-adt/interfaces-adt`](https://www.npmjs.com/package/@mcp-abap-adt/interfaces-adt) `^26.0.0` | the ADT type tables (`ADT_TYPES_ONPREM`, `ADT_TYPES_CLOUD`, `ADT_TYPES_BASIS_740`) and their code types (`AdtTypeCode`, …), the ABAP Unit run registry (`ABAP_UNIT_RUN_TYPES`, `AbapUnitRunObjectType`, `AbapUnitRunTarget`), the capability atoms, every object's config, the result-set contracts, `IAdtAnsweredObject`, `IAdtResponse`, `IAnalyse`, `IAdtAnalyseOptions`, `IAdtHeaders`, `IResultStrategy`, `ADT_NO_FAILURE`, `ADT_TASK_TYPE` |
|
|
160
|
-
| [`@mcp-abap-adt/interfaces-adt-connection`](https://www.npmjs.com/package/@mcp-abap-adt/interfaces-adt-connection) `^
|
|
160
|
+
| [`@mcp-abap-adt/interfaces-adt-connection`](https://www.npmjs.com/package/@mcp-abap-adt/interfaces-adt-connection) `^4.0.0` | `IAbapConnection`, `IAdtWireResponse`, `IAbapRequestOptions`, the connection capability atoms, `ADT_SESSION_ERROR` |
|
|
161
161
|
| [`@mcp-abap-adt/interfaces-network`](https://www.npmjs.com/package/@mcp-abap-adt/interfaces-network) `^2.0.1` | `IWebSocketTransport` and its four companions, `HttpError` |
|
|
162
162
|
| [`@mcp-abap-adt/interfaces-utils`](https://www.npmjs.com/package/@mcp-abap-adt/interfaces-utils) `^1.1.1` | `ILogger`, `LogLevel`, `XmlNode` |
|
|
163
163
|
| [`@mcp-abap-adt/interfaces-auth`](https://www.npmjs.com/package/@mcp-abap-adt/interfaces-auth) `^7.5.0` — **dev only** | `IAuthProvider`, for the test helpers that open a session |
|
|
@@ -891,12 +891,12 @@ npm run discovery:markdown -- --env /path/to/.env
|
|
|
891
891
|
|
|
892
892
|
**Environment Variables:**
|
|
893
893
|
The script uses the same environment variables as the main package:
|
|
894
|
-
- `SAP_URL` - SAP system URL (required)
|
|
894
|
+
- `SAP_URL` - SAP system URL (required over HTTP). The wire is the test configuration's required `environment.connection_type` (`"http"` or `"rfc"`, never guessed). Over RFC there is no URL: the address is stated instead — `SAP_ASHOST` and `SAP_SYSNR`, or `SAP_MSHOST` with `SAP_MSSERV` and/or `SAP_SYSID` and `SAP_GROUP` — with `SAP_LANGUAGE`, and `SAP_SAPROUTER` when needed; a `SAP_URL` beside it is refused
|
|
895
895
|
- `SAP_AUTH_TYPE` - Authentication type: `'basic'`, `'jwt'` or `'xsuaa'` (required: a missing or other value is refused, naming the key)
|
|
896
896
|
- `SAP_USERNAME` - Username for basic auth
|
|
897
897
|
- `SAP_PASSWORD` - Password for basic auth
|
|
898
898
|
- `SAP_JWT_TOKEN` - JWT token for JWT auth
|
|
899
|
-
- `SAP_CLIENT` - Client number (optional)
|
|
899
|
+
- `SAP_CLIENT` - Client number (optional over HTTP, required over RFC)
|
|
900
900
|
|
|
901
901
|
**When to use:**
|
|
902
902
|
- To explore available ADT API endpoints on your SAP system
|
|
@@ -1420,7 +1420,7 @@ everything else is not.
|
|
|
1420
1420
|
|
|
1421
1421
|
### Single Definition Site: the contract packages
|
|
1422
1422
|
|
|
1423
|
-
Since **7.5.0**, every contract type is **defined once**, in the contract packages — today `@mcp-abap-adt/interfaces-adt` (`^26.0.0`) for the ADT contracts and `@mcp-abap-adt/interfaces-adt-connection` (`^
|
|
1423
|
+
Since **7.5.0**, every contract type is **defined once**, in the contract packages — today `@mcp-abap-adt/interfaces-adt` (`^26.0.0`) for the ADT contracts and `@mcp-abap-adt/interfaces-adt-connection` (`^4.0.0`) for the connection. This package declares no copies of its own — every `IXxxConfig`, the capability atoms, the result-set contracts a factory accepts (`IClassResults`, …, since 38.0.0), the option and response types and the cross-cutting shared types all live there.
|
|
1424
1424
|
|
|
1425
1425
|
**Import them from the package that owns them:**
|
|
1426
1426
|
|
|
@@ -1641,6 +1641,7 @@ See [Architecture Documentation](docs/architecture/ARCHITECTURE.md#type-system-a
|
|
|
1641
1641
|
One document per breaking release, each written for a consumer on the contract
|
|
1642
1642
|
before it:
|
|
1643
1643
|
|
|
1644
|
+
- **[43.x → 44.0.0](docs/usage/MIGRATION-44.md)** — `@mcp-abap-adt/interfaces-adt-connection` 4: `getBaseUrl()` answers `Promise<string | undefined>` (`undefined` over RFC), `AdtBatchConnection` hands it on and `isCloudEnvironment` asks `systeminformation` without a URL; adt-strategies 0.21.0 and adt-clients-legacy 0.8.0 declare the same range. The test configuration states `environment.connection_type` (required, `"http"` or `"rfc"`); over RFC it states `SAP_ASHOST` + `SAP_SYSNR` (or the message-server keys), `SAP_CLIENT` and `SAP_LANGUAGE`, and no `SAP_URL`.
|
|
1644
1645
|
- **[42.x → 43.0.0](docs/usage/MIGRATION-43.md)** — a create invents no language: given one, it writes `adtcore:language` / `adtcore:masterLanguage` and sends `sap-language`, one value, from the config else the system context; given none, neither (no `EN` default); `AdtFunctionModule.validate` requires `description`; class create takes no `abstract` and program create no program type (SAP ignores both on create); a run id of `.` or `..` is refused before anything is sent.
|
|
1645
1646
|
- **[41.x → 42.0.0](docs/usage/MIGRATION-42.md)** — `create` of every handler whose request needs a package, and `validate` of `AdtProgram` / `AdtInclude`, take `packageName: string`, required, in the config type (SAP creates nothing without a package; program validation refuses an empty one); any other `validate` without a package sends `packagename` empty, never `undefined`; a call that passes a package sends the same request.
|
|
1646
1647
|
- **[40.x → 41.0.0](docs/usage/MIGRATION-41.md)** — every handler class is generic over the values its result slots answer (`AdtClass<ResultValuesOf<typeof classDocuments>>`), not over the strategies (`AdtClass<typeof classDocuments>`); code that names a class's type parameter wraps it in `ResultValuesOf<…>`, and `getX()` / `getX(results)` calls and every request are unchanged.
|
|
@@ -16,7 +16,7 @@ export declare class AdtBatchConnection implements IAbapConnection {
|
|
|
16
16
|
});
|
|
17
17
|
private wrappedSession;
|
|
18
18
|
connect(): Promise<void>;
|
|
19
|
-
getBaseUrl(): Promise<string>;
|
|
19
|
+
getBaseUrl(): Promise<string | undefined>;
|
|
20
20
|
getSessionId(): string | null;
|
|
21
21
|
setSessionType(type: Session): void;
|
|
22
22
|
getSessionType(): Session;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdtBatchConnection.d.ts","sourceRoot":"","sources":["../../src/batch/AdtBatchConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAM9D,KAAK,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;AAQxC,sFAAsF;AACtF,qBAAa,kBAAmB,YAAW,eAAe;IAOtD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAP1B,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAU;IACzC,OAAO,CAAC,iBAAiB,CAAC,CAAqB;IAC/C,OAAO,CAAC,SAAS,CAAS;gBAEP,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE;QACxB,QAAQ,EAAE,eAAe,GAAG,UAAU,CAAC;QACvC,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB;IAQH,OAAO,CAAC,cAAc;IAWtB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAGxB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AdtBatchConnection.d.ts","sourceRoot":"","sources":["../../src/batch/AdtBatchConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,mB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l()` answers `Promise<string | undefined>`: an RFC
|
|
5
|
+
connection has no HTTP origin and answers `undefined`. It pairs with
|
|
6
|
+
`@mcp-abap-adt/adt-strategies` 0.21.0 and `@mcp-abap-adt/adt-clients-legacy`
|
|
7
|
+
0.8.0, which declare the same range. No request changes.
|
|
8
|
+
|
|
9
|
+
- [`getBaseUrl()` may answer `undefined`](#getbaseurl-may-answer-undefined)
|
|
10
|
+
- [The test configuration over RFC states its address](#the-test-configuration-over-rfc-states-its-address)
|
|
11
|
+
|
|
12
|
+
## `getBaseUrl()` may answer `undefined`
|
|
13
|
+
|
|
14
|
+
### What changed
|
|
15
|
+
|
|
16
|
+
`AdtBatchConnection.getBaseUrl()` answers `Promise<string | undefined>` and
|
|
17
|
+
hands on what the wrapped connection answers, `undefined` included.
|
|
18
|
+
`isCloudEnvironment(connection)` already skipped a missing URL: with
|
|
19
|
+
`undefined` it asks `systeminformation`, as it did for an empty one.
|
|
20
|
+
|
|
21
|
+
### What to do
|
|
22
|
+
|
|
23
|
+
A caller that reads `getBaseUrl()` from this package's types narrows before it
|
|
24
|
+
uses the answer:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
const origin = await batch.getBaseUrl();
|
|
28
|
+
if (origin !== undefined) {
|
|
29
|
+
// an HTTP connection: its origin
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Install `@mcp-abap-adt/interfaces-adt-connection@^4.0.0` beside this package
|
|
34
|
+
(and `@mcp-abap-adt/connection` 20 for a concrete connection), so one copy of
|
|
35
|
+
the contract is installed. A connection of your own that answers a string
|
|
36
|
+
still conforms.
|
|
37
|
+
|
|
38
|
+
## The test configuration over RFC states its address
|
|
39
|
+
|
|
40
|
+
This concerns a run of this repository's tests, not the library.
|
|
41
|
+
|
|
42
|
+
### What changed
|
|
43
|
+
|
|
44
|
+
The test helpers take `@mcp-abap-adt/connection` 20, where an RFC config has
|
|
45
|
+
no URL. With `environment.connection_type: "rfc"`, the session file names the
|
|
46
|
+
address and no `SAP_URL`:
|
|
47
|
+
|
|
48
|
+
```env
|
|
49
|
+
SAP_ASHOST=saphost # the host your SAP_URL named
|
|
50
|
+
SAP_SYSNR=00 # the two digits of its 80NN port
|
|
51
|
+
SAP_CLIENT=100
|
|
52
|
+
SAP_LANGUAGE=EN
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
— or a message server: `SAP_MSHOST` with `SAP_MSSERV` and/or `SAP_SYSID` and
|
|
56
|
+
`SAP_GROUP`. `SAP_SAPROUTER` is taken when stated. Nothing is derived from a URL
|
|
57
|
+
and nothing is defaulted.
|
|
58
|
+
|
|
59
|
+
`environment.connection_type` is required in the overlay: `"http"` or `"rfc"`,
|
|
60
|
+
stated. Absent or another value is refused, naming the key; until 44.0.0 an
|
|
61
|
+
absent one was read as HTTP.
|
|
62
|
+
|
|
63
|
+
### What to do
|
|
64
|
+
|
|
65
|
+
State `"environment.connection_type": "http"` (or `"rfc"`) in your
|
|
66
|
+
`test-config.overlay.yaml`; an old full `test-config.yaml` that states none is
|
|
67
|
+
not migrated (`npm run test-config:migrate` names the key). Remove `SAP_URL` from an RFC session file and add `SAP_ASHOST`, `SAP_SYSNR`,
|
|
68
|
+
`SAP_CLIENT` and `SAP_LANGUAGE` (`000` and `EN` were the old defaults). The
|
|
69
|
+
helper refuses, naming the keys, an RFC file that states `SAP_URL`, two
|
|
70
|
+
addresses, none, an incomplete one, or no client or language; an HTTP file
|
|
71
|
+
that states an RFC address key; and ABAP Cloud over RFC. See
|
|
72
|
+
[RFC_TESTING.md](../development/RFC_TESTING.md).
|
|
@@ -44,7 +44,7 @@ export LD_LIBRARY_PATH=$SAPNWRFC_HOME/lib:$LD_LIBRARY_PATH
|
|
|
44
44
|
RFC transport is provided by `@mcp-abap-adt/sap-rfc-lite`, which is pulled in automatically as a dependency of `@mcp-abap-adt/connection`. Nothing needs to be added to `package.json` — `adt-clients` consumes the `IAbapConnection` interface and does not depend on any RFC library directly.
|
|
45
45
|
|
|
46
46
|
It is an **optional** dependency with no install script (sap-rfc-lite 0.3.x,
|
|
47
|
-
`@mcp-abap-adt/connection` 19 and later): `npm install` compiles nothing and needs
|
|
47
|
+
`@mcp-abap-adt/connection` 19 and later; this package's tests use 20): `npm install` compiles nothing and needs
|
|
48
48
|
no SDK. It ships prebuilt bindings for linux-x64 (glibc), win32-x64 and
|
|
49
49
|
darwin-arm64. On any other platform the install succeeds without a binding and
|
|
50
50
|
the RFC connection fails when it loads sap-rfc-lite; build the binding from
|
|
@@ -61,10 +61,13 @@ The SAP user needs `S_RFC` authorization for function module `SADT_REST_RFC_ENDP
|
|
|
61
61
|
|
|
62
62
|
### Connection Layer (`@mcp-abap-adt/connection`)
|
|
63
63
|
|
|
64
|
-
RFC is a **transport**, not an auth type
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
RFC is a **transport**, not an auth type: the wire an on-prem system is
|
|
65
|
+
reached over is an argument (`RfcTransport`), as it has been since
|
|
66
|
+
`@mcp-abap-adt/connection` 6.0.0. `connectionType: 'rfc'` is the config's
|
|
67
|
+
discriminant since `@mcp-abap-adt/interfaces-auth-sap` 4 /
|
|
68
|
+
`@mcp-abap-adt/connection` 20: `ISapConfig` is a union, and an RFC config
|
|
69
|
+
(`SapRfcConfig`) states its own address, client and logon language and has no
|
|
70
|
+
`url`.
|
|
68
71
|
|
|
69
72
|
```typescript
|
|
70
73
|
import { BasicAuthProvider } from '@mcp-abap-adt/auth-providers';
|
|
@@ -72,29 +75,41 @@ import {
|
|
|
72
75
|
AdtOnPremConnector,
|
|
73
76
|
RfcTransport,
|
|
74
77
|
rfcConversationFrom,
|
|
78
|
+
type SapRfcConfig,
|
|
75
79
|
} from '@mcp-abap-adt/connection';
|
|
76
80
|
|
|
77
|
-
const config = {
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
const config: SapRfcConfig = {
|
|
82
|
+
connectionType: 'rfc',
|
|
83
|
+
ashost: 'saphost', // the application server
|
|
84
|
+
sysnr: '00', // its system number
|
|
80
85
|
client: '100',
|
|
86
|
+
language: 'EN',
|
|
87
|
+
authType: 'basic',
|
|
81
88
|
username: 'DEVELOPER',
|
|
82
89
|
password: 'secret',
|
|
83
90
|
};
|
|
84
91
|
|
|
85
92
|
const connection = new AdtOnPremConnector(
|
|
86
93
|
config,
|
|
87
|
-
new BasicAuthProvider(
|
|
94
|
+
new BasicAuthProvider('DEVELOPER', 'secret'),
|
|
88
95
|
new RfcTransport(rfcConversationFrom(config)),
|
|
89
96
|
);
|
|
90
97
|
|
|
91
98
|
await connection.connect();
|
|
92
99
|
```
|
|
93
100
|
|
|
94
|
-
`rfcConversationFrom(config)`
|
|
95
|
-
- `ashost`
|
|
96
|
-
-
|
|
97
|
-
|
|
101
|
+
`rfcConversationFrom(config)` takes the address as stated:
|
|
102
|
+
- an application server: `ashost` and `sysnr`;
|
|
103
|
+
- or a message server: `mshost`, its service as `msserv`, `sysid` or both, and
|
|
104
|
+
the logon `group`;
|
|
105
|
+
- `client` and `language` (sent as the SDK's `lang`), and `saprouter` when the
|
|
106
|
+
config states it;
|
|
107
|
+
- the provider's logon parameters (`user`, `passwd`, or SNC) are spread over
|
|
108
|
+
that address at each open.
|
|
109
|
+
|
|
110
|
+
Nothing is derived from a URL, nothing is defaulted (no `000`, `EN` or
|
|
111
|
+
`PUBLIC`), and `SAP_SYSNR` is not read from the environment. An RFC
|
|
112
|
+
connection's `getBaseUrl()` answers `undefined`: it has no HTTP origin.
|
|
98
113
|
|
|
99
114
|
### ADT Clients Layer (`@mcp-abap-adt/adt-clients`)
|
|
100
115
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-abap-adt/adt-clients",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "44.0.0",
|
|
4
4
|
"description": "ADT clients for SAP ABAP systems - AdtClient and AdtRuntimeClient",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
},
|
|
118
118
|
"dependencies": {
|
|
119
119
|
"@mcp-abap-adt/interfaces-adt": "^26.0.0",
|
|
120
|
-
"@mcp-abap-adt/interfaces-adt-connection": "^
|
|
120
|
+
"@mcp-abap-adt/interfaces-adt-connection": "^4.0.0",
|
|
121
121
|
"@mcp-abap-adt/interfaces-network": "^2.0.1",
|
|
122
122
|
"@mcp-abap-adt/interfaces-utils": "^1.1.1",
|
|
123
123
|
"@mcp-abap-adt/logger": "^0.4.1",
|
|
@@ -126,11 +126,11 @@
|
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
128
|
"@biomejs/biome": "^2.4.4",
|
|
129
|
-
"@mcp-abap-adt/adt-strategies": "^0.
|
|
129
|
+
"@mcp-abap-adt/adt-strategies": "^0.21.0",
|
|
130
130
|
"@mcp-abap-adt/auth-providers": "^6.0.2",
|
|
131
|
-
"@mcp-abap-adt/connection": "^
|
|
131
|
+
"@mcp-abap-adt/connection": "^20.0.0",
|
|
132
132
|
"@mcp-abap-adt/interfaces-auth": "^7.5.0",
|
|
133
|
-
"@mcp-abap-adt/interfaces-auth-sap": "^
|
|
133
|
+
"@mcp-abap-adt/interfaces-auth-sap": "^4.0.0",
|
|
134
134
|
"@types/jest": "^30.0.0",
|
|
135
135
|
"@types/node": "^25.3.3",
|
|
136
136
|
"dotenv": "^17.3.1",
|