@contentstack/cli-audit 1.6.2 → 1.6.4

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.6.2 linux-x64 node-v18.20.3
22
+ @contentstack/cli-audit/1.6.4 linux-x64 node-v18.20.4
23
23
  $ csdx --help [COMMAND]
24
24
  USAGE
25
25
  $ csdx COMMAND
@@ -267,7 +267,7 @@ EXAMPLES
267
267
  $ csdx plugins
268
268
  ```
269
269
 
270
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/index.ts)_
270
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.9/src/commands/plugins/index.ts)_
271
271
 
272
272
  ## `csdx plugins:add PLUGIN`
273
273
 
@@ -292,7 +292,7 @@ GLOBAL FLAGS
292
292
  DESCRIPTION
293
293
  Installs a plugin into csdx.
294
294
 
295
- Uses bundled npm executable to install plugins into /home/runner/.local/share/@contentstack/cli-audit
295
+ Uses npm to install plugins.
296
296
 
297
297
  Installation of a user-installed plugin will override a core plugin.
298
298
 
@@ -341,7 +341,7 @@ EXAMPLES
341
341
  $ csdx plugins:inspect myplugin
342
342
  ```
343
343
 
344
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/inspect.ts)_
344
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.9/src/commands/plugins/inspect.ts)_
345
345
 
346
346
  ## `csdx plugins:install PLUGIN`
347
347
 
@@ -366,7 +366,7 @@ GLOBAL FLAGS
366
366
  DESCRIPTION
367
367
  Installs a plugin into csdx.
368
368
 
369
- Uses bundled npm executable to install plugins into /home/runner/.local/share/@contentstack/cli-audit
369
+ Uses npm to install plugins.
370
370
 
371
371
  Installation of a user-installed plugin will override a core plugin.
372
372
 
@@ -390,7 +390,7 @@ EXAMPLES
390
390
  $ csdx plugins:install someuser/someplugin
391
391
  ```
392
392
 
393
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/install.ts)_
393
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.9/src/commands/plugins/install.ts)_
394
394
 
395
395
  ## `csdx plugins:link PATH`
396
396
 
@@ -420,7 +420,7 @@ EXAMPLES
420
420
  $ csdx plugins:link myplugin
421
421
  ```
422
422
 
423
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/link.ts)_
423
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.9/src/commands/plugins/link.ts)_
424
424
 
425
425
  ## `csdx plugins:remove [PLUGIN]`
426
426
 
@@ -461,7 +461,7 @@ FLAGS
461
461
  --reinstall Reinstall all plugins after uninstalling.
462
462
  ```
463
463
 
464
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/reset.ts)_
464
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.9/src/commands/plugins/reset.ts)_
465
465
 
466
466
  ## `csdx plugins:uninstall [PLUGIN]`
467
467
 
@@ -489,7 +489,7 @@ EXAMPLES
489
489
  $ csdx plugins:uninstall myplugin
490
490
  ```
491
491
 
492
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/uninstall.ts)_
492
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.9/src/commands/plugins/uninstall.ts)_
493
493
 
494
494
  ## `csdx plugins:unlink [PLUGIN]`
495
495
 
@@ -533,5 +533,5 @@ DESCRIPTION
533
533
  Update installed plugins.
