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.
Files changed (384) hide show
  1. package/README.md +20 -0
  2. package/changelog.txt +11 -0
  3. package/dist/actions/cg3y/download.js +34 -4
  4. package/dist/actions/cg3y/index.d.ts +23 -0
  5. package/dist/actions/cg3y/index.js +13 -10
  6. package/dist/actions/cg3z/index.d.ts +67 -3
  7. package/dist/actions/cg3z/index.js +25 -14
  8. package/dist/actions/cg3z/upload.d.ts +20 -0
  9. package/dist/actions/cg3z/upload.js +165 -36
  10. package/dist/actions/checkEngines/analyze.d.ts +11 -0
  11. package/dist/actions/checkEngines/analyze.js +294 -0
  12. package/dist/actions/checkEngines/index.d.ts +87 -0
  13. package/dist/actions/checkEngines/index.js +38 -0
  14. package/dist/actions/checkEngines/init.d.ts +11 -0
  15. package/dist/actions/checkEngines/init.js +45 -0
  16. package/dist/actions/checkPackageDependencies/analyze.d.ts +10 -0
  17. package/dist/actions/checkPackageDependencies/analyze.js +37 -39
  18. package/dist/actions/checkPackageDependencies/index.d.ts +56 -0
  19. package/dist/actions/checkPackageDependencies/index.js +13 -10
  20. package/dist/actions/checkPackageDependencies/init.d.ts +8 -0
  21. package/dist/actions/checkPackageDependencies/init.js +24 -2
  22. package/dist/actions/checkSapEntries/analyze.d.ts +12 -0
  23. package/dist/actions/checkSapEntries/analyze.js +63 -47
  24. package/dist/actions/checkSapEntries/index.d.ts +35 -0
  25. package/dist/actions/checkSapEntries/index.js +12 -10
  26. package/dist/actions/checkSapEntries/init.d.ts +8 -0
  27. package/dist/actions/checkSapEntries/init.js +10 -2
  28. package/dist/actions/commons/IActionContext.d.ts +10 -0
  29. package/dist/actions/commons/checkServerAuth.d.ts +7 -0
  30. package/dist/actions/commons/checkServerAuth.js +10 -5
  31. package/dist/actions/commons/index.d.ts +1 -1
  32. package/dist/actions/commons/index.js +1 -1
  33. package/dist/actions/commons/prompts/index.d.ts +1 -0
  34. package/dist/actions/commons/prompts/index.js +1 -0
  35. package/dist/actions/commons/prompts/setLandscapeTarget.d.ts +14 -0
  36. package/dist/actions/commons/prompts/setLandscapeTarget.js +40 -0
  37. package/dist/actions/commons/prompts/setTransportTarget.d.ts +15 -0
  38. package/dist/actions/commons/prompts/setTransportTarget.js +20 -2
  39. package/dist/actions/commons/setSystemPackages.d.ts +7 -0
  40. package/dist/actions/commons/setSystemPackages.js +12 -2
  41. package/dist/actions/commons/utils/actionLocks.d.ts +32 -0
  42. package/dist/actions/commons/utils/actionLocks.js +135 -0
  43. package/dist/actions/commons/utils/dirtyEntries.d.ts +12 -0
  44. package/dist/actions/commons/utils/dirtyEntries.js +54 -0
  45. package/dist/actions/commons/utils/index.d.ts +10 -0
  46. package/dist/actions/commons/utils/index.js +26 -0
  47. package/dist/actions/commons/utils/installRegistry.d.ts +18 -0
  48. package/dist/actions/commons/utils/installRegistry.js +46 -0
  49. package/dist/actions/commons/utils/installedDependency.d.ts +15 -0
  50. package/dist/actions/commons/utils/installedDependency.js +30 -0
  51. package/dist/actions/commons/utils/owningInstallation.d.ts +6 -0
  52. package/dist/actions/commons/utils/owningInstallation.js +47 -0
  53. package/dist/actions/commons/utils/packageCleanup.d.ts +168 -0
  54. package/dist/actions/commons/utils/packageCleanup.js +1017 -0
  55. package/dist/actions/commons/utils/releaseDeletionTransport.d.ts +5 -0
  56. package/dist/actions/commons/utils/releaseDeletionTransport.js +67 -0
  57. package/dist/actions/commons/utils/restoreTransport.d.ts +6 -0
  58. package/dist/actions/commons/utils/restoreTransport.js +50 -0
  59. package/dist/actions/commons/utils/retainedWorkflow.d.ts +6 -0
  60. package/dist/actions/commons/utils/retainedWorkflow.js +49 -0
  61. package/dist/actions/commons/utils/withScopedPrefix.d.ts +5 -0
  62. package/dist/actions/commons/utils/withScopedPrefix.js +32 -0
  63. package/dist/actions/commons/workflowCallbacks.d.ts +21 -0
  64. package/dist/actions/commons/workflowCallbacks.js +157 -0
  65. package/dist/actions/index.d.ts +3 -0
  66. package/dist/actions/index.js +5 -0
  67. package/dist/actions/install/addNamespace.d.ts +18 -0
  68. package/dist/actions/install/addNamespace.js +121 -51
  69. package/dist/actions/install/checkDependants.d.ts +15 -0
  70. package/dist/actions/install/checkDependants.js +74 -0
  71. package/dist/actions/install/checkDependencies.d.ts +11 -0
  72. package/dist/actions/install/checkDependencies.js +32 -13
  73. package/dist/actions/install/checkDependencyCycles.d.ts +17 -0
  74. package/dist/actions/install/checkDependencyCycles.js +105 -0
  75. package/dist/actions/install/checkEngines.d.ts +11 -0
  76. package/dist/actions/install/checkEngines.js +100 -0
  77. package/dist/actions/install/checkInstallDevclass.d.ts +24 -0
  78. package/dist/actions/install/checkInstallDevclass.js +110 -0
  79. package/dist/actions/install/checkSapEntries.d.ts +9 -0
  80. package/dist/actions/install/checkSapEntries.js +20 -12
  81. package/dist/actions/install/checkTransports.d.ts +34 -0
  82. package/dist/actions/install/checkTransports.js +329 -170
  83. package/dist/actions/install/cleanupCheckpoint.d.ts +11 -0
  84. package/dist/actions/install/cleanupCheckpoint.js +62 -0
  85. package/dist/actions/install/defaultTransportLayer.d.ts +5 -0
  86. package/dist/actions/install/defaultTransportLayer.js +36 -0
  87. package/dist/actions/install/executePostActivities.d.ts +6 -0
  88. package/dist/actions/install/executePostActivities.js +28 -38
  89. package/dist/actions/install/generateDevclass.d.ts +10 -0
  90. package/dist/actions/install/generateDevclass.js +66 -20
  91. package/dist/actions/install/generateLandscapeTransport.d.ts +23 -0
  92. package/dist/actions/install/generateLandscapeTransport.js +136 -0
  93. package/dist/actions/install/generateUpdateTransport.d.ts +20 -0
  94. package/dist/actions/install/generateUpdateTransport.js +122 -0
  95. package/dist/actions/install/importBatch.d.ts +22 -0
  96. package/dist/actions/install/importBatch.js +0 -0
  97. package/dist/actions/install/index.d.ts +273 -44
  98. package/dist/actions/install/index.js +139 -59
  99. package/dist/actions/install/init.d.ts +14 -0
  100. package/dist/actions/install/init.js +215 -108
  101. package/dist/actions/install/installDependencies.d.ts +14 -0
  102. package/dist/actions/install/installDependencies.js +122 -45
  103. package/dist/actions/install/lockResources.d.ts +8 -0
  104. package/dist/actions/install/lockResources.js +100 -0
  105. package/dist/actions/install/prepareCust.d.ts +13 -0
  106. package/dist/actions/install/prepareCust.js +138 -0
  107. package/dist/actions/install/prepareDevc.d.ts +15 -0
  108. package/dist/actions/install/prepareDevc.js +113 -0
  109. package/dist/actions/install/prepareLang.d.ts +13 -0
  110. package/dist/actions/install/prepareLang.js +110 -0
  111. package/dist/actions/install/prepareTadir.d.ts +13 -0
  112. package/dist/actions/install/prepareTadir.js +95 -0
  113. package/dist/actions/install/releaseLandscapeTransport.d.ts +11 -0
  114. package/dist/actions/install/releaseLandscapeTransport.js +79 -0
  115. package/dist/actions/install/setInstallDevclass.d.ts +10 -0
  116. package/dist/actions/install/setInstallDevclass.js +140 -54
  117. package/dist/actions/install/updatePackageData.d.ts +9 -0
  118. package/dist/actions/install/updatePackageData.js +117 -13
  119. package/dist/actions/installDependency/checkInstalledRelease.d.ts +13 -0
  120. package/dist/actions/installDependency/checkInstalledRelease.js +50 -0
  121. package/dist/actions/installDependency/confirmDowngrade.d.ts +11 -0
  122. package/dist/actions/installDependency/confirmDowngrade.js +53 -0
  123. package/dist/actions/installDependency/findInstallRelease.d.ts +24 -0
  124. package/dist/actions/installDependency/findInstallRelease.js +42 -19
  125. package/dist/actions/installDependency/index.d.ts +64 -3
  126. package/dist/actions/installDependency/index.js +30 -13
  127. package/dist/actions/installDependency/init.d.ts +14 -0
  128. package/dist/actions/installDependency/init.js +24 -3
  129. package/dist/actions/installDependency/installRelease.d.ts +6 -0
  130. package/dist/actions/installDependency/installRelease.js +22 -12
  131. package/dist/actions/publish/enginesUi.d.ts +53 -0
  132. package/dist/actions/publish/enginesUi.js +289 -0
  133. package/dist/actions/publish/findDependencies.d.ts +19 -0
  134. package/dist/actions/publish/findDependencies.js +72 -37
  135. package/dist/actions/publish/generateCustTransport.d.ts +6 -0
  136. package/dist/actions/publish/generateCustTransport.js +42 -19
  137. package/dist/actions/publish/generateDevcTransport.d.ts +6 -0
  138. package/dist/actions/publish/generateDevcTransport.js +16 -18
  139. package/dist/actions/publish/generateLangTransport.d.ts +6 -0
  140. package/dist/actions/publish/generateLangTransport.js +20 -23
  141. package/dist/actions/publish/generateTadirTransport.d.ts +6 -0
  142. package/dist/actions/publish/generateTadirTransport.js +18 -17
  143. package/dist/actions/publish/getSystemEngines.d.ts +27 -0
  144. package/dist/actions/publish/getSystemEngines.js +112 -0
  145. package/dist/actions/publish/index.d.ts +162 -37
  146. package/dist/actions/publish/index.js +51 -34
  147. package/dist/actions/publish/init.d.ts +28 -0
  148. package/dist/actions/publish/init.js +304 -120
  149. package/dist/actions/publish/lockResources.d.ts +4 -0
  150. package/dist/actions/{install/refreshTmsTxt.js → publish/lockResources.js} +14 -17
  151. package/dist/actions/publish/publishToRegistry.d.ts +8 -0
  152. package/dist/actions/publish/publishToRegistry.js +18 -8
  153. package/dist/actions/publish/releaseTransports.d.ts +6 -0
  154. package/dist/actions/publish/releaseTransports.js +48 -20
  155. package/dist/actions/publish/setCustomizingTransports.d.ts +6 -0
  156. package/dist/actions/publish/setCustomizingTransports.js +227 -101
  157. package/dist/actions/publish/setManifestValues.d.ts +22 -0
  158. package/dist/actions/publish/setManifestValues.js +455 -119
  159. package/dist/actions/publish/setOptionalPublishData.d.ts +11 -0
  160. package/dist/actions/publish/setOptionalPublishData.js +133 -0
  161. package/dist/actions/publish/updatePackageData.d.ts +8 -0
  162. package/dist/actions/publish/updatePackageData.js +20 -7
  163. package/dist/actions/stopWarning.d.ts +5 -0
  164. package/dist/actions/stopWarning.js +5 -0
  165. package/dist/actions/uninstall/checkDependants.d.ts +7 -0
  166. package/dist/actions/uninstall/checkDependants.js +55 -0
  167. package/dist/actions/uninstall/forwardDeletionTransport.d.ts +10 -0
  168. package/dist/actions/uninstall/forwardDeletionTransport.js +51 -0
  169. package/dist/actions/uninstall/generateDeletionTransport.d.ts +10 -0
  170. package/dist/actions/uninstall/generateDeletionTransport.js +45 -0
  171. package/dist/actions/uninstall/index.d.ts +153 -0
  172. package/dist/actions/uninstall/index.js +141 -0
  173. package/dist/actions/uninstall/init.d.ts +17 -0
  174. package/dist/actions/uninstall/init.js +146 -0
  175. package/dist/actions/uninstall/lockResources.d.ts +4 -0
  176. package/dist/actions/{publish/setTransportTarget.js → uninstall/lockResources.js} +16 -7
  177. package/dist/actions/uninstall/removePackageData.d.ts +9 -0
  178. package/dist/actions/uninstall/removePackageData.js +64 -0
  179. package/dist/actions/uninstall/uninstallNestedPackages.d.ts +26 -0
  180. package/dist/actions/uninstall/uninstallNestedPackages.js +174 -0
  181. package/dist/client/ClientError.d.ts +3 -1
  182. package/dist/client/ClientError.js +2 -1
  183. package/dist/client/RESTClient.d.ts +18 -5
  184. package/dist/client/RESTClient.js +194 -52
  185. package/dist/client/RESTClientError.d.ts +1 -2
  186. package/dist/client/RESTClientError.js +3 -2
  187. package/dist/client/RFCClient.d.ts +28 -7
  188. package/dist/client/RFCClient.js +325 -77
  189. package/dist/client/RFCClientError.d.ts +1 -1
  190. package/dist/client/RFCClientError.js +2 -2
  191. package/dist/client/TransportEntries.d.ts +8 -0
  192. package/dist/client/TransportEntries.js +2 -0
  193. package/dist/client/components/BORM_ID.d.ts +1 -0
  194. package/dist/client/components/BORM_ID.js +2 -0
  195. package/dist/client/components/BORM_NAME.d.ts +1 -0
  196. package/dist/client/components/BORM_NAME.js +2 -0
  197. package/dist/client/components/BORM_NAMEL.d.ts +1 -0
  198. package/dist/client/components/BORM_NAMEL.js +2 -0
  199. package/dist/client/components/BORM_VEND.d.ts +1 -0
  200. package/dist/client/components/BORM_VEND.js +2 -0
  201. package/dist/client/components/BORM_VERS.d.ts +1 -0
  202. package/dist/client/components/BORM_VERS.js +2 -0
  203. package/dist/client/components/CWBNTNUMM.d.ts +1 -0
  204. package/dist/client/components/CWBNTNUMM.js +2 -0
  205. package/dist/client/components/CWBNTSTAT.d.ts +1 -0
  206. package/dist/client/components/CWBNTSTAT.js +2 -0
  207. package/dist/client/components/CWBNTVERS.d.ts +1 -0
  208. package/dist/client/components/CWBNTVERS.js +2 -0
  209. package/dist/client/components/CWBPRSTAT.d.ts +1 -0
  210. package/dist/client/components/CWBPRSTAT.js +2 -0
  211. package/dist/client/components/INSTSTATE.d.ts +1 -0
  212. package/dist/client/components/INSTSTATE.js +2 -0
  213. package/dist/client/components/RELC_TYPE.d.ts +1 -0
  214. package/dist/client/components/RELC_TYPE.js +2 -0
  215. package/dist/client/components/SAPPATCHLV.d.ts +1 -0
  216. package/dist/client/components/SAPPATCHLV.js +2 -0
  217. package/dist/client/components/SAPRELEASE.d.ts +1 -0
  218. package/dist/client/components/SAPRELEASE.js +2 -0
  219. package/dist/client/components/SYSYSID.d.ts +1 -0
  220. package/dist/client/components/SYSYSID.js +2 -0
  221. package/dist/client/components/ZTRM_INSTALLTR_TYPE.d.ts +1 -0
  222. package/dist/client/components/ZTRM_INSTALLTR_TYPE.js +2 -0
  223. package/dist/client/components/index.d.ts +15 -0
  224. package/dist/client/components/index.js +15 -0
  225. package/dist/client/index.d.ts +1 -0
  226. package/dist/client/index.js +1 -0
  227. package/dist/client/messageLog.d.ts +7 -0
  228. package/dist/client/messageLog.js +21 -0
  229. package/dist/client/struct/ActionLockKey.d.ts +6 -0
  230. package/dist/client/struct/ActionLockKey.js +2 -0
  231. package/dist/client/struct/CVERS.d.ts +7 -0
  232. package/dist/client/struct/CVERS.js +2 -0
  233. package/dist/client/struct/CWBNTCUST.d.ts +6 -0
  234. package/dist/client/struct/CWBNTCUST.js +2 -0
  235. package/dist/client/struct/CWBNTHEAD.d.ts +5 -0
  236. package/dist/client/struct/CWBNTHEAD.js +2 -0
  237. package/dist/client/struct/E070.d.ts +2 -1
  238. package/dist/client/struct/E071K.d.ts +9 -0
  239. package/dist/client/struct/E071K.js +2 -0
  240. package/dist/client/struct/PRDVERS.d.ts +9 -0
  241. package/dist/client/struct/PRDVERS.js +2 -0
  242. package/dist/client/struct/SCOMPKDTLN.d.ts +21 -0
  243. package/dist/client/struct/STMSCALERT.d.ts +21 -0
  244. package/dist/client/struct/STMSCALERT.js +2 -0
  245. package/dist/client/struct/STMS_TP_IMPORT.d.ts +14 -0
  246. package/dist/client/struct/STMS_TP_IMPORT.js +2 -0
  247. package/dist/client/struct/STMS_TR_REQUEST.d.ts +8 -0
  248. package/dist/client/struct/STMS_TR_REQUEST.js +2 -0
  249. package/dist/client/struct/TDEVC.d.ts +38 -0
  250. package/dist/client/struct/TPLOGPTR.d.ts +13 -0
  251. package/dist/client/struct/TPLOGPTR.js +2 -0
  252. package/dist/client/struct/TPSTDOUT.d.ts +3 -0
  253. package/dist/client/struct/TPSTDOUT.js +2 -0
  254. package/dist/client/struct/ZTRM_INSTALLTR.d.ts +8 -0
  255. package/dist/client/struct/ZTRM_INSTALLTR.js +2 -0
  256. package/dist/client/struct/index.d.ts +12 -0
  257. package/dist/client/struct/index.js +12 -0
  258. package/dist/commons/checkCoreTrmDependencies.js +1 -1
  259. package/dist/commons/getAxiosInstance.js +8 -17
  260. package/dist/commons/getNodePackage.js +7 -0
  261. package/dist/commons/getPackageHierarchy.js +2 -0
  262. package/dist/commons/getPackagesNamespace.d.ts +9 -0
  263. package/dist/commons/getPackagesNamespace.js +19 -0
  264. package/dist/commons/index.d.ts +4 -0
  265. package/dist/commons/index.js +4 -0
  266. package/dist/commons/packageDataFromTdevc.d.ts +12 -0
  267. package/dist/commons/packageDataFromTdevc.js +25 -0
  268. package/dist/commons/resolveCoreVersion.d.ts +10 -0
  269. package/dist/commons/resolveCoreVersion.js +24 -0
  270. package/dist/commons/summarizeForLog.d.ts +22 -0
  271. package/dist/commons/summarizeForLog.js +120 -0
  272. package/dist/connection/OpenRFCConnect.d.ts +13 -0
  273. package/dist/connection/OpenRFCConnect.js +23 -0
  274. package/dist/connection/index.d.ts +1 -0
  275. package/dist/connection/index.js +17 -0
  276. package/dist/dependencies/PackageDependencies.d.ts +2 -0
  277. package/dist/dependencies/PackageDependencies.js +24 -0
  278. package/dist/index.d.ts +1 -0
  279. package/dist/index.js +1 -0
  280. package/dist/lockfile/Lockfile.d.ts +23 -1
  281. package/dist/lockfile/Lockfile.js +45 -9
  282. package/dist/manifest/Manifest.d.ts +9 -5
  283. package/dist/manifest/Manifest.js +82 -29
  284. package/dist/manifest/PostActivity.js +3 -3
  285. package/dist/manifest/TrmManifest.d.ts +0 -2
  286. package/dist/manifest/TrmManifestBase.d.ts +2 -0
  287. package/dist/manifest/TrmManifestEngines.d.ts +64 -0
  288. package/dist/manifest/TrmManifestEngines.js +2 -0
  289. package/dist/manifest/engines/index.d.ts +2 -0
  290. package/dist/manifest/engines/index.js +18 -0
  291. package/dist/manifest/engines/sapRange.d.ts +38 -0
  292. package/dist/manifest/engines/sapRange.js +135 -0
  293. package/dist/manifest/engines/validateEngines.d.ts +44 -0
  294. package/dist/manifest/engines/validateEngines.js +282 -0
  295. package/dist/manifest/index.d.ts +3 -0
  296. package/dist/manifest/index.js +3 -0
  297. package/dist/manifest/sapEntries.d.ts +14 -0
  298. package/dist/manifest/sapEntries.js +63 -0
  299. package/dist/protocol/Protocol.js +7 -0
  300. package/dist/registry/AbstractRegistry.d.ts +18 -3
  301. package/dist/registry/FileSystem.d.ts +22 -13
  302. package/dist/registry/FileSystem.js +69 -18
  303. package/dist/registry/RegistryDeletionTransportUnauthorizedError.d.ts +4 -0
  304. package/dist/registry/RegistryDeletionTransportUnauthorizedError.js +12 -0
  305. package/dist/registry/RegistryDeletionTransportUnavailableError.d.ts +9 -0
  306. package/dist/registry/RegistryDeletionTransportUnavailableError.js +17 -0
  307. package/dist/registry/RegistryPackageNotFoundError.d.ts +7 -0
  308. package/dist/registry/RegistryPackageNotFoundError.js +14 -0
  309. package/dist/registry/RegistryV2.d.ts +15 -5
  310. package/dist/registry/RegistryV2.js +308 -48
  311. package/dist/registry/index.d.ts +4 -0
  312. package/dist/registry/index.js +4 -0
  313. package/dist/registry/registryKey.d.ts +7 -0
  314. package/dist/registry/registryKey.js +21 -0
  315. package/dist/systemConnector/ActionLock.d.ts +1 -0
  316. package/dist/systemConnector/ActionLock.js +2 -0
  317. package/dist/systemConnector/ISystemConnector.d.ts +21 -4
  318. package/dist/systemConnector/ISystemConnectorBase.d.ts +16 -0
  319. package/dist/systemConnector/InstallTransport.d.ts +6 -0
  320. package/dist/systemConnector/InstallTransport.js +2 -0
  321. package/dist/systemConnector/OpenRFCSystemConnector.d.ts +12 -0
  322. package/dist/systemConnector/OpenRFCSystemConnector.js +51 -0
  323. package/dist/systemConnector/RESTSystemConnector.d.ts +22 -7
  324. package/dist/systemConnector/RESTSystemConnector.js +95 -23
  325. package/dist/systemConnector/RFCConnection.d.ts +0 -1
  326. package/dist/systemConnector/RFCSystemConnector.d.ts +25 -7
  327. package/dist/systemConnector/RFCSystemConnector.js +75 -16
  328. package/dist/systemConnector/SystemConnector.d.ts +38 -6
  329. package/dist/systemConnector/SystemConnector.js +138 -12
  330. package/dist/systemConnector/SystemConnectorBase.d.ts +24 -1
  331. package/dist/systemConnector/SystemConnectorBase.js +174 -22
  332. package/dist/systemConnector/index.d.ts +3 -0
  333. package/dist/systemConnector/index.js +3 -0
  334. package/dist/transport/E071KOwner.d.ts +10 -0
  335. package/dist/transport/E071KOwner.js +15 -0
  336. package/dist/transport/R3transLogParser.d.ts +19 -0
  337. package/dist/transport/R3transLogParser.js +148 -0
  338. package/dist/transport/Transport.d.ts +36 -3
  339. package/dist/transport/Transport.js +304 -138
  340. package/dist/transport/index.d.ts +2 -0
  341. package/dist/transport/index.js +2 -0
  342. package/dist/trmPackage/TransportBinary.d.ts +4 -1
  343. package/dist/trmPackage/TrmArtifact.d.ts +12 -8
  344. package/dist/trmPackage/TrmArtifact.js +93 -74
  345. package/dist/trmPackage/TrmPackage.d.ts +20 -6
  346. package/dist/trmPackage/TrmPackage.js +27 -1
  347. package/dist/validators/validateDevclass.js +4 -0
  348. package/package.json +15 -7
  349. package/dist/actions/commons/trmServerPa.d.ts +0 -3
  350. package/dist/actions/commons/trmServerPa.js +0 -40
  351. package/dist/actions/install/checkAlreadyInstalled.d.ts +0 -3
  352. package/dist/actions/install/checkAlreadyInstalled.js +0 -71
  353. package/dist/actions/install/checkObjectTypes.d.ts +0 -3
  354. package/dist/actions/install/checkObjectTypes.js +0 -50
  355. package/dist/actions/install/checkObjectsLock.d.ts +0 -3
  356. package/dist/actions/install/checkObjectsLock.js +0 -52
  357. package/dist/actions/install/generateInstallTransports.d.ts +0 -3
  358. package/dist/actions/install/generateInstallTransports.js +0 -128
  359. package/dist/actions/install/importCustTransport.d.ts +0 -3
  360. package/dist/actions/install/importCustTransport.js +0 -73
  361. package/dist/actions/install/importDevcTransport.d.ts +0 -3
  362. package/dist/actions/install/importDevcTransport.js +0 -93
  363. package/dist/actions/install/importLangTransport.d.ts +0 -3
  364. package/dist/actions/install/importLangTransport.js +0 -72
  365. package/dist/actions/install/importTadirTransport.d.ts +0 -3
  366. package/dist/actions/install/importTadirTransport.js +0 -83
  367. package/dist/actions/install/readDevc.d.ts +0 -3
  368. package/dist/actions/install/readDevc.js +0 -33
  369. package/dist/actions/install/readTadir.d.ts +0 -3
  370. package/dist/actions/install/readTadir.js +0 -101
  371. package/dist/actions/install/refreshTmsTxt.d.ts +0 -3
  372. package/dist/actions/install/releaseInstallTransport.d.ts +0 -3
  373. package/dist/actions/install/releaseInstallTransport.js +0 -80
  374. package/dist/actions/publish/checkAllObjectsReleased.d.ts +0 -3
  375. package/dist/actions/publish/checkAllObjectsReleased.js +0 -46
  376. package/dist/actions/publish/getSourceCode.d.ts +0 -3
  377. package/dist/actions/publish/getSourceCode.js +0 -49
  378. package/dist/actions/publish/setChangelog.d.ts +0 -3
  379. package/dist/actions/publish/setChangelog.js +0 -69
  380. package/dist/actions/publish/setDevclass.d.ts +0 -3
  381. package/dist/actions/publish/setDevclass.js +0 -74
  382. package/dist/actions/publish/setReadme.d.ts +0 -3
  383. package/dist/actions/publish/setReadme.js +0 -52
  384. package/dist/actions/publish/setTransportTarget.d.ts +0 -3
