@rockcarver/frodo-cli 0.18.2-7 → 0.18.2-9

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 (334) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/esm/app.js +2 -2
  3. package/esm/app.js.map +1 -1
  4. package/esm/cli/_template/something-delete.js +7 -4
  5. package/esm/cli/_template/something-delete.js.map +1 -1
  6. package/esm/cli/_template/something-describe.js +7 -4
  7. package/esm/cli/_template/something-describe.js.map +1 -1
  8. package/esm/cli/_template/something-else-delete.js +7 -4
  9. package/esm/cli/_template/something-else-delete.js.map +1 -1
  10. package/esm/cli/_template/something-else-describe.js +7 -4
  11. package/esm/cli/_template/something-else-describe.js.map +1 -1
  12. package/esm/cli/_template/something-else-export.js +7 -4
  13. package/esm/cli/_template/something-else-export.js.map +1 -1
  14. package/esm/cli/_template/something-else-import.js +7 -4
  15. package/esm/cli/_template/something-else-import.js.map +1 -1
  16. package/esm/cli/_template/something-else-list.js +7 -4
  17. package/esm/cli/_template/something-else-list.js.map +1 -1
  18. package/esm/cli/_template/something-else.js.map +1 -1
  19. package/esm/cli/_template/something-export.js +7 -4
  20. package/esm/cli/_template/something-export.js.map +1 -1
  21. package/esm/cli/_template/something-import.js +7 -4
  22. package/esm/cli/_template/something-import.js.map +1 -1
  23. package/esm/cli/_template/something-list.js +7 -4
  24. package/esm/cli/_template/something-list.js.map +1 -1
  25. package/esm/cli/_template/something-other-delete.js +7 -4
  26. package/esm/cli/_template/something-other-delete.js.map +1 -1
  27. package/esm/cli/_template/something-other-describe.js +7 -4
  28. package/esm/cli/_template/something-other-describe.js.map +1 -1
  29. package/esm/cli/_template/something-other-export.js +7 -4
  30. package/esm/cli/_template/something-other-export.js.map +1 -1
  31. package/esm/cli/_template/something-other-import.js +7 -4
  32. package/esm/cli/_template/something-other-import.js.map +1 -1
  33. package/esm/cli/_template/something-other-list.js +7 -4
  34. package/esm/cli/_template/something-other-list.js.map +1 -1
  35. package/esm/cli/_template/something-other.js.map +1 -1
  36. package/esm/cli/_template/something.js +0 -2
  37. package/esm/cli/_template/something.js.map +1 -1
  38. package/esm/cli/admin/admin-add-autoid-static-user-mapping.js +5 -3
  39. package/esm/cli/admin/admin-add-autoid-static-user-mapping.js.map +1 -1
  40. package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +7 -11
  41. package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js.map +1 -1
  42. package/esm/cli/admin/admin-get-access-token.js +5 -3
  43. package/esm/cli/admin/admin-get-access-token.js.map +1 -1
  44. package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js +5 -3
  45. package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js.map +1 -1
  46. package/esm/cli/admin/admin-hide-generic-extension-attributes.js +5 -3
  47. package/esm/cli/admin/admin-hide-generic-extension-attributes.js.map +1 -1
  48. package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +5 -3
  49. package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js.map +1 -1
  50. package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +5 -3
  51. package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js.map +1 -1
  52. package/esm/cli/admin/admin-list-static-user-mappings.js +5 -3
  53. package/esm/cli/admin/admin-list-static-user-mappings.js.map +1 -1
  54. package/esm/cli/admin/admin-remove-static-user-mapping.js +5 -3
  55. package/esm/cli/admin/admin-remove-static-user-mapping.js.map +1 -1
  56. package/esm/cli/admin/admin-repair-org-model.js +5 -3
  57. package/esm/cli/admin/admin-repair-org-model.js.map +1 -1
  58. package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +5 -3
  59. package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js.map +1 -1
  60. package/esm/cli/admin/admin-show-generic-extension-attributes.js +5 -3
  61. package/esm/cli/admin/admin-show-generic-extension-attributes.js.map +1 -1
  62. package/esm/cli/admin/admin.js +0 -2
  63. package/esm/cli/admin/admin.js.map +1 -1
  64. package/esm/cli/agent/agent-delete.js +9 -7
  65. package/esm/cli/agent/agent-delete.js.map +1 -1
  66. package/esm/cli/agent/agent-describe.js +7 -4
  67. package/esm/cli/agent/agent-describe.js.map +1 -1
  68. package/esm/cli/agent/agent-export.js +11 -6
  69. package/esm/cli/agent/agent-export.js.map +1 -1
  70. package/esm/cli/agent/agent-gateway-delete.js +9 -7
  71. package/esm/cli/agent/agent-gateway-delete.js.map +1 -1
  72. package/esm/cli/agent/agent-gateway-describe.js +7 -4
  73. package/esm/cli/agent/agent-gateway-describe.js.map +1 -1
  74. package/esm/cli/agent/agent-gateway-export.js +11 -6
  75. package/esm/cli/agent/agent-gateway-export.js.map +1 -1
  76. package/esm/cli/agent/agent-gateway-import.js +13 -7
  77. package/esm/cli/agent/agent-gateway-import.js.map +1 -1
  78. package/esm/cli/agent/agent-gateway-list.js +5 -3
  79. package/esm/cli/agent/agent-gateway-list.js.map +1 -1
  80. package/esm/cli/agent/agent-gateway.js.map +1 -1
  81. package/esm/cli/agent/agent-import.js +13 -7
  82. package/esm/cli/agent/agent-import.js.map +1 -1
  83. package/esm/cli/agent/agent-java-delete.js +9 -7
  84. package/esm/cli/agent/agent-java-delete.js.map +1 -1
  85. package/esm/cli/agent/agent-java-describe.js +7 -4
  86. package/esm/cli/agent/agent-java-describe.js.map +1 -1
  87. package/esm/cli/agent/agent-java-export.js +11 -6
  88. package/esm/cli/agent/agent-java-export.js.map +1 -1
  89. package/esm/cli/agent/agent-java-import.js +13 -7
  90. package/esm/cli/agent/agent-java-import.js.map +1 -1
  91. package/esm/cli/agent/agent-java-list.js +5 -3
  92. package/esm/cli/agent/agent-java-list.js.map +1 -1
  93. package/esm/cli/agent/agent-java.js.map +1 -1
  94. package/esm/cli/agent/agent-list.js +5 -3
  95. package/esm/cli/agent/agent-list.js.map +1 -1
  96. package/esm/cli/agent/agent-web-delete.js +9 -7
  97. package/esm/cli/agent/agent-web-delete.js.map +1 -1
  98. package/esm/cli/agent/agent-web-describe.js +7 -4
  99. package/esm/cli/agent/agent-web-describe.js.map +1 -1
  100. package/esm/cli/agent/agent-web-export.js +11 -6
  101. package/esm/cli/agent/agent-web-export.js.map +1 -1
  102. package/esm/cli/agent/agent-web-import.js +13 -7
  103. package/esm/cli/agent/agent-web-import.js.map +1 -1
  104. package/esm/cli/agent/agent-web-list.js +5 -3
  105. package/esm/cli/agent/agent-web-list.js.map +1 -1
  106. package/esm/cli/agent/agent-web.js.map +1 -1
  107. package/esm/cli/agent/agent.js +0 -2
  108. package/esm/cli/agent/agent.js.map +1 -1
  109. package/esm/cli/app/app-delete.js +7 -4
  110. package/esm/cli/app/app-delete.js.map +1 -1
  111. package/esm/cli/app/app-describe.js +7 -4
  112. package/esm/cli/app/app-describe.js.map +1 -1
  113. package/esm/cli/app/app-export.js +11 -6
  114. package/esm/cli/app/app-export.js.map +1 -1
  115. package/esm/cli/app/app-import.js +9 -5
  116. package/esm/cli/app/app-import.js.map +1 -1
  117. package/esm/cli/app/app-list.js +5 -3
  118. package/esm/cli/app/app-list.js.map +1 -1
  119. package/esm/cli/app/app.js +8 -5
  120. package/esm/cli/app/app.js.map +1 -1
  121. package/esm/cli/cmd_common.js +2 -1
  122. package/esm/cli/cmd_common.js.map +1 -1
  123. package/esm/cli/conn/conn-add.js +5 -5
  124. package/esm/cli/conn/conn-add.js.map +1 -1
  125. package/esm/cli/conn/conn-delete.js +5 -2
  126. package/esm/cli/conn/conn-delete.js.map +1 -1
  127. package/esm/cli/conn/conn-describe.js +5 -2
  128. package/esm/cli/conn/conn-describe.js.map +1 -1
  129. package/esm/cli/conn/conn-list.js +7 -3
  130. package/esm/cli/conn/conn-list.js.map +1 -1
  131. package/esm/cli/conn/conn.js +2 -3
  132. package/esm/cli/conn/conn.js.map +1 -1
  133. package/esm/cli/email/email-template-export.js +13 -12
  134. package/esm/cli/email/email-template-export.js.map +1 -1
  135. package/esm/cli/email/email-template-import.js +15 -14
  136. package/esm/cli/email/email-template-import.js.map +1 -1
  137. package/esm/cli/email/email-template-list.js +7 -7
  138. package/esm/cli/email/email-template-list.js.map +1 -1
  139. package/esm/cli/email/email-template.js.map +1 -1
  140. package/esm/cli/email/email.js +0 -2
  141. package/esm/cli/email/email.js.map +1 -1
  142. package/esm/cli/esv/esv-apply.js +9 -11
  143. package/esm/cli/esv/esv-apply.js.map +1 -1
  144. package/esm/cli/esv/esv-secret-create.js +5 -3
  145. package/esm/cli/esv/esv-secret-create.js.map +1 -1
  146. package/esm/cli/esv/esv-secret-delete.js +9 -5
  147. package/esm/cli/esv/esv-secret-delete.js.map +1 -1
  148. package/esm/cli/esv/esv-secret-describe.js +5 -3
  149. package/esm/cli/esv/esv-secret-describe.js.map +1 -1
  150. package/esm/cli/esv/esv-secret-export.js +7 -4
  151. package/esm/cli/esv/esv-secret-export.js.map +1 -1
  152. package/esm/cli/esv/esv-secret-import.js +7 -4
  153. package/esm/cli/esv/esv-secret-import.js.map +1 -1
  154. package/esm/cli/esv/esv-secret-list.js +5 -3
  155. package/esm/cli/esv/esv-secret-list.js.map +1 -1
  156. package/esm/cli/esv/esv-secret-set.js +5 -3
  157. package/esm/cli/esv/esv-secret-set.js.map +1 -1
  158. package/esm/cli/esv/esv-secret-version-activate.js +7 -4
  159. package/esm/cli/esv/esv-secret-version-activate.js.map +1 -1
  160. package/esm/cli/esv/esv-secret-version-create.js +5 -3
  161. package/esm/cli/esv/esv-secret-version-create.js.map +1 -1
  162. package/esm/cli/esv/esv-secret-version-deactivate.js +7 -4
  163. package/esm/cli/esv/esv-secret-version-deactivate.js.map +1 -1
  164. package/esm/cli/esv/esv-secret-version-delete.js +7 -4
  165. package/esm/cli/esv/esv-secret-version-delete.js.map +1 -1
  166. package/esm/cli/esv/esv-secret-version-list.js +5 -3
  167. package/esm/cli/esv/esv-secret-version-list.js.map +1 -1
  168. package/esm/cli/esv/esv-secret-version.js.map +1 -1
  169. package/esm/cli/esv/esv-secret.js +4 -1
  170. package/esm/cli/esv/esv-secret.js.map +1 -1
  171. package/esm/cli/esv/esv-variable-create.js +5 -3
  172. package/esm/cli/esv/esv-variable-create.js.map +1 -1
  173. package/esm/cli/esv/esv-variable-delete.js +9 -5
  174. package/esm/cli/esv/esv-variable-delete.js.map +1 -1
  175. package/esm/cli/esv/esv-variable-describe.js +5 -3
  176. package/esm/cli/esv/esv-variable-describe.js.map +1 -1
  177. package/esm/cli/esv/esv-variable-export.js +7 -4
  178. package/esm/cli/esv/esv-variable-export.js.map +1 -1
  179. package/esm/cli/esv/esv-variable-import.js +7 -4
  180. package/esm/cli/esv/esv-variable-import.js.map +1 -1
  181. package/esm/cli/esv/esv-variable-list.js +5 -3
  182. package/esm/cli/esv/esv-variable-list.js.map +1 -1
  183. package/esm/cli/esv/esv-variable-set.js +7 -4
  184. package/esm/cli/esv/esv-variable-set.js.map +1 -1
  185. package/esm/cli/esv/esv-variable.js +4 -1
  186. package/esm/cli/esv/esv-variable.js.map +1 -1
  187. package/esm/cli/esv/esv.js +0 -2
  188. package/esm/cli/esv/esv.js.map +1 -1
  189. package/esm/cli/idm/idm-count.js +5 -3
  190. package/esm/cli/idm/idm-count.js.map +1 -1
  191. package/esm/cli/idm/idm-export.js +11 -6
  192. package/esm/cli/idm/idm-export.js.map +1 -1
  193. package/esm/cli/idm/idm-import.js +11 -6
  194. package/esm/cli/idm/idm-import.js.map +1 -1
  195. package/esm/cli/idm/idm-list.js +7 -4
  196. package/esm/cli/idm/idm-list.js.map +1 -1
  197. package/esm/cli/idm/idm.js +2 -3
  198. package/esm/cli/idm/idm.js.map +1 -1
  199. package/esm/cli/idp/idp-export.js +11 -6
  200. package/esm/cli/idp/idp-export.js.map +1 -1
  201. package/esm/cli/idp/idp-import.js +13 -7
  202. package/esm/cli/idp/idp-import.js.map +1 -1
  203. package/esm/cli/idp/idp-list.js +7 -4
  204. package/esm/cli/idp/idp-list.js.map +1 -1
  205. package/esm/cli/idp/idp.js +0 -2
  206. package/esm/cli/idp/idp.js.map +1 -1
  207. package/esm/cli/info/info.js +0 -5
  208. package/esm/cli/info/info.js.map +1 -1
  209. package/esm/cli/journey/journey-delete.e2e.test_.js.map +1 -1
  210. package/esm/cli/journey/journey-delete.js +9 -5
  211. package/esm/cli/journey/journey-delete.js.map +1 -1
  212. package/esm/cli/journey/journey-describe.js +31 -28
  213. package/esm/cli/journey/journey-describe.js.map +1 -1
  214. package/esm/cli/journey/journey-disable.js +9 -6
  215. package/esm/cli/journey/journey-disable.js.map +1 -1
  216. package/esm/cli/journey/journey-enable.js +9 -6
  217. package/esm/cli/journey/journey-enable.js.map +1 -1
  218. package/esm/cli/journey/journey-export.js +11 -6
  219. package/esm/cli/journey/journey-export.js.map +1 -1
  220. package/esm/cli/journey/journey-import.js +13 -7
  221. package/esm/cli/journey/journey-import.js.map +1 -1
  222. package/esm/cli/journey/journey-list.e2e.test_.js.map +1 -1
  223. package/esm/cli/journey/journey-list.js +5 -3
  224. package/esm/cli/journey/journey-list.js.map +1 -1
  225. package/esm/cli/journey/journey-prune.js +5 -5
  226. package/esm/cli/journey/journey-prune.js.map +1 -1
  227. package/esm/cli/journey/journey.js +0 -2
  228. package/esm/cli/journey/journey.js.map +1 -1
  229. package/esm/cli/logging/logs-fetch.js +2 -11
  230. package/esm/cli/logging/logs-fetch.js.map +1 -1
  231. package/esm/cli/logging/logs-list.js +0 -5
  232. package/esm/cli/logging/logs-list.js.map +1 -1
  233. package/esm/cli/logging/logs-tail.js +0 -4
  234. package/esm/cli/logging/logs-tail.js.map +1 -1
  235. package/esm/cli/logging/logs.js +2 -4
  236. package/esm/cli/logging/logs.js.map +1 -1
  237. package/esm/cli/realm/realm-add-custom-domain.js +5 -3
  238. package/esm/cli/realm/realm-add-custom-domain.js.map +1 -1
  239. package/esm/cli/realm/realm-describe.js +5 -3
  240. package/esm/cli/realm/realm-describe.js.map +1 -1
  241. package/esm/cli/realm/realm-list.js +5 -3
  242. package/esm/cli/realm/realm-list.js.map +1 -1
  243. package/esm/cli/realm/realm-remove-custom-domain.js +5 -3
  244. package/esm/cli/realm/realm-remove-custom-domain.js.map +1 -1
  245. package/esm/cli/realm/realm.js +5 -4
  246. package/esm/cli/realm/realm.js.map +1 -1
  247. package/esm/cli/saml/saml-cot-export.js +11 -6
  248. package/esm/cli/saml/saml-cot-export.js.map +1 -1
  249. package/esm/cli/saml/saml-cot-import.js +13 -7
  250. package/esm/cli/saml/saml-cot-import.js.map +1 -1
  251. package/esm/cli/saml/saml-cot-list.js +5 -3
  252. package/esm/cli/saml/saml-cot-list.js.map +1 -1
  253. package/esm/cli/saml/saml-cot.js.map +1 -1
  254. package/esm/cli/saml/saml-delete.js +11 -6
  255. package/esm/cli/saml/saml-delete.js.map +1 -1
  256. package/esm/cli/saml/saml-describe.js +5 -3
  257. package/esm/cli/saml/saml-describe.js.map +1 -1
  258. package/esm/cli/saml/saml-export.js +13 -7
  259. package/esm/cli/saml/saml-export.js.map +1 -1
  260. package/esm/cli/saml/saml-import.js +13 -7
  261. package/esm/cli/saml/saml-import.js.map +1 -1
  262. package/esm/cli/saml/saml-list.js +5 -3
  263. package/esm/cli/saml/saml-list.js.map +1 -1
  264. package/esm/cli/saml/saml-metadata-export.js +7 -4
  265. package/esm/cli/saml/saml-metadata-export.js.map +1 -1
  266. package/esm/cli/saml/saml-metadata.js.map +1 -1
  267. package/esm/cli/saml/saml.js +0 -2
  268. package/esm/cli/saml/saml.js.map +1 -1
  269. package/esm/cli/script/script-delete.js +7 -4
  270. package/esm/cli/script/script-delete.js.map +1 -1
  271. package/esm/cli/script/script-describe.js +7 -4
  272. package/esm/cli/script/script-describe.js.map +1 -1
  273. package/esm/cli/script/script-export.js +15 -8
  274. package/esm/cli/script/script-export.js.map +1 -1
  275. package/esm/cli/script/script-import.js +7 -4
  276. package/esm/cli/script/script-import.js.map +1 -1
  277. package/esm/cli/script/script-list.js +5 -3
  278. package/esm/cli/script/script-list.js.map +1 -1
  279. package/esm/cli/script/script.js +6 -4
  280. package/esm/cli/script/script.js.map +1 -1
  281. package/esm/cli/service/service-delete.js +0 -1
  282. package/esm/cli/service/service-delete.js.map +1 -1
  283. package/esm/cli/service/service-export.js +11 -6
  284. package/esm/cli/service/service-export.js.map +1 -1
  285. package/esm/cli/service/service-import.js +13 -6
  286. package/esm/cli/service/service-import.js.map +1 -1
  287. package/esm/cli/service/service-list.js +0 -1
  288. package/esm/cli/service/service-list.js.map +1 -1
  289. package/esm/cli/service/service.js +0 -2
  290. package/esm/cli/service/service.js.map +1 -1
  291. package/esm/cli/theme/theme-delete.e2e.test_.js.map +1 -1
  292. package/esm/cli/theme/theme-delete.js +16 -14
  293. package/esm/cli/theme/theme-delete.js.map +1 -1
  294. package/esm/cli/theme/theme-export.js +17 -15
  295. package/esm/cli/theme/theme-export.js.map +1 -1
  296. package/esm/cli/theme/theme-import.js +19 -17
  297. package/esm/cli/theme/theme-import.js.map +1 -1
  298. package/esm/cli/theme/theme-list.e2e.test_.js.map +1 -1
  299. package/esm/cli/theme/theme-list.js +7 -7
  300. package/esm/cli/theme/theme-list.js.map +1 -1
  301. package/esm/cli/theme/theme.js +0 -2
  302. package/esm/cli/theme/theme.js.map +1 -1
  303. package/esm/ops/AgentOps.js +48 -126
  304. package/esm/ops/AgentOps.js.map +1 -1
  305. package/esm/ops/CirclesOfTrustOps.js +2 -2
  306. package/esm/ops/CirclesOfTrustOps.js.map +1 -1
  307. package/esm/ops/EmailTemplateOps.js +270 -6
  308. package/esm/ops/EmailTemplateOps.js.map +1 -1
  309. package/esm/ops/IdpOps.js +2 -2
  310. package/esm/ops/IdpOps.js.map +1 -1
  311. package/esm/ops/JourneyOps.js +96 -152
  312. package/esm/ops/JourneyOps.js.map +1 -1
  313. package/esm/ops/NodeOps.js +6 -12
  314. package/esm/ops/NodeOps.js.map +1 -1
  315. package/esm/ops/Saml2Ops.js +25 -78
  316. package/esm/ops/Saml2Ops.js.map +1 -1
  317. package/esm/ops/Saml2Ops.test_.js.map +1 -1
  318. package/esm/ops/ScriptOps.js +3 -3
  319. package/esm/ops/ScriptOps.js.map +1 -1
  320. package/esm/ops/ServiceOps.js +10 -31
  321. package/esm/ops/ServiceOps.js.map +1 -1
  322. package/esm/ops/ThemeOps.js +331 -2
  323. package/esm/ops/ThemeOps.js.map +1 -1
  324. package/esm/ops/utils/Wordwrap.js.map +1 -1
  325. package/esm/storage/StaticStorage.js.map +1 -1
  326. package/esm/utils/Config.js +0 -9
  327. package/esm/utils/Config.js.map +1 -1
  328. package/esm/utils/Console.js +32 -79
  329. package/esm/utils/Console.js.map +1 -1
  330. package/esm/utils/ExportImportUtils.js +46 -0
  331. package/esm/utils/ExportImportUtils.js.map +1 -0
  332. package/esm/utils/Version.js +6 -24
  333. package/esm/utils/Version.js.map +1 -1
  334. package/package.json +18 -17
