@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.
- package/CHANGELOG.md +13 -1
- package/README.md +3 -3
- package/package.json +17 -15
- package/src/app.js +7 -6
- package/src/cli/_template/cmd-delete.js +9 -8
- package/src/cli/_template/cmd-describe.js +9 -8
- package/src/cli/_template/cmd-export.js +9 -8
- package/src/cli/_template/cmd-import.js +9 -8
- package/src/cli/_template/cmd-list.js +9 -8
- package/src/cli/_template/cmd-sub1-delete.js +9 -8
- package/src/cli/_template/cmd-sub1-describe.js +9 -8
- package/src/cli/_template/cmd-sub1-export.js +9 -8
- package/src/cli/_template/cmd-sub1-import.js +9 -8
- package/src/cli/_template/cmd-sub1-list.js +9 -8
- package/src/cli/_template/cmd-sub2-delete.js +9 -8
- package/src/cli/_template/cmd-sub2-describe.js +9 -8
- package/src/cli/_template/cmd-sub2-export.js +9 -8
- package/src/cli/_template/cmd-sub2-import.js +9 -8
- package/src/cli/_template/cmd-sub2-list.js +9 -8
- package/src/cli/admin/admin-add-autoid-static-user-mapping.js +12 -12
- package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +15 -18
- package/src/cli/admin/admin-get-access-token.js +12 -12
- package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.js +13 -13
- package/src/cli/admin/admin-hide-generic-extension-attributes.js +13 -13
- package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +13 -13
- package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +14 -13
- package/src/cli/admin/admin-list-static-user-mappings.js +12 -12
- package/src/cli/admin/admin-remove-static-user-mapping.js +12 -12
- package/src/cli/admin/admin-repair-org-model.js +13 -13
- package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +13 -13
- package/src/cli/admin/admin-show-generic-extension-attributes.js +13 -13
- package/src/cli/app/app-delete.js +9 -8
- package/src/cli/app/app-describe.js +9 -8
- package/src/cli/app/app-export.js +15 -15
- package/src/cli/app/app-import.js +11 -11
- package/src/cli/app/app-list.js +11 -12
- package/src/cli/conn/conn-add.js +11 -11
- package/src/cli/conn/conn-delete.js +3 -1
- package/src/cli/conn/conn-describe.js +3 -1
- package/src/cli/conn/conn-list.js +3 -4
- package/src/cli/email/email-template-export.js +16 -16
- package/src/cli/email/email-template-import.js +16 -16
- package/src/cli/email/email-template-list.js +11 -11
- package/src/cli/esv/esv-apply.js +12 -12
- package/src/cli/esv/esv-secret-create.js +11 -11
- package/src/cli/esv/esv-secret-delete.js +13 -13
- package/src/cli/esv/esv-secret-describe.js +11 -11
- package/src/cli/esv/esv-secret-export.js +9 -8
- package/src/cli/esv/esv-secret-import.js +9 -8
- package/src/cli/esv/esv-secret-list.js +11 -11
- package/src/cli/esv/esv-secret-set.js +11 -11
- package/src/cli/esv/esv-secret-version-activate.js +12 -12
- package/src/cli/esv/esv-secret-version-create.js +11 -11
- package/src/cli/esv/esv-secret-version-deactivate.js +12 -12
- package/src/cli/esv/esv-secret-version-delete.js +13 -13
- package/src/cli/esv/esv-secret-version-list.js +11 -11
- package/src/cli/esv/esv-variable-create.js +11 -11
- package/src/cli/esv/esv-variable-delete.js +13 -16
- package/src/cli/esv/esv-variable-describe.js +11 -11
- package/src/cli/esv/esv-variable-export.js +9 -8
- package/src/cli/esv/esv-variable-import.js +9 -8
- package/src/cli/esv/esv-variable-list.js +11 -11
- package/src/cli/esv/esv-variable-set.js +13 -16
- package/src/cli/idm/idm-count.js +11 -11
- package/src/cli/idm/idm-export.js +16 -16
- package/src/cli/idm/idm-list.js +11 -11
- package/src/cli/idp/idp-export.js +15 -19
- package/src/cli/idp/idp-import.js +18 -18
- package/src/cli/idp/idp-list.js +12 -12
- package/src/cli/info/info.js +23 -19
- package/src/cli/journey/journey-delete.js +14 -14
- package/src/cli/journey/journey-describe.js +26 -35
- package/src/cli/journey/journey-export.js +18 -21
- package/src/cli/journey/journey-import.js +17 -17
- package/src/cli/journey/journey-list.js +12 -12
- package/src/cli/journey/journey-prune.js +12 -12
- package/src/cli/logging/logs-list.js +33 -28
- package/src/cli/logging/logs-tail.js +26 -22
- package/src/cli/realm/realm-add-custom-domain.js +13 -13
- package/src/cli/realm/realm-describe.js +14 -14
- package/src/cli/realm/realm-list.js +11 -11
- package/src/cli/realm/realm-remove-custom-domain.js +16 -13
- package/src/cli/saml/saml-cot-export.js +16 -16
- package/src/cli/saml/saml-cot-import.js +18 -18
- package/src/cli/saml/saml-cot-list.js +12 -12
- package/src/cli/saml/saml-describe.js +12 -12
- package/src/cli/saml/saml-export.js +16 -19
- package/src/cli/saml/saml-import.js +19 -18
- package/src/cli/saml/saml-list.js +12 -12
- package/src/cli/saml/saml-metadata-export.js +15 -19
- package/src/cli/script/script-delete.js +9 -8
- package/src/cli/script/script-describe.js +9 -8
- package/src/cli/script/script-export.js +18 -20
- package/src/cli/script/script-import.js +13 -12
- package/src/cli/script/script-list.js +12 -12
- package/src/cli/theme/theme-delete.js +17 -21
- package/src/cli/theme/theme-export.js +19 -18
- package/src/cli/theme/theme-import.js +21 -20
- package/src/cli/theme/theme-list.js +12 -12
- package/.eslintrc +0 -29
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/README.md +0 -273
- package/.github/workflows/pipeline.yml +0 -487
- package/.prettierrc +0 -6
- package/CODE_OF_CONDUCT.md +0 -128
- package/docs/BINARIES.md +0 -22
- package/docs/CONTRIBUTE.md +0 -96
- package/docs/PIPELINE.md +0 -169
- package/docs/images/macos_warn1.png +0 -0
- package/docs/images/macos_warn2.png +0 -0
- package/docs/images/macos_warn3.png +0 -0
- package/docs/images/npm_versioning_guidelines.png +0 -0
- package/docs/images/release_pipeline.png +0 -0
- package/gulpfile.js +0 -49
- package/jsconfig.json +0 -6
- package/resources/sampleEntitiesFile.json +0 -8
- package/resources/sampleEnvFile.env +0 -2
- package/src/api/AuthenticateApi.js +0 -33
- package/src/api/BaseApi.js +0 -242
- package/src/api/CirclesOfTrustApi.js +0 -87
- package/src/api/EmailTemplateApi.js +0 -37
- package/src/api/IdmConfigApi.js +0 -88
- package/src/api/LogApi.js +0 -45
- package/src/api/ManagedObjectApi.js +0 -62
- package/src/api/OAuth2ClientApi.js +0 -69
- package/src/api/OAuth2OIDCApi.js +0 -73
- package/src/api/OAuth2ProviderApi.js +0 -32
- package/src/api/RealmApi.js +0 -99
- package/src/api/Saml2Api.js +0 -176
- package/src/api/ScriptApi.js +0 -84
- package/src/api/SecretsApi.js +0 -151
- package/src/api/ServerInfoApi.js +0 -41
- package/src/api/SocialIdentityProvidersApi.js +0 -114
- package/src/api/StartupApi.js +0 -45
- package/src/api/ThemeApi.js +0 -181
- package/src/api/TreeApi.js +0 -207
- package/src/api/VariablesApi.js +0 -104
- package/src/api/utils/ApiUtils.js +0 -77
- package/src/api/utils/Base64.js +0 -62
- package/src/cli/journey/journey-delete.e2e.test.js +0 -380
- package/src/cli/journey/journey-list.e2e.test.js +0 -141
- package/src/cli/theme/theme-delete.e2e.test.js +0 -178
- package/src/cli/theme/theme-list.e2e.test.js +0 -119
- package/src/ops/AdminOps.js +0 -901
- package/src/ops/AuthenticateOps.js +0 -342
- package/src/ops/CirclesOfTrustOps.js +0 -350
- package/src/ops/ConnectionProfileOps.js +0 -254
- package/src/ops/EmailTemplateOps.js +0 -326
- package/src/ops/IdmOps.js +0 -227
- package/src/ops/IdpOps.js +0 -342
- package/src/ops/JourneyOps.js +0 -2026
- package/src/ops/LogOps.js +0 -357
- package/src/ops/ManagedObjectOps.js +0 -34
- package/src/ops/OAuth2ClientOps.js +0 -151
- package/src/ops/OrganizationOps.js +0 -85
- package/src/ops/RealmOps.js +0 -139
- package/src/ops/SamlOps.js +0 -541
- package/src/ops/ScriptOps.js +0 -211
- package/src/ops/SecretsOps.js +0 -288
- package/src/ops/StartupOps.js +0 -114
- package/src/ops/ThemeOps.js +0 -379
- package/src/ops/VariablesOps.js +0 -185
- package/src/ops/templates/OAuth2ClientTemplate.json +0 -270
- package/src/ops/templates/OrgModelUserAttributesTemplate.json +0 -149
- package/src/ops/templates/cloud/GenericExtensionAttributesTemplate.json +0 -392
- package/src/ops/templates/cloud/managed.json +0 -4119
- package/src/ops/utils/Console.js +0 -434
- package/src/ops/utils/DataProtection.js +0 -92
- package/src/ops/utils/ExportImportUtils.js +0 -146
- package/src/ops/utils/OpsUtils.js +0 -76
- package/src/ops/utils/Wordwrap.js +0 -11
- package/src/storage/SessionStorage.js +0 -45
- package/test/client_cli/en/connections.test.js +0 -62
- package/test/client_cli/en/connections_add.test.js +0 -34
- package/test/client_cli/en/connections_delete.test.js +0 -34
- package/test/client_cli/en/connections_list.test.js +0 -34
- package/test/client_cli/en/email_templates.test.js +0 -77
- package/test/client_cli/en/email_templates_export.test.js +0 -196
- package/test/client_cli/en/email_templates_import.test.js +0 -145
- package/test/client_cli/en/email_templates_list.test.js +0 -130
- package/test/client_cli/en/idm.test.js +0 -111
- package/test/client_cli/en/idm_count.test.js +0 -121
- package/test/client_cli/en/idm_export.test.js +0 -136
- package/test/client_cli/en/idm_exportAll.test.js +0 -156
- package/test/client_cli/en/idm_exportAllRaw.test.js +0 -120
- package/test/client_cli/en/idm_import.test_.js +0 -103
- package/test/client_cli/en/idm_importAll.test_.js +0 -103
- package/test/client_cli/en/idm_list.test.js +0 -103
- package/test/client_cli/en/info.test.js +0 -125
- package/test/client_cli/en/journey.test.js +0 -127
- package/test/client_cli/en/journey_describe.test.js +0 -196
- package/test/client_cli/en/journey_export.test.js +0 -213
- package/test/client_cli/en/journey_import.test.js +0 -195
- package/test/client_cli/en/journey_importAll.test.js +0 -180
- package/test/client_cli/en/journey_list.test.js +0 -162
- package/test/client_cli/en/journey_prune.test.js +0 -148
- package/test/client_cli/en/logs.test.js +0 -79
- package/test/client_cli/en/logs_list.test.js +0 -83
- package/test/client_cli/en/logs_tail.test.js +0 -118
- package/test/client_cli/en/root.test.js +0 -91
- package/test/client_cli/en/script.test.js +0 -77
- package/test/client_cli/en/script_export.test.js +0 -213
- package/test/client_cli/en/script_import.test.js +0 -163
- package/test/client_cli/en/script_list.test.js +0 -148
- package/test/client_cli/utils/utils.js +0 -32
- package/test/e2e/journey/baseline/ForgottenUsername.journey.json +0 -216
- package/test/e2e/journey/baseline/Login.journey.json +0 -205
- package/test/e2e/journey/baseline/PasswordGrant.journey.json +0 -139
- package/test/e2e/journey/baseline/ProgressiveProfile.journey.json +0 -198
- package/test/e2e/journey/baseline/Registration.journey.json +0 -249
- package/test/e2e/journey/baseline/ResetPassword.journey.json +0 -268
- package/test/e2e/journey/baseline/UpdatePassword.journey.json +0 -323
- package/test/e2e/journey/baseline/allAlphaJourneys.journeys.json +0 -1520
- package/test/e2e/journey/delete/ForgottenUsername.journey.json +0 -216
- package/test/e2e/journey/delete/Login.journey.json +0 -205
- package/test/e2e/journey/delete/PasswordGrant.journey.json +0 -139
- package/test/e2e/journey/delete/ProgressiveProfile.journey.json +0 -198
- package/test/e2e/journey/delete/Registration.journey.json +0 -249
- package/test/e2e/journey/delete/ResetPassword.journey.json +0 -268
- package/test/e2e/journey/delete/UpdatePassword.journey.json +0 -323
- package/test/e2e/journey/delete/deleteMe.journey.json +0 -230
- package/test/e2e/journey/list/Disabled.journey.json +0 -43
- package/test/e2e/journey/list/ForgottenUsername.journey.json +0 -216
- package/test/e2e/journey/list/Login.journey.json +0 -205
- package/test/e2e/journey/list/PasswordGrant.journey.json +0 -139
- package/test/e2e/journey/list/ProgressiveProfile.journey.json +0 -198
- package/test/e2e/journey/list/Registration.journey.json +0 -249
- package/test/e2e/journey/list/ResetPassword.journey.json +0 -268
- package/test/e2e/journey/list/UpdatePassword.journey.json +0 -323
- package/test/e2e/setup.js +0 -98
- package/test/e2e/theme/baseline/Contrast.theme.json +0 -95
- package/test/e2e/theme/baseline/Highlander.theme.json +0 -95
- package/test/e2e/theme/baseline/Robroy.theme.json +0 -95
- package/test/e2e/theme/baseline/Starter-Theme.theme.json +0 -94
- package/test/e2e/theme/baseline/Zardoz.theme.json +0 -95
- package/test/e2e/theme/import/Contrast.theme.json +0 -95
- package/test/e2e/theme/import/Highlander.theme.json +0 -95
- package/test/e2e/theme/import/Robroy.theme.json +0 -95
- package/test/e2e/theme/import/Starter-Theme.theme.json +0 -94
- package/test/e2e/theme/import/Zardoz.default.theme.json +0 -95
- package/test/fs_tmp/.gitkeep +0 -2
- package/test/global/setup.js +0 -65
- package/test/lib_api/unit_tests/ApiUtils.test.js +0 -186
- package/test/lib_api/unit_tests/Base64URL.test.js +0 -22
- package/test/lib_api/unit_tests/DataProtection.test.js +0 -25
- package/test/lib_api/unit_tests/ExportImportUtils.test.js +0 -121
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, Idm, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const {
|
|
5
7
|
exportAllConfigEntities,
|
|
6
8
|
exportAllRawConfigEntities,
|
|
7
9
|
exportConfigEntity,
|
|
8
|
-
}
|
|
9
|
-
import storage from '../../storage/SessionStorage.js';
|
|
10
|
-
import { printMessage } from '../../ops/utils/Console.js';
|
|
10
|
+
} = Idm;
|
|
11
11
|
|
|
12
12
|
const program = new Command('frodo idm export');
|
|
13
13
|
|
|
@@ -61,19 +61,19 @@ program
|
|
|
61
61
|
.action(
|
|
62
62
|
// implement command logic inside action handler
|
|
63
63
|
async (host, realm, user, password, options) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
state.default.session.setTenant(host);
|
|
65
|
+
state.default.session.setRealm(realm);
|
|
66
|
+
state.default.session.setUsername(user);
|
|
67
|
+
state.default.session.setPassword(password);
|
|
68
|
+
state.default.session.setDeploymentType(options.type);
|
|
69
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
70
70
|
if (await getTokens()) {
|
|
71
71
|
// export by id/name
|
|
72
72
|
if (options.idmName) {
|
|
73
|
-
|
|
73
|
+
console.log(
|
|
74
74
|
`Exporting object "${
|
|
75
75
|
options.idmName
|
|
76
|
-
}" from realm "${
|
|
76
|
+
}" from realm "${state.default.session.getRealm()}"...`
|
|
77
77
|
);
|
|
78
78
|
exportConfigEntity(options.idmName, options.file);
|
|
79
79
|
}
|
|
@@ -84,7 +84,7 @@ program
|
|
|
84
84
|
options.entitiesFile &&
|
|
85
85
|
options.envFile
|
|
86
86
|
) {
|
|
87
|
-
|
|
87
|
+
console.log(
|
|
88
88
|
`Exporting IDM configuration objects specified in ${options.entitiesFile} into separate files in ${options.directory} using ${options.envFile} for variable replacement...`
|
|
89
89
|
);
|
|
90
90
|
exportAllConfigEntities(
|
|
@@ -95,14 +95,14 @@ program
|
|
|
95
95
|
}
|
|
96
96
|
// --all-separate -A without variable replacement
|
|
97
97
|
else if (options.allSeparate && options.directory) {
|
|
98
|
-
|
|
98
|
+
console.log(
|
|
99
99
|
`Exporting all IDM configuration objects into separate files in ${options.directory}...`
|
|
100
100
|
);
|
|
101
101
|
exportAllRawConfigEntities(options.directory);
|
|
102
102
|
}
|
|
103
103
|
// unrecognized combination of options or no options
|
|
104
104
|
else {
|
|
105
|
-
|
|
105
|
+
console.log(
|
|
106
106
|
'Unrecognized combination of options or no options...',
|
|
107
107
|
'error'
|
|
108
108
|
);
|
package/src/cli/idm/idm-list.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import { Authenticate, Idm, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { getTokens } from '../../ops/AuthenticateOps.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { listAllConfigEntities } = Idm;
|
|
7
7
|
|
|
8
8
|
const program = new Command('frodo idm list');
|
|
9
9
|
|
|
@@ -23,14 +23,14 @@ program
|
|
|
23
23
|
.action(
|
|
24
24
|
// implement command logic inside action handler
|
|
25
25
|
async (host, realm, user, password, options) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
33
|
+
console.log('Listing all IDM configuration objects...');
|
|
34
34
|
listAllConfigEntities();
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, Idp, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exportProvidersToFile,
|
|
7
|
-
exportProvidersToFiles,
|
|
8
|
-
} from '../../ops/IdpOps.js';
|
|
9
|
-
import storage from '../../storage/SessionStorage.js';
|
|
10
|
-
import { printMessage } from '../../ops/utils/Console.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { exportProvider, exportProvidersToFile, exportProvidersToFiles } = Idp;
|
|
11
7
|
|
|
12
8
|
const program = new Command('frodo idp export');
|
|
13
9
|
|
|
@@ -48,35 +44,35 @@ program
|
|
|
48
44
|
.action(
|
|
49
45
|
// implement command logic inside action handler
|
|
50
46
|
async (host, realm, user, password, options) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
state.default.session.setTenant(host);
|
|
48
|
+
state.default.session.setRealm(realm);
|
|
49
|
+
state.default.session.setUsername(user);
|
|
50
|
+
state.default.session.setPassword(password);
|
|
51
|
+
state.default.session.setDeploymentType(options.type);
|
|
52
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
57
53
|
if (await getTokens()) {
|
|
58
54
|
// export by id/name
|
|
59
55
|
if (options.idpId) {
|
|
60
|
-
|
|
56
|
+
console.log(
|
|
61
57
|
`Exporting provider "${
|
|
62
58
|
options.idpId
|
|
63
|
-
}" from realm "${
|
|
59
|
+
}" from realm "${state.default.session.getRealm()}"...`
|
|
64
60
|
);
|
|
65
61
|
exportProvider(options.idpId, options.file);
|
|
66
62
|
}
|
|
67
63
|
// --all -a
|
|
68
64
|
else if (options.all) {
|
|
69
|
-
|
|
65
|
+
console.log('Exporting all providers to a single file...');
|
|
70
66
|
exportProvidersToFile(options.file);
|
|
71
67
|
}
|
|
72
68
|
// --all-separate -A
|
|
73
69
|
else if (options.allSeparate) {
|
|
74
|
-
|
|
70
|
+
console.log('Exporting all providers to separate files...');
|
|
75
71
|
exportProvidersToFiles();
|
|
76
72
|
}
|
|
77
73
|
// unrecognized combination of options or no options
|
|
78
74
|
else {
|
|
79
|
-
|
|
75
|
+
console.log(
|
|
80
76
|
'Unrecognized combination of options or no options...',
|
|
81
77
|
'error'
|
|
82
78
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, Idp, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const {
|
|
5
7
|
importProviderById,
|
|
6
8
|
importFirstProvider,
|
|
7
9
|
importProvidersFromFile,
|
|
8
10
|
importProvidersFromFiles,
|
|
9
|
-
}
|
|
10
|
-
import storage from '../../storage/SessionStorage.js';
|
|
11
|
-
import { printMessage } from '../../ops/utils/Console.js';
|
|
11
|
+
} = Idp;
|
|
12
12
|
|
|
13
13
|
const program = new Command('frodo idp import');
|
|
14
14
|
|
|
@@ -49,48 +49,48 @@ program
|
|
|
49
49
|
.action(
|
|
50
50
|
// implement command logic inside action handler
|
|
51
51
|
async (host, realm, user, password, options) => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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.idpId) {
|
|
61
|
-
|
|
61
|
+
console.log(
|
|
62
62
|
`Importing provider "${
|
|
63
63
|
options.idpId
|
|
64
|
-
}" into realm "${
|
|
64
|
+
}" into realm "${state.default.session.getRealm()}"...`
|
|
65
65
|
);
|
|
66
66
|
importProviderById(options.idpId, options.file);
|
|
67
67
|
}
|
|
68
68
|
// --all -a
|
|
69
69
|
else if (options.all && options.file) {
|
|
70
|
-
|
|
70
|
+
console.log(
|
|
71
71
|
`Importing all providers from a single file (${options.file})...`
|
|
72
72
|
);
|
|
73
73
|
importProvidersFromFile(options.file);
|
|
74
74
|
}
|
|
75
75
|
// --all-separate -A
|
|
76
76
|
else if (options.allSeparate && !options.file) {
|
|
77
|
-
|
|
77
|
+
console.log(
|
|
78
78
|
'Importing all providers from separate files in current directory...'
|
|
79
79
|
);
|
|
80
80
|
importProvidersFromFiles();
|
|
81
81
|
}
|
|
82
82
|
// import first provider from file
|
|
83
83
|
else if (options.file) {
|
|
84
|
-
|
|
84
|
+
console.log(
|
|
85
85
|
`Importing first provider from file "${
|
|
86
86
|
options.file
|
|
87
|
-
}" into realm "${
|
|
87
|
+
}" into realm "${state.default.session.getRealm()}"...`
|
|
88
88
|
);
|
|
89
89
|
importFirstProvider(options.file);
|
|
90
90
|
}
|
|
91
91
|
// unrecognized combination of options or no options
|
|
92
92
|
else {
|
|
93
|
-
|
|
93
|
+
console.log('Unrecognized combination of options or no options...');
|
|
94
94
|
program.help();
|
|
95
95
|
}
|
|
96
96
|
}
|
package/src/cli/idp/idp-list.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import { Authenticate, Idp, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { printMessage } from '../../ops/utils/Console.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { listProviders } = Idp;
|
|
7
7
|
|
|
8
8
|
const program = new Command('frodo idp 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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
34
|
-
`Listing providers in realm "${
|
|
33
|
+
console.log(
|
|
34
|
+
`Listing providers in realm "${state.default.session.getRealm()}"...`
|
|
35
35
|
);
|
|
36
36
|
listProviders();
|
|
37
37
|
}
|
package/src/cli/info/info.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { printMessage } from '../../ops/utils/Console.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
6
|
|
|
7
7
|
export default function setup() {
|
|
8
8
|
const info = new Command('info');
|
|
@@ -16,32 +16,36 @@ export default function setup() {
|
|
|
16
16
|
.addOption(common.scriptFriendlyOption)
|
|
17
17
|
.description('Print versions and tokens.')
|
|
18
18
|
.action(async (host, user, password, options) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
state.default.session.setTenant(host);
|
|
20
|
+
state.default.session.setUsername(user);
|
|
21
|
+
state.default.session.setPassword(password);
|
|
22
|
+
state.default.session.setDeploymentType(options.type);
|
|
23
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
24
|
+
state.default.session.setItem('scriptFriendly', options.scriptFriendly);
|
|
25
25
|
if (!options.scriptFriendly) {
|
|
26
|
-
|
|
26
|
+
console.log('Printing versions and tokens...');
|
|
27
27
|
if (await getTokens()) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
console.log(`Cookie name: ${state.default.session.getCookieName()}`);
|
|
29
|
+
console.log(
|
|
30
|
+
`Session token: ${state.default.session.getCookieValue()}`
|
|
31
|
+
);
|
|
32
|
+
if (state.default.session.getBearerToken()) {
|
|
33
|
+
console.log(
|
|
34
|
+
`Bearer token: ${state.default.session.getBearerToken()}`
|
|
35
|
+
);
|
|
32
36
|
}
|
|
33
37
|
} else {
|
|
34
38
|
process.exitCode = 1;
|
|
35
39
|
}
|
|
36
40
|
} else if (await getTokens()) {
|
|
37
41
|
const output = {
|
|
38
|
-
cookieName:
|
|
39
|
-
sessionToken:
|
|
42
|
+
cookieName: state.default.session.getCookieName(),
|
|
43
|
+
sessionToken: state.default.session.getCookieValue(),
|
|
40
44
|
};
|
|
41
|
-
if (
|
|
42
|
-
output.bearerToken =
|
|
45
|
+
if (state.default.session.getBearerToken()) {
|
|
46
|
+
output.bearerToken = state.default.session.getBearerToken();
|
|
43
47
|
}
|
|
44
|
-
|
|
48
|
+
console.log(JSON.stringify(output, null, 2), 'data');
|
|
45
49
|
} else {
|
|
46
50
|
process.exitCode = 1;
|
|
47
51
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, Journey, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { printMessage } from '../../ops/utils/Console.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { deleteJourney, deleteJourneys } = Journey;
|
|
7
7
|
|
|
8
8
|
const program = new Command('frodo journey delete');
|
|
9
9
|
|
|
@@ -44,30 +44,30 @@ program
|
|
|
44
44
|
.action(
|
|
45
45
|
// implement command logic inside action handler
|
|
46
46
|
async (host, realm, user, password, options) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
state.default.session.setTenant(host);
|
|
48
|
+
state.default.session.setRealm(realm);
|
|
49
|
+
state.default.session.setUsername(user);
|
|
50
|
+
state.default.session.setPassword(password);
|
|
51
|
+
state.default.session.setDeploymentType(options.type);
|
|
52
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
53
53
|
if (await getTokens()) {
|
|
54
54
|
// delete by id
|
|
55
55
|
if (options.journeyId) {
|
|
56
|
-
|
|
56
|
+
console.log(
|
|
57
57
|
`Deleting journey ${
|
|
58
58
|
options.journeyId
|
|
59
|
-
} in realm "${
|
|
59
|
+
} in realm "${state.default.session.getRealm()}"...`
|
|
60
60
|
);
|
|
61
61
|
deleteJourney(options.journeyId, options);
|
|
62
62
|
}
|
|
63
63
|
// --all -a
|
|
64
64
|
else if (options.all) {
|
|
65
|
-
|
|
65
|
+
console.log('Deleting all journeys...');
|
|
66
66
|
deleteJourneys(options);
|
|
67
67
|
}
|
|
68
68
|
// unrecognized combination of options or no options
|
|
69
69
|
else {
|
|
70
|
-
|
|
70
|
+
console.log('Unrecognized combination of options or no options...');
|
|
71
71
|
program.help();
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import { Command, Option } from 'commander';
|
|
3
|
+
import { Authenticate, Journey, state } from '@rockcarver/frodo-lib';
|
|
3
4
|
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
getJourneyData,
|
|
8
|
-
describeTree,
|
|
9
|
-
} from '../../ops/JourneyOps.js';
|
|
10
|
-
import storage from '../../storage/SessionStorage.js';
|
|
11
|
-
import {
|
|
12
|
-
printMessage,
|
|
13
|
-
createProgressBar,
|
|
14
|
-
updateProgressBar,
|
|
15
|
-
stopProgressBar,
|
|
16
|
-
} from '../../ops/utils/Console.js';
|
|
5
|
+
|
|
6
|
+
const { getTokens } = Authenticate;
|
|
7
|
+
const { listJourneys, getJourneyData, describeTree } = Journey;
|
|
17
8
|
|
|
18
9
|
const program = new Command('frodo journey describe');
|
|
19
10
|
|
|
@@ -50,68 +41,68 @@ program
|
|
|
50
41
|
.action(
|
|
51
42
|
// implement command logic inside action handler
|
|
52
43
|
async (host, realm, user, password, options) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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);
|
|
59
50
|
const treeDescription = [];
|
|
60
51
|
// TODO: review checks for arguments
|
|
61
52
|
if (typeof host === 'undefined' || typeof options.file !== 'undefined') {
|
|
62
53
|
if (typeof options.file === 'undefined') {
|
|
63
|
-
|
|
54
|
+
console.log(
|
|
64
55
|
'You either need <host> or -f when using describe',
|
|
65
56
|
'error'
|
|
66
57
|
);
|
|
67
58
|
return;
|
|
68
59
|
}
|
|
69
|
-
|
|
60
|
+
console.log(`Describing local journey file ${options.file}...`);
|
|
70
61
|
try {
|
|
71
62
|
const data = fs.readFileSync(options.file, 'utf8');
|
|
72
63
|
const journeyData = JSON.parse(data);
|
|
73
64
|
treeDescription.push(describeTree(journeyData));
|
|
74
65
|
} catch (err) {
|
|
75
|
-
|
|
66
|
+
console.log(err, 'error');
|
|
76
67
|
}
|
|
77
68
|
} else if (await getTokens()) {
|
|
78
|
-
|
|
79
|
-
`Describing journey(s) in realm "${
|
|
69
|
+
console.log(
|
|
70
|
+
`Describing journey(s) in realm "${state.default.session.getRealm()}"...`
|
|
80
71
|
);
|
|
81
72
|
if (typeof options.journeyId === 'undefined') {
|
|
82
73
|
const journeyList = await listJourneys(false);
|
|
83
|
-
createProgressBar(journeyList.length, '');
|
|
74
|
+
// createProgressBar(journeyList.length, '');
|
|
84
75
|
for (const item of journeyList) {
|
|
85
76
|
// eslint-disable-next-line no-await-in-loop
|
|
86
77
|
const journeyData = await getJourneyData(item.name);
|
|
87
78
|
treeDescription.push(describeTree(journeyData));
|
|
88
|
-
updateProgressBar(`Analyzing journey - ${item.name}`);
|
|
79
|
+
// updateProgressBar(`Analyzing journey - ${item.name}`);
|
|
89
80
|
}
|
|
90
|
-
stopProgressBar('Done');
|
|
81
|
+
// stopProgressBar('Done');
|
|
91
82
|
} else {
|
|
92
83
|
const journeyData = await getJourneyData(options.journeyId);
|
|
93
84
|
treeDescription.push(describeTree(journeyData));
|
|
94
85
|
}
|
|
95
86
|
}
|
|
96
87
|
for (const item of treeDescription) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
88
|
+
console.log(`\nJourney: ${item.treeName}`, 'info');
|
|
89
|
+
console.log('========');
|
|
90
|
+
console.log('\nNodes:', 'info');
|
|
100
91
|
if (Object.entries(item.nodeTypes).length) {
|
|
101
92
|
for (const [name, count] of Object.entries(item.nodeTypes)) {
|
|
102
|
-
|
|
93
|
+
console.log(`- ${name}: ${count}`, 'info');
|
|
103
94
|
}
|
|
104
95
|
}
|
|
105
96
|
if (Object.entries(item.scripts).length) {
|
|
106
|
-
|
|
97
|
+
console.log('\nScripts:', 'info');
|
|
107
98
|
for (const [name, desc] of Object.entries(item.scripts)) {
|
|
108
|
-
|
|
99
|
+
console.log(`- ${name}: ${desc}`, 'info');
|
|
109
100
|
}
|
|
110
101
|
}
|
|
111
102
|
if (Object.entries(item.emailTemplates).length) {
|
|
112
|
-
|
|
103
|
+
console.log('\nEmail Templates:', 'info');
|
|
113
104
|
for (const [id] of Object.entries(item.emailTemplates)) {
|
|
114
|
-
|
|
105
|
+
console.log(`- ${id}`, 'info');
|
|
115
106
|
}
|
|
116
107
|
}
|
|
117
108
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, Journey, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exportJourneysToFiles,
|
|
8
|
-
} from '../../ops/JourneyOps.js';
|
|
9
|
-
import storage from '../../storage/SessionStorage.js';
|
|
10
|
-
import { printMessage } from '../../ops/utils/Console.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { exportJourneyToFile, exportJourneysToFile, exportJourneysToFiles } =
|
|
7
|
+
Journey;
|
|
11
8
|
|
|
12
9
|
const program = new Command('frodo journey export');
|
|
13
10
|
|
|
@@ -66,17 +63,17 @@ program
|
|
|
66
63
|
.action(
|
|
67
64
|
// implement command logic inside action handler
|
|
68
65
|
async (host, realm, user, password, options) => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
state.default.session.setTenant(host);
|
|
67
|
+
state.default.session.setRealm(realm);
|
|
68
|
+
state.default.session.setUsername(user);
|
|
69
|
+
state.default.session.setPassword(password);
|
|
70
|
+
state.default.session.setDeploymentType(options.type);
|
|
71
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
75
72
|
if (await getTokens()) {
|
|
76
73
|
// export
|
|
77
74
|
if (options.journeyId) {
|
|
78
|
-
|
|
79
|
-
exportJourneyToFile(options.journeyId, options.file, {
|
|
75
|
+
console.log('Exporting journey...');
|
|
76
|
+
await exportJourneyToFile(options.journeyId, options.file, {
|
|
80
77
|
useStringArrays: options.useStringArrays,
|
|
81
78
|
deps: options.deps,
|
|
82
79
|
verbose: options.verbose,
|
|
@@ -84,8 +81,8 @@ program
|
|
|
84
81
|
}
|
|
85
82
|
// --all -a
|
|
86
83
|
else if (options.all) {
|
|
87
|
-
|
|
88
|
-
exportJourneysToFile(options.file, {
|
|
84
|
+
console.log('Exporting all journeys to a single file...');
|
|
85
|
+
await exportJourneysToFile(options.file, {
|
|
89
86
|
useStringArrays: options.useStringArrays,
|
|
90
87
|
deps: options.deps,
|
|
91
88
|
verbose: options.verbose,
|
|
@@ -93,8 +90,8 @@ program
|
|
|
93
90
|
}
|
|
94
91
|
// --all-separate -A
|
|
95
92
|
else if (options.allSeparate) {
|
|
96
|
-
|
|
97
|
-
exportJourneysToFiles({
|
|
93
|
+
console.log('Exporting all journeys to separate files...');
|
|
94
|
+
await exportJourneysToFiles({
|
|
98
95
|
useStringArrays: options.useStringArrays,
|
|
99
96
|
deps: options.deps,
|
|
100
97
|
verbose: options.verbose,
|
|
@@ -102,7 +99,7 @@ program
|
|
|
102
99
|
}
|
|
103
100
|
// unrecognized combination of options or no options
|
|
104
101
|
else {
|
|
105
|
-
|
|
102
|
+
console.log('Unrecognized combination of options or no options...');
|
|
106
103
|
program.help();
|
|
107
104
|
}
|
|
108
105
|
}
|