@mcp-abap-adt/adt-clients 34.0.0 → 34.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/dist/index.d.ts CHANGED
@@ -26,4 +26,5 @@ export * from './index.executors';
26
26
  export * from './index.readings';
27
27
  export * from './index.runtime';
28
28
  export * from './index.ws';
29
+ export { exemptFromAcceptNegotiation, getBaseRequest, } from './utils/acceptNegotiation';
29
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,2BAA2B,EAC3B,cAAc,GACf,MAAM,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
34
34
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
35
35
  };
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.CT_INCLUDE = exports.AdtInclude = exports.AdtBatchConnection = void 0;
37
+ exports.getBaseRequest = exports.exemptFromAcceptNegotiation = exports.CT_INCLUDE = exports.AdtInclude = exports.AdtBatchConnection = void 0;
38
38
  var batch_1 = require("./batch");
39
39
  Object.defineProperty(exports, "AdtBatchConnection", { enumerable: true, get: function () { return batch_1.AdtBatchConnection; } });
40
40
  var include_1 = require("./core/include");
@@ -46,3 +46,6 @@ __exportStar(require("./index.executors"), exports);
46
46
  __exportStar(require("./index.readings"), exports);
47
47
  __exportStar(require("./index.runtime"), exports);
48
48
  __exportStar(require("./index.ws"), exports);
49
+ var acceptNegotiation_1 = require("./utils/acceptNegotiation");
50
+ Object.defineProperty(exports, "exemptFromAcceptNegotiation", { enumerable: true, get: function () { return acceptNegotiation_1.exemptFromAcceptNegotiation; } });
51
+ Object.defineProperty(exports, "getBaseRequest", { enumerable: true, get: function () { return acceptNegotiation_1.getBaseRequest; } });
@@ -1,6 +1,13 @@
1
1
  import type { IAbapConnection, IAbapRequestOptions, IAdtWireResponse } from '@mcp-abap-adt/interfaces-adt-connection';
2
2
  import type { ILogger } from '@mcp-abap-adt/interfaces-utils';
3
- /** Mark a connection so accept negotiation never corrects or resends through it. */
3
+ /**
4
+ * Mark a connection so accept negotiation never corrects or resends through it.
5
+ *
6
+ * Public for a consumer that hands members its own connection over an
7
+ * `AdtBatchConnection` — a per-call wrapper, say: an `AdtBatchConnection` marks
8
+ * itself, but a different object is not it, and is negotiated like any other
9
+ * connection unless it is marked too. The mark is permanent; there is no unmark.
10
+ */
4
11
  export declare function exemptFromAcceptNegotiation(connection: IAbapConnection): void;
