diff --git a/package-lock.json b/package-lock.json index 9c41b62bd9..57ee1ba448 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25404,7 +25404,7 @@ "version": "1.17.3", "license": "MIT", "dependencies": { - "@contentstack/cli-audit": "~1.5.3", + "@contentstack/cli-audit": "~1.5.4", "@contentstack/cli-auth": "~1.3.17", "@contentstack/cli-cm-bootstrap": "~1.9.0", "@contentstack/cli-cm-branches": "~1.0.24", @@ -25469,7 +25469,7 @@ }, "packages/contentstack-audit": { "name": "@contentstack/cli-audit", - "version": "1.5.3", + "version": "1.5.4", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", @@ -26917,7 +26917,7 @@ "version": "1.15.1", "license": "MIT", "dependencies": { - "@contentstack/cli-audit": "~1.5.3", + "@contentstack/cli-audit": "~1.5.4", "@contentstack/cli-command": "~1.2.16", "@contentstack/cli-utilities": "~1.6.0", "@contentstack/management": "~1.15.3", diff --git a/packages/contentstack-audit/src/modules/entries.ts b/packages/contentstack-audit/src/modules/entries.ts index b02899eada..dfce908806 100644 --- a/packages/contentstack-audit/src/modules/entries.ts +++ b/packages/contentstack-audit/src/modules/entries.ts @@ -55,6 +55,7 @@ export default class Entries { protected missingRefs: Record = {}; public entryMetaData: Record[] = []; public moduleName: keyof typeof auditConfig.moduleConfig = 'entries'; + public isEntryWithoutTitleField: boolean = false; constructor({ log, fix, config, moduleName, ctSchema, gfSchema }: ModuleConstructorParam & CtConstructorParam) { this.log = log; @@ -105,7 +106,6 @@ export default class Entries { if (this.fix) { this.removeMissingKeysOnEntry(ctSchema.schema as ContentTypeSchemaType[], this.entries[entryUid]); } - this.lookForReference([{ locale: code, uid, name: title }], ctSchema, this.entries[entryUid]); const message = $t(auditMsg.SCAN_ENTRY_SUCCESS_MSG, { title, @@ -981,10 +981,20 @@ export default class Entries { const entries = (await fsUtility.readChunkFiles.next()) as Record; for (const entryUid in entries) { let { title } = entries[entryUid]; + if (!title) { + this.isEntryWithoutTitleField = true; + this.log( + `Entry with UID '${entryUid}' of Content Type '${uid}' in Locale '${code}' does not have a 'title' field.`, + `error`, + ); + } this.entryMetaData.push({ uid: entryUid, title }); } } } } + if (this.isEntryWithoutTitleField) { + throw Error(`Entries found with missing 'title' field! Please make the data corrections and re-run the audit.`); + } } } diff --git a/packages/contentstack-import/package.json b/packages/contentstack-import/package.json index da302aa025..78b85fe616 100644 --- a/packages/contentstack-import/package.json +++ b/packages/contentstack-import/package.json @@ -5,7 +5,7 @@ "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-audit": "~1.5.3", + "@contentstack/cli-audit": "~1.5.4", "@contentstack/cli-command": "~1.2.16", "@contentstack/cli-utilities": "~1.6.0", "@contentstack/management": "~1.15.3", diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index adc437204f..8cf64987d3 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -22,7 +22,7 @@ "prepack": "pnpm compile && oclif manifest && oclif readme" }, "dependencies": { - "@contentstack/cli-audit": "~1.5.3", + "@contentstack/cli-audit": "~1.5.4", "@contentstack/cli-auth": "~1.3.17", "@contentstack/cli-cm-bootstrap": "~1.9.0", "@contentstack/cli-cm-branches": "~1.0.24", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 125dc7db73..8bd898e9ed 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: packages/contentstack: specifiers: - '@contentstack/cli-audit': ~1.5.3 + '@contentstack/cli-audit': ~1.5.4 '@contentstack/cli-auth': ~1.3.17 '@contentstack/cli-cm-bootstrap': ~1.9.0 '@contentstack/cli-cm-branches': ~1.0.24 @@ -730,7 +730,7 @@ importers: packages/contentstack-import: specifiers: - '@contentstack/cli-audit': ~1.5.3 + '@contentstack/cli-audit': ~1.5.4 '@contentstack/cli-command': ~1.2.16 '@contentstack/cli-utilities': ~1.6.0 '@contentstack/management': ~1.15.3