Skip to content
Open
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
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.8.1",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"@oclif/core": "^4.10.5",
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
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 @@
"@contentstack/cli-cm-seed": "~1.15.2",
"@contentstack/cli-command": "~1.8.1",
"@contentstack/cli-config": "~1.20.2",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"@oclif/core": "^4.10.5",
"@oclif/plugin-help": "^6.2.37",
"inquirer": "8.2.7",
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 @@ -8,7 +8,7 @@
"@contentstack/cli-command": "~1.8.1",
"@oclif/core": "^4.10.5",
"@oclif/plugin-help": "^6.2.28",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"chalk": "^4.1.2",
"just-diff": "^6.0.2",
"lodash": "^4.18.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command } from '@contentstack/cli-command';
import { messageHandler, flags, isAuthenticated } from '@contentstack/cli-utilities';
import path from 'path';
import { createBranch } from '../../../utils/create-branch';
import { interactive, handleErrorMsg } from '../../../utils';

Expand Down Expand Up @@ -27,6 +28,11 @@ export default class BranchCreateCommand extends Command {
static aliases: string[] = []; // Note: alternative usage if any

async run(): Promise<any> {
if (messageHandler.isEmptyMessages()) {
messageHandler.init({
messageFilePath: path.join(__dirname, '..', '..', '..', 'messages', 'index.json'),
});
}
const { flags: branchCreateFlags } = await this.parse(BranchCreateCommand);
let apiKey = branchCreateFlags['stack-api-key'];
let branch = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command } from '@contentstack/cli-command';
import { messageHandler, flags, cliux, isAuthenticated } from '@contentstack/cli-utilities';
import path from 'path';
import { deleteBranch } from '../../../utils/delete-branch';
import { interactive, handleErrorMsg } from '../../../utils';

Expand Down Expand Up @@ -30,6 +31,11 @@ export default class BranchDeleteCommand extends Command {
static aliases: string[] = []; // Note: alternative usage if any

async run(): Promise<any> {
if (messageHandler.isEmptyMessages()) {
messageHandler.init({
messageFilePath: path.join(__dirname, '..', '..', '..', 'messages', 'index.json'),
});
}
const { flags: branchDeleteFlags } = await this.parse(BranchDeleteCommand);
let apiKey = branchDeleteFlags['stack-api-key'];
if (!isAuthenticated()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command } from '@contentstack/cli-command';
import { messageHandler, flags, isAuthenticated } from '@contentstack/cli-utilities';
import path from 'path';
import { BranchOptions } from '../../../interfaces/index';
import { BranchDiffHandler } from '../../../branch';
import { handleErrorMsg } from '../../../utils';
Expand Down Expand Up @@ -58,6 +59,11 @@ export default class BranchDiffCommand extends Command {

async run(): Promise<any> {
try {
if (messageHandler.isEmptyMessages()) {
messageHandler.init({
messageFilePath: path.join(__dirname, '..', '..', '..', 'messages', 'index.json'),
});
}
const { flags: branchDiffFlags } = await this.parse(BranchDiffCommand);
let options: BranchOptions = {
baseBranch: branchDiffFlags['base-branch'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
isAuthenticated,
TableHeader,
} from '@contentstack/cli-utilities';
import path from 'path';
import { getbranchesList, getbranchConfig, interactive, handleErrorMsg } from '../../../utils/index';
import chalk from 'chalk';
export default class BranchListCommand extends Command {
Expand All @@ -25,6 +26,11 @@ export default class BranchListCommand extends Command {

async run(): Promise<any> {
try {
if (messageHandler.isEmptyMessages()) {
messageHandler.init({
messageFilePath: path.join(__dirname, '..', '..', '..', 'messages', 'index.json'),
});
}
const managementAPIClient = await managementSDKClient({ host: this.cmaHost });
const { flags: branchListFlags } = await this.parse(BranchListCommand);
let stackApiKey = branchListFlags['stack-api-key'];
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 @@ -7,7 +7,7 @@
"dependencies": {
"@contentstack/cli-command": "~1.8.1",
"@contentstack/cli-config": "~1.20.2",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"@oclif/core": "^4.10.5",
"@oclif/plugin-help": "^6.2.44",
"chalk": "^4.1.2",
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 @@ -9,7 +9,7 @@
"@contentstack/cli-cm-export": "~1.25.0",
"@contentstack/cli-cm-import": "~1.33.0",
"@contentstack/cli-command": "~1.8.1",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"@oclif/core": "^4.10.5",
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export-to-csv/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.8.1",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"@oclif/core": "^4.10.5",
"@oclif/plugin-help": "^6.2.32",
"fast-csv": "^4.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@contentstack/cli-command": "~1.8.1",
"@oclif/core": "^4.10.5",
"@contentstack/cli-variants": "~1.4.2",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"async": "^3.2.6",
"big-json": "^3.2.0",
"bluebird": "^3.7.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {
createLogContext,
} from '@contentstack/cli-utilities';

import path from 'path';

import { ModuleExporter } from '../../../export';
import { ExportConfig } from '../../../types';
import { setupExportConfig, writeExportMetaFile } from '../../../utils';
Expand Down Expand Up @@ -117,6 +119,12 @@ export default class ExportCommand extends Command {
static aliases: string[] = ['cm:export'];

async run(): Promise<void> {
if (messageHandler.isEmptyMessages()) {
messageHandler.init({
messageFilePath: path.join(__dirname, '..', '..', '..', '..', 'messages', 'index.json'),
});
}

let exportDir: string = pathValidator('logs');
try {
const { flags } = await this.parse(ExportCommand);
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import-setup/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.8.1",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"@oclif/core": "^4.10.5",
"big-json": "^3.2.0",
"chalk": "^4.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export default class ImportSetupCommand 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']
exclusive: ['branch-alias'],
}),
'branch-alias': flags.string({
description:
"Specify the branch alias where you want to import your content. If not specified, the content is imported into the main branch by default.",
'Specify the branch alias where you want to import your content. If not specified, the content is imported into the main branch by default.',
exclusive: ['branch'],
}),
};
Expand All @@ -69,17 +69,22 @@ export default class ImportSetupCommand extends Command {

async run(): Promise<void> {
try {
if (messageHandler.isEmptyMessages()) {
messageHandler.init({
messageFilePath: path.join(__dirname, '..', '..', '..', '..', 'messages', 'index.json'),
});
}
const { flags } = await this.parse(ImportSetupCommand);
let importSetupConfig = await setupImportConfig(flags);
// Prepare the context object
createLogContext(
this.context?.info?.command || 'cm:stacks:import-setup',
importSetupConfig.apiKey,
configHandler.get('authenticationMethod')
configHandler.get('authenticationMethod'),
);

importSetupConfig.context = { module: '' };

// Note setting host to create cma client
importSetupConfig.host = this.cmaHost;
importSetupConfig.region = this.region;
Expand All @@ -99,5 +104,4 @@ export default class ImportSetupCommand extends Command {
handleAndLogError(error);
}
}

}
2 changes: 1 addition & 1 deletion packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@contentstack/cli-audit": "~1.19.2",
"@contentstack/cli-command": "~1.8.1",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"@contentstack/cli-variants": "~1.4.2",
"@oclif/core": "^4.10.5",
"big-json": "^3.2.0",
Expand Down
12 changes: 9 additions & 3 deletions packages/contentstack-import/src/commands/cm/stacks/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
createLogContext,
} from '@contentstack/cli-utilities';

import path from 'path';
import { Context, ImportConfig } from '../../../types';
import { ModuleImporter } from '../../../import';
import { setupImportConfig } from '../../../utils';
Expand Down Expand Up @@ -153,15 +154,20 @@ export default class ImportCommand extends Command {
let backupDir: string;
let importConfig: ImportConfig;
try {
if (messageHandler.isEmptyMessages()) {
messageHandler.init({
messageFilePath: path.join(__dirname, '..', '..', '..', '..', 'messages', 'index.json'),
});
}
const { flags } = await this.parse(ImportCommand);
importConfig = await setupImportConfig(flags);
// Prepare the context object
createLogContext(
this.context?.info?.command || 'cm:stacks:export',
this.context?.info?.command || 'cm:stacks:import',
importConfig.apiKey,
importConfig.authenticationMethod
importConfig.authenticationMethod,
);

importConfig.context = { module: '' };
//log.info(`Using Cli Version: ${this.context?.cliVersion}`, importConfig.context);

Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.8.1",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"@oclif/core": "^4.10.5",
"@oclif/plugin-help": "^6.2.44",
"async": "^3.2.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-seed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@contentstack/cli-cm-import": "~1.33.0",
"@contentstack/cli-command": "~1.8.1",
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"inquirer": "8.2.7",
"mkdirp": "^1.0.4",
"tar": "^7.5.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-variants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"typescript": "^5.8.3"
},
"dependencies": {
"@contentstack/cli-utilities": "~1.18.2",
"@contentstack/cli-utilities": "~1.18.3",
"@oclif/core": "^4.10.5",
"@oclif/plugin-help": "^6.2.44",
"lodash": "^4.18.1",
Expand Down
Loading