@rockcarver/frodo-cli 0.13.3 → 0.14.1

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 (124) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/package.json +14 -7
  3. package/src/app.js +0 -63
  4. package/src/cli/_template/cmd-delete.js +0 -56
  5. package/src/cli/_template/cmd-describe.js +0 -36
  6. package/src/cli/_template/cmd-export.js +0 -54
  7. package/src/cli/_template/cmd-import.js +0 -54
  8. package/src/cli/_template/cmd-list.js +0 -38
  9. package/src/cli/_template/cmd-sub1-delete.js +0 -56
  10. package/src/cli/_template/cmd-sub1-describe.js +0 -36
  11. package/src/cli/_template/cmd-sub1-export.js +0 -54
  12. package/src/cli/_template/cmd-sub1-import.js +0 -54
  13. package/src/cli/_template/cmd-sub1-list.js +0 -38
  14. package/src/cli/_template/cmd-sub1.js +0 -20
  15. package/src/cli/_template/cmd-sub2-delete.js +0 -56
  16. package/src/cli/_template/cmd-sub2-describe.js +0 -36
  17. package/src/cli/_template/cmd-sub2-export.js +0 -54
  18. package/src/cli/_template/cmd-sub2-import.js +0 -54
  19. package/src/cli/_template/cmd-sub2-list.js +0 -38
  20. package/src/cli/_template/cmd-sub2.js +0 -20
  21. package/src/cli/_template/cmd.js +0 -29
  22. package/src/cli/admin/admin-add-autoid-static-user-mapping.js +0 -40
  23. package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +0 -121
  24. package/src/cli/admin/admin-get-access-token.js +0 -59
  25. package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.js +0 -45
  26. package/src/cli/admin/admin-hide-generic-extension-attributes.js +0 -47
  27. package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +0 -45
  28. package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +0 -46
  29. package/src/cli/admin/admin-list-static-user-mappings.js +0 -53
  30. package/src/cli/admin/admin-remove-static-user-mapping.js +0 -38
  31. package/src/cli/admin/admin-repair-org-model.js +0 -47
  32. package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +0 -47
  33. package/src/cli/admin/admin-show-generic-extension-attributes.js +0 -55
  34. package/src/cli/admin/admin.js +0 -94
  35. package/src/cli/app/app-delete.js +0 -56
  36. package/src/cli/app/app-describe.js +0 -36
  37. package/src/cli/app/app-export.js +0 -78
  38. package/src/cli/app/app-import.js +0 -56
  39. package/src/cli/app/app-list.js +0 -40
  40. package/src/cli/app/app.js +0 -29
  41. package/src/cli/cmd_common.js +0 -181
  42. package/src/cli/conn/conn-add.js +0 -65
  43. package/src/cli/conn/conn-delete.js +0 -22
  44. package/src/cli/conn/conn-describe.js +0 -23
  45. package/src/cli/conn/conn-list.js +0 -27
  46. package/src/cli/conn/conn.js +0 -28
  47. package/src/cli/email/email-template-export.js +0 -90
  48. package/src/cli/email/email-template-import.js +0 -90
  49. package/src/cli/email/email-template-list.js +0 -40
  50. package/src/cli/email/email-template.js +0 -16
  51. package/src/cli/email/email.js +0 -17
  52. package/src/cli/esv/esv-apply.js +0 -120
  53. package/src/cli/esv/esv-secret-create.js +0 -64
  54. package/src/cli/esv/esv-secret-delete.js +0 -65
  55. package/src/cli/esv/esv-secret-describe.js +0 -43
  56. package/src/cli/esv/esv-secret-export.js +0 -54
  57. package/src/cli/esv/esv-secret-import.js +0 -54
  58. package/src/cli/esv/esv-secret-list.js +0 -40
  59. package/src/cli/esv/esv-secret-set.js +0 -45
  60. package/src/cli/esv/esv-secret-version-activate.js +0 -53
  61. package/src/cli/esv/esv-secret-version-create.js +0 -45
  62. package/src/cli/esv/esv-secret-version-deactivate.js +0 -53
  63. package/src/cli/esv/esv-secret-version-delete.js +0 -66
  64. package/src/cli/esv/esv-secret-version-list.js +0 -41
  65. package/src/cli/esv/esv-secret-version.js +0 -20
  66. package/src/cli/esv/esv-secret.js +0 -26
  67. package/src/cli/esv/esv-variable-create.js +0 -46
  68. package/src/cli/esv/esv-variable-delete.js +0 -71
  69. package/src/cli/esv/esv-variable-describe.js +0 -43
  70. package/src/cli/esv/esv-variable-export.js +0 -54
  71. package/src/cli/esv/esv-variable-import.js +0 -54
  72. package/src/cli/esv/esv-variable-list.js +0 -40
  73. package/src/cli/esv/esv-variable-set.js +0 -62
  74. package/src/cli/esv/esv-variable.js +0 -24
  75. package/src/cli/esv/esv.js +0 -21
  76. package/src/cli/idm/idm-count.js +0 -42
  77. package/src/cli/idm/idm-export.js +0 -116
  78. package/src/cli/idm/idm-list.js +0 -40
  79. package/src/cli/idm/idm.js +0 -28
  80. package/src/cli/idp/idp-export.js +0 -90
  81. package/src/cli/idp/idp-import.js +0 -101
  82. package/src/cli/idp/idp-list.js +0 -42
  83. package/src/cli/idp/idp.js +0 -21
  84. package/src/cli/info/info.js +0 -55
  85. package/src/cli/journey/journey-delete.js +0 -78
  86. package/src/cli/journey/journey-describe.js +0 -143
  87. package/src/cli/journey/journey-export.js +0 -110
  88. package/src/cli/journey/journey-import.js +0 -127
  89. package/src/cli/journey/journey-list.js +0 -43
  90. package/src/cli/journey/journey-prune.js +0 -52
  91. package/src/cli/journey/journey.js +0 -37
  92. package/src/cli/logging/logs-list.js +0 -77
  93. package/src/cli/logging/logs-tail.js +0 -85
  94. package/src/cli/logging/logs.js +0 -21
  95. package/src/cli/realm/realm-add-custom-domain.js +0 -47
  96. package/src/cli/realm/realm-describe.js +0 -40
  97. package/src/cli/realm/realm-list.js +0 -40
  98. package/src/cli/realm/realm-remove-custom-domain.js +0 -50
  99. package/src/cli/realm/realm.js +0 -33
  100. package/src/cli/saml/saml-cot-export.js +0 -90
  101. package/src/cli/saml/saml-cot-import.js +0 -101
  102. package/src/cli/saml/saml-cot-list.js +0 -42
  103. package/src/cli/saml/saml-cot.js +0 -16
  104. package/src/cli/saml/saml-describe.js +0 -42
  105. package/src/cli/saml/saml-export.js +0 -91
  106. package/src/cli/saml/saml-import.js +0 -102
  107. package/src/cli/saml/saml-list.js +0 -42
  108. package/src/cli/saml/saml-metadata-export.js +0 -76
  109. package/src/cli/saml/saml-metadata.js +0 -12
  110. package/src/cli/saml/saml.js +0 -29
  111. package/src/cli/script/script-delete.js +0 -56
  112. package/src/cli/script/script-describe.js +0 -36
  113. package/src/cli/script/script-export.js +0 -95
  114. package/src/cli/script/script-import.js +0 -64
  115. package/src/cli/script/script-list.js +0 -42
  116. package/src/cli/script/script.js +0 -25
  117. package/src/cli/theme/theme-delete.js +0 -83
  118. package/src/cli/theme/theme-export.js +0 -107
  119. package/src/cli/theme/theme-import.js +0 -118
  120. package/src/cli/theme/theme-list.js +0 -42
  121. package/src/cli/theme/theme.js +0 -23
  122. package/src/storage/StaticStorage.js +0 -15
  123. package/src/utils/Console.js +0 -482
  124. package/tsconfig.json +0 -106
