@contentstack/cli-audit 1.10.0 → 1.12.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
@@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
19
19
  $ csdx COMMAND
20
20
  running command...
21
21
  $ csdx (--version|-v)
22
- @contentstack/cli-audit/1.10.0 linux-x64 node-v22.14.0
22
+ @contentstack/cli-audit/1.12.0 linux-x64 node-v22.14.0
23
23
  $ csdx --help [COMMAND]
24
24
  USAGE
25
25
  $ csdx COMMAND
@@ -34,7 +34,7 @@ USAGE
34
34
  * [`csdx audit:fix`](#csdx-auditfix)
35
35
  * [`csdx cm:stacks:audit`](#csdx-cmstacksaudit)
36
36
  * [`csdx cm:stacks:audit:fix`](#csdx-cmstacksauditfix)
37
- * [`csdx help [COMMANDS]`](#csdx-help-commands)
37
+ * [`csdx help [COMMAND]`](#csdx-help-command)
38
38
  * [`csdx plugins`](#csdx-plugins)
39
39
  * [`csdx plugins:add PLUGIN`](#csdx-pluginsadd-plugin)
40
40
  * [`csdx plugins:inspect PLUGIN...`](#csdx-pluginsinspect-plugin)
@@ -52,21 +52,30 @@ Perform audits and find possible errors in the exported Contentstack data
52
52
 
53
53
  ```
54
54
  USAGE
55
- $ csdx audit [--report-path <value>] [--modules
56
- content-types|global-fields|entries|extensions|workflows|custom-roles|assets] [--columns <value> | ] [--sort
57
- <value>] [--filter <value>] [--csv | --no-truncate]
55
+ $ csdx audit [-c <value>] [-d <value>] [--show-console-output] [--report-path <value>] [--modules
56
+ content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules...] [--columns <value>]
57
+ [--sort <value>] [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output csv|json|yaml]
58
58
 
59
59
  FLAGS
60
60
  --modules=<option>... Provide the list of modules to be audited
61
- <options: content-types|global-fields|entries|extensions|workflows|custom-roles|assets>
61
+ <options:
62
+ content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules>
62
63
  --report-path=<value> Path to store the audit reports
63
64
 
65
+ COMMON FLAGS
66
+ -c, --config=<value> Path of the external config
67
+ -d, --data-dir=<value> Path where the data is stored
68
+ --show-console-output Display the audit and audit fix result for individual modules
69
+
64
70
  TABLE FLAGS
65
- --columns=<value> Show only the specified columns (comma-separated)
66
- --csv The output is in the CSV format [alias: --output=csv]
67
- --filter=<value> Filter property by partial string matching. For example: name=foo
68
- --no-truncate The output is not truncated to fit the screen
69
- --sort=<value> Property to sort by (prepend '-' for descending)
71
+ --columns=<value> Specify columns to display, comma-separated.
72
+ --csv Output results in CSV format.
73
+ --filter=<value> Filter rows by a column value (e.g., name=foo).
74
+ --no-header Hide table headers in output.
75
+ --no-truncate Prevent truncation of long text in columns.
76
+ --output=<option> Specify output format: csv, json, or yaml.
77
+ <options: csv|json|yaml>
78
+ --sort=<value> Sort the table by a column. Use "-" for descending.
70
79
 
71
80
  DESCRIPTION
72
81
  Perform audits and find possible errors in the exported Contentstack data
@@ -93,10 +102,10 @@ Perform audits and fix possible errors in the exported Contentstack data.
93
102
 
94
103
  ```
95
104
  USAGE
96
- $ csdx audit:fix [--report-path <value>] [--modules
97
- content-types|global-fields|entries|extensions|workflows|custom-roles|assets] [--copy-path <value> --copy-dir]
98
- [--fix-only reference|global_field|json:rte|json:extension|blocks|group|content_types] [--columns <value> | ]
99
- [--sort <value>] [--filter <value>] [--csv | --no-truncate]
105
+ $ csdx audit:fix [-c <value>] [-d <value>] [--show-console-output] [--report-path <value>] [--modules
106
+ content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules...] [--copy-path <value>
107
+ --copy-dir] [--fix-only reference|global_field|json:rte|json:extension|blocks|group|content_types...] [--columns
108
+ <value>] [--sort <value>] [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output csv|json|yaml]
100
109
 
101
110
  FLAGS
102
111
  --copy-dir Create backup from the original data.
@@ -104,15 +113,24 @@ FLAGS
104
113
  --fix-only=<option>... Provide the list of fix options
105
114
  <options: reference|global_field|json:rte|json:extension|blocks|group|content_types>
106
115
  --modules=<option>... Provide the list of modules to be audited
107
- <options: content-types|global-fields|entries|extensions|workflows|custom-roles|assets>
116
+ <options:
117
+ content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules>
108
118
  --report-path=<value> Path to store the audit reports
109
119
 
120
+ COMMON FLAGS
121
+ -c, --config=<value> Path of the external config
122
+ -d, --data-dir=<value> Path where the data is stored
123
+ --show-console-output Display the audit and audit fix result for individual modules
124
+
110
125
  TABLE FLAGS
111
- --columns=<value> Show only the specified columns (comma-separated)
112
- --csv The output is in the CSV format [alias: --output=csv]
113
- --filter=<value> Filter property by partial string matching. For example: name=foo
114
- --no-truncate The output is not truncated to fit the screen
115
- --sort=<value> Property to sort by (prepend '-' for descending)
126
+ --columns=<value> Specify columns to display, comma-separated.
127
+ --csv Output results in CSV format.
128
+ --filter=<value> Filter rows by a column value (e.g., name=foo).
129
+ --no-header Hide table headers in output.
130
+ --no-truncate Prevent truncation of long text in columns.
131
+ --output=<option> Specify output format: csv, json, or yaml.
132
+ <options: csv|json|yaml>
133
+ --sort=<value> Sort the table by a column. Use "-" for descending.
116
134
 
117
135
  DESCRIPTION
118
136
  Perform audits and fix possible errors in the exported Contentstack data.
@@ -141,21 +159,30 @@ Perform audits and find possible errors in the exported Contentstack data
141
159
 
142
160
  ```
143
161
  USAGE
144
- $ csdx cm:stacks:audit [--report-path <value>] [--modules
145
- content-types|global-fields|entries|extensions|workflows|custom-roles|assets] [--columns <value> | ] [--sort
146
- <value>] [--filter <value>] [--csv | --no-truncate]
162
+ $ csdx cm:stacks:audit [-c <value>] [-d <value>] [--show-console-output] [--report-path <value>] [--modules
163
+ content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules...] [--columns <value>]
164
+ [--sort <value>] [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output csv|json|yaml]
147
165
 
148
166
  FLAGS
149
167
  --modules=<option>... Provide the list of modules to be audited
150
- <options: content-types|global-fields|entries|extensions|workflows|custom-roles|assets>
168
+ <options:
169
+ content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules>
151
170
  --report-path=<value> Path to store the audit reports
152
171
 
172
+ COMMON FLAGS
173
+ -c, --config=<value> Path of the external config
174
+ -d, --data-dir=<value> Path where the data is stored
175
+ --show-console-output Display the audit and audit fix result for individual modules
176
+
153
177
  TABLE FLAGS
154
- --columns=<value> Show only the specified columns (comma-separated)
155
- --csv The output is in the CSV format [alias: --output=csv]
156
- --filter=<value> Filter property by partial string matching. For example: name=foo
157
- --no-truncate The output is not truncated to fit the screen
158
- --sort=<value> Property to sort by (prepend '-' for descending)
178
+ --columns=<value> Specify columns to display, comma-separated.
179
+ --csv Output results in CSV format.
180
+ --filter=<value> Filter rows by a column value (e.g., name=foo).
181
+ --no-header Hide table headers in output.
182
+ --no-truncate Prevent truncation of long text in columns.
183
+ --output=<option> Specify output format: csv, json, or yaml.
184
+ <options: csv|json|yaml>
185
+ --sort=<value> Sort the table by a column. Use "-" for descending.
159
186
 
160
187
  DESCRIPTION
161
188
  Perform audits and find possible errors in the exported Contentstack data
@@ -184,10 +211,10 @@ Perform audits and fix possible errors in the exported Contentstack data.
184
211
 
185
212
  ```
186
213
  USAGE
187
- $ csdx cm:stacks:audit:fix [--report-path <value>] [--modules
188
- content-types|global-fields|entries|extensions|workflows|custom-roles|assets] [--copy-path <value> --copy-dir]
189
- [--fix-only reference|global_field|json:rte|json:extension|blocks|group|content_types] [--columns <value> | ]
190
- [--sort <value>] [--filter <value>] [--csv | --no-truncate]
214
+ $ csdx cm:stacks:audit:fix [-c <value>] [-d <value>] [--show-console-output] [--report-path <value>] [--modules
215
+ content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules...] [--copy-path <value>
216
+ --copy-dir] [--fix-only reference|global_field|json:rte|json:extension|blocks|group|content_types...] [--columns
217
+ <value>] [--sort <value>] [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output csv|json|yaml]
191
218
 
192
219
  FLAGS
193
220
  --copy-dir Create backup from the original data.
@@ -195,15 +222,24 @@ FLAGS
195
222
  --fix-only=<option>... Provide the list of fix options
196
223
  <options: reference|global_field|json:rte|json:extension|blocks|group|content_types>
197
224
  --modules=<option>... Provide the list of modules to be audited
198
- <options: content-types|global-fields|entries|extensions|workflows|custom-roles|assets>
225
+ <options:
226
+ content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules>
199
227
  --report-path=<value> Path to store the audit reports
200
228
 
229
+ COMMON FLAGS
230
+ -c, --config=<value> Path of the external config
231
+ -d, --data-dir=<value> Path where the data is stored
232
+ --show-console-output Display the audit and audit fix result for individual modules
233
+
201
234
  TABLE FLAGS
202
- --columns=<value> Show only the specified columns (comma-separated)
203
- --csv The output is in the CSV format [alias: --output=csv]
204
- --filter=<value> Filter property by partial string matching. For example: name=foo
205
- --no-truncate The output is not truncated to fit the screen
206
- --sort=<value> Property to sort by (prepend '-' for descending)
235
+ --columns=<value> Specify columns to display, comma-separated.
236
+ --csv Output results in CSV format.
237
+ --filter=<value> Filter rows by a column value (e.g., name=foo).
238
+ --no-header Hide table headers in output.
239
+ --no-truncate Prevent truncation of long text in columns.
240
+ --output=<option> Specify output format: csv, json, or yaml.
241
+ <options: csv|json|yaml>
242
+ --sort=<value> Sort the table by a column. Use "-" for descending.
207
243
 
208
244
  DESCRIPTION
209
245
  Perform audits and fix possible errors in the exported Contentstack data.
@@ -228,16 +264,16 @@ EXAMPLES
228
264
 
229
265
  _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)_
230
266
 
231
- ## `csdx help [COMMANDS]`
267
+ ## `csdx help [COMMAND]`
232
268
 
233
269
  Display help for csdx.
234
270
 
235
271
  ```
236
272
  USAGE
237
- $ csdx help [COMMANDS] [-n]
273
+ $ csdx help [COMMAND...] [-n]
238
274
 
239
275
  ARGUMENTS
240
- COMMANDS Command to show help for.
276
+ COMMAND... Command to show help for.
241
277
 
242
278
  FLAGS
243
279
  -n, --nested-commands Include all nested commands in the output.
@@ -246,7 +282,7 @@ DESCRIPTION
246
282
  Display help for csdx.
247
283
  ```
248
284
 
249
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_
285
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.27/src/commands/help.ts)_
250
286
 
251
287
  ## `csdx plugins`
252
288
 
@@ -277,10 +313,10 @@ Installs a plugin into csdx.
277
313
 
278
314
  ```
279
315
  USAGE
280
- $ csdx plugins:add PLUGIN [--json] [-f] [-h] [-s | -v]
316
+ $ csdx plugins:add PLUGIN... [--json] [-f] [-h] [-s | -v]
281
317
 
282
318
  ARGUMENTS
283
- PLUGIN Plugin to install.
319
+ PLUGIN... Plugin to install.
284
320
 
285
321
  FLAGS
286
322
  -f, --force Force npm to fetch remote resources even if a local copy exists on disk.
@@ -327,7 +363,7 @@ USAGE
327
363
  $ csdx plugins:inspect PLUGIN...
328
364
 
329
365
  ARGUMENTS
330
- PLUGIN [default: .] Plugin to inspect.
366
+ PLUGIN... [default: .] Plugin to inspect.
331
367
 
332
368
  FLAGS
333
369
  -h, --help Show CLI help.
@@ -351,10 +387,10 @@ Installs a plugin into csdx.
351
387
 
352
388
  ```
353
389
  USAGE
354
- $ csdx plugins:install PLUGIN [--json] [-f] [-h] [-s | -v]
390
+ $ csdx plugins:install PLUGIN... [--json] [-f] [-h] [-s | -v]
355
391
 
356
392
  ARGUMENTS
357
- PLUGIN Plugin to install.
393
+ PLUGIN... Plugin to install.
358
394
 
359
395
  FLAGS
360
396
  -f, --force Force npm to fetch remote resources even if a local copy exists on disk.
@@ -406,9 +442,9 @@ ARGUMENTS
406
442
  PATH [default: .] path to plugin
407
443
 
408
444
  FLAGS
409
- -h, --help Show CLI help.
445
+ -h, --help Show CLI help.
410
446
  -v, --verbose
411
- --[no-]install Install dependencies after linking the plugin.
447
+ --[no-]install Install dependencies after linking the plugin.
412
448
 
413
449
  DESCRIPTION
414
450
  Links a plugin into the CLI for development.
@@ -431,10 +467,10 @@ Removes a plugin from the CLI.
431
467
 
432
468
  ```
433
469
  USAGE
434
- $ csdx plugins:remove [PLUGIN] [-h] [-v]
470
+ $ csdx plugins:remove [PLUGIN...] [-h] [-v]
435
471
 
436
472
  ARGUMENTS
437
- PLUGIN plugin to uninstall
473
+ PLUGIN... plugin to uninstall
438
474
 
439
475
  FLAGS
440
476
  -h, --help Show CLI help.
@@ -472,10 +508,10 @@ Removes a plugin from the CLI.
472
508
 
473
509
  ```
474
510
  USAGE
475
- $ csdx plugins:uninstall [PLUGIN] [-h] [-v]
511
+ $ csdx plugins:uninstall [PLUGIN...] [-h] [-v]
476
512
 
477
513
  ARGUMENTS
478
- PLUGIN plugin to uninstall
514
+ PLUGIN... plugin to uninstall
479
515
 
480
516
  FLAGS
481
517
  -h, --help Show CLI help.
@@ -500,10 +536,10 @@ Removes a plugin from the CLI.
500
536
 
501
537
  ```
502
538
  USAGE
503
- $ csdx plugins:unlink [PLUGIN] [-h] [-v]
539
+ $ csdx plugins:unlink [PLUGIN...] [-h] [-v]
504
540
 
505
541
  ARGUMENTS
506
- PLUGIN plugin to uninstall
542
+ PLUGIN... plugin to uninstall
507
543
 
508
544
  FLAGS
509
545
  -h, --help Show CLI help.
@@ -3,6 +3,7 @@ import { BaseCommand } from './base-command';
3
3
  import { CommandNames, ContentTypeStruct } from './types';
4
4
  export declare abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseCommand> {
5
5
  private currentCommand;
6
+ private readonly summaryDataToPrint;
6
7
  get fixStatus(): {
7
8
  fixStatus: {
8
9
  minWidth: number;
@@ -24,8 +25,8 @@ export declare abstract class AuditBaseCommand extends BaseCommand<typeof AuditB
24
25
  * and `missingEntryRefs`.
25
26
  */
26
27
  scanAndFix(): Promise<{
27
- missingCtRefs: Record<string, any> | undefined;
28
- missingGfRefs: Record<string, any> | undefined;
28
+ missingCtRefs: Record<string, any> | ContentTypeStruct[] | undefined;
29
+ missingGfRefs: Record<string, any> | ContentTypeStruct[] | undefined;
29
30
  missingEntryRefs: Record<string, any> | undefined;
30
31
  missingCtRefsInExtensions: {} | undefined;
31
32
  missingCtRefsInWorkflow: {} | undefined;
@@ -33,8 +34,9 @@ export declare abstract class AuditBaseCommand extends BaseCommand<typeof AuditB
33
34
  missingMandatoryFields: Record<string, any> | undefined;
34
35
  missingTitleFields: Record<string, any> | undefined;
35
36
  missingRefInCustomRoles: {} | undefined;
36
- missingEnvLocalesInAssets: Record<string, any> | undefined;
37
+ missingEnvLocalesInAssets: Record<string, any> | ContentTypeStruct[] | undefined;
37
38
  missingEnvLocalesInEntries: Record<string, any> | undefined;
39
+ missingFieldRules: Record<string, any> | undefined;
38
40
  missingMultipleFields: Record<string, any> | undefined;
39
41
  }>;
40
42
  /**
@@ -81,7 +83,7 @@ export declare abstract class AuditBaseCommand extends BaseCommand<typeof AuditB
81
83
  * reference name and the value represents additional information about the missing reference.
82
84
  * @returns The function `prepareReport` returns a Promise that resolves to `void`.
83
85
  */
84
- prepareReport(moduleName: keyof typeof config.moduleConfig | keyof typeof config.ReportTitleForEntries, listOfMissingRefs: Record<string, any>): Promise<void>;
86
+ prepareReport(moduleName: keyof typeof config.moduleConfig | keyof typeof config.ReportTitleForEntries | 'field-rules' | 'Summary', listOfMissingRefs: Record<string, any>): Promise<void>;
85
87
  /**
86
88
  * The function `prepareCSV` takes a module name and a list of missing references, and generates a
87
89
  * CSV file with the specified columns and filtered rows.
@@ -92,5 +94,6 @@ export declare abstract class AuditBaseCommand extends BaseCommand<typeof AuditB
92
94
  * corresponding value is an array of objects that contain details about the missing reference.
93
95
  * @returns The function `prepareCSV` returns a Promise that resolves to `void`.
94
96
  */
95
- prepareCSV(moduleName: keyof typeof config.moduleConfig | keyof typeof config.ReportTitleForEntries, listOfMissingRefs: Record<string, any>): Promise<void>;
97
+ prepareCSV(moduleName: keyof typeof config.moduleConfig | keyof typeof config.ReportTitleForEntries | 'field-rules' | 'Summary', listOfMissingRefs: Record<string, any>): Promise<void>;
98
+ getAffectedData(module: string, dataExported: Record<string, any>, listOfMissingRefs: Record<string, any>, isFixable?: boolean): void;
96
99
  }