From 520ea211a0fff87dba2aa2f14194cfe78a70deba Mon Sep 17 00:00:00 2001 From: raj pandey Date: Tue, 31 Oct 2023 13:15:50 +0530 Subject: [PATCH 1/8] added api check to check the validity of the management token --- .../src/commands/cm/export-to-csv.js | 6 ++++++ packages/contentstack-utilities/src/helpers.ts | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js b/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js index 8fa579906c..d81404f4f8 100644 --- a/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js +++ b/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js @@ -6,6 +6,7 @@ const { isAuthenticated, cliux, doesBranchExist, + isManagementTokenValid } = require('@contentstack/cli-utilities'); const util = require('../../util'); const config = require('../../util/config'); @@ -109,6 +110,11 @@ class ExportToCsvCommand extends Command { apiKey: listOfTokens[managementTokenAlias].apiKey, token: listOfTokens[managementTokenAlias].token, }; + const valid = await isManagementTokenValid(stackAPIKey,listOfTokens[managementTokenAlias].token); + if(!valid) { + cliux.print("error: Exiting the command as the management token or stack api key is invalid", {color: "red"}); + process.exit(1); + } } else if (managementTokenAlias) { this.error('Provided management token alias not found in your config.!'); } else { diff --git a/packages/contentstack-utilities/src/helpers.ts b/packages/contentstack-utilities/src/helpers.ts index 600f698c27..9d78e20f87 100644 --- a/packages/contentstack-utilities/src/helpers.ts +++ b/packages/contentstack-utilities/src/helpers.ts @@ -1,4 +1,5 @@ import authHandler from './auth-handler'; +import { HttpClient, cliux, configHandler } from '.'; export const isAuthenticated = () => authHandler.isAuthenticated(); export const doesBranchExist = async (stack, branchName) => { return stack @@ -8,3 +9,15 @@ export const doesBranchExist = async (stack, branchName) => { return error; }); }; + +export const isManagementTokenValid =async (stackAPIKey, managementToken) => { + const httpClient = new HttpClient({ headers: { api_key: stackAPIKey, authorization: managementToken } }); + + const response = (await httpClient.get(`${configHandler.get('region').cma}/v3/environments?limit=1`)).data; + + if (response?.error_code === 105 || "error_code" in response) { + cliux.print(`error: Management Token or Stack API key is Not Valid. ${response.error_message || response.errorMessage}`,{color:"red"}); + return false + } + return true +} \ No newline at end of file From d8ba4c5b1eb685b7a92bf0efe2b6ee199b74d4ca Mon Sep 17 00:00:00 2001 From: raj pandey Date: Tue, 31 Oct 2023 18:46:05 +0530 Subject: [PATCH 2/8] showing the error in the command itself --- .../src/commands/cm/export-to-csv.js | 6 +++--- .../contentstack-utilities/src/helpers.ts | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js b/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js index d81404f4f8..35701cb8fd 100644 --- a/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js +++ b/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js @@ -110,9 +110,9 @@ class ExportToCsvCommand extends Command { apiKey: listOfTokens[managementTokenAlias].apiKey, token: listOfTokens[managementTokenAlias].token, }; - const valid = await isManagementTokenValid(stackAPIKey,listOfTokens[managementTokenAlias].token); - if(!valid) { - cliux.print("error: Exiting the command as the management token or stack api key is invalid", {color: "red"}); + const validObject = await isManagementTokenValid(stackAPIKey,listOfTokens[managementTokenAlias].token); + if(!validObject?.valid) { + cliux.print(`error: Management token or stack API key is invalid. ${validObject?.message||""}`, {color: "red"}); process.exit(1); } } else if (managementTokenAlias) { diff --git a/packages/contentstack-utilities/src/helpers.ts b/packages/contentstack-utilities/src/helpers.ts index 9d78e20f87..e26c43a541 100644 --- a/packages/contentstack-utilities/src/helpers.ts +++ b/packages/contentstack-utilities/src/helpers.ts @@ -10,14 +10,19 @@ export const doesBranchExist = async (stack, branchName) => { }); }; -export const isManagementTokenValid =async (stackAPIKey, managementToken) => { +export const isManagementTokenValid = async (stackAPIKey, managementToken) => { const httpClient = new HttpClient({ headers: { api_key: stackAPIKey, authorization: managementToken } }); + try { + const response = (await httpClient.get(`${configHandler.get('region').cma}/v3/environments?limit=1`))?.data; - const response = (await httpClient.get(`${configHandler.get('region').cma}/v3/environments?limit=1`)).data; - - if (response?.error_code === 105 || "error_code" in response) { - cliux.print(`error: Management Token or Stack API key is Not Valid. ${response.error_message || response.errorMessage}`,{color:"red"}); - return false + if (response?.environments) { + return { valid: true, message: `valid token and stack api key` } + } else if(response?.error_code) { + return { valid: false, message: response.error_message }; + } else { + throw typeof response === "string"? response : ""; + } + } catch (error) { + return { valid: false, message: error }; } - return true } \ No newline at end of file From 6da02417f26dff0801f3adc7fd74592552abf072 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Wed, 1 Nov 2023 12:08:07 +0530 Subject: [PATCH 3/8] version bump --- package-lock.json | 230 +++++++++--------- packages/contentstack-audit/package.json | 6 +- packages/contentstack-auth/package.json | 6 +- packages/contentstack-bootstrap/package.json | 8 +- packages/contentstack-branches/package.json | 6 +- .../contentstack-bulk-publish/package.json | 6 +- packages/contentstack-clone/package.json | 10 +- packages/contentstack-command/package.json | 4 +- packages/contentstack-config/package.json | 6 +- .../contentstack-export-to-csv/package.json | 6 +- packages/contentstack-export/package.json | 6 +- packages/contentstack-import/package.json | 6 +- packages/contentstack-launch/package.json | 6 +- .../contentstack-migrate-rte/package.json | 6 +- packages/contentstack-migration/package.json | 6 +- packages/contentstack-seed/package.json | 8 +- packages/contentstack-utilities/package.json | 2 +- packages/contentstack/package.json | 34 +-- pnpm-lock.yaml | 98 ++++---- 19 files changed, 230 insertions(+), 230 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9cbe4c49b4..f421585eb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22835,25 +22835,25 @@ }, "packages/contentstack": { "name": "@contentstack/cli", - "version": "1.10.0", + "version": "1.10.1", "license": "MIT", "dependencies": { - "@contentstack/cli-audit": "~1.2.0", - "@contentstack/cli-auth": "~1.3.15", - "@contentstack/cli-cm-bootstrap": "~1.6.0", - "@contentstack/cli-cm-branches": "~1.0.15", - "@contentstack/cli-cm-bulk-publish": "~1.3.13", - "@contentstack/cli-cm-clone": "~1.6.0", - "@contentstack/cli-cm-export": "~1.9.2", - "@contentstack/cli-cm-export-to-csv": "~1.4.4", - "@contentstack/cli-cm-import": "~1.10.0", - "@contentstack/cli-cm-migrate-rte": "~1.4.13", - "@contentstack/cli-cm-seed": "~1.6.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-config": "~1.4.13", - "@contentstack/cli-launch": "~1.0.13", - "@contentstack/cli-migration": "~1.3.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-audit": "~1.2.1", + "@contentstack/cli-auth": "~1.3.16", + "@contentstack/cli-cm-bootstrap": "~1.6.1", + "@contentstack/cli-cm-branches": "~1.0.16", + "@contentstack/cli-cm-bulk-publish": "~1.3.14", + "@contentstack/cli-cm-clone": "~1.6.1", + "@contentstack/cli-cm-export": "~1.9.3", + "@contentstack/cli-cm-export-to-csv": "~1.4.5", + "@contentstack/cli-cm-import": "~1.10.1", + "@contentstack/cli-cm-migrate-rte": "~1.4.14", + "@contentstack/cli-cm-seed": "~1.6.2", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-config": "~1.4.14", + "@contentstack/cli-launch": "~1.0.14", + "@contentstack/cli-migration": "~1.3.15", + "@contentstack/cli-utilities": "~1.5.5", "@contentstack/management": "~1.10.0", "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5", @@ -22903,11 +22903,11 @@ }, "packages/contentstack-audit": { "name": "@contentstack/cli-audit", - "version": "1.2.0", + "version": "1.2.1", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^3.8.4", "chalk": "^4.1.2", @@ -23552,11 +23552,11 @@ }, "packages/contentstack-auth": { "name": "@contentstack/cli-auth", - "version": "1.3.15", + "version": "1.3.16", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "~1.2.13", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "chalk": "^4.0.0", "debug": "^4.1.1", "inquirer": "8.2.4", @@ -23593,12 +23593,12 @@ }, "packages/contentstack-bootstrap": { "name": "@contentstack/cli-cm-bootstrap", - "version": "1.6.0", + "version": "1.6.1", "license": "MIT", "dependencies": { - "@contentstack/cli-cm-seed": "~1.6.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-cm-seed": "~1.6.2", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "inquirer": "8.2.4", "mkdirp": "^1.0.4", "tar": "^6.1.13" @@ -23672,11 +23672,11 @@ }, "packages/contentstack-branches": { "name": "@contentstack/cli-cm-branches", - "version": "1.0.15", + "version": "1.0.16", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "~1.2.13", - "@contentstack/cli-utilities": "~1.5.3", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/core": "^2.9.3", "async": "^3.2.4", "big-json": "^3.2.0", @@ -23733,11 +23733,11 @@ }, "packages/contentstack-bulk-publish": { "name": "@contentstack/cli-cm-bulk-publish", - "version": "1.3.13", + "version": "1.3.14", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "bluebird": "^3.7.2", "chalk": "^4.1.2", "dotenv": "^16.1.4", @@ -23782,14 +23782,14 @@ }, "packages/contentstack-clone": { "name": "@contentstack/cli-cm-clone", - "version": "1.6.0", + "version": "1.6.1", "license": "MIT", "dependencies": { "@colors/colors": "^1.5.0", - "@contentstack/cli-cm-export": "~1.9.0", - "@contentstack/cli-cm-import": "~1.10.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-cm-export": "~1.9.3", + "@contentstack/cli-cm-import": "~1.10.1", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "async": "^3.2.4", "chalk": "^4.1.0", "child_process": "^1.0.2", @@ -23844,10 +23844,10 @@ }, "packages/contentstack-command": { "name": "@contentstack/cli-command", - "version": "1.2.14", + "version": "1.2.15", "license": "MIT", "dependencies": { - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-utilities": "~1.5.5", "contentstack": "^3.10.1" }, "devDependencies": { @@ -23918,11 +23918,11 @@ }, "packages/contentstack-config": { "name": "@contentstack/cli-config", - "version": "1.4.13", + "version": "1.4.14", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "chalk": "^4.0.0", "debug": "^4.1.1", "inquirer": "8.2.4", @@ -24206,11 +24206,11 @@ }, "packages/contentstack-export": { "name": "@contentstack/cli-cm-export", - "version": "1.9.2", + "version": "1.9.3", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/core": "^2.9.3", "async": "^3.2.4", "big-json": "^3.2.0", @@ -24256,11 +24256,11 @@ }, "packages/contentstack-export-to-csv": { "name": "@contentstack/cli-cm-export-to-csv", - "version": "1.4.4", + "version": "1.4.5", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "chalk": "^4.1.0", "fast-csv": "^4.3.6", "inquirer": "8.2.4", @@ -24521,11 +24521,11 @@ }, "packages/contentstack-import": { "name": "@contentstack/cli-cm-import", - "version": "1.10.0", + "version": "1.10.1", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@contentstack/management": "~1.10.2", "@oclif/core": "^2.9.3", "axios": "^1.6.0", @@ -24654,12 +24654,12 @@ }, "packages/contentstack-launch": { "name": "@contentstack/cli-launch", - "version": "1.0.13", + "version": "1.0.14", "license": "MIT", "dependencies": { "@apollo/client": "^3.7.9", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^3.3.0", @@ -25145,11 +25145,11 @@ }, "packages/contentstack-migrate-rte": { "name": "@contentstack/cli-cm-migrate-rte", - "version": "1.4.13", + "version": "1.4.14", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@contentstack/json-rte-serializer": "~2.0.2", "chalk": "^4.1.2", "collapse-whitespace": "^1.1.7", @@ -25184,11 +25184,11 @@ }, "packages/contentstack-migration": { "name": "@contentstack/cli-migration", - "version": "1.3.14", + "version": "1.3.15", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "async": "^3.2.4", "callsites": "^3.1.0", "cardinal": "^2.1.1", @@ -25217,12 +25217,12 @@ }, "packages/contentstack-seed": { "name": "@contentstack/cli-cm-seed", - "version": "1.6.1", + "version": "1.6.2", "license": "MIT", "dependencies": { - "@contentstack/cli-cm-import": "~1.10.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-cm-import": "~1.10.1", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "inquirer": "8.2.4", "mkdirp": "^1.0.4", "tar": "^6.1.13", @@ -25298,7 +25298,7 @@ }, "packages/contentstack-utilities": { "name": "@contentstack/cli-utilities", - "version": "1.5.4", + "version": "1.5.5", "license": "MIT", "dependencies": { "@contentstack/management": "~1.10.2", @@ -26960,22 +26960,22 @@ "@contentstack/cli": { "version": "file:packages/contentstack", "requires": { - "@contentstack/cli-audit": "~1.2.0", - "@contentstack/cli-auth": "~1.3.15", - "@contentstack/cli-cm-bootstrap": "~1.6.0", - "@contentstack/cli-cm-branches": "~1.0.15", - "@contentstack/cli-cm-bulk-publish": "~1.3.13", - "@contentstack/cli-cm-clone": "~1.6.0", - "@contentstack/cli-cm-export": "~1.9.2", - "@contentstack/cli-cm-export-to-csv": "~1.4.4", - "@contentstack/cli-cm-import": "~1.10.0", - "@contentstack/cli-cm-migrate-rte": "~1.4.13", - "@contentstack/cli-cm-seed": "~1.6.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-config": "~1.4.13", - "@contentstack/cli-launch": "~1.0.13", - "@contentstack/cli-migration": "~1.3.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-audit": "~1.2.1", + "@contentstack/cli-auth": "~1.3.16", + "@contentstack/cli-cm-bootstrap": "~1.6.1", + "@contentstack/cli-cm-branches": "~1.0.16", + "@contentstack/cli-cm-bulk-publish": "~1.3.14", + "@contentstack/cli-cm-clone": "~1.6.1", + "@contentstack/cli-cm-export": "~1.9.3", + "@contentstack/cli-cm-export-to-csv": "~1.4.5", + "@contentstack/cli-cm-import": "~1.10.1", + "@contentstack/cli-cm-migrate-rte": "~1.4.14", + "@contentstack/cli-cm-seed": "~1.6.2", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-config": "~1.4.14", + "@contentstack/cli-launch": "~1.0.14", + "@contentstack/cli-migration": "~1.3.15", + "@contentstack/cli-utilities": "~1.5.5", "@contentstack/management": "~1.10.0", "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5", @@ -27018,8 +27018,8 @@ "@contentstack/cli-audit": { "version": "file:packages/contentstack-audit", "requires": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^3.8.4", "@oclif/test": "^2.0.3", @@ -27489,8 +27489,8 @@ "@contentstack/cli-auth": { "version": "file:packages/contentstack-auth", "requires": { - "@contentstack/cli-command": "~1.2.13", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@fancy-test/nock": "^0.1.1", "@oclif/plugin-help": "^5.1.19", "@oclif/test": "^2.2.10", @@ -27523,9 +27523,9 @@ "@contentstack/cli-cm-bootstrap": { "version": "file:packages/contentstack-bootstrap", "requires": { - "@contentstack/cli-cm-seed": "~1.6.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-cm-seed": "~1.6.2", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/test": "^2.2.10", "@types/inquirer": "^9.0.3", "@types/mkdirp": "^1.0.1", @@ -27583,10 +27583,10 @@ "version": "file:packages/contentstack-branches", "requires": { "@contentstack/cli-auth": "~1.3.14", - "@contentstack/cli-command": "~1.2.13", + "@contentstack/cli-command": "~1.2.15", "@contentstack/cli-config": "~1.4.11", "@contentstack/cli-dev-dependencies": "~1.2.3", - "@contentstack/cli-utilities": "~1.5.3", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5.1.19", "@oclif/test": "^1.2.6", @@ -27635,8 +27635,8 @@ "@contentstack/cli-cm-bulk-publish": { "version": "file:packages/contentstack-bulk-publish", "requires": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/test": "^1.2.6", "bluebird": "^3.7.2", "chai": "^4.2.0", @@ -27677,10 +27677,10 @@ "version": "file:packages/contentstack-clone", "requires": { "@colors/colors": "^1.5.0", - "@contentstack/cli-cm-export": "~1.9.0", - "@contentstack/cli-cm-import": "~1.10.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-cm-export": "~1.9.3", + "@contentstack/cli-cm-import": "~1.10.1", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/test": "^1.2.7", "async": "^3.2.4", "chai": "^4.2.0", @@ -27725,10 +27725,10 @@ "version": "file:packages/contentstack-export", "requires": { "@contentstack/cli-auth": "~1.3.14", - "@contentstack/cli-command": "~1.2.14", + "@contentstack/cli-command": "~1.2.15", "@contentstack/cli-config": "~1.4.11", "@contentstack/cli-dev-dependencies": "~1.2.3", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5.1.19", "@oclif/test": "^1.2.6", @@ -27778,8 +27778,8 @@ "@contentstack/cli-cm-export-to-csv": { "version": "file:packages/contentstack-export-to-csv", "requires": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/test": "^2.2.10", "chai": "^4.2.0", "chalk": "^4.1.0", @@ -27972,8 +27972,8 @@ "@contentstack/cli-cm-import": { "version": "file:packages/contentstack-import", "requires": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@contentstack/management": "~1.10.2", "@oclif/core": "^2.9.3", "@oclif/test": "^1.2.6", @@ -28090,8 +28090,8 @@ "@contentstack/cli-cm-migrate-rte": { "version": "file:packages/contentstack-migrate-rte", "requires": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@contentstack/json-rte-serializer": "~2.0.2", "@oclif/test": "^2.2.10", "chai": "^4.3.4", @@ -28124,9 +28124,9 @@ "@contentstack/cli-cm-seed": { "version": "file:packages/contentstack-seed", "requires": { - "@contentstack/cli-cm-import": "~1.10.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-cm-import": "~1.10.1", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/plugin-help": "^5.1.19", "@types/inquirer": "^9.0.3", "@types/jest": "^26.0.15", @@ -28185,7 +28185,7 @@ "@contentstack/cli-command": { "version": "file:packages/contentstack-command", "requires": { - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/test": "^2.2.10", "@types/chai": "^4.2.18", "@types/mkdirp": "^1.0.1", @@ -28239,8 +28239,8 @@ "@contentstack/cli-config": { "version": "file:packages/contentstack-config", "requires": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/test": "^2.2.10", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", @@ -28471,8 +28471,8 @@ "version": "file:packages/contentstack-launch", "requires": { "@apollo/client": "^3.7.9", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^3.3.0", @@ -28815,8 +28815,8 @@ "@contentstack/cli-migration": { "version": "file:packages/contentstack-migration", "requires": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/test": "^2.2.10", "async": "^3.2.4", "callsites": "^3.1.0", diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index 209588ea9d..57303f7a28 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-audit", - "version": "1.2.0", + "version": "1.2.1", "description": "Contentstack audit plugin", "author": "Contentstack CLI", "homepage": "https://github.com/contentstack/cli", @@ -18,8 +18,8 @@ "/oclif.manifest.json" ], "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^3.8.4", "chalk": "^4.1.2", diff --git a/packages/contentstack-auth/package.json b/packages/contentstack-auth/package.json index 6b5460325f..670001e46d 100644 --- a/packages/contentstack-auth/package.json +++ b/packages/contentstack-auth/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-auth", "description": "Contentstack CLI plugin for authentication activities", - "version": "1.3.15", + "version": "1.3.16", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "scripts": { @@ -22,8 +22,8 @@ "test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\"" }, "dependencies": { - "@contentstack/cli-command": "~1.2.13", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "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 e8914a7b3e..be7f73fef5 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.6.0", + "version": "1.6.1", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "scripts": { @@ -17,9 +17,9 @@ "test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\"" }, "dependencies": { - "@contentstack/cli-cm-seed": "~1.6.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-cm-seed": "~1.6.2", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "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 817065a5f2..58a8ac7ad0 100644 --- a/packages/contentstack-branches/package.json +++ b/packages/contentstack-branches/package.json @@ -1,12 +1,12 @@ { "name": "@contentstack/cli-cm-branches", "description": "Contentstack CLI plugin to do branches operations", - "version": "1.0.15", + "version": "1.0.16", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-command": "~1.2.13", - "@contentstack/cli-utilities": "~1.5.3", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@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 cd9dd6a120..ecbb4d3a59 100644 --- a/packages/contentstack-bulk-publish/package.json +++ b/packages/contentstack-bulk-publish/package.json @@ -1,12 +1,12 @@ { "name": "@contentstack/cli-cm-bulk-publish", "description": "Contentstack CLI plugin for bulk publish actions", - "version": "1.3.13", + "version": "1.3.14", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "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 d4b345e29f..2dab2a487e 100644 --- a/packages/contentstack-clone/package.json +++ b/packages/contentstack-clone/package.json @@ -1,14 +1,14 @@ { "name": "@contentstack/cli-cm-clone", "description": "Contentstack stack clone plugin", - "version": "1.6.0", + "version": "1.6.1", "author": "Contentstack", "bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues", "dependencies": { - "@contentstack/cli-cm-export": "~1.9.0", - "@contentstack/cli-cm-import": "~1.10.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-cm-export": "~1.9.3", + "@contentstack/cli-cm-import": "~1.10.1", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@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 e5223d5e02..147ac886ea 100644 --- a/packages/contentstack-command/package.json +++ b/packages/contentstack-command/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-command", "description": "Contentstack CLI plugin for configuration", - "version": "1.2.14", + "version": "1.2.15", "author": "Contentstack", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -17,7 +17,7 @@ "format": "eslint src/**/*.ts --fix" }, "dependencies": { - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-utilities": "~1.5.5", "contentstack": "^3.10.1" }, "devDependencies": { diff --git a/packages/contentstack-config/package.json b/packages/contentstack-config/package.json index 2873c003f7..b3c7bf2abf 100644 --- a/packages/contentstack-config/package.json +++ b/packages/contentstack-config/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-config", "description": "Contentstack CLI plugin for configuration", - "version": "1.4.13", + "version": "1.4.14", "author": "Contentstack", "scripts": { "build": "npm run clean && npm run compile", @@ -21,8 +21,8 @@ "test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\"" }, "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "chalk": "^4.0.0", "debug": "^4.1.1", "mkdirp": "^1.0.4", diff --git a/packages/contentstack-export-to-csv/package.json b/packages/contentstack-export-to-csv/package.json index 0f5c36b25b..7abd7b16fa 100644 --- a/packages/contentstack-export-to-csv/package.json +++ b/packages/contentstack-export-to-csv/package.json @@ -1,12 +1,12 @@ { "name": "@contentstack/cli-cm-export-to-csv", "description": "Export entities to csv", - "version": "1.4.4", + "version": "1.4.5", "author": "Abhinav Gupta @abhinav-from-contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "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 b0c89fbd78..4fd6dbd6c9 100644 --- a/packages/contentstack-export/package.json +++ b/packages/contentstack-export/package.json @@ -1,12 +1,12 @@ { "name": "@contentstack/cli-cm-export", "description": "Contentstack CLI plugin to export content from stack", - "version": "1.9.2", + "version": "1.9.3", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@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 6536e29eb8..22dc93a101 100644 --- a/packages/contentstack-import/package.json +++ b/packages/contentstack-import/package.json @@ -1,12 +1,12 @@ { "name": "@contentstack/cli-cm-import", "description": "Contentstack CLI plugin to import content into stack", - "version": "1.10.0", + "version": "1.10.1", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@contentstack/management": "~1.10.2", "@oclif/core": "^2.9.3", "axios": "^1.6.0", diff --git a/packages/contentstack-launch/package.json b/packages/contentstack-launch/package.json index 400ff67dc7..6ea48284c7 100755 --- a/packages/contentstack-launch/package.json +++ b/packages/contentstack-launch/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-launch", - "version": "1.0.13", + "version": "1.0.14", "description": "Launch related operations", "author": "Contentstack CLI", "bin": { @@ -18,8 +18,8 @@ ], "dependencies": { "@apollo/client": "^3.7.9", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^3.3.0", diff --git a/packages/contentstack-migrate-rte/package.json b/packages/contentstack-migrate-rte/package.json index ac235a1dbc..597b383483 100644 --- a/packages/contentstack-migrate-rte/package.json +++ b/packages/contentstack-migrate-rte/package.json @@ -1,12 +1,12 @@ { "name": "@contentstack/cli-cm-migrate-rte", "description": "Contentstack CLI plugin to migrate HTML RTE to JSON RTE", - "version": "1.4.13", + "version": "1.4.14", "author": "contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "@contentstack/json-rte-serializer": "~2.0.2", "collapse-whitespace": "^1.1.7", "chalk": "^4.1.2", diff --git a/packages/contentstack-migration/package.json b/packages/contentstack-migration/package.json index 61be6b7dc9..0934b26912 100644 --- a/packages/contentstack-migration/package.json +++ b/packages/contentstack-migration/package.json @@ -1,11 +1,11 @@ { "name": "@contentstack/cli-migration", - "version": "1.3.14", + "version": "1.3.15", "author": "@contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "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 e98d8582f8..74c232a264 100644 --- a/packages/contentstack-seed/package.json +++ b/packages/contentstack-seed/package.json @@ -1,13 +1,13 @@ { "name": "@contentstack/cli-cm-seed", "description": "create a Stack from existing content types, entries, assets, etc.", - "version": "1.6.1", + "version": "1.6.2", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-cm-import": "~1.10.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-cm-import": "~1.10.1", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-utilities": "~1.5.5", "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 1646027cf2..d4ae56330d 100644 --- a/packages/contentstack-utilities/package.json +++ b/packages/contentstack-utilities/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-utilities", - "version": "1.5.4", + "version": "1.5.5", "description": "Utilities for contentstack projects", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index aa73bc4db4..7cb6796624 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.10.0", + "version": "1.10.1", "author": "Contentstack", "bin": { "csdx": "./bin/run" @@ -22,22 +22,22 @@ "prepack": "pnpm compile && oclif manifest && oclif readme" }, "dependencies": { - "@contentstack/cli-audit": "~1.2.0", - "@contentstack/cli-auth": "~1.3.15", - "@contentstack/cli-cm-bootstrap": "~1.6.0", - "@contentstack/cli-cm-branches": "~1.0.15", - "@contentstack/cli-cm-bulk-publish": "~1.3.13", - "@contentstack/cli-cm-clone": "~1.6.0", - "@contentstack/cli-cm-export": "~1.9.2", - "@contentstack/cli-cm-export-to-csv": "~1.4.4", - "@contentstack/cli-cm-import": "~1.10.0", - "@contentstack/cli-cm-migrate-rte": "~1.4.13", - "@contentstack/cli-cm-seed": "~1.6.0", - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-config": "~1.4.13", - "@contentstack/cli-launch": "~1.0.13", - "@contentstack/cli-migration": "~1.3.14", - "@contentstack/cli-utilities": "~1.5.4", + "@contentstack/cli-audit": "~1.2.1", + "@contentstack/cli-auth": "~1.3.16", + "@contentstack/cli-cm-bootstrap": "~1.6.1", + "@contentstack/cli-cm-branches": "~1.0.16", + "@contentstack/cli-cm-bulk-publish": "~1.3.14", + "@contentstack/cli-cm-clone": "~1.6.1", + "@contentstack/cli-cm-export": "~1.9.3", + "@contentstack/cli-cm-export-to-csv": "~1.4.5", + "@contentstack/cli-cm-import": "~1.10.1", + "@contentstack/cli-cm-migrate-rte": "~1.4.14", + "@contentstack/cli-cm-seed": "~1.6.2", + "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-config": "~1.4.14", + "@contentstack/cli-launch": "~1.0.14", + "@contentstack/cli-migration": "~1.3.15", + "@contentstack/cli-utilities": "~1.5.5", "@contentstack/management": "~1.10.0", "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99e6a0743e..365abb8a87 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,22 +10,22 @@ importers: packages/contentstack: specifiers: - '@contentstack/cli-audit': ~1.2.0 - '@contentstack/cli-auth': ~1.3.15 - '@contentstack/cli-cm-bootstrap': ~1.6.0 - '@contentstack/cli-cm-branches': ~1.0.15 - '@contentstack/cli-cm-bulk-publish': ~1.3.13 - '@contentstack/cli-cm-clone': ~1.6.0 - '@contentstack/cli-cm-export': ~1.9.2 - '@contentstack/cli-cm-export-to-csv': ~1.4.4 - '@contentstack/cli-cm-import': ~1.10.0 - '@contentstack/cli-cm-migrate-rte': ~1.4.13 - '@contentstack/cli-cm-seed': ~1.6.0 - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-config': ~1.4.13 - '@contentstack/cli-launch': ~1.0.13 - '@contentstack/cli-migration': ~1.3.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-audit': ~1.2.1 + '@contentstack/cli-auth': ~1.3.16 + '@contentstack/cli-cm-bootstrap': ~1.6.1 + '@contentstack/cli-cm-branches': ~1.0.16 + '@contentstack/cli-cm-bulk-publish': ~1.3.14 + '@contentstack/cli-cm-clone': ~1.6.1 + '@contentstack/cli-cm-export': ~1.9.3 + '@contentstack/cli-cm-export-to-csv': ~1.4.5 + '@contentstack/cli-cm-import': ~1.10.1 + '@contentstack/cli-cm-migrate-rte': ~1.4.14 + '@contentstack/cli-cm-seed': ~1.6.2 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-config': ~1.4.14 + '@contentstack/cli-launch': ~1.0.14 + '@contentstack/cli-migration': ~1.3.15 + '@contentstack/cli-utilities': ~1.5.5 '@contentstack/management': ~1.10.0 '@oclif/core': ^2.9.3 '@oclif/plugin-help': ^5 @@ -121,8 +121,8 @@ importers: packages/contentstack-audit: specifiers: - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/plugin-help': ^5 '@oclif/plugin-plugins': ^3.8.4 '@oclif/test': ^2.0.3 @@ -178,8 +178,8 @@ importers: packages/contentstack-auth: specifiers: - '@contentstack/cli-command': ~1.2.13 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@fancy-test/nock': ^0.1.1 '@oclif/plugin-help': ^5.1.19 '@oclif/test': ^2.2.10 @@ -241,9 +241,9 @@ importers: packages/contentstack-bootstrap: specifiers: - '@contentstack/cli-cm-seed': ~1.6.0 - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-cm-seed': ~1.6.2 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/test': ^2.2.10 '@types/inquirer': ^9.0.3 '@types/mkdirp': ^1.0.1 @@ -293,10 +293,10 @@ importers: packages/contentstack-branches: specifiers: '@contentstack/cli-auth': ~1.3.14 - '@contentstack/cli-command': ~1.2.13 + '@contentstack/cli-command': ~1.2.15 '@contentstack/cli-config': ~1.4.11 '@contentstack/cli-dev-dependencies': ~1.2.3 - '@contentstack/cli-utilities': ~1.5.3 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/core': ^2.9.3 '@oclif/plugin-help': ^5.1.19 '@oclif/test': ^1.2.6 @@ -371,8 +371,8 @@ importers: packages/contentstack-bulk-publish: specifiers: - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/test': ^1.2.6 bluebird: ^3.7.2 chai: ^4.2.0 @@ -415,10 +415,10 @@ importers: packages/contentstack-clone: specifiers: '@colors/colors': ^1.5.0 - '@contentstack/cli-cm-export': ~1.9.0 - '@contentstack/cli-cm-import': ~1.10.0 - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-cm-export': ~1.9.3 + '@contentstack/cli-cm-import': ~1.10.1 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/test': ^1.2.7 async: ^3.2.4 chai: ^4.2.0 @@ -467,7 +467,7 @@ importers: packages/contentstack-command: specifiers: - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/test': ^2.2.10 '@types/chai': ^4.2.18 '@types/mkdirp': ^1.0.1 @@ -508,8 +508,8 @@ importers: packages/contentstack-config: specifiers: - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/test': ^2.2.10 '@types/chai': ^4.2.18 '@types/inquirer': ^9.0.3 @@ -593,10 +593,10 @@ importers: packages/contentstack-export: specifiers: '@contentstack/cli-auth': ~1.3.14 - '@contentstack/cli-command': ~1.2.14 + '@contentstack/cli-command': ~1.2.15 '@contentstack/cli-config': ~1.4.11 '@contentstack/cli-dev-dependencies': ~1.2.3 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/core': ^2.9.3 '@oclif/plugin-help': ^5.1.19 '@oclif/test': ^1.2.6 @@ -673,8 +673,8 @@ importers: packages/contentstack-export-to-csv: specifiers: - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/test': ^2.2.10 chai: ^4.2.0 chalk: ^4.1.0 @@ -710,8 +710,8 @@ importers: packages/contentstack-import: specifiers: - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@contentstack/management': ~1.10.2 '@oclif/core': ^2.9.3 '@oclif/test': ^1.2.6 @@ -796,8 +796,8 @@ importers: packages/contentstack-launch: specifiers: '@apollo/client': ^3.7.9 - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/core': ^2.9.3 '@oclif/plugin-help': ^5 '@oclif/plugin-plugins': ^3.3.0 @@ -872,8 +872,8 @@ importers: packages/contentstack-migrate-rte: specifiers: - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@contentstack/json-rte-serializer': ~2.0.2 '@oclif/test': ^2.2.10 chai: ^4.3.4 @@ -919,8 +919,8 @@ importers: packages/contentstack-migration: specifiers: - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/test': ^2.2.10 async: ^3.2.4 callsites: ^3.1.0 @@ -966,9 +966,9 @@ importers: packages/contentstack-seed: specifiers: - '@contentstack/cli-cm-import': ~1.10.0 - '@contentstack/cli-command': ~1.2.14 - '@contentstack/cli-utilities': ~1.5.4 + '@contentstack/cli-cm-import': ~1.10.1 + '@contentstack/cli-command': ~1.2.15 + '@contentstack/cli-utilities': ~1.5.5 '@oclif/plugin-help': ^5.1.19 '@types/inquirer': ^9.0.3 '@types/jest': ^26.0.15 From f7918f7a8eeb852d0d73e3ccb79911b812dc23f2 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Fri, 3 Nov 2023 17:23:50 +0530 Subject: [PATCH 4/8] changed the variable name and added error handling to check if the region is not set or cma url is not right and checking the token validity --- .../src/commands/cm/export-to-csv.js | 6 +++--- packages/contentstack-utilities/src/helpers.ts | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js b/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js index 35701cb8fd..6fa10a2a6b 100644 --- a/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js +++ b/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js @@ -110,9 +110,9 @@ class ExportToCsvCommand extends Command { apiKey: listOfTokens[managementTokenAlias].apiKey, token: listOfTokens[managementTokenAlias].token, }; - const validObject = await isManagementTokenValid(stackAPIKey,listOfTokens[managementTokenAlias].token); - if(!validObject?.valid) { - cliux.print(`error: Management token or stack API key is invalid. ${validObject?.message||""}`, {color: "red"}); + const checkManagementTokenValidity = await isManagementTokenValid(stackAPIKey,listOfTokens[managementTokenAlias].token); + if(!checkManagementTokenValidity?.valid) { + cliux.print(`error: Management token or stack API key is invalid. ${checkManagementTokenValidity?.message||""}`, {color: "red"}); process.exit(1); } } else if (managementTokenAlias) { diff --git a/packages/contentstack-utilities/src/helpers.ts b/packages/contentstack-utilities/src/helpers.ts index e26c43a541..d2e85eae2e 100644 --- a/packages/contentstack-utilities/src/helpers.ts +++ b/packages/contentstack-utilities/src/helpers.ts @@ -23,6 +23,7 @@ export const isManagementTokenValid = async (stackAPIKey, managementToken) => { throw typeof response === "string"? response : ""; } } catch (error) { - return { valid: false, message: error }; + cliux.print(`Failed to check the validity of the Management token. ${error}`, {color:"red"}); + process.exit(1) } } \ No newline at end of file From c32e8e5adfa53a924fa87f4101da1ea500072aa6 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Mon, 6 Nov 2023 13:32:36 +0530 Subject: [PATCH 5/8] error when merging with development --- pnpm-lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8754430f89..709fb7321a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,7 +17,7 @@ importers: '@contentstack/cli-cm-bulk-publish': ~1.3.14 '@contentstack/cli-cm-clone': ~1.6.1 '@contentstack/cli-cm-export': ~1.9.3 - '@contentstack/cli-cm-export-to-csv': ~~1.5.0 + '@contentstack/cli-cm-export-to-csv': ~1.5.0 '@contentstack/cli-cm-import': ~1.10.1 '@contentstack/cli-cm-migrate-rte': ~1.4.14 '@contentstack/cli-cm-seed': ~1.6.2 From 1cb33e9a21b25380f2b95c618ed769272a6484a3 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Tue, 7 Nov 2023 18:00:31 +0530 Subject: [PATCH 6/8] removed the process.exit from helper.ts --- .../src/commands/cm/export-to-csv.js | 3 +-- packages/contentstack-utilities/src/helpers.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js b/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js index d2c3585daa..02286bc5d4 100644 --- a/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js +++ b/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js @@ -122,8 +122,7 @@ class ExportToCsvCommand extends Command { }; const checkManagementTokenValidity = await isManagementTokenValid(stackAPIKey,listOfTokens[managementTokenAlias].token); if(!checkManagementTokenValidity?.valid) { - cliux.print(`error: Management token or stack API key is invalid. ${checkManagementTokenValidity?.message||""}`, {color: "red"}); - process.exit(1); + throw checkManagementTokenValidity.hasOwnProperty('valid')?(`error: Management token or stack API key is invalid. ${checkManagementTokenValidity?.message||""}`):checkManagementTokenValidity?.message||""; } } else if (managementTokenAlias) { this.error('Provided management token alias not found in your config.!'); diff --git a/packages/contentstack-utilities/src/helpers.ts b/packages/contentstack-utilities/src/helpers.ts index d2e85eae2e..db7e612c6e 100644 --- a/packages/contentstack-utilities/src/helpers.ts +++ b/packages/contentstack-utilities/src/helpers.ts @@ -23,7 +23,6 @@ export const isManagementTokenValid = async (stackAPIKey, managementToken) => { throw typeof response === "string"? response : ""; } } catch (error) { - cliux.print(`Failed to check the validity of the Management token. ${error}`, {color:"red"}); - process.exit(1) + return { message:`Failed to check the validity of the Management token. ${error}`}; } } \ No newline at end of file From 9d17d36724a0fd1a8b3880514a9edb40d0e5c005 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Tue, 21 Nov 2023 23:16:46 +0530 Subject: [PATCH 7/8] version issue in export-to-csv --- package-lock.json | 43 +++--------------------------- packages/contentstack/package.json | 2 +- pnpm-lock.yaml | 34 +++++------------------ 3 files changed, 11 insertions(+), 68 deletions(-) diff --git a/package-lock.json b/package-lock.json index f2ac8d42f1..6577f132db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22911,7 +22911,7 @@ "@contentstack/cli-cm-bulk-publish": "~1.3.14", "@contentstack/cli-cm-clone": "~1.7.0", "@contentstack/cli-cm-export": "~1.10.0", - "@contentstack/cli-cm-export-to-csv": "~1.5.0", + "@contentstack/cli-cm-export-to-csv": "~1.6.0", "@contentstack/cli-cm-import": "~1.11.0", "@contentstack/cli-cm-migrate-rte": "~1.4.14", "@contentstack/cli-cm-seed": "~1.7.0", @@ -26706,27 +26706,11 @@ "url": "https://github.com/sponsors/isaacs" } }, - "packages/contentstack/node_modules/@contentstack/cli-cm-export-to-csv": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@contentstack/cli-cm-export-to-csv/-/cli-cm-export-to-csv-1.5.0.tgz", - "integrity": "sha512-16v9WG7CeFpf+4q3OK2ImJZOXlL9pQQLfoSo1Zz5D1NYUSHjWlZNHzgUm8osB0iK776i2tZrZ81pKQb/cRsPkw==", - "dependencies": { - "@contentstack/cli-command": "~1.2.15", - "@contentstack/cli-utilities": "~1.5.5", - "chalk": "^4.1.0", - "fast-csv": "^4.3.6", - "inquirer": "8.2.4", - "inquirer-checkbox-plus-prompt": "1.0.1", - "mkdirp": "^3.0.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, "packages/contentstack/node_modules/@contentstack/cli-cm-export-to-csv/node_modules/mkdirp": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "extraneous": true, "bin": { "mkdirp": "dist/cjs/src/bin.js" }, @@ -27391,7 +27375,7 @@ "@contentstack/cli-cm-bulk-publish": "~1.3.14", "@contentstack/cli-cm-clone": "~1.7.0", "@contentstack/cli-cm-export": "~1.10.0", - "@contentstack/cli-cm-export-to-csv": "~1.5.0", + "@contentstack/cli-cm-export-to-csv": "~1.6.0", "@contentstack/cli-cm-import": "~1.11.0", "@contentstack/cli-cm-migrate-rte": "~1.4.14", "@contentstack/cli-cm-seed": "~1.7.0", @@ -27439,27 +27423,6 @@ "winston": "^3.7.2" }, "dependencies": { - "@contentstack/cli-cm-export-to-csv": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@contentstack/cli-cm-export-to-csv/-/cli-cm-export-to-csv-1.5.0.tgz", - "integrity": "sha512-16v9WG7CeFpf+4q3OK2ImJZOXlL9pQQLfoSo1Zz5D1NYUSHjWlZNHzgUm8osB0iK776i2tZrZ81pKQb/cRsPkw==", - "requires": { - "@contentstack/cli-command": "~1.2.15", - "@contentstack/cli-utilities": "~1.5.5", - "chalk": "^4.1.0", - "fast-csv": "^4.3.6", - "inquirer": "8.2.4", - "inquirer-checkbox-plus-prompt": "1.0.1", - "mkdirp": "^3.0.1" - }, - "dependencies": { - "mkdirp": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", - "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==" - } - } - }, "@contentstack/cli-migration": { "version": "1.3.15", "resolved": "https://registry.npmjs.org/@contentstack/cli-migration/-/cli-migration-1.3.15.tgz", diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index c433b56248..d607014d6a 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -29,7 +29,7 @@ "@contentstack/cli-cm-bulk-publish": "~1.3.14", "@contentstack/cli-cm-clone": "~1.7.0", "@contentstack/cli-cm-export": "~1.10.0", - "@contentstack/cli-cm-export-to-csv": "~1.5.0", + "@contentstack/cli-cm-export-to-csv": "~1.6.0", "@contentstack/cli-cm-import": "~1.11.0", "@contentstack/cli-cm-migrate-rte": "~1.4.14", "@contentstack/cli-cm-seed": "~1.7.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f9a97c216..81961495d8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,7 +17,7 @@ importers: '@contentstack/cli-cm-bulk-publish': ~1.3.14 '@contentstack/cli-cm-clone': ~1.7.0 '@contentstack/cli-cm-export': ~1.10.0 - '@contentstack/cli-cm-export-to-csv': ~1.5.0 + '@contentstack/cli-cm-export-to-csv': ~1.6.0 '@contentstack/cli-cm-import': ~1.11.0 '@contentstack/cli-cm-migrate-rte': ~1.4.14 '@contentstack/cli-cm-seed': ~1.7.0 @@ -71,7 +71,7 @@ importers: '@contentstack/cli-cm-bulk-publish': link:../contentstack-bulk-publish '@contentstack/cli-cm-clone': link:../contentstack-clone '@contentstack/cli-cm-export': link:../contentstack-export - '@contentstack/cli-cm-export-to-csv': 1.5.0_4qcp7qp4jxxdgb4qbxgwox4hwq + '@contentstack/cli-cm-export-to-csv': link:../contentstack-export-to-csv '@contentstack/cli-cm-import': link:../contentstack-import '@contentstack/cli-cm-migrate-rte': link:../contentstack-migrate-rte '@contentstack/cli-cm-seed': link:../contentstack-seed @@ -1561,31 +1561,11 @@ packages: engines: {node: '>=0.1.90'} dev: false - /@contentstack/cli-cm-export-to-csv/1.5.0_4qcp7qp4jxxdgb4qbxgwox4hwq: - resolution: {integrity: sha512-16v9WG7CeFpf+4q3OK2ImJZOXlL9pQQLfoSo1Zz5D1NYUSHjWlZNHzgUm8osB0iK776i2tZrZ81pKQb/cRsPkw==} - engines: {node: '>=14.0.0'} - dependencies: - '@contentstack/cli-command': 1.2.15_4qcp7qp4jxxdgb4qbxgwox4hwq - '@contentstack/cli-utilities': 1.5.5_4qcp7qp4jxxdgb4qbxgwox4hwq - chalk: 4.1.2 - fast-csv: 4.3.6 - inquirer: 8.2.4 - inquirer-checkbox-plus-prompt: 1.0.1 - mkdirp: 3.0.1 - transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - encoding - - supports-color - - typescript - dev: false - /@contentstack/cli-command/1.2.15_4qcp7qp4jxxdgb4qbxgwox4hwq: resolution: {integrity: sha512-4HZ2fRrXlFgf1DX7aEVzIbKKdRK3JOT4qbjVYSdK+bM9x9A5INV44SBZ+DILKjCPnN07Yc88SL82Isylvr7kyg==} engines: {node: '>=14.0.0'} dependencies: - '@contentstack/cli-utilities': 1.5.5_4qcp7qp4jxxdgb4qbxgwox4hwq + '@contentstack/cli-utilities': 1.5.6_4qcp7qp4jxxdgb4qbxgwox4hwq contentstack: 3.17.1 transitivePeerDependencies: - '@swc/core' @@ -1601,7 +1581,7 @@ packages: engines: {node: '>=8.3.0'} dependencies: '@contentstack/cli-command': 1.2.15_4qcp7qp4jxxdgb4qbxgwox4hwq - '@contentstack/cli-utilities': 1.5.5_4qcp7qp4jxxdgb4qbxgwox4hwq + '@contentstack/cli-utilities': 1.5.6_4qcp7qp4jxxdgb4qbxgwox4hwq async: 3.2.4 callsites: 3.1.0 cardinal: 2.1.1 @@ -1621,10 +1601,10 @@ packages: - zenObservable dev: false - /@contentstack/cli-utilities/1.5.5_4qcp7qp4jxxdgb4qbxgwox4hwq: - resolution: {integrity: sha512-LUWB5vd60V2xxlQJCwmR5Xr09zm6k13jGYSgcgC8wWofc8JUfjTVLMI58xmPrm1pq1uL9uq+mC//cUEHZvHvDQ==} + /@contentstack/cli-utilities/1.5.6_4qcp7qp4jxxdgb4qbxgwox4hwq: + resolution: {integrity: sha512-Ey/KetB5P0PHnZbteYx+9D48p/0k0wzRWHA4X+ak1Ml2u/mdMb6BY0gcnON4Xnms2zREDerRwrV07D0VE1gAKg==} dependencies: - '@contentstack/management': 1.11.0_debug@4.3.4 + '@contentstack/management': 1.12.0_debug@4.3.4 '@oclif/core': 2.15.0_4qcp7qp4jxxdgb4qbxgwox4hwq axios: 1.6.0_debug@4.3.4 chalk: 4.1.2 From e211a2aee94d8ef5334f98451e5e488d7a029ef3 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Tue, 21 Nov 2023 23:19:35 +0530 Subject: [PATCH 8/8] solved the issue listOfToken is not defined --- .../contentstack-export-to-csv/src/commands/cm/export-to-csv.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js b/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js index 4d83f9e4b2..ba33f64ed1 100644 --- a/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js +++ b/packages/contentstack-export-to-csv/src/commands/cm/export-to-csv.js @@ -118,6 +118,7 @@ class ExportToCsvCommand extends Command { let contentTypes = []; if (managementTokenAlias) { + const listOfTokens = configHandler.get('tokens'); const checkManagementTokenValidity = await isManagementTokenValid(stackAPIKey,listOfTokens[managementTokenAlias].token); if(!checkManagementTokenValidity?.valid) { throw checkManagementTokenValidity.hasOwnProperty('valid')?(`error: Management token or stack API key is invalid. ${checkManagementTokenValidity?.message||""}`):checkManagementTokenValidity?.message||"";