@@ -26,19 +26,17 @@ const {
26
26
  saveJsonToFile,
27
27
  getRealmString
28
28
  } = ExportImportUtils;
29
+
29
30
  /**
30
31
  * List all the journeys/trees
31
32
  * @param {boolean} long Long version, all the fields
32
33
  * @param {boolean} analyze Analyze journeys/trees for custom nodes (expensive)
33
34
  * @returns {Promise<TreeSkeleton[]>} a promise that resolves to an array journey objects
34
35
  */
35
-
36
36
  export async function listJourneys(long = false, analyze = false) {
37
37
  let journeys = [];
38
-
39
38
  try {
40
39
  journeys = await getJourneys();
41
-
42
40
  if (!long && !analyze) {
43
41
  for (const journeyStub of journeys) {
44
42
  printMessage(`${journeyStub['_id']}`, 'data');
@@ -46,18 +44,14 @@ export async function listJourneys(long = false, analyze = false) {
46
44
  } else {
47
45
  if (!analyze) {
48
46
  const table = createTable(['Name', 'Status', 'Tags']);
49
-
50
47
  for (const journeyStub of journeys) {
51
48
  var _journeyStub$uiConfig;
52
-
53
49
  table.push([`${journeyStub._id}`, journeyStub.enabled === false ? 'disabled'['brightRed'] : 'enabled'['brightGreen'], (_journeyStub$uiConfig = journeyStub.uiConfig) !== null && _journeyStub$uiConfig !== void 0 && _journeyStub$uiConfig.categories ? wordwrap(JSON.parse(journeyStub.uiConfig.categories).join(', '), 60) : '']);
54
50
  }
55
-
56
51
  printMessage(table.toString(), 'data');
57
52
  } else {
58
53
  showSpinner('Retrieving details of all journeys...');
59
54
  const exportPromises = [];
60
-
61
55
  try {
62
56
  for (const journeyStub of journeys) {
63
57
  exportPromises.push(exportJourney(journeyStub['_id'], {
@@ -65,17 +59,13 @@ export async function listJourneys(long = false, analyze = false) {
65
59
  deps: false
66
60
  }));
67
61
  }
68
-
69
62
  const journeyExports = await Promise.all(exportPromises);
70
63
  succeedSpinner('Retrieved details of all journeys.');
71
64
  const table = createTable(['Name', 'Status', 'Classification', 'Tags']);
72
-
73
65
  for (const journeyExport of journeyExports) {
74
66
  var _journeyExport$tree$u;
75
-
76
67
  table.push([`${journeyExport.tree._id}`, journeyExport.tree.enabled === false ? 'disabled'['brightRed'] : 'enabled'['brightGreen'], getJourneyClassification(journeyExport).join(', '), (_journeyExport$tree$u = journeyExport.tree.uiConfig) !== null && _journeyExport$tree$u !== void 0 && _journeyExport$tree$u.categories ? wordwrap(JSON.parse(journeyExport.tree.uiConfig.categories).join(', '), 60) : '']);
77
68
  }
78
-
79
69
  printMessage(table.toString(), 'data');
80
70
  } catch (error) {
81
71
  failSpinner('Error retrieving details of all journeys.');
@@ -86,29 +76,26 @@ export async function listJourneys(long = false, analyze = false) {
86
76
  } catch (error) {
87
77
  printMessage(error.response.data, 'error');
88
78
  }
89
-
90
79
  return journeys;
91
80
  }
81
+
92
82
  /**
93
83
  * Export journey by id/name to file
94
84
  * @param {string} journeyId journey id/name
95
85
  * @param {string} file optional export file name
96
86
  * @param {TreeExportOptions} options export options
97
87
  */
98
-
99
88
  export async function exportJourneyToFile(journeyId, file, options) {
100
89
  debugMessage(`exportJourneyToFile: start`);
101
90
  const verbose = state.default.session.getDebug();
102
-
103
91
  if (!file) {
104
92
  file = getTypedFilename(journeyId, 'journey');
105
93
  }
106
-
107
94
  if (state.default.session.getDirectory()) {
108
95
  const dir = state.default.session.getDirectory().replace(/\/$/, '');
109
96
  debugMessage(`exportJourneyToFile: directory='${dir}'`);
110
- file = `${dir}/${file}`; // create directory if it doesn't exist
111
-
97
+ file = `${dir}/${file}`;
98
+ // create directory if it doesn't exist
112
99
  if (!fs.existsSync(dir)) {
113
100
  debugMessage(`exportJourneyToFile: creating directory '${dir}'`);
114
101
  fs.mkdirSync(dir, {
@@ -116,9 +103,7 @@ export async function exportJourneyToFile(journeyId, file, options) {
116
103
  });
117
104
  }
118
105
  }
119
-
120
106
  if (!verbose) showSpinner(`${journeyId}`);
121
-
122
107
  try {
123
108
  const fileData = await exportJourney(journeyId, options);
124
109
  if (verbose) showSpinner(`${journeyId}`);
@@ -129,29 +114,25 @@ export async function exportJourneyToFile(journeyId, file, options) {
129
114
  failSpinner(`Error exporting journey ${journeyId}: ${error}`);
130
115
  }
131
116
  }
117
+
132
118
  /**
133
119
  * Export all journeys to file
134
120
  * @param {string} file optional export file name
135
121
  * @param {TreeExportOptions} options export options
136
122
  */
137
-
138
123
  export async function exportJourneysToFile(file, options = {
139
124
  deps: false,
140
125
  useStringArrays: false
141
126
  }) {
142
127
  let fileName = file;
143
-
144
128
  if (!fileName) {
145
129
  fileName = getTypedFilename(`all${getRealmString()}Journeys`, 'journeys');
146
130
  }
147
-
148
131
  const trees = await getJourneys();
149
132
  const fileData = createMultiTreeExportTemplate();
150
133
  createProgressBar(trees.length, 'Exporting journeys...');
151
-
152
134
  for (const tree of trees) {
153
135
  updateProgressBar(`${tree._id}`);
154
-
155
136
  try {
156
137
  const exportData = await exportJourney(tree._id, options);
157
138
  delete exportData.meta;
@@ -160,52 +141,49 @@ export async function exportJourneysToFile(file, options = {
160
141
  printMessage(`Error exporting journey ${tree._id}: ${error}`, 'error');
161
142
  }
162
143
  }
163
-
164
144
  saveJsonToFile(fileData, fileName);
165
145
  stopProgressBar(`Exported to ${fileName}`);
166
146
  }
147
+
167
148
  /**
168
149
  * Export all journeys to separate files
169
150
  * @param {TreeExportOptions} options export options
170
151
  */
171
-
172
152
  export async function exportJourneysToFiles(options) {
173
153
  const trees = await getJourneys();
174
154
  createProgressBar(trees.length, 'Exporting journeys...');
175
-
176
155
  for (const tree of trees) {
177
156
  updateProgressBar(`${tree._id}`);
178
157
  const fileName = getTypedFilename(`${tree._id}`, 'journey');
179
-
180
158
  try {
181
159
  const exportData = await exportJourney(tree._id, options);
182
160
  saveJsonToFile(exportData, fileName);
183
- } catch (error) {// do we need to report status here?
161
+ } catch (error) {
162
+ // do we need to report status here?
184
163
  }
185
164
  }
186
-
187
165
  stopProgressBar('Done');
188
166
  }
167
+
189
168
  /**
190
169
  * Import a journey from file
191
170
  * @param {string} journeyId journey id/name
192
171
  * @param {string} file import file name
193
172
  * @param {TreeImportOptions} options import options
194
173
  */
195
-
196
174
  export async function importJourneyFromFile(journeyId, file, options) {
197
175
  const verbose = state.default.session.getDebug();
198
176
  fs.readFile(file, 'utf8', async (err, data) => {
199
177
  if (err) throw err;
200
- let journeyData = JSON.parse(data); // check if this is a file with multiple trees and get journey by id
201
-
178
+ let journeyData = JSON.parse(data);
179
+ // check if this is a file with multiple trees and get journey by id
202
180
  if (journeyData.trees && journeyData.trees[journeyId]) {
203
181
  journeyData = journeyData.trees[journeyId];
204
182
  } else if (journeyData.trees) {
205
183
  journeyData = null;
206
- } // if a journeyId was specified, only import the matching journey
207
-
184
+ }
208
185
 
186
+ // if a journeyId was specified, only import the matching journey
209
187
  if (journeyData && journeyId === journeyData.tree._id) {
210
188
  // attempt dependency resolution for single tree import
211
189
  const installedJourneys = (await getJourneys()).map(x => x._id);
@@ -215,7 +193,6 @@ export async function importJourneyFromFile(journeyId, file, options) {
215
193
  await resolveDependencies(installedJourneys, {
216
194
  [journeyId]: journeyData
217
195
  }, unresolvedJourneys, resolvedJourneys);
218
-
219
196
  if (Object.keys(unresolvedJourneys).length === 0) {
220
197
  succeedSpinner(`Resolved all dependencies.`);
221
198
  if (!verbose) showSpinner(`Importing ${journeyId}...`);
@@ -228,36 +205,34 @@ export async function importJourneyFromFile(journeyId, file, options) {
228
205
  });
229
206
  } else {
230
207
  failSpinner(`Unresolved dependencies:`);
231
-
232
208
  for (const journey of Object.keys(unresolvedJourneys)) {
233
209
  printMessage(` ${journey} requires ${unresolvedJourneys[journey]}`, 'error');
234
210
  }
235
- } // end dependency resolution for single tree import
236
-
211
+ }
212
+ // end dependency resolution for single tree import
237
213
  } else {
238
214
  showSpinner(`Importing ${journeyId}...`);
239
215
  failSpinner(`${journeyId} not found!`);
240
216
  }
241
217
  });
242
218
  }
219
+
243
220
  /**
244
221
  * Import first journey from file
245
222
  * @param {string} file import file name
246
223
  * @param {TreeImportOptions} options import options
247
224
  */
248
-
249
225
  export async function importFirstJourneyFromFile(file, options) {
250
226
  const verbose = state.default.session.getDebug();
251
227
  fs.readFile(file, 'utf8', async (err, data) => {
252
228
  if (err) throw err;
253
-
254
229
  let journeyData = _.cloneDeep(JSON.parse(data));
255
-
256
- let journeyId = null; // single tree
257
-
230
+ let journeyId = null;
231
+ // single tree
258
232
  if (journeyData.tree) {
259
233
  journeyId = _.cloneDeep(journeyData.tree._id);
260
- } // multiple trees, so get the first tree
234
+ }
235
+ // multiple trees, so get the first tree
261
236
  else if (journeyData.trees) {
262
237
  for (const treeId in journeyData.trees) {
263
238
  if (Object.hasOwnProperty.call(journeyData.trees, treeId)) {
@@ -266,9 +241,9 @@ export async function importFirstJourneyFromFile(file, options) {
266
241
  break;
267
242
  }
268
243
  }
269
- } // if a journeyId was specified, only import the matching journey
270
-
244
+ }
271
245
 
246
+ // if a journeyId was specified, only import the matching journey
272
247
  if (journeyData && journeyId) {
273
248
  // attempt dependency resolution for single tree import
274
249
  const installedJourneys = (await getJourneys()).map(x => x._id);
@@ -278,7 +253,6 @@ export async function importFirstJourneyFromFile(file, options) {
278
253
  await resolveDependencies(installedJourneys, {
279
254
  [journeyId]: journeyData
280
255
  }, unresolvedJourneys, resolvedJourneys);
281
-
282
256
  if (Object.keys(unresolvedJourneys).length === 0) {
283
257
  succeedSpinner(`Resolved all dependencies.`);
284
258
  if (!verbose) showSpinner(`Importing ${journeyId}...`);
@@ -291,7 +265,6 @@ export async function importFirstJourneyFromFile(file, options) {
291
265
  });
292
266
  } else {
293
267
  failSpinner(`Unresolved dependencies:`);
294
-
295
268
  for (const journey of Object.keys(unresolvedJourneys)) {
296
269
  printMessage(` ${journey} requires ${unresolvedJourneys[journey]}`, 'error');
297
270
  }
@@ -299,16 +272,16 @@ export async function importFirstJourneyFromFile(file, options) {
299
272
  } else {
300
273
  showSpinner(`Importing...`);
301
274
  failSpinner(`No journeys found!`);
302
- } // end dependency resolution for single tree import
303
-
275
+ }
276
+ // end dependency resolution for single tree import
304
277
  });
305
278
  }
279
+
306
280
  /**
307
281
  * Import all journeys from file
308
282
  * @param {string} file import file name
309
283
  * @param {TreeImportOptions} options import options
310
284
  */
311
-
312
285
  export async function importJourneysFromFile(file, options) {
313
286
  fs.readFile(file, 'utf8', (err, data) => {
314
287
  if (err) throw err;
@@ -316,142 +289,127 @@ export async function importJourneysFromFile(file, options) {
316
289
  importAllJourneys(fileData.trees, options);
317
290
  });
318
291
  }
292
+
319
293
  /**
320
294
  * Import all journeys from separate files
321
295
  * @param {TreeImportOptions} options import options
322
296
  */
323
-
324
297
  export async function importJourneysFromFiles(options) {
325
298
  const names = fs.readdirSync('.');
326
299
  const jsonFiles = names.filter(name => name.toLowerCase().endsWith('.journey.json'));
327
300
  const allJourneysData = {
328
301
  trees: {}
329
302
  };
330
-
331
303
  for (const file of jsonFiles) {
332
304
  const journeyData = JSON.parse(fs.readFileSync(file, 'utf8'));
333
305
  allJourneysData.trees[journeyData.tree._id] = journeyData;
334
306
  }
335
-
336
307
  importAllJourneys(allJourneysData.trees, options);
337
308
  }
309
+
338
310
  /**
339
311
  * Get journey classification
340
312
  * @param {SingleTreeExportInterface} journey journey export
341
313
  * @returns {string[]} Colored string array of classifications
342
314
  */
343
-
344
315
  export function getJourneyClassification(journey) {
345
316
  return Journey.getJourneyClassification(journey).map(it => {
346
317
  switch (it) {
347
318
  case Types.JourneyClassification.STANDARD:
348
319
  return it.toString()['brightGreen'];
349
-
350
320
  case Types.JourneyClassification.CLOUD:
351
321
  return it.toString()['brightMagenta'];
352
-
353
322
  case Types.JourneyClassification.CUSTOM:
354
323
  return it.toString()['brightRed'];
355
-
356
324
  case Types.JourneyClassification.PREMIUM:
357
325
  return it.toString()['brightYellow'];
358
326
  }
359
327
  });
360
328
  }
329
+
361
330
  /**
362
331
  * Get journey classification in markdown
363
332
  * @param {SingleTreeExportInterface} journey journey export
364
333
  * @returns {string[]} Colored string array of classifications
365
334
  */
366
-
367
335
  export function getJourneyClassificationMd(journey) {
368
336
  return Journey.getJourneyClassification(journey).map(it => {
369
337
  switch (it) {
370
338
  case Types.JourneyClassification.STANDARD:
371
339
  return `:green_circle: \`${it.toString()}\``;
372
-
373
340
  case Types.JourneyClassification.CLOUD:
374
341
  return `:purple_circle: \`${it.toString()}\``;
375
-
376
342
  case Types.JourneyClassification.CUSTOM:
377
343
  return `:red_circle: \`${it.toString()}\``;
378
-
379
344
  case Types.JourneyClassification.PREMIUM:
380
345
  return `:yellow_circle: \`${it.toString()}\``;
381
346
  }
382
347
  });
383
348
  }
349
+
384
350
  /**
385
351
  * Get a one-line description of the tree object
386
352
  * @param {TreeSkeleton} treeObj circle of trust object to describe
387
353
  * @returns {string} a one-line description
388
354
  */
389
-
390
355
  export function getOneLineDescription(treeObj) {
391
356
  const description = `[${treeObj._id['brightCyan']}]`;
392
357
  return description;
393
358
  }
359
+
394
360
  /**
395
361
  * Get a one-line description of the tree object in markdown
396
362
  * @param {TreeSkeleton} treeObj circle of trust object to describe
397
363
  * @returns {string} a one-line description
398
364
  */
399
-
400
365
  export function getOneLineDescriptionMd(treeObj) {
401
366
  const description = `${treeObj._id}`;
402
367
  return description;
403
368
  }
369
+
404
370
  /**
405
371
  * Helper function to render a nested list of dependent trees
406
372
  * @param {TreeDependencyMapInterface} descendents tree dependency map
407
373
  * @param {number} depth level of nesting
408
374
  */
409
-
410
375
  function describeTreeDescendents(descendents, depth = 0) {
411
376
  if (depth || Object.values(descendents)[0].length) {
412
377
  // heading
413
378
  if (depth === 0) {
414
379
  printMessage(`\nInner Tree Dependencies (${Object.values(descendents)[0].length}):`, 'data');
415
380
  }
416
-
417
381
  const indent = Array(depth * 2).fill(' ').join('');
418
382
  const [tree] = Object.keys(descendents);
419
383
  printMessage(`${indent}- ${tree['brightCyan']}`, 'data');
420
-
421
384
  for (const descendent of descendents[tree]) {
422
385
  describeTreeDescendents(descendent, depth + 1);
423
386
  }
424
387
  }
425
388
  }
389
+
426
390
  /**
427
391
  * Helper function to render a nested list of dependent trees in markdown
428
392
  * @param {TreeDependencyMapInterface} descendents tree dependency map
429
393
  * @param {number} depth level of nesting
430
394
  */
431
-
432
-
433
395
  function describeTreeDescendentsMd(descendents, depth = 0) {
434
396
  let markdown = '';
435
-
436
397
  if (depth || Object.values(descendents)[0].length) {
437
398
  // heading
438
399
  if (depth === 0) {
439
400
  markdown += `## Inner Tree Dependencies (${Object.values(descendents)[0].length})\n`;
440
401
  }
441
-
442
402
  const indent = Array(depth * 2).fill(' ').join('');
443
403
  const [tree] = Object.keys(descendents);
444
404
  markdown += `${indent}- ${tree}\n`;
445
-
446
405
  for (const descendent of descendents[tree]) {
447
406
  markdown += describeTreeDescendentsMd(descendent, depth + 1);
448
407
  }
449
-
450
408
  return markdown;
451
409
  }
452
-
453
410
  return markdown;
454
411
  }
412
+
455
413
  /**
456
414
  * Describe a journey:
457
415
  * - Properties, tags, description, name, metadata
@@ -467,125 +425,118 @@ function describeTreeDescendentsMd(descendents, depth = 0) {
467
425
  * @param {SingleTreeExportInterface} journeyData journey export object
468
426
  * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function
469
427
  */
470
-
471
-
472
428
  export async function describeJourney(journeyData, resolveTreeExport = onlineTreeExportResolver) {
473
429
  var _journeyData$meta, _journeyData$tree$uiC, _journeyData$themes;
474
-
475
- const allNodes = { ...journeyData.nodes,
430
+ const allNodes = {
431
+ ...journeyData.nodes,
476
432
  ...journeyData.innerNodes
477
433
  };
478
434
  const nodeTypeMap = {};
479
-
480
435
  for (const nodeData of Object.values(allNodes)) {
481
436
  if (nodeTypeMap[nodeData._type._id]) {
482
437
  nodeTypeMap[nodeData._type._id] += 1;
483
438
  } else {
484
439
  nodeTypeMap[nodeData._type._id] = 1;
485
440
  }
486
- } // initialize AM version from file
487
-
441
+ }
488
442
 
443
+ // initialize AM version from file
489
444
  if (!state.default.session.getAmVersion() && (_journeyData$meta = journeyData.meta) !== null && _journeyData$meta !== void 0 && _journeyData$meta.originAmVersion) {
490
445
  state.default.session.setAmVersion(journeyData.meta.originAmVersion);
491
- } // Journey Name
492
-
446
+ }
493
447
 
448
+ // Journey Name
494
449
  printMessage(`${getOneLineDescription(journeyData.tree)}`, 'data');
495
- printMessage(Array(`[${journeyData.tree._id}]`['length']).fill('=').join('')); // Description
450
+ printMessage(Array(`[${journeyData.tree._id}]`['length']).fill('=').join(''));
496
451
 
452
+ // Description
497
453
  if (journeyData.tree.description) {
498
454
  printMessage(`\n${journeyData.tree.description}`, 'data');
499
- } // Status
500
-
455
+ }
501
456
 
502
- printMessage(`\nStatus\n${journeyData.tree.enabled === false ? 'disabled'['brightRed'] : 'enabled'['brightGreen']}`); // Classification
457
+ // Status
458
+ printMessage(`\nStatus\n${journeyData.tree.enabled === false ? 'disabled'['brightRed'] : 'enabled'['brightGreen']}`);
503
459
 
460
+ // Classification
504
461
  if (state.default.session.getAmVersion()) {
505
462
  printMessage(`\nClassification\n${getJourneyClassification(journeyData).join(', ')}`, 'data');
506
- } // Categories/Tags
507
-
463
+ }
508
464
 
465
+ // Categories/Tags
509
466
  if ((_journeyData$tree$uiC = journeyData.tree.uiConfig) !== null && _journeyData$tree$uiC !== void 0 && _journeyData$tree$uiC.categories && journeyData.tree.uiConfig.categories != '[]') {
510
467
  printMessage('\nCategories/Tags', 'data');
511
468
  printMessage(`${JSON.parse(journeyData.tree.uiConfig.categories).join(', ')}`, 'data');
512
- } // Dependency Tree
513
-
469
+ }
514
470
 
471
+ // Dependency Tree
515
472
  const descendents = await getTreeDescendents(journeyData, resolveTreeExport);
516
- describeTreeDescendents(descendents); // Node Types
473
+ describeTreeDescendents(descendents);
517
474
 
475
+ // Node Types
518
476
  if (Object.entries(nodeTypeMap).length) {
519
477
  printMessage(`\nNode Types (${Object.entries(nodeTypeMap).length}):`, 'data');
520
-
521
478
  for (const [nodeType, count] of Object.entries(nodeTypeMap)) {
522
479
  printMessage(`- ${String(count)} [${nodeType['brightCyan']}] (${Node.getNodeClassification(nodeType).join(', ')})`, 'data');
523
480
  }
524
- } // Nodes
525
-
481
+ }
526
482
 
483
+ // Nodes
527
484
  if (Object.entries(allNodes).length) {
528
485
  printMessage(`\nNodes (${Object.entries(allNodes).length}):`, 'data');
529
-
530
486
  for (const nodeObj of Object.values(allNodes)) {
531
487
  printMessage(`- ${Node.getOneLineDescription(nodeObj, getNodeRef(nodeObj, journeyData))}`, 'data');
532
488
  }
533
- } // Themes
534
-
489
+ }
535
490
 
491
+ // Themes
536
492
  if ((_journeyData$themes = journeyData.themes) !== null && _journeyData$themes !== void 0 && _journeyData$themes.length) {
537
493
  printMessage(`\nThemes (${journeyData.themes.length}):`, 'data');
538
-
539
494
  for (const themeData of journeyData.themes) {
540
495
  printMessage(`- ${Theme.getOneLineDescription(themeData)}`, 'data');
541
496
  }
542
- } // Scripts
543
-
497
+ }
544
498
 
499
+ // Scripts
545
500
  if (Object.entries(journeyData.scripts).length) {
546
501
  printMessage(`\nScripts (${Object.entries(journeyData.scripts).length}):`, 'data');
547
-
548
502
  for (const scriptData of Object.values(journeyData.scripts)) {
549
503
  printMessage(`- ${Script.getOneLineDescription(scriptData)}`, 'data');
550
504
  }
551
- } // Email Templates
552
-
505
+ }
553
506
 
507
+ // Email Templates
554
508
  if (Object.entries(journeyData.emailTemplates).length) {
555
509
  printMessage(`\nEmail Templates (${Object.entries(journeyData.emailTemplates).length}):`, 'data');
556
-
557
510
  for (const templateData of Object.values(journeyData.emailTemplates)) {
558
511
  printMessage(`- ${EmailTemplate.getOneLineDescription(templateData)}`, 'data');
559
512
  }
560
- } // Social Identity Providers
561
-
513
+ }
562
514
 
515
+ // Social Identity Providers
563
516
  if (Object.entries(journeyData.socialIdentityProviders).length) {
564
517
  printMessage(`\nSocial Identity Providers (${Object.entries(journeyData.socialIdentityProviders).length}):`, 'data');
565
-
566
518
  for (const socialIdpData of Object.values(journeyData.socialIdentityProviders)) {
567
519
  printMessage(`- ${Idp.getOneLineDescription(socialIdpData)}`, 'data');
568
520
  }
569
- } // SAML2 Entity Providers
570
-
521
+ }
571
522
 
523
+ // SAML2 Entity Providers
572
524
  if (Object.entries(journeyData.saml2Entities).length) {
573
525
  printMessage(`\nSAML2 Entity Providers (${Object.entries(journeyData.saml2Entities).length}):`, 'data');
574
-
575
526
  for (const entityProviderData of Object.values(journeyData.saml2Entities)) {
576
527
  printMessage(`- ${Saml2.getOneLineDescription(entityProviderData)}`, 'data');
577
528
  }
578
- } // SAML2 Circles Of Trust
579
-
529
+ }
580
530
 
