@mcp-abap-adt/core 6.4.1 → 6.5.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/handlers/function_module/high/handleGetFunctionModule.d.ts.map +1 -1
- package/dist/handlers/function_module/high/handleGetFunctionModule.js +14 -4
- package/dist/handlers/function_module/high/handleGetFunctionModule.js.map +1 -1
- package/dist/handlers/function_module/readonly/handleReadFunctionModule.d.ts.map +1 -1
- package/dist/handlers/function_module/readonly/handleReadFunctionModule.js +20 -15
- package/dist/handlers/function_module/readonly/handleReadFunctionModule.js.map +1 -1
- package/dist/handlers/function_module/shared/parseContainerGroup.d.ts +25 -0
- package/dist/handlers/function_module/shared/parseContainerGroup.d.ts.map +1 -0
- package/dist/handlers/function_module/shared/parseContainerGroup.js +47 -0
- package/dist/handlers/function_module/shared/parseContainerGroup.js.map +1 -0
- package/dist/lib/config/validateExposition.d.ts +10 -0
- package/dist/lib/config/validateExposition.d.ts.map +1 -0
- package/dist/lib/config/validateExposition.js +21 -0
- package/dist/lib/config/validateExposition.js.map +1 -0
- package/dist/lib/handlers/groups/ReadOnlyHandlersGroup.d.ts +13 -2
- package/dist/lib/handlers/groups/ReadOnlyHandlersGroup.d.ts.map +1 -1
- package/dist/lib/handlers/groups/ReadOnlyHandlersGroup.js +18 -1
- package/dist/lib/handlers/groups/ReadOnlyHandlersGroup.js.map +1 -1
- package/dist/lib/handlers/groups/index.d.ts +1 -0
- package/dist/lib/handlers/groups/index.d.ts.map +1 -1
- package/dist/lib/handlers/groups/index.js +4 -1
- package/dist/lib/handlers/groups/index.js.map +1 -1
- package/dist/lib/handlers/groups/strategies/IReadOnlyDedupStrategy.d.ts +15 -0
- package/dist/lib/handlers/groups/strategies/IReadOnlyDedupStrategy.d.ts.map +1 -0
- package/dist/lib/handlers/groups/strategies/IReadOnlyDedupStrategy.js +3 -0
- package/dist/lib/handlers/groups/strategies/IReadOnlyDedupStrategy.js.map +1 -0
- package/dist/lib/handlers/groups/strategies/NoDedupStrategy.d.ts +10 -0
- package/dist/lib/handlers/groups/strategies/NoDedupStrategy.d.ts.map +1 -0
- package/dist/lib/handlers/groups/strategies/NoDedupStrategy.js +14 -0
- package/dist/lib/handlers/groups/strategies/NoDedupStrategy.js.map +1 -0
- package/dist/lib/handlers/groups/strategies/ReadVsGetDedupStrategy.d.ts +14 -0
- package/dist/lib/handlers/groups/strategies/ReadVsGetDedupStrategy.d.ts.map +1 -0
- package/dist/lib/handlers/groups/strategies/ReadVsGetDedupStrategy.js +22 -0
- package/dist/lib/handlers/groups/strategies/ReadVsGetDedupStrategy.js.map +1 -0
- package/dist/lib/handlers/groups/strategies/index.d.ts +4 -0
- package/dist/lib/handlers/groups/strategies/index.d.ts.map +1 -0
- package/dist/lib/handlers/groups/strategies/index.js +8 -0
- package/dist/lib/handlers/groups/strategies/index.js.map +1 -0
- package/dist/server/EmbeddableMcpServer.d.ts +12 -0
- package/dist/server/EmbeddableMcpServer.d.ts.map +1 -1
- package/dist/server/EmbeddableMcpServer.js +22 -10
- package/dist/server/EmbeddableMcpServer.js.map +1 -1
- package/dist/server/launcher.js +23 -9
- package/dist/server/launcher.js.map +1 -1
- package/docs/user-guide/AVAILABLE_TOOLS.md +97 -65
- package/docs/user-guide/AVAILABLE_TOOLS_COMPACT.md +4 -5
- package/docs/user-guide/AVAILABLE_TOOLS_HIGH.md +32 -34
- package/docs/user-guide/AVAILABLE_TOOLS_LEGACY.md +21 -21
- package/docs/user-guide/AVAILABLE_TOOLS_LOW.md +49 -13
- package/docs/user-guide/AVAILABLE_TOOLS_READONLY.md +17 -19
- package/docs/user-guide/HANDLERS_MANAGEMENT.md +63 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [6.5.0] - 2026-04-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- `EmbeddableMcpServer` accepts optional `readOnlyDedupStrategy: IReadOnlyDedupStrategy` to hide duplicate `Read<X>` readonly handlers when another group (HighLevel / LowLevel / Compact) contributes an equivalent. Ships two implementations: `NoDedupStrategy` (default — no behavior change for existing consumers) and `ReadVsGetDedupStrategy` (hides `Read<X>` when `Get<X>` is exposed). Consumers can also plug custom strategies for role-based rules. Exported from `@mcp-abap-adt/core/handlers` and `@mcp-abap-adt/core/server`.
|
|
9
|
+
- CLI launcher validates `--exposition` — `compact` must be exposed alone, `high` and `low` are mutually exclusive. Fails fast at startup with a clear error on misconfiguration.
|
|
10
|
+
- Diagnostic scripts `scripts/read-fm.ts` and `scripts/probe-fm.ts` for reproducing function-module endpoint quirks against an arbitrary env file.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- CLI launcher opts into `ReadVsGetDedupStrategy` by default, so running the shipped server no longer exposes duplicate pairs like `ReadFunctionModule` + `GetFunctionModule` when both `readonly` and `high` are enabled.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- `ReadFunctionModule` / `GetFunctionModule`: ADT resolves function modules by name regardless of the group segment in the URL, so passing a wrong group silently returned the correct FM's source and echoed the wrong group back in the response. Both handlers now read metadata first, verify the owning group via `<adtcore:containerRef/>`, and reject mismatches with an explicit error (`Function module X belongs to group Y, not Z.`). The response now echoes the real group from metadata rather than the input.
|
|
17
|
+
|
|
18
|
+
### Backward compatibility
|
|
19
|
+
- `EmbeddableMcpServer` default dedup is `NoDedupStrategy` — existing consumers see no change in exposed tool sets until they explicitly pass a strategy.
|
|
20
|
+
- Invalid `--exposition` combinations previously silently produced duplicate-tool errors at runtime or exposed overlapping handlers; they now fail at startup with an explicit message.
|
|
21
|
+
|
|
5
22
|
## [6.4.1] - 2026-04-21
|
|
6
23
|
|
|
7
24
|
### Fixed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleGetFunctionModule.d.ts","sourceRoot":"","sources":["../../../../src/handlers/function_module/high/handleGetFunctionModule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"handleGetFunctionModule.d.ts","sourceRoot":"","sources":["../../../../src/handlers/function_module/high/handleGetFunctionModule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAQvE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;CA2BlB,CAAC;AAEX,UAAU,qBAAqB;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,qBAAqB;;;;;;GAwG5B"}
|
|
@@ -10,6 +10,7 @@ exports.TOOL_DEFINITION = void 0;
|
|
|
10
10
|
exports.handleGetFunctionModule = handleGetFunctionModule;
|
|
11
11
|
const clients_1 = require("../../../lib/clients");
|
|
12
12
|
const utils_1 = require("../../../lib/utils");
|
|
13
|
+
const parseContainerGroup_1 = require("../shared/parseContainerGroup");
|
|
13
14
|
exports.TOOL_DEFINITION = {
|
|
14
15
|
name: 'GetFunctionModule',
|
|
15
16
|
available_in: ['onprem', 'cloud', 'legacy'],
|
|
@@ -53,9 +54,18 @@ async function handleGetFunctionModule(context, args) {
|
|
|
53
54
|
const functionGroupName = function_group_name.toUpperCase();
|
|
54
55
|
logger?.info(`Reading function module ${functionModuleName} in ${functionGroupName}, version: ${version}`);
|
|
55
56
|
try {
|
|
56
|
-
// Read function module using AdtClient
|
|
57
57
|
const functionModuleObject = client.getFunctionModule();
|
|
58
|
-
|
|
58
|
+
// Verify ownership first — ADT resolves FM by name regardless of group
|
|
59
|
+
// segment in URL, so we reject mismatches before returning source.
|
|
60
|
+
const metaResult = await functionModuleObject.readMetadata({
|
|
61
|
+
functionModuleName,
|
|
62
|
+
functionGroupName,
|
|
63
|
+
});
|
|
64
|
+
const metadataXml = typeof metaResult?.metadataResult?.data === 'string'
|
|
65
|
+
? metaResult.metadataResult.data
|
|
66
|
+
: null;
|
|
67
|
+
const realGroup = (0, parseContainerGroup_1.assertFunctionGroupMatches)(metadataXml, functionGroupName, functionModuleName);
|
|
68
|
+
const readResult = await functionModuleObject.read({ functionModuleName, functionGroupName: realGroup }, version);
|
|
59
69
|
if (!readResult || !readResult.readResult) {
|
|
60
70
|
throw new Error(`FunctionModule ${functionModuleName} not found`);
|
|
61
71
|
}
|
|
@@ -73,12 +83,12 @@ async function handleGetFunctionModule(context, args) {
|
|
|
73
83
|
functionModuleData = String(readResult.readResult.data);
|
|
74
84
|
}
|
|
75
85
|
}
|
|
76
|
-
logger?.info(
|
|
86
|
+
logger?.info(`GetFunctionModule completed successfully: ${functionModuleName} in ${realGroup}`);
|
|
77
87
|
return (0, utils_1.return_response)({
|
|
78
88
|
data: JSON.stringify({
|
|
79
89
|
success: true,
|
|
80
90
|
function_module_name: functionModuleName,
|
|
81
|
-
function_group_name:
|
|
91
|
+
function_group_name: realGroup,
|
|
82
92
|
version,
|
|
83
93
|
function_module_data: functionModuleData,
|
|
84
94
|
status: readResult.readResult.status,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleGetFunctionModule.js","sourceRoot":"","sources":["../../../../src/handlers/function_module/high/handleGetFunctionModule.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;
|
|
1
|
+
{"version":3,"file":"handleGetFunctionModule.js","sourceRoot":"","sources":["../../../../src/handlers/function_module/high/handleGetFunctionModule.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAmDH,0DA0GC;AA3JD,kDAAuD;AAEvD,8CAI4B;AAC5B,uEAA2E;AAE9D,QAAA,eAAe,GAAG;IAC7B,IAAI,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CAClF,CAAC;YAEF,OAAO,IAAA,uBAAe,EAAC;gBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;oBACE,OAAO,EAAE,IAAI;oBACb,oBAAoB,EAAE,kBAAkB;oBACxC,mBAAmB,EAAE,SAAS;oBAC9B,OAAO;oBACP,oBAAoB,EAAE,kBAAkB;oBACxC,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,MAAM;oBACpC,WAAW,EAAE,UAAU,CAAC,UAAU,CAAC,UAAU;iBAC9C,EACD,IAAI,EACJ,CAAC,CACF;aACe,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,EAAE,KAAK,CACX,iCAAiC,kBAAkB,KAAK,KAAK,EAAE,OAAO,IAAI,KAAK,EAAE,CAClF,CAAC;YAEF,sBAAsB;YACtB,IAAI,YAAY,GAAG,mCAAmC,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAEvF,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;gBACnC,YAAY,GAAG,kBAAkB,kBAAkB,aAAa,CAAC;YACnE,CAAC;iBAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC1C,YAAY,GAAG,kBAAkB,kBAAkB,6BAA6B,CAAC;YACnF,CAAC;YAED,OAAO,IAAA,oBAAY,EAAC,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleReadFunctionModule.d.ts","sourceRoot":"","sources":["../../../../src/handlers/function_module/readonly/handleReadFunctionModule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"handleReadFunctionModule.d.ts","sourceRoot":"","sources":["../../../../src/handlers/function_module/readonly/handleReadFunctionModule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAQvE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;CA0BlB,CAAC;AAEX,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE;IACJ,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CACjC;;;;;;GAmFF"}
|
|
@@ -4,6 +4,7 @@ exports.TOOL_DEFINITION = void 0;
|
|
|
4
4
|
exports.handleReadFunctionModule = handleReadFunctionModule;
|
|
5
5
|
const clients_1 = require("../../../lib/clients");
|
|
6
6
|
const utils_1 = require("../../../lib/utils");
|
|
7
|
+
const parseContainerGroup_1 = require("../shared/parseContainerGroup");
|
|
7
8
|
exports.TOOL_DEFINITION = {
|
|
8
9
|
name: 'ReadFunctionModule',
|
|
9
10
|
available_in: ['onprem', 'cloud', 'legacy'],
|
|
@@ -39,19 +40,9 @@ async function handleReadFunctionModule(context, args) {
|
|
|
39
40
|
const functionModuleName = function_module_name.toUpperCase();
|
|
40
41
|
const functionGroupName = function_group_name.toUpperCase();
|
|
41
42
|
const obj = client.getFunctionModule();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (readResult?.readResult?.data) {
|
|
46
|
-
source_code =
|
|
47
|
-
typeof readResult.readResult.data === 'string'
|
|
48
|
-
? readResult.readResult.data
|
|
49
|
-
: safeStringify(readResult.readResult.data);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
catch (e) {
|
|
53
|
-
logger?.warn(`Could not read source for ${functionModuleName}: ${e?.message}`);
|
|
54
|
-
}
|
|
43
|
+
// Read metadata FIRST — the ADT backend resolves FM by name regardless of
|
|
44
|
+
// the group segment in the URL, so we must verify ownership from metadata
|
|
45
|
+
// (<adtcore:containerRef/>) before trusting any source payload.
|
|
55
46
|
let metadata = null;
|
|
56
47
|
try {
|
|
57
48
|
const metaResult = await obj.readMetadata({
|
|
@@ -66,13 +57,27 @@ async function handleReadFunctionModule(context, args) {
|
|
|
66
57
|
}
|
|
67
58
|
}
|
|
68
59
|
catch (e) {
|
|
69
|
-
|
|
60
|
+
return (0, utils_1.return_error)(new Error(`Could not read metadata for ${functionModuleName} in group ${functionGroupName}: ${e?.message ?? e}`));
|
|
61
|
+
}
|
|
62
|
+
const realGroup = (0, parseContainerGroup_1.assertFunctionGroupMatches)(metadata, functionGroupName, functionModuleName);
|
|
63
|
+
let source_code = null;
|
|
64
|
+
try {
|
|
65
|
+
const readResult = await obj.read({ functionModuleName, functionGroupName: realGroup }, version);
|
|
66
|
+
if (readResult?.readResult?.data) {
|
|
67
|
+
source_code =
|
|
68
|
+
typeof readResult.readResult.data === 'string'
|
|
69
|
+
? readResult.readResult.data
|
|
70
|
+
: safeStringify(readResult.readResult.data);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
logger?.warn(`Could not read source for ${functionModuleName}: ${e?.message}`);
|
|
70
75
|
}
|
|
71
76
|
return (0, utils_1.return_response)({
|
|
72
77
|
data: JSON.stringify({
|
|
73
78
|
success: true,
|
|
74
79
|
function_module_name: functionModuleName,
|
|
75
|
-
function_group_name:
|
|
80
|
+
function_group_name: realGroup,
|
|
76
81
|
version,
|
|
77
82
|
source_code,
|
|
78
83
|
metadata,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleReadFunctionModule.js","sourceRoot":"","sources":["../../../../src/handlers/function_module/readonly/handleReadFunctionModule.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"handleReadFunctionModule.js","sourceRoot":"","sources":["../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,CAAC;YAClD,CAAC;QACH,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,EAAE,IAAI,CACV,6BAA6B,kBAAkB,KAAK,CAAC,EAAE,OAAO,EAAE,CACjE,CAAC;QACJ,CAAC;QAED,OAAO,IAAA,uBAAe,EAAC;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;gBACE,OAAO,EAAE,IAAI;gBACb,oBAAoB,EAAE,kBAAkB;gBACxC,mBAAmB,EAAE,SAAS;gBAC9B,OAAO;gBACP,WAAW;gBACX,QAAQ;aACT,EACD,IAAI,EACJ,CAAC,CACF;SACe,CAAC,CAAC;IACtB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,IAAa;IAClC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse the owning function group from ADT function module metadata XML.
|
|
3
|
+
*
|
|
4
|
+
* The relevant element is:
|
|
5
|
+
* <adtcore:containerRef
|
|
6
|
+
* adtcore:uri="/sap/bc/adt/functions/groups/sxpt"
|
|
7
|
+
* adtcore:type="FUGR/F"
|
|
8
|
+
* adtcore:name="SXPT" .../>
|
|
9
|
+
*
|
|
10
|
+
* The ADT backend resolves function modules by name alone and happily returns
|
|
11
|
+
* source/metadata even when the group segment of the URL is wrong. The only
|
|
12
|
+
* reliable indicator of the real owning group is the `containerRef` element
|
|
13
|
+
* above. Callers compare it with the caller-supplied group to reject
|
|
14
|
+
* mismatched inputs instead of silently returning code from a different
|
|
15
|
+
* group than requested.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseContainerGroupName(metadataXml: string | null | undefined): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Validate that the FM belongs to the expected group and return the real
|
|
20
|
+
* group name from metadata. Throws when the metadata does not contain a
|
|
21
|
+
* `containerRef` (so we never return unverified source) or when the real
|
|
22
|
+
* group does not match the expected one (case-insensitive).
|
|
23
|
+
*/
|
|
24
|
+
export declare function assertFunctionGroupMatches(metadataXml: string | null | undefined, expectedGroupName: string, functionModuleName: string): string;
|
|
25
|
+
//# sourceMappingURL=parseContainerGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseContainerGroup.d.ts","sourceRoot":"","sources":["../../../../src/handlers/function_module/shared/parseContainerGroup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACrC,MAAM,GAAG,IAAI,CAWf;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACtC,iBAAiB,EAAE,MAAM,EACzB,kBAAkB,EAAE,MAAM,GACzB,MAAM,CAaR"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseContainerGroupName = parseContainerGroupName;
|
|
4
|
+
exports.assertFunctionGroupMatches = assertFunctionGroupMatches;
|
|
5
|
+
/**
|
|
6
|
+
* Parse the owning function group from ADT function module metadata XML.
|
|
7
|
+
*
|
|
8
|
+
* The relevant element is:
|
|
9
|
+
* <adtcore:containerRef
|
|
10
|
+
* adtcore:uri="/sap/bc/adt/functions/groups/sxpt"
|
|
11
|
+
* adtcore:type="FUGR/F"
|
|
12
|
+
* adtcore:name="SXPT" .../>
|
|
13
|
+
*
|
|
14
|
+
* The ADT backend resolves function modules by name alone and happily returns
|
|
15
|
+
* source/metadata even when the group segment of the URL is wrong. The only
|
|
16
|
+
* reliable indicator of the real owning group is the `containerRef` element
|
|
17
|
+
* above. Callers compare it with the caller-supplied group to reject
|
|
18
|
+
* mismatched inputs instead of silently returning code from a different
|
|
19
|
+
* group than requested.
|
|
20
|
+
*/
|
|
21
|
+
function parseContainerGroupName(metadataXml) {
|
|
22
|
+
if (!metadataXml)
|
|
23
|
+
return null;
|
|
24
|
+
const match = metadataXml.match(/<adtcore:containerRef\b[^>]*\badtcore:type="FUGR\/F"[^>]*\badtcore:name="([^"]+)"/);
|
|
25
|
+
if (match)
|
|
26
|
+
return match[1];
|
|
27
|
+
// Attribute order is not guaranteed — try with name before type.
|
|
28
|
+
const alt = metadataXml.match(/<adtcore:containerRef\b[^>]*\badtcore:name="([^"]+)"[^>]*\badtcore:type="FUGR\/F"/);
|
|
29
|
+
return alt ? alt[1] : null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Validate that the FM belongs to the expected group and return the real
|
|
33
|
+
* group name from metadata. Throws when the metadata does not contain a
|
|
34
|
+
* `containerRef` (so we never return unverified source) or when the real
|
|
35
|
+
* group does not match the expected one (case-insensitive).
|
|
36
|
+
*/
|
|
37
|
+
function assertFunctionGroupMatches(metadataXml, expectedGroupName, functionModuleName) {
|
|
38
|
+
const real = parseContainerGroupName(metadataXml);
|
|
39
|
+
if (!real) {
|
|
40
|
+
throw new Error(`Could not determine owning function group for ${functionModuleName} from ADT metadata. Refusing to return unverified source.`);
|
|
41
|
+
}
|
|
42
|
+
if (real.toUpperCase() !== expectedGroupName.toUpperCase()) {
|
|
43
|
+
throw new Error(`Function module ${functionModuleName} belongs to group ${real}, not ${expectedGroupName}.`);
|
|
44
|
+
}
|
|
45
|
+
return real;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=parseContainerGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseContainerGroup.js","sourceRoot":"","sources":["../../../../src/handlers/function_module/shared/parseContainerGroup.ts"],"names":[],"mappings":";;AAgBA,0DAaC;AAQD,gEAiBC;AAtDD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,uBAAuB,CACrC,WAAsC;IAEtC,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAC9B,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAC7B,mFAAmF,CACpF,CAAC;IACF,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,iEAAiE;IACjE,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAC3B,mFAAmF,CACpF,CAAC;IACF,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,WAAsC,EACtC,iBAAyB,EACzB,kBAA0B;IAE1B,MAAM,IAAI,GAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAClD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,iDAAiD,kBAAkB,2DAA2D,CAC/H,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,iBAAiB,CAAC,WAAW,EAAE,EAAE,CAAC;QAC3D,MAAM,IAAI,KAAK,CACb,mBAAmB,kBAAkB,qBAAqB,IAAI,SAAS,iBAAiB,GAAG,CAC5F,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HandlerSet } from './IServerConfig.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validates an exposition array and throws on disallowed combinations.
|
|
4
|
+
*
|
|
5
|
+
* Rules:
|
|
6
|
+
* - `compact` is exposed only by itself. It cannot be combined with any other set.
|
|
7
|
+
* - `high` and `low` are mutually exclusive.
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateExposition(exposition: readonly HandlerSet[]): void;
|
|
10
|
+
//# sourceMappingURL=validateExposition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateExposition.d.ts","sourceRoot":"","sources":["../../../src/lib/config/validateExposition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,SAAS,UAAU,EAAE,GAAG,IAAI,CAe1E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateExposition = validateExposition;
|
|
4
|
+
/**
|
|
5
|
+
* Validates an exposition array and throws on disallowed combinations.
|
|
6
|
+
*
|
|
7
|
+
* Rules:
|
|
8
|
+
* - `compact` is exposed only by itself. It cannot be combined with any other set.
|
|
9
|
+
* - `high` and `low` are mutually exclusive.
|
|
10
|
+
*/
|
|
11
|
+
function validateExposition(exposition) {
|
|
12
|
+
const set = new Set(exposition);
|
|
13
|
+
if (set.has('compact') && set.size > 1) {
|
|
14
|
+
const others = [...set].filter((s) => s !== 'compact').join(', ');
|
|
15
|
+
throw new Error(`Invalid exposition: 'compact' must be exposed alone, but also found: ${others}`);
|
|
16
|
+
}
|
|
17
|
+
if (set.has('high') && set.has('low')) {
|
|
18
|
+
throw new Error(`Invalid exposition: 'high' and 'low' are mutually exclusive`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=validateExposition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateExposition.js","sourceRoot":"","sources":["../../../src/lib/config/validateExposition.ts"],"names":[],"mappings":";;AASA,gDAeC;AAtBD;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAAC,UAAiC;IAClE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IAEhC,IAAI,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClE,MAAM,IAAI,KAAK,CACb,wEAAwE,MAAM,EAAE,CACjF,CAAC;IACJ,CAAC;IAED,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { BaseHandlerGroup } from '../base/BaseHandlerGroup.js';
|
|
2
|
-
import type { HandlerEntry } from '../interfaces.js';
|
|
2
|
+
import type { HandlerContext, HandlerEntry } from '../interfaces.js';
|
|
3
|
+
import { type IReadOnlyDedupStrategy } from './strategies/index.js';
|
|
3
4
|
/**
|
|
4
5
|
* Handler group for all readonly (read-only) handlers.
|
|
5
6
|
* Contains handlers that only read data without modifying the ABAP system.
|
|
7
|
+
*
|
|
8
|
+
* When other groups (HighLevel / LowLevel / Compact) are also exposed, some
|
|
9
|
+
* readonly handlers semantically duplicate tools from those groups
|
|
10
|
+
* (e.g. ReadFunctionModule vs GetFunctionModule). The group hides such
|
|
11
|
+
* duplicates based on the injected override strategy and the set of tool
|
|
12
|
+
* names contributed by the other groups.
|
|
6
13
|
*/
|
|
7
14
|
export declare class ReadOnlyHandlersGroup extends BaseHandlerGroup {
|
|
8
15
|
protected groupName: string;
|
|
16
|
+
private readonly overridingToolNames;
|
|
17
|
+
private readonly dedupStrategy;
|
|
18
|
+
constructor(context: HandlerContext, overridingToolNames?: ReadonlySet<string>, dedupStrategy?: IReadOnlyDedupStrategy);
|
|
9
19
|
/**
|
|
10
|
-
* Gets all readonly handler entries
|
|
20
|
+
* Gets all readonly handler entries, filtered by the dedup strategy.
|
|
11
21
|
*/
|
|
12
22
|
getHandlers(): HandlerEntry[];
|
|
23
|
+
private getAllEntries;
|
|
13
24
|
}
|
|
14
25
|
//# sourceMappingURL=ReadOnlyHandlersGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadOnlyHandlersGroup.d.ts","sourceRoot":"","sources":["../../../../src/lib/handlers/groups/ReadOnlyHandlersGroup.ts"],"names":[],"mappings":"AAwGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ReadOnlyHandlersGroup.d.ts","sourceRoot":"","sources":["../../../../src/lib/handlers/groups/ReadOnlyHandlersGroup.ts"],"names":[],"mappings":"AAwGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;GASG;AACH,qBAAa,qBAAsB,SAAQ,gBAAgB;IACzD,SAAS,CAAC,SAAS,SAAsB;IACzC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAsB;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAyB;gBAGrD,OAAO,EAAE,cAAc,EACvB,mBAAmB,GAAE,WAAW,CAAC,MAAM,CAAa,EACpD,aAAa,GAAE,sBAA8C;IAO/D;;OAEG;IACH,WAAW,IAAI,YAAY,EAAE;IAM7B,OAAO,CAAC,aAAa;CAgHtB"}
|
|
@@ -28,16 +28,33 @@ const handleGetTransport_1 = require("../../../handlers/transport/readonly/handl
|
|
|
28
28
|
const handleListTransports_1 = require("../../../handlers/transport/readonly/handleListTransports");
|
|
29
29
|
const handleReadView_1 = require("../../../handlers/view/readonly/handleReadView");
|
|
30
30
|
const BaseHandlerGroup_js_1 = require("../base/BaseHandlerGroup.js");
|
|
31
|
+
const index_js_1 = require("./strategies/index.js");
|
|
31
32
|
/**
|
|
32
33
|
* Handler group for all readonly (read-only) handlers.
|
|
33
34
|
* Contains handlers that only read data without modifying the ABAP system.
|
|
35
|
+
*
|
|
36
|
+
* When other groups (HighLevel / LowLevel / Compact) are also exposed, some
|
|
37
|
+
* readonly handlers semantically duplicate tools from those groups
|
|
38
|
+
* (e.g. ReadFunctionModule vs GetFunctionModule). The group hides such
|
|
39
|
+
* duplicates based on the injected override strategy and the set of tool
|
|
40
|
+
* names contributed by the other groups.
|
|
34
41
|
*/
|
|
35
42
|
class ReadOnlyHandlersGroup extends BaseHandlerGroup_js_1.BaseHandlerGroup {
|
|
36
43
|
groupName = 'ReadOnlyHandlers';
|
|
44
|
+
overridingToolNames;
|
|
45
|
+
dedupStrategy;
|
|
46
|
+
constructor(context, overridingToolNames = new Set(), dedupStrategy = new index_js_1.NoDedupStrategy()) {
|
|
47
|
+
super(context);
|
|
48
|
+
this.overridingToolNames = overridingToolNames;
|
|
49
|
+
this.dedupStrategy = dedupStrategy;
|
|
50
|
+
}
|
|
37
51
|
/**
|
|
38
|
-
* Gets all readonly handler entries
|
|
52
|
+
* Gets all readonly handler entries, filtered by the dedup strategy.
|
|
39
53
|
*/
|
|
40
54
|
getHandlers() {
|
|
55
|
+
return this.getAllEntries().filter((e) => !this.dedupStrategy.shouldExclude(e, this.overridingToolNames));
|
|
56
|
+
}
|
|
57
|
+
getAllEntries() {
|
|
41
58
|
return [
|
|
42
59
|
// Existing readonly handlers
|
|
43
60
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadOnlyHandlersGroup.js","sourceRoot":"","sources":["../../../../src/lib/handlers/groups/ReadOnlyHandlersGroup.ts"],"names":[],"mappings":";;;AAAA,8HAGqF;AACrF,0IAG6F;AAC7F,sFAG0D;AAC1D,yGAGuE;AACvE,yFAG4D;AAC5D,8GAGyE;AACzE,8GAGyE;AACzE,wGAGsE;AACtE,+GAG2E;AAC3E,kHAG6E;AAC7E,0FAG6D;AAC7D,oGAGkE;AAClE,kGAGkE;AAClE,2HAGmF;AACnF,0GAGqE;AACrE,4FAG8D;AAC9D,oGAGkE;AAClE,4FAG8D;AAC9D,kHAG6E;AAC7E,2HAGmF;AACnF,kGAGkE;AAClE,oGAGiE;AACjE,sFAG0D;AAC1D,gGAGiE;AACjE,oGAGmE;AACnE,mFAGwD;AACxD,qEAA+D;
|
|
1
|
+
{"version":3,"file":"ReadOnlyHandlersGroup.js","sourceRoot":"","sources":["../../../../src/lib/handlers/groups/ReadOnlyHandlersGroup.ts"],"names":[],"mappings":";;;AAAA,8HAGqF;AACrF,0IAG6F;AAC7F,sFAG0D;AAC1D,yGAGuE;AACvE,yFAG4D;AAC5D,8GAGyE;AACzE,8GAGyE;AACzE,wGAGsE;AACtE,+GAG2E;AAC3E,kHAG6E;AAC7E,0FAG6D;AAC7D,oGAGkE;AAClE,kGAGkE;AAClE,2HAGmF;AACnF,0GAGqE;AACrE,4FAG8D;AAC9D,oGAGkE;AAClE,4FAG8D;AAC9D,kHAG6E;AAC7E,2HAGmF;AACnF,kGAGkE;AAClE,oGAGiE;AACjE,sFAG0D;AAC1D,gGAGiE;AACjE,oGAGmE;AACnE,mFAGwD;AACxD,qEAA+D;AAE/D,oDAG+B;AAE/B;;;;;;;;;GASG;AACH,MAAa,qBAAsB,SAAQ,sCAAgB;IAC/C,SAAS,GAAG,kBAAkB,CAAC;IACxB,mBAAmB,CAAsB;IACzC,aAAa,CAAyB;IAEvD,YACE,OAAuB,EACvB,sBAA2C,IAAI,GAAG,EAAE,EACpD,gBAAwC,IAAI,0BAAe,EAAE;QAE7D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,mBAAmB,G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C,IAAS,EAAE,EAAE,CACrB,IAAA,2DAA4B,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;aACnD;YACD;gBACE,cAAc,EAAE,kDAA+B;gBAC/C,OAAO,EAAE,CAAC,IAAS,EAAE,EAAE,CACrB,IAAA,mEAAgC,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;aACvD;YACD;gBACE,cAAc,EAAE,0CAAuB;gBACvC,OAAO,EAAE,CAAC,IAAS,EAAE,EAAE,CAAC,IAAA,mDAAwB,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;aACrE;SACF,CAAC;IACJ,CAAC;CACF;AAxID,sDAwIC"}
|
|
@@ -11,4 +11,5 @@ export { LowLevelHandlersGroup } from './LowLevelHandlersGroup.js';
|
|
|
11
11
|
export { ReadOnlyHandlersGroup } from './ReadOnlyHandlersGroup.js';
|
|
12
12
|
export { SearchHandlersGroup } from './SearchHandlersGroup.js';
|
|
13
13
|
export { SystemHandlersGroup } from './SystemHandlersGroup.js';
|
|
14
|
+
export { type IReadOnlyDedupStrategy, NoDedupStrategy, ReadVsGetDedupStrategy, } from './strategies/index.js';
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/handlers/groups/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/handlers/groups/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,KAAK,sBAAsB,EAC3B,eAAe,EACf,sBAAsB,GACvB,MAAM,uBAAuB,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* to use different sets of handlers.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.SystemHandlersGroup = exports.SearchHandlersGroup = exports.ReadOnlyHandlersGroup = exports.LowLevelHandlersGroup = exports.HighLevelHandlersGroup = exports.CompactHandlersGroup = void 0;
|
|
10
|
+
exports.ReadVsGetDedupStrategy = exports.NoDedupStrategy = exports.SystemHandlersGroup = exports.SearchHandlersGroup = exports.ReadOnlyHandlersGroup = exports.LowLevelHandlersGroup = exports.HighLevelHandlersGroup = exports.CompactHandlersGroup = void 0;
|
|
11
11
|
var CompactHandlersGroup_js_1 = require("./CompactHandlersGroup.js");
|
|
12
12
|
Object.defineProperty(exports, "CompactHandlersGroup", { enumerable: true, get: function () { return CompactHandlersGroup_js_1.CompactHandlersGroup; } });
|
|
13
13
|
var HighLevelHandlersGroup_js_1 = require("./HighLevelHandlersGroup.js");
|
|
@@ -20,4 +20,7 @@ var SearchHandlersGroup_js_1 = require("./SearchHandlersGroup.js");
|
|
|
20
20
|
Object.defineProperty(exports, "SearchHandlersGroup", { enumerable: true, get: function () { return SearchHandlersGroup_js_1.SearchHandlersGroup; } });
|
|
21
21
|
var SystemHandlersGroup_js_1 = require("./SystemHandlersGroup.js");
|
|
22
22
|
Object.defineProperty(exports, "SystemHandlersGroup", { enumerable: true, get: function () { return SystemHandlersGroup_js_1.SystemHandlersGroup; } });
|
|
23
|
+
var index_js_1 = require("./strategies/index.js");
|
|
24
|
+
Object.defineProperty(exports, "NoDedupStrategy", { enumerable: true, get: function () { return index_js_1.NoDedupStrategy; } });
|
|
25
|
+
Object.defineProperty(exports, "ReadVsGetDedupStrategy", { enumerable: true, get: function () { return index_js_1.ReadVsGetDedupStrategy; } });
|
|
23
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/handlers/groups/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA;AAC7B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/handlers/groups/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA;AAC7B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,kDAI+B;AAF7B,2GAAA,eAAe,OAAA;AACf,kHAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HandlerEntry } from '../../interfaces.js';
|
|
2
|
+
/**
|
|
3
|
+
* Strategy that decides whether a readonly handler entry should be deduped
|
|
4
|
+
* (excluded) from the ReadOnly group when overriding handler groups
|
|
5
|
+
* (high / low / compact) are also exposed.
|
|
6
|
+
*/
|
|
7
|
+
export interface IReadOnlyDedupStrategy {
|
|
8
|
+
/**
|
|
9
|
+
* @param entry readonly handler entry being considered
|
|
10
|
+
* @param overridingToolNames tool names contributed by non-readonly groups
|
|
11
|
+
* @returns true if the entry should be excluded from the readonly group
|
|
12
|
+
*/
|
|
13
|
+
shouldExclude(entry: HandlerEntry, overridingToolNames: ReadonlySet<string>): boolean;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=IReadOnlyDedupStrategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IReadOnlyDedupStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/lib/handlers/groups/strategies/IReadOnlyDedupStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,aAAa,CACX,KAAK,EAAE,YAAY,EACnB,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAAC,GACvC,OAAO,CAAC;CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IReadOnlyDedupStrategy.js","sourceRoot":"","sources":["../../../../../src/lib/handlers/groups/strategies/IReadOnlyDedupStrategy.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HandlerEntry } from '../../interfaces.js';
|
|
2
|
+
import type { IReadOnlyDedupStrategy } from './IReadOnlyDedupStrategy.js';
|
|
3
|
+
/**
|
|
4
|
+
* Null strategy — never excludes anything. Useful when the caller wants to
|
|
5
|
+
* expose the readonly group as-is regardless of other groups present.
|
|
6
|
+
*/
|
|
7
|
+
export declare class NoDedupStrategy implements IReadOnlyDedupStrategy {
|
|
8
|
+
shouldExclude(_entry: HandlerEntry, _overridingToolNames: ReadonlySet<string>): boolean;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=NoDedupStrategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoDedupStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/lib/handlers/groups/strategies/NoDedupStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;;GAGG;AACH,qBAAa,eAAgB,YAAW,sBAAsB;IAC5D,aAAa,CACX,MAAM,EAAE,YAAY,EACpB,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAAC,GACxC,OAAO;CAGX"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoDedupStrategy = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Null strategy — never excludes anything. Useful when the caller wants to
|
|
6
|
+
* expose the readonly group as-is regardless of other groups present.
|
|
7
|
+
*/
|
|
8
|
+
class NoDedupStrategy {
|
|
9
|
+
shouldExclude(_entry, _overridingToolNames) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.NoDedupStrategy = NoDedupStrategy;
|
|
14
|
+
//# sourceMappingURL=NoDedupStrategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoDedupStrategy.js","sourceRoot":"","sources":["../../../../../src/lib/handlers/groups/strategies/NoDedupStrategy.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACH,MAAa,eAAe;IAC1B,aAAa,CACX,MAAoB,EACpB,oBAAyC;QAEzC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAPD,0CAOC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HandlerEntry } from '../../interfaces.js';
|
|
2
|
+
import type { IReadOnlyDedupStrategy } from './IReadOnlyDedupStrategy.js';
|
|
3
|
+
/**
|
|
4
|
+
* Excludes a readonly `Read<X>` handler when a corresponding `Get<X>` handler
|
|
5
|
+
* is contributed by another group (HighLevel) or when the HighLevel/LowLevel
|
|
6
|
+
* groups otherwise provide a semantic replacement.
|
|
7
|
+
*
|
|
8
|
+
* Standalone `Get*` / `List*` readonly handlers (e.g. GetEnhancements,
|
|
9
|
+
* ListTransports) are never excluded — they have no pair in other groups.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ReadVsGetDedupStrategy implements IReadOnlyDedupStrategy {
|
|
12
|
+
shouldExclude(entry: HandlerEntry, overridingToolNames: ReadonlySet<string>): boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ReadVsGetDedupStrategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadVsGetDedupStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/lib/handlers/groups/strategies/ReadVsGetDedupStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;;;;;;GAOG;AACH,qBAAa,sBAAuB,YAAW,sBAAsB;IACnE,aAAa,CACX,KAAK,EAAE,YAAY,EACnB,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAAC,GACvC,OAAO;CAMX"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReadVsGetDedupStrategy = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Excludes a readonly `Read<X>` handler when a corresponding `Get<X>` handler
|
|
6
|
+
* is contributed by another group (HighLevel) or when the HighLevel/LowLevel
|
|
7
|
+
* groups otherwise provide a semantic replacement.
|
|
8
|
+
*
|
|
9
|
+
* Standalone `Get*` / `List*` readonly handlers (e.g. GetEnhancements,
|
|
10
|
+
* ListTransports) are never excluded — they have no pair in other groups.
|
|
11
|
+
*/
|
|
12
|
+
class ReadVsGetDedupStrategy {
|
|
13
|
+
shouldExclude(entry, overridingToolNames) {
|
|
14
|
+
const name = entry.toolDefinition.name;
|
|
15
|
+
if (!name.startsWith('Read'))
|
|
16
|
+
return false;
|
|
17
|
+
const getName = 'Get' + name.slice('Read'.length);
|
|
18
|
+
return overridingToolNames.has(getName);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ReadVsGetDedupStrategy = ReadVsGetDedupStrategy;
|
|
22
|
+
//# sourceMappingURL=ReadVsGetDedupStrategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadVsGetDedupStrategy.js","sourceRoot":"","sources":["../../../../../src/lib/handlers/groups/strategies/ReadVsGetDedupStrategy.ts"],"names":[],"mappings":";;;AAGA;;;;;;;GAOG;AACH,MAAa,sBAAsB;IACjC,aAAa,CACX,KAAmB,EACnB,mBAAwC;QAExC,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,KAAK,CAAC;QAC3C,MAAM,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAClD,OAAO,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;CACF;AAVD,wDAUC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/handlers/groups/strategies/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReadVsGetDedupStrategy = exports.NoDedupStrategy = void 0;
|
|
4
|
+
var NoDedupStrategy_js_1 = require("./NoDedupStrategy.js");
|
|
5
|
+
Object.defineProperty(exports, "NoDedupStrategy", { enumerable: true, get: function () { return NoDedupStrategy_js_1.NoDedupStrategy; } });
|
|
6
|
+
var ReadVsGetDedupStrategy_js_1 = require("./ReadVsGetDedupStrategy.js");
|
|
7
|
+
Object.defineProperty(exports, "ReadVsGetDedupStrategy", { enumerable: true, get: function () { return ReadVsGetDedupStrategy_js_1.ReadVsGetDedupStrategy; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/handlers/groups/strategies/index.ts"],"names":[],"mappings":";;;AACA,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AbapConnection } from '@mcp-abap-adt/connection';
|
|
2
2
|
import type { Logger } from '@mcp-abap-adt/logger';
|
|
3
|
+
import type { IReadOnlyDedupStrategy } from '../lib/handlers/groups/strategies/index.js';
|
|
3
4
|
import type { IHandlersRegistry, SapEnvironment } from '../lib/handlers/interfaces.js';
|
|
4
5
|
import type { IAdtSystemContext } from '../lib/systemContext.js';
|
|
5
6
|
import { BaseMcpServer } from './BaseMcpServer.js';
|
|
@@ -49,6 +50,17 @@ export interface EmbeddableMcpServerOptions {
|
|
|
49
50
|
* mutating `process.env.SAP_SYSTEM_TYPE` per instance is not safe.
|
|
50
51
|
*/
|
|
51
52
|
systemType?: SapEnvironment;
|
|
53
|
+
/**
|
|
54
|
+
* Optional strategy that decides which readonly handlers to dedup (hide)
|
|
55
|
+
* when overriding groups (high / low / compact) are also exposed.
|
|
56
|
+
*
|
|
57
|
+
* Default: no dedup — readonly handlers are exposed verbatim, preserving
|
|
58
|
+
* prior behavior for existing consumers. Pass `new ReadVsGetDedupStrategy()`
|
|
59
|
+
* (exported from this package) to hide `Read<X>` when a corresponding
|
|
60
|
+
* `Get<X>` is contributed by another group, or supply a custom
|
|
61
|
+
* implementation for bespoke role-based rules.
|
|
62
|
+
*/
|
|
63
|
+
readOnlyDedupStrategy?: IReadOnlyDedupStrategy;
|
|
52
64
|
}
|
|
53
65
|
/**
|
|
54
66
|
* Embeddable MCP Server for integration with external applications
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbeddableMcpServer.d.ts","sourceRoot":"","sources":["../../src/server/EmbeddableMcpServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AASnD,OAAO,KAAK,EAEV,iBAAiB,EACjB,cAAc,EACf,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAInD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,UAAU,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IAErC;;;OAGG;IACH,UAAU,CAAC,EAAE,CACT,UAAU,GACV,MAAM,GACN,KAAK,GAC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