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
@@ -47,7 +47,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
48
  exports.Transport = exports.COMMENT_OBJ = void 0;
49
49
  const commons_1 = require("../commons");
50
- const node_r3trans_1 = require("node-r3trans");
50
+ const R3transLogParser_1 = require("./R3transLogParser");
51
51
  const TrmTransportIdentifier_1 = require("./TrmTransportIdentifier");
52
52
  const manifest_1 = require("../manifest");
53
53
  const promises_1 = require("timers/promises");
@@ -57,6 +57,11 @@ const trm_commons_1 = require("trm-commons");
57
57
  const systemConnector_1 = require("../systemConnector");
58
58
  const chalk_1 = __importDefault(require("chalk"));
59
59
  exports.COMMENT_OBJ = 'ZTRM';
60
+ const RELEASE_LOG_STEPS = [
61
+ { id: 'ETP182', name: 'CHECK WRITEABILITY OF BUFFERS', namePadding: '' },
62
+ { id: 'ETP183', name: 'EXPORT PREPARATION', namePadding: ' ' },
63
+ { id: 'ETP150', name: 'MAIN EXPORT', namePadding: ' ' }
64
+ ];
60
65
  class Transport {
61
66
  constructor(trkorr, _trTarget) {
62
67
  this.trkorr = trkorr;
@@ -87,7 +92,8 @@ class Transport {
87
92
  { fieldName: 'TRFUNCTION' },
88
93
  { fieldName: 'TRSTATUS' },
89
94
  { fieldName: 'AS4DATE' },
90
- { fieldName: 'AS4TIME' }
95
+ { fieldName: 'AS4TIME' },
96
+ { fieldName: 'TARSYSTEM' }
91
97
  ];
92
98
  var e070;
93
99
  e070 = yield systemConnector_1.SystemConnector.readTable('E070', fields, `TRKORR EQ '${this.trkorr}'`);
@@ -111,6 +117,44 @@ class Transport {
111
117
  return this._e071;
112
118
  });
113
119
  }
