@dropthis/cli 0.33.0 → 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 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
- Or pass both flags directly:
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
@@ -925,6 +925,56 @@ var COMMAND_ANNOTATIONS = {
925
925
  "dropthis workspace use ws_team123"
926
926
  ]
927
927
  },
928
+ "workspace create": {
929
+ auth: "required",
930
+ examples: ['dropthis workspace create "Acme" --slug acme --json']
931
+ },
932
+ "workspace rename": {
933
+ auth: "required",
934
+ examples: ['dropthis workspace rename ws_team123 --name "Acme Inc" --json']
935
+ },
936
+ "workspace delete": {
937
+ auth: "required",
938
+ examples: ["dropthis workspace delete ws_team123 --yes --json"]
939
+ },
940
+ members: {
941
+ auth: "required",
942
+ examples: ["dropthis members list ws_team123 --json"]
943
+ },
944
+ "members list": {
945
+ auth: "required",
946
+ examples: ["dropthis members list ws_team123 --json"]
947
+ },
948
+ "members invite": {
949
+ auth: "required",
950
+ examples: [
951
+ "dropthis members invite ws_team123 --email teammate@acme.com --role member --json"
952
+ ]
953
+ },
954
+ "members role": {
955
+ auth: "required",
956
+ examples: ["dropthis members role ws_team123 acc_123 --role admin --json"]
957
+ },
958
+ "members remove": {
959
+ auth: "required",
960
+ examples: ["dropthis members remove ws_team123 acc_123 --yes --json"]
961
+ },
962
+ invitations: {
963
+ auth: "required",
964
+ examples: ["dropthis invitations --json"]
965
+ },
966
+ "invitations list": {
967
+ auth: "required",
968
+ examples: ["dropthis invitations list --json"]
969
+ },
970
+ "invitations accept": {
971
+ auth: "required",
972
+ examples: ["dropthis invitations accept --token inv_tok_abc --json"]
973
+ },
974
+ "invitations accept-by-id": {
975
+ auth: "required",
976
+ examples: ["dropthis invitations accept-by-id inv_123 --json"]
977
+ },
928
978
  login: {
929
979
  examples: [
930
980
  "dropthis login",
@@ -1086,7 +1136,7 @@ function spreadData(data) {
1086
1136
  }
1087
1137
 
1088
1138
  // src/version.ts
1089
- var CLI_VERSION = true ? "0.33.0" : "0.0.0-dev";
1139
+ var CLI_VERSION = true ? "0.33.2" : "0.0.0-dev";
1090
1140
 
1091
1141
  // src/commands/doctor.ts
1092
1142
  async function onlineChecks(deps, hasCredential) {
@@ -1906,8 +1956,7 @@ async function runLoginInteractive(deps) {
1906
1956
  const authedClient = deps.createClient(session.data.token);
1907
1957
  const apiKey = await authedClient.apiKeys.create({
1908
1958
  label: "CLI",
1909
- type: "delegated",
1910
- ...deps.scope ? { scopes: [deps.scope] } : {}
1959
+ type: "delegated"
1911
1960
  });
1912
1961
  if (apiKey.error) {
1913
1962
  prompts4.cancel(apiKey.error.message);
@@ -4094,51 +4143,26 @@ ${import_picocolors6.default.bold("Canonical vs raw URLs:")}`,
4094
4143
  process.exitCode = result.exitCode;
4095
4144
  }
4096
4145
  );
4097
- program.command("login").description("Authenticate with email OTP").option("--email <email>", "Email address").option("--otp <otp>", "One-time passcode").option(
4098
- "--scope <scope>",
4099
- "Capability scope to request for the minted key (e.g. team)"
4100
- ).option("--json", "Force JSON output").action(
4101
- async (commandOptions) => {
4102
- if (!commandOptions.email || !commandOptions.otp) {
4103
- const deps2 = await commandDeps(program, options, store, commandOptions);
4104
- const global2 = globalOptions(program, commandOptions);
4105
- const stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;
4106
- if (!isInteractive(stdinIsTTY, deps2.env, global2)) {
4107
- process.exitCode = writeError(
4108
- deps2,
4109
- "invalid_usage",
4110
- "dropthis login is interactive and needs a terminal.",
4111
- "Set DROPTHIS_API_KEY, or run: dropthis login request --email <email>, then dropthis login verify --email <email> --otp <code>."
4112
- ).exitCode;
4113
- return;
4114
- }
4115
- const context = createContext({ global: global2 });
4116
- const result2 = await runLoginInteractive({
4117
- ...deps2,
4118
- createClient: (apiKey) => context.createClient(apiKey),
4119
- ...commandOptions.scope ? { scope: commandOptions.scope } : {}
4120
- });
4121
- process.exitCode = result2.exitCode;
4122
- return;
4123
- }
4124
- const deps = await commandDeps(program, options, store, commandOptions);
4125
- const global = globalOptions(program, commandOptions);
4126
- const verifyContext = createContext({ global });
4127
- const result = await runLoginVerify(
4128
- {
4129
- email: commandOptions.email,
4130
- otp: commandOptions.otp,
4131
- ...commandOptions.scope ? { scope: commandOptions.scope } : {},
4132
- ...commandOptions.json !== void 0 ? { json: commandOptions.json } : {}
4133
- },
4134
- {
4135
- ...deps,
4136
- createClient: (apiKey) => verifyContext.createClient(apiKey)
4137
- }
4138
- );
4139
- 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;
4140
4158
  }
4141
- );
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
+ });
4142
4166
  const login = program.commands.find((command) => command.name() === "login");
4143
4167
  login?.command("request").description("Request an email OTP").requiredOption("--email <email>", "Email address").option("--json", "Force JSON output").action(async (commandOptions) => {
4144
4168
  const deps = await commandDeps(program, options, store, commandOptions);