@hcl-software/dxclient 228.0.0 → 230.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 (337) hide show
  1. package/README.md +4 -0
  2. package/dist/configuration/config.json +1 -0
  3. package/dist/package.json +17 -17
  4. package/dist/packages/admintasks/package-lock.json +8623 -15409
  5. package/dist/packages/admintasks/package.json +10 -6
  6. package/dist/packages/admintasks/src/commands/createCredentialVault.d.ts +2 -2
  7. package/dist/packages/admintasks/src/commands/createCredentialVault.js +62 -74
  8. package/dist/packages/admintasks/src/commands/createCredentialVault.js.map +1 -1
  9. package/dist/packages/admintasks/src/commands/createSyndicationRelation.d.ts +1 -1
  10. package/dist/packages/admintasks/src/commands/createSyndicationRelation.js +38 -49
  11. package/dist/packages/admintasks/src/commands/createSyndicationRelation.js.map +1 -1
  12. package/dist/packages/admintasks/src/commands/createVirtualPortal.d.ts +1 -1
  13. package/dist/packages/admintasks/src/commands/createVirtualPortal.js +33 -44
  14. package/dist/packages/admintasks/src/commands/createVirtualPortal.js.map +1 -1
  15. package/dist/packages/admintasks/src/commands/differentialReport.d.ts +1 -1
  16. package/dist/packages/admintasks/src/commands/differentialReport.js +107 -106
  17. package/dist/packages/admintasks/src/commands/differentialReport.js.map +1 -1
  18. package/dist/packages/admintasks/src/commands/exportVirtualPortal.d.ts +1 -1
  19. package/dist/packages/admintasks/src/commands/exportVirtualPortal.js +35 -46
  20. package/dist/packages/admintasks/src/commands/exportVirtualPortal.js.map +1 -1
  21. package/dist/packages/admintasks/src/commands/exportWCMLibrary.d.ts +1 -1
  22. package/dist/packages/admintasks/src/commands/exportWCMLibrary.js +104 -101
  23. package/dist/packages/admintasks/src/commands/exportWCMLibrary.js.map +1 -1
  24. package/dist/packages/admintasks/src/commands/importVirtualPortal.d.ts +1 -1
  25. package/dist/packages/admintasks/src/commands/importVirtualPortal.js +40 -47
  26. package/dist/packages/admintasks/src/commands/importVirtualPortal.js.map +1 -1
  27. package/dist/packages/admintasks/src/commands/importWCMLibrary.d.ts +1 -1
  28. package/dist/packages/admintasks/src/commands/importWCMLibrary.js +85 -82
  29. package/dist/packages/admintasks/src/commands/importWCMLibrary.js.map +1 -1
  30. package/dist/packages/admintasks/src/commands/listVirtualPortals.d.ts +1 -1
  31. package/dist/packages/admintasks/src/commands/listVirtualPortals.js +26 -37
  32. package/dist/packages/admintasks/src/commands/listVirtualPortals.js.map +1 -1
  33. package/dist/packages/admintasks/src/commands/pznRulesExport.d.ts +1 -1
  34. package/dist/packages/admintasks/src/commands/pznRulesExport.js +52 -63
  35. package/dist/packages/admintasks/src/commands/pznRulesExport.js.map +1 -1
  36. package/dist/packages/admintasks/src/commands/pznRulesImport.d.ts +1 -1
  37. package/dist/packages/admintasks/src/commands/pznRulesImport.js +103 -100
  38. package/dist/packages/admintasks/src/commands/pznRulesImport.js.map +1 -1
  39. package/dist/packages/admintasks/src/commands/resEnvProviderActions.d.ts +1 -1
  40. package/dist/packages/admintasks/src/commands/resEnvProviderActions.js +133 -130
  41. package/dist/packages/admintasks/src/commands/resEnvProviderActions.js.map +1 -1
  42. package/dist/packages/admintasks/src/commands/restartCorePods.d.ts +1 -1
  43. package/dist/packages/admintasks/src/commands/restartCorePods.js +19 -30
  44. package/dist/packages/admintasks/src/commands/restartCorePods.js.map +1 -1
  45. package/dist/packages/admintasks/src/commands/restartDXCore.d.ts +1 -1
  46. package/dist/packages/admintasks/src/commands/restartDXCore.js +52 -50
  47. package/dist/packages/admintasks/src/commands/restartDXCore.js.map +1 -1
  48. package/dist/packages/admintasks/src/errors/CommandLineMessages_en.json +4 -2
  49. package/dist/packages/admintasks/src/services/createSyndicationRelationServices.js +6 -15
  50. package/dist/packages/admintasks/src/services/createSyndicationRelationServices.js.map +1 -1
  51. package/dist/packages/admintasks/src/services/differentialReportService.js +8 -17
  52. package/dist/packages/admintasks/src/services/differentialReportService.js.map +1 -1
  53. package/dist/packages/admintasks/src/services/resEnvProviderService.js +54 -64
  54. package/dist/packages/admintasks/src/services/resEnvProviderService.js.map +1 -1
  55. package/dist/packages/admintasks/src/services/restartCorePodsService.js +7 -16
  56. package/dist/packages/admintasks/src/services/restartCorePodsService.js.map +1 -1
  57. package/dist/packages/admintasks/src/services/restartDXCoreService.js +15 -24
  58. package/dist/packages/admintasks/src/services/restartDXCoreService.js.map +1 -1
  59. package/dist/packages/admintasks/src/services/virtualPortalServices.js +40 -49
  60. package/dist/packages/admintasks/src/services/virtualPortalServices.js.map +1 -1
  61. package/dist/packages/admintasks/src/utils/differential-report-utils.js +1042 -1055
  62. package/dist/packages/admintasks/src/utils/differential-report-utils.js.map +1 -1
  63. package/dist/packages/dam/package-lock.json +3417 -6718
  64. package/dist/packages/dam/package.json +12 -8
  65. package/dist/packages/dam/src/commands/createSecrets.d.ts +1 -1
  66. package/dist/packages/dam/src/commands/createSecrets.js +38 -45
  67. package/dist/packages/dam/src/commands/createSecrets.js.map +1 -1
  68. package/dist/packages/dam/src/commands/deleteDAMStagingMismatch.d.ts +1 -1
  69. package/dist/packages/dam/src/commands/deleteDAMStagingMismatch.js +22 -33
  70. package/dist/packages/dam/src/commands/deleteDAMStagingMismatch.js.map +1 -1
  71. package/dist/packages/dam/src/commands/deleteSchema.d.ts +1 -1
  72. package/dist/packages/dam/src/commands/deleteSchema.js +48 -59
  73. package/dist/packages/dam/src/commands/deleteSchema.js.map +1 -1
  74. package/dist/packages/dam/src/commands/exportAssets.d.ts +1 -1
  75. package/dist/packages/dam/src/commands/exportAssets.js +58 -69
  76. package/dist/packages/dam/src/commands/exportAssets.js.map +1 -1
  77. package/dist/packages/dam/src/commands/findDAMStagingMismatch.d.ts +1 -1
  78. package/dist/packages/dam/src/commands/findDAMStagingMismatch.js +25 -36
  79. package/dist/packages/dam/src/commands/findDAMStagingMismatch.js.map +1 -1
  80. package/dist/packages/dam/src/commands/importAssets.d.ts +1 -1
  81. package/dist/packages/dam/src/commands/importAssets.js +38 -49
  82. package/dist/packages/dam/src/commands/importAssets.js.map +1 -1
  83. package/dist/packages/dam/src/commands/listSchema.d.ts +1 -1
  84. package/dist/packages/dam/src/commands/listSchema.js +19 -30
  85. package/dist/packages/dam/src/commands/listSchema.js.map +1 -1
  86. package/dist/packages/dam/src/commands/stagingMismatchReport.d.ts +1 -1
  87. package/dist/packages/dam/src/commands/stagingMismatchReport.js +79 -76
  88. package/dist/packages/dam/src/commands/stagingMismatchReport.js.map +1 -1
  89. package/dist/packages/dam/src/commands/stagingResync.d.ts +1 -1
  90. package/dist/packages/dam/src/commands/stagingResync.js +25 -36
  91. package/dist/packages/dam/src/commands/stagingResync.js.map +1 -1
  92. package/dist/packages/dam/src/commands/subscriberDeRegistration.d.ts +1 -1
  93. package/dist/packages/dam/src/commands/subscriberDeRegistration.js +19 -30
  94. package/dist/packages/dam/src/commands/subscriberDeRegistration.js.map +1 -1
  95. package/dist/packages/dam/src/commands/subscriberDetails.d.ts +1 -1
  96. package/dist/packages/dam/src/commands/subscriberDetails.js +24 -35
  97. package/dist/packages/dam/src/commands/subscriberDetails.js.map +1 -1
  98. package/dist/packages/dam/src/commands/subscriberRegistration.d.ts +1 -1
  99. package/dist/packages/dam/src/commands/subscriberRegistration.js +34 -45
  100. package/dist/packages/dam/src/commands/subscriberRegistration.js.map +1 -1
  101. package/dist/packages/dam/src/commands/triggerDAMStaging.d.ts +1 -1
  102. package/dist/packages/dam/src/commands/triggerDAMStaging.js +19 -30
  103. package/dist/packages/dam/src/commands/triggerDAMStaging.js.map +1 -1
  104. package/dist/packages/dam/src/commands/triggerDamReindexing.d.ts +1 -1
  105. package/dist/packages/dam/src/commands/triggerDamReindexing.js +26 -38
  106. package/dist/packages/dam/src/commands/triggerDamReindexing.js.map +1 -1
  107. package/dist/packages/dam/src/commands/updateSecrets.d.ts +1 -1
  108. package/dist/packages/dam/src/commands/updateSecrets.js +36 -47
  109. package/dist/packages/dam/src/commands/updateSecrets.js.map +1 -1
  110. package/dist/packages/dam/src/commands/validateAssets.d.ts +1 -1
  111. package/dist/packages/dam/src/commands/validateAssets.js +29 -40
  112. package/dist/packages/dam/src/commands/validateAssets.js.map +1 -1
  113. package/dist/packages/dam/src/errors/CommandLineMessages_en.json +1 -1
  114. package/dist/packages/dam/src/export/collection.d.ts +8 -8
  115. package/dist/packages/dam/src/export/collection.js +71 -80
  116. package/dist/packages/dam/src/export/collection.js.map +1 -1
  117. package/dist/packages/dam/src/export/favorite.d.ts +1 -1
  118. package/dist/packages/dam/src/export/favorite.js +10 -19
  119. package/dist/packages/dam/src/export/favorite.js.map +1 -1
  120. package/dist/packages/dam/src/export/media-item.d.ts +4 -4
  121. package/dist/packages/dam/src/export/media-item.js +61 -56
  122. package/dist/packages/dam/src/export/media-item.js.map +1 -1
  123. package/dist/packages/dam/src/export/media-type-group.d.ts +1 -1
  124. package/dist/packages/dam/src/export/media-type-group.js +7 -16
  125. package/dist/packages/dam/src/export/media-type-group.js.map +1 -1
  126. package/dist/packages/dam/src/export/media-type.d.ts +1 -1
  127. package/dist/packages/dam/src/export/media-type.js +7 -16
  128. package/dist/packages/dam/src/export/media-type.js.map +1 -1
  129. package/dist/packages/dam/src/export/renditions.d.ts +6 -6
  130. package/dist/packages/dam/src/export/renditions.js +78 -73
  131. package/dist/packages/dam/src/export/renditions.js.map +1 -1
  132. package/dist/packages/dam/src/import/collection.d.ts +3 -3
  133. package/dist/packages/dam/src/import/collection.js +26 -35
  134. package/dist/packages/dam/src/import/collection.js.map +1 -1
  135. package/dist/packages/dam/src/import/favorite.d.ts +1 -1
  136. package/dist/packages/dam/src/import/favorite.js +8 -17
  137. package/dist/packages/dam/src/import/favorite.js.map +1 -1
  138. package/dist/packages/dam/src/import/media-items.d.ts +3 -3
  139. package/dist/packages/dam/src/import/media-items.js +46 -41
  140. package/dist/packages/dam/src/import/media-items.js.map +1 -1
  141. package/dist/packages/dam/src/import/media-type-group.d.ts +1 -1
  142. package/dist/packages/dam/src/import/media-type-group.js +13 -22
  143. package/dist/packages/dam/src/import/media-type-group.js.map +1 -1
  144. package/dist/packages/dam/src/import/media-type.d.ts +1 -1
  145. package/dist/packages/dam/src/import/media-type.js +12 -21
  146. package/dist/packages/dam/src/import/media-type.js.map +1 -1
  147. package/dist/packages/dam/src/import/permission.d.ts +3 -3
  148. package/dist/packages/dam/src/import/permission.js +21 -30
  149. package/dist/packages/dam/src/import/permission.js.map +1 -1
  150. package/dist/packages/dam/src/import/renditions.d.ts +6 -6
  151. package/dist/packages/dam/src/import/renditions.js +69 -64
  152. package/dist/packages/dam/src/import/renditions.js.map +1 -1
  153. package/dist/packages/dam/src/services/authService.d.ts +1 -1
  154. package/dist/packages/dam/src/services/authService.js +9 -18
  155. package/dist/packages/dam/src/services/authService.js.map +1 -1
  156. package/dist/packages/dam/src/services/stagingService.js +94 -85
  157. package/dist/packages/dam/src/services/stagingService.js.map +1 -1
  158. package/dist/packages/dam/src/services/tokenCache.d.ts +1 -1
  159. package/dist/packages/dam/src/services/tokenCache.js +30 -41
  160. package/dist/packages/dam/src/services/tokenCache.js.map +1 -1
  161. package/dist/packages/dam/src/utils/constants.js +3 -3
  162. package/dist/packages/dam/src/utils/constants.js.map +1 -1
  163. package/dist/packages/dam/src/utils/service.js +59 -70
  164. package/dist/packages/dam/src/utils/service.js.map +1 -1
  165. package/dist/packages/dam/src/validation/collection-list-validate.js +26 -35
  166. package/dist/packages/dam/src/validation/collection-list-validate.js.map +1 -1
  167. package/dist/packages/dam/src/validation/media-list-validate.js +44 -39
  168. package/dist/packages/dam/src/validation/media-list-validate.js.map +1 -1
  169. package/dist/packages/dam/src/validation/media-type-group-validate.js +5 -14
  170. package/dist/packages/dam/src/validation/media-type-group-validate.js.map +1 -1
  171. package/dist/packages/dam/src/validation/media-type-validate.js +5 -14
  172. package/dist/packages/dam/src/validation/media-type-validate.js.map +1 -1
  173. package/dist/packages/dam/src/validation/root-validate.js +10 -19
  174. package/dist/packages/dam/src/validation/root-validate.js.map +1 -1
  175. package/dist/packages/dam/src/validation/validate.rendition.js +17 -26
  176. package/dist/packages/dam/src/validation/validate.rendition.js.map +1 -1
  177. package/dist/packages/dam/src/validation/validate.versions.js +16 -25
  178. package/dist/packages/dam/src/validation/validate.versions.js.map +1 -1
  179. package/dist/packages/deployportlet/package-lock.json +9910 -12666
  180. package/dist/packages/deployportlet/package.json +20 -6
  181. package/dist/packages/deployportlet/src/commands/deployPortlet.d.ts +1 -1
  182. package/dist/packages/deployportlet/src/commands/deployPortlet.js +65 -62
  183. package/dist/packages/deployportlet/src/commands/deployPortlet.js.map +1 -1
  184. package/dist/packages/deployportlet/src/commands/undeployPortlet.d.ts +1 -1
  185. package/dist/packages/deployportlet/src/commands/undeployPortlet.js +80 -77
  186. package/dist/packages/deployportlet/src/commands/undeployPortlet.js.map +1 -1
  187. package/dist/packages/deployportlet/src/commands/xmlaccess.d.ts +1 -1
  188. package/dist/packages/deployportlet/src/commands/xmlaccess.js +18 -25
  189. package/dist/packages/deployportlet/src/commands/xmlaccess.js.map +1 -1
  190. package/dist/packages/deployportlet/src/messages/messages_en.json +1 -1
  191. package/dist/packages/deployportlet/src/services/undeployPortletServices.d.ts +1 -1
  192. package/dist/packages/deployportlet/src/services/undeployPortletServices.js +34 -43
  193. package/dist/packages/deployportlet/src/services/undeployPortletServices.js.map +1 -1
  194. package/dist/packages/deployscriptapplication/package-lock.json +6386 -12749
  195. package/dist/packages/deployscriptapplication/package.json +12 -5
  196. package/dist/packages/deployscriptapplication/src/commands/pull.d.ts +1 -2
  197. package/dist/packages/deployscriptapplication/src/commands/pull.js +146 -159
  198. package/dist/packages/deployscriptapplication/src/commands/pull.js.map +1 -1
  199. package/dist/packages/deployscriptapplication/src/commands/push.d.ts +3 -3
  200. package/dist/packages/deployscriptapplication/src/commands/push.js +149 -157
  201. package/dist/packages/deployscriptapplication/src/commands/push.js.map +1 -1
  202. package/dist/packages/deployscriptapplication/src/commands/restoreScriptApplication.d.ts +2 -2
  203. package/dist/packages/deployscriptapplication/src/commands/restoreScriptApplication.js +88 -101
  204. package/dist/packages/deployscriptapplication/src/commands/restoreScriptApplication.js.map +1 -1
  205. package/dist/packages/deployscriptapplication/src/commands/undeployScriptApplication.d.ts +2 -2
  206. package/dist/packages/deployscriptapplication/src/commands/undeployScriptApplication.js +118 -131
  207. package/dist/packages/deployscriptapplication/src/commands/undeployScriptApplication.js.map +1 -1
  208. package/dist/packages/deployscriptapplication/src/util/constants.js.map +1 -1
  209. package/dist/packages/deployscriptapplication/src/util/generic.js.map +1 -1
  210. package/dist/packages/deploytheme/package-lock.json +7434 -13135
  211. package/dist/packages/deploytheme/package.json +10 -7
  212. package/dist/packages/deploytheme/src/commands/deployApplication.d.ts +1 -1
  213. package/dist/packages/deploytheme/src/commands/deployApplication.js +87 -84
  214. package/dist/packages/deploytheme/src/commands/deployApplication.js.map +1 -1
  215. package/dist/packages/deploytheme/src/commands/deployTheme.d.ts +4 -4
  216. package/dist/packages/deploytheme/src/commands/deployTheme.js +223 -226
  217. package/dist/packages/deploytheme/src/commands/deployTheme.js.map +1 -1
  218. package/dist/packages/deploytheme/src/commands/undeployApplication.d.ts +1 -1
  219. package/dist/packages/deploytheme/src/commands/undeployApplication.js +21 -32
  220. package/dist/packages/deploytheme/src/commands/undeployApplication.js.map +1 -1
  221. package/dist/packages/deploytheme/src/commands/undeployTheme.d.ts +4 -4
  222. package/dist/packages/deploytheme/src/commands/undeployTheme.js +214 -223
  223. package/dist/packages/deploytheme/src/commands/undeployTheme.js.map +1 -1
  224. package/dist/packages/deploytheme/src/services/themeServices.js +97 -90
  225. package/dist/packages/deploytheme/src/services/themeServices.js.map +1 -1
  226. package/dist/packages/livesync/package-lock.json +2201 -3750
  227. package/dist/packages/livesync/package.json +10 -6
  228. package/dist/packages/livesync/src/commands/pullTheme.d.ts +2 -2
  229. package/dist/packages/livesync/src/commands/pullTheme.js +62 -75
  230. package/dist/packages/livesync/src/commands/pullTheme.js.map +1 -1
  231. package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.d.ts +2 -1
  232. package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.js +260 -286
  233. package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.js.map +1 -1
  234. package/dist/packages/livesync/src/commands/pushTheme.d.ts +6 -6
  235. package/dist/packages/livesync/src/commands/pushTheme.js +125 -140
  236. package/dist/packages/livesync/src/commands/pushTheme.js.map +1 -1
  237. package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.d.ts +4 -4
  238. package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.js +554 -553
  239. package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.js.map +1 -1
  240. package/dist/packages/livesync/src/errors/CommandLineMessages_en.json +7 -2
  241. package/dist/packages/livesync/src/messages/messages_en.json +1 -0
  242. package/dist/packages/livesync/src/services/EventsQueue.js +11 -24
  243. package/dist/packages/livesync/src/services/EventsQueue.js.map +1 -1
  244. package/dist/packages/livesync/src/services/foldersWcmServices.js +21 -30
  245. package/dist/packages/livesync/src/services/foldersWcmServices.js.map +1 -1
  246. package/dist/packages/livesync/src/services/htmlComponentWcmServices.js +19 -28
  247. package/dist/packages/livesync/src/services/htmlComponentWcmServices.js.map +1 -1
  248. package/dist/packages/livesync/src/services/initialSyncServices.js +65 -81
  249. package/dist/packages/livesync/src/services/initialSyncServices.js.map +1 -1
  250. package/dist/packages/livesync/src/services/livesyncUtils.js +54 -49
  251. package/dist/packages/livesync/src/services/livesyncUtils.js.map +1 -1
  252. package/dist/packages/livesync/src/services/metadataServices.js +113 -77
  253. package/dist/packages/livesync/src/services/metadataServices.js.map +1 -1
  254. package/dist/packages/livesync/src/services/ongoingSyncServices.js +188 -182
  255. package/dist/packages/livesync/src/services/ongoingSyncServices.js.map +1 -1
  256. package/dist/packages/livesync/src/services/presentationTemplateWcmServices.js +19 -28
  257. package/dist/packages/livesync/src/services/presentationTemplateWcmServices.js.map +1 -1
  258. package/dist/packages/livesync/src/services/styleSheetComponentWcmServices.js +18 -27
  259. package/dist/packages/livesync/src/services/styleSheetComponentWcmServices.js.map +1 -1
  260. package/dist/packages/livesync/src/services/wcmContext/initialSync.js +29 -23
  261. package/dist/packages/livesync/src/services/wcmContext/initialSync.js.map +1 -1
  262. package/dist/packages/livesync/src/services/wcmContext/stylesheetComponent.js +221 -225
  263. package/dist/packages/livesync/src/services/wcmContext/stylesheetComponent.js.map +1 -1
  264. package/dist/packages/livesync/src/services/wcmContext/wcmLibraryContext.js +4 -4
  265. package/dist/packages/livesync/src/services/wcmContext/wcmLibraryContext.js.map +1 -1
  266. package/dist/packages/livesync/src/services/wcmRestV2Services.js +20 -26
  267. package/dist/packages/livesync/src/services/wcmRestV2Services.js.map +1 -1
  268. package/dist/packages/livesync/src/types/EventHandler.type.d.ts +1 -1
  269. package/dist/packages/livesync/src/types/EventQueueItem.type.d.ts +2 -2
  270. package/dist/packages/livesync/src/types/OngoingSyncHooks.type.d.ts +1 -1
  271. package/dist/packages/livesync/src/types/WCMDesignLibraryCache.type.d.ts +1 -1
  272. package/dist/packages/livesync/src/types/WcmRestApiV2.type.d.ts +8 -8
  273. package/dist/packages/livesync/src/types/index.d.ts +15 -0
  274. package/dist/packages/livesync/src/types/index.js +5 -1
  275. package/dist/packages/livesync/src/types/index.js.map +1 -1
  276. package/dist/packages/mls_exim/package-lock.json +2910 -5990
  277. package/dist/packages/mls_exim/package.json +10 -6
  278. package/dist/packages/mls_exim/src/export/mlsExport.d.ts +2 -2
  279. package/dist/packages/mls_exim/src/export/mlsExport.js +81 -78
  280. package/dist/packages/mls_exim/src/export/mlsExport.js.map +1 -1
  281. package/dist/packages/mls_exim/src/export/mlsExport.ts +9 -9
  282. package/dist/packages/mls_exim/src/import/mlsImport.d.ts +1 -1
  283. package/dist/packages/mls_exim/src/import/mlsImport.js +36 -47
  284. package/dist/packages/mls_exim/src/import/mlsImport.js.map +1 -1
  285. package/dist/packages/mls_exim/src/import/mlsImport.ts +3 -3
  286. package/dist/packages/sharedlibrary/package-lock.json +6222 -12628
  287. package/dist/packages/sharedlibrary/package.json +9 -6
  288. package/dist/packages/sharedlibrary/src/commands/delete.d.ts +1 -1
  289. package/dist/packages/sharedlibrary/src/commands/delete.js +40 -37
  290. package/dist/packages/sharedlibrary/src/commands/delete.js.map +1 -1
  291. package/dist/packages/sharedlibrary/src/commands/upload.d.ts +1 -1
  292. package/dist/packages/sharedlibrary/src/commands/upload.js +73 -70
  293. package/dist/packages/sharedlibrary/src/commands/upload.js.map +1 -1
  294. package/dist/packages/sharedlibrary/src/errors/CommandLineMessages_en.json +1 -0
  295. package/dist/packages/sharedlibrary/src/services/sharedLibraryServices.js +29 -30
  296. package/dist/packages/sharedlibrary/src/services/sharedLibraryServices.js.map +1 -1
  297. package/dist/packages/syndication/package-lock.json +9912 -12668
  298. package/dist/packages/syndication/package.json +21 -7
  299. package/dist/packages/syndication/src/commands/subscriber.d.ts +1 -1
  300. package/dist/packages/syndication/src/commands/subscriber.js +43 -43
  301. package/dist/packages/syndication/src/commands/subscriber.js.map +1 -1
  302. package/dist/packages/syndication/src/commands/syndicator.d.ts +1 -1
  303. package/dist/packages/syndication/src/commands/syndicator.js +33 -44
  304. package/dist/packages/syndication/src/commands/syndicator.js.map +1 -1
  305. package/dist/packages/syndication/src/commands/syndicatorFailedItem.d.ts +1 -1
  306. package/dist/packages/syndication/src/commands/syndicatorFailedItem.js +81 -78
  307. package/dist/packages/syndication/src/commands/syndicatorFailedItem.js.map +1 -1
  308. package/dist/packages/syndication/src/errors/CommandLineMessages_en.json +3 -1
  309. package/dist/packages/syndication/src/services/syndicationService.d.ts +8 -8
  310. package/dist/packages/syndication/src/services/syndicationService.js +67 -48
  311. package/dist/packages/syndication/src/services/syndicationService.js.map +1 -1
  312. package/dist/src/errors/CommandLineMessages_en.json +6 -1
  313. package/dist/src/index.js +1113 -944
  314. package/dist/src/index.js.map +1 -1
  315. package/dist/src/services/apiServices.js +184 -177
  316. package/dist/src/services/apiServices.js.map +1 -1
  317. package/dist/src/services/filesServices.d.ts +1 -1
  318. package/dist/src/services/filesServices.js +28 -23
  319. package/dist/src/services/filesServices.js.map +1 -1
  320. package/dist/src/services/requestService.js +16 -22
  321. package/dist/src/services/requestService.js.map +1 -1
  322. package/dist/src/utils/constants.d.ts +1 -1
  323. package/dist/src/utils/constants.js +59 -59
  324. package/dist/src/utils/constants.js.map +1 -1
  325. package/dist/src/utils/helpFormatter.d.ts +6 -0
  326. package/dist/src/utils/helpFormatter.js +34 -0
  327. package/dist/src/utils/helpFormatter.js.map +1 -0
  328. package/dist/src/utils/logger.d.ts +1 -0
  329. package/dist/src/utils/logger.js +58 -61
  330. package/dist/src/utils/logger.js.map +1 -1
  331. package/dist/src/utils/utils.d.ts +7 -6
  332. package/dist/src/utils/utils.js +126 -113
  333. package/dist/src/utils/utils.js.map +1 -1
  334. package/dist/src/utils/validateOptions.d.ts +3 -3
  335. package/dist/src/utils/validateOptions.js +378 -333
  336. package/dist/src/utils/validateOptions.js.map +1 -1
  337. package/package.json +17 -17
