Skip to content

Commit 4586ada

Browse files
authored
Merge pull request #1618 from contentstack/staging
Staging
2 parents cdb6292 + 33f4086 commit 4586ada

File tree

40 files changed

+949
-226
lines changed

40 files changed

+949
-226
lines changed

package-lock.json

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/contentstack-audit/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ EXAMPLES
269269
$ csdx plugins
270270
```
271271

272-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/index.ts)_
272+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.14/src/commands/plugins/index.ts)_
273273

274274
## `csdx plugins:add PLUGIN`
275275

@@ -343,7 +343,7 @@ EXAMPLES
343343
$ csdx plugins:inspect myplugin
344344
```
345345

346-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/inspect.ts)_
346+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.14/src/commands/plugins/inspect.ts)_
347347

348348
## `csdx plugins:install PLUGIN`
349349

@@ -392,7 +392,7 @@ EXAMPLES
392392
$ csdx plugins:install someuser/someplugin
393393
```
394394

395-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/install.ts)_
395+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.14/src/commands/plugins/install.ts)_
396396

397397
## `csdx plugins:link PATH`
398398

@@ -412,6 +412,7 @@ FLAGS
412412
413413
DESCRIPTION
414414
Links a plugin into the CLI for development.
415+
415416
Installation of a linked plugin will override a user-installed or core plugin.
416417
417418
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
@@ -422,7 +423,7 @@ EXAMPLES
422423
$ csdx plugins:link myplugin
423424
```
424425

425-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/link.ts)_
426+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.14/src/commands/plugins/link.ts)_
426427

427428
## `csdx plugins:remove [PLUGIN]`
428429

@@ -463,7 +464,7 @@ FLAGS
463464
--reinstall Reinstall all plugins after uninstalling.
464465
```
465466

466-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/reset.ts)_
467+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.14/src/commands/plugins/reset.ts)_
467468

468469
## `csdx plugins:uninstall [PLUGIN]`
469470

@@ -491,7 +492,7 @@ EXAMPLES
491492
$ csdx plugins:uninstall myplugin
492493
```
493494

494-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/uninstall.ts)_
495+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.14/src/commands/plugins/uninstall.ts)_
495496

496497
## `csdx plugins:unlink [PLUGIN]`
497498

@@ -535,5 +536,5 @@ DESCRIPTION
535536
Update installed plugins.
536537
```
537538

538-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/update.ts)_
539+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.14/src/commands/plugins/update.ts)_
539540
<!-- commandsstop -->

packages/contentstack-auth/src/commands/auth/login.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ export default class LoginCommand extends BaseCommand<typeof LoginCommand> {
6666
}
6767
} catch (error) {
6868
let errorMessage = formatError(error) || 'Something went wrong while logging. Please try again.';
69+
if (typeof errorMessage === 'object' && Object.keys(errorMessage)?.length === 0) {
70+
console.log(error);
71+
}
6972
this.logger.error('login failed', errorMessage);
7073
cliux.error('CLI_AUTH_LOGIN_FAILED');
7174
cliux.error(errorMessage);

packages/contentstack-auth/test/integration/auth.test.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ describe('contentstack-auth plugin test', () => {
2525

2626
describe('Check auth:login command with wrong credentials', () => {
2727
test
28+
.loadConfig({ root: process.cwd() })
2829
// @ts-ignore
2930
.stub(CliUx, 'inquire', async (inquire) => {
3031
switch (inquire.name) {
@@ -34,24 +35,27 @@ describe('contentstack-auth plugin test', () => {
3435
return 'WrongPassword@12345%$#@!'; // NOTE forcing wrong password
3536
}
3637
})
38+
.stub(process,'exit',()=>{})
3739
.stdout({ print: PRINT_LOGS || false })
3840
.command(['auth:login'])
3941
.it('Login should fail due to wrong credentials.!', (ctx) => {
40-
expect(ctx.stdout).to.a('string').includes('Login Error\nLooks like your email or password is invalid');
42+
expect(ctx.stdout).to.be.includes('Login Error\nLooks like your email or password is invalid. Please try again or reset your password.');
4143
});
4244
});
4345

4446
describe('Check auth:login command with --username, --password flags and wrong credentials', () => {
45-
test
47+
test.loadConfig({ root: process.cwd() })
4648
.stdout({ print: PRINT_LOGS || false })
49+
.stub(process,'exit',()=>{})
4750
.command(['auth:login', `--username=${username}`, '--password=WrongPassword@12345%$#@!'])
4851
.it('Login should fail due to wrong credentials.!', (ctx) => {
49-
expect(ctx.stdout).to.a('string').includes('Login Error\nLooks like your email or password is invalid');
52+
expect(ctx.stdout).to.a('string').includes('Login Error\nLooks like your email or password is invalid. Please try again or reset your password.');
5053
});
5154
});
5255

56+
//NOTE
5357
describe('Check auth:login command with correct credentials.', () => {
54-
test
58+
test.loadConfig({ root: process.cwd() })
5559
// @ts-ignore
5660
.stub(CliUx, 'inquire', async (inquire) => {
5761
switch (inquire.name) {
@@ -69,17 +73,17 @@ describe('contentstack-auth plugin test', () => {
6973
});
7074

7175
describe('Check auth:logout command', () => {
72-
test
76+
test.loadConfig({ root: process.cwd() })
7377
.stub(CliUx, 'inquire', async () => 'Yes')
7478
.stdout({ print: PRINT_LOGS || false })
75-
.command(['auth:logout'])
79+
.command(['auth:logout','--yes'])
7680
.it('Logout should succeed.!', (ctx) => {
7781
expect(ctx.stdout).to.a('string').includes('Successfully logged out');
7882
});
7983
});
8084

8185
describe('Check auth:login command with --username, --password flags', () => {
82-
test
86+
test.loadConfig({ root: process.cwd() })
8387
.stdout({ print: PRINT_LOGS || false })
8488
.command(['auth:login', `-u=${username}`, `-p=${password}`])
8589
.it('Login should succeed!', (ctx) => {
@@ -95,7 +99,7 @@ describe('contentstack-auth plugin test', () => {
9599
after(() => {
96100
mail = '';
97101
});
98-
test
102+
test.loadConfig({ root: process.cwd() })
99103
.stdout({ print: PRINT_LOGS || false })
100104
.command(['whoami'])
101105
.it('shows user email who logged in', (ctx) => {

packages/contentstack-branches/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
3737
$ csdx COMMAND
3838
running command...
3939
$ csdx (--version)
40-
@contentstack/cli-cm-branches/1.1.4 darwin-arm64 node-v22.2.0
40+
@contentstack/cli-cm-branches/1.2.0 darwin-arm64 node-v22.2.0
4141
$ csdx --help [COMMAND]
4242
USAGE
4343
$ csdx COMMAND

packages/contentstack-branches/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-cm-branches",
33
"description": "Contentstack CLI plugin to do branches operations",
4-
"version": "1.1.4",
4+
"version": "1.2.0",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"dependencies": {
@@ -26,7 +26,7 @@
2626
},
2727
"devDependencies": {
2828
"@contentstack/cli-auth": "~1.3.22",
29-
"@contentstack/cli-config": "~1.7.3",
29+
"@contentstack/cli-config": "~1.8.0",
3030
"@contentstack/cli-dev-dependencies": "~1.2.4",
3131
"@oclif/plugin-help": "^5.1.19",
3232
"@oclif/test": "^2.5.6",

0 commit comments

Comments
 (0)