@mcp-abap-adt/connection 14.0.0 → 14.1.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 +39 -1
- package/README.md +6 -6
- package/dist/connection/AdtCloudConnector.d.ts +2 -2
- package/dist/connection/AdtCloudConnector.js +2 -2
- package/dist/connection/CloudHttpTransport.d.ts +23 -10
- package/dist/connection/CloudHttpTransport.d.ts.map +1 -1
- package/dist/connection/CloudHttpTransport.js +56 -44
- package/dist/connection/HttpTransport.d.ts +22 -2
- package/dist/connection/HttpTransport.d.ts.map +1 -1
- package/dist/connection/HttpTransport.js +45 -2
- package/dist/connection/IAdtTransport.d.ts +3 -2
- package/dist/connection/IAdtTransport.d.ts.map +1 -1
- package/dist/connection/OnPremHttpTransport.d.ts.map +1 -1
- package/dist/connection/OnPremHttpTransport.js +5 -24
- package/docs/INDEX.md +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/docs/MIGRATION-10.0.md +5 -0
- package/docs/MIGRATION-12.0.md +1 -1
- package/docs/MIGRATION-6.0.md +3 -1
- package/docs/USAGE.md +7 -6
- package/examples/README.md +1 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [14.1.0] - 2026-10-12
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- **A cloud connection's `disconnect()` now ends its security session.** The
|
|
14
|
+
close sent `DELETE` on the session's own address, and the server ends a
|
|
15
|
+
session that way only when the request runs in a DIFFERENT one; from inside
|
|
16
|
+
it the answer is `200` and nothing is ended, so every closed connection left
|
|
17
|
+
its session until the server's timeout. The close now sends the logoff the
|
|
18
|
+
session document links to (`rel=…/sessions/logoff`). Measured on a BTP trial
|
|
19
|
+
(2026-10-12): after the `DELETE` the session's cookie alone was still
|
|
20
|
+
accepted 30 s later; after the logoff it is refused with `401` at once. When
|
|
21
|
+
the server links no logoff resource, nothing is sent and the debug log says
|
|
22
|
+
so.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- **The logoff is sent as Eclipse ADT 3.60.3 sends it, on both wires**: the
|
|
26
|
+
session's cookie and no credential, with `Accept: */*`,
|
|
27
|
+
`sap-adt-request-id` and `sap-cancel-on-close: true`, and on the cloud
|
|
28
|
+
`x-sap-security-session: use`. The service answers `sap-authenticated: not
|
|
29
|
+
required`, so the credential the goodbye carried was handed to a public
|
|
30
|
+
endpoint that ignored it; the provider is no longer asked, and a provider
|
|
31
|
+
that refuses no longer keeps the session open. Measured 2026-10-12 on a BTP
|
|
32
|
+
trial and on premise (BASIS 816): after `disconnect()` the session's cookie
|
|
33
|
+
alone is refused with `401` at once and 10 s later.
|
|
34
|
+
|
|
35
|
+
## [14.0.1] - 2026-10-09
|
|
36
|
+
|
|
37
|
+
Documentation and development only; the code is the same as 14.0.0.
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
- Docs (README, INSTALLATION, USAGE, INDEX, the examples, the 12.0 migration):
|
|
41
|
+
connection 13.x and 14.x both work with auth-providers 6.0.0.
|
|
42
|
+
- Development: the auth error contract's shape check runs as a Jest test from
|
|
43
|
+
`@mcp-abap-adt/auth-errors` 2.2.0 (`test:shape` in `prepublishOnly`); the
|
|
44
|
+
copied script is gone and `lint:check` is Biome alone.
|
|
45
|
+
|
|
10
46
|
## [14.0.0] - 2026-10-08
|
|
11
47
|
|
|
12
48
|
### Breaking
|
|
@@ -2337,7 +2373,9 @@ const connection = createAbapConnection(config, logger);
|
|
|
2337
2373
|
- JWT token refresh now properly handles connection errors (401/403 during initial connect)
|
|
2338
2374
|
- Permission errors (403 with "ExceptionResourceNoAccess") no longer trigger JWT refresh loops
|
|
2339
2375
|
- Proper separation: base class handles HTTP/session, concrete classes handle auth-specific errors
|
|
2340
|
-
[Unreleased]: https://github.com/fr0ster/mcp-abap-connection/compare/v14.
|
|
2376
|
+
[Unreleased]: https://github.com/fr0ster/mcp-abap-connection/compare/v14.1.0...HEAD
|
|
2377
|
+
[14.1.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v14.0.1...v14.1.0
|
|
2378
|
+
[14.0.1]: https://github.com/fr0ster/mcp-abap-connection/compare/v14.0.0...v14.0.1
|
|
2341
2379
|
[14.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v13.0.0...v14.0.0
|
|
2342
2380
|
[13.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v12.0.0...v13.0.0
|
|
2343
2381
|
[12.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v11.0.1...v12.0.0
|
package/README.md
CHANGED
|
@@ -47,13 +47,13 @@ The package uses a clean separation of concerns:
|
|
|
47
47
|
|
|
48
48
|
- **`AdtCloudConnector`** (concrete, exported):
|
|
49
49
|
- An ABAP Cloud system: a session is a resource, opened at
|
|
50
|
-
`/sap/bc/adt/core/http/sessions` and given back
|
|
50
|
+
`/sap/bc/adt/core/http/sessions` and given back through the logoff resource its answer
|
|
51
|
+
links to (a `DELETE` on the session's own address answers `200` and ends nothing)
|
|
51
52
|
- Takes an auth provider, same as above
|
|
52
53
|
|
|
53
54
|
**Which one you take is how you say where you are dialling.** Nothing is probed:
|
|
54
|
-
the session resource answers on on-prem too,
|
|
55
|
-
|
|
56
|
-
mechanism that releases nothing.
|
|
55
|
+
the session resource answers on on-prem too, so its answer says nothing about which
|
|
56
|
+
system this is.
|
|
57
57
|
|
|
58
58
|
- **Auth providers** (an `IAuthProvider` from `@mcp-abap-adt/interfaces-auth`; the
|
|
59
59
|
ready-made ones — `BasicAuthProvider`, `TokenAuthProvider`, `SamlAuthProvider`,
|
|
@@ -209,8 +209,8 @@ since 10.0.0. Install them from where they live:
|
|
|
209
209
|
npm install @mcp-abap-adt/auth-providers@^6
|
|
210
210
|
```
|
|
211
211
|
|
|
212
|
-
connection 13.x
|
|
213
|
-
built on interfaces-auth 7 and auth-errors 2, and
|
|
212
|
+
connection 13.x and 14.x work with **auth-providers 6.0.0** (`^6.0.0`), the release
|
|
213
|
+
built on interfaces-auth 7 and auth-errors 2, and are tested with it: the 5.x
|
|
214
214
|
providers answer unbranded refusals and do not fit. See
|
|
215
215
|
[Migration to 13.0.0](./docs/MIGRATION-13.0.md) and
|
|
216
216
|
[Migration to 12.0.0](./docs/MIGRATION-12.0.md).
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A session there is a **resource**: asked for at
|
|
5
5
|
* `/sap/bc/adt/core/http/sessions` with `x-sap-security-session: create` and
|
|
6
|
-
* `sap-adt-purpose: preflight_logon`, and given back
|
|
7
|
-
* the
|
|
6
|
+
* `sap-adt-purpose: preflight_logon`, and given back through the logoff resource
|
|
7
|
+
* the same answer links to. Reproduced from Eclipse ADT 3.60 and
|
|
8
8
|
* measured against a BTP trial: without that request the same connection gets
|
|
9
9
|
* `sap-usercontext` and `sap-XSRF_*` and no session for a lock to be bound to,
|
|
10
10
|
* which is how "cloud issues no SAP_SESSIONID" came to be believed.
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* A session there is a **resource**: asked for at
|
|
6
6
|
* `/sap/bc/adt/core/http/sessions` with `x-sap-security-session: create` and
|
|
7
|
-
* `sap-adt-purpose: preflight_logon`, and given back
|
|
8
|
-
* the
|
|
7
|
+
* `sap-adt-purpose: preflight_logon`, and given back through the logoff resource
|
|
8
|
+
* the same answer links to. Reproduced from Eclipse ADT 3.60 and
|
|
9
9
|
* measured against a BTP trial: without that request the same connection gets
|
|
10
10
|
* `sap-usercontext` and `sap-XSRF_*` and no session for a lock to be bound to,
|
|
11
11
|
* which is how "cloud issues no SAP_SESSIONID" came to be believed.
|
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
* ABAP Cloud over HTTP: the wire where a session is a resource with an address.
|
|
3
3
|
*
|
|
4
4
|
* Asked for at `/sap/bc/adt/core/http/sessions` with `x-sap-security-session:
|
|
5
|
-
* create` and `sap-adt-purpose: preflight_logon`, and given back
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
5
|
+
* create` and `sap-adt-purpose: preflight_logon`, and given back through the
|
|
6
|
+
* logoff resource the same answer links to. Reproduced from Eclipse ADT 3.60 and
|
|
7
|
+
* measured against a BTP trial: without that request the same connection gets
|
|
8
|
+
* `sap-usercontext` and `sap-XSRF_*` and no session for a lock to be bound to,
|
|
9
|
+
* which is how "cloud issues no SAP_SESSIONID" came to be believed.
|
|
10
|
+
*
|
|
11
|
+
* **Not by `DELETE` on the session's own address.** The resource ends a session
|
|
12
|
+
* only when the address names a DIFFERENT one than the request runs in — a new
|
|
13
|
+
* session ending an old one — and otherwise answers `200` having done nothing.
|
|
14
|
+
* Measured on a BTP trial (2026-10-12): after that `DELETE` the session's cookie
|
|
15
|
+
* alone was still accepted, at once and 30 s later; after the logoff it was
|
|
16
|
+
* refused with `401` at once, and so was a session whose address another
|
|
17
|
+
* session sent the `DELETE` for.
|
|
11
18
|
*
|
|
12
19
|
* **Taking this transport is the consumer saying which system it is dialling.**
|
|
13
20
|
* Nothing here asks the server what it is. The strategy this replaces treated a
|
|
@@ -41,16 +48,22 @@ export declare class CloudHttpTransport extends HttpTransport implements ICloudT
|
|
|
41
48
|
* guess wearing a measurement's clothes.
|
|
42
49
|
*/
|
|
43
50
|
protected sessionHeaders(): Record<string, string>;
|
|
44
|
-
/** The
|
|
45
|
-
private
|
|
51
|
+
/** The logoff resource this server linked to beside our session, resolved — the close target. */
|
|
52
|
+
private logoff;
|
|
46
53
|
open(context: IAdtSessionContext): Promise<void>;
|
|
47
54
|
close(context: IAdtSessionContext): Promise<void>;
|
|
48
55
|
/**
|
|
49
|
-
*
|
|
56
|
+
* An href resolved against the document that published it, as a link in an
|
|
57
|
+
* Atom document is. Resolved at open, so the close has nothing left that can
|
|
58
|
+
* throw: an href that is no URL is said once and leaves nothing to send.
|
|
59
|
+
*/
|
|
60
|
+
private resolveLink;
|
|
61
|
+
/**
|
|
62
|
+
* A link's href, by its `rel` rather than by position.
|
|
50
63
|
*
|
|
51
64
|
* The document carries three links — the session, the logoff resource and
|
|
52
65
|
* system information — and their order is not a contract.
|
|
53
66
|
*/
|
|
54
|
-
private
|
|
67
|
+
private linkHref;
|
|
55
68
|
}
|
|
56
69
|
//# sourceMappingURL=CloudHttpTransport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudHttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/CloudHttpTransport.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CloudHttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/CloudHttpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAgB9E,qBAAa,kBACX,SAAQ,aACR,YAAW,eAAe;IAE1B,SAAkB,IAAI,gBAAgB;IAEtC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAU;IAEnC;;;;;;;;;;;;;;;;;OAiBG;cACgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAI3D,iGAAiG;IACjG,OAAO,CAAC,MAAM,CAAuB;IAEtB,IAAI,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiEhD,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmChE;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAenB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;CAWjB"}
|
|
@@ -3,12 +3,19 @@
|
|
|
3
3
|
* ABAP Cloud over HTTP: the wire where a session is a resource with an address.
|
|
4
4
|
*
|
|
5
5
|
* Asked for at `/sap/bc/adt/core/http/sessions` with `x-sap-security-session:
|
|
6
|
-
* create` and `sap-adt-purpose: preflight_logon`, and given back
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* create` and `sap-adt-purpose: preflight_logon`, and given back through the
|
|
7
|
+
* logoff resource the same answer links to. Reproduced from Eclipse ADT 3.60 and
|
|
8
|
+
* measured against a BTP trial: without that request the same connection gets
|
|
9
|
+
* `sap-usercontext` and `sap-XSRF_*` and no session for a lock to be bound to,
|
|
10
|
+
* which is how "cloud issues no SAP_SESSIONID" came to be believed.
|
|
11
|
+
*
|
|
12
|
+
* **Not by `DELETE` on the session's own address.** The resource ends a session
|
|
13
|
+
* only when the address names a DIFFERENT one than the request runs in — a new
|
|
14
|
+
* session ending an old one — and otherwise answers `200` having done nothing.
|
|
15
|
+
* Measured on a BTP trial (2026-10-12): after that `DELETE` the session's cookie
|
|
16
|
+
* alone was still accepted, at once and 30 s later; after the logoff it was
|
|
17
|
+
* refused with `401` at once, and so was a session whose address another
|
|
18
|
+
* session sent the `DELETE` for.
|
|
12
19
|
*
|
|
13
20
|
* **Taking this transport is the consumer saying which system it is dialling.**
|
|
14
21
|
* Nothing here asks the server what it is. The strategy this replaces treated a
|
|
@@ -29,6 +36,7 @@ const SESSION_ACCEPT = 'application/vnd.sap.adt.core.http.session.v3+xml, ' +
|
|
|
29
36
|
'application/vnd.sap.adt.core.http.session.v2+xml, ' +
|
|
30
37
|
'application/vnd.sap.adt.core.http.session.v1+xml';
|
|
31
38
|
const SECURITY_SESSION_REL = 'http://www.sap.com/adt/categories/core/http/sessions/securitysession';
|
|
39
|
+
const LOGOFF_REL = 'http://www.sap.com/adt/categories/core/http/sessions/logoff';
|
|
32
40
|
class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
33
41
|
kind = 'cloud-http';
|
|
34
42
|
/** Which system this wire is for. Read by the compiler, never at runtime. */
|
|
@@ -54,8 +62,8 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
|
54
62
|
sessionHeaders() {
|
|
55
63
|
return this.sessionEstablished() ? { 'x-sap-security-session': 'use' } : {};
|
|
56
64
|
}
|
|
57
|
-
/** The
|
|
58
|
-
|
|
65
|
+
/** The logoff resource this server linked to beside our session, resolved — the close target. */
|
|
66
|
+
logoff = null;
|
|
59
67
|
async open(context) {
|
|
60
68
|
// The logon, outside the swallowing `try`: a credential that refuses it
|
|
61
69
|
// (`AuthRefusedError`) is the caller's to hear, not a preflight to shrug at.
|
|
@@ -87,7 +95,7 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
|
87
95
|
// anything is read out of it.
|
|
88
96
|
context.observe(response.headers);
|
|
89
97
|
this.ingest(response.headers);
|
|
90
|
-
const resource = this.
|
|
98
|
+
const resource = this.linkHref(response.data, SECURITY_SESSION_REL);
|
|
91
99
|
if (!resource) {
|
|
92
100
|
// Answered, but published no session of its own — so there is no
|
|
93
101
|
// address to give one back by. Said out loud rather than worked
|
|
@@ -96,7 +104,9 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
|
96
104
|
this.logger?.debug(`Session resource answered ${response.status} but published no securitysession link`);
|
|
97
105
|
return;
|
|
98
106
|
}
|
|
99
|
-
|
|
107
|
+
// Published only while its ICF service is active; without it there is
|
|
108
|
+
// nothing that ends this session, and the close says so.
|
|
109
|
+
this.logoff = this.resolveLink(this.linkHref(response.data, LOGOFF_REL), `${context.baseUrl}${SESSIONS_PATH}`);
|
|
100
110
|
this.logger?.debug(`Security session opened: ${resource}`);
|
|
101
111
|
}
|
|
102
112
|
catch (error) {
|
|
@@ -111,63 +121,65 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
|
111
121
|
}
|
|
112
122
|
}
|
|
113
123
|
async close(context) {
|
|
114
|
-
const
|
|
115
|
-
this.
|
|
124
|
+
const logoff = this.logoff;
|
|
125
|
+
this.logoff = null;
|
|
116
126
|
// Read SYNCHRONOUSLY, before the first await. A close is dispatched
|
|
117
127
|
// without being awaited, so the teardown's `forgetSession()` runs while
|
|
118
128
|
// this is suspended — and a goodbye assembled afterwards would carry no
|
|
119
129
|
// cookie, which is the one thing that proves the session is ours to end.
|
|
120
130
|
const cookies = this.cookies();
|
|
121
|
-
|
|
122
|
-
// Snapshotted for the same reason: the DELETE must reach the server holding
|
|
131
|
+
// Snapshotted for the same reason: the logoff must reach the server holding
|
|
123
132
|
// this session, not whichever one the wire is pinned to when it goes out.
|
|
124
133
|
const affinity = this.affinityHeaders();
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
//
|
|
134
|
+
const session = this.sessionHeaders();
|
|
135
|
+
if (!cookies) {
|
|
136
|
+
// No cookie to prove the session is ours — holding the cookie is the
|
|
137
|
+
// whole permission to end one.
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (!logoff) {
|
|
141
|
+
// A session was opened, but the server linked no logoff resource: it
|
|
142
|
+
// stays until the server's own timeout.
|
|
143
|
+
this.logger?.debug('The server published no logoff resource; the security session is left to its timeout');
|
|
128
144
|
return;
|
|
129
145
|
}
|
|
146
|
+
await this.sendLogoff(context, logoff, {
|
|
147
|
+
cookies,
|
|
148
|
+
affinity,
|
|
149
|
+
// `x-sap-security-session: use`, as Eclipse sends it on the logoff: it
|
|
150
|
+
// names the session the logoff ends, like every other request here.
|
|
151
|
+
session,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* An href resolved against the document that published it, as a link in an
|
|
156
|
+
* Atom document is. Resolved at open, so the close has nothing left that can
|
|
157
|
+
* throw: an href that is no URL is said once and leaves nothing to send.
|
|
158
|
+
*/
|
|
159
|
+
resolveLink(href, documentUrl) {
|
|
160
|
+
if (!href)
|
|
161
|
+
return null;
|
|
130
162
|
try {
|
|
131
|
-
|
|
132
|
-
await context.authorize(auth);
|
|
133
|
-
await this.sendDetached({
|
|
134
|
-
method: 'DELETE',
|
|
135
|
-
url: new URL(resource, context.baseUrl).toString(),
|
|
136
|
-
headers: {
|
|
137
|
-
...affinity,
|
|
138
|
-
// Detached, so not dressed: the client is said here in so many
|
|
139
|
-
// words, as on every other request of this wire.
|
|
140
|
-
...this.clientHeaders(),
|
|
141
|
-
...auth,
|
|
142
|
-
...context.extraHeaders,
|
|
143
|
-
Cookie: (0, cookies_js_1.mergeCookieHeaders)(auth.Cookie, cookies),
|
|
144
|
-
'x-sap-security-session': 'use',
|
|
145
|
-
// A state change, so the server wants the token. Without one the
|
|
146
|
-
// request is refused with 403 — which is still just a message the
|
|
147
|
-
// server did not accept, and still not something to raise from a
|
|
148
|
-
// teardown.
|
|
149
|
-
...(csrf ? { 'x-csrf-token': csrf } : {}),
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
this.logger?.debug('Told the server the security session is finished');
|
|
163
|
+
return new URL(href, documentUrl).toString();
|
|
153
164
|
}
|
|
154
|
-
catch
|
|
155
|
-
this.logger?.debug(`
|
|
165
|
+
catch {
|
|
166
|
+
this.logger?.debug(`The server published a logoff link that is no URL: ${href}`);
|
|
167
|
+
return null;
|
|
156
168
|
}
|
|
157
169
|
}
|
|
158
170
|
/**
|
|
159
|
-
*
|
|
171
|
+
* A link's href, by its `rel` rather than by position.
|
|
160
172
|
*
|
|
161
173
|
* The document carries three links — the session, the logoff resource and
|
|
162
174
|
* system information — and their order is not a contract.
|
|
163
175
|
*/
|
|
164
|
-
|
|
176
|
+
linkHref(body, wanted) {
|
|
165
177
|
if (typeof body !== 'string')
|
|
166
178
|
return undefined;
|
|
167
179
|
for (const link of body.matchAll(/<[^>]*link\b([^>]*)>/g)) {
|
|
168
180
|
const attrs = link[1];
|
|
169
181
|
const rel = attrs.match(/\brel="([^"]*)"/)?.[1];
|
|
170
|
-
if (rel !==
|
|
182
|
+
if (rel !== wanted)
|
|
171
183
|
continue;
|
|
172
184
|
const href = attrs.match(/\bhref="([^"]*)"/)?.[1];
|
|
173
185
|
if (href)
|
|
@@ -219,11 +219,31 @@ export declare class HttpTransport implements IAdtTransport {
|
|
|
219
219
|
/**
|
|
220
220
|
* Nothing to give back at this level.
|
|
221
221
|
*
|
|
222
|
-
* The two concrete wires override it — the cloud one
|
|
223
|
-
*
|
|
222
|
+
* The two concrete wires override it — the cloud one sends the logoff its
|
|
223
|
+
* session document links to, the on-prem one the platform logoff. A bare HTTP wire has
|
|
224
224
|
* neither, and says so by doing nothing.
|
|
225
225
|
*/
|
|
226
226
|
close(_context: IAdtSessionContext): Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* The logoff, sent as Eclipse ADT 3.60.3 sends it when a project is closed.
|
|
229
|
+
*
|
|
230
|
+
* The session's cookie and nothing that logs on: the service answers
|
|
231
|
+
* `sap-authenticated: not required`, so a credential would only be handed to
|
|
232
|
+
* a public endpoint that ignores it (measured on a BTP trial, 2026-10-12).
|
|
233
|
+
* What is snapshotted — the cookie, the affinity, the session headers — is
|
|
234
|
+
* taken by the caller before its first await, because the teardown clears it
|
|
235
|
+
* while the close is suspended.
|
|
236
|
+
*
|
|
237
|
+
* Its answer is not read: it is the same `200` and the same goodbye page for
|
|
238
|
+
* a live session, one already ended and no cookie at all, so it says nothing
|
|
239
|
+
* about THIS session; and when the logoff cannot end one, the reason is an
|
|
240
|
+
* error message whose status the ICF kernel picks, which no ABAP source shows.
|
|
241
|
+
*/
|
|
242
|
+
protected sendLogoff(context: IAdtSessionContext, url: string, snapshot: {
|
|
243
|
+
cookies: string;
|
|
244
|
+
affinity: Record<string, string>;
|
|
245
|
+
session: Record<string, string>;
|
|
246
|
+
}): Promise<void>;
|
|
227
247
|
/**
|
|
228
248
|
* Throws for a status the request does not admit — by doing nothing, because
|
|
229
249
|
* that is already what axios does, and `AxiosError` already carries
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/HttpTransport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;;;;;;;OAOG;IACG,IAAI,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD;;;;;;OAMG;IACG,KAAK,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAExD;;;;;;;;;;;;;;OAcG;cACa,UAAU,CACxB,OAAO,EAAE,kBAAkB,EAC3B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACjC,GACA,OAAO,CAAC,IAAI,CAAC;IAiChB;;;;;OAKG;IACG,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAKzE;;;;;;OAMG;IACH,OAAO,CAAC,GAAG;IAmBX;;;;;;;;;;;;;OAaG;cACa,YAAY,CAC1B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;YAInB,QAAQ;CA4BvB"}
|
|
@@ -24,6 +24,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.HttpTransport = exports.isStatefulRequest = void 0;
|
|
27
|
+
const node_crypto_1 = require("node:crypto");
|
|
27
28
|
const node_https_1 = require("node:https");
|
|
28
29
|
const auth_errors_1 = require("@mcp-abap-adt/auth-errors");
|
|
29
30
|
const axios_1 = __importDefault(require("axios"));
|
|
@@ -656,11 +657,53 @@ class HttpTransport {
|
|
|
656
657
|
/**
|
|
657
658
|
* Nothing to give back at this level.
|
|
658
659
|
*
|
|
659
|
-
* The two concrete wires override it — the cloud one
|
|
660
|
-
*
|
|
660
|
+
* The two concrete wires override it — the cloud one sends the logoff its
|
|
661
|
+
* session document links to, the on-prem one the platform logoff. A bare HTTP wire has
|
|
661
662
|
* neither, and says so by doing nothing.
|
|
662
663
|
*/
|
|
663
664
|
async close(_context) { }
|
|
665
|
+
/**
|
|
666
|
+
* The logoff, sent as Eclipse ADT 3.60.3 sends it when a project is closed.
|
|
667
|
+
*
|
|
668
|
+
* The session's cookie and nothing that logs on: the service answers
|
|
669
|
+
* `sap-authenticated: not required`, so a credential would only be handed to
|
|
670
|
+
* a public endpoint that ignores it (measured on a BTP trial, 2026-10-12).
|
|
671
|
+
* What is snapshotted — the cookie, the affinity, the session headers — is
|
|
672
|
+
* taken by the caller before its first await, because the teardown clears it
|
|
673
|
+
* while the close is suspended.
|
|
674
|
+
*
|
|
675
|
+
* Its answer is not read: it is the same `200` and the same goodbye page for
|
|
676
|
+
* a live session, one already ended and no cookie at all, so it says nothing
|
|
677
|
+
* about THIS session; and when the logoff cannot end one, the reason is an
|
|
678
|
+
* error message whose status the ICF kernel picks, which no ABAP source shows.
|
|
679
|
+
*/
|
|
680
|
+
async sendLogoff(context, url, snapshot) {
|
|
681
|
+
// Nothing that logs on, whoever put it in the context: the goodbye carries
|
|
682
|
+
// the session's cookie and no credential.
|
|
683
|
+
const extra = Object.fromEntries(Object.entries(context.extraHeaders ?? {}).filter(([name]) => name.trim().toLowerCase() !== 'authorization'));
|
|
684
|
+
try {
|
|
685
|
+
await this.sendDetached({
|
|
686
|
+
method: 'GET',
|
|
687
|
+
url,
|
|
688
|
+
headers: {
|
|
689
|
+
...snapshot.affinity,
|
|
690
|
+
// Detached, so not dressed: the client is said here in so many
|
|
691
|
+
// words, as on every other request of this wire.
|
|
692
|
+
...this.clientHeaders(),
|
|
693
|
+
...extra,
|
|
694
|
+
...snapshot.session,
|
|
695
|
+
Accept: '*/*',
|
|
696
|
+
'sap-adt-request-id': (0, node_crypto_1.randomUUID)().replace(/-/g, ''),
|
|
697
|
+
'sap-cancel-on-close': 'true',
|
|
698
|
+
Cookie: snapshot.cookies,
|
|
699
|
+
},
|
|
700
|
+
});
|
|
701
|
+
this.logger?.debug('Told the server the session is finished');
|
|
702
|
+
}
|
|
703
|
+
catch (error) {
|
|
704
|
+
this.logger?.debug(`Could not tell the server the session is finished: ${error instanceof Error ? error.message : String(error)}`);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
664
707
|
/**
|
|
665
708
|
* Throws for a status the request does not admit — by doing nothing, because
|
|
666
709
|
* that is already what axios does, and `AxiosError` already carries
|
|
@@ -77,7 +77,8 @@ export interface IAdtSessionContext {
|
|
|
77
77
|
baseUrl: string;
|
|
78
78
|
/**
|
|
79
79
|
* Fill the credential into a request the wire itself originates — the CSRF
|
|
80
|
-
* fetch, the cloud preflight
|
|
80
|
+
* fetch, the cloud preflight. Not the logoff: it carries the session's cookie
|
|
81
|
+
* and no credential, as Eclipse sends it. Asked per request, never held: a
|
|
81
82
|
* provider may renew behind the call. Throws `AuthRefusedError` when the
|
|
82
83
|
* credential will not authorize it; the request is then not sent.
|
|
83
84
|
*/
|
|
@@ -147,7 +148,7 @@ export interface IAdtTransport {
|
|
|
147
148
|
*
|
|
148
149
|
* Never throws, and a repeat call finds nothing owed — this is reached from
|
|
149
150
|
* `disconnect()`, which promises to settle. What it does is the wire's: a
|
|
150
|
-
*
|
|
151
|
+
* the logoff the cloud session document links to, the platform's logoff, or
|
|
151
152
|
* closing the conversation.
|
|
152
153
|
*/
|
|
153
154
|
close(context: IAdtSessionContext): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAdtTransport.d.ts","sourceRoot":"","sources":["../../src/connection/IAdtTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,4DAA4D;AAC5D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA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
1
|
-
{"version":3,"file":"OnPremHttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/OnPremHttpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"OnPremHttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/OnPremHttpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAI5B,qBAAa,mBACX,SAAQ,aACR,YAAW,gBAAgB;IAE3B,SAAkB,IAAI,EAAE,MAAM,CAAiB;IAE/C,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAG,QAAQ,CAAU;IAEpC;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW,CAAS;IAEb,SAAS,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7D,aAAa,IAAI,IAAI;IAK9B;;;;;;;OAOG;IAEY,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAwBjE"}
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.OnPremHttpTransport = void 0;
|
|
21
|
-
const cookies_js_1 = require("../utils/cookies.js");
|
|
22
21
|
const HttpTransport_js_1 = require("./HttpTransport.js");
|
|
23
22
|
const ICF_LOGOFF_PATH = '/sap/public/bc/icf/logoff';
|
|
24
23
|
class OnPremHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
@@ -67,29 +66,11 @@ class OnPremHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
|
67
66
|
// eventually close somebody's GUI.
|
|
68
67
|
return;
|
|
69
68
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
await this.sendDetached({
|
|
76
|
-
method: 'GET',
|
|
77
|
-
url: `${context.baseUrl}${ICF_LOGOFF_PATH}`,
|
|
78
|
-
headers: {
|
|
79
|
-
...affinity,
|
|
80
|
-
// Detached, so not dressed: the client is said here in so many
|
|
81
|
-
// words, as on every other request of this wire.
|
|
82
|
-
...this.clientHeaders(),
|
|
83
|
-
...auth,
|
|
84
|
-
...context.extraHeaders,
|
|
85
|
-
Cookie: (0, cookies_js_1.mergeCookieHeaders)(auth.Cookie, cookies),
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
this.logger?.debug('Told the server the session is finished');
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
this.logger?.debug(`Could not tell the server the session is finished: ${error instanceof Error ? error.message : String(error)}`);
|
|
92
|
-
}
|
|
69
|
+
await this.sendLogoff(context, `${context.baseUrl}${ICF_LOGOFF_PATH}`, {
|
|
70
|
+
cookies,
|
|
71
|
+
affinity,
|
|
72
|
+
session: {},
|
|
73
|
+
});
|
|
93
74
|
}
|
|
94
75
|
}
|
|
95
76
|
exports.OnPremHttpTransport = OnPremHttpTransport;
|
package/docs/INDEX.md
CHANGED
|
@@ -83,7 +83,7 @@ mcp-abap-connection/
|
|
|
83
83
|
- **Connection Interface**: [USAGE.md - API Reference](./USAGE.md#api-reference)
|
|
84
84
|
- **Configuration Types**: [USAGE.md - Configuration Types](./USAGE.md#configuration-types)
|
|
85
85
|
- **Connectors**: `AdtOnPremConnector`, `AdtCloudConnector`
|
|
86
|
-
- **Credentials**: an `IAuthProvider` (`@mcp-abap-adt/interfaces-auth`); the ready-made providers live in `@mcp-abap-adt/auth-providers` (6.0.0 with connection 13.x)
|
|
86
|
+
- **Credentials**: an `IAuthProvider` (`@mcp-abap-adt/interfaces-auth`); the ready-made providers live in `@mcp-abap-adt/auth-providers` (6.0.0 with connection 13.x and 14.x)
|
|
87
87
|
- **Errors**: `AuthRefusedError` (its `refusal` an `IAuthProviderError` minted by `@mcp-abap-adt/auth-errors`), `WireLogonError`
|
|
88
88
|
- **Transports**: `HttpTransport`, `RfcTransport` (+ `rfcConversationFrom()`)
|
|
89
89
|
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -189,7 +189,7 @@ puts two copies of the same contract in your tree.
|
|
|
189
189
|
The credential providers (`BasicAuthProvider`, `TokenAuthProvider`,
|
|
190
190
|
`SamlAuthProvider`, `CertificateAuthProvider`) are no longer part of this
|
|
191
191
|
package as of 10.0.0; install `@mcp-abap-adt/auth-providers` for them —
|
|
192
|
-
connection 13.x
|
|
192
|
+
connection 13.x and 14.x work with auth-providers **6.0.0** (`^6.0.0`), built on
|
|
193
193
|
interfaces-auth 7 and auth-errors 2; the 5.x providers do not fit.
|
|
194
194
|
See [Migration to 10.0.0](./MIGRATION-10.0.md),
|
|
195
195
|
[Migration to 12.0.0](./MIGRATION-12.0.md) and
|
package/docs/MIGRATION-10.0.md
CHANGED
|
@@ -221,6 +221,11 @@ gone. Two methods replace it:
|
|
|
221
221
|
provider refuses, so a goodbye that authorizes catches it; the connection absorbs
|
|
222
222
|
a rejected close it dispatched, but a close that never throws is the contract.
|
|
223
223
|
|
|
224
|
+
(Later releases send the logoff of the shipped wires without a credential, as
|
|
225
|
+
Eclipse does: the service answers `sap-authenticated: not required`, and a goodbye
|
|
226
|
+
that waits on the provider leaves the session open when the provider refuses. A
|
|
227
|
+
custom wire is better off doing the same — see the CHANGELOG.)
|
|
228
|
+
|
|
224
229
|
```ts
|
|
225
230
|
import { authError } from '@mcp-abap-adt/auth-errors';
|
|
226
231
|
import type {
|
package/docs/MIGRATION-12.0.md
CHANGED
|
@@ -143,7 +143,7 @@ moment so that a throw becomes a refusal and the answer is classified. A
|
|
|
143
143
|
provider that still answers `{ ok: false, refusal: { reason } }` compiles no
|
|
144
144
|
more in TypeScript. In JavaScript, the connection answers `provider-threw` for
|
|
145
145
|
it, as described above. `@mcp-abap-adt/auth-providers` 6.0.0 (with connection
|
|
146
|
-
13.x) ships `AuthProviderBase`, which owns the four moments for you.
|
|
146
|
+
13.x and 14.x) ships `AuthProviderBase`, which owns the four moments for you.
|
|
147
147
|
|
|
148
148
|
## Deep imports
|
|
149
149
|
|
package/docs/MIGRATION-6.0.md
CHANGED
|
@@ -87,7 +87,9 @@ The cloud wire is not the on-prem one with a different name. It asks for a
|
|
|
87
87
|
session at `/sap/bc/adt/core/http/sessions` and gives it back by `DELETE` on the
|
|
88
88
|
address the server publishes; the on-prem wire has neither, and says goodbye
|
|
89
89
|
through the platform logoff. Handing the wrong one to a connector does not
|
|
90
|
-
compile.
|
|
90
|
+
compile. (Later releases give the cloud session back through the logoff its
|
|
91
|
+
session document links to: the `DELETE`, sent from inside the session, ended
|
|
92
|
+
nothing — see the CHANGELOG.)
|
|
91
93
|
|
|
92
94
|
The `ITokenRefresher` that used to be a constructor slot **is** the credential
|
|
93
95
|
now. Hand `TokenAuthProvider` a bare string instead and you get a token with
|
package/docs/USAGE.md
CHANGED
|
@@ -80,8 +80,7 @@ on-prem system are both ordinary, and a design where the credential picked the
|
|
|
80
80
|
system's session mechanism got one of them wrong whichever way it guessed.
|
|
81
81
|
|
|
82
82
|
Nothing is detected. `/sap/bc/adt/core/http/sessions` answers on on-prem too,
|
|
83
|
-
|
|
84
|
-
it — so asking the server would choose the mechanism that releases nothing.
|
|
83
|
+
so its answer says nothing about which system this is.
|
|
85
84
|
|
|
86
85
|
### Basic Authentication (On-Premise)
|
|
87
86
|
|
|
@@ -768,8 +767,10 @@ class AdtCloudConnector<
|
|
|
768
767
|
|
|
769
768
|
The difference is what each does with the session: on-prem takes it from the
|
|
770
769
|
establishing call and gives it back with the platform's ICF logoff; cloud opens
|
|
771
|
-
one at `/sap/bc/adt/core/http/sessions` and gives it back
|
|
772
|
-
|
|
770
|
+
one at `/sap/bc/adt/core/http/sessions` and gives it back through the logoff
|
|
771
|
+
resource the server links to in the same answer. Not by `DELETE` on the
|
|
772
|
+
session's own address: from inside that session it answers `200` and ends
|
|
773
|
+
nothing (measured on a BTP trial, 2026-10-12).
|
|
773
774
|
|
|
774
775
|
**Both take a transport, and neither defaults one.** What differs is the CHOICE,
|
|
775
776
|
and the type parameter is where that is said: `TTransport` is bound to
|
|
@@ -928,7 +929,7 @@ export class CloudSdkAbapConnection {
|
|
|
928
929
|
### The credential, and how a refusal is classified
|
|
929
930
|
|
|
930
931
|
For SAP BTP cloud systems, hand `AdtCloudConnector` a token provider from
|
|
931
|
-
`@mcp-abap-adt/auth-providers` 6.0.0 (connection 13.x
|
|
932
|
+
`@mcp-abap-adt/auth-providers` 6.0.0 (connection 13.x and 14.x work with `^6.0.0`): `TokenAuthProvider.fixed(token)` is a token with
|
|
932
933
|
nothing behind it, `TokenAuthProvider.from(refresher)` takes an `ITokenRefresher`
|
|
933
934
|
and renews a token the system refused. Obtaining tokens in the first place is
|
|
934
935
|
`@mcp-abap-adt/auth-broker`'s job, not this package's.
|
|
@@ -951,7 +952,7 @@ never asks what kind it is:
|
|
|
951
952
|
|---|---|
|
|
952
953
|
| `prepare()` | once, in `connect()`, before the wire opens |
|
|
953
954
|
| `establish(logon)` | at each logon the wire performs |
|
|
954
|
-
| `authorize(request)` | before every attempt of every request — including the CSRF fetch, the cloud preflight
|
|
955
|
+
| `authorize(request)` | before every attempt of every request — including the CSRF fetch, the cloud preflight and each resend; not the logoff, which carries only the session's cookie |
|
|
955
956
|
| `rejected(rejection)` | the system said no |
|
|
956
957
|
|
|
957
958
|
**Each request asks the provider.** Nothing is cached by the connection, so a
|
package/examples/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This directory contains example code demonstrating how to use the `@mcp-abap-adt
|
|
|
8
8
|
# Install dependencies
|
|
9
9
|
cd packages/connection
|
|
10
10
|
npm install
|
|
11
|
-
npm install @mcp-abap-adt/auth-providers@^6 # the credential providers the examples use (6.0.0 with connection 13.x)
|
|
11
|
+
npm install @mcp-abap-adt/auth-providers@^6 # the credential providers the examples use (6.0.0 with connection 13.x and 14.x)
|
|
12
12
|
|
|
13
13
|
# Build the package
|
|
14
14
|
npm run build
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-abap-adt/connection",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"description": "ABAP connection layer for MCP ABAP ADT server",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,12 +35,13 @@
|
|
|
35
35
|
"chrono": "node scripts/version-stats.mjs",
|
|
36
36
|
"clean": "node scripts/clean.mjs",
|
|
37
37
|
"lint": "npx biome check --write src scripts",
|
|
38
|
-
"lint:check": "npx biome check src scripts --error-on-warnings
|
|
38
|
+
"lint:check": "npx biome check src scripts --error-on-warnings",
|
|
39
|
+
"test:shape": "jest src/__tests__/shapeCheck.test.ts",
|
|
39
40
|
"format": "npx biome format --write src scripts",
|
|
40
41
|
"build": "npm run --silent clean && npx biome check src scripts --diagnostic-level=error && npx tsc -p tsconfig.json && npm run --silent typecheck:scripts",
|
|
41
42
|
"build:fast": "npx tsc -p tsconfig.json",
|
|
42
43
|
"test": "npm run --silent check:docs && jest",
|
|
43
|
-
"prepublishOnly": "npm run build && npm run lint:check && npm run check:docs && npm run --silent check:pack",
|
|
44
|
+
"prepublishOnly": "npm run build && npm run lint:check && npm run test:shape && npm run check:docs && npm run --silent check:pack",
|
|
44
45
|
"check:docs": "node scripts/check-docs.mjs",
|
|
45
46
|
"typecheck:scripts": "npx tsc -p tsconfig.scripts.json",
|
|
46
47
|
"check:pack": "node scripts/check-pack.mjs"
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"node": "^22 || ^24 || ^26"
|
|
50
51
|
},
|
|
51
52
|
"dependencies": {
|
|
52
|
-
"@mcp-abap-adt/auth-errors": "^2.
|
|
53
|
+
"@mcp-abap-adt/auth-errors": "^2.2.0",
|
|
53
54
|
"@mcp-abap-adt/interfaces-adt-connection": "^1.0.0",
|
|
54
55
|
"@mcp-abap-adt/interfaces-auth": "^7.5.0",
|
|
55
56
|
"@mcp-abap-adt/interfaces-auth-sap": "^3.3.0",
|