@dropthis/cli 0.33.1 → 0.33.2
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 +2 -2
- package/dist/cli.cjs +21 -47
- package/dist/cli.cjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,10 +39,10 @@ dropthis login verify --email you@example.com --otp 123456
|
|
|
39
39
|
|
|
40
40
|
> A failed verify prints `Your code has expired` (`otp_expired`) or `That code is incorrect` (`otp_invalid`) and exits non-zero.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
To request a capability-scoped key (e.g. to manage teams), add `--scope` on `login verify`:
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
-
dropthis login --email you@example.com --otp 123456
|
|
45
|
+
dropthis login verify --email you@example.com --otp 123456 --scope team
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
Credentials resolve in this order:
|
package/dist/cli.cjs
CHANGED
|
@@ -1136,7 +1136,7 @@ function spreadData(data) {
|
|
|
1136
1136
|
}
|
|
1137
1137
|
|
|
1138
1138
|
// src/version.ts
|
|
1139
|
-
var CLI_VERSION = true ? "0.33.
|
|
1139
|
+
var CLI_VERSION = true ? "0.33.2" : "0.0.0-dev";
|
|
1140
1140
|
|
|
1141
1141
|
// src/commands/doctor.ts
|
|
1142
1142
|
async function onlineChecks(deps, hasCredential) {
|
|
@@ -1956,8 +1956,7 @@ async function runLoginInteractive(deps) {
|
|
|
1956
1956
|
const authedClient = deps.createClient(session.data.token);
|
|
1957
1957
|
const apiKey = await authedClient.apiKeys.create({
|
|
1958
1958
|
label: "CLI",
|
|
1959
|
-
type: "delegated"
|
|
1960
|
-
...deps.scope ? { scopes: [deps.scope] } : {}
|
|
1959
|
+
type: "delegated"
|
|
1961
1960
|
});
|
|
1962
1961
|
if (apiKey.error) {
|
|
1963
1962
|
prompts4.cancel(apiKey.error.message);
|
|
@@ -4144,51 +4143,26 @@ ${import_picocolors6.default.bold("Canonical vs raw URLs:")}`,
|
|
|
4144
4143
|
process.exitCode = result.exitCode;
|
|
4145
4144
|
}
|
|
4146
4145
|
);
|
|
4147
|
-
program.command("login").description("Authenticate with email OTP").option("--
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
"invalid_usage",
|
|
4160
|
-
"dropthis login is interactive and needs a terminal.",
|
|
4161
|
-
"Set DROPTHIS_API_KEY, or run: dropthis login request --email <email>, then dropthis login verify --email <email> --otp <code>."
|
|
4162
|
-
).exitCode;
|
|
4163
|
-
return;
|
|
4164
|
-
}
|
|
4165
|
-
const context = createContext({ global: global2 });
|
|
4166
|
-
const result2 = await runLoginInteractive({
|
|
4167
|
-
...deps2,
|
|
4168
|
-
createClient: (apiKey) => context.createClient(apiKey),
|
|
4169
|
-
...commandOptions.scope ? { scope: commandOptions.scope } : {}
|
|
4170
|
-
});
|
|
4171
|
-
process.exitCode = result2.exitCode;
|
|
4172
|
-
return;
|
|
4173
|
-
}
|
|
4174
|
-
const deps = await commandDeps(program, options, store, commandOptions);
|
|
4175
|
-
const global = globalOptions(program, commandOptions);
|
|
4176
|
-
const verifyContext = createContext({ global });
|
|
4177
|
-
const result = await runLoginVerify(
|
|
4178
|
-
{
|
|
4179
|
-
email: commandOptions.email,
|
|
4180
|
-
otp: commandOptions.otp,
|
|
4181
|
-
...commandOptions.scope ? { scope: commandOptions.scope } : {},
|
|
4182
|
-
...commandOptions.json !== void 0 ? { json: commandOptions.json } : {}
|
|
4183
|
-
},
|
|
4184
|
-
{
|
|
4185
|
-
...deps,
|
|
4186
|
-
createClient: (apiKey) => verifyContext.createClient(apiKey)
|
|
4187
|
-
}
|
|
4188
|
-
);
|
|
4189
|
-
process.exitCode = result.exitCode;
|
|
4146
|
+
program.command("login").description("Authenticate with email OTP (interactive)").option("--json", "Force JSON output").action(async (commandOptions) => {
|
|
4147
|
+
const deps = await commandDeps(program, options, store, commandOptions);
|
|
4148
|
+
const global = globalOptions(program, commandOptions);
|
|
4149
|
+
const stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;
|
|
4150
|
+
if (!isInteractive(stdinIsTTY, deps.env, global)) {
|
|
4151
|
+
process.exitCode = writeError(
|
|
4152
|
+
deps,
|
|
4153
|
+
"invalid_usage",
|
|
4154
|
+
"dropthis login is interactive and needs a terminal.",
|
|
4155
|
+
"Set DROPTHIS_API_KEY, or run: dropthis login request --email <email>, then dropthis login verify --email <email> --otp <code>."
|
|
4156
|
+
).exitCode;
|
|
4157
|
+
return;
|
|
4190
4158
|
}
|
|
4191
|
-
|
|
4159
|
+
const context = createContext({ global });
|
|
4160
|
+
const result = await runLoginInteractive({
|
|
4161
|
+
...deps,
|
|
4162
|
+
createClient: (apiKey) => context.createClient(apiKey)
|
|
4163
|
+
});
|
|
4164
|
+
process.exitCode = result.exitCode;
|
|
4165
|
+
});
|
|
4192
4166
|
const login = program.commands.find((command) => command.name() === "login");
|
|
4193
4167
|
login?.command("request").description("Request an email OTP").requiredOption("--email <email>", "Email address").option("--json", "Force JSON output").action(async (commandOptions) => {
|
|
4194
4168
|
const deps = await commandDeps(program, options, store, commandOptions);
|