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.
Files changed (384) hide show
  1. package/README.md +20 -0
  2. package/changelog.txt +3 -2
  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 -56
  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
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.lockResources = void 0;
13
+ const trm_commons_1 = require("trm-commons");
14
+ const utils_1 = require("../commons/utils");
15
+ const addNamespace_1 = require("./addNamespace");
16
+ const checkTransports_1 = require("./checkTransports");
17
+ function objectKey(object) {
18
+ return `${object.pgmid.trim().toUpperCase()} ${object.object.trim().toUpperCase()} ${object.objName.trim().toUpperCase()}`;
19
+ }
20
+ /**
21
+ * Lock the selected import payload, its resolved target packages and its custom namespace before
22
+ * dependencies mutate SAP, then repeat the safety checks of check-transports that another action
23
+ * could have invalidated before the locks were held.
24
+ */
25
+ exports.lockResources = {
26
+ name: "lock-resources",
27
+ run: (context) => __awaiter(void 0, void 0, void 0, function* () {
28
+ var _a, _b, _c, _d, _e, _f;
29
+ const replacements = new Map((context.rawInput.installData.installDevclass.replacements || [])
30
+ .map(row => [row.originalDevclass.trim().toUpperCase(), row.installDevclass.trim().toUpperCase()]));
31
+ const resources = [];
32
+ resources.push((0, utils_1.packageLockResource)(context.runtime.installRegistry, context.runtime.package.data.manifest.name));
33
+ for (const target of replacements.values()) {
34
+ resources.push({ type: "DEVCLASS", name: target });
35
+ }
36
+ for (const previous of context.runtime.previousInstallPackages || []) {
37
+ resources.push({ type: "DEVCLASS", name: previous.installDevclass });
38
+ }
39
+ //a namespace held by a parent install stays locked until that install finishes
40
+ const namespace = (0, addNamespace_1.getInstallNamespace)(context).trim().toUpperCase();
41
+ const inheritedNamespaces = (context.inheritedNamespaceLocks || []).map(o => o.trim().toUpperCase());
42
+ context.runtime.lockedNamespaces = [...inheritedNamespaces];
43
+ if (namespace.startsWith('/') && !inheritedNamespaces.includes(namespace)) {
44
+ resources.push({ type: "NAMESPACE", name: namespace });
45
+ context.runtime.lockedNamespaces.push(namespace);
46
+ }
47
+ const slots = [
48
+ context.runtime.transports.devc,
49
+ context.runtime.transports.tadir,
50
+ context.runtime.transports.lang,
51
+ ...(context.runtime.transports.cust || [])
52
+ ].filter(Boolean);
53
+ for (const slot of slots) {
54
+ if ((_a = slot.binaries) === null || _a === void 0 ? void 0 : _a.trkorr) {
55
+ resources.push({ type: "TRANSPORT", name: slot.binaries.trkorr });
56
+ }
57
+ // TRM comment rows (pgmid *, e.g. "version=1.0.0") are not objects: every package has them,
58
+ // so a dependency would collide with the lock its parent install holds.
59
+ for (const entry of (((_c = (_b = slot.binaries) === null || _b === void 0 ? void 0 : _b.entries) === null || _c === void 0 ? void 0 : _c.e071) || []).filter(entry => entry.pgmid.trim() !== '*')) {
60
+ const original = entry.objName.trim().toUpperCase();
61
+ const target = entry.pgmid.trim().toUpperCase() === "R3TR" && entry.object.trim().toUpperCase() === "DEVC"
62
+ ? replacements.get(original) || original
63
+ : original;
64
+ resources.push((0, utils_1.objectLockResource)(Object.assign(Object.assign({}, entry), { objName: target })));
65
+ if (entry.pgmid.trim().toUpperCase() === "R3TR" && entry.object.trim().toUpperCase() === "DEVC") {
66
+ resources.push({ type: "DEVCLASS", name: target });
67
+ }
68
+ }
69
+ for (const object of ((_e = (_d = slot.binaries) === null || _d === void 0 ? void 0 : _d.entries) === null || _e === void 0 ? void 0 : _e.tadir) || []) {
70
+ const original = object.objName.trim().toUpperCase();
71
+ const target = object.pgmid.trim().toUpperCase() === "R3TR" && object.object.trim().toUpperCase() === "DEVC"
72
+ ? replacements.get(original) || original
73
+ : original;
74
+ resources.push((0, utils_1.objectLockResource)(Object.assign(Object.assign({}, object), { objName: target })));
75
+ }
76
+ }
77
+ const root = context.runtime.package.hierarchy.devclass.trim().toUpperCase();
78
+ resources.push({ type: "DEVCLASS", name: replacements.get(root) || root });
79
+ yield context.lockScope.acquire(resources);
80
+ //the checks ran before the locks were held: repeat those another action could invalidate
81
+ const e071 = slots.flatMap(slot => { var _a, _b; return ((_b = (_a = slot.binaries) === null || _a === void 0 ? void 0 : _a.entries) === null || _b === void 0 ? void 0 : _b.e071) || []; });
82
+ const tadir = slots.flatMap(slot => { var _a, _b; return ((_b = (_a = slot.binaries) === null || _a === void 0 ? void 0 : _a.entries) === null || _b === void 0 ? void 0 : _b.tadir) || []; });
83
+ trm_commons_1.Logger.loading(`Checking objects locks...`, true);
84
+ yield (0, checkTransports_1.checkObjectsLocks)(e071);
85
+ trm_commons_1.Logger.loading(`Checking objects existence...`, true);
86
+ const accepted = new Set((context.runtime.existingObjects || []).map(objectKey));
87
+ const checkedTadir = (0, checkTransports_1.existenceCheckObjects)(tadir);
88
+ const appeared = (checkedTadir.length > 0 ? yield (0, checkTransports_1.findExistingObjects)(context, checkedTadir) : []).filter(o => !accepted.has(objectKey(o)));
89
+ if (appeared.length > 0) {
90
+ const noExistingObjects = (_f = context.rawInput.installData.checks) === null || _f === void 0 ? void 0 : _f.noExistingObjects;
91
+ appeared.forEach(o => {
92
+ const message = `${o.pgmid} ${o.object} ${o.objName} was created on the target system during the install checks`;
93
+ noExistingObjects ? trm_commons_1.Logger.warning(message, { important: true }) : trm_commons_1.Logger.error(message, { important: true });
94
+ });
95
+ if (!noExistingObjects) {
96
+ throw new Error(`Install aborted: ${appeared.length} object(s) were created on the target system during the install checks.`);
97
+ }
98
+ }
99
+ })
100
+ };
@@ -0,0 +1,13 @@
1
+ import { Step } from "@simonegaffurini/sammarksworkflow";
2
+ import { InstallWorkflowContext } from ".";
3
+ /**
4
+ * Workflow step that prepares and test-imports each customizing transport.
5
+ *
6
+ * 1- generate dummy transport (if registry is not local)
7
+ *
8
+ * 2- upload transport binaries
9
+ *
10
+ * 3- test import transport
11
+ *
12
+ */
13
+ export declare const prepareCust: Step<InstallWorkflowContext>;
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.prepareCust = void 0;
13
+ const trm_commons_1 = require("trm-commons");
14
+ const systemConnector_1 = require("../../systemConnector");
15
+ const transport_1 = require("../../transport");
16
+ const stopWarning_1 = require("../stopWarning");
17
+ const utils_1 = require("../commons/utils");
18
+ const importBatch_1 = require("./importBatch");
19
+ /**
20
+ * Workflow step that prepares and test-imports each customizing transport.
21
+ *
22
+ * 1- generate dummy transport (if registry is not local)
23
+ *
24
+ * 2- upload transport binaries
25
+ *
26
+ * 3- test import transport
27
+ *
28
+ */
29
+ exports.prepareCust = {
30
+ name: 'prepare-cust',
31
+ filter: (context) => __awaiter(void 0, void 0, void 0, function* () {
32
+ if (context.rawInput.installData.import.noCust) {
33
+ trm_commons_1.Logger.log(`Skipping import CUST transport (user input)`, true);
34
+ return false;
35
+ }
36
+ else {
37
+ if (context.runtime.transports.cust.length > 0) {
38
+ return true;
39
+ }
40
+ else {
41
+ trm_commons_1.Logger.log(`Skipping import CUST transport (no transports in package)`, true);
42
+ return false;
43
+ }
44
+ }
45
+ }),
46
+ run: (context) => __awaiter(void 0, void 0, void 0, function* () {
47
+ if (!context.runtime.stopWarningShown) {
48
+ context.runtime.stopWarningShown = true;
49
+ (0, stopWarning_1.stopWarning)('install');
50
+ }
51
+ let index = 0;
52
+ for (const cust of context.runtime.transports.cust) {
53
+ index++;
54
+ const prefix = `(${transport_1.Transport.getTransportIcon()} ${index}/${context.runtime.transports.cust.length} Customizing) `;
55
+ yield (0, utils_1.withScopedPrefix)(prefix, () => __awaiter(void 0, void 0, void 0, function* () {
56
+ var _a;
57
+ //1- generate dummy transport (if registry is not local)
58
+ //checking if binaries are already loaded in context instead of checking registry local
59
+ //is equivalent, but better for possible changes in the future
60
+ //binaries for local registry are loaded in the checkTransports step
61
+ let trkorr;
62
+ if (!cust.binaries.binaries) {
63
+ trm_commons_1.Logger.loading(`Generating transport...`);
64
+ const dummy = yield transport_1.Transport.createToc({
65
+ text: ((_a = context.runtime.package.data.transports.find(o => o.trkorr === cust.binaries.trkorr)) === null || _a === void 0 ? void 0 : _a.description) || `CUST ${index} ${context.rawInput.packageData.name}`,
66
+ target: systemConnector_1.SystemConnector.getDest(),
67
+ trmIdentifier: transport_1.TrmTransportIdentifier.CUST
68
+ });
69
+ context.revert.createdTransports.cust.push(dummy);
70
+ yield dummy.release(false, true);
71
+ try {
72
+ //saving dummy binaries for a possible revert
73
+ context.revert.transports.cust.push({
74
+ trkorr: dummy.trkorr,
75
+ entries: undefined,
76
+ binaries: (yield dummy.download()).binaries
77
+ });
78
+ }
79
+ catch (e) {
80
+ trm_commons_1.Logger.error(`Unable to dowload dummy transport!`, true);
81
+ trm_commons_1.Logger.error(e.toString(), true);
82
+ trm_commons_1.Logger.error(`On failure, revert won't be possible!`, true);
83
+ }
84
+ cust.binaries.binaries = yield context.rawInput.packageData.registry.transport(cust.binaries.trkorr, dummy.trkorr);
85
+ trkorr = dummy.trkorr;
86
+ }
87
+ else {
88
+ trkorr = cust.binaries.trkorr;
89
+ }
90
+ //2- upload transport binaries
91
+ trm_commons_1.Logger.loading(`Uploading transport...`);
92
+ cust.instance = yield transport_1.Transport.upload(trkorr, {
93
+ binary: cust.binaries.binaries,
94
+ trTarget: systemConnector_1.SystemConnector.getDest()
95
+ });
96
+ //3- test import transport
97
+ trm_commons_1.Logger.loading(`Testing import...`);
98
+ const testRc = yield cust.instance.import(true);
99
+ if (testRc < 0 || testRc > 8) {
100
+ throw new Error(`Test import of customizing failed: check logs.`);
101
+ }
102
+ }));
103
+ }
104
+ }),
105
+ revert: (context) => __awaiter(void 0, void 0, void 0, function* () {
106
+ if (!context.revert.cleanupImported && (context.revert.namespace || context.revert.sapPackages.length > 0)) {
107
+ yield (0, importBatch_1.deleteImportedEntries)(context);
108
+ }
109
+ if (context.revert.cleanupImported && !context.revert.cleanupSucceeded) {
110
+ return;
111
+ }
112
+ // Each customizing transport is independent: attempt all of them, then surface the first failure.
113
+ let firstError;
114
+ for (const cust of [...context.revert.transports.cust].reverse()) {
115
+ const generated = context.revert.createdTransports.cust.find(transport => transport.trkorr === cust.trkorr);
116
+ try {
117
+ yield (0, utils_1.revertPreparedTransport)(generated, cust);
118
+ }
119
+ catch (error) {
120
+ firstError || (firstError = error);
121
+ }
122
+ }
123
+ for (const generated of [...context.revert.createdTransports.cust].reverse()) {
124
+ const hasSnapshot = context.revert.transports.cust.some(snapshot => snapshot.trkorr === generated.trkorr);
125
+ if (!hasSnapshot) {
126
+ try {
127
+ yield (0, utils_1.revertPreparedTransport)(generated, undefined);
128
+ }
129
+ catch (error) {
130
+ firstError || (firstError = error);
131
+ }
132
+ }
133
+ }
134
+ if (firstError) {
135
+ throw firstError;
136
+ }
137
+ })
138
+ };
@@ -0,0 +1,15 @@
1
+ import { Step } from "@simonegaffurini/sammarksworkflow";
2
+ import { InstallWorkflowContext } from ".";
3
+ /**
4
+ * Workflow step that prepares and test-imports ABAP package definitions.
5
+ *
6
+ * 1- read if root already exists in system
7
+ *
8
+ * 2- generate dummy transport (if registry is not local)
9
+ *
10
+ * 3- upload transport binaries
11
+ *
12
+ * 4- test import transport
13
+ *
14
+ */
15
+ export declare const prepareDevc: Step<InstallWorkflowContext>;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.prepareDevc = void 0;
13
+ const trm_commons_1 = require("trm-commons");
14
+ const systemConnector_1 = require("../../systemConnector");
15
+ const transport_1 = require("../../transport");
16
+ const stopWarning_1 = require("../stopWarning");
17
+ const utils_1 = require("../commons/utils");
18
+ const importBatch_1 = require("./importBatch");
19
+ /**
20
+ * Workflow step that prepares and test-imports ABAP package definitions.
21
+ *
22
+ * 1- read if root already exists in system
23
+ *
24
+ * 2- generate dummy transport (if registry is not local)
25
+ *
26
+ * 3- upload transport binaries
27
+ *
28
+ * 4- test import transport
29
+ *
30
+ */
31
+ exports.prepareDevc = {
32
+ name: 'prepare-devc',
33
+ filter: (context) => __awaiter(void 0, void 0, void 0, function* () {
34
+ if (context.rawInput.installData.installDevclass.keepOriginal) {
35
+ return true;
36
+ }
37
+ else {
38
+ trm_commons_1.Logger.log(`Skipping import DEVC transport (user input or devclass already generated)`, true);
39
+ return false;
40
+ }
41
+ }),
42
+ run: (context) => __awaiter(void 0, void 0, void 0, function* () {
43
+ var _a;
44
+ var _b;
45
+ //1- read if root already exists in system
46
+ //this is needed later to understand if keeping the superpackage or not
47
+ trm_commons_1.Logger.loading(`Getting ready to import...`);
48
+ //an upgrade reads it before its cleanup deletes the root package (generate-update-transport)
49
+ (_a = (_b = context.runtime).rootDevclassBeforeImport) !== null && _a !== void 0 ? _a : (_b.rootDevclassBeforeImport = yield systemConnector_1.SystemConnector.getDevclass(context.runtime.package.hierarchy.devclass));
50
+ if (!context.runtime.stopWarningShown) {
51
+ context.runtime.stopWarningShown = true;
52
+ (0, stopWarning_1.stopWarning)('install');
53
+ }
54
+ yield (0, utils_1.withScopedPrefix)(`(${transport_1.Transport.getTransportIcon()} SAP Packages) `, () => __awaiter(void 0, void 0, void 0, function* () {
55
+ var _a;
56
+ //2- generate dummy transport (if registry is not local)
57
+ //checking if binaries are already loaded in context instead of checking registry local
58
+ //is equivalent, but better for possible changes in the future
59
+ //binaries for local registry are loaded in the checkTransports step
60
+ let trkorr;
61
+ if (!context.runtime.transports.devc.binaries.binaries) {
62
+ trm_commons_1.Logger.loading(`Generating transport...`);
63
+ const dummy = yield transport_1.Transport.createToc({
64
+ text: ((_a = context.runtime.package.data.transports.find(o => o.trkorr === context.runtime.transports.devc.binaries.trkorr)) === null || _a === void 0 ? void 0 : _a.description) || `DEVC ${context.rawInput.packageData.name}`,
65
+ target: systemConnector_1.SystemConnector.getDest(),
66
+ trmIdentifier: transport_1.TrmTransportIdentifier.DEVC
67
+ });
68
+ context.revert.createdTransports.devc = dummy;
69
+ yield dummy.release(false, true);
70
+ try {
71
+ //saving dummy binaries for a possible revert
72
+ context.revert.transports.devc = {
73
+ trkorr: dummy.trkorr,
74
+ entries: undefined,
75
+ binaries: (yield dummy.download()).binaries
76
+ };
77
+ }
78
+ catch (e) {
79
+ trm_commons_1.Logger.error(`Unable to dowload dummy transport!`, true);
80
+ trm_commons_1.Logger.error(e.toString(), true);
81
+ trm_commons_1.Logger.error(`On failure, revert won't be possible!`, true);
82
+ }
83
+ context.runtime.transports.devc.binaries.binaries = yield context.rawInput.packageData.registry.transport(context.runtime.transports.devc.binaries.trkorr, dummy.trkorr);
84
+ trkorr = dummy.trkorr;
85
+ }
86
+ else {
87
+ trkorr = context.runtime.transports.devc.binaries.trkorr;
88
+ }
89
+ //3- upload transport binaries
90
+ trm_commons_1.Logger.loading(`Uploading transport...`);
91
+ context.runtime.transports.devc.instance = yield transport_1.Transport.upload(trkorr, {
92
+ binary: context.runtime.transports.devc.binaries.binaries,
93
+ trTarget: systemConnector_1.SystemConnector.getDest()
94
+ });
95
+ //4- test import transport
96
+ trm_commons_1.Logger.loading(`Testing import...`);
97
+ const testRc = yield context.runtime.transports.devc.instance.import(true);
98
+ if (testRc < 0 || testRc > 8) {
99
+ throw new Error(`Test import of SAP packages failed: check logs.`);
100
+ }
101
+ }));
102
+ }),
103
+ revert: (context) => __awaiter(void 0, void 0, void 0, function* () {
104
+ if (!context.revert.cleanupImported && (context.revert.namespace || context.revert.sapPackages.length > 0)) {
105
+ yield (0, importBatch_1.deleteImportedEntries)(context);
106
+ }
107
+ if (context.revert.cleanupImported && !context.revert.cleanupSucceeded) {
108
+ return;
109
+ }
110
+ const snapshot = context.revert.transports.devc;
111
+ yield (0, utils_1.revertPreparedTransport)(context.revert.createdTransports.devc, snapshot);
112
+ })
113
+ };
@@ -0,0 +1,13 @@
1
+ import { Step } from "@simonegaffurini/sammarksworkflow";
2
+ import { InstallWorkflowContext } from ".";
3
+ /**
4
+ * Workflow step that prepares and test-imports the optional language transport.
5
+ *
6
+ * 1- generate dummy transport (if registry is not local)
7
+ *
8
+ * 2- upload transport binaries
9
+ *
10
+ * 3- test import transport
11
+ *
12
+ */
13
+ export declare const prepareLang: Step<InstallWorkflowContext>;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.prepareLang = void 0;
13
+ const trm_commons_1 = require("trm-commons");
14
+ const systemConnector_1 = require("../../systemConnector");
15
+ const transport_1 = require("../../transport");
16
+ const stopWarning_1 = require("../stopWarning");
17
+ const utils_1 = require("../commons/utils");
18
+ const importBatch_1 = require("./importBatch");
19
+ /**
20
+ * Workflow step that prepares and test-imports the optional language transport.
21
+ *
22
+ * 1- generate dummy transport (if registry is not local)
23
+ *
24
+ * 2- upload transport binaries
25
+ *
26
+ * 3- test import transport
27
+ *
28
+ */
29
+ exports.prepareLang = {
30
+ name: 'prepare-lang',
31
+ filter: (context) => __awaiter(void 0, void 0, void 0, function* () {
32
+ if (context.rawInput.installData.import.noLang) {
33
+ trm_commons_1.Logger.log(`Skipping import LANG transport (user input)`, true);
34
+ return false;
35
+ }
36
+ else {
37
+ if (context.runtime.transports.lang) {
38
+ return true;
39
+ }
40
+ else {
41
+ trm_commons_1.Logger.log(`Skipping import LANG transport (no transports in package)`, true);
42
+ return false;
43
+ }
44
+ }
45
+ }),
46
+ run: (context) => __awaiter(void 0, void 0, void 0, function* () {
47
+ if (!context.runtime.stopWarningShown) {
48
+ context.runtime.stopWarningShown = true;
49
+ (0, stopWarning_1.stopWarning)('install');
50
+ }
51
+ yield (0, utils_1.withScopedPrefix)(`(${transport_1.Transport.getTransportIcon()} Translations) `, () => __awaiter(void 0, void 0, void 0, function* () {
52
+ var _a;
53
+ //1- generate dummy transport (if registry is not local)
54
+ //checking if binaries are already loaded in context instead of checking registry local
55
+ //is equivalent, but better for possible changes in the future
56
+ //binaries for local registry are loaded in the checkTransports step
57
+ let trkorr;
58
+ if (!context.runtime.transports.lang.binaries.binaries) {
59
+ trm_commons_1.Logger.loading(`Generating transport...`);
60
+ const dummy = yield transport_1.Transport.createToc({
61
+ text: ((_a = context.runtime.package.data.transports.find(o => o.trkorr === context.runtime.transports.lang.binaries.trkorr)) === null || _a === void 0 ? void 0 : _a.description) || `LANG ${context.rawInput.packageData.name}`,
62
+ target: systemConnector_1.SystemConnector.getDest(),
63
+ trmIdentifier: transport_1.TrmTransportIdentifier.LANG
64
+ });
65
+ context.revert.createdTransports.lang = dummy;
66
+ yield dummy.release(false, true);
67
+ try {
68
+ //saving dummy binaries for a possible revert
69
+ context.revert.transports.lang = {
70
+ trkorr: dummy.trkorr,
71
+ entries: undefined,
72
+ binaries: (yield dummy.download()).binaries
73
+ };
74
+ }
75
+ catch (e) {
76
+ trm_commons_1.Logger.error(`Unable to dowload dummy transport!`, true);
77
+ trm_commons_1.Logger.error(e.toString(), true);
78
+ trm_commons_1.Logger.error(`On failure, revert won't be possible!`, true);
79
+ }
80
+ context.runtime.transports.lang.binaries.binaries = yield context.rawInput.packageData.registry.transport(context.runtime.transports.lang.binaries.trkorr, dummy.trkorr);
81
+ trkorr = dummy.trkorr;
82
+ }
83
+ else {
84
+ trkorr = context.runtime.transports.lang.binaries.trkorr;
85
+ }
86
+ //2- upload transport binaries
87
+ trm_commons_1.Logger.loading(`Uploading transport...`);
88
+ context.runtime.transports.lang.instance = yield transport_1.Transport.upload(trkorr, {
89
+ binary: context.runtime.transports.lang.binaries.binaries,
90
+ trTarget: systemConnector_1.SystemConnector.getDest()
91
+ });
92
+ //3- test import transport
93
+ trm_commons_1.Logger.loading(`Testing import...`);
94
+ const testRc = yield context.runtime.transports.lang.instance.import(true);
95
+ if (testRc < 0 || testRc > 8) {
96
+ throw new Error(`Test import of translations failed: check logs.`);
97
+ }
98
+ }));
99
+ }),
100
+ revert: (context) => __awaiter(void 0, void 0, void 0, function* () {
101
+ if (!context.revert.cleanupImported && (context.revert.namespace || context.revert.sapPackages.length > 0)) {
102
+ yield (0, importBatch_1.deleteImportedEntries)(context);
103
+ }
104
+ if (context.revert.cleanupImported && !context.revert.cleanupSucceeded) {
105
+ return;
106
+ }
107
+ const snapshot = context.revert.transports.lang;
108
+ yield (0, utils_1.revertPreparedTransport)(context.revert.createdTransports.lang, snapshot);
109
+ })
110
+ };
@@ -0,0 +1,13 @@
1
+ import { Step } from "@simonegaffurini/sammarksworkflow";
2
+ import { InstallWorkflowContext } from ".";
3
+ /**
4
+ * Workflow step that prepares and test-imports repository objects.
5
+ *
6
+ * 1- generate dummy transport (if registry is not local)
7
+ *
8
+ * 2- upload transport binaries
9
+ *
10
+ * 3- test import transport
11
+ *
12
+ */
13
+ export declare const prepareTadir: Step<InstallWorkflowContext>;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.prepareTadir = void 0;
13
+ const trm_commons_1 = require("trm-commons");
14
+ const systemConnector_1 = require("../../systemConnector");
15
+ const transport_1 = require("../../transport");
16
+ const stopWarning_1 = require("../stopWarning");
17
+ const utils_1 = require("../commons/utils");
18
+ const importBatch_1 = require("./importBatch");
19
+ /**
20
+ * Workflow step that prepares and test-imports repository objects.
21
+ *
22
+ * 1- generate dummy transport (if registry is not local)
23
+ *
24
+ * 2- upload transport binaries
25
+ *
26
+ * 3- test import transport
27
+ *
28
+ */
29
+ exports.prepareTadir = {
30
+ name: 'prepare-tadir',
31
+ run: (context) => __awaiter(void 0, void 0, void 0, function* () {
32
+ if (!context.runtime.stopWarningShown) {
33
+ context.runtime.stopWarningShown = true;
34
+ (0, stopWarning_1.stopWarning)('install');
35
+ }
36
+ yield (0, utils_1.withScopedPrefix)(`(${transport_1.Transport.getTransportIcon()} Workbench) `, () => __awaiter(void 0, void 0, void 0, function* () {
37
+ var _a;
38
+ //1- generate dummy transport (if registry is not local)
39
+ //checking if binaries are already loaded in context instead of checking registry local
40
+ //is equivalent, but better for possible changes in the future
41
+ //binaries for local registry are loaded in the checkTransports step
42
+ let trkorr;
43
+ if (!context.runtime.transports.tadir.binaries.binaries) {
44
+ trm_commons_1.Logger.loading(`Generating transport...`);
45
+ const dummy = yield transport_1.Transport.createToc({
46
+ text: ((_a = context.runtime.package.data.transports.find(o => o.trkorr === context.runtime.transports.tadir.binaries.trkorr)) === null || _a === void 0 ? void 0 : _a.description) || `TADIR ${context.rawInput.packageData.name}`,
47
+ target: systemConnector_1.SystemConnector.getDest(),
48
+ trmIdentifier: transport_1.TrmTransportIdentifier.TADIR
49
+ });
50
+ context.revert.createdTransports.tadir = dummy;
51
+ yield dummy.release(false, true);
52
+ try {
53
+ //saving dummy binaries for a possible revert
54
+ context.revert.transports.tadir = {
55
+ trkorr: dummy.trkorr,
56
+ entries: undefined,
57
+ binaries: (yield dummy.download()).binaries
58
+ };
59
+ }
60
+ catch (e) {
61
+ trm_commons_1.Logger.error(`Unable to dowload dummy transport!`, true);
62
+ trm_commons_1.Logger.error(e.toString(), true);
63
+ trm_commons_1.Logger.error(`On failure, revert won't be possible!`, true);
64
+ }
65
+ context.runtime.transports.tadir.binaries.binaries = yield context.rawInput.packageData.registry.transport(context.runtime.transports.tadir.binaries.trkorr, dummy.trkorr);
66
+ trkorr = dummy.trkorr;
67
+ }
68
+ else {
69
+ trkorr = context.runtime.transports.tadir.binaries.trkorr;
70
+ }
71
+ //2- upload transport binaries
72
+ trm_commons_1.Logger.loading(`Uploading transport...`);
73
+ context.runtime.transports.tadir.instance = yield transport_1.Transport.upload(trkorr, {
74
+ binary: context.runtime.transports.tadir.binaries.binaries,
75
+ trTarget: systemConnector_1.SystemConnector.getDest()
76
+ });
77
+ //3- test import transport
78
+ trm_commons_1.Logger.loading(`Testing import...`);
79
+ const testRc = yield context.runtime.transports.tadir.instance.import(true);
80
+ if (testRc < 0 || testRc > 8) {
81
+ throw new Error(`Test import of workbench failed: check logs.`);
82
+ }
83
+ }));
84
+ }),
85
+ revert: (context) => __awaiter(void 0, void 0, void 0, function* () {
86
+ if (!context.revert.cleanupImported && (context.revert.namespace || context.revert.sapPackages.length > 0)) {
87
+ yield (0, importBatch_1.deleteImportedEntries)(context);
88
+ }
89
+ if (context.revert.cleanupImported && !context.revert.cleanupSucceeded) {
90
+ return;
91
+ }
92
+ const snapshot = context.revert.transports.tadir;
93
+ yield (0, utils_1.revertPreparedTransport)(context.revert.createdTransports.tadir, snapshot);
94
+ })
95
+ };
@@ -0,0 +1,11 @@
1
+ import { Step } from "@simonegaffurini/sammarksworkflow";
2
+ import { InstallWorkflowContext } from ".";
3
+ /**
4
+ * Workflow step that releases the generated landscape transport, when present.
5
+ *
6
+ * 1- add upgrade transport to target transport queue
7
+ *
8
+ * 2- release
9
+ *
10
+ */
11
+ export declare const releaseLandscapeTransport: Step<InstallWorkflowContext>;