@contentstack/cli-auth 1.3.22 → 1.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/lib/commands/auth/login.js +7 -3
- package/lib/commands/auth/logout.js +2 -2
- package/lib/commands/auth/tokens/add.js +1 -1
- package/lib/commands/auth/tokens/remove.js +2 -2
- package/messages/index.json +1 -1
- package/oclif.manifest.json +9 -9
- package/package.json +21 -29
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
|
|
|
18
18
|
$ csdx COMMAND
|
|
19
19
|
running command...
|
|
20
20
|
$ csdx (--version)
|
|
21
|
-
@contentstack/cli-auth/1.3.
|
|
21
|
+
@contentstack/cli-auth/1.3.23 linux-x64 node-v18.20.6
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
|
@@ -49,9 +49,9 @@ USAGE
|
|
|
49
49
|
$ csdx auth:login [-u <value> | --oauth] [-p <value> | ]
|
|
50
50
|
|
|
51
51
|
FLAGS
|
|
52
|
-
-p, --password=<value> Password
|
|
53
|
-
-u, --username=<value>
|
|
54
|
-
--oauth Enables single sign-on (SSO) in Contentstack CLI
|
|
52
|
+
-p, --password=<value> Password of your Contentstack app.
|
|
53
|
+
-u, --username=<value> Email address of your Contentstack account.
|
|
54
|
+
--oauth Enables single sign-on (SSO) in Contentstack CLI.
|
|
55
55
|
|
|
56
56
|
DESCRIPTION
|
|
57
57
|
User sessions login
|
|
@@ -82,7 +82,7 @@ USAGE
|
|
|
82
82
|
$ csdx auth:logout [-y]
|
|
83
83
|
|
|
84
84
|
FLAGS
|
|
85
|
-
-y, --yes Force log out by skipping the confirmation
|
|
85
|
+
-y, --yes Force log out by skipping the confirmation.
|
|
86
86
|
|
|
87
87
|
DESCRIPTION
|
|
88
88
|
User session logout
|
|
@@ -141,7 +141,7 @@ USAGE
|
|
|
141
141
|
$ csdx auth:tokens:add [-a <value>] [--delivery] [--management] [-e <value>] [-k <value>] [-y] [--token <value>]
|
|
142
142
|
|
|
143
143
|
FLAGS
|
|
144
|
-
-a, --alias=<value>
|
|
144
|
+
-a, --alias=<value> Alias (name) you want to assign to the token
|
|
145
145
|
-d, --delivery Set this flag to save delivery token
|
|
146
146
|
-e, --environment=<value> Environment name for delivery token
|
|
147
147
|
-k, --stack-api-key=<value> Stack API Key
|
|
@@ -187,8 +187,8 @@ USAGE
|
|
|
187
187
|
$ csdx auth:tokens:remove [-a <value>] [-i]
|
|
188
188
|
|
|
189
189
|
FLAGS
|
|
190
|
-
-a, --alias=<value>
|
|
191
|
-
-i, --ignore
|
|
190
|
+
-a, --alias=<value> Alias (name) of the token to delete.
|
|
191
|
+
-i, --ignore Ignores if the token is not present.
|
|
192
192
|
|
|
193
193
|
DESCRIPTION
|
|
194
194
|
Removes selected tokens
|
|
@@ -230,9 +230,9 @@ USAGE
|
|
|
230
230
|
$ csdx login [-u <value> | --oauth] [-p <value> | ]
|
|
231
231
|
|
|
232
232
|
FLAGS
|
|
233
|
-
-p, --password=<value> Password
|
|
234
|
-
-u, --username=<value>
|
|
235
|
-
--oauth Enables single sign-on (SSO) in Contentstack CLI
|
|
233
|
+
-p, --password=<value> Password of your Contentstack app.
|
|
234
|
+
-u, --username=<value> Email address of your Contentstack account.
|
|
235
|
+
--oauth Enables single sign-on (SSO) in Contentstack CLI.
|
|
236
236
|
|
|
237
237
|
DESCRIPTION
|
|
238
238
|
User sessions login
|
|
@@ -261,7 +261,7 @@ USAGE
|
|
|
261
261
|
$ csdx logout [-y]
|
|
262
262
|
|
|
263
263
|
FLAGS
|
|
264
|
-
-y, --yes Force log out by skipping the confirmation
|
|
264
|
+
-y, --yes Force log out by skipping the confirmation.
|
|
265
265
|
|
|
266
266
|
DESCRIPTION
|
|
267
267
|
User session logout
|
|
@@ -5,6 +5,7 @@ const utils_1 = require("../../utils");
|
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
class LoginCommand extends base_command_1.BaseCommand {
|
|
7
7
|
async run() {
|
|
8
|
+
var _a;
|
|
8
9
|
try {
|
|
9
10
|
const managementAPIClient = await (0, cli_utilities_1.managementSDKClient)({ host: this.cmaHost, skipTokenValidity: true });
|
|
10
11
|
const { flags: loginFlags } = await this.parse(LoginCommand);
|
|
@@ -23,6 +24,9 @@ class LoginCommand extends base_command_1.BaseCommand {
|
|
|
23
24
|
}
|
|
24
25
|
catch (error) {
|
|
25
26
|
let errorMessage = (0, cli_utilities_1.formatError)(error) || 'Something went wrong while logging. Please try again.';
|
|
27
|
+
if (typeof errorMessage === 'object' && ((_a = Object.keys(errorMessage)) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
28
|
+
console.log(error);
|
|
29
|
+
}
|
|
26
30
|
this.logger.error('login failed', errorMessage);
|
|
27
31
|
cli_utilities_1.cliux.error('CLI_AUTH_LOGIN_FAILED');
|
|
28
32
|
cli_utilities_1.cliux.error(errorMessage);
|
|
@@ -56,20 +60,20 @@ LoginCommand.examples = [
|
|
|
56
60
|
LoginCommand.flags = {
|
|
57
61
|
username: cli_utilities_1.flags.string({
|
|
58
62
|
char: 'u',
|
|
59
|
-
description: '
|
|
63
|
+
description: 'Email address of your Contentstack account.',
|
|
60
64
|
multiple: false,
|
|
61
65
|
required: false,
|
|
62
66
|
exclusive: ['oauth'],
|
|
63
67
|
}),
|
|
64
68
|
password: cli_utilities_1.flags.string({
|
|
65
69
|
char: 'p',
|
|
66
|
-
description: 'Password',
|
|
70
|
+
description: 'Password of your Contentstack app.',
|
|
67
71
|
multiple: false,
|
|
68
72
|
required: false,
|
|
69
73
|
exclusive: ['oauth'],
|
|
70
74
|
}),
|
|
71
75
|
oauth: cli_utilities_1.flags.boolean({
|
|
72
|
-
description: 'Enables single sign-on (SSO) in Contentstack CLI',
|
|
76
|
+
description: 'Enables single sign-on (SSO) in Contentstack CLI.',
|
|
73
77
|
required: false,
|
|
74
78
|
default: false,
|
|
75
79
|
exclusive: ['username', 'password'],
|
|
@@ -52,13 +52,13 @@ LogoutCommand.examples = ['$ csdx auth:logout', '$ csdx auth:logout -y', '$ csdx
|
|
|
52
52
|
LogoutCommand.flags = {
|
|
53
53
|
yes: cli_utilities_1.flags.boolean({
|
|
54
54
|
char: 'y',
|
|
55
|
-
description: 'Force log out by skipping the confirmation',
|
|
55
|
+
description: 'Force log out by skipping the confirmation.',
|
|
56
56
|
required: false,
|
|
57
57
|
default: false,
|
|
58
58
|
}),
|
|
59
59
|
force: cli_utilities_1.flags.boolean({
|
|
60
60
|
char: 'f',
|
|
61
|
-
description: 'Force log out by skipping the confirmation',
|
|
61
|
+
description: 'Force log out by skipping the confirmation.',
|
|
62
62
|
required: false,
|
|
63
63
|
hidden: true,
|
|
64
64
|
default: false,
|
|
@@ -100,7 +100,7 @@ TokensAddCommand.examples = [
|
|
|
100
100
|
'$ csdx auth:tokens:add --alias <alias> --stack-api-key <stack api key> --delivery -e <environment> --token <delivery token>',
|
|
101
101
|
];
|
|
102
102
|
TokensAddCommand.flags = {
|
|
103
|
-
alias: cli_utilities_1.Flags.string({ char: 'a', description: '
|
|
103
|
+
alias: cli_utilities_1.Flags.string({ char: 'a', description: 'Alias (name) you want to assign to the token' }),
|
|
104
104
|
delivery: cli_utilities_1.flags.boolean({
|
|
105
105
|
char: 'd',
|
|
106
106
|
description: 'Set this flag to save delivery token',
|
|
@@ -54,6 +54,6 @@ exports.default = TokensRemoveCommand;
|
|
|
54
54
|
TokensRemoveCommand.description = 'Removes selected tokens';
|
|
55
55
|
TokensRemoveCommand.examples = ['$ csdx auth:tokens:remove', '$ csdx auth:tokens:remove -a <alias>'];
|
|
56
56
|
TokensRemoveCommand.flags = {
|
|
57
|
-
alias: cli_utilities_1.flags.string({ char: 'a', description: '
|
|
58
|
-
ignore: cli_utilities_1.flags.boolean({ char: 'i', description: '
|
|
57
|
+
alias: cli_utilities_1.flags.string({ char: 'a', description: 'Alias (name) of the token to delete.' }),
|
|
58
|
+
ignore: cli_utilities_1.flags.boolean({ char: 'i', description: 'Ignores if the token is not present.' }),
|
|
59
59
|
};
|
package/messages/index.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"CLI_AUTH_WHOAMI_DESCRIPTION": "Display current users email address",
|
|
24
24
|
"CLI_AUTH_TOKENS_ADD_ASK_TOKEN_ALIAS": "Provide alias to store token",
|
|
25
25
|
"CLI_AUTH_TOKENS_ADD_CONFIRM_ALIAS_REPLACE": "Alias is already exists, do you want to replace?",
|
|
26
|
-
"CLI_AUTH_TOKENS_ADD_ENTER_API_KEY": "Enter the
|
|
26
|
+
"CLI_AUTH_TOKENS_ADD_ENTER_API_KEY": "Enter the API key",
|
|
27
27
|
"CLI_AUTH_TOKENS_ADD_ENTER_TOKEN": "Enter the token",
|
|
28
28
|
"CLI_AUTH_TOKENS_ADD_ENTER_ENVIRONMENT": "Enter the environment name",
|
|
29
29
|
"CLI_AUTH_TOKENS_ADD_REPLACE_SUCCESS": "Successfully replaced the token",
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.3.
|
|
2
|
+
"version": "1.3.23",
|
|
3
3
|
"commands": {
|
|
4
4
|
"auth:login": {
|
|
5
5
|
"id": "auth:login",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"name": "username",
|
|
25
25
|
"type": "option",
|
|
26
26
|
"char": "u",
|
|
27
|
-
"description": "
|
|
27
|
+
"description": "Email address of your Contentstack account.",
|
|
28
28
|
"required": false,
|
|
29
29
|
"multiple": false,
|
|
30
30
|
"exclusive": [
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"name": "password",
|
|
36
36
|
"type": "option",
|
|
37
37
|
"char": "p",
|
|
38
|
-
"description": "Password",
|
|
38
|
+
"description": "Password of your Contentstack app.",
|
|
39
39
|
"required": false,
|
|
40
40
|
"multiple": false,
|
|
41
41
|
"exclusive": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"oauth": {
|
|
46
46
|
"name": "oauth",
|
|
47
47
|
"type": "boolean",
|
|
48
|
-
"description": "Enables single sign-on (SSO) in Contentstack CLI",
|
|
48
|
+
"description": "Enables single sign-on (SSO) in Contentstack CLI.",
|
|
49
49
|
"required": false,
|
|
50
50
|
"allowNo": false,
|
|
51
51
|
"exclusive": [
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"name": "yes",
|
|
78
78
|
"type": "boolean",
|
|
79
79
|
"char": "y",
|
|
80
|
-
"description": "Force log out by skipping the confirmation",
|
|
80
|
+
"description": "Force log out by skipping the confirmation.",
|
|
81
81
|
"required": false,
|
|
82
82
|
"allowNo": false
|
|
83
83
|
},
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"name": "force",
|
|
86
86
|
"type": "boolean",
|
|
87
87
|
"char": "f",
|
|
88
|
-
"description": "Force log out by skipping the confirmation",
|
|
88
|
+
"description": "Force log out by skipping the confirmation.",
|
|
89
89
|
"hidden": true,
|
|
90
90
|
"required": false,
|
|
91
91
|
"allowNo": false
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"name": "alias",
|
|
139
139
|
"type": "option",
|
|
140
140
|
"char": "a",
|
|
141
|
-
"description": "
|
|
141
|
+
"description": "Alias (name) you want to assign to the token",
|
|
142
142
|
"multiple": false
|
|
143
143
|
},
|
|
144
144
|
"delivery": {
|
|
@@ -328,14 +328,14 @@
|
|
|
328
328
|
"name": "alias",
|
|
329
329
|
"type": "option",
|
|
330
330
|
"char": "a",
|
|
331
|
-
"description": "
|
|
331
|
+
"description": "Alias (name) of the token to delete.",
|
|
332
332
|
"multiple": false
|
|
333
333
|
},
|
|
334
334
|
"ignore": {
|
|
335
335
|
"name": "ignore",
|
|
336
336
|
"type": "boolean",
|
|
337
337
|
"char": "i",
|
|
338
|
-
"description": "
|
|
338
|
+
"description": "Ignores if the token is not present.",
|
|
339
339
|
"allowNo": false
|
|
340
340
|
}
|
|
341
341
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-auth",
|
|
3
3
|
"description": "Contentstack CLI plugin for authentication activities",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.23",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"scripts": {
|
|
@@ -22,37 +22,29 @@
|
|
|
22
22
|
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@contentstack/cli-command": "~1.3.
|
|
26
|
-
"@contentstack/cli-utilities": "~1.8.
|
|
27
|
-
"chalk": "^4.0.0",
|
|
28
|
-
"debug": "^4.1.1",
|
|
29
|
-
"inquirer": "8.2.4",
|
|
30
|
-
"winston": "^3.7.2"
|
|
25
|
+
"@contentstack/cli-command": "~1.3.3",
|
|
26
|
+
"@contentstack/cli-utilities": "~1.8.1"
|
|
31
27
|
},
|
|
32
28
|
"devDependencies": {
|
|
33
29
|
"@fancy-test/nock": "^0.1.1",
|
|
34
|
-
"@oclif/plugin-help": "^5.
|
|
35
|
-
"@oclif/test": "^
|
|
36
|
-
"@types/chai": "^4.
|
|
37
|
-
"@types/
|
|
38
|
-
"@types/
|
|
39
|
-
"@types/
|
|
40
|
-
"@types/
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"eslint": "^
|
|
45
|
-
"eslint-config-oclif": "^
|
|
46
|
-
"
|
|
47
|
-
"globby": "^10.0.2",
|
|
48
|
-
"mocha": "10.1.0",
|
|
30
|
+
"@oclif/plugin-help": "^5.2.20",
|
|
31
|
+
"@oclif/test": "^4.1.6",
|
|
32
|
+
"@types/chai": "^4.3.20",
|
|
33
|
+
"@types/mkdirp": "^1.0.2",
|
|
34
|
+
"@types/mocha": "^8.2.3",
|
|
35
|
+
"@types/node": "^14.18.63",
|
|
36
|
+
"@types/sinon": "^10.0.20",
|
|
37
|
+
"chai": "^4.5.0",
|
|
38
|
+
"dotenv": "^16.4.7",
|
|
39
|
+
"eslint": "^8.57.1",
|
|
40
|
+
"eslint-config-oclif": "^5.2.2",
|
|
41
|
+
"eslint-config-oclif-typescript": "^3.1.13",
|
|
42
|
+
"mocha": "10.8.2",
|
|
49
43
|
"nyc": "^15.1.0",
|
|
50
|
-
"oclif": "^3.
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"ts-node": "^10.9.1",
|
|
55
|
-
"typescript": "^4.9.3"
|
|
44
|
+
"oclif": "^3.17.2",
|
|
45
|
+
"sinon": "^19.0.2",
|
|
46
|
+
"ts-node": "^10.9.2",
|
|
47
|
+
"typescript": "^4.9.5"
|
|
56
48
|
},
|
|
57
49
|
"engines": {
|
|
58
50
|
"node": ">=14.0.0"
|
|
@@ -96,4 +88,4 @@
|
|
|
96
88
|
}
|
|
97
89
|
},
|
|
98
90
|
"repository": "contentstack/cli"
|
|
99
|
-
}
|
|
91
|
+
}
|