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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

Please refer to the Contentstack Command-line Interface release notes [here](https://www.contentstack.com/docs/developers/cli/cli-changelog).




#### Date: Feb-09-2025
## cli
- Refactor Endpoints Integration using Utils SDK in cli-cm-config v1.9.0
## cli beta
- Updated @contentstack/cli-cm-export from ~2.0.0-beta.6 to ~2.0.0-beta.7
- Updated @contentstack/cli-cm-clone from ~2.0.0-beta.7 to ~2.0.0-beta.8

## @contentstack/cli-cm-clone
### Version: 1.8.2
#### Date: June-30-2025
Expand Down
350 changes: 151 additions & 199 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dependencies": {
"@contentstack/cli-cm-seed": "~1.14.2",
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-config": "~1.19.0",
"@contentstack/cli-utilities": "~1.17.1",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-bulk-publish",
"description": "Contentstack CLI plugin for bulk publish actions",
"version": "1.10.6",
"version": "1.10.7",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-config": "~1.18.0",
"@contentstack/cli-config": "~1.19.0",
"@contentstack/cli-utilities": "~1.17.1",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.23.1",
"@contentstack/cli-cm-export": "~1.23.2",
"@contentstack/cli-cm-import": "~1.31.2",
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.1",
Expand Down
7 changes: 4 additions & 3 deletions packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-config",
"description": "Contentstack CLI plugin for configuration",
"version": "1.18.0",
"version": "1.19.0",
"author": "Contentstack",
"scripts": {
"build": "npm run clean && npm run compile",
Expand All @@ -22,7 +22,8 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.1",
"@contentstack/cli-utilities": "~1.17.0",
"@contentstack/utils": "~1.7.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"lodash": "^4.17.23"
Expand Down Expand Up @@ -80,4 +81,4 @@
}
},
"repository": "contentstack/cli"
}
}
4 changes: 4 additions & 0 deletions packages/contentstack-config/src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ export interface SetRateLimitConfig {
default?: boolean;
host?: string;
}

export interface RegionsMap {
[key: string]: Region;
}
166 changes: 63 additions & 103 deletions packages/contentstack-config/src/utils/region-handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { configHandler } from '@contentstack/cli-utilities';
import { getContentstackEndpoint } from '@contentstack/utils';
import { Region, RegionsMap } from '../interfaces';

