Skip to content
Draft
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
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

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

## @contentstack/cli-cm-export
### Version: 1.22.3
#### Date: January-12-2026
##### Fix:
- Fixed error handling when empty Stack API key is provided. Now shows a clear error message instead of "tempAPIClient.stack(...).fetch is not a function"

## @contentstack/cli-cm-import
### Version: 1.30.3
#### Date: January-12-2026
##### Fix:
- Fixed error handling when empty Stack API key is provided. Now shows a clear error message instead of SDK-related errors

## @contentstack/cli-cm-import-setup
### Version: 1.7.3
#### Date: January-12-2026
##### Fix:
- Fixed error handling when empty Stack API key is provided. Now shows a clear error message instead of SDK-related errors

## @contentstack/cli-config
### Version: 1.13.1
#### Date: July-21-2025
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Contentstack
Copyright (c) 2026 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2,174 changes: 1,116 additions & 1,058 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.22.2",
"@contentstack/cli-cm-import": "~1.30.2",
"@contentstack/cli-cm-export": "~1.22.3",
"@contentstack/cli-cm-import": "~1.30.3",
"@contentstack/cli-command": "~1.7.1",
"@contentstack/cli-utilities": "~1.16.0",
"@oclif/core": "^4.3.0",
Expand Down
2 changes: 1 addition & 1 deletion 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.22.2",
"version": "1.22.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ const setupConfig = async (exportCmdFlags: any): Promise<ExportConfig> => {

config.apiKey =
exportCmdFlags['stack-uid'] || exportCmdFlags['stack-api-key'] || config.source_stack || (await askAPIKey());
if (typeof config.apiKey !== 'string') {
log.debug('Invalid API key received!', { apiKey: config.apiKey });
throw new Error('Invalid API key received');
if (typeof config.apiKey !== 'string' || !config.apiKey || !config.apiKey.trim()) {
log.debug('Invalid or empty API key received!', { apiKey: config.apiKey });
throw new Error('Invalid or empty API key received. Please provide a valid stack API key.');
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions packages/contentstack-export/src/utils/interactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,11 @@ export const askAPIKey = async (): Promise<string> => {
type: 'input',
message: 'Enter the stack api key',
name: 'apiKey',
validate: (input: string) => {
if (!input || !input.trim()) {
return 'Stack API key cannot be empty. Please enter a valid stack API key.';
}
return true;
},
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ describe('Export Config Handler', () => {
await setupConfig(flags);
expect.fail('Should have thrown an error');
} catch (error: any) {
expect(error.message).to.include('Invalid API key received');
expect(error.message).to.include('Invalid or empty API key received. Please provide a valid stack API key.');
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import-setup/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-import-setup",
"description": "Contentstack CLI plugin to setup the mappers and configurations for the import command",
"version": "1.7.2",
"version": "1.7.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
} else {
config.apiKey =
importCmdFlags['stack-uid'] || importCmdFlags['stack-api-key'] || config.target_stack || (await askAPIKey());
if (typeof config.apiKey !== 'string') {
throw new Error('Invalid API key received');
if (typeof config.apiKey !== 'string' || !config.apiKey || !config.apiKey.trim()) {
throw new Error('Invalid or empty API key received. Please provide a valid stack API key.');
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions packages/contentstack-import-setup/src/utils/interactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@ export const askAPIKey = async (): Promise<string> => {
type: 'input',
message: 'Enter the stack api key',
name: 'apiKey',
validate: (input: string) => {
if (!input || !input.trim()) {
return 'Stack API key cannot be empty. Please enter a valid stack API key.';
}
return true;
},
});
};
2 changes: 1 addition & 1 deletion packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.30.2",
"version": "1.30.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
}
config.apiKey =
importCmdFlags['stack-uid'] || importCmdFlags['stack-api-key'] || config.target_stack || (await askAPIKey());
if (typeof config.apiKey !== 'string') {
throw new Error('Invalid API key received');
if (typeof config.apiKey !== 'string' || !config.apiKey || !config.apiKey.trim()) {
log.debug('Invalid or empty API key received!', { apiKey: config.apiKey });
throw new Error('Invalid or empty API key received. Please provide a valid stack API key.');
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions packages/contentstack-import/src/utils/interactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export const askAPIKey = async (): Promise<string> => {
type: 'input',
message: 'Enter the stack api key',
name: 'apiKey',
validate: (input: string) => {
if (!input || !input.trim()) {
return 'Stack API key cannot be empty. Please enter a valid stack API key.';
}
return true;
},
});
};

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 @@ -5,7 +5,7 @@
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-cm-import": "1.30.2",
"@contentstack/cli-cm-import": "1.30.3",
"@contentstack/cli-command": "~1.7.1",
"@contentstack/cli-utilities": "~1.16.0",
"@contentstack/management": "~1.22.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
},
"dependencies": {
"@contentstack/cli-audit": "~1.16.2",
"@contentstack/cli-cm-export": "~1.22.2",
"@contentstack/cli-cm-import": "~1.30.2",
"@contentstack/cli-cm-export": "~1.22.3",
"@contentstack/cli-cm-import": "~1.30.3",
"@contentstack/cli-auth": "~1.6.3",
"@contentstack/cli-cm-bootstrap": "~1.17.2",
"@contentstack/cli-cm-branches": "~1.6.2",
"@contentstack/cli-cm-bulk-publish": "~1.10.4",
"@contentstack/cli-cm-clone": "~1.18.1",
"@contentstack/cli-cm-export-to-csv": "~1.10.2",
"@contentstack/cli-cm-import-setup": "~1.7.2",
"@contentstack/cli-cm-import-setup": "~1.7.3",
"@contentstack/cli-cm-migrate-rte": "~1.6.3",
"@contentstack/cli-cm-seed": "~1.13.2",
"@contentstack/cli-command": "~1.7.1",
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading