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
|
@@ -8,108 +8,182 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.init = void 0;
|
|
13
16
|
const trm_commons_1 = require("trm-commons");
|
|
14
|
-
const crypto_1 = require("crypto");
|
|
15
17
|
const systemConnector_1 = require("../../systemConnector");
|
|
16
18
|
const registry_1 = require("../../registry");
|
|
17
19
|
const semver_1 = require("semver");
|
|
20
|
+
const manifest_1 = require("../../manifest");
|
|
21
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
22
|
+
const prompts_1 = require("../commons/prompts");
|
|
23
|
+
const utils_1 = require("../commons/utils");
|
|
24
|
+
function sameName(a, b) {
|
|
25
|
+
return a.trim().toUpperCase() === b.trim().toUpperCase();
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Fills the requested release from the lockfile root, before it is fetched: the root version when
|
|
29
|
+
* none is requested and the root integrity when none is expected.
|
|
30
|
+
* @throws When the package, the requested version, or the expected integrity conflicts with the lockfile root.
|
|
31
|
+
*/
|
|
32
|
+
function applyRootLock(context, rootLock) {
|
|
33
|
+
const packageData = context.rawInput.packageData;
|
|
34
|
+
//the name of a local artifact is only known once it's read
|
|
35
|
+
if (packageData.registry.getRegistryType() !== registry_1.RegistryType.LOCAL && !sameName(packageData.name, rootLock.name)) {
|
|
36
|
+
throw new Error(`Lockfile is for package "${rootLock.name}", cannot install "${packageData.name}" with it.`);
|
|
37
|
+
}
|
|
38
|
+
if (!packageData.version) {
|
|
39
|
+
packageData.version = rootLock.version;
|
|
40
|
+
trm_commons_1.Logger.info(`Using ${rootLock.name} v${rootLock.version} from lockfile.`);
|
|
41
|
+
}
|
|
42
|
+
else if ((0, semver_1.valid)(packageData.version) && !(0, semver_1.eq)(packageData.version, rootLock.version)) {
|
|
43
|
+
throw new Error(`Requested version ${packageData.version} conflicts with lockfile version ${rootLock.version} of "${rootLock.name}". Omit the version or regenerate the lockfile.`);
|
|
44
|
+
}
|
|
45
|
+
if (rootLock.integrity) {
|
|
46
|
+
if (packageData.integrity === undefined) {
|
|
47
|
+
packageData.integrity = rootLock.integrity;
|
|
48
|
+
}
|
|
49
|
+
else if (packageData.integrity !== rootLock.integrity) {
|
|
50
|
+
throw new Error(`Requested integrity conflicts with lockfile integrity of "${rootLock.name}" v${rootLock.version}.`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Checks the fetched release against the lockfile root: a distribution tag or a local artifact
|
|
56
|
+
* may resolve to another package, release, or registry.
|
|
57
|
+
* @throws When the fetched release is not the lockfile root.
|
|
58
|
+
*/
|
|
59
|
+
function checkRootLock(context, rootLock) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const manifest = context.runtime.package.data.manifest;
|
|
62
|
+
if (!sameName(manifest.name, rootLock.name)) {
|
|
63
|
+
throw new Error(`Lockfile is for package "${rootLock.name}", cannot install "${manifest.name}" with it.`);
|
|
64
|
+
}
|
|
65
|
+
if (!(0, semver_1.valid)(manifest.version) || !(0, semver_1.eq)(manifest.version, rootLock.version)) {
|
|
66
|
+
throw new Error(`Release "${manifest.name}" v${manifest.version} (${context.rawInput.packageData.version}) conflicts with lockfile version ${rootLock.version}. Omit the version or regenerate the lockfile.`);
|
|
67
|
+
}
|
|
68
|
+
if (rootLock.registry) {
|
|
69
|
+
const installRegistry = (yield (0, utils_1.resolveInstallPackage)(context.rawInput.packageData.registry, manifest.name)).registry;
|
|
70
|
+
if (installRegistry.getRegistryType() !== registry_1.RegistryType.LOCAL && installRegistry.endpoint.trim().toLowerCase() !== rootLock.registry.trim().toLowerCase()) {
|
|
71
|
+
throw new Error(`Lockfile is for package "${rootLock.name}" of registry "${rootLock.registry}", cannot install it from registry "${installRegistry.endpoint}".`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Workflow step that fetches the release, validates install settings, and initializes rollback state.
|
|
78
|
+
*
|
|
79
|
+
* 1- fill context data
|
|
80
|
+
*
|
|
81
|
+
* 2- fill missing input data
|
|
82
|
+
*
|
|
83
|
+
* 3- check install transport layer
|
|
84
|
+
*
|
|
85
|
+
* 4- check/set system target
|
|
86
|
+
*
|
|
87
|
+
* 5- check if already installed
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
18
90
|
exports.init = {
|
|
19
91
|
name: 'init',
|
|
20
92
|
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
|
|
93
|
+
var _a, _b, _c;
|
|
22
94
|
const registry = context.rawInput.packageData.registry;
|
|
23
|
-
|
|
24
|
-
var manifest;
|
|
25
|
-
var packageData;
|
|
26
|
-
var actualRegistry;
|
|
27
|
-
if (registry.getRegistryType() === registry_1.RegistryType.LOCAL) {
|
|
28
|
-
try {
|
|
29
|
-
artifact = yield registry.downloadArtifact('dummy', 'dummy');
|
|
30
|
-
}
|
|
31
|
-
catch (_a) {
|
|
32
|
-
throw new Error(`Unable to read local package.`);
|
|
33
|
-
}
|
|
34
|
-
const oManifest = artifact.getManifest();
|
|
35
|
-
manifest = oManifest.get();
|
|
36
|
-
packageData.manifest = manifest;
|
|
37
|
-
actualRegistry = oManifest.getPackage().registry;
|
|
38
|
-
context.rawInput.packageData.name = manifest.name;
|
|
39
|
-
}
|
|
40
|
-
if (registry.getRegistryType() !== registry_1.RegistryType.LOCAL) {
|
|
41
|
-
trm_commons_1.Logger.loading(`Fetching package in registry ${registry.name}...`);
|
|
42
|
-
packageData = yield registry.getPackage(context.rawInput.packageData.name, context.rawInput.packageData.version || 'latest');
|
|
43
|
-
artifact = yield registry.downloadArtifact(packageData.name, packageData.manifest.version);
|
|
44
|
-
const checksum = (0, crypto_1.createHash)("sha512").update(artifact.binary).digest("base64");
|
|
45
|
-
if (checksum !== packageData.checksum) {
|
|
46
|
-
var ping;
|
|
47
|
-
try {
|
|
48
|
-
ping = yield registry.ping();
|
|
49
|
-
}
|
|
50
|
-
catch (_b) { }
|
|
51
|
-
trm_commons_1.Logger.error(`SECURITY ISSUE! Release integrity does NOT match!`);
|
|
52
|
-
trm_commons_1.Logger.error(`SECURITY ISSUE! Expected SHA is ${packageData.checksum}, current SHA is ${checksum}`);
|
|
53
|
-
trm_commons_1.Logger.error(`SECURITY ISSUE! Please, report the issue to ${ping && ping.alert_email ? ping.alert_email : 'registry moderation team'}`);
|
|
54
|
-
throw new Error(`Cannot continue due to security issues.`);
|
|
55
|
-
}
|
|
56
|
-
manifest = artifact.getManifest().get();
|
|
57
|
-
}
|
|
58
|
-
trm_commons_1.Logger.info(`Ready to install ${manifest.name} v${manifest.version}${!(0, semver_1.valid)(context.rawInput.packageData.version) ? (' (' + (context.rawInput.packageData.version || 'latest') + ')') : ''}.`);
|
|
59
|
-
if (!context.rawInput.contextData) {
|
|
60
|
-
context.rawInput.contextData = {};
|
|
61
|
-
}
|
|
95
|
+
//1- fill context data
|
|
62
96
|
context.runtime = {
|
|
63
|
-
stopWarningShown: context.rawInput.contextData.noStopWarning ? true : false,
|
|
64
|
-
isTrmServer: false,
|
|
65
97
|
isTrmRest: false,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
contents: false
|
|
73
|
-
},
|
|
74
|
-
dependenciesToInstall: [],
|
|
75
|
-
r3trans: undefined,
|
|
76
|
-
packageTransports: {
|
|
77
|
-
devc: {
|
|
78
|
-
binaries: undefined,
|
|
79
|
-
instance: undefined
|
|
80
|
-
},
|
|
81
|
-
tadir: {
|
|
82
|
-
binaries: undefined,
|
|
83
|
-
instance: undefined
|
|
84
|
-
},
|
|
85
|
-
cust: [],
|
|
86
|
-
lang: {
|
|
87
|
-
binaries: undefined,
|
|
88
|
-
instance: undefined
|
|
89
|
-
}
|
|
98
|
+
isTrmServer: false,
|
|
99
|
+
isLocal: registry.getRegistryType() === registry_1.RegistryType.LOCAL,
|
|
100
|
+
update: undefined, //if has value, it's the package from system that we're updating
|
|
101
|
+
package: {
|
|
102
|
+
data: undefined,
|
|
103
|
+
hierarchy: undefined
|
|
90
104
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
105
|
+
transports: {
|
|
106
|
+
devc: undefined,
|
|
107
|
+
tadir: undefined,
|
|
108
|
+
lang: undefined,
|
|
109
|
+
cust: []
|
|
96
110
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
transports: []
|
|
111
|
+
dele: undefined,
|
|
112
|
+
transportEntries: {
|
|
113
|
+
tdevct: []
|
|
101
114
|
},
|
|
102
|
-
|
|
103
|
-
|
|
115
|
+
dependencies: [],
|
|
116
|
+
namespace: undefined, //will be calculated from either origin devclass or target devclass later
|
|
117
|
+
installRegistry: undefined,
|
|
118
|
+
previousInstallPackages: [],
|
|
119
|
+
previousInstallTransports: [],
|
|
120
|
+
dependencyRollbacks: [],
|
|
121
|
+
dependencyReleases: [],
|
|
122
|
+
installedDependencies: [],
|
|
123
|
+
stopWarningShown: false
|
|
124
|
+
};
|
|
125
|
+
context.output = {
|
|
126
|
+
manifest: undefined,
|
|
127
|
+
transport: undefined
|
|
128
|
+
};
|
|
129
|
+
context.revert = {
|
|
130
|
+
transports: {
|
|
131
|
+
devc: undefined,
|
|
132
|
+
tadir: undefined,
|
|
133
|
+
lang: undefined,
|
|
134
|
+
cust: []
|
|
104
135
|
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
136
|
+
cleanupTransport: undefined,
|
|
137
|
+
cleanupImported: false,
|
|
138
|
+
cleanupSucceeded: false,
|
|
139
|
+
importStarted: false,
|
|
140
|
+
importedEntries: [],
|
|
141
|
+
importedCustomizing: [],
|
|
142
|
+
packageHierarchy: [],
|
|
143
|
+
packageTransportLayers: [],
|
|
144
|
+
createdTransports: { cust: [] },
|
|
145
|
+
sapPackages: [],
|
|
146
|
+
dele: undefined,
|
|
147
|
+
metadataWriteStarted: false,
|
|
148
|
+
metadataPackageRegistry: undefined,
|
|
149
|
+
metadataPackageRow: undefined,
|
|
150
|
+
metadataPreviousPackageRow: undefined,
|
|
151
|
+
namespace: undefined
|
|
110
152
|
};
|
|
111
|
-
|
|
112
|
-
context.
|
|
153
|
+
//the lockfile root pins the release (and its integrity) of the package being installed
|
|
154
|
+
const rootLock = context.rawInput.dependency ? undefined : (_c = (_b = (_a = context.rawInput.installData) === null || _a === void 0 ? void 0 : _a.checks) === null || _b === void 0 ? void 0 : _b.lockfile) === null || _c === void 0 ? void 0 : _c.getRootLock();
|
|
155
|
+
if (rootLock) {
|
|
156
|
+
applyRootLock(context, rootLock);
|
|
157
|
+
}
|
|
158
|
+
trm_commons_1.Logger.loading(`Fetching package in registry ${registry.name}...`);
|
|
159
|
+
context.runtime.package.data = yield registry.getPackage(context.rawInput.packageData.name, context.rawInput.packageData.version || 'latest');
|
|
160
|
+
context.output.manifest = context.runtime.package.data.manifest;
|
|
161
|
+
if (rootLock) {
|
|
162
|
+
yield checkRootLock(context, rootLock);
|
|
163
|
+
}
|
|
164
|
+
//the release whose transports are imported must be the expected one (e.g. locked)
|
|
165
|
+
const expectedIntegrity = context.rawInput.packageData.integrity;
|
|
166
|
+
if (expectedIntegrity !== undefined && context.runtime.package.data.checksum !== expectedIntegrity) {
|
|
167
|
+
trm_commons_1.Logger.error(`SECURITY ISSUE! Release "${context.rawInput.packageData.name}", registry "${registry.name}", integrity does NOT match!`, { important: true });
|
|
168
|
+
trm_commons_1.Logger.error(`SECURITY ISSUE! Registry SHA is ${context.runtime.package.data.checksum}`, { important: true });
|
|
169
|
+
trm_commons_1.Logger.error(`SECURITY ISSUE! Expected SHA is ${expectedIntegrity}`, { important: true });
|
|
170
|
+
throw new Error(`Cannot continue due to security issues.`);
|
|
171
|
+
}
|
|
172
|
+
//only used to validate manifest
|
|
173
|
+
try {
|
|
174
|
+
manifest_1.Manifest.normalize(context.runtime.package.data.manifest);
|
|
175
|
+
}
|
|
176
|
+
catch (e) {
|
|
177
|
+
throw new Error(`Package manifest is invalid: ${e.toString()}`);
|
|
178
|
+
}
|
|
179
|
+
// replace input name with actual name in manifest: install mappings and transports
|
|
180
|
+
// are read and written with case-sensitive queries, under the name of the package record
|
|
181
|
+
context.rawInput.packageData.name = context.runtime.package.data.manifest.name;
|
|
182
|
+
//install mappings, transports and locks are recorded under the real registry of a local artifact
|
|
183
|
+
context.runtime.installRegistry = (yield (0, utils_1.resolveInstallPackage)(registry, context.rawInput.packageData.name)).registry;
|
|
184
|
+
context.runtime.isTrmServer = context.runtime.package.data.name === systemConnector_1.TRM_SERVER_PACKAGE_NAME && registry.getRegistryType() === registry_1.RegistryType.PUBLIC;
|
|
185
|
+
context.runtime.isTrmRest = context.runtime.package.data.name === systemConnector_1.TRM_REST_PACKAGE_NAME && registry.getRegistryType() === registry_1.RegistryType.PUBLIC;
|
|
186
|
+
//2- fill missing input data
|
|
113
187
|
if (context.rawInput.packageData.overwrite === undefined) {
|
|
114
188
|
context.rawInput.packageData.overwrite = false;
|
|
115
189
|
}
|
|
@@ -128,42 +202,75 @@ exports.init = {
|
|
|
128
202
|
if (!context.rawInput.installData.installDevclass.replacements) {
|
|
129
203
|
context.rawInput.installData.installDevclass.replacements = [];
|
|
130
204
|
}
|
|
131
|
-
if (!context.rawInput.installData.
|
|
132
|
-
context.rawInput.installData.
|
|
133
|
-
create: true
|
|
134
|
-
};
|
|
205
|
+
if (!context.rawInput.installData.landscapeTransport) {
|
|
206
|
+
context.rawInput.installData.landscapeTransport = {};
|
|
135
207
|
}
|
|
136
208
|
if (!context.rawInput.installData.skipPostActivities) {
|
|
137
209
|
context.rawInput.installData.skipPostActivities = false;
|
|
138
210
|
}
|
|
211
|
+
//guard
|
|
139
212
|
if (context.runtime.isTrmServer || context.runtime.isTrmRest) {
|
|
140
213
|
context.rawInput.installData.installDevclass.keepOriginal = false;
|
|
141
214
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
default: context.rawInput.installData.installDevclass.keepOriginal ? true : false
|
|
149
|
-
}])).keepOriginal;
|
|
215
|
+
//3- check install transport layer
|
|
216
|
+
//the system default is resolved by generate-devclass, only when transportable packages are created
|
|
217
|
+
if (context.rawInput.installData.installDevclass.transportLayer) {
|
|
218
|
+
trm_commons_1.Logger.loading(`Checking transport layer...`);
|
|
219
|
+
if (!(yield systemConnector_1.SystemConnector.isTransportLayerExist(context.rawInput.installData.installDevclass.transportLayer))) {
|
|
220
|
+
throw new Error(`Transport layer "${context.rawInput.installData.installDevclass.transportLayer}" doesn't exist.`);
|
|
150
221
|
}
|
|
151
222
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
223
|
+
//4- check/set system target
|
|
224
|
+
context.rawInput.installData.landscapeTransport.targetSystem = yield (0, prompts_1.setLandscapeTarget)(context.rawInput.contextData.noInquirer, context.rawInput.installData.landscapeTransport.targetSystem, "Install transport target", "Install transport won't be generated.");
|
|
225
|
+
//5- check if already installed
|
|
226
|
+
context.runtime.update = context.rawInput.contextData.systemPackages.find(o => manifest_1.Manifest.compare(o.manifest, new manifest_1.Manifest(context.runtime.package.data.manifest), false));
|
|
227
|
+
if (context.runtime.update) {
|
|
228
|
+
context.runtime.previousInstallPackages = yield systemConnector_1.SystemConnector.getInstallPackages(context.rawInput.packageData.name, context.runtime.installRegistry);
|
|
229
|
+
context.runtime.previousInstallTransports = yield systemConnector_1.SystemConnector.getInstallTransports(context.rawInput.packageData.name, context.runtime.installRegistry);
|
|
230
|
+
const installVersion = context.runtime.package.data.manifest.version;
|
|
231
|
+
const installedVersion = context.runtime.update.manifest.get().version;
|
|
232
|
+
//transports TRM generated for the package (e.g. of a rolled back release) aren't changes made on the system
|
|
233
|
+
const dirtyEntries = yield (0, utils_1.withoutOwnTrmTransports)(context.runtime.update.getDirtyEntries(), context.runtime.update.packageName);
|
|
234
|
+
if ((0, semver_1.eq)(installVersion, installedVersion)) {
|
|
235
|
+
if (context.rawInput.packageData.overwrite) {
|
|
236
|
+
if (dirtyEntries.length > 0) {
|
|
237
|
+
let ignoreDirty = false;
|
|
238
|
+
trm_commons_1.Logger.warning(`${context.rawInput.packageData.name} has changes made on ${systemConnector_1.SystemConnector.getDest()} that will be overwritten!`, { important: true });
|
|
239
|
+
(0, utils_1.logDirtyEntries)(dirtyEntries);
|
|
240
|
+
if (!context.rawInput.contextData.noInquirer) {
|
|
241
|
+
ignoreDirty = (yield trm_commons_1.Inquirer.prompt({
|
|
242
|
+
message: `Continue with install?`,
|
|
243
|
+
type: 'confirm',
|
|
244
|
+
default: false,
|
|
245
|
+
name: 'ignoreDirty'
|
|
246
|
+
})).ignoreDirty;
|
|
247
|
+
}
|
|
248
|
+
if (!ignoreDirty) {
|
|
249
|
+
throw new Error(`Install aborted.`);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
trm_commons_1.Logger.info(`${context.rawInput.packageData.name} v${installedVersion} already installed in ${systemConnector_1.SystemConnector.getDest()}, overwriting.`);
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
throw new Error(`Install aborted. ${context.rawInput.packageData.name} v${installedVersion} already installed in ${systemConnector_1.SystemConnector.getDest()}. If you wish to overwrite, rerun install with overwrite feature.`);
|
|
256
|
+
}
|
|
157
257
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
258
|
+
else {
|
|
259
|
+
if ((0, semver_1.gt)(installVersion, installedVersion)) {
|
|
260
|
+
trm_commons_1.Logger.info(`${chalk_1.default.bold('Upgrading')} ${installedVersion} -> ${installVersion}`);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
trm_commons_1.Logger.warning(`${chalk_1.default.bold('Downgrading')} ${installedVersion} -> ${installVersion}`);
|
|
264
|
+
}
|
|
265
|
+
if (dirtyEntries.length > 0) {
|
|
266
|
+
trm_commons_1.Logger.warning(`${context.rawInput.packageData.name} has changes made on ${systemConnector_1.SystemConnector.getDest()} that will be overwritten!`, { important: true });
|
|
267
|
+
(0, utils_1.logDirtyEntries)(dirtyEntries);
|
|
268
|
+
}
|
|
161
269
|
}
|
|
162
270
|
}
|
|
163
271
|
else {
|
|
164
|
-
|
|
165
|
-
throw new Error(`Transport layer "${context.rawInput.installData.installDevclass.transportLayer}" doesn't exist.`);
|
|
166
|
-
}
|
|
272
|
+
trm_commons_1.Logger.info(`Package first install on ${systemConnector_1.SystemConnector.getDest()}`, true);
|
|
167
273
|
}
|
|
274
|
+
trm_commons_1.Logger.info(`Ready to install ${context.runtime.package.data.manifest.name} v${context.runtime.package.data.manifest.version}${!(0, semver_1.valid)(context.rawInput.packageData.version) ? (' (' + (context.rawInput.packageData.version || 'latest') + ')') : ''}.`);
|
|
168
275
|
})
|
|
169
276
|
};
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
import { Step } from "@simonegaffurini/sammarksworkflow";
|
|
2
2
|
import { InstallWorkflowContext } from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Workflow step that installs each dependency missing from the target system or installed in an
|
|
5
|
+
* incompatible version. A downgrade is confirmed by the dependency install; a dependency found
|
|
6
|
+
* already installed there is skipped without a rollback. Every package a dependency install
|
|
7
|
+
* installed, transitive ones included, is merged into the package snapshot, so a later dependency
|
|
8
|
+
* sharing it (diamond) finds it installed.
|
|
9
|
+
*
|
|
10
|
+
* 1- list dependencies to install
|
|
11
|
+
*
|
|
12
|
+
* 2- prompt install
|
|
13
|
+
*
|
|
14
|
+
* 3- run install workflow for each dependency
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
3
17
|
export declare const installDependencies: Step<InstallWorkflowContext>;
|
|
@@ -45,13 +45,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
45
45
|
exports.installDependencies = void 0;
|
|
46
46
|
const trm_commons_1 = require("trm-commons");
|
|
47
47
|
const __1 = require("..");
|
|
48
|
+
const manifest_1 = require("../../manifest");
|
|
48
49
|
const registry_1 = require("../../registry");
|
|
50
|
+
const trmPackage_1 = require("../../trmPackage");
|
|
49
51
|
const _ = __importStar(require("lodash"));
|
|
50
|
-
const
|
|
52
|
+
const _1 = require(".");
|
|
53
|
+
/**
|
|
54
|
+
* Workflow step that installs each dependency missing from the target system or installed in an
|
|
55
|
+
* incompatible version. A downgrade is confirmed by the dependency install; a dependency found
|
|
56
|
+
* already installed there is skipped without a rollback. Every package a dependency install
|
|
57
|
+
* installed, transitive ones included, is merged into the package snapshot, so a later dependency
|
|
58
|
+
* sharing it (diamond) finds it installed.
|
|
59
|
+
*
|
|
60
|
+
* 1- list dependencies to install
|
|
61
|
+
*
|
|
62
|
+
* 2- prompt install
|
|
63
|
+
*
|
|
64
|
+
* 3- run install workflow for each dependency
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
51
67
|
exports.installDependencies = {
|
|
52
68
|
name: 'install-dependencies',
|
|
53
69
|
filter: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
-
if (context.runtime.
|
|
70
|
+
if (context.runtime.dependencies.length > 0) {
|
|
55
71
|
return true;
|
|
56
72
|
}
|
|
57
73
|
else {
|
|
@@ -60,65 +76,126 @@ exports.installDependencies = {
|
|
|
60
76
|
}
|
|
61
77
|
}),
|
|
62
78
|
run: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
//1- list dependencies to install
|
|
80
|
+
const total = context.runtime.dependencies.length;
|
|
81
|
+
trm_commons_1.Logger.info(total === 1 ? `There is 1 dependency to install:` : `There are ${total} dependencies to install:`);
|
|
82
|
+
context.runtime.dependencies.forEach((o, i) => {
|
|
83
|
+
if (o.status === 'versionMismatch') {
|
|
84
|
+
trm_commons_1.Logger.info(` ${i + 1}/${total} ${o.dependency.name} ${o.dependency.version} (incompatible: v${o.installedVersion} installed)`);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
trm_commons_1.Logger.info(` ${i + 1}/${total} ${o.dependency.name} ${o.dependency.version} (missing)`);
|
|
88
|
+
}
|
|
72
89
|
});
|
|
73
|
-
|
|
74
|
-
|
|
90
|
+
//2- prompt install (not again for dependencies a parent install already confirmed)
|
|
91
|
+
let confirmInstall = true;
|
|
92
|
+
const approved = context.rawInput.installData.approvedDependencies || [];
|
|
93
|
+
const alreadyApproved = context.runtime.dependencies.every(o => approved.includes(o.dependency.name));
|
|
94
|
+
if (alreadyApproved) {
|
|
95
|
+
trm_commons_1.Logger.log(`Dependencies already confirmed by the parent install`, true);
|
|
96
|
+
}
|
|
97
|
+
else if (!context.rawInput.contextData.noInquirer) {
|
|
75
98
|
confirmInstall = (yield trm_commons_1.Inquirer.prompt({
|
|
76
99
|
type: 'confirm',
|
|
77
100
|
default: true,
|
|
78
|
-
message: `Install missing dependencies?`,
|
|
101
|
+
message: context.runtime.dependencies.some(o => o.status === 'versionMismatch') ? `Install or replace dependencies?` : `Install missing dependencies?`,
|
|
79
102
|
name: 'confirmInstall'
|
|
80
103
|
})).confirmInstall;
|
|
81
104
|
}
|
|
82
105
|
if (!confirmInstall) {
|
|
83
|
-
throw new Error(`Install aborted
|
|
106
|
+
throw new Error(`Install aborted.`);
|
|
84
107
|
}
|
|
85
|
-
|
|
108
|
+
//3- run install workflow for each dependency
|
|
109
|
+
context.runtime.systemPackagesBeforeDependencies = [...context.rawInput.contextData.systemPackages];
|
|
110
|
+
let counter = 0;
|
|
86
111
|
const originalLPrefix = trm_commons_1.Logger.getPrefix();
|
|
87
112
|
const originalIPrefix = trm_commons_1.Inquirer.getPrefix();
|
|
88
|
-
for (const dependency of context.runtime.
|
|
113
|
+
for (const { dependency } of context.runtime.dependencies) {
|
|
89
114
|
counter++;
|
|
90
|
-
trm_commons_1.Logger.loading(`Getting ready to install
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
115
|
+
trm_commons_1.Logger.loading(`Getting ready to install dependency "${dependency.name}"...`);
|
|
116
|
+
const prefix = `(${counter}/${context.runtime.dependencies.length}) `;
|
|
117
|
+
try {
|
|
118
|
+
if (originalLPrefix) {
|
|
119
|
+
trm_commons_1.Logger.setPrefix(`${originalLPrefix}-> ${prefix}`);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
trm_commons_1.Logger.setPrefix(` ${prefix}`);
|
|
123
|
+
}
|
|
124
|
+
if (originalIPrefix) {
|
|
125
|
+
trm_commons_1.Inquirer.setPrefix(`${originalIPrefix}-> ${prefix}`);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
trm_commons_1.Inquirer.setPrefix(` ${prefix}`);
|
|
129
|
+
}
|
|
130
|
+
const dependencyRegistry = registry_1.RegistryProvider.getRegistry(dependency.registry);
|
|
131
|
+
const inputData = {
|
|
132
|
+
dependencyDataPackage: {
|
|
133
|
+
name: dependency.name,
|
|
134
|
+
versionRange: dependency.version,
|
|
135
|
+
registry: dependencyRegistry
|
|
136
|
+
},
|
|
137
|
+
contextData: _.cloneDeep(context.rawInput.contextData),
|
|
138
|
+
installData: _.cloneDeep(context.rawInput.installData)
|
|
139
|
+
};
|
|
140
|
+
inputData.installData.approvedDependencies = [...new Set([...approved, ...context.runtime.dependencies.map(o => o.dependency.name)])];
|
|
141
|
+
delete inputData.installData.installDevclass.keepOriginal; //force input value if inquirer allows
|
|
142
|
+
//the parent's mappings were resolved for its own devclasses: the dependency resolves its own
|
|
143
|
+
inputData.installData.installDevclass.replacements = [];
|
|
144
|
+
//on upgrade, the dependency must see the parent's new requirements, not the installed ones
|
|
145
|
+
if (context.runtime.update) {
|
|
146
|
+
const parentPackage = inputData.contextData.systemPackages.find(systemPackage => trmPackage_1.TrmPackage.compare(systemPackage, context.runtime.update));
|
|
147
|
+
if (parentPackage) {
|
|
148
|
+
parentPackage.manifest = new manifest_1.Manifest(_.cloneDeep(context.runtime.package.data.manifest));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const result = yield (0, __1.installDependency)(inputData, input => (0, _1.installWithRollback)(input, context.runtime.lockedNamespaces || []));
|
|
152
|
+
if (result.alreadyInstalled) {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
if (!result.rollback) {
|
|
156
|
+
throw new Error(`Dependency install did not return its rollback journal.`);
|
|
157
|
+
}
|
|
158
|
+
context.runtime.dependencyRollbacks.push(result.rollback);
|
|
159
|
+
if (result.release) {
|
|
160
|
+
context.runtime.dependencyReleases.push(result.release);
|
|
161
|
+
}
|
|
162
|
+
const installedPackage = new trmPackage_1.TrmPackage(result.installOutput.manifest.name, dependencyRegistry, new manifest_1.Manifest(result.installOutput.manifest));
|
|
163
|
+
//the dependency install only updated its own copy of the snapshot
|
|
164
|
+
for (const installed of [...(result.installedPackages || []), installedPackage]) {
|
|
165
|
+
const installedIndex = context.rawInput.contextData.systemPackages.findIndex(systemPackage => trmPackage_1.TrmPackage.compare(systemPackage, installed));
|
|
166
|
+
if (installedIndex === -1) {
|
|
167
|
+
context.rawInput.contextData.systemPackages.push(installed);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
context.rawInput.contextData.systemPackages.splice(installedIndex, 1, installed);
|
|
171
|
+
}
|
|
172
|
+
context.runtime.installedDependencies.push(installed);
|
|
173
|
+
}
|
|
94
174
|
}
|
|
95
|
-
|
|
96
|
-
trm_commons_1.Logger.setPrefix(
|
|
97
|
-
|
|
98
|
-
if (originalIPrefix) {
|
|
99
|
-
trm_commons_1.Inquirer.setPrefix(`${originalIPrefix}-> ${prefix}`);
|
|
175
|
+
finally {
|
|
176
|
+
trm_commons_1.Logger.setPrefix(originalLPrefix);
|
|
177
|
+
trm_commons_1.Inquirer.setPrefix(originalIPrefix);
|
|
100
178
|
}
|
|
101
|
-
|
|
102
|
-
|
|
179
|
+
}
|
|
180
|
+
}),
|
|
181
|
+
revert: (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
182
|
+
let firstError;
|
|
183
|
+
for (const rollback of [...context.runtime.dependencyRollbacks].reverse()) {
|
|
184
|
+
try {
|
|
185
|
+
yield rollback();
|
|
103
186
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
name: dependency.name,
|
|
107
|
-
versionRange: dependency.version,
|
|
108
|
-
registry: registry_1.RegistryProvider.getRegistry(dependency.registry)
|
|
109
|
-
},
|
|
110
|
-
contextData: _.cloneDeep(context.rawInput.contextData),
|
|
111
|
-
installData: _.cloneDeep(context.rawInput.installData)
|
|
112
|
-
};
|
|
113
|
-
if (inputData.contextData) {
|
|
114
|
-
inputData.contextData.noR3transInfo = true;
|
|
187
|
+
catch (error) {
|
|
188
|
+
firstError || (firstError = error);
|
|
115
189
|
}
|
|
116
|
-
delete inputData.installData.installDevclass.keepOriginal;
|
|
117
|
-
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);
|
|
118
|
-
const result = yield (0, __1.installDependency)(inputData);
|
|
119
|
-
trm_commons_1.Logger.log(`Workflow ${SUBWORKFLOW_NAME} result: ${(0, trm_commons_1.inspect)(result, { breakLength: Infinity, compact: true })}`, true);
|
|
120
|
-
trm_commons_1.Logger.setPrefix(originalLPrefix);
|
|
121
|
-
trm_commons_1.Inquirer.setPrefix(originalIPrefix);
|
|
122
190
|
}
|
|
191
|
+
if (firstError) {
|
|
192
|
+
throw firstError;
|
|
193
|
+
}
|
|
194
|
+
//the rolled back packages are no longer installed
|
|
195
|
+
const before = context.runtime.systemPackagesBeforeDependencies;
|
|
196
|
+
if (before) {
|
|
197
|
+
context.rawInput.contextData.systemPackages.splice(0, context.rawInput.contextData.systemPackages.length, ...before);
|
|
198
|
+
}
|
|
199
|
+
context.runtime.installedDependencies = [];
|
|
123
200
|
})
|
|
124
201
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Step } from "@simonegaffurini/sammarksworkflow";
|
|
2
|
+
import { InstallWorkflowContext } from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Lock the selected import payload, its resolved target packages and its custom namespace before
|
|
5
|
+
* dependencies mutate SAP, then repeat the safety checks of check-transports that another action
|
|
6
|
+
* could have invalidated before the locks were held.
|
|
7
|
+
*/
|
|
8
|
+
export declare const lockResources: Step<InstallWorkflowContext>;
|