Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fileignoreconfig:
- filename: package-lock.json
checksum: 45100667793fc7dfaae3e24787871257e7f29e06df69ba10ec05b358d59ff15d
checksum: a76d549ee4cbf3da65907ccf49fd0f2e5027f39be8c7ac431e7e38c9b1b5df8e
- filename: pnpm-lock.yaml
checksum: 87d001c32b1d7f9df30a289c277e0ea13cfd8a0e2e5fa5118956ff4183683e5c
checksum: 6fe43d681f940f941c2a30d9cb6352b19705e006581d853a53eac64424d27f99
version: '1.0'
1,232 changes: 591 additions & 641 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/contentstack-auth/messages/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"CLI_AUTH_LOGOUT_DESCRIPTION": "User session logout",
"CLI_AUTH_LOGOUT_FLAG_FORCE": "Force logging out for skipping the confirmation",
"CLI_AUTH_LOGOUT_ALREADY": "You're already logged out",
"CLI_AUTH_LOGOUT_CANCELLED": "Log out cancelled",
"CLI_AUTH_LOGOUT_NO_AUTHORIZATIONS": "No authorizations found",
"CLI_AUTH_LOGOUT_NO_AUTHORIZATIONS_USER": "No authorizations found for current user",
"CLI_AUTH_WHOAMI_LOGGED_IN_AS": "You are currently logged in with email:",
Expand Down
2 changes: 1 addition & 1 deletion 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": "2.0.0-beta.6",
"version": "2.0.0-beta.7",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion packages/contentstack-auth/src/commands/auth/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ export default class LogoutCommand extends BaseCommand<typeof LogoutCommand> {
confirm,
isAuthenticated: oauthHandler.isAuthenticated(),
});
log.success(messageHandler.parse('CLI_AUTH_LOGOUT_ALREADY'), this.contextDetails);
const messageKey = confirm === false && oauthHandler.isAuthenticated()
? 'CLI_AUTH_LOGOUT_CANCELLED'
: 'CLI_AUTH_LOGOUT_ALREADY';
log.success(messageHandler.parse(messageKey), this.contextDetails);
}
} catch (error) {
log.debug('Logout failed.', { ...this.contextDetails, error: error.message });
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 @@ -21,7 +21,7 @@
"winston": "^3.17.0"
},
"devDependencies": {
"@contentstack/cli-auth": "~2.0.0-beta.6",
"@contentstack/cli-auth": "~2.0.0-beta.7",
"@contentstack/cli-config": "~2.0.0-beta.2",
"@contentstack/cli-dev-dependencies": "~1.3.1",
"@oclif/plugin-help": "^6.2.28",
Expand Down
5 changes: 3 additions & 2 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli",
"description": "Command-line tool (CLI) to interact with Contentstack",
"version": "2.0.0-beta.13",
"version": "2.0.0-beta.14",
"author": "Contentstack",
"bin": {
"csdx": "./bin/run.js"
Expand All @@ -25,7 +25,7 @@
"@contentstack/cli-audit": "~2.0.0-beta.5",
"@contentstack/cli-cm-export": "~2.0.0-beta.10",
"@contentstack/cli-cm-import": "~2.0.0-beta.10",
"@contentstack/cli-auth": "~2.0.0-beta.6",
"@contentstack/cli-auth": "~2.0.0-beta.7",
"@contentstack/cli-bulk-operations": "^1.0.0-beta",
"@contentstack/cli-cm-bootstrap": "~2.0.0-beta.10",
"@contentstack/cli-cm-branches": "~2.0.0-beta.1",
Expand Down Expand Up @@ -157,6 +157,7 @@
],
"hooks": {
"prerun": [
"./lib/hooks/prerun/init-context-for-command",
"./lib/hooks/prerun/default-rate-limit-check",
"./lib/hooks/prerun/latest-version-warning"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {
cliux,
messageHandler,
managementSDKInitiator,
marketplaceSDKInitiator,
} from '@contentstack/cli-utilities';
import { CsdxContext } from '../../utils';

/**
* When an invalid command is corrected (e.g. loginasda → login), init ran with the invalid
* command so context.messageFilePath was never set. Re-build context and re-init utilities
* for the actual command so i18n prompts show human-readable text.
*/
export default async function (opts: {
Command?: { id?: string };
config?: any;
}): Promise<void> {
const config = opts?.config ?? this.config;
const commandId = opts?.Command?.id;
if (!config?.context?.messageFilePath && commandId) {
config.context = new CsdxContext({ id: commandId }, config);
messageHandler.init(config.context);
cliux.init(config.context);
managementSDKInitiator.init(config.context);
marketplaceSDKInitiator.init(config.context);
}
}
Loading
Loading