package/dist/src/index.js CHANGED
@@ -1,13 +1,4 @@
1
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
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -76,8 +67,9 @@ const stagingResync_1 = require("../packages/dam/src/commands/stagingResync");
76
67
  const deleteDAMStagingMismatch_1 = require("../packages/dam/src/commands/deleteDAMStagingMismatch");
77
68
  const wcmRestV2Services_1 = require("../packages/livesync/src/services/wcmRestV2Services");
78
69
  const metadataServices_1 = require("../packages/livesync/src/services/metadataServices");
70
+ const helpFormatter_1 = require("./utils/helpFormatter");
79
71
  const MaskData = require('maskdata');
80
- const config = utils_1.getConfigJSON();
72
+ const config = (0, utils_1.getConfigJSON)();
81
73
  const program = new commander_1.default.Command();
82
74
  program.version(package_json_1.default.version || 'missing version info');
83
75
  program.description(package_json_1.default.description || 'missing description');
@@ -93,6 +85,7 @@ program.on('--help', () => {
93
85
  logger_1.logger.help(' $ dxclient deploy-theme');
94
86
  logger_1.logger.help(' $ dxclient undeploy-theme');
95
87
  logger_1.logger.help(' $ dxclient deploy-application');
88
+ logger_1.logger.help(' $ dxclient undeploy-application');
96
89
  logger_1.logger.help(' $ dxclient mls-export');
97
90
  logger_1.logger.help(' $ dxclient mls-import');
98
91
  logger_1.logger.help(' $ dxclient manage-syndicator');
@@ -115,10 +108,10 @@ program.on('--help', () => {
115
108
  logger_1.logger.help(' $ dxclient wcm-library-import');
116
109
  logger_1.logger.help(' $ dxclient dx-core-configuration-reports summary-report');
117
110
  logger_1.logger.help(' $ dxclient manage-dam-assets export-assets | import-assets | validate-assets');
118
- if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
119
- logger_1.logger.help(` $ dxclient livesync push-theme | pull-theme${utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC_WCM) ? ' | push-wcm-design-library | pull-wcm-design-library' : ''}`);
111
+ if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC)) {
112
+ logger_1.logger.help(` $ dxclient livesync push-theme | pull-theme${(0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC_WCM) ? ' | push-wcm-design-library | pull-wcm-design-library' : ''}`);
120
113
  }
121
- if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_REINDEXING)) {
114
+ if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.DAM_REINDEXING)) {
122
115
  logger_1.logger.help(' $ dxclient trigger-dam-reindexing');
123
116
  }
124
117
  logger_1.logger.help(' $ dxclient accept-license');
@@ -135,14 +128,15 @@ program.on('--help', () => {
135
128
  }
136
129
  });
137
130
  program.command(constants_1.COMMANDS.VERSION_COMPAT)
138
- .option('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
139
- .option('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
140
- .option('-dxConnectProtocol, --dxConnectProtocol <value>', 'Protocol of the cw_profile', config.dxConnectProtocol.toString())
141
- .option('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
142
- .option('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
131
+ .requiredOption('--hostname [value]', 'Host name of the DX Core server', config.hostname)
132
+ .requiredOption('--dxConnectPort [value]', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
133
+ .requiredOption('--dxConnectProtocol [value]', 'Protocol of the cw_profile', config.dxConnectProtocol.toString())
134
+ .requiredOption('--dxConnectUsername [value]', 'Username for the cw_profile', config.dxConnectUsername)
135
+ .requiredOption('--dxConnectPassword [value]', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
143
136
  .description('- Show version compatibility details between DX Core and DXClient.')
144
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
145
- commands_1.configureCommand(constants_1.COMMANDS.VERSION_COMPAT);
137
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient version-compat --hostname localhost --dxConnectProtocol https --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'))
138
+ .action(async (cmdOptions) => {
139
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.VERSION_COMPAT);
146
140
  try {
147
141
  if (process.env.DXCLIENT_TYPE && process.env.DXCLIENT_TYPE === 'container') {
148
142
  logger_1.logger.help('\n Note: This installation is a container-based version of DXClient.\n');
@@ -150,149 +144,169 @@ program.command(constants_1.COMMANDS.VERSION_COMPAT)
150
144
  else {
151
145
  logger_1.logger.help('\n Note: This installation is a node-based version of DXClient.\n');
152
146
  }
153
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
154
- yield utils_1.validateVersionMapping(cmdOptions);
147
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
148
+ await (0, utils_1.validateVersionMapping)(cmdOptions);
155
149
  }
156
150
  catch (error) {
157
151
  logger_1.logger.error(error.message);
158
- yield utils_1.flushLogAndExitProcess(false);
152
+ await (0, utils_1.flushLogAndExitProcess)(false);
159
153
  }
160
- }));
154
+ });
161
155
  program
162
156
  .command(constants_1.COMMANDS.DEPLOY_PORTLET)
163
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
164
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
165
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
166
- .requiredOption('-xmlConfigPath, --xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
167
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
168
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
169
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
170
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
171
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
172
- .requiredOption('-xmlFile, --xmlFile <value>', 'Input xml file name with full path')
173
- .requiredOption('-warFile, --warFile <value>', 'War file name with full path ')
157
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
158
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
159
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
160
+ .requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
161
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
162
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
163
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
164
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
165
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
166
+ .requiredOption('--xmlFile <value>', 'Input xml file name with full path')
167
+ .requiredOption('--warFile <value>', 'War file name with full path ')
174
168
  .description('- Deploys the portlet to the DX Core server')
175
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
176
- commands_1.configureCommand(constants_1.COMMANDS.DEPLOY_PORTLET);
169
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient deploy-portlet --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsername wpsadmin --dxPassword wpsadmin --dxConnectUsername wpsadmin'
170
+ + ' --dxConnectPassword wpsadmin --dxConnectPort 10202 --xmlFile /user/deploy-portlet/test.xml --warFile /user/deploy-portlet/test.war'))
171
+ .action(async (cmdOptions) => {
172
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.DEPLOY_PORTLET);
177
173
  logger_1.logger.debug('Deploy portlet execution started');
178
174
  try {
179
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
180
- validateOptions_1.validateOptions(cmdOptions);
175
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
176
+ (0, validateOptions_1.validateOptions)(cmdOptions);
181
177
  }
182
178
  catch (error) {
183
179
  logger_1.logger.error(error.message);
184
- yield utils_1.flushLogAndExitProcess(false, true);
180
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
185
181
  }
186
182
  const deployPortletObj = new deployPortlet_1.DeployPortlet();
187
183
  try {
188
- const responseCode = yield deployPortletObj.invoke(cmdOptions);
184
+ const responseCode = await deployPortletObj.invoke(cmdOptions);
189
185
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
190
186
  logger_1.logger.debug('Deploy portlet execution completed');
191
- yield utils_1.flushLogAndExitProcess(responseCode);
187
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
192
188
  }
193
189
  catch (error) {
194
190
  logger_1.logger.debug('Exception in execution of deploy portlet : %o', error);
195
- yield utils_1.flushLogAndExitProcess(false);
191
+ await (0, utils_1.flushLogAndExitProcess)(false);
196
192
  }
197
- }));
193
+ });
198
194
  program
199
195
  .command(constants_1.COMMANDS.UNDEPLOY_PORTLET)