@@ -1,113 +1,342 @@
1
- import { R3trans, R3transOptions } from "node-r3trans";
1
+ import { Package } from "trm-registry-types";
2
+ import { Lockfile } from "../../lockfile";
3
+ import { AbstractRegistry } from "../../registry";
2
4
  import { Transport } from "../../transport";
3
- import { TransportBinary, TrmArtifact, TrmPackage, TrmPackageInstallTransport } from "../../trmPackage";
5
+ import { TransportBinary, TrmPackage } from "../../trmPackage";
4
6
  import { TrmManifest, TrmManifestDependency } from "../../manifest";
5
- import { IActionContext } from "..";
6
- import { DEVCLASS, E071, NAMESPACE, TADIR, TDEVC, TDEVCT } from "../../client";
7
7
  import { PackageHierarchy } from "../../commons";
8
- import { AbstractRegistry } from "../../registry";
9
- import { Package } from "trm-registry-types";
10
- import { Lockfile } from "../../lockfile/Lockfile";
8
+ import { IActionContext } from "../commons";
9
+ import { DEVCLASS, E071, TADIR, TDEVC, TDEVCT, ZTRM_INSTALLDEVC } from "../../client";
10
+ import { InstallTransport, TrmPackageUpdateData } from "../../systemConnector";
11
+ import { ActionLockScope } from "../commons/utils";
12
+ /** Maps a publisher ABAP package to the package that should receive its objects during installation. */
11
13
  export type InstallPackageReplacements = {
14
+ /**
15
+ * Original ABAP package name stored in the published artifact.
16
+ */
12
17
  originalDevclass: string;
18
+ /**
19
+ * Target ABAP package name to use on the receiving system.
20
+ */
13
21
  installDevclass: string;
14
22
  };