531
+ // SAML2 Circles Of Trust
581
532
  if (Object.entries(journeyData.circlesOfTrust).length) {
582
533
  printMessage(`\nSAML2 Circles Of Trust (${Object.entries(journeyData.circlesOfTrust).length}):`, 'data');
583
-
584
534
  for (const cotData of Object.values(journeyData.circlesOfTrust)) {
585
535
  printMessage(`- ${CirclesOfTrust.getOneLineDescription(cotData)}`, 'data');
586
536
  }
587
537
  }
588
538
  }
539
+
589
540
  /**
590
541
  * Describe a journey in markdown:
591
542
  * - Properties, tags, description, name, metadata
@@ -601,121 +552,114 @@ export async function describeJourney(journeyData, resolveTreeExport = onlineTre
601
552
  * @param {SingleTreeExportInterface} journeyData journey export object
602
553
  * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function
603
554
  */
604
-
605
555
  export async function describeJourneyMd(journeyData, resolveTreeExport = onlineTreeExportResolver) {
606
556
  var _journeyData$meta2, _journeyData$tree$uiC2, _journeyData$themes2;
607
-
608
- const allNodes = { ...journeyData.nodes,
557
+ const allNodes = {
558
+ ...journeyData.nodes,
609
559
  ...journeyData.innerNodes
610
560
  };
611
561
  const nodeTypeMap = {};
612
-
613
562
  for (const nodeData of Object.values(allNodes)) {
614
563
  if (nodeTypeMap[nodeData._type._id]) {
615
564
  nodeTypeMap[nodeData._type._id] += 1;
616
565
  } else {
617
566
  nodeTypeMap[nodeData._type._id] = 1;
618
567
  }
619
- } // initialize AM version from file
620
-
568
+ }
621
569
 
570
+ // initialize AM version from file
622
571
  if (!state.default.session.getAmVersion() && (_journeyData$meta2 = journeyData.meta) !== null && _journeyData$meta2 !== void 0 && _journeyData$meta2.originAmVersion) {
623
572
  state.default.session.setAmVersion(journeyData.meta.originAmVersion);
624
- } // Journey Name
625
-
573
+ }
626
574
 
