Skip to content

Commit

Permalink
Merge branch 'development' into fix/CS-42015
Browse files Browse the repository at this point in the history
  • Loading branch information
cs-raj committed Nov 30, 2023
2 parents 43d5e98 + cc5eb9e commit 8b40e8e
Show file tree
Hide file tree
Showing 32 changed files with 20,668 additions and 245 deletions.
20,136 changes: 20,084 additions & 52 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"dependencies": {
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.5.8",
"@contentstack/cli-utilities": "~1.5.9",
"@oclif/plugin-help": "^5",
"@oclif/plugin-plugins": "^3.8.4",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.5.8",
"@contentstack/cli-utilities": "~1.5.9",
"chalk": "^4.0.0",
"debug": "^4.1.1",
"inquirer": "8.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dependencies": {
"@contentstack/cli-cm-seed": "~1.7.0",
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.5.8",
"@contentstack/cli-utilities": "~1.5.9",
"inquirer": "8.2.4",
"mkdirp": "^1.0.4",
"tar": "^6.1.13"
Expand Down
10 changes: 10 additions & 0 deletions packages/contentstack-bootstrap/src/bootstrap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ export default class Bootstrap {
} else {
throw new Error(messageHandler.parse('CLI_BOOTSTRAP_NO_API_KEY_FOUND'));
}

if (this.options.livePreviewEnabled) {
cliux.print(
'Important: set management token and app host in the environment file before running the application',
{
color: 'yellow',
},
);
}

cliux.print(messageHandler.parse('CLI_BOOTSTRAP_SUCCESS'));
} catch (error) {
cliux.error(messageHandler.parse('CLI_BOOTSTRAP_STACK_CREATION_FAILED', this.appConfig.stack));
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-bootstrap/src/bootstrap/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ const envFileHandler = async (
filePath = path.join(clonedDirectory, fileName);
content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${
environmentVariables.deliveryToken
}\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${
customHost ? '\nCONTENTSTACK_API_HOST=' + customHost : ''
}\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nCONTENTSTACK_API_HOST=${
customHost ? customHost : managementAPIHost
}${
!isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : ''
}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}`;
}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}\nCONTENTSTACK_MANAGEMENT_TOKEN=''\nCONTENTSTACK_APP_HOST=''\nCONTENTSTACK_LIVE_EDIT_TAGS=false`;
result = await writeEnvFile(content, filePath);
break;
case 'gatsby':
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.5.8",
"@contentstack/cli-utilities": "~1.5.9",
"@oclif/core": "^2.9.3",
"async": "^3.2.4",
"big-json": "^3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.5.8",
"@contentstack/cli-utilities": "~1.5.9",
"bluebird": "^3.7.2",
"chalk": "^4.1.2",
"dotenv": "^16.1.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@contentstack/cli-cm-export": "~1.10.2",
"@contentstack/cli-cm-import": "~1.12.0",
"@contentstack/cli-cm-import": "~1.12.1",
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.5.8",
"@contentstack/cli-utilities": "~1.5.9",
"@colors/colors": "^1.5.0",
"async": "^3.2.4",
"chalk": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-command/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"format": "eslint src/**/*.ts --fix"
},
"dependencies": {
"@contentstack/cli-utilities": "~1.5.8",
"@contentstack/cli-utilities": "~1.5.9",
"contentstack": "^3.10.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.5.8",
"@contentstack/cli-utilities": "~1.5.9",
"chalk": "^4.0.0",
"debug": "^4.1.1",
"inquirer": "8.2.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-export-to-csv/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-export-to-csv",
"description": "Export entities to csv",
"version": "1.6.1",
"version": "1.6.2",
"author": "Abhinav Gupta @abhinav-from-contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.5.8",
"@contentstack/cli-utilities": "~1.5.9",
"chalk": "^4.1.0",
"fast-csv": "^4.3.6",
"inquirer": "8.2.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ class ExportToCsvCommand extends Command {
const listOfTokens = configHandler.get('tokens');
if (managementTokenAlias && listOfTokens[managementTokenAlias]) {
const checkManagementTokenValidity = await isManagementTokenValid((listOfTokens[managementTokenAlias].apiKey) ,listOfTokens[managementTokenAlias].token);
if(!checkManagementTokenValidity?.valid) {
throw checkManagementTokenValidity.hasOwnProperty('valid')?(`error: Management token or stack API key is invalid. ${checkManagementTokenValidity?.message||""}`):checkManagementTokenValidity?.message||"";
if(checkManagementTokenValidity.hasOwnProperty('message')) {
throw checkManagementTokenValidity.valid==='failedToCheck'?checkManagementTokenValidity.message:(`error: Management token or stack API key is invalid. ${checkManagementTokenValidity.message}`);
}
apiClient = await managementSDKClient({
host: this.cmaHost,
Expand Down Expand Up @@ -449,31 +449,31 @@ ExportToCsvCommand.description = `Export entries, taxonomies, terms or organizat
ExportToCsvCommand.examples = [
'csdx cm:export-to-csv',
'',
'Exporting entries to csv',
'Exporting entries to CSV',
'csdx cm:export-to-csv --action <entries> --locale <locale> --alias <management-token-alias> --content-type <content-type>',
'',
'Exporting entries to csv with stack name provided and branch name provided',
'Exporting entries to CSV with stack name provided and branch name provided',
'csdx cm:export-to-csv --action <entries> --locale <locale> --alias <management-token-alias> --content-type <content-type> --stack-name <stack-name> --branch <branch-name>',
'',
'Exporting organization users to csv',
'Exporting organization users to CSV',
'csdx cm:export-to-csv --action <users> --org <org-uid>',
'',
'Exporting organization users to csv with organization name provided',
'Exporting organization users to CSV with organization name provided',
'csdx cm:export-to-csv --action <users> --org <org-uid> --org-name <org-name>',
'',
'Exporting Organizations Teams to CSV',
'Exporting organization teams to CSV',
'csdx cm:export-to-csv --action <teams>',
'',
'Exporting Organizations Teams to CSV with org-uid',
'Exporting organization teams to CSV with org UID',
'csdx cm:export-to-csv --action <teams> --org <org-uid>',
'',
'Exporting Organizations Teams to CSV with team uid',
'Exporting organization teams to CSV with team UID',
'csdx cm:export-to-csv --action <teams> --team-uid <team-uid>',
'',
'Exporting Organizations Teams to CSV with org-uid and team uid',
'Exporting organization teams to CSV with org UID and team UID',
'csdx cm:export-to-csv --action <teams> --org <org-uid> --team-uid <team-uid>',
'',
'Exporting Organizations Teams to CSV with org-uid and team uid',
'Exporting organization teams to CSV with org UID and team UID',
'csdx cm:export-to-csv --action <teams> --org <org-uid> --team-uid <team-uid> --org-name <org-name>',
'',
'Exporting taxonomies and related terms to a .CSV file with the provided taxonomy UID',
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-export-to-csv/src/util/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module.exports = {
limit:100,
cancelString: 'Cancel and Exit',
exportEntries: 'Export entries to a .CSV file',
exportUsers: "Export organization user's data to a .CSV file",
exportTeams: "Export organization team's data to a .csv file",
exportUsers: "Export organization users' data to a .CSV file",
exportTeams: "Export organization teams' data to a .CSV file",
exportTaxonomies: 'Export taxonomies to a .CSV file',
adminError: "Unable to export data. Make sure you're an admin or owner of this organization",
organizationNameRegex: /\'/,
Expand Down
Loading

0 comments on commit 8b40e8e

Please sign in to comment.