@@ -12,8 +12,7 @@ import {
12
12
import { Installation } from "@contentstack/management/types/app/installation" ;
13
13
import { AppTarget } from "@contentstack/management/types/app/index" ;
14
14
15
- import config from "../config" ;
16
- import messages , { $t , commonMsg , errors , uninstallAppMsg } from "../messages" ;
15
+ import messages , { $t , errors , uninstallAppMsg } from "../messages" ;
17
16
import {
18
17
CommonOptions ,
19
18
getOrganizations ,
@@ -159,28 +158,20 @@ async function getInstalledApps(
159
158
* @return {* } {Promise<string>}
160
159
*/
161
160
async function getDeveloperHubUrl ( ) : Promise < string > {
162
- const { cma, name } = configHandler . get ( "region" ) || { } ;
163
- let developerHubBaseUrl = ( config . developerHubUrls as Record < string , string > ) [
164
- cma
165
- ] ;
166
-
167
- if ( ! developerHubBaseUrl ) {
168
- developerHubBaseUrl = await cliux . inquire ( {
169
- type : "input" ,
170
- name : "name" ,
171
- validate : ( url ) => {
172
- if ( ! url ) return errors . BASE_URL_EMPTY ;
173
-
174
- return true ;
175
- } ,
176
- message : $t ( commonMsg . DEVELOPER_HUB_URL_PROMPT , { name } ) ,
177
- } ) ;
178
- }
161
+ const { cma } = configHandler . get ( "region" ) || { } ;
162
+ let developerHubBaseUrl = cma . replace ( "api" , "developerhub-api" ) ;
179
163
180
164
if ( developerHubBaseUrl . startsWith ( "http" ) ) {
181
165
developerHubBaseUrl = developerHubBaseUrl . split ( "//" ) [ 1 ] ;
182
166
}
183
167
168
+ developerHubBaseUrl = developerHubBaseUrl . startsWith ( "dev11" )
169
+ ? developerHubBaseUrl . replace ( "dev11" , "dev" )
170
+ : developerHubBaseUrl ;
171
+ developerHubBaseUrl = developerHubBaseUrl . endsWith ( "io" )
172
+ ? developerHubBaseUrl . replace ( "io" , "com" )
173
+ : developerHubBaseUrl ;
174
+
184
175
return developerHubBaseUrl ;
185
176
}
186
177
0 commit comments