@rockcarver/frodo-cli 0.10.4 → 0.11.1-2

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 (247) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/README.md +3 -3
  3. package/package.json +17 -15
  4. package/src/app.js +7 -6
  5. package/src/cli/_template/cmd-delete.js +9 -8
  6. package/src/cli/_template/cmd-describe.js +9 -8
  7. package/src/cli/_template/cmd-export.js +9 -8
  8. package/src/cli/_template/cmd-import.js +9 -8
  9. package/src/cli/_template/cmd-list.js +9 -8
  10. package/src/cli/_template/cmd-sub1-delete.js +9 -8
  11. package/src/cli/_template/cmd-sub1-describe.js +9 -8
  12. package/src/cli/_template/cmd-sub1-export.js +9 -8
  13. package/src/cli/_template/cmd-sub1-import.js +9 -8
  14. package/src/cli/_template/cmd-sub1-list.js +9 -8
  15. package/src/cli/_template/cmd-sub2-delete.js +9 -8
  16. package/src/cli/_template/cmd-sub2-describe.js +9 -8
  17. package/src/cli/_template/cmd-sub2-export.js +9 -8
  18. package/src/cli/_template/cmd-sub2-import.js +9 -8
  19. package/src/cli/_template/cmd-sub2-list.js +9 -8
  20. package/src/cli/admin/admin-add-autoid-static-user-mapping.js +12 -12
  21. package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +15 -18
  22. package/src/cli/admin/admin-get-access-token.js +12 -12
  23. package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.js +13 -13
  24. package/src/cli/admin/admin-hide-generic-extension-attributes.js +13 -13
  25. package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +13 -13
  26. package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +14 -13
  27. package/src/cli/admin/admin-list-static-user-mappings.js +12 -12
  28. package/src/cli/admin/admin-remove-static-user-mapping.js +12 -12
  29. package/src/cli/admin/admin-repair-org-model.js +13 -13
  30. package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +13 -13
  31. package/src/cli/admin/admin-show-generic-extension-attributes.js +13 -13
  32. package/src/cli/app/app-delete.js +9 -8
  33. package/src/cli/app/app-describe.js +9 -8
  34. package/src/cli/app/app-export.js +15 -15
  35. package/src/cli/app/app-import.js +11 -11
  36. package/src/cli/app/app-list.js +11 -12
  37. package/src/cli/conn/conn-add.js +11 -11
  38. package/src/cli/conn/conn-delete.js +3 -1
  39. package/src/cli/conn/conn-describe.js +3 -1
  40. package/src/cli/conn/conn-list.js +3 -4
  41. package/src/cli/email/email-template-export.js +16 -16
  42. package/src/cli/email/email-template-import.js +16 -16
  43. package/src/cli/email/email-template-list.js +11 -11
  44. package/src/cli/esv/esv-apply.js +12 -12
  45. package/src/cli/esv/esv-secret-create.js +11 -11
  46. package/src/cli/esv/esv-secret-delete.js +13 -13
  47. package/src/cli/esv/esv-secret-describe.js +11 -11
  48. package/src/cli/esv/esv-secret-export.js +9 -8
  49. package/src/cli/esv/esv-secret-import.js +9 -8
  50. package/src/cli/esv/esv-secret-list.js +11 -11
  51. package/src/cli/esv/esv-secret-set.js +11 -11
  52. package/src/cli/esv/esv-secret-version-activate.js +12 -12
  53. package/src/cli/esv/esv-secret-version-create.js +11 -11
  54. package/src/cli/esv/esv-secret-version-deactivate.js +12 -12
  55. package/src/cli/esv/esv-secret-version-delete.js +13 -13
  56. package/src/cli/esv/esv-secret-version-list.js +11 -11
  57. package/src/cli/esv/esv-variable-create.js +11 -11
  58. package/src/cli/esv/esv-variable-delete.js +13 -16
  59. package/src/cli/esv/esv-variable-describe.js +11 -11
  60. package/src/cli/esv/esv-variable-export.js +9 -8
  61. package/src/cli/esv/esv-variable-import.js +9 -8
  62. package/src/cli/esv/esv-variable-list.js +11 -11
  63. package/src/cli/esv/esv-variable-set.js +13 -16
  64. package/src/cli/idm/idm-count.js +11 -11
  65. package/src/cli/idm/idm-export.js +16 -16
  66. package/src/cli/idm/idm-list.js +11 -11
  67. package/src/cli/idp/idp-export.js +15 -19
  68. package/src/cli/idp/idp-import.js +18 -18
  69. package/src/cli/idp/idp-list.js +12 -12
  70. package/src/cli/info/info.js +23 -19
  71. package/src/cli/journey/journey-delete.js +14 -14
  72. package/src/cli/journey/journey-describe.js +26 -35
  73. package/src/cli/journey/journey-export.js +18 -21
  74. package/src/cli/journey/journey-import.js +17 -17
  75. package/src/cli/journey/journey-list.js +12 -12
  76. package/src/cli/journey/journey-prune.js +12 -12
  77. package/src/cli/logging/logs-list.js +33 -28
  78. package/src/cli/logging/logs-tail.js +26 -22
  79. package/src/cli/realm/realm-add-custom-domain.js +13 -13
  80. package/src/cli/realm/realm-describe.js +14 -14
  81. package/src/cli/realm/realm-list.js +11 -11
  82. package/src/cli/realm/realm-remove-custom-domain.js +16 -13
  83. package/src/cli/saml/saml-cot-export.js +16 -16
  84. package/src/cli/saml/saml-cot-import.js +18 -18
  85. package/src/cli/saml/saml-cot-list.js +12 -12
  86. package/src/cli/saml/saml-describe.js +12 -12
  87. package/src/cli/saml/saml-export.js +16 -19
  88. package/src/cli/saml/saml-import.js +19 -18
  89. package/src/cli/saml/saml-list.js +12 -12
  90. package/src/cli/saml/saml-metadata-export.js +15 -19
  91. package/src/cli/script/script-delete.js +9 -8
  92. package/src/cli/script/script-describe.js +9 -8
  93. package/src/cli/script/script-export.js +18 -20
  94. package/src/cli/script/script-import.js +13 -12
  95. package/src/cli/script/script-list.js +12 -12
  96. package/src/cli/theme/theme-delete.js +17 -21
  97. package/src/cli/theme/theme-export.js +19 -18
  98. package/src/cli/theme/theme-import.js +21 -20
  99. package/src/cli/theme/theme-list.js +12 -12
  100. package/.eslintrc +0 -29
  101. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
  102. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  103. package/.github/README.md +0 -273
  104. package/.github/workflows/pipeline.yml +0 -487
  105. package/.prettierrc +0 -6
  106. package/CODE_OF_CONDUCT.md +0 -128
  107. package/docs/BINARIES.md +0 -22
  108. package/docs/CONTRIBUTE.md +0 -96
  109. package/docs/PIPELINE.md +0 -169
  110. package/docs/images/macos_warn1.png +0 -0
  111. package/docs/images/macos_warn2.png +0 -0
  112. package/docs/images/macos_warn3.png +0 -0
  113. package/docs/images/npm_versioning_guidelines.png +0 -0
  114. package/docs/images/release_pipeline.png +0 -0
  115. package/gulpfile.js +0 -49
  116. package/jsconfig.json +0 -6
  117. package/resources/sampleEntitiesFile.json +0 -8
  118. package/resources/sampleEnvFile.env +0 -2
  119. package/src/api/AuthenticateApi.js +0 -33
  120. package/src/api/BaseApi.js +0 -242
  121. package/src/api/CirclesOfTrustApi.js +0 -87
  122. package/src/api/EmailTemplateApi.js +0 -37
  123. package/src/api/IdmConfigApi.js +0 -88
  124. package/src/api/LogApi.js +0 -45
  125. package/src/api/ManagedObjectApi.js +0 -62
  126. package/src/api/OAuth2ClientApi.js +0 -69
  127. package/src/api/OAuth2OIDCApi.js +0 -73
  128. package/src/api/OAuth2ProviderApi.js +0 -32
  129. package/src/api/RealmApi.js +0 -99
  130. package/src/api/Saml2Api.js +0 -176
  131. package/src/api/ScriptApi.js +0 -84
  132. package/src/api/SecretsApi.js +0 -151
  133. package/src/api/ServerInfoApi.js +0 -41
  134. package/src/api/SocialIdentityProvidersApi.js +0 -114
  135. package/src/api/StartupApi.js +0 -45
  136. package/src/api/ThemeApi.js +0 -181
  137. package/src/api/TreeApi.js +0 -207
  138. package/src/api/VariablesApi.js +0 -104
  139. package/src/api/utils/ApiUtils.js +0 -77
  140. package/src/api/utils/Base64.js +0 -62
  141. package/src/cli/journey/journey-delete.e2e.test.js +0 -380
  142. package/src/cli/journey/journey-list.e2e.test.js +0 -141
  143. package/src/cli/theme/theme-delete.e2e.test.js +0 -178
  144. package/src/cli/theme/theme-list.e2e.test.js +0 -119
  145. package/src/ops/AdminOps.js +0 -901
  146. package/src/ops/AuthenticateOps.js +0 -342
  147. package/src/ops/CirclesOfTrustOps.js +0 -350
  148. package/src/ops/ConnectionProfileOps.js +0 -254
  149. package/src/ops/EmailTemplateOps.js +0 -326
  150. package/src/ops/IdmOps.js +0 -227
  151. package/src/ops/IdpOps.js +0 -342
  152. package/src/ops/JourneyOps.js +0 -2026
  153. package/src/ops/LogOps.js +0 -357
  154. package/src/ops/ManagedObjectOps.js +0 -34
  155. package/src/ops/OAuth2ClientOps.js +0 -151
  156. package/src/ops/OrganizationOps.js +0 -85
  157. package/src/ops/RealmOps.js +0 -139
  158. package/src/ops/SamlOps.js +0 -541
  159. package/src/ops/ScriptOps.js +0 -211
  160. package/src/ops/SecretsOps.js +0 -288
  161. package/src/ops/StartupOps.js +0 -114
  162. package/src/ops/ThemeOps.js +0 -379
  163. package/src/ops/VariablesOps.js +0 -185
  164. package/src/ops/templates/OAuth2ClientTemplate.json +0 -270
  165. package/src/ops/templates/OrgModelUserAttributesTemplate.json +0 -149
  166. package/src/ops/templates/cloud/GenericExtensionAttributesTemplate.json +0 -392
  167. package/src/ops/templates/cloud/managed.json +0 -4119
  168. package/src/ops/utils/Console.js +0 -434
  169. package/src/ops/utils/DataProtection.js +0 -92
  170. package/src/ops/utils/ExportImportUtils.js +0 -146
  171. package/src/ops/utils/OpsUtils.js +0 -76
  172. package/src/ops/utils/Wordwrap.js +0 -11
  173. package/src/storage/SessionStorage.js +0 -45
  174. package/test/client_cli/en/connections.test.js +0 -62
  175. package/test/client_cli/en/connections_add.test.js +0 -34
  176. package/test/client_cli/en/connections_delete.test.js +0 -34
  177. package/test/client_cli/en/connections_list.test.js +0 -34
  178. package/test/client_cli/en/email_templates.test.js +0 -77
  179. package/test/client_cli/en/email_templates_export.test.js +0 -196
  180. package/test/client_cli/en/email_templates_import.test.js +0 -145
  181. package/test/client_cli/en/email_templates_list.test.js +0 -130
  182. package/test/client_cli/en/idm.test.js +0 -111
  183. package/test/client_cli/en/idm_count.test.js +0 -121
  184. package/test/client_cli/en/idm_export.test.js +0 -136
  185. package/test/client_cli/en/idm_exportAll.test.js +0 -156
  186. package/test/client_cli/en/idm_exportAllRaw.test.js +0 -120
  187. package/test/client_cli/en/idm_import.test_.js +0 -103
  188. package/test/client_cli/en/idm_importAll.test_.js +0 -103
  189. package/test/client_cli/en/idm_list.test.js +0 -103
  190. package/test/client_cli/en/info.test.js +0 -125
  191. package/test/client_cli/en/journey.test.js +0 -127
  192. package/test/client_cli/en/journey_describe.test.js +0 -196
  193. package/test/client_cli/en/journey_export.test.js +0 -213
  194. package/test/client_cli/en/journey_import.test.js +0 -195
  195. package/test/client_cli/en/journey_importAll.test.js +0 -180
  196. package/test/client_cli/en/journey_list.test.js +0 -162
  197. package/test/client_cli/en/journey_prune.test.js +0 -148
  198. package/test/client_cli/en/logs.test.js +0 -79
  199. package/test/client_cli/en/logs_list.test.js +0 -83
  200. package/test/client_cli/en/logs_tail.test.js +0 -118
  201. package/test/client_cli/en/root.test.js +0 -91
  202. package/test/client_cli/en/script.test.js +0 -77
  203. package/test/client_cli/en/script_export.test.js +0 -213
  204. package/test/client_cli/en/script_import.test.js +0 -163
  205. package/test/client_cli/en/script_list.test.js +0 -148
  206. package/test/client_cli/utils/utils.js +0 -32
  207. package/test/e2e/journey/baseline/ForgottenUsername.journey.json +0 -216
  208. package/test/e2e/journey/baseline/Login.journey.json +0 -205
  209. package/test/e2e/journey/baseline/PasswordGrant.journey.json +0 -139
  210. package/test/e2e/journey/baseline/ProgressiveProfile.journey.json +0 -198
  211. package/test/e2e/journey/baseline/Registration.journey.json +0 -249
  212. package/test/e2e/journey/baseline/ResetPassword.journey.json +0 -268
  213. package/test/e2e/journey/baseline/UpdatePassword.journey.json +0 -323
  214. package/test/e2e/journey/baseline/allAlphaJourneys.journeys.json +0 -1520
  215. package/test/e2e/journey/delete/ForgottenUsername.journey.json +0 -216
  216. package/test/e2e/journey/delete/Login.journey.json +0 -205
  217. package/test/e2e/journey/delete/PasswordGrant.journey.json +0 -139
  218. package/test/e2e/journey/delete/ProgressiveProfile.journey.json +0 -198
  219. package/test/e2e/journey/delete/Registration.journey.json +0 -249
  220. package/test/e2e/journey/delete/ResetPassword.journey.json +0 -268
  221. package/test/e2e/journey/delete/UpdatePassword.journey.json +0 -323
  222. package/test/e2e/journey/delete/deleteMe.journey.json +0 -230
  223. package/test/e2e/journey/list/Disabled.journey.json +0 -43
  224. package/test/e2e/journey/list/ForgottenUsername.journey.json +0 -216
  225. package/test/e2e/journey/list/Login.journey.json +0 -205
  226. package/test/e2e/journey/list/PasswordGrant.journey.json +0 -139
  227. package/test/e2e/journey/list/ProgressiveProfile.journey.json +0 -198
  228. package/test/e2e/journey/list/Registration.journey.json +0 -249
  229. package/test/e2e/journey/list/ResetPassword.journey.json +0 -268
  230. package/test/e2e/journey/list/UpdatePassword.journey.json +0 -323
  231. package/test/e2e/setup.js +0 -98
  232. package/test/e2e/theme/baseline/Contrast.theme.json +0 -95
  233. package/test/e2e/theme/baseline/Highlander.theme.json +0 -95
  234. package/test/e2e/theme/baseline/Robroy.theme.json +0 -95
  235. package/test/e2e/theme/baseline/Starter-Theme.theme.json +0 -94
  236. package/test/e2e/theme/baseline/Zardoz.theme.json +0 -95
  237. package/test/e2e/theme/import/Contrast.theme.json +0 -95
  238. package/test/e2e/theme/import/Highlander.theme.json +0 -95
  239. package/test/e2e/theme/import/Robroy.theme.json +0 -95
  240. package/test/e2e/theme/import/Starter-Theme.theme.json +0 -94
  241. package/test/e2e/theme/import/Zardoz.default.theme.json +0 -95
  242. package/test/fs_tmp/.gitkeep +0 -2
  243. package/test/global/setup.js +0 -65
  244. package/test/lib_api/unit_tests/ApiUtils.test.js +0 -186
  245. package/test/lib_api/unit_tests/Base64URL.test.js +0 -22
  246. package/test/lib_api/unit_tests/DataProtection.test.js +0 -25
  247. package/test/lib_api/unit_tests/ExportImportUtils.test.js +0 -121
