@relkit/better-auth 0.0.4 → 0.1.0

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.d.ts CHANGED
@@ -1,24 +1,51 @@
1
+ import { createDescriptorBase } from "@relkit/contracts";
2
+ import { type DrizzleActivation, type DrizzleServiceDescriptor } from "@relkit/drizzle/internal";
1
3
  import type { RawHttpHandler } from "@relkit/routes";
4
+ import { type Auth, type BetterAuthOptions } from "better-auth";
5
+ import { type DrizzleAdapterConfig } from "better-auth/adapters/drizzle";
2
6
  export declare const BETTER_AUTH_HANDLER: unique symbol;
3
- export interface BetterAuthLike<Session = unknown> {
4
- readonly handler: (request: Request) => Promise<Response>;
5
- readonly api: {
6
- readonly getSession: (options: {
7
- readonly headers: Headers;
8
- }) => Promise<Session | null>;
9
- };
10
- }
11
- export interface BetterAuthRegistration<Session = unknown> {
7
+ export type BetterAuthServiceOptions = Omit<BetterAuthOptions, "database" | "basePath"> & {
8
+ readonly database?: never;
9
+ readonly basePath?: never;
10
+ readonly drizzle?: Omit<DrizzleAdapterConfig, "provider">;
11
+ };
12
+ export interface BetterAuthRegistration {
12
13
  readonly kind: "better-auth";
13
- readonly auth: BetterAuthLike<Session>;
14
- readonly protected: readonly string[];
14
+ readonly service: BetterAuthServiceDescriptor<any>;
15
15
  }
16
16
  export type BetterAuthHandler<Session = unknown> = RawHttpHandler & {
17
- readonly [BETTER_AUTH_HANDLER]: BetterAuthRegistration<Session>;
17
+ readonly [BETTER_AUTH_HANDLER]: BetterAuthRegistration;
18
+ readonly __session?: Session;
18
19
  };
19
20
  export type InferBetterAuthSession<Handler> = Handler extends BetterAuthHandler<infer Session> ? Session : never;
20
- export interface BetterAuthAdapterOptions {
21
- readonly protected?: readonly string[];
21
+ export interface BetterAuthServiceDescriptor<Options extends BetterAuthServiceOptions> extends ReturnType<typeof createDescriptorBase<"service", string>> {
22
+ readonly capability: {
23
+ readonly kind: "better-auth";
24
+ };
25
+ readonly handler: BetterAuthHandler<Auth<Options>["$Infer"]["Session"]>;
22
26
  }
23
- export declare function betterAuthAdapter<Session>(auth: BetterAuthLike<Session>, options?: BetterAuthAdapterOptions): BetterAuthHandler<Session>;
27
+ /**
28
+ * Defines a lazy Better Auth domain service using the application's Drizzle database.
29
+ *
30
+ * Mount `handler` with a filesystem `ALL` catch-all route. RELKIT supplies `database`
31
+ * and derives `basePath` from that route; neither option can be set here. Other
32
+ * options follow Better Auth, with optional `drizzle` adapter settings. The
33
+ * descriptor is not the native auth instance and does not expose `auth.api`.
34
+ * Supply BETTER_AUTH_SECRET through the server process environment before startup.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * import { defineBetterAuthService } from "@relkit/better-auth"
39
+ *
40
+ * const auth = defineBetterAuthService({
41
+ * baseURL: "http://127.0.0.1:3000",
42
+ * emailAndPassword: { enabled: true },
43
+ * })
44
+ * const handler = auth.handler
45
+ * ```
46
+ * @category Services
47
+ * @since 0.0.5
48
+ */
49
+ export declare function defineBetterAuthService<const Options extends BetterAuthServiceOptions>(options: Options): BetterAuthServiceDescriptor<Options>;
50
+ export declare function activateBetterAuthService<Options extends BetterAuthServiceOptions, Database extends DrizzleServiceDescriptor<any, any, any, any>>(service: BetterAuthServiceDescriptor<Options>, database: DrizzleActivation<Database>, basePath: string): Promise<Auth<any>>;
24
51
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,eAAO,MAAM,mBAAmB,eAA2C,CAAC;AAE5E,MAAM,WAAW,cAAc,CAAC,OAAO,GAAG,OAAO;IAC/C,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1D,QAAQ,CAAC,GAAG,EAAE;QACZ,QAAQ,CAAC,UAA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OAAO,SAAS,wBAAwB,EACpF,OAAO,EAAE,OAAO,GACf,2BAA2B,CAAC,OAAO,CAAC,CAyBtC;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,SAAS,wBAAwB,EACxC,QAAQ,SAAS,wBAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAE7D,OAAO,EAAE,2BAA2B,CAAC,OAAO,CAAC,EAC7C,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,EACrC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAqBpB"}
package/dist/index.js CHANGED
@@ -1,23 +1,101 @@
1
+ import { createDescriptorBase } from "@relkit/contracts";
2
+ import { drizzleRuntimeOf, } from "@relkit/drizzle/internal";
3
+ import { createUnboundIdentity } from "@relkit/invocation";
4
+ import { betterAuth } from "better-auth";
5
+ import { drizzleAdapter } from "better-auth/adapters/drizzle";
1
6
  export const BETTER_AUTH_HANDLER = Symbol.for("relkit.better-auth.handler");
2
- export function betterAuthAdapter(auth, options = {}) {
3
- if (typeof auth?.handler !== "function" || typeof auth.api?.getSession !== "function") {
4
- throw new TypeError("betterAuthAdapter requires a Better Auth instance");
7
+ const BETTER_AUTH_RUNTIME = Symbol.for("relkit.better-auth.runtime");
8
+ /**
9
+ * Defines a lazy Better Auth domain service using the application's Drizzle database.
10
+ *
11
+ * Mount `handler` with a filesystem `ALL` catch-all route. RELKIT supplies `database`
12
+ * and derives `basePath` from that route; neither option can be set here. Other
13
+ * options follow Better Auth, with optional `drizzle` adapter settings. The
14
+ * descriptor is not the native auth instance and does not expose `auth.api`.
15
+ * Supply BETTER_AUTH_SECRET through the server process environment before startup.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * import { defineBetterAuthService } from "@relkit/better-auth"
20
+ *
21
+ * const auth = defineBetterAuthService({
22
+ * baseURL: "http://127.0.0.1:3000",
23
+ * emailAndPassword: { enabled: true },
24
+ * })
25
+ * const handler = auth.handler
26
+ * ```
27
+ * @category Services
28
+ * @since 0.0.5
29
+ */
30
+ export function defineBetterAuthService(options) {
31
+ if (!isRecord(options))
32
+ throw new TypeError("Better Auth service options must be an object");
33
+ if (Object.hasOwn(options, "database")) {
34
+ throw new TypeError("Better Auth service database is provided by the Drizzle service");
5
35
  }
6
- const protectedPaths = Object.freeze([...new Set(options.protected ?? [])].map(validatePattern).sort());
7
- const handler = ((request) => auth.handler(request));
36
+ if (Object.hasOwn(options, "basePath")) {
37
+ throw new TypeError("Better Auth basePath is derived from its ALL route");
38
+ }
39
+ const runtime = { options, activation: undefined };
40
+ const handler = (async (request) => {
41
+ const auth = await runtime.activation;
42
+ if (auth === undefined)
43
+ return new Response("Service Unavailable", { status: 503 });
44
+ return auth.handler(request);
45
+ });
46
+ const descriptor = {
47
+ ...createDescriptorBase("service", createUnboundIdentity()),
48
+ capability: Object.freeze({ kind: "better-auth" }),
49
+ handler,
50
+ };
8
51
  Object.defineProperty(handler, BETTER_AUTH_HANDLER, {
9
- value: Object.freeze({ kind: "better-auth", auth, protected: protectedPaths }),
10
- enumerable: false,
52
+ value: Object.freeze({ kind: "better-auth", service: descriptor }),
11
53
  });
12
- return Object.freeze(handler);
54
+ Object.defineProperty(descriptor, BETTER_AUTH_RUNTIME, { value: runtime });
55
+ Object.freeze(handler);
56
+ return Object.freeze(descriptor);
13
57
  }
14
- function validatePattern(value) {
15
- if (!value.startsWith("/") || value.includes("?") || value.includes("#")) {
16
- throw new TypeError(`Invalid protected route pattern "${value}"`);
17
- }
18
- if (value.includes("*") && !value.endsWith("/*")) {
19
- throw new TypeError(`Protected route wildcard must end the pattern: "${value}"`);
58
+ export async function activateBetterAuthService(service, database, basePath) {
59
+ const runtime = runtimeOf(service);
60
+ if (runtime.activation !== undefined)
61
+ return runtime.activation;
62
+ validateBasePath(basePath);
63
+ runtime.activation = Promise.resolve().then(() => {
64
+ const drizzle = drizzleRuntimeOf(databaseServiceOf(database));
65
+ const { drizzle: adapterOptions, ...options } = runtime.options;
66
+ return betterAuth({
67
+ ...options,
68
+ basePath,
69
+ database: drizzleAdapter(database.client, {
70
+ ...(adapterOptions ?? {}),
71
+ schema: adapterOptions?.schema ?? drizzle.schema,
72
+ provider: drizzle.dialect,
73
+ }),
74
+ });
75
+ });
76
+ runtime.activation.catch(() => {
77
+ runtime.activation = undefined;
78
+ });
79
+ return runtime.activation;
80
+ }
81
+ function runtimeOf(service) {
82
+ const runtime = service[BETTER_AUTH_RUNTIME];
83
+ if (!isRecord(runtime))
84
+ throw new TypeError("Invalid Better Auth service descriptor");
85
+ return runtime;
86
+ }
87
+ function databaseServiceOf(activation) {
88
+ const service = activation[Symbol.for("relkit.drizzle.service")];
89
+ if (!isRecord(service))
90
+ throw new TypeError("Drizzle activation is missing its service");
91
+ return service;
92
+ }
93
+ function validateBasePath(value) {
94
+ if (!value.startsWith("/") || value.endsWith("/") || value.includes("*") || value.includes("[")) {
95
+ throw new TypeError(`Invalid Better Auth base path "${value}"`);
20
96
  }
21
- return value;
97
+ }
98
+ function isRecord(value) {
99
+ return value !== null && typeof value === "object" && !Array.isArray(value);
22
100
  }
23
101
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AA0B5E,MAAM,UAAU,iBAAiB,CAC/B,IAA6B,EAC7B,UAAoC,EAAE;IAEtC,IAAI,OAAO,IAAI,EAAE,OAAO,KAAK,UAAU,IAAI,OAAO,IAAI,CAAC,GAAG,EAAE,UAAU,KAAK,UAAU,EAAE,CAAC;QACtF,MAAM,IAAI,SAAS,CAAC,mDAAmD,CAAC,CAAC;IAC3E,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAClC,CAAC,GAAG,IAAI,GAAG,CAAC,OA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CAAC,KAAK,CAAC,GAAG,EAAE;QAC5B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IACjC,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC,UAAU,CAAC;AAC5B,CAAC;AAED,SAAS,SAAS,CAChB,OAA6C;IAE7C,MAAM,OAAO,GAAI,OAAmD,CAAC,mBAAmB,CAAC,CAAC;IAC1F,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAC;IACtF,OAAO,OAAgD,CAAC;AAC1D,CAAC;AAED,SAAS,iBAAiB,CACxB,UAA2E;IAE3E,MAAM,OAAO,GAAI,UAAsD,CACrE,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CACrC,CAAC;IACF,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,2CAA2C,CAAC,CAAC;IACzF,OAAO,OAAuD,CAAC;AACjE,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;IACrC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAChG,MAAM,IAAI,SAAS,CAAC,kCAAkC,KAAK,GAAG,CAAC,CAAC;IAClE,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relkit/better-auth",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "description": "Better Auth integration for RELKIT routes.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,9 +29,15 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@relkit/routes": "0.0.4",
32
+ "@relkit/contracts": "0.1.0",
33
+ "@relkit/drizzle": "0.1.0",
34
+ "@relkit/invocation": "0.1.0",
35
+ "@relkit/routes": "0.1.0",
33
36
  "better-auth": "1.7.1"
34
37
  },
38
+ "devDependencies": {
39
+ "drizzle-orm": "1.0.0-rc.5-169397b"
40
+ },
35
41
  "scripts": {
36
42
  "build": "tsc -b",
37
43
  "check": "tsc -b --pretty false",