function validURL(str) {
const pattern = new RegExp(
Expand All @@ -15,109 +17,67 @@ function validURL(str) {
return pattern.test(str);
}

// Available region list
const regions = {
NA: {
name: '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',
composableStudioUrl: 'https://composable-studio-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',
composableStudioUrl: 'https://composable-studio-api.contentstack.com',
},
EU: {
name: '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',
composableStudioUrl: 'https://eu-composable-studio-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',
composableStudioUrl: 'https://eu-composable-studio-api.contentstack.com',
},
AU: {
name: 'AU',
cma: 'https://au-api.contentstack.com',
cda: 'https://au-cdn.contentstack.com',
uiHost: 'https://au-app.contentstack.com',
developerHubUrl: 'https://au-developerhub-api.contentstack.com',
launchHubUrl: 'https://au-launch-api.contentstack.com',
personalizeUrl: 'https://au-personalize-api.contentstack.com',
composableStudioUrl: 'https://au-composable-studio-api.contentstack.com',
},
'AWS-AU': {
name: 'AWS-AU',
cma: 'https://au-api.contentstack.com',
cda: 'https://au-cdn.contentstack.com',
uiHost: 'https://au-app.contentstack.com',
developerHubUrl: 'https://au-developerhub-api.contentstack.com',
launchHubUrl: 'https://au-launch-api.contentstack.com',
personalizeUrl: 'https://au-personalize-api.contentstack.com',
composableStudioUrl: 'https://au-composable-studio-api.contentstack.com',
},
'AZURE-NA': {
name: 'AZURE-NA',
cma: 'https://azure-na-api.contentstack.com',
cda: 'https://azure-na-cdn.contentstack.com',
uiHost: 'https://azure-na-app.contentstack.com',
developerHubUrl: 'https://azure-na-developerhub-api.contentstack.com',
launchHubUrl: 'https://azure-na-launch-api.contentstack.com',
personalizeUrl: 'https://azure-na-personalize-api.contentstack.com',
composableStudioUrl: 'https://azure-na-composable-studio-api.contentstack.com',
},
'AZURE-EU': {
name: 'AZURE-EU',
cma: 'https://azure-eu-api.contentstack.com',
cda: 'https://azure-eu-cdn.contentstack.com',
uiHost: 'https://azure-eu-app.contentstack.com',
developerHubUrl: 'https://azure-eu-developerhub-api.contentstack.com',
launchHubUrl: 'https://azure-eu-launch-api.contentstack.com',
personalizeUrl: 'https://azure-eu-personalize-api.contentstack.com',
composableStudioUrl: 'https://azure-eu-composable-studio-api.contentstack.com',
},
'GCP-NA': {
name: 'GCP-NA',
cma: 'https://gcp-na-api.contentstack.com',
cda: 'https://gcp-na-cdn.contentstack.com',
uiHost: 'https://gcp-na-app.contentstack.com',
developerHubUrl: 'https://gcp-na-developerhub-api.contentstack.com',
launchHubUrl: 'https://gcp-na-launch-api.contentstack.com',
personalizeUrl: 'https://gcp-na-personalize-api.contentstack.com',
composableStudioUrl: 'https://gcp-na-composable-studio-api.contentstack.com',
},
'GCP-EU': {
name: 'GCP-EU',
cma: 'https://gcp-eu-api.contentstack.com',
cda: 'https://gcp-eu-cdn.contentstack.com',
uiHost: 'https://gcp-eu-app.contentstack.com',
developerHubUrl: 'https://gcp-eu-developerhub-api.contentstack.com',
launchHubUrl: 'https://gcp-eu-launch-api.contentstack.com',
personalizeUrl: 'https://gcp-eu-personalize-api.contentstack.com',
composableStudioUrl: 'https://gcp-eu-composable-studio-api.contentstack.com',
},
};
/**
* Helper function to build region object from @contentstack/utils
* @param {string} regionKey - Region identifier
* @returns {object} Region object with all necessary URLs
*/
function getRegionObject(regionKey: string): Region {
try {
// getContentstackEndpoint handles all aliases defined in regions.json
const endpoints = getContentstackEndpoint(regionKey) as any;

if (typeof endpoints === 'string') {
throw new Error('Invalid endpoint response');
}

return {
name: regionKey,
cma: endpoints.contentManagement,
cda: endpoints.contentDelivery,
uiHost: endpoints.application,
developerHubUrl: endpoints.developerHub,
launchHubUrl: endpoints.launch,
personalizeUrl: endpoints.personalizeManagement,
composableStudioUrl: endpoints.composableStudio,
};
} catch (error) {
return null;
}
}

/**
* Get all available regions dynamically
* This creates a regions object similar to the old hardcoded one but using @contentstack/utils
*/
function getAvailableRegions() {
const regionKeys = [
'NA',
'AWS-NA',
'EU',
'AWS-EU',
'AU',
'AWS-AU',
'AZURE-NA',
'AZURE-EU',
'GCP-NA',
'GCP-EU',
];

const regions: RegionsMap = {};

for (const key of regionKeys) {
const regionObj = getRegionObject(key);
if (regionObj) {
regions[key] = regionObj;
}
}

return regions;
}

// Available region list - now dynamically generated
const regions = getAvailableRegions();

class UserConfig {
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-export",
"description": "Contentstack CLI plugin to export content from stack",
"version": "1.23.1",
"version": "1.23.2",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand All @@ -22,7 +22,7 @@
},
"devDependencies": {
"@contentstack/cli-auth": "~1.7.3",
"@contentstack/cli-config": "~1.18.0",
"@contentstack/cli-config": "~1.19.0",
"@contentstack/cli-dev-dependencies": "~1.3.1",
"@oclif/plugin-help": "^6.2.28",
"@oclif/test": "^4.1.13",
Expand Down
8 changes: 4 additions & 4 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli",
"description": "Command-line tool (CLI) to interact with Contentstack",
"version": "1.57.1",
"version": "1.58.0",
"author": "Contentstack",
"bin": {
"csdx": "./bin/run.js"
Expand All @@ -23,19 +23,19 @@
},
"dependencies": {
"@contentstack/cli-audit": "~1.17.1",
"@contentstack/cli-cm-export": "~1.23.1",
"@contentstack/cli-cm-export": "~1.23.2",
"@contentstack/cli-cm-import": "~1.31.2",
"@contentstack/cli-auth": "~1.7.3",
"@contentstack/cli-cm-bootstrap": "~1.18.3",
"@contentstack/cli-cm-branches": "~1.6.3",
"@contentstack/cli-cm-bulk-publish": "~1.10.6",
"@contentstack/cli-cm-bulk-publish": "~1.10.7",
"@contentstack/cli-cm-clone": "~1.20.1",
"@contentstack/cli-cm-export-to-csv": "~1.11.0",
"@contentstack/cli-cm-import-setup": "~1.7.3",
"@contentstack/cli-cm-migrate-rte": "~1.6.4",
"@contentstack/cli-cm-seed": "~1.14.2",
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-config": "~1.18.0",
"@contentstack/cli-config": "~1.19.0",
"@contentstack/cli-launch": "^1.9.2",
"@contentstack/cli-migration": "~1.11.0",
"@contentstack/cli-utilities": "~1.17.1",
Expand Down
Loading
Loading