@bgord/bun 1.10.20 → 1.10.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/bun",
3
- "version": "1.10.20",
3
+ "version": "1.10.22",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": "Bartosz Gordon",
@@ -1,14 +1,11 @@
1
- import type { betterAuth } from "better-auth";
1
+ import type { Auth } from "better-auth";
2
2
  import type { AuthSessionReaderPort } from "./auth-session-reader.port";
3
3
  import type { HasRequestHeaders } from "./request-context.port";
4
4
 
5
- type BetterAuthUserType = ReturnType<typeof betterAuth>["$Infer"]["Session"]["user"];
6
- type BetterAuthSessionType = ReturnType<typeof betterAuth>["$Infer"]["Session"]["session"];
7
-
8
- export class AuthSessionReaderBetterAuthAdapter
9
- implements AuthSessionReaderPort<BetterAuthUserType, BetterAuthSessionType>
5
+ export class AuthSessionReaderBetterAuthAdapter<TAuth extends Auth<any>>
6
+ implements AuthSessionReaderPort<TAuth["$Infer"]["Session"]["user"], TAuth["$Infer"]["Session"]["session"]>
10
7
  {
11
- constructor(private readonly auth: ReturnType<typeof betterAuth>) {}
8
+ constructor(private readonly auth: TAuth) {}
12
9
 
13
10
  async getSession(context: HasRequestHeaders) {
14
11
  const result = await this.auth.api.getSession({ headers: context.request.headers() });