@@ -1,13 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Theme, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
5
- import { printMessage } from '../../ops/utils/Console.js';
6
- import {
7
- deleteThemeByNameCmd,
8
- deleteThemeCmd,
9
- deleteThemesCmd,
10
- } from '../../ops/ThemeOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { deleteThemeByNameCmd, deleteThemeCmd, deleteThemesCmd } = Theme;
11
7
 
12
8
  const program = new Command('frodo theme delete');
13
9
 
@@ -42,41 +38,41 @@ program
42
38
  .action(
43
39
  // implement command logic inside action handler
44
40
  async (host, realm, user, password, options) => {
45
- storage.session.setTenant(host);
46
- storage.session.setRealm(realm);
47
- storage.session.setUsername(user);
48
- storage.session.setPassword(password);
49
- storage.session.setDeploymentType(options.type);
50
- storage.session.setAllowInsecureConnection(options.insecure);
41
+ state.default.session.setTenant(host);
42
+ state.default.session.setRealm(realm);
43
+ state.default.session.setUsername(user);
44
+ state.default.session.setPassword(password);
45
+ state.default.session.setDeploymentType(options.type);
46
+ state.default.session.setAllowInsecureConnection(options.insecure);
51
47
  if (await getTokens()) {
52
48
  // delete by name
53
49
  if (options.themeName) {
54
- printMessage(
50
+ console.log(
55
51
  `Deleting theme with name "${
56
52
  options.themeName
57
- }" from realm "${storage.session.getRealm()}"...`
53
+ }" from realm "${state.default.session.getRealm()}"...`
58
54
  );
59
55
  deleteThemeByNameCmd(options.themeName, options.file);
60
56
  }
61
57
  // delete by id
62
58
  else if (options.themeId) {
63
- printMessage(
59
+ console.log(
64
60
  `Deleting theme with id "${
65
61
  options.themeId
66
- }" from realm "${storage.session.getRealm()}"...`
62
+ }" from realm "${state.default.session.getRealm()}"...`
67
63
  );
68
64
  deleteThemeCmd(options.themeId, options.file);
69
65
  }
70
66
  // --all -a
71
67
  else if (options.all) {
72
- printMessage(
73
- `Deleting all themes from realm "${storage.session.getRealm()}"...`
68
+ console.log(
69
+ `Deleting all themes from realm "${state.default.session.getRealm()}"...`
74
70
  );
75
71
  deleteThemesCmd(options.file);
76
72
  }
77
73
  // unrecognized combination of options or no options
78
74
  else {
79
- printMessage('Unrecognized combination of options or no options...');
75
+ console.log('Unrecognized combination of options or no options...');
80
76
  program.help();
81
77
  }
82
78
  }
@@ -1,14 +1,15 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Theme, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
5
- import { printMessage } from '../../ops/utils/Console.js';
6
- import {
4
+
5
+ const { getTokens } = Authenticate;
6
+
7
+ const {
7
8
  exportThemeById,
8
9
  exportThemeByName,
9
10
  exportThemesToFile,
10
11
  exportThemesToFiles,
11
- } from '../../ops/ThemeOps.js';
12
+ } = Theme;
12
13
 
13
14
  const program = new Command('frodo theme export');
14
15
 
@@ -55,44 +56,44 @@ program
55
56
  .action(
56
57
  // implement command logic inside action handler
57
58
  async (host, realm, user, password, options) => {
58
- storage.session.setTenant(host);
59
- storage.session.setRealm(realm);
60
- storage.session.setUsername(user);
61
- storage.session.setPassword(password);
62
- storage.session.setDeploymentType(options.type);
63
- storage.session.setAllowInsecureConnection(options.insecure);
59
+ state.default.session.setTenant(host);
60
+ state.default.session.setRealm(realm);
61
+ state.default.session.setUsername(user);
62
+ state.default.session.setPassword(password);
63
+ state.default.session.setDeploymentType(options.type);
64
+ state.default.session.setAllowInsecureConnection(options.insecure);
64
65
  if (await getTokens()) {
65
66
  // export by name
66
67
  if (options.themeName) {
67
- printMessage(
68
+ console.log(
68
69
  `Exporting theme "${
69
70
  options.themeName
70
- }" from realm "${storage.session.getRealm()}"...`
71
+ }" from realm "${state.default.session.getRealm()}"...`
71
72
  );
72
73
  exportThemeByName(options.themeName, options.file);
73
74
  }
74
75
  // export by id
75
76
  else if (options.themeId) {
76
- printMessage(
77
+ console.log(
77
78
  `Exporting theme "${
78
79
  options.themeId
79
- }" from realm "${storage.session.getRealm()}"...`
80
+ }" from realm "${state.default.session.getRealm()}"...`
80
81
  );
81
82
  exportThemeById(options.themeId, options.file);
82
83
  }
83
84
  // --all -a
84
85
  else if (options.all) {
85
- printMessage('Exporting all themes to a single file...');
86
+ console.log('Exporting all themes to a single file...');
86
87
  exportThemesToFile(options.file);
87
88
  }
88
89
  // --all-separate -A
89
90
  else if (options.allSeparate) {
90
- printMessage('Exporting all themes to separate files...');
91
+ console.log('Exporting all themes to separate files...');
91
92
  exportThemesToFiles();
92
93
  }
93
94
  // unrecognized combination of options or no options
94
95
  else {
95
- printMessage(
96
+ console.log(
96
97
  'Unrecognized combination of options or no options...',
97
98
  'error'
98
99
  );
@@ -1,15 +1,16 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Theme, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
5
- import { printMessage } from '../../ops/utils/Console.js';
6
- import {
4
+
5
+ const { getTokens } = Authenticate;
6
+
7
+ const {
7
8
  importFirstThemeFromFile,
8
9
  importThemeById,
9
10
  importThemeByName,
10
11
  importThemesFromFile,
11
12
  importThemesFromFiles,
12
- } from '../../ops/ThemeOps.js';
13
+ } = Theme;
13
14
 
14
15
  const program = new Command('frodo theme import');
15
16
 
@@ -56,57 +57,57 @@ program
56
57
  .action(
57
58
  // implement command logic inside action handler
58
59
  async (host, realm, user, password, options) => {
59
- storage.session.setTenant(host);
60
- storage.session.setRealm(realm);
61
- storage.session.setUsername(user);
62
- storage.session.setPassword(password);
63
- storage.session.setDeploymentType(options.type);
64
- storage.session.setAllowInsecureConnection(options.insecure);
60
+ state.default.session.setTenant(host);
61
+ state.default.session.setRealm(realm);
62
+ state.default.session.setUsername(user);
63
+ state.default.session.setPassword(password);
64
+ state.default.session.setDeploymentType(options.type);
65
+ state.default.session.setAllowInsecureConnection(options.insecure);
65
66
  if (await getTokens()) {
66
67
  // import by name
67
68
  if (options.file && options.themeName) {
68
- printMessage(
69
+ console.log(
69
70
  `Importing theme with name "${
70
71
  options.themeName
71
- }" into realm "${storage.session.getRealm()}"...`
72
+ }" into realm "${state.default.session.getRealm()}"...`
72
73
  );
73
74
  importThemeByName(options.themeName, options.file);
74
75
  }
75
76
  // import by id
76
77
  else if (options.file && options.themeId) {
77
- printMessage(
78
+ console.log(
78
79
  `Importing theme with id "${
79
80
  options.themeId
80
- }" into realm "${storage.session.getRealm()}"...`
81
+ }" into realm "${state.default.session.getRealm()}"...`
81
82
  );
82
83
  importThemeById(options.themeId, options.file);
83
84
  }
84
85
  // --all -a
85
86
  else if (options.all && options.file) {
86
- printMessage(
87
+ console.log(
87
88
  `Importing all themes from a single file (${options.file})...`
88
89
  );
89
90
  importThemesFromFile(options.file);
90
91
  }
91
92
  // --all-separate -A
92
93
  else if (options.allSeparate && !options.file) {
93
- printMessage(
94
+ console.log(
94
95
  'Importing all themes from separate files in current directory...'
95
96
  );
96
97
  importThemesFromFiles();
97
98
  }
98
99
  // import single theme from file
99
100
  else if (options.file) {
100
- printMessage(
101
+ console.log(
101
102
  `Importing first theme from file "${
102
103
  options.file
103
- }" into realm "${storage.session.getRealm()}"...`
104
+ }" into realm "${state.default.session.getRealm()}"...`
104
105
  );
105
106
  importFirstThemeFromFile(options.file);
106
107
  }
107
108
  // unrecognized combination of options or no options
108
109
  else {
109
- printMessage('Unrecognized combination of options or no options...');
110
+ console.log('Unrecognized combination of options or no options...');
110
111
  program.help();
111
112
  }
112
113
  }
@@ -1,9 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Theme, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
5
- import { printMessage } from '../../ops/utils/Console.js';
6
- import { listThemes } from '../../ops/ThemeOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { listThemes } = Theme;
7
7
 
8
8
  const program = new Command('frodo theme list');
9
9
 
@@ -23,15 +23,15 @@ program
23
23
  .action(
24
24
  // implement command logic inside action handler
25
25
  async (host, realm, user, password, options) => {
26
- storage.session.setTenant(host);
27
- storage.session.setRealm(realm);
28
- storage.session.setUsername(user);
29
- storage.session.setPassword(password);
30
- storage.session.setDeploymentType(options.type);
31
- storage.session.setAllowInsecureConnection(options.insecure);
26
+ state.default.session.setTenant(host);
27
+ state.default.session.setRealm(realm);
28
+ state.default.session.setUsername(user);
29
+ state.default.session.setPassword(password);
30
+ state.default.session.setDeploymentType(options.type);
31
+ state.default.session.setAllowInsecureConnection(options.insecure);
32
32
  if (await getTokens()) {
33
- printMessage(
34
- `Listing themes in realm "${storage.session.getRealm()}"...`
33
+ console.log(
34
+ `Listing themes in realm "${state.default.session.getRealm()}"...`
35
35
  );
36
36
  listThemes(options.long);
37
37
  }
package/.eslintrc DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "extends": ["airbnb", "prettier"],
3
- "parser": "@babel/eslint-parser",
4
- "plugins": ["prettier", "jest"],
5
- "rules": {
6
- "prettier/prettier": ["error"],
7
- "import/extensions": [
8
- "error",
9
- {
10
- "js": "always",
11
- "json": "always"
12
- }
13
- ],
14
- "no-console": "off",
15
- "no-underscore-dangle": "off",
16
- "no-restricted-syntax": [
17
- "error",
18
- // "ForInStatement",
19
- // "ForOfStatement",
20
- "LabeledStatement",
21
- "WithStatement"
22
- ],
23
- "no-multi-str": "off"
24
- },
25
- "env": {
26
- "jest": true,
27
- "jest/globals": true
28
- }
29
- }
@@ -1,30 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Describe the bug**
11
- A clear and concise description of what the bug is.
12
-
13
- **To Reproduce**
14
- Steps to reproduce the behavior:
15
- 1. Run command with parameters '...'
16
- 2. See error
17
-
18
- **Expected behavior**
19
- A clear and concise description of what you expected to happen.
20
-
21
- **Screenshots**
22
- If applicable, add screenshots/command output to help explain your problem.
23
-
24
- **Desktop (please complete the following information):**
25
- - OS: [e.g. iOS]
26
- - Browser [e.g. chrome, safari]
27
- - Version [e.g. 22]
28
-
29
- **Additional context**
30
- Add any other context about the problem here.
@@ -1,20 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for frodo
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Is your feature request related to a problem? Please describe.**
11
- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
-
13
- **Describe the solution you'd like**
14
- A clear and concise description of what you want to happen.
15
-
16
- **Describe alternatives you've considered**
17
- A clear and concise description of any alternative solutions or features you've considered.
18
-
19
- **Additional context**
20
- Add any other context or screenshots about the feature request here.
package/.github/README.md DELETED
@@ -1,273 +0,0 @@
1
- <!-- README.md for GitHub; the one for NPM is ../README.md. -->
2
- # Frodo - ForgeROck DO
3
-
4
- This is the ForgeROck DO - or short frodo - command line interface, a CLI to manage ForgeRock platform deployments. Frodo supports Identity Cloud tenants, ForgeOps deployments, and classic deployments.
5
-
6
- Frodo is the successor to field tools like [amtree.sh](https://github.com/vscheuber/AM-treetool), [fidc-debug-tools](https://github.com/vscheuber/fidc-debug-tools), and ForgeRock-internal utilities.
7
-
8
- ## Quick start
9
-
10
- 1. Download the platform specific binary archive from the [release page](https://github.com/rockcarver/frodo/releases) and unzip it to a directory.
11
- 2. Open a terminal and change to the above directory.
12
- 3. Run `frodo conn add` (example below) to setup `frodo` for your ForgeRock environment. If all parameters are correct, `frodo` creates a new [connection profile](#connection-profiles). If you are offline and don't want to validate the data you enter, you can use the --no-validate paramter and frodo stores the [connection profile](#connection-profiles) without validating it.
13
- ```console
14
- $ frodo conn add https://openam-tenant-name.forgeblocks.com/am john.doe@company.com '5uP3r-53cr3t!'
15
- ForgeRock Identity Cloud detected.
16
- Connected to ForgeRock Access Management 7.2.0-2022-6-SNAPSHOT Build ee394dde039e790642653a516d498c16759876c1 (2022-July-07 19:49)
17
- Saving creds in /Users/john.doe/.frodo/.frodorc...
18
- ```
19
- **NOTE: MacOS and Windows may not let you run `frodo` right after you download (and unzip) and execute it for the very first time. Please refer to [this page](../docs/BINARIES.md) if this happens.**
20
-
21
- 4. Test your connection profile using a simple convenience feature in frodo:
22
- ```console
23
- $ frodo info tenant-name
24
- Printing versions and tokens...
25
- ForgeRock Identity Cloud detected.
26
- Connected to ForgeRock Access Management 7.2.0-2022-6-SNAPSHOT Build ee394dde039e790642653a516d498c16759876c1 (2022-July-07 19:49)
27
- Cookie name: 6ac6499e9da2071
28
- Session token: g9CMhj7k9Asq...
29
- Bearer token: eyJ0eXAiOiJKV...
30
- ```
31
- Note how the command does not specify the complete tenant URL nor username nor password. I only uses a unique substring that matches the tenant URL and frodo looks up and uses the right [connection profile](#connection-profiles).
32
-
33
- 5. Now you can use other frodo commands, like `journey`, `logs`, `applications` etc. as desired. **For detailed usage, refer to [this](#usage)**
34
-
35
- ## Quick Nav
36
-
37
- - [Features](#features)
38
- - [Limitations](#limitations)
39
- - [Installing](#installing)
40
- - [Usage](#usage)
41
- - [Request features or report issues](#feature-requests)
42
- - [Contributing](#contributing)
43
- - [Maintaining](#maintaining)
44
-
45
- ## Features
46
-
47
- Frodo allows an administrator to easily connect to and manage any number of Identity Cloud tenants, ForgeOps deployment instances, or classic deployment instances from the command line. The following tasks are currently supported:
48
-
49
- - User mode
50
-
51
- Install and run pre-compiled single binaries without any dependencies for MacOS, Windows, and Linux.
52
-
53
- - Manage journeys/trees.
54
-
55
- Export, import and pruning of journeys. Frodo handles referenced scripts and email templates.
56
-
57
- - Manage applications.
58
-
59
- List, export, and import applications (OAuth2 clients).
60
-
61
- - Manage connection profiles.
62
-
63
- Saving and reading credentials (for multiple ForgeRock deployments) from a configuration file.
64
-
65
- - Manage email templates.
66
-
67
- List, export, and import email templates.
68
-
69
- - Manage IDM configuration.
70
-
71
- Export of IDM configuration. Import is coming.
72
-
73
- - Print versions and tokens.
74
-
75
- Obtain ForgeRock session token and admin access_tokens for a ForgeRock Identity Cloud or platform (ForgeOps) deployment
76
-
77
- - View Identity Cloud logs.
78
-
79
- List available log sources and tail them.
80
-
81
- - Manage realms.
82
-
83
- List realms and show realm details. Allow adding and removing of custom DNS names.
84
-
85
- - Manage scripts.
86
-
87
- List, export, and import scripts.
88
-
89
- - Manage Identity Cloud environment specific variables and secrets.
90
-
91
- List and view details of secrets and variables in Identity Cloud.
92
-
93
- - Platform admin tasks.
94
-
95
- Common tasks administrators need to perform daily that are tedious and repetitive. Advanced tasks, which used to be involved and potentially dangerous if performed manually, now made easy and safe.
96
-
97
- - Create an oauth2 client with admin privileges.
98
- - Get an access token using client credentials grant type.
99
- - List oauth2 clients with admin privileges.
100
- - Grant an oauth2 client admin privileges.
101
- - Revoke admin privileges from an oauth2 client.
102
- - List oauth2 clients with custom privileges.
103
- - List all subjects of static user mappings that are not oauth2 clients.
104
- - Remove a subject's static user mapping.
105
- - Add AutoId static user mapping to enable dashboards and other AutoId-based functionality.
106
- - Hide generic extension attributes.
107
- - Show generic extension attributes.
108
- - Repair org model (beta).
109
-
110
- - Developer mode
111
-
112
- Install and run in developer mode (npm i -g)
113
-
114
- ## Limitations
115
-
116
- `frodo` can't export passwords (including API secrets, etc), so these need to be manually added back to imported configuration or alternatively, edit the export file to add the missing fields before importing.
117
-
118
- ## Installing
119
-
120
- ### User Mode
121
- Individuals who do not intend to develop or contribute to frodo should use this method. Please refer to [Quick Start](#quick-start)
122
-
123
- ### Developer Mode
124
- For those who want to contribute or are just curious about the build process.
125
-
126
- - Make sure you have Node.js v18 (the version used by developers) or newer and npm.
127
- - Clone this repo
128
- ```console
129
- git clone https://github.com/rockcarver/frodo.git
130
- ```
131
- - Install via NPM
132
- ```console
133
- cd frodo
134
- npm install
135
- npm i -g
136
- ```
137
-
138
- ### NPM package
139
- If you are a node developer and want to use frodo as a cli tool or as a library for your own applications, you can install the npm package:
140
-
141
- - To install the latest version as a cli tool:
142
- ```console
143
- npm i -g @rockcarver/frodo-cli
144
- ```
145
- - To install the latest version as a dependency for you own application:
146
- ```console
147
- npm i --save @rockcarver/frodo-cli
148
- ```
149
- - To install the latest pre-release:
150
- ```console
151
- npm i @rockcarver/frodo-cli@next
152
- ```
153
-
154
- ## Usage
155
-
156
- You can invoke `frodo` from the terminal as long as you're in the directory or sourced/added it to the path.
157
-
158
- To get started, refer to [Quick Start](#quick-start).
159
-
160
- ### Connection Profiles
161
- A connection profile is a set of ForgeRock environment URL (Access Management base URL), admin username and admin password. It can optionally contain log API key and secret for a ForgeRock Identity Cloud environment. All connection profiless are stored in `~/.frodo/.frodorc`. Passwords are stored encrypted. `.frodorc` can house information for multiple connections.
162
-
163
- Use the `frodo conn` sub-commands to manage connections:
164
- - `frodo conn list` to list all the connections frodo currently knows about for the current machine and user.
165
- - `frodo conn add` to add a new connection profile.
166
- - `frodo conn describe` to see all the details of a connection profile.
167
- - `frodo conn delete` to remove a connection profile.
168
-
169
- Once `frodo` saves a connection, you don't have to provide the `host`, `username`, and `password` arguments. You can reference your connection using any unique substring from your host. This is the most common way users would run frodo. For example, if `https://openam-example-use1-dev.id.forgerock.io/am` and `https://openam-example-use1-staging.id.forgerock.io/am` are two saved ForgeRock connections from previous commands, one would simply use:
170
-
171
- ```console
172
- frodo info example-use1-dev
173
- ```
174
- OR
175
- ```console
176
- frodo info example-use1-staging
177
- ```
178
-
179
- ### cli options
180
- You interact with `frodo` using commands and options. You can see the list of options by using the `help` command
181
-
182
- ```console
183
- frodo help
184
- ```
185
-
186
- ```console
187
- Usage: frodo [options] [command]
188
-
189
- Options:
190
- -v, --version output the version number
191
- -h, --help display help for command
192
-
193
- Commands:
194
- admin Platform admin tasks.
195
- application Manage applications.
196
- conn|connection Manage connection profiles.
197
- email Manage email templates and configuration.
198
- esv Manage Environment-Specific Variables (ESVs).
199
- idm Manage IDM configuration.
200
- idp Manage (social) identity providers.
201
- info [options] <host> [user] [password] Print versions and tokens.
202
- journey Manage journeys/trees.
203
- logs List/View Identity Cloud logs
204
- realm Manage realms.
205
- saml Manage SAML entity providers and circles of trust.
206
- script Manage scripts.
207
- theme Manages themes.
208
- help [command] display help for command
209
- ```
210
-
211
- Or to view options for a specific command
212
-
213
- ```console
214
- frodo help journey
215
- ```
216
-
217
- ```console
218
- Usage: frodo journey [options] [command]
219
-
220
- Manage journeys/trees.
221
-
222
- Options:
223
- -h, --help Help
224
-
225
- Commands:
226
- list List journeys/trees.
227
- describe If host argument is supplied, describe the journey/tree indicated by -t, or all journeys/trees in the realm if no -t is supplied, otherwise describe the journey/tree export file indicated by -f.
228
- export Export journeys/trees.
229
- import Import journeys/trees.
230
- delete Delete journeys/trees.
231
- prune Prune orphaned configuration artifacts left behind after deleting authentication trees. You will be prompted before any destructive operations are performed.
232
- help [command] display help for command
233
- ```
234
-
235
- ```console
236
- frodo journey help export
237
- ```
238
-
239
- ```console
240
- Usage: frodo journey export [options] <host> [realm] [user] [password]
241
-
242
- Export journeys/trees.
243
-
244
- Arguments:
245
- host Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring.
246
- realm Realm. Specify realm as '/' for the root realm or 'realm' or '/parent/child' otherwise. (default: "alpha" for Identity Cloud tenants, "/" otherwise.)
247
- user Username to login with. Must be an admin user with appropriate rights to manage authentication journeys/trees.
248
- password Password.
249
-
250
- Options:
251
- -m, --type <type> Override auto-detected deployment type. Valid values for type:
252
- classic: A classic Access Management-only deployment with custom layout and configuration.
253
- cloud: A ForgeRock Identity Cloud environment.
254
- forgeops: A ForgeOps CDK or CDM deployment.
255
- The detected or provided deployment type controls certain behavior like obtaining an Identity Management admin token or not and whether to export/import referenced email templates or how to
256
- walk through the tenant admin login flow of Identity Cloud and handle MFA (choices: "classic", "cloud", "forgeops")
257
- -k, --insecure Allow insecure connections when using SSL/TLS (default: Don't allow insecure connections)
258
- -i, --journey-id <journey> Name of a journey/tree. If specified, -a and -A are ignored.
259
- -f, --file <file> Name of the file to write the exported journey(s) to. Ignored with -A.
260
- -a, --all Export all the journeys/trees in a realm. Ignored with -i.
261
- -A, --all-separate Export all the journeys/trees in a realm as separate files <journey/tree name>.json. Ignored with -i or -a.
262
- --use-string-arrays Where applicable, use string arrays to store multi-line text (e.g. scripts). (default: off)
263
- -h, --help Help
264
- ```
265
-
266
- ## Feature requests
267
- Please use the repository's [issues](https://github.com/rockcarver/frodo/issues) to request new features/enhancements or report bugs/issues.
268
-
269
- ## Contributing
270
- If you would like to contribute to frodo, please refer to the [contributing instructions](../docs/CONTRIBUTE.md).
271
-
272
- ## Maintaining
273
- If you are a maintainer of this repository, please refer to the [pipeline and release process instructions](../docs/PIPELINE.md).