@mcp-abap-adt/interfaces-adt-connection 1.0.1 → 2.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 CHANGED
@@ -7,6 +7,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.0.0] - 2026-10-05
11
+
12
+ ### Changed (breaking)
13
+
14
+ - **An answer whose types the caller did not name is `unknown`, not `any`.**
15
+ `IAdtWireResponse<T = unknown, D = unknown>` and
16
+ `IAbapConnection.makeAdtRequest<T = unknown, D = unknown>` — both were
17
+ `= any`. Code that reads `answer.data.someField` without naming the type
18
+ compiled against anything, a typo included; now it does not compile until
19
+ the type is named or checked. The same holds for every type that names
20
+ `IAdtWireResponse` without type arguments, in this package and in
21
+ `@mcp-abap-adt/interfaces-adt` (13.0.0). Names, fields and runtime are
22
+ unchanged.
23
+
24
+ ### Migrating from 1.x
25
+
26
+ A consumer on 1.x does one of these where the compiler now reports an error:
27
+
28
+ - **Name the type** the request answers, when it is known:
29
+ `connection.makeAdtRequest<string>(options)`, or
30
+ `IAdtWireResponse<string>` for a stored answer.
31
+ - **Narrow `unknown`** where the shape is checked at run time anyway:
32
+ `typeof answer.data === 'string'`, or a type guard for an object, before
33
+ reading a field. `data && typeof data === 'object'` narrows to `object`,
34
+ which has no fields: use `'systemID' in data` or a guard.
35
+ - **A stub or mock of `makeAdtRequest`** that returns a fixed shape is no
36
+ longer assignable to the generic signature (with `any` it was): declare it
37
+ generic, `async <T = unknown, D = unknown>(options) => ({ … data: body as T … })`,
38
+ or annotate its return as `Promise<IAdtWireResponse<any, any>>` in the test.
39
+
40
+ Measured before release, with this package's 2.0.0 declarations overlaid on a
41
+ copy of each consumer (`tsc --noEmit`, nothing changed in those repositories):
42
+ `@mcp-abap-adt/connection` 0 new errors; `adt-clients` 8 — 5 in
43
+ `src/utils/systemInfo.ts` (fields read off an `object`), 3 in unit-test stubs
44
+ of `makeAdtRequest`; `mcp-abap-adt` 1, a test helper's `makeAdtRequest` stub.
45
+
46
+ ### Changed
47
+
48
+ - **Built under a stricter compiler and lint**: the repository's base
49
+ `tsconfig` adds `noImplicitReturns`, `noFallthroughCasesInSwitch`,
50
+ `noImplicitOverride`, `noUncheckedIndexedAccess` and
51
+ `exactOptionalPropertyTypes`; lint fails on a warning and on any `any`.
52
+ A new compile-only check (`__typechecks__/wireDefaults.ts`) holds the
53
+ `unknown` defaults.
54
+
10
55
  ## [1.0.1] - 2026-10-02
11
56
 
12
57
  ### Changed
package/README.md CHANGED
@@ -11,7 +11,7 @@ npm install @mcp-abap-adt/interfaces-adt-connection
11
11
  |---|---|
12
12
  | `IAbapConnection` | a connection an ADT request is made through: `makeAdtRequest`, connect/disconnect, the session type |
13
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 |
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
17
  | `ITimeoutConfig` | the deadlines a caller gives a connection: `default`, `csrf`, `long` |
@@ -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 = any, D = any> extends Omit<IHttpWireResponse<T, D>, 'headers'> {
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 = any, D = any>(options: IAbapRequestOptions): Promise<IAdtWireResponse<T, D>>;
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,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAE/C,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAChD,SAAQ,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC;IAChD;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG;QACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,kBAAkB,CAAC,EAAE,eAAe,CAAC;QACrC,kBAAkB,CAAC,EAAE,eAAe,CAAC;QACrC,kBAAkB,CAAC,EAAE,eAAe,CAAC;KACtC,CAAC;CACH;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IA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AAO,CAAC,MAAM,CAAC,CAAC;IAE9B;;OAEG;IACH,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAE9B;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,CAAC;IAErD;;;;;;;;;;OAUG;IACH,cAAc,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EACrC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/interfaces-adt-connection",
3
- "version": "1.0.1",
3
+ "version": "2.0.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",