Skip to content

Commit

Permalink
fix: review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aman19K committed Jun 18, 2023
1 parent 31563aa commit 1f46577
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 85 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ DESCRIPTION
Display recent changes to a Content Type
EXAMPLES
$ csdx content-type:audit -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"
$ csdx content-type:audit --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"
$ csdx content-type:audit -a "management token" -c "home_page"
$ csdx content-type:audit --alias "management token" --content-type "home_page"
```

_See code: [src/commands/content-type/audit.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/audit.ts)_
Expand All @@ -109,11 +109,11 @@ DESCRIPTION
Compare two Content Type versions
EXAMPLES
$ csdx content-type:compare -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"
$ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"
$ csdx content-type:compare -k "xxxxxxxxxxxxxxxxxxx" -c "home_page" -l # -r #
$ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page" --left # --right #
$ csdx content-type:compare -a "management token" -c "home_page" -l # -r #
$ csdx content-type:compare --alias "management token" --content-type "home_page" --left # --right #
```

_See code: [src/commands/content-type/compare.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/compare.ts)_
Expand All @@ -135,7 +135,7 @@ DESCRIPTION
compare two Content Types on different Stacks
EXAMPLES
$ csdx content-type:compare-remote -o "xxxxxxxxxxxxxxxxxxx" -r "xxxxxxxxxxxxxxxxxxx" -c "home_page"
$ csdx content-type:compare-remote --origin-stack "xxxxxxxxxxxxxxxxxxx" --remote-stack "xxxxxxxxxxxxxxxxxxx" -content-type "home_page"
```

_See code: [src/commands/content-type/compare-remote.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/compare-remote.ts)_
Expand All @@ -160,11 +160,11 @@ DESCRIPTION
Display Content Type details
EXAMPLES
$ csdx content-type:details -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"
$ csdx content-type:details --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"
$ csdx content-type:details -a "management token" -c "home_page"
$ csdx content-type:details --alias "management token" --content-type "home_page"
$ csdx content-type:details -a "management token" -c "home_page" --no-path
$ csdx content-type:details --alias "management token" --content-type "home_page" --no-path
```

_See code: [src/commands/content-type/details.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/details.ts)_
Expand Down Expand Up @@ -193,13 +193,13 @@ DESCRIPTION
Create a visual diagram of a Stack's Content Types
EXAMPLES
$ csdx content-type:diagram -k "xxxxxxxxxxxxxxxxxxx" -o "content-model.svg"
$ csdx content-type:diagram --stack-api-key "xxxxxxxxxxxxxxxxxxx" --output "content-model.svg"
$ csdx content-type:diagram -a "management token" -o "content-model.svg"
$ csdx content-type:diagram --alias "management token" --output "content-model.svg"
$ csdx content-type:diagram -a "management token" -o "content-model.svg" -d "landscape"
$ csdx content-type:diagram --alias "management token" --output "content-model.svg" --direction "landscape"
$ csdx content-type:diagram -a "management token" -o "content-model.dot" -t "dot"
$ csdx content-type:diagram --alias "management token" --output "content-model.dot" --type "dot"
```

_See code: [src/commands/content-type/diagram.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/diagram.ts)_
Expand All @@ -224,11 +224,11 @@ DESCRIPTION
List all Content Types in a Stack
EXAMPLES
$ csdx content-type:list -k "xxxxxxxxxxxxxxxxxxx"
$ csdx content-type:list --stack-api-key "xxxxxxxxxxxxxxxxxxx"
$ csdx content-type:list -a "management token"
$ csdx content-type:list --alias "management token"
$ csdx content-type:list -a "management token" -o modified
$ csdx content-type:list --alias "management token" --order modified
```