23
+ /** Shared execution settings for package and dependency installation actions. */
15
24
  export type InstallActionInputContextData = {
25
+ /**
26
+ * Snapshot of packages installed on the target system. When omitted, the action queries SAP.
27
+ */
16
28
  systemPackages?: TrmPackage[];
17
- r3transOptions?: R3transOptions;
18
- noR3transInfo?: boolean;
29
+ /**
30
+ * Disable interactive prompts. Any required choice without an explicit value then causes an error.
31
+ */
19
32
  noInquirer?: boolean;
20
- noStopWarning?: boolean;
33
+ /**
34
+ * Directory in which transport-release logs and temporary files are written.
35
+ */
36
+ logTemporaryFolder?: string;
37
+ /**
38
+ * Version of trm-core in use, checked against the `trm-core` engine of the package.
39
+ * Supply it when the client resolves trm-core itself; defaults to the version read from trm-core package.json.
40
+ */
41
+ coreVersion?: string;
21
42
  };
43
+ /** Options controlling package validation, transport import, and target package mapping. */
22
44
  export type InstallActionInputInstallData = {
45
+ /**
46
+ * Set by an install for the dependency installs it runs: the dependencies the user already
47
+ * confirmed. A dependency install doesn't ask again for these.
48
+ */
49
+ approvedDependencies?: string[];
50
+ /**
51
+ * Import-related data.
52
+ */
23
53
  import?: {
54
+ /**
55
+ * Skip the optional language transport. When unset, the user is asked (default: import);
56
+ * without prompts (`noInquirer`) the transport is imported.
57
+ */
24
58
  noLang?: boolean;
59
+ /**
60
+ * Skip all customizing transports. When unset, the user is asked for each transport
61
+ * (default: import); without prompts (`noInquirer`) all of them are imported.
62
+ * On update, the customizing of the installed release is then kept.
63
+ */
25
64
  noCust?: boolean;
26
- replaceExistingTransports?: boolean;
27
65
  };
66
+ /**
67
+ * Optional checks to perform during installation.
68
+ */
28
69
  checks?: {
70
+ /**
71
+ * Lockfile used to pin the release and dependency versions and verify their integrity.
72
+ * The package must be the lockfile root: when `packageData.version` is omitted the root
73
+ * version is installed, and an explicit version, distribution tag, local artifact, registry,
74
+ * or integrity that doesn't match the root aborts the install before any change.
75
+ */
29
76
  lockfile?: Lockfile;
77
+ /**
78
+ * Skip validation of required SAP table entries. Defaults to `false`.
79
+ */
30
80
  noSapEntries?: boolean;
31
- noObjectTypes?: boolean;
81
+ /**
82
+ * Skip validation of the manifest engines (SAP components, products, notes, tables). Defaults to `false`.
83
+ */
84
+ noEngines?: boolean;
85
+ /**
86
+ * Skip package dependency validation and installation. Defaults to `false`.
87
+ */
32
88
  noDependencies?: boolean;
89
+ /**
90
+ * Allow a dependency install to replace a newer installed release without confirmation.
91
+ * Defaults to `false`: the user is prompted, and without a prompt the install is aborted.
92
+ */
93
+ allowDowngrade?: boolean;
94
+ /**
95
+ * Skip the safety check for repository objects that would be overwritten. Defaults to `false`.
96
+ */
33
97
  noExistingObjects?: boolean;
34
98
  };
99
+ /**
100
+ * Options related to the devclass installation.
101
+ */
35
102
  installDevclass?: {
103
+ /**
104
+ * Preserve publisher package names instead of mapping objects into an install package.
105
+ */
36
106
  keepOriginal?: boolean;
107
+ /**
108
+ * Transport layer assigned to generated transportable target packages. When omitted, the system default
109
+ * is resolved only if such packages have to be created.
110
+ */
37
111
  transportLayer?: string;
112
+ /**
113
+ * Explicit publisher-to-target package mappings. Ignored when `keepOriginal` is `true`.
114
+ */
38
115
  replacements?: InstallPackageReplacements[];
116
+ /**
117
+ * Do not register the package namespace on the target system. When unset and the namespace
118
+ * is missing, the user is asked (default: import); without prompts (`noInquirer`) it is imported.
119
+ */
39
120
  skipNamespace?: boolean;
40
121
  };
41
- installTransport?: {
42
- create?: boolean;
122
+ /**
123
+ * Landscape transport-related options.
124
+ */
125
+ landscapeTransport?: {
126
+ /**
127
+ * TMS target for the generated landscape transport. It is selected interactively when omitted.
128
+ * When omitted and the system has no transport targets, it is treated as the final system
129
+ * of the landscape and no landscape transport is generated.
130
+ */
43
131
  targetSystem?: string;
44
132
  };
133
+ /**
134
+ * Skip every post-install activity declared in the manifest. Defaults to `false`.
135
+ */
45
136
  skipPostActivities?: boolean;
46
137
  };
138
+ /** Input required to install a TRM package release into the connected SAP system. */
47
139
  export interface InstallActionInput {
140
+ /** Optional shared execution settings. */
48
141
  contextData?: InstallActionInputContextData;
142
+ /**
143
+ * Data related to the package being installed.
144
+ */
49
145
  packageData: {
146
+ /**
147
+ * Registry package name. For local registries, the manifest name becomes authoritative.
148
+ */
50
149
  name: string;
150
+ /**
151
+ * Release version or registry selector. Defaults to the lockfile root version when
152
+ * `installData.checks.lockfile` is set, otherwise to `latest`.
153
+ */
51
154
  version?: string;
155
+ /**
156
+ * Registry from which metadata and the release artifact are fetched.
157
+ */
52
158
  registry: AbstractRegistry;
159
+ /**
160
+ * Allow reinstalling the same version. Defaults to `false`; dirty local changes still
161
+ * require interactive confirmation and therefore abort when prompts are disabled.
162
+ */
53
163
  overwrite?: boolean;
164
+ /**
165
+ * Expected release integrity (SHA-512, base64), for example from a lockfile. When set, the
166
+ * install aborts before any change unless the release fetched from the registry matches it.
167
+ */
168
+ integrity?: string;
54
169
  };
170
+ /** Optional validation, import, package-mapping, and post-activity settings. */
55
171
  installData?: InstallActionInputInstallData;
172
+ /**
173
+ * Set by a dependency install: the release is selected by the dependency range and the
174
+ * lockfile dependency entries, so the lockfile root (`name`, `version`, `registry`, `integrity`)
175
+ * is not applied to it.
176
+ */
177
+ dependency?: boolean;
56
178
  }
57
179
  type TransportRuntime = {
58
180
  binaries?: TransportBinary;
59
181
  instance?: Transport;
60
182
  };
61
183
  type WorkflowRuntime = {
62
- stopWarningShown: boolean;
63
- registry: AbstractRegistry;
64
- update: boolean;
65
184
  isTrmServer: boolean;
66
185
  isTrmRest: boolean;
67
- remotePackageData: {
186
+ isLocal: boolean;
187
+ update: TrmPackage;
188
+ package: {
68
189
  data: Package;
69
- manifest: TrmManifest;
70
- artifact: TrmArtifact;
71
- contents: boolean;
190
+ hierarchy: PackageHierarchy;
72
191
  };
73
- packageTransports: {
192
+ transports: {
74
193
  devc: TransportRuntime;
75
194
  tadir: TransportRuntime;
76
- lang: TransportRuntime;
77
- cust: TransportRuntime[];
195
+ lang?: TransportRuntime;
196
+ cust?: TransportRuntime[];
78
197
  };
79
- packageTransportsData: {
80
- tdevc: TDEVC[];
198
+ dele?: Transport;
199
+ transportEntries: {
81
200
  tdevct: TDEVCT[];
82
- tadir: TADIR[];
83
- e071: E071[];
84
201
  };
85
- dependenciesToInstall: TrmManifestDependency[];
86
- r3trans: R3trans;
87
- originalData: {
88
- hierarchy: PackageHierarchy;
89
- };
90
- installData: {
91
- namespace: string;
92
- entries: E071[];
93
- transports: TrmPackageInstallTransport[];
94
- upgradingPackage?: TrmPackage;
202
+ dependencies: InstallDependencyEntry[];
203
+ namespace: string;
204
+ /** Registry the package is recorded under: the real registry of a local (.trm) artifact. */
205
+ installRegistry: AbstractRegistry;
206
+ previousInstallPackages: InstallPackageReplacements[];
207
+ /** Transports recorded for the installed release being updated. */
208
+ previousInstallTransports: InstallTransport[];
209
+ dependencyRollbacks: Array<() => Promise<void>>;
210
+ dependencyReleases: Array<() => Promise<void>>;
211
+ /** Packages installed by the dependency installs, transitive ones included, merged into the package snapshot. */
212
+ installedDependencies: TrmPackage[];
213
+ /** Package snapshot before the dependency installs, restored after they are rolled back. */
214
+ systemPackagesBeforeDependencies?: TrmPackage[];
215
+ rootDevclassBeforeImport?: TDEVC;
216
+ stopWarningShown: boolean;
217
+ /** Customizing transports of the release the user chose not to import (or skipped by noCust / non-interactive mode). */
218
+ skippedCust?: string[];
219
+ /** Release objects found on the system by check-transports, accepted before locking. */
220
+ existingObjects?: TADIR[];
221
+ /** Custom namespaces locked by this install or by the install it is a dependency of. */
222
+ lockedNamespaces?: string[];
223
+ /** Required SAP entries missing on the system: the install is aborted by check-engines, with the unmet engines. */
224
+ missingSapEntries?: number;
225
+ };
226
+ /** Dependency queued for install: missing from the system, or installed in an incompatible version. */
227
+ export type InstallDependencyEntry = {
228
+ dependency: TrmManifestDependency;
229
+ status: 'notFound' | 'versionMismatch';
230
+ /** Version on the system; set for `versionMismatch`. */
231
+ installedVersion?: string;
232
+ };
233
+ type WorkflowRevert = {
234
+ transports: {
235
+ devc: TransportBinary;
236
+ tadir: TransportBinary;
237
+ lang?: TransportBinary;
238
+ cust?: TransportBinary[];
95
239
  };
96
- generatedData: {
97
- devclass: DEVCLASS[];
98
- namespace: NAMESPACE;
99
- tmsTxtRefresh: Transport[];
240
+ cleanupTransport?: Transport;
241
+ cleanupImported?: boolean;
242
+ cleanupSucceeded?: boolean;
243
+ importStarted?: boolean;
244
+ importedEntries?: E071[];
245
+ /** Imported customizing transports, copied into the rollback cleanup transport with their keys. */
246
+ importedCustomizing?: Transport[];
247
+ /**
248
+ * Imported objects, SAP packages included, that were already on the system before the import,
249
+ * with their previous TADIR row. The rollback cleanup never deletes them.
250
+ */
251
+ existingObjectsTadir?: TADIR[];
252
+ /** Transport of copies backing up {@link WorkflowRevert.existingObjectsTadir}, tracked before it is released. */
253
+ existingObjectsBackupTransport?: Transport;
254
+ /** Previous version of the existing objects, re-imported once the rollback cleanup succeeded. */
255
+ existingObjectsBackup?: TransportBinary;
256
+ packageHierarchy?: TDEVC[];
257
+ packageTransportLayers?: Array<{
258
+ devclass: DEVCLASS;
259
+ transportLayer: string;
260
+ }>;
261
+ createdTransports?: {
262
+ devc?: Transport;
263
+ tadir?: Transport;
264
+ lang?: Transport;
265
+ cust: Transport[];
100
266
  };
267
+ sapPackages: DEVCLASS[];
268
+ stagingPackages?: DEVCLASS[];
269
+ dele?: TransportBinary;
270
+ deleImportStarted?: boolean;
271
+ deleInTargetTms?: boolean;
272
+ /** Set before the landscape transport is released, as SAP may export it and still fail. */
273
+ landscapeReleaseStarted?: boolean;
274
+ cleanupOriginalTadir?: TADIR[];
275
+ cleanupTemporaryPackages?: TDEVC[];
276
+ updateCleanupTransport?: Transport;
277
+ updateTablesBackupTransport?: Transport;
278
+ retainedTables?: TransportBinary;
279
+ retainedTableObjects?: Pick<E071, 'pgmid' | 'object' | 'objName'>[];
280
+ metadataWriteStarted?: boolean;
281
+ /** Set before the install transports are written, as SAP may commit them and still fail. */
282
+ metadataTransportsWriteStarted?: boolean;
283
+ metadataPackageRegistry?: string;
284
+ /** Install package mappings written by this install. */
285
+ metadataInstallDevc?: ZTRM_INSTALLDEVC[];
286
+ metadataPackageRow?: TrmPackageUpdateData;
287
+ /** TRM packages table row stored before an upgrade wrote its own; undefined when none was stored. */
288
+ metadataPreviousPackageRow?: TrmPackageUpdateData;
289
+ /** Set once the stored row was read: only then can an upgrade revert restore the metadata. */
290
+ metadataPreviousPackageRead?: boolean;
291
+ namespace?: string;
101
292
  };
293
+ /** Result of a successful {@link install} action. */
102
294
  export type InstallActionOutput = {
295
+ /** Normalized manifest of the installed release. */
103
296
  manifest: TrmManifest;
104
- registry: AbstractRegistry;
105
- installTransports?: TrmPackageInstallTransport[];
297
+ /** Generated landscape transport, when the installation produced one. */
298
+ transport?: Transport;
106
299
  };
300
+ /** Internal state shared by package-install workflow steps and rollback handlers. */
107
301
  export interface InstallWorkflowContext extends IActionContext {
302
+ lockScope?: ActionLockScope;
303
+ /** Custom namespaces already locked by the parent installs of a dependency install. */
304
+ inheritedNamespaceLocks?: string[];
305
+ /** Original action input; optional groups are normalized during initialization. */
108
306
  rawInput: InstallActionInput;
307
+ /** Resolved release, package hierarchy, transports, dependencies, and system metadata. */
109
308
  runtime?: WorkflowRuntime;
309
+ /** Data retained so completed steps can be rolled back after a later failure. */
310
+ revert?: WorkflowRevert;
311
+ /** Installation result assembled by the workflow. */
110
312
  output?: InstallActionOutput;
111
313
  }
314
+ /**
315
+ * Installs a TRM package release into the currently connected SAP system.
316
+ *
317
+ * The workflow authorizes the user, fetches and validates the release, checks dependencies
318
+ * (aborting on cyclic dependency graphs before anything is installed) and required SAP entries, maps ABAP packages, imports the artifact transports, executes
319
+ * post-install activities, and records the installed package. Completed reversible steps are
320
+ * rolled back when a later step fails.
321
+ *
322
+ * This operation changes the target SAP system. Do not interrupt it while transports are being
323
+ * generated, imported, or released.
324
+ *
325
+ * @param inputData Package identity, registry, and installation options.
326
+ * @returns The installed release manifest and, when generated, its landscape transport.
327
+ * @throws When authorization, release validation, safety checks, dependency installation,
328
+ * transport processing, or post-install work fails.
329
+ */
112
330
  export declare function install(inputData: InstallActionInput): Promise<InstallActionOutput>;
331
+ /**
332
+ * Internal transactional entry point used when a parent install must retain rollback ownership.
333
+ * `inheritedNamespaceLocks` are the namespaces the parent installs hold locked until they finish.
334
+ */
335
+ export declare function installWithRollback(inputData: InstallActionInput, inheritedNamespaceLocks?: string[]): Promise<{
336
+ output: InstallActionOutput;
337
+ /** Packages installed by the install's own dependency installs, transitive ones included. */
338
+ installedPackages: TrmPackage[];
339
+ rollback: () => Promise<void>;
340
+ release: () => Promise<void>;
341
+ }>;
113
342
  export {};
@@ -8,81 +8,161 @@ 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
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  exports.install = install;
16
- const sammarksworkflow_1 = __importDefault(require("@simonegaffurini/sammarksworkflow"));
17
- const util_1 = require("util");
18
- const trm_commons_1 = require("trm-commons");
13
+ exports.installWithRollback = installWithRollback;
14
+ const commons_1 = require("../commons");
19
15
  const init_1 = require("./init");
20
- const __1 = require("..");
21
- const setSystemPackages_1 = require("../commons/setSystemPackages");
22
- const checkAlreadyInstalled_1 = require("./checkAlreadyInstalled");
16
+ const checkTransports_1 = require("./checkTransports");
23
17
  const checkSapEntries_1 = require("./checkSapEntries");
18
+ const checkEngines_1 = require("./checkEngines");
24
19
  const checkDependencies_1 = require("./checkDependencies");
20
+ const checkDependencyCycles_1 = require("./checkDependencyCycles");
25
21
  const installDependencies_1 = require("./installDependencies");
26
- const checkTransports_1 = require("./checkTransports");
27
- const readDevc_1 = require("./readDevc");
28
22
  const setInstallDevclass_1 = require("./setInstallDevclass");
29
- const checkObjectTypes_1 = require("./checkObjectTypes");
30
- const generateDevclass_1 = require("./generateDevclass");
31
- const readTadir_1 = require("./readTadir");
32
- const importDevcTransport_1 = require("./importDevcTransport");
23
+ const checkInstallDevclass_1 = require("./checkInstallDevclass");
33
24
  const addNamespace_1 = require("./addNamespace");
34
- const importTadirTransport_1 = require("./importTadirTransport");
35
- const importLangTransport_1 = require("./importLangTransport");
36
- const importCustTransport_1 = require("./importCustTransport");
25
+ const generateDevclass_1 = require("./generateDevclass");
26
+ const prepareDevc_1 = require("./prepareDevc");
27
+ const prepareTadir_1 = require("./prepareTadir");
28
+ const prepareLang_1 = require("./prepareLang");
29
+ const prepareCust_1 = require("./prepareCust");
30
+ const importBatch_1 = require("./importBatch");
31
+ const generateLandscapeTransport_1 = require("./generateLandscapeTransport");
37
32
  const updatePackageData_1 = require("./updatePackageData");
38
- const generateInstallTransports_1 = require("./generateInstallTransports");
39
- const refreshTmsTxt_1 = require("./refreshTmsTxt");
40
33
  const executePostActivities_1 = require("./executePostActivities");
41
- const checkObjectsLock_1 = require("./checkObjectsLock");
42
- const releaseInstallTransport_1 = require("./releaseInstallTransport");
34
+ const releaseLandscapeTransport_1 = require("./releaseLandscapeTransport");
35
+ const generateUpdateTransport_1 = require("./generateUpdateTransport");
36
+ const checkDependants_1 = require("./checkDependants");
37
+ const utils_1 = require("../commons/utils");
38
+ const utils_2 = require("../commons/utils");
39
+ const lockResources_1 = require("./lockResources");
40
+ const cleanupCheckpoint_1 = require("./cleanupCheckpoint");
43
41
  ;
44
42
  const WORKFLOW_NAME = 'install';
43
+ /**
44
+ * Installs a TRM package release into the currently connected SAP system.
45
+ *
46
+ * The workflow authorizes the user, fetches and validates the release, checks dependencies
47
+ * (aborting on cyclic dependency graphs before anything is installed) and required SAP entries, maps ABAP packages, imports the artifact transports, executes
48
+ * post-install activities, and records the installed package. Completed reversible steps are
49
+ * rolled back when a later step fails.
50
+ *
51
+ * This operation changes the target SAP system. Do not interrupt it while transports are being
52
+ * generated, imported, or released.
53
+ *
54
+ * @param inputData Package identity, registry, and installation options.
55
+ * @returns The installed release manifest and, when generated, its landscape transport.
56
+ * @throws When authorization, release validation, safety checks, dependency installation,
57
+ * transport processing, or post-install work fails.
58
+ */
45
59
  function install(inputData) {
46
60
  return __awaiter(this, void 0, void 0, function* () {
47
- const workflow = [
48
- __1.checkServerAuth,
49
- init_1.init,
50
- setSystemPackages_1.setSystemPackages,
51
- __1.trmServerPa,
52
- checkAlreadyInstalled_1.checkAlreadyInstalled,
53
- checkSapEntries_1.checkSapEntries,
54
- checkDependencies_1.checkDependencies,
55
- installDependencies_1.installDependencies,
56
- checkTransports_1.checkTransports,
57
- checkObjectTypes_1.checkObjectTypes,
58
- checkObjectsLock_1.checkObjectsLock,
59
- readDevc_1.readDevc,
60
- readTadir_1.readTadir,
61
- setInstallDevclass_1.setInstallDevclass,
62
- addNamespace_1.addNamespace,
63
- generateDevclass_1.generateDevclass,
64
- importDevcTransport_1.importDevcTransport,
65
- importTadirTransport_1.importTadirTransport,
66
- importLangTransport_1.importLangTransport,
67
- importCustTransport_1.importCustTransport,
68
- refreshTmsTxt_1.refreshTmsTxt,
69
- generateInstallTransports_1.generateInstallTransports,
70
- updatePackageData_1.updatePackageData,
71
- executePostActivities_1.executePostActivities,
72
- releaseInstallTransport_1.releaseInstallTransports
73
- ];
74
- trm_commons_1.Logger.log(`Ready to execute workflow ${WORKFLOW_NAME}, input data: ${(0, util_1.inspect)(inputData, { breakLength: Infinity, compact: true })}`, true);
75
- const result = yield (0, sammarksworkflow_1.default)(WORKFLOW_NAME, workflow, {
76
- rawInput: inputData
61
+ return (yield runInstall(inputData, false)).output;
62
+ });
63
+ }
64
+ const installWorkflow = [
65
+ commons_1.checkServerAuth,
66
+ commons_1.setSystemPackages,
67
+ init_1.init,
68
+ checkDependants_1.checkDependants,
69
+ checkTransports_1.checkTransports,
70
+ checkSapEntries_1.checkSapEntries,
71
+ checkEngines_1.checkEngines,
72
+ checkDependencies_1.checkDependencies,
73
+ checkDependencyCycles_1.checkDependencyCycles,
74
+ setInstallDevclass_1.setInstallDevclass,
75
+ checkInstallDevclass_1.checkInstallDevclass,
76
+ lockResources_1.lockResources,
77
+ installDependencies_1.installDependencies,
78
+ cleanupCheckpoint_1.cleanupCheckpoint,
79
+ addNamespace_1.addNamespace,
80
+ generateDevclass_1.generateDevclass,
81
+ generateUpdateTransport_1.generateUpdateTransport,
82
+ prepareDevc_1.prepareDevc,
83
+ prepareTadir_1.prepareTadir,
84
+ prepareLang_1.prepareLang,
85
+ prepareCust_1.prepareCust,
86
+ importBatch_1.importBatch,
87
+ generateLandscapeTransport_1.generateLandscapeTransport,
88
+ executePostActivities_1.executePostActivities,
89
+ releaseLandscapeTransport_1.releaseLandscapeTransport,
90
+ updatePackageData_1.updatePackageData
91
+ ];
92
+ function runInstall(inputData_1, retainRollback_1) {
93
+ return __awaiter(this, arguments, void 0, function* (inputData, retainRollback, inheritedNamespaceLocks = []) {
94
+ var _a;
95
+ const lockScope = new utils_2.ActionLockScope(WORKFLOW_NAME);
96
+ const context = { rawInput: inputData, lockScope, inheritedNamespaceLocks };
97
+ //a local artifact is locked under the package it installs, as a remote install of it would be
98
+ const lockPackage = yield (0, utils_2.resolveInstallPackage)(inputData.packageData.registry, inputData.packageData.name);
99
+ yield lockScope.acquire([(0, utils_2.packageLockResource)(lockPackage.registry, lockPackage.name)]);
100
+ const release = () => __awaiter(this, void 0, void 0, function* () {
101
+ var _a;
102
+ let firstError;
103
+ for (const releaseDependency of [...(((_a = context.runtime) === null || _a === void 0 ? void 0 : _a.dependencyReleases) || [])].reverse()) {
104
+ try {
105
+ yield releaseDependency();
106
+ }
107
+ catch (error) {
108
+ firstError || (firstError = error);
109
+ }
110
+ }
111
+ try {
112
+ yield lockScope.release();
113
+ }
114
+ catch (error) {
115
+ firstError || (firstError = error);
116
+ }
117
+ if (firstError)
118
+ throw firstError;
77
119
  });
78
- trm_commons_1.Logger.log(`Workflow ${WORKFLOW_NAME} result: ${(0, util_1.inspect)(result, { breakLength: Infinity, compact: true })}`, true);
79
- const manifest = result.runtime.remotePackageData.manifest;
80
- const registry = result.runtime.registry;
81
- const installTransports = result.runtime.installData.transports;
120
+ if (!retainRollback) {
121
+ return (0, utils_2.withLockRelease)(release, () => __awaiter(this, void 0, void 0, function* () {
122
+ const result = yield (0, commons_1.executeWorkflow)(WORKFLOW_NAME, installWorkflow, context, commons_1.workflowCallbacks);
123
+ return { output: result.output };
124
+ }));
125
+ }
126
+ let retained;
127
+ try {
128
+ retained = yield (0, utils_1.executeRetainedWorkflow)(WORKFLOW_NAME, installWorkflow, context, commons_1.workflowCallbacks);
129
+ }
130
+ catch (error) {
131
+ yield (0, utils_2.releaseLogged)(release);
132
+ throw error;
133
+ }
134
+ // The locks stay held until the parent calls release (or rollback).
82
135
  return {
83
- manifest,
84
- registry,
85
- installTransports
136
+ output: retained.context.output,
137
+ installedPackages: ((_a = retained.context.runtime) === null || _a === void 0 ? void 0 : _a.installedDependencies) || [],
138
+ release,
139
+ rollback: () => __awaiter(this, void 0, void 0, function* () {
140
+ let firstError;
141
+ try {
142
+ yield retained.rollback();
143
+ }
144
+ catch (error) {
145
+ firstError = error;
146
+ }
147
+ try {
148
+ yield release();
149
+ }
150
+ catch (error) {
151
+ firstError || (firstError = error);
152
+ }
153
+ if (firstError)
154
+ throw firstError;
155
+ })
86
156
  };
87
157
  });
88
158
  }
159
+ /**
160
+ * Internal transactional entry point used when a parent install must retain rollback ownership.
161
+ * `inheritedNamespaceLocks` are the namespaces the parent installs hold locked until they finish.
162
+ */
163
+ function installWithRollback(inputData_1) {
164
+ return __awaiter(this, arguments, void 0, function* (inputData, inheritedNamespaceLocks = []) {
165
+ const retained = yield runInstall(inputData, true, inheritedNamespaceLocks);
166
+ return { output: retained.output, installedPackages: retained.installedPackages, rollback: retained.rollback, release: retained.release };
167
+ });
168
+ }
@@ -1,3 +1,17 @@
1
1
  import { Step } from "@simonegaffurini/sammarksworkflow";
2
2
  import { InstallWorkflowContext } from ".";
3
+ /**
4
+ * Workflow step that fetches the release, validates install settings, and initializes rollback state.
5
+ *
6
+ * 1- fill context data
7
+ *
8
+ * 2- fill missing input data
9
+ *
10
+ * 3- check install transport layer
11
+ *
12
+ * 4- check/set system target
13
+ *
14
+ * 5- check if already installed
15
+ *
16
+ */
3
17
  export declare const init: Step<InstallWorkflowContext>;