627
- printMessage(`# ${getOneLineDescriptionMd(journeyData.tree)} - ${journeyData.tree.enabled === false ? ':o: `disabled`' : ':white_check_mark: `enabled`'}, ${getJourneyClassificationMd(journeyData).join(', ')}`, 'data'); // Categories/Tags
575
+ // Journey Name
576
+ printMessage(`# ${getOneLineDescriptionMd(journeyData.tree)} - ${journeyData.tree.enabled === false ? ':o: `disabled`' : ':white_check_mark: `enabled`'}, ${getJourneyClassificationMd(journeyData).join(', ')}`, 'data');
628
577
 
578
+ // Categories/Tags
629
579
  if ((_journeyData$tree$uiC2 = journeyData.tree.uiConfig) !== null && _journeyData$tree$uiC2 !== void 0 && _journeyData$tree$uiC2.categories && journeyData.tree.uiConfig.categories != '[]') {
630
580
  printMessage(`\`${JSON.parse(journeyData.tree.uiConfig.categories).join('`, `')}\``, 'data');
631
- } // Description
632
-
581
+ }
633
582
 
583
+ // Description
634
584
  if (journeyData.tree.description) {
635
585
  printMessage(`\n${journeyData.tree.description}`, 'data');
636
- } // Journey image
637
-
586
+ }
638
587
 
