@contentstack/cli 1.9.0 → 1.10.0

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.9.0 linux-x64 node-v18.18.0
21
+ @contentstack/cli/1.10.0 linux-x64 node-v18.18.2
22
22
  $ csdx --help [COMMAND]
23
23
  USAGE
24
24
  $ csdx COMMAND
@@ -29,6 +29,8 @@ USAGE
29
29
  # Commands
30
30
 
31
31
  <!-- commands -->
32
+ * [`csdx audit`](#csdx-audit)
33
+ * [`csdx audit:fix`](#csdx-auditfix)
32
34
  * [`csdx auth:login`](#csdx-authlogin)
33
35
  * [`csdx auth:logout`](#csdx-authlogout)
34
36
  * [`csdx auth:tokens`](#csdx-authtokens)
@@ -69,6 +71,8 @@ USAGE
69
71
  * [`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
72
  * [`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
73
  * [`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)
74
+ * [`csdx cm:stacks:audit`](#csdx-cmstacksaudit)
75
+ * [`csdx cm:stacks:audit:fix`](#csdx-cmstacksauditfix)
72
76
  * [`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
77
  * [`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
78
  * [`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)
@@ -105,6 +109,90 @@ USAGE
105
109
  * [`csdx tokens`](#csdx-tokens)
106
110
  * [`csdx whoami`](#csdx-whoami)
107
111
 
112
+ ## `csdx audit`
113
+
114
+ Perform audits and find possible errors in the exported Contentstack data
115
+
116
+ ```
117
+ USAGE
118
+ $ csdx audit [-c <value>] [-d <value>] [--report-path <value>] [--modules
119
+ content-types|global-fields|entries] [--columns <value> | ] [--sort <value>] [--filter <value>] [--csv |
120
+ --no-truncate]
121
+
122
+ FLAGS
123
+ -c, --config=<value> Path of the external config
124
+ -d, --data-dir=<value> Path where the data is stored
125
+ --columns=<value> only show provided columns (comma-separated)
126
+ --csv output is csv format [alias: --output=csv]
127
+ --filter=<value> filter property by partial string matching, ex: name=foo
128
+ --modules=<option>... Provide the list of modules to be audited
129
+ <options: content-types|global-fields|entries>
130
+ --no-truncate do not truncate output to fit screen
131
+ --report-path=<value> Path to store the audit reports
132
+ --sort=<value> property to sort by (prepend '-' for descending)
133
+
134
+ DESCRIPTION
135
+ Perform audits and find possible errors in the exported Contentstack data
136
+
137
+ ALIASES
138
+ $ csdx audit
139
+ $ csdx cm:stacks:audit
140
+
141
+ EXAMPLES
142
+ $ csdx audit
143
+
144
+ $ csdx audit --report-path=<path>
145
+
146
+ $ csdx audit --report-path=<path> --csv
147
+
148
+ $ csdx audit --report-path=<path> --filter="name=<filter-value>"
149
+
150
+ $ csdx audit --report-path=<path> --modules=content-types --filter="name="<filter-value>"
151
+ ```
152
+
153
+ ## `csdx audit:fix`
154
+
155
+ Perform audits and fix possible errors in the exported Contentstack data.
156
+
157
+ ```
158
+ USAGE
159
+ $ csdx audit:fix [-c <value>] [-d <value>] [--report-path <value>] [--modules
160
+ content-types|global-fields|entries] [--copy-path <value> --copy-dir] [--columns <value> | ] [--sort <value>]
161
+ [--filter <value>] [--csv | --no-truncate]
162
+
163
+ FLAGS
164
+ -c, --config=<value> Path of the external config
165
+ -d, --data-dir=<value> Path where the data is stored
166
+ --columns=<value> only show provided columns (comma-separated)
167
+ --copy-dir Create backup from the original data.
168
+ --copy-path=<value> Provide the path to backup the copied data
169
+ --csv output is csv format [alias: --output=csv]
170
+ --filter=<value> filter property by partial string matching, ex: name=foo
171
+ --modules=<option>... Provide the list of modules to be audited
172
+ <options: content-types|global-fields|entries>
173
+ --no-truncate do not truncate output to fit screen
174
+ --report-path=<value> Path to store the audit reports
175
+ --sort=<value> property to sort by (prepend '-' for descending)
176
+
177
+ DESCRIPTION
178
+ Perform audits and fix possible errors in the exported Contentstack data.
179
+
180
+ ALIASES
181
+ $ csdx audit:fix
182
+ $ csdx cm:stacks:audit:fix
183
+
184
+ EXAMPLES
185
+ $ csdx audit:fix --copy-dir
186
+
187
+ $ csdx audit:fix --report-path=<path> --copy-dir
188
+
189
+ $ csdx audit:fix --report-path=<path> --copy-dir --csv
190
+
191
+ $ csdx audit:fix --report-path=<path> --filter="name=<filter-value>"
192
+
193
+ $ csdx audit:fix --report-path=<path> --modules=content-types --filter="name="<filter-value>" --copy-dir --copy-path=<path>
194
+ ```
195
+
108
196
  ## `csdx auth:login`
109
197
 
110
198
  User sessions login
@@ -1998,6 +2086,8 @@ FLAGS
1998
2086
  -y, --yes [optional] Override marketplace prompts
1999
2087
  --import-webhook-status=<option> [default: disable] [optional] Webhook state
2000
2088
  <options: disable|current>
2089
+ --replace-existing Replaces the existing module in the target stack.
2090
+ --skip-existing Skips the module exists warning messages.
2001
2091
 
2002
2092
  DESCRIPTION
2003
2093
  Import content from a stack
@@ -2205,6 +2295,94 @@ EXAMPLES
2205
2295
  $ 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
2296
  ```
2207
2297
 
2298
+ ## `csdx cm:stacks:audit`
2299
+
2300
+ Perform audits and find possible errors in the exported Contentstack data
2301
+
2302
+ ```
2303
+ USAGE
2304
+ $ csdx cm:stacks:audit [-c <value>] [-d <value>] [--report-path <value>] [--modules
2305
+ content-types|global-fields|entries] [--columns <value> | ] [--sort <value>] [--filter <value>] [--csv |
2306
+ --no-truncate]
2307
+
2308
+ FLAGS
2309
+ -c, --config=<value> Path of the external config
2310
+ -d, --data-dir=<value> Path where the data is stored
2311
+ --columns=<value> only show provided columns (comma-separated)
2312
+ --csv output is csv format [alias: --output=csv]
2313
+ --filter=<value> filter property by partial string matching, ex: name=foo
2314
+ --modules=<option>... Provide the list of modules to be audited
2315
+ <options: content-types|global-fields|entries>
2316
+ --no-truncate do not truncate output to fit screen
2317
+ --report-path=<value> Path to store the audit reports
2318
+ --sort=<value> property to sort by (prepend '-' for descending)
2319
+
2320
+ DESCRIPTION
2321
+ Perform audits and find possible errors in the exported Contentstack data
2322
+
2323
+ ALIASES
2324
+ $ csdx audit
2325
+ $ csdx cm:stacks:audit
2326
+
2327
+ EXAMPLES
2328
+ $ csdx cm:stacks:audit
2329
+
2330
+ $ csdx cm:stacks:audit --report-path=<path>
2331
+
2332
+ $ csdx cm:stacks:audit --report-path=<path> --csv
2333
+
2334
+ $ csdx cm:stacks:audit --report-path=<path> --filter="name=<filter-value>"
2335
+
2336
+ $ csdx cm:stacks:audit --report-path=<path> --modules=content-types --filter="name="<filter-value>"
2337
+ ```
2338
+
2339
+ _See code: [@contentstack/cli-audit](https://github.com/contentstack/audit/blob/main/packages/contentstack-audit/src/commands/cm/stacks/audit/index.ts)_
2340
+
2341
+ ## `csdx cm:stacks:audit:fix`
2342
+
2343
+ Perform audits and fix possible errors in the exported Contentstack data.
2344
+
2345
+ ```
2346
+ USAGE
2347
+ $ csdx cm:stacks:audit:fix [-c <value>] [-d <value>] [--report-path <value>] [--modules
2348
+ content-types|global-fields|entries] [--copy-path <value> --copy-dir] [--columns <value> | ] [--sort <value>]
2349
+ [--filter <value>] [--csv | --no-truncate]
2350
+
2351
+ FLAGS
2352
+ -c, --config=<value> Path of the external config
2353
+ -d, --data-dir=<value> Path where the data is stored
2354
+ --columns=<value> only show provided columns (comma-separated)
2355
+ --copy-dir Create backup from the original data.
2356
+ --copy-path=<value> Provide the path to backup the copied data
2357
+ --csv output is csv format [alias: --output=csv]
2358
+ --filter=<value> filter property by partial string matching, ex: name=foo
2359
+ --modules=<option>... Provide the list of modules to be audited
2360
+ <options: content-types|global-fields|entries>
2361
+ --no-truncate do not truncate output to fit screen
2362
+ --report-path=<value> Path to store the audit reports
2363
+ --sort=<value> property to sort by (prepend '-' for descending)
2364
+
2365
+ DESCRIPTION
2366
+ Perform audits and fix possible errors in the exported Contentstack data.
2367
+
2368
+ ALIASES
2369
+ $ csdx audit:fix
2370
+ $ csdx cm:stacks:audit:fix
2371
+
2372
+ EXAMPLES
2373
+ $ csdx cm:stacks:audit:fix --copy-dir
2374
+
2375
+ $ csdx cm:stacks:audit:fix --report-path=<path> --copy-dir
2376
+
2377
+ $ csdx cm:stacks:audit:fix --report-path=<path> --copy-dir --csv
2378
+
2379
+ $ csdx cm:stacks:audit:fix --report-path=<path> --filter="name=<filter-value>"
2380
+
2381
+ $ csdx cm:stacks:audit:fix --report-path=<path> --modules=content-types --filter="name="<filter-value>" --copy-dir --copy-path=<path>
2382
+ ```
2383
+
2384
+ _See code: [@contentstack/cli-audit](https://github.com/contentstack/audit/blob/main/packages/contentstack-audit/src/commands/cm/stacks/audit/fix.ts)_
2385
+
2208
2386
  ## `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
2387
 
2210
2388
  Clone data (structure/content or both) of a stack into another stack
@@ -2320,6 +2498,8 @@ FLAGS
2320
2498
  -y, --yes [optional] Override marketplace prompts
2321
2499
  --import-webhook-status=<option> [default: disable] [optional] Webhook state
2322
2500
  <options: disable|current>
2501
+ --replace-existing Replaces the existing module in the target stack.
2502
+ --skip-existing Skips the module exists warning messages.
2323
2503
 
2324
2504
  DESCRIPTION
2325
2505
  Import content from a stack
@@ -2807,7 +2987,7 @@ DESCRIPTION
2807
2987
  Display help for csdx.
2808
2988
  ```
2809
2989
 
2810
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.13/src/commands/help.ts)_
2990
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_
2811
2991
 
2812
2992
  ## `csdx launch`
2813
2993
 
@@ -3105,7 +3285,7 @@ EXAMPLES
3105
3285
  $ csdx plugins
3106
3286
  ```
3107
3287
 
3108
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/index.ts)_
3288
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/index.ts)_
3109
3289
 
3110
3290
  ## `csdx plugins:install PLUGIN...`
3111
3291
 
@@ -3170,7 +3350,7 @@ EXAMPLES
3170
3350
  $ csdx plugins:inspect myplugin
3171
3351
  ```
3172
3352
 
3173
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/inspect.ts)_
3353
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/inspect.ts)_
3174
3354
 
3175
3355
  ## `csdx plugins:install PLUGIN...`
3176
3356
 
@@ -3210,7 +3390,7 @@ EXAMPLES
3210
3390
  $ csdx plugins:install someuser/someplugin
3211
3391
  ```
3212
3392
 
3213
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/install.ts)_
3393
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/install.ts)_
3214
3394
 
3215
3395
  ## `csdx plugins:link PLUGIN`
3216
3396
 
@@ -3239,7 +3419,7 @@ EXAMPLES
3239
3419
  $ csdx plugins:link myplugin
3240
3420
  ```
3241
3421
 
3242
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/link.ts)_
3422
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/link.ts)_
3243
3423
 
3244
3424
  ## `csdx plugins:uninstall PLUGIN...`
3245
3425
 
@@ -3287,7 +3467,7 @@ ALIASES
3287
3467
  $ csdx plugins:remove
3288
3468
  ```
3289
3469
 
3290
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/uninstall.ts)_
3470
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/uninstall.ts)_
3291
3471
 
3292
3472
  ## `csdx plugins:uninstall PLUGIN...`
3293
3473
 
@@ -3328,7 +3508,7 @@ DESCRIPTION
3328
3508
  Update installed plugins.
3329
3509
  ```
3330
3510
 
3331
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.3.2/src/commands/plugins/update.ts)_
3511
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.8.4/src/commands/plugins/update.ts)_
3332
3512
 
3333
3513
  ## `csdx tokens`
3334
3514
 
@@ -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.9.0",
2
+ "version": "1.10.0",
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.9.0",
4
+ "version": "1.10.0",
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.5.0",
27
- "@contentstack/cli-cm-bulk-publish": "~1.3.11",
28
- "@contentstack/cli-cm-clone": "~1.5.0",
29
- "@contentstack/cli-cm-export": "~1.9.0",
30
- "@contentstack/cli-cm-import": "~1.9.0",
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.5.0",
34
- "@contentstack/cli-command": "~1.2.12",
35
- "@contentstack/cli-config": "~1.4.11",
36
- "@contentstack/cli-launch": "~1.0.12",
37
- "@contentstack/cli-migration": "~1.3.13",
38
- "@contentstack/cli-utilities": "~1.5.2",
25
+ "@contentstack/cli-audit": "~1.2.0",
26
+ "@contentstack/cli-auth": "~1.3.15",
27
+ "@contentstack/cli-cm-bootstrap": "~1.6.0",
28
+ "@contentstack/cli-cm-branches": "~1.0.15",
29
+ "@contentstack/cli-cm-bulk-publish": "~1.3.13",
30
+ "@contentstack/cli-cm-clone": "~1.6.0",
31
+ "@contentstack/cli-cm-export": "~1.9.2",
32
+ "@contentstack/cli-cm-export-to-csv": "~1.4.4",
33
+ "@contentstack/cli-cm-import": "~1.10.0",
34
+ "@contentstack/cli-cm-migrate-rte": "~1.4.13",
35
+ "@contentstack/cli-cm-seed": "~1.6.0",
36
+ "@contentstack/cli-command": "~1.2.14",
37
+ "@contentstack/cli-config": "~1.4.13",
38
+ "@contentstack/cli-launch": "~1.0.13",
39
+ "@contentstack/cli-migration": "~1.3.14",
40
+ "@contentstack/cli-utilities": "~1.5.4",
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": [