Skip to content

Commit

Permalink
fix: resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikram Kalta authored and Vikram Kalta committed Nov 7, 2023
2 parents eedea96 + 4ae5bd3 commit b5c8bf0
Show file tree
Hide file tree
Showing 44 changed files with 1,474 additions and 557 deletions.
409 changes: 277 additions & 132 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-audit/1.2.0 darwin-arm64 node-v20.8.0
@contentstack/cli-audit/1.2.1 darwin-arm64 node-v20.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"/oclif.manifest.json"
],
"dependencies": {
"@contentstack/cli-command": "~1.2.14",
"@contentstack/cli-utilities": "~1.5.4",
"@contentstack/cli-command": "~1.2.15",
"@contentstack/cli-utilities": "~1.5.5",
"@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/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-auth/1.3.15 darwin-arm64 node-v20.8.0
@contentstack/cli-auth/1.3.16 darwin-arm64 node-v20.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-command": "~1.2.13",
"@contentstack/cli-utilities": "~1.5.4",
"@contentstack/cli-command": "~1.2.15",
"@contentstack/cli-utilities": "~1.5.5",
"chalk": "^4.0.0",
"debug": "^4.1.1",
"inquirer": "8.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bootstrap/1.6.0 darwin-arm64 node-v20.8.0
@contentstack/cli-cm-bootstrap/1.7.0 darwin-arm64 node-v20.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
8 changes: 4 additions & 4 deletions packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bootstrap",
"description": "Bootstrap contentstack apps",
"version": "1.6.1",
"version": "1.7.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -17,9 +17,9 @@
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
},
"dependencies": {
"@contentstack/cli-cm-seed": "~1.6.0",
"@contentstack/cli-command": "~1.2.14",
"@contentstack/cli-utilities": "~1.5.4",
"@contentstack/cli-cm-seed": "~1.7.0",
"@contentstack/cli-command": "~1.2.15",
"@contentstack/cli-utilities": "~1.5.5",
"inquirer": "8.2.4",
"mkdirp": "^1.0.4",
"tar": "^6.1.13"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-branches/1.0.15 darwin-arm64 node-v20.8.0
@contentstack/cli-cm-branches/1.0.16 darwin-arm64 node-v20.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
10 changes: 5 additions & 5 deletions packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-branches",
"description": "Contentstack CLI plugin to do branches operations",
"version": "1.0.15",
"version": "1.0.16",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.2.13",
"@contentstack/cli-utilities": "~1.5.3",
"@contentstack/cli-command": "~1.2.15",
"@contentstack/cli-utilities": "~1.5.5",
"@oclif/core": "^2.9.3",
"async": "^3.2.4",
"big-json": "^3.2.0",
Expand All @@ -25,8 +25,8 @@
"winston": "^3.7.2"
},
"devDependencies": {
"@contentstack/cli-auth": "~1.3.14",
"@contentstack/cli-config": "~1.4.11",
"@contentstack/cli-auth": "~1.3.16",
"@contentstack/cli-config": "~1.4.14",
"@contentstack/cli-dev-dependencies": "~1.2.3",
"@oclif/plugin-help": "^5.1.19",
"@oclif/test": "^1.2.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bulk-publish/1.3.13 darwin-arm64 node-v20.8.0
@contentstack/cli-cm-bulk-publish/1.3.14 darwin-arm64 node-v20.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
6 changes: 3 additions & 3 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.3.13",
"version": "1.3.14",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.2.14",
"@contentstack/cli-utilities": "~1.5.4",
"@contentstack/cli-command": "~1.2.15",
"@contentstack/cli-utilities": "~1.5.5",
"bluebird": "^3.7.2",
"chalk": "^4.1.2",
"dotenv": "^16.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-clone/1.6.0 darwin-arm64 node-v20.8.0
@contentstack/cli-cm-clone/1.7.0 darwin-arm64 node-v20.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
10 changes: 5 additions & 5 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.6.0",
"version": "1.7.0",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@contentstack/cli-cm-export": "~1.9.0",
"@contentstack/cli-cm-import": "~1.10.0",
"@contentstack/cli-command": "~1.2.14",
"@contentstack/cli-utilities": "~1.5.4",
"@contentstack/cli-cm-export": "~1.9.3",
"@contentstack/cli-cm-import": "~1.11.0",
"@contentstack/cli-command": "~1.2.15",
"@contentstack/cli-utilities": "~1.5.5",
"@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.4",
"@contentstack/cli-utilities": "~1.5.5",
"contentstack": "^3.10.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-config/1.4.13 darwin-arm64 node-v20.8.0
@contentstack/cli-config/1.4.14 darwin-arm64 node-v20.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-command": "~1.2.14",
"@contentstack/cli-utilities": "~1.5.4",
"@contentstack/cli-command": "~1.2.15",
"@contentstack/cli-utilities": "~1.5.5",
"chalk": "^4.0.0",
"debug": "^4.1.1",
"mkdirp": "^1.0.4",
Expand Down
6 changes: 3 additions & 3 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.4.4",
"version": "1.5.0",
"author": "Abhinav Gupta @abhinav-from-contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.2.14",
"@contentstack/cli-utilities": "~1.5.4",
"@contentstack/cli-command": "~1.2.15",
"@contentstack/cli-utilities": "~1.5.5",
"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 @@ -15,8 +15,8 @@ class ExportToCsvCommand extends Command {
action: flags.string({
required: false,
multiple: false,
options: ['entries', 'users'],
description: `Option to export data (entries, users)`,
options: ['entries', 'users', 'teams'],
description: `Option to export data (entries, users, teams)`,
}),
alias: flags.string({
char: 'a',
Expand Down Expand Up @@ -59,6 +59,9 @@ class ExportToCsvCommand extends Command {
multiple: false,
required: false,
}),
"team-uid": flags.string({
description: 'Uid of the team whose user data and stack roles are required'
})
};

async run() {
Expand All @@ -75,11 +78,18 @@ class ExportToCsvCommand extends Command {
'content-type': contentTypesFlag,
alias: managementTokenAlias,
branch: branchUid,
"team-uid": teamUid
},
} = await this.parse(ExportToCsvCommand);

if (!managementTokenAlias) {
managementAPIClient = await managementSDKClient({ host: this.cmaHost });
if (!isAuthenticated()) {
this.error(config.CLI_EXPORT_CSV_ENTRIES_ERROR, {
exit: 2,
suggestions: ['https://www.contentstack.com/docs/developers/cli/authentication/'],
});
}
}

if (actionFlag) {
Expand Down Expand Up @@ -113,14 +123,6 @@ class ExportToCsvCommand extends Command {
this.error('Provided management token alias not found in your config.!');
} else {
let organization;

if (!isAuthenticated()) {
this.error(config.CLI_EXPORT_CSV_ENTRIES_ERROR, {
exit: 2,
suggestions: ['https://www.contentstack.com/docs/developers/cli/authentication/'],
});
}

if (org) {
organization = { uid: org };
} else {
Expand Down Expand Up @@ -227,12 +229,6 @@ class ExportToCsvCommand extends Command {
case config.exportUsers:
case 'users': {
try {
if (!isAuthenticated()) {
this.error(config.CLI_EXPORT_CSV_LOGIN_FAILED, {
exit: 2,
suggestions: ['https://www.contentstack.com/docs/developers/cli/authentication/'],
});
}
let organization;

if (org) {
Expand All @@ -258,6 +254,24 @@ class ExportToCsvCommand extends Command {
}
break;
}
case config.exportTeams:
case 'teams': {
try{
let organization;
if (org) {
organization = { uid: org, name: orgName || org };
} else {
organization = await util.chooseOrganization(managementAPIClient, action); // prompt for organization
}

await util.exportTeams(managementAPIClient,organization,teamUid);
} catch (error) {
if (error.message || error.errorMessage) {
cliux.error(util.formatError(error));
}
}
}
break;
}
} catch (error) {
if (error.message || error.errorMessage) {
Expand Down Expand Up @@ -310,6 +324,21 @@ ExportToCsvCommand.examples = [
'',
'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',
'csdx cm:export-to-csv --action <teams>',
'',
'Exporting Organizations Teams to CSV with org-uid',
'csdx cm:export-to-csv --action <teams> --org <org-uid>',
'',
'Exporting Organizations 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',
'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',
'csdx cm:export-to-csv --action <teams> --org <org-uid> --team-uid <team-uid> --org-name <org-name>',
];

module.exports = ExportToCsvCommand;
7 changes: 4 additions & 3 deletions packages/contentstack-export-to-csv/src/util/config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module.exports = {
cancelString: 'Cancel and Exit',
exportEntries: 'Export entries to a .CSV file',
exportUsers: "Export organization users' data to a .CSV file",
exportUsers: "Export organization user's data to a .CSV file",
exportTeams: "Export organization team's data to a .csv file",
adminError: "Unable to export data. Make sure you're an admin or owner of this organization",
organizationNameRegex: /\'/,
CLI_EXPORT_CSV_LOGIN_FAILED: "You need to login to execute this command. See: auth:login --help",
CLI_EXPORT_CSV_ENTRIES_ERROR: "You need to either login or provide a management token to execute this command"

CLI_EXPORT_CSV_ENTRIES_ERROR: "You need to either login or provide a management token to execute this command",
CLI_EXPORT_CSV_API_FAILED: 'Something went wrong. Please try again!'
};
Loading

0 comments on commit b5c8bf0

Please sign in to comment.