@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, OAuth2Client, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const {
|
|
7
7
|
exportOAuth2ClientsToFile,
|
|
8
8
|
exportOAuth2ClientsToFiles,
|
|
9
9
|
exportOAuth2ClientToFile,
|
|
10
|
-
}
|
|
10
|
+
} = OAuth2Client;
|
|
11
11
|
|
|
12
12
|
const program = new Command('frodo app export');
|
|
13
13
|
|
|
@@ -43,31 +43,31 @@ program
|
|
|
43
43
|
.action(
|
|
44
44
|
// implement command logic inside action handler
|
|
45
45
|
async (host, realm, user, password, options) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
state.default.session.setTenant(host);
|
|
47
|
+
state.default.session.setRealm(realm);
|
|
48
|
+
state.default.session.setUsername(user);
|
|
49
|
+
state.default.session.setPassword(password);
|
|
50
|
+
state.default.session.setDeploymentType(options.type);
|
|
51
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
52
52
|
if (await getTokens()) {
|
|
53
53
|
// export
|
|
54
54
|
if (options.appId) {
|
|
55
|
-
|
|
55
|
+
console.log('Exporting OAuth2 application...');
|
|
56
56
|
exportOAuth2ClientToFile(options.appId, options.file);
|
|
57
57
|
}
|
|
58
58
|
// -a/--all
|
|
59
59
|
else if (options.all) {
|
|
60
|
-
|
|
60
|
+
console.log('Exporting all OAuth2 applications to file...');
|
|
61
61
|
exportOAuth2ClientsToFile(options.file);
|
|
62
62
|
}
|
|
63
63
|
// -A/--all-separate
|
|
64
64
|
else if (options.allSeparate) {
|
|
65
|
-
|
|
65
|
+
console.log('Exporting all applications to separate files...');
|
|
66
66
|
exportOAuth2ClientsToFiles();
|
|
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,9 +1,9 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { importOAuth2ClientsFromFile } from '../../ops/OAuth2ClientOps.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { importOAuth2ClientsFromFile } = OAuth2Client;
|
|
7
7
|
|
|
8
8
|
const program = new Command('frodo app import');
|
|
9
9
|
|
|
@@ -39,14 +39,14 @@ program
|
|
|
39
39
|
.action(
|
|
40
40
|
// implement command logic inside action handler
|
|
41
41
|
async (host, realm, user, password, options) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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);
|
|
48
48
|
if (await getTokens()) {
|
|
49
|
-
|
|
49
|
+
console.log(`Importing OAuth2 application(s) ...`);
|
|
50
50
|
importOAuth2ClientsFromFile(options.file);
|
|
51
51
|
}
|
|
52
52
|
}
|
package/src/cli/app/app-list.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { getOAuth2Clients } from '../../api/OAuth2ClientApi.js';
|
|
7
|
-
import { listOAuth2Clients } from '../../ops/OAuth2ClientOps.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { listOAuth2Clients } = OAuth2Client;
|
|
8
7
|
|
|
9
8
|
const program = new Command('frodo app list');
|
|
10
9
|
|
|
@@ -24,14 +23,14 @@ program
|
|
|
24
23
|
.action(
|
|
25
24
|
// implement command logic inside action handler
|
|
26
25
|
async (host, realm, user, password, options) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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);
|
|
33
32
|
if (await getTokens()) {
|
|
34
|
-
|
|
33
|
+
console.log(`Listing OAuth2 applications...`);
|
|
35
34
|
listOAuth2Clients(options.long);
|
|
36
35
|
}
|
|
37
36
|
}
|
package/src/cli/conn/conn-add.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, ConnectionProfile, 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 { saveConnectionProfile } = ConnectionProfile;
|
|
7
7
|
|
|
8
8
|
const program = new Command('frodo conn add');
|
|
9
9
|
|
|
@@ -24,13 +24,13 @@ program
|
|
|
24
24
|
.action(
|
|
25
25
|
// implement command logic inside action handler
|
|
26
26
|
async (host, user, password, key, secret, options) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
state.default.session.setTenant(host);
|
|
28
|
+
state.default.session.setUsername(user);
|
|
29
|
+
state.default.session.setPassword(password);
|
|
30
|
+
state.default.session.setLogApiKey(key);
|
|
31
|
+
state.default.session.setLogApiSecret(secret);
|
|
32
|
+
state.default.session.setDeploymentType(options.type);
|
|
33
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
34
34
|
if ((options.validate && (await getTokens())) || !options.validate) {
|
|
35
35
|
saveConnectionProfile();
|
|
36
36
|
} else {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import { ConnectionProfile } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
const { deleteConnectionProfile } = ConnectionProfile;
|
|
4
6
|
|
|
5
7
|
const program = new Command('frodo conn delete');
|
|
6
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { ConnectionProfile } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
const { describeConnectionProfile } = ConnectionProfile;
|
|
4
6
|
|
|
5
7
|
const program = new Command('frodo conn describe');
|
|
6
8
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { listConnectionProfiles } from '../../ops/ConnectionProfileOps.js';
|
|
2
|
+
import { ConnectionProfile } from '@rockcarver/frodo-lib';
|
|
3
|
+
|
|
4
|
+
const { listConnectionProfiles } = ConnectionProfile;
|
|
6
5
|
|
|
7
6
|
const program = new Command('frodo conn list');
|
|
8
7
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, EmailTemplate, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const {
|
|
7
7
|
exportEmailTemplatesToFile,
|
|
8
8
|
exportEmailTemplatesToFiles,
|
|
9
9
|
exportEmailTemplateToFile,
|
|
10
|
-
}
|
|
10
|
+
} = EmailTemplate;
|
|
11
11
|
|
|
12
12
|
const program = new Command('frodo email template export');
|
|
13
13
|
|
|
@@ -48,35 +48,35 @@ program
|
|
|
48
48
|
.action(
|
|
49
49
|
// implement command logic inside action handler
|
|
50
50
|
async (host, realm, user, password, options) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
state.default.session.setTenant(host);
|
|
52
|
+
state.default.session.setRealm(realm);
|
|
53
|
+
state.default.session.setUsername(user);
|
|
54
|
+
state.default.session.setPassword(password);
|
|
55
|
+
state.default.session.setDeploymentType(options.type);
|
|
56
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
57
57
|
if (await getTokens()) {
|
|
58
58
|
// export by id/name
|
|
59
59
|
if (options.templateId) {
|
|
60
|
-
|
|
60
|
+
console.log(
|
|
61
61
|
`Exporting email template "${
|
|
62
62
|
options.templateId
|
|
63
|
-
}" from realm "${
|
|
63
|
+
}" from realm "${state.default.session.getRealm()}"...`
|
|
64
64
|
);
|
|
65
65
|
exportEmailTemplateToFile(options.templateId, options.file);
|
|
66
66
|
}
|
|
67
67
|
// --all -a
|
|
68
68
|
else if (options.all) {
|
|
69
|
-
|
|
69
|
+
console.log('Exporting all email templates to a single file...');
|
|
70
70
|
exportEmailTemplatesToFile(options.file);
|
|
71
71
|
}
|
|
72
72
|
// --all-separate -A
|
|
73
73
|
else if (options.allSeparate) {
|
|
74
|
-
|
|
74
|
+
console.log('Exporting all email templates to separate files...');
|
|
75
75
|
exportEmailTemplatesToFiles();
|
|
76
76
|
}
|
|
77
77
|
// unrecognized combination of options or no options
|
|
78
78
|
else {
|
|
79
|
-
|
|
79
|
+
console.log(
|
|
80
80
|
'Unrecognized combination of options or no options...',
|
|
81
81
|
'error'
|
|
82
82
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, EmailTemplate, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const {
|
|
7
7
|
importEmailTemplateFromFile,
|
|
8
8
|
importEmailTemplatesFromFile,
|
|
9
9
|
importEmailTemplatesFromFiles,
|
|
10
10
|
importFirstEmailTemplateFromFile,
|
|
11
|
-
}
|
|
11
|
+
} = EmailTemplate;
|
|
12
12
|
|
|
13
13
|
const program = new Command('frodo email template import');
|
|
14
14
|
|
|
@@ -44,42 +44,42 @@ program
|
|
|
44
44
|
.action(
|
|
45
45
|
// implement program 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
|
// import by id
|
|
55
55
|
if (options.file && options.templateId) {
|
|
56
|
-
|
|
56
|
+
console.log(`Importing email template "${options.templateId}"...`);
|
|
57
57
|
importEmailTemplateFromFile(options.templateId, options.file);
|
|
58
58
|
}
|
|
59
59
|
// --all -a
|
|
60
60
|
else if (options.all && options.file) {
|
|
61
|
-
|
|
61
|
+
console.log(
|
|
62
62
|
`Importing all email templates from a single file (${options.file})...`
|
|
63
63
|
);
|
|
64
64
|
importEmailTemplatesFromFile(options.file);
|
|
65
65
|
}
|
|
66
66
|
// --all-separate -A
|
|
67
67
|
else if (options.allSeparate && !options.file) {
|
|
68
|
-
|
|
68
|
+
console.log(
|
|
69
69
|
'Importing all email templates from separate files (*.template.email.json) in current directory...'
|
|
70
70
|
);
|
|
71
71
|
importEmailTemplatesFromFiles();
|
|
72
72
|
}
|
|
73
73
|
// import first template from file
|
|
74
74
|
else if (options.file) {
|
|
75
|
-
|
|
75
|
+
console.log(
|
|
76
76
|
`Importing first email template from file "${options.file}"...`
|
|
77
77
|
);
|
|
78
78
|
importFirstEmailTemplateFromFile(options.file);
|
|
79
79
|
}
|
|
80
80
|
// unrecognized combination of options or no options
|
|
81
81
|
else {
|
|
82
|
-
|
|
82
|
+
console.log('Unrecognized combination of options or no options...');
|
|
83
83
|
program.help();
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, EmailTemplate, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { listEmailTemplates } from '../../ops/EmailTemplateOps.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { listEmailTemplates } = EmailTemplate;
|
|
7
7
|
|
|
8
8
|
const program = new Command('frodo email template 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 email templates ...`);
|
|
34
34
|
listEmailTemplates(options.long);
|
|
35
35
|
}
|
|
36
36
|
}
|
package/src/cli/esv/esv-apply.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, Startup, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { applyUpdates, checkForUpdates } from '../../ops/StartupOps.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { applyUpdates, checkForUpdates } = Startup;
|
|
7
7
|
|
|
8
8
|
const program = new Command('frodo esv apply');
|
|
9
9
|
|
|
@@ -41,21 +41,21 @@ program
|
|
|
41
41
|
.action(
|
|
42
42
|
// implement command logic inside action handler
|
|
43
43
|
async (host, realm, user, password, options) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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);
|
|
50
50
|
if (await getTokens()) {
|
|
51
51
|
// check for updates only
|
|
52
52
|
if (options.checkOnly) {
|
|
53
|
-
|
|
53
|
+
console.log(`Checking for updates...`);
|
|
54
54
|
await checkForUpdates();
|
|
55
55
|
}
|
|
56
56
|
// apply updates
|
|
57
57
|
else {
|
|
58
|
-
|
|
58
|
+
console.log(`Applying updates...`);
|
|
59
59
|
await applyUpdates(options.force, options.wait, options.yes);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { createSecret } from '../../ops/SecretsOps.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { createSecret } = Secrets;
|
|
7
7
|
|
|
8
8
|
const program = new Command('frodo esv secret create');
|
|
9
9
|
|
|
@@ -41,14 +41,14 @@ program
|
|
|
41
41
|
.action(
|
|
42
42
|
// implement command logic inside action handler
|
|
43
43
|
async (host, realm, user, password, options) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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);
|
|
50
50
|
if (await getTokens()) {
|
|
51
|
-
|
|
51
|
+
console.log('Creating secret...');
|
|
52
52
|
createSecret(
|
|
53
53
|
options.secretId,
|
|
54
54
|
options.value,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
+
import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
|
|
2
3
|
import * as common from '../cmd_common.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { deleteSecretCmd, deleteSecretsCmd } from '../../ops/SecretsOps.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
6
|
+
const { deleteSecretCmd, deleteSecretsCmd } = Secrets;
|
|
7
7
|
|
|
8
8
|
const program = new Command('frodo esv secret delete');
|
|
9
9
|
|
|
@@ -35,26 +35,26 @@ program
|
|
|
35
35
|
.action(
|
|
36
36
|
// implement command logic inside action handler
|
|
37
37
|
async (host, realm, user, password, options) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
state.default.session.setTenant(host);
|
|
39
|
+
state.default.session.setRealm(realm);
|
|
40
|
+
state.default.session.setUsername(user);
|
|
41
|
+
state.default.session.setPassword(password);
|
|
42
|
+
state.default.session.setDeploymentType(options.type);
|
|
43
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
44
44
|
if (await getTokens()) {
|
|
45
45
|
// delete by id
|
|
46
46
|
if (options.secretId) {
|
|
47
|
-
|
|
47
|
+
console.log('Deleting secret...');
|
|
48
48
|
deleteSecretCmd(options.secretId);
|
|
49
49
|
}
|
|
50
50
|
// --all -a
|
|
51
51
|
else if (options.all) {
|
|
52
|
-
|
|
52
|
+
console.log('Deleting all secrets...');
|
|
53
53
|
deleteSecretsCmd();
|
|
54
54
|
}
|
|
55
55
|
// unrecognized combination of options or no options
|
|
56
56
|
else {
|
|
57
|
-
|
|
57
|
+
console.log('Unrecognized combination of options or no options...');
|
|
58
58
|
program.help();
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { describeSecret, listSecretVersionsCmd } from '../../ops/SecretsOps.js';
|
|
4
|
+
|
|
5
|
+
const { getTokens, Secrets } = Authenticate;
|
|
6
|
+
const { describeSecret } = Secrets;
|
|
7
7
|
|
|
8
8
|
const program = new Command('frodo esv secret describe');
|
|
9
9
|
|
|
@@ -21,14 +21,14 @@ program
|
|
|
21
21
|
.action(
|
|
22
22
|
// implement command logic inside action handler
|
|
23
23
|
async (host, realm, user, password, options) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
31
|
+
console.log(`Describing secret ${options.secretId}...`);
|
|
32
32
|
describeSecret(options.secretId);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -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
|
-
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
5
6
|
|
|
6
7
|
const program = new Command('frodo esv secret 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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const { getTokens } = Authenticate;
|
|
5
6
|
|
|
6
7
|
const program = new Command('frodo esv secret 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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
}
|