@mcp-abap-adt/proxy 1.0.2 → 1.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 +17 -0
- package/dist/proxy/btpProxy.d.ts.map +1 -1
- package/dist/proxy/btpProxy.js +23 -7
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.1.0] - 2026-04-12
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- **TypeScript 6.0** — migrated from TypeScript 5.9 to 6.0; added explicit `rootDir: "./src"` to `tsconfig.json` (required by TS6)
|
|
14
|
+
- **@mcp-abap-adt/interfaces 6.0** — updated from v5.0 to v6.0
|
|
15
|
+
- **@modelcontextprotocol/sdk 1.29** — updated from v1.26 to v1.29
|
|
16
|
+
- **@modelcontextprotocol/inspector 0.21** — updated from v0.20 to v0.21
|
|
17
|
+
- **Biome 2.4** — updated from v2.3 to v2.4
|
|
18
|
+
- **Jest 30.3** — updated from v30.2 to v30.3
|
|
19
|
+
- **axios 1.15** — updated from v1.13 to v1.15
|
|
20
|
+
- **ts-jest 29.4.9**, **@types/node 25.6**, **@inquirer/prompts 8.4**, **rimraf 6.1.3** — minor/patch bumps
|
|
21
|
+
|
|
22
|
+
## [1.0.3] - 2026-04-07
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **Automatic token refresh on 401/403 errors** — proxy now detects expired tokens, clears the cache, and retries the request with a freshly obtained token instead of failing immediately
|
|
26
|
+
|
|
10
27
|
## [1.0.2] - 2026-04-07
|
|
11
28
|
|
|
12
29
|
### Fixed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"btpProxy.d.ts","sourceRoot":"","sources":["../../src/proxy/btpProxy.ts"],"names":[],"mappings":"A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AC,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;CAyB7E;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAC5B,OAAO,CAAC,QAAQ,CAAC,CAEnB"}
|
package/dist/proxy/btpProxy.js
CHANGED
|
@@ -715,8 +715,8 @@ class BtpProxy {
|
|
|
715
715
|
retryableStatusCodes: [500, 502, 503, 504],
|
|
716
716
|
};
|
|
717
717
|
try {
|
|
718
|
-
|
|
719
|
-
|
|
718
|
+
let forceTokenRefresh = false;
|
|
719
|
+
const executeRequest = async () => {
|
|
720
720
|
const proxyConfig = await this.buildProxyRequest(originalRequest, routingDecision, originalHeaders, forceTokenRefresh);
|
|
721
721
|
// Log outgoing request details
|
|
722
722
|
const outgoingHeaders = {};
|
|
@@ -778,6 +778,27 @@ class BtpProxy {
|
|
|
778
778
|
const response = await this.axiosInstance.request(proxyConfig);
|
|
779
779
|
this.circuitBreaker.recordSuccess();
|
|
780
780
|
return response;
|
|
781
|
+
};
|
|
782
|
+
const response = await (0, errorHandler_js_1.retryWithBackoff)(async () => {
|
|
783
|
+
try {
|
|
784
|
+
return await executeRequest();
|
|
785
|
+
}
|
|
786
|
+
catch (error) {
|
|
787
|
+
if (!forceTokenRefresh && (0, errorHandler_js_1.isTokenExpirationError)(error)) {
|
|
788
|
+
const destination = routingDecision.btpDestination ||
|
|
789
|
+
this.getHeaderValue(originalHeaders[interfaces_1.HEADER_SAP_DESTINATION]);
|
|
790
|
+
logger_js_1.logger?.warn('Token expired, retrying with refreshed token', {
|
|
791
|
+
type: 'TOKEN_EXPIRED_RETRY',
|
|
792
|
+
destination,
|
|
793
|
+
});
|
|
794
|
+
if (destination) {
|
|
795
|
+
this.tokenCache.delete(destination);
|
|
796
|
+
}
|
|
797
|
+
forceTokenRefresh = true;
|
|
798
|
+
return await executeRequest();
|
|
799
|
+
}
|
|
800
|
+
throw error;
|
|
801
|
+
}
|
|
781
802
|
}, retryOptions);
|
|
782
803
|
// Return response in JSON-RPC format
|
|
783
804
|
return {
|
|
@@ -788,11 +809,6 @@ class BtpProxy {
|
|
|
788
809
|
};
|
|
789
810
|
}
|
|
790
811
|
catch (error) {
|
|
791
|
-
if ((0, errorHandler_js_1.isTokenExpirationError)(error)) {
|
|
792
|
-
logger_js_1.logger?.warn('Token expired usually handled by retry with refresh', {
|
|
793
|
-
type: 'TOKEN_EXPIRED_ERROR',
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
812
|
this.circuitBreaker.recordFailure();
|
|
797
813
|
let statusCode = 500;
|
|
798
814
|
let errorMessage = 'Internal Server Error';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-abap-adt/proxy",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "MCP proxy server for SAP ABAP ADT - proxies local requests to cloud-llm-hub with JWT authentication",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@biomejs/biome": "^2.3.15",
|
|
48
48
|
"@jest/globals": "^30.2.0",
|
|
49
|
-
"@modelcontextprotocol/inspector": "^0.
|
|
49
|
+
"@modelcontextprotocol/inspector": "^0.21.1",
|
|
50
50
|
"@types/jest": "^30.0.0",
|
|
51
51
|
"@types/js-yaml": "^4.0.9",
|
|
52
52
|
"@types/node": "^25.2.3",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"rimraf": "^6.1.2",
|
|
62
62
|
"ts-jest": "^29.2.5",
|
|
63
63
|
"tsx": "^4.21.0",
|
|
64
|
-
"typescript": "^
|
|
64
|
+
"typescript": "^6.0.2"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@inquirer/prompts": "^8.3.2",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@mcp-abap-adt/auth-providers": "^1.0.5",
|
|
70
70
|
"@mcp-abap-adt/auth-stores": "^1.0.4",
|
|
71
71
|
"@mcp-abap-adt/header-validator": "^0.1.8",
|
|
72
|
-
"@mcp-abap-adt/interfaces": "^
|
|
72
|
+
"@mcp-abap-adt/interfaces": "^6.0.0",
|
|
73
73
|
"@mcp-abap-adt/logger": "^0.1.4",
|
|
74
74
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
75
75
|
"axios": "^1.13.5",
|