@rockcarver/frodo-cli 2.0.0-57 → 2.0.0-59

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 (398) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/esm/cli/FrodoCommand.js +9 -1
  3. package/esm/cli/FrodoCommand.js.map +1 -1
  4. package/esm/cli/_template/something-delete.js +14 -12
  5. package/esm/cli/_template/something-delete.js.map +1 -1
  6. package/esm/cli/_template/something-describe.js +14 -12
  7. package/esm/cli/_template/something-describe.js.map +1 -1
  8. package/esm/cli/_template/something-else-delete.js +14 -12
  9. package/esm/cli/_template/something-else-delete.js.map +1 -1
  10. package/esm/cli/_template/something-else-describe.js +14 -12
  11. package/esm/cli/_template/something-else-describe.js.map +1 -1
  12. package/esm/cli/_template/something-else-export.js +14 -12
  13. package/esm/cli/_template/something-else-export.js.map +1 -1
  14. package/esm/cli/_template/something-else-import.js +14 -12
  15. package/esm/cli/_template/something-else-import.js.map +1 -1
  16. package/esm/cli/_template/something-else-list.js +14 -12
  17. package/esm/cli/_template/something-else-list.js.map +1 -1
  18. package/esm/cli/_template/something-else.js +15 -8
  19. package/esm/cli/_template/something-else.js.map +1 -1
  20. package/esm/cli/_template/something-export.js +14 -12
  21. package/esm/cli/_template/something-export.js.map +1 -1
  22. package/esm/cli/_template/something-import.js +14 -12
  23. package/esm/cli/_template/something-import.js.map +1 -1
  24. package/esm/cli/_template/something-list.js +14 -12
  25. package/esm/cli/_template/something-list.js.map +1 -1
  26. package/esm/cli/_template/something-other-delete.js +14 -12
  27. package/esm/cli/_template/something-other-delete.js.map +1 -1
  28. package/esm/cli/_template/something-other-describe.js +14 -12
  29. package/esm/cli/_template/something-other-describe.js.map +1 -1
  30. package/esm/cli/_template/something-other-export.js +14 -12
  31. package/esm/cli/_template/something-other-export.js.map +1 -1
  32. package/esm/cli/_template/something-other-import.js +14 -12
  33. package/esm/cli/_template/something-other-import.js.map +1 -1
  34. package/esm/cli/_template/something-other-list.js +14 -12
  35. package/esm/cli/_template/something-other-list.js.map +1 -1
  36. package/esm/cli/_template/something-other.js +15 -8
  37. package/esm/cli/_template/something-other.js.map +1 -1
  38. package/esm/cli/_template/something.js +15 -11
  39. package/esm/cli/_template/something.js.map +1 -1
  40. package/esm/cli/admin/admin-add-autoid-static-user-mapping.js +16 -14
  41. package/esm/cli/admin/admin-add-autoid-static-user-mapping.js.map +1 -1
  42. package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +62 -60
  43. package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js.map +1 -1
  44. package/esm/cli/admin/admin-execute-rfc7523-authz-grant-flow.js +27 -25
  45. package/esm/cli/admin/admin-execute-rfc7523-authz-grant-flow.js.map +1 -1
  46. package/esm/cli/admin/admin-federation-export.js +34 -32
  47. package/esm/cli/admin/admin-federation-export.js.map +1 -1
  48. package/esm/cli/admin/admin-federation-import.js +39 -37
  49. package/esm/cli/admin/admin-federation-import.js.map +1 -1
  50. package/esm/cli/admin/admin-federation-list.js +20 -18
  51. package/esm/cli/admin/admin-federation-list.js.map +1 -1
  52. package/esm/cli/admin/admin-federation.js +16 -8
  53. package/esm/cli/admin/admin-federation.js.map +1 -1
  54. package/esm/cli/admin/admin-generate-rfc7523-authz-grant-artefacts.js +29 -27
  55. package/esm/cli/admin/admin-generate-rfc7523-authz-grant-artefacts.js.map +1 -1
  56. package/esm/cli/admin/admin-get-access-token.js +16 -14
  57. package/esm/cli/admin/admin-get-access-token.js.map +1 -1
  58. package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js +16 -14
  59. package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js.map +1 -1
  60. package/esm/cli/admin/admin-hide-generic-extension-attributes.js +16 -14
  61. package/esm/cli/admin/admin-hide-generic-extension-attributes.js.map +1 -1
  62. package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +16 -14
  63. package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js.map +1 -1
  64. package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +16 -14
  65. package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js.map +1 -1
  66. package/esm/cli/admin/admin-list-static-user-mappings.js +16 -14
  67. package/esm/cli/admin/admin-list-static-user-mappings.js.map +1 -1
  68. package/esm/cli/admin/admin-remove-static-user-mapping.js +16 -14
  69. package/esm/cli/admin/admin-remove-static-user-mapping.js.map +1 -1
  70. package/esm/cli/admin/admin-repair-org-model.js +16 -14
  71. package/esm/cli/admin/admin-repair-org-model.js.map +1 -1
  72. package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +16 -14
  73. package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js.map +1 -1
  74. package/esm/cli/admin/admin-show-generic-extension-attributes.js +16 -14
  75. package/esm/cli/admin/admin-show-generic-extension-attributes.js.map +1 -1
  76. package/esm/cli/admin/admin-train-auto-access-model.js +19 -17
  77. package/esm/cli/admin/admin-train-auto-access-model.js.map +1 -1
  78. package/esm/cli/admin/admin.js +34 -20
  79. package/esm/cli/admin/admin.js.map +1 -1
  80. package/esm/cli/agent/agent-delete.js +28 -26
  81. package/esm/cli/agent/agent-delete.js.map +1 -1
  82. package/esm/cli/agent/agent-describe.js +14 -12
  83. package/esm/cli/agent/agent-describe.js.map +1 -1
  84. package/esm/cli/agent/agent-export.js +34 -32
  85. package/esm/cli/agent/agent-export.js.map +1 -1
  86. package/esm/cli/agent/agent-gateway-delete.js +28 -26
  87. package/esm/cli/agent/agent-gateway-delete.js.map +1 -1
  88. package/esm/cli/agent/agent-gateway-describe.js +14 -12
  89. package/esm/cli/agent/agent-gateway-describe.js.map +1 -1
  90. package/esm/cli/agent/agent-gateway-export.js +34 -32
  91. package/esm/cli/agent/agent-gateway-export.js.map +1 -1
  92. package/esm/cli/agent/agent-gateway-import.js +40 -38
  93. package/esm/cli/agent/agent-gateway-import.js.map +1 -1
  94. package/esm/cli/agent/agent-gateway-list.js +15 -13
  95. package/esm/cli/agent/agent-gateway-list.js.map +1 -1
  96. package/esm/cli/agent/agent-gateway.js +15 -8
  97. package/esm/cli/agent/agent-gateway.js.map +1 -1
  98. package/esm/cli/agent/agent-import.js +40 -38
  99. package/esm/cli/agent/agent-import.js.map +1 -1
  100. package/esm/cli/agent/agent-java-delete.js +28 -26
  101. package/esm/cli/agent/agent-java-delete.js.map +1 -1
  102. package/esm/cli/agent/agent-java-describe.js +14 -12
  103. package/esm/cli/agent/agent-java-describe.js.map +1 -1
  104. package/esm/cli/agent/agent-java-export.js +34 -32
  105. package/esm/cli/agent/agent-java-export.js.map +1 -1
  106. package/esm/cli/agent/agent-java-import.js +40 -38
  107. package/esm/cli/agent/agent-java-import.js.map +1 -1
  108. package/esm/cli/agent/agent-java-list.js +15 -13
  109. package/esm/cli/agent/agent-java-list.js.map +1 -1
  110. package/esm/cli/agent/agent-java.js +15 -8
  111. package/esm/cli/agent/agent-java.js.map +1 -1
  112. package/esm/cli/agent/agent-list.js +15 -13
  113. package/esm/cli/agent/agent-list.js.map +1 -1
  114. package/esm/cli/agent/agent-web-delete.js +28 -26
  115. package/esm/cli/agent/agent-web-delete.js.map +1 -1
  116. package/esm/cli/agent/agent-web-describe.js +14 -12
  117. package/esm/cli/agent/agent-web-describe.js.map +1 -1
  118. package/esm/cli/agent/agent-web-export.js +34 -32
  119. package/esm/cli/agent/agent-web-export.js.map +1 -1
  120. package/esm/cli/agent/agent-web-import.js +40 -38
  121. package/esm/cli/agent/agent-web-import.js.map +1 -1
  122. package/esm/cli/agent/agent-web-list.js +15 -13
  123. package/esm/cli/agent/agent-web-list.js.map +1 -1
  124. package/esm/cli/agent/agent-web.js +15 -8
  125. package/esm/cli/agent/agent-web.js.map +1 -1
  126. package/esm/cli/agent/agent.js +17 -12
  127. package/esm/cli/agent/agent.js.map +1 -1
  128. package/esm/cli/app/app-delete.js +27 -25
  129. package/esm/cli/app/app-delete.js.map +1 -1
  130. package/esm/cli/app/app-describe.js +14 -12
  131. package/esm/cli/app/app-describe.js.map +1 -1
  132. package/esm/cli/app/app-export.js +42 -40
  133. package/esm/cli/app/app-export.js.map +1 -1
  134. package/esm/cli/app/app-import.js +47 -45
  135. package/esm/cli/app/app-import.js.map +1 -1
  136. package/esm/cli/app/app-list.js +16 -14
  137. package/esm/cli/app/app-list.js.map +1 -1
  138. package/esm/cli/app/app.js +11 -10
  139. package/esm/cli/app/app.js.map +1 -1
  140. package/esm/cli/authn/authn-describe.js +20 -18
  141. package/esm/cli/authn/authn-describe.js.map +1 -1
  142. package/esm/cli/authn/authn-export.js +16 -14
  143. package/esm/cli/authn/authn-export.js.map +1 -1
  144. package/esm/cli/authn/authn-import.js +16 -14
  145. package/esm/cli/authn/authn-import.js.map +1 -1
  146. package/esm/cli/authn/authn.js +7 -7
  147. package/esm/cli/authn/authn.js.map +1 -1
  148. package/esm/cli/authz/authz-policy-delete.js +33 -31
  149. package/esm/cli/authz/authz-policy-delete.js.map +1 -1
  150. package/esm/cli/authz/authz-policy-describe.js +20 -18
  151. package/esm/cli/authz/authz-policy-describe.js.map +1 -1
  152. package/esm/cli/authz/authz-policy-export.js +65 -63
  153. package/esm/cli/authz/authz-policy-export.js.map +1 -1
  154. package/esm/cli/authz/authz-policy-import.js +55 -53
  155. package/esm/cli/authz/authz-policy-import.js.map +1 -1
  156. package/esm/cli/authz/authz-policy-list.js +27 -25
  157. package/esm/cli/authz/authz-policy-list.js.map +1 -1
  158. package/esm/cli/authz/authz-policy.js +15 -8
  159. package/esm/cli/authz/authz-policy.js.map +1 -1
  160. package/esm/cli/authz/authz-set-delete.js +27 -25
  161. package/esm/cli/authz/authz-set-delete.js.map +1 -1
  162. package/esm/cli/authz/authz-set-describe.js +20 -18
  163. package/esm/cli/authz/authz-set-describe.js.map +1 -1
  164. package/esm/cli/authz/authz-set-export.js +45 -43
  165. package/esm/cli/authz/authz-set-export.js.map +1 -1
  166. package/esm/cli/authz/authz-set-import.js +51 -49
  167. package/esm/cli/authz/authz-set-import.js.map +1 -1
  168. package/esm/cli/authz/authz-set-list.js +16 -14
  169. package/esm/cli/authz/authz-set-list.js.map +1 -1
  170. package/esm/cli/authz/authz-set.js +15 -8
  171. package/esm/cli/authz/authz-set.js.map +1 -1
  172. package/esm/cli/authz/authz-type-delete.js +33 -31
  173. package/esm/cli/authz/authz-type-delete.js.map +1 -1
  174. package/esm/cli/authz/authz-type-describe.js +24 -22
  175. package/esm/cli/authz/authz-type-describe.js.map +1 -1
  176. package/esm/cli/authz/authz-type-export.js +39 -37
  177. package/esm/cli/authz/authz-type-export.js.map +1 -1
  178. package/esm/cli/authz/authz-type-import.js +45 -43
  179. package/esm/cli/authz/authz-type-import.js.map +1 -1
  180. package/esm/cli/authz/authz-type-list.js +16 -14
  181. package/esm/cli/authz/authz-type-list.js.map +1 -1
  182. package/esm/cli/authz/authz-type.js +15 -8
  183. package/esm/cli/authz/authz-type.js.map +1 -1
  184. package/esm/cli/authz/authz.js +7 -7
  185. package/esm/cli/authz/authz.js.map +1 -1
  186. package/esm/cli/config/config-delete.js +14 -12
  187. package/esm/cli/config/config-delete.js.map +1 -1
  188. package/esm/cli/config/config-describe.js +14 -12
  189. package/esm/cli/config/config-describe.js.map +1 -1
  190. package/esm/cli/config/config-export.js +43 -41
  191. package/esm/cli/config/config-export.js.map +1 -1
  192. package/esm/cli/config/config-import.js +53 -51
  193. package/esm/cli/config/config-import.js.map +1 -1
  194. package/esm/cli/config/config-list.js +14 -12
  195. package/esm/cli/config/config-list.js.map +1 -1
  196. package/esm/cli/config/config.js +12 -9
  197. package/esm/cli/config/config.js.map +1 -1
  198. package/esm/cli/conn/conn-delete.js +15 -13
  199. package/esm/cli/conn/conn-delete.js.map +1 -1
  200. package/esm/cli/conn/conn-describe.js +11 -9
  201. package/esm/cli/conn/conn-describe.js.map +1 -1
  202. package/esm/cli/conn/conn-list.js +11 -9
  203. package/esm/cli/conn/conn-list.js.map +1 -1
  204. package/esm/cli/conn/conn-save.js +77 -75
  205. package/esm/cli/conn/conn-save.js.map +1 -1
  206. package/esm/cli/conn/conn.js +9 -8
  207. package/esm/cli/conn/conn.js.map +1 -1
  208. package/esm/cli/email/email-template-export.js +33 -31
  209. package/esm/cli/email/email-template-export.js.map +1 -1
  210. package/esm/cli/email/email-template-import.js +39 -37
  211. package/esm/cli/email/email-template-import.js.map +1 -1
  212. package/esm/cli/email/email-template-list.js +16 -14
  213. package/esm/cli/email/email-template-list.js.map +1 -1
  214. package/esm/cli/email/email-template.js +11 -6
  215. package/esm/cli/email/email-template.js.map +1 -1
  216. package/esm/cli/email/email.js +3 -5
  217. package/esm/cli/email/email.js.map +1 -1
  218. package/esm/cli/esv/esv-apply.js +39 -37
  219. package/esm/cli/esv/esv-apply.js.map +1 -1
  220. package/esm/cli/esv/esv-secret-create.js +19 -17
  221. package/esm/cli/esv/esv-secret-create.js.map +1 -1
  222. package/esm/cli/esv/esv-secret-delete.js +26 -24
  223. package/esm/cli/esv/esv-secret-delete.js.map +1 -1
  224. package/esm/cli/esv/esv-secret-describe.js +16 -14
  225. package/esm/cli/esv/esv-secret-describe.js.map +1 -1
  226. package/esm/cli/esv/esv-secret-export.js +25 -23
  227. package/esm/cli/esv/esv-secret-export.js.map +1 -1
  228. package/esm/cli/esv/esv-secret-import.js +14 -12
  229. package/esm/cli/esv/esv-secret-import.js.map +1 -1
  230. package/esm/cli/esv/esv-secret-list.js +16 -14
  231. package/esm/cli/esv/esv-secret-list.js.map +1 -1
  232. package/esm/cli/esv/esv-secret-set.js +16 -14
  233. package/esm/cli/esv/esv-secret-set.js.map +1 -1
  234. package/esm/cli/esv/esv-secret-version-activate.js +20 -18
  235. package/esm/cli/esv/esv-secret-version-activate.js.map +1 -1
  236. package/esm/cli/esv/esv-secret-version-create.js +19 -17
  237. package/esm/cli/esv/esv-secret-version-create.js.map +1 -1
  238. package/esm/cli/esv/esv-secret-version-deactivate.js +20 -18
  239. package/esm/cli/esv/esv-secret-version-deactivate.js.map +1 -1
  240. package/esm/cli/esv/esv-secret-version-delete.js +26 -24
  241. package/esm/cli/esv/esv-secret-version-delete.js.map +1 -1
  242. package/esm/cli/esv/esv-secret-version-list.js +16 -14
  243. package/esm/cli/esv/esv-secret-version-list.js.map +1 -1
  244. package/esm/cli/esv/esv-secret-version.js +15 -8
  245. package/esm/cli/esv/esv-secret-version.js.map +1 -1
  246. package/esm/cli/esv/esv-secret.js +21 -11
  247. package/esm/cli/esv/esv-secret.js.map +1 -1
  248. package/esm/cli/esv/esv-variable-create.js +16 -14
  249. package/esm/cli/esv/esv-variable-create.js.map +1 -1
  250. package/esm/cli/esv/esv-variable-delete.js +27 -25
  251. package/esm/cli/esv/esv-variable-delete.js.map +1 -1
  252. package/esm/cli/esv/esv-variable-describe.js +16 -14
  253. package/esm/cli/esv/esv-variable-describe.js.map +1 -1
  254. package/esm/cli/esv/esv-variable-export.js +26 -24
  255. package/esm/cli/esv/esv-variable-export.js.map +1 -1
  256. package/esm/cli/esv/esv-variable-import.js +14 -12
  257. package/esm/cli/esv/esv-variable-import.js.map +1 -1
  258. package/esm/cli/esv/esv-variable-list.js +16 -14
  259. package/esm/cli/esv/esv-variable-list.js.map +1 -1
  260. package/esm/cli/esv/esv-variable-set.js +24 -22
  261. package/esm/cli/esv/esv-variable-set.js.map +1 -1
  262. package/esm/cli/esv/esv-variable.js +19 -10
  263. package/esm/cli/esv/esv-variable.js.map +1 -1
  264. package/esm/cli/esv/esv.js +7 -7
  265. package/esm/cli/esv/esv.js.map +1 -1
  266. package/esm/cli/idm/idm-count.js +16 -14
  267. package/esm/cli/idm/idm-count.js.map +1 -1
  268. package/esm/cli/idm/idm-export.js +41 -39
  269. package/esm/cli/idm/idm-export.js.map +1 -1
  270. package/esm/cli/idm/idm-import.js +45 -43
  271. package/esm/cli/idm/idm-import.js.map +1 -1
  272. package/esm/cli/idm/idm-list.js +21 -19
  273. package/esm/cli/idm/idm-list.js.map +1 -1
  274. package/esm/cli/idm/idm.js +9 -8
  275. package/esm/cli/idm/idm.js.map +1 -1
  276. package/esm/cli/idp/idp-export.js +34 -32
  277. package/esm/cli/idp/idp-export.js.map +1 -1
  278. package/esm/cli/idp/idp-import.js +47 -45
  279. package/esm/cli/idp/idp-import.js.map +1 -1
  280. package/esm/cli/idp/idp-list.js +20 -18
  281. package/esm/cli/idp/idp-list.js.map +1 -1
  282. package/esm/cli/idp/idp.js +7 -7
  283. package/esm/cli/idp/idp.js.map +1 -1
  284. package/esm/cli/journey/journey-delete.js +27 -25
  285. package/esm/cli/journey/journey-delete.js.map +1 -1
  286. package/esm/cli/journey/journey-describe.js +92 -90
  287. package/esm/cli/journey/journey-describe.js.map +1 -1
  288. package/esm/cli/journey/journey-disable.js +27 -25
  289. package/esm/cli/journey/journey-disable.js.map +1 -1
  290. package/esm/cli/journey/journey-enable.js +27 -25
  291. package/esm/cli/journey/journey-enable.js.map +1 -1
  292. package/esm/cli/journey/journey-export.js +55 -53
  293. package/esm/cli/journey/journey-export.js.map +1 -1
  294. package/esm/cli/journey/journey-import.js +51 -49
  295. package/esm/cli/journey/journey-import.js.map +1 -1
  296. package/esm/cli/journey/journey-list.js +16 -14
  297. package/esm/cli/journey/journey-list.js.map +1 -1
  298. package/esm/cli/journey/journey-prune.js +26 -24
  299. package/esm/cli/journey/journey-prune.js.map +1 -1
  300. package/esm/cli/journey/journey.js +17 -12
  301. package/esm/cli/journey/journey.js.map +1 -1
  302. package/esm/cli/log/log-fetch.js +98 -96
  303. package/esm/cli/log/log-fetch.js.map +1 -1
  304. package/esm/cli/log/log-key-delete.js +25 -23
  305. package/esm/cli/log/log-key-delete.js.map +1 -1
  306. package/esm/cli/log/log-key-describe.js +14 -12
  307. package/esm/cli/log/log-key-describe.js.map +1 -1
  308. package/esm/cli/log/log-key-list.js +16 -14
  309. package/esm/cli/log/log-key-list.js.map +1 -1
  310. package/esm/cli/log/log-key.js +11 -6
  311. package/esm/cli/log/log-key.js.map +1 -1
  312. package/esm/cli/log/log-list.js +70 -68
  313. package/esm/cli/log/log-list.js.map +1 -1
  314. package/esm/cli/log/log-tail.js +60 -58
  315. package/esm/cli/log/log-tail.js.map +1 -1
  316. package/esm/cli/log/log.js +9 -8
  317. package/esm/cli/log/log.js.map +1 -1
  318. package/esm/cli/oauth/oauth-client-delete.js +14 -12
  319. package/esm/cli/oauth/oauth-client-delete.js.map +1 -1
  320. package/esm/cli/oauth/oauth-client-describe.js +14 -12
  321. package/esm/cli/oauth/oauth-client-describe.js.map +1 -1
  322. package/esm/cli/oauth/oauth-client-export.js +42 -40
  323. package/esm/cli/oauth/oauth-client-export.js.map +1 -1
  324. package/esm/cli/oauth/oauth-client-import.js +47 -45
  325. package/esm/cli/oauth/oauth-client-import.js.map +1 -1
  326. package/esm/cli/oauth/oauth-client-list.js +16 -14
  327. package/esm/cli/oauth/oauth-client-list.js.map +1 -1
  328. package/esm/cli/oauth/oauth-client.js +16 -8
  329. package/esm/cli/oauth/oauth-client.js.map +1 -1
  330. package/esm/cli/oauth/oauth.js +4 -6
  331. package/esm/cli/oauth/oauth.js.map +1 -1
  332. package/esm/cli/realm/realm-add-custom-domain.js +15 -13
  333. package/esm/cli/realm/realm-add-custom-domain.js.map +1 -1
  334. package/esm/cli/realm/realm-describe.js +15 -13
  335. package/esm/cli/realm/realm-describe.js.map +1 -1
  336. package/esm/cli/realm/realm-list.js +15 -13
  337. package/esm/cli/realm/realm-list.js.map +1 -1
  338. package/esm/cli/realm/realm-remove-custom-domain.js +15 -13
  339. package/esm/cli/realm/realm-remove-custom-domain.js.map +1 -1
  340. package/esm/cli/realm/realm.js +13 -10
  341. package/esm/cli/realm/realm.js.map +1 -1
  342. package/esm/cli/saml/saml-cot-export.js +33 -31
  343. package/esm/cli/saml/saml-cot-export.js.map +1 -1
  344. package/esm/cli/saml/saml-cot-import.js +39 -37
  345. package/esm/cli/saml/saml-cot-import.js.map +1 -1
  346. package/esm/cli/saml/saml-cot-list.js +16 -14
  347. package/esm/cli/saml/saml-cot-list.js.map +1 -1
  348. package/esm/cli/saml/saml-cot.js +11 -6
  349. package/esm/cli/saml/saml-cot.js.map +1 -1
  350. package/esm/cli/saml/saml-delete.js +25 -23
  351. package/esm/cli/saml/saml-delete.js.map +1 -1
  352. package/esm/cli/saml/saml-describe.js +16 -14
  353. package/esm/cli/saml/saml-describe.js.map +1 -1
  354. package/esm/cli/saml/saml-export.js +39 -37
  355. package/esm/cli/saml/saml-export.js.map +1 -1
  356. package/esm/cli/saml/saml-import.js +47 -45
  357. package/esm/cli/saml/saml-import.js.map +1 -1
  358. package/esm/cli/saml/saml-list.js +16 -14
  359. package/esm/cli/saml/saml-list.js.map +1 -1
  360. package/esm/cli/saml/saml-metadata-export.js +33 -31
  361. package/esm/cli/saml/saml-metadata-export.js.map +1 -1
  362. package/esm/cli/saml/saml-metadata.js +7 -4
  363. package/esm/cli/saml/saml-metadata.js.map +1 -1
  364. package/esm/cli/saml/saml.js +15 -11
  365. package/esm/cli/saml/saml.js.map +1 -1
  366. package/esm/cli/script/script-delete.js +28 -27
  367. package/esm/cli/script/script-delete.js.map +1 -1
  368. package/esm/cli/script/script-describe.js +14 -12
  369. package/esm/cli/script/script-describe.js.map +1 -1
  370. package/esm/cli/script/script-export.js +43 -41
  371. package/esm/cli/script/script-export.js.map +1 -1
  372. package/esm/cli/script/script-import.js +32 -30
  373. package/esm/cli/script/script-import.js.map +1 -1
  374. package/esm/cli/script/script-list.js +16 -14
  375. package/esm/cli/script/script-list.js.map +1 -1
  376. package/esm/cli/script/script.js +11 -9
  377. package/esm/cli/script/script.js.map +1 -1
  378. package/esm/cli/service/service-delete.js +18 -16
  379. package/esm/cli/service/service-delete.js.map +1 -1
  380. package/esm/cli/service/service-export.js +32 -30
  381. package/esm/cli/service/service-export.js.map +1 -1
  382. package/esm/cli/service/service-import.js +56 -54
  383. package/esm/cli/service/service-import.js.map +1 -1
  384. package/esm/cli/service/service-list.js +14 -12
  385. package/esm/cli/service/service-list.js.map +1 -1
  386. package/esm/cli/service/service.js +9 -8
  387. package/esm/cli/service/service.js.map +1 -1
  388. package/esm/cli/theme/theme-delete.js +33 -31
  389. package/esm/cli/theme/theme-delete.js.map +1 -1
  390. package/esm/cli/theme/theme-export.js +39 -37
  391. package/esm/cli/theme/theme-export.js.map +1 -1
  392. package/esm/cli/theme/theme-import.js +45 -43
  393. package/esm/cli/theme/theme-import.js.map +1 -1
  394. package/esm/cli/theme/theme-list.js +16 -14
  395. package/esm/cli/theme/theme-list.js.map +1 -1
  396. package/esm/cli/theme/theme.js +9 -8
  397. package/esm/cli/theme/theme.js.map +1 -1
  398. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"idp-export.js","names":["state","Option","getTokens","exportSocialIdentityProvidersToFile","exportSocialIdentityProvidersToFiles","exportSocialIdentityProviderToFile","printMessage","verboseMessage","FrodoCommand","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","idpId","getRealm","outcome","file","metadata","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/idp/idp-export.ts"],"sourcesContent":["import { state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { getTokens } from '../../ops/AuthenticateOps';\nimport {\n exportSocialIdentityProvidersToFile,\n exportSocialIdentityProvidersToFiles,\n exportSocialIdentityProviderToFile,\n} from '../../ops/IdpOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst program = new FrodoCommand('frodo idp export');\n\nprogram\n .description('Export (social) identity providers.')\n .addOption(\n new Option(\n '-i, --idp-id <idp-id>',\n 'Id/name of a provider. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Name of the file to write the exported provider(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the providers in a realm to a single file. Ignored with -t and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the providers in a realm as separate files <provider name>.idp.json. Ignored with -t, -i, and -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // export by id/name\n if (options.idpId) {\n verboseMessage(\n `Exporting provider \"${\n options.idpId\n }\" from realm \"${state.getRealm()}\"...`\n );\n const outcome = await exportSocialIdentityProviderToFile(\n options.idpId,\n options.file,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all providers to a single file...');\n const outcome = await exportSocialIdentityProvidersToFile(\n options.file,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all providers to separate files...');\n const outcome = await exportSocialIdentityProvidersToFiles(\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SACEC,mCAAmC,EACnCC,oCAAoC,EACpCC,kCAAkC,QAC7B,kBAAkB;AACzB,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAMC,OAAO,GAAG,IAAID,YAAY,CAAC,kBAAkB,CAAC;AAEpDC,OAAO,CACJC,WAAW,CAAC,qCAAqC,CAAC,CAClDC,SAAS,CACR,IAAIV,MAAM,CACR,uBAAuB,EACvB,6DACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,mBAAmB,EACnB,yEACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,WAAW,EACX,+EACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,oBAAoB,EACpB,8GACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,mBAAmB,EACnB,+CACF,CACF,CAAC,CACAW,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMhB,SAAS,CAAC,CAAC,EAAE;IACrB;IACA,IAAIe,OAAO,CAACG,KAAK,EAAE;MACjBb,cAAc,CACX,uBACCU,OAAO,CAACG,KACT,iBAAgBpB,KAAK,CAACqB,QAAQ,CAAC,CAAE,MACpC,CAAC;MACD,MAAMC,OAAO,GAAG,MAAMjB,kCAAkC,CACtDY,OAAO,CAACG,KAAK,EACbH,OAAO,CAACM,IAAI,EACZN,OAAO,CAACO,QACV,CAAC;MACD,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;IACpC;IACA;IAAA,KACK,IAAIT,OAAO,CAACU,GAAG,EAAE;MACpBpB,cAAc,CAAC,6CAA6C,CAAC;MAC7D,MAAMe,OAAO,GAAG,MAAMnB,mCAAmC,CACvDc,OAAO,CAACM,IAAI,EACZN,OAAO,CAACO,QACV,CAAC;MACD,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;IACpC;IACA;IAAA,KACK,IAAIT,OAAO,CAACW,WAAW,EAAE;MAC5BrB,cAAc,CAAC,8CAA8C,CAAC;MAC9D,MAAMe,OAAO,GAAG,MAAMlB,oCAAoC,CACxDa,OAAO,CAACO,QACV,CAAC;MACD,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;IACpC;IACA;IAAA,KACK;MACHpB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;MACDG,OAAO,CAACoB,IAAI,CAAC,CAAC;MACdJ,OAAO,CAACC,QAAQ,GAAG,CAAC;IACtB;EACF;AACF;AACA;AACF,CAAC;AAEHjB,OAAO,CAACqB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"idp-export.js","names":["state","Option","getTokens","exportSocialIdentityProvidersToFile","exportSocialIdentityProvidersToFiles","exportSocialIdentityProviderToFile","printMessage","verboseMessage","FrodoCommand","setup","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","idpId","getRealm","outcome","file","metadata","process","exitCode","all","allSeparate","help"],"sources":["../../../src/cli/idp/idp-export.ts"],"sourcesContent":["import { state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { getTokens } from '../../ops/AuthenticateOps';\nimport {\n exportSocialIdentityProvidersToFile,\n exportSocialIdentityProvidersToFiles,\n exportSocialIdentityProviderToFile,\n} from '../../ops/IdpOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nexport default function setup() {\n const program = new FrodoCommand('frodo idp export');\n\n program\n .description('Export (social) identity providers.')\n .addOption(\n new Option(\n '-i, --idp-id <idp-id>',\n 'Id/name of a provider. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Name of the file to write the exported provider(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the providers in a realm to a single file. Ignored with -t and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the providers in a realm as separate files <provider name>.idp.json. Ignored with -t, -i, and -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // export by id/name\n if (options.idpId) {\n verboseMessage(\n `Exporting provider \"${\n options.idpId\n }\" from realm \"${state.getRealm()}\"...`\n );\n const outcome = await exportSocialIdentityProviderToFile(\n options.idpId,\n options.file,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all providers to a single file...');\n const outcome = await exportSocialIdentityProvidersToFile(\n options.file,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all providers to separate files...');\n const outcome = await exportSocialIdentityProvidersToFiles(\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n }\n // end command logic inside action handler\n );\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SACEC,mCAAmC,EACnCC,oCAAoC,EACpCC,kCAAkC,QAC7B,kBAAkB;AACzB,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIF,YAAY,CAAC,kBAAkB,CAAC;EAEpDE,OAAO,CACJC,WAAW,CAAC,qCAAqC,CAAC,CAClDC,SAAS,CACR,IAAIX,MAAM,CACR,uBAAuB,EACvB,6DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,mBAAmB,EACnB,yEACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,WAAW,EACX,+EACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,oBAAoB,EACpB,8GACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,mBAAmB,EACnB,+CACF,CACF,CAAC,CACAY,MAAM;EACL;EACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;IACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;IACD,IAAI,MAAMjB,SAAS,CAAC,CAAC,EAAE;MACrB;MACA,IAAIgB,OAAO,CAACG,KAAK,EAAE;QACjBd,cAAc,CACX,uBACCW,OAAO,CAACG,KACT,iBAAgBrB,KAAK,CAACsB,QAAQ,CAAC,CAAE,MACpC,CAAC;QACD,MAAMC,OAAO,GAAG,MAAMlB,kCAAkC,CACtDa,OAAO,CAACG,KAAK,EACbH,OAAO,CAACM,IAAI,EACZN,OAAO,CAACO,QACV,CAAC;QACD,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;MACpC;MACA;MAAA,KACK,IAAIT,OAAO,CAACU,GAAG,EAAE;QACpBrB,cAAc,CAAC,6CAA6C,CAAC;QAC7D,MAAMgB,OAAO,GAAG,MAAMpB,mCAAmC,CACvDe,OAAO,CAACM,IAAI,EACZN,OAAO,CAACO,QACV,CAAC;QACD,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;MACpC;MACA;MAAA,KACK,IAAIT,OAAO,CAACW,WAAW,EAAE;QAC5BtB,cAAc,CAAC,8CAA8C,CAAC;QAC9D,MAAMgB,OAAO,GAAG,MAAMnB,oCAAoC,CACxDc,OAAO,CAACO,QACV,CAAC;QACD,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;MACpC;MACA;MAAA,KACK;QACHrB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;QACDI,OAAO,CAACoB,IAAI,CAAC,CAAC;QACdJ,OAAO,CAACC,QAAQ,GAAG,CAAC;MACtB;IACF;EACF;EACA;EACF,CAAC;EAEH,OAAOjB,OAAO;AAChB"}
@@ -4,51 +4,53 @@ import { getTokens } from '../../ops/AuthenticateOps';
4
4
  import { importFirstSocialIdentityProviderFromFile, importSocialIdentityProviderFromFile, importSocialIdentityProvidersFromFile, importSocialIdentityProvidersFromFiles } from '../../ops/IdpOps';
5
5
  import { printMessage, verboseMessage } from '../../utils/Console';
6
6
  import { FrodoCommand } from '../FrodoCommand';
7
- const program = new FrodoCommand('frodo idp import');
8
- program.description('Import (social) identity providers.').addOption(new Option('-i, --idp-id <id>', 'Provider id. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to import the provider(s) from.')).addOption(new Option('-a, --all', 'Import all the providers from single file. Ignored with -t or -i.')).addOption(new Option('-A, --all-separate', 'Import all the providers from separate files (*.json) in the current directory. Ignored with -t or -i or -a.')).addOption(new Option('--no-deps', 'Do not include any dependencies (scripts).')).action(
9
- // implement command logic inside action handler
10
- async (host, realm, user, password, options, command) => {
11
- command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
12
- // import by id
13
- if (options.file && options.idpId && (await getTokens())) {
14
- verboseMessage(`Importing provider "${options.idpId}" into realm "${state.getRealm()}"...`);
15
- const outcome = await importSocialIdentityProviderFromFile(options.idpId, options.file, {
16
- deps: options.deps
17
- });
18
- if (!outcome) process.exitCode = 1;
19
- }
20
- // --all -a
21
- else if (options.all && options.file && (await getTokens())) {
22
- verboseMessage(`Importing all providers from a single file (${options.file})...`);
23
- const outcome = await importSocialIdentityProvidersFromFile(options.file, {
24
- deps: options.deps
25
- });
26
- if (!outcome) process.exitCode = 1;
27
- }
28
- // --all-separate -A
29
- else if (options.allSeparate && !options.file && (await getTokens())) {
30
- verboseMessage('Importing all providers from separate files in current directory...');
31
- const outcome = await importSocialIdentityProvidersFromFiles({
32
- deps: options.deps
33
- });
34
- if (!outcome) process.exitCode = 1;
35
- }
36
- // import first provider from file
37
- else if (options.file && (await getTokens())) {
38
- verboseMessage(`Importing first provider from file "${options.file}" into realm "${state.getRealm()}"...`);
39
- const outcome = await importFirstSocialIdentityProviderFromFile(options.file, {
40
- deps: options.deps
41
- });
42
- if (!outcome) process.exitCode = 1;
43
- }
44
- // unrecognized combination of options or no options
45
- else {
46
- printMessage('Unrecognized combination of options or no options...');
47
- program.help();
48
- process.exitCode = 1;
7
+ export default function setup() {
8
+ const program = new FrodoCommand('frodo idp import');
9
+ program.description('Import (social) identity providers.').addOption(new Option('-i, --idp-id <id>', 'Provider id. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to import the provider(s) from.')).addOption(new Option('-a, --all', 'Import all the providers from single file. Ignored with -t or -i.')).addOption(new Option('-A, --all-separate', 'Import all the providers from separate files (*.json) in the current directory. Ignored with -t or -i or -a.')).addOption(new Option('--no-deps', 'Do not include any dependencies (scripts).')).action(
10
+ // implement command logic inside action handler
11
+ async (host, realm, user, password, options, command) => {
12
+ command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
13
+ // import by id
14
+ if (options.file && options.idpId && (await getTokens())) {
15
+ verboseMessage(`Importing provider "${options.idpId}" into realm "${state.getRealm()}"...`);
16
+ const outcome = await importSocialIdentityProviderFromFile(options.idpId, options.file, {
17
+ deps: options.deps
18
+ });
19
+ if (!outcome) process.exitCode = 1;
20
+ }
21
+ // --all -a
22
+ else if (options.all && options.file && (await getTokens())) {
23
+ verboseMessage(`Importing all providers from a single file (${options.file})...`);
24
+ const outcome = await importSocialIdentityProvidersFromFile(options.file, {
25
+ deps: options.deps
26
+ });
27
+ if (!outcome) process.exitCode = 1;
28
+ }
29
+ // --all-separate -A
30
+ else if (options.allSeparate && !options.file && (await getTokens())) {
31
+ verboseMessage('Importing all providers from separate files in current directory...');
32
+ const outcome = await importSocialIdentityProvidersFromFiles({
33
+ deps: options.deps
34
+ });
35
+ if (!outcome) process.exitCode = 1;
36
+ }
37
+ // import first provider from file
38
+ else if (options.file && (await getTokens())) {
39
+ verboseMessage(`Importing first provider from file "${options.file}" into realm "${state.getRealm()}"...`);
40
+ const outcome = await importFirstSocialIdentityProviderFromFile(options.file, {
41
+ deps: options.deps
42
+ });
43
+ if (!outcome) process.exitCode = 1;
44
+ }
45
+ // unrecognized combination of options or no options
46
+ else {
47
+ printMessage('Unrecognized combination of options or no options...');
48
+ program.help();
49
+ process.exitCode = 1;
50
+ }
49
51
  }
52
+ // end command logic inside action handler
53
+ );
54
+ return program;
50
55
  }
51
- // end command logic inside action handler
52
- );
53
- program.parse();
54
56
  //# sourceMappingURL=idp-import.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"idp-import.js","names":["state","Option","getTokens","importFirstSocialIdentityProviderFromFile","importSocialIdentityProviderFromFile","importSocialIdentityProvidersFromFile","importSocialIdentityProvidersFromFiles","printMessage","verboseMessage","FrodoCommand","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","idpId","getRealm","outcome","deps","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/idp/idp-import.ts"],"sourcesContent":["import { state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { getTokens } from '../../ops/AuthenticateOps';\nimport {\n importFirstSocialIdentityProviderFromFile,\n importSocialIdentityProviderFromFile,\n importSocialIdentityProvidersFromFile,\n importSocialIdentityProvidersFromFiles,\n} from '../../ops/IdpOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst program = new FrodoCommand('frodo idp import');\n\nprogram\n .description('Import (social) identity providers.')\n .addOption(\n new Option(\n '-i, --idp-id <id>',\n 'Provider id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to import the provider(s) from.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all the providers from single file. Ignored with -t or -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all the providers from separate files (*.json) in the current directory. Ignored with -t or -i or -a.'\n )\n )\n .addOption(\n new Option('--no-deps', 'Do not include any dependencies (scripts).')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id\n if (options.file && options.idpId && (await getTokens())) {\n verboseMessage(\n `Importing provider \"${\n options.idpId\n }\" into realm \"${state.getRealm()}\"...`\n );\n const outcome = await importSocialIdentityProviderFromFile(\n options.idpId,\n options.file,\n {\n deps: options.deps,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage(\n `Importing all providers from a single file (${options.file})...`\n );\n const outcome = await importSocialIdentityProvidersFromFile(\n options.file,\n {\n deps: options.deps,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n verboseMessage(\n 'Importing all providers from separate files in current directory...'\n );\n const outcome = await importSocialIdentityProvidersFromFiles({\n deps: options.deps,\n });\n if (!outcome) process.exitCode = 1;\n }\n // import first provider from file\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first provider from file \"${\n options.file\n }\" into realm \"${state.getRealm()}\"...`\n );\n const outcome = await importFirstSocialIdentityProviderFromFile(\n options.file,\n {\n deps: options.deps,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"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"}
1
+ {"version":3,"file":"idp-import.js","names":["state","Option","getTokens","importFirstSocialIdentityProviderFromFile","importSocialIdentityProviderFromFile","importSocialIdentityProvidersFromFile","importSocialIdentityProvidersFromFiles","printMessage","verboseMessage","FrodoCommand","setup","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","idpId","getRealm","outcome","deps","process","exitCode","all","allSeparate","help"],"sources":["../../../src/cli/idp/idp-import.ts"],"sourcesContent":["import { state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { getTokens } from '../../ops/AuthenticateOps';\nimport {\n importFirstSocialIdentityProviderFromFile,\n importSocialIdentityProviderFromFile,\n importSocialIdentityProvidersFromFile,\n importSocialIdentityProvidersFromFiles,\n} from '../../ops/IdpOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nexport default function setup() {\n const program = new FrodoCommand('frodo idp import');\n\n program\n .description('Import (social) identity providers.')\n .addOption(\n new Option(\n '-i, --idp-id <id>',\n 'Provider id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to import the provider(s) from.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all the providers from single file. Ignored with -t or -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all the providers from separate files (*.json) in the current directory. Ignored with -t or -i or -a.'\n )\n )\n .addOption(\n new Option('--no-deps', 'Do not include any dependencies (scripts).')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id\n if (options.file && options.idpId && (await getTokens())) {\n verboseMessage(\n `Importing provider \"${\n options.idpId\n }\" into realm \"${state.getRealm()}\"...`\n );\n const outcome = await importSocialIdentityProviderFromFile(\n options.idpId,\n options.file,\n {\n deps: options.deps,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage(\n `Importing all providers from a single file (${options.file})...`\n );\n const outcome = await importSocialIdentityProvidersFromFile(\n options.file,\n {\n deps: options.deps,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n verboseMessage(\n 'Importing all providers from separate files in current directory...'\n );\n const outcome = await importSocialIdentityProvidersFromFiles({\n deps: options.deps,\n });\n if (!outcome) process.exitCode = 1;\n }\n // import first provider from file\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first provider from file \"${\n options.file\n }\" into realm \"${state.getRealm()}\"...`\n );\n const outcome = await importFirstSocialIdentityProviderFromFile(\n options.file,\n {\n deps: options.deps,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\n return program;\n}\n"],"mappings":"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"}
@@ -3,24 +3,26 @@ import { getTokens } from '../../ops/AuthenticateOps';
3
3
  import { listSocialProviders } from '../../ops/IdpOps';
4
4
  import { verboseMessage } from '../../utils/Console';
5
5
  import { FrodoCommand } from '../FrodoCommand';
6
- const program = new FrodoCommand('frodo idp list');
7
- program.description('List (social) identity providers.')
8
- // .addOption(
9
- // new Option('-l, --long', 'Long with all fields.').default(false, 'false')
10
- // )
11
- .action(
12
- // implement command logic inside action handler
13
- async (host, realm, user, password, options, command) => {
14
- command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
15
- if (await getTokens()) {
16
- verboseMessage(`Listing providers in realm "${state.getRealm()}"...`);
17
- const outcome = await listSocialProviders();
18
- if (!outcome) process.exitCode = 1;
19
- } else {
20
- process.exitCode = 1;
6
+ export default function setup() {
7
+ const program = new FrodoCommand('frodo idp list');
8
+ program.description('List (social) identity providers.')
9
+ // .addOption(
10
+ // new Option('-l, --long', 'Long with all fields.').default(false, 'false')
11
+ // )
12
+ .action(
13
+ // implement command logic inside action handler
14
+ async (host, realm, user, password, options, command) => {
15
+ command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
16
+ if (await getTokens()) {
17
+ verboseMessage(`Listing providers in realm "${state.getRealm()}"...`);
18
+ const outcome = await listSocialProviders();
19
+ if (!outcome) process.exitCode = 1;
20
+ } else {
21
+ process.exitCode = 1;
22
+ }
21
23
  }
24
+ // end command logic inside action handler
25
+ );
26
+ return program;
22
27
  }
23
- // end command logic inside action handler
24
- );
25
- program.parse();
26
28
  //# sourceMappingURL=idp-list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"idp-list.js","names":["state","getTokens","listSocialProviders","verboseMessage","FrodoCommand","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","outcome","process","exitCode","parse"],"sources":["../../../src/cli/idp/idp-list.ts"],"sourcesContent":["import { state } from '@rockcarver/frodo-lib';\n\nimport { getTokens } from '../../ops/AuthenticateOps';\nimport { listSocialProviders } from '../../ops/IdpOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst program = new FrodoCommand('frodo idp list');\n\nprogram\n .description('List (social) identity providers.')\n // .addOption(\n // new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Listing providers in realm \"${state.getRealm()}\"...`);\n const outcome = await listSocialProviders();\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAE7C,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAMC,OAAO,GAAG,IAAID,YAAY,CAAC,gBAAgB,CAAC;AAElDC,OAAO,CACJC,WAAW,CAAC,mCAAmC;AAChD;AACA;AACA;AAAA,CACCC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMZ,SAAS,CAAC,CAAC,EAAE;IACrBE,cAAc,CAAE,+BAA8BH,KAAK,CAACe,QAAQ,CAAC,CAAE,MAAK,CAAC;IACrE,MAAMC,OAAO,GAAG,MAAMd,mBAAmB,CAAC,CAAC;IAC3C,IAAI,CAACc,OAAO,EAAEC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHb,OAAO,CAACc,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"idp-list.js","names":["state","getTokens","listSocialProviders","verboseMessage","FrodoCommand","setup","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","outcome","process","exitCode"],"sources":["../../../src/cli/idp/idp-list.ts"],"sourcesContent":["import { state } from '@rockcarver/frodo-lib';\n\nimport { getTokens } from '../../ops/AuthenticateOps';\nimport { listSocialProviders } from '../../ops/IdpOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nexport default function setup() {\n const program = new FrodoCommand('frodo idp list');\n\n program\n .description('List (social) identity providers.')\n // .addOption(\n // new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Listing providers in realm \"${state.getRealm()}\"...`);\n const outcome = await listSocialProviders();\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAE7C,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIF,YAAY,CAAC,gBAAgB,CAAC;EAElDE,OAAO,CACJC,WAAW,CAAC,mCAAmC;EAChD;EACA;EACA;EAAA,CACCC,MAAM;EACL;EACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;IACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;IACD,IAAI,MAAMb,SAAS,CAAC,CAAC,EAAE;MACrBE,cAAc,CAAE,+BAA8BH,KAAK,CAACgB,QAAQ,CAAC,CAAE,MAAK,CAAC;MACrE,MAAMC,OAAO,GAAG,MAAMf,mBAAmB,CAAC,CAAC;MAC3C,IAAI,CAACe,OAAO,EAAEC,OAAO,CAACC,QAAQ,GAAG,CAAC;IACpC,CAAC,MAAM;MACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;IACtB;EACF;EACA;EACF,CAAC;EAEH,OAAOb,OAAO;AAChB"}
@@ -1,12 +1,12 @@
1
- import path from 'path';
2
- import { fileURLToPath } from 'url';
3
1
  import { FrodoStubCommand } from '../FrodoCommand';
4
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
2
+ import ExportCmd from './idp-export.js';
3
+ import ImportCmd from './idp-import.js';
4
+ import ListCmd from './idp-list.js';
5
5
  export default function setup() {
6
- const program = new FrodoStubCommand('idp').description('Manage (social) identity providers.').executableDir(__dirname);
7
- program.command('list', 'List identity providers.');
8
- program.command('export', 'Export identity providers.');
9
- program.command('import', 'Import identity providers.');
6
+ const program = new FrodoStubCommand('idp').description('Manage (social) identity providers.');
7
+ program.addCommand(ListCmd().name('list'));
8
+ program.addCommand(ExportCmd().name('export'));
9
+ program.addCommand(ImportCmd().name('import'));
10
10
  return program;
11
11
  }
12
12
  //# sourceMappingURL=idp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"idp.js","names":["path","fileURLToPath","FrodoStubCommand","__dirname","dirname","import","meta","url","setup","program","description","executableDir","command"],"sources":["../../../src/cli/idp/idp.ts"],"sourcesContent":["import path from 'path';\nimport { fileURLToPath } from 'url';\n\nimport { FrodoStubCommand } from '../FrodoCommand';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('idp')\n .description('Manage (social) identity providers.')\n .executableDir(__dirname);\n\n program.command('list', 'List identity providers.');\n\n program.command('export', 'Export identity providers.');\n\n program.command('import', 'Import identity providers.');\n\n return program;\n}\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,SAASC,gBAAgB,QAAQ,iBAAiB;AAElD,MAAMC,SAAS,GAAGH,IAAI,CAACI,OAAO,CAACH,aAAa,CAACI,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIP,gBAAgB,CAAC,KAAK,CAAC,CACxCQ,WAAW,CAAC,qCAAqC,CAAC,CAClDC,aAAa,CAACR,SAAS,CAAC;EAE3BM,OAAO,CAACG,OAAO,CAAC,MAAM,EAAE,0BAA0B,CAAC;EAEnDH,OAAO,CAACG,OAAO,CAAC,QAAQ,EAAE,4BAA4B,CAAC;EAEvDH,OAAO,CAACG,OAAO,CAAC,QAAQ,EAAE,4BAA4B,CAAC;EAEvD,OAAOH,OAAO;AAChB"}
1
+ {"version":3,"file":"idp.js","names":["FrodoStubCommand","ExportCmd","ImportCmd","ListCmd","setup","program","description","addCommand","name"],"sources":["../../../src/cli/idp/idp.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\nimport ExportCmd from './idp-export.js';\nimport ImportCmd from './idp-import.js';\nimport ListCmd from './idp-list.js';\n\nexport default function setup() {\n const program = new FrodoStubCommand('idp').description(\n 'Manage (social) identity providers.'\n );\n\n program.addCommand(ListCmd().name('list'));\n\n program.addCommand(ExportCmd().name('export'));\n\n program.addCommand(ImportCmd().name('import'));\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,OAAOC,SAAS,MAAM,iBAAiB;AACvC,OAAOC,SAAS,MAAM,iBAAiB;AACvC,OAAOC,OAAO,MAAM,eAAe;AAEnC,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIL,gBAAgB,CAAC,KAAK,CAAC,CAACM,WAAW,CACrD,qCACF,CAAC;EAEDD,OAAO,CAACE,UAAU,CAACJ,OAAO,CAAC,CAAC,CAACK,IAAI,CAAC,MAAM,CAAC,CAAC;EAE1CH,OAAO,CAACE,UAAU,CAACN,SAAS,CAAC,CAAC,CAACO,IAAI,CAAC,QAAQ,CAAC,CAAC;EAE9CH,OAAO,CAACE,UAAU,CAACL,SAAS,CAAC,CAAC,CAACM,IAAI,CAAC,QAAQ,CAAC,CAAC;EAE9C,OAAOH,OAAO;AAChB"}
@@ -4,31 +4,33 @@ import { getTokens } from '../../ops/AuthenticateOps';
4
4
  import { deleteJourney, deleteJourneys } from '../../ops/JourneyOps';
5
5
  import { printMessage, verboseMessage } from '../../utils/Console';
6
6
  import { FrodoCommand } from '../FrodoCommand';
7
- const program = new FrodoCommand('frodo journey delete');
8
- program.description('Delete journeys/trees.').addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a is ignored.')).addOption(new Option('-a, --all', 'Delete all the journeys/trees in a realm. Ignored with -i.')).addOption(new Option('--no-deep', 'No deep delete. This leaves orphaned configuration artifacts behind.')).addOption(new Option('--verbose', 'Verbose output during command execution. If specified, may or may not produce additional output.').default(false, 'off')).action(
9
- // implement command logic inside action handler
10
- async (host, realm, user, password, options, command) => {
11
- command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
12
- // delete by id
13
- if (options.journeyId && (await getTokens())) {
14
- verboseMessage(`Deleting journey ${options.journeyId} in realm "${state.getRealm()}"...`);
15
- const outcome = await deleteJourney(options.journeyId, options);
16
- if (!outcome) process.exitCode = 1;
17
- }
18
- // --all -a
19
- else if (options.all && (await getTokens())) {
20
- verboseMessage('Deleting all journeys...');
21
- const outcome = await deleteJourneys(options);
22
- if (!outcome) process.exitCode = 1;
23
- }
24
- // unrecognized combination of options or no options
25
- else {
26
- printMessage('Unrecognized combination of options or no options...', 'error');
27
- program.help();
28
- process.exitCode = 1;
7
+ export default function setup() {
8
+ const program = new FrodoCommand('frodo journey delete');
9
+ program.description('Delete journeys/trees.').addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a is ignored.')).addOption(new Option('-a, --all', 'Delete all the journeys/trees in a realm. Ignored with -i.')).addOption(new Option('--no-deep', 'No deep delete. This leaves orphaned configuration artifacts behind.')).addOption(new Option('--verbose', 'Verbose output during command execution. If specified, may or may not produce additional output.').default(false, 'off')).action(
10
+ // implement command logic inside action handler
11
+ async (host, realm, user, password, options, command) => {
12
+ command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
13
+ // delete by id
14
+ if (options.journeyId && (await getTokens())) {
15
+ verboseMessage(`Deleting journey ${options.journeyId} in realm "${state.getRealm()}"...`);
16
+ const outcome = await deleteJourney(options.journeyId, options);
17
+ if (!outcome) process.exitCode = 1;
18
+ }
19
+ // --all -a
20
+ else if (options.all && (await getTokens())) {
21
+ verboseMessage('Deleting all journeys...');
22
+ const outcome = await deleteJourneys(options);
23
+ if (!outcome) process.exitCode = 1;
24
+ }
25
+ // unrecognized combination of options or no options
26
+ else {
27
+ printMessage('Unrecognized combination of options or no options...', 'error');
28
+ program.help();
29
+ process.exitCode = 1;
30
+ }
29
31
  }
32
+ // end command logic inside action handler
33
+ );
34
+ return program;
30
35
  }
31
- // end command logic inside action handler
32
- );
33
- program.parse();
34
36
  //# sourceMappingURL=journey-delete.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"journey-delete.js","names":["state","Option","getTokens","deleteJourney","deleteJourneys","printMessage","verboseMessage","FrodoCommand","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","getRealm","outcome","process","exitCode","all","help","parse"],"sources":["../../../src/cli/journey/journey-delete.ts"],"sourcesContent":["import { state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { getTokens } from '../../ops/AuthenticateOps';\nimport { deleteJourney, deleteJourneys } from '../../ops/JourneyOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst program = new FrodoCommand('frodo journey delete');\n\nprogram\n .description('Delete journeys/trees.')\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a is ignored.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Delete all the journeys/trees in a realm. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '--no-deep',\n 'No deep delete. This leaves orphaned configuration artifacts behind.'\n )\n )\n .addOption(\n new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n ).default(false, 'off')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // delete by id\n if (options.journeyId && (await getTokens())) {\n verboseMessage(\n `Deleting journey ${\n options.journeyId\n } in realm \"${state.getRealm()}\"...`\n );\n const outcome = await deleteJourney(options.journeyId, options);\n if (!outcome) process.exitCode = 1;\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Deleting all journeys...');\n const outcome = await deleteJourneys(options);\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SAASC,aAAa,EAAEC,cAAc,QAAQ,sBAAsB;AACpE,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAMC,OAAO,GAAG,IAAID,YAAY,CAAC,sBAAsB,CAAC;AAExDC,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIT,MAAM,CACR,4BAA4B,EAC5B,sDACF,CACF,CAAC,CACAS,SAAS,CACR,IAAIT,MAAM,CACR,WAAW,EACX,4DACF,CACF,CAAC,CACAS,SAAS,CACR,IAAIT,MAAM,CACR,WAAW,EACX,sEACF,CACF,CAAC,CACAS,SAAS,CACR,IAAIT,MAAM,CACR,WAAW,EACX,kGACF,CAAC,CAACU,OAAO,CAAC,KAAK,EAAE,KAAK,CACxB,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD;EACA,IAAID,OAAO,CAACG,SAAS,KAAK,MAAMlB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CI,cAAc,CACX,oBACCW,OAAO,CAACG,SACT,cAAapB,KAAK,CAACqB,QAAQ,CAAC,CAAE,MACjC,CAAC;IACD,MAAMC,OAAO,GAAG,MAAMnB,aAAa,CAACc,OAAO,CAACG,SAAS,EAAEH,OAAO,CAAC;IAC/D,IAAI,CAACK,OAAO,EAAEC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIP,OAAO,CAACQ,GAAG,KAAK,MAAMvB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CI,cAAc,CAAC,0BAA0B,CAAC;IAC1C,MAAMgB,OAAO,GAAG,MAAMlB,cAAc,CAACa,OAAO,CAAC;IAC7C,IAAI,CAACK,OAAO,EAAEC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK;IACHnB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDG,OAAO,CAACkB,IAAI,CAAC,CAAC;IACdH,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHhB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"journey-delete.js","names":["state","Option","getTokens","deleteJourney","deleteJourneys","printMessage","verboseMessage","FrodoCommand","setup","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","getRealm","outcome","process","exitCode","all","help"],"sources":["../../../src/cli/journey/journey-delete.ts"],"sourcesContent":["import { state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { getTokens } from '../../ops/AuthenticateOps';\nimport { deleteJourney, deleteJourneys } from '../../ops/JourneyOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nexport default function setup() {\n const program = new FrodoCommand('frodo journey delete');\n\n program\n .description('Delete journeys/trees.')\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a is ignored.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Delete all the journeys/trees in a realm. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '--no-deep',\n 'No deep delete. This leaves orphaned configuration artifacts behind.'\n )\n )\n .addOption(\n new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n ).default(false, 'off')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // delete by id\n if (options.journeyId && (await getTokens())) {\n verboseMessage(\n `Deleting journey ${\n options.journeyId\n } in realm \"${state.getRealm()}\"...`\n );\n const outcome = await deleteJourney(options.journeyId, options);\n if (!outcome) process.exitCode = 1;\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Deleting all journeys...');\n const outcome = await deleteJourneys(options);\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SAASC,aAAa,EAAEC,cAAc,QAAQ,sBAAsB;AACpE,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIF,YAAY,CAAC,sBAAsB,CAAC;EAExDE,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIV,MAAM,CACR,4BAA4B,EAC5B,sDACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,WAAW,EACX,4DACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,WAAW,EACX,sEACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,WAAW,EACX,kGACF,CAAC,CAACW,OAAO,CAAC,KAAK,EAAE,KAAK,CACxB,CAAC,CACAC,MAAM;EACL;EACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;IACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;IACD;IACA,IAAID,OAAO,CAACG,SAAS,KAAK,MAAMnB,SAAS,CAAC,CAAC,CAAC,EAAE;MAC5CI,cAAc,CACX,oBACCY,OAAO,CAACG,SACT,cAAarB,KAAK,CAACsB,QAAQ,CAAC,CAAE,MACjC,CAAC;MACD,MAAMC,OAAO,GAAG,MAAMpB,aAAa,CAACe,OAAO,CAACG,SAAS,EAAEH,OAAO,CAAC;MAC/D,IAAI,CAACK,OAAO,EAAEC,OAAO,CAACC,QAAQ,GAAG,CAAC;IACpC;IACA;IAAA,KACK,IAAIP,OAAO,CAACQ,GAAG,KAAK,MAAMxB,SAAS,CAAC,CAAC,CAAC,EAAE;MAC3CI,cAAc,CAAC,0BAA0B,CAAC;MAC1C,MAAMiB,OAAO,GAAG,MAAMnB,cAAc,CAACc,OAAO,CAAC;MAC7C,IAAI,CAACK,OAAO,EAAEC,OAAO,CAACC,QAAQ,GAAG,CAAC;IACpC;IACA;IAAA,KACK;MACHpB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;MACDI,OAAO,CAACkB,IAAI,CAAC,CAAC;MACdH,OAAO,CAACC,QAAQ,GAAG,CAAC;IACtB;EACF;EACA;EACF,CAAC;EAEH,OAAOhB,OAAO;AAChB"}
@@ -13,79 +13,100 @@ const {
13
13
  readJourneys,
14
14
  exportJourney
15
15
  } = frodo.authn.journey;
16
- const program = new FrodoCommand('frodo journey describe');
17
- program.description('If -h is supplied, describe the journey/tree indicated by -i, or all journeys/trees in the realm if no -i is supplied, otherwise describe the journey/tree export file indicated by -f.').addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the journey export file to describe. Ignored with -A.')).addOption(new Option('-F, --output-file <file>', 'Name of the file to write the output to.')).addOption(new Option('--markdown', 'Output in markdown.')).addOption(new Option('-o, --override-version <version>', "Override version. Notation: '<major>.<minor>.<patch>' e.g. '7.2.0'. Override detected version with any version. This is helpful in order to check if journeys in one environment would be compatible running in another environment (e.g. in preparation of migrating from on-prem to ForgeRock Identity Cloud.")).action(
18
- // implement command logic inside action handler
19
- async (host, realm, user, password, options, command) => {
20
- command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
21
- host = host ? host : state.getHost();
22
- if (options.outputFile) state.setOutputFile(options.outputFile);
23
- // TODO: review checks for arguments
24
- if (typeof host === 'undefined' || typeof options.file !== 'undefined') {
25
- if (typeof host === 'undefined' && typeof options.file === 'undefined') {
26
- printMessage('Need either [host] or -f.', 'error');
27
- process.exitCode = 1;
28
- return;
29
- }
30
- verboseMessage(`Describing local journey file ${options.file}...`);
31
- try {
32
- var _fileData$tree, _fileData$tree2;
16
+ export default function setup() {
17
+ const program = new FrodoCommand('frodo journey describe');
18
+ program.description('If -h is supplied, describe the journey/tree indicated by -i, or all journeys/trees in the realm if no -i is supplied, otherwise describe the journey/tree export file indicated by -f.').addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the journey export file to describe. Ignored with -A.')).addOption(new Option('-F, --output-file <file>', 'Name of the file to write the output to.')).addOption(new Option('--markdown', 'Output in markdown.')).addOption(new Option('-o, --override-version <version>', "Override version. Notation: '<major>.<minor>.<patch>' e.g. '7.2.0'. Override detected version with any version. This is helpful in order to check if journeys in one environment would be compatible running in another environment (e.g. in preparation of migrating from on-prem to ForgeRock Identity Cloud.")).action(
19
+ // implement command logic inside action handler
20
+ async (host, realm, user, password, options, command) => {
21
+ command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
22
+ host = host ? host : state.getHost();
23
+ if (options.outputFile) state.setOutputFile(options.outputFile);
24
+ // TODO: review checks for arguments
25
+ if (typeof host === 'undefined' || typeof options.file !== 'undefined') {
26
+ if (typeof host === 'undefined' && typeof options.file === 'undefined') {
27
+ printMessage('Need either [host] or -f.', 'error');
28
+ process.exitCode = 1;
29
+ return;
30
+ }
31
+ verboseMessage(`Describing local journey file ${options.file}...`);
32
+ try {
33
+ var _fileData$tree, _fileData$tree2;
34
+ // override version
35
+ if (typeof options.overrideVersion !== 'undefined') {
36
+ state.setAmVersion(options.overrideVersion);
37
+ }
38
+ const fileData = JSON.parse(fs.readFileSync(options.file, 'utf8'));
39
+ let journeyData;
40
+ // single or multi tree export?
41
+ // multi - by id
42
+ if (typeof options.journeyId !== 'undefined' && fileData.trees && fileData.trees[options.journeyId]) {
43
+ journeyData = fileData.trees[options.journeyId];
44
+ }
45
+ // multi - first
46
+ else if (typeof options.journeyId === 'undefined' && fileData.trees) {
47
+ [journeyData] = Object.values(fileData.trees);
48
+ }
49
+ // single - by id
50
+ else if (typeof options.journeyId !== 'undefined' && options.journeyId === ((_fileData$tree = fileData.tree) === null || _fileData$tree === void 0 ? void 0 : _fileData$tree._id)) {
51
+ journeyData = fileData;
52
+ }
53
+ // single
54
+ else if (typeof options.journeyId === 'undefined' && (_fileData$tree2 = fileData.tree) !== null && _fileData$tree2 !== void 0 && _fileData$tree2._id) {
55
+ journeyData = fileData;
56
+ }
57
+ // no journey/tree found
58
+ else {
59
+ throw new Error(typeof options.journeyId === 'undefined' ? `No journey found in ${options.file}` : `Journey '${options.journeyId}' not found in ${options.file}`);
60
+ }
61
+ // ANSI text output
62
+ if (!options.markdown) {
63
+ const outcome = await describeJourney(journeyData, createFileParamTreeExportResolver(options.file));
64
+ if (!outcome) process.exitCode = 1;
65
+ }
66
+ // Markdown output
67
+ else {
68
+ // reset output file
69
+ if (options.outputFile) saveTextToFile('', options.outputFile);
70
+ const outcome = await describeJourneyMd(journeyData, createFileParamTreeExportResolver(options.file));
71
+ if (!outcome) process.exitCode = 1;
72
+ }
73
+ } catch (error) {
74
+ printMessage(error.message, 'error');
75
+ process.exitCode = 1;
76
+ }
77
+ } else if (await getTokens()) {
78
+ verboseMessage(`Describing journey(s) in realm "${state.getRealm()}"...`);
33
79
  // override version
34
80
  if (typeof options.overrideVersion !== 'undefined') {
35
81
  state.setAmVersion(options.overrideVersion);
36
82
  }
37
- const fileData = JSON.parse(fs.readFileSync(options.file, 'utf8'));
38
- let journeyData;
39
- // single or multi tree export?
40
- // multi - by id
41
- if (typeof options.journeyId !== 'undefined' && fileData.trees && fileData.trees[options.journeyId]) {
42
- journeyData = fileData.trees[options.journeyId];
43
- }
44
- // multi - first
45
- else if (typeof options.journeyId === 'undefined' && fileData.trees) {
46
- [journeyData] = Object.values(fileData.trees);
47
- }
48
- // single - by id
49
- else if (typeof options.journeyId !== 'undefined' && options.journeyId === ((_fileData$tree = fileData.tree) === null || _fileData$tree === void 0 ? void 0 : _fileData$tree._id)) {
50
- journeyData = fileData;
51
- }
52
- // single
53
- else if (typeof options.journeyId === 'undefined' && (_fileData$tree2 = fileData.tree) !== null && _fileData$tree2 !== void 0 && _fileData$tree2._id) {
54
- journeyData = fileData;
55
- }
56
- // no journey/tree found
57
- else {
58
- throw new Error(typeof options.journeyId === 'undefined' ? `No journey found in ${options.file}` : `Journey '${options.journeyId}' not found in ${options.file}`);
59
- }
60
- // ANSI text output
61
- if (!options.markdown) {
62
- const outcome = await describeJourney(journeyData, createFileParamTreeExportResolver(options.file));
63
- if (!outcome) process.exitCode = 1;
64
- }
65
- // Markdown output
66
- else {
67
- // reset output file
68
- if (options.outputFile) saveTextToFile('', options.outputFile);
69
- const outcome = await describeJourneyMd(journeyData, createFileParamTreeExportResolver(options.file));
70
- if (!outcome) process.exitCode = 1;
71
- }
72
- } catch (error) {
73
- printMessage(error.message, 'error');
74
- process.exitCode = 1;
75
- }
76
- } else if (await getTokens()) {
77
- verboseMessage(`Describing journey(s) in realm "${state.getRealm()}"...`);
78
- // override version
79
- if (typeof options.overrideVersion !== 'undefined') {
80
- state.setAmVersion(options.overrideVersion);
81
- }
82
- if (typeof options.journeyId === 'undefined') {
83
- let journeys = [];
84
- journeys = await readJourneys();
85
- for (const journey of journeys) {
83
+ if (typeof options.journeyId === 'undefined') {
84
+ let journeys = [];
85
+ journeys = await readJourneys();
86
+ for (const journey of journeys) {
87
+ try {
88
+ // eslint-disable-next-line no-await-in-loop, dot-notation
89
+ const treeData = await exportJourney(journey['_id']);
90
+ // ANSI text output
91
+ if (!options.markdown) {
92
+ const outcome = await describeJourney(treeData);
93
+ if (!outcome) process.exitCode = 1;
94
+ }
95
+ // Markdown output
96
+ else {
97
+ // reset output file
98
+ if (options.outputFile) saveTextToFile('', options.outputFile);
99
+ const outcome = await describeJourneyMd(treeData);
100
+ if (!outcome) process.exitCode = 1;
101
+ }
102
+ } catch (error) {
103
+ printError(error);
104
+ process.exitCode = 1;
105
+ }
106
+ }
107
+ } else {
86
108
  try {
87
- // eslint-disable-next-line no-await-in-loop, dot-notation
88
- const treeData = await exportJourney(journey['_id']);
109
+ const treeData = await exportJourney(options.journeyId);
89
110
  // ANSI text output
90
111
  if (!options.markdown) {
91
112
  const outcome = await describeJourney(treeData);
@@ -103,29 +124,10 @@ async (host, realm, user, password, options, command) => {
103
124
  process.exitCode = 1;
104
125
  }
105
126
  }
106
- } else {
107
- try {
108
- const treeData = await exportJourney(options.journeyId);
109
- // ANSI text output
110
- if (!options.markdown) {
111
- const outcome = await describeJourney(treeData);
112
- if (!outcome) process.exitCode = 1;
113
- }
114
- // Markdown output
115
- else {
116
- // reset output file
117
- if (options.outputFile) saveTextToFile('', options.outputFile);
118
- const outcome = await describeJourneyMd(treeData);
119
- if (!outcome) process.exitCode = 1;
120
- }
121
- } catch (error) {
122
- printError(error);
123
- process.exitCode = 1;
124
- }
125
127
  }
126
128
  }
129
+ // end command logic inside action handler
130
+ );
131
+ return program;
127
132
  }
128
- // end command logic inside action handler
129
- );
130
- program.parse();
131
133
  //# sourceMappingURL=journey-describe.js.map