Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -702,14 +702,14 @@ info: Configuration: {"key":"value","nested":{"field":"data"}}
```

##### Find a versioned node
To find a specific node in a package by version, use the `--version` option:
To find a specific node in a package by version, use the `--packageVersion` option:
```
content-cli config nodes get --packageKey <packageKey> --nodeKey <nodeKey> --version <version>
content-cli config nodes get --packageKey <packageKey> --nodeKey <nodeKey> --packageVersion <packageVersion>
```

For example, to find a node in version 1.2.3:
```
content-cli config nodes get --packageKey my-package --nodeKey my-node --version 1.2.3
content-cli config nodes get --packageKey my-package --nodeKey my-node --packageVersion 1.2.3
```

The command will display the node information in the console with the same format as staging nodes:
Expand All @@ -728,9 +728,9 @@ info: Flavor: STUDIO
```

##### Find a versioned node with configuration
You can combine the `--version` and `--withConfiguration` options to retrieve a versioned node with its configuration:
You can combine the `--packageVersion` and `--withConfiguration` options to retrieve a versioned node with its configuration:
```
content-cli config nodes get --packageKey <packageKey> --nodeKey <nodeKey> --version <version> --withConfiguration
content-cli config nodes get --packageKey <packageKey> --nodeKey <nodeKey> --packageVersion <packageVersion> --withConfiguration
```

When configuration is included, it will be displayed as a JSON string in the output:
Expand Down Expand Up @@ -758,12 +758,12 @@ content-cli config nodes get --packageKey <packageKey> --nodeKey <nodeKey> --wit

You can also export versioned nodes as JSON:
```
content-cli config nodes get --packageKey <packageKey> --nodeKey <nodeKey> --version <version> --json
content-cli config nodes get --packageKey <packageKey> --nodeKey <nodeKey> --packageVersion <packageVersion> --json
```

Or combine all options for a versioned node with configuration:
```
content-cli config nodes get --packageKey <packageKey> --nodeKey <nodeKey> --version <version> --withConfiguration --json
content-cli config nodes get --packageKey <packageKey> --nodeKey <nodeKey> --packageVersion <packageVersion> --withConfiguration --json
```
#### Diffing node configurations

Expand Down
4 changes: 2 additions & 2 deletions src/commands/configuration-management/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Module extends IModule {
.description("Find a specific node in a package")
.requiredOption("--packageKey <packageKey>", "Identifier of the package")
.requiredOption("--nodeKey <nodeKey>", "Identifier of the node")
.option("--version <version>", "Version of the package")
.option("--packageVersion <packageVersion>", "Version of the package")
.option("--withConfiguration", "Include node configuration in the response", false)
.option("--json", "Return the response as a JSON file")
.action(this.findNode);
Expand Down Expand Up @@ -139,7 +139,7 @@ class Module extends IModule {
}

private async findNode(context: Context, command: Command, options: OptionValues): Promise<void> {
await new NodeService(context).findNode(options.packageKey, options.nodeKey, options.withConfiguration, options.version ?? null, options.json);
await new NodeService(context).findNode(options.packageKey, options.nodeKey, options.withConfiguration, options.packageVersion ?? null, options.json);
}

private async diffNode(context: Context, command: Command, options: OptionValues): Promise<void> {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/configuration-management/node.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export class NodeService {
this.nodeApi = new NodeApi(context);
}

public async findNode(packageKey: string, nodeKey: string, withConfiguration: boolean, version: string | null, jsonResponse: boolean): Promise<void> {
const node = version
? await this.nodeApi.findVersionedNodeByKey(packageKey, nodeKey, version, withConfiguration)
public async findNode(packageKey: string, nodeKey: string, withConfiguration: boolean, packageVersion: string | null, jsonResponse: boolean): Promise<void> {
const node = packageVersion
? await this.nodeApi.findVersionedNodeByKey(packageKey, nodeKey, packageVersion, withConfiguration)
: await this.nodeApi.findStagingNodeByKey(packageKey, nodeKey, withConfiguration);

if (jsonResponse) {
Expand Down