639
- printMessage(`\n[![](./${journeyData.tree._id}.png)]()\n`, 'data'); // Dependency Tree
588
+ // Journey image
589
+ printMessage(`\n[![](./${journeyData.tree._id}.png)]()\n`, 'data');
640
590
 
591
+ // Dependency Tree
641
592
  const descendents = await getTreeDescendents(journeyData, resolveTreeExport);
642
- printMessage(describeTreeDescendentsMd(descendents), 'data'); // Node Types
593
+ printMessage(describeTreeDescendentsMd(descendents), 'data');
643
594
 
595
+ // Node Types
644
596
  if (Object.entries(nodeTypeMap).length) {
645
597
  printMessage(`## Node Types (${Object.entries(nodeTypeMap).length})`, 'data');
646
598
  printMessage('| Count | Type | Classification |', 'data');
647
599
  printMessage('| -----:| ---- | -------------- |', 'data');
648
-
649
600
  for (const [nodeType, count] of Object.entries(nodeTypeMap)) {
650
601
  printMessage(`| ${String(count)} | ${nodeType} | ${Node.getNodeClassificationMd(nodeType).join('<br>')} |`, 'data');
651
602
  }
652
- } // Nodes
653
-
603
+ }
654
604
 
605
+ // Nodes
655
606
  if (Object.entries(allNodes).length) {
656
607
  printMessage(`## Nodes (${Object.entries(allNodes).length})`, 'data');
657
608
  printMessage(Node.getTableHeaderMd(), 'data');
658
-
659
609
  for (const nodeObj of Object.values(allNodes)) {
660
610
  printMessage(`${Node.getTableRowMd(nodeObj, getNodeRef(nodeObj, journeyData))}`, 'data');
661
611
  }
662
- } // Themes
663
-
612
+ }
664
613
 