120
+ getE071K() {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ if (!this._e071k) {
123
+ const fields = [
124
+ { fieldName: 'PGMID' },
125
+ { fieldName: 'OBJECT' },
126
+ { fieldName: 'OBJNAME' },
127
+ { fieldName: 'MASTERTYPE' },
128
+ { fieldName: 'MASTERNAME' }
129
+ ];
130
+ this._e071k = yield systemConnector_1.SystemConnector.readTable('E071K', fields, `TRKORR EQ '${this.trkorr}'`);
131
+ }
132
+ return this._e071k;
133
+ });
134
+ }
135
+ /**
136
+ * Table content carried by the transport: one entry per E071K key, and one entry without key
137
+ * (the whole table content) per TABU object that has no key list.
138
+ */
139
+ getCustomizingKeys() {
140
+ return __awaiter(this, void 0, void 0, function* () {
141
+ const keys = yield systemConnector_1.SystemConnector.readTable('E071K', [
142
+ { fieldName: 'OBJNAME' },
143
+ { fieldName: 'MASTERNAME' },
144
+ { fieldName: 'TABKEY' }
145
+ ], `TRKORR EQ '${this.trkorr}'`);
146
+ const objects = yield systemConnector_1.SystemConnector.readTable('E071', [
147
+ { fieldName: 'OBJECT' },
148
+ { fieldName: 'OBJ_NAME' },
149
+ { fieldName: 'OBJFUNC' }
150
+ ], `TRKORR EQ '${this.trkorr}'`);
151
+ return [
152
+ ...keys.map(o => ({ table: (o.objname || o.mastername || '').trim(), tabkey: (o.tabkey || '').trim() })),
153
+ ...objects.filter(o => (o.object || '').trim().toUpperCase() === 'TABU' && (o.objfunc || '').trim().toUpperCase() !== 'K')
154
+ .map(o => ({ table: (o.objName || '').trim() }))
155
+ ];
156
+ });
157
+ }
114
158
  getE07T() {
115
159
  return __awaiter(this, void 0, void 0, function* () {
116
160
  if (!this._e07t) {
@@ -139,6 +183,14 @@ class Transport {
139
183
  }
140
184
  });
141
185
  }
186
+ getEntries() {
187
+ return __awaiter(this, void 0, void 0, function* () {
188
+ if (!this._entries) {
189
+ this._entries = yield systemConnector_1.SystemConnector.getTransportEntries(this.trkorr);
190
+ }
191
+ return this._entries;
192
+ });
193
+ }
142
194
  getTasks() {
143
195
  return __awaiter(this, void 0, void 0, function* () {
144
196
  var tasks = [];
@@ -155,6 +207,7 @@ class Transport {
155
207
  const aE071 = yield this.getE071();
156
208
  if (!aTdevc) {
157
209
  var aDevclass = aE071.filter(o => o.pgmid === 'R3TR' && o.object === 'DEVC').map(o => o.objName);
210
+ //check support for bulk operations
158
211
  if (!systemConnector_1.SystemConnector.getSupportedBulk().getTransportObjects) {
159
212
  for (const oE071 of aE071) {
160
213
  if (oE071.pgmid === 'R3TR') {
@@ -171,16 +224,31 @@ class Transport {
171
224
  aDevclass = Array.from(new Set(aDevclass));
172
225
  }
173
226
  aTdevc = [];
227
+ /*
228
+ #143
229
+ Find root package from E071 object list
230
+ This is not 100% right because the root package found by E071 object list
231
+ might not actually be the root of the package (cases where the root package doesn't have an object
232
+ but has a subpackage with objects).
233
+ The original logic used was this: find the root based on package hierachy.
234
+ This is also not 100% right because after install, users might move the root package to another package
235
+ making it a subpackage, invalidating the logic.
236
+ */
237
+ //for each devclass in aDevclass, add all the parent devclasses (#143 XX stop when parentcl is empty XX)
174
238
  for (var devclass of aDevclass) {
239
+ //while (devclass) {
175
240
  var tdevc = aTdevc.find(o => o.devclass === devclass);
176
241
  if (!tdevc) {
177
242
  tdevc = yield systemConnector_1.SystemConnector.getDevclass(devclass);
178
243
  aTdevc.push(tdevc);
179
244
  }
245
+ //devclass = tdevc.parentcl;
246
+ //}
180
247
  }
181
248
  }
249
+ //now look for the first root package that is included in the original aDevclass
182
250
  while (aTdevc.length > 0 && !this._rootDevclass) {
183
- const hierarchy = (0, commons_1.getPackageHierarchy)(aTdevc, true);
251
+ const hierarchy = (0, commons_1.getPackageHierarchy)(aTdevc, true); //-> added parameter to ignore multiple roots
184
252
  if (aTdevc.find(o => o.devclass === hierarchy.devclass)) {
185
253
  this._rootDevclass = hierarchy.devclass;
186
254
  }
@@ -259,8 +327,9 @@ class Transport {
259
327
  }
260
328
  setDocumentation(sDocumentation) {
261
329
  return __awaiter(this, void 0, void 0, function* () {
262
- this._docs = undefined;
330
+ this._docs = undefined; //clear
263
331
  var doc = [];
332
+ //split at /n to preserve indentation, then split every line that exceedes 67 chars (TDLINE limit)
264
333
  const indentationSplit = sDocumentation.split('\n');
265
334
  indentationSplit.forEach(s => {
266
335
  if (s.length <= 67) {
@@ -293,6 +362,7 @@ class Transport {
293
362
  var doktl;
294
363
  doktl = yield systemConnector_1.SystemConnector.readTable('DOKTL', fields, `ID EQ 'TA' AND OBJECT EQ '${this.trkorr}'`);
295
364
  this._docs = Transport.doktlToDoc(doktl);
365
+ //sort by version descending
296
366
  this._docs = this._docs.sort((a, b) => b.version - a.version);
297
367
  trm_commons_1.Logger.success(`Found ${this.trkorr} ${this._docs.length} documentation.`, true);
298
368
  }
@@ -335,6 +405,11 @@ class Transport {
335
405
  yield systemConnector_1.SystemConnector.addToTransportRequest(this.trkorr, objects, lock);
336
406
  });
337
407
  }
408
+ lock() {
409
+ return __awaiter(this, void 0, void 0, function* () {
410
+ yield systemConnector_1.SystemConnector.lockTransportObjs(this.trkorr);
411
+ });
412
+ }
338
413
  removeComments() {
339
414
  return __awaiter(this, void 0, void 0, function* () {
340
415
  yield systemConnector_1.SystemConnector.removeComments(this.trkorr, exports.COMMENT_OBJ);
@@ -385,14 +460,17 @@ class Transport {
385
460
  }
386
461
  }
387
462
  try {
388
- oTrmPackage = manifest_1.Manifest.fromAbapXml(docVal).setLinkedTransport(this).getPackage();
463
+ oTrmPackage = manifest_1.Manifest.fromAbapXml(docVal).getPackage();
464
+ oTrmPackage.setTransport(this);
389
465
  }
390
466
  catch (e) {
467
+ //invalid manifest
391
468
  }
392
469
  try {
393
470
  oTrmPackage.setDevclass(yield this.getDevclass());
394
471
  }
395
472
  catch (e) {
473
+ //devclass not found
396
474
  }
397
475
  this._linkedTrmPackage = oTrmPackage;
398
476
  }
@@ -401,14 +479,25 @@ class Transport {
401
479
  }
402
480
  delete() {
403
481
  return __awaiter(this, void 0, void 0, function* () {
404
- yield systemConnector_1.SystemConnector.deleteTrkorr(this.trkorr);
482
+ try {
483
+ yield systemConnector_1.SystemConnector.deleteTrkorr(this.trkorr);
484
+ }
485
+ finally {
486
+ //the request may be gone even if the call failed: re-read its status
487
+ this._e070 = undefined;
488
+ }
405
489
  return null;
406
490
  });
407
491
  }
408
492
  release(lock, skipLog, tmpFolder) {
409
493
  return __awaiter(this, void 0, void 0, function* () {
410
- yield systemConnector_1.SystemConnector.releaseTrkorr(this.trkorr, lock);
411
- yield systemConnector_1.SystemConnector.dequeueTransport(this.trkorr);
494
+ try {
495
+ yield systemConnector_1.SystemConnector.releaseTrkorr(this.trkorr, lock);
496
+ }
497
+ finally {
498
+ //the status may have changed even if the call failed: re-read it
499
+ this._e070 = undefined;
500
+ }
412
501
  if (tmpFolder) {
413
502
  yield this.readReleaseLog(tmpFolder);
414
503
  }
@@ -426,130 +515,95 @@ class Transport {
426
515
  trm_commons_1.Logger.log(`System R3trans: ${systemR3transVersion}`, true);
427
516
  trm_commons_1.Logger.log(`System R3trans unicode: ${systemR3transUnicode}`, true);
428
517
  const multibar = trm_commons_1.Logger.multibar('{stage} [{bar}] {exitCode} {result}', Transport.getTransportIcon());
429
- var iEtp182 = 0;
430
- var iEtp183 = 0;
431
- var iEtp150 = 0;
432
- const etp182 = multibar.create(100, iEtp182, {
433
- stage: '',
434
- exitCode: '',
435
- result: 'Needs update'
436
- });
437
- const etp183 = multibar.create(100, iEtp183, {
438
- stage: '',
439
- exitCode: '',
440
- result: 'Needs update'
441
- });
442
- const etp150 = multibar.create(100, iEtp150, {
443
- stage: '',
444
- exitCode: '',
445
- result: 'Needs update'
446
- });
518
+ const steps = RELEASE_LOG_STEPS.map(step => (Object.assign(Object.assign({}, step), { progress: 0, bar: multibar.create(100, 0, {
519
+ stage: '',
520
+ exitCode: '',
521
+ result: 'Needs update'
522
+ }) })));
447
523
  var exitWhile = false;
448
524
  var whileResult = null;
449
- while (!exitWhile) {
450
- var logResult = [];
451
- try {
452
- const logBinary = yield systemConnector_1.SystemConnector.getBinaryFile(filePaths.releaseLog);
453
- fs.writeFileSync(localPath, logBinary);
454
- logResult = yield (new node_r3trans_1.R3transLogParser(localPath, systemR3transUnicode)).getReleaseLog();
455
- fs.unlinkSync(localPath);
456
- }
457
- catch (e) {
458
- logResult = [];
459
- }
460
- var etp182LogResult = logResult.find(o => o.id === 'ETP182') || { name: 'CHECK WRITEABILITY OF BUFFERS', exitCode: null };
461
- var etp183LogResult = logResult.find(o => o.id === 'ETP183') || { name: 'EXPORT PREPARATION', exitCode: null };
462
- var etp150LogResult = logResult.find(o => o.id === 'ETP150') || { name: 'MAIN EXPORT', exitCode: null };
463
- etp183LogResult.name += ' ';
464
- etp150LogResult.name += ' ';
465
- const etp182ExitCode = node_r3trans_1.R3transLogParser.parseExitCode(etp182LogResult.exitCode);
466
- const etp183ExitCode = node_r3trans_1.R3transLogParser.parseExitCode(etp183LogResult.exitCode);
467
- const etp150ExitCode = node_r3trans_1.R3transLogParser.parseExitCode(etp150LogResult.exitCode);
468
- exitWhile = (etp182LogResult.exitCode !== null) && (etp183LogResult.exitCode !== null) && (etp150LogResult.exitCode !== null);
469
- if (etp182ExitCode.type === 'SUCCESS' || etp183ExitCode.type === 'SUCCESS' || etp150ExitCode.type === 'SUCCESS') {
470
- whileResult = 'SUCCESS';
471
- }
472
- if (etp182ExitCode.type === 'WARNING' || etp183ExitCode.type === 'WARNING' || etp150ExitCode.type === 'WARNING') {
473
- whileResult = 'WARNING';
474
- }
475
- if (etp182ExitCode.type === 'ERROR' || etp183ExitCode.type === 'ERROR' || etp150ExitCode.type === 'ERROR') {
476
- whileResult = 'ERROR';
477
- }
478
- const etp182Payload = {
479
- stage: etp182LogResult.name,
480
- exitCode: etp182LogResult.exitCode || '',
481
- result: etp182ExitCode.type !== 'UNKNOWN' ? etp182ExitCode.value : 'In progress'
482
- };
483
- const etp183Payload = {
484
- stage: etp183LogResult.name,
485
- exitCode: etp183LogResult.exitCode || '',
486
- result: etp183ExitCode.type !== 'UNKNOWN' ? etp183ExitCode.value : 'In progress'
487
- };
488
- const etp150Payload = {
489
- stage: etp150LogResult.name,
490
- exitCode: etp150LogResult.exitCode || '',
491
- result: etp150ExitCode.type !== 'UNKNOWN' ? etp150ExitCode.value : 'In progress'
492
- };
493
- if (iEtp182 < 99) {
494
- if (etp182ExitCode.type === 'UNKNOWN') {
495
- iEtp182++;
496
- }
497
- else {
498
- iEtp182 = 100;
525
+ const deadline = Date.now() + Transport.releaseLogTimeoutMs;
526
+ try {
527
+ //the log is downloaded into the temporary folder: a local file system error is not "log not ready yet"
528
+ fs.mkdirSync(tmpFolder, { recursive: true });
529
+ while (!exitWhile && Date.now() < deadline) {
530
+ var logResult = [];
531
+ var logBinary;
532
+ try {
533
+ logBinary = yield systemConnector_1.SystemConnector.getBinaryFile(filePaths.releaseLog);
499
534
  }
500
- }
501
- else {
502
- if (etp182ExitCode.type === 'UNKNOWN') {
503
- iEtp182++;
535
+ catch (e) {
536
+ //log not written yet
537
+ logBinary = undefined;
504
538
  }
505
- }
506
- etp182.update(iEtp182, etp182Payload);
507
- if (iEtp183 < 99) {
508
- if (etp183ExitCode.type === 'UNKNOWN') {
509
- iEtp183++;
539
+ if (logBinary) {
540
+ fs.writeFileSync(localPath, logBinary);
541
+ try {
542
+ logResult = yield (new R3transLogParser_1.R3transLogParser(localPath)).getReleaseLog();
543
+ }
544
+ catch (e) {
545
+ //log incomplete
546
+ logResult = [];
547
+ }
548
+ finally {
549
+ fs.rmSync(localPath, { force: true });
550
+ }
510
551
  }
511
- else {
512
- iEtp183 = 100;
552
+ const stepResults = steps.map(step => {
553
+ const logStep = logResult.find(o => o.id === step.id) || { name: step.name, exitCode: null };
554
+ return {
555
+ step,
556
+ stageName: logStep.name + step.namePadding,
557
+ exitCode: logStep.exitCode,
558
+ parsedExitCode: R3transLogParser_1.R3transLogParser.parseExitCode(logStep.exitCode)
559
+ };
560
+ });
561
+ exitWhile = stepResults.every(o => o.exitCode !== null);
562
+ if (stepResults.some(o => o.parsedExitCode.type === 'SUCCESS')) {
563
+ whileResult = 'SUCCESS';
513
564
  }
514
- }
515
- else {
516
- if (etp183ExitCode.type === 'UNKNOWN') {
517
- iEtp183++;
565
+ if (stepResults.some(o => o.parsedExitCode.type === 'WARNING')) {
566
+ whileResult = 'WARNING';
518
567
  }
519
- }
520
- etp183.update(iEtp183, etp183Payload);
521
- if (iEtp150 < 99) {
522
- if (etp150ExitCode.type === 'UNKNOWN') {
523
- iEtp150++;
568
+ if (stepResults.some(o => o.parsedExitCode.type === 'ERROR')) {
569
+ whileResult = 'ERROR';
524
570
  }
525
- else {
526
- iEtp150 = 100;
571
+ for (const { step, stageName, exitCode, parsedExitCode } of stepResults) {
572
+ if (parsedExitCode.type === 'UNKNOWN') {
573
+ step.progress++;
574
+ }
575
+ else if (step.progress < 99) {
576
+ step.progress = 100;
577
+ }
578
+ step.bar.update(step.progress, {
579
+ stage: stageName,
580
+ exitCode: exitCode || '',
581
+ result: parsedExitCode.type !== 'UNKNOWN' ? parsedExitCode.value : 'In progress'
582
+ });
527
583
  }
528
- }
529
- else {
530
- if (etp150ExitCode.type === 'UNKNOWN') {
531
- iEtp150++;
584
+ if (!exitWhile) {
585
+ yield (0, promises_1.setTimeout)(1000); //each second
532
586
  }
533
587
  }
534
- etp150.update(iEtp150, etp150Payload);
535
- yield (0, promises_1.setTimeout)(1000);
536
588
  }
537
- multibar.stop();
589
+ finally {
590
+ multibar.stop();
591
+ }
538
592
  var error;
539
593
  var rc;
540
594
  if (!exitWhile) {
541
- error = new Error(`Timed out waiting for release.`);
595
+ error = new Error(`Timed out waiting for transport ${this.trkorr} release log "${filePaths.releaseLog}".`);
542
596
  }
543
597
  else {
544
598
  if (whileResult === "ERROR") {
545
599
  error = new Error(`Error occurred during transport ${this.trkorr} release.`);
546
600
  }
547
601
  if (whileResult === "SUCCESS") {
548
- trm_commons_1.Logger.success(`${Transport.getTransportIcon()} ${this.trkorr} released with success.`);
602
+ trm_commons_1.Logger.success(`${Transport.getTransportIcon()} ${this.trkorr} released with success.`);
549
603
  rc = 0;
550
604
  }
551
605
  if (whileResult === "WARNING") {
552
- trm_commons_1.Logger.warning(`${Transport.getTransportIcon()} ${this.trkorr} released with warning.`);
606
+ trm_commons_1.Logger.warning(`${Transport.getTransportIcon()} ${this.trkorr} released with warning.`, { important: true });
553
607
  rc = 4;
554
608
  }
555
609
  }
@@ -563,14 +617,13 @@ class Transport {
563
617
  }
564
618
  _isInTmsQueue(skipLog_1) {
565
619
  return __awaiter(this, arguments, void 0, function* (skipLog, checkImpSing = false) {
566
- trm_commons_1.Logger.log(`TMS check for transport ${this.trkorr}`, true);
567
620
  var inQueue = false;
568
621
  var rc = 12;
569
622
  var message;
570
623
  var lastCheck;
571
624
  if (this._trTarget) {
572
625
  var inQueueAttempts = 0;
573
- trm_commons_1.Logger.loading(`Checking transport status...`, skipLog);
626
+ trm_commons_1.Logger.loading(`Checking ${this.trkorr} status...`, skipLog);
574
627
  while (!inQueue) {
575
628
  inQueueAttempts++;
576
629
  trm_commons_1.Logger.log(`Attempt ${inQueueAttempts}, reading in 3 seconds...`, true);
@@ -596,16 +649,22 @@ class Transport {
596
649
  trm_commons_1.Logger.error(e.toString(), true);
597
650
  }
598
651
  }
652
+ //reading the queue is outdated now and getTransportImportStatus should be used
653
+ //HOWEVER it doesn't work for VIRTUAL TARGETS!
654
+ //for now, keep it like this
599
655
  var tmsQueue = yield systemConnector_1.SystemConnector.readTmsQueue(this._trTarget);
600
656
  tmsQueue = tmsQueue.filter(o => o.trkorr === this.trkorr);
601
657
  tmsQueue = tmsQueue.sort((a, b) => parseInt(b.bufpos) - parseInt(a.bufpos));
602
658
  if (!checkImpSing) {
659
+ //without check if in import, simply check if in queue
603
660
  inQueue = tmsQueue.length > 0;
604
661
  }
605
662
  else {
663
+ //if importing, get the last transport in queue (if re installing, there are more than 1)
606
664
  if (tmsQueue.length > 0) {
607
665
  inQueue = tmsQueue[0].impsing !== 'X';
608
666
  if (!tmsQueue[0].maxrc) {
667
+ //no rc => transport wasn't imported! set as -1 (field is blank, do not confuse with 0 which is success)
609
668
  rc = -1;
610
669
  }
611
670
  else {
@@ -618,10 +677,13 @@ class Transport {
618
677
  }
619
678
  }
620
679
  if (!checkImpSing) {
680
+ //without check of import, we're releasing the transport (publish?)
681
+ //set rc to -1 as it is irrelevant
621
682
  trm_commons_1.Logger.success(`${Transport.getTransportIcon()} ${this.trkorr} released.`, skipLog);
622
683
  rc = -1;
623
684
  }
624
685
  else {
686
+ //read final import message
625
687
  try {
626
688
  message = (yield systemConnector_1.SystemConnector.getTransportImportStatus(this.trkorr, this._trTarget)).message;
627
689
  }
@@ -740,6 +802,43 @@ class Transport {
740
802
  return new Transport(trkorr, data.trTarget);
741
803
  });
742
804
  }
805
+ /**
806
+ * Reads the transport's header (cofile) and data files from the transport directory, if present.
807
+ *
808
+ * A missing (`NOT_FOUND`) or empty file is returned as `undefined`; any other read error is rethrown.
809
+ */
810
+ static readBinaryFiles(trkorr) {
811
+ return __awaiter(this, void 0, void 0, function* () {
812
+ const filePaths = yield Transport._getFilePaths(Transport._getFileNames(trkorr, systemConnector_1.SystemConnector.getDest()));
813
+ const read = (filePath) => __awaiter(this, void 0, void 0, function* () {
814
+ try {
815
+ const file = yield systemConnector_1.SystemConnector.getBinaryFile(filePath);
816
+ return file && file.length > 0 ? file : undefined;
817
+ }
818
+ catch (e) {
819
+ //RFC: exception key, REST: HTTP reason (wrapped in exceptionType or raw error message)
820
+ if ((e === null || e === void 0 ? void 0 : e.exceptionType) === 'NOT_FOUND' || (e === null || e === void 0 ? void 0 : e.message) === 'NOT_FOUND') {
821
+ trm_commons_1.Logger.log(`File "${filePath}" not found.`, true);
822
+ return undefined;
823
+ }
824
+ throw e;
825
+ }
826
+ });
827
+ return {
828
+ header: yield read(filePaths.header),
829
+ data: yield read(filePaths.data)
830
+ };
831
+ });
832
+ }
833
+ /**
834
+ * Writes one of the transport's files (header/cofile or data) to the transport directory.
835
+ */
836
+ static writeBinaryFile(trkorr, kind, binary) {
837
+ return __awaiter(this, void 0, void 0, function* () {
838
+ const filePaths = yield Transport._getFilePaths(Transport._getFileNames(trkorr, systemConnector_1.SystemConnector.getDest()));
839
+ yield systemConnector_1.SystemConnector.writeBinaryFile(filePaths[kind], binary);
840
+ });
841
+ }
743
842
  static getTransportsFromObject(objectKeys, transportsCache) {
744
843
  return __awaiter(this, void 0, void 0, function* () {
745
844
  var transports = [];
@@ -780,41 +879,102 @@ class Transport {
780
879
  return latest;
781
880
  });
782
881
  }
783
- import() {
882
+ static importMultiple(transports_1, target_1) {
883
+ return __awaiter(this, arguments, void 0, function* (transports, target, forward = true) {
884
+ if (forward) {
885
+ for (const transport of transports) {
886
+ trm_commons_1.Logger.loading(`Forwarding transport ${transport.trkorr}`, true);
887
+ yield systemConnector_1.SystemConnector.forwardTransport(transport.trkorr, target, target, true);
888
+ }
889
+ }
890
+ trm_commons_1.Logger.loading(`Importing ${transports.map(o => o.trkorr).join(', ')} in batch`, true);
891
+ yield systemConnector_1.SystemConnector.importTransportMultiple(transports.map(o => o.trkorr), target, false);
892
+ const results = [];
893
+ const originalLPrefix = trm_commons_1.Logger.getPrefix();
894
+ try {
895
+ var index = 0;
896
+ for (const transport of transports) {
897
+ index++;
898
+ const prefix = `(${Transport.getTransportIcon()} ${index}/${transports.length}) `;
899
+ if (originalLPrefix) {
900
+ trm_commons_1.Logger.setPrefix(`${originalLPrefix}-> ${prefix}`);
901
+ }
902
+ else {
903
+ trm_commons_1.Logger.setPrefix(prefix);
904
+ }
905
+ trm_commons_1.Logger.log(`Starting transport ${transport.trkorr} TMS queue status check`, true);
906
+ transport._trTarget = target;
907
+ const queue = yield transport._isInTmsQueue(false, true);
908
+ Transport._printImportResult(transport.trkorr, queue.rc, queue.message, false);
909
+ results.push({ trkorr: transport.trkorr, rc: queue.rc, message: queue.message });
910
+ }
911
+ return results;
912
+ }
913
+ finally {
914
+ trm_commons_1.Logger.setPrefix(originalLPrefix);
915
+ }
916
+ });
917
+ }
918
+ import(test) {
784
919
  return __awaiter(this, void 0, void 0, function* () {
920
+ var rc;
921
+ var message;
785
922
  if (!this._trTarget) {
786
923
  throw new Error('Missing transport target.');
787
924
  }
788
- trm_commons_1.Logger.log(`Starting ${this.trkorr} import`, true);
925
+ trm_commons_1.Logger.log(`Starting ${this.trkorr} import ${test ? 'test' : ''}`, true);
789
926
  trm_commons_1.Logger.loading(`Forwarding transport ${this.trkorr}`, true);
790
927
  yield systemConnector_1.SystemConnector.forwardTransport(this.trkorr, this._trTarget, this._trTarget, true);
791
- trm_commons_1.Logger.loading(`Importing ${this.trkorr}`, true);
792
- yield systemConnector_1.SystemConnector.importTransport(this.trkorr, this._trTarget);
793
- trm_commons_1.Logger.log(`Starting transport ${this.trkorr} TMS queue status check`, true);
794
- const queue = yield this._isInTmsQueue(false, true);
795
- trm_commons_1.Logger.log(`Transport ${this.trkorr} import ended: return code ${queue.rc}`, true);
796
- switch (queue.rc) {
797
- case -1:
798
- trm_commons_1.Logger.error(`${this.trkorr} import has no return code!`);
799
- break;
800
- case 0:
801
- trm_commons_1.Logger.success(`${this.trkorr} import ended with success${queue.message ? ' -> ' + queue.message : '.'}`);
802
- break;
803
- case 4:
804
- trm_commons_1.Logger.warning(`${this.trkorr} import ended with warning${queue.message ? ' -> ' + queue.message : '.'}`);
805
- break;
806
- case 8:
807
- trm_commons_1.Logger.error(`${this.trkorr} import ended with error (check ${chalk_1.default.bold('STMS')})${queue.message ? ' -> ' + queue.message : '.'}`);
808
- break;
809
- case 12:
810
- trm_commons_1.Logger.error(`${this.trkorr} import was cancelled${queue.message ? ' -> ' + queue.message : '.'}`);
811
- break;
812
- case 16:
813
- trm_commons_1.Logger.error(`${this.trkorr} import was cancelled${queue.message ? ' -> ' + queue.message : '.'}`);
814
- break;
928
+ trm_commons_1.Logger.loading(`Importing ${this.trkorr}${test ? ' (TEST IMPORT)' : ''}`, true);
929
+ const result = yield systemConnector_1.SystemConnector.importTransport(this.trkorr, this._trTarget, test);
930
+ if (result) {
931
+ rc = Number(result.tpRetCode);
932
+ if (Array(result.tpStdout)) {
933
+ result.tpStdout.forEach(line => trm_commons_1.Logger.log(line.line, true));
934
+ }
935
+ // tp can hand the import over to the background ("Going offline") and return at once: the objects are
936
+ // only imported (or deleted) afterwards. Wait for the import recorded in the queue and take its return code.
937
+ if (!test && rc < 8) {
938
+ trm_commons_1.Logger.log(`Waiting for transport ${this.trkorr} import to complete`, true);
939
+ const queue = yield this._isInTmsQueue(true, true);
940
+ if (queue.rc >= 0) {
941
+ rc = queue.rc;
942
+ message = queue.message;
943
+ }
944
+ }
945
+ }
946
+ else {
947
+ trm_commons_1.Logger.log(`Starting transport ${this.trkorr} TMS queue status check`, true);
948
+ const queue = yield this._isInTmsQueue(false, true);
949
+ rc = queue.rc;
950
+ message = queue.message;
815
951
  }
952
+ Transport._printImportResult(this.trkorr, rc, message, test);
953
+ return rc;
816
954
  });
817
955
  }
956
+ static _printImportResult(trkorr, rc, message, test) {
957
+ switch (rc) {
958
+ case -1:
959
+ trm_commons_1.Logger.error(`${trkorr} import has no return code!`, { debug: test, important: true });
960
+ break;
961
+ case 0:
962
+ trm_commons_1.Logger.success(`${trkorr} import ended with success${message ? ' -> ' + message : '.'}`, test);
963
+ break;
964
+ case 4:
965
+ trm_commons_1.Logger.warning(`${trkorr} import ended with warning${message ? ' -> ' + message : '.'}`, { debug: test, important: true });
966
+ break;
967
+ case 8:
968
+ trm_commons_1.Logger.error(`${trkorr} import ended with error (check ${chalk_1.default.bold('STMS')})${message ? ' -> ' + message : '.'}`, { debug: test, important: true });
969
+ break;
970
+ case 12:
971
+ trm_commons_1.Logger.error(`${trkorr} import was cancelled${message ? ' -> ' + message : '.'}`, { debug: test, important: true });
972
+ break;
973
+ case 16:
974
+ trm_commons_1.Logger.error(`${trkorr} import was cancelled${message ? ' -> ' + message : '.'}`, { debug: test, important: true });
975
+ break;
976
+ }
977
+ }
818
978
  rename(as4text) {
819
979
  return __awaiter(this, void 0, void 0, function* () {
820
980
  yield systemConnector_1.SystemConnector.renameTransportRequest(this.trkorr, as4text);
@@ -822,13 +982,15 @@ class Transport {
822
982
  }
823
983
  canBeDeleted() {
824
984
  return __awaiter(this, void 0, void 0, function* () {
825
- const status = (yield this.getE070()).trstatus;
985
+ var _a;
986
+ const status = (_a = (yield this.getE070())) === null || _a === void 0 ? void 0 : _a.trstatus;
826
987
  return status === 'D';
827
988
  });
828
989
  }
829
990
  isReleased() {
830
991
  return __awaiter(this, void 0, void 0, function* () {
831
- const status = (yield this.getE070()).trstatus;
992
+ var _a;
993
+ const status = (_a = (yield this.getE070())) === null || _a === void 0 ? void 0 : _a.trstatus;
832
994
  return status === 'R' || status === 'N';
833
995
  });
834
996
  }
@@ -857,3 +1019,7 @@ class Transport {
857
1019
  }
858
1020
  }
859
1021
  exports.Transport = Transport;
1022
+ /**
1023
+ * Maximum time to wait for a release log to report every export step.
1024
+ */
1025
+ Transport.releaseLogTimeoutMs = 30 * 60 * 1000;
@@ -1,6 +1,8 @@
1
1
  export * from "./Transport";
2
+ export * from "./E071KOwner";
2
3
  export * from "./BinaryTransport";
3
4
  export * from "./FileNames";
4
5
  export * from "./FilePaths";
5
6
  export * from "./Documentation";
6
7
  export * from "./TrmTransportIdentifier";
8
+ export * from "./R3transLogParser";