From d4ade05a747474f9891ed3796386d2c5a11f3848 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Thu, 15 Feb 2024 15:56:29 +0530 Subject: [PATCH 1/3] nuxt3 added, deperaction warning for nuxt, env file creation for angular app and version bump --- package-lock.json | 4 +-- packages/contentstack-bootstrap/package.json | 2 +- .../src/bootstrap/utils.ts | 34 +++++++++++-------- packages/contentstack-bootstrap/src/config.ts | 7 +++- packages/contentstack/package.json | 2 +- pnpm-lock.yaml | 2 +- 6 files changed, 30 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index cf5efad16a..43c7c35d96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23545,7 +23545,7 @@ "dependencies": { "@contentstack/cli-audit": "~1.4.0", "@contentstack/cli-auth": "~1.3.17", - "@contentstack/cli-cm-bootstrap": "~1.8.0", + "@contentstack/cli-cm-bootstrap": "~1.9.0", "@contentstack/cli-cm-branches": "~1.0.22", "@contentstack/cli-cm-bulk-publish": "~1.4.0", "@contentstack/cli-cm-clone": "~1.10.0", @@ -23917,7 +23917,7 @@ }, "packages/contentstack-bootstrap": { "name": "@contentstack/cli-cm-bootstrap", - "version": "1.8.0", + "version": "1.9.0", "license": "MIT", "dependencies": { "@contentstack/cli-cm-seed": "~1.7.0", diff --git a/packages/contentstack-bootstrap/package.json b/packages/contentstack-bootstrap/package.json index a7c52f1f5a..6ab12662ce 100644 --- a/packages/contentstack-bootstrap/package.json +++ b/packages/contentstack-bootstrap/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-bootstrap", "description": "Bootstrap contentstack apps", - "version": "1.8.0", + "version": "1.9.0", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "scripts": { diff --git a/packages/contentstack-bootstrap/src/bootstrap/utils.ts b/packages/contentstack-bootstrap/src/bootstrap/utils.ts index daa053e1ae..255c8fbd28 100644 --- a/packages/contentstack-bootstrap/src/bootstrap/utils.ts +++ b/packages/contentstack-bootstrap/src/bootstrap/utils.ts @@ -197,7 +197,10 @@ const envFileHandler = async ( environmentVariables.deliveryToken }\n${ livePreviewEnabled - ? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n`: '\n' + ? `\nCONTENTSTACK_PREVIEW_TOKEN=${ + environmentVariables.preview_token || `''` + }\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n` + : '\n' }\nCONTENTSTACK_ENVIRONMENT=${ environmentVariables.environment }\nCONTENTSTACK_API_HOST=${managementAPIHost}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}`; @@ -217,29 +220,31 @@ const envFileHandler = async ( },\n\t\tenvironment: '${environmentVariables.environment}'${ !isUSRegion && !customHost ? `,\n\t\tregion: '${region.name}'` : '' } \n\t } \n };`; - fileName = `environment${environmentVariables.environment === 'production' ? '.prod.' : '.'}ts`; + fileName = `.env${environmentVariables.environment === 'production' ? '.prod' : ''}`; filePath = path.join(clonedDirectory, 'src', 'environments', fileName); result = await writeEnvFile(content, filePath); break; case 'angular-starter': - content = `export const environment = { \n\tproduction: true \n}; \nexport const Config = { \n\tapi_key: '${ - environmentVariables.api_key - }', \n\tdelivery_token: '${environmentVariables.deliveryToken}',\n\t${ + content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${ + environmentVariables.deliveryToken + }\n${ livePreviewEnabled - ? `\npreview_token:'${environmentVariables.preview_token || ''}',\npreview_host:'${previewHost - }',\napp_host:'${appHost}'` + ? `\nCONTENTSTACK_PREVIEW_TOKEN=${ + environmentVariables.preview_token || `''` + }\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n` : '\n' - },\n\tenvironment: '${environmentVariables.environment}'${ - !isUSRegion && !customHost ? `,\n\tregion: '${region.name}'` : '' - },\n\tapi_host: '${ + }CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nCONTENTSTACK_API_HOST=${ customHost ? customHost : managementAPIHost - }',\n\tlive_preview: ${livePreviewEnabled}\n};`; - fileName = `environment${environmentVariables.environment === 'production' ? '.prod.' : '.'}ts`; - filePath = path.join(clonedDirectory, 'src', 'environments', fileName); + }${ + !isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : '' + }\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}\nCONTENTSTACK_LIVE_EDIT_TAGS=false`; + fileName = `.env${environmentVariables.environment === 'production' ? '.prod' : ''}`; + filePath = path.join(clonedDirectory, fileName); result = await writeEnvFile(content, filePath); break; case 'nuxtjs': case 'nuxt-starter': + case 'nuxt3-starter': case 'stencil-starter': fileName = production ? '.env.production' : '.env'; filePath = path.join(clonedDirectory, fileName); @@ -268,8 +273,7 @@ const envFileHandler = async ( livePreviewEnabled ? `\nVUE_APP_CONTENTSTACK_PREVIEW_TOKEN=${ environmentVariables.preview_token || `''` - }\nVUE_APP_CONTENTSTACK_PREVIEW_HOST=${previewHost - }\nVUE_APP_CONTENTSTACK_APP_HOST=${appHost}\n` + }\nVUE_APP_CONTENTSTACK_PREVIEW_HOST=${previewHost}\nVUE_APP_CONTENTSTACK_APP_HOST=${appHost}\n` : '\n' }\nVUE_APP_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${ customHost ? '\nVUE_APP_CONTENTSTACK_API_HOST=' + customHost : '' diff --git a/packages/contentstack-bootstrap/src/config.ts b/packages/contentstack-bootstrap/src/config.ts index 307fc8c744..99f85fd26d 100644 --- a/packages/contentstack-bootstrap/src/config.ts +++ b/packages/contentstack-bootstrap/src/config.ts @@ -25,9 +25,10 @@ const config: Configuration = { { displayName: 'Next JS', configKey: 'nextjs-starter' }, { displayName: 'Gatsby', configKey: 'gatsby-starter' }, { displayName: 'Angular', configKey: 'angular-starter' }, - { displayName: 'Nuxt JS', configKey: 'nuxt-starter' }, + { displayName: 'Nuxt JS (To be Deprecated)', configKey: 'nuxt-starter' }, { displayName: 'Vue JS', configKey: 'vue-starter' }, { displayName: 'Stencil', configKey: 'stencil-starter' }, + { displayName: 'Nuxt3', configKey: 'nuxt3-starter' }, ], appLevelConfig: { nextjs: { @@ -78,6 +79,10 @@ const config: Configuration = { source: 'contentstack/contentstack-stencil-starter-app', stack: 'contentstack/stack-starter-app', }, + 'nuxt3-starter': { + source: 'contentstack/contentstack-nuxt3-starter-app', + stack: 'contentstack/stack-starter-app', + }, }, }; export default config; diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index 62b7ba57d8..f48d578c82 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -24,7 +24,7 @@ "dependencies": { "@contentstack/cli-audit": "~1.4.0", "@contentstack/cli-auth": "~1.3.17", - "@contentstack/cli-cm-bootstrap": "~1.8.0", + "@contentstack/cli-cm-bootstrap": "~1.9.0", "@contentstack/cli-cm-branches": "~1.0.22", "@contentstack/cli-cm-bulk-publish": "~1.4.0", "@contentstack/cli-cm-export": "~1.10.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2be68a439..622cf7a2bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,7 +12,7 @@ importers: specifiers: '@contentstack/cli-audit': ~1.4.0 '@contentstack/cli-auth': ~1.3.17 - '@contentstack/cli-cm-bootstrap': ~1.8.0 + '@contentstack/cli-cm-bootstrap': ~1.9.0 '@contentstack/cli-cm-branches': ~1.0.22 '@contentstack/cli-cm-bulk-publish': ~1.4.0 '@contentstack/cli-cm-clone': ~1.10.0 From fd6257a9e79d6b642248654ae85ca48f2664485a Mon Sep 17 00:00:00 2001 From: raj pandey Date: Mon, 19 Feb 2024 15:08:55 +0530 Subject: [PATCH 2/3] replaced pseudoRandomBytes with randomBytes and version bump --- package-lock.json | 32 +++++++++---------- packages/contentstack-audit/package.json | 2 +- packages/contentstack-auth/package.json | 2 +- packages/contentstack-bootstrap/package.json | 2 +- packages/contentstack-branches/package.json | 2 +- .../contentstack-bulk-publish/package.json | 2 +- packages/contentstack-clone/package.json | 2 +- packages/contentstack-command/package.json | 2 +- packages/contentstack-config/package.json | 2 +- .../contentstack-export-to-csv/package.json | 2 +- packages/contentstack-export/package.json | 2 +- packages/contentstack-import/package.json | 2 +- packages/contentstack-launch/package.json | 2 +- .../contentstack-migrate-rte/package.json | 2 +- packages/contentstack-migration/package.json | 2 +- packages/contentstack-seed/package.json | 2 +- packages/contentstack-utilities/package.json | 2 +- .../src/auth-handler.ts | 3 +- pnpm-lock.yaml | 30 ++++++++--------- 19 files changed, 49 insertions(+), 48 deletions(-) diff --git a/package-lock.json b/package-lock.json index cf5efad16a..19f183a859 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23612,7 +23612,7 @@ "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^4.1.9", "chalk": "^4.1.2", @@ -23874,7 +23874,7 @@ "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "chalk": "^4.0.0", "debug": "^4.1.1", "inquirer": "8.2.4", @@ -23922,7 +23922,7 @@ "dependencies": { "@contentstack/cli-cm-seed": "~1.7.0", "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "inquirer": "8.2.4", "mkdirp": "^1.0.4", "tar": "^6.1.13" @@ -24006,7 +24006,7 @@ "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@oclif/core": "^2.9.3", "async": "^3.2.4", "big-json": "^3.2.0", @@ -24055,7 +24055,7 @@ "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "bluebird": "^3.7.2", "chalk": "^4.1.2", "dotenv": "^16.1.4", @@ -24095,7 +24095,7 @@ "@contentstack/cli-cm-export": "~1.10.5", "@contentstack/cli-cm-import": "~1.13.4", "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "async": "^3.2.4", "chalk": "^4.1.0", "child_process": "^1.0.2", @@ -24143,7 +24143,7 @@ "version": "1.2.17", "license": "MIT", "dependencies": { - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "contentstack": "^3.10.1" }, "devDependencies": { @@ -24224,7 +24224,7 @@ "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "chalk": "^4.0.0", "debug": "^4.1.1", "inquirer": "8.2.4", @@ -24529,7 +24529,7 @@ "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@oclif/core": "^2.9.3", "async": "^3.2.4", "big-json": "^3.2.0", @@ -24579,7 +24579,7 @@ "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "chalk": "^4.1.0", "fast-csv": "^4.3.6", "inquirer": "8.2.4", @@ -24998,7 +24998,7 @@ "dependencies": { "@contentstack/cli-audit": "~1.4.0", "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@contentstack/management": "~1.13.0", "@oclif/core": "^2.9.3", "big-json": "^3.2.0", @@ -25128,7 +25128,7 @@ "dependencies": { "@apollo/client": "^3.7.9", "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^4.1.9", @@ -25401,7 +25401,7 @@ "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@contentstack/json-rte-serializer": "~2.0.4", "chalk": "^4.1.2", "collapse-whitespace": "^1.1.7", @@ -25440,7 +25440,7 @@ "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "async": "^3.2.4", "callsites": "^3.1.0", "cardinal": "^2.1.1", @@ -25474,7 +25474,7 @@ "dependencies": { "@contentstack/cli-cm-import": "~1.13.4", "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "inquirer": "8.2.4", "mkdirp": "^1.0.4", "tar": "^6.1.13", @@ -25556,7 +25556,7 @@ }, "packages/contentstack-utilities": { "name": "@contentstack/cli-utilities", - "version": "1.5.12", + "version": "1.5.13", "license": "MIT", "dependencies": { "@contentstack/management": "~1.13.0", diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index a046c729a3..e721409e11 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -19,7 +19,7 @@ ], "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^4.1.9", "chalk": "^4.1.2", diff --git a/packages/contentstack-auth/package.json b/packages/contentstack-auth/package.json index 448f3a0c16..e77221f06e 100644 --- a/packages/contentstack-auth/package.json +++ b/packages/contentstack-auth/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "chalk": "^4.0.0", "debug": "^4.1.1", "inquirer": "8.2.4", diff --git a/packages/contentstack-bootstrap/package.json b/packages/contentstack-bootstrap/package.json index a7c52f1f5a..7c751aa077 100644 --- a/packages/contentstack-bootstrap/package.json +++ b/packages/contentstack-bootstrap/package.json @@ -19,7 +19,7 @@ "dependencies": { "@contentstack/cli-cm-seed": "~1.7.0", "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "inquirer": "8.2.4", "mkdirp": "^1.0.4", "tar": "^6.1.13" diff --git a/packages/contentstack-branches/package.json b/packages/contentstack-branches/package.json index 131f3fb134..7ecef1ad77 100644 --- a/packages/contentstack-branches/package.json +++ b/packages/contentstack-branches/package.json @@ -6,7 +6,7 @@ "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@oclif/core": "^2.9.3", "async": "^3.2.4", "big-json": "^3.2.0", diff --git a/packages/contentstack-bulk-publish/package.json b/packages/contentstack-bulk-publish/package.json index 2cfda05977..b1fed62ceb 100644 --- a/packages/contentstack-bulk-publish/package.json +++ b/packages/contentstack-bulk-publish/package.json @@ -6,7 +6,7 @@ "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "bluebird": "^3.7.2", "chalk": "^4.1.2", "dotenv": "^16.1.4", diff --git a/packages/contentstack-clone/package.json b/packages/contentstack-clone/package.json index 43aa7a03b6..783be690cb 100644 --- a/packages/contentstack-clone/package.json +++ b/packages/contentstack-clone/package.json @@ -8,7 +8,7 @@ "@contentstack/cli-cm-export": "~1.10.5", "@contentstack/cli-cm-import": "~1.13.4", "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@colors/colors": "^1.5.0", "async": "^3.2.4", "chalk": "^4.1.0", diff --git a/packages/contentstack-command/package.json b/packages/contentstack-command/package.json index 91cda88e62..4654db6e5b 100644 --- a/packages/contentstack-command/package.json +++ b/packages/contentstack-command/package.json @@ -17,7 +17,7 @@ "format": "eslint src/**/*.ts --fix" }, "dependencies": { - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "contentstack": "^3.10.1" }, "devDependencies": { diff --git a/packages/contentstack-config/package.json b/packages/contentstack-config/package.json index 50b85a6931..e5a775383c 100644 --- a/packages/contentstack-config/package.json +++ b/packages/contentstack-config/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "chalk": "^4.0.0", "debug": "^4.1.1", "inquirer": "8.2.4", diff --git a/packages/contentstack-export-to-csv/package.json b/packages/contentstack-export-to-csv/package.json index 86bde2c529..6909033e04 100644 --- a/packages/contentstack-export-to-csv/package.json +++ b/packages/contentstack-export-to-csv/package.json @@ -6,7 +6,7 @@ "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "chalk": "^4.1.0", "fast-csv": "^4.3.6", "inquirer": "8.2.4", diff --git a/packages/contentstack-export/package.json b/packages/contentstack-export/package.json index e70f726b5a..26dc1f4053 100644 --- a/packages/contentstack-export/package.json +++ b/packages/contentstack-export/package.json @@ -6,7 +6,7 @@ "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@oclif/core": "^2.9.3", "async": "^3.2.4", "big-json": "^3.2.0", diff --git a/packages/contentstack-import/package.json b/packages/contentstack-import/package.json index 7c612fd273..65ff8139dc 100644 --- a/packages/contentstack-import/package.json +++ b/packages/contentstack-import/package.json @@ -7,7 +7,7 @@ "dependencies": { "@contentstack/cli-audit": "~1.4.0", "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@contentstack/management": "~1.13.0", "@oclif/core": "^2.9.3", "big-json": "^3.2.0", diff --git a/packages/contentstack-launch/package.json b/packages/contentstack-launch/package.json index 1704922306..9a14449afb 100755 --- a/packages/contentstack-launch/package.json +++ b/packages/contentstack-launch/package.json @@ -19,7 +19,7 @@ "dependencies": { "@apollo/client": "^3.7.9", "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^4.1.9", diff --git a/packages/contentstack-migrate-rte/package.json b/packages/contentstack-migrate-rte/package.json index 43f16ef3f6..36545459be 100644 --- a/packages/contentstack-migrate-rte/package.json +++ b/packages/contentstack-migrate-rte/package.json @@ -6,7 +6,7 @@ "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "@contentstack/json-rte-serializer": "~2.0.4", "collapse-whitespace": "^1.1.7", "chalk": "^4.1.2", diff --git a/packages/contentstack-migration/package.json b/packages/contentstack-migration/package.json index 3f56e8e0a6..a5b07daa4e 100644 --- a/packages/contentstack-migration/package.json +++ b/packages/contentstack-migration/package.json @@ -5,7 +5,7 @@ "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "async": "^3.2.4", "callsites": "^3.1.0", "cardinal": "^2.1.1", diff --git a/packages/contentstack-seed/package.json b/packages/contentstack-seed/package.json index 22a7c5808e..e09b96b882 100644 --- a/packages/contentstack-seed/package.json +++ b/packages/contentstack-seed/package.json @@ -7,7 +7,7 @@ "dependencies": { "@contentstack/cli-cm-import": "~1.13.4", "@contentstack/cli-command": "~1.2.16", - "@contentstack/cli-utilities": "~1.5.12", + "@contentstack/cli-utilities": "~1.5.13", "inquirer": "8.2.4", "mkdirp": "^1.0.4", "tar": "^6.1.13", diff --git a/packages/contentstack-utilities/package.json b/packages/contentstack-utilities/package.json index 5b5659b796..3e2d8b6a7f 100644 --- a/packages/contentstack-utilities/package.json +++ b/packages/contentstack-utilities/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-utilities", - "version": "1.5.12", + "version": "1.5.13", "description": "Utilities for contentstack projects", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/contentstack-utilities/src/auth-handler.ts b/packages/contentstack-utilities/src/auth-handler.ts index 6878547c68..b043095d2f 100644 --- a/packages/contentstack-utilities/src/auth-handler.ts +++ b/packages/contentstack-utilities/src/auth-handler.ts @@ -39,7 +39,7 @@ class AuthHandler { } constructor() { - this.codeVerifier = crypto.pseudoRandomBytes(32).toString('hex'); + this.codeVerifier = crypto.randomBytes(32).toString('hex'); this.OAuthAppId = process.env.OAUTH_APP_ID || '6400aa06db64de001a31c8a9'; this.OAuthClientId = process.env.OAUTH_CLIENT_ID || 'Ie0FEfTzlfAHL4xM'; this.OAuthRedirectURL = process.env.OAUTH_APP_REDIRECT_URL || 'http://localhost:8184'; @@ -207,6 +207,7 @@ class AuthHandler { async openOAuthURL(): Promise { return new Promise(async (resolve, reject) => { try { + console.log(this.codeVerifier) const digest = crypto.createHash('sha256').update(this.codeVerifier).digest(); const codeChallenge = digest.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); await this.setOAuthBaseURL(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2be68a439..9befe2bbf0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -123,7 +123,7 @@ importers: specifiers: '@contentstack/cli-command': ~1.2.16 '@contentstack/cli-dev-dependencies': ^1.2.4 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/plugin-help': ^5 '@oclif/plugin-plugins': ^4.1.9 '@oclif/test': ^2.5.6 @@ -187,7 +187,7 @@ importers: packages/contentstack-auth: specifiers: '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@fancy-test/nock': ^0.1.1 '@oclif/plugin-help': ^5.1.19 '@oclif/test': ^2.5.6 @@ -251,7 +251,7 @@ importers: specifiers: '@contentstack/cli-cm-seed': ~1.7.0 '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/test': ^2.5.6 '@types/inquirer': ^9.0.3 '@types/mkdirp': ^1.0.1 @@ -304,7 +304,7 @@ importers: '@contentstack/cli-command': ~1.2.16 '@contentstack/cli-config': ~1.6.1 '@contentstack/cli-dev-dependencies': ~1.2.4 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/core': ^2.9.3 '@oclif/plugin-help': ^5.1.19 '@oclif/test': ^2.5.6 @@ -380,7 +380,7 @@ importers: packages/contentstack-bulk-publish: specifiers: '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/test': ^2.5.6 bluebird: ^3.7.2 chai: ^4.2.0 @@ -426,7 +426,7 @@ importers: '@contentstack/cli-cm-export': ~1.10.5 '@contentstack/cli-cm-import': ~1.13.4 '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/test': ^2.5.6 async: ^3.2.4 chai: ^4.2.0 @@ -479,7 +479,7 @@ importers: packages/contentstack-command: specifiers: - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/test': ^2.5.6 '@types/chai': ^4.2.18 '@types/mkdirp': ^1.0.1 @@ -521,7 +521,7 @@ importers: packages/contentstack-config: specifiers: '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/test': ^2.5.6 '@types/chai': ^4.2.18 '@types/inquirer': ^9.0.3 @@ -610,7 +610,7 @@ importers: '@contentstack/cli-command': ~1.2.16 '@contentstack/cli-config': ~1.6.1 '@contentstack/cli-dev-dependencies': ~1.2.4 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/core': ^2.9.3 '@oclif/plugin-help': ^5.1.19 '@oclif/test': ^2.5.6 @@ -688,7 +688,7 @@ importers: packages/contentstack-export-to-csv: specifiers: '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/test': ^2.5.6 '@types/chai': ^4.3.6 '@types/mocha': ^10.0.1 @@ -732,7 +732,7 @@ importers: specifiers: '@contentstack/cli-audit': ~1.4.0 '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@contentstack/management': ~1.13.0 '@oclif/core': ^2.9.3 '@oclif/test': ^2.5.6 @@ -821,7 +821,7 @@ importers: specifiers: '@apollo/client': ^3.7.9 '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/core': ^2.9.3 '@oclif/plugin-help': ^5 '@oclif/plugin-plugins': ^4.1.9 @@ -897,7 +897,7 @@ importers: packages/contentstack-migrate-rte: specifiers: '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@contentstack/json-rte-serializer': ~2.0.4 '@oclif/test': ^2.5.6 chai: ^4.3.4 @@ -944,7 +944,7 @@ importers: packages/contentstack-migration: specifiers: '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/test': ^2.5.6 async: ^3.2.4 callsites: ^3.1.0 @@ -992,7 +992,7 @@ importers: specifiers: '@contentstack/cli-cm-import': ~1.13.4 '@contentstack/cli-command': ~1.2.16 - '@contentstack/cli-utilities': ~1.5.12 + '@contentstack/cli-utilities': ~1.5.13 '@oclif/plugin-help': ^5.1.19 '@types/inquirer': ^9.0.3 '@types/jest': ^26.0.15 From bb4b5ad3948b7d17c0c8ff6cada3648d023e281d Mon Sep 17 00:00:00 2001 From: raj pandey Date: Mon, 19 Feb 2024 15:21:30 +0530 Subject: [PATCH 3/3] removed stray console log --- packages/contentstack-utilities/src/auth-handler.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/contentstack-utilities/src/auth-handler.ts b/packages/contentstack-utilities/src/auth-handler.ts index b043095d2f..98dbda88f5 100644 --- a/packages/contentstack-utilities/src/auth-handler.ts +++ b/packages/contentstack-utilities/src/auth-handler.ts @@ -207,7 +207,6 @@ class AuthHandler { async openOAuthURL(): Promise { return new Promise(async (resolve, reject) => { try { - console.log(this.codeVerifier) const digest = crypto.createHash('sha256').update(this.codeVerifier).digest(); const codeChallenge = digest.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); await this.setOAuthBaseURL();