614
+ // Themes
665
615
  if ((_journeyData$themes2 = journeyData.themes) !== null && _journeyData$themes2 !== void 0 && _journeyData$themes2.length) {
666
616
  printMessage(`## Themes (${journeyData.themes.length})`, 'data');
667
617
  printMessage(Theme.getTableHeaderMd(), 'data');
668
-
669
618
  for (const themeData of journeyData.themes) {
670
619
  printMessage(`${Theme.getTableRowMd(themeData)}`, 'data');
671
620
  }
672
- } // Scripts
673
-
621
+ }
674
622
 
623
+ // Scripts
675
624
  if (Object.entries(journeyData.scripts).length) {
676
625
  printMessage(`## Scripts (${Object.entries(journeyData.scripts).length})`, 'data');
677
626
  printMessage(Script.getTableHeaderMd(), 'data');
678
-
679
627
  for (const scriptData of Object.values(journeyData.scripts)) {
680
628
  printMessage(`${Script.getTableRowMd(scriptData)}`, 'data');
681
629
  }
682
- } // Email Templates
683
-
630
+ }
684
631
 
632
+ // Email Templates
685
633
  if (Object.entries(journeyData.emailTemplates).length) {
686
634
  printMessage(`## Email Templates (${Object.entries(journeyData.emailTemplates).length})`, 'data');
687
635
  printMessage(EmailTemplate.getTableHeaderMd(), 'data');
688
-
689
636
  for (const templateData of Object.values(journeyData.emailTemplates)) {
690
637
  printMessage(`${EmailTemplate.getTableRowMd(templateData)}`, 'data');
691
638
  }
692
- } // Social Identity Providers
693
-
639
+ }
694
640
 
