@contentstack/cli 1.8.5 → 1.9.1

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/README.md CHANGED
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli
18
18
  $ csdx COMMAND
19
19
  running command...
20
20
  $ csdx (--version|-v)
21
- @contentstack/cli/1.8.5 linux-x64 node-v18.17.1
21
+ @contentstack/cli/1.9.1 linux-x64 node-v18.18.0
22
22
  $ csdx --help [COMMAND]
23
23
  USAGE
24
24
  $ csdx COMMAND
@@ -35,6 +35,7 @@ USAGE
35
35
  * [`csdx auth:tokens:add [-a <value>] [--delivery] [--management] [-e <value>] [-k <value>] [-y] [--token <value>]`](#csdx-authtokensadd--a-value---delivery---management--e-value--k-value--y---token-value)
36
36
  * [`csdx auth:tokens:remove`](#csdx-authtokensremove)
37
37
  * [`csdx auth:whoami`](#csdx-authwhoami)
38
+ * [`csdx cm::stacks:audit:fix`](#csdx-cmstacksauditfix)
38
39
  * [`csdx cm:assets:publish [-a <value>] [--retry-failed <value>] [-e <value>] [--folder-uid <value>] [--bulk-publish <value>] [-c <value>] [-y] [--locales <value>] [--branch <value>] [--delivery-token <value>] [--source-env <value>]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value)
39
40
  * [`csdx cm:assets:unpublish`](#csdx-cmassetsunpublish)
40
41
  * [`csdx cm:bootstrap`](#csdx-cmbootstrap)
@@ -69,6 +70,8 @@ USAGE
69
70
  * [`csdx cm:stacks:migration [-k <value>] [-a <value>] [--file-path <value>] [--branch <value>] [--config-file <value>] [--config <value>] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple)
70
71
  * [`csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y-value--s-value)
71
72
  * [`csdx cm:stacks:clone [--source-branch <value>] [--target-branch <value>] [--source-management-token-alias <value>] [--destination-management-token-alias <value>] [-n <value>] [--type a|b] [--source-stack-api-key <value>] [--destination-stack-api-key <value>] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent)
73
+ * [`csdx cm:stacks:audit`](#csdx-cmstacksaudit)
74
+ * [`csdx cm:stacks:audit:fix`](#csdx-cmstacksauditfix-1)
72
75
  * [`csdx cm:stacks:clone [--source-branch <value>] [--target-branch <value>] [--source-management-token-alias <value>] [--destination-management-token-alias <value>] [-n <value>] [--type a|b] [--source-stack-api-key <value>] [--destination-stack-api-key <value>] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent-1)
73
76
  * [`csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets-1)
74
77
  * [`csdx cm:stacks:import [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent-1)
@@ -286,6 +289,30 @@ EXAMPLES
286
289
 
287
290
  _See code: [@contentstack/cli-auth](https://github.com/contentstack/cli/blob/main/packages/contentstack-auth/src/commands/auth/whoami.ts)_
288
291
 
292
+ ## `csdx cm::stacks:audit:fix`
293
+
294
+ Audit fix command
295
+
296
+ ```
297
+ USAGE
298
+ $ csdx cm::stacks:audit:fix [-c <value>] [-d <value>]
299
+
300
+ FLAGS
301
+ -c, --config=<value> Path of the external config.
302
+ -d, --data-dir=<value> Path where the data is stored.
303
+
304
+ DESCRIPTION
305
+ Audit fix command
306
+
307
+ ALIASES
308
+ $ csdx cm::stacks:audit:fix
309
+
310
+ EXAMPLES
311
+ $ csdx cm::stacks:audit:fix
312
+ ```
313
+
314
+ _See code: [@contentstack/cli-audit](https://github.com/contentstack/audit/blob/main/packages/contentstack-audit/src/commands/cm/stacks/audit/fix.ts)_
315
+
289
316
  ## `csdx cm:assets:publish [-a <value>] [--retry-failed <value>] [-e <value>] [--folder-uid <value>] [--bulk-publish <value>] [-c <value>] [-y] [--locales <value>] [--branch <value>] [--delivery-token <value>] [--source-env <value>]`
290
317
 
291
318
  Publish assets to the specified environments
@@ -2205,6 +2232,72 @@ EXAMPLES
2205
2232
  $ csdx cm:stacks:clone --source-branch --target-branch --source-management-token-alias <management token alias> --destination-management-token-alias <management token alias> --type <value a or b>
2206
2233
  ```
2207
2234
 
2235
+ ## `csdx cm:stacks:audit`
2236
+
2237
+ Perform audits and find possible errors in the exported Contentstack data
2238
+
2239
+ ```
2240
+ USAGE
2241
+ $ csdx cm:stacks:audit [-c <value>] [-d <value>] [--report-path <value>] [--modules
2242
+ content-types|global-fields|entries] [--columns <value> | ] [--sort <value>] [--filter <value>] [--csv |
2243
+ --no-truncate]
2244
+
2245
+ FLAGS
2246
+ -c, --config=<value> Path of the external config.
2247
+ -d, --data-dir=<value> Path where the data is stored.
2248
+ --columns=<value> only show provided columns (comma-separated)
2249
+ --csv output is csv format [alias: --output=csv]
2250
+ --filter=<value> filter property by partial string matching, ex: name=foo
2251
+ --modules=<option>... Provide the list of modules to be audited.
2252
+ <options: content-types|global-fields|entries>
2253
+ --no-truncate do not truncate output to fit screen
2254
+ --report-path=<value> Path to store the audit reports.
2255
+ --sort=<value> property to sort by (prepend '-' for descending)
2256
+
2257
+ DESCRIPTION
2258
+ Perform audits and find possible errors in the exported Contentstack data
2259
+
2260
+ ALIASES
2261
+ $ csdx cm:stacks:audit
2262
+
2263
+ EXAMPLES
2264
+ $ csdx cm:stacks:audit
2265
+
2266
+ $ csdx cm:stacks:audit --report-path=<path>
2267
+
2268
+ $ csdx cm:stacks:audit --report-path=<path> --csv
2269
+
2270
+ $ csdx cm:stacks:audit --report-path=<path> --filter="name=<filter-value>"
2271
+
2272
+ $ csdx cm:stacks:audit --report-path=<path> --modules=content-types --filter="name="<filter-value>"
2273
+ ```
2274
+
2275
+ _See code: [@contentstack/cli-audit](https://github.com/contentstack/audit/blob/main/packages/contentstack-audit/src/commands/cm/stacks/audit/index.ts)_
2276
+
2277
+ ## `csdx cm:stacks:audit:fix`
2278
+
2279
+ Audit fix command
2280
+
2281
+ ```
2282
+ USAGE
2283
+ $ csdx cm:stacks:audit:fix [-c <value>] [-d <value>]
2284
+
2285
+ FLAGS
2286
+ -c, --config=<value> Path of the external config.
2287
+ -d, --data-dir=<value> Path where the data is stored.
2288
+
2289
+ DESCRIPTION
2290
+ Audit fix command
2291
+
2292
+ ALIASES
2293
+ $ csdx cm::stacks:audit:fix
2294
+
2295
+ EXAMPLES
2296
+ $ csdx cm:stacks:audit:fix
2297
+ ```
2298
+
2299
+ _See code: [@contentstack/cli-audit](https://github.com/contentstack/audit/blob/main/packages/contentstack-audit/src/commands/cm/stacks/audit/fix.ts)_
2300
+
2208
2301
  ## `csdx cm:stacks:clone [--source-branch <value>] [--target-branch <value>] [--source-management-token-alias <value>] [--destination-management-token-alias <value>] [-n <value>] [--type a|b] [--source-stack-api-key <value>] [--destination-stack-api-key <value>] [--import-webhook-status disable|current]`
2209
2302
 
2210
2303
  Clone data (structure/content or both) of a stack into another stack
@@ -2807,7 +2900,7 @@ DESCRIPTION
2807
2900
  Display help for csdx.
2808
2901
  ```
2809
2902
 
2810
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.13/src/commands/help.ts)_
2903
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_
2811
2904
 
2812
2905
  ## `csdx launch`
2813
2906
 
@@ -3105,7 +3198,7 @@ EXAMPLES
3105
3198
  $ csdx plugins
3106
3199
  ```
3107
3200
 
3108
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/index.ts)_
3201
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/index.ts)_
3109
3202
 
3110
3203
  ## `csdx plugins:install PLUGIN...`
3111
3204
 
@@ -3170,7 +3263,7 @@ EXAMPLES
3170
3263
  $ csdx plugins:inspect myplugin
3171
3264
  ```
3172
3265
 
3173
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/inspect.ts)_
3266
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/inspect.ts)_
3174
3267
 
3175
3268
  ## `csdx plugins:install PLUGIN...`
3176
3269
 
@@ -3210,7 +3303,7 @@ EXAMPLES
3210
3303
  $ csdx plugins:install someuser/someplugin
3211
3304
  ```
3212
3305
 
3213
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/install.ts)_
3306
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/install.ts)_
3214
3307
 
3215
3308
  ## `csdx plugins:link PLUGIN`
3216
3309
 
@@ -3239,7 +3332,7 @@ EXAMPLES
3239
3332
  $ csdx plugins:link myplugin
3240
3333
  ```
3241
3334
 
3242
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/link.ts)_
3335
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/link.ts)_
3243
3336
 
3244
3337
  ## `csdx plugins:uninstall PLUGIN...`
3245
3338
 
@@ -3287,7 +3380,7 @@ ALIASES
3287
3380
  $ csdx plugins:remove
3288
3381
  ```
3289
3382
 
3290
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/uninstall.ts)_
3383
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/uninstall.ts)_
3291
3384
 
3292
3385
  ## `csdx plugins:uninstall PLUGIN...`
3293
3386
 
@@ -3328,7 +3421,7 @@ DESCRIPTION
3328
3421
  Update installed plugins.
3329
3422
  ```
3330
3423
 
3331
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/update.ts)_
3424
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/update.ts)_
3332
3425
 
3333
3426
  ## `csdx tokens`
3334
3427
 
@@ -6,7 +6,7 @@ const cli_utilities_1 = require("@contentstack/cli-utilities");
6
6
  */
7
7
  function default_1(_opts) {
8
8
  const { context } = this.config;
9
- cli_utilities_1.logger.init(context);
9
+ // logger.init(context);
10
10
  cli_utilities_1.messageHandler.init(context);
11
11
  cli_utilities_1.cliux.init(context);
12
12
  cli_utilities_1.managementSDKInitiator.init(context);
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const cli_utilities_1 = require("@contentstack/cli-utilities");
4
+ const cli_utilities_2 = require("@contentstack/cli-utilities");
4
5
  // TBD: run region command if region is not there
5
6
  async function default_1(opts) {
7
+ const newLogger = new cli_utilities_2.LoggerService(process.cwd(), 'cli-log');
6
8
  const { context: { plugin: { config: { protectedCommands = {} } = {} } = {}, region = null } = {} } = this.config;
7
9
  if (opts.Command.id !== 'config:set:region') {
8
10
  if (!region) {
@@ -15,7 +17,7 @@ async function default_1(opts) {
15
17
  // Auth guard
16
18
  if (protectedCommands[opts.Command.id]) {
17
19
  if (!(0, cli_utilities_1.isAuthenticated)()) {
18
- cli_utilities_1.logger.error('No auth token found for command', opts.Command.id);
20
+ newLogger.error('No auth token found for command', opts.Command.id);
19
21
  cli_utilities_1.cliux.error('Please login to execute the command');
20
22
  this.exit();
21
23
  }
@@ -23,14 +25,14 @@ async function default_1(opts) {
23
25
  try {
24
26
  const result = await client.getUser();
25
27
  if (!result) {
26
- cli_utilities_1.logger.error('error in auth validation');
28
+ newLogger.error('error in auth validation');
27
29
  cli_utilities_1.cliux.error('Please login to execute the command');
28
30
  this.exit();
29
31
  }
30
- cli_utilities_1.logger.debug('logged in user', result.data);
32
+ newLogger.debug('logged in user', result.data);
31
33
  }
32
34
  catch (error) {
33
- cli_utilities_1.logger.error('error in auth validation', error);
35
+ newLogger.error('error in auth validation', error);
34
36
  cli_utilities_1.cliux.error('Please login to execute the command');
35
37
  process.exit();
36
38
  }
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "1.8.5",
2
+ "version": "1.9.1",
3
3
  "commands": {}
4
4
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contentstack/cli",
3
3
  "description": "Command-line tool (CLI) to interact with Contentstack",
4
- "version": "1.8.5",
4
+ "version": "1.9.1",
5
5
  "author": "Contentstack",
6
6
  "bin": {
7
7
  "csdx": "./bin/run"
@@ -22,26 +22,27 @@
22
22
  "prepack": "pnpm compile && oclif manifest && oclif readme"
23
23
  },
24
24
  "dependencies": {
25
- "@contentstack/cli-auth": "~1.3.13",
26
- "@contentstack/cli-cm-bootstrap": "~1.4.16",
27
- "@contentstack/cli-cm-bulk-publish": "~1.3.11",
28
- "@contentstack/cli-cm-clone": "~1.4.17",
29
- "@contentstack/cli-cm-export": "~1.8.2",
30
- "@contentstack/cli-cm-import": "~1.8.4",
31
- "@contentstack/cli-cm-export-to-csv": "~1.4.2",
32
- "@contentstack/cli-cm-migrate-rte": "~1.4.11",
33
- "@contentstack/cli-cm-seed": "~1.4.16",
34
- "@contentstack/cli-command": "~1.2.12",
35
- "@contentstack/cli-config": "~1.4.11",
25
+ "@contentstack/cli-audit": "~1.0.0",
26
+ "@contentstack/cli-auth": "~1.3.14",
27
+ "@contentstack/cli-cm-bootstrap": "~1.5.1",
28
+ "@contentstack/cli-cm-branches": "~1.0.14",
29
+ "@contentstack/cli-cm-bulk-publish": "~1.3.12",
30
+ "@contentstack/cli-cm-clone": "~1.5.1",
31
+ "@contentstack/cli-cm-export": "~1.9.1",
32
+ "@contentstack/cli-cm-export-to-csv": "~1.4.3",
33
+ "@contentstack/cli-cm-import": "~1.9.1",
34
+ "@contentstack/cli-cm-migrate-rte": "~1.4.12",
35
+ "@contentstack/cli-cm-seed": "~1.5.1",
36
+ "@contentstack/cli-command": "~1.2.13",
37
+ "@contentstack/cli-config": "~1.4.12",
36
38
  "@contentstack/cli-launch": "~1.0.12",
37
39
  "@contentstack/cli-migration": "~1.3.13",
38
- "@contentstack/cli-utilities": "~1.5.2",
40
+ "@contentstack/cli-utilities": "~1.5.3",
39
41
  "@contentstack/management": "~1.10.0",
40
- "@contentstack/cli-cm-branches": "~1.0.13",
42
+ "@oclif/core": "^2.9.3",
41
43
  "@oclif/plugin-help": "^5",
42
44
  "@oclif/plugin-not-found": "^2.4.0",
43
- "@oclif/plugin-plugins": "^3.3.2",
44
- "@oclif/core": "^2.9.3",
45
+ "@oclif/plugin-plugins": "^3.3.0",
45
46
  "chalk": "^4.1.2",
46
47
  "debug": "^4.1.1",
47
48
  "figlet": "^1.5.2",
@@ -145,7 +146,8 @@
145
146
  "@contentstack/cli-migration",
146
147
  "@contentstack/cli-cm-bulk-publish",
147
148
  "@contentstack/cli-cm-branches",
148
- "@contentstack/cli-launch"
149
+ "@contentstack/cli-launch",
150
+ "@contentstack/cli-audit"
149
151
  ],
150
152
  "hooks": {
151
153
  "prerun": [