@contentstack/cli-audit 1.3.3 → 1.3.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.3.3 linux-x64 node-v18.19.0
22
+ @contentstack/cli-audit/1.3.4 linux-x64 node-v18.19.0
23
23
  $ csdx --help [COMMAND]
24
24
  USAGE
25
25
  $ csdx COMMAND
@@ -285,7 +285,7 @@ EXAMPLES
285
285
  $ csdx plugins
286
286
  ```
287
287
 
288
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.10/src/commands/plugins/index.ts)_
288
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.17/src/commands/plugins/index.ts)_
289
289
 
290
290
  ## `csdx plugins:install PLUGIN...`
291
291
 
@@ -354,7 +354,7 @@ EXAMPLES
354
354
  $ csdx plugins:inspect myplugin
355
355
  ```
356
356
 
357
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.10/src/commands/plugins/inspect.ts)_
357
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.17/src/commands/plugins/inspect.ts)_
358
358
 
359
359
  ## `csdx plugins:install PLUGIN...`
360
360
 
@@ -398,7 +398,7 @@ EXAMPLES
398
398
  $ csdx plugins:install someuser/someplugin
399
399
  ```
400
400
 
401
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.10/src/commands/plugins/install.ts)_
401
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.17/src/commands/plugins/install.ts)_
402
402
 
403
403
  ## `csdx plugins:link PLUGIN`
404
404
 
@@ -428,7 +428,7 @@ EXAMPLES
428
428
  $ csdx plugins:link myplugin
429
429
  ```
430
430
 
431
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.10/src/commands/plugins/link.ts)_
431
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.17/src/commands/plugins/link.ts)_
432
432
 
433
433
  ## `csdx plugins:uninstall PLUGIN...`
434
434
 
@@ -465,7 +465,7 @@ USAGE
465
465
  $ csdx plugins:reset
466
466
  ```
467
467
 
468
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.10/src/commands/plugins/reset.ts)_
468
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.17/src/commands/plugins/reset.ts)_
469
469
 
470
470
  ## `csdx plugins:uninstall PLUGIN...`
471
471
 
@@ -493,7 +493,7 @@ EXAMPLES
493
493
  $ csdx plugins:uninstall myplugin
494
494
  ```
495
495
 
496
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.10/src/commands/plugins/uninstall.ts)_
496
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.17/src/commands/plugins/uninstall.ts)_
497
497
 
498
498
  ## `csdx plugins:uninstall PLUGIN...`
499
499
 
@@ -537,5 +537,5 @@ DESCRIPTION
537
537
  Update installed plugins.
538
538
  ```
539
539
 
540
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.10/src/commands/plugins/update.ts)_
540
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.1.17/src/commands/plugins/update.ts)_
541
541
  <!-- commandsstop -->
@@ -354,6 +354,9 @@ class Entries {
354
354
  }
355
355
  // NOTE Reference field
356
356
  entry[uid] = this.fixMissingReferences([...tree, { uid: field.uid, name: field.display_name, data_type: field.data_type }], field, entry[uid]);
357
+ if (!entry[uid]) {
358
+ delete entry[uid];
359
+ }
357
360
  break;
358
361
  case 'blocks':
359
362
  entry[uid] = this.fixModularBlocksReferences([...tree, { uid: field.uid, name: field.display_name, data_type: field.data_type }], field.blocks, entry[uid]);
@@ -392,20 +395,16 @@ class Entries {
392
395
  * @returns the updated `entry` array after performing some modifications.
393
396
  */
394
397
  fixModularBlocksReferences(tree, blocks, entry) {
395
- entry = entry
396
- .map((block, index) => this.modularBlockRefCheck(tree, blocks, block, index))
397
- .filter((val) => !(0, isEmpty_1.default)(val));
398
+ entry = entry === null || entry === void 0 ? void 0 : entry.map((block, index) => this.modularBlockRefCheck(tree, blocks, block, index)).filter((val) => !(0, isEmpty_1.default)(val));
398
399
  blocks.forEach((block) => {
399
- entry = entry
400
- .map((eBlock) => {
400
+ entry = entry === null || entry === void 0 ? void 0 : entry.map((eBlock) => {
401
401
  if (!(0, isEmpty_1.default)(block.schema)) {
402
402
  if (eBlock[block.uid]) {
403
403
  eBlock[block.uid] = this.runFixOnSchema([...tree, { uid: block.uid, display_name: block.title }], block.schema, eBlock[block.uid]);
404
404
  }
405
405
  }
406
406
  return eBlock;
407
- })
408
- .filter((val) => !(0, isEmpty_1.default)(val));
407
+ }).filter((val) => !(0, isEmpty_1.default)(val));
409
408
  });
410
409
  return entry;
411
410
  }
@@ -482,8 +481,7 @@ class Entries {
482
481
  */
483
482
  fixMissingReferences(tree, field, entry) {
484
483
  const missingRefs = [];
485
- entry = entry
486
- .map((reference) => {
484
+ entry = entry === null || entry === void 0 ? void 0 : entry.map((reference) => {
487
485
  const { uid } = reference;
488
486
  const refExist = (0, find_1.default)(this.entryMetaData, { uid });
489
487
  if (!refExist) {
@@ -491,8 +489,7 @@ class Entries {
491
489
  return null;
492
490
  }
493
491
  return reference;
494
- })
495
- .filter((val) => val);
492
+ }).filter((val) => val);
496
493
  if (!(0, isEmpty_1.default)(missingRefs)) {
497
494
  this.missingRefs[this.currentUid].push({
498
495
  tree,
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.3",
2
+ "version": "1.3.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.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Contentstack audit plugin",
5
5
  "author": "Contentstack CLI",
6
6
  "homepage": "https://github.com/contentstack/cli",
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "@contentstack/cli-command": "~1.2.16",
22
- "@contentstack/cli-utilities": "~1.5.10",
22
+ "@contentstack/cli-utilities": "~1.5.11",
23
23
  "@oclif/plugin-help": "^5",
24
24
  "@oclif/plugin-plugins": "^4.1.9",
25
25
  "chalk": "^4.1.2",
@@ -34,6 +34,7 @@
34
34
  "@oclif/test": "^2.0.3",
35
35
  "@types/chai": "^4.3.5",
36
36
  "@types/fs-extra": "^11.0.2",
37
+ "@types/mocha": "^10.0.6",
37
38
  "@types/node": "^20.3.1",
38
39
  "@types/uuid": "^9.0.4",
39
40
  "chai": "^4.3.7",
@@ -71,6 +72,7 @@
71
72
  "lint": "eslint . --ext .ts --config .eslintrc",
72
73
  "postpack": "shx rm -f oclif.manifest.json",
73
74
  "posttest": "npm run lint",
75
+ "compile": "shx rm -rf lib && tsc -b",
74
76
  "prepack": "npm run build && oclif manifest && oclif readme",
75
77
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
76
78
  "version": "oclif readme && git add README.md",
@@ -84,4 +86,4 @@
84
86
  "keywords": [
85
87
  "oclif"
86
88
  ]
87
- }
89
+ }