@rockcarver/frodo-cli 0.10.4 → 0.11.1-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/.github/README.md +44 -104
  2. package/.github/workflows/pipeline.yml +9 -1
  3. package/CHANGELOG.md +5 -1
  4. package/README.md +3 -3
  5. package/package.json +8 -8
  6. package/src/app.js +5 -4
  7. package/src/cli/_template/cmd-delete.js +9 -8
  8. package/src/cli/_template/cmd-describe.js +9 -8
  9. package/src/cli/_template/cmd-export.js +9 -8
  10. package/src/cli/_template/cmd-import.js +9 -8
  11. package/src/cli/_template/cmd-list.js +9 -8
  12. package/src/cli/_template/cmd-sub1-delete.js +9 -8
  13. package/src/cli/_template/cmd-sub1-describe.js +9 -8
  14. package/src/cli/_template/cmd-sub1-export.js +9 -8
  15. package/src/cli/_template/cmd-sub1-import.js +9 -8
  16. package/src/cli/_template/cmd-sub1-list.js +9 -8
  17. package/src/cli/_template/cmd-sub2-delete.js +9 -8
  18. package/src/cli/_template/cmd-sub2-describe.js +9 -8
  19. package/src/cli/_template/cmd-sub2-export.js +9 -8
  20. package/src/cli/_template/cmd-sub2-import.js +9 -8
  21. package/src/cli/_template/cmd-sub2-list.js +9 -8
  22. package/src/cli/admin/admin-add-autoid-static-user-mapping.js +12 -12
  23. package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +15 -18
  24. package/src/cli/admin/admin-get-access-token.js +12 -12
  25. package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.js +13 -13
  26. package/src/cli/admin/admin-hide-generic-extension-attributes.js +13 -13
  27. package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +13 -13
  28. package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +14 -13
  29. package/src/cli/admin/admin-list-static-user-mappings.js +12 -12
  30. package/src/cli/admin/admin-remove-static-user-mapping.js +12 -12
  31. package/src/cli/admin/admin-repair-org-model.js +13 -13
  32. package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +13 -13
  33. package/src/cli/admin/admin-show-generic-extension-attributes.js +13 -13
  34. package/src/cli/app/app-delete.js +9 -8
  35. package/src/cli/app/app-describe.js +9 -8
  36. package/src/cli/app/app-export.js +15 -15
  37. package/src/cli/app/app-import.js +11 -11
  38. package/src/cli/app/app-list.js +11 -12
  39. package/src/cli/conn/conn-add.js +11 -11
  40. package/src/cli/conn/conn-delete.js +3 -1
  41. package/src/cli/conn/conn-describe.js +3 -1
  42. package/src/cli/conn/conn-list.js +3 -4
  43. package/src/cli/email/email-template-export.js +16 -16
  44. package/src/cli/email/email-template-import.js +16 -16
  45. package/src/cli/email/email-template-list.js +11 -11
  46. package/src/cli/esv/esv-apply.js +12 -12
  47. package/src/cli/esv/esv-secret-create.js +11 -11
  48. package/src/cli/esv/esv-secret-delete.js +13 -13
  49. package/src/cli/esv/esv-secret-describe.js +11 -11
  50. package/src/cli/esv/esv-secret-export.js +9 -8
  51. package/src/cli/esv/esv-secret-import.js +9 -8
  52. package/src/cli/esv/esv-secret-list.js +11 -11
  53. package/src/cli/esv/esv-secret-set.js +11 -11
  54. package/src/cli/esv/esv-secret-version-activate.js +12 -12
  55. package/src/cli/esv/esv-secret-version-create.js +11 -11
  56. package/src/cli/esv/esv-secret-version-deactivate.js +12 -12
  57. package/src/cli/esv/esv-secret-version-delete.js +13 -13
  58. package/src/cli/esv/esv-secret-version-list.js +11 -11
  59. package/src/cli/esv/esv-variable-create.js +11 -11
  60. package/src/cli/esv/esv-variable-delete.js +13 -16
  61. package/src/cli/esv/esv-variable-describe.js +11 -11
  62. package/src/cli/esv/esv-variable-export.js +9 -8
  63. package/src/cli/esv/esv-variable-import.js +9 -8
  64. package/src/cli/esv/esv-variable-list.js +11 -11
  65. package/src/cli/esv/esv-variable-set.js +13 -16
  66. package/src/cli/idm/idm-count.js +11 -11
  67. package/src/cli/idm/idm-export.js +16 -16
  68. package/src/cli/idm/idm-list.js +11 -11
  69. package/src/cli/idp/idp-export.js +15 -19
  70. package/src/cli/idp/idp-import.js +18 -18
  71. package/src/cli/idp/idp-list.js +12 -12
  72. package/src/cli/info/info.js +23 -19
  73. package/src/cli/journey/{journey-delete.e2e.test.js → journey-delete.e2e.test_.js} +0 -0
  74. package/src/cli/journey/journey-delete.js +14 -14
  75. package/src/cli/journey/journey-describe.js +26 -35
  76. package/src/cli/journey/journey-export.js +15 -18
  77. package/src/cli/journey/journey-import.js +17 -17
  78. package/src/cli/journey/{journey-list.e2e.test.js → journey-list.e2e.test_.js} +1 -0
  79. package/src/cli/journey/journey-list.js +12 -12
  80. package/src/cli/journey/journey-prune.js +12 -12
  81. package/src/cli/logging/logs-list.js +33 -28
  82. package/src/cli/logging/logs-tail.js +26 -22
  83. package/src/cli/realm/realm-add-custom-domain.js +13 -13
  84. package/src/cli/realm/realm-describe.js +14 -14
  85. package/src/cli/realm/realm-list.js +11 -11
  86. package/src/cli/realm/realm-remove-custom-domain.js +16 -13
  87. package/src/cli/saml/saml-cot-export.js +16 -16
  88. package/src/cli/saml/saml-cot-import.js +18 -18
  89. package/src/cli/saml/saml-cot-list.js +12 -12
  90. package/src/cli/saml/saml-describe.js +12 -12
  91. package/src/cli/saml/saml-export.js +16 -19
  92. package/src/cli/saml/saml-import.js +19 -18
  93. package/src/cli/saml/saml-list.js +12 -12
  94. package/src/cli/saml/saml-metadata-export.js +15 -19
  95. package/src/cli/script/script-delete.js +9 -8
  96. package/src/cli/script/script-describe.js +9 -8
  97. package/src/cli/script/script-export.js +18 -20
  98. package/src/cli/script/script-import.js +13 -12
  99. package/src/cli/script/script-list.js +12 -12
  100. package/src/cli/theme/{theme-delete.e2e.test.js → theme-delete.e2e.test_.js} +0 -0
  101. package/src/cli/theme/theme-delete.js +17 -21
  102. package/src/cli/theme/theme-export.js +19 -18
  103. package/src/cli/theme/theme-import.js +21 -20
  104. package/src/cli/theme/{theme-list.e2e.test.js → theme-list.e2e.test_.js} +0 -0
  105. package/src/cli/theme/theme-list.js +12 -12
  106. package/test/client_cli/en/conn-add.test.js +37 -0
  107. package/test/client_cli/en/conn-delete.test.js +37 -0
  108. package/test/client_cli/en/conn-list.test.js +37 -0
  109. package/test/client_cli/en/conn.test.js +65 -0
  110. package/test/client_cli/en/email-template-import.test.js +156 -0
  111. package/test/client_cli/en/email-template.test.js +79 -0
  112. package/test/client_cli/en/email-templates-export.test.js +208 -0
  113. package/test/client_cli/en/email-templates-list.test.js +139 -0
  114. package/test/client_cli/en/idm-count.test.js +131 -0
  115. package/test/client_cli/en/idm-export.test.js +149 -0
  116. package/test/client_cli/en/{idm_import.test_.js → idm-import.test_.js} +59 -61
  117. package/test/client_cli/en/idm-list.test.js +109 -0
  118. package/test/client_cli/en/idm.test.js +55 -84
  119. package/test/client_cli/en/info.test.js +85 -74
  120. package/test/client_cli/en/journey-describe.test.js +194 -0
  121. package/test/client_cli/en/journey-export.test.js +231 -0
  122. package/test/client_cli/en/journey-import.test.js +212 -0
  123. package/test/client_cli/en/journey-list.test.js +173 -0
  124. package/test/client_cli/en/{journey_prune.test.js → journey-prune.test.js} +102 -91
  125. package/test/client_cli/en/journey.test.js +76 -92
  126. package/test/client_cli/en/logs-list.test.js +81 -0
  127. package/test/client_cli/en/logs-tail.test.js +130 -0
  128. package/test/client_cli/en/logs.test.js +44 -58
  129. package/test/client_cli/en/root.test.js +61 -59
  130. package/test/client_cli/en/script-export.test.js +230 -0
  131. package/test/client_cli/en/script-import.test.js +176 -0
  132. package/test/client_cli/en/script-list.test.js +159 -0
  133. package/test/client_cli/en/script.test.js +52 -50
  134. package/test/client_cli/utils/utils.js +48 -17
  135. package/src/api/AuthenticateApi.js +0 -33
  136. package/src/api/BaseApi.js +0 -242
  137. package/src/api/CirclesOfTrustApi.js +0 -87
  138. package/src/api/EmailTemplateApi.js +0 -37
  139. package/src/api/IdmConfigApi.js +0 -88
  140. package/src/api/LogApi.js +0 -45
  141. package/src/api/ManagedObjectApi.js +0 -62
  142. package/src/api/OAuth2ClientApi.js +0 -69
  143. package/src/api/OAuth2OIDCApi.js +0 -73
  144. package/src/api/OAuth2ProviderApi.js +0 -32
  145. package/src/api/RealmApi.js +0 -99
  146. package/src/api/Saml2Api.js +0 -176
  147. package/src/api/ScriptApi.js +0 -84
  148. package/src/api/SecretsApi.js +0 -151
  149. package/src/api/ServerInfoApi.js +0 -41
  150. package/src/api/SocialIdentityProvidersApi.js +0 -114
  151. package/src/api/StartupApi.js +0 -45
  152. package/src/api/ThemeApi.js +0 -181
  153. package/src/api/TreeApi.js +0 -207
  154. package/src/api/VariablesApi.js +0 -104
  155. package/src/api/utils/ApiUtils.js +0 -77
  156. package/src/api/utils/Base64.js +0 -62
  157. package/src/ops/AdminOps.js +0 -901
  158. package/src/ops/AuthenticateOps.js +0 -342
  159. package/src/ops/CirclesOfTrustOps.js +0 -350
  160. package/src/ops/ConnectionProfileOps.js +0 -254
  161. package/src/ops/EmailTemplateOps.js +0 -326
  162. package/src/ops/IdmOps.js +0 -227
  163. package/src/ops/IdpOps.js +0 -342
  164. package/src/ops/JourneyOps.js +0 -2026
  165. package/src/ops/LogOps.js +0 -357
  166. package/src/ops/ManagedObjectOps.js +0 -34
  167. package/src/ops/OAuth2ClientOps.js +0 -151
  168. package/src/ops/OrganizationOps.js +0 -85
  169. package/src/ops/RealmOps.js +0 -139
  170. package/src/ops/SamlOps.js +0 -541
  171. package/src/ops/ScriptOps.js +0 -211
  172. package/src/ops/SecretsOps.js +0 -288
  173. package/src/ops/StartupOps.js +0 -114
  174. package/src/ops/ThemeOps.js +0 -379
  175. package/src/ops/VariablesOps.js +0 -185
  176. package/src/ops/templates/OAuth2ClientTemplate.json +0 -270
  177. package/src/ops/templates/OrgModelUserAttributesTemplate.json +0 -149
  178. package/src/ops/templates/cloud/GenericExtensionAttributesTemplate.json +0 -392
  179. package/src/ops/templates/cloud/managed.json +0 -4119
  180. package/src/ops/utils/Console.js +0 -434
  181. package/src/ops/utils/DataProtection.js +0 -92
  182. package/src/ops/utils/ExportImportUtils.js +0 -146
  183. package/src/ops/utils/OpsUtils.js +0 -76
  184. package/src/ops/utils/Wordwrap.js +0 -11
  185. package/src/storage/SessionStorage.js +0 -45
  186. package/test/client_cli/en/connections.test.js +0 -62
  187. package/test/client_cli/en/connections_add.test.js +0 -34
  188. package/test/client_cli/en/connections_delete.test.js +0 -34
  189. package/test/client_cli/en/connections_list.test.js +0 -34
  190. package/test/client_cli/en/email_templates.test.js +0 -77
  191. package/test/client_cli/en/email_templates_export.test.js +0 -196
  192. package/test/client_cli/en/email_templates_import.test.js +0 -145
  193. package/test/client_cli/en/email_templates_list.test.js +0 -130
  194. package/test/client_cli/en/idm_count.test.js +0 -121
  195. package/test/client_cli/en/idm_export.test.js +0 -136
  196. package/test/client_cli/en/idm_exportAll.test.js +0 -156
  197. package/test/client_cli/en/idm_exportAllRaw.test.js +0 -120
  198. package/test/client_cli/en/idm_importAll.test_.js +0 -103
  199. package/test/client_cli/en/idm_list.test.js +0 -103
  200. package/test/client_cli/en/journey_describe.test.js +0 -196
  201. package/test/client_cli/en/journey_export.test.js +0 -213
  202. package/test/client_cli/en/journey_import.test.js +0 -195
  203. package/test/client_cli/en/journey_importAll.test.js +0 -180
  204. package/test/client_cli/en/journey_list.test.js +0 -162
  205. package/test/client_cli/en/logs_list.test.js +0 -83
  206. package/test/client_cli/en/logs_tail.test.js +0 -118
  207. package/test/client_cli/en/script_export.test.js +0 -213
  208. package/test/client_cli/en/script_import.test.js +0 -163
  209. package/test/client_cli/en/script_list.test.js +0 -148
  210. package/test/e2e/setup.js +0 -98
  211. package/test/global/setup.js +0 -65
  212. package/test/lib_api/unit_tests/ApiUtils.test.js +0 -186
  213. package/test/lib_api/unit_tests/Base64URL.test.js +0 -22
  214. package/test/lib_api/unit_tests/DataProtection.test.js +0 -25
  215. package/test/lib_api/unit_tests/ExportImportUtils.test.js +0 -121
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, 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';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd sub1 list');
7
8
 