200
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
201
- .requiredOption('-hostname,--hostname <value>', 'Host name of the DX Core server', config.hostname)
202
- .requiredOption('-dxPort,--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
203
- .requiredOption('-xmlConfigPath, --xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
204
- .requiredOption('-dxUsername,--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
205
- .requiredOption('-dxPassword,--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
206
- .requiredOption('-xmlFile,--xmlFile <value>', 'XML file name with full path ')
207
- .option('-enableBackup,--enableBackup <value>', 'Set the flag to true to take backup of the Portlets that to be undeployed', config.enableBackup)
208
- .option('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
209
- .option('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
210
- .option('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
211
- .option('-dxSoapPort, --dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
212
- .option('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
213
- .option('-dxProfilePath, --dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
196
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
197
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
198
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
199
+ .requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
200
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
201
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
202
+ .requiredOption('--xmlFile <value>', 'XML file name with full path ')
203
+ .option('--enableBackup <value>', 'Set the flag to true to take backup of the Portlets that to be undeployed', config.enableBackup)
204
+ .option('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
205
+ .option('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
206
+ .option('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
207
+ .option('--dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
208
+ .option('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
209
+ .option('--dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
214
210
  .description('- Undeploys the portlet from the DX Core server.')
215
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
216
- commands_1.configureCommand(constants_1.COMMANDS.UNDEPLOY_PORTLET);
211
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient undeploy-portlet --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsername wpsadmin'
212
+ + ' --dxPassword wpsadmin --xmlFile /user/undeploy-portlet/test.xml --enableBackup false --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
213
+ + ' --dxConnectPort 10202 --dxSoapPort 10033 --dxProfileName wp_profile --dxProfilePath /opt/HCL/wp_profile'))
214
+ .action(async (cmdOptions) => {
215
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.UNDEPLOY_PORTLET);
217
216
  logger_1.logger.debug('undeploy portlet execution started');
218
217
  try {
219
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
220
- validateOptions_1.validateOptions(cmdOptions);
218
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
219
+ (0, validateOptions_1.validateOptions)(cmdOptions);
221
220
  }
222
221
  catch (error) {
223
222
  logger_1.logger.error(error.message);
224
- yield utils_1.flushLogAndExitProcess(false, true);
223
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
225
224
  }
226
225
  const undeployPortletObj = new undeployPortlet_1.UndeployPortlet();
227
226
  try {
228
- const responseCode = yield undeployPortletObj.invoke(cmdOptions);
227
+ const responseCode = await undeployPortletObj.invoke(cmdOptions);
229
228
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
230
229
  logger_1.logger.debug('undeploy portlet execution completed');
231
- yield utils_1.flushLogAndExitProcess(responseCode);
230
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
232
231
  }
233
232
  catch (error) {
234
233
  logger_1.logger.debug('Exception in execution of xml access : %o', error);
235
- yield utils_1.flushLogAndExitProcess(false);
234
+ await (0, utils_1.flushLogAndExitProcess)(false);
236
235
  }
237
- }));
236
+ });
238
237
  program
239
238
  .command(constants_1.COMMANDS.XMLACCESS)
240
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
241
- .requiredOption('-hostname,--hostname <value>', 'Host name of the DX Core server', config.hostname)
242
- .requiredOption('-dxPort,--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
243
- .requiredOption('-xmlConfigPath, --xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
244
- .requiredOption('-dxUsername,--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
245
- .requiredOption('-dxPassword,--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
246
- .requiredOption('-xmlFile,--xmlFile <value>', 'XML file name with full path ')
239
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
240
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
241
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
242
+ .requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
243
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
244
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
245
+ .requiredOption('--xmlFile <value>', 'XML file name with full path ')
246
+ .option('--xmlAccessOutputFileName <value>', 'File name for the XML access output', config.xmlAccessOutputFileName)
247
247
  .description('- Executes xml access tasks on the DX Core server.')
248
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
249
- commands_1.configureCommand(constants_1.COMMANDS.XMLACCESS);
248
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient xmlaccess --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsername wpsadmin'
249
+ + ' --dxPassword wpsadmin --xmlFile /user/xmlaccess/fullPageExport.xml --xmlAccessOutputFileName test.xml'))
250
+ .action(async (cmdOptions) => {
251
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.XMLACCESS);
250
252
  logger_1.logger.debug('Xmlaccess execution started');
251
253
  try {
252
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
253
- validateOptions_1.validateOptions(cmdOptions);
254
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
255
+ (0, validateOptions_1.validateOptions)(cmdOptions);
254
256
  }
255
257
  catch (error) {
256
258
  logger_1.logger.error(error.message);
257
- yield utils_1.flushLogAndExitProcess(false, true);
259
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
258
260
  }
259
261
  try {
260
262
  const xmlAccess = new xmlaccess_1.XmlAccess();
261
- const responseCode = yield xmlAccess.invoke(cmdOptions);
263
+ const responseCode = await xmlAccess.invoke(cmdOptions);
262
264
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
263
265
  logger_1.logger.debug('Xmlaccess execution completed');
264
- yield utils_1.flushLogAndExitProcess(responseCode);
266
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
265
267
  }
266
268
  catch (error) {
267
269
  logger_1.logger.debug('Exception in execution of xml access : %o', error);
268
- yield utils_1.flushLogAndExitProcess(false);
270
+ await (0, utils_1.flushLogAndExitProcess)(false);
269
271
  }
270
- }));
272
+ });
271
273
  program
272
274
  .command('deploy-scriptapplication [subCmd]')
273
- .requiredOption('-dxProtocol,--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
274
- .requiredOption('-hostname,--hostname <value>', 'Hostname of the DX Core server', config.hostname)
275
- .requiredOption('-dxPort,--dxPort <value>', 'Port number for DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
276
- .requiredOption('-dxUsername,--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
277
- .requiredOption('-dxPassword,--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
278
- .requiredOption('-wcmSiteArea,--wcmSiteArea <value>', 'Web Content Manager site area in which Script Application instances are created', config.wcmSiteArea)
279
- .requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
280
- .requiredOption('-mainHtmlFile,--mainHtmlFile <value>', 'Path to the main .html file of the Script Application', '')
281
- .requiredOption('-wcmContentId,--wcmContentId <value>', 'Web Content Manager content ID of an existing Script Application instance on a portal page', config.wcmContentId)
282
- .requiredOption('-wcmContentTitle,--wcmContentTitle <value>', 'Sets or updates the title of the Script Application instance', '')
283
- .option('-contentRoot,--contentRoot <value>', 'Absolute or relative path to a directory on the workstation that contains the content to be pushed to the portal')
284
- .option('-wcmContentPath,--wcmContentPath <value>', 'Full Web Content Manager path, including library and site area', config.wcmContentPath)
285
- .option('-wcmContentName,--wcmContentName <value>', 'Name of the Script Application instance to be created or updated', config.wcmContentName)
286
- .option('-prebuiltZip,--prebuiltZip <value>', 'Path to an existing compressed file that provides the content to be pushed to the portal')
287
- .option('-virtualPortalContext,--virtualPortalContext <value>', 'Context of the virtual portal that contains the Script Application instance', config.virtualPortalContext)
288
- .option('-projectContext,--projectContext <value>', 'Context of the portal project that manages the publication of changes to the Script Application content', config.projectContext)
275
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
276
+ .requiredOption('--hostname <value>', 'Hostname of the DX Core server', config.hostname)
277
+ .requiredOption('--dxPort <value>', 'Port number for DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
278
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
279
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
280
+ .requiredOption('--wcmSiteArea <value>', 'Web Content Manager site area in which Script Application instances are created', config.wcmSiteArea)
281
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
282
+ .requiredOption('--mainHtmlFile <value>', 'Path to the main .html file of the Script Application', '')
283
+ .requiredOption('--wcmContentId <value>', 'Web Content Manager content ID of an existing Script Application instance on a portal page', config.wcmContentId)
284
+ .requiredOption('--wcmContentTitle <value>', 'Sets or updates the title of the Script Application instance', '')
285
+ .option('--contentRoot <value>', 'Absolute or relative path to a directory on the workstation that contains the content to be pushed to the portal')
286
+ .option('--wcmContentPath <value>', 'Full Web Content Manager path, including library and site area', config.wcmContentPath)
287
+ .option('--wcmContentName <value>', 'Name of the Script Application instance to be created or updated', config.wcmContentName)
288
+ .option('--prebuiltZip <value>', 'Path to an existing compressed file that provides the content to be pushed to the portal')
289
+ .option('--virtualPortalContext <value>', 'Context of the virtual portal that contains the Script Application instance', config.virtualPortalContext)
290
+ .option('--projectContext <value>', 'Context of the portal project that manages the publication of changes to the Script Application content', config.projectContext)
289
291
  .option('-h, --help')
290
292
  .description('- creates or updates the content of a Script Application instance')
291
- .action((subCmd, cmd) => __awaiter(void 0, void 0, void 0, function* () {
292
- if ((subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL || subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PUSH) && (cmd.parent.args[2] === constants_1.COMMANDS.H || cmd.parent.args[2] === constants_1.COMMANDS.HELP)) {
293
+ .action(async (subCmd, cmd) => {
294
+ if ((subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL || subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PUSH) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
293
295
  logger_1.logger.help('\n This command allows user to create or update (push) or fetch (pull) the content in a Script Application in DX Core');
294
- logger_1.logger.help('\n Usage: dxclient deploy-scriptapplication [options] [subCmd]');
295
- logger_1.logger.help(` - Create or update the content of a Script Application instance for ${subCmd} \n`);
296
+ logger_1.logger.help('\n Usage: dxclient deploy-scriptapplication [options] [subCmd] \n');
297
+ logger_1.logger.help(`- Create or update the content of a Script Application instance for ${subCmd} \n`);
298
+ }
299
+ if (subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL) {
300
+ logger_1.logger.help(' \nExample : dxclient deploy-scriptapplication pull --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
301
+ + ' --contenthandlerPath /wps/mycontenthandler --wcmContentId 987654356789\n');
302
+ }
303
+ if (subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PUSH) {
304
+ logger_1.logger.help(' \nExample : dxclient deploy-scriptapplication push --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
305
+ + ' --contenthandlerPath /wps/mycontenthandler --prebuiltZip /temp/DemoScriptApplication.zip --wcmSiteArea "Script Application Library/Script Applications/" '
306
+ + ' --wcmContentName DemoScriptApplication --mainHtmlFile /temp/DemoScriptApplication/index.html \n');
307
+ }
308
+ if ((subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL || subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PUSH) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
309
+ logger_1.logger.help('Options:\n');
296
310
  logger_1.logger.help(` -dxProtocol, --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
297
311
  logger_1.logger.help(` -hostname, --hostname <value> Hostname of the DX Core server (default: "${config.hostname}")`);
298
312
  logger_1.logger.help(` -dxPort, --dxPort <value> Port number for DX Core server, for any Kubernetes Environment default port is 443 \
@@ -314,7 +328,7 @@ Script Application content (default: "${config.projectContext}")`);
314
328
  logger_1.logger.help(` -wcmSiteArea, --wcmSiteArea <value> Web Content Manager site area in which Script Application instances are created (default: "${config.wcmSiteArea}")`);
315
329
  logger_1.logger.help(` -contenthandlerPath, --contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet \
316
330
  (default: "${config.contenthandlerPath}")`);
317
- logger_1.logger.help(' -mainHtmlFile, --mainHtmlFile <value> Path to the main .html file of the Script Application (default: "")');
331
+ logger_1.logger.help(' -mainHtmlFile, --mainHtmlFile <value> Path or relative path to the main .html file within the Script Application.');
318
332
  logger_1.logger.help(` -wcmContentId, --wcmContentId <value> Web Content Manager content ID of an existing Script Application instance on a portal\
319
333
  page (default: "${config.wcmContentId}")`);
320
334
  logger_1.logger.help(' -wcmContentTitle, --wcmContentTitle <value> Sets or updates the title of the Script Application instance (default: "")');
@@ -336,565 +350,605 @@ Script Application content (default: "${config.projectContext}")`);
336
350
  }
337
351
  else {
338
352
  const command = subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL ? constants_1.COMMANDS.SCRIPT_APPLICATION_PULL : constants_1.COMMANDS.SCRIPT_APPLICATION_PUSH;
339
- commands_1.configureCommand(command);
340
- cmd = utils_1.unmaskPasswords(cmd);
341
- validateOptions_1.validateOptions(cmd);
353
+ (0, commands_1.configureCommand)(command);
354
+ cmd = (0, utils_1.unmaskPasswords)(cmd);
355
+ (0, validateOptions_1.validateOptions)(cmd);
342
356
  }
343
357
  }
344
358
  catch (error) {
345
359
  logger_1.logger.error(error.message);
346
- yield utils_1.flushLogAndExitProcess(false, true);
360
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
347
361
  }
348
362
  if (subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL) {
349
363
  logger_1.logger.debug('Deploy script application execution started');
350
364
  const pull = new pull_1.Pull();
351
365
  try {
352
- const responseCode = yield pull.pullScriptApplication(cmd);
366
+ const responseCode = await pull.pullScriptApplication(cmd);
353
367
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
354
368
  logger_1.logger.debug('Deploy script application execution completed');
355
- yield utils_1.flushLogAndExitProcess(responseCode);
369
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
356
370
  }
357
371
  catch (error) {
358
372
  logger_1.logger.debug('Exception in execution of script application : %o', error);
359
- yield utils_1.flushLogAndExitProcess(false);
373
+ await (0, utils_1.flushLogAndExitProcess)(false);
360
374
  }
361
375
  }
362
376
  else if (subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PUSH) {
363
377
  logger_1.logger.debug('Deploy script application execution started');
364
378
  try {
365
379
  const push = new push_1.PushSP();
366
- const responseCode = yield push.pushScriptApplication(cmd);
380
+ const responseCode = await push.pushScriptApplication(cmd);
367
381
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
368
382
  logger_1.logger.debug('Deploy script application execution completed');
369
383
  if (responseCode.results && responseCode.results.status === constants_1.ResponseStatus.SUCCESS) {
370
- yield utils_1.flushLogAndExitProcess(true);
384
+ await (0, utils_1.flushLogAndExitProcess)(true);
371
385
  }
372
386
  else {
373
- yield utils_1.flushLogAndExitProcess(false);
387
+ await (0, utils_1.flushLogAndExitProcess)(false);
374
388
  }
375
389
  }
376
390
  catch (error) {
377
391
  logger_1.logger.debug('Exception in execution of script application : %o', error);
378
- yield utils_1.flushLogAndExitProcess(false);
392
+ await (0, utils_1.flushLogAndExitProcess)(false);
379
393
  }
380
394
  }
381
- }))
395
+ })
382
396
  .helpOption(false);
383
397
  program
384
398
  .command(constants_1.COMMANDS.UNDEPLOY_SCRIPTAPPLICATION)
385
- .requiredOption('-dxProtocol,--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
386
- .requiredOption('-hostname,--hostname <value>', 'Hostname of the DX Core server', config.hostname)
387
- .requiredOption('-dxPort,--dxPort <value>', 'Port number for DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
388
- .requiredOption('-dxUsername,--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
389
- .requiredOption('-dxPassword,--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
390
- .requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
391
- .requiredOption('-wcmContentId,--wcmContentId <value>', 'Web Content Manager content ID of an existing Script Application instance on a portal page', config.wcmContentId)
392
- .option('-virtualPortalContext,--virtualPortalContext <value>', 'Context of the virtual portal that contains the Script Application instance', config.virtualPortalContext)
393
- .option('-projectContext,--projectContext <value>', 'Context of the portal project that manages the publication of changes to the Script Application content', config.projectContext)
399
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
400
+ .requiredOption('--hostname <value>', 'Hostname of the DX Core server', config.hostname)
401
+ .requiredOption('--dxPort <value>', 'Port number for DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
402
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
403
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
404
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
405
+ .requiredOption('--wcmContentId <value>', 'Web Content Manager content ID of an existing Script Application instance on a portal page', config.wcmContentId)
406
+ .option('--virtualPortalContext <value>', 'Context of the virtual portal that contains the Script Application instance', config.virtualPortalContext)
407
+ .option('--projectContext <value>', 'Context of the portal project that manages the publication of changes to the Script Application content', config.projectContext)
394
408
  .option('-f, --force', 'Delete the Script Application forcefully')
395
- .option('-enableBackup, --enableBackup <value>', 'Set the flag to true to take backup of the script application to be undeployed', config.enableBackup)
409
+ .option('--enableBackup <value>', 'Set the flag to true to take backup of the script application to be undeployed', config.enableBackup)
396
410
  .description('- Undeploys the script application from the DX Core server')
397
- .action((cmd) => __awaiter(void 0, void 0, void 0, function* () {
398
- commands_1.configureCommand(constants_1.COMMANDS.UNDEPLOY_SCRIPTAPPLICATION);
411
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient undeploy-scriptapplication --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
412
+ + ' --contenthandlerPath /wps/mycontenthandler --wcmContentId 89023456738239 --enableBackup false -f'))
413
+ .action(async (cmd) => {
414
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.UNDEPLOY_SCRIPTAPPLICATION);
399
415
  try {
400
- cmd = utils_1.unmaskPasswords(cmd);
401
- validateOptions_1.validateOptions(cmd);
416
+ cmd = (0, utils_1.unmaskPasswords)(cmd);
417
+ (0, validateOptions_1.validateOptions)(cmd);
402
418
  }
403
419
  catch (error) {
404
420
  logger_1.logger.error(error.message);
405
- yield utils_1.flushLogAndExitProcess(false, true);
421
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
406
422
  }
407
423
  try {
408
424
  const undeployScriptApplication = new undeployScriptApplication_1.UndeployScriptApplication();
409
425
  logger_1.logger.debug('Undeploy scriptapplication execution started');
410
- const responseCode = yield undeployScriptApplication.invoke(cmd);
426
+ const responseCode = await undeployScriptApplication.invoke(cmd);
411
427
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
412
428
  logger_1.logger.debug('Undeploy scriptapplication execution completed');
413
- yield utils_1.flushLogAndExitProcess(responseCode);
429
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
414
430
  }
415
431
  catch (error) {
416
432
  logger_1.logger.debug('Exception in execution of undeploy scriptapplication : %o', error);
417
- yield utils_1.flushLogAndExitProcess(false);
433
+ await (0, utils_1.flushLogAndExitProcess)(false);
418
434
  }
419
- }));
435
+ });
420
436
  program
421
437
  .command(constants_1.COMMANDS.RESTORE_SCRIPTAPPLICATION)
422
- .requiredOption('-dxProtocol,--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
423
- .requiredOption('-hostname,--hostname <value>', 'Hostname of the DX Core server', config.hostname)
424
- .requiredOption('-dxPort,--dxPort <value>', 'Port number for DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
425
- .requiredOption('-dxUsername,--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
426
- .requiredOption('-dxPassword,--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
427
- .requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
428
- .requiredOption('-wcmContentId,--wcmContentId <value>', 'Web Content Manager content ID of an existing Script Application instance on a portal page', '')
429
- .requiredOption('-versionName,--versionName <value>', 'Name of the version that should become the current version of Script Application', '')
430
- .requiredOption('-restoreAsPublished,--restoreAsPublished <value>', 'Restore as a draft or replace the published version of Script Application', config.restoreAsPublished)
431
- .option('-virtualPortalContext,--virtualPortalContext <value>', 'Context of the virtual portal that contains the Script Application instance', config.virtualPortalContext)
432
- .option('-projectContext,--projectContext <value>', 'Context of the portal project that manages the publication of changes to the Script Application content', config.projectContext)
438
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
439
+ .requiredOption('--hostname <value>', 'Hostname of the DX Core server', config.hostname)
440
+ .requiredOption('--dxPort <value>', 'Port number for DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
441
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
442
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
443
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
444
+ .requiredOption('--wcmContentId <value>', 'Web Content Manager content ID of an existing Script Application instance on a portal page', '')
445
+ .requiredOption('--versionName <value>', 'Name of the version that should become the current version of Script Application', '')
446
+ .requiredOption('--restoreAsPublished <value>', 'Restore as a draft or replace the published version of Script Application', config.restoreAsPublished)
447
+ .option('--virtualPortalContext <value>', 'Context of the virtual portal that contains the Script Application instance', config.virtualPortalContext)
448
+ .option('--projectContext <value>', 'Context of the portal project that manages the publication of changes to the Script Application content', config.projectContext)
433
449
  .description('- Restores script application to version specified or if not, its previous by default')
434
- .action((cmd) => __awaiter(void 0, void 0, void 0, function* () {
435
- commands_1.configureCommand(constants_1.COMMANDS.RESTORE_SCRIPTAPPLICATION);
450
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient restore-scriptapplication --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
451
+ + ' --contenthandlerPath /wps/mycontenthandler --wcmContentID 89023456738239 --versionName 3 --restoreAsPublished false'))
452
+ .action(async (cmd) => {
453
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.RESTORE_SCRIPTAPPLICATION);
436
454
  try {
437
- cmd = utils_1.unmaskPasswords(cmd);
438
- validateOptions_1.validateOptions(cmd);
455
+ cmd = (0, utils_1.unmaskPasswords)(cmd);
456
+ (0, validateOptions_1.validateOptions)(cmd);
439
457
  }
440
458
  catch (error) {
441
459
  logger_1.logger.error(error.message);
442
- yield utils_1.flushLogAndExitProcess(false, true);
460
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
443
461
  }
444
462
  const restoreScriptApplication = new restoreScriptApplication_1.RestoreScriptApplication();
445
463
  logger_1.logger.debug('Restore scriptapplication execution started');
446
464
  try {
447
- const responseCode = yield restoreScriptApplication.invoke(cmd);
465
+ const responseCode = await restoreScriptApplication.invoke(cmd);
448
466
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
449
467
  logger_1.logger.debug('Restore scriptapplication execution completed');
450
- yield utils_1.flushLogAndExitProcess(responseCode);
468
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
451
469
  }
452
470
  catch (error) {
453
471
  logger_1.logger.debug('Exception in execution of Restore scriptapplication : %o', error);
454
- yield utils_1.flushLogAndExitProcess(false);
472
+ await (0, utils_1.flushLogAndExitProcess)(false);
455
473
  }
456
- }));
474
+ });
457
475
  program
458
476
  .command(constants_1.COMMANDS.DEPLOY_THEME)
459
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
460
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
461
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
462
- .requiredOption('-xmlConfigPath, --xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
463
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
464
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
465
- .requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
466
- .requiredOption('-dxSoapPort, --dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
467
- .requiredOption('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
468
- .option('-dxProfilePath, --dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
469
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
470
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
471
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
472
- .option('-xmlFile, --xmlFile <value>', 'Input xml file name with full path')
473
- .option('-applicationFile, --applicationFile <value>', 'Application file name with full path')
474
- .option('-applicationName, --applicationName <value>', 'Application name')
475
- .option('-themeName, --themeName <value>', 'Theme Collection name')
476
- .option('-themePath, --themePath <value>', 'Theme Path with zip or folder name')
477
- .option('-requestId, --requestId <value>', 'Unique Id of a previously triggered deploy theme request.')
477
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
478
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
479
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
480
+ .requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
481
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
482
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
483
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
484
+ .requiredOption('--dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
485
+ .requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
486
+ .option('--dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
487
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
488
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
489
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
490
+ .option('--xmlFile <value>', 'Input xml file name with full path')
491
+ .option('--applicationFile <value>', 'Application file name with full path')
492
+ .option('--applicationName <value>', 'Application name')
493
+ .option('--themeName <value>', 'Theme Collection name')
494
+ .option('--themePath <value>', 'Theme Path with zip or folder name')
495
+ .option('--requestId <value>', 'Unique Id of a previously triggered deploy theme request.')
478
496
  .description('- Deploys the theme(EAR or WebDav packages) to the DX Core server')
479
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
480
- commands_1.configureCommand(constants_1.COMMANDS.DEPLOY_THEME);
497
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient deploy-theme --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsername wpsadmin --dxPassword wpsadmin'
498
+ + ' --contenthandlerPath /wps/mycontenthandler --dxSoapPort 10033 --dxProfileName wp_profile --dxProfilePath /opt/HCL/wp_profile --dxConnectUsername wpsadmin'
499
+ + ' --dxConnectPassword wpsadmin --dxConnectPort 10202 --xmlFile /user/deploy-theme/test.xml --applicationFile /user/deploy-theme/application.xml'
500
+ + ' --applicationName testApplication --themeName testTheme --themePath /user/deploy-theme/test.xml'))
501
+ .action(async (cmdOptions) => {
502
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.DEPLOY_THEME);
481
503
  logger_1.logger.debug('Deploy theme execution started');
482
504
  try {
483
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
484
- validateOptions_1.validateOptions(cmdOptions);
505
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
506
+ (0, validateOptions_1.validateOptions)(cmdOptions);
485
507
  }
486
508
  catch (error) {
487
509
  logger_1.logger.error(error.message);
488
- yield utils_1.flushLogAndExitProcess(false, true);
510
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
489
511
  }
490
512
  try {
491
513
  const deployThemeObj = new deployTheme_1.DeployTheme();
492
- const responseCode = yield deployThemeObj.invoke(cmdOptions);
514
+ const responseCode = await deployThemeObj.invoke(cmdOptions);
493
515
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
494
516
  logger_1.logger.debug('Deploy theme execution completed');
495
- yield utils_1.flushLogAndExitProcess(responseCode);
517
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
496
518
  }
497
519
  catch (error) {
498
520
  logger_1.logger.debug('Exception in execution : %o', error);
499
- yield utils_1.flushLogAndExitProcess(false);
521
+ await (0, utils_1.flushLogAndExitProcess)(false);
500
522
  }
501
- }));
523
+ });
502
524
  program
503
525
  .command(constants_1.COMMANDS.UNDEPLOY_THEME)
504
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
505
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
506
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
507
- .requiredOption('-xmlConfigPath, --xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
508
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
509
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
510
- .requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
511
- .requiredOption('-dxSoapPort, --dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
512
- .requiredOption('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
513
- .option('-dxProfilePath, --dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
514
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
515
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
516
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
517
- .option('-xmlFile, --xmlFile <value>', 'Input xml file name with full path to unregister the theme')
518
- .option('-applicationName, --applicationName <value>', 'Application name')
519
- .option('-themeName, --themeName <value>', 'Theme Collection name')
520
- .option('-enableBackup, --enableBackup <value>', 'Set the flag to true to take backup of the theme to be undeployed', config.enableBackup)
526
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
527
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
528
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
529
+ .requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
530
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
531
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
532
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
533
+ .requiredOption('--dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
534
+ .requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
535
+ .option('--dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
536
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
537
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
538
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
539
+ .option('--xmlFile <value>', 'Input xml file name with full path to unregister the theme')
540
+ .option('--applicationName <value>', 'Application name')
541
+ .option('--themeName <value>', 'Theme Collection name')
542
+ .option('--enableBackup <value>', 'Set the flag to true to take backup of the theme to be undeployed', config.enableBackup)
521
543
  .description('- Undeploys the theme(EAR or WebDav packages) from the DX Core server')
522
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
523
- commands_1.configureCommand(constants_1.COMMANDS.UNDEPLOY_THEME);
544
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient undeploy-theme --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsername wpsadmin'
545
+ + ' --dxPassword wpsadmin --contenthandlerPath /wps/mycontenthandler --dxSoapPort 10033 --dxProfileName wp_profile --dxProfilePath /opt/HCL/wp_profile --dxConnectUsername wpsadmin'
546
+ + ' --dxConnectPassword wpsadmin --dxConnectPort 10202 --xmlFile /user/undeploy-theme/test.xml --applicationName test --themeName testTheme --enableBackup true'))
547
+ .action(async (cmdOptions) => {
548
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.UNDEPLOY_THEME);
524
549
  logger_1.logger.debug('Undeploy theme execution started');
525
550
  try {
526
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
527
- validateOptions_1.validateOptions(cmdOptions);
551
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
552
+ (0, validateOptions_1.validateOptions)(cmdOptions);
528
553
  }
529
554
  catch (error) {
530
555
  logger_1.logger.error(error.message);
531
- yield utils_1.flushLogAndExitProcess(false, true);
556
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
532
557
  }
533
558
  try {
534
559
  const undeployThemeObj = new undeployTheme_1.UndeployTheme();
535
- const responseCode = yield undeployThemeObj.invoke(cmdOptions);
560
+ const responseCode = await undeployThemeObj.invoke(cmdOptions);
536
561
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
537
562
  logger_1.logger.debug('Undeploy theme execution completed');
538
- yield utils_1.flushLogAndExitProcess(responseCode);
563
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
539
564
  }
540
565
  catch (error) {
541
566
  logger_1.logger.debug('Exception in execution : %o', error);
542
- yield utils_1.flushLogAndExitProcess(false);
567
+ await (0, utils_1.flushLogAndExitProcess)(false);
543
568
  }
544
- }));
569
+ });
545
570
  program
546
571
  .command(constants_1.COMMANDS.DEPLOY_APPLICATION)
547
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
548
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
549
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
550
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
551
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
552
- .requiredOption('-dxSoapPort, --dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
553
- .requiredOption('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
554
- .option('-dxProfilePath, --dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
555
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
556
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
557
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
558
- .requiredOption('-dxConnectProtocol, --dxConnectProtocol <value>', 'Protocol of the cw_profile', config.dxConnectProtocol.toString())
559
- .requiredOption('-applicationFile, --applicationFile <value>', 'Application file name with full path')
560
- .requiredOption('-applicationName, --applicationName <value>', 'Application name')
561
- .option('-requestId, --requestId <value>', 'Unique Id of a previously triggered deploy application request.')
572
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
573
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
574
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
575
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
576
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
577
+ .requiredOption('--dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
578
+ .requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
579
+ .option('--dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
580
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
581
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
582
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
583
+ .requiredOption('--dxConnectProtocol <value>', 'Protocol of the cw_profile', config.dxConnectProtocol.toString())
584
+ .requiredOption('--applicationFile <value>', 'Application file name with full path')
585
+ .requiredOption('--applicationName <value>', 'Application name')
586
+ .option('--requestId <value>', 'Unique Id of a previously triggered deploy application request.')
562
587
  .description('- Deploys the application to the DX Core server')
563
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
564
- commands_1.configureCommand(constants_1.COMMANDS.DEPLOY_APPLICATION);
588
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient deploy-application --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin --dxSoapPort 10033 --dxProfileName wp_profile'
589
+ + ' --dxProfilePath /opt/HCL/wp_profile --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202 --dxConnectProtocol https'
590
+ + ' --applicationFile /user/deploy-application/test.xml --applicationName test'))
591
+ .action(async (cmdOptions) => {
592
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.DEPLOY_APPLICATION);
565
593
  logger_1.logger.debug('Deploy Application execution started');
566
594
  try {
567
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
568
- validateOptions_1.validateOptions(cmdOptions);
595
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
596
+ (0, validateOptions_1.validateOptions)(cmdOptions);
569
597
  }
570
598
  catch (error) {
571
599
  logger_1.logger.error(error.message);
572
- yield utils_1.flushLogAndExitProcess(false, true);
600
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
573
601
  }
574
602
  try {
575
603
  const deployApplicationObj = new deployApplication_1.DeployApplication();
576
- const responseCode = yield deployApplicationObj.invoke(cmdOptions);
604
+ const responseCode = await deployApplicationObj.invoke(cmdOptions);
577
605
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
578
606
  logger_1.logger.debug('Deploy Application execution completed');
579
- yield utils_1.flushLogAndExitProcess(responseCode);
607
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
580
608
  }
581
609
  catch (error) {
582
610
  logger_1.logger.debug('Exception in execution : %o', error);
583
- yield utils_1.flushLogAndExitProcess(false);
611
+ await (0, utils_1.flushLogAndExitProcess)(false);
584
612
  }
585
- }));
613
+ });
586
614
  program
587
615
  .command(constants_1.COMMANDS.UNDEPLOY_APPLICATION)
588
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
589
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
590
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
591
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
592
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
593
- .requiredOption('-dxSoapPort, --dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
594
- .requiredOption('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
595
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
596
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
597
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
598
- .requiredOption('-dxConnectProtocol, --dxConnectProtocol <value>', 'Protocol of the cw_profile', config.dxConnectProtocol.toString())
599
- .requiredOption('-applicationName, --applicationName <value>', 'Application name')
600
- .option('-enableBackup, --enableBackup <value>', 'Set the flag to true to take backup of the application to be undeployed', config.enableBackup)
616
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
617
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
618
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
619
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
620
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
621
+ .requiredOption('--dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
622
+ .requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
623
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
624
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
625
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
626
+ .requiredOption('--dxConnectProtocol <value>', 'Protocol of the cw_profile', config.dxConnectProtocol.toString())
627
+ .requiredOption('--applicationName <value>', 'Application name')
628
+ .option('--enableBackup <value>', 'Set the flag to true to take backup of the application to be undeployed', config.enableBackup)
601
629
  .description('- Undeploys the application from the DX Core server')
602
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
603
- commands_1.configureCommand(constants_1.COMMANDS.UNDEPLOY_APPLICATION);
630
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient undeploy-application --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
631
+ + ' --dxSoapPort 10033 --dxProfileName wp_profile --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202 --dxConnectProtocol https'
632
+ + ' --applicationName /user/undeploy-application/test.xml --enableBackup false'))
633
+ .action(async (cmdOptions) => {
634
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.UNDEPLOY_APPLICATION);
604
635
  logger_1.logger.debug('Undeploy Application execution started');
605
636
  try {
606
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
607
- validateOptions_1.validateOptions(cmdOptions);
637
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
638
+ (0, validateOptions_1.validateOptions)(cmdOptions);
608
639
  }
609
640
  catch (error) {
610
641
  logger_1.logger.error(error.message);
611
- yield utils_1.flushLogAndExitProcess(false, true);
642
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
612
643
  }
613
644
  try {
614
645
  const undeployApplicationObj = new undeployApplication_1.UndeployApplication();
615
- const responseCode = yield undeployApplicationObj.invoke(cmdOptions);
646
+ const responseCode = await undeployApplicationObj.invoke(cmdOptions);
616
647
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
617
648
  logger_1.logger.debug('Undeploy Application execution completed');
618
- yield utils_1.flushLogAndExitProcess(responseCode);
649
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
619
650
  }
620
651
  catch (error) {
621
652
  logger_1.logger.debug('Exception in execution : %o', error);
622
- yield utils_1.flushLogAndExitProcess(false);
653
+ await (0, utils_1.flushLogAndExitProcess)(false);
623
654
  }
624
- }));
655
+ });
625
656
  program
626
657
  .command(constants_1.COMMANDS.MLS_EXPORT)
627
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
628
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
629
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
630
- .requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path to the contenthandler servlet on the DX Core server', config.contenthandlerPath)
631
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
632
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
633
- .option('-wcmLibraryId, --wcmLibraryId <value>', 'WCM Library ID', config.wcmLibraryId)
634
- .option('-wcmLibraryName, --wcmLibraryName <value>', 'WCM Library Name', config.wcmLibraryName)
635
- .option('-lastModifiedAfter, --lastModifiedAfter <value>', 'Last Modified After is in GMT Format', config.lastModifiedAfter)
636
- .option('-wcmProjectName, --wcmProjectName <value>', 'WCM project name to export the contents of the specified project', config.wcmProjectName)
637
- .option('-exportPath, --exportPath <value>', 'Location of the file path to export')
638
- .option('-virtualPortalContext,--virtualPortalContext <value>', 'Context of the virtual portal of the DX Core server', config.virtualPortalContext)
658
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
659
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
660
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
661
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path to the contenthandler servlet on the DX Core server', config.contenthandlerPath)
662
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
663
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
664
+ .option('--wcmLibraryId <value>', 'WCM Library ID', config.wcmLibraryId)
665
+ .option('--wcmLibraryName <value>', 'WCM Library Name', config.wcmLibraryName)
666
+ .option('--lastModifiedAfter <value>', 'Last Modified After is in GMT Format', config.lastModifiedAfter)
667
+ .option('--wcmProjectName <value>', 'WCM project name to export the contents of the specified project', config.wcmProjectName)
668
+ .option('--exportPath <value>', 'Location of the file path to export')
669
+ .option('--virtualPortalContext <value>', 'Context of the virtual portal of the DX Core server', config.virtualPortalContext)
639
670
  .description('- Exports the source contents from a library into a .csv file at the location specified')
640
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
641
- commands_1.configureCommand(constants_1.COMMANDS.MLS_EXPORT);
671
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient mls-export --dxProtocol https --hostname localhost --dxPort 10041 --contenthandlerPath /wps/mycontenthandler --dxUsername wpsadmin'
672
+ + ' --dxPassword wpsadmin --wcmLibraryId 97765345736538 --wcmLibraryName tetslib --exportPath /user/store/mls-export/'))
673
+ .action(async (cmdOptions) => {
674
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.MLS_EXPORT);
642
675
  logger_1.logger.debug('Exports the source contents execution started');
643
676
  try {
644
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
645
- validateOptions_1.validateOptions(cmdOptions);
677
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
678
+ (0, validateOptions_1.validateOptions)(cmdOptions);
646
679
  }
647
680
  catch (error) {
648
681
  logger_1.logger.error(error.message);
649
- yield utils_1.flushLogAndExitProcess(false, true);
682
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
650
683
  }
651
684
  const mlsExportObj = new mlsExport_1.MLSExport();
652
685
  try {
653
- const responseCode = yield mlsExportObj.invoke(cmdOptions);
686
+ const responseCode = await mlsExportObj.invoke(cmdOptions);
654
687
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
655
688
  logger_1.logger.debug('Exporting the source contents execution completed');
656
- yield utils_1.flushLogAndExitProcess(responseCode);
689
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
657
690
  }
658
691
  catch (error) {
659
692
  logger_1.logger.debug('Exception in execution of exporting the source contents : %o', error);
660
- yield utils_1.flushLogAndExitProcess(false);
693
+ await (0, utils_1.flushLogAndExitProcess)(false);
661
694
  }
662
- }));
695
+ });
663
696
  program
664
697
  .command(constants_1.COMMANDS.MLS_IMPORT)
665
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
666
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
667
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
668
- .requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
669
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
670
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
671
- .requiredOption('-importPath, --importPath <value>', 'Location of the file path(s) (separated by comma) to import')
672
- .option('-wcmProjectName, --wcmProjectName <value>', 'Project for which the contents to be imported', config.wcmProjectName)
673
- .option('-forceImport, --forceImport <value>', 'Flag to forcefully import the content')
674
- .option('-virtualPortalContext,--virtualPortalContext <value>', 'Context of the virtual portal of the DX Core server', config.virtualPortalContext)
698
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
699
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
700
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
701
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
702
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
703
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
704
+ .requiredOption('--importPath <value>', 'Location of the file path(s) (separated by comma) to import')
705
+ .option('--wcmProjectName <value>', 'Project for which the contents to be imported', config.wcmProjectName)
706
+ .option('--forceImport <value>', 'Flag to forcefully import the content')
707
+ .option('--virtualPortalContext <value>', 'Context of the virtual portal of the DX Core server', config.virtualPortalContext)
675
708
  .description('- Imports the source contents from a CSV file into DX at the location specified')
676
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
677
- commands_1.configureCommand(constants_1.COMMANDS.MLS_IMPORT);
709
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient mls-import --dxProtocol https --hostname localhost --dxPort 443 --contenthandlerPath /wps/mycontenthandler --dxUsername wpsadmin'
710
+ + ' --dxPassword wpsadmin --importPath /user/store/mls-export/test.xml'))
711
+ .action(async (cmdOptions) => {
712
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.MLS_IMPORT);
678
713
  logger_1.logger.debug('Imports the source contents execution started');
679
714
  try {
680
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
681
- validateOptions_1.validateOptions(cmdOptions);
715
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
716
+ (0, validateOptions_1.validateOptions)(cmdOptions);
682
717
  }
683
718
  catch (error) {
684
719
  logger_1.logger.error(error.message);
685
- yield utils_1.flushLogAndExitProcess(false, true);
720
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
686
721
  }
687
722
  const mlsImportObj = new mlsImport_1.MLSImport();
688
723
  try {
689
- const responseCode = yield mlsImportObj.invoke(cmdOptions);
724
+ const responseCode = await mlsImportObj.invoke(cmdOptions);
690
725
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
691
726
  logger_1.logger.debug('Importing the source contents into DX execution completed');
692
- yield utils_1.flushLogAndExitProcess(responseCode);
727
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
693
728
  }
694
729
  catch (error) {
695
730
  logger_1.logger.debug('Exception in execution of importation the source contents : %o', error);
696
- yield utils_1.flushLogAndExitProcess(false);
731
+ await (0, utils_1.flushLogAndExitProcess)(false);
697
732
  }
698
- }));
733
+ });
699
734
  program
700
735
  .command(`${constants_1.COMMANDS.MANAGE_SYNDICATOR} [subCmd]`)
701
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
702
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
703
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
704
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
705
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
706
- .requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
707
- .requiredOption('-UUID,--UUID <value>', 'UUID of the syndicator instance', '')
708
- .option('-enable,--enable <value>', 'Use true or false to enable or disable the syndicator')
736
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
737
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
738
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
739
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
740
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
741
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
742
+ .requiredOption('--UUID <value>', 'UUID of the syndicator instance', '')
743
+ .option('--enable <value>', 'Use true or false to enable or disable the syndicator')
709
744
  .option('-h, --help')
710
745
  .description('- Manages the syndicator in DX Server (Enable/Disable or helps to get syndicator report)')
711
- .action((subCmd, cmd) => __awaiter(void 0, void 0, void 0, function* () {
712
- if (cmd.parent.args[1] === constants_1.COMMANDS.H || cmd.parent.args[1] === constants_1.COMMANDS.HELP || cmd.parent.args[2] === constants_1.COMMANDS.H || cmd.parent.args[2] === constants_1.COMMANDS.HELP) {
746
+ .action(async (subCmd, cmd, options) => {
747
+ if (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP)) {
713
748
  logger_1.logger.help('Usage: dxclient manage-syndicator [options] [subCmd](get-syndication-report)\n');
714
749
  logger_1.logger.help(' - Manages the syndicator in DX Server (Enable/Disable or helps to get syndicator report)\n');
715
- logger_1.logger.help(` -dxProtocol, --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
716
- logger_1.logger.help(` -hostname, --hostname <value> Hostname of the DX Core server (default: "${config.hostname}")`);
717
- logger_1.logger.help(` -dxPort, --dxPort <value> Port number for DX Core server, for any Kubernetes Environment default port is 443 \
750
+ logger_1.logger.help(' \nExample : dxclient manage-syndicator get-syndication-report --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
751
+ + ' --dxPassword wpsadmin --contenthandlerPath /wps/mycontenthandler --UUID 958476536576 \n');
752
+ logger_1.logger.help(` --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
753
+ logger_1.logger.help(` --hostname <value> Hostname of the DX Core server (default: "${config.hostname}")`);
754
+ logger_1.logger.help(` --dxPort <value> Port number for DX Core server, for any Kubernetes Environment default port is 443 \
718
755
  (default: "${config.dxPort.toString()}")`);
719
- logger_1.logger.help(` -dxUsername, --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}")`);
720
- logger_1.logger.help(` -dxPassword, --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
721
- logger_1.logger.help(` -contenthandlerPath,--contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet (default: "${config.contenthandlerPath}")`);
722
- logger_1.logger.help(' -UUID,--UUID <value> UUID of the syndicator instance');
723
- if (cmd._name === constants_1.COMMANDS.MANAGE_SYNDICATOR && !subCmd) {
724
- logger_1.logger.help(' -enable,--enable <value> Use true or false to enable or disable the syndicator');
725
- }
726
- logger_1.logger.help(' -h, --help display help for command');
756
+ logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}")`);
757
+ logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
758
+ logger_1.logger.help(` --contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet (default: "${config.contenthandlerPath}")`);
759
+ logger_1.logger.help(' --UUID <value> UUID of the syndicator instance');
760
+ if (options.parent.args[0] === constants_1.COMMANDS.MANAGE_SYNDICATOR && !subCmd) {
761
+ logger_1.logger.help(' --enable <value> Use true or false to enable or disable the syndicator');
762
+ }
763
+ logger_1.logger.help(' -h, --help Display help for command');
727
764
  process.exit(1);
728
765
  }
729
766
  try {
730
767
  const command = subCmd ? constants_1.COMMANDS.GET_SYNDICATION_REPORT : constants_1.COMMANDS.MANAGE_SYNDICATOR;
731
- commands_1.configureCommand(command);
768
+ (0, commands_1.configureCommand)(command);
732
769
  logger_1.logger.debug('Manage syndicator execution started');
733
- cmd = utils_1.unmaskPasswords(cmd);
734
- validateOptions_1.validateOptions(cmd);
770
+ cmd = (0, utils_1.unmaskPasswords)(cmd);
771
+ (0, validateOptions_1.validateOptions)(cmd);
735
772
  }
736
773
  catch (error) {
737
774
  logger_1.logger.error(error.message);
738
- yield utils_1.flushLogAndExitProcess(false, true);
775
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
739
776
  }
740
777
  if (subCmd === constants_1.COMMANDS.GET_SYNDICATION_REPORT) {
741
778
  const syndicatorFailedItems = new syndicatorFailedItem_1.SyndicatorFailedItem();
742
779
  try {
743
- const responseCode = yield syndicatorFailedItems.invoke(cmd);
780
+ const responseCode = await syndicatorFailedItems.invoke(cmd);
744
781
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
745
782
  logger_1.logger.debug('Syndication failed item execution completed');
746
- yield utils_1.flushLogAndExitProcess(responseCode);
783
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
747
784
  }
748
785
  catch (error) {
749
786
  logger_1.logger.debug('Exception in Syndication failed item: %o', error);
750
- yield utils_1.flushLogAndExitProcess(false);
787
+ await (0, utils_1.flushLogAndExitProcess)(false);
751
788
  }
752
789
  }
753
790
  else if (!subCmd && cmd._name === constants_1.COMMANDS.MANAGE_SYNDICATOR) {
754
791
  const syndicator = new syndicator_1.Syndicator();
755
792
  try {
756
- const responseCode = yield syndicator.invoke(cmd);
793
+ const responseCode = await syndicator.invoke(cmd);
757
794
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
758
795
  logger_1.logger.debug('Manage syndicator execution completed');
759
- yield utils_1.flushLogAndExitProcess(responseCode);
796
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
760
797
  }
761
798
  catch (error) {
762
799
  logger_1.logger.debug('Exception in manage syndicator: %o', error);
763
- yield utils_1.flushLogAndExitProcess(false);
800
+ await (0, utils_1.flushLogAndExitProcess)(false);
764
801
  }
765
802
  }
766
- }))
803
+ })
767
804
  .helpOption(false);
768
805
  program
769
806
  .command(constants_1.COMMANDS.MANAGE_SUBSCRIBER)
770
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
771
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
772
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
773
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
774
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
775
- .requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
776
- .requiredOption('-UUID,--UUID <value>', 'UUID of the subscriber instance', '')
777
- .option('-enable,--enable <value>', 'Use true or false to enable or disable the subscriber')
807
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
808
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
809
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
810
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
811
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
812
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
813
+ .requiredOption('--UUID <value>', 'UUID of the subscriber instance', '')
814
+ .option('--enable <value>', 'Use true or false to enable or disable the subscriber')
778
815
  .description('- Manages the subscriber in DX Server(Enable/Disable)')
779
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
780
- commands_1.configureCommand(constants_1.COMMANDS.MANAGE_SUBSCRIBER);
816
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient manage-subscriber --dxProtocol https --hostname localhost --dxPort 443 --dxUsername wpsadmin'
817
+ + ' --dxPassword wpsadmin --contenthandlerPath /wps/mycontenthandler --UUID 958476536576 -enable true '))
818
+ .action(async (cmdOptions) => {
819
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.MANAGE_SUBSCRIBER);
781
820
  logger_1.logger.debug('Manage subscriber execution started');
782
821
  try {
783
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
784
- validateOptions_1.validateOptions(cmdOptions);
822
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
823
+ (0, validateOptions_1.validateOptions)(cmdOptions);
785
824
  }
786
825
  catch (error) {
787
826
  logger_1.logger.error(error.message);
788
- yield utils_1.flushLogAndExitProcess(false, true);
827
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
789
828
  }
790
829
  const subscriber = new subscriber_1.Subscriber();
791
830
  try {
792
- const responseCode = yield subscriber.invoke(cmdOptions);
831
+ const responseCode = await subscriber.invoke(cmdOptions);
793
832
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
794
833
  logger_1.logger.debug('Manage subscriber execution completed');
795
- yield utils_1.flushLogAndExitProcess(responseCode);
834
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
796
835
  }
797
836
  catch (error) {
798
837
  logger_1.logger.debug('Exception in manage subscriber: %o', error);
799
- yield utils_1.flushLogAndExitProcess(false);
838
+ await (0, utils_1.flushLogAndExitProcess)(false);
800
839
  }
801
- }));
840
+ });
802
841
  program
