Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
this.logger.error('failed to set the region', error);
cliux.error(`Failed to set region due to: ${error.message}`);
}
} else if (['NA', 'EU', 'AZURE-NA', 'AZURE-EU', 'GCP-NA', 'GCP-EU'].includes(selectedRegion)) {
} else if (['NA', 'EU', 'AWS-NA', 'AWS-EU', 'AZURE-NA', 'AZURE-EU', 'GCP-NA', 'GCP-EU'].includes(selectedRegion)) {
const regionDetails: Region = regionHandler.setRegion(selectedRegion);
await authHandler.setConfigData('logout'); //Todo: Handle this logout flow well through logout command call
cliux.success(`Region has been set to ${regionDetails.name}`);
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-config/src/utils/interactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
choices: [
{ name: 'NA', value: 'NA' },
{ name: 'EU', value: 'EU' },
{ name: 'AWS-NA', value: 'NA' },
{ name: 'AWS-EU', value: 'EU' },
{ name: 'AWS-NA', value: 'AWS-NA' },
{ name: 'AWS-EU', value: 'AWS-EU' },
{ name: 'AZURE-NA', value: 'AZURE-NA' },
{ name: 'AZURE-EU', value: 'AZURE-EU' },
{ name: 'GCP-NA', value: 'GCP-NA' },
Expand All @@ -20,7 +20,7 @@
});
};

export const askCustomRegion = async (): Promise<any> => {

Check warning on line 23 in packages/contentstack-config/src/utils/interactive.ts

View workflow job for this annotation

GitHub Actions / run-tests

Unexpected any. Specify a different type
const name = await cliux.inquire<string>({
type: 'input',
name: 'name',
Expand Down
18 changes: 18 additions & 0 deletions packages/contentstack-config/src/utils/region-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ const regions = {
launchHubUrl: 'https://launch-api.contentstack.com',
personalizeUrl: 'https://personalize-api.contentstack.com',
},
'AWS-NA': {
name: 'AWS-NA',
cma: 'https://api.contentstack.io',
cda: 'https://cdn.contentstack.io',
uiHost: 'https://app.contentstack.com',
developerHubUrl: 'https://developerhub-api.contentstack.com',
launchHubUrl: 'https://launch-api.contentstack.com',
personalizeUrl: 'https://personalize-api.contentstack.com',
},
EU: {
name: 'EU',
cma: 'https://eu-api.contentstack.com',
Expand All @@ -35,6 +44,15 @@ const regions = {
launchHubUrl: 'https://eu-launch-api.contentstack.com',
personalizeUrl: 'https://eu-personalize-api.contentstack.com',
},
'AWS-EU': {
name: 'AWS-EU',
cma: 'https://eu-api.contentstack.com',
cda: 'https://eu-cdn.contentstack.com',
uiHost: 'https://eu-app.contentstack.com',
developerHubUrl: 'https://eu-developerhub-api.contentstack.com',
launchHubUrl: 'https://eu-launch-api.contentstack.com',
personalizeUrl: 'https://eu-personalize-api.contentstack.com',
},
'AZURE-NA': {
name: 'AZURE-NA',
cma: 'https://azure-na-api.contentstack.com',
Expand Down
Loading