534
534
  ```
535
535
 
536
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/update.ts)_
536
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.9/src/commands/plugins/update.ts)_
537
537
  <!-- commandsstop -->
@@ -49,8 +49,8 @@ const auditFixMsg = {
49
49
  EMPTY_FIX_MSG: 'Successfully removed the empty field/block found at {path} from the schema.',
50
50
  AUDIT_FIX_CMD_DESCRIPTION: 'Perform audits and fix possible errors in the exported Contentstack data.',
51
51
  WF_FIX_MSG: 'Successfully removed the workflow {uid} named {name}.',
52
- ENTRY_MANDATORY_FIELD_FIX: `Removing the publish details from entry uid '{uid}' from locale '{locale}'`,
53
- ENTRY_SELECT_FIELD_FIX: `Adding the value '{value}' in select field of uid '{uid}'`
52
+ ENTRY_MANDATORY_FIELD_FIX: `Removing the publish details from the entry with UID '{uid}' in Locale '{locale}'...`,
53
+ ENTRY_SELECT_FIELD_FIX: `Adding the value '{value}' in the select field of entry UID '{uid}'...`
54
54
  };
55
55
  exports.auditFixMsg = auditFixMsg;
56
56
  const messages = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, errors), commonMsg), auditMsg), auditFixMsg), tableColumnDescriptions);
@@ -18,7 +18,6 @@ export default class Entries {
18
18
  protected missingMandatoryFields: Record<string, any>;
19
19
  entryMetaData: Record<string, any>[];
20
20
  moduleName: keyof typeof auditConfig.moduleConfig;
21
- isEntryWithoutTitleField: boolean;
22
21
  constructor({ log, fix, config, moduleName, ctSchema, gfSchema }: ModuleConstructorParam & CtConstructorParam);
23
22
  validateModules(moduleName: keyof typeof auditConfig.moduleConfig, moduleConfig: Record<string, unknown>): keyof typeof auditConfig.moduleConfig;
24
23
  /**
@@ -20,7 +20,6 @@ class Entries {
20
20
  this.missingMandatoryFields = {};
21
21
  this.entryMetaData = [];
22
22
  this.moduleName = 'entries';
23
- this.isEntryWithoutTitleField = false;
24
23
  this.log = log;
25
24
  this.config = config;
26
25
  this.fix = fix !== null && fix !== void 0 ? fix : false;
@@ -42,6 +41,7 @@ class Entries {
42
41
  * @returns the `missingRefs` object.
43
42
  */
44
43
  async run() {
44
+ var _a;
45
45
  if (!(0, fs_1.existsSync)(this.folderPath)) {
46
46
  this.log(`Skipping ${this.moduleName} audit`, 'warn');
47
47
  this.log((0, messages_1.$t)(messages_1.auditMsg.NOT_VALID_PATH, { path: this.folderPath }), { color: 'yellow' });
@@ -76,7 +76,7 @@ class Entries {
76
76
  }
77
77
  this.lookForReference([{ locale: code, uid, name: title }], ctSchema, this.entries[entryUid]);
78
78
  const fields = this.missingMandatoryFields[uid];
79
- const isPublished = entry.publish_details.length > 0;
79
+ const isPublished = ((_a = entry.publish_details) === null || _a === void 0 ? void 0 : _a.length) > 0;
80
80
  if ((this.fix && fields.length && isPublished) || (!this.fix && fields)) {
81
81
  const fixStatus = this.fix ? 'Fixed' : '';
82
82
  fields === null || fields === void 0 ? void 0 : fields.forEach((field) => {
@@ -983,21 +983,16 @@ class Entries {
983
983
  for (const entryUid in entries) {
984
984
  let { title } = entries[entryUid];
985
985
  if (entries[entryUid].hasOwnProperty('title') && !title) {
986
- this.isEntryWithoutTitleField = true;
987
986
  this.log(`The 'title' field in Entry with UID '${entryUid}' of Content Type '${uid}' in Locale '${code}' is empty.`, `error`);
988
987
  }
989
988
  else if (!title) {
990
- this.isEntryWithoutTitleField = true;
991
- this.log(`Entry with UID '${entryUid}' of Content Type '${uid}' in Locale '${code}' does not have a 'title' field.`, `error`);
989
+ this.log(`The 'title' field in Entry with UID '${entryUid}' of Content Type '${uid}' in Locale '${code}' is empty.`, `error`);
992
990
  }
993
991
  this.entryMetaData.push({ uid: entryUid, title });
994
992
  }
995
993
  }
996
994
  }
997
995
  }
998
- if (this.isEntryWithoutTitleField) {
999
- // throw Error(`Entries found with missing 'title' field! Please make the data corrections and re-run the audit.`);
1000
- }
1001
996
  }
1002
997
  }
1003
998
  exports.default = Entries;
@@ -29,6 +29,7 @@ class Extensions {
29
29
  return 'extensions';
30
30
  }
31
31
  async run() {
32
+ var _a;
32
33
  if (!(0, fs_1.existsSync)(this.folderPath)) {
33
34
  this.log(`Skipping ${this.moduleName} audit`, 'warn');
34
35
  this.log((0, messages_1.$t)(messages_1.auditMsg.NOT_VALID_PATH, { path: this.folderPath }), { color: 'yellow' });
@@ -44,8 +45,8 @@ class Extensions {
44
45
  const ctNotPresent = scope === null || scope === void 0 ? void 0 : scope.content_types.filter((ct) => !this.ctUidSet.has(ct));
45
46
  if ((ctNotPresent === null || ctNotPresent === void 0 ? void 0 : ctNotPresent.length) && ext.scope) {
46
47
  ext.content_types = ctNotPresent;
47
- ctNotPresent.forEach((ct) => this.missingCts.add(ct));
48
- this.missingCtInExtensions.push((0, lodash_1.cloneDeep)(ext));
48
+ ctNotPresent.forEach((ct) => { var _a; return (_a = this.missingCts) === null || _a === void 0 ? void 0 : _a.add(ct); });
49
+ (_a = this.missingCtInExtensions) === null || _a === void 0 ? void 0 : _a.push((0, lodash_1.cloneDeep)(ext));
49
50
  }
50
51
  this.log((0, messages_1.$t)(messages_1.auditMsg.SCAN_EXT_SUCCESS_MSG, {
51
52
  title,
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.6.2",
2
+ "version": "1.6.4",
3
3
  "commands": {
4
4
  "cm:stacks:audit:fix": {
5
5
  "id": "cm:stacks:audit:fix",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/cli-audit",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "description": "Contentstack audit plugin",
5
5
  "author": "Contentstack CLI",
6
6
  "homepage": "https://github.com/contentstack/cli",
@@ -18,8 +18,8 @@
18
18
  "/oclif.manifest.json"
19
19
  ],
20
20
  "dependencies": {
21
- "@contentstack/cli-command": "~1.2.18",
22
- "@contentstack/cli-utilities": "~1.6.2",
21
+ "@contentstack/cli-command": "~1.2.19",
22
+ "@contentstack/cli-utilities": "~1.7.0",
23
23
  "@oclif/plugin-help": "^5",
24
24
  "@oclif/plugin-plugins": "^5.0.0",
25
25
  "chalk": "^4.1.2",