@mcp-abap-adt/connection 6.0.1 → 8.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/CHANGELOG.md +157 -1
- package/COPYING +674 -0
- package/LICENSE +165 -21
- package/README.md +22 -1
- package/dist/connection/AbstractAbapConnection.d.ts +58 -25
- package/dist/connection/AbstractAbapConnection.d.ts.map +1 -1
- package/dist/connection/AbstractAbapConnection.js +119 -5
- package/dist/connection/CloudHttpTransport.d.ts +19 -0
- package/dist/connection/CloudHttpTransport.d.ts.map +1 -1
- package/dist/connection/CloudHttpTransport.js +21 -0
- package/dist/connection/HttpTransport.d.ts +9 -0
- package/dist/connection/HttpTransport.d.ts.map +1 -1
- package/dist/connection/HttpTransport.js +12 -0
- package/dist/utils/networkErrors.d.ts +2 -0
- package/dist/utils/networkErrors.d.ts.map +1 -0
- package/dist/utils/networkErrors.js +25 -0
- package/docs/MIGRATION-6.0.md +1 -1
- package/package.json +5 -4
|
@@ -160,6 +160,17 @@ class HttpTransport {
|
|
|
160
160
|
: {}),
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* What this wire says about the session it is already in, on every request.
|
|
165
|
+
*
|
|
166
|
+
* Empty here, because it is not the same on every wire: a cloud session is a
|
|
167
|
+
* resource that has to be named, an on-prem one arrives with the logon, and
|
|
168
|
+
* an RFC conversation has no such notion at all. A wire that has something to
|
|
169
|
+
* say overrides this.
|
|
170
|
+
*/
|
|
171
|
+
sessionHeaders() {
|
|
172
|
+
return {};
|
|
173
|
+
}
|
|
163
174
|
/**
|
|
164
175
|
* Earn a CSRF token, and with it the cookies that name the session.
|
|
165
176
|
*
|
|
@@ -299,6 +310,7 @@ class HttpTransport {
|
|
|
299
310
|
dress(headers) {
|
|
300
311
|
const dressed = {
|
|
301
312
|
...this.affinityHeaders(),
|
|
313
|
+
...this.sessionHeaders(),
|
|
302
314
|
...headers,
|
|
303
315
|
};
|
|
304
316
|
const merged = (0, cookies_js_1.mergeCookieHeaders)(headers?.Cookie, this.combined ?? undefined);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkErrors.d.ts","sourceRoot":"","sources":["../../src/utils/networkErrors.ts"],"names":[],"mappings":"AAkBA,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAItD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNetworkError = isNetworkError;
|
|
4
|
+
/**
|
|
5
|
+
* Whether an error is the network's rather than the server's.
|
|
6
|
+
*
|
|
7
|
+
* `@mcp-abap-adt/interfaces` published this as a function until 29.0.0, when
|
|
8
|
+
* that package stopped emitting code: it holds types, interfaces and constants,
|
|
9
|
+
* and a predicate is none of those. The codes are still there —
|
|
10
|
+
* {@link NETWORK_ERROR_CODES} — and the judgement lives here, with the wire it
|
|
11
|
+
* judges.
|
|
12
|
+
*
|
|
13
|
+
* The distinction is not cosmetic. A refusal from SAP is an answer and can be
|
|
14
|
+
* retried once a token is refreshed; `ECONNREFUSED` is a statement about
|
|
15
|
+
* infrastructure, and retrying it re-runs the same failure against the same
|
|
16
|
+
* unreachable host.
|
|
17
|
+
*/
|
|
18
|
+
const interfaces_1 = require("@mcp-abap-adt/interfaces");
|
|
19
|
+
const CODES = new Set(Object.values(interfaces_1.NETWORK_ERROR_CODES));
|
|
20
|
+
function isNetworkError(error) {
|
|
21
|
+
if (!error || typeof error !== 'object')
|
|
22
|
+
return false;
|
|
23
|
+
const code = error.code;
|
|
24
|
+
return typeof code === 'string' && CODES.has(code);
|
|
25
|
+
}
|
package/docs/MIGRATION-6.0.md
CHANGED
|
@@ -294,7 +294,7 @@ session was negotiated elsewhere:
|
|
|
294
294
|
```typescript
|
|
295
295
|
import type { IAuthProvider, IRenewableCredential } from '@mcp-abap-adt/interfaces';
|
|
296
296
|
|
|
297
|
-
function isRenewable(c: IAuthProvider): c is IRenewableCredential {
|
|
297
|
+
function isRenewable(c: IAuthProvider): c is IAuthProvider & IRenewableCredential {
|
|
298
298
|
return typeof (c as Partial<IRenewableCredential>).renew === 'function';
|
|
299
299
|
}
|
|
300
300
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-abap-adt/connection",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.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",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"examples",
|
|
12
12
|
"README.md",
|
|
13
13
|
"CHANGELOG.md",
|
|
14
|
-
"LICENSE"
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"COPYING"
|
|
15
16
|
],
|
|
16
17
|
"bin": {
|
|
17
18
|
"sap-abap-auth": "./bin/sap-abap-auth.js"
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"abap-adt"
|
|
26
27
|
],
|
|
27
28
|
"author": "Oleksii Kyslytsia <oleksij.kyslytsja@gmail.com>",
|
|
28
|
-
"license": "
|
|
29
|
+
"license": "LGPL-3.0-only",
|
|
29
30
|
"homepage": "https://github.com/fr0ster/mcp-abap-connection#readme",
|
|
30
31
|
"bugs": {
|
|
31
32
|
"url": "https://github.com/fr0ster/mcp-abap-connection/issues"
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
"node": ">=18.0.0"
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
|
-
"@mcp-abap-adt/interfaces": "^
|
|
56
|
+
"@mcp-abap-adt/interfaces": "^39.0.0",
|
|
56
57
|
"axios": "^1.16.0",
|
|
57
58
|
"commander": "^14.0.3",
|
|
58
59
|
"open": "^11.0.0"
|