@@ -21,12 +22,12 @@ program
21
22
  .action(
22
23
  // implement command logic inside action handler
23
24
  async (host, realm, user, password, options) => {
24
- storage.session.setTenant(host);
25
- storage.session.setRealm(realm);
26
- storage.session.setUsername(user);
27
- storage.session.setPassword(password);
28
- storage.session.setDeploymentType(options.type);
29
- storage.session.setAllowInsecureConnection(options.insecure);
25
+ state.default.session.setTenant(host);
26
+ state.default.session.setRealm(realm);
27
+ state.default.session.setUsername(user);
28
+ state.default.session.setPassword(password);
29
+ state.default.session.setDeploymentType(options.type);
30
+ state.default.session.setAllowInsecureConnection(options.insecure);
30
31
  if (await getTokens()) {
31
32
  // code goes here
32
33
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, 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';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd sub2 delete');
7
8
 
@@ -39,12 +40,12 @@ program
39
40
  .action(
40
41
  // implement command logic inside action handler
41
42
  async (host, realm, user, password, options) => {
42
- storage.session.setTenant(host);
43
- storage.session.setRealm(realm);
44
- storage.session.setUsername(user);
45
- storage.session.setPassword(password);
46
- storage.session.setDeploymentType(options.type);
47
- storage.session.setAllowInsecureConnection(options.insecure);
43
+ state.default.session.setTenant(host);
44
+ state.default.session.setRealm(realm);
45
+ state.default.session.setUsername(user);
46
+ state.default.session.setPassword(password);
47
+ state.default.session.setDeploymentType(options.type);
48
+ state.default.session.setAllowInsecureConnection(options.insecure);
48
49
  if (await getTokens()) {
49
50
  // code goes here
50
51
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, 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';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd sub2 describe');
7
8
 
@@ -19,12 +20,12 @@ program
19
20
  .action(
20
21
  // implement command logic inside action handler
21
22
  async (host, realm, user, password, options) => {
22
- storage.session.setTenant(host);
23
- storage.session.setRealm(realm);
24
- storage.session.setUsername(user);
25
- storage.session.setPassword(password);
26
- storage.session.setDeploymentType(options.type);
27
- storage.session.setAllowInsecureConnection(options.insecure);
23
+ state.default.session.setTenant(host);
24
+ state.default.session.setRealm(realm);
25
+ state.default.session.setUsername(user);
26
+ state.default.session.setPassword(password);
27
+ state.default.session.setDeploymentType(options.type);
28
+ state.default.session.setAllowInsecureConnection(options.insecure);
28
29
  if (await getTokens()) {
29
30
  // code goes here
30
31
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, 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';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd sub2 export');
7
8
 
@@ -37,12 +38,12 @@ program
37
38
  .action(
38
39
  // implement command logic inside action handler
39
40
  async (host, realm, user, password, options) => {
40
- storage.session.setTenant(host);
41
- storage.session.setRealm(realm);
42
- storage.session.setUsername(user);
43
- storage.session.setPassword(password);
44
- storage.session.setDeploymentType(options.type);
45
- 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);
46
47
  if (await getTokens()) {
47
48
  // code goes here
48
49
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, 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';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd sub2 import');
7
8
 
@@ -37,12 +38,12 @@ program
37
38
  .action(
38
39
  // implement command logic inside action handler
39
40
  async (host, realm, user, password, options) => {
40
- storage.session.setTenant(host);
41
- storage.session.setRealm(realm);
42
- storage.session.setUsername(user);
43
- storage.session.setPassword(password);
44
- storage.session.setDeploymentType(options.type);
45
- 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);
46
47
  if (await getTokens()) {
47
48
  // code goes here
48
49
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, 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';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd sub2 list');
7
8
 
@@ -21,12 +22,12 @@ program
21
22
  .action(
22
23
  // implement command logic inside action handler
23
24
  async (host, realm, user, password, options) => {
24
- storage.session.setTenant(host);
25
- storage.session.setRealm(realm);
26
- storage.session.setUsername(user);
27
- storage.session.setPassword(password);
28
- storage.session.setDeploymentType(options.type);
29
- storage.session.setAllowInsecureConnection(options.insecure);
25
+ state.default.session.setTenant(host);
26
+ state.default.session.setRealm(realm);
27
+ state.default.session.setUsername(user);
28
+ state.default.session.setPassword(password);
29
+ state.default.session.setDeploymentType(options.type);
30
+ state.default.session.setAllowInsecureConnection(options.insecure);
30
31
  if (await getTokens()) {
31
32
  // code goes here
32
33
  }
@@ -1,9 +1,9 @@
1
1
  import { Command } from 'commander';
2
+ import { Authenticate, Admin, 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 { addAutoIdStaticUserMapping } from '../../ops/AdminOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { addAutoIdStaticUserMapping } = Admin;
7
7
 
8
8
  const program = new Command('frodo admin add-autoid-static-user-mapping');
9
9
 
@@ -22,16 +22,16 @@ program
22
22
  .action(
23
23
  // implement command logic inside action handler
24
24
  async (host, realm, user, password, options) => {
25
- storage.session.setTenant(host);
26
- storage.session.setRealm(realm);
27
- storage.session.setUsername(user);
28
- storage.session.setPassword(password);
29
- storage.session.setDeploymentType(options.type);
30
- storage.session.setAllowInsecureConnection(options.insecure);
25
+ state.default.session.setTenant(host);
26
+ state.default.session.setRealm(realm);
27
+ state.default.session.setUsername(user);
28
+ state.default.session.setPassword(password);
29
+ state.default.session.setDeploymentType(options.type);
30
+ state.default.session.setAllowInsecureConnection(options.insecure);
31
31
  if (await getTokens()) {
32
- printMessage(`Adding AutoId static user mapping...`);
32
+ console.log(`Adding AutoId static user mapping...`);
33
33
  await addAutoIdStaticUserMapping();
34
- printMessage('Done.');
34
+ console.log('Done.');
35
35
  }
36
36
  }
37
37
  // end command logic inside action handler
@@ -1,14 +1,11 @@
1
1
  import { Command, Option } from 'commander';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
  import Table from 'cli-table3';
4
+ import { Authenticate, Admin, state } from '@rockcarver/frodo-lib';
4
5
  import * as common from '../cmd_common.js';
5
- import { getTokens } from '../../ops/AuthenticateOps.js';
6
- import storage from '../../storage/SessionStorage.js';
7
- import { printMessage } from '../../ops/utils/Console.js';
8
- import {
9
- createLongLivedToken,
10
- createOAuth2ClientWithAdminPrivileges,
11
- } from '../../ops/AdminOps.js';
6
+
7
+ const { getTokens } = Authenticate;
8
+ const { createLongLivedToken, createOAuth2ClientWithAdminPrivileges } = Admin;
12
9
 
13
10
  const program = new Command(
14
11
  'frodo admin create-oauth2-client-with-admin-privileges'
@@ -53,15 +50,15 @@ program
53
50
  .action(
54
51
  // implement command logic inside action handler
55
52
  async (host, realm, user, password, options) => {
56
- storage.session.setTenant(host);
57
- storage.session.setRealm(realm);
58
- storage.session.setUsername(user);
59
- storage.session.setPassword(password);
60
- storage.session.setDeploymentType(options.type);
61
- storage.session.setAllowInsecureConnection(options.insecure);
53
+ state.default.session.setTenant(host);
54
+ state.default.session.setRealm(realm);
55
+ state.default.session.setUsername(user);
56
+ state.default.session.setPassword(password);
57
+ state.default.session.setDeploymentType(options.type);
58
+ state.default.session.setAllowInsecureConnection(options.insecure);
62
59
  if (await getTokens()) {
63
- printMessage(
64
- `Creating oauth2 client with admin privileges in realm "${storage.session.getRealm()}"...`
60
+ console.log(
61
+ `Creating oauth2 client with admin privileges in realm "${state.default.session.getRealm()}"...`
65
62
  );
66
63
  let clientId = uuidv4();
67
64
  let clientSecret = uuidv4();
@@ -74,7 +71,7 @@ program
74
71
  try {
75
72
  await createOAuth2ClientWithAdminPrivileges(clientId, clientSecret);
76
73
  } catch (error) {
77
- printMessage(error, 'error');
74
+ console.log(error, 'error');
78
75
  }
79
76
  const table = new Table({
80
77
  chars: {
@@ -110,12 +107,12 @@ program
110
107
  // table.push(['Token Lifetime'.brightCyan, response.expires_in]);
111
108
  table.push(['Expires'.brightCyan, response.expires_on]);
112
109
  } catch (error) {
113
- printMessage(error, 'error');
110
+ console.log(error, 'error');
114
111
  }
115
112
  }
116
113
  table.push(['Client ID'.brightCyan, clientId]);
117
114
  table.push(['Client Secret'.brightCyan, clientSecret]);
118
- printMessage(table.toString());
115
+ console.log(table.toString());
119
116
  }
120
117
  }
121
118
  // end command logic inside action handler
@@ -1,9 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, OAuth2OIDCApi, 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 { clientCredentialsGrant } from '../../api/OAuth2OIDCApi.js';
4
+
5
+ const { clientCredentialsGrant } = OAuth2OIDCApi;
6
+ const { getTokens } = Authenticate;
7
7
 
8
8
  const program = new Command('frodo admin get-access-token');
9
9
 
@@ -33,14 +33,14 @@ program
33
33
  .action(
34
34
  // implement command logic inside action handler
35
35
  async (host, realm, user, password, options) => {
36
- storage.session.setTenant(host);
37
- storage.session.setRealm(realm);
38
- storage.session.setUsername(user);
39
- storage.session.setPassword(password);
40
- storage.session.setDeploymentType(options.type);
41
- storage.session.setAllowInsecureConnection(options.insecure);
36
+ state.default.session.setTenant(host);
37
+ state.default.session.setRealm(realm);
38
+ state.default.session.setUsername(user);
39
+ state.default.session.setPassword(password);
40
+ state.default.session.setDeploymentType(options.type);
41
+ state.default.session.setAllowInsecureConnection(options.insecure);
42
42
  if (await getTokens()) {
43
- printMessage(
43
+ console.log(
44
44
  `Getting an access token using client "${options.clientId}"...`
45
45
  );
46
46
  const response = (
@@ -50,7 +50,7 @@ program
50
50
  options.scope
51
51
  )
52
52
  ).data;
53
- printMessage(`Token: ${response.access_token}`);
53
+ console.log(`Token: ${response.access_token}`);
54
54
  }
55
55
  }
56
56
  // end command logic inside action handler
@@ -1,9 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Admin, 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 { grantOAuth2ClientAdminPrivileges } from '../../ops/AdminOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { grantOAuth2ClientAdminPrivileges } = Admin;
7
7
 
8
8
  const program = new Command('frodo admin grant-oauth2-client-admin-privileges');
9
9
 
@@ -23,20 +23,20 @@ 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(
33
+ console.log(
34
34
  `Granting oauth2 client "${
35
35
  options.target
36
- }" in realm "${storage.session.getRealm()}" admin privileges...`
36
+ }" in realm "${state.default.session.getRealm()}" admin privileges...`
37
37
  );
38
38
  await grantOAuth2ClientAdminPrivileges(options.target);
39
- printMessage('Done.');
39
+ console.log('Done.');
40
40
  }
41
41
  }
42
42
  // end command logic inside action handler
@@ -1,9 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Admin, 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 { hideGenericExtensionAttributes } from '../../ops/AdminOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { hideGenericExtensionAttributes } = Admin;
7
7
 
8
8
  const program = new Command('frodo admin hide-generic-extension-attributes');
9
9
 
@@ -24,21 +24,21 @@ program
24
24
  .action(
25
25
  // implement command logic inside action handler
26
26
  async (host, realm, user, password, options) => {
27
- storage.session.setTenant(host);
28
- storage.session.setRealm(realm);
29
- storage.session.setUsername(user);
30
- storage.session.setPassword(password);
31
- storage.session.setDeploymentType(options.type);
32
- storage.session.setAllowInsecureConnection(options.insecure);
27
+ state.default.session.setTenant(host);
28
+ state.default.session.setRealm(realm);
29
+ state.default.session.setUsername(user);
30
+ state.default.session.setPassword(password);
31
+ state.default.session.setDeploymentType(options.type);
32
+ state.default.session.setAllowInsecureConnection(options.insecure);
33
33
  if (await getTokens()) {
34
- printMessage(
35
- `Hiding generic extension attributes in realm "${storage.session.getRealm()}"...`
34
+ console.log(
35
+ `Hiding generic extension attributes in realm "${state.default.session.getRealm()}"...`
36
36
  );
37
37
  await hideGenericExtensionAttributes(
38
38
  options.includeCustomized,
39
39
  options.dryRun
40
40
  );
41
- printMessage('Done.');
41
+ console.log('Done.');
42
42
  }
43
43
  }
44
44
  // end command logic inside action handler
@@ -1,9 +1,9 @@
1
1
  import { Command } from 'commander';
2
+ import { Authenticate, Admin, 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 { listOAuth2AdminClients } from '../../ops/AdminOps.js';
4
+
5
+ const { listOAuth2AdminClients } = Admin;
6
+ const { getTokens } = Authenticate;
7
7
 
8
8
  const program = new Command(
9
9
  'frodo admin list-oauth2-clients-with-admin-privileges'
@@ -22,20 +22,20 @@ program
22
22
  .action(
23
23
  // implement command logic inside action handler
24
24
  async (host, realm, user, password, options) => {
25
- storage.session.setTenant(host);
26
- storage.session.setRealm(realm);
27
- storage.session.setUsername(user);
28
- storage.session.setPassword(password);
29
- storage.session.setDeploymentType(options.type);
30
- storage.session.setAllowInsecureConnection(options.insecure);
25
+ state.default.session.setTenant(host);
26
+ state.default.session.setRealm(realm);
27
+ state.default.session.setUsername(user);
28
+ state.default.session.setPassword(password);
29
+ state.default.session.setDeploymentType(options.type);
30
+ state.default.session.setAllowInsecureConnection(options.insecure);
31
31
  if (await getTokens()) {
32
- printMessage(
33
- `Listing oauth2 clients with admin privileges in realm "${storage.session.getRealm()}"...`
32
+ console.log(
33
+ `Listing oauth2 clients with admin privileges in realm "${state.default.session.getRealm()}"...`
34
34
  );
35
35
  const adminClients = await listOAuth2AdminClients();
36
36
  adminClients.sort((a, b) => a.localeCompare(b));
37
37
  adminClients.forEach((item) => {
38
- printMessage(`${item}`);
38
+ console.log(`${item}`);
39
39
  });
40
40
  }
41
41
  }
@@ -1,9 +1,10 @@
1
1
  import { Command } from 'commander';
2
+ import { Authenticate, Admin, 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 { listOAuth2CustomClients } from '../../ops/AdminOps.js';
4
+
5
+ const { listOAuth2CustomClients } = Admin;
6
+
7
+ const { getTokens } = Authenticate;
7
8
 
8
9
  const program = new Command(
9
10
  'frodo admin list-oauth2-clients-with-custom-privileges'
@@ -22,20 +23,20 @@ program
22
23
  .action(
23
24
  // implement command logic inside action handler
24
25
  async (host, realm, user, password, options) => {
25
- storage.session.setTenant(host);
26
- storage.session.setRealm(realm);
27
- storage.session.setUsername(user);
28
- storage.session.setPassword(password);
29
- storage.session.setDeploymentType(options.type);
30
- 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);
31
32
  if (await getTokens()) {
32
- printMessage(
33
- `Listing oauth2 clients with custom privileges in realm "${storage.session.getRealm()}"...`
33
+ console.log(
34
+ `Listing oauth2 clients with custom privileges in realm "${state.default.session.getRealm()}"...`
34
35
  );
35
36
  const adminClients = await listOAuth2CustomClients();
36
37
  adminClients.sort((a, b) => a.localeCompare(b));
37
38
  adminClients.forEach((item) => {
38
- printMessage(`${item}`);
39
+ console.log(`${item}`);
39
40
  });
40
41
  }
41
42
  }
@@ -1,9 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Admin, 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 { listNonOAuth2AdminStaticUserMappings } from '../../ops/AdminOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { listNonOAuth2AdminStaticUserMappings } = Admin;
7
7
 
8
8
  const program = new Command('frodo admin list-static-user-mappings');
9
9
 
@@ -28,14 +28,14 @@ program
28
28
  .action(
29
29
  // implement command logic inside action handler
30
30
  async (host, realm, user, password, options) => {
31
- storage.session.setTenant(host);
32
- storage.session.setRealm(realm);
33
- storage.session.setUsername(user);
34
- storage.session.setPassword(password);
35
- storage.session.setDeploymentType(options.type);
36
- storage.session.setAllowInsecureConnection(options.insecure);
31
+ state.default.session.setTenant(host);
32
+ state.default.session.setRealm(realm);
33
+ state.default.session.setUsername(user);
34
+ state.default.session.setPassword(password);
35
+ state.default.session.setDeploymentType(options.type);
36
+ state.default.session.setAllowInsecureConnection(options.insecure);
37
37
  if (await getTokens()) {
38
- printMessage(
38
+ console.log(
39
39
  'Listing all non-oauth2 client subjects of static user mappings...'
40
40
  );
41
41
  const subjects = await listNonOAuth2AdminStaticUserMappings(
@@ -43,7 +43,7 @@ program
43
43
  );
44
44
  subjects.sort((a, b) => a.localeCompare(b));
45
45
  subjects.forEach((item) => {
46
- printMessage(`${item}`);
46
+ console.log(`${item}`);
47
47
  });
48
48
  }
49
49
  }
@@ -1,9 +1,9 @@
1
1
  import { Command } from 'commander';
2
+ import { Authenticate, Admin, 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 { removeStaticUserMapping } from '../../ops/AdminOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { removeStaticUserMapping } = Admin;
7
7
 
8
8
  const program = new Command('frodo admin remove-static-user-mapping');
9
9
 
@@ -20,16 +20,16 @@ program
20
20
  .action(
21
21
  // implement command logic inside action handler
22
22
  async (host, realm, user, password, options) => {
23
- storage.session.setTenant(host);
24
- storage.session.setRealm(realm);
25
- storage.session.setUsername(user);
26
- storage.session.setPassword(password);
27
- storage.session.setDeploymentType(options.type);
28
- storage.session.setAllowInsecureConnection(options.insecure);
23
+ state.default.session.setTenant(host);
24
+ state.default.session.setRealm(realm);
25
+ state.default.session.setUsername(user);
26
+ state.default.session.setPassword(password);
27
+ state.default.session.setDeploymentType(options.type);
28
+ state.default.session.setAllowInsecureConnection(options.insecure);
29
29
  if (await getTokens()) {
30
- printMessage("Removing a subject's static user mapping...");
30
+ console.log("Removing a subject's static user mapping...");
31
31
  await removeStaticUserMapping(options.subject);
32
- printMessage('Done.');
32
+ console.log('Done.');
33
33
  }
34
34
  }
35
35
  // end command logic inside action handler
@@ -1,9 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Admin, 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 { repairOrgModel } from '../../ops/AdminOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { repairOrgModel } = Admin;
7
7
 
8
8
  const program = new Command('frodo admin repair-org-model');
9
9
 
@@ -27,18 +27,18 @@ program
27
27
  .action(
28
28
  // implement command logic inside action handler
29
29
  async (host, realm, user, password, options) => {
30
- storage.session.setTenant(host);
31
- storage.session.setRealm(realm);
32
- storage.session.setUsername(user);
33
- storage.session.setPassword(password);
34
- storage.session.setDeploymentType(options.type);
35
- storage.session.setAllowInsecureConnection(options.insecure);
30
+ state.default.session.setTenant(host);
31
+ state.default.session.setRealm(realm);
32
+ state.default.session.setUsername(user);
33
+ state.default.session.setPassword(password);
34
+ state.default.session.setDeploymentType(options.type);
35
+ state.default.session.setAllowInsecureConnection(options.insecure);
36
36
  if (await getTokens()) {
37
- printMessage(
38
- `Repairing org model in realm "${storage.session.getRealm()}"...`
37
+ console.log(
38
+ `Repairing org model in realm "${state.default.session.getRealm()}"...`
39
39
  );
40
40
  await repairOrgModel(options.extendPermissions, options.dryRun);
41
- printMessage('Done.');
41
+ console.log('Done.');
42
42
  }
43
43
  }
44
44
  // end command logic inside action handler