diff --git a/package-lock.json b/package-lock.json index 15997f4ead..51a5cb84fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25320,10 +25320,10 @@ }, "packages/contentstack": { "name": "@contentstack/cli", - "version": "1.17.0", + "version": "1.17.1", "license": "MIT", "dependencies": { - "@contentstack/cli-audit": "~1.5.1", + "@contentstack/cli-audit": "~1.5.2", "@contentstack/cli-auth": "~1.3.17", "@contentstack/cli-cm-bootstrap": "~1.9.0", "@contentstack/cli-cm-branches": "~1.0.24", @@ -25388,7 +25388,7 @@ }, "packages/contentstack-audit": { "name": "@contentstack/cli-audit", - "version": "1.5.1", + "version": "1.5.2", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", @@ -26836,7 +26836,7 @@ "version": "1.15.0", "license": "MIT", "dependencies": { - "@contentstack/cli-audit": "~1.5.1", + "@contentstack/cli-audit": "~1.5.2", "@contentstack/cli-command": "~1.2.16", "@contentstack/cli-utilities": "~1.6.0", "@contentstack/management": "~1.15.3", @@ -27455,4 +27455,4 @@ "dev": true } } -} +} \ No newline at end of file diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index abca50ec1e..f1d3f5a338 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-audit", - "version": "1.5.1", + "version": "1.5.2", "description": "Contentstack audit plugin", "author": "Contentstack CLI", "homepage": "https://github.com/contentstack/cli", diff --git a/packages/contentstack-audit/src/modules/entries.ts b/packages/contentstack-audit/src/modules/entries.ts index 87082a369c..b02899eada 100644 --- a/packages/contentstack-audit/src/modules/entries.ts +++ b/packages/contentstack-audit/src/modules/entries.ts @@ -301,6 +301,11 @@ export default class Entries { fieldStructure: ReferenceFieldDataType, field: EntryReferenceFieldDataType[], ) { + if (typeof field === 'string') { + let stringReference = field as string; + stringReference = stringReference.replace(/'/g, '"'); + field = JSON.parse(stringReference); + } return this.validateReferenceValues(tree, fieldStructure, field); } @@ -826,6 +831,11 @@ export default class Entries { entry: EntryReferenceFieldDataType[], ) { const missingRefs: Record[] = []; + if (typeof entry === 'string') { + let stringReference = entry as string; + stringReference = stringReference.replace(/'/g, '"'); + entry = JSON.parse(stringReference); + } entry = entry ?.map((reference) => { const { uid } = reference; diff --git a/packages/contentstack-import/package.json b/packages/contentstack-import/package.json index 771c835b22..9b2df1564b 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.1", + "@contentstack/cli-audit": "~1.5.2", "@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 ea37096f22..41dce9d621 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli", "description": "Command-line tool (CLI) to interact with Contentstack", - "version": "1.17.0", + "version": "1.17.1", "author": "Contentstack", "bin": { "csdx": "./bin/run" @@ -22,7 +22,7 @@ "prepack": "pnpm compile && oclif manifest && oclif readme" }, "dependencies": { - "@contentstack/cli-audit": "~1.5.1", + "@contentstack/cli-audit": "~1.5.2", "@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 40adc2b418..181c16cad6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: packages/contentstack: specifiers: - '@contentstack/cli-audit': ~1.5.1 + '@contentstack/cli-audit': ~1.5.2 '@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.1 + '@contentstack/cli-audit': ~1.5.2 '@contentstack/cli-command': ~1.2.16 '@contentstack/cli-utilities': ~1.6.0 '@contentstack/management': ~1.15.3