@mcp-abap-adt/adt-clients 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +184 -0
- package/bin/README.md +368 -0
- package/bin/lock-object.js +274 -0
- package/bin/manage-locks.js +331 -0
- package/bin/manage-sessions.js +235 -0
- package/bin/unlock-object.js +291 -0
- package/bin/unlock-test-objects.js +248 -0
- package/dist/clients/CrudClient.d.ts +48 -0
- package/dist/clients/CrudClient.d.ts.map +1 -0
- package/dist/clients/CrudClient.js +135 -0
- package/dist/clients/LockClient.d.ts +28 -0
- package/dist/clients/LockClient.d.ts.map +1 -0
- package/dist/clients/LockClient.js +141 -0
- package/dist/clients/ManagementClient.d.ts +34 -0
- package/dist/clients/ManagementClient.d.ts.map +1 -0
- package/dist/clients/ManagementClient.js +80 -0
- package/dist/clients/ReadOnlyClient.d.ts +70 -0
- package/dist/clients/ReadOnlyClient.d.ts.map +1 -0
- package/dist/clients/ReadOnlyClient.js +141 -0
- package/dist/clients/ValidationClient.d.ts +8 -0
- package/dist/clients/ValidationClient.d.ts.map +1 -0
- package/dist/clients/ValidationClient.js +14 -0
- package/dist/core/class/ClassBuilder.d.ts +140 -0
- package/dist/core/class/ClassBuilder.d.ts.map +1 -0
- package/dist/core/class/ClassBuilder.js +400 -0
- package/dist/core/class/activation.d.ts +11 -0
- package/dist/core/class/activation.d.ts.map +1 -0
- package/dist/core/class/activation.js +16 -0
- package/dist/core/class/check.d.ts +24 -0
- package/dist/core/class/check.d.ts.map +1 -0
- package/dist/core/class/check.js +73 -0
- package/dist/core/class/create.d.ts +30 -0
- package/dist/core/class/create.d.ts.map +1 -0
- package/dist/core/class/create.js +118 -0
- package/dist/core/class/index.d.ts +14 -0
- package/dist/core/class/index.d.ts.map +1 -0
- package/dist/core/class/index.js +31 -0
- package/dist/core/class/lock.d.ts +20 -0
- package/dist/core/class/lock.d.ts.map +1 -0
- package/dist/core/class/lock.js +49 -0
- package/dist/core/class/read.d.ts +34 -0
- package/dist/core/class/read.d.ts.map +1 -0
- package/dist/core/class/read.js +59 -0
- package/dist/core/class/run.d.ts +51 -0
- package/dist/core/class/run.d.ts.map +1 -0
- package/dist/core/class/run.js +105 -0
- package/dist/core/class/unlock.d.ts +11 -0
- package/dist/core/class/unlock.d.ts.map +1 -0
- package/dist/core/class/unlock.js +16 -0
- package/dist/core/class/update.d.ts +11 -0
- package/dist/core/class/update.d.ts.map +1 -0
- package/dist/core/class/update.js +30 -0
- package/dist/core/class/validation.d.ts +28 -0
- package/dist/core/class/validation.d.ts.map +1 -0
- package/dist/core/class/validation.js +269 -0
- package/dist/core/dataElement/DataElementBuilder.d.ts +113 -0
- package/dist/core/dataElement/DataElementBuilder.d.ts.map +1 -0
- package/dist/core/dataElement/DataElementBuilder.js +449 -0
- package/dist/core/dataElement/activation.d.ts +11 -0
- package/dist/core/dataElement/activation.d.ts.map +1 -0
- package/dist/core/dataElement/activation.js +123 -0
- package/dist/core/dataElement/check.d.ts +12 -0
- package/dist/core/dataElement/check.d.ts.map +1 -0
- package/dist/core/dataElement/check.js +32 -0
- package/dist/core/dataElement/create.d.ts +12 -0
- package/dist/core/dataElement/create.d.ts.map +1 -0
- package/dist/core/dataElement/create.js +259 -0
- package/dist/core/dataElement/delete.d.ts +14 -0
- package/dist/core/dataElement/delete.d.ts.map +1 -0
- package/dist/core/dataElement/delete.js +21 -0
- package/dist/core/dataElement/index.d.ts +14 -0
- package/dist/core/dataElement/index.d.ts.map +1 -0
- package/dist/core/dataElement/index.js +31 -0
- package/dist/core/dataElement/lock.d.ts +10 -0
- package/dist/core/dataElement/lock.d.ts.map +1 -0
- package/dist/core/dataElement/lock.js +31 -0
- package/dist/core/dataElement/read.d.ts +17 -0
- package/dist/core/dataElement/read.d.ts.map +1 -0
- package/dist/core/dataElement/read.js +42 -0
- package/dist/core/dataElement/types.d.ts +64 -0
- package/dist/core/dataElement/types.d.ts.map +1 -0
- package/dist/core/dataElement/types.js +5 -0
- package/dist/core/dataElement/unlock.d.ts +11 -0
- package/dist/core/dataElement/unlock.d.ts.map +1 -0
- package/dist/core/dataElement/unlock.js +17 -0
- package/dist/core/dataElement/update.d.ts +29 -0
- package/dist/core/dataElement/update.d.ts.map +1 -0
- package/dist/core/dataElement/update.js +269 -0
- package/dist/core/delete.d.ts +22 -0
- package/dist/core/delete.d.ts.map +1 -0
- package/dist/core/delete.js +148 -0
- package/dist/core/domain/DomainBuilder.d.ts +135 -0
- package/dist/core/domain/DomainBuilder.d.ts.map +1 -0
- package/dist/core/domain/DomainBuilder.js +430 -0
- package/dist/core/domain/activation.d.ts +11 -0
- package/dist/core/domain/activation.d.ts.map +1 -0
- package/dist/core/domain/activation.js +16 -0
- package/dist/core/domain/check.d.ts +16 -0
- package/dist/core/domain/check.d.ts.map +1 -0
- package/dist/core/domain/check.js +36 -0
- package/dist/core/domain/create.d.ts +21 -0
- package/dist/core/domain/create.d.ts.map +1 -0
- package/dist/core/domain/create.js +172 -0
- package/dist/core/domain/delete.d.ts +14 -0
- package/dist/core/domain/delete.d.ts.map +1 -0
- package/dist/core/domain/delete.js +21 -0
- package/dist/core/domain/index.d.ts +14 -0
- package/dist/core/domain/index.d.ts.map +1 -0
- package/dist/core/domain/index.js +31 -0
- package/dist/core/domain/lock.d.ts +15 -0
- package/dist/core/domain/lock.d.ts.map +1 -0
- package/dist/core/domain/lock.js +61 -0
- package/dist/core/domain/read.d.ts +17 -0
- package/dist/core/domain/read.d.ts.map +1 -0
- package/dist/core/domain/read.js +42 -0
- package/dist/core/domain/types.d.ts +38 -0
- package/dist/core/domain/types.d.ts.map +1 -0
- package/dist/core/domain/types.js +5 -0
- package/dist/core/domain/unlock.d.ts +11 -0
- package/dist/core/domain/unlock.d.ts.map +1 -0
- package/dist/core/domain/unlock.js +17 -0
- package/dist/core/domain/update.d.ts +12 -0
- package/dist/core/domain/update.d.ts.map +1 -0
- package/dist/core/domain/update.js +144 -0
- package/dist/core/functionGroup/FunctionGroupBuilder.d.ts +91 -0
- package/dist/core/functionGroup/FunctionGroupBuilder.d.ts.map +1 -0
- package/dist/core/functionGroup/FunctionGroupBuilder.js +268 -0
- package/dist/core/functionGroup/activation.d.ts +10 -0
- package/dist/core/functionGroup/activation.d.ts.map +1 -0
- package/dist/core/functionGroup/activation.js +30 -0
- package/dist/core/functionGroup/check.d.ts +24 -0
- package/dist/core/functionGroup/check.d.ts.map +1 -0
- package/dist/core/functionGroup/check.js +91 -0
- package/dist/core/functionGroup/create.d.ts +12 -0
- package/dist/core/functionGroup/create.d.ts.map +1 -0
- package/dist/core/functionGroup/create.js +90 -0
- package/dist/core/functionGroup/delete.d.ts +14 -0
- package/dist/core/functionGroup/delete.d.ts.map +1 -0
- package/dist/core/functionGroup/delete.js +21 -0
- package/dist/core/functionGroup/index.d.ts +15 -0
- package/dist/core/functionGroup/index.d.ts.map +1 -0
- package/dist/core/functionGroup/index.js +32 -0
- package/dist/core/functionGroup/lock.d.ts +25 -0
- package/dist/core/functionGroup/lock.d.ts.map +1 -0
- package/dist/core/functionGroup/lock.js +50 -0
- package/dist/core/functionGroup/read.d.ts +17 -0
- package/dist/core/functionGroup/read.d.ts.map +1 -0
- package/dist/core/functionGroup/read.js +42 -0
- package/dist/core/functionGroup/types.d.ts +11 -0
- package/dist/core/functionGroup/types.d.ts.map +1 -0
- package/dist/core/functionGroup/types.js +5 -0
- package/dist/core/functionGroup/unlock.d.ts +5 -0
- package/dist/core/functionGroup/unlock.d.ts.map +1 -0
- package/dist/core/functionGroup/unlock.js +8 -0
- package/dist/core/functionGroup/update.d.ts +20 -0
- package/dist/core/functionGroup/update.d.ts.map +1 -0
- package/dist/core/functionGroup/update.js +119 -0
- package/dist/core/functionGroup/validation.d.ts +10 -0
- package/dist/core/functionGroup/validation.d.ts.map +1 -0
- package/dist/core/functionGroup/validation.js +17 -0
- package/dist/core/functionModule/FunctionModuleBuilder.d.ts +101 -0
- package/dist/core/functionModule/FunctionModuleBuilder.d.ts.map +1 -0
- package/dist/core/functionModule/FunctionModuleBuilder.js +314 -0
- package/dist/core/functionModule/activation.d.ts +10 -0
- package/dist/core/functionModule/activation.d.ts.map +1 -0
- package/dist/core/functionModule/activation.js +17 -0
- package/dist/core/functionModule/check.d.ts +23 -0
- package/dist/core/functionModule/check.d.ts.map +1 -0
- package/dist/core/functionModule/check.js +116 -0
- package/dist/core/functionModule/create.d.ts +12 -0
- package/dist/core/functionModule/create.d.ts.map +1 -0
- package/dist/core/functionModule/create.js +158 -0
- package/dist/core/functionModule/delete.d.ts +15 -0
- package/dist/core/functionModule/delete.d.ts.map +1 -0
- package/dist/core/functionModule/delete.js +25 -0
- package/dist/core/functionModule/index.d.ts +15 -0
- package/dist/core/functionModule/index.d.ts.map +1 -0
- package/dist/core/functionModule/index.js +32 -0
- package/dist/core/functionModule/lock.d.ts +18 -0
- package/dist/core/functionModule/lock.d.ts.map +1 -0
- package/dist/core/functionModule/lock.js +52 -0
- package/dist/core/functionModule/read.d.ts +31 -0
- package/dist/core/functionModule/read.d.ts.map +1 -0
- package/dist/core/functionModule/read.js +57 -0
- package/dist/core/functionModule/types.d.ts +19 -0
- package/dist/core/functionModule/types.d.ts.map +1 -0
- package/dist/core/functionModule/types.js +5 -0
- package/dist/core/functionModule/unlock.d.ts +10 -0
- package/dist/core/functionModule/unlock.d.ts.map +1 -0
- package/dist/core/functionModule/unlock.js +20 -0
- package/dist/core/functionModule/update.d.ts +17 -0
- package/dist/core/functionModule/update.d.ts.map +1 -0
- package/dist/core/functionModule/update.js +103 -0
- package/dist/core/functionModule/validation.d.ts +27 -0
- package/dist/core/functionModule/validation.d.ts.map +1 -0
- package/dist/core/functionModule/validation.js +107 -0
- package/dist/core/interface/InterfaceBuilder.d.ts +98 -0
- package/dist/core/interface/InterfaceBuilder.d.ts.map +1 -0
- package/dist/core/interface/InterfaceBuilder.js +311 -0
- package/dist/core/interface/activation.d.ts +11 -0
- package/dist/core/interface/activation.d.ts.map +1 -0
- package/dist/core/interface/activation.js +16 -0
- package/dist/core/interface/check.d.ts +10 -0
- package/dist/core/interface/check.d.ts.map +1 -0
- package/dist/core/interface/check.js +18 -0
- package/dist/core/interface/create.d.ts +12 -0
- package/dist/core/interface/create.d.ts.map +1 -0
- package/dist/core/interface/create.js +119 -0
- package/dist/core/interface/delete.d.ts +20 -0
- package/dist/core/interface/delete.d.ts.map +1 -0
- package/dist/core/interface/delete.js +47 -0
- package/dist/core/interface/index.d.ts +15 -0
- package/dist/core/interface/index.d.ts.map +1 -0
- package/dist/core/interface/index.js +32 -0
- package/dist/core/interface/lock.d.ts +23 -0
- package/dist/core/interface/lock.d.ts.map +1 -0
- package/dist/core/interface/lock.js +51 -0
- package/dist/core/interface/read.d.ts +26 -0
- package/dist/core/interface/read.d.ts.map +1 -0
- package/dist/core/interface/read.js +51 -0
- package/dist/core/interface/types.d.ts +19 -0
- package/dist/core/interface/types.d.ts.map +1 -0
- package/dist/core/interface/types.js +5 -0
- package/dist/core/interface/unlock.d.ts +11 -0
- package/dist/core/interface/unlock.d.ts.map +1 -0
- package/dist/core/interface/unlock.js +35 -0
- package/dist/core/interface/update.d.ts +12 -0
- package/dist/core/interface/update.d.ts.map +1 -0
- package/dist/core/interface/update.js +82 -0
- package/dist/core/interface/validation.d.ts +10 -0
- package/dist/core/interface/validation.d.ts.map +1 -0
- package/dist/core/interface/validation.js +17 -0
- package/dist/core/managementOperations.d.ts +34 -0
- package/dist/core/managementOperations.d.ts.map +1 -0
- package/dist/core/managementOperations.js +136 -0
- package/dist/core/package/PackageBuilder.d.ts +129 -0
- package/dist/core/package/PackageBuilder.d.ts.map +1 -0
- package/dist/core/package/PackageBuilder.js +386 -0
- package/dist/core/package/check.d.ts +9 -0
- package/dist/core/package/check.d.ts.map +1 -0
- package/dist/core/package/check.js +29 -0
- package/dist/core/package/create.d.ts +12 -0
- package/dist/core/package/create.d.ts.map +1 -0
- package/dist/core/package/create.js +145 -0
- package/dist/core/package/delete.d.ts +27 -0
- package/dist/core/package/delete.d.ts.map +1 -0
- package/dist/core/package/delete.js +138 -0
- package/dist/core/package/index.d.ts +15 -0
- package/dist/core/package/index.d.ts.map +1 -0
- package/dist/core/package/index.js +32 -0
- package/dist/core/package/lock.d.ts +10 -0
- package/dist/core/package/lock.d.ts.map +1 -0
- package/dist/core/package/lock.js +28 -0
- package/dist/core/package/read.d.ts +17 -0
- package/dist/core/package/read.d.ts.map +1 -0
- package/dist/core/package/read.js +42 -0
- package/dist/core/package/transportCheck.d.ts +10 -0
- package/dist/core/package/transportCheck.d.ts.map +1 -0
- package/dist/core/package/transportCheck.js +52 -0
- package/dist/core/package/types.d.ts +15 -0
- package/dist/core/package/types.d.ts.map +1 -0
- package/dist/core/package/types.js +5 -0
- package/dist/core/package/unlock.d.ts +11 -0
- package/dist/core/package/unlock.d.ts.map +1 -0
- package/dist/core/package/unlock.js +16 -0
- package/dist/core/package/update.d.ts +19 -0
- package/dist/core/package/update.d.ts.map +1 -0
- package/dist/core/package/update.js +125 -0
- package/dist/core/package/validation.d.ts +14 -0
- package/dist/core/package/validation.d.ts.map +1 -0
- package/dist/core/package/validation.js +72 -0
- package/dist/core/program/ProgramBuilder.d.ts +102 -0
- package/dist/core/program/ProgramBuilder.d.ts.map +1 -0
- package/dist/core/program/ProgramBuilder.js +321 -0
- package/dist/core/program/activation.d.ts +11 -0
- package/dist/core/program/activation.d.ts.map +1 -0
- package/dist/core/program/activation.js +16 -0
- package/dist/core/program/check.d.ts +10 -0
- package/dist/core/program/check.d.ts.map +1 -0
- package/dist/core/program/check.js +18 -0
- package/dist/core/program/create.d.ts +23 -0
- package/dist/core/program/create.d.ts.map +1 -0
- package/dist/core/program/create.js +159 -0
- package/dist/core/program/delete.d.ts +14 -0
- package/dist/core/program/delete.d.ts.map +1 -0
- package/dist/core/program/delete.js +21 -0
- package/dist/core/program/index.d.ts +14 -0
- package/dist/core/program/index.d.ts.map +1 -0
- package/dist/core/program/index.js +31 -0
- package/dist/core/program/lock.d.ts +20 -0
- package/dist/core/program/lock.d.ts.map +1 -0
- package/dist/core/program/lock.js +49 -0
- package/dist/core/program/read.d.ts +26 -0
- package/dist/core/program/read.d.ts.map +1 -0
- package/dist/core/program/read.js +51 -0
- package/dist/core/program/unlock.d.ts +11 -0
- package/dist/core/program/unlock.d.ts.map +1 -0
- package/dist/core/program/unlock.js +16 -0
- package/dist/core/program/update.d.ts +16 -0
- package/dist/core/program/update.d.ts.map +1 -0
- package/dist/core/program/update.js +82 -0
- package/dist/core/program/validation.d.ts +10 -0
- package/dist/core/program/validation.d.ts.map +1 -0
- package/dist/core/program/validation.js +17 -0
- package/dist/core/readOperations.d.ts +63 -0
- package/dist/core/readOperations.d.ts.map +1 -0
- package/dist/core/readOperations.js +204 -0
- package/dist/core/shared/checkRun.d.ts +68 -0
- package/dist/core/shared/checkRun.d.ts.map +1 -0
- package/dist/core/shared/checkRun.js +292 -0
- package/dist/core/shared/readMetadata.d.ts +16 -0
- package/dist/core/shared/readMetadata.d.ts.map +1 -0
- package/dist/core/shared/readMetadata.js +74 -0
- package/dist/core/shared/readSource.d.ts +21 -0
- package/dist/core/shared/readSource.d.ts.map +1 -0
- package/dist/core/shared/readSource.js +83 -0
- package/dist/core/shared/search.d.ts +26 -0
- package/dist/core/shared/search.d.ts.map +1 -0
- package/dist/core/shared/search.js +32 -0
- package/dist/core/shared/sqlQuery.d.ts +22 -0
- package/dist/core/shared/sqlQuery.d.ts.map +1 -0
- package/dist/core/shared/sqlQuery.js +36 -0
- package/dist/core/shared/systemInfo.d.ts +22 -0
- package/dist/core/shared/systemInfo.d.ts.map +1 -0
- package/dist/core/shared/systemInfo.js +67 -0
- package/dist/core/shared/tableContents.d.ts +22 -0
- package/dist/core/shared/tableContents.d.ts.map +1 -0
- package/dist/core/shared/tableContents.js +89 -0
- package/dist/core/shared/validation.d.ts +26 -0
- package/dist/core/shared/validation.d.ts.map +1 -0
- package/dist/core/shared/validation.js +134 -0
- package/dist/core/shared/whereUsed.d.ts +19 -0
- package/dist/core/shared/whereUsed.d.ts.map +1 -0
- package/dist/core/shared/whereUsed.js +88 -0
- package/dist/core/structure/StructureBuilder.d.ts +124 -0
- package/dist/core/structure/StructureBuilder.d.ts.map +1 -0
- package/dist/core/structure/StructureBuilder.js +357 -0
- package/dist/core/structure/activation.d.ts +10 -0
- package/dist/core/structure/activation.d.ts.map +1 -0
- package/dist/core/structure/activation.js +15 -0
- package/dist/core/structure/check.d.ts +12 -0
- package/dist/core/structure/check.d.ts.map +1 -0
- package/dist/core/structure/check.js +44 -0
- package/dist/core/structure/create.d.ts +12 -0
- package/dist/core/structure/create.d.ts.map +1 -0
- package/dist/core/structure/create.js +136 -0
- package/dist/core/structure/delete.d.ts +14 -0
- package/dist/core/structure/delete.d.ts.map +1 -0
- package/dist/core/structure/delete.js +21 -0
- package/dist/core/structure/index.d.ts +15 -0
- package/dist/core/structure/index.d.ts.map +1 -0
- package/dist/core/structure/index.js +32 -0
- package/dist/core/structure/lock.d.ts +10 -0
- package/dist/core/structure/lock.d.ts.map +1 -0
- package/dist/core/structure/lock.js +28 -0
- package/dist/core/structure/read.d.ts +26 -0
- package/dist/core/structure/read.d.ts.map +1 -0
- package/dist/core/structure/read.js +51 -0
- package/dist/core/structure/types.d.ts +33 -0
- package/dist/core/structure/types.d.ts.map +1 -0
- package/dist/core/structure/types.js +5 -0
- package/dist/core/structure/unlock.d.ts +11 -0
- package/dist/core/structure/unlock.d.ts.map +1 -0
- package/dist/core/structure/unlock.js +16 -0
- package/dist/core/structure/update.d.ts +11 -0
- package/dist/core/structure/update.d.ts.map +1 -0
- package/dist/core/structure/update.js +26 -0
- package/dist/core/structure/validation.d.ts +10 -0
- package/dist/core/structure/validation.d.ts.map +1 -0
- package/dist/core/structure/validation.js +17 -0
- package/dist/core/table/TableBuilder.d.ts +115 -0
- package/dist/core/table/TableBuilder.d.ts.map +1 -0
- package/dist/core/table/TableBuilder.js +328 -0
- package/dist/core/table/activation.d.ts +10 -0
- package/dist/core/table/activation.d.ts.map +1 -0
- package/dist/core/table/activation.js +15 -0
- package/dist/core/table/check.d.ts +11 -0
- package/dist/core/table/check.d.ts.map +1 -0
- package/dist/core/table/check.js +30 -0
- package/dist/core/table/create.d.ts +12 -0
- package/dist/core/table/create.d.ts.map +1 -0
- package/dist/core/table/create.js +182 -0
- package/dist/core/table/delete.d.ts +14 -0
- package/dist/core/table/delete.d.ts.map +1 -0
- package/dist/core/table/delete.js +21 -0
- package/dist/core/table/index.d.ts +15 -0
- package/dist/core/table/index.d.ts.map +1 -0
- package/dist/core/table/index.js +32 -0
- package/dist/core/table/lock.d.ts +9 -0
- package/dist/core/table/lock.d.ts.map +1 -0
- package/dist/core/table/lock.js +29 -0
- package/dist/core/table/read.d.ts +26 -0
- package/dist/core/table/read.d.ts.map +1 -0
- package/dist/core/table/read.js +51 -0
- package/dist/core/table/types.d.ts +10 -0
- package/dist/core/table/types.d.ts.map +1 -0
- package/dist/core/table/types.js +5 -0
- package/dist/core/table/unlock.d.ts +15 -0
- package/dist/core/table/unlock.d.ts.map +1 -0
- package/dist/core/table/unlock.js +32 -0
- package/dist/core/table/update.d.ts +16 -0
- package/dist/core/table/update.d.ts.map +1 -0
- package/dist/core/table/update.js +32 -0
- package/dist/core/table/validation.d.ts +10 -0
- package/dist/core/table/validation.d.ts.map +1 -0
- package/dist/core/table/validation.js +17 -0
- package/dist/core/transport/TransportBuilder.d.ts +85 -0
- package/dist/core/transport/TransportBuilder.d.ts.map +1 -0
- package/dist/core/transport/TransportBuilder.js +154 -0
- package/dist/core/transport/create.d.ts +11 -0
- package/dist/core/transport/create.d.ts.map +1 -0
- package/dist/core/transport/create.js +157 -0
- package/dist/core/transport/index.d.ts +8 -0
- package/dist/core/transport/index.d.ts.map +1 -0
- package/dist/core/transport/index.js +25 -0
- package/dist/core/transport/read.d.ts +10 -0
- package/dist/core/transport/read.d.ts.map +1 -0
- package/dist/core/transport/read.js +22 -0
- package/dist/core/transport/types.d.ts +10 -0
- package/dist/core/transport/types.d.ts.map +1 -0
- package/dist/core/transport/types.js +5 -0
- package/dist/core/view/ViewBuilder.d.ts +117 -0
- package/dist/core/view/ViewBuilder.d.ts.map +1 -0
- package/dist/core/view/ViewBuilder.js +335 -0
- package/dist/core/view/activation.d.ts +10 -0
- package/dist/core/view/activation.d.ts.map +1 -0
- package/dist/core/view/activation.js +15 -0
- package/dist/core/view/check.d.ts +7 -0
- package/dist/core/view/check.d.ts.map +1 -0
- package/dist/core/view/check.js +57 -0
- package/dist/core/view/create.d.ts +12 -0
- package/dist/core/view/create.d.ts.map +1 -0
- package/dist/core/view/create.js +88 -0
- package/dist/core/view/delete.d.ts +14 -0
- package/dist/core/view/delete.d.ts.map +1 -0
- package/dist/core/view/delete.js +21 -0
- package/dist/core/view/index.d.ts +15 -0
- package/dist/core/view/index.d.ts.map +1 -0
- package/dist/core/view/index.js +32 -0
- package/dist/core/view/lock.d.ts +18 -0
- package/dist/core/view/lock.d.ts.map +1 -0
- package/dist/core/view/lock.js +45 -0
- package/dist/core/view/read.d.ts +26 -0
- package/dist/core/view/read.d.ts.map +1 -0
- package/dist/core/view/read.js +51 -0
- package/dist/core/view/types.d.ts +19 -0
- package/dist/core/view/types.d.ts.map +1 -0
- package/dist/core/view/types.js +5 -0
- package/dist/core/view/unlock.d.ts +10 -0
- package/dist/core/view/unlock.d.ts.map +1 -0
- package/dist/core/view/unlock.js +15 -0
- package/dist/core/view/update.d.ts +12 -0
- package/dist/core/view/update.d.ts.map +1 -0
- package/dist/core/view/update.js +89 -0
- package/dist/core/view/validation.d.ts +10 -0
- package/dist/core/view/validation.d.ts.map +1 -0
- package/dist/core/view/validation.js +17 -0
- package/dist/core.d.ts +133 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +175 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/utils/activationUtils.d.ts +44 -0
- package/dist/utils/activationUtils.d.ts.map +1 -0
- package/dist/utils/activationUtils.js +127 -0
- package/dist/utils/internalUtils.d.ts +12 -0
- package/dist/utils/internalUtils.d.ts.map +1 -0
- package/dist/utils/internalUtils.js +16 -0
- package/dist/utils/lockStateManager.d.ts +64 -0
- package/dist/utils/lockStateManager.d.ts.map +1 -0
- package/dist/utils/lockStateManager.js +172 -0
- package/dist/utils/sessionUtils.d.ts +69 -0
- package/dist/utils/sessionUtils.d.ts.map +1 -0
- package/dist/utils/sessionUtils.js +134 -0
- package/package.json +75 -0
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DataElementBuilder - Fluent API for data element operations with Promise chaining
|
|
4
|
+
*
|
|
5
|
+
* Supports:
|
|
6
|
+
* - Method chaining: builder.create().then(b => b.lock()).then(b => b.update())...
|
|
7
|
+
* - Error handling: .catch() for error callbacks
|
|
8
|
+
* - Cleanup: .finally() for guaranteed execution
|
|
9
|
+
* - Result storage: all results stored in logger/state
|
|
10
|
+
* - Chain interruption: chain stops on first error (standard Promise behavior)
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.DataElementBuilder = void 0;
|
|
14
|
+
const sessionUtils_1 = require("../../utils/sessionUtils");
|
|
15
|
+
const create_1 = require("./create");
|
|
16
|
+
const read_1 = require("./read");
|
|
17
|
+
const lock_1 = require("./lock");
|
|
18
|
+
const update_1 = require("./update");
|
|
19
|
+
const check_1 = require("./check");
|
|
20
|
+
const unlock_1 = require("./unlock");
|
|
21
|
+
const activation_1 = require("./activation");
|
|
22
|
+
const validation_1 = require("../shared/validation");
|
|
23
|
+
class DataElementBuilder {
|
|
24
|
+
connection;
|
|
25
|
+
logger;
|
|
26
|
+
config;
|
|
27
|
+
lockHandle;
|
|
28
|
+
sessionId;
|
|
29
|
+
state;
|
|
30
|
+
constructor(connection, logger, config) {
|
|
31
|
+
this.connection = connection;
|
|
32
|
+
this.logger = logger;
|
|
33
|
+
this.config = { ...config };
|
|
34
|
+
this.sessionId = config.sessionId || (0, sessionUtils_1.generateSessionId)();
|
|
35
|
+
this.state = {
|
|
36
|
+
errors: []
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// Builder methods - return this for chaining
|
|
40
|
+
setPackage(packageName) {
|
|
41
|
+
this.config.packageName = packageName;
|
|
42
|
+
this.logger.debug?.('Package set:', packageName);
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
setRequest(transportRequest) {
|
|
46
|
+
this.config.transportRequest = transportRequest;
|
|
47
|
+
this.logger.debug?.('Transport request set:', transportRequest);
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
setName(dataElementName) {
|
|
51
|
+
this.config.dataElementName = dataElementName;
|
|
52
|
+
this.logger.debug?.('Data element name set:', dataElementName);
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
setDescription(description) {
|
|
56
|
+
this.config.description = description;
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
setDomainName(domainName) {
|
|
60
|
+
this.config.domainName = domainName;
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
setDataType(dataType) {
|
|
64
|
+
this.config.dataType = dataType;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
setLength(length) {
|
|
68
|
+
this.config.length = length;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
setDecimals(decimals) {
|
|
72
|
+
this.config.decimals = decimals;
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
setShortLabel(shortLabel) {
|
|
76
|
+
this.config.shortLabel = shortLabel;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
setMediumLabel(mediumLabel) {
|
|
80
|
+
this.config.mediumLabel = mediumLabel;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
setLongLabel(longLabel) {
|
|
84
|
+
this.config.longLabel = longLabel;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
setHeadingLabel(headingLabel) {
|
|
88
|
+
this.config.headingLabel = headingLabel;
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
setTypeKind(typeKind) {
|
|
92
|
+
this.config.typeKind = typeKind;
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
setTypeName(typeName) {
|
|
96
|
+
this.config.typeName = typeName;
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
// Operation methods - return Promise<this> for Promise chaining
|
|
100
|
+
async validate() {
|
|
101
|
+
try {
|
|
102
|
+
this.logger.info?.('Validating data element name:', this.config.dataElementName);
|
|
103
|
+
const result = await (0, validation_1.validateObjectName)(this.connection, 'DTEL/DE', this.config.dataElementName, this.config.packageName ? { packagename: this.config.packageName } : undefined);
|
|
104
|
+
this.state.validationResult = result;
|
|
105
|
+
if (!result.valid) {
|
|
106
|
+
// Check if error is about object already existing (common in tests)
|
|
107
|
+
const errorMsg = result.message || '';
|
|
108
|
+
if (errorMsg.toLowerCase().includes('already exists') ||
|
|
109
|
+
errorMsg.toLowerCase().includes('does already exist') ||
|
|
110
|
+
errorMsg.toLowerCase().includes('resource') && errorMsg.toLowerCase().includes('exist')) {
|
|
111
|
+
// Object exists - this is OK for tests, just log warning
|
|
112
|
+
this.logger.warn?.('Data element already exists, validation skipped:', this.config.dataElementName);
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
throw new Error(`Data element name validation failed: ${errorMsg || 'Invalid data element name'}`);
|
|
116
|
+
}
|
|
117
|
+
this.logger.info?.('Data element name validation successful');
|
|
118
|
+
return this;
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
// If validation endpoint returns 400 and it's about object existing, that's OK for tests
|
|
122
|
+
if (error.response?.status === 400) {
|
|
123
|
+
const errorData = error.response?.data;
|
|
124
|
+
const errorText = typeof errorData === 'string' ? errorData : JSON.stringify(errorData || {});
|
|
125
|
+
if (errorText.toLowerCase().includes('already exists') ||
|
|
126
|
+
errorText.toLowerCase().includes('does already exist') ||
|
|
127
|
+
errorText.toLowerCase().includes('resource') && errorText.toLowerCase().includes('exist')) {
|
|
128
|
+
this.logger.warn?.('Data element already exists, validation skipped:', this.config.dataElementName);
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// If validation is not supported for this object type, skip it (log warning)
|
|
133
|
+
const errorMsg = error.message || '';
|
|
134
|
+
const errorData = error.response?.data;
|
|
135
|
+
const errorText = typeof errorData === 'string' ? errorData : JSON.stringify(errorData || {});
|
|
136
|
+
if (errorMsg.toLowerCase().includes('not supported') ||
|
|
137
|
+
errorText.toLowerCase().includes('not supported') ||
|
|
138
|
+
errorMsg.toLowerCase().includes('object type') && errorMsg.toLowerCase().includes('not supported')) {
|
|
139
|
+
this.logger.warn?.('Validation not supported for DTEL/DE in this SAP system, skipping:', this.config.dataElementName);
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
142
|
+
this.state.errors.push({
|
|
143
|
+
method: 'validate',
|
|
144
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
145
|
+
timestamp: new Date()
|
|
146
|
+
});
|
|
147
|
+
this.logger.error?.('Validation failed:', error);
|
|
148
|
+
// If validation result exists, use its message
|
|
149
|
+
if (this.state.validationResult && !this.state.validationResult.valid) {
|
|
150
|
+
throw new Error(`Data element name validation failed: ${this.state.validationResult.message || 'Invalid data element name'}`);
|
|
151
|
+
}
|
|
152
|
+
throw error; // Interrupts chain
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async read() {
|
|
156
|
+
try {
|
|
157
|
+
this.logger.info?.('Reading data element:', this.config.dataElementName);
|
|
158
|
+
const result = await (0, read_1.getDataElement)(this.connection, this.config.dataElementName);
|
|
159
|
+
this.state.readResult = result;
|
|
160
|
+
this.logger.info?.('Data element read successfully:', result.status);
|
|
161
|
+
return this;
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
this.state.errors.push({
|
|
165
|
+
method: 'read',
|
|
166
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
167
|
+
timestamp: new Date()
|
|
168
|
+
});
|
|
169
|
+
this.logger.error?.('Read failed:', error);
|
|
170
|
+
throw error; // Interrupts chain
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
async create() {
|
|
174
|
+
try {
|
|
175
|
+
if (!this.config.packageName) {
|
|
176
|
+
throw new Error('Package name is required');
|
|
177
|
+
}
|
|
178
|
+
if (!this.config.typeKind) {
|
|
179
|
+
throw new Error('typeKind is required in DataElementBuilderConfig. Must be one of: domain, predefinedAbapType, refToPredefinedAbapType, refToDictionaryType, refToClifType');
|
|
180
|
+
}
|
|
181
|
+
const typeKind = this.config.typeKind;
|
|
182
|
+
if (typeKind === 'domain' && !this.config.domainName) {
|
|
183
|
+
throw new Error('Domain name is required for domain-based data elements');
|
|
184
|
+
}
|
|
185
|
+
this.logger.info?.('Creating data element:', this.config.dataElementName);
|
|
186
|
+
const params = {
|
|
187
|
+
data_element_name: this.config.dataElementName,
|
|
188
|
+
package_name: this.config.packageName,
|
|
189
|
+
transport_request: this.config.transportRequest,
|
|
190
|
+
description: this.config.description,
|
|
191
|
+
domain_name: this.config.domainName,
|
|
192
|
+
type_kind: typeKind,
|
|
193
|
+
type_name: this.config.typeName,
|
|
194
|
+
data_type: this.config.dataType,
|
|
195
|
+
length: this.config.length,
|
|
196
|
+
decimals: this.config.decimals,
|
|
197
|
+
short_label: this.config.shortLabel,
|
|
198
|
+
medium_label: this.config.mediumLabel,
|
|
199
|
+
long_label: this.config.longLabel,
|
|
200
|
+
heading_label: this.config.headingLabel
|
|
201
|
+
};
|
|
202
|
+
const result = await (0, create_1.createDataElement)(this.connection, params);
|
|
203
|
+
this.state.createResult = result;
|
|
204
|
+
this.logger.info?.('Data element created successfully:', result.status);
|
|
205
|
+
return this;
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
this.state.errors.push({
|
|
209
|
+
method: 'create',
|
|
210
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
211
|
+
timestamp: new Date()
|
|
212
|
+
});
|
|
213
|
+
this.logger.error?.('Create failed:', error);
|
|
214
|
+
throw error; // Interrupts chain
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
async lock() {
|
|
218
|
+
try {
|
|
219
|
+
this.logger.info?.('Locking data element:', this.config.dataElementName);
|
|
220
|
+
const lockHandle = await (0, lock_1.lockDataElement)(this.connection, this.config.dataElementName, this.sessionId);
|
|
221
|
+
this.lockHandle = lockHandle;
|
|
222
|
+
this.state.lockHandle = lockHandle;
|
|
223
|
+
// Register lock in persistent storage if callback provided
|
|
224
|
+
if (this.config.onLock) {
|
|
225
|
+
this.config.onLock(lockHandle, this.sessionId);
|
|
226
|
+
}
|
|
227
|
+
this.logger.info?.('Data element locked, handle:', lockHandle.substring(0, 10) + '...');
|
|
228
|
+
return this;
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
this.state.errors.push({
|
|
232
|
+
method: 'lock',
|
|
233
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
234
|
+
timestamp: new Date()
|
|
235
|
+
});
|
|
236
|
+
this.logger.error?.('Lock failed:', error);
|
|
237
|
+
throw error; // Interrupts chain
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
async update() {
|
|
241
|
+
try {
|
|
242
|
+
if (!this.lockHandle) {
|
|
243
|
+
throw new Error('Data element must be locked before update. Call lock() first.');
|
|
244
|
+
}
|
|
245
|
+
if (!this.config.packageName) {
|
|
246
|
+
throw new Error('Package name is required');
|
|
247
|
+
}
|
|
248
|
+
if (!this.config.typeKind) {
|
|
249
|
+
throw new Error('typeKind is required in DataElementBuilderConfig. Must be one of: domain, predefinedAbapType, refToPredefinedAbapType, refToDictionaryType, refToClifType');
|
|
250
|
+
}
|
|
251
|
+
const typeKind = this.config.typeKind;
|
|
252
|
+
this.logger.info?.('Updating data element:', this.config.dataElementName);
|
|
253
|
+
const username = process.env.SAP_USER || process.env.SAP_USERNAME || 'MPCUSER';
|
|
254
|
+
let domainInfo = { dataType: 'CHAR', length: 100, decimals: 0 };
|
|
255
|
+
if (typeKind === 'domain') {
|
|
256
|
+
const domainName = this.config.typeName || this.config.domainName || 'CHAR100';
|
|
257
|
+
domainInfo = await (0, update_1.getDomainInfo)(this.connection, domainName);
|
|
258
|
+
}
|
|
259
|
+
else if (typeKind === 'predefinedAbapType') {
|
|
260
|
+
domainInfo = {
|
|
261
|
+
dataType: this.config.dataType || 'CHAR',
|
|
262
|
+
length: this.config.length || 100,
|
|
263
|
+
decimals: this.config.decimals || 0
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
const params = {
|
|
267
|
+
data_element_name: this.config.dataElementName,
|
|
268
|
+
package_name: this.config.packageName,
|
|
269
|
+
transport_request: this.config.transportRequest,
|
|
270
|
+
description: this.config.description,
|
|
271
|
+
domain_name: this.config.domainName,
|
|
272
|
+
type_kind: typeKind,
|
|
273
|
+
type_name: this.config.typeName,
|
|
274
|
+
data_type: this.config.dataType,
|
|
275
|
+
length: this.config.length,
|
|
276
|
+
decimals: this.config.decimals,
|
|
277
|
+
short_label: this.config.shortLabel,
|
|
278
|
+
medium_label: this.config.mediumLabel,
|
|
279
|
+
long_label: this.config.longLabel,
|
|
280
|
+
heading_label: this.config.headingLabel,
|
|
281
|
+
activate: false // Don't activate in low-level function
|
|
282
|
+
};
|
|
283
|
+
const result = await (0, update_1.updateDataElementInternal)(this.connection, params, this.lockHandle, this.sessionId, username, domainInfo);
|
|
284
|
+
this.state.updateResult = {
|
|
285
|
+
data: {
|
|
286
|
+
success: true,
|
|
287
|
+
data_element_name: params.data_element_name,
|
|
288
|
+
package: params.package_name,
|
|
289
|
+
transport_request: params.transport_request,
|
|
290
|
+
status: 'inactive',
|
|
291
|
+
session_id: this.sessionId,
|
|
292
|
+
message: `Data element ${params.data_element_name} updated successfully`
|
|
293
|
+
},
|
|
294
|
+
status: result.status,
|
|
295
|
+
statusText: result.statusText,
|
|
296
|
+
headers: result.headers,
|
|
297
|
+
config: result.config
|
|
298
|
+
};
|
|
299
|
+
this.logger.info?.('Data element updated successfully:', result.status);
|
|
300
|
+
return this;
|
|
301
|
+
}
|
|
302
|
+
catch (error) {
|
|
303
|
+
this.state.errors.push({
|
|
304
|
+
method: 'update',
|
|
305
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
306
|
+
timestamp: new Date()
|
|
307
|
+
});
|
|
308
|
+
this.logger.error?.('Update failed:', error);
|
|
309
|
+
throw error; // Interrupts chain
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
async check(version = 'inactive') {
|
|
313
|
+
try {
|
|
314
|
+
this.logger.info?.('Checking data element:', this.config.dataElementName, 'version:', version);
|
|
315
|
+
const result = await (0, check_1.checkDataElement)(this.connection, this.config.dataElementName, version, this.sessionId);
|
|
316
|
+
this.state.checkResult = result;
|
|
317
|
+
this.logger.info?.('Data element check successful:', result.status);
|
|
318
|
+
return this;
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
// For DDIC objects, check may not be fully supported - log warning but continue
|
|
322
|
+
const errorMsg = error.message || '';
|
|
323
|
+
if (errorMsg.toLowerCase().includes('importing') &&
|
|
324
|
+
errorMsg.toLowerCase().includes('database')) {
|
|
325
|
+
this.logger.warn?.('Check not fully supported for data element (common for DDIC objects), continuing:', this.config.dataElementName);
|
|
326
|
+
// Return a mock successful result to allow chain to continue
|
|
327
|
+
this.state.checkResult = {
|
|
328
|
+
data: { success: true, message: 'Check skipped (not fully supported for DDIC objects)' },
|
|
329
|
+
status: 200,
|
|
330
|
+
statusText: 'OK',
|
|
331
|
+
headers: {},
|
|
332
|
+
config: {}
|
|
333
|
+
};
|
|
334
|
+
return this;
|
|
335
|
+
}
|
|
336
|
+
this.state.errors.push({
|
|
337
|
+
method: 'check',
|
|
338
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
339
|
+
timestamp: new Date()
|
|
340
|
+
});
|
|
341
|
+
this.logger.error?.('Check failed:', error);
|
|
342
|
+
throw error; // Interrupts chain
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
async unlock() {
|
|
346
|
+
try {
|
|
347
|
+
if (!this.lockHandle) {
|
|
348
|
+
throw new Error('Data element is not locked. Call lock() first.');
|
|
349
|
+
}
|
|
350
|
+
this.logger.info?.('Unlocking data element:', this.config.dataElementName);
|
|
351
|
+
const result = await (0, unlock_1.unlockDataElement)(this.connection, this.config.dataElementName, this.lockHandle, this.sessionId);
|
|
352
|
+
this.state.unlockResult = result;
|
|
353
|
+
this.lockHandle = undefined;
|
|
354
|
+
this.state.lockHandle = undefined;
|
|
355
|
+
this.logger.info?.('Data element unlocked successfully');
|
|
356
|
+
return this;
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
this.state.errors.push({
|
|
360
|
+
method: 'unlock',
|
|
361
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
362
|
+
timestamp: new Date()
|
|
363
|
+
});
|
|
364
|
+
this.logger.error?.('Unlock failed:', error);
|
|
365
|
+
throw error; // Interrupts chain
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
async activate() {
|
|
369
|
+
try {
|
|
370
|
+
this.logger.info?.('Activating data element:', this.config.dataElementName);
|
|
371
|
+
const result = await (0, activation_1.activateDataElement)(this.connection, this.config.dataElementName, this.sessionId);
|
|
372
|
+
this.state.activateResult = result;
|
|
373
|
+
this.logger.info?.('Data element activated successfully:', result.status);
|
|
374
|
+
return this;
|
|
375
|
+
}
|
|
376
|
+
catch (error) {
|
|
377
|
+
this.state.errors.push({
|
|
378
|
+
method: 'activate',
|
|
379
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
380
|
+
timestamp: new Date()
|
|
381
|
+
});
|
|
382
|
+
this.logger.error?.('Activate failed:', error);
|
|
383
|
+
throw error; // Interrupts chain
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
async forceUnlock() {
|
|
387
|
+
if (!this.lockHandle) {
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
try {
|
|
391
|
+
await (0, unlock_1.unlockDataElement)(this.connection, this.config.dataElementName, this.lockHandle, this.sessionId);
|
|
392
|
+
this.logger.info?.('Force unlock successful for', this.config.dataElementName);
|
|
393
|
+
}
|
|
394
|
+
catch (error) {
|
|
395
|
+
this.logger.warn?.('Force unlock failed:', error);
|
|
396
|
+
}
|
|
397
|
+
finally {
|
|
398
|
+
this.lockHandle = undefined;
|
|
399
|
+
this.state.lockHandle = undefined;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
// Getters for accessing results
|
|
403
|
+
getState() {
|
|
404
|
+
return { ...this.state };
|
|
405
|
+
}
|
|
406
|
+
getDataElementName() {
|
|
407
|
+
return this.config.dataElementName;
|
|
408
|
+
}
|
|
409
|
+
getLockHandle() {
|
|
410
|
+
return this.lockHandle;
|
|
411
|
+
}
|
|
412
|
+
getSessionId() {
|
|
413
|
+
return this.sessionId;
|
|
414
|
+
}
|
|
415
|
+
getReadResult() {
|
|
416
|
+
return this.state.readResult;
|
|
417
|
+
}
|
|
418
|
+
getCreateResult() {
|
|
419
|
+
return this.state.createResult;
|
|
420
|
+
}
|
|
421
|
+
getUpdateResult() {
|
|
422
|
+
return this.state.updateResult;
|
|
423
|
+
}
|
|
424
|
+
getCheckResult() {
|
|
425
|
+
return this.state.checkResult;
|
|
426
|
+
}
|
|
427
|
+
getUnlockResult() {
|
|
428
|
+
return this.state.unlockResult;
|
|
429
|
+
}
|
|
430
|
+
getActivateResult() {
|
|
431
|
+
return this.state.activateResult;
|
|
432
|
+
}
|
|
433
|
+
getErrors() {
|
|
434
|
+
return [...this.state.errors];
|
|
435
|
+
}
|
|
436
|
+
// Helper method to get all results
|
|
437
|
+
getResults() {
|
|
438
|
+
return {
|
|
439
|
+
create: this.state.createResult,
|
|
440
|
+
update: this.state.updateResult,
|
|
441
|
+
check: this.state.checkResult,
|
|
442
|
+
unlock: this.state.unlockResult,
|
|
443
|
+
activate: this.state.activateResult,
|
|
444
|
+
lockHandle: this.lockHandle,
|
|
445
|
+
errors: [...this.state.errors]
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
exports.DataElementBuilder = DataElementBuilder;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataElement activation operations
|
|
3
|
+
*/
|
|
4
|
+
import { AbapConnection } from '@mcp-abap-adt/connection';
|
|
5
|
+
import { AxiosResponse } from 'axios';
|
|
6
|
+
/**
|
|
7
|
+
* Activate data element
|
|
8
|
+
* Makes data element active and usable in SAP system
|
|
9
|
+
*/
|
|
10
|
+
export declare function activateDataElement(connection: AbapConnection, dataElementName: string, sessionId: string): Promise<AxiosResponse>;
|
|
11
|
+
//# sourceMappingURL=activation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../../src/core/dataElement/activation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAc,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAkFtC;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,cAAc,EAC1B,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,CAAC,CAkBxB"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DataElement activation operations
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.activateDataElement = activateDataElement;
|
|
40
|
+
const connection_1 = require("@mcp-abap-adt/connection");
|
|
41
|
+
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
42
|
+
const internalUtils_1 = require("../../utils/internalUtils");
|
|
43
|
+
const crypto = __importStar(require("crypto"));
|
|
44
|
+
/**
|
|
45
|
+
* Generate unique request ID
|
|
46
|
+
*/
|
|
47
|
+
function generateRequestId() {
|
|
48
|
+
return crypto.randomUUID().replace(/-/g, '');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Build activation XML payload
|
|
52
|
+
*/
|
|
53
|
+
function buildActivationXml(dataElementName) {
|
|
54
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
55
|
+
<adtcore:objectReferences xmlns:adtcore="http://www.sap.com/adt/core">
|
|
56
|
+
<adtcore:objectReference adtcore:uri="/sap/bc/adt/ddic/dataelements/${(0, internalUtils_1.encodeSapObjectName)(dataElementName.toLowerCase())}" adtcore:name="${dataElementName.toUpperCase()}"/>
|
|
57
|
+
</adtcore:objectReferences>`;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Parse activation response
|
|
61
|
+
*/
|
|
62
|
+
function parseActivationResponse(response) {
|
|
63
|
+
const parser = new fast_xml_parser_1.XMLParser({
|
|
64
|
+
ignoreAttributes: false,
|
|
65
|
+
attributeNamePrefix: '',
|
|
66
|
+
});
|
|
67
|
+
try {
|
|
68
|
+
const result = parser.parse(response.data);
|
|
69
|
+
const properties = result['chkl:messages']?.['chkl:properties'];
|
|
70
|
+
if (properties) {
|
|
71
|
+
const activated = properties['activationExecuted'] === 'true' || properties['activationExecuted'] === true;
|
|
72
|
+
const checked = properties['checkExecuted'] === 'true' || properties['checkExecuted'] === true;
|
|
73
|
+
return {
|
|
74
|
+
success: activated && checked,
|
|
75
|
+
message: activated ? 'Data element activated successfully' : 'Activation failed'
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return { success: false, message: 'Unknown activation status' };
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return { success: false, message: `Failed to parse activation response: ${error}` };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Make ADT request stateless
|
|
86
|
+
*/
|
|
87
|
+
async function makeAdtRequestStateless(connection, url, method, sessionId, data, additionalHeaders) {
|
|
88
|
+
const baseUrl = await connection.getBaseUrl();
|
|
89
|
+
const fullUrl = url.startsWith('http') ? url : `${baseUrl}${url}`;
|
|
90
|
+
const requestId = generateRequestId();
|
|
91
|
+
const headers = {
|
|
92
|
+
'sap-adt-connection-id': sessionId,
|
|
93
|
+
'sap-adt-request-id': requestId,
|
|
94
|
+
'X-sap-adt-profiling': 'server-time',
|
|
95
|
+
...additionalHeaders
|
|
96
|
+
};
|
|
97
|
+
return connection.makeAdtRequest({
|
|
98
|
+
url: fullUrl,
|
|
99
|
+
method,
|
|
100
|
+
timeout: (0, connection_1.getTimeout)('default'),
|
|
101
|
+
data,
|
|
102
|
+
headers
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Activate data element
|
|
107
|
+
* Makes data element active and usable in SAP system
|
|
108
|
+
*/
|
|
109
|
+
async function activateDataElement(connection, dataElementName, sessionId) {
|
|
110
|
+
const baseUrl = await connection.getBaseUrl();
|
|
111
|
+
const url = `${baseUrl}/sap/bc/adt/activation?method=activate&preauditRequested=true`;
|
|
112
|
+
const xmlBody = buildActivationXml(dataElementName);
|
|
113
|
+
const headers = {
|
|
114
|
+
'Accept': 'application/xml',
|
|
115
|
+
'Content-Type': 'application/xml'
|
|
116
|
+
};
|
|
117
|
+
const response = await makeAdtRequestStateless(connection, url, 'POST', sessionId, xmlBody, headers);
|
|
118
|
+
const activationResult = parseActivationResponse(response);
|
|
119
|
+
if (!activationResult.success) {
|
|
120
|
+
throw new Error(`Data element activation failed: ${activationResult.message}`);
|
|
121
|
+
}
|
|
122
|
+
return response;
|
|
123
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataElement check operations
|
|
3
|
+
*/
|
|
4
|
+
import { AbapConnection } from '@mcp-abap-adt/connection';
|
|
5
|
+
import { AxiosResponse } from 'axios';
|
|
6
|
+
/**
|
|
7
|
+
* Check data element syntax
|
|
8
|
+
* Note: For DDIC objects like data elements, check may not be fully supported in all SAP systems.
|
|
9
|
+
* If check fails with "importing from database" error, it's often safe to skip.
|
|
10
|
+
*/
|
|
11
|
+
export declare function checkDataElement(connection: AbapConnection, dataElementName: string, version?: string, sessionId?: string): Promise<AxiosResponse>;
|
|
12
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/core/dataElement/check.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,cAAc,EAC1B,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE,MAAiB,EAC1B,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAqBxB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DataElement check operations
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.checkDataElement = checkDataElement;
|
|
7
|
+
const checkRun_1 = require("../shared/checkRun");
|
|
8
|
+
/**
|
|
9
|
+
* Check data element syntax
|
|
10
|
+
* Note: For DDIC objects like data elements, check may not be fully supported in all SAP systems.
|
|
11
|
+
* If check fails with "importing from database" error, it's often safe to skip.
|
|
12
|
+
*/
|
|
13
|
+
async function checkDataElement(connection, dataElementName, version = 'active', sessionId) {
|
|
14
|
+
const response = await (0, checkRun_1.runCheckRun)(connection, 'data_element', dataElementName, version, 'abapCheckRun', sessionId);
|
|
15
|
+
const checkResult = (0, checkRun_1.parseCheckRunResponse)(response);
|
|
16
|
+
if (!checkResult.success && checkResult.has_errors) {
|
|
17
|
+
// For DDIC objects, "importing from database" errors are often non-critical
|
|
18
|
+
// and can be safely ignored, especially for inactive versions
|
|
19
|
+
const errorMessage = checkResult.message || '';
|
|
20
|
+
if (errorMessage.toLowerCase().includes('importing') &&
|
|
21
|
+
errorMessage.toLowerCase().includes('database')) {
|
|
22
|
+
// This is expected behavior for DDIC objects - check may not be fully supported
|
|
23
|
+
// Return response without throwing - test chain can continue
|
|
24
|
+
if (process.env.DEBUG_TESTS === 'true') {
|
|
25
|
+
console.warn(`Check warning for data element ${dataElementName}: ${errorMessage} (check may not be fully supported for DDIC objects)`);
|
|
26
|
+
}
|
|
27
|
+
return response; // Return response anyway
|
|
28
|
+
}
|
|
29
|
+
throw new Error(`Data element check failed: ${checkResult.message}`);
|
|
30
|
+
}
|
|
31
|
+
return response;
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataElement create operations
|
|
3
|
+
*/
|
|
4
|
+
import { AbapConnection } from '@mcp-abap-adt/connection';
|
|
5
|
+
import { AxiosResponse } from 'axios';
|
|
6
|
+
import { CreateDataElementParams } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* Create ABAP data element
|
|
9
|
+
* Full workflow: create -> activate -> verify
|
|
10
|
+
*/
|
|
11
|
+
export declare function createDataElement(connection: AbapConnection, params: CreateDataElementParams): Promise<AxiosResponse>;
|
|
12
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/core/dataElement/create.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAc,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAOtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAyMlD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,aAAa,CAAC,CAmDxB"}
|