diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..1be7e0d --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @contentstack/security-admin diff --git a/.github/workflows/secrets-scan.yml b/.github/workflows/secrets-scan.yml index eca3c48..15acb5b 100644 --- a/.github/workflows/secrets-scan.yml +++ b/.github/workflows/secrets-scan.yml @@ -11,7 +11,7 @@ jobs: fetch-depth: 0 - name: Install Expect, jq and Python - run: sudo apt-get install -y expect jq python3 python3-pip wkhtmltopdf + run: sudo apt-get update --fix-missing && sudo apt-get install -y expect jq python3 python3-pip wkhtmltopdf - name: Install Python packages run: pip install pandas json2html tabulate @@ -51,4 +51,4 @@ jobs: - name: Check the status of talisman scan run: | # if [[ ${{ steps.run_talisman.outcome }} == "success" ]]; then exit 0; else echo "Download the Talisman scan report from Artifact: ${{ steps.upload_report.outputs.artifact-url }}" && exit 1; fi - echo "Download the Talisman scan report from Artifact: ${{ steps.upload_report.outputs.artifact-url }}"; \ No newline at end of file + echo "Download the Talisman scan report from Artifact: ${{ steps.upload_report.outputs.artifact-url }}"; diff --git a/package-lock.json b/package-lock.json index 76c7574..0c15fe1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "contentstack-cli-tsgen", - "version": "2.3.1", + "version": "2.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "contentstack-cli-tsgen", - "version": "2.3.1", + "version": "2.3.2", "license": "MIT", "dependencies": { "@contentstack/cli-command": "^1.2.17", diff --git a/package.json b/package.json index c901721..b81dbdd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "contentstack-cli-tsgen", "description": "Generate TypeScript typings from a Stack.", - "version": "2.3.1", + "version": "2.3.2", "author": "Michael Davis", "bugs": "https://github.com/Contentstack-Solutions/contentstack-cli-tsgen/issues", "dependencies": { diff --git a/src/lib/tsgen/factory.ts b/src/lib/tsgen/factory.ts index 12f7c02..a48d65f 100644 --- a/src/lib/tsgen/factory.ts +++ b/src/lib/tsgen/factory.ts @@ -240,7 +240,7 @@ export default function (userOptions: TSGenOptions) { define_interface(contentType, options.systemFields), '{', ['/**', "Version", '*/'].join(' '), - [`version: `,contentType._version,';'].join(' '), + [`_version: `,contentType._version,';'].join(' '), visit_fields(contentType.schema), '}', ] diff --git a/tests/tsgen/boolean.test.ts b/tests/tsgen/boolean.test.ts index 125523d..4fd1731 100644 --- a/tests/tsgen/boolean.test.ts +++ b/tests/tsgen/boolean.test.ts @@ -25,7 +25,7 @@ describe("builtin boolean field", () => { "export interface IBoolean { /** Version */ - version: 2 ; + _version: 2 ; title: string ; boolean?: boolean ; }" diff --git a/tests/tsgen/defaults.test.ts b/tests/tsgen/defaults.test.ts index 1032277..b79145b 100644 --- a/tests/tsgen/defaults.test.ts +++ b/tests/tsgen/defaults.test.ts @@ -18,7 +18,7 @@ describe("default single content block", () => { "export interface IMetadataSingleContentBlock { /** Version */ - version: 2 ; + _version: 2 ; title: string ; }" `); @@ -44,7 +44,7 @@ describe("default single webpage", () => { "export interface IMetadataSingleWebpage { /** Version */ - version: 2 ; + _version: 2 ; title: string ; url: string ; }" diff --git a/tests/tsgen/global.fields.test.ts b/tests/tsgen/global.fields.test.ts index caffbf7..f8c340c 100644 --- a/tests/tsgen/global.fields.test.ts +++ b/tests/tsgen/global.fields.test.ts @@ -25,7 +25,7 @@ describe("global fields", () => { "export interface ISeo { /** Version */ - version: ; + _version: ; keywords?: string ; description?: string ; }" @@ -37,7 +37,7 @@ describe("global fields", () => { "export interface IGlobalFields { /** Version */ - version: 2 ; + _version: 2 ; title: string ; seo?: ISeo ; }" diff --git a/tests/tsgen/group.test.ts b/tests/tsgen/group.test.ts index 7259de0..454ca4b 100644 --- a/tests/tsgen/group.test.ts +++ b/tests/tsgen/group.test.ts @@ -24,7 +24,7 @@ describe("group", () => { "export interface Group { /** Version */ - version: 3 ; + _version: 3 ; title: string ; multiple_group_max_limit?: [{ number?: number | null ; diff --git a/tests/tsgen/isodate.test.ts b/tests/tsgen/isodate.test.ts index 98302a4..6e44ab6 100644 --- a/tests/tsgen/isodate.test.ts +++ b/tests/tsgen/isodate.test.ts @@ -25,7 +25,7 @@ describe("builtin isodate field", () => { "export interface Isodate { /** Version */ - version: 2 ; + _version: 2 ; title: string ; date?: string | null ; date_required: string ; diff --git a/tests/tsgen/jsdoc.test.ts b/tests/tsgen/jsdoc.test.ts index c5efa75..56a654c 100644 --- a/tests/tsgen/jsdoc.test.ts +++ b/tests/tsgen/jsdoc.test.ts @@ -16,7 +16,7 @@ describe("jsdoc", () => { export interface Jsdoc { /** Version */ - version: 3 ; + _version: 3 ; /** Name */ title: string ; /** Age */ diff --git a/tests/tsgen/modular.blocks.test.ts b/tests/tsgen/modular.blocks.test.ts index 765495d..06cc63b 100644 --- a/tests/tsgen/modular.blocks.test.ts +++ b/tests/tsgen/modular.blocks.test.ts @@ -21,7 +21,7 @@ describe("modular blocks", () => { "export interface ModularBlocks { /** Version */ - version: 2 ; + _version: 2 ; title: string ; url: string ; modular_blocks?: ({string_block: {single_line?: string ; diff --git a/tests/tsgen/number.test.ts b/tests/tsgen/number.test.ts index 036dab6..5273063 100644 --- a/tests/tsgen/number.test.ts +++ b/tests/tsgen/number.test.ts @@ -22,7 +22,7 @@ describe("builtin number field", () => { "export interface Number { /** Version */ - version: 2 ; + _version: 2 ; title: string ; url: string ; number?: number | null ; diff --git a/tests/tsgen/options.test.ts b/tests/tsgen/options.test.ts index 9466446..7846dea 100644 --- a/tests/tsgen/options.test.ts +++ b/tests/tsgen/options.test.ts @@ -15,7 +15,7 @@ describe("all options", () => { "export interface Options { /** Version */ - version: 4 ; + _version: 4 ; title: string ; url: string ; single_line_textbox_not_required?: string ; diff --git a/tests/tsgen/references.test.ts b/tests/tsgen/references.test.ts index a5b3b42..9ceef14 100644 --- a/tests/tsgen/references.test.ts +++ b/tests/tsgen/references.test.ts @@ -26,7 +26,7 @@ describe("references", () => { "export interface IReferenceParent { /** Version */ - version: 5 ; + _version: 5 ; title: string ; url: string ; single_reference: (IReferenceChild)[] ; diff --git a/tests/tsgen/select.test.ts b/tests/tsgen/select.test.ts index 8209dd8..bc79bcf 100644 --- a/tests/tsgen/select.test.ts +++ b/tests/tsgen/select.test.ts @@ -21,7 +21,7 @@ describe("select (dropdown)", () => { "export interface Select { /** Version */ - version: 5 ; + _version: 5 ; title: string ; select_single_value?: (\\"Option 1\\" | \\"Option 2\\" | \\"Option 3\\") | null ; select_single_value_required: (\\"Test 1\\" | \\"Test 2\\" | \\"Test 3\\") ; diff --git a/tests/tsgen/string.test.ts b/tests/tsgen/string.test.ts index 00ba136..1659d4c 100644 --- a/tests/tsgen/string.test.ts +++ b/tests/tsgen/string.test.ts @@ -22,7 +22,7 @@ describe("builtin string fields", () => { "export interface BuiltinStrings { /** Version */ - version: 4 ; + _version: 4 ; title: string ; single_line?: string ; multi_line?: string ; diff --git a/tests/tsgen/taxonomies.test.ts b/tests/tsgen/taxonomies.test.ts index 6ae0414..9817e4f 100644 --- a/tests/tsgen/taxonomies.test.ts +++ b/tests/tsgen/taxonomies.test.ts @@ -27,7 +27,7 @@ describe("builtin taxonomies field", () => { "export interface ITaxonomy { /** Version */ - version: 2 ; + _version: 2 ; title: string ; boolean?: boolean ; taxonomies?: ITaxonomy[] ;