trm-core 9.10.6 → 10.0.1
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 +11 -0
- 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 -52
- 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
|
@@ -10,83 +10,153 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.addNamespace = void 0;
|
|
13
|
+
exports.flattenDevclasses = flattenDevclasses;
|
|
14
|
+
exports.getInstallNamespace = getInstallNamespace;
|
|
13
15
|
const trm_commons_1 = require("trm-commons");
|
|
14
16
|
const commons_1 = require("../../commons");
|
|
15
17
|
const systemConnector_1 = require("../../systemConnector");
|
|
16
18
|
const stopWarning_1 = require("../stopWarning");
|
|
19
|
+
function flattenDevclasses(pkg) {
|
|
20
|
+
return [
|
|
21
|
+
pkg.devclass,
|
|
22
|
+
...pkg.sub.flatMap(flattenDevclasses),
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the namespace packages are installed into: the target names, or the original names when
|
|
27
|
+
* `original` is set or `keepOriginal` is used. See getPackagesNamespace.
|
|
28
|
+
*/
|
|
29
|
+
function getInstallNamespace(context, original = false) {
|
|
30
|
+
var _a;
|
|
31
|
+
const hierarchy = context.runtime.package.hierarchy;
|
|
32
|
+
const originalDevclasses = flattenDevclasses(hierarchy);
|
|
33
|
+
if (original || context.rawInput.installData.installDevclass.keepOriginal) {
|
|
34
|
+
return (0, commons_1.getPackagesNamespace)(hierarchy.devclass, originalDevclasses);
|
|
35
|
+
}
|
|
36
|
+
//ignore stored mappings of devclasses that are no longer part of the release
|
|
37
|
+
const replacements = context.rawInput.installData.installDevclass.replacements.filter(o => originalDevclasses.includes(o.originalDevclass));
|
|
38
|
+
if (replacements.length === 0) {
|
|
39
|
+
return (0, commons_1.getPackagesNamespace)(hierarchy.devclass, originalDevclasses);
|
|
40
|
+
}
|
|
41
|
+
const rootDevclass = ((_a = replacements.find(o => o.originalDevclass === hierarchy.devclass)) === null || _a === void 0 ? void 0 : _a.installDevclass) || hierarchy.devclass;
|
|
42
|
+
return (0, commons_1.getPackagesNamespace)(rootDevclass, replacements.map(o => o.installDevclass));
|
|
43
|
+
}
|
|
44
|
+
/** Imports `namespace` with the repair license and texts shipped by the package manifest. */
|
|
45
|
+
function createNamespace(context, namespace) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
let replicense;
|
|
48
|
+
let aTexts = [];
|
|
49
|
+
if (context.runtime.package.data.manifest.namespace) {
|
|
50
|
+
replicense = context.runtime.package.data.manifest.namespace.replicense;
|
|
51
|
+
aTexts = context.runtime.package.data.manifest.namespace.texts.map(o => {
|
|
52
|
+
return {
|
|
53
|
+
namespace: context.runtime.package.data.manifest.namespace.ns || namespace,
|
|
54
|
+
spras: o.language,
|
|
55
|
+
descriptn: o.description,
|
|
56
|
+
owner: o.owner
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (!replicense) {
|
|
61
|
+
throw new Error(`Cannot use namespace ${namespace}: unknown repair license.`);
|
|
62
|
+
}
|
|
63
|
+
if (aTexts.length === 0) {
|
|
64
|
+
throw new Error(`Cannot use namespace ${namespace}: unknown description.`);
|
|
65
|
+
}
|
|
66
|
+
if (!context.runtime.stopWarningShown) {
|
|
67
|
+
context.runtime.stopWarningShown = true;
|
|
68
|
+
(0, stopWarning_1.stopWarning)('install');
|
|
69
|
+
}
|
|
70
|
+
trm_commons_1.Logger.loading(`Installing namespace ${namespace}...`);
|
|
71
|
+
// Track before the mutating await: SAP may commit the namespace and the
|
|
72
|
+
// connector can still fail while returning the response.
|
|
73
|
+
context.revert.namespace = namespace;
|
|
74
|
+
yield systemConnector_1.SystemConnector.addNamespace(namespace, replicense, aTexts);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Asks to import the namespace of the objects when the packages are installed outside of it.
|
|
79
|
+
* Declining keeps the previous behavior: the install continues without it.
|
|
80
|
+
*/
|
|
81
|
+
function importObjectsNamespace(context, namespace) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
if (context.rawInput.installData.installDevclass.skipNamespace === undefined && !context.rawInput.contextData.noInquirer) {
|
|
84
|
+
context.rawInput.installData.installDevclass.skipNamespace = !(yield trm_commons_1.Inquirer.prompt({
|
|
85
|
+
message: `Package objects use namespace ${namespace}, do you want to import it (repair license)?`,
|
|
86
|
+
name: 'skipNamespace',
|
|
87
|
+
type: 'confirm',
|
|
88
|
+
default: true
|
|
89
|
+
})).skipNamespace;
|
|
90
|
+
}
|
|
91
|
+
if (context.rawInput.installData.installDevclass.skipNamespace) {
|
|
92
|
+
trm_commons_1.Logger.warning(`Install will continue without importing namespace ${namespace}: its objects might not be assigned to the install packages. Run install with namespace import or manually add namespace in SE03.`, { important: true });
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
yield createNamespace(context, namespace);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Workflow step that registers the package namespace for repair when required.
|
|
100
|
+
*
|
|
101
|
+
* 1- set namespace
|
|
102
|
+
*
|
|
103
|
+
* 2- check if namespace already exists (only if customer namespace)
|
|
104
|
+
*
|
|
105
|
+
*
|
|
106
|
+
* 3- create namespace
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
17
109
|
exports.addNamespace = {
|
|
18
110
|
name: 'add-namespace',
|
|
19
111
|
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
|
|
21
|
-
|
|
112
|
+
var _a;
|
|
113
|
+
//1- set namespace
|
|
114
|
+
const originalNamespace = getInstallNamespace(context, true);
|
|
22
115
|
trm_commons_1.Logger.log(`Package original namespace is ${originalNamespace}`, true);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
116
|
+
context.runtime.namespace = getInstallNamespace(context);
|
|
117
|
+
if (context.runtime.namespace[0] !== '/') {
|
|
118
|
+
trm_commons_1.Logger.log(`Package install namespace is ${context.runtime.namespace}, continue`, true);
|
|
119
|
+
// Packages renamed out of the original namespace: the objects keep their names, and can only be
|
|
120
|
+
// assigned to the install packages (and repaired) when their namespace exists.
|
|
121
|
+
if (originalNamespace[0] === '/' && !((_a = (yield systemConnector_1.SystemConnector.getNamespace(originalNamespace))) === null || _a === void 0 ? void 0 : _a.trnspacet)) {
|
|
122
|
+
yield importObjectsNamespace(context, originalNamespace);
|
|
123
|
+
}
|
|
31
124
|
return;
|
|
32
125
|
}
|
|
33
|
-
|
|
34
|
-
|
|
126
|
+
//2- check if namespace already exists (only if customer namespace)
|
|
127
|
+
trm_commons_1.Logger.loading(`Checking namespace ${context.runtime.namespace}...`);
|
|
128
|
+
const namespaceCheck = yield systemConnector_1.SystemConnector.getNamespace(context.runtime.namespace);
|
|
35
129
|
if (namespaceCheck && namespaceCheck.trnspacet) {
|
|
36
|
-
trm_commons_1.Logger.log(`Namespace ${context.runtime.
|
|
130
|
+
trm_commons_1.Logger.log(`Namespace ${context.runtime.namespace} exists in system, continue`, true);
|
|
37
131
|
return;
|
|
38
132
|
}
|
|
39
133
|
else {
|
|
40
|
-
if (context.runtime.
|
|
41
|
-
|
|
42
|
-
trm_commons_1.Logger.warning(`Install will continue without importing namespace ${context.runtime.installData.namespace}. Run install with namespace import or manually add namespace in SE03.`, context.runtime.installData.namespace === '/ATRM/');
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
134
|
+
if (context.runtime.namespace === originalNamespace) {
|
|
135
|
+
//trying to install with the same namespace provided by package
|
|
45
136
|
if (context.rawInput.installData.installDevclass.skipNamespace === undefined && !context.rawInput.contextData.noInquirer) {
|
|
46
137
|
context.rawInput.installData.installDevclass.skipNamespace = !(yield trm_commons_1.Inquirer.prompt({
|
|
47
|
-
message: `Package uses namespace ${context.runtime.
|
|
138
|
+
message: `Package uses namespace ${context.runtime.namespace}, do you want to import it (repair license)?`,
|
|
48
139
|
name: 'skipNamespace',
|
|
49
140
|
type: 'confirm',
|
|
50
141
|
default: true
|
|
51
142
|
})).skipNamespace;
|
|
52
143
|
}
|
|
53
144
|
if (context.rawInput.installData.installDevclass.skipNamespace) {
|
|
54
|
-
|
|
145
|
+
if (context.rawInput.installData.installDevclass.keepOriginal) {
|
|
146
|
+
//no packages are being generated under this namespace, importing it is optional
|
|
147
|
+
trm_commons_1.Logger.warning(`Install will continue without importing namespace ${context.runtime.namespace}. Run install with namespace import or manually add namespace in SE03.`, { debug: context.runtime.namespace === '/ATRM/', important: true });
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
//namespace doesn't exist but packages must be generated, it's mandatory to have the namespace
|
|
151
|
+
throw new Error(`Cannot generate packages without namespace ${context.runtime.namespace}. Run install with namespace import or avoid renaming packages.`);
|
|
55
152
|
}
|
|
56
153
|
}
|
|
57
154
|
else {
|
|
58
|
-
|
|
155
|
+
//namespace doesn't exist, force user to create it manually
|
|
156
|
+
throw new Error(`Namespace ${context.runtime.namespace} doesn't exist in ${systemConnector_1.SystemConnector.getDest()}. Manually add namespace in SE03.`);
|
|
59
157
|
}
|
|
60
158
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (context.runtime.remotePackageData.manifest.namespace) {
|
|
64
|
-
replicense = context.runtime.remotePackageData.manifest.namespace.replicense;
|
|
65
|
-
aTexts = context.runtime.remotePackageData.manifest.namespace.texts.map(o => {
|
|
66
|
-
return {
|
|
67
|
-
namespace: context.runtime.remotePackageData.manifest.namespace.ns || context.runtime.installData.namespace,
|
|
68
|
-
spras: o.language,
|
|
69
|
-
descriptn: o.description,
|
|
70
|
-
owner: o.owner
|
|
71
|
-
};
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
if (!replicense) {
|
|
75
|
-
throw new Error(`Cannot use namespace ${context.runtime.installData.namespace}: unknown repair license.`);
|
|
76
|
-
}
|
|
77
|
-
if (aTexts.length === 0) {
|
|
78
|
-
throw new Error(`Cannot use namespace ${context.runtime.installData.namespace}: unknown description.`);
|
|
79
|
-
}
|
|
80
|
-
if (!context.runtime.stopWarningShown) {
|
|
81
|
-
context.runtime.stopWarningShown = true;
|
|
82
|
-
(0, stopWarning_1.stopWarning)('install');
|
|
83
|
-
}
|
|
84
|
-
trm_commons_1.Logger.loading(`Installing namespace ${context.runtime.installData.namespace}...`);
|
|
85
|
-
yield systemConnector_1.SystemConnector.addNamespace(context.runtime.installData.namespace, replicense, aTexts);
|
|
86
|
-
context.runtime.generatedData.namespace = context.runtime.installData.namespace;
|
|
87
|
-
}),
|
|
88
|
-
revert: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
-
if (context.runtime.generatedData.namespace) {
|
|
90
|
-
}
|
|
159
|
+
//3- create namespace
|
|
160
|
+
yield createNamespace(context, context.runtime.namespace);
|
|
91
161
|
})
|
|
92
162
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Step } from "@simonegaffurini/sammarksworkflow";
|
|
2
|
+
import { InstallWorkflowContext } from ".";
|
|
3
|
+
import { TrmPackage } from "../../trmPackage";
|
|
4
|
+
/** Installed package declaring a dependency on another installed package. */
|
|
5
|
+
export type PackageDependant = {
|
|
6
|
+
package: TrmPackage;
|
|
7
|
+
/** Version range the dependant requires. */
|
|
8
|
+
range: string;
|
|
9
|
+
};
|
|
10
|
+
/** Lists the dependencies on `target` declared by the other installed packages. */
|
|
11
|
+
export declare function getDependants(systemPackages: TrmPackage[], target: TrmPackage): PackageDependant[];
|
|
12
|
+
/**
|
|
13
|
+
* Prevents an upgrade from breaking the declared ranges of installed dependant packages.
|
|
14
|
+
*/
|
|
15
|
+
export declare const checkDependants: Step<InstallWorkflowContext>;
|
|
@@ -0,0 +1,74 @@
|
|
|
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.checkDependants = void 0;
|
|
13
|
+
exports.getDependants = getDependants;
|
|
14
|
+
const trm_commons_1 = require("trm-commons");
|
|
15
|
+
const semver_1 = require("semver");
|
|
16
|
+
const registry_1 = require("../../registry");
|
|
17
|
+
const trmPackage_1 = require("../../trmPackage");
|
|
18
|
+
/** Lists the dependencies on `target` declared by the other installed packages. */
|
|
19
|
+
function getDependants(systemPackages, target) {
|
|
20
|
+
return systemPackages.flatMap(systemPackage => {
|
|
21
|
+
if (!systemPackage.manifest || trmPackage_1.TrmPackage.compare(systemPackage, target)) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
return (systemPackage.manifest.get().dependencies || [])
|
|
25
|
+
.filter(dependency => trmPackage_1.TrmPackage.compare(new trmPackage_1.TrmPackage(dependency.name, registry_1.RegistryProvider.getRegistry(dependency.registry)), target))
|
|
26
|
+
.map(dependency => ({
|
|
27
|
+
package: systemPackage,
|
|
28
|
+
range: dependency.version
|
|
29
|
+
}));
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** Explains how to unblock an upgrade rejected by incompatible dependants. */
|
|
33
|
+
function logResolutionGuide(upgradedPackage, upgradedVersion, incompatibleDependants, ranges) {
|
|
34
|
+
const target = `"${upgradedPackage.packageName}" v${upgradedVersion}`;
|
|
35
|
+
const names = incompatibleDependants.map(dependant => `"${dependant.package.packageName}"`).join(', ');
|
|
36
|
+
trm_commons_1.Logger.info(`How to upgrade to ${target}:`, { important: true });
|
|
37
|
+
trm_commons_1.Logger.info(` 1. Install a newer release of ${names} whose dependency on "${upgradedPackage.packageName}" accepts v${upgradedVersion}; installing it can also upgrade "${upgradedPackage.packageName}" as its dependency.`, { important: true });
|
|
38
|
+
trm_commons_1.Logger.info(` 2. If ${target} is still not installed, run this install again.`, { important: true });
|
|
39
|
+
trm_commons_1.Logger.info(`If no compatible release of ${names} is available, keep the current version or install a version of "${upgradedPackage.packageName}" that satisfies all dependant ranges (${[...new Set(ranges)].join(', ')}).`, { important: true });
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Prevents an upgrade from breaking the declared ranges of installed dependant packages.
|
|
43
|
+
*/
|
|
44
|
+
exports.checkDependants = {
|
|
45
|
+
name: 'check-dependants',
|
|
46
|
+
filter: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
if (!context.runtime.update) {
|
|
48
|
+
trm_commons_1.Logger.log(`Skipping check dependants check (no upgrade/downgrade)`, true);
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
const upgradedPackage = context.runtime.update;
|
|
57
|
+
const upgradedVersion = context.runtime.package.data.manifest.version;
|
|
58
|
+
const dependants = getDependants(context.rawInput.contextData.systemPackages, upgradedPackage).map(dependant => (Object.assign(Object.assign({}, dependant), { compatible: (0, semver_1.satisfies)(upgradedVersion, dependant.range, { includePrerelease: true }) })));
|
|
59
|
+
if (dependants.length === 0) {
|
|
60
|
+
trm_commons_1.Logger.info(`No installed packages depend on "${upgradedPackage.packageName}".`, true);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const incompatibleDependants = dependants.filter(dependant => !dependant.compatible);
|
|
64
|
+
dependants
|
|
65
|
+
.filter(dependant => dependant.compatible)
|
|
66
|
+
.forEach(dependant => trm_commons_1.Logger.info(`Dependant "${dependant.package.packageName}" accepts "${upgradedPackage.packageName}" v${upgradedVersion} (${dependant.range}); no action needed.`));
|
|
67
|
+
if (incompatibleDependants.length === 0) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
incompatibleDependants.forEach(dependant => trm_commons_1.Logger.error(`Dependant "${dependant.package.packageName}" requires "${upgradedPackage.packageName}" ${dependant.range}, which does not accept v${upgradedVersion}.`, { important: true }));
|
|
71
|
+
logResolutionGuide(upgradedPackage, upgradedVersion, incompatibleDependants, dependants.map(dependant => dependant.range));
|
|
72
|
+
throw new Error(`Upgrade aborted: incompatible dependant packages must be upgraded first.`);
|
|
73
|
+
})
|
|
74
|
+
};
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import { Step } from "@simonegaffurini/sammarksworkflow";
|
|
2
2
|
import { InstallWorkflowContext } from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Workflow step that identifies missing or incompatible dependencies on the target system.
|
|
5
|
+
* Incompatible dependencies are queued with their installed version, so they are not reported as missing.
|
|
6
|
+
*
|
|
7
|
+
* 1- execute check dependencies workflow
|
|
8
|
+
*
|
|
9
|
+
* 2- reject installed dependencies with an unreadable manifest
|
|
10
|
+
*
|
|
11
|
+
* 3- filter dependencies
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
3
14
|
export declare const checkDependencies: Step<InstallWorkflowContext>;
|
|
@@ -12,7 +12,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.checkDependencies = void 0;
|
|
13
13
|
const trm_commons_1 = require("trm-commons");
|
|
14
14
|
const checkPackageDependencies_1 = require("../checkPackageDependencies");
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Workflow step that identifies missing or incompatible dependencies on the target system.
|
|
17
|
+
* Incompatible dependencies are queued with their installed version, so they are not reported as missing.
|
|
18
|
+
*
|
|
19
|
+
* 1- execute check dependencies workflow
|
|
20
|
+
*
|
|
21
|
+
* 2- reject installed dependencies with an unreadable manifest
|
|
22
|
+
*
|
|
23
|
+
* 3- filter dependencies
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
16
26
|
exports.checkDependencies = {
|
|
17
27
|
name: 'check-dependencies',
|
|
18
28
|
filter: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -25,10 +35,10 @@ exports.checkDependencies = {
|
|
|
25
35
|
}
|
|
26
36
|
}),
|
|
27
37
|
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
-
|
|
38
|
+
//1- execute check dependencies workflow
|
|
29
39
|
const inputData = {
|
|
30
40
|
packageData: {
|
|
31
|
-
manifest: context.runtime.
|
|
41
|
+
manifest: context.runtime.package.data.manifest
|
|
32
42
|
},
|
|
33
43
|
contextData: {
|
|
34
44
|
systemPackages: context.rawInput.contextData.systemPackages
|
|
@@ -38,18 +48,27 @@ exports.checkDependencies = {
|
|
|
38
48
|
information: false
|
|
39
49
|
}
|
|
40
50
|
};
|
|
41
|
-
trm_commons_1.Logger.loading(`Checking dependencies...`);
|
|
42
|
-
trm_commons_1.Logger.log(`Ready to execute sub-workflow ${SUBWORKFLOW_NAME}, input data: ${(0, trm_commons_1.inspect)(inputData, { breakLength: Infinity, compact: true })}`, true);
|
|
51
|
+
trm_commons_1.Logger.loading(`Checking package dependencies...`);
|
|
43
52
|
const result = yield (0, checkPackageDependencies_1.checkPackageDependencies)(inputData);
|
|
44
|
-
trm_commons_1.Logger.log(`Workflow ${SUBWORKFLOW_NAME} result: ${(0, trm_commons_1.inspect)(result, { breakLength: Infinity, compact: true })}`, true);
|
|
45
53
|
if (result.dependencies.length > 0) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
const installed = result.dependencyStatus.filter(o => o.status === 'ok').length;
|
|
55
|
+
const missing = result.dependencyStatus.filter(o => o.status === 'notFound').length;
|
|
56
|
+
const incompatible = result.dependencyStatus.filter(o => o.status === 'versionMismatch').length;
|
|
57
|
+
const noun = result.dependencies.length === 1 ? 'dependency' : 'dependencies';
|
|
58
|
+
trm_commons_1.Logger.info(`"${context.rawInput.packageData.name}" has ${result.dependencies.length} ${noun}: ${installed} installed, ${missing} missing, ${incompatible} incompatible.`);
|
|
59
|
+
}
|
|
60
|
+
//2- reject installed dependencies with an unreadable manifest
|
|
61
|
+
const unreadable = result.dependencyStatus.filter(o => o.status === 'manifestUnreadable');
|
|
62
|
+
if (unreadable.length > 0) {
|
|
63
|
+
throw new Error(`Cannot verify installed dependencies ${unreadable.map(o => `"${o.dependency.name}"`).join(', ')}: package is installed but its manifest is unreadable.`);
|
|
52
64
|
}
|
|
53
|
-
|
|
65
|
+
//3- filter dependencies
|
|
66
|
+
context.runtime.dependencies = result.dependencyStatus
|
|
67
|
+
.filter(o => o.status === 'notFound' || o.status === 'versionMismatch')
|
|
68
|
+
.map(o => ({
|
|
69
|
+
dependency: o.dependency,
|
|
70
|
+
status: o.status,
|
|
71
|
+
installedVersion: o.installedVersion
|
|
72
|
+
}));
|
|
54
73
|
})
|
|
55
74
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Step } from "@simonegaffurini/sammarksworkflow";
|
|
2
|
+
import { InstallWorkflowContext } from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Workflow step that rejects dependency cycles and version conflicts the install would run into,
|
|
5
|
+
* before anything is locked or installed. A dependency already installed in a compatible version is
|
|
6
|
+
* not installed again, so it ends the walk on that branch. Any other dependency is resolved to the
|
|
7
|
+
* release a dependency install would select (lockfile entry or newest release in range) and walked.
|
|
8
|
+
* The walk follows the install order: the first package reaching a dependency decides its version,
|
|
9
|
+
* and a later range that version doesn't satisfy is a conflict, which would otherwise fail midway,
|
|
10
|
+
* after earlier dependencies were installed.
|
|
11
|
+
*
|
|
12
|
+
* 1- walk the dependency graph and abort on the first cycle or version conflict
|
|
13
|
+
*
|
|
14
|
+
* 2- abort when a replaced dependency no longer satisfies another installed package
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare const checkDependencyCycles: Step<InstallWorkflowContext>;
|
|
@@ -0,0 +1,105 @@
|
|
|
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.checkDependencyCycles = void 0;
|
|
13
|
+
const trm_commons_1 = require("trm-commons");
|
|
14
|
+
const registry_1 = require("../../registry");
|
|
15
|
+
const trmPackage_1 = require("../../trmPackage");
|
|
16
|
+
const findInstallRelease_1 = require("../installDependency/findInstallRelease");
|
|
17
|
+
const utils_1 = require("../commons/utils");
|
|
18
|
+
const semver_1 = require("semver");
|
|
19
|
+
/**
|
|
20
|
+
* Workflow step that rejects dependency cycles and version conflicts the install would run into,
|
|
21
|
+
* before anything is locked or installed. A dependency already installed in a compatible version is
|
|
22
|
+
* not installed again, so it ends the walk on that branch. Any other dependency is resolved to the
|
|
23
|
+
* release a dependency install would select (lockfile entry or newest release in range) and walked.
|
|
24
|
+
* The walk follows the install order: the first package reaching a dependency decides its version,
|
|
25
|
+
* and a later range that version doesn't satisfy is a conflict, which would otherwise fail midway,
|
|
26
|
+
* after earlier dependencies were installed.
|
|
27
|
+
*
|
|
28
|
+
* 1- walk the dependency graph and abort on the first cycle or version conflict
|
|
29
|
+
*
|
|
30
|
+
* 2- abort when a replaced dependency no longer satisfies another installed package
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
exports.checkDependencyCycles = {
|
|
34
|
+
name: 'check-dependency-cycles',
|
|
35
|
+
filter: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
if (context.rawInput.installData.checks.noDependencies) {
|
|
37
|
+
trm_commons_1.Logger.log(`Skipping dependency cycles check (user input)`, true);
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
//1- walk the dependency graph and abort on the first cycle or version conflict
|
|
47
|
+
trm_commons_1.Logger.loading(`Checking dependency graph...`);
|
|
48
|
+
const systemPackages = context.rawInput.contextData.systemPackages || [];
|
|
49
|
+
const lockfile = context.rawInput.installData.checks.lockfile;
|
|
50
|
+
const root = new trmPackage_1.TrmPackage(context.rawInput.packageData.name, context.rawInput.packageData.registry);
|
|
51
|
+
//completely walked dependencies (a dependency still being walked is on the path)
|
|
52
|
+
const planned = [];
|
|
53
|
+
const visit = (manifest, path) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
+
const requiredBy = path[path.length - 1].packageName;
|
|
55
|
+
for (const dependency of manifest.dependencies || []) {
|
|
56
|
+
const trmPackage = new trmPackage_1.TrmPackage(dependency.name, registry_1.RegistryProvider.getRegistry(dependency.registry));
|
|
57
|
+
const plan = planned.find(o => trmPackage_1.TrmPackage.compare(o.trmPackage, trmPackage));
|
|
58
|
+
if (plan) {
|
|
59
|
+
if (!(0, semver_1.satisfies)(plan.version, dependency.version, { includePrerelease: true })) {
|
|
60
|
+
throw new Error(`Install aborted: dependency "${trmPackage.packageName}" version conflict: "${plan.requiredBy}" requires ${plan.versionRange} (v${plan.version} ${plan.kept ? 'installed' : 'to install'}), "${requiredBy}" requires ${dependency.version}.`);
|
|
61
|
+
}
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const installed = (0, utils_1.getInstalledDependency)(systemPackages, trmPackage, dependency.version);
|
|
65
|
+
if (installed.status === 'ok') {
|
|
66
|
+
//the package being installed changes version: it is not planned
|
|
67
|
+
if (!trmPackage_1.TrmPackage.compare(trmPackage, root)) {
|
|
68
|
+
planned.push({ trmPackage, version: installed.installedVersion, kept: true, requiredBy, versionRange: dependency.version });
|
|
69
|
+
}
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
//the same package installed from another registry (e.g. a .trm file) owns the objects: it can't be installed again
|
|
73
|
+
const otherRegistry = systemPackages.find(o => o.compareName(trmPackage.packageName) && !o.compareRegistry(trmPackage.registry));
|
|
74
|
+
if (otherRegistry) {
|
|
75
|
+
const source = (registry) => registry.getRegistryType() === registry_1.RegistryType.LOCAL ? 'a .trm file' : `registry ${registry.name}`;
|
|
76
|
+
throw new Error(`Install aborted: dependency "${trmPackage.packageName}" must be installed from ${source(trmPackage.registry)}, but it's installed from ${source(otherRegistry.registry)}. Delete it, then install again.`);
|
|
77
|
+
}
|
|
78
|
+
const cycleStart = path.findIndex(o => trmPackage_1.TrmPackage.compare(o, trmPackage));
|
|
79
|
+
if (cycleStart >= 0) {
|
|
80
|
+
const cycle = [...path.slice(cycleStart), trmPackage].map(o => `"${o.packageName}"`).join(' -> ');
|
|
81
|
+
throw new Error(`Install aborted: cyclic dependency detected ${cycle}.`);
|
|
82
|
+
}
|
|
83
|
+
const release = yield (0, findInstallRelease_1.selectDependencyRelease)(trmPackage, trmPackage.registry, dependency.version, lockfile);
|
|
84
|
+
const releaseManifest = (yield trmPackage.registry.getPackage(trmPackage.packageName, release.version)).manifest;
|
|
85
|
+
yield visit(releaseManifest, [...path, trmPackage]);
|
|
86
|
+
planned.push({ trmPackage, version: release.version, kept: false, requiredBy, versionRange: dependency.version });
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
yield visit(context.runtime.package.data.manifest, [root]);
|
|
90
|
+
//2- a dependency installed in another version must still satisfy the other installed packages requiring it
|
|
91
|
+
const changed = planned.filter(plan => !plan.kept);
|
|
92
|
+
for (const installedPackage of systemPackages) {
|
|
93
|
+
if (trmPackage_1.TrmPackage.compare(installedPackage, root) || changed.some(plan => trmPackage_1.TrmPackage.compare(plan.trmPackage, installedPackage))) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
for (const dependency of ((_b = (_a = installedPackage.manifest) === null || _a === void 0 ? void 0 : _a.get()) === null || _b === void 0 ? void 0 : _b.dependencies) || []) {
|
|
97
|
+
const plan = changed.find(o => trmPackage_1.TrmPackage.compare(o.trmPackage, new trmPackage_1.TrmPackage(dependency.name, registry_1.RegistryProvider.getRegistry(dependency.registry))));
|
|
98
|
+
if (plan && (0, utils_1.getInstalledDependency)(systemPackages, plan.trmPackage, plan.versionRange).status !== 'notFound'
|
|
99
|
+
&& !(0, semver_1.satisfies)(plan.version, dependency.version, { includePrerelease: true })) {
|
|
100
|
+
throw new Error(`Install aborted: dependency "${plan.trmPackage.packageName}" would be replaced with v${plan.version}, but installed package "${installedPackage.packageName}" requires ${dependency.version}. Upgrade "${installedPackage.packageName}" first.`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Step } from "@simonegaffurini/sammarksworkflow";
|
|
2
|
+
import { InstallWorkflowContext } from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Workflow step that blocks installation when the manifest engines are not satisfied.
|
|
5
|
+
*
|
|
6
|
+
* 1- execute check engines workflow
|
|
7
|
+
*
|
|
8
|
+
* 2- check result (detail each alternative of a failed anyOf)
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare const checkEngines: Step<InstallWorkflowContext>;
|
|
@@ -0,0 +1,100 @@
|
|
|
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.checkEngines = void 0;
|
|
13
|
+
const trm_commons_1 = require("trm-commons");
|
|
14
|
+
const checkEngines_1 = require("../checkEngines");
|
|
15
|
+
function requirementsError(missingSapEntries, notMetEngines) {
|
|
16
|
+
const parts = [
|
|
17
|
+
missingSapEntries > 0 ? `${missingSapEntries} system ${missingSapEntries === 1 ? 'requirement' : 'requirements'}` : '',
|
|
18
|
+
notMetEngines > 0 ? `${notMetEngines} engine ${notMetEngines === 1 ? 'requirement' : 'requirements'}` : ''
|
|
19
|
+
].filter(Boolean);
|
|
20
|
+
const total = missingSapEntries + notMetEngines;
|
|
21
|
+
return new Error(`Install aborted. ${parts.join(' and ')} ${total === 1 ? 'is' : 'are'} not met!`);
|
|
22
|
+
}
|
|
23
|
+
function isAnyOf(result) {
|
|
24
|
+
return result.path === 'anyOf' || result.path.endsWith('.anyOf');
|
|
25
|
+
}
|
|
26
|
+
function describeNotMet(result) {
|
|
27
|
+
return `expected ${result.requirement}${result.reason ? ` (${result.reason})` : result.actual ? `, found ${result.actual}` : ''}`;
|
|
28
|
+
}
|
|
29
|
+
/** Lists the unmet requirements of a failed `anyOf`, skipping those under a satisfied nested `anyOf`. */
|
|
30
|
+
function getAnyOfDetails(results, anyOf) {
|
|
31
|
+
const satisfied = results.filter(o => isAnyOf(o) && o.ok).map(o => `${o.path}[`);
|
|
32
|
+
return results.filter(o => !o.ok && o.path.startsWith(`${anyOf.path}[`) && !satisfied.some(prefix => o.path.startsWith(prefix)));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Workflow step that blocks installation when the manifest engines are not satisfied.
|
|
36
|
+
*
|
|
37
|
+
* 1- execute check engines workflow
|
|
38
|
+
*
|
|
39
|
+
* 2- check result (detail each alternative of a failed anyOf)
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
exports.checkEngines = {
|
|
43
|
+
name: 'check-engines',
|
|
44
|
+
filter: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
if (context.runtime.missingSapEntries > 0) {
|
|
46
|
+
// Aborts the install for the missing SAP entries.
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
else if (context.rawInput.installData.checks.noEngines) {
|
|
50
|
+
trm_commons_1.Logger.log(`Skipping engines check (user input)`, true);
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
else if (!context.runtime.package.data.manifest.engines) {
|
|
54
|
+
trm_commons_1.Logger.log(`Package has no engines, skipping check`, true);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}),
|
|
61
|
+
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
+
var _a;
|
|
63
|
+
const missingSapEntries = context.runtime.missingSapEntries || 0;
|
|
64
|
+
if (context.rawInput.installData.checks.noEngines || !context.runtime.package.data.manifest.engines) {
|
|
65
|
+
throw requirementsError(missingSapEntries, 0);
|
|
66
|
+
}
|
|
67
|
+
//1- execute check engines workflow
|
|
68
|
+
const inputData = {
|
|
69
|
+
contextData: {
|
|
70
|
+
coreVersion: (_a = context.rawInput.contextData) === null || _a === void 0 ? void 0 : _a.coreVersion
|
|
71
|
+
},
|
|
72
|
+
packageData: {
|
|
73
|
+
manifest: context.runtime.package.data.manifest
|
|
74
|
+
},
|
|
75
|
+
printOptions: {
|
|
76
|
+
enginesStatus: false,
|
|
77
|
+
information: false
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
trm_commons_1.Logger.loading(`Checking engines...`);
|
|
81
|
+
const result = yield (0, checkEngines_1.checkEngines)(inputData);
|
|
82
|
+
//2- check result
|
|
83
|
+
const notMet = result.results.filter(o => o.required && !o.ok);
|
|
84
|
+
if (!result.passed) {
|
|
85
|
+
notMet.forEach(o => {
|
|
86
|
+
trm_commons_1.Logger.error(`Engine requirement ${o.path} not met: ${describeNotMet(o)}`, { important: true });
|
|
87
|
+
if (isAnyOf(o)) {
|
|
88
|
+
getAnyOfDetails(result.results, o).forEach(detail => {
|
|
89
|
+
trm_commons_1.Logger.error(` ${detail.path}: ${describeNotMet(detail)}`, { important: true });
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
throw requirementsError(missingSapEntries, notMet.length);
|
|
94
|
+
}
|
|
95
|
+
trm_commons_1.Logger.success(`Engines checked.`);
|
|
96
|
+
if (missingSapEntries > 0) {
|
|
97
|
+
throw requirementsError(missingSapEntries, 0);
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Step } from "@simonegaffurini/sammarksworkflow";
|
|
2
|
+
import { InstallWorkflowContext } from ".";
|
|
3
|
+
import { DEVCLASS } from "../../client";
|
|
4
|
+
/**
|
|
5
|
+
* Validates one install package name chosen by the user, so the prompt can ask again: it must be
|
|
6
|
+
* outside the SAP packages of the other installed TRM packages and, when it exists, contain none of
|
|
7
|
+
* their root packages. check-install-devclass repeats the check on the final choice.
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateInstallDevclass(context: InstallWorkflowContext, devclass: DEVCLASS): Promise<true | string>;
|
|
10
|
+
/**
|
|
11
|
+
* Workflow step that rejects an install whose target ABAP packages would nest it with another
|
|
12
|
+
* installed TRM package, before anything is locked or installed.
|
|
13
|
+
*
|
|
14
|
+
* 1- collect the ABAP package trees of the other installed TRM packages
|
|
15
|
+
*
|
|
16
|
+
* 2- reject install packages inside one of those trees
|
|
17
|
+
*
|
|
18
|
+
* 3- reject existing install packages that contain another TRM package
|
|
19
|
+
*
|
|
20
|
+
* On update, the package's own installed tree stays allowed, also when it is already nested
|
|
21
|
+
* in another TRM package.
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
export declare const checkInstallDevclass: Step<InstallWorkflowContext>;
|