package/CHANGELOG.md CHANGED
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.14.1] - 2022-10-03
11
+
12
+ ### Fixed
13
+
14
+ - \#66: Removed unnecessary files from npm package
15
+
16
+ ## [0.14.0] - 2022-10-03
17
+
18
+ ### Changed
19
+
20
+ - Updated frodo-lib to 0.12.7
21
+ - Changes to `frodo journey describe` command:
22
+ - Added journey status (enabled/disabled)
23
+ - Added journey/node classification:
24
+ Classifications are shown for the whole journey and for each node type and node, making it easy to determine why a journey is classified a certain way.
25
+ - `standard`: can run on any instance of a ForgeRock platform
26
+ - `cloud`: utilize nodes, which are exclusively available in the ForgeRock Identity Cloud
27
+ - `premium`: utilizes nodes, which come at a premium
28
+ - `custom`: utilizes nodes not included in the ForgeRock platform release
29
+ - Added journey categories/tags
30
+ - Added consideration of version from export file meta data when using `-f [file]` option to describe a juorney export
31
+ - Added `-o`/`--override-version` parameter. Notation: `major.minor.patch` e.g. `7.2.0`. Override detected version with any version. This is helpful in order to check if journeys in one environment would be compatible running in another environment (e.g. in preparation of migrating from on-prem to ForgeRock Identity Cloud.
32
+ - \#59: Converted frodo-cli to TypeScript
33
+
10
34
  ## [0.13.3] - 2022-09-30
11
35
 
12
36
  ### Added
@@ -570,7 +594,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
570
594
  - Fixed problem with adding connection profiles
571
595
  - Miscellaneous bug fixes
572
596
 
573
- [Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.13.3...HEAD
597
+ [Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.14.1...HEAD
598
+
599
+ [0.14.1]: https://github.com/rockcarver/frodo-cli/compare/v0.14.0...v0.14.1
600
+
601
+ [0.14.0]: https://github.com/rockcarver/frodo-cli/compare/v0.13.3...v0.14.0
574
602
 
575
603
  [0.13.3]: https://github.com/rockcarver/frodo-cli/compare/v0.13.2...v0.13.3
576
604
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rockcarver/frodo-cli",
3
- "version": "0.13.3",
3
+ "version": "0.14.1",
4
4
  "type": "module",
5
5
  "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
6
6
  "keywords": [
@@ -27,14 +27,17 @@
27
27
  "bugs": {
28
28
  "url": "https://github.com/rockcarver/frodo-cli/issues"
29
29
  },
30
- "main": "src/app.js",
30
+ "main": "esm/app.js",
31
31
  "scripts": {
32
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
32
+ "test": "npx tsc && node --experimental-vm-modules node_modules/jest/bin/jest.js",
33
33
  "test:list": "node --experimental-vm-modules node_modules/jest/bin/jest.js --listTests",
34
34
  "test:e2e": "node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand e2e",
35
35
  "test:e2e:list": "node --experimental-vm-modules node_modules/jest/bin/jest.js --listTests e2e",
36
36
  "lint": "npx eslint --ext .js --ignore-path .gitignore .",
37
- "build": "npx gulp"
37
+ "build": "npx gulp",
38
+ "build:local": "npx gulp build-local",
39
+ "build:binary": "npx gulp build-binary",
40
+ "watch": "npx gulp watch"
38
41
  },
39
42
  "contributors": [
40
43
  {
@@ -60,7 +63,7 @@
60
63
  ],
61
64
  "license": "MIT",
62
65
  "bin": {
63
- "frodo": "./src/app.js"
66
+ "frodo": "./esm/app.js"
64
67
  },
65
68
  "babel": {
66
69
  "plugins": [
@@ -84,10 +87,10 @@
84
87
  ]
85
88
  },
86
89
  "dependencies": {
87
- "@colors/colors": "^1.5.0",
88
- "@rockcarver/frodo-lib": "0.12.6",
90
+ "@rockcarver/frodo-lib": "0.12.7",
89
91
  "cli-progress": "^3.11.2",
90
92
  "cli-table3": "^0.6.2",
93
+ "colors": "^1.4.0",
91
94
  "commander": "^9.4.0",
92
95
  "nanospinner": "^1.1.0",
93
96
  "uuid": "^8.3.2",
@@ -97,6 +100,9 @@
97
100
  "@babel/eslint-parser": "^7.18.9",
98
101
  "@babel/plugin-syntax-import-assertions": "^7.16.7",
99
102
  "@babel/plugin-transform-modules-commonjs": "^7.16.8",
103
+ "@babel/preset-env": "^7.19.3",
104
+ "@babel/preset-typescript": "^7.18.6",
105
+ "@types/colors": "^1.2.1",
100
106
  "babel-plugin-transform-import-meta": "^2.1.1",
101
107
  "del": "^6.0.0",
102
108
  "eslint": "^8.21.0",
@@ -111,6 +117,7 @@
111
117
  "gulp": "^4.0.2",
112
118
  "gulp-babel": "^8.0.0",
113
119
  "gulp-install": "^1.1.0",
120
+ "gulp-rename": "^2.0.0",
114
121
  "gulp-sourcemaps": "^3.0.0",
115
122
  "jest": "^28.1.3",
116
123
  "map-stream": "^0.0.7",
package/src/app.js DELETED
@@ -1,63 +0,0 @@
1
- #!/usr/bin/env -S node --no-warnings --enable-source-maps --experimental-specifier-resolution=node
2
-
3
- import { getVersion, ConnectionProfile } from '@rockcarver/frodo-lib';
4
- import fs from 'fs';
5
- import { Command } from 'commander';
6
- import path from 'path';
7
- import { fileURLToPath } from 'url';
8
-
9
- // commands
10
- import admin from './cli/admin/admin.js';
11
- import app from './cli/app/app.js';
12
- import conn from './cli/conn/conn.js';
13
- import email from './cli/email/email.js';
14
- import esv from './cli/esv/esv.js';
15
- import idm from './cli/idm/idm.js';
16
- import idp from './cli/idp/idp.js';
17
- import info from './cli/info/info.js';
18
- import journey from './cli/journey/journey.js';
19
- import logging from './cli/logging/logs.js';
20
- import realm from './cli/realm/realm.js';
21
- import saml from './cli/saml/saml.js';
22
- import script from './cli/script/script.js';
23
- import theme from './cli/theme/theme.js';
24
-
25
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
26
-
27
- const pkg = JSON.parse(
28
- fs.readFileSync(path.resolve(__dirname, '../package.json'), 'utf8')
29
- );
30
-
31
- const { initConnectionProfiles } = ConnectionProfile;
32
-
33
- const program = new Command('frodo').version(
34
- `cli: v${pkg.version}\nlib: ${getVersion()}\nnode: ${process.version}`,
35
- '-v, --version'
36
- );
37
-
38
- (async () => {
39
- try {
40
- initConnectionProfiles();
41
-
42
- program.addCommand(admin());
43
- program.addCommand(app());
44
- program.addCommand(conn());
45
- program.addCommand(email());
46
- program.addCommand(esv());
47
- program.addCommand(idm());
48
- program.addCommand(idp());
49
- program.addCommand(info());
50
- program.addCommand(journey());
51
- program.addCommand(logging());
52
- program.addCommand(realm());
53
- program.addCommand(saml());
54
- program.addCommand(script());
55
- program.addCommand(theme());
56
-
57
- program.showHelpAfterError();
58
- program.enablePositionalOptions();
59
- program.parse();
60
- } catch (e) {
61
- console.log(`ERROR: exception running frodo - ${e}`, 'error');
62
- }
63
- })();
@@ -1,56 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const program = new Command('frodo cmd delete');
8
-
9
- program
10
- .description('Cmd delete.')
11
- .helpOption('-h, --help', 'Help')
12
- .showHelpAfterError()
13
- .addArgument(common.hostArgumentM)
14
- .addArgument(common.realmArgument)
15
- .addArgument(common.userArgument)
16
- .addArgument(common.passwordArgument)
17
- .addOption(common.deploymentOption)
18
- .addOption(common.insecureOption)
19
- .addOption(
20
- new Option(
21
- '-i, --cmd-id <cmd-id>',
22
- 'Cmd id. If specified, -a and -A are ignored.'
23
- )
24
- )
25
- .addOption(
26
- new Option('-a, --all', 'Delete all cmds in a realm. Ignored with -i.')
27
- )
28
- .addOption(
29
- new Option(
30
- '--no-deep',
31
- 'No deep delete. This leaves orphaned configuration artifacts behind.'
32
- )
33
- )
34
- .addOption(
35
- new Option(
36
- '--verbose',
37
- 'Verbose output during command execution. If specified, may or may not produce additional output.'
38
- ).default(false, 'off')
39
- )
40
- .action(
41
- // implement command logic inside action handler
42
- async (host, realm, user, password, options) => {
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);
49
- if (await getTokens()) {
50
- // code goes here
51
- }
52
- }
53
- // end command logic inside action handler
54
- );
55
-
56
- program.parse();
@@ -1,36 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const program = new Command('frodo cmd describe');
8
-
9
- program
10
- .description('Cmd describe.')
11
- .helpOption('-h, --help', 'Help')
12
- .showHelpAfterError()
13
- .addArgument(common.hostArgumentM)
14
- .addArgument(common.realmArgument)
15
- .addArgument(common.userArgument)
16
- .addArgument(common.passwordArgument)
17
- .addOption(common.deploymentOption)
18
- .addOption(common.insecureOption)
19
- .addOption(new Option('-i, --cmd-id <cmd-id>', 'Cmd id.'))
20
- .action(
21
- // implement command logic inside action handler
22
- async (host, realm, user, password, options) => {
23
- state.default.session.setTenant(host);
24
- state.default.session.setRealm(realm);
25
- state.default.session.setUsername(user);
26
- state.default.session.setPassword(password);
27
- state.default.session.setDeploymentType(options.type);
28
- state.default.session.setAllowInsecureConnection(options.insecure);
29
- if (await getTokens()) {
30
- // code goes here
31
- }
32
- }
33
- // end command logic inside action handler
34
- );
35
-
36
- program.parse();
@@ -1,54 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const program = new Command('frodo cmd export');
8
-
9
- program
10
- .description('Cmd export.')
11
- .helpOption('-h, --help', 'Help')
12
- .showHelpAfterError()
13
- .addArgument(common.hostArgumentM)
14
- .addArgument(common.realmArgument)
15
- .addArgument(common.userArgument)
16
- .addArgument(common.passwordArgument)
17
- .addOption(common.deploymentOption)
18
- .addOption(common.insecureOption)
19
- .addOption(
20
- new Option(
21
- '-i, --cmd-id <cmd-id>',
22
- 'Cmd id. If specified, -a and -A are ignored.'
23
- )
24
- )
25
- .addOption(new Option('-f, --file <file>', 'Name of the export file.'))
26
- .addOption(
27
- new Option(
28
- '-a, --all',
29
- 'Export all cmds to a single file. Ignored with -i.'
30
- )
31
- )
32
- .addOption(
33
- new Option(
34
- '-A, --all-separate',
35
- 'Export all cmds to separate files (*.cmd.json) in the current directory. Ignored with -i or -a.'
36
- )
37
- )
38
- .action(
39
- // implement command logic inside action handler
40
- async (host, realm, user, password, options) => {
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);
47
- if (await getTokens()) {
48
- // code goes here
49
- }
50
- }
51
- // end command logic inside action handler
52
- );
53
-
54
- program.parse();
@@ -1,54 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const program = new Command('frodo cmd import');
8
-
9
- program
10
- .description('Cmd import.')
11
- .helpOption('-h, --help', 'Help')
12
- .showHelpAfterError()
13
- .addArgument(common.hostArgumentM)
14
- .addArgument(common.realmArgument)
15
- .addArgument(common.userArgument)
16
- .addArgument(common.passwordArgument)
17
- .addOption(common.deploymentOption)
18
- .addOption(common.insecureOption)
19
- .addOption(
20
- new Option(
21
- '-i, --cmd-id <cmd-id>',
22
- 'Cmd id. If specified, only one cmd is imported and the options -a and -A are ignored.'
23
- )
24
- )
25
- .addOption(new Option('-f, --file <file>', 'Name of the file to import.'))
26
- .addOption(
27
- new Option(
28
- '-a, --all',
29
- 'Import all cmds from single file. Ignored with -i.'
30
- )
31
- )
32
- .addOption(
33
- new Option(
34
- '-A, --all-separate',
35
- 'Import all cmds from separate files (*.cmd.json) in the current directory. Ignored with -i or -a.'
36
- )
37
- )
38
- .action(
39
- // implement command logic inside action handler
40
- async (host, realm, user, password, options) => {
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);
47
- if (await getTokens()) {
48
- // code goes here
49
- }
50
- }
51
- // end command logic inside action handler
52
- );
53
-
54
- program.parse();
@@ -1,38 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const program = new Command('frodo cmd list');
8
-
9
- program
10
- .description('Cmd list.')
11
- .helpOption('-h, --help', 'Help')
12
- .showHelpAfterError()
13
- .addArgument(common.hostArgumentM)
14
- .addArgument(common.realmArgument)
15
- .addArgument(common.userArgument)
16
- .addArgument(common.passwordArgument)
17
- .addOption(common.deploymentOption)
18
- .addOption(common.insecureOption)
19
- .addOption(
20
- new Option('-l, --long', 'Long with all fields.').default(false, 'false')
21
- )
22
- .action(
23
- // implement command logic inside action handler
24
- async (host, realm, user, password, options) => {
25
- state.default.session.setTenant(host);
26
- state.default.session.setRealm(realm);
27
- state.default.session.setUsername(user);
28
- state.default.session.setPassword(password);
29
- state.default.session.setDeploymentType(options.type);
30
- state.default.session.setAllowInsecureConnection(options.insecure);
31
- if (await getTokens()) {
32
- // code goes here
33
- }
34
- }
35
- // end command logic inside action handler
36
- );
37
-
38
- program.parse();
@@ -1,56 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const program = new Command('frodo cmd sub1 delete');
8
-
9
- program
10
- .description('Sub1 delete.')
11
- .helpOption('-h, --help', 'Help')
12
- .showHelpAfterError()
13
- .addArgument(common.hostArgumentM)
14
- .addArgument(common.realmArgument)
15
- .addArgument(common.userArgument)
16
- .addArgument(common.passwordArgument)
17
- .addOption(common.deploymentOption)
18
- .addOption(common.insecureOption)
19
- .addOption(
20
- new Option(
21
- '-i, --sub1-id <sub1-id>',
22
- 'Sub1 id. If specified, -a and -A are ignored.'
23
- )
24
- )
25
- .addOption(
26
- new Option('-a, --all', 'Delete all sub1s in a realm. Ignored with -i.')
27
- )
28
- .addOption(
29
- new Option(
30
- '--no-deep',
31
- 'No deep delete. This leaves orphaned configuration artifacts behind.'
32
- )
33
- )
34
- .addOption(
35
- new Option(
36
- '--verbose',
37
- 'Verbose output during command execution. If specified, may or may not produce additional output.'
38
- ).default(false, 'off')
39
- )
40
- .action(
41
- // implement command logic inside action handler
42
- async (host, realm, user, password, options) => {
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);
49
- if (await getTokens()) {
50
- // code goes here
51
- }
52
- }
53
- // end command logic inside action handler
54
- );
55
-
56
- program.parse();
@@ -1,36 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const program = new Command('frodo cmd sub1 describe');
8
-
9
- program
10
- .description('Sub1 describe.')
11
- .helpOption('-h, --help', 'Help')
12
- .showHelpAfterError()
13
- .addArgument(common.hostArgumentM)
14
- .addArgument(common.realmArgument)
15
- .addArgument(common.userArgument)
16
- .addArgument(common.passwordArgument)
17
- .addOption(common.deploymentOption)
18
- .addOption(common.insecureOption)
19
- .addOption(new Option('-i, --sub1-id <sub1-id>', 'Sub1 id.'))
20
- .action(
21
- // implement command logic inside action handler
22
- async (host, realm, user, password, options) => {
23
- state.default.session.setTenant(host);
24
- state.default.session.setRealm(realm);
25
- state.default.session.setUsername(user);
26
- state.default.session.setPassword(password);
27
- state.default.session.setDeploymentType(options.type);
28
- state.default.session.setAllowInsecureConnection(options.insecure);
29
- if (await getTokens()) {
30
- // code goes here
31
- }
32
- }
33
- // end command logic inside action handler
34
- );
35
-
36
- program.parse();
@@ -1,54 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const program = new Command('frodo cmd sub1 export');
8
-
9
- program
10
- .description('Sub1 export.')
11
- .helpOption('-h, --help', 'Help')
12
- .showHelpAfterError()
13
- .addArgument(common.hostArgumentM)
14
- .addArgument(common.realmArgument)
15
- .addArgument(common.userArgument)
16
- .addArgument(common.passwordArgument)
17
- .addOption(common.deploymentOption)
18
- .addOption(common.insecureOption)
19
- .addOption(
20
- new Option(
21
- '-i, --sub1-id <sub1-id>',
22
- 'Sub1 id. If specified, -a and -A are ignored.'
23
- )
24
- )
25
- .addOption(new Option('-f, --file <file>', 'Name of the export file.'))
26
- .addOption(
27
- new Option(
28
- '-a, --all',
29
- 'Export all sub1s to a single file. Ignored with -i.'
30
- )
31
- )
32
- .addOption(
33
- new Option(
34
- '-A, --all-separate',
35
- 'Export all sub1s to separate files (*.sub1.json) in the current directory. Ignored with -i or -a.'
36
- )
37
- )
38
- .action(
39
- // implement command logic inside action handler
40
- async (host, realm, user, password, options) => {
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);
47
- if (await getTokens()) {
48
- // code goes here
49
- }
50
- }
51
- // end command logic inside action handler
52
- );
53
-
54
- program.parse();
@@ -1,54 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const program = new Command('frodo cmd sub1 import');
8
-
9
- program
10
- .description('Sub1 import.')
11
- .helpOption('-h, --help', 'Help')
12
- .showHelpAfterError()
13
- .addArgument(common.hostArgumentM)
14
- .addArgument(common.realmArgument)
15
- .addArgument(common.userArgument)
16
- .addArgument(common.passwordArgument)
17
- .addOption(common.deploymentOption)
18
- .addOption(common.insecureOption)
19
- .addOption(
20
- new Option(
21
- '-i, --sub1-id <sub1-id>',
22
- 'Sub1 id. If specified, only one sub1 is imported and the options -a and -A are ignored.'
23
- )
24
- )
25
- .addOption(new Option('-f, --file <file>', 'Name of the file to import.'))
26
- .addOption(
27
- new Option(
28
- '-a, --all',
29
- 'Import all sub1s from single file. Ignored with -i.'
30
- )
31
- )
32
- .addOption(
33
- new Option(
34
- '-A, --all-separate',
35
- 'Import all sub1s from separate files (*.sub1.json) in the current directory. Ignored with -i or -a.'
36
- )
37
- )
38
- .action(
39
- // implement command logic inside action handler
40
- async (host, realm, user, password, options) => {
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);
47
- if (await getTokens()) {
48
- // code goes here
49
- }
50
- }
51
- // end command logic inside action handler
52
- );
53
-
54
- program.parse();
@@ -1,38 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const program = new Command('frodo cmd sub1 list');
8
-
9
- program
10
- .description('Sub1 list.')
11
- .helpOption('-h, --help', 'Help')
12
- .showHelpAfterError()
13
- .addArgument(common.hostArgumentM)
14
- .addArgument(common.realmArgument)
15
- .addArgument(common.userArgument)
16
- .addArgument(common.passwordArgument)
17
- .addOption(common.deploymentOption)
18
- .addOption(common.insecureOption)
19
- .addOption(
20
- new Option('-l, --long', 'Long with all fields.').default(false, 'false')
21
- )
22
- .action(
23
- // implement command logic inside action handler
24
- async (host, realm, user, password, options) => {
25
- state.default.session.setTenant(host);
26
- state.default.session.setRealm(realm);
27
- state.default.session.setUsername(user);
28
- state.default.session.setPassword(password);
29
- state.default.session.setDeploymentType(options.type);
30
- state.default.session.setAllowInsecureConnection(options.insecure);
31
- if (await getTokens()) {
32
- // code goes here
33
- }
34
- }
35
- // end command logic inside action handler
36
- );
37
-
38
- program.parse();
@@ -1,20 +0,0 @@
1
- import { Command } from 'commander';
2
-
3
- const program = new Command('frodo cmd sub1');
4
-
5
- program
6
- .description('Sub1 command.')
7
- .helpOption('-h, --help', 'Help')
8
- .showHelpAfterError();
9
-
10
- program.command('list', 'Sub1 list.').showHelpAfterError();
11
-
12
- program.command('describe', 'Sub1 describe.').showHelpAfterError();
13
-
14
- program.command('export', 'Sub1 export.').showHelpAfterError();
15
-
16
- program.command('import', 'Sub1 import.').showHelpAfterError();
17
-
18
- program.command('delete', 'Sub1 delete.').showHelpAfterError();
19
-
20
- program.parse();