trm-core 9.10.5 → 10.0.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/README.md +20 -0
- package/changelog.txt +3 -2
- package/dist/actions/cg3y/download.js +34 -4
- package/dist/actions/cg3y/index.d.ts +23 -0
- package/dist/actions/cg3y/index.js +13 -10
- package/dist/actions/cg3z/index.d.ts +67 -3
- package/dist/actions/cg3z/index.js +25 -14
- package/dist/actions/cg3z/upload.d.ts +20 -0
- package/dist/actions/cg3z/upload.js +165 -36
- package/dist/actions/checkEngines/analyze.d.ts +11 -0
- package/dist/actions/checkEngines/analyze.js +294 -0
- package/dist/actions/checkEngines/index.d.ts +87 -0
- package/dist/actions/checkEngines/index.js +38 -0
- package/dist/actions/checkEngines/init.d.ts +11 -0
- package/dist/actions/checkEngines/init.js +45 -0
- package/dist/actions/checkPackageDependencies/analyze.d.ts +10 -0
- package/dist/actions/checkPackageDependencies/analyze.js +37 -39
- package/dist/actions/checkPackageDependencies/index.d.ts +56 -0
- package/dist/actions/checkPackageDependencies/index.js +13 -10
- package/dist/actions/checkPackageDependencies/init.d.ts +8 -0
- package/dist/actions/checkPackageDependencies/init.js +24 -2
- package/dist/actions/checkSapEntries/analyze.d.ts +12 -0
- package/dist/actions/checkSapEntries/analyze.js +63 -47
- package/dist/actions/checkSapEntries/index.d.ts +35 -0
- package/dist/actions/checkSapEntries/index.js +12 -10
- package/dist/actions/checkSapEntries/init.d.ts +8 -0
- package/dist/actions/checkSapEntries/init.js +10 -2
- package/dist/actions/commons/IActionContext.d.ts +10 -0
- package/dist/actions/commons/checkServerAuth.d.ts +7 -0
- package/dist/actions/commons/checkServerAuth.js +10 -5
- package/dist/actions/commons/index.d.ts +1 -1
- package/dist/actions/commons/index.js +1 -1
- package/dist/actions/commons/prompts/index.d.ts +1 -0
- package/dist/actions/commons/prompts/index.js +1 -0
- package/dist/actions/commons/prompts/setLandscapeTarget.d.ts +14 -0
- package/dist/actions/commons/prompts/setLandscapeTarget.js +40 -0
- package/dist/actions/commons/prompts/setTransportTarget.d.ts +15 -0
- package/dist/actions/commons/prompts/setTransportTarget.js +20 -2
- package/dist/actions/commons/setSystemPackages.d.ts +7 -0
- package/dist/actions/commons/setSystemPackages.js +12 -2
- package/dist/actions/commons/utils/actionLocks.d.ts +32 -0
- package/dist/actions/commons/utils/actionLocks.js +135 -0
- package/dist/actions/commons/utils/dirtyEntries.d.ts +12 -0
- package/dist/actions/commons/utils/dirtyEntries.js +54 -0
- package/dist/actions/commons/utils/index.d.ts +10 -0
- package/dist/actions/commons/utils/index.js +26 -0
- package/dist/actions/commons/utils/installRegistry.d.ts +18 -0
- package/dist/actions/commons/utils/installRegistry.js +46 -0
- package/dist/actions/commons/utils/installedDependency.d.ts +15 -0
- package/dist/actions/commons/utils/installedDependency.js +30 -0
- package/dist/actions/commons/utils/owningInstallation.d.ts +6 -0
- package/dist/actions/commons/utils/owningInstallation.js +47 -0
- package/dist/actions/commons/utils/packageCleanup.d.ts +168 -0
- package/dist/actions/commons/utils/packageCleanup.js +1017 -0
- package/dist/actions/commons/utils/releaseDeletionTransport.d.ts +5 -0
- package/dist/actions/commons/utils/releaseDeletionTransport.js +67 -0
- package/dist/actions/commons/utils/restoreTransport.d.ts +6 -0
- package/dist/actions/commons/utils/restoreTransport.js +50 -0
- package/dist/actions/commons/utils/retainedWorkflow.d.ts +6 -0
- package/dist/actions/commons/utils/retainedWorkflow.js +49 -0
- package/dist/actions/commons/utils/withScopedPrefix.d.ts +5 -0
- package/dist/actions/commons/utils/withScopedPrefix.js +32 -0
- package/dist/actions/commons/workflowCallbacks.d.ts +21 -0
- package/dist/actions/commons/workflowCallbacks.js +157 -0
- package/dist/actions/index.d.ts +3 -0
- package/dist/actions/index.js +5 -0
- package/dist/actions/install/addNamespace.d.ts +18 -0
- package/dist/actions/install/addNamespace.js +121 -51
- package/dist/actions/install/checkDependants.d.ts +15 -0
- package/dist/actions/install/checkDependants.js +74 -0
- package/dist/actions/install/checkDependencies.d.ts +11 -0
- package/dist/actions/install/checkDependencies.js +32 -13
- package/dist/actions/install/checkDependencyCycles.d.ts +17 -0
- package/dist/actions/install/checkDependencyCycles.js +105 -0
- package/dist/actions/install/checkEngines.d.ts +11 -0
- package/dist/actions/install/checkEngines.js +100 -0
- package/dist/actions/install/checkInstallDevclass.d.ts +24 -0
- package/dist/actions/install/checkInstallDevclass.js +110 -0
- package/dist/actions/install/checkSapEntries.d.ts +9 -0
- package/dist/actions/install/checkSapEntries.js +20 -12
- package/dist/actions/install/checkTransports.d.ts +34 -0
- package/dist/actions/install/checkTransports.js +329 -170
- package/dist/actions/install/cleanupCheckpoint.d.ts +11 -0
- package/dist/actions/install/cleanupCheckpoint.js +62 -0
- package/dist/actions/install/defaultTransportLayer.d.ts +5 -0
- package/dist/actions/install/defaultTransportLayer.js +36 -0
- package/dist/actions/install/executePostActivities.d.ts +6 -0
- package/dist/actions/install/executePostActivities.js +28 -38
- package/dist/actions/install/generateDevclass.d.ts +10 -0
- package/dist/actions/install/generateDevclass.js +66 -20
- package/dist/actions/install/generateLandscapeTransport.d.ts +23 -0
- package/dist/actions/install/generateLandscapeTransport.js +136 -0
- package/dist/actions/install/generateUpdateTransport.d.ts +20 -0
- package/dist/actions/install/generateUpdateTransport.js +122 -0
- package/dist/actions/install/importBatch.d.ts +22 -0
- package/dist/actions/install/importBatch.js +0 -0
- package/dist/actions/install/index.d.ts +273 -44
- package/dist/actions/install/index.js +139 -59
- package/dist/actions/install/init.d.ts +14 -0
- package/dist/actions/install/init.js +215 -108
- package/dist/actions/install/installDependencies.d.ts +14 -0
- package/dist/actions/install/installDependencies.js +122 -45
- package/dist/actions/install/lockResources.d.ts +8 -0
- package/dist/actions/install/lockResources.js +100 -0
- package/dist/actions/install/prepareCust.d.ts +13 -0
- package/dist/actions/install/prepareCust.js +138 -0
- package/dist/actions/install/prepareDevc.d.ts +15 -0
- package/dist/actions/install/prepareDevc.js +113 -0
- package/dist/actions/install/prepareLang.d.ts +13 -0
- package/dist/actions/install/prepareLang.js +110 -0
- package/dist/actions/install/prepareTadir.d.ts +13 -0
- package/dist/actions/install/prepareTadir.js +95 -0
- package/dist/actions/install/releaseLandscapeTransport.d.ts +11 -0
- package/dist/actions/install/releaseLandscapeTransport.js +79 -0
- package/dist/actions/install/setInstallDevclass.d.ts +10 -0
- package/dist/actions/install/setInstallDevclass.js +140 -54
- package/dist/actions/install/updatePackageData.d.ts +9 -0
- package/dist/actions/install/updatePackageData.js +117 -13
- package/dist/actions/installDependency/checkInstalledRelease.d.ts +13 -0
- package/dist/actions/installDependency/checkInstalledRelease.js +50 -0
- package/dist/actions/installDependency/confirmDowngrade.d.ts +11 -0
- package/dist/actions/installDependency/confirmDowngrade.js +53 -0
- package/dist/actions/installDependency/findInstallRelease.d.ts +24 -0
- package/dist/actions/installDependency/findInstallRelease.js +42 -19
- package/dist/actions/installDependency/index.d.ts +64 -3
- package/dist/actions/installDependency/index.js +30 -13
- package/dist/actions/installDependency/init.d.ts +14 -0
- package/dist/actions/installDependency/init.js +24 -3
- package/dist/actions/installDependency/installRelease.d.ts +6 -0
- package/dist/actions/installDependency/installRelease.js +22 -12
- package/dist/actions/publish/enginesUi.d.ts +53 -0
- package/dist/actions/publish/enginesUi.js +289 -0
- package/dist/actions/publish/findDependencies.d.ts +19 -0
- package/dist/actions/publish/findDependencies.js +72 -37
- package/dist/actions/publish/generateCustTransport.d.ts +6 -0
- package/dist/actions/publish/generateCustTransport.js +42 -19
- package/dist/actions/publish/generateDevcTransport.d.ts +6 -0
- package/dist/actions/publish/generateDevcTransport.js +16 -18
- package/dist/actions/publish/generateLangTransport.d.ts +6 -0
- package/dist/actions/publish/generateLangTransport.js +20 -23
- package/dist/actions/publish/generateTadirTransport.d.ts +6 -0
- package/dist/actions/publish/generateTadirTransport.js +18 -17
- package/dist/actions/publish/getSystemEngines.d.ts +27 -0
- package/dist/actions/publish/getSystemEngines.js +112 -0
- package/dist/actions/publish/index.d.ts +162 -37
- package/dist/actions/publish/index.js +51 -34
- package/dist/actions/publish/init.d.ts +28 -0
- package/dist/actions/publish/init.js +304 -120
- package/dist/actions/publish/lockResources.d.ts +4 -0
- package/dist/actions/{install/refreshTmsTxt.js → publish/lockResources.js} +14 -17
- package/dist/actions/publish/publishToRegistry.d.ts +8 -0
- package/dist/actions/publish/publishToRegistry.js +18 -8
- package/dist/actions/publish/releaseTransports.d.ts +6 -0
- package/dist/actions/publish/releaseTransports.js +48 -20
- package/dist/actions/publish/setCustomizingTransports.d.ts +6 -0
- package/dist/actions/publish/setCustomizingTransports.js +227 -101
- package/dist/actions/publish/setManifestValues.d.ts +22 -0
- package/dist/actions/publish/setManifestValues.js +455 -119
- package/dist/actions/publish/setOptionalPublishData.d.ts +11 -0
- package/dist/actions/publish/setOptionalPublishData.js +133 -0
- package/dist/actions/publish/updatePackageData.d.ts +8 -0
- package/dist/actions/publish/updatePackageData.js +20 -7
- package/dist/actions/stopWarning.d.ts +5 -0
- package/dist/actions/stopWarning.js +5 -0
- package/dist/actions/uninstall/checkDependants.d.ts +7 -0
- package/dist/actions/uninstall/checkDependants.js +55 -0
- package/dist/actions/uninstall/forwardDeletionTransport.d.ts +10 -0
- package/dist/actions/uninstall/forwardDeletionTransport.js +51 -0
- package/dist/actions/uninstall/generateDeletionTransport.d.ts +10 -0
- package/dist/actions/uninstall/generateDeletionTransport.js +45 -0
- package/dist/actions/uninstall/index.d.ts +153 -0
- package/dist/actions/uninstall/index.js +141 -0
- package/dist/actions/uninstall/init.d.ts +17 -0
- package/dist/actions/uninstall/init.js +146 -0
- package/dist/actions/uninstall/lockResources.d.ts +4 -0
- package/dist/actions/{publish/setTransportTarget.js → uninstall/lockResources.js} +16 -7
- package/dist/actions/uninstall/removePackageData.d.ts +9 -0
- package/dist/actions/uninstall/removePackageData.js +64 -0
- package/dist/actions/uninstall/uninstallNestedPackages.d.ts +26 -0
- package/dist/actions/uninstall/uninstallNestedPackages.js +174 -0
- package/dist/client/ClientError.d.ts +3 -1
- package/dist/client/ClientError.js +2 -1
- package/dist/client/RESTClient.d.ts +18 -5
- package/dist/client/RESTClient.js +194 -56
- package/dist/client/RESTClientError.d.ts +1 -2
- package/dist/client/RESTClientError.js +3 -2
- package/dist/client/RFCClient.d.ts +28 -7
- package/dist/client/RFCClient.js +325 -77
- package/dist/client/RFCClientError.d.ts +1 -1
- package/dist/client/RFCClientError.js +2 -2
- package/dist/client/TransportEntries.d.ts +8 -0
- package/dist/client/TransportEntries.js +2 -0
- package/dist/client/components/BORM_ID.d.ts +1 -0
- package/dist/client/components/BORM_ID.js +2 -0
- package/dist/client/components/BORM_NAME.d.ts +1 -0
- package/dist/client/components/BORM_NAME.js +2 -0
- package/dist/client/components/BORM_NAMEL.d.ts +1 -0
- package/dist/client/components/BORM_NAMEL.js +2 -0
- package/dist/client/components/BORM_VEND.d.ts +1 -0
- package/dist/client/components/BORM_VEND.js +2 -0
- package/dist/client/components/BORM_VERS.d.ts +1 -0
- package/dist/client/components/BORM_VERS.js +2 -0
- package/dist/client/components/CWBNTNUMM.d.ts +1 -0
- package/dist/client/components/CWBNTNUMM.js +2 -0
- package/dist/client/components/CWBNTSTAT.d.ts +1 -0
- package/dist/client/components/CWBNTSTAT.js +2 -0
- package/dist/client/components/CWBNTVERS.d.ts +1 -0
- package/dist/client/components/CWBNTVERS.js +2 -0
- package/dist/client/components/CWBPRSTAT.d.ts +1 -0
- package/dist/client/components/CWBPRSTAT.js +2 -0
- package/dist/client/components/INSTSTATE.d.ts +1 -0
- package/dist/client/components/INSTSTATE.js +2 -0
- package/dist/client/components/RELC_TYPE.d.ts +1 -0
- package/dist/client/components/RELC_TYPE.js +2 -0
- package/dist/client/components/SAPPATCHLV.d.ts +1 -0
- package/dist/client/components/SAPPATCHLV.js +2 -0
- package/dist/client/components/SAPRELEASE.d.ts +1 -0
- package/dist/client/components/SAPRELEASE.js +2 -0
- package/dist/client/components/SYSYSID.d.ts +1 -0
- package/dist/client/components/SYSYSID.js +2 -0
- package/dist/client/components/ZTRM_INSTALLTR_TYPE.d.ts +1 -0
- package/dist/client/components/ZTRM_INSTALLTR_TYPE.js +2 -0
- package/dist/client/components/index.d.ts +15 -0
- package/dist/client/components/index.js +15 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/messageLog.d.ts +7 -0
- package/dist/client/messageLog.js +21 -0
- package/dist/client/struct/ActionLockKey.d.ts +6 -0
- package/dist/client/struct/ActionLockKey.js +2 -0
- package/dist/client/struct/CVERS.d.ts +7 -0
- package/dist/client/struct/CVERS.js +2 -0
- package/dist/client/struct/CWBNTCUST.d.ts +6 -0
- package/dist/client/struct/CWBNTCUST.js +2 -0
- package/dist/client/struct/CWBNTHEAD.d.ts +5 -0
- package/dist/client/struct/CWBNTHEAD.js +2 -0
- package/dist/client/struct/E070.d.ts +2 -1
- package/dist/client/struct/E071K.d.ts +9 -0
- package/dist/client/struct/E071K.js +2 -0
- package/dist/client/struct/PRDVERS.d.ts +9 -0
- package/dist/client/struct/PRDVERS.js +2 -0
- package/dist/client/struct/SCOMPKDTLN.d.ts +21 -0
- package/dist/client/struct/STMSCALERT.d.ts +21 -0
- package/dist/client/struct/STMSCALERT.js +2 -0
- package/dist/client/struct/STMS_TP_IMPORT.d.ts +14 -0
- package/dist/client/struct/STMS_TP_IMPORT.js +2 -0
- package/dist/client/struct/STMS_TR_REQUEST.d.ts +8 -0
- package/dist/client/struct/STMS_TR_REQUEST.js +2 -0
- package/dist/client/struct/TDEVC.d.ts +38 -0
- package/dist/client/struct/TPLOGPTR.d.ts +13 -0
- package/dist/client/struct/TPLOGPTR.js +2 -0
- package/dist/client/struct/TPSTDOUT.d.ts +3 -0
- package/dist/client/struct/TPSTDOUT.js +2 -0
- package/dist/client/struct/ZTRM_INSTALLTR.d.ts +8 -0
- package/dist/client/struct/ZTRM_INSTALLTR.js +2 -0
- package/dist/client/struct/index.d.ts +12 -0
- package/dist/client/struct/index.js +12 -0
- package/dist/commons/checkCoreTrmDependencies.js +1 -1
- package/dist/commons/getAxiosInstance.js +8 -17
- package/dist/commons/getNodePackage.js +7 -0
- package/dist/commons/getPackageHierarchy.js +2 -0
- package/dist/commons/getPackagesNamespace.d.ts +9 -0
- package/dist/commons/getPackagesNamespace.js +19 -0
- package/dist/commons/index.d.ts +4 -0
- package/dist/commons/index.js +4 -0
- package/dist/commons/packageDataFromTdevc.d.ts +12 -0
- package/dist/commons/packageDataFromTdevc.js +25 -0
- package/dist/commons/resolveCoreVersion.d.ts +10 -0
- package/dist/commons/resolveCoreVersion.js +24 -0
- package/dist/commons/summarizeForLog.d.ts +22 -0
- package/dist/commons/summarizeForLog.js +120 -0
- package/dist/connection/OpenRFCConnect.d.ts +13 -0
- package/dist/connection/OpenRFCConnect.js +23 -0
- package/dist/connection/index.d.ts +1 -0
- package/dist/connection/index.js +17 -0
- package/dist/dependencies/PackageDependencies.d.ts +2 -0
- package/dist/dependencies/PackageDependencies.js +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lockfile/Lockfile.d.ts +23 -1
- package/dist/lockfile/Lockfile.js +45 -9
- package/dist/manifest/Manifest.d.ts +9 -5
- package/dist/manifest/Manifest.js +82 -29
- package/dist/manifest/PostActivity.js +3 -3
- package/dist/manifest/TrmManifest.d.ts +0 -2
- package/dist/manifest/TrmManifestBase.d.ts +2 -0
- package/dist/manifest/TrmManifestEngines.d.ts +64 -0
- package/dist/manifest/TrmManifestEngines.js +2 -0
- package/dist/manifest/engines/index.d.ts +2 -0
- package/dist/manifest/engines/index.js +18 -0
- package/dist/manifest/engines/sapRange.d.ts +38 -0
- package/dist/manifest/engines/sapRange.js +135 -0
- package/dist/manifest/engines/validateEngines.d.ts +44 -0
- package/dist/manifest/engines/validateEngines.js +282 -0
- package/dist/manifest/index.d.ts +3 -0
- package/dist/manifest/index.js +3 -0
- package/dist/manifest/sapEntries.d.ts +14 -0
- package/dist/manifest/sapEntries.js +63 -0
- package/dist/protocol/Protocol.js +7 -0
- package/dist/registry/AbstractRegistry.d.ts +18 -3
- package/dist/registry/FileSystem.d.ts +22 -13
- package/dist/registry/FileSystem.js +69 -18
- package/dist/registry/RegistryDeletionTransportUnauthorizedError.d.ts +4 -0
- package/dist/registry/RegistryDeletionTransportUnauthorizedError.js +12 -0
- package/dist/registry/RegistryDeletionTransportUnavailableError.d.ts +9 -0
- package/dist/registry/RegistryDeletionTransportUnavailableError.js +17 -0
- package/dist/registry/RegistryPackageNotFoundError.d.ts +7 -0
- package/dist/registry/RegistryPackageNotFoundError.js +14 -0
- package/dist/registry/RegistryV2.d.ts +15 -5
- package/dist/registry/RegistryV2.js +308 -48
- package/dist/registry/index.d.ts +4 -0
- package/dist/registry/index.js +4 -0
- package/dist/registry/registryKey.d.ts +7 -0
- package/dist/registry/registryKey.js +21 -0
- package/dist/systemConnector/ActionLock.d.ts +1 -0
- package/dist/systemConnector/ActionLock.js +2 -0
- package/dist/systemConnector/ISystemConnector.d.ts +21 -4
- package/dist/systemConnector/ISystemConnectorBase.d.ts +16 -0
- package/dist/systemConnector/InstallTransport.d.ts +6 -0
- package/dist/systemConnector/InstallTransport.js +2 -0
- package/dist/systemConnector/OpenRFCSystemConnector.d.ts +12 -0
- package/dist/systemConnector/OpenRFCSystemConnector.js +51 -0
- package/dist/systemConnector/RESTSystemConnector.d.ts +22 -7
- package/dist/systemConnector/RESTSystemConnector.js +95 -23
- package/dist/systemConnector/RFCConnection.d.ts +0 -1
- package/dist/systemConnector/RFCSystemConnector.d.ts +25 -7
- package/dist/systemConnector/RFCSystemConnector.js +75 -16
- package/dist/systemConnector/SystemConnector.d.ts +38 -6
- package/dist/systemConnector/SystemConnector.js +138 -12
- package/dist/systemConnector/SystemConnectorBase.d.ts +24 -1
- package/dist/systemConnector/SystemConnectorBase.js +174 -22
- package/dist/systemConnector/index.d.ts +3 -0
- package/dist/systemConnector/index.js +3 -0
- package/dist/transport/E071KOwner.d.ts +10 -0
- package/dist/transport/E071KOwner.js +15 -0
- package/dist/transport/R3transLogParser.d.ts +19 -0
- package/dist/transport/R3transLogParser.js +148 -0
- package/dist/transport/Transport.d.ts +36 -3
- package/dist/transport/Transport.js +304 -138
- package/dist/transport/index.d.ts +2 -0
- package/dist/transport/index.js +2 -0
- package/dist/trmPackage/TransportBinary.d.ts +4 -1
- package/dist/trmPackage/TrmArtifact.d.ts +12 -8
- package/dist/trmPackage/TrmArtifact.js +93 -74
- package/dist/trmPackage/TrmPackage.d.ts +20 -6
- package/dist/trmPackage/TrmPackage.js +27 -1
- package/dist/validators/validateDevclass.js +4 -0
- package/package.json +15 -7
- package/dist/actions/commons/trmServerPa.d.ts +0 -3
- package/dist/actions/commons/trmServerPa.js +0 -40
- package/dist/actions/install/checkAlreadyInstalled.d.ts +0 -3
- package/dist/actions/install/checkAlreadyInstalled.js +0 -71
- package/dist/actions/install/checkObjectTypes.d.ts +0 -3
- package/dist/actions/install/checkObjectTypes.js +0 -50
- package/dist/actions/install/checkObjectsLock.d.ts +0 -3
- package/dist/actions/install/checkObjectsLock.js +0 -52
- package/dist/actions/install/generateInstallTransports.d.ts +0 -3
- package/dist/actions/install/generateInstallTransports.js +0 -128
- package/dist/actions/install/importCustTransport.d.ts +0 -3
- package/dist/actions/install/importCustTransport.js +0 -73
- package/dist/actions/install/importDevcTransport.d.ts +0 -3
- package/dist/actions/install/importDevcTransport.js +0 -93
- package/dist/actions/install/importLangTransport.d.ts +0 -3
- package/dist/actions/install/importLangTransport.js +0 -72
- package/dist/actions/install/importTadirTransport.d.ts +0 -3
- package/dist/actions/install/importTadirTransport.js +0 -83
- package/dist/actions/install/readDevc.d.ts +0 -3
- package/dist/actions/install/readDevc.js +0 -33
- package/dist/actions/install/readTadir.d.ts +0 -3
- package/dist/actions/install/readTadir.js +0 -101
- package/dist/actions/install/refreshTmsTxt.d.ts +0 -3
- package/dist/actions/install/releaseInstallTransport.d.ts +0 -3
- package/dist/actions/install/releaseInstallTransport.js +0 -80
- package/dist/actions/publish/checkAllObjectsReleased.d.ts +0 -3
- package/dist/actions/publish/checkAllObjectsReleased.js +0 -46
- package/dist/actions/publish/getSourceCode.d.ts +0 -3
- package/dist/actions/publish/getSourceCode.js +0 -49
- package/dist/actions/publish/setChangelog.d.ts +0 -3
- package/dist/actions/publish/setChangelog.js +0 -69
- package/dist/actions/publish/setDevclass.d.ts +0 -3
- package/dist/actions/publish/setDevclass.js +0 -74
- package/dist/actions/publish/setReadme.d.ts +0 -3
- package/dist/actions/publish/setReadme.js +0 -52
- package/dist/actions/publish/setTransportTarget.d.ts +0 -3
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.uninstall = uninstall;
|
|
13
|
+
exports.uninstallWithRollback = uninstallWithRollback;
|
|
14
|
+
const commons_1 = require("../commons");
|
|
15
|
+
const utils_1 = require("../commons/utils");
|
|
16
|
+
const init_1 = require("./init");
|
|
17
|
+
const checkDependants_1 = require("./checkDependants");
|
|
18
|
+
const uninstallNestedPackages_1 = require("./uninstallNestedPackages");
|
|
19
|
+
const lockResources_1 = require("./lockResources");
|
|
20
|
+
const generateDeletionTransport_1 = require("./generateDeletionTransport");
|
|
21
|
+
const removePackageData_1 = require("./removePackageData");
|
|
22
|
+
const forwardDeletionTransport_1 = require("./forwardDeletionTransport");
|
|
23
|
+
;
|
|
24
|
+
const WORKFLOW_NAME = 'uninstall';
|
|
25
|
+
/**
|
|
26
|
+
* Uninstalls a TRM package from the currently connected SAP system.
|
|
27
|
+
*
|
|
28
|
+
* This is the opposite of {@link install}: the workflow authorizes the user, checks that no
|
|
29
|
+
* installed package depends on it, removes the objects of the installed release through a
|
|
30
|
+
* registry-generated deletion transport, forwards that transport to the landscape target
|
|
31
|
+
* system so the package is uninstalled there too, and removes the TRM package record. The object
|
|
32
|
+
* cleanup is the same performed when an install upgrades a package, with no incoming release.
|
|
33
|
+
* Other TRM packages installed in its SAP packages, at any depth, are uninstalled first by the same
|
|
34
|
+
* action, with the same options.
|
|
35
|
+
* Completed reversible steps are rolled back when a later step fails.
|
|
36
|
+
*
|
|
37
|
+
* This operation changes the target SAP system. Do not interrupt it while transports are being
|
|
38
|
+
* generated, imported, or released.
|
|
39
|
+
*
|
|
40
|
+
* @param inputData Package identity, registry, and uninstall options.
|
|
41
|
+
* @returns The uninstalled release manifest, the imported deletion transport, and the landscape
|
|
42
|
+
* target it was forwarded to.
|
|
43
|
+
* @throws When authorization, dependants check, deletion transport processing, or the
|
|
44
|
+
* package record removal fails.
|
|
45
|
+
*/
|
|
46
|
+
function uninstall(inputData) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return (yield runUninstall(inputData, false, [])).output;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const uninstallWorkflow = [
|
|
52
|
+
commons_1.checkServerAuth,
|
|
53
|
+
commons_1.setSystemPackages,
|
|
54
|
+
init_1.init,
|
|
55
|
+
checkDependants_1.checkDependants,
|
|
56
|
+
uninstallNestedPackages_1.uninstallNestedPackages,
|
|
57
|
+
lockResources_1.lockResources,
|
|
58
|
+
generateDeletionTransport_1.generateDeletionTransport,
|
|
59
|
+
forwardDeletionTransport_1.forwardDeletionTransport,
|
|
60
|
+
removePackageData_1.removePackageData
|
|
61
|
+
];
|
|
62
|
+
function runUninstall(inputData, retainRollback, uninstallingPackages, parentLockScope) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
// A nested uninstall locks in its parent scope: the parent cleanup locks the same SAP packages
|
|
65
|
+
// and objects again, and the parent releases them all once it has finished.
|
|
66
|
+
const lockScope = parentLockScope || new utils_1.ActionLockScope(WORKFLOW_NAME);
|
|
67
|
+
const context = { rawInput: inputData, lockScope, uninstallingPackages };
|
|
68
|
+
yield lockScope.acquire([(0, utils_1.packageLockResource)(inputData.packageData.registry, inputData.packageData.name)]);
|
|
69
|
+
const release = () => __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
var _a;
|
|
71
|
+
let firstError;
|
|
72
|
+
for (const releaseNested of [...(((_a = context.runtime) === null || _a === void 0 ? void 0 : _a.nestedReleases) || [])].reverse()) {
|
|
73
|
+
try {
|
|
74
|
+
yield releaseNested();
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
firstError || (firstError = error);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (!parentLockScope) {
|
|
81
|
+
try {
|
|
82
|
+
yield lockScope.release();
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
firstError || (firstError = error);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (firstError)
|
|
89
|
+
throw firstError;
|
|
90
|
+
});
|
|
91
|
+
if (!retainRollback) {
|
|
92
|
+
return (0, utils_1.withLockRelease)(release, () => __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const result = yield (0, commons_1.executeWorkflow)(WORKFLOW_NAME, uninstallWorkflow, context, commons_1.workflowCallbacks);
|
|
94
|
+
return { output: result.output };
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
let retained;
|
|
98
|
+
try {
|
|
99
|
+
retained = yield (0, utils_1.executeRetainedWorkflow)(WORKFLOW_NAME, uninstallWorkflow, context, commons_1.workflowCallbacks);
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
yield (0, utils_1.releaseLogged)(release);
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
// The locks stay held until the parent calls release (or rollback).
|
|
106
|
+
return {
|
|
107
|
+
output: retained.context.output,
|
|
108
|
+
release,
|
|
109
|
+
rollback: () => __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
let firstError;
|
|
111
|
+
try {
|
|
112
|
+
yield retained.rollback();
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
firstError = error;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
yield release();
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
firstError || (firstError = error);
|
|
122
|
+
}
|
|
123
|
+
if (firstError)
|
|
124
|
+
throw firstError;
|
|
125
|
+
})
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Internal transactional entry point used when a parent uninstall must retain rollback ownership:
|
|
131
|
+
* the package is uninstalled, its locks stay held until `release`, and `rollback` restores it.
|
|
132
|
+
*
|
|
133
|
+
* @param uninstallingPackages Other packages uninstalled by the same run, ignored as dependants.
|
|
134
|
+
* @param parentLockScope Lock scope of the parent uninstall: its locks are taken in it and released by the parent.
|
|
135
|
+
*/
|
|
136
|
+
function uninstallWithRollback(inputData, uninstallingPackages, parentLockScope) {
|
|
137
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
const retained = yield runUninstall(inputData, true, uninstallingPackages, parentLockScope);
|
|
139
|
+
return { output: retained.output, rollback: retained.rollback, release: retained.release };
|
|
140
|
+
});
|
|
141
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Step } from "@simonegaffurini/sammarksworkflow";
|
|
2
|
+
import { UninstallWorkflowContext } from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Workflow step that finds the installed package and initializes rollback state.
|
|
5
|
+
*
|
|
6
|
+
* 1- fill missing input data
|
|
7
|
+
*
|
|
8
|
+
* 2- find installed package and its TRM packages table record
|
|
9
|
+
*
|
|
10
|
+
* 3- check if package can be deleted
|
|
11
|
+
*
|
|
12
|
+
* 4- check/set system target
|
|
13
|
+
*
|
|
14
|
+
* 5- fill context data, including the TRM packages installed under the uninstalled one
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare const init: Step<UninstallWorkflowContext>;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.init = void 0;
|
|
13
|
+
const trm_commons_1 = require("trm-commons");
|
|
14
|
+
const systemConnector_1 = require("../../systemConnector");
|
|
15
|
+
const registry_1 = require("../../registry");
|
|
16
|
+
const trmPackage_1 = require("../../trmPackage");
|
|
17
|
+
const prompts_1 = require("../commons/prompts");
|
|
18
|
+
const uninstallNestedPackages_1 = require("./uninstallNestedPackages");
|
|
19
|
+
const utils_1 = require("../commons/utils");
|
|
20
|
+
/**
|
|
21
|
+
* Workflow step that finds the installed package and initializes rollback state.
|
|
22
|
+
*
|
|
23
|
+
* 1- fill missing input data
|
|
24
|
+
*
|
|
25
|
+
* 2- find installed package and its TRM packages table record
|
|
26
|
+
*
|
|
27
|
+
* 3- check if package can be deleted
|
|
28
|
+
*
|
|
29
|
+
* 4- check/set system target
|
|
30
|
+
*
|
|
31
|
+
* 5- fill context data, including the TRM packages installed under the uninstalled one
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
exports.init = {
|
|
35
|
+
name: 'init',
|
|
36
|
+
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
var _a;
|
|
38
|
+
const registry = context.rawInput.packageData.registry;
|
|
39
|
+
//1- fill missing input data
|
|
40
|
+
if (!context.rawInput.uninstallData) {
|
|
41
|
+
context.rawInput.uninstallData = {};
|
|
42
|
+
}
|
|
43
|
+
if (!context.rawInput.uninstallData.checks) {
|
|
44
|
+
context.rawInput.uninstallData.checks = {};
|
|
45
|
+
}
|
|
46
|
+
if (!context.rawInput.uninstallData.landscapeTransport) {
|
|
47
|
+
context.rawInput.uninstallData.landscapeTransport = {};
|
|
48
|
+
}
|
|
49
|
+
//2- find installed package
|
|
50
|
+
//the registry generates the deletion transport
|
|
51
|
+
if (registry.getRegistryType() === registry_1.RegistryType.LOCAL) {
|
|
52
|
+
throw new Error(`Uninstall aborted. Deletion transports can't be generated from a local registry.`);
|
|
53
|
+
}
|
|
54
|
+
const installed = context.rawInput.contextData.systemPackages.find(o => o.manifest
|
|
55
|
+
&& trmPackage_1.TrmPackage.compare(o, new trmPackage_1.TrmPackage(context.rawInput.packageData.name, registry)));
|
|
56
|
+
if (!installed) {
|
|
57
|
+
throw new Error(`Package ${context.rawInput.packageData.name} is not installed in ${systemConnector_1.SystemConnector.getDest()}.`);
|
|
58
|
+
}
|
|
59
|
+
// Without its TRM packages table row the record would survive the uninstall:
|
|
60
|
+
// the row is missing when the backend read failed, so read it again before changing anything.
|
|
61
|
+
if (!installed.getMetadataSnapshot()) {
|
|
62
|
+
trm_commons_1.Logger.loading(`Reading TRM data...`, true);
|
|
63
|
+
const snapshot = (_a = (yield systemConnector_1.SystemConnector.getInstalledPackages(true)).find(o => o.manifest
|
|
64
|
+
&& trmPackage_1.TrmPackage.compare(o, installed))) === null || _a === void 0 ? void 0 : _a.getMetadataSnapshot();
|
|
65
|
+
if (!snapshot) {
|
|
66
|
+
throw new Error(`Uninstall aborted. The TRM packages table record of ${context.rawInput.packageData.name} could not be read from ${systemConnector_1.SystemConnector.getDest()}.`);
|
|
67
|
+
}
|
|
68
|
+
installed.setMetadataSnapshot(snapshot);
|
|
69
|
+
}
|
|
70
|
+
//3- check if package can be deleted
|
|
71
|
+
if (registry.getRegistryType() === registry_1.RegistryType.PUBLIC
|
|
72
|
+
&& (installed.packageName === systemConnector_1.TRM_SERVER_PACKAGE_NAME || installed.packageName === systemConnector_1.TRM_REST_PACKAGE_NAME)) {
|
|
73
|
+
throw new Error(`Uninstall aborted. ${installed.packageName} is required by TRM and can't be uninstalled.`);
|
|
74
|
+
}
|
|
75
|
+
//4- read install data
|
|
76
|
+
//install mappings are queried case-sensitively: use the stored name and registry, not the input
|
|
77
|
+
const previousInstallPackages = yield systemConnector_1.SystemConnector.getInstallPackages(installed.packageName, installed.registry);
|
|
78
|
+
const previousInstallTransports = yield systemConnector_1.SystemConnector.getInstallTransports(installed.packageName, installed.registry);
|
|
79
|
+
const nestedPackages = yield (0, uninstallNestedPackages_1.getNestedPackages)(context.rawInput.contextData.systemPackages, installed, previousInstallPackages.map(replacement => replacement.installDevclass));
|
|
80
|
+
//5- dirty check: changes still being edited would fail the cleanup objects lock check,
|
|
81
|
+
//so check them before asking anything
|
|
82
|
+
const allDirtyEntries = yield (0, utils_1.withoutOwnTrmTransports)(installed.getDirtyEntries(), installed.packageName);
|
|
83
|
+
if (allDirtyEntries.length > 0) {
|
|
84
|
+
trm_commons_1.Logger.loading(`Checking changed objects locks...`, true);
|
|
85
|
+
const locks = yield (0, utils_1.getInstalledObjectsLocks)(installed, previousInstallPackages, context.rawInput.contextData.systemPackages, allDirtyEntries);
|
|
86
|
+
if (locks.length > 0) {
|
|
87
|
+
locks.forEach(lock => trm_commons_1.Logger.error(`${lock.pgmid} ${lock.object} ${lock.objName} is currently locked in transport ${lock.trkorr}`, { important: true }));
|
|
88
|
+
throw new Error(`Uninstall aborted. To continue, all cleanup objects and SAP packages must be released`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//the TRM packages installed under it confirm their own changes
|
|
92
|
+
const dirtyEntries = yield (0, uninstallNestedPackages_1.withoutNestedDirtyEntries)(allDirtyEntries, nestedPackages.all);
|
|
93
|
+
if (dirtyEntries.length > 0 && !context.rawInput.uninstallData.checks.ignoreDirty) {
|
|
94
|
+
const reason = `${context.rawInput.packageData.name} has changes made on ${systemConnector_1.SystemConnector.getDest()} that will be deleted`;
|
|
95
|
+
trm_commons_1.Logger.warning(`${reason}!`);
|
|
96
|
+
(0, utils_1.logDirtyEntries)(dirtyEntries);
|
|
97
|
+
if (context.rawInput.contextData.noInquirer) {
|
|
98
|
+
throw new Error(`Uninstall aborted. ${reason}: set the ignoreDirty check to uninstall it without prompts.`);
|
|
99
|
+
}
|
|
100
|
+
const { ignoreDirty } = yield trm_commons_1.Inquirer.prompt({
|
|
101
|
+
message: `Continue with uninstall?`,
|
|
102
|
+
type: 'confirm',
|
|
103
|
+
default: false,
|
|
104
|
+
name: 'ignoreDirty'
|
|
105
|
+
});
|
|
106
|
+
if (!ignoreDirty) {
|
|
107
|
+
throw new Error(`Uninstall aborted. ${reason}.`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else if (dirtyEntries.length > 0) {
|
|
111
|
+
trm_commons_1.Logger.warning(`${context.rawInput.packageData.name} has changes made on ${systemConnector_1.SystemConnector.getDest()} that will be deleted!`, { important: true });
|
|
112
|
+
(0, utils_1.logDirtyEntries)(dirtyEntries);
|
|
113
|
+
}
|
|
114
|
+
//6- check/set system target
|
|
115
|
+
//objects of a temporary package only exist on this system
|
|
116
|
+
if (!(installed.getDevclass() || '').trim().startsWith('$')) {
|
|
117
|
+
context.rawInput.uninstallData.landscapeTransport.targetSystem = yield (0, prompts_1.setLandscapeTarget)(context.rawInput.contextData.noInquirer, context.rawInput.uninstallData.landscapeTransport.targetSystem, "Deletion transport target", "Deletion transport won't be forwarded.");
|
|
118
|
+
}
|
|
119
|
+
//7- fill context data
|
|
120
|
+
context.runtime = {
|
|
121
|
+
update: installed,
|
|
122
|
+
previousInstallPackages,
|
|
123
|
+
previousInstallTransports,
|
|
124
|
+
dele: undefined,
|
|
125
|
+
stopWarningShown: false,
|
|
126
|
+
nestedPackages,
|
|
127
|
+
nestedRollbacks: [],
|
|
128
|
+
nestedReleases: [],
|
|
129
|
+
deletedObjects: []
|
|
130
|
+
};
|
|
131
|
+
context.output = {
|
|
132
|
+
manifest: installed.manifest.get(),
|
|
133
|
+
transport: undefined,
|
|
134
|
+
targetSystem: undefined
|
|
135
|
+
};
|
|
136
|
+
context.revert = {
|
|
137
|
+
sapPackages: [],
|
|
138
|
+
dele: undefined,
|
|
139
|
+
deleImportStarted: false,
|
|
140
|
+
deleInTargetTms: false,
|
|
141
|
+
metadataRemoveStarted: false,
|
|
142
|
+
metadataPreviousPackageRow: undefined
|
|
143
|
+
};
|
|
144
|
+
trm_commons_1.Logger.info(`Ready to uninstall ${installed.packageName} v${installed.manifest.get().version}.`);
|
|
145
|
+
})
|
|
146
|
+
};
|
|
@@ -9,13 +9,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
name: 'set-transport-target',
|
|
12
|
+
exports.lockResources = void 0;
|
|
13
|
+
/** Lock the installed SAP packages and transport before the deletion selection is computed. */
|
|
14
|
+
exports.lockResources = {
|
|
15
|
+
name: "lock-resources",
|
|
17
16
|
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
var _a;
|
|
18
|
+
const resources = [];
|
|
19
|
+
for (const previous of context.runtime.previousInstallPackages || []) {
|
|
20
|
+
resources.push({ type: "DEVCLASS", name: previous.installDevclass });
|
|
21
|
+
}
|
|
22
|
+
if (context.runtime.update.getDevclass()) {
|
|
23
|
+
resources.push({ type: "DEVCLASS", name: context.runtime.update.getDevclass() });
|
|
24
|
+
}
|
|
25
|
+
if ((_a = context.runtime.update.getTransport()) === null || _a === void 0 ? void 0 : _a.trkorr) {
|
|
26
|
+
resources.push({ type: "TRANSPORT", name: context.runtime.update.getTransport().trkorr });
|
|
27
|
+
}
|
|
28
|
+
yield context.lockScope.acquire(resources);
|
|
20
29
|
})
|
|
21
30
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Step } from "@simonegaffurini/sammarksworkflow";
|
|
2
|
+
import { UninstallWorkflowContext } from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Workflow step that removes the uninstalled package from the target system's TRM package table.
|
|
5
|
+
*
|
|
6
|
+
* Removes the record in TRM packages table, its install devclass mappings and install transports
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export declare const removePackageData: Step<UninstallWorkflowContext>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.removePackageData = void 0;
|
|
13
|
+
const trm_commons_1 = require("trm-commons");
|
|
14
|
+
const systemConnector_1 = require("../../systemConnector");
|
|
15
|
+
/**
|
|
16
|
+
* Workflow step that removes the uninstalled package from the target system's TRM package table.
|
|
17
|
+
*
|
|
18
|
+
* Removes the record in TRM packages table, its install devclass mappings and install transports
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
exports.removePackageData = {
|
|
22
|
+
name: 'remove-package-data',
|
|
23
|
+
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
// init reads the record before anything is deleted: never skip its removal.
|
|
25
|
+
const snapshot = context.runtime.update.getMetadataSnapshot();
|
|
26
|
+
if (!snapshot) {
|
|
27
|
+
throw new Error(`TRM packages table record of ${context.runtime.update.packageName} is missing: it can't be removed.`);
|
|
28
|
+
}
|
|
29
|
+
trm_commons_1.Logger.loading(`Updating TRM data...`);
|
|
30
|
+
context.revert.metadataPreviousPackageRow = snapshot;
|
|
31
|
+
// Mark before the mutating await: SAP may commit the removal and still
|
|
32
|
+
// fail while returning the response.
|
|
33
|
+
context.revert.metadataRemoveStarted = true;
|
|
34
|
+
yield systemConnector_1.SystemConnector.restoreInstallMetadata({
|
|
35
|
+
package: context.revert.metadataPreviousPackageRow,
|
|
36
|
+
packageExists: false,
|
|
37
|
+
installDevc: [],
|
|
38
|
+
installTr: []
|
|
39
|
+
});
|
|
40
|
+
trm_commons_1.Logger.success(`${context.runtime.update.packageName} deleted from ${systemConnector_1.SystemConnector.getDest()}.`);
|
|
41
|
+
}),
|
|
42
|
+
revert: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
if (!context.revert.metadataRemoveStarted) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const previousRow = context.revert.metadataPreviousPackageRow;
|
|
47
|
+
yield systemConnector_1.SystemConnector.restoreInstallMetadata({
|
|
48
|
+
package: previousRow,
|
|
49
|
+
packageExists: true,
|
|
50
|
+
installDevc: context.runtime.previousInstallPackages.map(replacement => ({
|
|
51
|
+
package_name: previousRow.package_name,
|
|
52
|
+
package_registry: previousRow.package_registry,
|
|
53
|
+
original_devclass: replacement.originalDevclass,
|
|
54
|
+
install_devclass: replacement.installDevclass
|
|
55
|
+
})),
|
|
56
|
+
installTr: (context.runtime.previousInstallTransports || []).map(transport => ({
|
|
57
|
+
package_name: previousRow.package_name,
|
|
58
|
+
package_registry: previousRow.package_registry,
|
|
59
|
+
trkorr: transport.trkorr,
|
|
60
|
+
trm_type: transport.trmType
|
|
61
|
+
}))
|
|
62
|
+
});
|
|
63
|
+
})
|
|
64
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Step } from "@simonegaffurini/sammarksworkflow";
|
|
2
|
+
import type { UninstallWorkflowContext } from ".";
|
|
3
|
+
import { TrmPackage } from "../../trmPackage";
|
|
4
|
+
import { ZTRM_DIRTY } from "../../client";
|
|
5
|
+
/**
|
|
6
|
+
* Other TRM packages installed in the SAP packages of the uninstalled one, at any depth: the first
|
|
7
|
+
* list holds the outermost ones, whose uninstall removes the packages installed under them.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getNestedPackages(systemPackages: TrmPackage[], installed: TrmPackage, installDevclasses: string[]): Promise<{
|
|
10
|
+
outermost: TrmPackage[];
|
|
11
|
+
all: TrmPackage[];
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Dirty entries of the uninstalled package that belong to the TRM packages installed under it:
|
|
15
|
+
* their installs (landscape transports) and their own changes, which their uninstall confirms.
|
|
16
|
+
*/
|
|
17
|
+
export declare function withoutNestedDirtyEntries(entries: ZTRM_DIRTY[], nested: TrmPackage[]): Promise<ZTRM_DIRTY[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Workflow step that deletes the TRM packages installed in the SAP packages of the uninstalled one.
|
|
20
|
+
*
|
|
21
|
+
* Their SAP packages are deleted with the package anyway: running the uninstall action for each
|
|
22
|
+
* also removes their customizing and records, and forwards their deletion. Their rollbacks are
|
|
23
|
+
* retained, so a later failure restores them too.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
export declare const uninstallNestedPackages: Step<UninstallWorkflowContext>;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.uninstallNestedPackages = void 0;
|
|
13
|
+
exports.getNestedPackages = getNestedPackages;
|
|
14
|
+
exports.withoutNestedDirtyEntries = withoutNestedDirtyEntries;
|
|
15
|
+
const trm_commons_1 = require("trm-commons");
|
|
16
|
+
const _1 = require(".");
|
|
17
|
+
const systemConnector_1 = require("../../systemConnector");
|
|
18
|
+
const utils_1 = require("../commons/utils");
|
|
19
|
+
const transport_1 = require("../../transport");
|
|
20
|
+
function normalize(value) {
|
|
21
|
+
return value.trim().toUpperCase();
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Other TRM packages installed in the SAP packages of the uninstalled one, at any depth: the first
|
|
25
|
+
* list holds the outermost ones, whose uninstall removes the packages installed under them.
|
|
26
|
+
*/
|
|
27
|
+
function getNestedPackages(systemPackages, installed, installDevclasses) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const roots = new Set(installDevclasses);
|
|
30
|
+
if (installed.getDevclass()) {
|
|
31
|
+
roots.add(installed.getDevclass());
|
|
32
|
+
}
|
|
33
|
+
const subtree = new Set(Array.from(roots, normalize));
|
|
34
|
+
const parents = new Map();
|
|
35
|
+
for (const devclass of roots) {
|
|
36
|
+
for (const subpackage of yield systemConnector_1.SystemConnector.getSubpackages(devclass)) {
|
|
37
|
+
subtree.add(normalize(subpackage.devclass));
|
|
38
|
+
if (subpackage.parentcl) {
|
|
39
|
+
parents.set(normalize(subpackage.devclass), normalize(subpackage.parentcl));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const all = (0, utils_1.getPackagesInstalledIn)(systemPackages, installed, subtree);
|
|
44
|
+
const nestedDevclasses = new Set(all.map(pkg => normalize(pkg.getDevclass())));
|
|
45
|
+
const outermost = all.filter(pkg => {
|
|
46
|
+
const visited = new Set();
|
|
47
|
+
let parent = parents.get(normalize(pkg.getDevclass()));
|
|
48
|
+
while (parent && !visited.has(parent)) {
|
|
49
|
+
if (nestedDevclasses.has(parent)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
visited.add(parent);
|
|
53
|
+
parent = parents.get(parent);
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
});
|
|
57
|
+
return { outermost, all };
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Dirty entries of the uninstalled package that belong to the TRM packages installed under it:
|
|
62
|
+
* their installs (landscape transports) and their own changes, which their uninstall confirms.
|
|
63
|
+
*/
|
|
64
|
+
function withoutNestedDirtyEntries(entries, nested) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
if (entries.length === 0 || nested.length === 0) {
|
|
67
|
+
return entries;
|
|
68
|
+
}
|
|
69
|
+
const nestedNames = new Set(nested.map(pkg => pkg.packageName));
|
|
70
|
+
const nestedEntries = new Set(nested.flatMap(pkg => pkg.getDirtyEntries())
|
|
71
|
+
.map(o => `${o.trkorr}|${o.pgmid}|${o.object}|${o.objName}`));
|
|
72
|
+
const nestedTransports = new Set();
|
|
73
|
+
for (const trkorr of new Set(entries.map(o => o.trkorr))) {
|
|
74
|
+
if (nestedNames.has(yield new transport_1.Transport(trkorr).getTrmPackageName())) {
|
|
75
|
+
nestedTransports.add(trkorr);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return entries.filter(o => !nestedTransports.has(o.trkorr)
|
|
79
|
+
&& !nestedEntries.has(`${o.trkorr}|${o.pgmid}|${o.object}|${o.objName}`));
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Workflow step that deletes the TRM packages installed in the SAP packages of the uninstalled one.
|
|
84
|
+
*
|
|
85
|
+
* Their SAP packages are deleted with the package anyway: running the uninstall action for each
|
|
86
|
+
* also removes their customizing and records, and forwards their deletion. Their rollbacks are
|
|
87
|
+
* retained, so a later failure restores them too.
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
90
|
+
exports.uninstallNestedPackages = {
|
|
91
|
+
name: 'uninstall-nested-packages',
|
|
92
|
+
filter: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
+
if (context.runtime.nestedPackages.all.length === 0) {
|
|
94
|
+
trm_commons_1.Logger.log(`Skipping nested packages uninstall (no TRM packages installed under ${context.runtime.update.packageName})`, true);
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
return true;
|
|
98
|
+
}),
|
|
99
|
+
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
100
|
+
const { outermost, all } = context.runtime.nestedPackages;
|
|
101
|
+
const nestedMessage = `${all.length} TRM package(s) installed in the SAP packages of ${context.runtime.update.packageName} will be deleted too: ${all.map(pkg => pkg.packageName).join(', ')}`;
|
|
102
|
+
trm_commons_1.Logger.warning(`${nestedMessage}.`, { important: true });
|
|
103
|
+
// Deleting other TRM packages is destructive: ask first (without prompts the warning stands).
|
|
104
|
+
if (!context.rawInput.contextData.noInquirer) {
|
|
105
|
+
const { uninstallNested } = yield trm_commons_1.Inquirer.prompt({
|
|
106
|
+
name: 'uninstallNested',
|
|
107
|
+
type: 'confirm',
|
|
108
|
+
message: `${nestedMessage}. Continue?`,
|
|
109
|
+
default: false
|
|
110
|
+
});
|
|
111
|
+
if (!uninstallNested) {
|
|
112
|
+
throw new Error(`Uninstall aborted.`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const uninstallingPackages = [...(context.uninstallingPackages || []), context.runtime.update, ...all];
|
|
116
|
+
const originalLPrefix = trm_commons_1.Logger.getPrefix();
|
|
117
|
+
const originalIPrefix = trm_commons_1.Inquirer.getPrefix();
|
|
118
|
+
let counter = 0;
|
|
119
|
+
for (const nested of outermost) {
|
|
120
|
+
counter++;
|
|
121
|
+
const prefix = `(${counter}/${outermost.length}) `;
|
|
122
|
+
try {
|
|
123
|
+
trm_commons_1.Logger.setPrefix(originalLPrefix ? `${originalLPrefix}-> ${prefix}` : ` ${prefix}`);
|
|
124
|
+
trm_commons_1.Inquirer.setPrefix(originalIPrefix ? `${originalIPrefix}-> ${prefix}` : ` ${prefix}`);
|
|
125
|
+
trm_commons_1.Logger.loading(`Getting ready to uninstall nested package "${nested.packageName}"...`);
|
|
126
|
+
const result = yield (0, _1.uninstallWithRollback)({
|
|
127
|
+
contextData: {
|
|
128
|
+
noInquirer: context.rawInput.contextData.noInquirer,
|
|
129
|
+
systemPackages: [...context.rawInput.contextData.systemPackages]
|
|
130
|
+
},
|
|
131
|
+
packageData: {
|
|
132
|
+
name: nested.packageName,
|
|
133
|
+
registry: nested.registry
|
|
134
|
+
},
|
|
135
|
+
uninstallData: {
|
|
136
|
+
checks: Object.assign({}, context.rawInput.uninstallData.checks),
|
|
137
|
+
landscapeTransport: Object.assign({}, context.rawInput.uninstallData.landscapeTransport)
|
|
138
|
+
}
|
|
139
|
+
}, uninstallingPackages.filter(pkg => pkg !== nested), context.lockScope);
|
|
140
|
+
context.runtime.nestedRollbacks.push(result.rollback);
|
|
141
|
+
context.runtime.nestedReleases.push(result.release);
|
|
142
|
+
// The SAP buffers may still list them: the cleanup of this package must not delete them again.
|
|
143
|
+
if (result.output.transport) {
|
|
144
|
+
context.runtime.deletedObjects = [
|
|
145
|
+
...(context.runtime.deletedObjects || []),
|
|
146
|
+
...(yield result.output.transport.getE071()).filter(object => object.pgmid !== '*')
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
trm_commons_1.Logger.setPrefix(originalLPrefix);
|
|
152
|
+
trm_commons_1.Inquirer.setPrefix(originalIPrefix);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// The cleanup must not see them as installed anymore.
|
|
156
|
+
context.rawInput.contextData.systemPackages = context.rawInput.contextData.systemPackages
|
|
157
|
+
.filter(pkg => !all.includes(pkg));
|
|
158
|
+
}),
|
|
159
|
+
revert: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
160
|
+
let firstError;
|
|
161
|
+
for (const rollback of [...(context.runtime.nestedRollbacks || [])].reverse()) {
|
|
162
|
+
try {
|
|
163
|
+
yield rollback();
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
firstError || (firstError = error);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
context.runtime.nestedRollbacks = [];
|
|
170
|
+
if (firstError) {
|
|
171
|
+
throw firstError;
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
};
|
|
@@ -2,6 +2,8 @@ import { SapMessage } from "./SapMessage";
|
|
|
2
2
|
export declare class ClientError extends Error {
|
|
3
3
|
exceptionType: string;
|
|
4
4
|
sapMessage: SapMessage;
|
|
5
|
+
resource?: string;
|
|
5
6
|
messageError?: string;
|
|
6
|
-
|
|
7
|
+
messageLog?: string[];
|
|
8
|
+
constructor(exceptionType: string, sapMessage: SapMessage, message?: string, resource?: string);
|
|
7
9
|
}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ClientError = void 0;
|
|
4
4
|
class ClientError extends Error {
|
|
5
|
-
constructor(exceptionType, sapMessage, message) {
|
|
5
|
+
constructor(exceptionType, sapMessage, message, resource) {
|
|
6
6
|
super(message);
|
|
7
7
|
this.exceptionType = exceptionType;
|
|
8
8
|
this.sapMessage = sapMessage;
|
|
9
|
+
this.resource = resource;
|
|
9
10
|
this.name = 'ClientError';
|
|
10
11
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
11
12
|
}
|