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