Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: PR for the implementation of the content type audit:fix command. #1072

Closed
wants to merge 17 commits into from
Closed
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ oclif.manifest.json
contentstack-cli-logs
packages/**/package-lock.json
.dccache
yarn.lock
yarn.lock
contents-*
52 changes: 37 additions & 15 deletions package-lock.json

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

133 changes: 109 additions & 24 deletions packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ npm install -g @contentstack/cli-audit
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-audit/0.0.0-alpha darwin-arm64 node-v16.19.0
@contentstack/cli-audit/0.0.0-alpha darwin-arm64 node-v20.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand All @@ -30,9 +30,10 @@ USAGE

# Commands
<!-- commands -->
* [`csdx cm::stacks:audit:fix`](#csdx-cmstacksauditfix)
* [`csdx audit`](#csdx-audit)
* [`csdx audit:fix`](#csdx-auditfix)
* [`csdx cm:stacks:audit`](#csdx-cmstacksaudit)
* [`csdx cm:stacks:audit:fix`](#csdx-cmstacksauditfix-1)
* [`csdx cm:stacks:audit:fix`](#csdx-cmstacksauditfix)
* [`csdx help [COMMANDS]`](#csdx-help-commands)
* [`csdx plugins`](#csdx-plugins)
* [`csdx plugins:install PLUGIN...`](#csdx-pluginsinstall-plugin)
Expand All @@ -44,33 +45,94 @@ USAGE
* [`csdx plugins:uninstall PLUGIN...`](#csdx-pluginsuninstall-plugin-2)
* [`csdx plugins:update`](#csdx-pluginsupdate)

## `csdx cm::stacks:audit:fix`
## `csdx audit`

Audit fix command
Perform audits and find possible errors in the exported Contentstack data

```
USAGE
$ csdx cm::stacks:audit:fix [-c <value>] [-d <value>]
$ csdx audit [-c <value>] [-d <value>] [--report-path <value>] [--modules
content-types|global-fields|entries] [--columns <value> | ] [--sort <value>] [--filter <value>] [--csv |
--no-truncate]

FLAGS
-c, --config=<value> Path of the external config.
-d, --data-dir=<value> Path where the data is stored.
--columns=<value> only show provided columns (comma-separated)
--csv output is csv format [alias: --output=csv]
--filter=<value> filter property by partial string matching, ex: name=foo
--modules=<option>... Provide the list of modules to be audited.
<options: content-types|global-fields|entries>
--no-truncate do not truncate output to fit screen
--report-path=<value> Path to store the audit reports.
--sort=<value> property to sort by (prepend '-' for descending)

DESCRIPTION
Audit fix command
Perform audits and find possible errors in the exported Contentstack data

ALIASES
$ csdx cm::stacks:audit:fix
$ csdx audit
$ csdx cm:stacks:audit

EXAMPLES
$ csdx cm::stacks:audit:fix
$ csdx audit

$ csdx audit --report-path=<path>

$ csdx audit --report-path=<path> --csv

$ csdx audit --report-path=<path> --filter="name=<filter-value>"

$ csdx audit --report-path=<path> --modules=content-types --filter="name="<filter-value>"
```

_See code: [src/commands/cm/stacks/audit/fix.ts](https://github.com/contentstack/audit/blob/main/packages/contentstack-audit/src/commands/cm/stacks/audit/fix.ts)_
## `csdx audit:fix`

Audit and fix possible errors in the exported data

```
USAGE
$ csdx audit:fix [-c <value>] [-d <value>] [--report-path <value>] [--modules
content-types|global-fields|entries] [--backup-dir <value> --copy-dir] [-y] [--columns <value> | ] [--sort <value>]
[--filter <value>] [--csv | --no-truncate]

FLAGS
-c, --config=<value> Path of the external config.
-d, --data-dir=<value> Path where the data is stored.
-y, --yes Use this flag to skip confirmation
--backup-dir=<value> Provided path to backup original data
--columns=<value> only show provided columns (comma-separated)
--copy-dir Create backup from original data
--csv output is csv format [alias: --output=csv]
--filter=<value> filter property by partial string matching, ex: name=foo
--modules=<option>... Provide the list of modules to be audited.
<options: content-types|global-fields|entries>
--no-truncate do not truncate output to fit screen
--report-path=<value> Path to store the audit reports.
--sort=<value> property to sort by (prepend '-' for descending)

DESCRIPTION
Audit and fix possible errors in the exported data

ALIASES
$ csdx audit:fix
$ csdx cm:stacks:audit:fix

EXAMPLES
$ csdx audit:fix --copy-dir

$ csdx audit:fix --report-path=<path> --copy-dir

$ csdx audit:fix --report-path=<path> --copy-dir --csv

$ csdx audit:fix --report-path=<path> --filter="name=<filter-value>"

$ csdx audit:fix --report-path=<path> --modules=content-types --filter="name="<filter-value>" --copy-dir --backup-dir=<path>
```

## `csdx cm:stacks:audit`

Audit and find possible errors in the exported data
Perform audits and find possible errors in the exported Contentstack data

```
USAGE
Expand All @@ -91,9 +153,10 @@ FLAGS
--sort=<value> property to sort by (prepend '-' for descending)

DESCRIPTION
Audit and find possible errors in the exported data
Perform audits and find possible errors in the exported Contentstack data

ALIASES
$ csdx audit
$ csdx cm:stacks:audit

EXAMPLES
Expand All @@ -112,24 +175,46 @@ _See code: [src/commands/cm/stacks/audit/index.ts](https://github.com/contentsta

## `csdx cm:stacks:audit:fix`

Audit fix command
Audit and fix possible errors in the exported data

```
USAGE
$ csdx cm:stacks:audit:fix [-c <value>] [-d <value>]
$ csdx cm:stacks:audit:fix [-c <value>] [-d <value>] [--report-path <value>] [--modules
content-types|global-fields|entries] [--backup-dir <value> --copy-dir] [-y] [--columns <value> | ] [--sort <value>]
[--filter <value>] [--csv | --no-truncate]

FLAGS
-c, --config=<value> Path of the external config.
-d, --data-dir=<value> Path where the data is stored.
-y, --yes Use this flag to skip confirmation
--backup-dir=<value> Provided path to backup original data
--columns=<value> only show provided columns (comma-separated)
--copy-dir Create backup from original data
--csv output is csv format [alias: --output=csv]
--filter=<value> filter property by partial string matching, ex: name=foo
--modules=<option>... Provide the list of modules to be audited.
<options: content-types|global-fields|entries>
--no-truncate do not truncate output to fit screen
--report-path=<value> Path to store the audit reports.
--sort=<value> property to sort by (prepend '-' for descending)

DESCRIPTION
Audit fix command
Audit and fix possible errors in the exported data

ALIASES
$ csdx cm::stacks:audit:fix
$ csdx audit:fix
$ csdx cm:stacks:audit:fix

EXAMPLES
$ csdx cm:stacks:audit:fix
$ csdx cm:stacks:audit:fix --copy-dir

$ csdx cm:stacks:audit:fix --report-path=<path> --copy-dir

$ csdx cm:stacks:audit:fix --report-path=<path> --copy-dir --csv

$ csdx cm:stacks:audit:fix --report-path=<path> --filter="name=<filter-value>"

$ csdx cm:stacks:audit:fix --report-path=<path> --modules=content-types --filter="name="<filter-value>" --copy-dir --backup-dir=<path>
```

_See code: [src/commands/cm/stacks/audit/fix.ts](https://github.com/contentstack/audit/blob/main/packages/contentstack-audit/src/commands/cm/stacks/audit/fix.ts)_
Expand All @@ -152,7 +237,7 @@ DESCRIPTION
Display help for csdx.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.19/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_

## `csdx plugins`

Expand All @@ -175,7 +260,7 @@ EXAMPLES
$ csdx plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/index.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/index.ts)_

## `csdx plugins:install PLUGIN...`

Expand Down Expand Up @@ -240,7 +325,7 @@ EXAMPLES
$ csdx plugins:inspect myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/inspect.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/inspect.ts)_

## `csdx plugins:install PLUGIN...`

Expand Down Expand Up @@ -280,7 +365,7 @@ EXAMPLES
$ csdx plugins:install someuser/someplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/install.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/install.ts)_

## `csdx plugins:link PLUGIN`

Expand Down Expand Up @@ -309,7 +394,7 @@ EXAMPLES
$ csdx plugins:link myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/link.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/link.ts)_

## `csdx plugins:uninstall PLUGIN...`

Expand Down Expand Up @@ -357,7 +442,7 @@ ALIASES
$ csdx plugins:remove
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/uninstall.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/uninstall.ts)_

## `csdx plugins:uninstall PLUGIN...`

Expand Down Expand Up @@ -398,5 +483,5 @@ DESCRIPTION
Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/update.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/update.ts)_
<!-- commandsstop -->
Loading