@rockcarver/frodo-cli 0.13.1 → 0.13.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 CHANGED
@@ -7,8 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.13.3] - 2022-09-30
11
+
12
+ ### Added
13
+
14
+ - rockcarver/frodo-lib#104: Enhanced `frodo journey describe` command to include more details
15
+ - \#60: Support the improved frodo journey describe command with frodo-cli
16
+
17
+ ### Changed
18
+
19
+ - Updated frodo-lib to 0.12.6
20
+
21
+ ## [0.13.2] - 2022-09-29
22
+
23
+ ### Changed
24
+
25
+ - Updated frodo-lib to 0.12.5
26
+
27
+ ### Fixed
28
+
29
+ - rockcarver/frodo-lib#98: Frodo now properly runs `frodo idm export -A -D ./idm <host>` command
30
+ - rockcarver/frodo-lib#100: Frodo now properly handles nested realms when specified as `/parent/child`
31
+ - rockcarver/frodo-lib#101: Frodo now properly sets the identity resource when the realm was specified with a leading slash
32
+ - rockcarver/frodo-lib#102: Frodo now properly replaces existing themes on import when the realm was specified with a leading slash
33
+
10
34
  ## [0.13.1] - 2022-09-23
11
35
 
36
+ ### Changed
37
+
38
+ - Updated frodo-lib to 0.12.4
39
+ - Updated binary installation instructions in README.md
40
+
41
+ ### Fixed
42
+
43
+ - \#49: Frodo now properly reports missing mandatory parameters when running `frodo esv variable describe <host>` and `frodo esv secret describe <host>`
44
+
12
45
  ## [0.13.0] - 2022-09-17
13
46
 
14
47
  ### Added
@@ -537,7 +570,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
537
570
  - Fixed problem with adding connection profiles
538
571
  - Miscellaneous bug fixes
539
572
 
540
- [Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.13.1...HEAD
573
+ [Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.13.3...HEAD
574
+
575
+ [0.13.3]: https://github.com/rockcarver/frodo-cli/compare/v0.13.2...v0.13.3
576
+
577
+ [0.13.2]: https://github.com/rockcarver/frodo-cli/compare/v0.13.1...v0.13.2
541
578
 
542
579
  [0.13.1]: https://github.com/rockcarver/frodo-cli/compare/v0.13.0...v0.13.1
543
580
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rockcarver/frodo-cli",
3
- "version": "0.13.1",
3
+ "version": "0.13.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.4",
88
+ "@rockcarver/frodo-lib": "0.12.6",
89
89
  "cli-progress": "^3.11.2",
90
90
  "cli-table3": "^0.6.2",
91
91
  "commander": "^9.4.0",
@@ -4,7 +4,12 @@ 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 { getJourneys, exportJourney, describeJourney } = Journey;
7
+ const {
8
+ getJourneys,
9
+ exportJourney,
10
+ createFileParamTreeExportResolver,
11
+ describeJourney,
12
+ } = Journey;
8
13
 
9
14
  const program = new Command('frodo journey describe');
10
15
 
@@ -59,9 +64,47 @@ program
59
64
  }
60
65
  console.log(`Describing local journey file ${options.file}...`);
61
66
  try {
62
- const data = fs.readFileSync(options.file, 'utf8');
63
- const journeyData = JSON.parse(data);
64
- describeJourney(journeyData);
67
+ const fileData = JSON.parse(fs.readFileSync(options.file, 'utf8'));
68
+ let journeyData = null;
69
+ // single or multi tree export?
70
+ // multi - by id
71
+ if (
72
+ typeof options.journeyId !== 'undefined' &&
73
+ fileData.trees &&
74
+ fileData.trees[options.journeyId]
75
+ ) {
76
+ journeyData = fileData.trees[options.journeyId];
77
+ }
78
+ // multi - first
79
+ else if (typeof options.journeyId === 'undefined' && fileData.trees) {
80
+ [journeyData] = Object.values(fileData.trees);
81
+ }
82
+ // single - by id
83
+ else if (
84
+ typeof options.journeyId !== 'undefined' &&
85
+ options.journeyId === fileData.tree?._id
86
+ ) {
87
+ journeyData = fileData;
88
+ }
89
+ // single
90
+ else if (
91
+ typeof options.journeyId === 'undefined' &&
92
+ fileData.tree?._id
93
+ ) {
94
+ journeyData = fileData;
95
+ }
96
+ // no journey/tree found
97
+ else {
98
+ throw new Error(
99
+ typeof options.journeyId === 'undefined'
100
+ ? `No journey found in ${options.file}`
101
+ : `Journey '${options.journeyId}' not found in ${options.file}`
102
+ );
103
+ }
104
+ describeJourney(
105
+ journeyData,
106
+ createFileParamTreeExportResolver(options.file)
107
+ );
65
108
  } catch (error) {
66
109
  console.log(error.message);
67
110
  process.exitCode = 1;
@@ -75,7 +118,7 @@ program
75
118
  journeys = await getJourneys();
76
119
  for (const journey of journeys) {
77
120
  try {
78
- // eslint-disable-next-line no-await-in-loop
121
+ // eslint-disable-next-line no-await-in-loop, dot-notation
79
122
  const treeData = await exportJourney(journey['_id']);
80
123
  describeJourney(treeData);
81
124
  } catch (error) {