803
842
  .command(constants_1.COMMANDS.RESTART_CORE_PODS)
804
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
805
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX server', config.hostname)
806
- .requiredOption('-dxWASUsername, --dxWASUsername <value>', 'Username of the DX WAS server', '')
807
- .requiredOption('-dxWASPassword, --dxWASPassword <value>', 'Password of the DX WAS server', '')
843
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
844
+ .requiredOption('--hostname <value>', 'Host name of the DX server', config.hostname)
845
+ .requiredOption('--dxWASUsername <value>', 'Username of the DX WAS server', '')
846
+ .requiredOption('--dxWASPassword <value>', 'Password of the DX WAS server', '')
808
847
  .description(`- Restarts the DX Core Pods in Kubernetes Deployment.
809
848
  Note: Only the user set as wasAdmin in the Helm values is authorised to trigger this command.`)
810
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
811
- commands_1.configureCommand(constants_1.COMMANDS.RESTART_CORE_PODS);
849
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient restart-core-pods --dxProtocol https --hostname localhost --dxWASUsername wpsadmin --dxWASPassword wpsadmin'))
850
+ .action(async (cmdOptions) => {
851
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.RESTART_CORE_PODS);
812
852
  logger_1.logger.debug('Sending DX Core Pods restart request.');
813
853
  try {
814
- validateOptions_1.validateOptions(cmdOptions);
854
+ (0, validateOptions_1.validateOptions)(cmdOptions);
815
855
  }
816
856
  catch (error) {
817
857
  logger_1.logger.error(error.message);
818
- yield utils_1.flushLogAndExitProcess(false, true);
858
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
819
859
  }
820
860
  try {
821
861
  const restartDXCoreObject = new restartCorePods_1.RestartCorePods();
822
- const responseCode = yield restartDXCoreObject.invoke(cmdOptions);
862
+ const responseCode = await restartDXCoreObject.invoke(cmdOptions);
823
863
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
824
864
  logger_1.logger.debug('Restart DX Core pods execution completed');
825
- yield utils_1.flushLogAndExitProcess(responseCode);
865
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
826
866
  }
827
867
  catch (error) {
828
868
  logger_1.logger.debug('Exception in execution : %o', error);
829
- yield utils_1.flushLogAndExitProcess(false);
869
+ await (0, utils_1.flushLogAndExitProcess)(false);
830
870
  }
831
- }));
871
+ });
832
872
  program
833
873
  .command(constants_1.COMMANDS.RESTART_DXCORE)
834
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
835
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
836
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
837
- .requiredOption('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
838
- .option('-dxProfilePath, --dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
839
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
840
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
841
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
842
- .option('-requestId, --requestId <value>', 'Unique Id of a previously triggered restart request.')
874
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
875
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
876
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
877
+ .requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
878
+ .option('--dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
879
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
880
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
881
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
882
+ .option('--requestId <value>', 'Unique Id of a previously triggered restart request.')
843
883
  .description('- Restarts the DX Core server. This command works for single DX Server instances.')
844
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
845
- commands_1.configureCommand(constants_1.COMMANDS.RESTART_DXCORE);
884
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient restart-dx-core --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin'
885
+ + ' --dxProfileName wp_profile --dxProfilePath /opt/HCL/wp_profile --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202'))
886
+ .action(async (cmdOptions) => {
887
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.RESTART_DXCORE);
846
888
  logger_1.logger.debug('Restart DX Core execution started');
847
889
  try {
848
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
849
- validateOptions_1.validateOptions(cmdOptions);
890
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
891
+ (0, validateOptions_1.validateOptions)(cmdOptions);
850
892
  }
851
893
  catch (error) {
852
894
  logger_1.logger.error(error.message);
853
- yield utils_1.flushLogAndExitProcess(false, true);
895
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
854
896
  }
855
897
  try {
856
898
  const restartDXCoreObject = new restartDXCore_1.RestartDXCore();
857
- const responseCode = yield restartDXCoreObject.invoke(cmdOptions);
899
+ const responseCode = await restartDXCoreObject.invoke(cmdOptions);
858
900
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
859
901
  logger_1.logger.debug('Restart DX Core execution completed');
860
- yield utils_1.flushLogAndExitProcess(responseCode);
902
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
861
903
  }
862
904
  catch (error) {
863
905
  logger_1.logger.debug('Exception in execution : %o', error);
864
- yield utils_1.flushLogAndExitProcess(false);
906
+ await (0, utils_1.flushLogAndExitProcess)(false);
865
907
  }
866
- }));
908
+ });
867
909
  program
868
910
  .command(`${constants_1.COMMANDS.SHARED_LIBRARY} [subCmd]`)
869
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
870
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
871
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
872
- .requiredOption('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
873
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
874
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
875
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
876
- .option('-libFilePath, --libFilePath <value>', 'File/Folder path of the shared library jar files')
877
- .option('-libFileNames, --libFileNames <value>', 'File names of the shared library jar files')
911
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
912
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
913
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
914
+ .requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
915
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
916
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
917
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
918
+ .option('--libFilePath <value>', 'File/Folder path of the shared library jar files')
919
+ .option('--libFileNames <value>', 'File names of the shared library jar files')
878
920
  .option('-h, --help')
879
921
  .description('- manages the shared library files in the remote server')
880
- .action((subCmd, cmd) => __awaiter(void 0, void 0, void 0, function* () {
881
- if ((subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD || subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE) && (cmd.parent.args[2] === constants_1.COMMANDS.H || cmd.parent.args[2] === constants_1.COMMANDS.HELP)) {
922
+ .action(async (subCmd, cmd) => {
923
+ if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD) {
882
924
  logger_1.logger.help(' Usage: dxclient shared-library [options] [subCmd](upload/delete)\n');
883
925
  logger_1.logger.help(' - Uploads/Deletes files in default Shared Library location in DX Core (<dx-profile>/PortalServer/sharedLibrary/DXCLib)\n');
884
- logger_1.logger.help(` -hostname,--hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
885
- logger_1.logger.help(` -dxUsername, --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}")`);
886
- logger_1.logger.help(` -dxPassword, --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
926
+ logger_1.logger.help(' \nExample : dxclient shared-library upload --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxProfileName wp_profile'
927
+ + ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202 --libFilePath /user/store/output/test.jar \n');
928
+ }
929
+ if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE) {
930
+ logger_1.logger.help(' Usage: dxclient shared-library [options] [subCmd](upload/delete)\n');
931
+ logger_1.logger.help(' - Uploads/Deletes files in default Shared Library location in DX Core (<dx-profile>/PortalServer/sharedLibrary/DXCLib)\n');
932
+ logger_1.logger.help(' \nExample : dxclient shared-library delete --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxProfileName wp_profile'
933
+ + ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202 --libFileNames test.jar \n');
934
+ }
935
+ if ((subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD || subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
936
+ logger_1.logger.help('Options:\n');
937
+ logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
938
+ logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}")`);
939
+ logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
887
940
  logger_1.logger.help(` -dxProfileName, --dxProfileName <value> Profile name in the DX core server (default: "${config.dxProfileName}")`);
888
- logger_1.logger.help(` -dxConnectUsername, --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
889
- logger_1.logger.help(` -dxConnectPassword, --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
890
- logger_1.logger.help(` -dxConnectPort, --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
941
+ logger_1.logger.help(` --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
942
+ logger_1.logger.help(` --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
943
+ logger_1.logger.help(` --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
891
944
  if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD) {
892
- logger_1.logger.help(' -libFilePath, --libFilePath <value> File/Folder path of the shared library files to be uploaded');
945
+ logger_1.logger.help(' --libFilePath <value> File/Folder path of the shared library files to be uploaded');
946
+ logger_1.logger.help(' -h, --help display help for command');
893
947
  }
894
948
  if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE) {
895
- logger_1.logger.help(' -libFileNames, --libFileNames <value> File names of shared library files to be deleted');
949
+ logger_1.logger.help(' --libFileNames <value> File names of shared library files to be deleted');
950
+ logger_1.logger.help(' -h, --help display help for command');
896
951
  }
897
- logger_1.logger.help(' -h, --help display help for command');
898
952
  process.exit(1);
899
953
  }
900
954
  try {
@@ -904,258 +958,291 @@ program
904
958
  }
905
959
  else {
906
960
  const command = subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD ? constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD : constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE;
907
- commands_1.configureCommand(command);
961
+ (0, commands_1.configureCommand)(command);
908
962
  logger_1.logger.debug('Manage shared library execution started');
909
- cmd = utils_1.unmaskPasswords(cmd);
910
- validateOptions_1.validateOptions(cmd);
963
+ cmd = (0, utils_1.unmaskPasswords)(cmd);
964
+ (0, validateOptions_1.validateOptions)(cmd);
911
965
  }
912
966
  }
913
967
  catch (error) {
914
968
  logger_1.logger.error(error.message);
915
- yield utils_1.flushLogAndExitProcess(false, true);
969
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
916
970
  }
917
971
  if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD) {
918
972
  const sharedLibraryUpload = new upload_1.SharedLibraryUpload();
919
973
  try {
920
- const responseCode = yield sharedLibraryUpload.invoke(cmd);
974
+ const responseCode = await sharedLibraryUpload.invoke(cmd);
921
975
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
922
976
  logger_1.logger.debug('Shared Library files upload execution completed');
923
- yield utils_1.flushLogAndExitProcess(responseCode);
977
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
924
978
  }
925
979
  catch (error) {
926
980
  logger_1.logger.debug('Exception in Shared Library files upload: %o', error);
927
- yield utils_1.flushLogAndExitProcess(false);
981
+ await (0, utils_1.flushLogAndExitProcess)(false);
928
982
  }
929
983
  }
930
984
  else if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE) {
931
985
  const sharedLibraryDelete = new delete_1.SharedLibraryDelete();
932
986
  try {
933
- const responseCode = yield sharedLibraryDelete.invoke(cmd);
987
+ const responseCode = await sharedLibraryDelete.invoke(cmd);
934
988
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
935
989
  logger_1.logger.debug('Shared Library files delete execution completed');
936
- yield utils_1.flushLogAndExitProcess(responseCode);
990
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
937
991
  }
938
992
  catch (error) {
939
993
  logger_1.logger.debug('Exception in Shared Library files delete: %o', error);
940
- yield utils_1.flushLogAndExitProcess(false);
994
+ logger_1.logger.error(error.message);
995
+ await (0, utils_1.flushLogAndExitProcess)(false);
941
996
  }
942
997
  }
943
- }))
998
+ })
944
999
  .helpOption(false);
945
1000
  program
946
1001
  .command(constants_1.COMMANDS.PZN_EXPORT)
947
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
948
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
949
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
950
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
951
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
952
- .option('-dxContextRoot, --dxContextRoot <value>', 'Alternate path to the context root on the DX Core server', config.dxContextRoot)
953
- .option('-targetPath, --targetPath <value>', 'The location of the rule or folder containing the rules in the target workspace, which is the parent for the published nodes. '
1002
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1003
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1004
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1005
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1006
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1007
+ .option('--dxContextRoot <value>', 'Alternate path to the context root on the DX Core server', config.dxContextRoot)
1008
+ .option('--targetPath <value>', 'The location of the rule or folder containing the rules in the target workspace, which is the parent for the published nodes. '
954
1009
  + 'The target path must exist before publishing (default targetPath is "/")')
955
- .option('-targetWorkspace, --targetWorkspace <value>', 'The name of the workspace containing the rules in DX Core server')
1010
+ .option('--targetWorkspace <value>', 'The name of the workspace containing the rules in DX Core server')
956
1011
  .description('- Exports the personalization rules from the DX Core server')
957
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
958
- commands_1.configureCommand(constants_1.COMMANDS.PZN_EXPORT);
1012
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient pzn-export --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
1013
+ + ' --dxPassword wpsadmin --dxContextRoot /wps'))
1014
+ .action(async (cmdOptions) => {
1015
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.PZN_EXPORT);
959
1016
  logger_1.logger.debug('Export of the PZN rule execution started');
960
1017
  try {
961
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
962
- validateOptions_1.validateOptions(cmdOptions);
1018
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
1019
+ (0, validateOptions_1.validateOptions)(cmdOptions);
963
1020
  }
964
1021
  catch (error) {
965
1022
  logger_1.logger.error(error.message);
966
- yield utils_1.flushLogAndExitProcess(false, true);
1023
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
967
1024
  }
968
1025
  const pznRulesExportObj = new pznRulesExport_1.PznRulesExport();
969
1026
  try {
970
- const responseCode = yield pznRulesExportObj.invoke(cmdOptions);
1027
+ const responseCode = await pznRulesExportObj.invoke(cmdOptions);
971
1028
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
972
1029
  logger_1.logger.debug('Export pzn rules execution completed');
973
- yield utils_1.flushLogAndExitProcess(responseCode);
1030
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
974
1031
  }
975
1032
  catch (error) {
976
1033
  logger_1.logger.debug('Exception in execution of export pzn rules : %o', error);
977
- yield utils_1.flushLogAndExitProcess(false);
1034
+ await (0, utils_1.flushLogAndExitProcess)(false);
978
1035
  }
979
- }));
1036
+ });
980
1037
  program
981
1038
  .command(constants_1.COMMANDS.PZN_IMPORT)
