@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,1651 @@
1
+ /* eslint-why: MasterDict can be object also can be string. */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ /*
4
+ **************************************************************************
5
+ * Licensed Materials - Property of HCL *
6
+ * *
7
+ * Copyright HCL Technologies Ltd. 2021, 2024. All Rights Reserved. *
8
+ * *
9
+ * Note to US Government Users Restricted Rights: *
10
+ * *
11
+ * Use, duplication or disclosure restricted by GSA ADP Schedule *
12
+ **************************************************************************
13
+ */
14
+ import fs from 'fs';
15
+ import path from 'path';
16
+ import moment from 'moment';
17
+ import { logger } from '../../../../src/utils/logger';
18
+ import { getFileNameWithTimeStamp, getStoreDir, message } from '../../../../src/utils/utils';
19
+ import { fileServices } from '../../../../src/services/filesServices';
20
+ import { CONSTANT_VALUES, FileType } from '../../../../src/utils/constants';
21
+
22
+ function isConfigID(cfg: string) {
23
+ let rtnVal = false;
24
+ rtnVal = cfg.indexOf('(') > -1 && cfg.indexOf('#') > -1 && cfg.indexOf('|') > -1 && cfg.indexOf(')') > -1;
25
+ return rtnVal;
26
+ }
27
+
28
+ /**
29
+ * This function is used to get the cell suffix value from the given value and index.
30
+ * @param {string} value - cell value.
31
+ * @param {string} cellSuffix - cell suffix.
32
+ * @returns {string} - updated cell suffix value after replacing it.
33
+ */
34
+ function addCellSuffix(value: string, cellSuffix: string) {
35
+ if (value.indexOf('\r') === value.length - 1) {
36
+ value = value.slice();
37
+ }
38
+ if (value.indexOf('\n') === value.length - 1) {
39
+ value = value.slice();
40
+ }
41
+ let idx = 0;
42
+ const replacementList = ['cells/', 'waspolicies/'];
43
+ if (isConfigID(value)) {
44
+ replacementList.forEach((repVal) => {
45
+ while (value.indexOf(repVal, idx) > -1) {
46
+ idx = value.indexOf(repVal, idx) + repVal.length;
47
+ const idx1 = value.indexOf('/', idx);
48
+ const idx2 = value.indexOf('|', idx);
49
+ if (idx1 > -1 && idx1 < idx2) {
50
+ idx = idx1;
51
+ } else {
52
+ idx = idx2;
53
+ }
54
+ value = `${value.slice(0, idx)}-${cellSuffix}${value.slice(idx)}`;
55
+ }
56
+ });
57
+ }
58
+ return value;
59
+ }
60
+
61
+ /**
62
+ * This function is used to get the cell suffix value from the given value and index.
63
+ * @param {string} value - cell value.
64
+ * @param {string} cellSuffix - cell suffix.
65
+ * @returns {string} - updated cell suffix value after replacing it.
66
+ */
67
+ function getConfigIDCell(configID: string) {
68
+ let rtnVal = 'getConfigIDCell_error_cell_not_found';
69
+ const idx = configID.indexOf('cells/');
70
+ if (idx > -1) {
71
+ rtnVal = configID.slice(idx + 6);
72
+ // eslint-why: it cannot be de-structured since variable already defined with predefined values and also it contains string value
73
+ // eslint-disable-next-line prefer-destructuring
74
+ if (rtnVal.indexOf('/') > -1) rtnVal = rtnVal.split('/')[0];
75
+ // eslint-why: it cannot be de-structured since variable already defined with predefined values and also it contains string value
76
+ // eslint-disable-next-line prefer-destructuring
77
+ if (rtnVal.indexOf('|') > -1) rtnVal = rtnVal.split('|')[0];
78
+ }
79
+ return rtnVal;
80
+ }
81
+
82
+ /**
83
+ * This function is used to get the cell name given data.
84
+ * @param {string[]} configDict - json data.
85
+ * @returns {string} - return the cell name.
86
+ */
87
+ function getCellNames(configDict: string[]) {
88
+ const rtnVal: string[] = [];
89
+ const keys = configDict;
90
+
91
+ Object.keys(keys).forEach((key) => {
92
+ const idx = key.indexOf('cells/');
93
+ if (idx > -1) {
94
+ const cell = getConfigIDCell(key);
95
+ if (!rtnVal.includes(cell)) rtnVal.push(cell);
96
+ }
97
+ });
98
+ logger.debug('getCellNames %s', rtnVal);
99
+ return rtnVal;
100
+ }
101
+
102
+ /**
103
+ * This function is used read the config file and generate the json payload.
104
+ * @param {string} fileName - file name.
105
+ * @returns {Object} - payload object.
106
+ */
107
+ function readConfigs(fileName: string): Object {
108
+ let idx = 0;
109
+ // eslint-why: master dictionary can be object also can be string.
110
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
111
+ const MasterDict: any = {};
112
+ const OriginalCellNameList: string[] | string = [];
113
+
114
+ if (!fileName) {
115
+ logger.debug('ERROR: No configuration files found');
116
+ return false;
117
+ }
118
+ logger.debug('FileName %s', fileName);
119
+ let fileContent = '';
120
+ try {
121
+ fileContent = fs.readFileSync(fileName.toString(), 'utf8');
122
+ } catch (error) {
123
+ logger.debug('Error in reading file %s %o', fileName, error);
124
+ return false;
125
+ }
126
+ const lines = fileContent.toString().split('\n');
127
+ let currentKey = 'NOT_INITIALIZED';
128
+ // eslint-why: currentDict can be object also can be string.
129
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
130
+ let currentDict: any;
131
+ let cellSuffix = '';
132
+ let lineNumber = 0;
133
+ let key;
134
+ let value;
135
+ try {
136
+ lines.forEach((line) => {
137
+ lineNumber += 1;
138
+ if (line.indexOf('CellSuffix') === 0) {
139
+ idx = line.indexOf('=');
140
+ cellSuffix = line.substring(idx + 1);
141
+ } else if (line.indexOf('\t') === 0) {
142
+ idx = line.indexOf('=');
143
+ key = line.slice(1, idx);
144
+ value = line.slice(idx + 1);
145
+ currentDict[key] = addCellSuffix(value, cellSuffix);
146
+ } else {
147
+ let idx1 = line.indexOf('cells/');
148
+ if (idx1 > -1) {
149
+ idx1 += String('cells/').length;
150
+ const idx2 = line.indexOf('/', idx1);
151
+ if (idx2 > -1) {
152
+ const originalCellName = line.slice(idx1, idx2);
153
+ if (!OriginalCellNameList.includes(originalCellName)) OriginalCellNameList.push(originalCellName);
154
+ }
155
+ }
156
+ if (currentKey !== 'NOT_INITIALIZED') {
157
+ MasterDict[currentKey] = currentDict;
158
+ }
159
+ currentKey = line.slice();
160
+ if (!isConfigID(currentKey) && currentKey !== '(null)' && line !== '') {
161
+ logger.info('WARNING: File %s may be corrupted at line %i. Invalid value "%s" found.', fileName, lineNumber, currentKey);
162
+ currentKey = `ERROR-${lineNumber}-${fileName}`;
163
+ }
164
+ currentKey = addCellSuffix(currentKey, cellSuffix);
165
+ currentDict = { CONFIG_ID: currentKey };
166
+ }
167
+ });
168
+ MasterDict[currentKey] = currentDict;
169
+ MasterDict.CellList = getCellNames(MasterDict);
170
+ } catch (error) {
171
+ logger.debug('error %s', error.message);
172
+ }
173
+ return MasterDict;
174
+ }
175
+
176
+ function readProperties() {
177
+ const PropDict: any = {};
178
+ let idx = 0;
179
+ let fileContent = '';
180
+ try {
181
+ const reportAttr = path.resolve(__dirname, CONSTANT_VALUES.reportPropertiesFile);
182
+ fileContent = fs.readFileSync(reportAttr, 'utf8');
183
+ } catch (error) {
184
+ logger.debug('Error in reading file %s %o', CONSTANT_VALUES.reportPropertiesFile, error);
185
+ return false;
186
+ }
187
+ const lines = fileContent.toString().split('\n');
188
+ let key = 'NOT_INITIALIZED';
189
+ let append = false;
190
+ let value;
191
+ try {
192
+ lines.forEach((line) => {
193
+ if (line.indexOf('CellSuffix') === 0) {
194
+ logger.debug('ERROR: File is a configuration dump file.');
195
+ return false;
196
+ }
197
+ line = line.trim();
198
+ if ((line.length > 0) && !(line.indexOf('#') === 0)) {
199
+ if (append) {
200
+ if (line.indexOf('\\') === line.length - 1) {
201
+ append = true;
202
+ line = line.substring(0, line.length - 1);
203
+ } else {
204
+ append = false;
205
+ }
206
+ PropDict[key] = PropDict[key].concat(line);
207
+ }
208
+ if (line.indexOf('=') > -1) {
209
+ idx = line.indexOf('=');
210
+ key = line.slice(0, idx);
211
+ value = line.slice(idx + 1);
212
+ if ((value.length > 0) && (value.indexOf('\\') === value.length - 1)) {
213
+ append = true;
214
+ value = value.substring(0, value.length - 1);
215
+ }
216
+ PropDict[key] = value;
217
+ } else if (line.length === 0) {
218
+ logger.debug('Invalid line', line);
219
+ return false;
220
+ }
221
+ }
222
+ return true;
223
+ });
224
+ } catch (error) {
225
+ logger.debug('error %s', error.message);
226
+ }
227
+ return PropDict;
228
+ }
229
+
230
+ /**
231
+ * This function is used to read the configID and returns the scope for sorting column headers.
232
+ * @param {string} configID - config ID of payload.
233
+ * @returns {string} - scope value.
234
+ */
235
+ function getScope(configID: string) {
236
+ let rtnVal = '';
237
+ const scopeStr = configID.substring(configID.indexOf('cells/'), configID.indexOf('|'));
238
+ let name = false;
239
+ scopeStr.split('/').forEach((element) => {
240
+ if (name) {
241
+ rtnVal = `${rtnVal}${element} `;
242
+ } else {
243
+ rtnVal = `${rtnVal}${element.slice()}: `;
244
+ }
245
+ name = !name;
246
+ });
247
+ return rtnVal;
248
+ }
249
+
250
+ /**
251
+ * This function is used to read the json payload and generate the summary report.
252
+ * @param {any} MasterDict - json data.
253
+ * @returns {boolean} - True in case of success and False in case of failure.
254
+ */
255
+ // eslint-why: currentDict can be object also can be string.
256
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
257
+ async function generateSummaryReport(MasterDict: any): Promise<boolean> {
258
+ logger.debug('Entering to the generateSummaryReport function');
259
+ try {
260
+ const reports = [['Application Servers', '/.*#Server_.*', 'name', 'True', ['serverType', 'APPLICATION_SERVER']],
261
+ ['Web Servers', '/.*#Server_.*', 'name', 'True', ['serverType', 'WEB_SERVER']],
262
+ ['Clusters', '/.*#ServerCluster_.*', 'name', 'False'],
263
+ ['Virtual Hosts', '.*VirtualHost_.*', 'name', 'False'],
264
+ ['Core Groups', '.*CoreGroup_.*', 'name', 'False'],
265
+ ['Data Sources', '.*DataSource_.*', 'name', 'True'],
266
+ ['JMS Providers', '.*JMSProvider_.*', 'name', 'True'],
267
+ ['J2C Resource Adapters', '.*J2CResourceAdapter_.*', 'name', 'True'],
268
+ ['SSL Configs', '.*SSLConfig_.*', 'alias', 'True'],
269
+ ['Mail Providers', '.*MailProvider_.*', 'name', 'True'],
270
+ ['URL Providers', '.*URLProvider_.*', 'name', 'True'],
271
+ ['JDBC Providers', '.*JDBCProvider_.*', 'name', 'True'],
272
+ ['Service Integration Buses', '.*SIBus_.*', 'name', 'False'],
273
+ ['Application Deployments', '.*ApplicationDeployment_.*', 'binariesURL', 'False'],
274
+ ['Servlet Cache Instances', '.*ServletCacheInstance_.*', 'name', 'True'],
275
+ ['Object Cache Instances', '.*ObjectCacheInstance_.*', 'name', 'True'],
276
+ ];
277
+ const skipString = '/(\\bdockerCell-\\S+\\b)/ig';
278
+ const reportRowHeaders: string[] = [];
279
+ const columnHeaders: string[] = MasterDict.CellList;
280
+ const reportTableData: string[][] = [];
281
+ reports.forEach((report) => {
282
+ const list: string[] = [];
283
+ reportRowHeaders.push(report[0].toString());
284
+ // loop through each cell suffix's available
285
+ columnHeaders.forEach((cell) => {
286
+ const rElements: string[] = [];
287
+ // find each ConfigID from MasterDict keys
288
+ const keys = Object.keys(MasterDict);
289
+ const configIDs: string[] = [];
290
+ keys.forEach((key) => {
291
+ // get each key validated with regex from masterDict by looping it
292
+ if (new RegExp(`.*/${cell}${report[1]}`).test(key)) {
293
+ configIDs.push(key);
294
+ }
295
+ });
296
+ configIDs.forEach((configID) => {
297
+ // check for serverType of report with MasterDict
298
+ if (report.length === 5) {
299
+ if (MasterDict[configID][report[4][0]] !== report[4][1]) {
300
+ return;
301
+ }
302
+ }
303
+ let value: string = MasterDict[configID][`${report[2]}`];
304
+ // identify the scope and split cell/node/server
305
+ const reportScope = report[3];
306
+ if (reportScope === 'True') {
307
+ // split the scopes getScope()
308
+ const scope = getScope(configID);
309
+ value = `<br>${value}<br>&nbsp;&nbsp;&nbsp;<font size="1">${scope}</font>`;
310
+ } else {
311
+ value = `<br>${value}`;
312
+ }
313
+ rElements.push(value);
314
+ });
315
+ rElements.sort();
316
+ list.push(rElements.toString());
317
+ });
318
+
319
+ reportTableData.push(list);
320
+ });
321
+
322
+ const reportingTableTitle = 'Cell Summary';
323
+ let reportingTable = '<table style="table-layout:fixed" id="differential-report" border="2" cellpadding="2" cellspacing="0" width="50px">\n'; // Table START
324
+ let tbody = `<tbody><tr align="left">\n<td colspan="3" rowspan="1" bgcolor="#999999" valign="top"><big><big><b>${reportingTableTitle}</b></big></big><br></td></tr>\n<tr>`;
325
+ tbody = `${tbody}<tr><td class="wrapped" bgcolor="#cccccc" valign="top"><b></b><b><br></b> </td>\n`;
326
+ columnHeaders.forEach((header) => {
327
+ tbody = `${tbody}<td class="wrapped" bgcolor="#cccccc" valign="top"><b>${header}</b><b><br></b> </td>\n`;
328
+ });
329
+ tbody = `${tbody}<tr>`;
330
+
331
+ // Write attribute rows
332
+ let idx = 0;
333
+ reportRowHeaders.forEach((header) => {
334
+ tbody = `${tbody}<tr><td class="wrapped" bgcolor="#cccccc" valign="top"><b>${header}</b><b><br></b> </td>\n`;
335
+ // write attribute values
336
+ reportTableData[idx].forEach((value) => {
337
+ tbody = `${tbody}<td class="wrapped" valign="top">${value}<br></td>\n`;
338
+ });
339
+ tbody = `${tbody}</tr>\n`;
340
+ idx += 1;
341
+ });
342
+
343
+ reportingTable = `${reportingTable}${tbody}</tbody></table><br>\n`; // Table END
344
+ // Generate cell summary report
345
+ const summaryReport = `
346
+ <!DOCTYPE html>
347
+ <html>\n<head>\n<meta http-equiv="content-type" content="text/html; charset=UTF-8">\n<title>Cell Summary Report</title>\n</head>\n<body>
348
+ <head><style type="text/css">
349
+ #header{
350
+ text-align: center;
351
+ font-size:25px;
352
+ }
353
+ .subHeader {text-align: left;
354
+ color:#000080;
355
+ font-size:15px;
356
+ }
357
+ table {
358
+ font-family: arial, sans-serif;
359
+ border-collapse: collapse;
360
+ width: 100%;
361
+ }
362
+ th {
363
+ border: 1px solid black;
364
+ text-align: center;
365
+ padding: 8px;
366
+ font-size: 15px;
367
+ }
368
+ td{
369
+ border:1px solid black;
370
+ text-align: left;
371
+ padding: 8px;
372
+ font-size: 14px;
373
+ word-wrap: break-word;
374
+ }
375
+ table{
376
+ border: 2px solid black;
377
+ }
378
+ text{
379
+ color:black;
380
+ font-size: 13px;
381
+ }
382
+ #syndicatorId{
383
+ background-color:#F0F8FF;
384
+ }
385
+ #rowId{
386
+ size:"1";
387
+ width:"100%" ;
388
+ color:"black";
389
+ }
390
+ #subRowId{
391
+ size:"2";
392
+ width:"100%" ;
393
+ color:"black";
394
+ }
395
+ </style>
396
+ </head>
397
+ <body>
398
+ <div><h1>Cell Summary Report ${moment().format('MM/DD/YY h:mm:ss')}</h1>
399
+ <div class="Div1">
400
+ <svg width="20" height="20">
401
+ <rect width="20" height="20" style="fill:#87CEEB;stroke-width:3;stroke:rgb(0,0,0)" />
402
+ </svg>
403
+ Configuration details mismatch.<br>
404
+ </div>
405
+ <div class="Div2">
406
+ <svg width="20" height="20">
407
+ <rect width="20" height="20" style="fill:#E9E612;stroke-width:3;stroke:rgb(0,0,0)" />
408
+ </svg>
409
+ Only one configuration is found.
410
+ </div>
411
+ <style>
412
+ .Div1{
413
+ position: absolute;
414
+ top: 28px;
415
+ right: 19px;
416
+ font-size: 15px;
417
+ }
418
+ .Div2 {
419
+ position: absolute;
420
+ top: 55px;
421
+ right: 16px;
422
+ font-size: 15px;
423
+ }
424
+ </style>
425
+ ${reportingTable}
426
+ </div>Note, if there is no output, check to ensure there were resources found to compare and ReportOnlyMismatched is either not present or set to False.
427
+ <script>
428
+ var oTable = document.getElementById('differential-report');
429
+ //gets rows of table
430
+ var rowLength = oTable.rows.length;
431
+ //loops through rows
432
+ for (i = 0; i < rowLength; i++){
433
+ //gets cells of current row
434
+ var oCells = oTable.rows.item(i).cells;
435
+ //gets amount of cells of current row
436
+ var cellLength = oCells.length;
437
+ //loops through each cell in current row
438
+ for(var j = 0; j < cellLength; j++){
439
+ // get your cell info here
440
+ if(cellLength > 1){
441
+ var cellOne = oCells.item(1).innerHTML.match(${skipString});
442
+ var cellSceond = oCells.item(2).innerHTML.match(${skipString});
443
+ if((oCells.item(1).innerHTML.replaceAll(cellOne ? cellOne[0] : cellOne, '') !== oCells.item(2).innerHTML.replaceAll(cellSceond ? cellSceond[0] : cellSceond, ''))
444
+ && oCells.item(0).innerText.length !==1 && oCells.item(1).innerText.length !== 1 && oCells.item(2).innerText.length !== 1){
445
+ oCells.item(2).bgColor ='Sky blue';
446
+ }else if ((oCells.item(1).innerText.length) !== (oCells.item(2).innerText.length) && (oCells.item(2).innerText.length) !== 1) {
447
+ oCells.item(2).bgColor ='Yellow';
448
+ }
449
+ else if ((oCells.item(1).innerText.length) !== (oCells.item(2).innerText.length) && (oCells.item(1).innerText.length) !== 1) {
450
+ oCells.item(1).bgColor ='Yellow';
451
+ }
452
+ }
453
+ }
454
+ }
455
+ </script>
456
+ </body>
457
+ </html>`;
458
+
459
+ try {
460
+ const outputFileName = getFileNameWithTimeStamp(CONSTANT_VALUES.summaryReport);
461
+ const outputFileLocation = `${path.resolve(getStoreDir(), CONSTANT_VALUES.outputFileLocation)}/${CONSTANT_VALUES.reportCFG}`;
462
+ const writeFileResponse = await fileServices.writeFile(summaryReport, outputFileLocation, `${outputFileName}.${FileType.HTML}`);
463
+ logger.info(message('EXPORT_SUMMARY_REPORT_SUCCESS', { 0: writeFileResponse }));
464
+ } catch (error) {
465
+ logger.debug('Error in writing file %o', error);
466
+ return false;
467
+ }
468
+ } catch (error) {
469
+ logger.debug('Error in generating summary report %s', error.message);
470
+ return false;
471
+ }
472
+ return true;
473
+ }
474
+
475
+ function getConfigIDNode(configID: string) {
476
+ let rtnVal = 'UnKnown';
477
+ if (configID.split('/')[3] !== undefined) {
478
+ // eslint-why: this won't be easier to read with array destructuring
479
+ // eslint-disable-next-line prefer-destructuring
480
+ rtnVal = configID.split('/')[3];
481
+ }
482
+ return rtnVal;
483
+ }
484
+
485
+ function findConfigIDs(regexStr: string, all: boolean, MasterDict: any) {
486
+ const keys = Object.keys(MasterDict);
487
+ const configIDs:any = [];
488
+ keys.forEach((key) => {
489
+ if (new RegExp(regexStr).test(key)) {
490
+ configIDs.push(key);
491
+ }
492
+ });
493
+ return configIDs;
494
+ }
495
+
496
+ function getUniqueConfigAttrValues(configType: string, attr: string, MasterDict: any) {
497
+ const configIDs = findConfigIDs(`.*\\#${configType}\\_.*`, true, MasterDict);
498
+ const values:any = [];
499
+ configIDs.forEach((configID:string) => {
500
+ values.push(MasterDict[configID][attr]);
501
+ });
502
+ values.sort();
503
+ return values;
504
+ }
505
+
506
+ function getNameAttribute(resourceType: string) {
507
+ let rtnVal = 'name';
508
+ if (resourceType === 'SSLConfig' || resourceType === 'JAASAuthData') rtnVal = 'alias';
509
+ return rtnVal;
510
+ }
511
+
512
+ async function generateResourceReport(MasterDict:any): Promise<boolean> {
513
+ logger.debug('Entering to the generateResourceReport function:');
514
+ try {
515
+ const PropertiesDict = readProperties();
516
+ const resourceReportDefinitions:any = {
517
+ DataSource: [
518
+ {
519
+ Title: 'Data Source',
520
+ ReportName: 'dataSourceRsc',
521
+ ConfigPath: [
522
+
523
+ ],
524
+ },
525
+ {
526
+ Title: 'Data Source Connection Pool',
527
+ ReportName: 'connectionPoolRsc',
528
+ ConfigPath: [
529
+ 'connectionPool',
530
+ ],
531
+ },
532
+ {
533
+ Title: 'Data Source Provider',
534
+ ReportName: 'providerReportRsc',
535
+ ConfigPath: [
536
+ 'provider',
537
+ ],
538
+ },
539
+ {
540
+ Title: 'Data Source Relational Resource Adpter',
541
+ ReportName: 'resourceAdapterRsc',
542
+ ConfigPath: [
543
+ 'relationalResourceAdapter',
544
+ ],
545
+ },
546
+ {
547
+ Title: 'Data Source Relational Resource Adpter Connector',
548
+ ReportName: 'connectorRsc',
549
+ ConfigPath: [
550
+ 'relationalResourceAdapter',
551
+ 'deploymentDescriptor',
552
+ ],
553
+ },
554
+ ],
555
+ J2CResourceAdapter: [
556
+ {
557
+ Title: 'J2C Resource Adapter',
558
+ ReportName: 'resourceAdapterRsc',
559
+ ConfigPath: [
560
+
561
+ ],
562
+ },
563
+ {
564
+ Title: 'J2C Resource Adpter Connector',
565
+ ReportName: 'connectorRsc',
566
+ ConfigPath: [
567
+ 'deploymentDescriptor',
568
+ ],
569
+ },
570
+ ],
571
+ JDBCProvider: [
572
+ {
573
+ Title: 'JDBC Provider',
574
+ ReportName: 'jdbcProviderRsc',
575
+ ConfigPath: [
576
+ '',
577
+ ],
578
+ },
579
+ ],
580
+ SIBus: [
581
+ {
582
+ Title: 'Service Integration Bus',
583
+ ReportName: 'sibRsc',
584
+ ConfigPath: [
585
+ '',
586
+ ],
587
+ },
588
+ ],
589
+ ObjectCacheInstance: [
590
+ {
591
+ Title: 'Object Cache',
592
+ ReportName: 'objectCacheRsc',
593
+ ConfigPath: [
594
+
595
+ ],
596
+ },
597
+ {
598
+ Title: 'Cache Provider',
599
+ ReportName: 'cacheProviderRsc',
600
+ ConfigPath: [
601
+ 'provider',
602
+ ],
603
+ },
604
+ ],
605
+ ServletCacheInstance: [
606
+ {
607
+ Title: 'Servlet Cache',
608
+ ReportName: 'objectCacheRsc',
609
+ ConfigPath: [
610
+
611
+ ],
612
+ },
613
+ {
614
+ Title: 'Cache Provider',
615
+ ReportName: 'cacheProviderRsc',
616
+ ConfigPath: [
617
+ 'provider',
618
+ ],
619
+ },
620
+ {
621
+ Title: 'Disk Cache custom Performance Settings',
622
+ ReportName: 'diskCacheCustomPerformanceSettingsRsc',
623
+ ConfigPath: [
624
+ 'diskCacheCustomPerformanceSettings',
625
+ ],
626
+ },
627
+ {
628
+ Title: 'Disk Cache Eviction Policy',
629
+ ReportName: 'diskCacheEvictionPolicyRsc',
630
+ ConfigPath: [
631
+ 'diskCacheEvictionPolicy',
632
+ ],
633
+ },
634
+ ],
635
+ Security: [
636
+ {
637
+ Title: 'Global Security',
638
+ ReportName: 'securityRsc',
639
+ ConfigPath: [
640
+
641
+ ],
642
+ },
643
+ {
644
+ Title: 'Cell Default Common Secure Interoperability (CSI) Inbound',
645
+ ReportName: 'csiv2Rsc',
646
+ ConfigPath: [
647
+ 'CSI',
648
+ 'claims',
649
+ ],
650
+ },
651
+ {
652
+ Title: 'Cell Default Common Secure Interoperability (CSI) Inbound ID assertion',
653
+ ReportName: 'csiv2idAssertRsc',
654
+ ConfigPath: [
655
+ 'CSI',
656
+ 'claims',
657
+ 'layers->IdentityAssertionLayer_',
658
+ ],
659
+ },
660
+ {
661
+ Title: 'Cell Default Common Secure Interoperability (CSI) Inbound ID assertion QOP',
662
+ ReportName: 'csiv2idAssertQOPRsc',
663
+ ConfigPath: [
664
+ 'CSI',
665
+ 'claims',
666
+ 'layers->IdentityAssertionLayer_',
667
+ 'supportedQOP',
668
+ ],
669
+ },
670
+ {
671
+ Title: 'Cell Default Common Secure Interoperability (CSI) Inbound Message',
672
+ ReportName: 'csiv2MessageRsc',
673
+ ConfigPath: [
674
+ 'CSI',
675
+ 'claims',
676
+ 'layers->MessageLayer_',
677
+ ],
678
+ },
679
+ {
680
+ Title: 'Cell Default Common Secure Interoperability (CSI) Inbound Message supported QOP',
681
+ ReportName: 'csiv2MessageQOPRsc',
682
+ ConfigPath: [
683
+ 'CSI',
684
+ 'claims',
685
+ 'layers->MessageLayer_',
686
+ 'supportedQOP',
687
+ ],
688
+ },
689
+ {
690
+ Title: 'Cell Default Common Secure Interoperability (CSI) Inbound Message required QOP',
691
+ ReportName: 'csiv2MessageQOPRsc',
692
+ ConfigPath: [
693
+ 'CSI',
694
+ 'claims',
695
+ 'layers->MessageLayer_',
696
+ 'requiredQOP',
697
+ ],
698
+ },
699
+ {
700
+ Title: 'Cell Default Common Secure Interoperability (CSI) Inbound Transport',
701
+ ReportName: 'csiv2TransportRsc',
702
+ ConfigPath: [
703
+ 'CSI',
704
+ 'claims',
705
+ 'layers->TransportLayer_',
706
+ ],
707
+ },
708
+ {
709
+ Title: 'Cell Default Common Secure Interoperability (CSI) Inbound Transport Server Authentication',
710
+ ReportName: 'csiv2TransportSrvSAuthRsc',
711
+ ConfigPath: [
712
+ 'CSI',
713
+ 'claims',
714
+ 'layers->TransportLayer_',
715
+ 'serverAuthentication',
716
+ ],
717
+ },
718
+ {
719
+ Title: 'Cell Default Common Secure Interoperability (CSI) Inbound Transport supported QOP',
720
+ ReportName: 'csiv2TransportQOPRsc',
721
+ ConfigPath: [
722
+ 'CSI',
723
+ 'claims',
724
+ 'layers->TransportLayer_',
725
+ 'supportedQOP',
726
+ ],
727
+ },
728
+ {
729
+ Title: 'Cell Default Common Secure Interoperability (CSI) Inbound Transport required QOP',
730
+ ReportName: 'csiv2TransportQOPRsc',
731
+ ConfigPath: [
732
+ 'CSI',
733
+ 'claims',
734
+ 'layers->TransportLayer_',
735
+ 'requiredQOP',
736
+ ],
737
+ },
738
+ {
739
+ Title: 'Cell Default Common Secure Interoperability (CSI) Outbound',
740
+ ReportName: 'csiv2Rsc',
741
+ ConfigPath: [
742
+ 'CSI',
743
+ 'performs',
744
+ ],
745
+ },
746
+ {
747
+ Title: 'Cell Default Common Secure Interoperability (CSI) Outbound ID assertion',
748
+ ReportName: 'csiv2idAssertRsc',
749
+ ConfigPath: [
750
+ 'CSI',
751
+ 'performs',
752
+ 'layers->IdentityAssertionLayer_',
753
+ ],
754
+ },
755
+ {
756
+ Title: 'Cell Default Common Secure Interoperability (CSI) Outbound ID assertion QOP',
757
+ ReportName: 'csiv2idAssertQOPRsc',
758
+ ConfigPath: [
759
+ 'CSI',
760
+ 'performs',
761
+ 'layers->IdentityAssertionLayer_',
762
+ 'supportedQOP',
763
+ ],
764
+ },
765
+ {
766
+ Title: 'Cell Default Common Secure Interoperability (CSI) Outbound Message',
767
+ ReportName: 'csiv2MessageRsc',
768
+ ConfigPath: [
769
+ 'CSI',
770
+ 'performs',
771
+ 'layers->MessageLayer_',
772
+ ],
773
+ },
774
+ {
775
+ Title: 'Cell Default Common Secure Interoperability (CSI) Outbound Message supported QOP',
776
+ ReportName: 'csiv2MessageQOPRsc',
777
+ ConfigPath: [
778
+ 'CSI',
779
+ 'performs',
780
+ 'layers->MessageLayer_',
781
+ 'supportedQOP',
782
+ ],
783
+ },
784
+ {
785
+ Title: 'Cell Default Common Secure Interoperability (CSI) Outbound Message required QOP',
786
+ ReportName: 'csiv2MessageQOPRsc',
787
+ ConfigPath: [
788
+ 'CSI',
789
+ 'performs',
790
+ 'layers->MessageLayer_',
791
+ 'requiredQOP',
792
+ ],
793
+ },
794
+ {
795
+ Title: 'Cell Default Common Secure Interoperability (CSI) Outbound Transport',
796
+ ReportName: 'csiv2TransportRsc',
797
+ ConfigPath: [
798
+ 'CSI',
799
+ 'performs',
800
+ 'layers->TransportLayer_',
801
+ ],
802
+ },
803
+ {
804
+ Title: 'Cell Default Common Secure Interoperability (CSI) Outbound Transport Server Authentication',
805
+ ReportName: 'csiv2TransportSrvSAuthRsc',
806
+ ConfigPath: [
807
+ 'CSI',
808
+ 'performs',
809
+ 'layers->TransportLayer_',
810
+ 'serverAuthentication',
811
+ ],
812
+ },
813
+ {
814
+ Title: 'Cell Default Common Secure Interoperability (CSI) Outbound Transport supported QOP',
815
+ ReportName: 'csiv2TransportQOPRsc',
816
+ ConfigPath: [
817
+ 'CSI',
818
+ 'performs',
819
+ 'layers->TransportLayer_',
820
+ 'supportedQOP',
821
+ ],
822
+ },
823
+ {
824
+ Title: 'Cell Default Common Secure Interoperability (CSI) Outbound Transport required QOP',
825
+ ReportName: 'csiv2TransportQOPRsc',
826
+ ConfigPath: [
827
+ 'CSI',
828
+ 'performs',
829
+ 'layers->TransportLayer_',
830
+ 'requiredQOP',
831
+ ],
832
+ },
833
+ {
834
+ Title: 'Certificate Expiration Monitor',
835
+ ReportName: 'certExpMonitorRsc',
836
+ ConfigPath: [
837
+ 'wsCertificateExpirationMonitor',
838
+ ],
839
+ },
840
+ {
841
+ Title: 'Certificate Expiration Monitor Notification',
842
+ ReportName: 'notificationRsc',
843
+ ConfigPath: [
844
+ 'wsCertificateExpirationMonitor',
845
+ 'wsNotification',
846
+ ],
847
+ },
848
+ {
849
+ Title: 'Certificate Expiration Monitor Scedule',
850
+ ReportName: 'scheduleRsc',
851
+ ConfigPath: [
852
+ 'wsCertificateExpirationMonitor',
853
+ 'wsSchedule',
854
+ ],
855
+ },
856
+ ],
857
+ SSLConfig: [
858
+ {
859
+ Title: 'SSL settings',
860
+ ReportName: 'sslConfig1Rsc',
861
+ ConfigPath: [
862
+ 'setting',
863
+ ],
864
+ },
865
+ {
866
+ Title: 'Ciphers',
867
+ ReportName: 'ciphers',
868
+ ConfigPath: [
869
+ 'setting',
870
+ 'trustStore',
871
+ ],
872
+ ReportFunc: 'ciphersReport',
873
+ },
874
+ {
875
+ Title: 'Trust Store',
876
+ ReportName: 'keyStoreRsc',
877
+ ConfigPath: [
878
+ 'setting',
879
+ 'trustStore',
880
+ ],
881
+ },
882
+ {
883
+ Title: 'Key Store',
884
+ ReportName: 'keyStoreRsc',
885
+ ConfigPath: [
886
+ 'setting',
887
+ 'keyStore',
888
+ ],
889
+ },
890
+ {
891
+ Title: 'Trust Manager',
892
+ ReportName: 'trustManagerRsc',
893
+ ConfigPath: [
894
+ 'setting',
895
+ 'trustManager',
896
+ ],
897
+ },
898
+ {
899
+ Title: 'Key Manager',
900
+ ReportName: 'keyManagerRsc',
901
+ ConfigPath: [
902
+ 'setting',
903
+ 'keyManager',
904
+ ],
905
+ },
906
+ ],
907
+ ResourceEnvironmentProvider: [
908
+ {
909
+ Title: 'Resource Environment Provider',
910
+ ReportName: 'rscEnvProviderRsc',
911
+ ConfigPath: [
912
+ '',
913
+ ],
914
+ },
915
+ ],
916
+ ResourceEnvEntry: [
917
+ {
918
+ Title: 'Resource Environment Entry',
919
+ ReportName: 'rscEnvEntryRsc',
920
+ ConfigPath: [
921
+
922
+ ],
923
+ },
924
+ {
925
+ Title: 'Referencable',
926
+ ReportName: 'referencableRsc',
927
+ ConfigPath: [
928
+ 'referenceable',
929
+ ],
930
+ },
931
+ {
932
+ Title: 'Resource Environment Provider',
933
+ ReportName: 'rscEnvProviderRsc',
934
+ ConfigPath: [
935
+ 'provider',
936
+ ],
937
+ },
938
+ ],
939
+ Application: [
940
+ {
941
+ Title: 'Application Deployment',
942
+ ReportName: 'applicationDeployment',
943
+ ConfigPath: [
944
+
945
+ ],
946
+ },
947
+ {
948
+ Title: 'Application Deployment Classloader',
949
+ ReportName: 'applicationClassloader',
950
+ ConfigPath: [
951
+ 'classloader',
952
+ ],
953
+ },
954
+ ],
955
+ ApplicationModules: [
956
+ {
957
+ Title: 'Application Module',
958
+ ReportName: 'applicationDeployment',
959
+ ConfigPath: [
960
+ 'modules',
961
+ ],
962
+ },
963
+ ],
964
+ JMSProvider: [
965
+ {
966
+ Title: 'JMS Provider',
967
+ ReportName: 'jmsProviderRsc',
968
+ ConfigPath: [
969
+ '',
970
+ ],
971
+ },
972
+ ],
973
+ GenericJMSConnectionFactory: [
974
+ {
975
+ Title: 'JMS Connection Factory',
976
+ ReportName: 'genericJMSConnectionFactoryRsc',
977
+ ConfigPath: [
978
+ '',
979
+ ],
980
+ },
981
+ {
982
+ Title: 'Session Pool',
983
+ ReportName: 'connectionPoolRsc',
984
+ ConfigPath: [
985
+ 'sessionPool',
986
+ ],
987
+ },
988
+ {
989
+ Title: 'JMS Provider',
990
+ ReportName: 'jmsProviderRsc',
991
+ ConfigPath: [
992
+ 'provider',
993
+ ],
994
+ },
995
+ {
996
+ Title: 'Connection Pool',
997
+ ReportName: 'connectionPoolRsc',
998
+ ConfigPath: [
999
+ 'connectionPool',
1000
+ ],
1001
+ },
1002
+ {
1003
+ Title: 'JAAS Mapping',
1004
+ ReportName: 'mappingModuleRsc',
1005
+ ConfigPath: [
1006
+ 'mapping',
1007
+ ],
1008
+ },
1009
+ {
1010
+ Title: 'J2C Authentication Alias',
1011
+ ReportName: 'jaasAuthDataRsc',
1012
+ ConfigPath: [
1013
+ 'mapping',
1014
+ ],
1015
+ ReportFunc: 'j2cAuthReport',
1016
+ },
1017
+ ],
1018
+ GenericJMSDestination: [
1019
+ {
1020
+ Title: 'JMS Destination',
1021
+ ReportName: 'genericJMSDestinationRsc',
1022
+ ConfigPath: [
1023
+
1024
+ ],
1025
+ },
1026
+ {
1027
+ Title: 'JMS Provider',
1028
+ ReportName: 'jmsProviderRsc',
1029
+ ConfigPath: [
1030
+ 'provider',
1031
+ ],
1032
+ },
1033
+ ],
1034
+ J2CActivationSpec: [
1035
+ {
1036
+ Title: 'J2C Activation Specification',
1037
+ ReportName: 'j2cActivationSpecRsc',
1038
+ ConfigPath: [
1039
+
1040
+ ],
1041
+ },
1042
+ {
1043
+ Title: 'Activation Specification',
1044
+ ReportName: 'activationSpecRsc',
1045
+ ConfigPath: [
1046
+ 'activationSpec',
1047
+ ],
1048
+ },
1049
+ ],
1050
+ JAASAuthData: [
1051
+ {
1052
+ Title: 'JAAS Alias',
1053
+ ReportName: 'jaasAuthDataRsc',
1054
+ ConfigPath: [
1055
+ '',
1056
+ ],
1057
+ },
1058
+ ],
1059
+ URLProvider: [
1060
+ {
1061
+ Title: 'URL Provider',
1062
+ ReportName: 'urlProviderRsc',
1063
+ ConfigPath: [
1064
+ '',
1065
+ ],
1066
+ },
1067
+ ],
1068
+ URL: [
1069
+ {
1070
+ Title: 'URL',
1071
+ ReportName: 'urlRsc',
1072
+ ConfigPath: [
1073
+
1074
+ ],
1075
+ },
1076
+ {
1077
+ Title: 'URL Provider',
1078
+ ReportName: 'urlProviderRsc',
1079
+ ConfigPath: [
1080
+ 'provider',
1081
+ ],
1082
+ },
1083
+ ],
1084
+ J2CConnectionFactory: [
1085
+ {
1086
+ Title: 'J2C Connection Factory',
1087
+ ReportName: 'j2cConnectionFactoryRsc',
1088
+ ConfigPath: [
1089
+
1090
+ ],
1091
+ },
1092
+ {
1093
+ Title: 'J2C CF Connection Pool',
1094
+ ReportName: 'connectionPoolRsc',
1095
+ ConfigPath: [
1096
+ 'connectionPool',
1097
+ ],
1098
+ },
1099
+ {
1100
+ Title: 'J2C Resource Adapter',
1101
+ ReportName: 'resourceAdapterRsc',
1102
+ ConfigPath: [
1103
+ 'provider',
1104
+ ],
1105
+ },
1106
+ {
1107
+ Title: 'J2C CF Connection Definition',
1108
+ ReportName: 'j2cConnectionFactoryConDefRsc',
1109
+ ConfigPath: [
1110
+ 'connectionDefinition',
1111
+ ],
1112
+ },
1113
+ ],
1114
+ J2CAdminObject: [
1115
+ {
1116
+ Title: 'J2C Admin Object',
1117
+ ReportName: 'j2cAdminObjectRsc',
1118
+ ConfigPath: [
1119
+
1120
+ ],
1121
+ },
1122
+ {
1123
+ Title: 'Admin Object',
1124
+ ReportName: 'adminObjectRsc',
1125
+ ConfigPath: [
1126
+ 'adminObject',
1127
+ ],
1128
+ },
1129
+ ],
1130
+ MQConnectionFactory: [
1131
+ {
1132
+ Title: 'MQ Connection Factory',
1133
+ ReportName: 'mqConnectionFactoryRsc',
1134
+ ConfigPath: [
1135
+
1136
+ ],
1137
+ },
1138
+ {
1139
+ Title: 'MQ Connection Pool',
1140
+ ReportName: 'connectionPoolRsc',
1141
+ ConfigPath: [
1142
+ 'connectionPool',
1143
+ ],
1144
+ },
1145
+ {
1146
+ Title: 'MQ Session Pool',
1147
+ ReportName: 'connectionPoolRsc',
1148
+ ConfigPath: [
1149
+ 'sessionPool',
1150
+ ],
1151
+ },
1152
+ {
1153
+ Title: 'JAAS Mapping',
1154
+ ReportName: 'mappingModuleRsc',
1155
+ ConfigPath: [
1156
+ 'mapping',
1157
+ ],
1158
+ },
1159
+ {
1160
+ Title: 'MQ Provider',
1161
+ ReportName: 'jmsProviderRsc',
1162
+ ConfigPath: [
1163
+ 'provider',
1164
+ ],
1165
+ },
1166
+ ],
1167
+ MQQueueConnectionFactory: [
1168
+ {
1169
+ Title: 'MQ Queue Connection Factory',
1170
+ ReportName: 'mqQueueConnectionFactoryRsc',
1171
+ ConfigPath: [
1172
+
1173
+ ],
1174
+ },
1175
+ {
1176
+ Title: 'MQ Connection Pool',
1177
+ ReportName: 'connectionPoolRsc',
1178
+ ConfigPath: [
1179
+ 'connectionPool',
1180
+ ],
1181
+ },
1182
+ {
1183
+ Title: 'MQ Session Pool',
1184
+ ReportName: 'connectionPoolRsc',
1185
+ ConfigPath: [
1186
+ 'sessionPool',
1187
+ ],
1188
+ },
1189
+ {
1190
+ Title: 'JAAS Mapping',
1191
+ ReportName: 'mappingModuleRsc',
1192
+ ConfigPath: [
1193
+ 'mapping',
1194
+ ],
1195
+ },
1196
+ {
1197
+ Title: 'MQ Provider',
1198
+ ReportName: 'jmsProviderRsc',
1199
+ ConfigPath: [
1200
+ 'provider',
1201
+ ],
1202
+ },
1203
+ ],
1204
+ MQTopicConnectionFactory: [
1205
+ {
1206
+ Title: 'MQ Topic Connection Factory',
1207
+ ReportName: 'mqTopicConnectionFactoryRsc',
1208
+ ConfigPath: [
1209
+
1210
+ ],
1211
+ },
1212
+ {
1213
+ Title: 'MQ Connection Pool',
1214
+ ReportName: 'connectionPoolRsc',
1215
+ ConfigPath: [
1216
+ 'connectionPool',
1217
+ ],
1218
+ },
1219
+ {
1220
+ Title: 'MQ Session Pool',
1221
+ ReportName: 'connectionPoolRsc',
1222
+ ConfigPath: [
1223
+ 'sessionPool',
1224
+ ],
1225
+ },
1226
+ {
1227
+ Title: 'JAAS Mapping',
1228
+ ReportName: 'mappingModuleRsc',
1229
+ ConfigPath: [
1230
+ 'mapping',
1231
+ ],
1232
+ },
1233
+ {
1234
+ Title: 'MQ Provider',
1235
+ ReportName: 'jmsProviderRsc',
1236
+ ConfigPath: [
1237
+ 'provider',
1238
+ ],
1239
+ },
1240
+ ],
1241
+ MQQueue: [
1242
+ {
1243
+ Title: 'MQ Queue ',
1244
+ ReportName: 'mqQueueRsc',
1245
+ ConfigPath: [
1246
+
1247
+ ],
1248
+ },
1249
+ {
1250
+ Title: 'MQ Provider',
1251
+ ReportName: 'jmsProviderRsc',
1252
+ ConfigPath: [
1253
+ 'provider',
1254
+ ],
1255
+ },
1256
+ ],
1257
+ MQTopic: [
1258
+ {
1259
+ Title: 'MQ Topic ',
1260
+ ReportName: 'mqTopicRsc',
1261
+ ConfigPath: [
1262
+
1263
+ ],
1264
+ },
1265
+ {
1266
+ Title: 'MQ Provider',
1267
+ ReportName: 'jmsProviderRsc',
1268
+ ConfigPath: [
1269
+ 'provider',
1270
+ ],
1271
+ },
1272
+ ],
1273
+ };
1274
+ // only resource attributes present in reportAttributes.properties are considered here.
1275
+ // eslint-why: resources types definations
1276
+ // eslint-disable-next-line max-len
1277
+ const resourceTypes = ['DataSource', 'JDBCProvider', 'ObjectCacheInstance', 'ServletCacheInstance', 'SIBus', 'ResourceEnvEntry', 'JMSProvider', 'GenericJMSConnectionFactory', 'GenericJMSDestination', 'J2CActivationSpec', 'URLProvider', 'URL', 'J2CConnectionFactory', 'J2CAdminObject', 'MQConnectionFactory', 'MQQueueConnectionFactory', 'MQTopicConnectionFactory', 'MQQueue', 'MQTopic'];
1278
+ let reportingTable = '';
1279
+ resourceTypes.forEach((resourceType) => {
1280
+ let names = [];
1281
+ names = getUniqueConfigAttrValues(resourceType, getNameAttribute(resourceType), MasterDict);
1282
+ names.forEach((name: any) => {
1283
+ let rptParms:any = {};
1284
+ const rptTables:any = [];
1285
+ const nameAttr = getNameAttribute(resourceType);
1286
+ const configIDs = findConfigIDs(`.*\\#${resourceType}\\_.*`, true, MasterDict);
1287
+ const resources:any = [];
1288
+ const list:any = [];
1289
+ configIDs.forEach((configID:string) => {
1290
+ if (MasterDict[configID][nameAttr] === name) {
1291
+ resources.push(configID);
1292
+ }
1293
+ });
1294
+ resources.forEach((resource:string) => {
1295
+ if (MasterDict[resource][nameAttr] === name) {
1296
+ list.push(resource);
1297
+ }
1298
+ });
1299
+ rptParms = { ServerList: list };
1300
+ resourceReportDefinitions[resourceType].forEach((resourceReport:any) => {
1301
+ const rscRptTitle = `${resourceReport.Title}(${name})`;
1302
+ Object.assign(rptParms, { Title: rscRptTitle, ConfigPath: resourceReport.ConfigPath, ReportName: resourceReport.ReportName });
1303
+ if (PropertiesDict[`${resourceReport.ReportName}:attributes`] !== undefined) {
1304
+ Object.assign(rptParms, { Attributes: PropertiesDict[`${resourceReport.ReportName}:attributes`].split(',') });
1305
+ }
1306
+ const columnHeaders: any = [];
1307
+ const initialConfigIDs:any = [];
1308
+ const tableData:any = [];
1309
+ const rowHeaders:any = [];
1310
+ rptParms.ServerList.forEach((server:any) => {
1311
+ if (rptParms.ColumnHeaderFunc === undefined) {
1312
+ columnHeaders.push((MasterDict[server].name).concat(' (', getConfigIDNode(server), ', ', getConfigIDCell(server), ')'));
1313
+ }
1314
+ });
1315
+ // Attributes Integration
1316
+ rptParms.Attributes.forEach((attribute:any) => {
1317
+ const attributeValues:any = [];
1318
+ rptParms.ServerList.forEach((server:any) => {
1319
+ let config: any = {};
1320
+ try {
1321
+ const pathElements:any = [];
1322
+ pathElements.push(server);
1323
+ if ((rptParms.ConfigPath).length > 0) {
1324
+ rptParms.ConfigPath.forEach((ConfigPath:any) => {
1325
+ pathElements.push(ConfigPath);
1326
+ });
1327
+ }
1328
+ pathElements.forEach((pathElement:any) => {
1329
+ if (isConfigID(pathElement)) {
1330
+ if (MasterDict[pathElement] !== undefined) {
1331
+ config = MasterDict[pathElement];
1332
+ }
1333
+ } else if (MasterDict[config[pathElement]] !== undefined) {
1334
+ config = MasterDict[config[pathElement]];
1335
+ }
1336
+ });
1337
+ if (config !== undefined) {
1338
+ // eslint-why no-prototype-builtins
1339
+ // eslint-disable-next-line no-prototype-builtins
1340
+ if (initialConfigIDs.hasOwnProperty(config.CONFIG_ID)) {
1341
+ initialConfigIDs.push(config.CONFIG_ID);
1342
+ }
1343
+ }
1344
+ } catch (error) {
1345
+ logger.debug('error %s', error.message);
1346
+ }
1347
+ const keys = Object.keys(config);
1348
+ if (keys.length === 0) {
1349
+ attributeValues.push('configuration not defined');
1350
+ } else {
1351
+ keys.forEach((key) => {
1352
+ if (attribute === key) {
1353
+ attributeValues.push(config[attribute]);
1354
+ }
1355
+ });
1356
+ }
1357
+ });
1358
+ let attrSet = 'false';
1359
+ const BreakException = {};
1360
+ try {
1361
+ if (attributeValues.length !== 0) {
1362
+ attributeValues.forEach((attValue:any) => {
1363
+ if (attValue.indexOf(' not ') === -1) {
1364
+ attrSet = 'true';
1365
+ throw BreakException;
1366
+ }
1367
+ });
1368
+ }
1369
+ } catch (e) {
1370
+ if (e !== BreakException) throw e;
1371
+ }
1372
+ if (attrSet === 'true') {
1373
+ rowHeaders.push(attribute);
1374
+ tableData.push(attributeValues);
1375
+ }
1376
+ });
1377
+ const attributeDict = {
1378
+ RowHeaders: rowHeaders, TableData: tableData, Title: rptParms.Title, FirstColumnHeader: 'Attribute', ConfigIDs: initialConfigIDs, Type: 'Attributes',
1379
+ };
1380
+ Object.assign(rptParms, { ColumnHeaders: columnHeaders });
1381
+
1382
+ rptTables.push(attributeDict);
1383
+ Object.assign(rptParms, { Tables: rptTables });
1384
+ const PropertyAttributes = [{ PropName: 'properties', PropPath: [] },
1385
+ { PropName: 'customProperties', PropPath: [] },
1386
+ { PropName: 'systemProperties', PropPath: [] },
1387
+ { PropName: 'environment', PropPath: [] },
1388
+ { PropName: 'properties', PropPath: ['adminObjectTemplateProps'] },
1389
+ { PropName: 'additionalTrustManagerAttrs', PropPath: [] },
1390
+ { PropName: 'webAuthAttrs', PropPath: [] },
1391
+ { PropName: 'trustProperties', PropPath: [] }, { PropName: 'resourceProperties', PropPath: ['connectionDefTemplateProps', 'resourceProperties'] },
1392
+ { PropName: 'resourceProperties', PropPath: ['propertySet'] },
1393
+ { PropName: 'resourceProperties', PropPath: ['activationSpecTemplateProps'] },
1394
+ ];
1395
+ const clusterDict:any = {};
1396
+ const initialconfigIDs:any = [];
1397
+ PropertyAttributes.forEach((propAttr) => {
1398
+ const propNames:any = [];
1399
+ rptParms.ServerList.forEach((server:any) => {
1400
+ const serverDict = {};
1401
+ let config: any = {};
1402
+ try {
1403
+ const pathElements:any = [];
1404
+ pathElements.push(server);
1405
+ if ((rptParms.ConfigPath).length > 0) {
1406
+ rptParms.ConfigPath.forEach((ConfigPath:any) => {
1407
+ pathElements.push(ConfigPath);
1408
+ });
1409
+ }
1410
+ if ((propAttr.PropPath).length > 0) {
1411
+ propAttr.PropPath.forEach((PropPath:any) => {
1412
+ pathElements.push(PropPath);
1413
+ });
1414
+ }
1415
+ pathElements.forEach((pathElement:any) => {
1416
+ if (isConfigID(pathElement)) {
1417
+ if (MasterDict[pathElement] !== undefined) {
1418
+ config = MasterDict[pathElement];
1419
+ }
1420
+ } else if (MasterDict[config[pathElement]] !== undefined) {
1421
+ config = MasterDict[config[pathElement]];
1422
+ }
1423
+ });
1424
+ } catch (error) {
1425
+ logger.debug('error %s', error.message);
1426
+ }
1427
+ let props = config[propAttr.PropName];
1428
+ if (props !== undefined && props.length > 0) {
1429
+ if (isConfigID(props)) {
1430
+ props = props.slice(1, -1).split(' ');
1431
+ props.forEach((prop:any) => {
1432
+ let found = false;
1433
+ propNames.forEach((propname:any) => {
1434
+ if (propname === MasterDict[prop].name) {
1435
+ found = true;
1436
+ }
1437
+ });
1438
+ let value = '';
1439
+ if (!found) {
1440
+ propNames.push(MasterDict[prop].name);
1441
+ }
1442
+ if (MasterDict[prop].value !== undefined) {
1443
+ value = MasterDict[prop].value;
1444
+ } else {
1445
+ value = 'present but null';
1446
+ }
1447
+ Object.assign(serverDict, { [MasterDict[prop].name]: value });
1448
+ if (MasterDict[prop].CONFIG_ID !== undefined) {
1449
+ initialconfigIDs.push(MasterDict[prop].CONFIG_ID);
1450
+ }
1451
+ });
1452
+ }
1453
+ Object.assign(clusterDict, { [server]: serverDict });
1454
+ }
1455
+ });
1456
+ // propNames
1457
+ if (propNames.length > 0) {
1458
+ propNames.sort();
1459
+ const propertyTableData:any = [];
1460
+
1461
+ propNames.forEach((propName:any) => {
1462
+ let row:any = [];
1463
+ rptParms.ServerList.forEach((server:any) => {
1464
+ if (server === 'NOT_FOUND') {
1465
+ row = 'Interceptor not configured in domain';
1466
+ } else if (clusterDict[server][propName] !== undefined) {
1467
+ row = clusterDict[server][propName];
1468
+ } else {
1469
+ row = 'Property not set';
1470
+ }
1471
+ });
1472
+ propertyTableData.push(row);
1473
+ });
1474
+ const propsDict = {
1475
+ RowHeaders: propNames,
1476
+ TableData: propertyTableData,
1477
+ Title: `${propAttr.PropName} for ${rptParms.Title}`,
1478
+ FirstColumnHeader: propAttr.PropName,
1479
+ ConfigIDs: initialconfigIDs,
1480
+ Type: 'Properties',
1481
+ };
1482
+ rptTables.push(propsDict);
1483
+ Object.assign(rptParms, { Tables: rptTables });
1484
+ }
1485
+ });
1486
+ });
1487
+ // table generation
1488
+ let tbody = '';
1489
+ const reportTables = rptParms.Tables;
1490
+ const colHeaders = rptParms.ColumnHeaders;
1491
+ reportingTable = `${reportingTable}<table style="table-layout:fixed" border="2" cellpadding="2" cellspacing="0" width=554>`;
1492
+ reportTables.forEach((table:any) => {
1493
+ const firstColumnHeader = table.FirstColumnHeader;
1494
+ const rowHeadersData = table.RowHeaders;
1495
+ const reportTableData = table.TableData;
1496
+ const title = table.Title;
1497
+ // title
1498
+ tbody = `${tbody}<tbody>`;
1499
+ tbody = `${tbody}<tr align="left"><td colspan="3" rowspan="1" bgcolor="#999999" valign="top"><big><big><b>${title}</b></big></big><br></td></tr>`;
1500
+ tbody = `${tbody}<tr><td class="wrapped" valign="top"><b>${firstColumnHeader}</b><b><br></b> </td>`;
1501
+ // column headers for attributes
1502
+ colHeaders.forEach((header:any) => {
1503
+ tbody = `${tbody}<td class="wrapped" bgcolor="#cccccc" valign="top"><b>${header}</b><b><br></b> </td>`;
1504
+ });
1505
+ tbody = `${tbody}<tr>`;
1506
+
1507
+ // Write attribute rows
1508
+ let idx = 0;
1509
+ rowHeadersData.forEach((rowHeaderData:any) => {
1510
+ tbody = `${tbody}<tr><td class="wrapped" bgcolor="#cccccc" valign="top"><b>${rowHeadersData[idx]}</b><b><br></b> </td>`;
1511
+ tbody = `${tbody}<td class="wrapped" valign="top">${reportTableData[idx]}<br></td>`;
1512
+ tbody = `${tbody}</tr>`;
1513
+ idx += 1;
1514
+ });
1515
+ tbody = `${tbody}</tbody>`;
1516
+ });
1517
+ reportingTable = `${reportingTable}${tbody}</table></br>`;
1518
+ });
1519
+ });
1520
+
1521
+ // HTML generation
1522
+ const resourceReport = `
1523
+ <!DOCTYPE html>
1524
+ <html>\n<head>\n<meta http-equiv="content-type" content="text/html; charset=UTF-8">\n<title>Cell Summary Report</title>\n</head>\n<body>
1525
+ <head><style type="text/css">
1526
+ #header{
1527
+ text-align: center;
1528
+ font-size:25px;
1529
+ }
1530
+ .subHeader {text-align: left;
1531
+ color:#000080;
1532
+ font-size:15px;
1533
+ }
1534
+ table {
1535
+ font-family: arial, sans-serif;
1536
+ border-collapse: collapse;
1537
+ width: 100%;
1538
+ }
1539
+ th {
1540
+ border: 1px solid black;
1541
+ text-align: center;
1542
+ padding: 8px;
1543
+ font-size: 15px;
1544
+ }
1545
+ td{
1546
+ border:1px solid black;
1547
+ text-align: left;
1548
+ padding: 8px;
1549
+ font-size: 14px;
1550
+ word-wrap: break-word;
1551
+ }
1552
+ table{
1553
+ border: 2px solid black;
1554
+ }
1555
+ text{
1556
+ color:black;
1557
+ font-size: 13px;
1558
+ }
1559
+ #syndicatorId{
1560
+ background-color:#F0F8FF;
1561
+ }
1562
+ #rowId{
1563
+ size:"1";
1564
+ width:"100%" ;
1565
+ color:"black";
1566
+ }
1567
+ #subRowId{
1568
+ size:"2";
1569
+ width:"100%" ;
1570
+ color:"black";
1571
+ }
1572
+ </style>
1573
+ </head>
1574
+ <body>
1575
+ <div><h1>Resources Report ${moment().format('MM/DD/YY h:mm:ss')}</h1>
1576
+ <div class="Div1">
1577
+ <svg width="20" height="20">
1578
+ <rect width="20" height="20" style="fill:#87CEEB;stroke-width:3;stroke:rgb(0,0,0)" />
1579
+ </svg>
1580
+ Difference in configuration details<br>
1581
+ </div>
1582
+ <div class="Div2">
1583
+ <svg width="20" height="20">
1584
+ <rect width="20" height="20" style="fill:#E9E612;stroke-width:3;stroke:rgb(0,0,0)" />
1585
+ </svg>
1586
+ Only one configuration found.
1587
+ </div>
1588
+ <style>
1589
+ .Div1{
1590
+ position: absolute;
1591
+ top: 28px;
1592
+ right: 16px;
1593
+ font-size: 15px;
1594
+ }
1595
+ .Div2 {
1596
+ position: absolute;
1597
+ top: 55px;
1598
+ right: 73px;
1599
+ font-size: 15px;
1600
+ }
1601
+ </style>
1602
+ ${reportingTable}
1603
+ </div>Note, the output contains only limited resources data.
1604
+ </br>Some resources related to SSLConfig, Security, J2CResourceAdapter, ResourceEnvironmentProvider, JAASAuthData will be added in further updates.
1605
+ <script>
1606
+ var oTable = document.getElementById('differential-report');
1607
+ var rowLength = oTable.rows.length;
1608
+ for (i = 0; i < rowLength; i++){
1609
+ var oCells = oTable.rows.item(i).cells;
1610
+ var cellLength = oCells.length;
1611
+ for(var j = 0; j < cellLength; j++){
1612
+ if(cellLength > 1){
1613
+ var cellOne = oCells.item(1).innerHTML.match();
1614
+ var cellSceond = oCells.item(2).innerHTML.match();
1615
+ if((oCells.item(1).innerHTML.replaceAll(cellOne ? cellOne[0] : cellOne, '') !== oCells.item(2).innerHTML.replaceAll(cellSceond ? cellSceond[0] : cellSceond, ''))
1616
+ && oCells.item(0).innerText.length !==1 && oCells.item(1).innerText.length !== 1 && oCells.item(2).innerText.length !== 1){
1617
+ oCells.item(2).bgColor ='Sky blue';
1618
+ }else if ((oCells.item(1).innerText.length) !== (oCells.item(2).innerText.length) && (oCells.item(2).innerText.length) !== 1) {
1619
+ oCells.item(2).bgColor ='Yellow';
1620
+ }
1621
+ else if ((oCells.item(1).innerText.length) !== (oCells.item(2).innerText.length) && (oCells.item(1).innerText.length) !== 1) {
1622
+ oCells.item(1).bgColor ='Yellow';
1623
+ }
1624
+ }
1625
+ }
1626
+ }
1627
+ </script>
1628
+ </body>
1629
+ </html>`;
1630
+ try {
1631
+ const outputFileName = getFileNameWithTimeStamp(CONSTANT_VALUES.resourceReport);
1632
+ const outputFileLocation = `${path.resolve(getStoreDir(), CONSTANT_VALUES.outputFileLocation)}/${CONSTANT_VALUES.reportCFG}`;
1633
+ const writeFileResponse = await fileServices.writeFile(resourceReport, outputFileLocation, `${outputFileName}.${FileType.HTML}`);
1634
+ logger.info(message('EXPORT_RESOURCE_REPORT_SUCCESS', { 0: writeFileResponse }));
1635
+ } catch (error) {
1636
+ logger.debug('Error in writing file %o', error);
1637
+ return false;
1638
+ }
1639
+ } catch (error) {
1640
+ logger.debug('Error in generating resource report %s', error.message);
1641
+ return false;
1642
+ }
1643
+ return true;
1644
+ }
1645
+
1646
+ export const differentialReportUtils = {
1647
+ readConfigs,
1648
+ addCellSuffix,
1649
+ generateSummaryReport,
1650
+ generateResourceReport,
1651
+ };