@contentstack/cli-auth 1.0.4 → 1.1.0
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 +178 -35
- package/lib/commands/auth/login.js +1 -1
- package/lib/commands/auth/logout.js +1 -1
- package/lib/commands/auth/tokens/add.js +2 -1
- package/lib/commands/auth/tokens/index.js +1 -1
- package/lib/commands/auth/tokens/remove.js +1 -1
- package/oclif.manifest.json +314 -1
- package/package.json +10 -14
package/README.md
CHANGED
|
@@ -17,8 +17,8 @@ It is Contentstack’s CLI plugin to perform authentication-related activities.
|
|
|
17
17
|
$ npm install -g @contentstack/cli-auth
|
|
18
18
|
$ csdx COMMAND
|
|
19
19
|
running command...
|
|
20
|
-
$ csdx (
|
|
21
|
-
@contentstack/cli-auth/1.0
|
|
20
|
+
$ csdx (--version)
|
|
21
|
+
@contentstack/cli-auth/1.1.0 linux-x64 node-v16.19.0
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
|
@@ -35,6 +35,10 @@ USAGE
|
|
|
35
35
|
* [`csdx auth:tokens:add [-a <value>] [--delivery] [--management] [-e <value>] [-k <value>] [-y] [--token <value>]`](#csdx-authtokensadd--a-value---delivery---management--e-value--k-value--y---token-value)
|
|
36
36
|
* [`csdx auth:tokens:remove`](#csdx-authtokensremove)
|
|
37
37
|
* [`csdx auth:whoami`](#csdx-authwhoami)
|
|
38
|
+
* [`csdx login`](#csdx-login)
|
|
39
|
+
* [`csdx logout`](#csdx-logout)
|
|
40
|
+
* [`csdx tokens`](#csdx-tokens)
|
|
41
|
+
* [`csdx whoami`](#csdx-whoami)
|
|
38
42
|
|
|
39
43
|
## `csdx auth:login`
|
|
40
44
|
|
|
@@ -42,20 +46,27 @@ User sessions login
|
|
|
42
46
|
|
|
43
47
|
```
|
|
44
48
|
USAGE
|
|
45
|
-
$ csdx auth:login
|
|
49
|
+
$ csdx auth:login [-u <value>] [-p <value>]
|
|
50
|
+
|
|
51
|
+
FLAGS
|
|
52
|
+
-p, --password=<value> Password
|
|
53
|
+
-u, --username=<value> User name
|
|
46
54
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-u, --username=username User name
|
|
55
|
+
DESCRIPTION
|
|
56
|
+
User sessions login
|
|
50
57
|
|
|
51
58
|
ALIASES
|
|
52
59
|
$ csdx login
|
|
53
60
|
|
|
54
61
|
EXAMPLES
|
|
55
62
|
$ csdx auth:login
|
|
63
|
+
|
|
56
64
|
$ csdx auth:login -u <username>
|
|
65
|
+
|
|
57
66
|
$ csdx auth:login -u <username> -p <password>
|
|
67
|
+
|
|
58
68
|
$ csdx auth:login --username <username>
|
|
69
|
+
|
|
59
70
|
$ csdx auth:login --username <username> --password <password>
|
|
60
71
|
```
|
|
61
72
|
|
|
@@ -67,17 +78,22 @@ User session logout
|
|
|
67
78
|
|
|
68
79
|
```
|
|
69
80
|
USAGE
|
|
70
|
-
$ csdx auth:logout
|
|
81
|
+
$ csdx auth:logout [-y]
|
|
71
82
|
|
|
72
|
-
|
|
83
|
+
FLAGS
|
|
73
84
|
-y, --yes Force log out by skipping the confirmation
|
|
74
85
|
|
|
86
|
+
DESCRIPTION
|
|
87
|
+
User session logout
|
|
88
|
+
|
|
75
89
|
ALIASES
|
|
76
90
|
$ csdx logout
|
|
77
91
|
|
|
78
92
|
EXAMPLES
|
|
79
93
|
$ csdx auth:logout
|
|
94
|
+
|
|
80
95
|
$ csdx auth:logout -y
|
|
96
|
+
|
|
81
97
|
$ csdx auth:logout --yes
|
|
82
98
|
```
|
|
83
99
|
|
|
@@ -89,22 +105,27 @@ Lists all existing tokens added to the session
|
|
|
89
105
|
|
|
90
106
|
```
|
|
91
107
|
USAGE
|
|
92
|
-
$ csdx auth:tokens
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
--
|
|
97
|
-
--
|
|
98
|
-
--
|
|
99
|
-
--
|
|
100
|
-
--no-
|
|
101
|
-
--
|
|
102
|
-
--
|
|
108
|
+
$ csdx auth:tokens [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output csv|json|yaml | |
|
|
109
|
+
[--csv | --no-truncate]] [--no-header | ]
|
|
110
|
+
|
|
111
|
+
FLAGS
|
|
112
|
+
-x, --extended show extra columns
|
|
113
|
+
--columns=<value> only show provided columns (comma-separated)
|
|
114
|
+
--csv output is csv format [alias: --output=csv]
|
|
115
|
+
--filter=<value> filter property by partial string matching, ex: name=foo
|
|
116
|
+
--no-header hide table header from output
|
|
117
|
+
--no-truncate do not truncate output to fit screen
|
|
118
|
+
--output=<option> output in a more machine friendly format
|
|
119
|
+
<options: csv|json|yaml>
|
|
120
|
+
--sort=<value> property to sort by (prepend '-' for descending)
|
|
121
|
+
|
|
122
|
+
DESCRIPTION
|
|
123
|
+
Lists all existing tokens added to the session
|
|
103
124
|
|
|
104
125
|
ALIASES
|
|
105
126
|
$ csdx tokens
|
|
106
127
|
|
|
107
|
-
|
|
128
|
+
EXAMPLES
|
|
108
129
|
$ csdx auth:tokens
|
|
109
130
|
```
|
|
110
131
|
|
|
@@ -118,28 +139,40 @@ Adds management/delivery tokens to your session to use it with other CLI command
|
|
|
118
139
|
USAGE
|
|
119
140
|
$ csdx auth:tokens:add [-a <value>] [--delivery] [--management] [-e <value>] [-k <value>] [-y] [--token <value>]
|
|
120
141
|
|
|
121
|
-
|
|
122
|
-
-a, --alias
|
|
123
|
-
-d, --delivery
|
|
124
|
-
-e, --environment
|
|
125
|
-
-k, --stack-api-key
|
|
126
|
-
-m, --management
|
|
127
|
-
-t, --token
|
|
128
|
-
-y, --yes
|
|
142
|
+
FLAGS
|
|
143
|
+
-a, --alias=<value> Name of the token alias
|
|
144
|
+
-d, --delivery Set this flag to save delivery token
|
|
145
|
+
-e, --environment=<value> Environment name for delivery token
|
|
146
|
+
-k, --stack-api-key=<value> Stack API Key
|
|
147
|
+
-m, --management Set this flag to save management token
|
|
148
|
+
-t, --token=<value> Add the token name
|
|
149
|
+
-y, --yes Use this flag to skip confirmation
|
|
150
|
+
|
|
151
|
+
DESCRIPTION
|
|
152
|
+
Adds management/delivery tokens to your session to use it with other CLI commands
|
|
129
153
|
|
|
130
154
|
EXAMPLES
|
|
131
155
|
$ csdx auth:tokens:add
|
|
156
|
+
|
|
132
157
|
$ csdx auth:tokens:add -a <alias>
|
|
158
|
+
|
|
133
159
|
$ csdx auth:tokens:add -k <stack api key>
|
|
160
|
+
|
|
134
161
|
$ csdx auth:tokens:add --delivery
|
|
162
|
+
|
|
135
163
|
$ csdx auth:tokens:add --management
|
|
164
|
+
|
|
136
165
|
$ csdx auth:tokens:add -e <environment>
|
|
166
|
+
|
|
137
167
|
$ csdx auth:tokens:add --token <token>
|
|
168
|
+
|
|
138
169
|
$ csdx auth:tokens:add -a <alias> -k <stack api key> --management --token <management token>
|
|
170
|
+
|
|
139
171
|
$ csdx auth:tokens:add -a <alias> -k <stack api key> --delivery -e <environment> --token <delivery token>
|
|
172
|
+
|
|
140
173
|
$ csdx auth:tokens:add --alias <alias> --stack-api-key <stack api key> --management --token <management token>
|
|
141
|
-
|
|
142
|
-
token>
|
|
174
|
+
|
|
175
|
+
$ csdx auth:tokens:add --alias <alias> --stack-api-key <stack api key> --delivery -e <environment> --token <delivery token>
|
|
143
176
|
```
|
|
144
177
|
|
|
145
178
|
_See code: [src/commands/auth/tokens/add.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-auth/src/commands/auth/tokens/add.ts)_
|
|
@@ -150,14 +183,18 @@ Removes selected tokens
|
|
|
150
183
|
|
|
151
184
|
```
|
|
152
185
|
USAGE
|
|
153
|
-
$ csdx auth:tokens:remove
|
|
186
|
+
$ csdx auth:tokens:remove [-a <value>] [-i]
|
|
154
187
|
|
|
155
|
-
|
|
156
|
-
-a, --alias
|
|
157
|
-
-i, --ignore
|
|
188
|
+
FLAGS
|
|
189
|
+
-a, --alias=<value> Token alias
|
|
190
|
+
-i, --ignore Ignore
|
|
191
|
+
|
|
192
|
+
DESCRIPTION
|
|
193
|
+
Removes selected tokens
|
|
158
194
|
|
|
159
195
|
EXAMPLES
|
|
160
196
|
$ csdx auth:tokens:remove
|
|
197
|
+
|
|
161
198
|
$ csdx auth:tokens:remove -a <alias>
|
|
162
199
|
```
|
|
163
200
|
|
|
@@ -171,12 +208,118 @@ Display current users email address
|
|
|
171
208
|
USAGE
|
|
172
209
|
$ csdx auth:whoami
|
|
173
210
|
|
|
211
|
+
DESCRIPTION
|
|
212
|
+
Display current users email address
|
|
213
|
+
|
|
174
214
|
ALIASES
|
|
175
215
|
$ csdx whoami
|
|
176
216
|
|
|
177
|
-
|
|
217
|
+
EXAMPLES
|
|
178
218
|
$ csdx auth:whoami
|
|
179
219
|
```
|
|
180
220
|
|
|
181
221
|
_See code: [src/commands/auth/whoami.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-auth/src/commands/auth/whoami.ts)_
|
|
222
|
+
|
|
223
|
+
## `csdx login`
|
|
224
|
+
|
|
225
|
+
User sessions login
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
USAGE
|
|
229
|
+
$ csdx login [-u <value>] [-p <value>]
|
|
230
|
+
|
|
231
|
+
FLAGS
|
|
232
|
+
-p, --password=<value> Password
|
|
233
|
+
-u, --username=<value> User name
|
|
234
|
+
|
|
235
|
+
DESCRIPTION
|
|
236
|
+
User sessions login
|
|
237
|
+
|
|
238
|
+
ALIASES
|
|
239
|
+
$ csdx login
|
|
240
|
+
|
|
241
|
+
EXAMPLES
|
|
242
|
+
$ csdx auth:login
|
|
243
|
+
|
|
244
|
+
$ csdx auth:login -u <username>
|
|
245
|
+
|
|
246
|
+
$ csdx auth:login -u <username> -p <password>
|
|
247
|
+
|
|
248
|
+
$ csdx auth:login --username <username>
|
|
249
|
+
|
|
250
|
+
$ csdx auth:login --username <username> --password <password>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## `csdx logout`
|
|
254
|
+
|
|
255
|
+
User session logout
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
USAGE
|
|
259
|
+
$ csdx logout [-y]
|
|
260
|
+
|
|
261
|
+
FLAGS
|
|
262
|
+
-y, --yes Force log out by skipping the confirmation
|
|
263
|
+
|
|
264
|
+
DESCRIPTION
|
|
265
|
+
User session logout
|
|
266
|
+
|
|
267
|
+
ALIASES
|
|
268
|
+
$ csdx logout
|
|
269
|
+
|
|
270
|
+
EXAMPLES
|
|
271
|
+
$ csdx auth:logout
|
|
272
|
+
|
|
273
|
+
$ csdx auth:logout -y
|
|
274
|
+
|
|
275
|
+
$ csdx auth:logout --yes
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## `csdx tokens`
|
|
279
|
+
|
|
280
|
+
Lists all existing tokens added to the session
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
USAGE
|
|
284
|
+
$ csdx tokens [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output csv|json|yaml | |
|
|
285
|
+
[--csv | --no-truncate]] [--no-header | ]
|
|
286
|
+
|
|
287
|
+
FLAGS
|
|
288
|
+
-x, --extended show extra columns
|
|
289
|
+
--columns=<value> only show provided columns (comma-separated)
|
|
290
|
+
--csv output is csv format [alias: --output=csv]
|
|
291
|
+
--filter=<value> filter property by partial string matching, ex: name=foo
|
|
292
|
+
--no-header hide table header from output
|
|
293
|
+
--no-truncate do not truncate output to fit screen
|
|
294
|
+
--output=<option> output in a more machine friendly format
|
|
295
|
+
<options: csv|json|yaml>
|
|
296
|
+
--sort=<value> property to sort by (prepend '-' for descending)
|
|
297
|
+
|
|
298
|
+
DESCRIPTION
|
|
299
|
+
Lists all existing tokens added to the session
|
|
300
|
+
|
|
301
|
+
ALIASES
|
|
302
|
+
$ csdx tokens
|
|
303
|
+
|
|
304
|
+
EXAMPLES
|
|
305
|
+
$ csdx auth:tokens
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## `csdx whoami`
|
|
309
|
+
|
|
310
|
+
Display current users email address
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
USAGE
|
|
314
|
+
$ csdx whoami
|
|
315
|
+
|
|
316
|
+
DESCRIPTION
|
|
317
|
+
Display current users email address
|
|
318
|
+
|
|
319
|
+
ALIASES
|
|
320
|
+
$ csdx whoami
|
|
321
|
+
|
|
322
|
+
EXAMPLES
|
|
323
|
+
$ csdx auth:whoami
|
|
324
|
+
```
|
|
182
325
|
<!-- commandsstop -->
|
|
@@ -5,7 +5,7 @@ const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
class LoginCommand extends cli_command_1.Command {
|
|
7
7
|
async run() {
|
|
8
|
-
const { flags: loginFlags } = this.parse(LoginCommand);
|
|
8
|
+
const { flags: loginFlags } = await this.parse(LoginCommand);
|
|
9
9
|
utils_1.authHandler.client = this.managementAPIClient;
|
|
10
10
|
try {
|
|
11
11
|
const username = (loginFlags === null || loginFlags === void 0 ? void 0 : loginFlags.username) || (await utils_1.interactive.askUsername());
|
|
@@ -5,7 +5,7 @@ const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
class LogoutCommand extends cli_command_1.Command {
|
|
7
7
|
async run() {
|
|
8
|
-
const { flags: logoutFlags } = this.parse(LogoutCommand);
|
|
8
|
+
const { flags: logoutFlags } = await this.parse(LogoutCommand);
|
|
9
9
|
utils_1.authHandler.client = this.managementAPIClient;
|
|
10
10
|
let confirm = logoutFlags.force === true || logoutFlags.yes === true;
|
|
11
11
|
if (!confirm) {
|
|
@@ -6,7 +6,8 @@ const interactive_1 = require("../../../utils/interactive");
|
|
|
6
6
|
const utils_1 = require("../../../utils");
|
|
7
7
|
class TokensAddCommand extends cli_command_1.Command {
|
|
8
8
|
async run() {
|
|
9
|
-
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
const { flags: addTokenFlags } = await this.parse(TokensAddCommand);
|
|
10
11
|
let isAliasExist = false;
|
|
11
12
|
const skipAliasReplaceConfirmation = addTokenFlags.force || addTokenFlags.yes;
|
|
12
13
|
let alias = addTokenFlags.alias;
|
|
@@ -17,7 +17,7 @@ class TokensListCommand extends cli_command_1.Command {
|
|
|
17
17
|
type: managementTokens[item].type,
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
|
-
const { flags } = this.parse(TokensListCommand);
|
|
20
|
+
const { flags } = await this.parse(TokensListCommand);
|
|
21
21
|
cli_utilities_1.cliux.table(tokenOptions, {
|
|
22
22
|
alias: {
|
|
23
23
|
minWidth: 7,
|
|
@@ -4,7 +4,7 @@ const cli_command_1 = require("@contentstack/cli-command");
|
|
|
4
4
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
5
5
|
class TokensRemoveCommand extends cli_command_1.Command {
|
|
6
6
|
async run() {
|
|
7
|
-
const { flags: removeTokenFlags } = this.parse(TokensRemoveCommand);
|
|
7
|
+
const { flags: removeTokenFlags } = await this.parse(TokensRemoveCommand);
|
|
8
8
|
const alias = removeTokenFlags.alias;
|
|
9
9
|
const ignore = removeTokenFlags.ignore;
|
|
10
10
|
try {
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1,314 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": "1.1.0",
|
|
3
|
+
"commands": {
|
|
4
|
+
"auth:login": {
|
|
5
|
+
"id": "auth:login",
|
|
6
|
+
"description": "User sessions login",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"pluginName": "@contentstack/cli-auth",
|
|
9
|
+
"pluginAlias": "@contentstack/cli-auth",
|
|
10
|
+
"pluginType": "core",
|
|
11
|
+
"aliases": [
|
|
12
|
+
"login"
|
|
13
|
+
],
|
|
14
|
+
"examples": [
|
|
15
|
+
"$ csdx auth:login",
|
|
16
|
+
"$ csdx auth:login -u <username>",
|
|
17
|
+
"$ csdx auth:login -u <username> -p <password>",
|
|
18
|
+
"$ csdx auth:login --username <username>",
|
|
19
|
+
"$ csdx auth:login --username <username> --password <password>"
|
|
20
|
+
],
|
|
21
|
+
"flags": {
|
|
22
|
+
"username": {
|
|
23
|
+
"name": "username",
|
|
24
|
+
"type": "option",
|
|
25
|
+
"char": "u",
|
|
26
|
+
"description": "User name",
|
|
27
|
+
"required": false,
|
|
28
|
+
"multiple": false
|
|
29
|
+
},
|
|
30
|
+
"password": {
|
|
31
|
+
"name": "password",
|
|
32
|
+
"type": "option",
|
|
33
|
+
"char": "p",
|
|
34
|
+
"description": "Password",
|
|
35
|
+
"required": false,
|
|
36
|
+
"multiple": false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"args": {}
|
|
40
|
+
},
|
|
41
|
+
"auth:logout": {
|
|
42
|
+
"id": "auth:logout",
|
|
43
|
+
"description": "User session logout",
|
|
44
|
+
"strict": true,
|
|
45
|
+
"pluginName": "@contentstack/cli-auth",
|
|
46
|
+
"pluginAlias": "@contentstack/cli-auth",
|
|
47
|
+
"pluginType": "core",
|
|
48
|
+
"aliases": [
|
|
49
|
+
"logout"
|
|
50
|
+
],
|
|
51
|
+
"examples": [
|
|
52
|
+
"$ csdx auth:logout",
|
|
53
|
+
"$ csdx auth:logout -y",
|
|
54
|
+
"$ csdx auth:logout --yes"
|
|
55
|
+
],
|
|
56
|
+
"flags": {
|
|
57
|
+
"yes": {
|
|
58
|
+
"name": "yes",
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"char": "y",
|
|
61
|
+
"description": "Force log out by skipping the confirmation",
|
|
62
|
+
"required": false,
|
|
63
|
+
"allowNo": false
|
|
64
|
+
},
|
|
65
|
+
"force": {
|
|
66
|
+
"name": "force",
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"char": "f",
|
|
69
|
+
"description": "Force log out by skipping the confirmation",
|
|
70
|
+
"hidden": true,
|
|
71
|
+
"required": false,
|
|
72
|
+
"allowNo": false
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"args": {}
|
|
76
|
+
},
|
|
77
|
+
"auth:whoami": {
|
|
78
|
+
"id": "auth:whoami",
|
|
79
|
+
"description": "Display current users email address",
|
|
80
|
+
"strict": true,
|
|
81
|
+
"pluginName": "@contentstack/cli-auth",
|
|
82
|
+
"pluginAlias": "@contentstack/cli-auth",
|
|
83
|
+
"pluginType": "core",
|
|
84
|
+
"aliases": [
|
|
85
|
+
"whoami"
|
|
86
|
+
],
|
|
87
|
+
"examples": [
|
|
88
|
+
"$ csdx auth:whoami"
|
|
89
|
+
],
|
|
90
|
+
"flags": {},
|
|
91
|
+
"args": {}
|
|
92
|
+
},
|
|
93
|
+
"auth:tokens:add": {
|
|
94
|
+
"id": "auth:tokens:add",
|
|
95
|
+
"description": "Adds management/delivery tokens to your session to use it with other CLI commands",
|
|
96
|
+
"strict": true,
|
|
97
|
+
"usage": "auth:tokens:add [-a <value>] [--delivery] [--management] [-e <value>] [-k <value>] [-y] [--token <value>]",
|
|
98
|
+
"pluginName": "@contentstack/cli-auth",
|
|
99
|
+
"pluginAlias": "@contentstack/cli-auth",
|
|
100
|
+
"pluginType": "core",
|
|
101
|
+
"aliases": [],
|
|
102
|
+
"examples": [
|
|
103
|
+
"$ csdx auth:tokens:add",
|
|
104
|
+
"$ csdx auth:tokens:add -a <alias>",
|
|
105
|
+
"$ csdx auth:tokens:add -k <stack api key>",
|
|
106
|
+
"$ csdx auth:tokens:add --delivery",
|
|
107
|
+
"$ csdx auth:tokens:add --management",
|
|
108
|
+
"$ csdx auth:tokens:add -e <environment>",
|
|
109
|
+
"$ csdx auth:tokens:add --token <token>",
|
|
110
|
+
"$ csdx auth:tokens:add -a <alias> -k <stack api key> --management --token <management token>",
|
|
111
|
+
"$ csdx auth:tokens:add -a <alias> -k <stack api key> --delivery -e <environment> --token <delivery token>",
|
|
112
|
+
"$ csdx auth:tokens:add --alias <alias> --stack-api-key <stack api key> --management --token <management token>",
|
|
113
|
+
"$ csdx auth:tokens:add --alias <alias> --stack-api-key <stack api key> --delivery -e <environment> --token <delivery token>"
|
|
114
|
+
],
|
|
115
|
+
"flags": {
|
|
116
|
+
"alias": {
|
|
117
|
+
"name": "alias",
|
|
118
|
+
"type": "option",
|
|
119
|
+
"char": "a",
|
|
120
|
+
"description": "Name of the token alias",
|
|
121
|
+
"multiple": false
|
|
122
|
+
},
|
|
123
|
+
"delivery": {
|
|
124
|
+
"name": "delivery",
|
|
125
|
+
"type": "boolean",
|
|
126
|
+
"char": "d",
|
|
127
|
+
"description": "Set this flag to save delivery token",
|
|
128
|
+
"allowNo": false,
|
|
129
|
+
"exclusive": [
|
|
130
|
+
"management"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"management": {
|
|
134
|
+
"name": "management",
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"char": "m",
|
|
137
|
+
"description": "Set this flag to save management token",
|
|
138
|
+
"allowNo": false,
|
|
139
|
+
"exclusive": [
|
|
140
|
+
"delivery",
|
|
141
|
+
"environment"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"environment": {
|
|
145
|
+
"name": "environment",
|
|
146
|
+
"type": "option",
|
|
147
|
+
"char": "e",
|
|
148
|
+
"description": "Environment name for delivery token",
|
|
149
|
+
"multiple": false,
|
|
150
|
+
"exclusive": [
|
|
151
|
+
"management"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"stack-api-key": {
|
|
155
|
+
"name": "stack-api-key",
|
|
156
|
+
"type": "option",
|
|
157
|
+
"char": "k",
|
|
158
|
+
"description": "Stack API Key",
|
|
159
|
+
"multiple": false
|
|
160
|
+
},
|
|
161
|
+
"yes": {
|
|
162
|
+
"name": "yes",
|
|
163
|
+
"type": "boolean",
|
|
164
|
+
"char": "y",
|
|
165
|
+
"description": "Use this flag to skip confirmation",
|
|
166
|
+
"allowNo": false
|
|
167
|
+
},
|
|
168
|
+
"token": {
|
|
169
|
+
"name": "token",
|
|
170
|
+
"type": "option",
|
|
171
|
+
"char": "t",
|
|
172
|
+
"description": "Add the token name",
|
|
173
|
+
"multiple": false
|
|
174
|
+
},
|
|
175
|
+
"api-key": {
|
|
176
|
+
"name": "api-key",
|
|
177
|
+
"type": "option",
|
|
178
|
+
"description": "API Key",
|
|
179
|
+
"hidden": true,
|
|
180
|
+
"multiple": false
|
|
181
|
+
},
|
|
182
|
+
"force": {
|
|
183
|
+
"name": "force",
|
|
184
|
+
"type": "boolean",
|
|
185
|
+
"char": "f",
|
|
186
|
+
"description": "Force adding",
|
|
187
|
+
"hidden": true,
|
|
188
|
+
"allowNo": false
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"args": {}
|
|
192
|
+
},
|
|
193
|
+
"auth:tokens": {
|
|
194
|
+
"id": "auth:tokens",
|
|
195
|
+
"description": "Lists all existing tokens added to the session",
|
|
196
|
+
"strict": true,
|
|
197
|
+
"pluginName": "@contentstack/cli-auth",
|
|
198
|
+
"pluginAlias": "@contentstack/cli-auth",
|
|
199
|
+
"pluginType": "core",
|
|
200
|
+
"aliases": [
|
|
201
|
+
"tokens"
|
|
202
|
+
],
|
|
203
|
+
"examples": [
|
|
204
|
+
"$ csdx auth:tokens"
|
|
205
|
+
],
|
|
206
|
+
"flags": {
|
|
207
|
+
"columns": {
|
|
208
|
+
"name": "columns",
|
|
209
|
+
"type": "option",
|
|
210
|
+
"description": "only show provided columns (comma-separated)",
|
|
211
|
+
"multiple": false,
|
|
212
|
+
"exclusive": [
|
|
213
|
+
"extended"
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"sort": {
|
|
217
|
+
"name": "sort",
|
|
218
|
+
"type": "option",
|
|
219
|
+
"description": "property to sort by (prepend '-' for descending)",
|
|
220
|
+
"multiple": false
|
|
221
|
+
},
|
|
222
|
+
"filter": {
|
|
223
|
+
"name": "filter",
|
|
224
|
+
"type": "option",
|
|
225
|
+
"description": "filter property by partial string matching, ex: name=foo",
|
|
226
|
+
"multiple": false
|
|
227
|
+
},
|
|
228
|
+
"csv": {
|
|
229
|
+
"name": "csv",
|
|
230
|
+
"type": "boolean",
|
|
231
|
+
"description": "output is csv format [alias: --output=csv]",
|
|
232
|
+
"allowNo": false,
|
|
233
|
+
"exclusive": [
|
|
234
|
+
"no-truncate"
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
"output": {
|
|
238
|
+
"name": "output",
|
|
239
|
+
"type": "option",
|
|
240
|
+
"description": "output in a more machine friendly format",
|
|
241
|
+
"multiple": false,
|
|
242
|
+
"options": [
|
|
243
|
+
"csv",
|
|
244
|
+
"json",
|
|
245
|
+
"yaml"
|
|
246
|
+
],
|
|
247
|
+
"exclusive": [
|
|
248
|
+
"no-truncate",
|
|
249
|
+
"csv"
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
"extended": {
|
|
253
|
+
"name": "extended",
|
|
254
|
+
"type": "boolean",
|
|
255
|
+
"char": "x",
|
|
256
|
+
"description": "show extra columns",
|
|
257
|
+
"allowNo": false,
|
|
258
|
+
"exclusive": [
|
|
259
|
+
"columns"
|
|
260
|
+
]
|
|
261
|
+
},
|
|
262
|
+
"no-truncate": {
|
|
263
|
+
"name": "no-truncate",
|
|
264
|
+
"type": "boolean",
|
|
265
|
+
"description": "do not truncate output to fit screen",
|
|
266
|
+
"allowNo": false,
|
|
267
|
+
"exclusive": [
|
|
268
|
+
"csv"
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"no-header": {
|
|
272
|
+
"name": "no-header",
|
|
273
|
+
"type": "boolean",
|
|
274
|
+
"description": "hide table header from output",
|
|
275
|
+
"allowNo": false,
|
|
276
|
+
"exclusive": [
|
|
277
|
+
"csv"
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"args": {}
|
|
282
|
+
},
|
|
283
|
+
"auth:tokens:remove": {
|
|
284
|
+
"id": "auth:tokens:remove",
|
|
285
|
+
"description": "Removes selected tokens",
|
|
286
|
+
"strict": true,
|
|
287
|
+
"pluginName": "@contentstack/cli-auth",
|
|
288
|
+
"pluginAlias": "@contentstack/cli-auth",
|
|
289
|
+
"pluginType": "core",
|
|
290
|
+
"aliases": [],
|
|
291
|
+
"examples": [
|
|
292
|
+
"$ csdx auth:tokens:remove",
|
|
293
|
+
"$ csdx auth:tokens:remove -a <alias>"
|
|
294
|
+
],
|
|
295
|
+
"flags": {
|
|
296
|
+
"alias": {
|
|
297
|
+
"name": "alias",
|
|
298
|
+
"type": "option",
|
|
299
|
+
"char": "a",
|
|
300
|
+
"description": "Token alias",
|
|
301
|
+
"multiple": false
|
|
302
|
+
},
|
|
303
|
+
"ignore": {
|
|
304
|
+
"name": "ignore",
|
|
305
|
+
"type": "boolean",
|
|
306
|
+
"char": "i",
|
|
307
|
+
"description": "Ignore",
|
|
308
|
+
"allowNo": false
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"args": {}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
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.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"scripts": {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"clean": "rm -rf ./lib && rm -rf tsconfig.build.tsbuildinfo",
|
|
10
10
|
"compile": "tsc -b tsconfig.json",
|
|
11
11
|
"postpack": "rm -f oclif.manifest.json",
|
|
12
|
-
"prepack": "npm run build && oclif
|
|
13
|
-
"version": "oclif
|
|
12
|
+
"prepack": "npm run build && oclif manifest && oclif readme",
|
|
13
|
+
"version": "oclif readme && git add README.md",
|
|
14
14
|
"test:report": "tsc -p test && nyc --reporter=lcov --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
15
15
|
"pretest": "tsc -p test",
|
|
16
16
|
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
@@ -21,20 +21,19 @@
|
|
|
21
21
|
"test:unit": "mocha --forbid-only \"test/unit/*.test.ts\""
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@contentstack/cli-command": "^1.0
|
|
25
|
-
"@contentstack/cli-utilities": "^1.0
|
|
26
|
-
"@oclif/command": "^1.8.16",
|
|
27
|
-
"@oclif/config": "^1.18.3",
|
|
24
|
+
"@contentstack/cli-command": "^1.1.0",
|
|
25
|
+
"@contentstack/cli-utilities": "^1.1.0",
|
|
28
26
|
"chalk": "^4.0.0",
|
|
29
27
|
"debug": "^4.1.1",
|
|
30
28
|
"inquirer": "8.2.4",
|
|
31
29
|
"winston": "^3.7.2"
|
|
32
30
|
},
|
|
33
31
|
"devDependencies": {
|
|
32
|
+
"oclif": "^3.1.2",
|
|
34
33
|
"@fancy-test/nock": "^0.1.1",
|
|
35
|
-
"@oclif/dev-cli": "^1.
|
|
36
|
-
"@oclif/plugin-help": "^5.1.
|
|
37
|
-
"@oclif/test": "^
|
|
34
|
+
"@oclif/dev-cli": "^1.26.10",
|
|
35
|
+
"@oclif/plugin-help": "^5.1.19",
|
|
36
|
+
"@oclif/test": "^2.2.10",
|
|
38
37
|
"@types/chai": "^4.2.18",
|
|
39
38
|
"@types/inquirer": "^9.0.3",
|
|
40
39
|
"@types/mkdirp": "^1.0.1",
|
|
@@ -51,7 +50,7 @@
|
|
|
51
50
|
"mocha": "10.1.0",
|
|
52
51
|
"nyc": "^15.1.0",
|
|
53
52
|
"rimraf": "^2.7.1",
|
|
54
|
-
"sinon": "^
|
|
53
|
+
"sinon": "^15.0.1",
|
|
55
54
|
"tmp": "^0.2.1",
|
|
56
55
|
"ts-node": "^10.9.1",
|
|
57
56
|
"typescript": "^4.9.3"
|
|
@@ -75,9 +74,6 @@
|
|
|
75
74
|
"oclif": {
|
|
76
75
|
"commands": "./lib/commands",
|
|
77
76
|
"bin": "csdx",
|
|
78
|
-
"devPlugins": [
|
|
79
|
-
"@oclif/plugin-help"
|
|
80
|
-
],
|
|
81
77
|
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-auth/<%- commandPath %>"
|
|
82
78
|
},
|
|
83
79
|
"husky": {
|