diff --git a/.gitignore b/.gitignore index 636bcbe56e..329aeebd38 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ oclif.manifest.json contentstack-cli-logs packages/**/package-lock.json .dccache -yarn.lock \ No newline at end of file +yarn.lock +contents-* \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index de00a27b53..634135046b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2599,9 +2599,9 @@ "dev": true }, "node_modules/@types/fs-extra": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.1.tgz", - "integrity": "sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.2.tgz", + "integrity": "sha512-c0hrgAOVYr21EX8J0jBMXGLMgJqVf/v6yxi0dLaJboW9aQPh16Id+z6w2Tx1hm+piJOLv8xPfVKZCLfjPw/IMQ==", "dev": true, "dependencies": { "@types/jsonfile": "*", @@ -2903,6 +2903,12 @@ "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz", "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==" }, + "node_modules/@types/uuid": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.4.tgz", + "integrity": "sha512-zAuJWQflfx6dYJM62vna+Sn5aeSWhh3OB+wfUEACNcqUSc0AGc5JKl+ycL1vrH7frGTXhJchYjE1Hak8L819dA==", + "dev": true + }, "node_modules/@types/vinyl": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.7.tgz", @@ -21174,9 +21180,13 @@ } }, "node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } @@ -22819,7 +22829,8 @@ "chalk": "^4.1.2", "fast-csv": "^4.3.6", "lodash": "^4.17.21", - "winston": "^3.9.0" + "uuid": "^9.0.1", + "winston": "^3.10.0" }, "bin": { "audit": "bin/run" @@ -22827,7 +22838,9 @@ "devDependencies": { "@oclif/test": "^2.0.3", "@types/chai": "^4.3.5", + "@types/fs-extra": "^11.0.2", "@types/node": "^20.3.1", + "@types/uuid": "^9.0.4", "chai": "^4.3.7", "eslint": "^8.43.0", "eslint-config-oclif": "^4.0.0", @@ -26888,13 +26901,15 @@ "@oclif/plugin-plugins": "^3.8.4", "@oclif/test": "^2.0.3", "@types/chai": "^4.3.5", + "@types/fs-extra": "^11.0.2", "@types/node": "^20.3.1", + "@types/uuid": "^9.0.4", "chai": "^4.3.7", "chalk": "^4.1.2", "eslint": "^8.43.0", "eslint-config-oclif": "^4.0.0", "eslint-config-oclif-typescript": "^1.0.3", - "fast-csv": "*", + "fast-csv": "^4.3.6", "lodash": "^4.17.21", "mocha": "^10.2.0", "nyc": "^15.1.0", @@ -26903,7 +26918,8 @@ "ts-node": "^10.9.1", "tslib": "^2.5.3", "typescript": "^5.1.3", - "winston": "^3.9.0" + "uuid": "^9.0.1", + "winston": "^3.10.0" }, "dependencies": { "@babel/code-frame": { @@ -31074,9 +31090,9 @@ "dev": true }, "@types/fs-extra": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.1.tgz", - "integrity": "sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.2.tgz", + "integrity": "sha512-c0hrgAOVYr21EX8J0jBMXGLMgJqVf/v6yxi0dLaJboW9aQPh16Id+z6w2Tx1hm+piJOLv8xPfVKZCLfjPw/IMQ==", "dev": true, "requires": { "@types/jsonfile": "*", @@ -31379,6 +31395,12 @@ "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz", "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==" }, + "@types/uuid": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.4.tgz", + "integrity": "sha512-zAuJWQflfx6dYJM62vna+Sn5aeSWhh3OB+wfUEACNcqUSc0AGc5JKl+ycL1vrH7frGTXhJchYjE1Hak8L819dA==", + "dev": true + }, "@types/vinyl": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.7.tgz", @@ -44903,9 +44925,9 @@ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" }, "uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==" }, "v8-compile-cache": { "version": "2.3.0", diff --git a/packages/contentstack-audit/README.md b/packages/contentstack-audit/README.md index 6f4b4c946b..a9ae636708 100644 --- a/packages/contentstack-audit/README.md +++ b/packages/contentstack-audit/README.md @@ -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 @@ -30,9 +30,10 @@ USAGE # 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) @@ -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 ] [-d ] + $ csdx audit [-c ] [-d ] [--report-path ] [--modules + content-types|global-fields|entries] [--columns | ] [--sort ] [--filter ] [--csv | + --no-truncate] FLAGS -c, --config= Path of the external config. -d, --data-dir= Path where the data is stored. + --columns= only show provided columns (comma-separated) + --csv output is csv format [alias: --output=csv] + --filter= filter property by partial string matching, ex: name=foo + --modules=