@donkeylabs/cli 1.1.14 → 1.1.16

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.
@@ -3,8 +3,9 @@
3
3
  *
4
4
  * Provides:
5
5
  * - auth.register - Create new account
6
- * - auth.login - Login and get session
7
- * - auth.logout - Invalidate session (requires auth)
6
+ * - auth.login - Login and get tokens
7
+ * - auth.refresh - Refresh access token (refresh-token strategy only)
8
+ * - auth.logout - Invalidate session/token (requires auth)
8
9
  * - auth.me - Get current user (optional auth)
9
10
  * - auth.updateProfile - Update profile (requires auth)
10
11
  */
@@ -14,13 +15,16 @@ import { z } from "zod";
14
15
  import {
15
16
  registerSchema,
16
17
  loginSchema,
18
+ refreshSchema,
17
19
  updateProfileSchema,
18
20
  authResponseSchema,
21
+ refreshResponseSchema,
19
22
  userSchema,
20
23
  logoutResponseSchema,
21
24
  } from "./auth.schemas";
22
25
  import { RegisterHandler } from "./handlers/register.handler";
23
26
  import { LoginHandler } from "./handlers/login.handler";
27
+ import { RefreshHandler } from "./handlers/refresh.handler";
24
28
  import { LogoutHandler } from "./handlers/logout.handler";
25
29
  import { MeHandler } from "./handlers/me.handler";
26
30
  import { UpdateProfileHandler } from "./handlers/update-profile.handler";
@@ -40,6 +44,13 @@ export const authRouter = createRouter("auth")
40
44
  handle: LoginHandler,
41
45
  })
42
46
 
47
+ // Refresh token (for refresh-token strategy)
48
+ .route("refresh").typed({
49
+ input: refreshSchema,
50
+ output: refreshResponseSchema,
51
+ handle: RefreshHandler,
52
+ })
53
+
43
54
  // Optional auth - returns user if logged in, null otherwise
44
55
  .middleware.auth({ required: false })
45
56
  .route("me").typed({