diff --git a/package-lock.json b/package-lock.json index 8af6099849..1c56942480 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23549,9 +23549,9 @@ "@contentstack/cli-cm-branches": "~1.0.22", "@contentstack/cli-cm-bulk-publish": "~1.4.0", "@contentstack/cli-cm-clone": "~1.10.0", - "@contentstack/cli-cm-export": "~1.10.4", + "@contentstack/cli-cm-export": "~1.10.5", "@contentstack/cli-cm-export-to-csv": "~1.6.2", - "@contentstack/cli-cm-import": "~1.13.3", + "@contentstack/cli-cm-import": "~1.13.4", "@contentstack/cli-cm-migrate-rte": "~1.4.15", "@contentstack/cli-cm-seed": "~1.7.1", "@contentstack/cli-command": "~1.2.17", @@ -24092,8 +24092,8 @@ "license": "MIT", "dependencies": { "@colors/colors": "^1.5.0", - "@contentstack/cli-cm-export": "~1.10.4", - "@contentstack/cli-cm-import": "~1.13.3", + "@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.11", "async": "^3.2.4", @@ -24525,7 +24525,7 @@ }, "packages/contentstack-export": { "name": "@contentstack/cli-cm-export", - "version": "1.10.4", + "version": "1.10.5", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", @@ -24993,7 +24993,7 @@ }, "packages/contentstack-import": { "name": "@contentstack/cli-cm-import", - "version": "1.13.3", + "version": "1.13.4", "license": "MIT", "dependencies": { "@contentstack/cli-audit": "^1.3.5", @@ -25472,7 +25472,7 @@ "version": "1.7.1", "license": "MIT", "dependencies": { - "@contentstack/cli-cm-import": "~1.13.3", + "@contentstack/cli-cm-import": "~1.13.4", "@contentstack/cli-command": "~1.2.16", "@contentstack/cli-utilities": "~1.5.11", "inquirer": "8.2.4", diff --git a/packages/contentstack-clone/package.json b/packages/contentstack-clone/package.json index de90d23501..fcbd24afa4 100644 --- a/packages/contentstack-clone/package.json +++ b/packages/contentstack-clone/package.json @@ -5,8 +5,8 @@ "author": "Contentstack", "bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues", "dependencies": { - "@contentstack/cli-cm-export": "~1.10.4", - "@contentstack/cli-cm-import": "~1.13.3", + "@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.11", "@colors/colors": "^1.5.0", diff --git a/packages/contentstack-export/package.json b/packages/contentstack-export/package.json index 2b54eea5f8..a2bde1bc8a 100644 --- a/packages/contentstack-export/package.json +++ b/packages/contentstack-export/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-export", "description": "Contentstack CLI plugin to export content from stack", - "version": "1.10.4", + "version": "1.10.5", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { diff --git a/packages/contentstack-export/src/utils/interactive.ts b/packages/contentstack-export/src/utils/interactive.ts index 3004901136..6b129e1476 100644 --- a/packages/contentstack-export/src/utils/interactive.ts +++ b/packages/contentstack-export/src/utils/interactive.ts @@ -63,17 +63,4 @@ export const askAPIKey = async (): Promise => { message: 'Enter the stack api key', name: 'apiKey', }); -}; - -export const askDeveloperHub = async(regionName: string): Promise =>{ - return await cliux.inquire({ - type: 'input', - name: 'name', - validate: (url: string) => { - if (!url) return "Developer-hub URL can't be empty."; - - return true; - }, - message: `Enter the developer-hub base URL for the ${regionName} region - `, - }); -} +}; \ No newline at end of file diff --git a/packages/contentstack-export/src/utils/marketplace-app-helper.ts b/packages/contentstack-export/src/utils/marketplace-app-helper.ts index b96db792ab..5dad11cb98 100644 --- a/packages/contentstack-export/src/utils/marketplace-app-helper.ts +++ b/packages/contentstack-export/src/utils/marketplace-app-helper.ts @@ -2,16 +2,17 @@ import { cliux, configHandler, NodeCrypto, managementSDKClient } from '@contents import { formatError, log } from '../utils'; import { ExportConfig } from '../types'; -import { askDeveloperHub } from './interactive'; export const getDeveloperHubUrl = async (exportConfig: ExportConfig) => { const { cma, name } = configHandler.get('region') || {}; let developerHubBaseUrl = exportConfig?.developerHubUrls[cma]; if (!developerHubBaseUrl) { - developerHubBaseUrl = await askDeveloperHub(name); + developerHubBaseUrl = exportConfig.host?.replace('api','develperhub-api'); } + developerHubBaseUrl = developerHubBaseUrl.startsWith('dev9')?developerHubBaseUrl.replace('dev9','dev'):developerHubBaseUrl + return developerHubBaseUrl.startsWith('http') ? developerHubBaseUrl : `https://${developerHubBaseUrl}`; }; diff --git a/packages/contentstack-import/package.json b/packages/contentstack-import/package.json index dc5c4aa3cb..66120d55d8 100644 --- a/packages/contentstack-import/package.json +++ b/packages/contentstack-import/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-import", "description": "Contentstack CLI plugin to import content into stack", - "version": "1.13.3", + "version": "1.13.4", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { diff --git a/packages/contentstack-import/src/utils/interactive.ts b/packages/contentstack-import/src/utils/interactive.ts index c949030275..42a4703964 100644 --- a/packages/contentstack-import/src/utils/interactive.ts +++ b/packages/contentstack-import/src/utils/interactive.ts @@ -20,17 +20,6 @@ export const askAPIKey = async (): Promise => { }); }; -export const askDeveloperHubUrl = async (regionName: string): Promise => { - return await cliux.inquire({ - type: 'input', - name: 'name', - validate: (url) => { - if (!url) return "Developer-hub URL can't be empty."; - return true; - }, - message: `Enter the developer-hub base URL for the ${regionName} region -`, - }); -}; export const askEncryptionKey = async(defaultValue: unknown): Promise => { return await cliux.inquire({ diff --git a/packages/contentstack-import/src/utils/marketplace-app-helper.ts b/packages/contentstack-import/src/utils/marketplace-app-helper.ts index e789633796..8186f0d349 100644 --- a/packages/contentstack-import/src/utils/marketplace-app-helper.ts +++ b/packages/contentstack-import/src/utils/marketplace-app-helper.ts @@ -15,7 +15,6 @@ import { log } from './logger'; import { trace } from '../utils/log'; import { ImportConfig, Installation } from '../types'; import { formatError } from '../utils'; -import { askDeveloperHubUrl } from './interactive'; import { getAppName, askAppName, selectConfiguration } from '../utils/interactive'; export const getAllStackSpecificApps = async ( @@ -57,10 +56,11 @@ export const getAllStackSpecificApps = async ( export const getDeveloperHubUrl = async (config: ImportConfig): Promise => { const { cma, name } = configHandler.get('region') || {}; let developerHubBaseUrl = config.developerHubUrls[cma]; - + if (!developerHubBaseUrl) { - developerHubBaseUrl = await askDeveloperHubUrl(name); + developerHubBaseUrl = config.host?.replace('api','developerhub-api'); } + developerHubBaseUrl = developerHubBaseUrl.startsWith('dev9')?developerHubBaseUrl.replace('dev9','dev'):developerHubBaseUrl return developerHubBaseUrl.startsWith('http') ? developerHubBaseUrl : `https://${developerHubBaseUrl}`; }; diff --git a/packages/contentstack-seed/package.json b/packages/contentstack-seed/package.json index 2322efead6..c279ba12ca 100644 --- a/packages/contentstack-seed/package.json +++ b/packages/contentstack-seed/package.json @@ -5,7 +5,7 @@ "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-cm-import": "~1.13.3", + "@contentstack/cli-cm-import": "~1.13.4", "@contentstack/cli-command": "~1.2.16", "@contentstack/cli-utilities": "~1.5.11", "inquirer": "8.2.4", diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index a4dcfad222..e03f890df0 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -28,9 +28,9 @@ "@contentstack/cli-cm-branches": "~1.0.22", "@contentstack/cli-cm-bulk-publish": "~1.4.0", "@contentstack/cli-cm-clone": "~1.10.0", - "@contentstack/cli-cm-export": "~1.10.4", + "@contentstack/cli-cm-export": "~1.10.5", "@contentstack/cli-cm-export-to-csv": "~1.6.2", - "@contentstack/cli-cm-import": "~1.13.3", + "@contentstack/cli-cm-import": "~1.13.4", "@contentstack/cli-cm-migrate-rte": "~1.4.15", "@contentstack/cli-cm-seed": "~1.7.1", "@contentstack/cli-command": "~1.2.17", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1031c54d4a..cfbeac1257 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,9 +16,9 @@ importers: '@contentstack/cli-cm-branches': ~1.0.22 '@contentstack/cli-cm-bulk-publish': ~1.4.0 '@contentstack/cli-cm-clone': ~1.10.0 - '@contentstack/cli-cm-export': ~1.10.4 + '@contentstack/cli-cm-export': ~1.10.5 '@contentstack/cli-cm-export-to-csv': ~1.6.2 - '@contentstack/cli-cm-import': ~1.13.3 + '@contentstack/cli-cm-import': ~1.13.4 '@contentstack/cli-cm-migrate-rte': ~1.4.15 '@contentstack/cli-cm-seed': ~1.7.1 '@contentstack/cli-command': ~1.2.17 @@ -423,8 +423,8 @@ importers: packages/contentstack-clone: specifiers: '@colors/colors': ^1.5.0 - '@contentstack/cli-cm-export': ~1.10.4 - '@contentstack/cli-cm-import': ~1.13.3 + '@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.11 '@oclif/test': ^2.5.6 @@ -990,7 +990,7 @@ importers: packages/contentstack-seed: specifiers: - '@contentstack/cli-cm-import': ~1.13.3 + '@contentstack/cli-cm-import': ~1.13.4 '@contentstack/cli-command': ~1.2.16 '@contentstack/cli-utilities': ~1.5.11 '@oclif/plugin-help': ^5.1.19