@mcp-abap-adt/core 2.5.1 → 2.5.2
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 +22 -0
- package/README.md +3 -0
- package/dist/handlers/bdef/handleCreateBehaviorDefinition.d.ts +50 -0
- package/dist/handlers/bdef/handleCreateBehaviorDefinition.d.ts.map +1 -0
- package/dist/handlers/bdef/handleCreateBehaviorDefinition.js +101 -0
- package/dist/handlers/bdef/handleGetBdef.d.ts +54 -0
- package/dist/handlers/bdef/handleGetBdef.d.ts.map +1 -0
- package/dist/handlers/bdef/handleGetBdef.js +89 -0
- package/dist/handlers/bdef/handleUpdateBehaviorDefinition.d.ts +37 -0
- package/dist/handlers/bdef/handleUpdateBehaviorDefinition.d.ts.map +1 -0
- package/dist/handlers/bdef/handleUpdateBehaviorDefinition.js +85 -0
- package/dist/handlers/behavior_definition/readonly/handleGetBdef.d.ts +54 -0
- package/dist/handlers/behavior_definition/readonly/handleGetBdef.d.ts.map +1 -0
- package/dist/handlers/behavior_definition/readonly/handleGetBdef.js +89 -0
- package/dist/handlers/class/handleCheckClass.d.ts +59 -0
- package/dist/handlers/class/handleCheckClass.d.ts.map +1 -0
- package/dist/handlers/class/handleCheckClass.js +138 -0
- package/dist/handlers/class/handleCreateClass.d.ts +80 -0
- package/dist/handlers/class/handleCreateClass.d.ts.map +1 -0
- package/dist/handlers/class/handleCreateClass.js +192 -0
- package/dist/handlers/class/handleGetClass.d.ts +16 -0
- package/dist/handlers/class/handleGetClass.d.ts.map +1 -0
- package/dist/handlers/class/handleGetClass.js +159 -0
- package/dist/handlers/class/handleUpdateClassSource.d.ts +44 -0
- package/dist/handlers/class/handleUpdateClassSource.d.ts.map +1 -0
- package/dist/handlers/class/handleUpdateClassSource.js +131 -0
- package/dist/handlers/class/handleValidateClass.d.ts +62 -0
- package/dist/handlers/class/handleValidateClass.d.ts.map +1 -0
- package/dist/handlers/class/handleValidateClass.js +136 -0
- package/dist/handlers/class/readonly/handleGetClass.d.ts +20 -0
- package/dist/handlers/class/readonly/handleGetClass.d.ts.map +1 -0
- package/dist/handlers/class/readonly/handleGetClass.js +159 -0
- package/dist/handlers/common/handleActivateObject.d.ts +62 -0
- package/dist/handlers/common/handleActivateObject.d.ts.map +1 -0
- package/dist/handlers/common/handleActivateObject.js +137 -0
- package/dist/handlers/common/handleCheckObject.d.ts +63 -0
- package/dist/handlers/common/handleCheckObject.d.ts.map +1 -0
- package/dist/handlers/common/handleCheckObject.js +197 -0
- package/dist/handlers/common/handleDeleteObject.d.ts +46 -0
- package/dist/handlers/common/handleDeleteObject.d.ts.map +1 -0
- package/dist/handlers/common/handleDeleteObject.js +176 -0
- package/dist/handlers/common/handleLockObject.d.ts +57 -0
- package/dist/handlers/common/handleLockObject.d.ts.map +1 -0
- package/dist/handlers/common/handleLockObject.js +195 -0
- package/dist/handlers/common/handleUnlockObject.d.ts +61 -0
- package/dist/handlers/common/handleUnlockObject.d.ts.map +1 -0
- package/dist/handlers/common/handleUnlockObject.js +178 -0
- package/dist/handlers/common/handleValidateObject.d.ts +58 -0
- package/dist/handlers/common/handleValidateObject.d.ts.map +1 -0
- package/dist/handlers/common/handleValidateObject.js +177 -0
- package/dist/handlers/data_element/handleCreateDataElement.d.ts +83 -0
- package/dist/handlers/data_element/handleCreateDataElement.d.ts.map +1 -0
- package/dist/handlers/data_element/handleCreateDataElement.js +180 -0
- package/dist/handlers/data_element/handleGetDataElement.d.ts +29 -0
- package/dist/handlers/data_element/handleGetDataElement.d.ts.map +1 -0
- package/dist/handlers/data_element/handleGetDataElement.js +173 -0
- package/dist/handlers/data_element/handleUpdateDataElement.d.ts +131 -0
- package/dist/handlers/data_element/handleUpdateDataElement.d.ts.map +1 -0
- package/dist/handlers/data_element/handleUpdateDataElement.js +258 -0
- package/dist/handlers/data_element/readonly/handleGetDataElement.d.ts +33 -0
- package/dist/handlers/data_element/readonly/handleGetDataElement.d.ts.map +1 -0
- package/dist/handlers/data_element/readonly/handleGetDataElement.js +173 -0
- package/dist/handlers/ddlx/handleCreateMetadataExtension.d.ts +41 -0
- package/dist/handlers/ddlx/handleCreateMetadataExtension.d.ts.map +1 -0
- package/dist/handlers/ddlx/handleCreateMetadataExtension.js +92 -0
- package/dist/handlers/ddlx/handleUpdateMetadataExtension.d.ts +37 -0
- package/dist/handlers/ddlx/handleUpdateMetadataExtension.d.ts.map +1 -0
- package/dist/handlers/ddlx/handleUpdateMetadataExtension.js +81 -0
- package/dist/handlers/domain/handleCreateDomain.d.ts +104 -0
- package/dist/handlers/domain/handleCreateDomain.d.ts.map +1 -0
- package/dist/handlers/domain/handleCreateDomain.js +187 -0
- package/dist/handlers/domain/handleGetDomain.d.ts +19 -0
- package/dist/handlers/domain/handleGetDomain.d.ts.map +1 -0
- package/dist/handlers/domain/handleGetDomain.js +138 -0
- package/dist/handlers/domain/handleUpdateDomain.d.ts +99 -0
- package/dist/handlers/domain/handleUpdateDomain.d.ts.map +1 -0
- package/dist/handlers/domain/handleUpdateDomain.js +204 -0
- package/dist/handlers/domain/readonly/handleGetDomain.d.ts +23 -0
- package/dist/handlers/domain/readonly/handleGetDomain.d.ts.map +1 -0
- package/dist/handlers/domain/readonly/handleGetDomain.js +138 -0
- package/dist/handlers/enhancement/handleGetEnhancementImpl.d.ts +69 -0
- package/dist/handlers/enhancement/handleGetEnhancementImpl.d.ts.map +1 -0
- package/dist/handlers/enhancement/handleGetEnhancementImpl.js +171 -0
- package/dist/handlers/enhancement/handleGetEnhancementSpot.d.ts +53 -0
- package/dist/handlers/enhancement/handleGetEnhancementSpot.d.ts.map +1 -0
- package/dist/handlers/enhancement/handleGetEnhancementSpot.js +153 -0
- package/dist/handlers/enhancement/handleGetEnhancements.d.ts +64 -0
- package/dist/handlers/enhancement/handleGetEnhancements.d.ts.map +1 -0
- package/dist/handlers/enhancement/handleGetEnhancements.js +599 -0
- package/dist/handlers/function/handleCheckFunctionModule.d.ts +59 -0
- package/dist/handlers/function/handleCheckFunctionModule.d.ts.map +1 -0
- package/dist/handlers/function/handleCheckFunctionModule.js +140 -0
- package/dist/handlers/function/handleCreateFunctionGroup.d.ts +52 -0
- package/dist/handlers/function/handleCreateFunctionGroup.d.ts.map +1 -0
- package/dist/handlers/function/handleCreateFunctionGroup.js +114 -0
- package/dist/handlers/function/handleCreateFunctionModule.d.ts +57 -0
- package/dist/handlers/function/handleCreateFunctionModule.d.ts.map +1 -0
- package/dist/handlers/function/handleCreateFunctionModule.js +137 -0
- package/dist/handlers/function/handleGetFunction.d.ts +17 -0
- package/dist/handlers/function/handleGetFunction.d.ts.map +1 -0
- package/dist/handlers/function/handleGetFunction.js +172 -0
- package/dist/handlers/function/handleGetFunctionGroup.d.ts +16 -0
- package/dist/handlers/function/handleGetFunctionGroup.d.ts.map +1 -0
- package/dist/handlers/function/handleGetFunctionGroup.js +132 -0
- package/dist/handlers/function/handleUpdateFunctionModuleSource.d.ts +54 -0
- package/dist/handlers/function/handleUpdateFunctionModuleSource.d.ts.map +1 -0
- package/dist/handlers/function/handleUpdateFunctionModuleSource.js +108 -0
- package/dist/handlers/function/handleValidateFunctionModule.d.ts +58 -0
- package/dist/handlers/function/handleValidateFunctionModule.d.ts.map +1 -0
- package/dist/handlers/function/handleValidateFunctionModule.js +132 -0
- package/dist/handlers/function/readonly/handleGetFunctionGroup.d.ts +16 -0
- package/dist/handlers/function/readonly/handleGetFunctionGroup.d.ts.map +1 -0
- package/dist/handlers/function/readonly/handleGetFunctionGroup.js +132 -0
- package/dist/handlers/include/handleGetInclude.d.ts +16 -0
- package/dist/handlers/include/handleGetInclude.d.ts.map +1 -0
- package/dist/handlers/include/handleGetInclude.js +81 -0
- package/dist/handlers/include/handleGetIncludesList.d.ts +36 -0
- package/dist/handlers/include/handleGetIncludesList.d.ts.map +1 -0
- package/dist/handlers/include/handleGetIncludesList.js +223 -0
- package/dist/handlers/interface/handleCreateInterface.d.ts +64 -0
- package/dist/handlers/interface/handleCreateInterface.d.ts.map +1 -0
- package/dist/handlers/interface/handleCreateInterface.js +175 -0
- package/dist/handlers/interface/handleGetInterface.d.ts +40 -0
- package/dist/handlers/interface/handleGetInterface.d.ts.map +1 -0
- package/dist/handlers/interface/handleGetInterface.js +134 -0
- package/dist/handlers/interface/handleUpdateInterfaceSource.d.ts +48 -0
- package/dist/handlers/interface/handleUpdateInterfaceSource.d.ts.map +1 -0
- package/dist/handlers/interface/handleUpdateInterfaceSource.js +127 -0
- package/dist/handlers/interface/readonly/handleGetInterface.d.ts +44 -0
- package/dist/handlers/interface/readonly/handleGetInterface.d.ts.map +1 -0
- package/dist/handlers/interface/readonly/handleGetInterface.js +134 -0
- package/dist/handlers/package/handleCreatePackage.d.ts +38 -0
- package/dist/handlers/package/handleCreatePackage.d.ts.map +1 -0
- package/dist/handlers/package/handleCreatePackage.js +127 -0
- package/dist/handlers/package/handleGetPackage.d.ts +16 -0
- package/dist/handlers/package/handleGetPackage.d.ts.map +1 -0
- package/dist/handlers/package/handleGetPackage.js +94 -0
- package/dist/handlers/package/readonly/handleGetPackage.d.ts +21 -0
- package/dist/handlers/package/readonly/handleGetPackage.d.ts.map +1 -0
- package/dist/handlers/package/readonly/handleGetPackage.js +94 -0
- package/dist/handlers/program/handleCreateProgram.d.ts +73 -0
- package/dist/handlers/program/handleCreateProgram.d.ts.map +1 -0
- package/dist/handlers/program/handleCreateProgram.js +220 -0
- package/dist/handlers/program/handleGetProgFullCode.d.ts +67 -0
- package/dist/handlers/program/handleGetProgFullCode.d.ts.map +1 -0
- package/dist/handlers/program/handleGetProgFullCode.js +249 -0
- package/dist/handlers/program/handleGetProgram.d.ts +16 -0
- package/dist/handlers/program/handleGetProgram.d.ts.map +1 -0
- package/dist/handlers/program/handleGetProgram.js +71 -0
- package/dist/handlers/program/handleUpdateProgramSource.d.ts +44 -0
- package/dist/handlers/program/handleUpdateProgramSource.d.ts.map +1 -0
- package/dist/handlers/program/handleUpdateProgramSource.js +121 -0
- package/dist/handlers/program/readonly/handleGetProgram.d.ts +20 -0
- package/dist/handlers/program/readonly/handleGetProgram.d.ts.map +1 -0
- package/dist/handlers/program/readonly/handleGetProgram.js +71 -0
- package/dist/handlers/search/handleGetObjectsByType.d.ts +42 -0
- package/dist/handlers/search/handleGetObjectsByType.d.ts.map +1 -0
- package/dist/handlers/search/handleGetObjectsByType.js +166 -0
- package/dist/handlers/search/handleGetObjectsList.d.ts +46 -0
- package/dist/handlers/search/handleGetObjectsList.d.ts.map +1 -0
- package/dist/handlers/search/handleGetObjectsList.js +145 -0
- package/dist/handlers/search/handleSearchObject.d.ts +28 -0
- package/dist/handlers/search/handleSearchObject.d.ts.map +1 -0
- package/dist/handlers/search/handleSearchObject.js +119 -0
- package/dist/handlers/service_definition/readonly/handleGetServiceDefinition.d.ts +17 -0
- package/dist/handlers/service_definition/readonly/handleGetServiceDefinition.d.ts.map +1 -0
- package/dist/handlers/service_definition/readonly/handleGetServiceDefinition.js +136 -0
- package/dist/handlers/structure/handleCreateStructure.d.ts +107 -0
- package/dist/handlers/structure/handleCreateStructure.d.ts.map +1 -0
- package/dist/handlers/structure/handleCreateStructure.js +184 -0
- package/dist/handlers/structure/handleGetStructure.d.ts +16 -0
- package/dist/handlers/structure/handleGetStructure.d.ts.map +1 -0
- package/dist/handlers/structure/handleGetStructure.js +139 -0
- package/dist/handlers/structure/readonly/handleGetStructure.d.ts +16 -0
- package/dist/handlers/structure/readonly/handleGetStructure.d.ts.map +1 -0
- package/dist/handlers/structure/readonly/handleGetStructure.js +139 -0
- package/dist/handlers/system/handleDescribeByList.d.ts +36 -0
- package/dist/handlers/system/handleDescribeByList.d.ts.map +1 -0
- package/dist/handlers/system/handleDescribeByList.js +121 -0
- package/dist/handlers/system/handleGetAbapAST.d.ts +26 -0
- package/dist/handlers/system/handleGetAbapAST.d.ts.map +1 -0
- package/dist/handlers/system/handleGetAbapAST.js +172 -0
- package/dist/handlers/system/handleGetAbapSemanticAnalysis.d.ts +26 -0
- package/dist/handlers/system/handleGetAbapSemanticAnalysis.d.ts.map +1 -0
- package/dist/handlers/system/handleGetAbapSemanticAnalysis.js +353 -0
- package/dist/handlers/system/handleGetAbapSystemSymbols.d.ts +26 -0
- package/dist/handlers/system/handleGetAbapSystemSymbols.d.ts.map +1 -0
- package/dist/handlers/system/handleGetAbapSystemSymbols.js +574 -0
- package/dist/handlers/system/handleGetAllTypes.d.ts +22 -0
- package/dist/handlers/system/handleGetAllTypes.d.ts.map +1 -0
- package/dist/handlers/system/handleGetAllTypes.js +102 -0
- package/dist/handlers/system/handleGetInactiveObjects.d.ts +20 -0
- package/dist/handlers/system/handleGetInactiveObjects.d.ts.map +1 -0
- package/dist/handlers/system/handleGetInactiveObjects.js +41 -0
- package/dist/handlers/system/handleGetObjectInfo.d.ts +41 -0
- package/dist/handlers/system/handleGetObjectInfo.d.ts.map +1 -0
- package/dist/handlers/system/handleGetObjectInfo.js +210 -0
- package/dist/handlers/system/handleGetObjectNodeFromCache.d.ts +40 -0
- package/dist/handlers/system/handleGetObjectNodeFromCache.d.ts.map +1 -0
- package/dist/handlers/system/handleGetObjectNodeFromCache.js +70 -0
- package/dist/handlers/system/handleGetObjectStructure.d.ts +26 -0
- package/dist/handlers/system/handleGetObjectStructure.d.ts.map +1 -0
- package/dist/handlers/system/handleGetObjectStructure.js +103 -0
- package/dist/handlers/system/handleGetSession.d.ts +33 -0
- package/dist/handlers/system/handleGetSession.d.ts.map +1 -0
- package/dist/handlers/system/handleGetSession.js +63 -0
- package/dist/handlers/system/handleGetSqlQuery.d.ts +49 -0
- package/dist/handlers/system/handleGetSqlQuery.d.ts.map +1 -0
- package/dist/handlers/system/handleGetSqlQuery.js +176 -0
- package/dist/handlers/system/handleGetTransaction.d.ts +42 -0
- package/dist/handlers/system/handleGetTransaction.d.ts.map +1 -0
- package/dist/handlers/system/handleGetTransaction.js +91 -0
- package/dist/handlers/system/handleGetTypeInfo.d.ts +69 -0
- package/dist/handlers/system/handleGetTypeInfo.d.ts.map +1 -0
- package/dist/handlers/system/handleGetTypeInfo.js +169 -0
- package/dist/handlers/system/handleGetWhereUsed.d.ts +69 -0
- package/dist/handlers/system/handleGetWhereUsed.d.ts.map +1 -0
- package/dist/handlers/system/handleGetWhereUsed.js +405 -0
- package/dist/handlers/table/handleCheckTable.d.ts +55 -0
- package/dist/handlers/table/handleCheckTable.d.ts.map +1 -0
- package/dist/handlers/table/handleCheckTable.js +138 -0
- package/dist/handlers/table/handleCreateTable.d.ts +42 -0
- package/dist/handlers/table/handleCreateTable.d.ts.map +1 -0
- package/dist/handlers/table/handleCreateTable.js +118 -0
- package/dist/handlers/table/handleGetTable.d.ts +16 -0
- package/dist/handlers/table/handleGetTable.d.ts.map +1 -0
- package/dist/handlers/table/handleGetTable.js +140 -0
- package/dist/handlers/table/handleGetTableContents.d.ts +56 -0
- package/dist/handlers/table/handleGetTableContents.d.ts.map +1 -0
- package/dist/handlers/table/handleGetTableContents.js +387 -0
- package/dist/handlers/table/handleValidateTable.d.ts +53 -0
- package/dist/handlers/table/handleValidateTable.d.ts.map +1 -0
- package/dist/handlers/table/handleValidateTable.js +125 -0
- package/dist/handlers/table/readonly/handleGetTable.d.ts +20 -0
- package/dist/handlers/table/readonly/handleGetTable.d.ts.map +1 -0
- package/dist/handlers/table/readonly/handleGetTable.js +140 -0
- package/dist/handlers/transport/handleCreateTransport.d.ts +50 -0
- package/dist/handlers/transport/handleCreateTransport.d.ts.map +1 -0
- package/dist/handlers/transport/handleCreateTransport.js +151 -0
- package/dist/handlers/transport/handleGetTransport.d.ts +44 -0
- package/dist/handlers/transport/handleGetTransport.d.ts.map +1 -0
- package/dist/handlers/transport/handleGetTransport.js +183 -0
- package/dist/handlers/view/handleCreateView.d.ts +52 -0
- package/dist/handlers/view/handleCreateView.d.ts.map +1 -0
- package/dist/handlers/view/handleCreateView.js +139 -0
- package/dist/handlers/view/handleGetView.d.ts +26 -0
- package/dist/handlers/view/handleGetView.d.ts.map +1 -0
- package/dist/handlers/view/handleGetView.js +349 -0
- package/dist/handlers/view/handleUpdateViewSource.d.ts +44 -0
- package/dist/handlers/view/handleUpdateViewSource.d.ts.map +1 -0
- package/dist/handlers/view/handleUpdateViewSource.js +136 -0
- package/dist/handlers/view/readonly/handleGetView.d.ts +26 -0
- package/dist/handlers/view/readonly/handleGetView.d.ts.map +1 -0
- package/dist/handlers/view/readonly/handleGetView.js +349 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2453 -0
- package/dist/lib/activationUtils.d.ts +59 -0
- package/dist/lib/activationUtils.d.ts.map +1 -0
- package/dist/lib/activationUtils.js +168 -0
- package/dist/lib/config/ArgumentsParser.d.ts +2 -0
- package/dist/lib/config/ArgumentsParser.d.ts.map +1 -1
- package/dist/lib/config/ArgumentsParser.js +11 -1
- package/dist/lib/config/ArgumentsParser.js.map +1 -1
- package/dist/lib/config/IServerConfig.d.ts +2 -0
- package/dist/lib/config/IServerConfig.d.ts.map +1 -1
- package/dist/lib/config/ServerConfigManager.d.ts.map +1 -1
- package/dist/lib/config/ServerConfigManager.js +3 -0
- package/dist/lib/config/ServerConfigManager.js.map +1 -1
- package/dist/lib/getFullCodeCache.d.ts +3 -0
- package/dist/lib/getFullCodeCache.d.ts.map +1 -0
- package/dist/lib/getFullCodeCache.js +56 -0
- package/dist/lib/toolsRegistry.d.ts +13 -0
- package/dist/lib/toolsRegistry.d.ts.map +1 -0
- package/dist/lib/toolsRegistry.js +410 -0
- package/dist/server/AuthBrokerConfig.d.ts.map +1 -1
- package/dist/server/AuthBrokerConfig.js +14 -9
- package/dist/server/AuthBrokerConfig.js.map +1 -1
- package/dist/server/BaseMcpServer.d.ts.map +1 -1
- package/dist/server/BaseMcpServer.js +6 -0
- package/dist/server/BaseMcpServer.js.map +1 -1
- package/dist/server/launcher.js +4 -4
- package/dist/server/launcher.js.map +1 -1
- package/dist/utils/lockStateManager.d.ts +64 -0
- package/dist/utils/lockStateManager.d.ts.map +1 -0
- package/dist/utils/lockStateManager.js +173 -0
- package/dist/utils/lockStateManager.js.map +1 -0
- package/docs/user-guide/AUTHENTICATION.md +7 -0
- package/docs/user-guide/CLI_OPTIONS.md +14 -0
- package/package.json +2 -1
- package/dist/handlers/service_binding/high/handleListServiceBindings.d.ts +0 -44
- package/dist/handlers/service_binding/high/handleListServiceBindings.d.ts.map +0 -1
- package/dist/handlers/service_binding/high/handleListServiceBindings.js +0 -211
- package/dist/handlers/service_binding/high/handleListServiceBindings.js.map +0 -1
- package/dist/handlers/service_binding/high/serviceBindingXmlBuilder.d.ts +0 -11
- package/dist/handlers/service_binding/high/serviceBindingXmlBuilder.d.ts.map +0 -1
- package/dist/handlers/service_binding/high/serviceBindingXmlBuilder.js +0 -27
- package/dist/handlers/service_binding/high/serviceBindingXmlBuilder.js.map +0 -1
- package/dist/handlers/system/readonly/handleRuntimeGetDumpByUri.d.ts +0 -27
- package/dist/handlers/system/readonly/handleRuntimeGetDumpByUri.d.ts.map +0 -1
- package/dist/handlers/system/readonly/handleRuntimeGetDumpByUri.js +0 -47
- package/dist/handlers/system/readonly/handleRuntimeGetDumpByUri.js.map +0 -1
- package/dist/handlers/system/readonly/runtimeDumpReadCompat.d.ts +0 -8
- package/dist/handlers/system/readonly/runtimeDumpReadCompat.d.ts.map +0 -1
- package/dist/handlers/system/readonly/runtimeDumpReadCompat.js +0 -55
- package/dist/handlers/system/readonly/runtimeDumpReadCompat.js.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const TOOL_DEFINITION: {
|
|
2
|
+
readonly name: "GetSqlQuery";
|
|
3
|
+
readonly description: "Execute freestyle SQL queries via SAP ADT Data Preview API.";
|
|
4
|
+
readonly inputSchema: {
|
|
5
|
+
readonly type: "object";
|
|
6
|
+
readonly properties: {
|
|
7
|
+
readonly sql_query: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "SQL query to execute";
|
|
10
|
+
};
|
|
11
|
+
readonly row_number: {
|
|
12
|
+
readonly type: "number";
|
|
13
|
+
readonly description: "Maximum number of rows to return";
|
|
14
|
+
readonly default: 100;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly required: readonly ["sql_query"];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Interface for SQL query execution response
|
|
22
|
+
*/
|
|
23
|
+
export interface SqlQueryResponse {
|
|
24
|
+
sql_query: string;
|
|
25
|
+
row_number: number;
|
|
26
|
+
execution_time?: number;
|
|
27
|
+
total_rows?: number;
|
|
28
|
+
columns: Array<{
|
|
29
|
+
name: string;
|
|
30
|
+
type: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
length?: number;
|
|
33
|
+
}>;
|
|
34
|
+
rows: Array<Record<string, any>>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Handler to execute freestyle SQL queries via SAP ADT Data Preview API
|
|
38
|
+
*
|
|
39
|
+
* @param args - Tool arguments containing sql_query and optional row_number parameter
|
|
40
|
+
* @returns Response with parsed SQL query results or error
|
|
41
|
+
*/
|
|
42
|
+
export declare function handleGetSqlQuery(args: any): Promise<{
|
|
43
|
+
isError: boolean;
|
|
44
|
+
content: {
|
|
45
|
+
type: string;
|
|
46
|
+
text: string;
|
|
47
|
+
}[];
|
|
48
|
+
}>;
|
|
49
|
+
//# sourceMappingURL=handleGetSqlQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleGetSqlQuery.d.ts","sourceRoot":"","sources":["../../../src/handlers/system/handleGetSqlQuery.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAoBlB,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;CACpC;AAsGD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,GAAG;;;;;;GA+DhD"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_DEFINITION = void 0;
|
|
4
|
+
exports.handleGetSqlQuery = handleGetSqlQuery;
|
|
5
|
+
const utils_1 = require("../../lib/utils");
|
|
6
|
+
const utils_2 = require("../../lib/utils");
|
|
7
|
+
const writeResultToFile_1 = require("../../lib/writeResultToFile");
|
|
8
|
+
exports.TOOL_DEFINITION = {
|
|
9
|
+
"name": "GetSqlQuery",
|
|
10
|
+
"description": "Execute freestyle SQL queries via SAP ADT Data Preview API.",
|
|
11
|
+
"inputSchema": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"sql_query": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "SQL query to execute"
|
|
17
|
+
},
|
|
18
|
+
"row_number": {
|
|
19
|
+
"type": "number",
|
|
20
|
+
"description": "Maximum number of rows to return",
|
|
21
|
+
"default": 100
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"required": [
|
|
25
|
+
"sql_query"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Parse SAP ADT XML response from freestyle SQL query and convert to JSON format
|
|
31
|
+
* @param xmlData - Raw XML response from ADT
|
|
32
|
+
* @param sqlQuery - Original SQL query
|
|
33
|
+
* @param rowNumber - Number of rows requested
|
|
34
|
+
* @returns Parsed SQL query response
|
|
35
|
+
*/
|
|
36
|
+
function parseSqlQueryXml(xmlData, sqlQuery, rowNumber) {
|
|
37
|
+
try {
|
|
38
|
+
// Extract basic information
|
|
39
|
+
const totalRowsMatch = xmlData.match(/<dataPreview:totalRows>(\d+)<\/dataPreview:totalRows>/);
|
|
40
|
+
const totalRows = totalRowsMatch ? parseInt(totalRowsMatch[1]) : 0;
|
|
41
|
+
const queryTimeMatch = xmlData.match(/<dataPreview:queryExecutionTime>([\d.]+)<\/dataPreview:queryExecutionTime>/);
|
|
42
|
+
const queryExecutionTime = queryTimeMatch ? parseFloat(queryTimeMatch[1]) : 0;
|
|
43
|
+
// Extract column metadata
|
|
44
|
+
const columns = [];
|
|
45
|
+
const columnMatches = xmlData.match(/<dataPreview:metadata[^>]*>/g);
|
|
46
|
+
if (columnMatches) {
|
|
47
|
+
columnMatches.forEach(match => {
|
|
48
|
+
const nameMatch = match.match(/dataPreview:name="([^"]+)"/);
|
|
49
|
+
const typeMatch = match.match(/dataPreview:type="([^"]+)"/);
|
|
50
|
+
const descMatch = match.match(/dataPreview:description="([^"]+)"/);
|
|
51
|
+
const lengthMatch = match.match(/dataPreview:length="(\d+)"/);
|
|
52
|
+
if (nameMatch) {
|
|
53
|
+
columns.push({
|
|
54
|
+
name: nameMatch[1],
|
|
55
|
+
type: typeMatch ? typeMatch[1] : 'UNKNOWN',
|
|
56
|
+
description: descMatch ? descMatch[1] : '',
|
|
57
|
+
length: lengthMatch ? parseInt(lengthMatch[1]) : undefined
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
// Extract row data
|
|
63
|
+
const rows = [];
|
|
64
|
+
// Find all column sections
|
|
65
|
+
const columnSections = xmlData.match(/<dataPreview:columns>.*?<\/dataPreview:columns>/gs);
|
|
66
|
+
if (columnSections && columnSections.length > 0) {
|
|
67
|
+
// Extract data for each column
|
|
68
|
+
const columnData = {};
|
|
69
|
+
columnSections.forEach((section, index) => {
|
|
70
|
+
if (index < columns.length) {
|
|
71
|
+
const columnName = columns[index].name;
|
|
72
|
+
const dataMatches = section.match(/<dataPreview:data[^>]*>(.*?)<\/dataPreview:data>/g);
|
|
73
|
+
if (dataMatches) {
|
|
74
|
+
columnData[columnName] = dataMatches.map(match => {
|
|
75
|
+
const content = match.replace(/<[^>]+>/g, '');
|
|
76
|
+
return content || null;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
columnData[columnName] = [];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
// Convert column-based data to row-based data
|
|
85
|
+
const maxRowCount = Math.max(...Object.values(columnData).map(arr => arr.length), 0);
|
|
86
|
+
for (let rowIndex = 0; rowIndex < maxRowCount; rowIndex++) {
|
|
87
|
+
const row = {};
|
|
88
|
+
columns.forEach(column => {
|
|
89
|
+
const columnValues = columnData[column.name] || [];
|
|
90
|
+
row[column.name] = columnValues[rowIndex] || null;
|
|
91
|
+
});
|
|
92
|
+
rows.push(row);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
sql_query: sqlQuery,
|
|
97
|
+
row_number: rowNumber,
|
|
98
|
+
execution_time: queryExecutionTime,
|
|
99
|
+
total_rows: totalRows,
|
|
100
|
+
columns,
|
|
101
|
+
rows
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
catch (parseError) {
|
|
105
|
+
utils_2.logger.error('Failed to parse SQL query XML:', parseError);
|
|
106
|
+
// Return basic structure on parse error
|
|
107
|
+
return {
|
|
108
|
+
sql_query: sqlQuery,
|
|
109
|
+
row_number: rowNumber,
|
|
110
|
+
columns: [],
|
|
111
|
+
rows: [],
|
|
112
|
+
error: 'Failed to parse XML response'
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Handler to execute freestyle SQL queries via SAP ADT Data Preview API
|
|
118
|
+
*
|
|
119
|
+
* @param args - Tool arguments containing sql_query and optional row_number parameter
|
|
120
|
+
* @returns Response with parsed SQL query results or error
|
|
121
|
+
*/
|
|
122
|
+
async function handleGetSqlQuery(args) {
|
|
123
|
+
try {
|
|
124
|
+
utils_2.logger.info('handleGetSqlQuery called with args:', args);
|
|
125
|
+
if (!args?.sql_query) {
|
|
126
|
+
throw new utils_1.McpError(utils_1.ErrorCode.InvalidParams, 'SQL query is required');
|
|
127
|
+
}
|
|
128
|
+
const sqlQuery = args.sql_query;
|
|
129
|
+
const rowNumber = args.row_number || 100; // Default to 100 rows if not specified
|
|
130
|
+
utils_2.logger.info('Executing SQL query', { sqlQuery, rowNumber });
|
|
131
|
+
// Build URL for freestyle data preview with rowNumber parameter
|
|
132
|
+
const url = `${await (0, utils_2.getBaseUrl)()}/sap/bc/adt/datapreview/freestyle?rowNumber=${rowNumber}`;
|
|
133
|
+
utils_2.logger.info(`Making SQL query request to: ${url}`);
|
|
134
|
+
// Execute POST request with SQL query in body
|
|
135
|
+
const response = await (0, utils_2.makeAdtRequestWithTimeout)(url, 'POST', 'long', sqlQuery);
|
|
136
|
+
if (response.status === 200 && response.data) {
|
|
137
|
+
utils_2.logger.info('SQL query request completed successfully', { status: response.status });
|
|
138
|
+
// Parse the XML response
|
|
139
|
+
const parsedData = parseSqlQueryXml(response.data, sqlQuery, rowNumber);
|
|
140
|
+
utils_2.logger.info('Parsed SQL query data', {
|
|
141
|
+
totalRows: parsedData.total_rows,
|
|
142
|
+
columnsCount: parsedData.columns.length,
|
|
143
|
+
rowsCount: parsedData.rows.length,
|
|
144
|
+
executionTime: parsedData.execution_time
|
|
145
|
+
});
|
|
146
|
+
const result = {
|
|
147
|
+
isError: false,
|
|
148
|
+
content: [
|
|
149
|
+
{
|
|
150
|
+
type: "text",
|
|
151
|
+
text: JSON.stringify(parsedData, null, 2)
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
};
|
|
155
|
+
if (args.filePath) {
|
|
156
|
+
(0, writeResultToFile_1.writeResultToFile)(result, args.filePath);
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
throw new utils_1.McpError(utils_1.ErrorCode.InternalError, `Failed to execute SQL query. Status: ${response.status}`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
// MCP-compliant error response: always return content[] with type "text"
|
|
166
|
+
return {
|
|
167
|
+
isError: true,
|
|
168
|
+
content: [
|
|
169
|
+
{
|
|
170
|
+
type: "text",
|
|
171
|
+
text: `ADT error: ${String(error)}`
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const TOOL_DEFINITION: {
|
|
2
|
+
readonly name: "GetTransaction";
|
|
3
|
+
readonly description: "Retrieve ABAP transaction details.";
|
|
4
|
+
readonly inputSchema: {
|
|
5
|
+
readonly type: "object";
|
|
6
|
+
readonly properties: {
|
|
7
|
+
readonly transaction_name: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Name of the ABAP transaction";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
readonly required: readonly ["transaction_name"];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function handleGetTransaction(args: any): Promise<{
|
|
16
|
+
isError: boolean;
|
|
17
|
+
content: {
|
|
18
|
+
type: string;
|
|
19
|
+
text: any;
|
|
20
|
+
}[];
|
|
21
|
+
} | {
|
|
22
|
+
isError: boolean;
|
|
23
|
+
content: {
|
|
24
|
+
type: string;
|
|
25
|
+
json: {
|
|
26
|
+
name: any;
|
|
27
|
+
objectType: string;
|
|
28
|
+
description: any;
|
|
29
|
+
package: any;
|
|
30
|
+
type: any;
|
|
31
|
+
raw?: undefined;
|
|
32
|
+
} | {
|
|
33
|
+
raw: any;
|
|
34
|
+
name?: undefined;
|
|
35
|
+
objectType?: undefined;
|
|
36
|
+
description?: undefined;
|
|
37
|
+
package?: undefined;
|
|
38
|
+
type?: undefined;
|
|
39
|
+
};
|
|
40
|
+
}[];
|
|
41
|
+
}>;
|
|
42
|
+
//# sourceMappingURL=handleGetTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleGetTransaction.d.ts","sourceRoot":"","sources":["../../../src/handlers/system/handleGetTransaction.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAelB,CAAC;AA2BX,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CnD"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_DEFINITION = void 0;
|
|
4
|
+
exports.handleGetTransaction = handleGetTransaction;
|
|
5
|
+
const utils_1 = require("../../lib/utils");
|
|
6
|
+
const utils_2 = require("../../lib/utils");
|
|
7
|
+
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
8
|
+
const writeResultToFile_1 = require("../../lib/writeResultToFile");
|
|
9
|
+
exports.TOOL_DEFINITION = {
|
|
10
|
+
"name": "GetTransaction",
|
|
11
|
+
"description": "Retrieve ABAP transaction details.",
|
|
12
|
+
"inputSchema": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"transaction_name": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Name of the ABAP transaction"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": [
|
|
21
|
+
"transaction_name"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function parseTransactionXml(xml) {
|
|
26
|
+
const parser = new fast_xml_parser_1.XMLParser({
|
|
27
|
+
ignoreAttributes: false,
|
|
28
|
+
attributeNamePrefix: '',
|
|
29
|
+
parseAttributeValue: true,
|
|
30
|
+
trimValues: true
|
|
31
|
+
});
|
|
32
|
+
const result = parser.parse(xml);
|
|
33
|
+
// ADT Transaction XML (opr:objectProperties)
|
|
34
|
+
if (result['opr:objectProperties'] && result['opr:objectProperties']['opr:object']) {
|
|
35
|
+
const obj = result['opr:objectProperties']['opr:object'];
|
|
36
|
+
return {
|
|
37
|
+
name: obj['name'],
|
|
38
|
+
objectType: 'transaction',
|
|
39
|
+
description: obj['text'],
|
|
40
|
+
package: obj['package'],
|
|
41
|
+
type: obj['type']
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// fallback: return raw
|
|
45
|
+
return { raw: result };
|
|
46
|
+
}
|
|
47
|
+
async function handleGetTransaction(args) {
|
|
48
|
+
try {
|
|
49
|
+
if (!args?.transaction_name) {
|
|
50
|
+
throw new utils_1.McpError(utils_1.ErrorCode.InvalidParams, 'Transaction name is required');
|
|
51
|
+
}
|
|
52
|
+
const encodedTransactionName = (0, utils_2.encodeSapObjectName)(args.transaction_name);
|
|
53
|
+
const url = `${await (0, utils_2.getBaseUrl)()}/sap/bc/adt/repository/informationsystem/objectproperties/values?uri=%2Fsap%2Fbc%2Fadt%2Fvit%2Fwb%2Fobject_type%2Ftrant%2Fobject_name%2F${encodedTransactionName}&facet=package&facet=appl`;
|
|
54
|
+
const response = await (0, utils_2.makeAdtRequestWithTimeout)(url, 'GET', 'default');
|
|
55
|
+
// Parse XML responses; otherwise return the payload unchanged
|
|
56
|
+
if (typeof response.data === 'string' && response.data.trim().startsWith('<?xml')) {
|
|
57
|
+
const result = {
|
|
58
|
+
isError: false,
|
|
59
|
+
content: [
|
|
60
|
+
{
|
|
61
|
+
type: "json",
|
|
62
|
+
json: parseTransactionXml(response.data)
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
};
|
|
66
|
+
if (args.filePath) {
|
|
67
|
+
(0, writeResultToFile_1.writeResultToFile)(result, args.filePath);
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const plainResult = (0, utils_2.return_response)(response);
|
|
73
|
+
if (args.filePath) {
|
|
74
|
+
(0, writeResultToFile_1.writeResultToFile)(plainResult, args.filePath);
|
|
75
|
+
}
|
|
76
|
+
return plainResult;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
// MCP-compliant error response: always return content[] with type "text"
|
|
81
|
+
return {
|
|
82
|
+
isError: true,
|
|
83
|
+
content: [
|
|
84
|
+
{
|
|
85
|
+
type: "text",
|
|
86
|
+
text: `ADT error: ${String(error)}`
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const TOOL_DEFINITION: {
|
|
2
|
+
readonly name: "GetTypeInfo";
|
|
3
|
+
readonly description: "Retrieve ABAP type information.";
|
|
4
|
+
readonly inputSchema: {
|
|
5
|
+
readonly type: "object";
|
|
6
|
+
readonly properties: {
|
|
7
|
+
readonly type_name: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Name of the ABAP type";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
readonly required: readonly ["type_name"];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function handleGetTypeInfo(args: any): Promise<{
|
|
16
|
+
isError: boolean;
|
|
17
|
+
content: {
|
|
18
|
+
type: string;
|
|
19
|
+
json: {
|
|
20
|
+
name: any;
|
|
21
|
+
objectType: string;
|
|
22
|
+
description: any;
|
|
23
|
+
dataType: any;
|
|
24
|
+
length: number;
|
|
25
|
+
decimals: number;
|
|
26
|
+
domain: any;
|
|
27
|
+
package: any;
|
|
28
|
+
labels: {
|
|
29
|
+
short: any;
|
|
30
|
+
medium: any;
|
|
31
|
+
long: any;
|
|
32
|
+
heading: any;
|
|
33
|
+
};
|
|
34
|
+
type?: undefined;
|
|
35
|
+
raw?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
name: any;
|
|
38
|
+
objectType: string;
|
|
39
|
+
description: any;
|
|
40
|
+
package: any;
|
|
41
|
+
type: any;
|
|
42
|
+
dataType?: undefined;
|
|
43
|
+
length?: undefined;
|
|
44
|
+
decimals?: undefined;
|
|
45
|
+
domain?: undefined;
|
|
46
|
+
labels?: undefined;
|
|
47
|
+
raw?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
raw: any;
|
|
50
|
+
name?: undefined;
|
|
51
|
+
objectType?: undefined;
|
|
52
|
+
description?: undefined;
|
|
53
|
+
dataType?: undefined;
|
|
54
|
+
length?: undefined;
|
|
55
|
+
decimals?: undefined;
|
|
56
|
+
domain?: undefined;
|
|
57
|
+
package?: undefined;
|
|
58
|
+
labels?: undefined;
|
|
59
|
+
type?: undefined;
|
|
60
|
+
};
|
|
61
|
+
}[];
|
|
62
|
+
} | {
|
|
63
|
+
isError: boolean;
|
|
64
|
+
content: {
|
|
65
|
+
type: string;
|
|
66
|
+
text: string;
|
|
67
|
+
}[];
|
|
68
|
+
}>;
|
|
69
|
+
//# sourceMappingURL=handleGetTypeInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleGetTypeInfo.d.ts","sourceRoot":"","sources":["../../../src/handlers/system/handleGetTypeInfo.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAelB,CAAC;AAiDX,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGhD"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_DEFINITION = void 0;
|
|
4
|
+
exports.handleGetTypeInfo = handleGetTypeInfo;
|
|
5
|
+
const utils_1 = require("../../lib/utils");
|
|
6
|
+
const utils_2 = require("../../lib/utils");
|
|
7
|
+
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
8
|
+
const getObjectsListCache_1 = require("../../lib/getObjectsListCache");
|
|
9
|
+
exports.TOOL_DEFINITION = {
|
|
10
|
+
"name": "GetTypeInfo",
|
|
11
|
+
"description": "Retrieve ABAP type information.",
|
|
12
|
+
"inputSchema": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"type_name": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Name of the ABAP type"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": [
|
|
21
|
+
"type_name"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function parseTypeInfoXml(xml) {
|
|
26
|
+
const parser = new fast_xml_parser_1.XMLParser({
|
|
27
|
+
ignoreAttributes: false,
|
|
28
|
+
attributeNamePrefix: '',
|
|
29
|
+
parseAttributeValue: true,
|
|
30
|
+
trimValues: true
|
|
31
|
+
});
|
|
32
|
+
const result = parser.parse(xml);
|
|
33
|
+
// Data Element (DTEL/DE)
|
|
34
|
+
if (result['blue:wbobj'] && result['blue:wbobj']['dtel:dataElement']) {
|
|
35
|
+
const wb = result['blue:wbobj'];
|
|
36
|
+
const dtel = wb['dtel:dataElement'];
|
|
37
|
+
return {
|
|
38
|
+
name: wb['adtcore:name'],
|
|
39
|
+
objectType: 'data_element',
|
|
40
|
+
description: wb['adtcore:description'],
|
|
41
|
+
dataType: dtel['dtel:dataType'],
|
|
42
|
+
length: parseInt(dtel['dtel:dataTypeLength'], 10),
|
|
43
|
+
decimals: parseInt(dtel['dtel:dataTypeDecimals'], 10),
|
|
44
|
+
domain: dtel['dtel:typeName'],
|
|
45
|
+
package: wb['adtcore:packageRef']?.['adtcore:name'] || null,
|
|
46
|
+
labels: {
|
|
47
|
+
short: dtel['dtel:shortFieldLabel'],
|
|
48
|
+
medium: dtel['dtel:mediumFieldLabel'],
|
|
49
|
+
long: dtel['dtel:longFieldLabel'],
|
|
50
|
+
heading: dtel['dtel:headingFieldLabel']
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// Domain (DOMA/DD) via repository informationsystem
|
|
55
|
+
if (result['opr:objectProperties'] && result['opr:objectProperties']['opr:object']) {
|
|
56
|
+
const obj = result['opr:objectProperties']['opr:object'];
|
|
57
|
+
return {
|
|
58
|
+
name: obj['name'],
|
|
59
|
+
objectType: 'domain',
|
|
60
|
+
description: obj['text'],
|
|
61
|
+
package: obj['package'],
|
|
62
|
+
type: obj['type'],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// Table Type (not implemented, fallback)
|
|
66
|
+
return { raw: result };
|
|
67
|
+
}
|
|
68
|
+
async function handleGetTypeInfo(args) {
|
|
69
|
+
try {
|
|
70
|
+
if (!args?.type_name) {
|
|
71
|
+
throw new utils_1.McpError(utils_1.ErrorCode.InvalidParams, 'Type name is required');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
// MCP-compliant error response: always return content[] with type "text"
|
|
76
|
+
return {
|
|
77
|
+
isError: true,
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: "text",
|
|
81
|
+
text: `ADT error: ${String(error)}`
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
const url = `${await (0, utils_2.getBaseUrl)()}/sap/bc/adt/ddic/domains/${(0, utils_2.encodeSapObjectName)(args.type_name)}/source/main`;
|
|
88
|
+
const response = await (0, utils_2.makeAdtRequestWithTimeout)(url, 'GET', 'default');
|
|
89
|
+
const result = {
|
|
90
|
+
isError: false,
|
|
91
|
+
content: [
|
|
92
|
+
{
|
|
93
|
+
type: "json",
|
|
94
|
+
json: parseTypeInfoXml(response.data)
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
};
|
|
98
|
+
getObjectsListCache_1.objectsListCache.setCache(result);
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
// no domain found, try data element
|
|
103
|
+
try {
|
|
104
|
+
const url = `${await (0, utils_2.getBaseUrl)()}/sap/bc/adt/ddic/dataelements/${(0, utils_2.encodeSapObjectName)(args.type_name)}`;
|
|
105
|
+
const response = await (0, utils_2.makeAdtRequestWithTimeout)(url, 'GET', 'default');
|
|
106
|
+
const result = {
|
|
107
|
+
isError: false,
|
|
108
|
+
content: [
|
|
109
|
+
{
|
|
110
|
+
type: "json",
|
|
111
|
+
json: parseTypeInfoXml(response.data)
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
};
|
|
115
|
+
getObjectsListCache_1.objectsListCache.setCache(result);
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
// no data element found, try table type
|
|
120
|
+
try {
|
|
121
|
+
const url = `${await (0, utils_2.getBaseUrl)()}/sap/bc/adt/ddic/tabletypes/${(0, utils_2.encodeSapObjectName)(args.type_name)}`;
|
|
122
|
+
const response = await (0, utils_2.makeAdtRequestWithTimeout)(url, 'GET', 'default');
|
|
123
|
+
const result = {
|
|
124
|
+
isError: false,
|
|
125
|
+
content: [
|
|
126
|
+
{
|
|
127
|
+
type: "json",
|
|
128
|
+
json: parseTypeInfoXml(response.data)
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
};
|
|
132
|
+
getObjectsListCache_1.objectsListCache.setCache(result);
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
// fallback: try repository informationsystem for domain
|
|
137
|
+
try {
|
|
138
|
+
const baseUrl = await (0, utils_2.getBaseUrl)();
|
|
139
|
+
const uri = encodeURIComponent(`/sap/bc/adt/ddic/domains/${args.type_name.toLowerCase()}`);
|
|
140
|
+
const url = `${baseUrl}/sap/bc/adt/repository/informationsystem/objectproperties/values?uri=${uri}`;
|
|
141
|
+
const response = await (0, utils_2.makeAdtRequestWithTimeout)(url, 'GET', 'default');
|
|
142
|
+
const result = {
|
|
143
|
+
isError: false,
|
|
144
|
+
content: [
|
|
145
|
+
{
|
|
146
|
+
type: "json",
|
|
147
|
+
json: parseTypeInfoXml(response.data)
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
};
|
|
151
|
+
getObjectsListCache_1.objectsListCache.setCache(result);
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
// MCP-compliant error response: always return content[] with type "text"
|
|
156
|
+
return {
|
|
157
|
+
isError: true,
|
|
158
|
+
content: [
|
|
159
|
+
{
|
|
160
|
+
type: "text",
|
|
161
|
+
text: `ADT error: ${String(error)}`
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const TOOL_DEFINITION: {
|
|
2
|
+
readonly name: "GetWhereUsed";
|
|
3
|
+
readonly description: "Retrieve where-used references for ABAP objects via ADT usageReferences.";
|
|
4
|
+
readonly inputSchema: {
|
|
5
|
+
readonly type: "object";
|
|
6
|
+
readonly properties: {
|
|
7
|
+
readonly object_name: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Name of the ABAP object";
|
|
10
|
+
};
|
|
11
|
+
readonly object_type: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly description: "Type of the ABAP object";
|
|
14
|
+
};
|
|
15
|
+
readonly detailed: {
|
|
16
|
+
readonly type: "boolean";
|
|
17
|
+
readonly description: "If true, returns all references including packages and internal components.";
|
|
18
|
+
readonly default: false;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
readonly required: readonly ["object_name", "object_type"];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Returns where-used references for ABAP objects.
|
|
26
|
+
*
|
|
27
|
+
* Supported object_type values:
|
|
28
|
+
* - class
|
|
29
|
+
* - program
|
|
30
|
+
* - include
|
|
31
|
+
* - function (function group)
|
|
32
|
+
* - functionmodule (function module, format: GROUP|FM_NAME)
|
|
33
|
+
* - interface
|
|
34
|
+
* - badi, badi_class, badi-implementation
|
|
35
|
+
* - package
|
|
36
|
+
* - table, tabl, TABL
|
|
37
|
+
* - dataelement
|
|
38
|
+
* - domain
|
|
39
|
+
* - view, ddicview, cdsview
|
|
40
|
+
* - searchhelp
|
|
41
|
+
* - messageclass
|
|
42
|
+
* - transaction
|
|
43
|
+
* - bdef, BDEF
|
|
44
|
+
* - enhancementspot, enhs, enho
|
|
45
|
+
* - enhancementimpl, enhi
|
|
46
|
+
*/
|
|
47
|
+
export declare function handleGetWhereUsed(args: any): Promise<{
|
|
48
|
+
isError: boolean;
|
|
49
|
+
content: {
|
|
50
|
+
type: string;
|
|
51
|
+
json: {
|
|
52
|
+
object_name: string;
|
|
53
|
+
object_type: string;
|
|
54
|
+
object_uri: string;
|
|
55
|
+
detailed: boolean;
|
|
56
|
+
total_references: number;
|
|
57
|
+
total_found: number;
|
|
58
|
+
filtered_out: number;
|
|
59
|
+
references: any;
|
|
60
|
+
};
|
|
61
|
+
}[];
|
|
62
|
+
} | {
|
|
63
|
+
isError: boolean;
|
|
64
|
+
content: {
|
|
65
|
+
type: string;
|
|
66
|
+
text: string;
|
|
67
|
+
}[];
|
|
68
|
+
}>;
|
|
69
|
+
//# sourceMappingURL=handleGetWhereUsed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleGetWhereUsed.d.ts","sourceRoot":"","sources":["../../../src/handlers/system/handleGetWhereUsed.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAyBlB,CAAC;AAuUX;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;;GA0FjD"}
|