@rockcarver/frodo-cli 0.12.4-0 → 0.12.4-3
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/package.json +2 -2
- package/src/cli/journey/journey-describe.js +29 -19
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.12.4-3] - 2022-09-12
|
|
11
|
+
|
|
12
|
+
## [0.12.4-2] - 2022-09-09
|
|
13
|
+
|
|
14
|
+
## [0.12.4-1] - 2022-09-08
|
|
15
|
+
|
|
10
16
|
## [0.12.4-0] - 2022-09-02
|
|
11
17
|
|
|
12
18
|
## [0.12.3] - 2022-09-01
|
|
@@ -452,7 +458,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
452
458
|
- Fixed problem with adding connection profiles
|
|
453
459
|
- Miscellaneous bug fixes
|
|
454
460
|
|
|
455
|
-
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.12.4-
|
|
461
|
+
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.12.4-3...HEAD
|
|
462
|
+
|
|
463
|
+
[0.12.4-3]: https://github.com/rockcarver/frodo-cli/compare/v0.12.4-2...v0.12.4-3
|
|
464
|
+
|
|
465
|
+
[0.12.4-2]: https://github.com/rockcarver/frodo-cli/compare/v0.12.4-1...v0.12.4-2
|
|
466
|
+
|
|
467
|
+
[0.12.4-1]: https://github.com/rockcarver/frodo-cli/compare/v0.12.4-0...v0.12.4-1
|
|
456
468
|
|
|
457
469
|
[0.12.4-0]: https://github.com/rockcarver/frodo-cli/compare/v0.12.3...v0.12.4-0
|
|
458
470
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rockcarver/frodo-cli",
|
|
3
|
-
"version": "0.12.4-
|
|
3
|
+
"version": "0.12.4-3",
|
|
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": [
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@colors/colors": "^1.5.0",
|
|
88
|
-
"@rockcarver/frodo-lib": "0.12.2-
|
|
88
|
+
"@rockcarver/frodo-lib": "0.12.2-7",
|
|
89
89
|
"cli-progress": "^3.11.2",
|
|
90
90
|
"cli-table3": "^0.6.2",
|
|
91
91
|
"commander": "^9.4.0",
|
|
@@ -4,7 +4,7 @@ import { Authenticate, Journey, state } from '@rockcarver/frodo-lib';
|
|
|
4
4
|
import * as common from '../cmd_common.js';
|
|
5
5
|
|
|
6
6
|
const { getTokens } = Authenticate;
|
|
7
|
-
const {
|
|
7
|
+
const { getJourneys, exportTree, describeTree } = Journey;
|
|
8
8
|
|
|
9
9
|
const program = new Command('frodo journey describe');
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ program
|
|
|
14
14
|
)
|
|
15
15
|
.helpOption('-h, --help', 'Help')
|
|
16
16
|
.showHelpAfterError()
|
|
17
|
-
.addArgument(common.
|
|
17
|
+
.addArgument(common.hostArgument)
|
|
18
18
|
.addArgument(common.realmArgument)
|
|
19
19
|
.addArgument(common.userArgument)
|
|
20
20
|
.addArgument(common.passwordArgument)
|
|
@@ -49,11 +49,12 @@ program
|
|
|
49
49
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
50
50
|
// TODO: review checks for arguments
|
|
51
51
|
if (typeof host === 'undefined' || typeof options.file !== 'undefined') {
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
);
|
|
52
|
+
if (
|
|
53
|
+
typeof host === 'undefined' &&
|
|
54
|
+
typeof options.file === 'undefined'
|
|
55
|
+
) {
|
|
56
|
+
console.log('Need either [host] or -f.');
|
|
57
|
+
process.exitCode = 1;
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
60
|
console.log(`Describing local journey file ${options.file}...`);
|
|
@@ -61,26 +62,35 @@ program
|
|
|
61
62
|
const data = fs.readFileSync(options.file, 'utf8');
|
|
62
63
|
const journeyData = JSON.parse(data);
|
|
63
64
|
describeTree(journeyData);
|
|
64
|
-
} catch (
|
|
65
|
-
console.log(
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.log(error.message);
|
|
67
|
+
process.exitCode = 1;
|
|
66
68
|
}
|
|
67
69
|
} else if (await getTokens()) {
|
|
68
70
|
console.log(
|
|
69
71
|
`Describing journey(s) in realm "${state.default.session.getRealm()}"...`
|
|
70
72
|
);
|
|
71
73
|
if (typeof options.journeyId === 'undefined') {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
for (const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
let journeys = [];
|
|
75
|
+
journeys = await getJourneys();
|
|
76
|
+
for (const journey of journeys) {
|
|
77
|
+
try {
|
|
78
|
+
// eslint-disable-next-line no-await-in-loop
|
|
79
|
+
const treeData = await exportTree(journey._id);
|
|
80
|
+
describeTree(treeData);
|
|
81
|
+
} catch (error) {
|
|
82
|
+
console.log(error.message);
|
|
83
|
+
process.exitCode = 1;
|
|
84
|
+
}
|
|
79
85
|
}
|
|
80
|
-
// stopProgressBar('Done');
|
|
81
86
|
} else {
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
try {
|
|
88
|
+
const treeData = await exportTree(options.journeyId);
|
|
89
|
+
describeTree(treeData);
|
|
90
|
+
} catch (error) {
|
|
91
|
+
console.log(error.message);
|
|
92
|
+
process.exitCode = 1;
|
|
93
|
+
}
|
|
84
94
|
}
|
|
85
95
|
}
|
|
86
96
|
}
|