@mcp-abap-adt/interfaces-adt-connection 1.0.1 → 2.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 +60 -0
- package/README.md +4 -3
- package/dist/IAbapConnection.d.ts +2 -2
- package/dist/IAbapConnection.d.ts.map +1 -1
- package/dist/IAbapRequestOptions.d.ts +14 -0
- package/dist/IAbapRequestOptions.d.ts.map +1 -1
- package/dist/IAbapRequestOptions.js +6 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.1.0] - 2026-10-12
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`IAbapRequestOptions.signal?: AbortSignal | undefined`** — the caller no
|
|
15
|
+
longer needs this request. A connection honouring it sends nothing more of
|
|
16
|
+
the request once the signal has aborted: not the request, if it has not left
|
|
17
|
+
yet, and no resend (a CSRF retry, a reconnect). A request already on the wire
|
|
18
|
+
is not recalled — the server may still act on it. Optional: every request
|
|
19
|
+
written for 2.0.0 compiles unchanged, and a connection that ignores the
|
|
20
|
+
field still satisfies `IAbapConnection`.
|
|
21
|
+
- **`ADT_REQUEST_ERROR` / `AdtRequestErrorCode`** — what such a request fails
|
|
22
|
+
with: `ADT_REQUEST_ERROR.ABORTED` (`'ADT_REQUEST_ABORTED'`), as the thrown
|
|
23
|
+
error's `code`. Match on the code, not on a message.
|
|
24
|
+
|
|
25
|
+
## [2.0.0] - 2026-10-05
|
|
26
|
+
|
|
27
|
+
### Changed (breaking)
|
|
28
|
+
|
|
29
|
+
- **An answer whose types the caller did not name is `unknown`, not `any`.**
|
|
30
|
+
`IAdtWireResponse<T = unknown, D = unknown>` and
|
|
31
|
+
`IAbapConnection.makeAdtRequest<T = unknown, D = unknown>` — both were
|
|
32
|
+
`= any`. Code that reads `answer.data.someField` without naming the type
|
|
33
|
+
compiled against anything, a typo included; now it does not compile until
|
|
34
|
+
the type is named or checked. The same holds for every type that names
|
|
35
|
+
`IAdtWireResponse` without type arguments, in this package and in
|
|
36
|
+
`@mcp-abap-adt/interfaces-adt` (13.0.0). Names, fields and runtime are
|
|
37
|
+
unchanged.
|
|
38
|
+
|
|
39
|
+
### Migrating from 1.x
|
|
40
|
+
|
|
41
|
+
A consumer on 1.x does one of these where the compiler now reports an error:
|
|
42
|
+
|
|
43
|
+
- **Name the type** the request answers, when it is known:
|
|
44
|
+
`connection.makeAdtRequest<string>(options)`, or
|
|
45
|
+
`IAdtWireResponse<string>` for a stored answer.
|
|
46
|
+
- **Narrow `unknown`** where the shape is checked at run time anyway:
|
|
47
|
+
`typeof answer.data === 'string'`, or a type guard for an object, before
|
|
48
|
+
reading a field. `data && typeof data === 'object'` narrows to `object`,
|
|
49
|
+
which has no fields: use `'systemID' in data` or a guard.
|
|
50
|
+
- **A stub or mock of `makeAdtRequest`** that returns a fixed shape is no
|
|
51
|
+
longer assignable to the generic signature (with `any` it was): declare it
|
|
52
|
+
generic, `async <T = unknown, D = unknown>(options) => ({ … data: body as T … })`,
|
|
53
|
+
or annotate its return as `Promise<IAdtWireResponse<any, any>>` in the test.
|
|
54
|
+
|
|
55
|
+
Measured before release, with this package's 2.0.0 declarations overlaid on a
|
|
56
|
+
copy of each consumer (`tsc --noEmit`, nothing changed in those repositories):
|
|
57
|
+
`@mcp-abap-adt/connection` 0 new errors; `adt-clients` 8 — 5 in
|
|
58
|
+
`src/utils/systemInfo.ts` (fields read off an `object`), 3 in unit-test stubs
|
|
59
|
+
of `makeAdtRequest`; `mcp-abap-adt` 1, a test helper's `makeAdtRequest` stub.
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- **Built under a stricter compiler and lint**: the repository's base
|
|
64
|
+
`tsconfig` adds `noImplicitReturns`, `noFallthroughCasesInSwitch`,
|
|
65
|
+
`noImplicitOverride`, `noUncheckedIndexedAccess` and
|
|
66
|
+
`exactOptionalPropertyTypes`; lint fails on a warning and on any `any`.
|
|
67
|
+
A new compile-only check (`__typechecks__/wireDefaults.ts`) holds the
|
|
68
|
+
`unknown` defaults.
|
|
69
|
+
|
|
10
70
|
## [1.0.1] - 2026-10-02
|
|
11
71
|
|
|
12
72
|
### Changed
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @mcp-abap-adt/interfaces-adt-connection
|
|
2
2
|
|
|
3
3
|
The ABAP connection contract: what an ADT request is sent through, and what
|
|
4
|
-
comes back off the wire. Types and
|
|
4
|
+
comes back off the wire. Types and two constants; no implementation.
|
|
5
5
|
|
|
6
6
|
```bash
|
|
7
7
|
npm install @mcp-abap-adt/interfaces-adt-connection
|
|
@@ -10,10 +10,11 @@ npm install @mcp-abap-adt/interfaces-adt-connection
|
|
|
10
10
|
| symbol | what it is |
|
|
11
11
|
|---|---|
|
|
12
12
|
| `IAbapConnection` | a connection an ADT request is made through: `makeAdtRequest`, connect/disconnect, the session type |
|
|
13
|
-
| `IAbapRequestOptions` | what one request carries |
|
|
14
|
-
| `IAdtWireResponse` | the answer as it came off the wire — extends `IHttpWireResponse` from `interfaces-network` with the headers ADT sends |
|
|
13
|
+
| `IAbapRequestOptions` | what one request carries. Since 2.1.0 it may carry the caller's `signal`: once it aborts, nothing more of the request is sent — not the request, not a resend (a CSRF retry, a reconnect) — and the request fails with `ADT_REQUEST_ERROR.ABORTED`. A request already on the wire is not recalled: the server may still act on it |
|
|
14
|
+
| `IAdtWireResponse` | the answer as it came off the wire — extends `IHttpWireResponse` from `interfaces-network` with the headers ADT sends. Since 2.0.0 its `data` is `unknown` unless the caller names the type (`makeAdtRequest<string>(…)`); it was `any` — see the CHANGELOG's migration note |
|
|
15
15
|
| `ISessionLifecycleAware`, `ICriticalSection`, `IRequestProfiling`, `IDeferredResponseConnection` | the connection's capability atoms — a connection honours the ones it can |
|
|
16
16
|
| `ADT_SESSION_ERROR` / `AdtSessionErrorCode` | what a session failure is called |
|
|
17
|
+
| `ADT_REQUEST_ERROR` / `AdtRequestErrorCode` | what a request failure is called: `ADT_REQUEST_ABORTED`, the request's signal aborted before it was sent or before a resend |
|
|
17
18
|
| `ITimeoutConfig` | the deadlines a caller gives a connection: `default`, `csrf`, `long` |
|
|
18
19
|
|
|
19
20
|
## Why this package exists
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { IHttpHeaderValue, IHttpWireResponse } from '@mcp-abap-adt/interfaces-network';
|
|
5
5
|
import type { IAbapRequestOptions } from './IAbapRequestOptions';
|
|
6
6
|
export type IAdtHeaderValue = IHttpHeaderValue;
|
|
7
|
-
export interface IAdtWireResponse<T =
|
|
7
|
+
export interface IAdtWireResponse<T = unknown, D = unknown> extends Omit<IHttpWireResponse<T, D>, 'headers'> {
|
|
8
8
|
/**
|
|
9
9
|
* **The generic shape, narrowed by the headers ADT actually sends.** The
|
|
10
10
|
* frame itself — `data`, `status`, `statusText`, `config`, `request` — is
|
|
@@ -60,6 +60,6 @@ export interface IAbapConnection {
|
|
|
60
60
|
* @param options - Request options (url, method, data, etc.)
|
|
61
61
|
* @returns Promise with Axios response
|
|
62
62
|
*/
|
|
63
|
-
makeAdtRequest<T =
|
|
63
|
+
makeAdtRequest<T = unknown, D = unknown>(options: IAbapRequestOptions): Promise<IAdtWireResponse<T, D>>;
|
|
64
64
|
}
|
|
65
65
|
//# sourceMappingURL=IAbapConnection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAbapConnection.d.ts","sourceRoot":"","sources":["../src/IAbapConnection.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE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EACrC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACpC"}
|
|
@@ -5,5 +5,19 @@ export interface IAbapRequestOptions {
|
|
|
5
5
|
data?: unknown;
|
|
6
6
|
params?: unknown;
|
|
7
7
|
headers?: Record<string, string>;
|
|
8
|
+
/**
|
|
9
|
+
* The caller no longer needs this request: nothing more of it is sent.
|
|
10
|
+
*
|
|
11
|
+
* A request the signal aborts before it is sent, or before a resend (a CSRF
|
|
12
|
+
* retry, a reconnect), fails with `ADT_REQUEST_ERROR.ABORTED`. A request
|
|
13
|
+
* already on the wire is not recalled — the server may still act on it.
|
|
14
|
+
*/
|
|
15
|
+
signal?: AbortSignal | undefined;
|
|
8
16
|
}
|
|
17
|
+
/** Error codes a request raises. Match on these, not on messages. */
|
|
18
|
+
export declare const ADT_REQUEST_ERROR: {
|
|
19
|
+
/** The request's signal aborted before it was sent, or before a resend. */
|
|
20
|
+
readonly ABORTED: "ADT_REQUEST_ABORTED";
|
|
21
|
+
};
|
|
22
|
+
export type AdtRequestErrorCode = (typeof ADT_REQUEST_ERROR)[keyof typeof ADT_REQUEST_ERROR];
|
|
9
23
|
//# sourceMappingURL=IAbapRequestOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAbapRequestOptions.d.ts","sourceRoot":"","sources":["../src/IAbapRequestOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC"}
|
|
1
|
+
{"version":3,"file":"IAbapRequestOptions.d.ts","sourceRoot":"","sources":["../src/IAbapRequestOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAClC;AAED,qEAAqE;AACrE,eAAO,MAAM,iBAAiB;IAC5B,2EAA2E;;CAEnE,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ADT_REQUEST_ERROR = void 0;
|
|
4
|
+
/** Error codes a request raises. Match on these, not on messages. */
|
|
5
|
+
exports.ADT_REQUEST_ERROR = {
|
|
6
|
+
/** The request's signal aborted before it was sent, or before a resend. */
|
|
7
|
+
ABORTED: 'ADT_REQUEST_ABORTED',
|
|
8
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* (decision 35); what separated it is the release rate (decision 38).
|
|
12
12
|
*/
|
|
13
13
|
export type { IAbapConnection, IAdtWireResponse } from './IAbapConnection';
|
|
14
|
-
export type { IAbapRequestOptions } from './IAbapRequestOptions';
|
|
14
|
+
export type { AdtRequestErrorCode, IAbapRequestOptions, } from './IAbapRequestOptions';
|
|
15
|
+
export { ADT_REQUEST_ERROR } from './IAbapRequestOptions';
|
|
15
16
|
export type { AdtSessionErrorCode, ICriticalSection, IDeferredResponseConnection, IRequestProfiling, ISessionLifecycleAware, } from './IConnectionCapabilities';
|
|
16
17
|
export { ADT_SESSION_ERROR } from './IConnectionCapabilities';
|
|
17
18
|
export type { ITimeoutConfig } from './ITimeoutConfig';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,YAAY,EACV,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ADT_SESSION_ERROR = void 0;
|
|
3
|
+
exports.ADT_SESSION_ERROR = exports.ADT_REQUEST_ERROR = void 0;
|
|
4
|
+
var IAbapRequestOptions_1 = require("./IAbapRequestOptions");
|
|
5
|
+
Object.defineProperty(exports, "ADT_REQUEST_ERROR", { enumerable: true, get: function () { return IAbapRequestOptions_1.ADT_REQUEST_ERROR; } });
|
|
4
6
|
var IConnectionCapabilities_1 = require("./IConnectionCapabilities");
|
|
5
7
|
Object.defineProperty(exports, "ADT_SESSION_ERROR", { enumerable: true, get: function () { return IConnectionCapabilities_1.ADT_SESSION_ERROR; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-abap-adt/interfaces-adt-connection",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "The ABAP connection contract: IAbapConnection, its capability atoms, the wire response and the session error codes",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|