982
- .option('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
983
- .option('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
984
- .option('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
985
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
986
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
987
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
988
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
989
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
990
- .requiredOption('-rulesFilePath, --rulesFilePath <value>', 'Path to the file containing the rules to be imported')
991
- .option('-dxContextRoot, --dxContextRoot <value>', 'Alternate path to the context root on the DX Core server', config.dxContextRoot)
992
- .option('-targetPath, --targetPath <value>', 'The location of the rule or folder containing the rules in the target workspace, which is the parent for the published nodes. '
1039
+ .option('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1040
+ .option('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1041
+ .option('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1042
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1043
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1044
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1045
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1046
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
1047
+ .requiredOption('--rulesFilePath <value>', 'Path to the file containing the rules to be imported')
1048
+ .option('--dxContextRoot <value>', 'Alternate path to the context root on the DX Core server', config.dxContextRoot)
1049
+ .option('--targetPath <value>', 'The location of the rule or folder containing the rules in the target workspace, which is the parent for the published nodes. '
993
1050
  + 'The target path must exist before publishing (default targetPath is "/")')
994
- .option('-targetWorkspace, --targetWorkspace <value>', 'The name of the workspace containing the rules in DX Core server')
1051
+ .option('--targetWorkspace <value>', 'The name of the workspace containing the rules in DX Core server')
995
1052
  .description('- Imports the personalization rules to the DX Core server')
996
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
997
- commands_1.configureCommand(constants_1.COMMANDS.PZN_IMPORT);
1053
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient pzn-import --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
1054
+ + ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202 --rulesFilePath /user/store/pznrule/test.nodes --dxContextRoot /wps'))
1055
+ .action(async (cmdOptions) => {
1056
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.PZN_IMPORT);
998
1057
  logger_1.logger.debug('Import of the PZN rule execution started');
999
1058
  try {
1000
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
1001
- validateOptions_1.validateOptions(cmdOptions);
1059
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
1060
+ (0, validateOptions_1.validateOptions)(cmdOptions);
1002
1061
  }
1003
1062
  catch (error) {
1004
1063
  logger_1.logger.error(error.message);
1005
- yield utils_1.flushLogAndExitProcess(false, true);
1064
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1006
1065
  }
1007
1066
  const pznRulesImportObj = new pznRulesImport_1.PznRulesImport();
1008
1067
  try {
1009
- const responseCode = yield pznRulesImportObj.invoke(cmdOptions);
1068
+ const responseCode = await pznRulesImportObj.invoke(cmdOptions);
1010
1069
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1011
1070
  logger_1.logger.debug('Import pzn rules execution completed');
1012
- yield utils_1.flushLogAndExitProcess(responseCode);
1071
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1013
1072
  }
1014
1073
  catch (error) {
1015
1074
  logger_1.logger.debug('Exception in execution of Import pzn rules : %o', error);
1016
- yield utils_1.flushLogAndExitProcess(false);
1075
+ await (0, utils_1.flushLogAndExitProcess)(false);
1017
1076
  }
1018
- }));
1077
+ });
1019
1078
  program
1020
1079
  .command(constants_1.COMMANDS.DELETE_DAM_SCHEMA)
1021
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1022
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
1023
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1024
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core', MaskData.maskPassword(config.dxPassword))
1025
- .requiredOption('-damAPIPort, --damAPIPort <value>', 'Port number of the DAM server, for any Kubernetes Environment default port is 443', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
1026
- .requiredOption('-ringAPIPort, --ringAPIPort <value>', 'Port number of the DX Core API server, for any Kubernetes Environment default port is 443', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
1027
- .requiredOption('-damAPIVersion, --damAPIVersion <value>', 'API Version number of DAM, for any Kubernetes Environment default port is 443', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
1028
- .requiredOption('-ringAPIVersion, --ringAPIVersion <value>', 'API Version number of DX Core, for any Kubernetes Environment default port is 443', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
1029
- .option('-schemaVersion, --schemaVersion <value>', 'DAM Schema Version')
1080
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1081
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1082
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1083
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core', MaskData.maskPassword(config.dxPassword))
1084
+ .requiredOption('--damAPIPort <value>', 'Port number of the DAM server, for any Kubernetes Environment default port is 443', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
1085
+ .requiredOption('--ringAPIPort <value>', 'Port number of the DX Core API server, for any Kubernetes Environment default port is 443', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
1086
+ .requiredOption('--damAPIVersion <value>', 'API Version number of DAM, for any Kubernetes Environment default port is 443', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
1087
+ .requiredOption('--ringAPIVersion <value>', 'API Version number of DX Core, for any Kubernetes Environment default port is 443', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
1088
+ .option('--schemaVersion <value>', 'DAM Schema Version')
1030
1089
  .description('- Deletes inactive DAM schema from persistence in DX')
1031
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
1032
- commands_1.configureCommand(constants_1.COMMANDS.DELETE_DAM_SCHEMA);
1090
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient delete-dam-schema --dxProtocol https --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin'
1091
+ + ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --schemaVersion 3'))
1092
+ .action(async (cmdOptions) => {
1093
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.DELETE_DAM_SCHEMA);
1033
1094
  logger_1.logger.debug('Delete DAM Schema started');
1034
1095
  try {
1035
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
1036
- validateOptions_1.validateOptions(cmdOptions);
1096
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
1097
+ (0, validateOptions_1.validateOptions)(cmdOptions);
1037
1098
  }
1038
1099
  catch (error) {
1039
1100
  logger_1.logger.error(error.message);
1040
- yield utils_1.flushLogAndExitProcess(false, true);
1101
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1041
1102
  }
1042
1103
  try {
1043
1104
  const deleteSchema = new deleteSchema_1.DeleteSchema();
1044
- const responseCode = yield deleteSchema.invoke(cmdOptions);
1105
+ const responseCode = await deleteSchema.invoke(cmdOptions);
1045
1106
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1046
1107
  logger_1.logger.debug('Delete DAM Schema execution completed');
1047
- yield utils_1.flushLogAndExitProcess(responseCode);
1108
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1048
1109
  }
1049
1110
  catch (error) {
1050
1111
  logger_1.logger.debug('Exception in execution : %o', error);
1051
- yield utils_1.flushLogAndExitProcess(false);
1112
+ await (0, utils_1.flushLogAndExitProcess)(false);
1052
1113
  }
1053
- }));
1114
+ });
1054
1115
  program
1055
1116
  .command(constants_1.COMMANDS.LIST_DAM_SCHEMA)
1056
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1057
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
1058
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1059
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core', MaskData.maskPassword(config.dxPassword))
1060
- .requiredOption('-damAPIPort, --damAPIPort <value>', 'Port number of the DAM server, for any Kubernetes Environment default port is 443', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
1061
- .requiredOption('-ringAPIPort, --ringAPIPort <value>', 'Port number of the DX Core API server, for any Kubernetes Environment default port is 443', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
1062
- .requiredOption('-damAPIVersion, --damAPIVersion <value>', 'API Version number of DAM, for any Kubernetes Environment default port is 443', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
1063
- .requiredOption('-ringAPIVersion, --ringAPIVersion <value>', 'API Version number of DX Core, for any Kubernetes Environment default port is 443', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
1117
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1118
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1119
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1120
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core', MaskData.maskPassword(config.dxPassword))
1121
+ .requiredOption('--damAPIPort <value>', 'Port number of the DAM server, for any Kubernetes Environment default port is 443', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
1122
+ .requiredOption('--ringAPIPort <value>', 'Port number of the DX Core API server, for any Kubernetes Environment default port is 443', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
1123
+ .requiredOption('--damAPIVersion <value>', 'API Version number of DAM, for any Kubernetes Environment default port is 443', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
1124
+ .requiredOption('--ringAPIVersion <value>', 'API Version number of DX Core, for any Kubernetes Environment default port is 443', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
1064
1125
  .description('- Lists all DAM schemas in DX.')
1065
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
1066
- commands_1.configureCommand(constants_1.COMMANDS.LIST_DAM_SCHEMA);
1126
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient list-dam-schemas --dxProtocol https --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin'
1127
+ + ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1'))
1128
+ .action(async (cmdOptions) => {
1129
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.LIST_DAM_SCHEMA);
1067
1130
  logger_1.logger.debug('List DAM Schema started');
1068
1131
  try {
1069
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
1070
- validateOptions_1.validateOptions(cmdOptions);
1132
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
1133
+ (0, validateOptions_1.validateOptions)(cmdOptions);
1071
1134
  }
1072
1135
  catch (error) {
1073
1136
  logger_1.logger.error(error.message);
1074
- yield utils_1.flushLogAndExitProcess(false, true);
1137
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1075
1138
  }
1076
1139
  try {
1077
1140
  const listSchema = new listSchema_1.ListSchema();
1078
- const responseCode = yield listSchema.invoke(cmdOptions);
1141
+ const responseCode = await listSchema.invoke(cmdOptions);
1079
1142
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1080
1143
  logger_1.logger.debug('List DAM Schema execution completed');
1081
- yield utils_1.flushLogAndExitProcess(responseCode);
1144
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1082
1145
  }
1083
1146
  catch (error) {
1084
1147
  logger_1.logger.debug('Exception in execution : %o', error);
1085
- yield utils_1.flushLogAndExitProcess(false);
1148
+ await (0, utils_1.flushLogAndExitProcess)(false);
1086
1149
  }
1087
- }));
1150
+ });
1088
1151
  program
1089
1152
  .command(`${constants_1.COMMANDS.MANAGE_VIRTUAL_PORTAL} [subCmd]`)
1090
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1091
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1092
- .option('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort.toString())
1093
- .option('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
1094
- .option('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1095
- .option('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1096
- .option('-dxWASUsername, --dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
1097
- .option('-dxWASPassword, --dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
1098
- .option('-vpTitle, --vpTitle <value>', 'Virtual portal Title')
1099
- .option('-vpRealm, --vpRealm <value>', 'Virtual portal Realm')
1100
- .option('-vpAdminGroup, --vpAdminGroup <value>', 'Virtual portal AdminGroup')
1101
- .option('-vpHostname, --vpHostname <value>', 'Virtual portal Hostname')
1102
- .option('-vpContext, --vpContext <value>', 'Virtual portal Context')
1103
- .option('-dxProtocol, --dxProtocol <value>', 'protocol of the DX Core server', config.dxProtocol)
1104
- .requiredOption('-hostname,--hostname <value>', 'Host name of the DX Core server', config.hostname)
1105
- .option('-dxPort,--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1106
- .option('-xmlConfigPath, --xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
1107
- .option('-xmlFile,--xmlFile <value>', 'XML file name with full path')
1108
- .option('-requestId, --requestId <value>', 'Unique Id of a previously triggered create virtual portal request')
1153
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1154
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1155
+ .option('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort.toString())
1156
+ .option('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
1157
+ .option('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1158
+ .option('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1159
+ .option('--dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
1160
+ .option('--dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
1161
+ .option('--vpTitle <value>', 'Virtual portal Title')
1162
+ .option('--vpRealm <value>', 'Virtual portal Realm')
1163
+ .option('--vpAdminGroup <value>', 'Virtual portal AdminGroup')
1164
+ .option('--vpHostname <value>', 'Virtual portal Hostname')
1165
+ .option('--vpContext <value>', 'Virtual portal Context')
1166
+ .option('--dxProtocol <value>', 'protocol of the DX Core server', config.dxProtocol)
1167
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1168
+ .option('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1169
+ .option('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
1170
+ .option('--xmlFile <value>', 'XML file name with full path')
1171
+ .option('--requestId <value>', 'Unique Id of a previously triggered create virtual portal request')
1109
1172
  .option('-h, --help')
1110
1173
  .description('- Manages list,create,import or export of virtual portal in the DX Core server')
1111
- .action((subCmd, cmd) => __awaiter(void 0, void 0, void 0, function* () {
1174
+ .action(async (subCmd, cmd) => {
1112
1175
  if ((subCmd === constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS || subCmd === constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL || subCmd === constants_1.SUB_COMMANDS.IMPORT_VIRTUAL_PORTAL
1113
- || subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) && (cmd.parent.args[2] === constants_1.COMMANDS.H || cmd.parent.args[2] === constants_1.COMMANDS.HELP)) {
1176
+ || subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
1114
1177
  logger_1.logger.help('Usage: dxclient manage-virtual-portal [options] [subCmd](list/create/import/export)\n');
1115
1178
  logger_1.logger.help('Lists,create,import or export a virtual portal in the DX Core server\n');
1116
- logger_1.logger.help(` -hostname,--hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
1117
- logger_1.logger.help(` -dxUsername, --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}")`);
1118
- logger_1.logger.help(` -dxPassword, --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
1179
+ }
1180
+ if (subCmd === constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS) {
1181
+ logger_1.logger.help(' \nExample : dxclient manage-virtual-portal list --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxConnectPort 10202 --dxProfileName wp_profile'
1182
+ + ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxWASUsername wpsadmin --dxWASPassword wpsadmin \n');
1183
+ }
1184
+ if (subCmd === constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL) {
1185
+ logger_1.logger.help(' \nExample : dxclient manage-virtual-portal create --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxConnectPort 10202 --dxProfileName wp_profile'
1186
+ + ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxWASUsername wpsadmin --dxWASPassword wpsadmin --vpTitle test_vp -vpRealm defaultWIMFileBasedRealm'
1187
+ + ' -vpAdminGroup wpsadmins -vpContext test_Context \n');
1188
+ }
1189
+ if (subCmd === constants_1.SUB_COMMANDS.IMPORT_VIRTUAL_PORTAL) {
1190
+ logger_1.logger.help(' \nExample : dxclient manage-virtual-portal import --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsernam wpsadmin --dxPassword wpsadmin'
1191
+ + ' --xmlFile /user/store/output/test.xml --vpContext test_Context \n');
1192
+ }
1193
+ if (subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) {
1194
+ logger_1.logger.help(' \nExample : dxclient manage-virtual-portal export --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxProtocol https --dxPort 10041'
1195
+ + ' --xmlConfigPath /wps/config --vpTitle test --vpContext test_Context --xmlFile /user/store/output/test.xml \n');
1196
+ }
1197
+ if ((subCmd === constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS || subCmd === constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL || subCmd === constants_1.SUB_COMMANDS.IMPORT_VIRTUAL_PORTAL
1198
+ || subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
1199
+ logger_1.logger.help('Options:\n');
1200
+ logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
1201
+ logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}")`);
1202
+ logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
1119
1203
  if (subCmd === constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS) {
1120
- logger_1.logger.help(` -dxConnectPort, --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
1204
+ logger_1.logger.help(` --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
1121
1205
  logger_1.logger.help(` -dxProfileName, --dxProfileName <value> Profile name in the DX core server (default: "${config.dxProfileName}")`);
1122
- logger_1.logger.help(` -dxConnectUsername, --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
1123
- logger_1.logger.help(` -dxConnectPassword, --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
1124
- logger_1.logger.help(` -dxWASUsername, --dxWASUsername <value> Username of the DX WAS server (default: "${config.dxWASUsername}")`);
1125
- logger_1.logger.help(` -dxWASPassword, --dxWASPassword <value> Password of the DX WAS server (default: "${MaskData.maskPassword(config.dxWASPassword)}")`);
1206
+ logger_1.logger.help(` --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
1207
+ logger_1.logger.help(` --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
1208
+ logger_1.logger.help(` --dxWASUsername <value> Username of the DX WAS server (default: "${config.dxWASUsername}")`);
1209
+ logger_1.logger.help(` --dxWASPassword <value> Password of the DX WAS server (default: "${MaskData.maskPassword(config.dxWASPassword)}")`);
1210
+ logger_1.logger.help(' -h, --help display help for command');
1126
1211
  }
1127
1212
  if (subCmd === constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL) {
1128
- logger_1.logger.help(` -dxConnectPort, --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
1213
+ logger_1.logger.help(` --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
1129
1214
  logger_1.logger.help(` -dxProfileName, --dxProfileName <value> Profile name in the DX core server (default: "${config.dxProfileName}")`);
1130
- logger_1.logger.help(` -dxConnectUsername, --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
1131
- logger_1.logger.help(` -dxConnectPassword, --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
1132
- logger_1.logger.help(` -dxWASUsername, --dxWASUsername <value> Username of the DX WAS server (default: "${config.dxWASUsername}")`);
1133
- logger_1.logger.help(` -dxWASPassword, --dxWASPassword <value> Password of the DX WAS server (default: "${MaskData.maskPassword(config.dxWASPassword)}")`);
1134
- logger_1.logger.help(' -vpTitle, --vpTitle <value> Virtual portal Title');
1135
- logger_1.logger.help(' -vpRealm, --vpRealm <value> Virtual portal Realm');
1136
- logger_1.logger.help(' -vpAdminGroup, --vpAdminGroup <value> Virtual portal AdminGroup');
1137
- logger_1.logger.help(' -vpHostname, --vpHostname <value> Virtual portal Hostname');
1138
- logger_1.logger.help(' -vpContext, --vpContext <value> Virtual portal Context');
1139
- logger_1.logger.help(' -requestId, --requestId <value> Unique Id of a previously triggered create virtual portal request');
1215
+ logger_1.logger.help(` --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
1216
+ logger_1.logger.help(` --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
1217
+ logger_1.logger.help(` --dxWASUsername <value> Username of the DX WAS server (default: "${config.dxWASUsername}")`);
1218
+ logger_1.logger.help(` --dxWASPassword <value> Password of the DX WAS server (default: "${MaskData.maskPassword(config.dxWASPassword)}")`);
1219
+ logger_1.logger.help(' --vpTitle <value> Virtual portal Title');
1220
+ logger_1.logger.help(' --vpRealm <value> Virtual portal Realm');
1221
+ logger_1.logger.help(' --vpAdminGroup <value> Virtual portal AdminGroup');
1222
+ logger_1.logger.help(' --vpHostname <value> Virtual portal Hostname');
1223
+ logger_1.logger.help(' --vpContext <value> Virtual portal Context');
1224
+ logger_1.logger.help(' --requestId <value> Unique Id of a previously triggered create virtual portal request');
1225
+ logger_1.logger.help(' -h, --help display help for command');
1140
1226
  }
1141
1227
  if (subCmd === constants_1.SUB_COMMANDS.IMPORT_VIRTUAL_PORTAL) {
1142
- logger_1.logger.help(` -dxProtocol, --dxProtocol <value> protocol of the DX Core server (default: "${config.dxProtocol}")`);
1143
- logger_1.logger.help(` -dxPort, --dxPort <value> Port number for DX Core server, for any Kubernetes Environment \
1228
+ logger_1.logger.help(` --dxProtocol <value> protocol of the DX Core server (default: "${config.dxProtocol}")`);
1229
+ logger_1.logger.help(` --dxPort <value> Port number for DX Core server, for any Kubernetes Environment \
1144
1230
  default port is 443 (default: "${config.dxPort.toString()}")`);
1145
- logger_1.logger.help(` -xmlConfigPath, --xmlConfigPath <value> Path to DX configuration endpoint (default: "${config.xmlConfigPath}")`);
1146
- logger_1.logger.help(' -vpContext, --vpContext <value> Virtual portal Context');
1147
- logger_1.logger.help(' -xmlFile,--xmlFile <value> XML file name with full path');
1231
+ logger_1.logger.help(` --xmlConfigPath <value> Path to DX configuration endpoint (default: "${config.xmlConfigPath}")`);
1232
+ logger_1.logger.help(' --vpContext <value> Virtual portal Context');
1233
+ logger_1.logger.help(' --xmlFile <value> XML file name with full path');
1234
+ logger_1.logger.help(' -h, --help display help for command');
1148
1235
  }
1149
1236
  if (subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) {
1150
- logger_1.logger.help(` -dxProtocol, --dxProtocol <value> protocol of the DX Core server (default: "${config.dxProtocol}")`);
1151
- logger_1.logger.help(` -dxPort,--dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default port is 443,
1237
+ logger_1.logger.help(` --dxProtocol <value> protocol of the DX Core server (default: "${config.dxProtocol}")`);
1238
+ logger_1.logger.help(` --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default port is 443,
1152
1239
  (default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
1153
- logger_1.logger.help(` -xmlConfigPath, --xmlConfigPath <value> Path to DX configuration endpoint (default: "${config.xmlConfigPath}")`);
1154
- logger_1.logger.help(' -vpContext, --vpContext <value> Path to virtual portal context');
1155
- logger_1.logger.help(' -vpTitle, --vpTitle <value> Virtual portal name');
1156
- logger_1.logger.help(' -xmlFile,--xmlFile <value> XML file name with full path');
1240
+ logger_1.logger.help(` --xmlConfigPath <value> Path to DX configuration endpoint (default: "${config.xmlConfigPath}")`);
1241
+ logger_1.logger.help(' --vpContext <value> Path to virtual portal context');
1242
+ logger_1.logger.help(' --vpTitle <value> Virtual portal name');
1243
+ logger_1.logger.help(' --xmlFile <value> XML file name with full path');
1244
+ logger_1.logger.help(' -h, --help display help for command');
1157
1245
  }
1158
- logger_1.logger.help(' -h, --help display help for command');
1159
1246
  process.exit(1);
1160
1247
  }
1161
1248
  if (!subCmd || (subCmd !== constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS && subCmd !== constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL
@@ -1167,121 +1254,149 @@ program
1167
1254
  process.exit(1);
1168
1255
  }
1169
1256
  try {
1170
- commands_1.configureCommand(subCmd);
1257
+ (0, commands_1.configureCommand)(subCmd);
1171
1258
  logger_1.logger.debug('Manage virtual portal execution started');
1172
- cmd = utils_1.unmaskPasswords(cmd);
1173
- validateOptions_1.validateOptions(cmd);
1259
+ cmd = (0, utils_1.unmaskPasswords)(cmd);
1260
+ (0, validateOptions_1.validateOptions)(cmd);
1174
1261
  }
1175
1262
  catch (error) {
1176
1263
  logger_1.logger.error(error.message);
1177
- yield utils_1.flushLogAndExitProcess(false, true);
1264
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1178
1265
  }
1179
1266
  if (subCmd === constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS) {
1180
1267
  const listVirtualPortals = new listVirtualPortals_1.ListVirtualPortals();
1181
1268
  try {
1182
- const responseCode = yield listVirtualPortals.invoke(cmd);
1269
+ const responseCode = await listVirtualPortals.invoke(cmd);
1183
1270
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1184
1271
  logger_1.logger.debug('List virtual portal execution successful');
1185
- yield utils_1.flushLogAndExitProcess(responseCode);
1272
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1186
1273
  }
1187
1274
  catch (error) {
1188
1275
  logger_1.logger.debug('Exception in execution of list virtual portal : %o', error);
1189
- yield utils_1.flushLogAndExitProcess(false);
1276
+ await (0, utils_1.flushLogAndExitProcess)(false);
1190
1277
  }
1191
1278
  }
1192
1279
  else if (subCmd === constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL) {
1193
1280
  const createVirtualPortal = new createVirtualPortal_1.CreateVirtualPortal();
1194
1281
  try {
1195
- const responseCode = yield createVirtualPortal.invoke(cmd);
1282
+ const responseCode = await createVirtualPortal.invoke(cmd);
1196
1283
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1197
1284
  logger_1.logger.debug('create virtual portal execution successful');
1198
- yield utils_1.flushLogAndExitProcess(responseCode);
1285
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1199
1286
  }
1200
1287
  catch (error) {
1201
1288
  logger_1.logger.debug('Exception in execution of import virtual portal : %o', error);
1202
- yield utils_1.flushLogAndExitProcess(false);
1289
+ await (0, utils_1.flushLogAndExitProcess)(false);
1203
1290
  }
1204
1291
  }
1205
1292
  else if (subCmd === constants_1.SUB_COMMANDS.IMPORT_VIRTUAL_PORTAL) {
1206
1293
  const importVirtualPortal = new importVirtualPortal_1.ImportVirtualPortal();
1207
1294
  try {
1208
- const responseCode = yield importVirtualPortal.invoke(cmd);
1295
+ const responseCode = await importVirtualPortal.invoke(cmd);
1209
1296
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1210
1297
  logger_1.logger.debug('Import virtual portal execution successful');
1211
- yield utils_1.flushLogAndExitProcess(responseCode);
1298
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1212
1299
  }
1213
1300
  catch (error) {
1214
1301
  logger_1.logger.debug('Exception in execution of import virtual portal : %o', error);
1215
- yield utils_1.flushLogAndExitProcess(false);
1302
+ await (0, utils_1.flushLogAndExitProcess)(false);
1216
1303
  }
1217
1304
  }
1218
1305
  else if (subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) {
1219
1306
  const exportVirtualPortal = new exportVirtualPortal_1.ExportVirtualPortal();
1220
1307
  try {
1221
- const responseCode = yield exportVirtualPortal.invoke(cmd);
1308
+ const responseCode = await exportVirtualPortal.invoke(cmd);
1222
1309
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1223
1310
  logger_1.logger.debug('List virtual portal execution successful');
1224
- yield utils_1.flushLogAndExitProcess(responseCode);
1311
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1225
1312
  }
1226
1313
  catch (error) {
1227
1314
  logger_1.logger.debug('Exception in execution of list virtual portal : %o', error);
1228
- yield utils_1.flushLogAndExitProcess(false);
1315
+ await (0, utils_1.flushLogAndExitProcess)(false);
1229
1316
  }
1230
1317
  }
1231
- }))
1318
+ })
1232
1319
  .helpOption(false);
1233
1320
  program
1234
1321
  .command(`${constants_1.COMMANDS.RESOURCE_ENVIRONMENT_PROVIDER} [subCmd]`)
1235
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1236
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
1237
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1238
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1239
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1240
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1241
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1242
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
1243
- .requiredOption('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
1244
- .requiredOption('-dxWASUsername, --dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
1245
- .requiredOption('-dxWASPassword, --dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
1246
- .option('-providerName, --providerName <value>', 'Name of the Resource Environment Provider ')
1247
- .option('-propertyName, --propertyName <value>', 'Name of the Custom Property ')
1248
- .option('-propertyValue, --propertyValue <value>', 'Value of the Custom Property ')
1249
- .option('-propertyDesc, --propertyDesc <value>', 'Description of the Custom Property ')
1250
- .option('-filePath, --filePath <value>', 'File path of the import Resource Environment Provider files')
1322
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1323
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1324
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1325
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1326
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1327
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1328
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1329
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
1330
+ .requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
1331
+ .requiredOption('--dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
1332
+ .requiredOption('--dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
1333
+ .option('--providerName <value>', 'Name of the Resource Environment Provider ')
1334
+ .option('--propertyName <value>', 'Name of the Custom Property ')
1335
+ .option('--propertyValue <value>', 'Value of the Custom Property ')
1336
+ .option('--propertyDesc <value>', 'Description of the Custom Property ')
1337
+ .option('--filePath <value>', 'File path of the import Resource Environment Provider files')
1251
1338
  .option('-h, --help')
1252
1339
  .description('- Creates, Updates, Deletes,Import,Retrieves or Exports a custom property')
1253
- .action((subCommand, commands) => __awaiter(void 0, void 0, void 0, function* () {
1340
+ .action(async (subCommand, commands) => {
1254
1341
  logger_1.logger.debug('Resource Environment provider process started.');
1255
1342
  if ((subCommand === constants_1.SUB_COMMANDS.CREATE_PROPERTY || subCommand === constants_1.SUB_COMMANDS.UPDATE_PROPERTY || subCommand === constants_1.SUB_COMMANDS.DELETE_PROPERTY
1256
1343
  || subCommand === constants_1.SUB_COMMANDS.EXPORT_PROPERTIES || subCommand === constants_1.SUB_COMMANDS.IMPORT_PROPERTIES || subCommand === constants_1.SUB_COMMANDS.RETRIEVE_PROPERTY)
1257
- && (commands.parent.args[2] === constants_1.COMMANDS.H || commands.parent.args[2] === constants_1.COMMANDS.HELP)) {
1344
+ && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
1258
1345
  logger_1.logger.help('Usage: dxclient resource-env-provider [options] [subCmd](create-property/update-property/delete-property/export-properties/import-properties/retrieve-property)\n');
1259
1346
  logger_1.logger.help('- Creates, Retrieves, Updates, Deletes, Import or Exports custom properties.\n');
1260
- logger_1.logger.help(` -hostname,--hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
1261
- logger_1.logger.help(` -dxConnectPort, --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
1262
- logger_1.logger.help(` -dxConnectUsername, --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
1263
- logger_1.logger.help(` -dxConnectPassword, --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
1264
- logger_1.logger.help(` -dxWASUsername, --dxWASUsername <value> Username of the DX WAS server (default: "${config.dxWASUsername}")`);
1265
- logger_1.logger.help(` -dxWASPassword, --dxWASPassword <value> Password of the DX WAS server (default: "${MaskData.maskPassword(config.dxWASPassword)}")`);
1347
+ }
1348
+ if (subCommand === constants_1.SUB_COMMANDS.CREATE_PROPERTY) {
1349
+ logger_1.logger.help(' \nExample : dxclient resource-env-provider create-property --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
1350
+ + ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --providerName testprovider --propertyName test --propertyValue test \n');
1351
+ }
1352
+ if (subCommand === constants_1.SUB_COMMANDS.UPDATE_PROPERTY) {
1353
+ logger_1.logger.help(' \nExample : dxclient resource-env-provider update-property --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
1354
+ + ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --providerName testprovider --propertyName test --propertyValue test \n');
1355
+ }
1356
+ if (subCommand === constants_1.SUB_COMMANDS.DELETE_PROPERTY) {
1357
+ logger_1.logger.help(' \nExample : dxclient resource-env-provider delete-property --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
1358
+ + ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --providerName testprovider --propertyName test \n');
1359
+ }
1360
+ if (subCommand === constants_1.SUB_COMMANDS.EXPORT_PROPERTIES) {
1361
+ logger_1.logger.help(' \nExample : dxclient resource-env-provider export-properties --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
1362
+ + ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile \n');
1363
+ }
1364
+ if (subCommand === constants_1.SUB_COMMANDS.IMPORT_PROPERTIES) {
1365
+ logger_1.logger.help(' \nExample : dxclient resource-env-provider import-properties --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
1366
+ + ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --filePath /user/store/output/resourceenv/test.xml \n');
1367
+ }
1368
+ if (subCommand === constants_1.SUB_COMMANDS.RETRIEVE_PROPERTY) {
1369
+ logger_1.logger.help(' \nExample : dxclient resource-env-provider retrieve-property --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
1370
+ + ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --providerName testprovider --propertyName test \n');
1371
+ }
1372
+ if ((subCommand === constants_1.SUB_COMMANDS.CREATE_PROPERTY || subCommand === constants_1.SUB_COMMANDS.UPDATE_PROPERTY || subCommand === constants_1.SUB_COMMANDS.DELETE_PROPERTY
1373
+ || subCommand === constants_1.SUB_COMMANDS.EXPORT_PROPERTIES || subCommand === constants_1.SUB_COMMANDS.IMPORT_PROPERTIES || subCommand === constants_1.SUB_COMMANDS.RETRIEVE_PROPERTY)
1374
+ && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
1375
+ logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
1376
+ logger_1.logger.help(` --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
1377
+ logger_1.logger.help(` --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
1378
+ logger_1.logger.help(` --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
1379
+ logger_1.logger.help(` --dxWASUsername <value> Username of the DX WAS server (default: "${config.dxWASUsername}")`);
1380
+ logger_1.logger.help(` --dxWASPassword <value> Password of the DX WAS server (default: "${MaskData.maskPassword(config.dxWASPassword)}")`);
1266
1381
  logger_1.logger.help(` -dxProfileName, --dxProfileName <value> Profile name in the DX core server (default: "${config.dxProfileName}")`);
1267
1382
  if (subCommand === constants_1.SUB_COMMANDS.CREATE_PROPERTY || subCommand === constants_1.SUB_COMMANDS.UPDATE_PROPERTY) {
1268
- logger_1.logger.help(' -providerName, --providerName <value> Name of the Resource Environment Provider');
1269
- logger_1.logger.help(' -propertyName, --propertyName <value> Name of the Custom Property');
1270
- logger_1.logger.help(' -propertyValue, --propertyValue <value> Value of the Custom Property');
1271
- logger_1.logger.help(' -propertyDesc, --propertyDesc <value> Description of the Custom Property');
1383
+ logger_1.logger.help(' --providerName <value> Name of the Resource Environment Provider');
1384
+ logger_1.logger.help(' --propertyName <value> Name of the Custom Property');
1385
+ logger_1.logger.help(' --propertyValue <value> Value of the Custom Property');
1386
+ logger_1.logger.help(' --propertyDesc <value> Description of the Custom Property');
1272
1387
  }
1273
1388
  if (subCommand === constants_1.SUB_COMMANDS.DELETE_PROPERTY) {
1274
- logger_1.logger.help(' -providerName, --providerName <value> Name of the Resource Environment Provider');
1275
- logger_1.logger.help(' -propertyName, --propertyName <value> Name of the Custom Property');
1389
+ logger_1.logger.help(' --providerName <value> Name of the Resource Environment Provider');
1390
+ logger_1.logger.help(' --propertyName <value> Name of the Custom Property');
1276
1391
  }
1277
1392
  if (subCommand === constants_1.SUB_COMMANDS.IMPORT_PROPERTIES) {
1278
- logger_1.logger.help(' -filePath, --filePath <value> File path of the import Resource Environment Provider files');
1393
+ logger_1.logger.help(' --filePath <value> File path of the import Resource Environment Provider files');
1279
1394
  }
1280
1395
  if (subCommand === constants_1.SUB_COMMANDS.RETRIEVE_PROPERTY) {
1281
- logger_1.logger.help(' -providerName, --providerName <value> Name of the Resource Environment Provider');
1282
- logger_1.logger.help(' -propertyName, --propertyName <value> Name of the Custom Property');
1396
+ logger_1.logger.help(' --providerName <value> Name of the Resource Environment Provider');
1397
+ logger_1.logger.help(' --propertyName <value> Name of the Custom Property');
1283
1398
  }
1284
- logger_1.logger.help(' -h, --help display help for command');
1399
+ logger_1.logger.help(' -h, --help display help for command');
1285
1400
  process.exit(1);
1286
1401
  }
1287
1402
  if (!subCommand || (subCommand !== constants_1.SUB_COMMANDS.CREATE_PROPERTY && subCommand !== constants_1.SUB_COMMANDS.UPDATE_PROPERTY && subCommand !== constants_1.SUB_COMMANDS.DELETE_PROPERTY
@@ -1296,160 +1411,182 @@ program
1296
1411
  }
1297
1412
  else {
1298
1413
  try {
1299
- commands_1.configureCommand(subCommand);
1300
- commands = utils_1.unmaskPasswords(commands);
1301
- validateOptions_1.validateOptions(commands);
1414
+ (0, commands_1.configureCommand)(subCommand);
1415
+ commands = (0, utils_1.unmaskPasswords)(commands);
1416
+ (0, validateOptions_1.validateOptions)(commands);
1302
1417
  }
1303
1418
  catch (error) {
1304
1419
  logger_1.logger.error(error.message);
1305
- yield utils_1.flushLogAndExitProcess(false, true);
1420
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1306
1421
  }
1307
1422
  }
1308
1423
  const repActions = new resEnvProviderActions_1.ResourceEnvironmentProviderActions();
1309
1424
  try {
1310
- const responseCode = yield repActions.invoke(subCommand, commands);
1311
- yield utils_1.flushLogAndExitProcess(responseCode);
1425
+ const responseCode = await repActions.invoke(subCommand, commands);
1426
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1312
1427
  }
1313
1428
  catch (error) {
1314
1429
  logger_1.logger.debug('Exception in execution of Resource Environment Provider Process : %o', error);
1315
- yield utils_1.flushLogAndExitProcess(false);
1430
+ await (0, utils_1.flushLogAndExitProcess)(false);
1316
1431
  }
1317
- }))
1432
+ })
1318
1433
  .helpOption(false);
1319
1434
  program
1320
1435
  .command(constants_1.COMMANDS.CREATE_SYNDICATION_RELATION)
1321
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1322
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
1323
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1324
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1325
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1326
- .requiredOption('-contenthandlerPath, --contenthandlerPath <value>', 'Alternate path to the contenthandler servlet on the DX Core server', config.contenthandlerPath)
1327
- .requiredOption('-syndicatorUrl, --syndicatorUrl <value>', 'Syndicator URL e.g http(s)://host:port/wps/wcm')
1328
- .requiredOption('-syndicatorName, --syndicatorName <value>', 'New syndicator name: syndicatorName')
1329
- .requiredOption('-subscriberName, --subscriberName <value>', 'New subscriber name: subscriberName')
1330
- .requiredOption('-vaultSlotName, --vaultSlotName <value>', 'Credential Vault Name: vaultSlotName')
1331
- .requiredOption('-dxContextRoot, --dxContextRoot <value>', 'Alternate path to the context root on the DX Core server', config.dxContextRoot)
1332
- .option('-isEnabled, --isEnabled <value>', 'Whether the syndicator/subscriber pair is enabled on creation: isEnabled (default is true)', true)
1333
- .option('-updateAfterCreation, --updateAfterCreation <value>', 'Whether the syndicator/subscriber pair is updateAfterCreation : updateAfterCreation (default is true)', true)
1334
- .option('-syndicationType, --syndicationType <value>', 'The libraries to syndicate eg. all-items,liveItems,liveProjectsItem,all-items,published-items and all-items-and-versions')
1335
- .option('-webContentLibraries, --webContentLibraries <value>', ' Libraries Name: webContentLibraries')
1336
- .option('-subscriberURL, --subscriberURL <value>', 'Subscriber URL e.g http(s)://host:port/wps/wcm')
1337
- .option('-mode, --mode <value>', 'Syndicator/subscriber mode')
1338
- .option('-syndicatorVaultSlotName, --syndicatorVaultSlotName <value>', 'Credential Vault Name: syndicatorVaultSlotName')
1339
- .option('-virtualPortalContext, --virtualPortalContext <value>', 'Virtual portal Context', config.virtualPortalContext)
1436
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1437
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1438
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1439
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1440
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1441
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path to the contenthandler servlet on the DX Core server', config.contenthandlerPath)
1442
+ .requiredOption('--syndicatorUrl <value>', 'Syndicator URL e.g http(s)://host:port/wps/wcm')
1443
+ .requiredOption('--syndicatorName <value>', 'New syndicator name: syndicatorName')
1444
+ .requiredOption('--subscriberName <value>', 'New subscriber name: subscriberName')
1445
+ .requiredOption('--vaultSlotName <value>', 'Credential Vault Name: vaultSlotName')
1446
+ .requiredOption('--dxContextRoot <value>', 'Alternate path to the context root on the DX Core server', config.dxContextRoot)
1447
+ .option('--isEnabled <value>', 'Whether the syndicator/subscriber pair is enabled on creation: isEnabled (default is true)', true)
1448
+ .option('--updateAfterCreation <value>', 'Whether the syndicator/subscriber pair is updateAfterCreation : updateAfterCreation (default is true)', true)
1449
+ .option('--syndicationType <value>', 'The libraries to syndicate eg. all-items,liveItems,liveProjectsItem,all-items,published-items and all-items-and-versions')
1450
+ .option('--webContentLibraries <value>', ' Libraries Name: webContentLibraries')
1451
+ .option('--subscriberURL <value>', 'Subscriber URL e.g http(s)://host:port/wps/wcm')
1452
+ .option('--mode <value>', 'Syndicator/subscriber mode')
1453
+ .option('--syndicatorVaultSlotName <value>', 'Credential Vault Name: syndicatorVaultSlotName')
1454
+ .option('--virtualPortalContext <value>', 'Virtual portal Context', config.virtualPortalContext)
1340
1455
  .description('- Creates a syndication relation between syndicator and subscriber in the DX server.')
1341
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
1342
- commands_1.configureCommand(constants_1.COMMANDS.CREATE_SYNDICATION_RELATION);
1456
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient create-syndication-relation --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
1457
+ + ' --contenthandlerPath /wps/mycontenthandler --syndicatorUrl http(s)://localhost:10041/wps/wcm --syndicatorName testsyn --subscriberName testsub --vaultSlotName test_solt --dxContextRoot /wps'
1458
+ + ' --syndicationType all-items --webContentLibraries "Portal Sit" '))
1459
+ .action(async (cmdOptions) => {
1460
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.CREATE_SYNDICATION_RELATION);
1343
1461
  logger_1.logger.debug('Create syndication relation execution started');
1344
1462
  try {
1345
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
1346
- validateOptions_1.validateOptions(cmdOptions);
1463
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
1464
+ (0, validateOptions_1.validateOptions)(cmdOptions);
1347
1465
  }
1348
1466
  catch (error) {
1349
1467
  logger_1.logger.error(error.message);
1350
- yield utils_1.flushLogAndExitProcess(false, true);
1468
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1351
1469
  }
1352
1470
  try {
1353
1471
  const createSyndication = new createSyndicationRelation_1.CreateSyndicationRelation();
1354
- const responseCode = yield createSyndication.invoke(cmdOptions);
1472
+ const responseCode = await createSyndication.invoke(cmdOptions);
1355
1473
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1356
1474
  logger_1.logger.debug('Create syndication relation execution completed');
1357
- yield utils_1.flushLogAndExitProcess(responseCode);
1475
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1358
1476
  }
1359
1477
  catch (error) {
1360
1478
  logger_1.logger.debug('Exception in execution : %o', error);
1361
- yield utils_1.flushLogAndExitProcess(false);
1479
+ await (0, utils_1.flushLogAndExitProcess)(false);
1362
1480
  }
1363
- }));
1481
+ });
1364
1482
  program
1365
1483
  .command(`${constants_1.COMMANDS.MANAGE_DAM_STAGING} [subCommand]`)
1366
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server of the publisher', config.dxProtocol)
1367
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server of the publisher', config.hostname)
1368
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server of the publisher', config.dxPort ? config.dxPort.toString() : config.dxPort)
1369
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server of the publisher', config.dxUsername)
1370
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server of the publisher', MaskData.maskPassword(config.dxPassword))
1371
- .option('-targetServerUsername, --targetServerUsername <value>', 'Username of the DX Core server of the subscriber')
1372
- .option('-targetServerPassword, --targetServerPassword <value>', 'Password of the DX Core server of the subscriber')
1373
- .requiredOption('-damAPIPort, --damAPIPort <value>', 'Port number of the DAM API server of the publisher', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
1374
- .requiredOption('-ringAPIPort, --ringAPIPort <value>', 'Port number of the DX Core API server of the publisher', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
1375
- .requiredOption('-damAPIVersion, --damAPIVersion <value>', 'API Version number of DAM of the publisher', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
1376
- .requiredOption('-ringAPIVersion, --ringAPIVersion <value>', 'API Version number of DX Core of the publisher', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
1377
- .option('-ltpaTokenRefreshTime, --ltpaTokenRefreshTime <value>', 'LTPA Token refresh time in minutes', constants_2.LTPA_TOKEN_REFRESH_TIME)
1378
- .option('-subscriberId, --subscriberId <value>', 'Subscriber id of the target environment of the subscriber')
1379
- .option('-targetHostname, --targetHostname <value>', 'Host name of the target environment of the subscriber', config.targetHostname)
1380
- .option('-interval,--interval <value>', 'Interval between two sync cycles. The unit of interval is minute. Default value of interval is 2 minutes.')
1381
- .option('-recordType, --recordType <value>', 'Type of the mismatch record')
1382
- .option('-recordAction, --recordAction <value>', 'Action of the mismatch record')
1383
- .option('-reportPath, --reportPath <value>', 'Location of the file path to download report')
1384
- .option('-forceDownload, --forceDownload <value>', 'Force download the report', 'false')
1385
- .option('-dxWASUsername, --dxWASUsername <value>', 'Username of the DX WAS server of the publisher', '')
1386
- .option('-dxWASPassword, --dxWASPassword <value>', 'Password of the DX WAS server of the publisher', '')
1387
- .option('-targetServerWASUsername, --targetServerWASUsername <value>', 'Username of the DX WAS server of the subscriber', '')
1388
- .option('-targetServerWASPassword, --targetServerWASPassword <value>', 'Password of the DX WAS server of the subscriber', '')
1484
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server of the publisher', config.dxProtocol)
1485
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server of the publisher', config.hostname)
1486
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server of the publisher', config.dxPort ? config.dxPort.toString() : config.dxPort)
1487
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server of the publisher', config.dxUsername)
1488
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server of the publisher', MaskData.maskPassword(config.dxPassword))
1489
+ .option('--targetServerUsername <value>', 'Username of the DX Core server of the subscriber')
1490
+ .option('--targetServerPassword <value>', 'Password of the DX Core server of the subscriber')
1491
+ .requiredOption('--damAPIPort <value>', 'Port number of the DAM API server of the publisher', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
1492
+ .requiredOption('--ringAPIPort <value>', 'Port number of the DX Core API server of the publisher', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
1493
+ .requiredOption('--damAPIVersion <value>', 'API Version number of DAM of the publisher', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
1494
+ .requiredOption('--ringAPIVersion <value>', 'API Version number of DX Core of the publisher', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
1495
+ .option('--ltpaTokenRefreshTime <value>', 'LTPA Token refresh time in minutes', constants_2.LTPA_TOKEN_REFRESH_TIME)
1496
+ .option('--subscriberId <value>', 'Subscriber id of the target environment of the subscriber')
1497
+ .option('--targetHostname <value>', 'Host name of the target environment of the subscriber', config.targetHostname)
1498
+ .option('--interval <value>', 'Interval between two sync cycles. The unit of interval is minute. Default value of interval is 2 minutes.')
1499
+ .option('--recordType <value>', 'Type of the mismatch record')
1500
+ .option('--recordAction <value>', 'Action of the mismatch record')
1501
+ .option('--reportPath <value>', 'Location of the file path to download report')
1502
+ .option('--forceDownload <value>', 'Force download the report', 'false')
1503
+ .option('--dxWASUsername <value>', 'Username of the DX WAS server of the publisher', '')
1504
+ .option('--dxWASPassword <value>', 'Password of the DX WAS server of the publisher', '')
1505
+ .option('--targetServerWASUsername <value>', 'Username of the DX WAS server of the subscriber', '')
1506
+ .option('--targetServerWASPassword <value>', 'Password of the DX WAS server of the subscriber', '')
1389
1507
  .option('-h, --help')
1390
1508
  .description(`- Registration/Deregistration of the subscriber, trigger the dam staging, get all the subscriber details,
1391
1509
  get staging mismatch report, find the dam staging mismatch, start staging resync or delete staging mismatch logs`)
1392
- .action((subCommand, commands) => __awaiter(void 0, void 0, void 0, function* () {
1510
+ .action(async (subCommand, commands) => {
1393
1511
  if ((subCommand === constants_1.SUB_COMMANDS.DAM_REGISTER_SUBSCRIBER
1394
1512
  || subCommand === constants_1.SUB_COMMANDS.DAM_DEREGISTER_SUBSCRIBER
1395
1513
  || subCommand === constants_1.SUB_COMMANDS.DAM_TRIGGER_STAGING
1396
1514
  || subCommand === constants_1.SUB_COMMANDS.DAM_GET_ALL_SUBSCRIBERS
1397
1515
  || subCommand === constants_1.SUB_COMMANDS.UPDATE_SECRETS
1398
- || (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT && utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT))
1516
+ || (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT && (0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT))
1399
1517
  || subCommand === constants_1.SUB_COMMANDS.DAM_FIND_STAGING_MISMATCH
1400
1518
  || subCommand === constants_1.SUB_COMMANDS.DAM_START_STAGING_RESYNC
1401
- || subCommand === constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH) && (commands.parent.args[2] === constants_1.COMMANDS.H || commands.parent.args[2] === constants_1.COMMANDS.HELP)) {
1519
+ || subCommand === constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
1402
1520
  logger_1.logger.help('Usage: dxclient Manage DAM staging [options] [subCmd]\n');
1403
1521
  if (subCommand === constants_1.SUB_COMMANDS.DAM_REGISTER_SUBSCRIBER) {
1404
1522
  logger_1.logger.help(' Registration of the subscriber\n');
1523
+ logger_1.logger.help(' \nExample : dxclient manage-dam-staging register-dam-subscriber --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
1524
+ + ' --dxPassword wpsadmin --targetServerUsername wpsadmin --targetServerPassword wpsadmin --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1'
1525
+ + ' --targetHostname localhost --interval 2 \n');
1405
1526
  }
1406
1527
  if (subCommand === constants_1.SUB_COMMANDS.DAM_DEREGISTER_SUBSCRIBER) {
1407
1528
  logger_1.logger.help(' Deregistration of the subscriber\n');
1529
+ logger_1.logger.help(' \nExample : dxclient manage-dam-staging deregister-dam-subscriber --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
1530
+ + ' --dxPassword wpsadmin --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --subscriberId 9845465764 \n');
1408
1531
  }
1409
1532
  if (subCommand === constants_1.SUB_COMMANDS.DAM_TRIGGER_STAGING) {
1410
1533
  logger_1.logger.help(' Trigger the dam staging\n');
1534
+ logger_1.logger.help(' \nExample : dxclient manage-dam-staging trigger-staging --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
1535
+ + ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --targetHostname localhost \n');
1411
1536
  }
1412
1537
  if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_ALL_SUBSCRIBERS) {
1413
1538
  logger_1.logger.help(' Get all the subscriber details\n');
1539
+ logger_1.logger.help(' \nExample : dxclient manage-dam-staging get-all-subscribers --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
1540
+ + ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 \n');
1414
1541
  }
1415
1542
  if (subCommand === constants_1.SUB_COMMANDS.UPDATE_SECRETS) {
1416
1543
  logger_1.logger.help(' Update secrets of the publisher & subscriber\n');
1544
+ logger_1.logger.help(' \nExample : dxclient manage-dam-staging update-secrets --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
1545
+ + ' --targetServerUsername wpsadmin --targetServerPassword wpsadmin --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --targetHostname localhost \n');
1417
1546
  }
1418
1547
  if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT) {
1419
1548
  logger_1.logger.help(' Get staging mismatch records from publisher\n');
1549
+ logger_1.logger.help(' \nExample : dxclient manage-dam-staging get-staging-mismatch-report --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
1550
+ + ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 \n');
1420
1551
  }
1421
1552
  if (subCommand === constants_1.SUB_COMMANDS.DAM_FIND_STAGING_MISMATCH) {
1422
1553
  logger_1.logger.help(' Find dam staging mismatch\n');
1554
+ logger_1.logger.help(' \nExample : dxclient manage-dam-staging find-staging-mismatch --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
1555
+ + ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --subscriberId 87654678658 \n');
1423
1556
  }
1424
1557
  if (subCommand === constants_1.SUB_COMMANDS.DAM_START_STAGING_RESYNC) {
1425
1558
  logger_1.logger.help(' Start dam staging resync\n');
1559
+ logger_1.logger.help(' \nExample : dxclient manage-dam-staging start-staging-resync --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
1560
+ + ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --subscriberId 9876543256789 \n');
1426
1561
  }
1427
1562
  if (subCommand === constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH) {
1428
1563
  logger_1.logger.help(' Delete dam staging mismatch logs\n');
1564
+ logger_1.logger.help(' \nExample : dxclient manage-dam-staging delete-staging-mismatch --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
1565
+ + ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --subscriberId 9876543256789 \n');
1429
1566
  }
1430
- logger_1.logger.help(` -dxProtocol, --dxProtocol <value> Protocol of the DX Core server of the publisher (default: "${config.dxProtocol}")`);
1431
- logger_1.logger.help(` -hostname, --hostname <value> Host name of the DX Core server of the publisher (default: "${config.hostname}")`);
1432
- logger_1.logger.help(` -dxPort, --dxPort <value> Port number of the DX Core server, \
1567
+ logger_1.logger.help(` --dxProtocol <value> Protocol of the DX Core server of the publisher (default: "${config.dxProtocol}")`);
1568
+ logger_1.logger.help(` --hostname <value> Host name of the DX Core server of the publisher (default: "${config.hostname}")`);
1569
+ logger_1.logger.help(` --dxPort <value> Port number of the DX Core server, \
1433
1570
  for any Kubernetes Environment default port is 443 (default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
1434
- logger_1.logger.help(` -dxUsername, --dxUsername <value> Username of the DX Core server of the publisher (default: "${config.dxUsername}")`);
1435
- logger_1.logger.help(` -dxPassword, --dxPassword <value> Password of the DX Core server of the publisher (default: "${MaskData.maskPassword(config.dxPassword)}")`);
1436
- logger_1.logger.help(` -damAPIPort, --damAPIPort <value> Port number of the DAM API server of the publisher (default: "${config.damAPIPort
1571
+ logger_1.logger.help(` --dxUsername <value> Username of the DX Core server of the publisher (default: "${config.dxUsername}")`);
1572
+ logger_1.logger.help(` --dxPassword <value> Password of the DX Core server of the publisher (default: "${MaskData.maskPassword(config.dxPassword)}")`);
1573
+ logger_1.logger.help(` --damAPIPort <value> Port number of the DAM API server of the publisher (default: "${config.damAPIPort
1437
1574
  ? config.damAPIPort.toString() : config.damAPIPort}")`);
1438
- logger_1.logger.help(` -ringAPIPort, --ringAPIPort <value> Port number of the DX Core API server of the publisher (default: "${config.ringAPIPort
1575
+ logger_1.logger.help(` --ringAPIPort <value> Port number of the DX Core API server of the publisher (default: "${config.ringAPIPort
1439
1576
  ? config.ringAPIPort.toString() : config.ringAPIPort}")`);
1440
- logger_1.logger.help(` -damAPIVersion, --damAPIVersion <value> API Version number of DAM API server of the publisher \
1577
+ logger_1.logger.help(` --damAPIVersion <value> API Version number of DAM API server of the publisher \
1441
1578
  (default: "${config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion}")`);
1442
- logger_1.logger.help(` -ringAPIVersion, --ringAPIVersion <value> API Version number of DX Core API server of the publisher \
1579
+ logger_1.logger.help(` --ringAPIVersion <value> API Version number of DX Core API server of the publisher \
1443
1580
  (default: "${config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion}")`);
1444
1581
  if (subCommand === constants_1.SUB_COMMANDS.DAM_REGISTER_SUBSCRIBER) {
1445
- logger_1.logger.help(` -targetHostname, --targetHostname <value> Host name of the target environment of the subscriber (default: "${config.targetHostname}")`);
1582
+ logger_1.logger.help(` --targetHostname <value> Host name of the target environment of the subscriber (default: "${config.targetHostname}")`);
1446
1583
  logger_1.logger.help(' -interval,--interval <value> Interval between two sync cycles.The unit of interval is in minutes.Default value of interval is 2 minutes.');
1447
1584
  }
1448
1585
  if (subCommand === constants_1.SUB_COMMANDS.DAM_DEREGISTER_SUBSCRIBER) {
1449
1586
  logger_1.logger.help(' -subscriberId, --subscriberId <value> Subscriber id of the target environment of the subscriber');
1450
1587
  }
1451
1588
  if (subCommand === constants_1.SUB_COMMANDS.DAM_TRIGGER_STAGING) {
1452
- logger_1.logger.help(` -targetHostname, --targetHostname <value> Host name of the target environment of the subscriber (default: "${config.targetHostname}")`);
1589
+ logger_1.logger.help(` --targetHostname <value> Host name of the target environment of the subscriber (default: "${config.targetHostname}")`);
1453
1590
  }
1454
1591
  if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT) {
1455
1592
  logger_1.logger.help(` -ltpaTokenRefreshTime, --ltpaTokenRefreshTime <value> LTPA Token Refresh time in minutes (default: ${constants_2.LTPA_TOKEN_REFRESH_TIME})`);
@@ -1469,6 +1606,7 @@ for any Kubernetes Environment default port is 443 (default: "${config.dxPort ?
1469
1606
  logger_1.logger.help(' -subscriberId, --subscriberId <value> Subscriber id of the target environment of the subscriber');
1470
1607
  }
1471
1608
  if ([constants_1.SUB_COMMANDS.DAM_REGISTER_SUBSCRIBER, constants_1.SUB_COMMANDS.UPDATE_SECRETS].includes(subCommand)) {
1609
+ logger_1.logger.help(` --targetHostname <value> Host name of the target environment of the subscriber (default: "${config.targetHostname}")`);
1472
1610
  logger_1.logger.help(' -targetServerUsername, --targetServerUsername <value> Username of the DX Core server of the subscriber (default: "")');
1473
1611
  logger_1.logger.help(' -targetServerPassword, --targetServerPassword <value> Password of the DX Core server of the subscriber (default: "")');
1474
1612
  }
@@ -1492,208 +1630,212 @@ for any Kubernetes Environment default port is 443 (default: "${config.dxPort ?
1492
1630
  logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.DAM_FIND_STAGING_MISMATCH}: use "${constants_1.COMMANDS.MANAGE_DAM_STAGING} ${constants_1.SUB_COMMANDS.DAM_FIND_STAGING_MISMATCH} -h" for more details`);
1493
1631
  logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.DAM_START_STAGING_RESYNC}: use "${constants_1.COMMANDS.MANAGE_DAM_STAGING} ${constants_1.SUB_COMMANDS.DAM_START_STAGING_RESYNC} -h" for more details`);
1494
1632
  logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH}: use "${constants_1.COMMANDS.MANAGE_DAM_STAGING} ${constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH} -h" for more details`);
1495
- if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT)) {
1633
+ if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT)) {
1496
1634
  logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT}: use "${constants_1.COMMANDS.MANAGE_DAM_STAGING} ${constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT} -h" for more details`);
1497
1635
  }
1498
1636
  }
1499
1637
  else {
1500
1638
  logger_1.logger.debug('Manage DAM staging started');
1501
1639
  try {
1502
- commands_1.configureCommand(subCommand);
1503
- commands = utils_1.unmaskPasswords(commands);
1504
- validateOptions_1.validateOptions(commands);
1640
+ (0, commands_1.configureCommand)(subCommand);
1641
+ commands = (0, utils_1.unmaskPasswords)(commands);
1642
+ (0, validateOptions_1.validateOptions)(commands);
1505
1643
  }
1506
1644
  catch (error) {
1507
1645
  logger_1.logger.error(error.message);
1508
- yield utils_1.flushLogAndExitProcess(false, true);
1646
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1509
1647
  }
1510
1648
  }
1511
1649
  if (subCommand === constants_1.SUB_COMMANDS.DAM_DEREGISTER_SUBSCRIBER) {
1512
1650
  try {
1513
1651
  logger_1.logger.debug('DAM subscriber de registration started');
1514
1652
  const subscriberUnRegistration = new subscriberDeRegistration_1.SubscriberDeRegistration();
1515
- const responseCode = yield subscriberUnRegistration.invoke(commands);
1653
+ const responseCode = await subscriberUnRegistration.invoke(commands);
1516
1654
  logger_1.logger.debug('Subscriber deregister completed');
1517
- yield utils_1.flushLogAndExitProcess(responseCode);
1655
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1518
1656
  }
1519
1657
  catch (error) {
1520
1658
  logger_1.logger.error('Exception in execution deregister: %o', error);
1521
- yield utils_1.flushLogAndExitProcess(false);
1659
+ await (0, utils_1.flushLogAndExitProcess)(false);
1522
1660
  }
1523
1661
  }
1524
1662
  else if (subCommand === constants_1.SUB_COMMANDS.DAM_TRIGGER_STAGING) {
1525
1663
  try {
1526
1664
  logger_1.logger.debug('DAM staging sync triggered');
1527
1665
  const triggerManualStaging = new triggerDAMStaging_1.TriggerStaging();
1528
- const responseCode = yield triggerManualStaging.invoke(commands);
1666
+ const responseCode = await triggerManualStaging.invoke(commands);
1529
1667
  logger_1.logger.debug('DAM staging sync completed');
1530
- yield utils_1.flushLogAndExitProcess(responseCode);
1668
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1531
1669
  }
1532
1670
  catch (error) {
1533
1671
  logger_1.logger.error('Exception in execution trigger staging: %o', error);
1534
- yield utils_1.flushLogAndExitProcess(false);
1672
+ await (0, utils_1.flushLogAndExitProcess)(false);
1535
1673
  }
1536
1674
  }
1537
1675
  else if (subCommand === constants_1.SUB_COMMANDS.DAM_REGISTER_SUBSCRIBER) {
1538
1676
  try {
1539
1677
  logger_1.logger.debug('DAM subscriber registration started');
1540
1678
  const subscriberRegistration = new subscriberRegistration_1.SubscriberRegistration();
1541
- commands = utils_1.getTrimmedArguments(commands);
1542
- const responseCode = yield subscriberRegistration.invoke(commands);
1679
+ commands = (0, utils_1.getTrimmedArguments)(commands);
1680
+ const responseCode = await subscriberRegistration.invoke(commands);
1543
1681
  logger_1.logger.debug('Subscriber Registration completed');
1544
- yield utils_1.flushLogAndExitProcess(responseCode);
1682
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1545
1683
  }
1546
1684
  catch (error) {
1547
1685
  logger_1.logger.debug('Exception in execution subscriber registration: %o', error);
1548
- yield utils_1.flushLogAndExitProcess(false);
1686
+ await (0, utils_1.flushLogAndExitProcess)(false);
1549
1687
  }
1550
1688
  }
1551
1689
  else if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_ALL_SUBSCRIBERS) {
1552
1690
  try {
1553
1691
  logger_1.logger.debug('DAM get all subscribers execution started');
1554
1692
  const subscriberDetails = new subscriberDetails_1.SubscriberDetails();
1555
- const responseCode = yield subscriberDetails.invoke(commands);
1693
+ const responseCode = await subscriberDetails.invoke(commands);
1556
1694
  logger_1.logger.debug('DAM get all subscribers command execution completed');
1557
- yield utils_1.flushLogAndExitProcess(responseCode);
1695
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1558
1696
  }
1559
1697
  catch (error) {
1560
1698
  logger_1.logger.debug('Exception in execution get all subscribers command: %o', error);
1561
- yield utils_1.flushLogAndExitProcess(false);
1699
+ await (0, utils_1.flushLogAndExitProcess)(false);
1562
1700
  }
1563
1701
  }
1564
1702
  else if (subCommand === constants_1.SUB_COMMANDS.UPDATE_SECRETS) {
1565
1703
  try {
1566
1704
  logger_1.logger.debug('DAM update secrets execution started');
1567
1705
  const updateSecrets = new updateSecrets_1.UpdateSecrets();
1568
- commands = utils_1.getTrimmedArguments(commands);
1569
- const responseCode = yield updateSecrets.invoke(commands);
1706
+ commands = (0, utils_1.getTrimmedArguments)(commands);
1707
+ const responseCode = await updateSecrets.invoke(commands);
1570
1708
  logger_1.logger.debug('DAM update secrets command execution completed');
1571
- yield utils_1.flushLogAndExitProcess(responseCode);
1709
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1572
1710
  }
1573
1711
  catch (error) {
1574
1712
  logger_1.logger.debug('Exception in execution update secrets command: %o', error);
1575
- yield utils_1.flushLogAndExitProcess(false);
1713
+ await (0, utils_1.flushLogAndExitProcess)(false);
1576
1714
  }
1577
1715
  }
1578
- else if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT && utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT)) {
1716
+ else if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT && (0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT)) {
1579
1717
  try {
1580
1718
  logger_1.logger.debug('DAM Get staging mismatch report started');
1581
1719
  const stagingMismatchReport = new stagingMismatchReport_1.StagingMismatchReport();
1582
- const responseCode = yield stagingMismatchReport.invoke(commands);
1720
+ const responseCode = await stagingMismatchReport.invoke(commands);
1583
1721
  logger_1.logger.debug('DAM Get staging mismatch report command execution completed');
1584
- yield utils_1.flushLogAndExitProcess(responseCode);
1722
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1585
1723
  }
1586
1724
  catch (error) {
1587
1725
  logger_1.logger.debug('Exception in execution get staging mismatch report command: %o', error);
1588
- yield utils_1.flushLogAndExitProcess(false);
1726
+ await (0, utils_1.flushLogAndExitProcess)(false);
1589
1727
  }
1590
1728
  }
1591
1729
  else if (subCommand === constants_1.SUB_COMMANDS.DAM_FIND_STAGING_MISMATCH) {
1592
1730
  try {
1593
1731
  logger_1.logger.debug('DAM find staging mismatch started');
1594
1732
  const findStagingMismatch = new findDAMStagingMismatch_1.FindStagingMismatch();
1595
- const responseCode = yield findStagingMismatch.invoke(commands);
1596
- yield utils_1.flushLogAndExitProcess(responseCode);
1733
+ const responseCode = await findStagingMismatch.invoke(commands);
1734
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1597
1735
  }
1598
1736
  catch (error) {
1599
1737
  logger_1.logger.error('Exception in execution find staging mismatch log: %o', error);
1600
- yield utils_1.flushLogAndExitProcess(false);
1738
+ await (0, utils_1.flushLogAndExitProcess)(false);
1601
1739
  }
1602
1740
  }
1603
1741
  else if (subCommand === constants_1.SUB_COMMANDS.DAM_START_STAGING_RESYNC) {
1604
1742
  try {
1605
1743
  logger_1.logger.debug('DAM staging resync started');
1606
1744
  const startStagingResync = new stagingResync_1.StagingResync();
1607
- const responseCode = yield startStagingResync.invoke(commands);
1745
+ const responseCode = await startStagingResync.invoke(commands);
1608
1746
  logger_1.logger.debug('DAM staging resync completed');
1609
- yield utils_1.flushLogAndExitProcess(responseCode);
1747
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1610
1748
  }
1611
1749
  catch (error) {
1612
1750
  logger_1.logger.error('Exception in execution staging resync: %o', error);
1613
- yield utils_1.flushLogAndExitProcess(false);
1751
+ await (0, utils_1.flushLogAndExitProcess)(false);
1614
1752
  }
1615
1753
  }
1616
1754
  else if (subCommand === constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH) {
1617
1755
  try {
1618
1756
  logger_1.logger.debug('DAM delete staging mismatch started');
1619
1757
  const DeleteStagingMismatches = new deleteDAMStagingMismatch_1.DeleteStagingMismatch();
1620
- const responseCode = yield DeleteStagingMismatches.invoke(commands);
1758
+ const responseCode = await DeleteStagingMismatches.invoke(commands);
1621
1759
  logger_1.logger.debug('DAM delete staging mismatch completed');
1622
- yield utils_1.flushLogAndExitProcess(responseCode);
1760
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1623
1761
  }
1624
1762
  catch (error) {
1625
1763
  logger_1.logger.error('Exception in execution delete staging mismatch: %o', error);
1626
- yield utils_1.flushLogAndExitProcess(false);
1764
+ await (0, utils_1.flushLogAndExitProcess)(false);
1627
1765
  }
1628
1766
  }
1629
- }));
1767
+ });
1630
1768
  program
1631
1769
  .command(constants_1.COMMANDS.CREATE_CREDENTIAL_VAULT)
1632
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1633
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
1634
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1635
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1636
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1637
- .requiredOption('-xmlConfigPath, --xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
1638
- .requiredOption('-vaultUsername, --vaultUsername <value>', 'The name of the shared vaultUsername', config.vaultUsername)
1639
- .requiredOption('-vaultPassword , --vaultPassword <value>', 'The password for the shared userid', MaskData.maskPassword(config.vaultPassword))
1640
- .requiredOption('-credentialSlotName, --credentialSlotName <value>', 'The name of a credential vault slot')
1641
- .option('-vaultUserGroup , --vaultUserGroup <value>', 'Credential vault portal UserGroup')
1642
- .option('-vaultSegmentName, --vaultSegmentName <value>', 'The name of a new vault segment ')
1643
- .option('-vaultDescription, --vaultDescription <value>', 'Description for the credential segment ')
1770
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1771
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1772
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1773
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1774
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1775
+ .requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
1776
+ .requiredOption('--vaultUsername <value>', 'The name of the shared vaultUsername', config.vaultUsername)
1777
+ .requiredOption('--vaultPassword <value>', 'The password for the shared userid', MaskData.maskPassword(config.vaultPassword))
1778
+ .requiredOption('--credentialSlotName <value>', 'The name of a credential vault slot')
1779
+ .option('--vaultUserGroup <value>', 'Credential vault portal UserGroup')
1780
+ .option('--vaultSegmentName <value>', 'The name of a new vault segment ')
1781
+ .option('--vaultDescription <value>', 'Description for the credential segment ')
1644
1782
  .description('- Creates credential vault in DX Core server before registering a subscriber')
1645
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
1646
- commands_1.configureCommand(constants_1.COMMANDS.CREATE_CREDENTIAL_VAULT);
1783
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient create-credential-vault --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
1784
+ + ' --xmlConfigPath /wps/config --vaultUsername wpsadmin --vaultPassword wpsadmin --credentialSlotName test_solt'))
1785
+ .action(async (cmdOptions) => {
1786
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.CREATE_CREDENTIAL_VAULT);
1647
1787
  logger_1.logger.debug('Creates credential vault slot in the DX Core server before registering a subscriber');
1648
1788
  try {
1649
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
1650
- validateOptions_1.validateOptions(cmdOptions);
1789
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
1790
+ (0, validateOptions_1.validateOptions)(cmdOptions);
1651
1791
  }
1652
1792
  catch (error) {
1653
1793
  logger_1.logger.error(error.message);
1654
- yield utils_1.flushLogAndExitProcess(false, true);
1794
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1655
1795
  }
1656
1796
  try {
1657
1797
  logger_1.logger.debug('Create credential vault execution started');
1658
1798
  const createCredentialVault = new createCredentialVault_1.CreateCredentialVault();
1659
- const responseCode = yield createCredentialVault.invoke(cmdOptions);
1799
+ const responseCode = await createCredentialVault.invoke(cmdOptions);
1660
1800
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1661
1801
  logger_1.logger.debug('Create credential vault execution completed');
1662
- yield utils_1.flushLogAndExitProcess(responseCode);
1802
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1663
1803
  }
1664
1804
  catch (error) {
1665
1805
  logger_1.logger.debug('Exception in execution : %o', error);
1666
- yield utils_1.flushLogAndExitProcess(false);
1806
+ await (0, utils_1.flushLogAndExitProcess)(false);
1667
1807
  }
1668
- }));
1808
+ });
1669
1809
  program
1670
1810
  .command(`${constants_1.COMMANDS.DIFFERENTIAL_REPORT} [subCmd]`)
1671
- .option('-hostname, --hostname <value>', 'Host name of the DX core server', config.hostname)
1672
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
1673
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1674
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1675
- .requiredOption('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
1676
- .option('-targetHostname, --targetHostname <value>', 'Host name of the target DX core server', config.targetHostname)
1677
- .option('-targetDxConnectPort, --targetDxConnectPort <value>', 'Port number of the target server', config.targetDxConnectPort ? config.targetDxConnectPort.toString() : config.targetDxConnectPort)
1678
- .option('-targetDxConnectUsername, --targetDxConnectUsername <value>', 'Username for the target server', config.targetDxConnectUsername)
1679
- .option('-targetDxConnectPassword, --targetDxConnectPassword <value>', 'Password for the target server', MaskData.maskPassword(config.targetDxConnectPassword))
1680
- .option('-targetDxProfileName, --targetDxProfileName <value>', 'Profile name of the target DX core server ', config.targetDxProfileName)
1811
+ .option('--hostname <value>', 'Host name of the DX core server', config.hostname)
1812
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
1813
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1814
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1815
+ .requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
1816
+ .option('--targetHostname <value>', 'Host name of the target DX core server', config.targetHostname)
1817
+ .option('--targetDxConnectPort <value>', 'Port number of the target server', config.targetDxConnectPort ? config.targetDxConnectPort.toString() : config.targetDxConnectPort)
1818
+ .option('--targetDxConnectUsername <value>', 'Username for the target server', config.targetDxConnectUsername)
1819
+ .option('--targetDxConnectPassword <value>', 'Password for the target server', MaskData.maskPassword(config.targetDxConnectPassword))
1820
+ .option('--targetDxProfileName <value>', 'Profile name of the target DX core server ', config.targetDxProfileName)
1681
1821
  .option('-h, --help')
1682
1822
  .description('- generates dx-core-configuration-reports')
1683
- .action((subCmd, cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
1684
- if ((subCmd === constants_1.SUB_COMMANDS.SUMMARY_REPORT || constants_1.SUB_COMMANDS.RESOURCE_REPORT) && (cmdOptions.parent.args[2] === constants_1.COMMANDS.H || cmdOptions.parent.args[2] === constants_1.COMMANDS.HELP)) {
1823
+ .action(async (subCmd, cmdOptions) => {
1824
+ if ((subCmd === constants_1.SUB_COMMANDS.SUMMARY_REPORT || constants_1.SUB_COMMANDS.RESOURCE_REPORT) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
1685
1825
  logger_1.logger.help(' Usage: dxclient dx-core-configuration-reports [options] [subCmd]\n');
1686
1826
  logger_1.logger.help(' - The dx-core-configuration-reports command shows the summary of the configurations of a single DX server or both source and target DX servers, which users can use to compare.\n');
1687
- logger_1.logger.help(` -hostname, --hostname <value> Host name of the DX core server(default: "${config.hostname}")`);
1688
- logger_1.logger.help(` -dxConnectPort, --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
1689
- logger_1.logger.help(` -dxConnectUsername, --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
1690
- logger_1.logger.help(` -dxConnectPassword, --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
1827
+ logger_1.logger.help('\nExample : dxclient dx-core-configuration-reports summary-report --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
1828
+ + ' --dxProfileName wp_profile --targetHostname localhost --targetDxConnectPort 10202 --targetDxConnectUsername wpsadmin --targetDxConnectPassword wpsadmin --targetDxProfileName wp_profile \n');
1829
+ logger_1.logger.help(` --hostname <value> Host name of the DX core server(default: "${config.hostname}")`);
1830
+ logger_1.logger.help(` --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
1831
+ logger_1.logger.help(` --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
1832
+ logger_1.logger.help(` --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
1691
1833
  logger_1.logger.help(` -dxProfileName, --dxProfileName <value> Profile name in the DX core server (default: "${config.dxProfileName}")`);
1692
- logger_1.logger.help(` -targetHostname, --targetHostname <value> Host name of the target DX core server (default: "${config.targetHostname}")`);
1693
- logger_1.logger.help(` -targetDxConnectPort, --targetDxConnectPort <value> Port number of the target server (default: "${config.targetDxConnectPort}")`);
1694
- logger_1.logger.help(` -targetDxConnectUsername, --targetDxConnectUsername <value> Username for the target server (default: "${config.targetDxConnectUsername}")`);
1695
- logger_1.logger.help(` -targetDxConnectPassword, --targetDxConnectPassword <value> Password for the target server (default: "${MaskData.maskPassword(config.targetDxConnectPassword)}")`);
1696
- logger_1.logger.help(` -targetDxProfileName, --targetDxProfileName <value> Profile name of the target DX core server(default: "${config.targetDxProfileName}")`);
1834
+ logger_1.logger.help(` --targetHostname <value> Host name of the target DX core server (default: "${config.targetHostname}")`);
1835
+ logger_1.logger.help(` --targetDxConnectPort <value> Port number of the target server (default: "${config.targetDxConnectPort}")`);
1836
+ logger_1.logger.help(` --targetDxConnectUsername <value> Username for the target server (default: "${config.targetDxConnectUsername}")`);
1837
+ logger_1.logger.help(` --targetDxConnectPassword <value> Password for the target server (default: "${MaskData.maskPassword(config.targetDxConnectPassword)}")`);
1838
+ logger_1.logger.help(` --targetDxProfileName <value> Profile name of the target DX core server(default: "${config.targetDxProfileName}")`);
1697
1839
  logger_1.logger.help(' -h, --help display help for command');
1698
1840
  process.exit(1);
1699
1841
  }
@@ -1701,155 +1843,164 @@ program
1701
1843
  logger_1.logger.help(' Required (sub)command summary-report: use "dx-core-configuration-reports summary-report -h" for more details');
1702
1844
  process.exit(1);
1703
1845
  }
1704
- commands_1.configureCommand(subCmd);
1846
+ (0, commands_1.configureCommand)(subCmd);
1705
1847
  logger_1.logger.debug('Differential report execution started');
1706
1848
  try {
1707
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
1708
- validateOptions_1.validateOptionsInConfigReports(cmdOptions);
1849
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
1850
+ (0, validateOptions_1.validateOptionsInConfigReports)(cmdOptions);
1709
1851
  }
1710
1852
  catch (error) {
1711
1853
  logger_1.logger.error(error.message);
1712
- yield utils_1.flushLogAndExitProcess(false, true);
1854
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1713
1855
  }
1714
1856
  try {
1715
1857
  const differentialReport = new differentialReport_1.DifferentialReport();
1716
- const responseCode = yield differentialReport.invoke(cmdOptions);
1858
+ const responseCode = await differentialReport.invoke(cmdOptions);
1717
1859
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1718
1860
  logger_1.logger.debug('Differential report execution completed');
1719
- yield utils_1.flushLogAndExitProcess(responseCode);
1861
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1720
1862
  }
1721
1863
  catch (error) {
1722
1864
  logger_1.logger.debug('Exception in execution : %o', error);
1723
- yield utils_1.flushLogAndExitProcess(false);
1865
+ await (0, utils_1.flushLogAndExitProcess)(false);
1724
1866
  }
1725
- }))
1867
+ })
1726
1868
  .helpOption(false);
1727
1869
  program
1728
1870
  .command(constants_1.COMMANDS.WCM_LIBRARY_EXPORT)
1729
- .option('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
1730
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1731
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1732
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1733
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1734
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
1735
- .requiredOption('-dxWASUsername, --dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
1736
- .requiredOption('-dxWASPassword, --dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
1737
- .requiredOption('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
1738
- .option('-librariesName, --librariesName <value>', 'Name of the wcm library')
1739
- .option('-exportAllLibraries, --exportAllLibraries <value>', 'Enable this parameter if you export all wcm library')
1740
- .option('-virtualPortalContext,--virtualPortalContext <value>', 'Context of the virtual portal from which need to export the WCM Library', config.virtualPortalContext)
1871
+ .option('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1872
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1873
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1874
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1875
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1876
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
1877
+ .requiredOption('--dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
1878
+ .requiredOption('--dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
1879
+ .requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
1880
+ .option('--librariesName <value>', 'Name of the wcm library')
1881
+ .option('--exportAllLibraries <value>', 'Enable this parameter if you export all wcm library')
1882
+ .option('--virtualPortalContext <value>', 'Context of the virtual portal from which need to export the WCM Library', config.virtualPortalContext)
1741
1883
  .description('- Exports single, multiple or all WCM libraries from the DX Core server')
1742
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
1743
- commands_1.configureCommand(constants_1.COMMANDS.WCM_LIBRARY_EXPORT);
1884
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient wcm-library-export --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxConnectUsername wpsadmin'
1885
+ + ' --dxConnectPassword wpsadmin --dxConnectPort 10202 --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --exportAllLibraries true'))
1886
+ .action(async (cmdOptions) => {
1887
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.WCM_LIBRARY_EXPORT);
1744
1888
  logger_1.logger.debug('export of the wcm libraries execution started');
1745
1889
  try {
1746
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
1747
- validateOptions_1.validateOptions(cmdOptions);
1890
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
1891
+ (0, validateOptions_1.validateOptions)(cmdOptions);
1748
1892
  }
1749
1893
  catch (error) {
1750
1894
  logger_1.logger.error(error.message);
1751
- yield utils_1.flushLogAndExitProcess(false, true);
1895
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1752
1896
  }
1753
1897
  const exportWCMLibraryObj = new exportWCMLibrary_1.ExportWCMLibrary();
1754
1898
  try {
1755
- const responseCode = yield exportWCMLibraryObj.invoke(cmdOptions);
1899
+ const responseCode = await exportWCMLibraryObj.invoke(cmdOptions);
1756
1900
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1757
1901
  logger_1.logger.debug('export wcm libraries execution successful');
1758
- yield utils_1.flushLogAndExitProcess(responseCode);
1902
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1759
1903
  }
1760
1904
  catch (error) {
1761
1905
  logger_1.logger.debug('Exception in execution of export wcm libraries : %o', error);
1762
- yield utils_1.flushLogAndExitProcess(false);
1906
+ await (0, utils_1.flushLogAndExitProcess)(false);
1763
1907
  }
1764
- }));
1908
+ });
1765
1909
  program
1766
1910
  .command(constants_1.COMMANDS.WCM_LIBRARY_IMPORT)
1767
- .option('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
1768
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1769
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1770
- .requiredOption('-dxConnectUsername, --dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1771
- .requiredOption('-dxConnectPassword, --dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1772
- .requiredOption('-dxConnectPort, --dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
1773
- .requiredOption('-dxWASUsername, --dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
1774
- .requiredOption('-dxWASPassword, --dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
1775
- .requiredOption('-dxProfileName, --dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
1776
- .option('-libFilePath, --libFilePath <value>', 'Path to the file containing the wcm libraries to be imported')
1777
- .option('-virtualPortalContext,--virtualPortalContext <value>', 'Context of the virtual portal to which need to import the WCM Library', config.virtualPortalContext)
1911
+ .option('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1912
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1913
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1914
+ .requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
1915
+ .requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
1916
+ .requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
1917
+ .requiredOption('--dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
1918
+ .requiredOption('--dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
1919
+ .requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
1920
+ .option('--libFilePath <value>', 'Path to the file containing the wcm libraries to be imported')
1921
+ .option('--virtualPortalContext <value>', 'Context of the virtual portal to which need to import the WCM Library', config.virtualPortalContext)
1778
1922
  .description('- Imports single or multiple WCM libraries into the DX Core server')
1779
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
1780
- commands_1.configureCommand(constants_1.COMMANDS.WCM_LIBRARY_IMPORT);
1923
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient wcm-library-import --dxProtocol https --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin'
1924
+ + ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxWASUsername wpsadmin --dxProfileName wp_profile --libFilePath /user/output/store/wcmlib/test.xml'))
1925
+ .action(async (cmdOptions) => {
1926
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.WCM_LIBRARY_IMPORT);
1781
1927
  logger_1.logger.debug('import of the wcm libraries execution started');
1782
1928
  try {
1783
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
1784
- validateOptions_1.validateOptions(cmdOptions);
1929
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
1930
+ (0, validateOptions_1.validateOptions)(cmdOptions);
1785
1931
  }
1786
1932
  catch (error) {
1787
1933
  logger_1.logger.error(error.message);
1788
- yield utils_1.flushLogAndExitProcess(false, true);
1934
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1789
1935
  }
1790
1936
  const importWCMLibraryObj = new importWCMLibrary_1.ImportWCMLibrary();
1791
1937
  try {
1792
- const responseCode = yield importWCMLibraryObj.invoke(cmdOptions);
1938
+ const responseCode = await importWCMLibraryObj.invoke(cmdOptions);
1793
1939
  logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
1794
1940
  logger_1.logger.debug('import wcm libraries execution successful');
1795
- yield utils_1.flushLogAndExitProcess(responseCode);
1941
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1796
1942
  }
1797
1943
  catch (error) {
1798
1944
  logger_1.logger.debug('Exception in execution of export wcm libraries : %o', error);
1799
- yield utils_1.flushLogAndExitProcess(false);
1945
+ await (0, utils_1.flushLogAndExitProcess)(false);
1800
1946
  }
1801
- }));
1947
+ });
1802
1948
  program
1803
1949
  .command(`${constants_1.COMMANDS.MANAGE_DAM_ASSETS} [subCommand]`)
1804
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1805
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
1806
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1807
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1808
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1809
- .requiredOption('-damAPIPort, --damAPIPort <value>', 'Port number of the DAM server, for any Kubernetes Environment default port is 443', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
1810
- .requiredOption('-ringAPIPort, --ringAPIPort <value>', 'Port number of the DX Core API server, for any Kubernetes Environment default port is 443', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
1811
- .option('-exportPath, --exportPath <value>', 'Location of the file path to export')
1812
- .option('-ltpaTokenRefreshTime, --ltpaTokenRefreshTime <value>', 'LTPA Token refresh time in minutes', constants_2.LTPA_TOKEN_REFRESH_TIME)
1813
- .option('-exportBinary, --exportBinary <value>', 'Use true or false to include or exclude binary as part of export')
1814
- .option('-importBinary, --importBinary <value>', 'Use true or false to include or exclude binary as part of import')
1950
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
1951
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
1952
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1953
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
1954
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
1955
+ .requiredOption('--damAPIPort <value>', 'Port number of the DAM server, for any Kubernetes Environment default port is 443', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
1956
+ .requiredOption('--ringAPIPort <value>', 'Port number of the DX Core API server, for any Kubernetes Environment default port is 443', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
1957
+ .option('--exportPath <value>', 'Location of the file path to export')
1958
+ .option('--ltpaTokenRefreshTime <value>', 'LTPA Token refresh time in minutes', constants_2.LTPA_TOKEN_REFRESH_TIME)
1959
+ .option('--exportBinary <value>', 'Use true or false to include or exclude binary as part of export')
1960
+ .option('--importBinary <value>', 'Use true or false to include or exclude binary as part of import')
1815
1961
  .option('-h, --help')
1816
1962
  .description('- Export or Import or Validate the DAM assets')
1817
- .action((subCommand, commands) => __awaiter(void 0, void 0, void 0, function* () {
1963
+ .action(async (subCommand, commands) => {
1818
1964
  if ((subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_EXPORT || subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_IMPORT)
1819
- && (commands.parent.args[2] === constants_1.COMMANDS.H || commands.parent.args[2] === constants_1.COMMANDS.HELP)) {
1965
+ && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
1820
1966
  logger_1.logger.help('Usage: dxclient Manage DAM staging [options] [subCmd]');
1821
1967
  if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_EXPORT) {
1822
1968
  logger_1.logger.help(' -Export the DAM assets from DX.\n');
1969
+ logger_1.logger.help(' \nExample : dxclient manage-dam-assets export-assets --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
1970
+ + ' --dxPassword wpsadmin --damAPIPort 3001 --ringAPIPort 4000 --exportPath store/outputFiles/dam-export-assets/ --exportBinary true \n');
1823
1971
  }
1824
1972
  else if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_IMPORT) {
1825
1973
  logger_1.logger.help(' -Import the DAM assets from DX.\n');
1974
+ logger_1.logger.help(' \nExample : dxclient manage-dam-assets import-assets --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
1975
+ + ' --dxPassword wpsadmin --damAPIPort 3001 --ringAPIPort 4000 --exportPath store/outputFiles/dam-export-assets/ --importBinary true \n');
1826
1976
  }
1827
- logger_1.logger.help(` -dxProtocol, --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
1828
- logger_1.logger.help(` -hostname, --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
1829
- logger_1.logger.help(` -dxPort, --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default is 443 \
1977
+ logger_1.logger.help(` --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
1978
+ logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
1979
+ logger_1.logger.help(` --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default is 443 \
1830
1980
  (default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
1831
- logger_1.logger.help(` -dxUsername, --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}"`);
1832
- logger_1.logger.help(` -dxPassword, --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
1833
- logger_1.logger.help(` -damAPIPort, --damAPIPort <value> Port number of the DAM server, for any Kubernetes Environment default port is 443 \
1981
+ logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}"`);
1982
+ logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
1983
+ logger_1.logger.help(` --damAPIPort <value> Port number of the DAM server, for any Kubernetes Environment default port is 443 \
1834
1984
  (default: "${config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort}")`);
1835
- logger_1.logger.help(` -ringAPIPort, --ringAPIPort <value> Port number of the DX Core API server, for any Kubernetes Environment default is 443 \
1985
+ logger_1.logger.help(` --ringAPIPort <value> Port number of the DX Core API server, for any Kubernetes Environment default is 443 \
1836
1986
  (default: "${config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort}")`);
1837
- logger_1.logger.help(` -ltpaTokenRefreshTime, --ltpaTokenRefreshTime <value> LTPA Token Refresh time in minutes (default: ${constants_2.LTPA_TOKEN_REFRESH_TIME})`);
1987
+ logger_1.logger.help(` --ltpaTokenRefreshTime <value> LTPA Token Refresh time in minutes (default: ${constants_2.LTPA_TOKEN_REFRESH_TIME})`);
1838
1988
  if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_EXPORT) {
1839
- logger_1.logger.help(' -exportPath, --exportPath <value> Location of the file path to export(default is store/outputFiles/dam-export-assets/)');
1840
- logger_1.logger.help(' -exportBinary, --exportBinary <value> Use true or false to include or exclude binary as part of export(default is true)');
1989
+ logger_1.logger.help(' --exportPath <value> Location of the file path to export(default is store/outputFiles/dam-export-assets/)');
1990
+ logger_1.logger.help(' --exportBinary <value> Use true or false to include or exclude binary as part of export(default is true)');
1841
1991
  }
1842
1992
  else if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_IMPORT) {
1843
- logger_1.logger.help(' -exportPath, --exportPath <value> Location of the file path to import(default is store/outputFiles/dam-export-assets/)');
1844
- logger_1.logger.help(' -importBinary, --importBinary <value> Use true or false to include or exclude binary as part of import(default is true)');
1993
+ logger_1.logger.help(' --exportPath <value> Location of the file path to import(default is store/outputFiles/dam-export-assets/)');
1994
+ logger_1.logger.help(' --importBinary <value> Use true or false to include or exclude binary as part of import(default is true)');
1845
1995
  }
1846
1996
  logger_1.logger.help(' -h, --help display help for command');
1847
1997
  process.exit(1);
1848
1998
  }
1849
- else if (subCommand === constants_1.SUB_COMMANDS.DAM_EXPORT_VALIDATE && (commands.parent.args[2] === constants_1.COMMANDS.H || commands.parent.args[2] === constants_1.COMMANDS.HELP)) {
1999
+ else if (subCommand === constants_1.SUB_COMMANDS.DAM_EXPORT_VALIDATE && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
1850
2000
  logger_1.logger.help(' -Validate the exported DAM assets in your local.');
1851
- logger_1.logger.help(' -exportPath, --exportPath <value> Location of the exported file path(default is store/outputFiles/dam-export-assets/)');
1852
- logger_1.logger.help(' -importBinary, --importBinary <value> Use true or false to validate binary as part of validation(default is true)');
2001
+ logger_1.logger.help(' \nExample : dxclient manage-dam-assets validate-assets --exportPath store/outputFiles/dam-export-assets/ --importBinary true \n');
2002
+ logger_1.logger.help(' --exportPath <value> Location of the exported file path(default is store/outputFiles/dam-export-assets/)');
2003
+ logger_1.logger.help(' --importBinary <value> Use true or false to validate binary as part of validation(default is true)');
1853
2004
  logger_1.logger.help(' -h, --help display help for command');
1854
2005
  process.exit(1);
1855
2006
  }
@@ -1861,149 +2012,157 @@ program
1861
2012
  else {
1862
2013
  logger_1.logger.debug('Manage DAM assets started');
1863
2014
  try {
1864
- commands_1.configureCommand(subCommand);
1865
- commands = utils_1.unmaskPasswords(commands);
1866
- validateOptions_1.validateOptions(commands);
2015
+ (0, commands_1.configureCommand)(subCommand);
2016
+ commands = (0, utils_1.unmaskPasswords)(commands);
2017
+ (0, validateOptions_1.validateOptions)(commands);
1867
2018
  }
1868
2019
  catch (error) {
1869
2020
  logger_1.logger.error(error.message);
1870
- yield utils_1.flushLogAndExitProcess(false, true);
2021
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
1871
2022
  }
1872
2023
  }
1873
2024
  if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_EXPORT) {
1874
2025
  try {
1875
2026
  logger_1.logger.debug('DAM assets export started');
1876
2027
  const exportAssets = new exportAssets_1.ExportAssets();
1877
- const responseCode = yield exportAssets.invoke(commands);
2028
+ const responseCode = await exportAssets.invoke(commands);
1878
2029
  logger_1.logger.debug('DAM assets export completed');
1879
- yield utils_1.flushLogAndExitProcess(responseCode);
2030
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1880
2031
  }
1881
2032
  catch (error) {
1882
2033
  logger_1.logger.debug('Exception in execution of DAM assets export: %o', error);
1883
- yield utils_1.flushLogAndExitProcess(false);
2034
+ await (0, utils_1.flushLogAndExitProcess)(false);
1884
2035
  }
1885
2036
  }
1886
2037
  else if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_IMPORT) {
1887
2038
  try {
1888
2039
  logger_1.logger.debug('DAM assets validation started');
1889
2040
  const validateAssets = new validateAssets_1.ValidateAssets();
1890
- const validateResponseCode = yield validateAssets.invoke(commands);
2041
+ const validateResponseCode = await validateAssets.invoke(commands);
1891
2042
  if (!validateResponseCode) {
1892
2043
  logger_1.logger.debug('DAM assets validation failed');
1893
- yield utils_1.flushLogAndExitProcess(false);
2044
+ await (0, utils_1.flushLogAndExitProcess)(false);
1894
2045
  }
1895
2046
  logger_1.logger.debug('DAM assets validation completed');
1896
2047
  logger_1.logger.debug('DAM assets import started');
1897
2048
  const importAssets = new importAssets_1.ImportAssets();
1898
- const responseCode = yield importAssets.invoke(commands);
2049
+ const responseCode = await importAssets.invoke(commands);
1899
2050
  logger_1.logger.debug('DAM assets import completed');
1900
- yield utils_1.flushLogAndExitProcess(responseCode);
2051
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1901
2052
  }
1902
2053
  catch (error) {
1903
2054
  logger_1.logger.debug('Exception in execution of DAM assets import: %o', error);
1904
- yield utils_1.flushLogAndExitProcess(false);
2055
+ await (0, utils_1.flushLogAndExitProcess)(false);
1905
2056
  }
1906
2057
  }
1907
2058
  else if (subCommand === constants_1.SUB_COMMANDS.DAM_EXPORT_VALIDATE) {
1908
2059
  try {
1909
2060
  logger_1.logger.debug('DAM assets validation started');
1910
2061
  const validateAssets = new validateAssets_1.ValidateAssets();
1911
- const responseCode = yield validateAssets.invoke(commands);
2062
+ const responseCode = await validateAssets.invoke(commands);
1912
2063
  logger_1.logger.debug('DAM assets validation completed');
1913
- yield utils_1.flushLogAndExitProcess(responseCode);
2064
+ await (0, utils_1.flushLogAndExitProcess)(responseCode);
1914
2065
  }
1915
2066
  catch (error) {
1916
2067
  logger_1.logger.debug('Exception in execution of DAM assets validation: %o', error);
1917
- yield utils_1.flushLogAndExitProcess(false);
2068
+ await (0, utils_1.flushLogAndExitProcess)(false);
1918
2069
  }
1919
2070
  }
1920
- }));
1921
- if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
2071
+ });
2072
+ if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC)) {
1922
2073
  program
1923
2074
  .command(`${constants_1.COMMANDS.LIVESYNC} [subCommand]`)
1924
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Server', config.dxProtocol)
1925
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Server', config.hostname)
1926
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
1927
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core Server', config.dxUsername)
1928
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core Server', MaskData.maskPassword(config.dxPassword))
1929
- .requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
1930
- .option('-themeName, --themeName <value>', 'Theme System Name (or Theme Title)')
1931
- .option('-themePath, --themePath <value>', 'Local path to the Theme folder')
1932
- .option('-wcmLibraryName, --wcmLibraryName <value>', 'WCM Design Library Name', config.wcmLibraryName)
1933
- .option('-wcmLibraryId, --wcmLibraryId <value>', 'UUID of the WCM Design Library', config.wcmLibraryId)
1934
- .option('-wcmLibraryPath, --wcmLibraryPath <value>', 'Local path to the Library folder', config.wcmLibraryPath)
1935
- .option('-wcmProjectName, --wcmProjectName <value>', 'Name of the WCM Project', config.wcmProjectName)
1936
- .option('-virtualPortalContext, --virtualPortalContext <value>', 'Context of the virtual portal of the DX Core server')
1937
- .option('-disablePrompt, --disablePrompt <value>', 'Disables the confirmation prompt for overwriting local and server files.', config.disablePrompt)
2075
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Server', config.dxProtocol)
2076
+ .requiredOption('--hostname <value>', 'Host name of the DX Server', config.hostname)
2077
+ .requiredOption('--dxPort <value>', 'Port number of the DX Server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
2078
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core Server', config.dxUsername)
2079
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core Server', MaskData.maskPassword(config.dxPassword))
2080
+ .requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
2081
+ .option('--themeName <value>', 'Theme System Name (or Theme Title)')
2082
+ .option('--themePath <value>', 'Local path to the Theme folder')
2083
+ .option('--wcmLibraryName <value>', 'WCM Design Library Name', config.wcmLibraryName)
2084
+ .option('--wcmLibraryId <value>', 'UUID of the WCM Design Library', config.wcmLibraryId)
2085
+ .option('--wcmLibraryPath <value>', 'Local path to the Library folder', config.wcmLibraryPath)
2086
+ .option('--wcmProjectName <value>', 'Name of the WCM Project', config.wcmProjectName)
2087
+ .option('--virtualPortalContext <value>', 'Context of the virtual portal of the DX Core server')
2088
+ .option('--disablePrompt <value>', 'Disables the confirmation prompt for overwriting local and server files.', config.disablePrompt)
1938
2089
  .option('-h, --help')
1939
2090
  .description('- Syncs theme files in WebDAV Server and Local')
1940
2091
  .helpOption(false)
1941
- .action((subCommand, cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
2092
+ .action(async (subCommand, cmdOptions) => {
1942
2093
  if ((constants_1.LIVESYNC_THEME_SUB_CMDS.includes(subCommand))
1943
- && (cmdOptions.parent.args[2] === constants_1.COMMANDS.H || cmdOptions.parent.args[2] === constants_1.COMMANDS.HELP)) {
2094
+ && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
1944
2095
  if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME) {
1945
2096
  logger_1.logger.help(`Usage: dxclient ${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME} [options]\n`);
1946
2097
  logger_1.logger.help('- Pulls theme files from WebDAV Server into local themePath.\n');
2098
+ logger_1.logger.help(' \nExample : dxclient livesync pull-theme --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
2099
+ + ' --contenthandlerPath /wps/mycontenthandler --themePath "/Users/path/to/theme" --themeName "Portal8.5SyncTest" --disablePrompt true \n');
1947
2100
  }
1948
2101
  else if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME) {
1949
2102
  logger_1.logger.help(`Usage: dxclient ${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME} [options]\n`);
1950
2103
  logger_1.logger.help('- Pushes theme files to WebDAV Server, then continuously watches and syncs succeeding local changes into WebDav Server. "Press (Ctrl + C) to stop watching."\n');
2104
+ logger_1.logger.help(' \nExample : dxclient livesync push-theme --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
2105
+ + ' --contenthandlerPath /wps/mycontenthandler --themePath "/Users/path/to/theme" --themeName "Portal8.5SyncTest" --disablePrompt true \n');
1951
2106
  }
1952
2107
  logger_1.logger.help('Options:\n');
1953
- logger_1.logger.help(` -dxProtocol, --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
1954
- logger_1.logger.help(` -hostname, --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
1955
- logger_1.logger.help(` -dxPort, --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default is 443 \
2108
+ logger_1.logger.help(` --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
2109
+ logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
2110
+ logger_1.logger.help(` --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default is 443 \
1956
2111
  (default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
1957
- logger_1.logger.help(` -dxUsername, --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}"`);
1958
- logger_1.logger.help(` -dxPassword, --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
1959
- logger_1.logger.help(` -contenthandlerPath,--contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet \
2112
+ logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}"`);
2113
+ logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
2114
+ logger_1.logger.help(` --contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet \
1960
2115
  (default: "${config.contenthandlerPath}")`);
1961
2116
  if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME) {
1962
- logger_1.logger.help(' -themeName, --themeName <value> Theme System Name (or Theme Title)');
1963
- logger_1.logger.help(' -themePath, --themePath <value> Local path to the Theme folder');
2117
+ logger_1.logger.help(' --themeName <value> Theme System Name (or Theme Title)');
2118
+ logger_1.logger.help(' --themePath <value> Local path to the Theme folder');
1964
2119
  }
1965
2120
  else if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME) {
1966
- logger_1.logger.help(' -themeName, --themeName <value> Theme System Name (or Theme Title)');
1967
- logger_1.logger.help(' -themePath, --themePath <value> Local path to the Theme folder');
2121
+ logger_1.logger.help(' --themeName <value> Theme System Name (or Theme Title)');
2122
+ logger_1.logger.help(' --themePath <value> Local path to the Theme folder');
1968
2123
  }
1969
- logger_1.logger.help(' -disablePrompt, --disablePrompt <value> Disable the confirmation prompt for overwriting local and server files.');
2124
+ logger_1.logger.help(' --disablePrompt <value> Disable the confirmation prompt for overwriting local and server files.');
1970
2125
  logger_1.logger.help(' -h, --help Display help for command');
1971
2126
  process.exit(1);
1972
2127
  }
1973
- else if ((constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC_WCM))
1974
- && (cmdOptions.parent.args[2] === constants_1.COMMANDS.H || cmdOptions.parent.args[2] === constants_1.COMMANDS.HELP)) {
2128
+ else if ((constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && (0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC_WCM))
2129
+ && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
1975
2130
  if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY) {
1976
2131
  logger_1.logger.help(`Usage: dxclient ${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY} [options]\n`);
1977
2132
  logger_1.logger.help('- Pulls wcm design library files from dx Server into local target libraryPath directory.\n');
2133
+ logger_1.logger.help(' \nExample : dxclient livesync pull-wcm-design-library --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
2134
+ + ' --contenthandlerPath /wps/mycontenthandler --wcmLibraryName "portal site" --wcmLibraryPath "/Users/path/to/library" --disablePrompt true \n');
1978
2135
  }
1979
2136
  else if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY) {
1980
2137
  logger_1.logger.help(`Usage: dxclient ${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY} [options]\n`);
1981
2138
  logger_1.logger.help('- Pushes updated wcm design library files to dx Server, then continuously watches and syncs succeeding local changes into dx Server. "Press (Ctrl + C) to stop watching."\n');
2139
+ logger_1.logger.help(' \nExample : dxclient livesync push-wcm-design-library --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
2140
+ + ' --contenthandlerPath /wps/mycontenthandler --wcmLibraryName "portal site" --wcmLibraryPath "/Users/path/to/library" --disablePrompt true \n');
1982
2141
  }
1983
2142
  logger_1.logger.help('Options:\n');
1984
- logger_1.logger.help(` -dxProtocol, --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
1985
- logger_1.logger.help(` -hostname, --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
1986
- logger_1.logger.help(` -dxPort, --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default is 443 \
2143
+ logger_1.logger.help(` --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
2144
+ logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
2145
+ logger_1.logger.help(` --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default is 443 \
1987
2146
  (default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
1988
- logger_1.logger.help(` -dxUsername, --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}"`);
1989
- logger_1.logger.help(` -dxPassword, --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
1990
- logger_1.logger.help(` -contenthandlerPath,--contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet \
2147
+ logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}"`);
2148
+ logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
2149
+ logger_1.logger.help(` --contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet \
1991
2150
  (default: "${config.contenthandlerPath}")`);
1992
- logger_1.logger.help(' -wcmLibraryName, --wcmLibraryName <value> WCM Design Library Name');
1993
- logger_1.logger.help(' -wcmLibraryId, --wcmLibraryId <value> UUID of the WCM Design Library');
1994
- logger_1.logger.help(' -wcmLibraryPath, --wcmLibraryPath <value> Local path to the Library folder');
1995
- logger_1.logger.help(' -wcmProjectName, --wcmProjectName <value> Name of the WCM Project');
1996
- logger_1.logger.help(' -virtualPortalContext, --virtualPortalContext <value> Context of the virtual portal of the DX Core server');
1997
- logger_1.logger.help(' -disablePrompt, --disablePrompt <value> Disable the confirmation prompt for overwriting local and server files.');
2151
+ logger_1.logger.help(' --wcmLibraryName <value> WCM Design Library Name');
2152
+ logger_1.logger.help(' --wcmLibraryId <value> UUID of the WCM Design Library');
2153
+ logger_1.logger.help(' --wcmLibraryPath <value> Local path to the Library folder');
2154
+ logger_1.logger.help(' --wcmProjectName <value> Name of the WCM Project');
2155
+ logger_1.logger.help(' --virtualPortalContext <value> Context of the virtual portal of the DX Core server');
2156
+ logger_1.logger.help(' --disablePrompt <value> Disable the confirmation prompt for overwriting local and server files.');
1998
2157
  logger_1.logger.help(' -h, --help Display help for command');
1999
2158
  process.exit(1);
2000
2159
  }
2001
2160
  if (!subCommand
2002
- || (constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && !utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC_WCM))
2161
+ || (constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && !(0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC_WCM))
2003
2162
  || (!constants_1.LIVESYNC_SUB_CMDS.includes(subCommand))) {
2004
2163
  logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME}: use "${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME} -h" for more details`);
2005
2164
  logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME}: use "${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME} -h" for more details`);
2006
- if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC_WCM)) {
2165
+ if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC_WCM)) {
2007
2166
  logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY}: use "${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY} -h" for more details`);
2008
2167
  logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY}: use "${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY} -h" for more details`);
2009
2168
  }
@@ -2011,23 +2170,23 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
2011
2170
  }
2012
2171
  else {
2013
2172
  logger_1.logger.debug('LiveSync execution started');
2014
- commands_1.configureCommand(constants_1.COMMANDS.LIVESYNC);
2173
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.LIVESYNC);
2015
2174
  try {
2016
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
2017
- validateOptions_1.validateOptions(cmdOptions);
2175
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
2176
+ (0, validateOptions_1.validateOptions)(cmdOptions);
2018
2177
  }
2019
2178
  catch (error) {
2020
2179
  logger_1.logger.error(error.message);
2021
- yield utils_1.flushLogAndExitProcess(false, true);
2180
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
2022
2181
  }
2023
2182
  }
2024
2183
  if (constants_1.LIVESYNC_THEME_SUB_CMDS.includes(subCommand) && !cmdOptions.themeName) {
2025
2184
  const baseUrl = `${cmdOptions.dxProtocol}://${cmdOptions.hostname}:${cmdOptions.dxPort}`;
2026
2185
  const themePath = `${cmdOptions.contenthandlerPath}${constants_1.URL_PATH.webDavTheme}`;
2027
2186
  try {
2028
- const themeOptions = yield themeServices_1.themeServices.getAvailableThemes(baseUrl, themePath, cmdOptions.dxUsername, cmdOptions.dxPassword);
2187
+ const themeOptions = await themeServices_1.themeServices.getAvailableThemes(baseUrl, themePath, cmdOptions.dxUsername, cmdOptions.dxPassword);
2029
2188
  logger_1.logger.info('Please select a Theme name');
2030
- yield cli_select_1.default({ values: themeOptions, valueRenderer: (value, selected) => { return `[${value}]`; } }).then((response) => {
2189
+ await (0, cli_select_1.default)({ values: themeOptions, valueRenderer: (value, selected) => { return `[${value}]`; } }).then((response) => {
2031
2190
  logger_1.logger.info('Theme "%s" has been selected.', response.value);
2032
2191
  cmdOptions.themeName = response.value;
2033
2192
  }).catch(() => {
@@ -2035,27 +2194,27 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
2035
2194
  });
2036
2195
  if (!cmdOptions.themeName) {
2037
2196
  logger_1.logger.info('Unable to find a valid themeName, exiting DXCLient.');
2038
- yield utils_1.flushLogAndExitProcess(false);
2197
+ await (0, utils_1.flushLogAndExitProcess)(false);
2039
2198
  }
2040
2199
  }
2041
2200
  catch (error) {
2042
2201
  logger_1.logger.error('An error occurred during theme selection: %o', error.message ? error.message : error);
2043
- yield utils_1.flushLogAndExitProcess(false);
2202
+ await (0, utils_1.flushLogAndExitProcess)(false);
2044
2203
  }
2045
2204
  }
2046
2205
  if (constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && !(cmdOptions.wcmLibraryId || cmdOptions.wcmLibraryName)) {
2047
2206
  try {
2048
- const mappedLibraryPath = utils_1.mapToHostPath(cmdOptions.wcmLibraryPath, []);
2207
+ const mappedLibraryPath = (0, utils_1.mapToHostPath)(cmdOptions.wcmLibraryPath, []);
2049
2208
  logger_1.logger.info(`Checking for saved WCM Design Library in ${mappedLibraryPath}`);
2050
- const savedMetadata = metadataServices_1.getLibraryMetadata(cmdOptions.wcmLibraryPath);
2209
+ const savedMetadata = (0, metadataServices_1.getLibraryMetadata)(cmdOptions.wcmLibraryPath);
2051
2210
  if (savedMetadata) {
2052
2211
  if (savedMetadata.type !== 'Library') {
2053
2212
  logger_1.logger.error('DXClient exiting due to invalid metadata. Error: Metadata not for Library.');
2054
- yield utils_1.flushLogAndExitProcess(false, true);
2213
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
2055
2214
  }
2056
2215
  else if (!savedMetadata.id) {
2057
2216
  logger_1.logger.error('DXClient exiting due to invalid metadata. Error: Missing Library ID.');
2058
- yield utils_1.flushLogAndExitProcess(false, true);
2217
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
2059
2218
  }
2060
2219
  cmdOptions.wcmLibraryId = savedMetadata.id;
2061
2220
  cmdOptions.wcmLibraryName = savedMetadata.displayTitle;
@@ -2075,46 +2234,53 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
2075
2234
  virtualPortalContext: cmdOptions.virtualPortalContext,
2076
2235
  wcmProjectName: cmdOptions.wcmProjectName,
2077
2236
  };
2078
- const wcmlibraryResp = yield wcmRestV2Services_1.libraries(apiOptions);
2237
+ const wcmlibraryResp = await (0, wcmRestV2Services_1.libraries)(apiOptions);
2079
2238
  const wcmlibraryOptions = wcmlibraryResp.data['library-entries'];
2080
- yield cli_select_1.default({
2081
- values: wcmlibraryOptions,
2082
- valueRenderer: (value, selected) => {
2083
- let { displayTitle } = value;
2084
- if (!displayTitle && typeof value.title === 'string') {
2085
- displayTitle = value.title;
2086
- }
2087
- else if (typeof value.title === 'object') {
2088
- displayTitle = value.title.value;
2089
- }
2090
- else {
2091
- displayTitle = value.name;
2092
- }
2093
- return `[Library Name: ${value.name}, Display Title: ${displayTitle}, ID: ${value.id}]`;
2094
- },
2095
- }).then((response) => {
2096
- logger_1.logger.info('Library "%s" has been selected.', response.value.name || response.value.id);
2097
- cmdOptions.wcmLibraryId = response.value.id;
2098
- cmdOptions.libraryMetadata = response.value;
2099
- }).catch(() => {
2100
- logger_1.logger.info('Library selection has been cancelled.');
2101
- });
2102
- if (!cmdOptions.wcmLibraryId) {
2103
- logger_1.logger.info('Unable to find a valid WCM Design Library, exiting DXCLient.');
2104
- yield utils_1.flushLogAndExitProcess(false);
2239
+ const firstHref = wcmlibraryResp.data['library-entries'][0].links[0].href;
2240
+ if (!firstHref.includes(cmdOptions.virtualPortalContext) && cmdOptions.virtualPortalContext) {
2241
+ logger_1.logger.info(`The virtualPortalContext' '${cmdOptions.virtualPortalContext}' does not exits, please enter valide virtualPortalContext.`);
2242
+ await (0, utils_1.flushLogAndExitProcess)(false);
2243
+ }
2244
+ else {
2245
+ await (0, cli_select_1.default)({
2246
+ values: wcmlibraryOptions,
2247
+ valueRenderer: (value, selected) => {
2248
+ let { displayTitle } = value;
2249
+ if (!displayTitle && typeof value.title === 'string') {
2250
+ displayTitle = value.title;
2251
+ }
2252
+ else if (typeof value.title === 'object') {
2253
+ displayTitle = value.title.value;
2254
+ }
2255
+ else {
2256
+ displayTitle = value.name;
2257
+ }
2258
+ return `[Library Name: ${value.name}, Display Title: ${displayTitle}, ID: ${value.id}]`;
2259
+ },
2260
+ }).then((response) => {
2261
+ logger_1.logger.info('Library "%s" has been selected.', response.value.name || response.value.id);
2262
+ cmdOptions.wcmLibraryId = response.value.id;
2263
+ cmdOptions.libraryMetadata = response.value;
2264
+ }).catch(() => {
2265
+ logger_1.logger.info('Library selection has been cancelled.');
2266
+ });
2267
+ if (!cmdOptions.wcmLibraryId) {
2268
+ logger_1.logger.info('Unable to find a valid WCM Design Library, exiting DXCLient.');
2269
+ await (0, utils_1.flushLogAndExitProcess)(false);
2270
+ }
2105
2271
  }
2106
2272
  }
2107
2273
  }
2108
2274
  catch (error) {
2109
2275
  logger_1.logger.error('An error occurred during Library selection: %o', error.message ? error.message : error);
2110
- yield utils_1.flushLogAndExitProcess(false);
2276
+ await (0, utils_1.flushLogAndExitProcess)(false);
2111
2277
  }
2112
2278
  }
2113
2279
  if (cmdOptions.disablePrompt === 'false') {
2114
2280
  let isOverwritePermitted = true;
2115
2281
  if ([constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME, constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY].includes(subCommand)) {
2116
2282
  const diffSyncMsg = subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY ? ' using updated local files' : '';
2117
- const prompt = yield prompts_1.default([{
2283
+ const prompt = await (0, prompts_1.default)([{
2118
2284
  type: 'text',
2119
2285
  name: 'confirmation',
2120
2286
  message: `This command will overwrite existing files in your DX Server${diffSyncMsg}. Enter 'OVERWRITE-SERVER' to proceed:`,
@@ -2123,7 +2289,7 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
2123
2289
  isOverwritePermitted = prompt.confirmation === 'OVERWRITE-SERVER';
2124
2290
  }
2125
2291
  else if ([constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME, constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY].includes(subCommand)) {
2126
- const prompt = yield prompts_1.default([{
2292
+ const prompt = await (0, prompts_1.default)([{
2127
2293
  type: 'text',
2128
2294
  name: 'confirmation',
2129
2295
  message: 'This command will overwrite existing files in your local workspace. Enter \'OVERWRITE-LOCAL\' to proceed:',
@@ -2133,7 +2299,7 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
2133
2299
  }
2134
2300
  if (isOverwritePermitted === false) {
2135
2301
  logger_1.logger.info('LiveSync overwrite confirmation not validated, exiting DXClient.');
2136
- yield utils_1.flushLogAndExitProcess(false);
2302
+ await (0, utils_1.flushLogAndExitProcess)(false);
2137
2303
  }
2138
2304
  }
2139
2305
  const liveSyncSubCommands = [
@@ -2144,69 +2310,72 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
2144
2310
  ];
2145
2311
  logger_1.logger.info('LiveSync %s execution started.', liveSyncSubCommands.find((subCmd) => { return subCmd.key === subCommand; }).label);
2146
2312
  try {
2147
- const response = yield liveSyncSubCommands.find((subCmd) => { return subCmd.key === subCommand; }).value.invoke(cmdOptions);
2148
- yield utils_1.flushLogAndExitProcess(response);
2313
+ const response = await liveSyncSubCommands.find((subCmd) => { return subCmd.key === subCommand; }).value.invoke(cmdOptions);
2314
+ await (0, utils_1.flushLogAndExitProcess)(response);
2149
2315
  }
2150
2316
  catch (error) {
2151
2317
  logger_1.logger.debug('Exception in execution : %o', error);
2152
- yield utils_1.flushLogAndExitProcess(false);
2318
+ await (0, utils_1.flushLogAndExitProcess)(false);
2153
2319
  }
2154
- }));
2320
+ });
2155
2321
  }
2156
- if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_REINDEXING)) {
2322
+ if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.DAM_REINDEXING)) {
2157
2323
  program
2158
2324
  .command(constants_1.COMMANDS.DAM_TRIGGER_REINDEXING)
2159
2325
  .description('- Trigger Search content-source reindexing')
2160
- .requiredOption('-dxProtocol, --dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
2161
- .requiredOption('-hostname, --hostname <value>', 'Host name of the DX Core server', config.hostname)
2162
- .requiredOption('-dxPort, --dxPort <value>', 'Port number of the DX Core server', config.dxPort ? config.dxPort.toString() : config.dxPort)
2163
- .requiredOption('-dxUsername, --dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
2164
- .requiredOption('-dxPassword, --dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
2165
- .requiredOption('-damAPIPort, --damAPIPort <value>', 'Port number of the DAM API server', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
2166
- .requiredOption('-ringAPIPort, --ringAPIPort <value>', 'Port number of the DX Core API server', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
2167
- .requiredOption('-damAPIVersion, --damAPIVersion <value>', 'API Version number of DAM', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
2168
- .requiredOption('-ringAPIVersion, --ringAPIVersion <value>', 'API Version number of DX Core', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
2169
- .option('-ltpaTokenRefreshTime, --ltpaTokenRefreshTime <value>', 'LTPA Token refresh time in minutes', constants_2.LTPA_TOKEN_REFRESH_TIME)
2170
- .option('-reportPath, --reportPath <value>', 'Location of the file path to download report')
2326
+ .requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
2327
+ .requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
2328
+ .requiredOption('--dxPort <value>', 'Port number of the DX Core server', config.dxPort ? config.dxPort.toString() : config.dxPort)
2329
+ .requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
2330
+ .requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
2331
+ .requiredOption('--damAPIPort <value>', 'Port number of the DAM API server', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
2332
+ .requiredOption('--ringAPIPort <value>', 'Port number of the DX Core API server', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
2333
+ .requiredOption('--damAPIVersion <value>', 'API Version number of DAM', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
2334
+ .requiredOption('--ringAPIVersion <value>', 'API Version number of DX Core', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
2335
+ .option('--ltpaTokenRefreshTime <value>', 'LTPA Token refresh time in minutes', constants_2.LTPA_TOKEN_REFRESH_TIME)
2336
+ .option('--reportPath <value>', 'Location of the file path to download report')
2171
2337
  .option('-h, --help')
2172
- .action((cmdOptions) => __awaiter(void 0, void 0, void 0, function* () {
2173
- commands_1.configureCommand(constants_1.COMMANDS.DAM_TRIGGER_REINDEXING);
2338
+ .configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
2339
+ + ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1'))
2340
+ .action(async (cmdOptions) => {
2341
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.DAM_TRIGGER_REINDEXING);
2174
2342
  try {
2175
- cmdOptions = utils_1.unmaskPasswords(cmdOptions);
2176
- validateOptions_1.validateOptions(cmdOptions);
2343
+ cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
2344
+ (0, validateOptions_1.validateOptions)(cmdOptions);
2177
2345
  }
2178
2346
  catch (error) {
2179
2347
  logger_1.logger.error(error.message);
2180
- yield utils_1.flushLogAndExitProcess(false, true);
2348
+ await (0, utils_1.flushLogAndExitProcess)(false, true);
2181
2349
  }
2182
2350
  try {
2183
2351
  const triggerDamReindexing = new triggerDamReindexing_1.TriggerDamReindexing();
2184
- const res = yield triggerDamReindexing.invoke(cmdOptions);
2185
- yield utils_1.flushLogAndExitProcess(res);
2352
+ const res = await triggerDamReindexing.invoke(cmdOptions);
2353
+ await (0, utils_1.flushLogAndExitProcess)(res);
2186
2354
  }
2187
2355
  catch (error) {
2188
- yield utils_1.flushLogAndExitProcess(false);
2356
+ await (0, utils_1.flushLogAndExitProcess)(false);
2189
2357
  }
2190
- }));
2358
+ });
2191
2359
  }
2192
2360
  program
2193
2361
  .command(constants_1.COMMANDS.ACCEPT_LICENSE)
2194
2362
  .description('- accept-license.')
2195
- .action(() => __awaiter(void 0, void 0, void 0, function* () {
2363
+ .action(async () => {
2196
2364
  logger_1.logger.debug('accept-license.');
2197
- commands_1.configureCommand(constants_1.COMMANDS.ACCEPT_LICENSE);
2365
+ (0, commands_1.configureCommand)(constants_1.COMMANDS.ACCEPT_LICENSE);
2198
2366
  try {
2199
- yield logger_1.flushLogs(true);
2367
+ await (0, logger_1.flushLogs)(true);
2200
2368
  process.exit(0);
2201
2369
  }
2202
2370
  catch (error) {
2203
2371
  logger_1.logger.error(error.message);
2204
- yield utils_1.flushLogAndExitProcess(false);
2372
+ await (0, utils_1.flushLogAndExitProcess)(false);
2205
2373
  }
2206
- }));
2207
- (() => __awaiter(void 0, void 0, void 0, function* () { yield utils_1.checkLicense(process.argv[2]); }))().then(() => __awaiter(void 0, void 0, void 0, function* () {
2208
- program.parse(process.argv);
2209
- })).catch((error) => {
2374
+ });
2375
+ (async () => { await (0, utils_1.checkLicense)(process.argv[2]); })().then(async () => {
2376
+ const commandArgs = await (0, utils_1.convertSingleToDoubleHyphen)(process.argv);
2377
+ program.parse(commandArgs);
2378
+ }).catch((error) => {
2210
2379
  logger_1.logger.error(error.message);
2211
2380
  process.exit(1);
2212
2381
  });