Skip to content

Commit d37d444

Browse files
authored
Merge pull request #206 from contentstack/staging
Sprint 52 release
2 parents 2a76f63 + 6cbfe35 commit d37d444

File tree

4 files changed

+120
-51
lines changed

4 files changed

+120
-51
lines changed

package-lock.json

Lines changed: 108 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/apps-cli",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "App ClI",
55
"author": "Contentstack CLI",
66
"homepage": "https://github.com/contentstack/contentstack-apps-cli",
@@ -27,7 +27,7 @@
2727
"lodash": "^4.17.21",
2828
"open": "^9.1.0",
2929
"shelljs": "^0.8.5",
30-
"tmp": "^0.2.1",
30+
"tmp": "^0.2.2",
3131
"winston": "^3.11.0"
3232
},
3333
"devDependencies": {

src/config/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const config = {
1313
"azure-na-developerhub-api.contentstack.com",
1414
"https://azure-eu-api.contentstack.com":
1515
"azure-eu-developerhub-api.contentstack.com",
16-
"https://stag-api.csnonprod.com": "stag-developerhub-api.csnonprod.com",
1716
"https://gcp-na-api.contentstack.com": "gcp-na-developerhub-api.contentstack.com",
1817
},
1918
appBoilerplateGithubUrl:

src/util/inquirer.ts

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import {
1212
import { Installation } from "@contentstack/management/types/app/installation";
1313
import { AppTarget } from "@contentstack/management/types/app/index";
1414

15-
import config from "../config";
16-
import messages, { $t, commonMsg, errors, uninstallAppMsg } from "../messages";
15+
import messages, { $t, errors, uninstallAppMsg } from "../messages";
1716
import {
1817
CommonOptions,
1918
getOrganizations,
@@ -159,28 +158,20 @@ async function getInstalledApps(
159158
* @return {*} {Promise<string>}
160159
*/
161160
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");
179163

180164
if (developerHubBaseUrl.startsWith("http")) {
181165
developerHubBaseUrl = developerHubBaseUrl.split("//")[1];
182166
}
183167

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+
184175
return developerHubBaseUrl;
185176
}
186177

0 commit comments

Comments
 (0)