@contentstack/cli-audit 1.12.0 → 1.12.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
@@ -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.12.0 linux-x64 node-v22.14.0
22
+ @contentstack/cli-audit/1.12.1 linux-x64 node-v22.14.0
23
23
  $ csdx --help [COMMAND]
24
24
  USAGE
25
25
  $ csdx COMMAND
@@ -4,6 +4,7 @@ declare const config: {
4
4
  skipFieldTypes: string[];
5
5
  modules: string[];
6
6
  'fix-fields': string[];
7
+ 'schema-fields-data-type': string[];
7
8
  moduleConfig: {
8
9
  'content-types': {
9
10
  name: string;
@@ -15,6 +15,7 @@ const config = {
15
15
  'field-rules',
16
16
  ],
17
17
  'fix-fields': ['reference', 'global_field', 'json:rte', 'json:extension', 'blocks', 'group', 'content_types'],
18
+ 'schema-fields-data-type': ['blocks', 'group', 'global_field'],
18
19
  moduleConfig: {
19
20
  'content-types': {
20
21
  name: 'content type',
@@ -381,9 +381,11 @@ class ContentType {
381
381
  .filter((val) => {
382
382
  if (this.config.skipFieldTypes.includes(val === null || val === void 0 ? void 0 : val.data_type))
383
383
  return true;
384
- if ((val === null || val === void 0 ? void 0 : val.schema) && (0, isEmpty_1.default)(val === null || val === void 0 ? void 0 : val.schema))
384
+ if ((val === null || val === void 0 ? void 0 : val.schema) &&
385
+ (0, isEmpty_1.default)(val === null || val === void 0 ? void 0 : val.schema) &&
386
+ (!(val === null || val === void 0 ? void 0 : val.data_type) || this.config['schema-fields-data-type'].includes(val.data_type)))
385
387
  return false;
386
- if ((val === null || val === void 0 ? void 0 : val.reference_to) && (0, isEmpty_1.default)(val === null || val === void 0 ? void 0 : val.reference_to))
388
+ if ((val === null || val === void 0 ? void 0 : val.reference_to) && (0, isEmpty_1.default)(val === null || val === void 0 ? void 0 : val.reference_to) && val.data_type === 'reference')
387
389
  return false;
388
390
  return !!val;
389
391
  });
@@ -344,5 +344,5 @@
344
344
  ]
345
345
  }
346
346
  },
347
- "version": "1.12.0"
347
+ "version": "1.12.1"
348
348
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/cli-audit",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Contentstack audit plugin",
5
5
  "author": "Contentstack CLI",
6
6
  "homepage": "https://github.com/contentstack/cli",