@contentstack/cli-auth 1.7.0 → 2.0.0-beta.1
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/LICENSE +1 -1
- package/README.md +4 -4
- package/lib/base-command.js +1 -4
- package/lib/commands/auth/logout.js +0 -8
- package/lib/commands/auth/tokens/add.js +1 -19
- package/lib/interfaces/index.d.ts +1 -1
- package/oclif.manifest.json +1 -29
- package/package.json +3 -3
package/LICENSE
CHANGED
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/
|
|
21
|
+
@contentstack/cli-auth/2.0.0-beta.1 linux-x64 node-v22.21.1
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
|
@@ -141,12 +141,12 @@ USAGE
|
|
|
141
141
|
|
|
142
142
|
FLAGS
|
|
143
143
|
-a, --alias=<value> Alias (name) you want to assign to the token
|
|
144
|
-
-d, --delivery Set this flag to save delivery token
|
|
145
144
|
-e, --environment=<value> Environment name for delivery token
|
|
146
145
|
-k, --stack-api-key=<value> Stack API Key
|
|
147
|
-
-m, --management Set this flag to save management token
|
|
148
|
-
-t, --token=<value> [env: TOKEN] Add the token name
|
|
149
146
|
-y, --yes Use this flag to skip confirmation
|
|
147
|
+
--delivery Set this flag to save delivery token
|
|
148
|
+
--management Set this flag to save management token
|
|
149
|
+
--token=<value> [env: TOKEN] Add the token name
|
|
150
150
|
|
|
151
151
|
DESCRIPTION
|
|
152
152
|
Adds management/delivery tokens to your session to use it with other CLI commands
|
package/lib/base-command.js
CHANGED
|
@@ -9,10 +9,8 @@ class BaseCommand extends cli_command_1.Command {
|
|
|
9
9
|
* plugins, registering the configuration, and initializing the logger.
|
|
10
10
|
*/
|
|
11
11
|
async init() {
|
|
12
|
-
var _a, _b;
|
|
13
12
|
await super.init();
|
|
14
|
-
|
|
15
|
-
this.contextDetails = Object.assign({}, (0, cli_utilities_1.createLogContext)(((_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.command) || 'auth', '', cli_utilities_1.configHandler.get('authenticationMethod')));
|
|
13
|
+
this.contextDetails = Object.assign({}, this.createExportContext());
|
|
16
14
|
}
|
|
17
15
|
/**
|
|
18
16
|
* The catch function is used to handle errors from a command, either by adding custom logic or
|
|
@@ -45,7 +43,6 @@ class BaseCommand extends cli_command_1.Command {
|
|
|
45
43
|
command: ((_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.command) || 'auth',
|
|
46
44
|
module: '',
|
|
47
45
|
userId: cli_utilities_1.configHandler.get('userUid') || '',
|
|
48
|
-
email: cli_utilities_1.configHandler.get('email') || '',
|
|
49
46
|
sessionId: (_c = this.context) === null || _c === void 0 ? void 0 : _c.sessionId,
|
|
50
47
|
apiKey: apiKey || '',
|
|
51
48
|
orgId: cli_utilities_1.configHandler.get('oauthOrgUid') || '',
|
|
@@ -73,13 +73,5 @@ LogoutCommand.flags = {
|
|
|
73
73
|
required: false,
|
|
74
74
|
default: false,
|
|
75
75
|
}),
|
|
76
|
-
force: cli_utilities_1.flags.boolean({
|
|
77
|
-
char: 'f',
|
|
78
|
-
description: 'Force log out by skipping the confirmation.',
|
|
79
|
-
required: false,
|
|
80
|
-
hidden: true,
|
|
81
|
-
default: false,
|
|
82
|
-
parse: (0, cli_utilities_1.printFlagDeprecation)(['-f', '--force'], ['-y', '--yes']),
|
|
83
|
-
}),
|
|
84
76
|
};
|
|
85
77
|
LogoutCommand.aliases = ['logout'];
|
|
@@ -24,7 +24,7 @@ class TokensAddCommand extends base_command_1.BaseCommand {
|
|
|
24
24
|
skipAliasReplaceConfirmation }));
|
|
25
25
|
if (!isDelivery && !isManagement && !Boolean(environment)) {
|
|
26
26
|
cli_utilities_1.log.debug('No token type specified, requesting user input', this.contextDetails);
|
|
27
|
-
|
|
27
|
+
const tokenType = await (0, interactive_1.askTokenType)();
|
|
28
28
|
isDelivery = tokenType === 'delivery';
|
|
29
29
|
isManagement = tokenType === 'management';
|
|
30
30
|
cli_utilities_1.log.debug(`Token type selected: ${tokenType}`, this.contextDetails);
|
|
@@ -140,16 +140,12 @@ TokensAddCommand.examples = [
|
|
|
140
140
|
TokensAddCommand.flags = {
|
|
141
141
|
alias: cli_utilities_1.Flags.string({ char: 'a', description: 'Alias (name) you want to assign to the token' }),
|
|
142
142
|
delivery: cli_utilities_1.flags.boolean({
|
|
143
|
-
char: 'd',
|
|
144
143
|
description: 'Set this flag to save delivery token',
|
|
145
144
|
exclusive: ['management'],
|
|
146
|
-
parse: (0, cli_utilities_1.printFlagDeprecation)(['-d'], ['--delivery']),
|
|
147
145
|
}),
|
|
148
146
|
management: cli_utilities_1.flags.boolean({
|
|
149
|
-
char: 'm',
|
|
150
147
|
description: 'Set this flag to save management token',
|
|
151
148
|
exclusive: ['delivery', 'environment'],
|
|
152
|
-
parse: (0, cli_utilities_1.printFlagDeprecation)(['-m'], ['--management']),
|
|
153
149
|
}),
|
|
154
150
|
environment: cli_utilities_1.flags.string({
|
|
155
151
|
char: 'e',
|
|
@@ -159,22 +155,8 @@ TokensAddCommand.flags = {
|
|
|
159
155
|
'stack-api-key': cli_utilities_1.flags.string({ char: 'k', description: 'Stack API Key' }),
|
|
160
156
|
yes: cli_utilities_1.flags.boolean({ char: 'y', description: 'Use this flag to skip confirmation' }),
|
|
161
157
|
token: cli_utilities_1.flags.string({
|
|
162
|
-
char: 't',
|
|
163
158
|
description: 'Add the token name',
|
|
164
159
|
env: 'TOKEN',
|
|
165
|
-
parse: (0, cli_utilities_1.printFlagDeprecation)(['-t'], ['--token']),
|
|
166
|
-
}),
|
|
167
|
-
//To be deprecated
|
|
168
|
-
'api-key': cli_utilities_1.flags.string({
|
|
169
|
-
description: 'API Key',
|
|
170
|
-
hidden: true,
|
|
171
|
-
parse: (0, cli_utilities_1.printFlagDeprecation)(['api-key'], ['-k', 'stack-api-key']),
|
|
172
|
-
}),
|
|
173
|
-
force: cli_utilities_1.flags.boolean({
|
|
174
|
-
char: 'f',
|
|
175
|
-
hidden: true,
|
|
176
|
-
description: 'Force adding',
|
|
177
|
-
parse: (0, cli_utilities_1.printFlagDeprecation)(['-f', '--force'], ['-y', '--yes']),
|
|
178
160
|
}),
|
|
179
161
|
branch: cli_utilities_1.flags.string({
|
|
180
162
|
required: false,
|
package/oclif.manifest.json
CHANGED
|
@@ -84,15 +84,6 @@
|
|
|
84
84
|
"required": false,
|
|
85
85
|
"allowNo": false,
|
|
86
86
|
"type": "boolean"
|
|
87
|
-
},
|
|
88
|
-
"force": {
|
|
89
|
-
"char": "f",
|
|
90
|
-
"description": "Force log out by skipping the confirmation.",
|
|
91
|
-
"hidden": true,
|
|
92
|
-
"name": "force",
|
|
93
|
-
"required": false,
|
|
94
|
-
"allowNo": false,
|
|
95
|
-
"type": "boolean"
|
|
96
87
|
}
|
|
97
88
|
},
|
|
98
89
|
"hasDynamicHelp": false,
|
|
@@ -162,7 +153,6 @@
|
|
|
162
153
|
"type": "option"
|
|
163
154
|
},
|
|
164
155
|
"delivery": {
|
|
165
|
-
"char": "d",
|
|
166
156
|
"description": "Set this flag to save delivery token",
|
|
167
157
|
"exclusive": [
|
|
168
158
|
"management"
|
|
@@ -172,7 +162,6 @@
|
|
|
172
162
|
"type": "boolean"
|
|
173
163
|
},
|
|
174
164
|
"management": {
|
|
175
|
-
"char": "m",
|
|
176
165
|
"description": "Set this flag to save management token",
|
|
177
166
|
"exclusive": [
|
|
178
167
|
"delivery",
|
|
@@ -209,7 +198,6 @@
|
|
|
209
198
|
"type": "boolean"
|
|
210
199
|
},
|
|
211
200
|
"token": {
|
|
212
|
-
"char": "t",
|
|
213
201
|
"description": "Add the token name",
|
|
214
202
|
"env": "TOKEN",
|
|
215
203
|
"name": "token",
|
|
@@ -217,22 +205,6 @@
|
|
|
217
205
|
"multiple": false,
|
|
218
206
|
"type": "option"
|
|
219
207
|
},
|
|
220
|
-
"api-key": {
|
|
221
|
-
"description": "API Key",
|
|
222
|
-
"hidden": true,
|
|
223
|
-
"name": "api-key",
|
|
224
|
-
"hasDynamicHelp": false,
|
|
225
|
-
"multiple": false,
|
|
226
|
-
"type": "option"
|
|
227
|
-
},
|
|
228
|
-
"force": {
|
|
229
|
-
"char": "f",
|
|
230
|
-
"description": "Force adding",
|
|
231
|
-
"hidden": true,
|
|
232
|
-
"name": "force",
|
|
233
|
-
"allowNo": false,
|
|
234
|
-
"type": "boolean"
|
|
235
|
-
},
|
|
236
208
|
"branch": {
|
|
237
209
|
"description": "Branch name",
|
|
238
210
|
"hidden": true,
|
|
@@ -387,5 +359,5 @@
|
|
|
387
359
|
]
|
|
388
360
|
}
|
|
389
361
|
},
|
|
390
|
-
"version": "
|
|
362
|
+
"version": "2.0.0-beta.1"
|
|
391
363
|
}
|
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": "
|
|
4
|
+
"version": "2.0.0-beta.1",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"scripts": {
|
|
@@ -22,8 +22,8 @@
|
|
|
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.7.
|
|
26
|
-
"@contentstack/cli-utilities": "~1.
|
|
25
|
+
"@contentstack/cli-command": "~1.7.0",
|
|
26
|
+
"@contentstack/cli-utilities": "~1.15.0",
|
|
27
27
|
"@oclif/core": "^4.3.0",
|
|
28
28
|
"@oclif/plugin-help": "^6.2.28",
|
|
29
29
|
"otplib": "^12.0.1"
|