@contentstack/cli-audit 2.0.0-beta → 2.0.0-beta.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Contentstack
3
+ Copyright (c) 2026 Contentstack
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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/2.0.0-beta linux-x64 node-v22.21.1
22
+ @contentstack/cli-audit/2.0.0-beta.2 linux-x64 node-v22.22.0
23
23
  $ csdx --help [COMMAND]
24
24
  USAGE
25
25
  $ csdx COMMAND
@@ -30,128 +30,9 @@ USAGE
30
30
  # Commands
31
31
 
32
32
  <!-- commands -->
33
- * [`csdx audit`](#csdx-audit)
34
- * [`csdx audit:fix`](#csdx-auditfix)
35
33
  * [`csdx cm:stacks:audit`](#csdx-cmstacksaudit)
36
34
  * [`csdx cm:stacks:audit:fix`](#csdx-cmstacksauditfix)
37
35
  * [`csdx help [COMMAND]`](#csdx-help-command)
38
- * [`csdx plugins`](#csdx-plugins)
39
- * [`csdx plugins:add PLUGIN`](#csdx-pluginsadd-plugin)
40
- * [`csdx plugins:inspect PLUGIN...`](#csdx-pluginsinspect-plugin)
41
- * [`csdx plugins:install PLUGIN`](#csdx-pluginsinstall-plugin)
42
- * [`csdx plugins:link PATH`](#csdx-pluginslink-path)
43
- * [`csdx plugins:remove [PLUGIN]`](#csdx-pluginsremove-plugin)
44
- * [`csdx plugins:reset`](#csdx-pluginsreset)
45
- * [`csdx plugins:uninstall [PLUGIN]`](#csdx-pluginsuninstall-plugin)
46
- * [`csdx plugins:unlink [PLUGIN]`](#csdx-pluginsunlink-plugin)
47
- * [`csdx plugins:update`](#csdx-pluginsupdate)
48
-
49
- ## `csdx audit`
50
-
51
- Perform audits and find possible errors in the exported Contentstack data
52
-
53
- ```
54
- USAGE
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
-
59
- FLAGS
60
- --modules=<option>... Provide the list of modules to be audited
61
- <options:
62
- content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules>
63
- --report-path=<value> Path to store the audit reports
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
-
70
- TABLE FLAGS
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.
79
-
80
- DESCRIPTION
81
- Perform audits and find possible errors in the exported Contentstack data
82
-
83
- ALIASES
84
- $ csdx audit
85
- $ csdx cm:stacks:audit
86
-
87
- EXAMPLES
88
- $ csdx audit
89
-
90
- $ csdx audit --report-path=<path>
91
-
92
- $ csdx audit --report-path=<path> --csv
93
-
94
- $ csdx audit --report-path=<path> --filter="name=<filter-value>"
95
-
96
- $ csdx audit --report-path=<path> --modules=content-types --filter="name="<filter-value>"
97
- ```
98
-
99
- ## `csdx audit:fix`
100
-
101
- Perform audits and fix possible errors in the exported Contentstack data.
102
-
103
- ```
104
- USAGE
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]
109
-
110
- FLAGS
111
- --copy-dir Create backup from the original data.
112
- --copy-path=<value> Provide the path to backup the copied data
113
- --fix-only=<option>... Provide the list of fix options
114
- <options: reference|global_field|json:rte|json:extension|blocks|group|content_types>
115
- --modules=<option>... Provide the list of modules to be audited
116
- <options:
117
- content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules>
118
- --report-path=<value> Path to store the audit reports
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
-
125
- TABLE FLAGS
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.
134
-
135
- DESCRIPTION
136
- Perform audits and fix possible errors in the exported Contentstack data.
137
-
138
- ALIASES
139
- $ csdx audit:fix
140
- $ csdx cm:stacks:audit:fix
141
-
142
- EXAMPLES
143
- $ csdx audit:fix --copy-dir
144
-
145
- $ csdx audit:fix --report-path=<path> --copy-dir
146
-
147
- $ csdx audit:fix --report-path=<path> --copy-dir --csv
148
-
149
- $ csdx audit:fix --fix-only=reference,global_field --copy-dir
150
-
151
- $ csdx audit:fix --report-path=<path> --filter="name=<filter-value>"
152
-
153
- $ csdx audit:fix --report-path=<path> --modules=content-types --filter="name="<filter-value>" --copy-dir --copy-path=<path>
154
- ```
155
36
 
156
37
  ## `csdx cm:stacks:audit`
157
38
 
@@ -160,13 +41,14 @@ Perform audits and find possible errors in the exported Contentstack data
160
41
  ```
161
42
  USAGE
162
43
  $ 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]
44
+ content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules|composable-studio...]
45
+ [--columns <value>] [--sort <value>] [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output
46
+ csv|json|yaml]
165
47
 
166
48
  FLAGS
167
49
  --modules=<option>... Provide the list of modules to be audited
168
- <options:
169
- content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules>
50
+ <options: content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-ru
51
+ les|composable-studio>
170
52
  --report-path=<value> Path to store the audit reports
171
53
 
172
54
  COMMON FLAGS
@@ -187,10 +69,6 @@ TABLE FLAGS
187
69
  DESCRIPTION
188
70
  Perform audits and find possible errors in the exported Contentstack data
189
71
 
190
- ALIASES
191
- $ csdx audit
192
- $ csdx cm:stacks:audit
193
-
194
72
  EXAMPLES
195
73
  $ csdx cm:stacks:audit
196
74
 
@@ -212,9 +90,10 @@ Perform audits and fix possible errors in the exported Contentstack data.
212
90
  ```
213
91
  USAGE
214
92
  $ 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]
93
+ content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules|composable-studio...]
94
+ [--copy-path <value> --copy-dir] [--fix-only
95
+ reference|global_field|json:rte|json:extension|blocks|group|content_types...] [--columns <value>] [--sort <value>]
96
+ [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output csv|json|yaml]
218
97
 
219
98
  FLAGS
220
99
  --copy-dir Create backup from the original data.
@@ -222,8 +101,8 @@ FLAGS
222
101
  --fix-only=<option>... Provide the list of fix options
223
102
  <options: reference|global_field|json:rte|json:extension|blocks|group|content_types>
224
103
  --modules=<option>... Provide the list of modules to be audited
225
- <options:
226
- content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules>
104
+ <options: content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-r
105
+ ules|composable-studio>
227
106
  --report-path=<value> Path to store the audit reports
228
107
 
229
108
  COMMON FLAGS
@@ -244,10 +123,6 @@ TABLE FLAGS
244
123
  DESCRIPTION
245
124
  Perform audits and fix possible errors in the exported Contentstack data.
246
125
 
247
- ALIASES
248
- $ csdx audit:fix
249
- $ csdx cm:stacks:audit:fix
250
-
251
126
  EXAMPLES
252
127
  $ csdx cm:stacks:audit:fix --copy-dir
253
128
 
@@ -282,295 +157,5 @@ DESCRIPTION
282
157
  Display help for csdx.
283
158
  ```
284
159
 
285
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
286
-
287
- ## `csdx plugins`
288
-
289
- List installed plugins.
290
-
291
- ```
292
- USAGE
293
- $ csdx plugins [--json] [--core]
294
-
295
- FLAGS
296
- --core Show core plugins.
297
-
298
- GLOBAL FLAGS
299
- --json Format output as json.
300
-
301
- DESCRIPTION
302
- List installed plugins.
303
-
304
- EXAMPLES
305
- $ csdx plugins
306
- ```
307
-
308
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/index.ts)_
309
-
310
- ## `csdx plugins:add PLUGIN`
311
-
312
- Installs a plugin into csdx.
313
-
314
- ```
315
- USAGE
316
- $ csdx plugins:add PLUGIN... [--json] [-f] [-h] [-s | -v]
317
-
318
- ARGUMENTS
319
- PLUGIN... Plugin to install.
320
-
321
- FLAGS
322
- -f, --force Force npm to fetch remote resources even if a local copy exists on disk.
323
- -h, --help Show CLI help.
324
- -s, --silent Silences npm output.
325
- -v, --verbose Show verbose npm output.
326
-
327
- GLOBAL FLAGS
328
- --json Format output as json.
329
-
330
- DESCRIPTION
331
- Installs a plugin into csdx.
332
-
333
- Uses npm to install plugins.
334
-
335
- Installation of a user-installed plugin will override a core plugin.
336
-
337
- Use the CSDX_NPM_LOG_LEVEL environment variable to set the npm loglevel.
338
- Use the CSDX_NPM_REGISTRY environment variable to set the npm registry.
339
-
340
- ALIASES
341
- $ csdx plugins:add
342
-
343
- EXAMPLES
344
- Install a plugin from npm registry.
345
-
346
- $ csdx plugins:add myplugin
347
-
348
- Install a plugin from a github url.
349
-
350
- $ csdx plugins:add https://github.com/someuser/someplugin
351
-
352
- Install a plugin from a github slug.
353
-
354
- $ csdx plugins:add someuser/someplugin
355
- ```
356
-
357
- ## `csdx plugins:inspect PLUGIN...`
358
-
359
- Displays installation properties of a plugin.
360
-
361
- ```
362
- USAGE
363
- $ csdx plugins:inspect PLUGIN...
364
-
365
- ARGUMENTS
366
- PLUGIN... [default: .] Plugin to inspect.
367
-
368
- FLAGS
369
- -h, --help Show CLI help.
370
- -v, --verbose
371
-
372
- GLOBAL FLAGS
373
- --json Format output as json.
374
-
375
- DESCRIPTION
376
- Displays installation properties of a plugin.
377
-
378
- EXAMPLES
379
- $ csdx plugins:inspect myplugin
380
- ```
381
-
382
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/inspect.ts)_
383
-
384
- ## `csdx plugins:install PLUGIN`
385
-
386
- Installs a plugin into csdx.
387
-
388
- ```
389
- USAGE
390
- $ csdx plugins:install PLUGIN... [--json] [-f] [-h] [-s | -v]
391
-
392
- ARGUMENTS
393
- PLUGIN... Plugin to install.
394
-
395
- FLAGS
396
- -f, --force Force npm to fetch remote resources even if a local copy exists on disk.
397
- -h, --help Show CLI help.
398
- -s, --silent Silences npm output.
399
- -v, --verbose Show verbose npm output.
400
-
401
- GLOBAL FLAGS
402
- --json Format output as json.
403
-
404
- DESCRIPTION
405
- Installs a plugin into csdx.
406
-
407
- Uses npm to install plugins.
408
-
409
- Installation of a user-installed plugin will override a core plugin.
410
-
411
- Use the CSDX_NPM_LOG_LEVEL environment variable to set the npm loglevel.
412
- Use the CSDX_NPM_REGISTRY environment variable to set the npm registry.
413
-
414
- ALIASES
415
- $ csdx plugins:add
416
-
417
- EXAMPLES
418
- Install a plugin from npm registry.
419
-
420
- $ csdx plugins:install myplugin
421
-
422
- Install a plugin from a github url.
423
-
424
- $ csdx plugins:install https://github.com/someuser/someplugin
425
-
426
- Install a plugin from a github slug.
427
-
428
- $ csdx plugins:install someuser/someplugin
429
- ```
430
-
431
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/install.ts)_
432
-
433
- ## `csdx plugins:link PATH`
434
-
435
- Links a plugin into the CLI for development.
436
-
437
- ```
438
- USAGE
439
- $ csdx plugins:link PATH [-h] [--install] [-v]
440
-
441
- ARGUMENTS
442
- PATH [default: .] path to plugin
443
-
444
- FLAGS
445
- -h, --help Show CLI help.
446
- -v, --verbose
447
- --[no-]install Install dependencies after linking the plugin.
448
-
449
- DESCRIPTION
450
- Links a plugin into the CLI for development.
451
-
452
- Installation of a linked plugin will override a user-installed or core plugin.
453
-
454
- e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
455
- command will override the user-installed or core plugin implementation. This is useful for development work.
456
-
457
-
458
- EXAMPLES
459
- $ csdx plugins:link myplugin
460
- ```
461
-
462
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/link.ts)_
463
-
464
- ## `csdx plugins:remove [PLUGIN]`
465
-
466
- Removes a plugin from the CLI.
467
-
468
- ```
469
- USAGE
470
- $ csdx plugins:remove [PLUGIN...] [-h] [-v]
471
-
472
- ARGUMENTS
473
- [PLUGIN...] plugin to uninstall
474
-
475
- FLAGS
476
- -h, --help Show CLI help.
477
- -v, --verbose
478
-
479
- DESCRIPTION
480
- Removes a plugin from the CLI.
481
-
482
- ALIASES
483
- $ csdx plugins:unlink
484
- $ csdx plugins:remove
485
-
486
- EXAMPLES
487
- $ csdx plugins:remove myplugin
488
- ```
489
-
490
- ## `csdx plugins:reset`
491
-
492
- Remove all user-installed and linked plugins.
493
-
494
- ```
495
- USAGE
496
- $ csdx plugins:reset [--hard] [--reinstall]
497
-
498
- FLAGS
499
- --hard Delete node_modules and package manager related files in addition to uninstalling plugins.
500
- --reinstall Reinstall all plugins after uninstalling.
501
- ```
502
-
503
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/reset.ts)_
504
-
505
- ## `csdx plugins:uninstall [PLUGIN]`
506
-
507
- Removes a plugin from the CLI.
508
-
509
- ```
510
- USAGE
511
- $ csdx plugins:uninstall [PLUGIN...] [-h] [-v]
512
-
513
- ARGUMENTS
514
- [PLUGIN...] plugin to uninstall
515
-
516
- FLAGS
517
- -h, --help Show CLI help.
518
- -v, --verbose
519
-
520
- DESCRIPTION
521
- Removes a plugin from the CLI.
522
-
523
- ALIASES
524
- $ csdx plugins:unlink
525
- $ csdx plugins:remove
526
-
527
- EXAMPLES
528
- $ csdx plugins:uninstall myplugin
529
- ```
530
-
531
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/uninstall.ts)_
532
-
533
- ## `csdx plugins:unlink [PLUGIN]`
534
-
535
- Removes a plugin from the CLI.
536
-
537
- ```
538
- USAGE
539
- $ csdx plugins:unlink [PLUGIN...] [-h] [-v]
540
-
541
- ARGUMENTS
542
- [PLUGIN...] plugin to uninstall
543
-
544
- FLAGS
545
- -h, --help Show CLI help.
546
- -v, --verbose
547
-
548
- DESCRIPTION
549
- Removes a plugin from the CLI.
550
-
551
- ALIASES
552
- $ csdx plugins:unlink
553
- $ csdx plugins:remove
554
-
555
- EXAMPLES
556
- $ csdx plugins:unlink myplugin
557
- ```
558
-
559
- ## `csdx plugins:update`
560
-
561
- Update installed plugins.
562
-
563
- ```
564
- USAGE
565
- $ csdx plugins:update [-h] [-v]
566
-
567
- FLAGS
568
- -h, --help Show CLI help.
569
- -v, --verbose
570
-
571
- DESCRIPTION
572
- Update installed plugins.
573
- ```
574
-
575
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/update.ts)_
160
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.37/src/commands/help.ts)_
576
161
  <!-- commandsstop -->
@@ -12,10 +12,6 @@ export declare abstract class AuditBaseCommand extends BaseCommand<typeof AuditB
12
12
  get: (row: any) => string;
13
13
  };
14
14
  };
15
- /**
16
- * Create audit context object similar to export command
17
- */
18
- private createAuditContext;
19
15
  /**
20
16
  * The `start` function performs an audit on content types, global fields, entries, and workflows and displays
21
17
  * any missing references.
@@ -43,6 +39,7 @@ export declare abstract class AuditBaseCommand extends BaseCommand<typeof AuditB
43
39
  missingEnvLocalesInEntries: Record<string, any> | undefined;
44
40
  missingFieldRules: Record<string, any> | undefined;
45
41
  missingMultipleFields: Record<string, any> | undefined;
42
+ missingRefsInComposableStudio: {} | undefined;
46
43
  }>;
47
44
  /**
48
45
  * The `promptQueue` function prompts the user to enter a data directory path if the `data-dir` flag
@@ -33,19 +33,6 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
33
33
  },
34
34
  };
35
35
  }
36
- /**
37
- * Create audit context object similar to export command
38
- */
39
- createAuditContext(moduleName) {
40
- var _a, _b, _c;
41
- return {
42
- command: ((_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.command) || 'cm:stacks:audit',
43
- module: moduleName || 'audit',
44
- email: cli_utilities_1.configHandler.get('email') || '',
45
- sessionId: ((_c = this.context) === null || _c === void 0 ? void 0 : _c.sessionId) || '',
46
- authenticationMethod: cli_utilities_1.configHandler.get('authenticationMethod') || '',
47
- };
48
- }
49
36
  /**
50
37
  * The `start` function performs an audit on content types, global fields, entries, and workflows and displays
51
38
  * any missing references.
@@ -62,10 +49,6 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
62
49
  cli_utilities_1.configHandler.set('log.showConsoleLogs', false);
63
50
  }
64
51
  cli_utilities_1.configHandler.set('log.progressSupportedModule', 'audit');
65
- // Initialize audit context
66
- this.auditContext = this.createAuditContext();
67
- cli_utilities_1.log.debug(`Starting audit command: ${command}`, this.auditContext);
68
- cli_utilities_1.log.info(`Starting audit command: ${command}`, this.auditContext);
69
52
  // Initialize global summary for progress tracking
70
53
  cli_utilities_1.CLIProgressManager.initializeGlobalSummary('AUDIT', '', 'Auditing content...');
71
54
  await this.promptQueue();
@@ -73,7 +56,7 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
73
56
  this.sharedConfig.reportPath = (0, path_1.resolve)(this.flags['report-path'] || process.cwd(), 'audit-report');
74
57
  cli_utilities_1.log.debug(`Data directory: ${this.flags['data-dir']}`, this.auditContext);
75
58
  cli_utilities_1.log.debug(`Report path: ${this.flags['report-path'] || process.cwd()}`, this.auditContext);
76
- const { missingCtRefs, missingGfRefs, missingEntryRefs, missingCtRefsInExtensions, missingCtRefsInWorkflow, missingSelectFeild, missingMandatoryFields, missingTitleFields, missingRefInCustomRoles, missingEnvLocalesInAssets, missingEnvLocalesInEntries, missingFieldRules, missingMultipleFields, } = await this.scanAndFix();
59
+ const { missingCtRefs, missingGfRefs, missingEntryRefs, missingCtRefsInExtensions, missingCtRefsInWorkflow, missingSelectFeild, missingMandatoryFields, missingTitleFields, missingRefInCustomRoles, missingEnvLocalesInAssets, missingEnvLocalesInEntries, missingFieldRules, missingMultipleFields, missingRefsInComposableStudio, } = await this.scanAndFix();
77
60
  if (this.flags['show-console-output']) {
78
61
  this.showOutputOnScreen([
79
62
  { module: 'Content types', missingRefs: missingCtRefs },
@@ -100,6 +83,7 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
100
83
  this.showOutputOnScreenWorkflowsAndExtension([
101
84
  { module: 'Entries Changed Multiple Fields', missingRefs: missingMultipleFields },
102
85
  ]);
86
+ this.showOutputOnScreenWorkflowsAndExtension([{ module: 'Studio', missingRefs: missingRefsInComposableStudio }]);
103
87
  }
104
88
  this.showOutputOnScreenWorkflowsAndExtension([{ module: 'Summary', missingRefs: this.summaryDataToPrint }]);
105
89
  if (!(0, isEmpty_1.default)(missingCtRefs) ||
@@ -113,7 +97,8 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
113
97
  !(0, isEmpty_1.default)(missingEnvLocalesInAssets) ||
114
98
  !(0, isEmpty_1.default)(missingEnvLocalesInEntries) ||
115
99
  !(0, isEmpty_1.default)(missingFieldRules) ||
116
- !(0, isEmpty_1.default)(missingMultipleFields)) {
100
+ !(0, isEmpty_1.default)(missingMultipleFields) ||
101
+ !(0, isEmpty_1.default)(missingRefsInComposableStudio)) {
117
102
  if (this.currentCommand === 'cm:stacks:audit') {
118
103
  cli_utilities_1.log.warn(this.$t(messages_1.auditMsg.FINAL_REPORT_PATH, { path: this.sharedConfig.reportPath }), this.auditContext);
119
104
  }
@@ -144,7 +129,8 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
144
129
  !(0, isEmpty_1.default)(missingRefInCustomRoles) ||
145
130
  !(0, isEmpty_1.default)(missingEnvLocalesInAssets) ||
146
131
  !(0, isEmpty_1.default)(missingEnvLocalesInEntries) ||
147
- !(0, isEmpty_1.default)(missingFieldRules));
132
+ !(0, isEmpty_1.default)(missingFieldRules) ||
133
+ !(0, isEmpty_1.default)(missingRefsInComposableStudio));
148
134
  }
149
135
  /**
150
136
  * The `scan` function performs an audit on different modules (content-types, global-fields, and
@@ -157,7 +143,7 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
157
143
  cli_utilities_1.log.debug('Starting scan and fix process', this.auditContext);
158
144
  let { ctSchema, gfSchema } = this.getCtAndGfSchema();
159
145
  cli_utilities_1.log.info(`Retrieved ${(ctSchema === null || ctSchema === void 0 ? void 0 : ctSchema.length) || 0} content types and ${(gfSchema === null || gfSchema === void 0 ? void 0 : gfSchema.length) || 0} global fields`, this.auditContext);
160
- let missingCtRefs, missingGfRefs, missingEntryRefs, missingCtRefsInExtensions, missingCtRefsInWorkflow, missingSelectFeild, missingEntry = {}, missingMandatoryFields, missingTitleFields, missingRefInCustomRoles, missingEnvLocalesInAssets, missingEnvLocalesInEntries, missingFieldRules, missingMultipleFields;
146
+ let missingCtRefs, missingGfRefs, missingEntryRefs, missingCtRefsInExtensions, missingCtRefsInWorkflow, missingSelectFeild, missingEntry = {}, missingMandatoryFields, missingTitleFields, missingRefInCustomRoles, missingEnvLocalesInAssets, missingEnvLocalesInEntries, missingFieldRules, missingMultipleFields, missingRefsInComposableStudio;
161
147
  const constructorParam = {
162
148
  ctSchema,
163
149
  gfSchema,
@@ -171,7 +157,7 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
171
157
  const showConsoleLogs = (_a = logConfig.showConsoleLogs) !== null && _a !== void 0 ? _a : true;
172
158
  for (const module of this.sharedConfig.flags.modules || this.sharedConfig.modules) {
173
159
  // Update audit context with current module
174
- this.auditContext = this.createAuditContext(module);
160
+ this.auditContext = { module: module };
175
161
  cli_utilities_1.log.debug(`Starting audit for module: ${module}`, this.auditContext);
176
162
  cli_utilities_1.log.info(`Starting audit for module: ${module}`, this.auditContext);
177
163
  // Only show spinner message if console logs are enabled (compatible with line-by-line logs)
@@ -270,6 +256,13 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
270
256
  this.getAffectedData('field-rules', dataModuleWise['content-types'], missingFieldRules);
271
257
  cli_utilities_1.log.success(`Field-rules audit completed. Found ${Object.keys(missingFieldRules || {}).length} issues`, this.auditContext);
272
258
  break;
259
+ case 'composable-studio':
260
+ cli_utilities_1.log.info('Executing composable-studio audit', this.auditContext);
261
+ missingRefsInComposableStudio = await new modules_1.ComposableStudio((0, cloneDeep_1.default)(constructorParam)).run();
262
+ await this.prepareReport(module, missingRefsInComposableStudio);
263
+ this.getAffectedData('composable-studio', dataModuleWise['composable-studio'] || { Total: Object.keys(missingRefsInComposableStudio || {}).length }, missingRefsInComposableStudio);
264
+ cli_utilities_1.log.success(`Composable-studio audit completed. Found ${Object.keys(missingRefsInComposableStudio || {}).length} issues`, this.auditContext);
265
+ break;
273
266
  }
274
267
  // Only show completion message if console logs are enabled
275
268
  if (showConsoleLogs) {
@@ -304,6 +297,7 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
304
297
  missingEnvLocalesInEntries,
305
298
  missingFieldRules,
306
299
  missingMultipleFields,
300
+ missingRefsInComposableStudio,
307
301
  };
308
302
  }
309
303
  /**
@@ -2,7 +2,6 @@ import { FlagInput } from '@contentstack/cli-utilities';
2
2
  import { ConfigType } from '../../../../types';
3
3
  import { AuditBaseCommand } from '../../../../audit-base-command';
4
4
  export default class AuditFix extends AuditBaseCommand {
5
- static aliases: string[];
6
5
  static description: string;
7
6
  static examples: string[];
8
7
  static flags: FlagInput;
@@ -27,7 +27,6 @@ class AuditFix extends audit_base_command_1.AuditBaseCommand {
27
27
  }
28
28
  }
29
29
  }
30
- AuditFix.aliases = ['audit:fix', 'cm:stacks:audit:fix'];
31
30
  AuditFix.description = messages_1.auditFixMsg.AUDIT_FIX_CMD_DESCRIPTION;
32
31
  AuditFix.examples = [
33
32
  '$ <%= config.bin %> <%= command.id %> --copy-dir',
@@ -1,7 +1,6 @@
1
1
  import { FlagInput } from '@contentstack/cli-utilities';
2
2
  import { AuditBaseCommand } from '../../../../audit-base-command';
3
3
  export default class Audit extends AuditBaseCommand {
4
- static aliases: string[];
5
4
  static description: string;
6
5
  static examples: string[];
7
6
  static flags: FlagInput;
@@ -22,7 +22,6 @@ class Audit extends audit_base_command_1.AuditBaseCommand {
22
22
  }
23
23
  }
24
24
  }
25
- Audit.aliases = ['audit', 'cm:stacks:audit'];
26
25
  Audit.description = messages_1.auditMsg.AUDIT_CMD_DESCRIPTION;
27
26
  Audit.examples = [
28
27
  '$ <%= config.bin %> <%= command.id %>',
@@ -51,6 +51,11 @@ declare const config: {
51
51
  dirName: string;
52
52
  fileName: string;
53
53
  };
54
+ 'composable-studio': {
55
+ name: string;
56
+ dirName: string;
57
+ fileName: string;
58
+ };
54
59
  };
55
60
  entries: {
56
61
  systemKeys: string[];