@dypt/cli 0.1.12 → 0.1.13

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/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { Argument, Command, Option } from "commander";
9
9
  // package.json
10
10
  var package_default = {
11
11
  name: "@dypt/cli",
12
- version: "0.1.12",
12
+ version: "0.1.13",
13
13
  description: "Command-line interface for dypt task management",
14
14
  license: "SEE LICENSE IN LICENSE",
15
15
  homepage: "https://dypt.app",
@@ -42,9 +42,9 @@ var package_default = {
42
42
  typecheck: "tsc --noEmit"
43
43
  },
44
44
  dependencies: {
45
- "@trpc/client": "^11.17.0",
45
+ "@trpc/client": "^11.18.0",
46
46
  commander: "^15.0.0",
47
- "string-width": "^8.2.1",
47
+ "string-width": "^8.2.2",
48
48
  superjson: "^2.2.6"
49
49
  },
50
50
  devDependencies: {
@@ -293,6 +293,7 @@ async function createCliApi(options = {}) {
293
293
  const cliClient = client;
294
294
  return {
295
295
  getAuthStatus: () => cliClient.cli.v1.auth.status.query(),
296
+ revokeCurrentToken: () => cliClient.cli.v1.auth.logout.mutate(),
296
297
  createTask: (input) => cliClient.cli.v1.tasks.create.mutate(input),
297
298
  updateTask: (input) => cliClient.cli.v1.tasks.update.mutate(input),
298
299
  reorderTasks: (input) => cliClient.cli.v1.tasks.reorder.mutate(input),
@@ -376,6 +377,10 @@ async function runLogin(input, deps = createDefaultLoginDeps()) {
376
377
  // src/commands/auth/logout.ts
377
378
  function createDefaultLogoutDeps() {
378
379
  return {
380
+ revokeToken: async () => {
381
+ const api = await createCliApi({ baseUrl: getBaseUrl() });
382
+ await api.revokeCurrentToken();
383
+ },
379
384
  clearToken: () => clearCliToken(getBaseUrl()),
380
385
  writeLine: (message) => {
381
386
  process.stdout.write(`${message}
@@ -384,6 +389,7 @@ function createDefaultLogoutDeps() {
384
389
  };
385
390
  }
386
391
  async function runLogout(deps = createDefaultLogoutDeps()) {
392
+ await deps.revokeToken();
387
393
  await deps.clearToken();
388
394
  deps.writeLine?.("Signed out of dypt CLI.");
389
395
  }
@@ -2673,7 +2679,7 @@ function buildCli() {
2673
2679
  }
2674
2680
  );
2675
2681
  });
2676
- auth.command("logout").description("Remove the local CLI token").action(async () => {
2682
+ auth.command("logout").description("Revoke the current CLI session").action(async () => {
2677
2683
  await runLogout(createDefaultLogoutDeps());
2678
2684
  });
2679
2685
  const agent = addGroupHelpAction(