@mcp-abap-adt/interfaces 0.1.19 → 0.2.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
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
|
+
## [0.2.0] - 2025-12-19
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Network Error Detection Constants and Utility**: Added network error codes and helper function for detecting infrastructure-level connection issues
|
|
14
|
+
- `NETWORK_ERROR_CODES` - Object containing standard network error codes:
|
|
15
|
+
- `ECONNREFUSED` - Connection refused (server not accepting connections)
|
|
16
|
+
- `ETIMEDOUT` - Connection timeout (server not responding)
|
|
17
|
+
- `ENOTFOUND` - DNS resolution failed (hostname not found)
|
|
18
|
+
- `ECONNRESET` - Connection reset by peer
|
|
19
|
+
- `ENETUNREACH` - Network is unreachable
|
|
20
|
+
- `EHOSTUNREACH` - Host is unreachable
|
|
21
|
+
- `NetworkErrorCode` - Type for network error codes
|
|
22
|
+
- `isNetworkError(error: any): boolean` - Utility function to check if an error is a network-level error
|
|
23
|
+
- These constants and utilities help distinguish network/infrastructure errors from application-level HTTP errors
|
|
24
|
+
- Network errors should not trigger retry logic (CSRF, auth) as they indicate VPN, DNS, or connectivity issues
|
|
25
|
+
- Exported from `@mcp-abap-adt/interfaces` package in connection domain
|
|
26
|
+
|
|
10
27
|
## [0.1.19] - 2025-12-17
|
|
11
28
|
|
|
12
29
|
### Added
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network error codes that indicate infrastructure-level connection issues
|
|
3
|
+
* These errors should not trigger retry logic (CSRF, auth) as they indicate
|
|
4
|
+
* problems with network connectivity, VPN, DNS, or server availability.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Network error codes
|
|
8
|
+
*/
|
|
9
|
+
export declare const NETWORK_ERROR_CODES: {
|
|
10
|
+
/** Connection refused - server not accepting connections */
|
|
11
|
+
readonly ECONNREFUSED: "ECONNREFUSED";
|
|
12
|
+
/** Connection timeout - server not responding */
|
|
13
|
+
readonly ETIMEDOUT: "ETIMEDOUT";
|
|
14
|
+
/** DNS resolution failed - hostname not found */
|
|
15
|
+
readonly ENOTFOUND: "ENOTFOUND";
|
|
16
|
+
/** Connection reset by peer */
|
|
17
|
+
readonly ECONNRESET: "ECONNRESET";
|
|
18
|
+
/** Network is unreachable */
|
|
19
|
+
readonly ENETUNREACH: "ENETUNREACH";
|
|
20
|
+
/** Host is unreachable */
|
|
21
|
+
readonly EHOSTUNREACH: "EHOSTUNREACH";
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Type for network error codes
|
|
25
|
+
*/
|
|
26
|
+
export type NetworkErrorCode = typeof NETWORK_ERROR_CODES[keyof typeof NETWORK_ERROR_CODES];
|
|
27
|
+
/**
|
|
28
|
+
* Check if an error is a network error
|
|
29
|
+
* @param error Error object to check
|
|
30
|
+
* @returns true if error is a network-level error
|
|
31
|
+
*/
|
|
32
|
+
export declare function isNetworkError(error: any): boolean;
|
|
33
|
+
//# sourceMappingURL=NetworkErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NetworkErrors.d.ts","sourceRoot":"","sources":["../../src/connection/NetworkErrors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;IAC9B,4DAA4D;;IAE5D,iDAAiD;;IAEjD,iDAAiD;;IAEjD,+BAA+B;;IAE/B,6BAA6B;;IAE7B,0BAA0B;;CAElB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,mBAAmB,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAE5F;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAiBlD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Network error codes that indicate infrastructure-level connection issues
|
|
4
|
+
* These errors should not trigger retry logic (CSRF, auth) as they indicate
|
|
5
|
+
* problems with network connectivity, VPN, DNS, or server availability.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.NETWORK_ERROR_CODES = void 0;
|
|
9
|
+
exports.isNetworkError = isNetworkError;
|
|
10
|
+
/**
|
|
11
|
+
* Network error codes
|
|
12
|
+
*/
|
|
13
|
+
exports.NETWORK_ERROR_CODES = {
|
|
14
|
+
/** Connection refused - server not accepting connections */
|
|
15
|
+
ECONNREFUSED: 'ECONNREFUSED',
|
|
16
|
+
/** Connection timeout - server not responding */
|
|
17
|
+
ETIMEDOUT: 'ETIMEDOUT',
|
|
18
|
+
/** DNS resolution failed - hostname not found */
|
|
19
|
+
ENOTFOUND: 'ENOTFOUND',
|
|
20
|
+
/** Connection reset by peer */
|
|
21
|
+
ECONNRESET: 'ECONNRESET',
|
|
22
|
+
/** Network is unreachable */
|
|
23
|
+
ENETUNREACH: 'ENETUNREACH',
|
|
24
|
+
/** Host is unreachable */
|
|
25
|
+
EHOSTUNREACH: 'EHOSTUNREACH',
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Check if an error is a network error
|
|
29
|
+
* @param error Error object to check
|
|
30
|
+
* @returns true if error is a network-level error
|
|
31
|
+
*/
|
|
32
|
+
function isNetworkError(error) {
|
|
33
|
+
if (!error) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
const errorCode = error.code;
|
|
37
|
+
const errorMessage = error.message || '';
|
|
38
|
+
// Check error code
|
|
39
|
+
if (errorCode && Object.values(exports.NETWORK_ERROR_CODES).includes(errorCode)) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
// Check error message (fallback for wrapped errors)
|
|
43
|
+
return Object.values(exports.NETWORK_ERROR_CODES).some(code => errorMessage.includes(code));
|
|
44
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export type { ISessionStore } from './session/ISessionStore';
|
|
|
15
15
|
export type { IServiceKeyStore } from './serviceKey/IServiceKeyStore';
|
|
16
16
|
export type { IAbapConnection } from './connection/IAbapConnection';
|
|
17
17
|
export type { IAbapRequestOptions } from './connection/IAbapRequestOptions';
|
|
18
|
+
export { NETWORK_ERROR_CODES, isNetworkError } from './connection/NetworkErrors';
|
|
19
|
+
export type { NetworkErrorCode } from './connection/NetworkErrors';
|
|
18
20
|
export type { ISapConfig } from './sap/ISapConfig';
|
|
19
21
|
export type { SapAuthType } from './sap/SapAuthType';
|
|
20
22
|
export type { ISessionStorage } from './storage/ISessionStorage';
|
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,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG3E,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,YAAY,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;
|
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,MAAM,mCAAmC,CAAC;AAGvE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,cAAc,WAAW,CAAC;AAG1B,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
20
20
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.AdtObjectErrorCodes = exports.AuthMethodPriority = exports.LogLevel = void 0;
|
|
23
|
+
exports.AdtObjectErrorCodes = exports.AuthMethodPriority = exports.LogLevel = exports.isNetworkError = exports.NETWORK_ERROR_CODES = void 0;
|
|
24
|
+
var NetworkErrors_1 = require("./connection/NetworkErrors");
|
|
25
|
+
Object.defineProperty(exports, "NETWORK_ERROR_CODES", { enumerable: true, get: function () { return NetworkErrors_1.NETWORK_ERROR_CODES; } });
|
|
26
|
+
Object.defineProperty(exports, "isNetworkError", { enumerable: true, get: function () { return NetworkErrors_1.isNetworkError; } });
|
|
24
27
|
var LogLevel_1 = require("./logging/LogLevel");
|
|
25
28
|
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return LogLevel_1.LogLevel; } });
|
|
26
29
|
var IValidatedAuthConfig_1 = require("./validation/IValidatedAuthConfig");
|