@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,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LockObject Handler - Lock ABAP object for modification via ADT API
|
|
3
|
+
*
|
|
4
|
+
* Uses lock functions from @mcp-abap-adt/adt-clients/core for all operations.
|
|
5
|
+
* Returns lock handle that must be used in subsequent requests with the same session_id.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TOOL_DEFINITION: {
|
|
8
|
+
readonly name: "LockObject";
|
|
9
|
+
readonly description: "Lock an ABAP object for modification. Returns lock handle that must be used in subsequent update/unlock operations with the same session_id. Use GetSession first to get a session_id, then use that session_id for lock, update, and unlock operations.";
|
|
10
|
+
readonly inputSchema: {
|
|
11
|
+
readonly type: "object";
|
|
12
|
+
readonly properties: {
|
|
13
|
+
readonly object_name: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly description: "Object name (e.g., ZCL_MY_CLASS, Z_MY_PROGRAM, ZIF_MY_INTERFACE). For function modules, use format GROUP|FM_NAME";
|
|
16
|
+
};
|
|
17
|
+
readonly object_type: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: "Object type: 'class', 'program', 'interface', 'function_group', 'function_module', 'table', 'structure', 'view', 'domain', 'data_element', 'package', 'behavior_definition', 'metadata_extension'";
|
|
20
|
+
readonly enum: readonly ["class", "program", "interface", "function_group", "function_module", "table", "structure", "view", "domain", "data_element", "package", "behavior_definition", "metadata_extension"];
|
|
21
|
+
};
|
|
22
|
+
readonly session_id: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: "Session ID from GetSession. If not provided, a new session will be created.";
|
|
25
|
+
};
|
|
26
|
+
readonly session_state: {
|
|
27
|
+
readonly type: "object";
|
|
28
|
+
readonly description: "Session state from GetSession (cookies, csrf_token, cookie_store). Required if session_id is provided.";
|
|
29
|
+
readonly properties: {
|
|
30
|
+
readonly cookies: {
|
|
31
|
+
readonly type: "string";
|
|
32
|
+
};
|
|
33
|
+
readonly csrf_token: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
};
|
|
36
|
+
readonly cookie_store: {
|
|
37
|
+
readonly type: "object";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly required: readonly ["object_name", "object_type"];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Main handler for LockObject MCP tool
|
|
47
|
+
*
|
|
48
|
+
* Uses lock functions from @mcp-abap-adt/adt-clients/core for all operations
|
|
49
|
+
*/
|
|
50
|
+
export declare function handleLockObject(args: any): Promise<{
|
|
51
|
+
isError: boolean;
|
|
52
|
+
content: {
|
|
53
|
+
type: string;
|
|
54
|
+
text: any;
|
|
55
|
+
}[];
|
|
56
|
+
}>;
|
|
57
|
+
//# sourceMappingURL=handleLockObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleLockObject.d.ts","sourceRoot":"","sources":["../../../src/handlers/common/handleLockObject.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BlB,CAAC;AAaX;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,GAAG;;;;;;GAgK/C"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LockObject Handler - Lock ABAP object for modification via ADT API
|
|
4
|
+
*
|
|
5
|
+
* Uses lock functions from @mcp-abap-adt/adt-clients/core for all operations.
|
|
6
|
+
* Returns lock handle that must be used in subsequent requests with the same session_id.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.TOOL_DEFINITION = void 0;
|
|
10
|
+
exports.handleLockObject = handleLockObject;
|
|
11
|
+
const utils_1 = require("../../lib/utils");
|
|
12
|
+
const sessionUtils_1 = require("../../lib/sessionUtils");
|
|
13
|
+
const adt_clients_1 = require("@mcp-abap-adt/adt-clients");
|
|
14
|
+
exports.TOOL_DEFINITION = {
|
|
15
|
+
name: "LockObject",
|
|
16
|
+
description: "Lock an ABAP object for modification. Returns lock handle that must be used in subsequent update/unlock operations with the same session_id. Use GetSession first to get a session_id, then use that session_id for lock, update, and unlock operations.",
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
object_name: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Object name (e.g., ZCL_MY_CLASS, Z_MY_PROGRAM, ZIF_MY_INTERFACE). For function modules, use format GROUP|FM_NAME"
|
|
23
|
+
},
|
|
24
|
+
object_type: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Object type: 'class', 'program', 'interface', 'function_group', 'function_module', 'table', 'structure', 'view', 'domain', 'data_element', 'package', 'behavior_definition', 'metadata_extension'",
|
|
27
|
+
enum: ["class", "program", "interface", "function_group", "function_module", "table", "structure", "view", "domain", "data_element", "package", "behavior_definition", "metadata_extension"]
|
|
28
|
+
},
|
|
29
|
+
session_id: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Session ID from GetSession. If not provided, a new session will be created."
|
|
32
|
+
},
|
|
33
|
+
session_state: {
|
|
34
|
+
type: "object",
|
|
35
|
+
description: "Session state from GetSession (cookies, csrf_token, cookie_store). Required if session_id is provided.",
|
|
36
|
+
properties: {
|
|
37
|
+
cookies: { type: "string" },
|
|
38
|
+
csrf_token: { type: "string" },
|
|
39
|
+
cookie_store: { type: "object" }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
required: ["object_name", "object_type"]
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Main handler for LockObject MCP tool
|
|
48
|
+
*
|
|
49
|
+
* Uses lock functions from @mcp-abap-adt/adt-clients/core for all operations
|
|
50
|
+
*/
|
|
51
|
+
async function handleLockObject(args) {
|
|
52
|
+
try {
|
|
53
|
+
const { object_name, object_type, session_id, session_state } = args;
|
|
54
|
+
// Validation
|
|
55
|
+
if (!object_name || !object_type) {
|
|
56
|
+
return (0, utils_1.return_error)(new Error('object_name and object_type are required'));
|
|
57
|
+
}
|
|
58
|
+
const validTypes = ['class', 'program', 'interface', 'function_group', 'function_module', 'table', 'structure', 'view', 'domain', 'data_element', 'package'];
|
|
59
|
+
if (!validTypes.includes(object_type.toLowerCase())) {
|
|
60
|
+
return (0, utils_1.return_error)(new Error(`Invalid object_type. Must be one of: ${validTypes.join(', ')}`));
|
|
61
|
+
}
|
|
62
|
+
const connection = (0, utils_1.getManagedConnection)();
|
|
63
|
+
const client = new adt_clients_1.CrudClient(connection);
|
|
64
|
+
// Restore session state if provided
|
|
65
|
+
if (session_id && session_state) {
|
|
66
|
+
connection.setSessionState({
|
|
67
|
+
cookies: session_state.cookies || null,
|
|
68
|
+
csrfToken: session_state.csrf_token || null,
|
|
69
|
+
cookieStore: session_state.cookie_store || {}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
// Ensure connection is established
|
|
74
|
+
await connection.connect();
|
|
75
|
+
}
|
|
76
|
+
// Use provided session_id or generate new one
|
|
77
|
+
const desiredSessionId = session_id || (0, sessionUtils_1.generateSessionId)();
|
|
78
|
+
const objectName = object_name.toUpperCase();
|
|
79
|
+
const objectType = object_type.toLowerCase();
|
|
80
|
+
utils_1.logger.info(`Starting object lock: ${objectName} (type: ${objectType}, session: ${desiredSessionId.substring(0, 8)}...)`);
|
|
81
|
+
try {
|
|
82
|
+
let lockHandle;
|
|
83
|
+
// Call appropriate lock method based on object type
|
|
84
|
+
switch (objectType) {
|
|
85
|
+
case 'class':
|
|
86
|
+
await client.lockClass(objectName);
|
|
87
|
+
lockHandle = client.getLockHandle();
|
|
88
|
+
break;
|
|
89
|
+
case 'program':
|
|
90
|
+
await client.lockProgram(objectName);
|
|
91
|
+
lockHandle = client.getLockHandle();
|
|
92
|
+
break;
|
|
93
|
+
case 'interface':
|
|
94
|
+
await client.lockInterface(objectName);
|
|
95
|
+
lockHandle = client.getLockHandle();
|
|
96
|
+
break;
|
|
97
|
+
case 'function_group':
|
|
98
|
+
await client.lockFunctionGroup(objectName);
|
|
99
|
+
lockHandle = client.getLockHandle();
|
|
100
|
+
break;
|
|
101
|
+
case 'function_module':
|
|
102
|
+
// Function module requires function group name which is not provided in this generic handler
|
|
103
|
+
return (0, utils_1.return_error)(new Error('Function module locking via LockObject is not supported. Function modules require function group name.'));
|
|
104
|
+
case 'table':
|
|
105
|
+
await client.lockTable(objectName);
|
|
106
|
+
lockHandle = client.getLockHandle();
|
|
107
|
+
break;
|
|
108
|
+
case 'structure':
|
|
109
|
+
await client.lockStructure(objectName);
|
|
110
|
+
lockHandle = client.getLockHandle();
|
|
111
|
+
break;
|
|
112
|
+
case 'view':
|
|
113
|
+
await client.lockView(objectName);
|
|
114
|
+
lockHandle = client.getLockHandle();
|
|
115
|
+
break;
|
|
116
|
+
case 'domain':
|
|
117
|
+
await client.lockDomain(objectName);
|
|
118
|
+
lockHandle = client.getLockHandle();
|
|
119
|
+
break;
|
|
120
|
+
case 'data_element':
|
|
121
|
+
await client.lockDataElement(objectName);
|
|
122
|
+
lockHandle = client.getLockHandle();
|
|
123
|
+
break;
|
|
124
|
+
case 'behavior_definition':
|
|
125
|
+
await client.lockBehaviorDefinition(objectName);
|
|
126
|
+
lockHandle = client.getLockHandle();
|
|
127
|
+
break;
|
|
128
|
+
case 'metadata_extension':
|
|
129
|
+
await client.lockMetadataExtension(objectName);
|
|
130
|
+
lockHandle = client.getLockHandle();
|
|
131
|
+
break;
|
|
132
|
+
case 'package':
|
|
133
|
+
// Package requires superPackage parameter - need to fetch it or handle differently
|
|
134
|
+
return (0, utils_1.return_error)(new Error('Package locking via LockObject is not supported. Use specific package operations.'));
|
|
135
|
+
default:
|
|
136
|
+
return (0, utils_1.return_error)(new Error(`Unsupported object_type: ${object_type}`));
|
|
137
|
+
}
|
|
138
|
+
if (!lockHandle) {
|
|
139
|
+
throw new Error(`Lock did not return a lock handle for object ${objectName}`);
|
|
140
|
+
}
|
|
141
|
+
// Get updated session state after lock
|
|
142
|
+
const updatedSessionState = connection.getSessionState();
|
|
143
|
+
utils_1.logger.info(`✅ LockObject completed: ${objectName}`);
|
|
144
|
+
utils_1.logger.info(` Lock handle: ${lockHandle.substring(0, 20)}...`);
|
|
145
|
+
return (0, utils_1.return_response)({
|
|
146
|
+
data: JSON.stringify({
|
|
147
|
+
success: true,
|
|
148
|
+
object_name: objectName,
|
|
149
|
+
object_type: objectType,
|
|
150
|
+
session_id: desiredSessionId,
|
|
151
|
+
lock_handle: lockHandle,
|
|
152
|
+
transport_request: null, // CrudClient doesn't expose transport request
|
|
153
|
+
session_state: updatedSessionState ? {
|
|
154
|
+
cookies: updatedSessionState.cookies,
|
|
155
|
+
csrf_token: updatedSessionState.csrfToken,
|
|
156
|
+
cookie_store: updatedSessionState.cookieStore
|
|
157
|
+
} : null,
|
|
158
|
+
message: `Object ${objectName} locked successfully. Use this lock_handle and session_id for subsequent update/unlock operations.`
|
|
159
|
+
}, null, 2)
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
utils_1.logger.error(`Error locking object ${objectName}:`, error);
|
|
164
|
+
// Parse error message
|
|
165
|
+
let errorMessage = `Failed to lock object: ${error.message || String(error)}`;
|
|
166
|
+
if (error.response?.status === 404) {
|
|
167
|
+
errorMessage = `Object ${objectName} not found.`;
|
|
168
|
+
}
|
|
169
|
+
else if (error.response?.status === 409) {
|
|
170
|
+
errorMessage = `Object ${objectName} is already locked by another user.`;
|
|
171
|
+
}
|
|
172
|
+
else if (error.response?.data && typeof error.response.data === 'string') {
|
|
173
|
+
try {
|
|
174
|
+
const { XMLParser } = require('fast-xml-parser');
|
|
175
|
+
const parser = new XMLParser({
|
|
176
|
+
ignoreAttributes: false,
|
|
177
|
+
attributeNamePrefix: '@_'
|
|
178
|
+
});
|
|
179
|
+
const errorData = parser.parse(error.response.data);
|
|
180
|
+
const errorMsg = errorData['exc:exception']?.message?.['#text'] || errorData['exc:exception']?.message;
|
|
181
|
+
if (errorMsg) {
|
|
182
|
+
errorMessage = `SAP Error: ${errorMsg}`;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
catch (parseError) {
|
|
186
|
+
// Ignore parse errors
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return (0, utils_1.return_error)(new Error(errorMessage));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
return (0, utils_1.return_error)(error);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UnlockObject Handler - Unlock ABAP object after modification via ADT API
|
|
3
|
+
*
|
|
4
|
+
* Uses unlock functions from @mcp-abap-adt/adt-clients/core for all operations.
|
|
5
|
+
* Must use the same session_id and lock_handle from the LockObject operation.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TOOL_DEFINITION: {
|
|
8
|
+
readonly name: "UnlockObject";
|
|
9
|
+
readonly description: "Unlock an ABAP object after modification. Must use the same session_id and lock_handle from the LockObject operation.";
|
|
10
|
+
readonly inputSchema: {
|
|
11
|
+
readonly type: "object";
|
|
12
|
+
readonly properties: {
|
|
13
|
+
readonly object_name: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly description: "Object name (e.g., ZCL_MY_CLASS, Z_MY_PROGRAM, ZIF_MY_INTERFACE). For function modules, use format GROUP|FM_NAME";
|
|
16
|
+
};
|
|
17
|
+
readonly object_type: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: "Object type: 'class', 'program', 'interface', 'function_group', 'function_module', 'table', 'structure', 'view', 'domain', 'data_element', 'package', 'behavior_definition', 'metadata_extension'";
|
|
20
|
+
readonly enum: readonly ["class", "program", "interface", "function_group", "function_module", "table", "structure", "view", "domain", "data_element", "package", "behavior_definition", "metadata_extension"];
|
|
21
|
+
};
|
|
22
|
+
readonly lock_handle: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: "Lock handle from LockObject operation";
|
|
25
|
+
};
|
|
26
|
+
readonly session_id: {
|
|
27
|
+
readonly type: "string";
|
|
28
|
+
readonly description: "Session ID from LockObject operation. Must be the same as used in LockObject.";
|
|
29
|
+
};
|
|
30
|
+
readonly session_state: {
|
|
31
|
+
readonly type: "object";
|
|
32
|
+
readonly description: "Session state from LockObject (cookies, csrf_token, cookie_store). Required if session_id is provided.";
|
|
33
|
+
readonly properties: {
|
|
34
|
+
readonly cookies: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
};
|
|
37
|
+
readonly csrf_token: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
};
|
|
40
|
+
readonly cookie_store: {
|
|
41
|
+
readonly type: "object";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
readonly required: readonly ["object_name", "object_type", "lock_handle", "session_id"];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Main handler for UnlockObject MCP tool
|
|
51
|
+
*
|
|
52
|
+
* Uses unlock functions from @mcp-abap-adt/adt-clients/core for all operations
|
|
53
|
+
*/
|
|
54
|
+
export declare function handleUnlockObject(args: any): Promise<{
|
|
55
|
+
isError: boolean;
|
|
56
|
+
content: {
|
|
57
|
+
type: string;
|
|
58
|
+
text: any;
|
|
59
|
+
}[];
|
|
60
|
+
}>;
|
|
61
|
+
//# sourceMappingURL=handleUnlockObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleUnlockObject.d.ts","sourceRoot":"","sources":["../../../src/handlers/common/handleUnlockObject.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmClB,CAAC;AAcX;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,GAAG;;;;;;GA2IjD"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* UnlockObject Handler - Unlock ABAP object after modification via ADT API
|
|
4
|
+
*
|
|
5
|
+
* Uses unlock functions from @mcp-abap-adt/adt-clients/core for all operations.
|
|
6
|
+
* Must use the same session_id and lock_handle from the LockObject operation.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.TOOL_DEFINITION = void 0;
|
|
10
|
+
exports.handleUnlockObject = handleUnlockObject;
|
|
11
|
+
const utils_1 = require("../../lib/utils");
|
|
12
|
+
const adt_clients_1 = require("@mcp-abap-adt/adt-clients");
|
|
13
|
+
exports.TOOL_DEFINITION = {
|
|
14
|
+
name: "UnlockObject",
|
|
15
|
+
description: "Unlock an ABAP object after modification. Must use the same session_id and lock_handle from the LockObject operation.",
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
object_name: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Object name (e.g., ZCL_MY_CLASS, Z_MY_PROGRAM, ZIF_MY_INTERFACE). For function modules, use format GROUP|FM_NAME"
|
|
22
|
+
},
|
|
23
|
+
object_type: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Object type: 'class', 'program', 'interface', 'function_group', 'function_module', 'table', 'structure', 'view', 'domain', 'data_element', 'package', 'behavior_definition', 'metadata_extension'",
|
|
26
|
+
enum: ["class", "program", "interface", "function_group", "function_module", "table", "structure", "view", "domain", "data_element", "package", "behavior_definition", "metadata_extension"]
|
|
27
|
+
},
|
|
28
|
+
lock_handle: {
|
|
29
|
+
type: "string",
|
|
30
|
+
description: "Lock handle from LockObject operation"
|
|
31
|
+
},
|
|
32
|
+
session_id: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "Session ID from LockObject operation. Must be the same as used in LockObject."
|
|
35
|
+
},
|
|
36
|
+
session_state: {
|
|
37
|
+
type: "object",
|
|
38
|
+
description: "Session state from LockObject (cookies, csrf_token, cookie_store). Required if session_id is provided.",
|
|
39
|
+
properties: {
|
|
40
|
+
cookies: { type: "string" },
|
|
41
|
+
csrf_token: { type: "string" },
|
|
42
|
+
cookie_store: { type: "object" }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
required: ["object_name", "object_type", "lock_handle", "session_id"]
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Main handler for UnlockObject MCP tool
|
|
51
|
+
*
|
|
52
|
+
* Uses unlock functions from @mcp-abap-adt/adt-clients/core for all operations
|
|
53
|
+
*/
|
|
54
|
+
async function handleUnlockObject(args) {
|
|
55
|
+
try {
|
|
56
|
+
const { object_name, object_type, lock_handle, session_id, session_state } = args;
|
|
57
|
+
// Validation
|
|
58
|
+
if (!object_name || !object_type || !lock_handle || !session_id) {
|
|
59
|
+
return (0, utils_1.return_error)(new Error('object_name, object_type, lock_handle, and session_id are required'));
|
|
60
|
+
}
|
|
61
|
+
const validTypes = ['class', 'program', 'interface', 'function_group', 'function_module', 'table', 'structure', 'view', 'domain', 'data_element', 'package', 'behavior_definition', 'metadata_extension'];
|
|
62
|
+
if (!validTypes.includes(object_type.toLowerCase())) {
|
|
63
|
+
return (0, utils_1.return_error)(new Error(`Invalid object_type. Must be one of: ${validTypes.join(', ')}`));
|
|
64
|
+
}
|
|
65
|
+
const connection = (0, utils_1.getManagedConnection)();
|
|
66
|
+
const client = new adt_clients_1.CrudClient(connection);
|
|
67
|
+
// Restore session state if provided
|
|
68
|
+
if (session_state) {
|
|
69
|
+
connection.setSessionState({
|
|
70
|
+
cookies: session_state.cookies || null,
|
|
71
|
+
csrfToken: session_state.csrf_token || null,
|
|
72
|
+
cookieStore: session_state.cookie_store || {}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// Ensure connection is established
|
|
77
|
+
await connection.connect();
|
|
78
|
+
}
|
|
79
|
+
const objectName = object_name.toUpperCase();
|
|
80
|
+
const objectType = object_type.toLowerCase();
|
|
81
|
+
utils_1.logger.info(`Starting object unlock: ${objectName} (type: ${objectType}, session: ${session_id.substring(0, 8)}...)`);
|
|
82
|
+
try {
|
|
83
|
+
// Call appropriate unlock method based on object type
|
|
84
|
+
switch (objectType) {
|
|
85
|
+
case 'class':
|
|
86
|
+
await client.unlockClass(objectName, lock_handle);
|
|
87
|
+
break;
|
|
88
|
+
case 'program':
|
|
89
|
+
await client.unlockProgram(objectName, lock_handle);
|
|
90
|
+
break;
|
|
91
|
+
case 'interface':
|
|
92
|
+
await client.unlockInterface(objectName, lock_handle);
|
|
93
|
+
break;
|
|
94
|
+
case 'function_group':
|
|
95
|
+
await client.unlockFunctionGroup(objectName, lock_handle);
|
|
96
|
+
break;
|
|
97
|
+
case 'function_module':
|
|
98
|
+
// Function module requires function group name which is not provided in this generic handler
|
|
99
|
+
return (0, utils_1.return_error)(new Error('Function module unlocking via UnlockObject is not supported. Function modules require function group name.'));
|
|
100
|
+
case 'table':
|
|
101
|
+
await client.unlockTable(objectName, lock_handle);
|
|
102
|
+
break;
|
|
103
|
+
case 'structure':
|
|
104
|
+
await client.unlockStructure(objectName, lock_handle);
|
|
105
|
+
break;
|
|
106
|
+
case 'view':
|
|
107
|
+
await client.unlockView(objectName, lock_handle);
|
|
108
|
+
break;
|
|
109
|
+
case 'domain':
|
|
110
|
+
await client.unlockDomain(objectName, lock_handle);
|
|
111
|
+
break;
|
|
112
|
+
case 'data_element':
|
|
113
|
+
await client.unlockDataElement(objectName, lock_handle);
|
|
114
|
+
break;
|
|
115
|
+
case 'behavior_definition':
|
|
116
|
+
await client.unlockBehaviorDefinition(objectName, lock_handle);
|
|
117
|
+
break;
|
|
118
|
+
case 'metadata_extension':
|
|
119
|
+
await client.unlockMetadataExtension(objectName, lock_handle);
|
|
120
|
+
break;
|
|
121
|
+
case 'package':
|
|
122
|
+
// Package requires superPackage parameter - need to fetch it or handle differently
|
|
123
|
+
return (0, utils_1.return_error)(new Error('Package unlocking via UnlockObject is not supported. Use specific package operations.'));
|
|
124
|
+
default:
|
|
125
|
+
return (0, utils_1.return_error)(new Error(`Unsupported object_type: ${object_type}`));
|
|
126
|
+
}
|
|
127
|
+
// Get updated session state after unlock
|
|
128
|
+
const updatedSessionState = connection.getSessionState();
|
|
129
|
+
utils_1.logger.info(`✅ UnlockObject completed: ${objectName}`);
|
|
130
|
+
return (0, utils_1.return_response)({
|
|
131
|
+
data: JSON.stringify({
|
|
132
|
+
success: true,
|
|
133
|
+
object_name: objectName,
|
|
134
|
+
object_type: objectType,
|
|
135
|
+
session_id: session_id,
|
|
136
|
+
session_state: updatedSessionState ? {
|
|
137
|
+
cookies: updatedSessionState.cookies,
|
|
138
|
+
csrf_token: updatedSessionState.csrfToken,
|
|
139
|
+
cookie_store: updatedSessionState.cookieStore
|
|
140
|
+
} : null,
|
|
141
|
+
message: `Object ${objectName} unlocked successfully.`
|
|
142
|
+
}, null, 2)
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
utils_1.logger.error(`Error unlocking object ${objectName}:`, error);
|
|
147
|
+
// Parse error message
|
|
148
|
+
let errorMessage = `Failed to unlock object: ${error.message || String(error)}`;
|
|
149
|
+
if (error.response?.status === 404) {
|
|
150
|
+
errorMessage = `Object ${objectName} not found.`;
|
|
151
|
+
}
|
|
152
|
+
else if (error.response?.status === 400) {
|
|
153
|
+
errorMessage = `Invalid lock handle or session. Make sure you're using the same session_id and lock_handle from LockObject.`;
|
|
154
|
+
}
|
|
155
|
+
else if (error.response?.data && typeof error.response.data === 'string') {
|
|
156
|
+
try {
|
|
157
|
+
const { XMLParser } = require('fast-xml-parser');
|
|
158
|
+
const parser = new XMLParser({
|
|
159
|
+
ignoreAttributes: false,
|
|
160
|
+
attributeNamePrefix: '@_'
|
|
161
|
+
});
|
|
162
|
+
const errorData = parser.parse(error.response.data);
|
|
163
|
+
const errorMsg = errorData['exc:exception']?.message?.['#text'] || errorData['exc:exception']?.message;
|
|
164
|
+
if (errorMsg) {
|
|
165
|
+
errorMessage = `SAP Error: ${errorMsg}`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
catch (parseError) {
|
|
169
|
+
// Ignore parse errors
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return (0, utils_1.return_error)(new Error(errorMessage));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
return (0, utils_1.return_error)(error);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ValidateObject Handler - Validate ABAP object name via ADT API
|
|
3
|
+
*
|
|
4
|
+
* Uses validateObjectName from @mcp-abap-adt/adt-clients/core for all operations.
|
|
5
|
+
* Connection management handled internally.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TOOL_DEFINITION: {
|
|
8
|
+
readonly name: "ValidateObject";
|
|
9
|
+
readonly description: "Validate an ABAP object name before creation. Checks if the name is valid and available. Returns validation result with success status and message. Can use session_id and session_state from GetSession to maintain the same session.";
|
|
10
|
+
readonly inputSchema: {
|
|
11
|
+
readonly type: "object";
|
|
12
|
+
readonly properties: {
|
|
13
|
+
readonly object_name: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly description: "Object name to validate (e.g., ZCL_MY_CLASS, Z_MY_PROGRAM, ZIF_MY_INTERFACE)";
|
|
16
|
+
};
|
|
17
|
+
readonly object_type: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: "Object type: 'class', 'program', 'interface', 'function_group', 'table', 'structure', 'view', 'domain', 'data_element', 'package'";
|
|
20
|
+
readonly enum: readonly ["class", "program", "interface", "function_group", "table", "structure", "view", "domain", "data_element", "package"];
|
|
21
|
+
};
|
|
22
|
+
readonly session_id: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: "Session ID from GetSession. If not provided, a new session will be created.";
|
|
25
|
+
};
|
|
26
|
+
readonly session_state: {
|
|
27
|
+
readonly type: "object";
|
|
28
|
+
readonly description: "Session state from GetSession (cookies, csrf_token, cookie_store). Required if session_id is provided.";
|
|
29
|
+
readonly properties: {
|
|
30
|
+
readonly cookies: {
|
|
31
|
+
readonly type: "string";
|
|
32
|
+
};
|
|
33
|
+
readonly csrf_token: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
};
|
|
36
|
+
readonly cookie_store: {
|
|
37
|
+
readonly type: "object";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly required: readonly ["object_name", "object_type"];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Main handler for ValidateObject MCP tool
|
|
47
|
+
*
|
|
48
|
+
* Uses validateObjectName from @mcp-abap-adt/adt-clients/core for all operations
|
|
49
|
+
* Connection management handled internally
|
|
50
|
+
*/
|
|
51
|
+
export declare function handleValidateObject(args: any): Promise<{
|
|
52
|
+
isError: boolean;
|
|
53
|
+
content: {
|
|
54
|
+
type: string;
|
|
55
|
+
text: any;
|
|
56
|
+
}[];
|
|
57
|
+
}>;
|
|
58
|
+
//# sourceMappingURL=handleValidateObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleValidateObject.d.ts","sourceRoot":"","sources":["../../../src/handlers/common/handleValidateObject.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BlB,CAAC;AAaX;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,GAAG;;;;;;GA8InD"}
|