_See code: [src/commands/content-type/list.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/list.ts)_
Expand Down
72 changes: 36 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/commands/content-type/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export default class AuditCommand extends Command {
static description = 'Display recent changes to a Content Type'

static examples = [
'$ csdx content-type:audit -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"',
'$ csdx content-type:audit -a "management token" -c "home_page"'
'$ csdx content-type:audit --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"',
'$ csdx content-type:audit --alias "management token" --content-type "home_page"'
]

static flags: FlagInput = {
Expand Down Expand Up @@ -39,7 +39,8 @@ export default class AuditCommand extends Command {
'content-type': flags.string({
char: 'c',
description: 'Content Type UID',
required: true
required: true,
parse: printFlagDeprecation(['-c'], ['--content-type'])
})
}

Expand Down
13 changes: 8 additions & 5 deletions src/commands/content-type/compare-remote.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
import Command from '../../core/command'
import { flags, FlagInput, managementSDKClient, cliux } from '@contentstack/cli-utilities'
import { flags, FlagInput, managementSDKClient, cliux, printFlagDeprecation } from '@contentstack/cli-utilities'
import buildOutput from '../../core/content-type/compare'
import { getStack, getContentType } from '../../utils'

export default class CompareRemoteCommand extends Command {
static description = 'compare two Content Types on different Stacks'

static examples = [
'$ csdx content-type:compare-remote -o "xxxxxxxxxxxxxxxxxxx" -r "xxxxxxxxxxxxxxxxxxx" -c "home_page"'
'$ csdx content-type:compare-remote --origin-stack "xxxxxxxxxxxxxxxxxxx" --remote-stack "xxxxxxxxxxxxxxxxxxx" -content-type "home_page"'
]

static flags: FlagInput = {
'origin-stack': flags.string({
char: 'o',
description: 'Origin Stack API Key',
required: true,
dependsOn: ['remote-stack']
dependsOn: ['remote-stack'],
parse: printFlagDeprecation(['-o'], ['--remote-stack'])
}),

'remote-stack': flags.string({
char: 'r',
description: 'Remote Stack API Key',
required: true,
dependsOn: ['origin-stack']
dependsOn: ['origin-stack'],
parse: printFlagDeprecation(['-r'], ['--remote-stack'])
}),

'content-type': flags.string({
char: 'c',
description: 'Content Type UID',
required: true
required: true,
parse: printFlagDeprecation(['-c'], ['--content-type'])
})
}

Expand Down
17 changes: 9 additions & 8 deletions src/commands/content-type/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export default class CompareCommand extends Command {
static description = 'Compare two Content Type versions'

static examples = [
'$ csdx content-type:compare -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"',
'$ csdx content-type:compare -k "xxxxxxxxxxxxxxxxxxx" -c "home_page" -l # -r #',
'$ csdx content-type:compare -a "management token" -c "home_page" -l # -r #'
'$ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"',
'$ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page" --left # --right #',
'$ csdx content-type:compare --alias "management token" --content-type "home_page" --left # --right #'
]

static flags: FlagInput = {
Expand Down Expand Up @@ -40,21 +40,22 @@ export default class CompareCommand extends Command {
'content-type': flags.string({
char: 'c',
description: 'Content Type UID',
required: true
required: true,
parse: printFlagDeprecation(['-c'], ['--content-type'])
}),

left: flags.integer({
char: 'l',
description: 'Content Type version, i.e. prev version',
required: false,
dependsOn: ['right']
dependsOn: ['right'],
parse: printFlagDeprecation(['-l'], ['--left'])
}),

right: flags.integer({
char: 'r',
description: 'Content Type version, i.e. later version',
required: false,
dependsOn: ['left']
dependsOn: ['left'],
parse: printFlagDeprecation(['-r'], ['--right'])
})
}

Expand Down
12 changes: 7 additions & 5 deletions src/commands/content-type/details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export default class DetailsCommand extends Command {
static description = 'Display Content Type details'

static examples = [
'$ csdx content-type:details -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"',
'$ csdx content-type:details -a "management token" -c "home_page"',
'$ csdx content-type:details -a "management token" -c "home_page" --no-path'
'$ csdx content-type:details --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"',
'$ csdx content-type:details --alias "management token" --content-type "home_page"',
'$ csdx content-type:details --alias "management token" --content-type "home_page" --no-path'
]

static flags: FlagInput = {
Expand Down Expand Up @@ -40,14 +40,16 @@ export default class DetailsCommand extends Command {
'content-type': flags.string({
char: 'c',
description: 'Content Type UID',
required: true
required: true,
parse: printFlagDeprecation(['-c'], ['--content-type'])
}),

path: flags.boolean({
char: 'p',
description: 'show path column',
default: true,
allowNo: true
allowNo: true,
parse: printFlagDeprecation(['-p'], ['--path'])
})
}

Expand Down
Loading

0 comments on commit 1f46577

Please sign in to comment.