@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,14 +1,14 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, CirclesOfTrust, 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
+ const {
7
7
  importCircleOfTrust,
8
8
  importCirclesOfTrustFromFile,
9
9
  importCirclesOfTrustFromFiles,
10
10
  importFirstCircleOfTrust,
11
- } from '../../ops/CirclesOfTrustOps.js';
11
+ } = CirclesOfTrust;
12
12
 
13
13
  const program = new Command('frodo saml cot import');
14
14
 
@@ -49,48 +49,48 @@ program
49
49
  .action(
50
50
  // implement program logic inside action handler
51
51
  async (host, realm, user, password, options) => {
52
- storage.session.setTenant(host);
53
- storage.session.setRealm(realm);
54
- storage.session.setUsername(user);
55
- storage.session.setPassword(password);
56
- storage.session.setDeploymentType(options.type);
57
- storage.session.setAllowInsecureConnection(options.insecure);
52
+ state.default.session.setTenant(host);
53
+ state.default.session.setRealm(realm);
54
+ state.default.session.setUsername(user);
55
+ state.default.session.setPassword(password);
56
+ state.default.session.setDeploymentType(options.type);
57
+ state.default.session.setAllowInsecureConnection(options.insecure);
58
58
  if (await getTokens()) {
59
59
  // import by id
60
60
  if (options.file && options.cotId) {
61
- printMessage(
61
+ console.log(
62
62
  `Importing circle of trust "${
63
63
  options.cotId
64
- }" into realm "${storage.session.getRealm()}"...`
64
+ }" into realm "${state.default.session.getRealm()}"...`
65
65
  );
66
66
  importCircleOfTrust(options.cotId, options.file);
67
67
  }
68
68
  // --all -a
69
69
  else if (options.all && options.file) {
70
- printMessage(
70
+ console.log(
71
71
  `Importing all circles of trust from a single file (${options.file})...`
72
72
  );
73
73
  importCirclesOfTrustFromFile(options.file);
74
74
  }
75
75
  // --all-separate -A
76
76
  else if (options.allSeparate && !options.file) {
77
- printMessage(
77
+ console.log(
78
78
  'Importing all circles of trust from separate files (*.saml.json) in current directory...'
79
79
  );
80
80
  importCirclesOfTrustFromFiles();
81
81
  }
82
82
  // import first provider from file
83
83
  else if (options.file) {
84
- printMessage(
84
+ console.log(
85
85
  `Importing first circle of trust from file "${
86
86
  options.file
87
- }" into realm "${storage.session.getRealm()}"...`
87
+ }" into realm "${state.default.session.getRealm()}"...`
88
88
  );
89
89
  importFirstCircleOfTrust(options.file);
90
90
  }
91
91
  // unrecognized combination of options or no options
92
92
  else {
93
- printMessage('Unrecognized combination of options or no options...');
93
+ console.log('Unrecognized combination of options or no options...');
94
94
  program.help();
95
95
  }
96
96
  }
@@ -1,9 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, CirclesOfTrust, 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 { listCirclesOfTrust } from '../../ops/CirclesOfTrustOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { listCirclesOfTrust } = CirclesOfTrust;
7
7
 
8
8
  const program = new Command('frodo saml cot 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 SAML circles of trust in realm "${storage.session.getRealm()}"...`
33
+ console.log(
34
+ `Listing SAML circles of trust in realm "${state.default.session.getRealm()}"...`
35
35
  );
36
36
  listCirclesOfTrust(options.long);
37
37
  }
@@ -1,9 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Saml, 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 { describeProvider } from '../../ops/SamlOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { describeProvider } = Saml;
7
7
 
8
8
  const program = new Command('frodo saml describe');
9
9
 
@@ -21,17 +21,17 @@ program
21
21
  .action(
22
22
  // implement command logic inside action handler
23
23
  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);
24
+ state.default.session.setTenant(host);
25
+ state.default.session.setRealm(realm);
26
+ state.default.session.setUsername(user);
27
+ state.default.session.setPassword(password);
28
+ state.default.session.setDeploymentType(options.type);
29
+ state.default.session.setAllowInsecureConnection(options.insecure);
30
30
  if (await getTokens()) {
31
- printMessage(
31
+ console.log(
32
32
  `Describing SAML entity provider ${
33
33
  options.entityId
34
- } in realm "${storage.session.getRealm()}"...`
34
+ } in realm "${state.default.session.getRealm()}"...`
35
35
  );
36
36
  describeProvider(options.entityId);
37
37
  }
@@ -1,13 +1,10 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Saml, 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
- exportProvider,
8
- exportProvidersToFile,
9
- exportProvidersToFiles,
10
- } from '../../ops/SamlOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+
7
+ const { exportProvider, exportProvidersToFile, exportProvidersToFiles } = Saml;
11
8
 
12
9
  const program = new Command('frodo saml export');
13
10
 
@@ -48,35 +45,35 @@ program
48
45
  .action(
49
46
  // implement command logic inside action handler
50
47
  async (host, realm, user, password, options) => {
51
- storage.session.setTenant(host);
52
- storage.session.setRealm(realm);
53
- storage.session.setUsername(user);
54
- storage.session.setPassword(password);
55
- storage.session.setDeploymentType(options.type);
56
- storage.session.setAllowInsecureConnection(options.insecure);
48
+ state.default.session.setTenant(host);
49
+ state.default.session.setRealm(realm);
50
+ state.default.session.setUsername(user);
51
+ state.default.session.setPassword(password);
52
+ state.default.session.setDeploymentType(options.type);
53
+ state.default.session.setAllowInsecureConnection(options.insecure);
57
54
  if (await getTokens()) {
58
55
  // export by id/name
59
56
  if (options.entityId) {
60
- printMessage(
57
+ console.log(
61
58
  `Exporting provider "${
62
59
  options.entityId
63
- }" from realm "${storage.session.getRealm()}"...`
60
+ }" from realm "${state.default.session.getRealm()}"...`
64
61
  );
65
62
  exportProvider(options.entityId, options.file);
66
63
  }
67
64
  // --all -a
68
65
  else if (options.all) {
69
- printMessage('Exporting all providers to a single file...');
66
+ console.log('Exporting all providers to a single file...');
70
67
  exportProvidersToFile(options.file);
71
68
  }
72
69
  // --all-separate -A
73
70
  else if (options.allSeparate) {
74
- printMessage('Exporting all providers to separate files...');
71
+ console.log('Exporting all providers to separate files...');
75
72
  exportProvidersToFiles();
76
73
  }
77
74
  // unrecognized combination of options or no options
78
75
  else {
79
- printMessage(
76
+ console.log(
80
77
  'Unrecognized combination of options or no options...',
81
78
  'error'
82
79
  );
@@ -1,14 +1,15 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Saml, 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
  importProvider,
8
9
  importProvidersFromFile,
9
10
  importProvidersFromFiles,
10
11
  importFirstProvider,
11
- } from '../../ops/SamlOps.js';
12
+ } = Saml;
12
13
 
13
14
  const program = new Command('frodo saml import');
14
15
 
@@ -49,48 +50,48 @@ program
49
50
  .action(
50
51
  // implement program logic inside action handler
51
52
  async (host, realm, user, password, options) => {
52
- storage.session.setTenant(host);
53
- storage.session.setRealm(realm);
54
- storage.session.setUsername(user);
55
- storage.session.setPassword(password);
56
- storage.session.setDeploymentType(options.type);
57
- 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);
58
59
  if (await getTokens()) {
59
60
  // import by id
60
61
  if (options.file && options.entityId) {
61
- printMessage(
62
+ console.log(
62
63
  `Importing provider "${
63
64
  options.entityId
64
- }" into realm "${storage.session.getRealm()}"...`
65
+ }" into realm "${state.default.session.getRealm()}"...`
65
66
  );
66
67
  importProvider(options.entityId, options.file);
67
68
  }
68
69
  // --all -a
69
70
  else if (options.all && options.file) {
70
- printMessage(
71
+ console.log(
71
72
  `Importing all providers from a single file (${options.file})...`
72
73
  );
73
74
  importProvidersFromFile(options.file);
74
75
  }
75
76
  // --all-separate -A
76
77
  else if (options.allSeparate && !options.file) {
77
- printMessage(
78
+ console.log(
78
79
  'Importing all providers from separate files (*.saml.json) in current directory...'
79
80
  );
80
81
  importProvidersFromFiles();
81
82
  }
82
83
  // import first provider from file
83
84
  else if (options.file) {
84
- printMessage(
85
+ console.log(
85
86
  `Importing first provider from file "${
86
87
  options.file
87
- }" into realm "${storage.session.getRealm()}"...`
88
+ }" into realm "${state.default.session.getRealm()}"...`
88
89
  );
89
90
  importFirstProvider(options.file);
90
91
  }
91
92
  // unrecognized combination of options or no options
92
93
  else {
93
- printMessage('Unrecognized combination of options or no options...');
94
+ console.log('Unrecognized combination of options or no options...');
94
95
  program.help();
95
96
  }
96
97
  }
@@ -1,9 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Saml, 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 { listProviders } from '../../ops/SamlOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { listProviders } = Saml;
7
7
 
8
8
  const program = new Command('frodo saml 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 SAML entity providers in realm "${storage.session.getRealm()}"...`
33
+ console.log(
34
+ `Listing SAML entity providers in realm "${state.default.session.getRealm()}"...`
35
35
  );
36
36
  listProviders(options.long);
37
37
  }
@@ -1,14 +1,10 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Saml, 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
- exportCircleOfTrust,
8
- exportCirclesOfTrustToFile,
9
- exportCirclesOfTrustToFiles,
10
- } from '../../ops/CirclesOfTrustOps.js';
11
- import { exportMetadata } from '../../ops/SamlOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+
7
+ const { exportMetadata } = Saml;
12
8
 
13
9
  const program = new Command('frodo saml metadata export');
14
10
 
@@ -43,30 +39,30 @@ program
43
39
  .action(
44
40
  // implement command logic inside action handler
45
41
  async (host, realm, user, password, options) => {
46
- storage.session.setTenant(host);
47
- storage.session.setRealm(realm);
48
- storage.session.setUsername(user);
49
- storage.session.setPassword(password);
50
- storage.session.setDeploymentType(options.type);
51
- storage.session.setAllowInsecureConnection(options.insecure);
42
+ state.default.session.setTenant(host);
43
+ state.default.session.setRealm(realm);
44
+ state.default.session.setUsername(user);
45
+ state.default.session.setPassword(password);
46
+ state.default.session.setDeploymentType(options.type);
47
+ state.default.session.setAllowInsecureConnection(options.insecure);
52
48
  if (await getTokens()) {
53
49
  // export by id/name
54
50
  if (options.entityId) {
55
- printMessage(
51
+ console.log(
56
52
  `Exporting metadata for provider "${
57
53
  options.entityId
58
- }" from realm "${storage.session.getRealm()}"...`
54
+ }" from realm "${state.default.session.getRealm()}"...`
59
55
  );
60
56
  exportMetadata(options.entityId, options.file);
61
57
  }
62
58
  // // --all-separate -A
63
59
  // else if (options.allSeparate) {
64
- // printMessage('Exporting all providers to separate files...');
60
+ // console.log('Exporting all providers to separate files...');
65
61
  // exportProvidersToFiles();
66
62
  // }
67
63
  // unrecognized combination of options or no options
68
64
  else {
69
- printMessage(
65
+ console.log(
70
66
  'Unrecognized combination of options or no options...',
71
67
  'error'
72
68
  );
@@ -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 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 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,13 +1,11 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Script, 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
- exportScriptByName,
8
- exportScriptsToFile,
9
- exportScriptsToFiles,
10
- } from '../../ops/ScriptOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { exportScriptByName } = Script;
7
+ const { exportScriptsToFile } = Script;
8
+ const { exportScriptsToFiles } = Script;
11
9
 
12
10
  const program = new Command('frodo script export');
13
11
 
@@ -37,13 +35,13 @@ program
37
35
  .addOption(
38
36
  new Option(
39
37
  '-a, --all',
40
- 'Export all cmds to a single file. Ignored with -i.'
38
+ 'Export all scripts to a single file. Ignored with -i.'
41
39
  )
42
40
  )
43
41
  .addOption(
44
42
  new Option(
45
43
  '-A, --all-separate',
46
- 'Export all cmds to separate files (*.cmd.json) in the current directory. Ignored with -i or -a.'
44
+ 'Export all scripts to separate files (*.script.json) in the current directory. Ignored with -i or -a.'
47
45
  )
48
46
  )
49
47
  // deprecated option
@@ -56,16 +54,16 @@ program
56
54
  .action(
57
55
  // implement command logic inside action handler
58
56
  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);
57
+ state.default.session.setTenant(host);
58
+ state.default.session.setRealm(realm);
59
+ state.default.session.setUsername(user);
60
+ state.default.session.setPassword(password);
61
+ state.default.session.setDeploymentType(options.type);
62
+ state.default.session.setAllowInsecureConnection(options.insecure);
65
63
  if (await getTokens()) {
66
64
  // export by name
67
65
  if (options.scriptName || options.script) {
68
- printMessage('Exporting script...');
66
+ console.log('Exporting script...');
69
67
  exportScriptByName(
70
68
  options.scriptName || options.script,
71
69
  options.file
@@ -73,17 +71,17 @@ program
73
71
  }
74
72
  // -a / --all
75
73
  else if (options.all) {
76
- printMessage('Exporting all scripts to a single file...');
74
+ console.log('Exporting all scripts to a single file...');
77
75
  exportScriptsToFile(options.file);
78
76
  }
79
77
  // -A / --all-separate
80
78
  else if (options.allSeparate) {
81
- printMessage('Exporting all scripts to separate files...');
79
+ console.log('Exporting all scripts to separate files...');
82
80
  exportScriptsToFiles();
83
81
  }
84
82
  // unrecognized combination of options or no options
85
83
  else {
86
- printMessage(
84
+ console.log(
87
85
  'Unrecognized combination of options or no options...',
88
86
  'error'
89
87
  );
@@ -1,9 +1,10 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Script, 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 { importScriptsFromFile } from '../../ops/ScriptOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+
7
+ const { importScriptsFromFile } = Script;
7
8
 
8
9
  const program = new Command('frodo script import');
9
10
 
@@ -40,15 +41,15 @@ program
40
41
  .action(
41
42
  // implement command logic inside action handler
42
43
  async (host, realm, user, password, options) => {
43
- storage.session.setTenant(host);
44
- storage.session.setRealm(realm);
45
- storage.session.setUsername(user);
46
- storage.session.setPassword(password);
47
- storage.session.setDeploymentType(options.type);
48
- storage.session.setAllowInsecureConnection(options.insecure);
44
+ state.default.session.setTenant(host);
45
+ state.default.session.setRealm(realm);
46
+ state.default.session.setUsername(user);
47
+ state.default.session.setPassword(password);
48
+ state.default.session.setDeploymentType(options.type);
49
+ state.default.session.setAllowInsecureConnection(options.insecure);
49
50
  if (await getTokens()) {
50
- printMessage(
51
- `Importing script(s) into realm "${storage.session.getRealm()}"...`
51
+ console.log(
52
+ `Importing script(s) into realm "${state.default.session.getRealm()}"...`
52
53
  );
53
54
  importScriptsFromFile(
54
55
  options.scriptName || options.script,
@@ -1,9 +1,9 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, Script, 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 { listScripts } from '../../ops/ScriptOps.js';
4
+
5
+ const { getTokens } = Authenticate;
6
+ const { listScripts } = Script;
7
7
 
8
8
  const program = new Command('frodo script 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 scripts in realm "${storage.session.getRealm()}"...`
33
+ console.log(
34
+ `Listing scripts in realm "${state.default.session.getRealm()}"...`
35
35
  );
36
36
  await listScripts(options.long);
37
37
  }