5
12
  export interface IAcceptNegotiationOptions {
6
13
  enableAcceptCorrection?: boolean;
@@ -19,8 +26,10 @@ export declare function extractSupportedContentType(error: unknown): string[];
19
26
  * wrapped it: accept negotiation corrects and resends nothing. The
20
27
  * connection's own handling (credential, CSRF, session) is untouched.
21
28
  *
22
- * Exported for the batch connection: what SAP answers to an envelope is the
23
- * caller's to read.
29
+ * Exported for the batch connection, and public for a consumer that forwards a
30
+ * batch's envelope through a connection of its own over one an `AdtClient`
31
+ * wrapped: what SAP answers to an envelope is the caller's to read. For a
32
+ * connection never wrapped it is the connection's own `makeAdtRequest`, bound.
24
33
  */
25
34
  export declare function getBaseRequest(connection: IAbapConnection): IAbapConnection['makeAdtRequest'];
26
35
  export declare function wrapConnectionAcceptNegotiation(connection: IAbapConnection, logger?: ILogger): void;
@@ -1 +1 @@
1
- {"version":3,"file":"acceptNegotiation.d.ts","sourceRoot":"","sources":["../../src/utils/acceptNegotiation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAkD9D,oFAAoF;AACpF,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,CAM7E;AAaD,MAAM,WAAW,yBAAyB;IACxC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,2CAA2C;AAC3C,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,CAIlE;AAED,6DAA6D;AAC7D,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,eAAe,EAC3B,OAAO,CAAC,EAAE,OAAO,GAChB,IAAI,CAEN;AAED,wEAAwE;AACxE,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,eAAe,GAC1B,OAAO,CAIT;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAoC/D;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAsCpE;AAMD;;;;;;;G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M,EAAE,CAsCpE;AAMD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,eAAe,GAC1B,eAAe,CAAC,gBAAgB,CAAC,CAInC;AAED,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,eAAe,EAC3B,MAAM,CAAC,EAAE,OAAO,GACf,IAAI,CAkBN;AAED,wBAAsB,mCAAmC,CACvD,CAAC,GAAG,OAAO,EACX,CAAC,GAAG,OAAO,EAEX,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAkFjC"}
@@ -30,7 +30,14 @@ function stateOf(connection) {
30
30
  * whatever switch an `AdtClient` built over it was given.
31
31
  */
32
32
  const NO_NEGOTIATION = Symbol.for('@mcp-abap-adt/adt-clients/acceptNegotiation/none');
33
- /** Mark a connection so accept negotiation never corrects or resends through it. */
33
+ /**
34
+ * Mark a connection so accept negotiation never corrects or resends through it.
35
+ *
36
+ * Public for a consumer that hands members its own connection over an
37
+ * `AdtBatchConnection` — a per-call wrapper, say: an `AdtBatchConnection` marks
38
+ * itself, but a different object is not it, and is negotiated like any other
39
+ * connection unless it is marked too. The mark is permanent; there is no unmark.
40
+ */
34
41
  function exemptFromAcceptNegotiation(connection) {
35
42
  Object.defineProperty(connection, NO_NEGOTIATION, {
36
43
  value: true,
@@ -132,8 +139,10 @@ function buildCacheKey(request) {
132
139
  * wrapped it: accept negotiation corrects and resends nothing. The
133
140
  * connection's own handling (credential, CSRF, session) is untouched.
134
141
  *
135
- * Exported for the batch connection: what SAP answers to an envelope is the
136
- * caller's to read.
142
+ * Exported for the batch connection, and public for a consumer that forwards a
143
+ * batch's envelope through a connection of its own over one an `AdtClient`
144
+ * wrapped: what SAP answers to an envelope is the caller's to read. For a
145
+ * connection never wrapped it is the connection's own `makeAdtRequest`, bound.
137
146
  */
138
147
  function getBaseRequest(connection) {
139
148
  return (baseRequestMap.get(connection) ?? connection.makeAdtRequest.bind(connection));
@@ -80,7 +80,13 @@ itself sends through it once. On a connection an `AdtClient` wrapped with
80
80
  correction on, a `406` or `415` answered to the envelope reaches `execute()` and
81
81
  every part of that envelope as it came. A part's own `401`, `406` or `415` is
82
82
  that part's answer like any other status; nothing reads it, corrects it or
83
- sends it again. A batch is yours, and so is
83
+ sends it again. A connection of your own that members send through instead of
84
+ the batch connection — a per-call wrapper over it, say — is a different object
85
+ and is negotiated like any other; mark it with `exemptFromAcceptNegotiation(wrapper)`
86
+ (exported by the package) and it is exempt too. When the batch connection wraps
87
+ a forwarder of yours over a connection an `AdtClient` wrapped, forward through
88
+ `getBaseRequest(thatConnection)` (exported): the envelope then bypasses that
89
+ connection's accept negotiation and is sent once. A batch is yours, and so is
84
90
  what SAP answered to each of its parts. The envelope request itself still goes
85
91
  through the connection's own handling — credential renewal, CSRF recovery and
86
92
  session — as every request does: that is about the connection to the endpoint,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/adt-clients",
3
- "version": "34.0.0",
3
+ "version": "34.2.0",
4
4
  "description": "ADT clients for SAP ABAP systems - AdtClient and AdtRuntimeClient",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",