641
+ // Social Identity Providers
695
642
  if (Object.entries(journeyData.socialIdentityProviders).length) {
696
643
  printMessage(`## Social Identity Providers (${Object.entries(journeyData.socialIdentityProviders).length})`, 'data');
697
644
  printMessage(Idp.getTableHeaderMd(), 'data');
698
-
699
645
  for (const socialIdpData of Object.values(journeyData.socialIdentityProviders)) {
700
646
  printMessage(`${Idp.getTableRowMd(socialIdpData)}`, 'data');
701
647
  }
702
- } // SAML2 Entity Providers
703
-
648
+ }
704
649
 
650
+ // SAML2 Entity Providers
705
651
  if (Object.entries(journeyData.saml2Entities).length) {
706
652
  printMessage(`## SAML2 Entity Providers (${Object.entries(journeyData.saml2Entities).length})`, 'data');
707
653
  printMessage(Saml2.getTableHeaderMd(), 'data');
708
-
709
654
  for (const entityProviderData of Object.values(journeyData.saml2Entities)) {
710
655
  printMessage(`${Saml2.getTableRowMd(entityProviderData)}`, 'data');
711
656
  }
712
- } // SAML2 Circles Of Trust
713
-
657
+ }
714
658
 
659
+ // SAML2 Circles Of Trust
715
660
  if (Object.entries(journeyData.circlesOfTrust).length) {
716
661
  printMessage(`## SAML2 Circles Of Trust (${Object.entries(journeyData.circlesOfTrust).length})`, 'data');
717
662
  printMessage(CirclesOfTrust.getTableHeaderMd(), 'data');
718
-
719
663
  for (const cotData of Object.values(journeyData.circlesOfTrust)) {
720
664
  printMessage(`${CirclesOfTrust.getTableRowMd(cotData)}`, 'data');
721
665
  }