Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 4 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fileignoreconfig:
- filename: package-lock.json
checksum: b01e61e606c0f2fd26cee8c27e00f5910973020afa72ddfb9d995f09dff6229f
checksum: 283cf2850df7f019a02b3eb957b5e970762ddf783247848000635963c1ee6eaf
- filename: pnpm-lock.yaml
checksum: e0310a5c5772a87bf606ee80722e29f9d0bc412ce10444f825a5c14dce4c1b88
checksum: 69dfee27d69de03cee3179a0a68da4d731ab912127c69aba42d840d441e318eb
- filename: packages/contentstack-import-setup/test/unit/backup-handler.test.ts
checksum: 0582d62b88834554cf12951c8690a73ef3ddbb78b82d2804d994cf4148e1ef93
- filename: packages/contentstack-import-setup/test/config.json
Expand Down Expand Up @@ -57,4 +57,6 @@ fileignoreconfig:
checksum: f93aa9b0c964608b60c88d4c72ff33840b58ec900297c4bae1f4ea365aa51048
- filename: packages/contentstack-auth/test/utils/mfa-handler.test.ts
checksum: b067f93cf0185d794e8419cc41e8fac96ed790dea8fc48dc083ee242ccacbd4d
- filename: packages/contentstack-import/src/import/module-importer.ts
checksum: bdcfad1ec3a329f9ab49a203e8ea9cb97a9db2250bc202b92cd47ccc5a193010
version: "1.0"
3,204 changes: 1,503 additions & 1,701 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-audit",
"version": "1.14.0",
"version": "1.14.1",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand All @@ -18,8 +18,8 @@
"/oclif.manifest.json"
],
"dependencies": {
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"@oclif/plugin-plugins": "^5.4.38",
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-auth",
"description": "Contentstack CLI plugin for authentication activities",
"version": "1.6.0",
"version": "1.6.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -22,8 +22,8 @@
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"otplib": "^12.0.1"
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.15.0",
"version": "1.15.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -16,9 +16,9 @@
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
},
"dependencies": {
"@contentstack/cli-cm-seed": "~1.12.0",
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-cm-seed": "~1.12.1",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"inquirer": "8.2.6",
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@contentstack/cli-cm-branches",
"description": "Contentstack CLI plugin to do branches operations",
"version": "1.5.1",
"version": "1.5.2",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-command": "~1.6.1",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-utilities": "~1.14.0",
"chalk": "^4.1.2",
"just-diff": "^6.0.2",
"lodash": "^4.17.21"
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.9.0",
"version": "1.9.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.15.1",
"version": "1.15.2",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.19.0",
"@contentstack/cli-cm-import": "~1.26.1",
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-cm-export": "~1.20.0",
"@contentstack/cli-cm-import": "~1.27.0",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-command/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-command",
"description": "Contentstack CLI plugin for configuration",
"version": "1.6.0",
"version": "1.6.1",
"author": "Contentstack",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -19,7 +19,7 @@
"test:unit": "mocha --timeout 10000 --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-utilities": "~1.14.0",
"contentstack": "^3.25.3",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28"
Expand Down
6 changes: 3 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.15.0",
"version": "1.15.1",
"author": "Contentstack",
"scripts": {
"build": "npm run clean && npm run compile",
Expand All @@ -21,8 +21,8 @@
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"lodash": "^4.17.21"
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.9.0",
"version": "1.9.1",
"author": "Abhinav Gupta @abhinav-from-contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"fast-csv": "^4.3.6",
Expand Down
12 changes: 6 additions & 6 deletions packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@contentstack/cli-cm-export",
"description": "Contentstack CLI plugin to export content from stack",
"version": "1.19.0",
"version": "1.20.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-variants": "~1.3.0",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-variants": "~1.3.1",
"@oclif/core": "^4.3.3",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-utilities": "~1.14.0",
"async": "^3.2.6",
"big-json": "^3.2.0",
"bluebird": "^3.7.2",
Expand All @@ -21,8 +21,8 @@
"winston": "^3.17.0"
},
"devDependencies": {
"@contentstack/cli-auth": "~1.6.0",
"@contentstack/cli-config": "~1.12.1",
"@contentstack/cli-auth": "~1.6.1",
"@contentstack/cli-config": "~1.15.1",
"@contentstack/cli-dev-dependencies": "~1.3.1",
"@oclif/plugin-help": "^6.2.28",
"@oclif/test": "^4.1.13",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export default class ExportCommand extends Command {
description:
"[optional] The name of the branch where you want to export your content. If you don't mention the branch name, then by default the content will be exported from all the branches of your stack.",
parse: printFlagDeprecation(['-B'], ['--branch']),
exclusive: ['branch-alias'],
}),
'branch-alias': flags.string({
char: 'b',
description: '(Optional) The alias of the branch from which you want to export content.',
exclusive: ['branch'],
}),
'secured-assets': flags.boolean({
description: '[optional] Use this flag for assets that are secured.',
Expand Down Expand Up @@ -138,7 +144,7 @@ export default class ExportCommand extends Command {
log.success(`The log has been stored at '${getLogPath()}'`, exportConfig.context);
} catch (error) {
handleAndLogError(error);
log.info(`The log has been stored at '${getLogPath()}'`)
log.info(`The log has been stored at '${getLogPath()}'`);
}
}

Expand Down
15 changes: 14 additions & 1 deletion packages/contentstack-export/src/export/module-exporter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import * as path from 'path';
import { ContentstackClient, handleAndLogError, messageHandler, log } from '@contentstack/cli-utilities';
import {
ContentstackClient,
handleAndLogError,
messageHandler,
log,
getBranchFromAlias,
} from '@contentstack/cli-utilities';
import { setupBranches, setupExportDir, writeExportMetaFile } from '../utils';
import startModuleExport from './modules';
import startJSModuleExport from './modules-js';
Expand All @@ -21,6 +27,13 @@ class ModuleExporter {

async start(): Promise<any> {
// setup the branches
if (!this.exportConfig.branchName && this.exportConfig.branchAlias) {
try {
this.exportConfig.branchName = await getBranchFromAlias(this.stackAPIClient, this.exportConfig.branchAlias);
} catch (err) {
throw err;
}
}
await setupBranches(this.exportConfig, this.stackAPIClient);
await setupExportDir(this.exportConfig);
// if branches available run it export by branches
Expand Down
1 change: 1 addition & 0 deletions packages/contentstack-export/src/types/export-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default interface ExportConfig extends DefaultConfig {
forceStopMarketplaceAppsPrompt: boolean;
auth_token?: string;
branchName?: string;
branchAlias?: string;
securedAssets?: boolean;
contentTypes?: string[];
branches?: branch[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ const setupConfig = async (exportCmdFlags: any): Promise<ExportConfig> => {
config.auth_token = configHandler.get('authtoken'); // TBD handle auth token in httpClient & sdk
config.isAuthenticated = isAuthenticated();

if (exportCmdFlags['branch-alias']) {
config.branchAlias = exportCmdFlags['branch-alias'];
}
if (exportCmdFlags['branch']) {
config.branchName = exportCmdFlags['branch'];
}
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-import-setup/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-import-setup",
"description": "Contentstack CLI plugin to setup the mappers and configurations for the import command",
"version": "1.4.1",
"version": "1.4.2",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"big-json": "^3.2.0",
"chalk": "^4.1.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.26.2",
"version": "1.27.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-audit": "~1.14.0",
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.1",
"@contentstack/cli-audit": "~1.14.1",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@contentstack/management": "~1.22.0",
"@contentstack/cli-variants": "~1.3.0",
"@contentstack/cli-variants": "~1.3.1",
"@oclif/core": "^4.3.0",
"big-json": "^3.2.0",
"bluebird": "^3.7.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ export default class ImportCommand extends Command {
description:
"The name of the branch where you want to import your content. If you don't mention the branch name, then by default the content will be imported to the main branch.",
parse: printFlagDeprecation(['-B'], ['--branch']),
exclusive: ['branch-alias'],
}),
'branch-alias': flags.string({
description:
"The alias of the branch where you want to import your content. If you don't mention the branch alias, then by default the content will be imported to the main branch.",
exclusive: ['branch'],
}),
'import-webhook-status': flags.string({
description:
Expand Down Expand Up @@ -161,7 +167,7 @@ export default class ImportCommand extends Command {

const managementAPIClient: ContentstackClient = await managementSDKClient(importConfig);

if (!flags.branch) {
if (!flags.branch && !importConfig.branchAlias) {
try {
// Use stack configuration to check for branch availability
// false positive - no hardcoded secret here
Expand Down
Loading