@veloxts/auth 0.3.3 → 0.3.5

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.
Files changed (66) hide show
  1. package/README.md +1157 -30
  2. package/dist/__integration__/fixtures.d.ts +41 -0
  3. package/dist/__integration__/fixtures.d.ts.map +1 -0
  4. package/dist/__integration__/fixtures.js +79 -0
  5. package/dist/__integration__/fixtures.js.map +1 -0
  6. package/dist/__integration__/setup.d.ts +26 -0
  7. package/dist/__integration__/setup.d.ts.map +1 -0
  8. package/dist/__integration__/setup.js +28 -0
  9. package/dist/__integration__/setup.js.map +1 -0
  10. package/dist/adapter.d.ts +710 -0
  11. package/dist/adapter.d.ts.map +1 -0
  12. package/dist/adapter.js +581 -0
  13. package/dist/adapter.js.map +1 -0
  14. package/dist/adapters/better-auth.d.ts +271 -0
  15. package/dist/adapters/better-auth.d.ts.map +1 -0
  16. package/dist/adapters/better-auth.js +341 -0
  17. package/dist/adapters/better-auth.js.map +1 -0
  18. package/dist/adapters/index.d.ts +28 -0
  19. package/dist/adapters/index.d.ts.map +1 -0
  20. package/dist/adapters/index.js +28 -0
  21. package/dist/adapters/index.js.map +1 -0
  22. package/dist/csrf.d.ts +300 -0
  23. package/dist/csrf.d.ts.map +1 -0
  24. package/dist/csrf.js +402 -0
  25. package/dist/csrf.js.map +1 -0
  26. package/dist/guards.d.ts +142 -0
  27. package/dist/guards.d.ts.map +1 -0
  28. package/dist/guards.js +259 -0
  29. package/dist/guards.js.map +1 -0
  30. package/dist/hash.d.ts +91 -0
  31. package/dist/hash.d.ts.map +1 -0
  32. package/dist/hash.js +236 -0
  33. package/dist/hash.js.map +1 -0
  34. package/dist/index.d.ts +27 -32
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +94 -36
  37. package/dist/index.js.map +1 -1
  38. package/dist/jwt.d.ts +157 -0
  39. package/dist/jwt.d.ts.map +1 -0
  40. package/dist/jwt.js +489 -0
  41. package/dist/jwt.js.map +1 -0
  42. package/dist/middleware.d.ts +99 -0
  43. package/dist/middleware.d.ts.map +1 -0
  44. package/dist/middleware.js +253 -0
  45. package/dist/middleware.js.map +1 -0
  46. package/dist/plugin.d.ts +125 -0
  47. package/dist/plugin.d.ts.map +1 -0
  48. package/dist/plugin.js +193 -0
  49. package/dist/plugin.js.map +1 -0
  50. package/dist/policies.d.ts +137 -0
  51. package/dist/policies.d.ts.map +1 -0
  52. package/dist/policies.js +240 -0
  53. package/dist/policies.js.map +1 -0
  54. package/dist/rate-limit.d.ts +231 -0
  55. package/dist/rate-limit.d.ts.map +1 -0
  56. package/dist/rate-limit.js +352 -0
  57. package/dist/rate-limit.js.map +1 -0
  58. package/dist/session.d.ts +500 -0
  59. package/dist/session.d.ts.map +1 -0
  60. package/dist/session.js +801 -0
  61. package/dist/session.js.map +1 -0
  62. package/dist/types.d.ts +261 -0
  63. package/dist/types.d.ts.map +1 -0
  64. package/dist/types.js +33 -0
  65. package/dist/types.js.map +1 -0
  66. package/package.json +61 -7
@@ -0,0 +1,271 @@
1
+ /**
2
+ * BetterAuth Adapter for @veloxts/auth
3
+ *
4
+ * Integrates BetterAuth (https://better-auth.com) with VeloxTS's
5
+ * pluggable authentication system. BetterAuth is a comprehensive,
6
+ * framework-agnostic TypeScript authentication library.
7
+ *
8
+ * @module auth/adapters/better-auth
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { createAuthAdapterPlugin } from '@veloxts/auth';
13
+ * import { createBetterAuthAdapter } from '@veloxts/auth/adapters/better-auth';
14
+ * import { betterAuth } from 'better-auth';
15
+ * import { prismaAdapter } from 'better-auth/adapters/prisma';
16
+ *
17
+ * // Create BetterAuth instance
18
+ * const auth = betterAuth({
19
+ * database: prismaAdapter(prisma, {
20
+ * provider: 'postgresql',
21
+ * }),
22
+ * trustedOrigins: ['http://localhost:3000'],
23
+ * emailAndPassword: {
24
+ * enabled: true,
25
+ * },
26
+ * });
27
+ *
28
+ * // Create adapter
29
+ * const adapter = createBetterAuthAdapter({
30
+ * name: 'better-auth',
31
+ * auth,
32
+ * basePath: '/api/auth',
33
+ * });
34
+ *
35
+ * // Create plugin and register
36
+ * const authPlugin = createAuthAdapterPlugin({
37
+ * adapter,
38
+ * config: adapter.config,
39
+ * });
40
+ *
41
+ * app.use(authPlugin);
42
+ * ```
43
+ */
44
+ import type { FastifyInstance, FastifyRequest } from 'fastify';
45
+ import type { AdapterRoute, AdapterSessionResult, AuthAdapterConfig } from '../adapter.js';
46
+ import { BaseAuthAdapter } from '../adapter.js';
47
+ /**
48
+ * BetterAuth session user data
49
+ *
50
+ * Represents the user data returned by BetterAuth's getSession.
51
+ */
52
+ export interface BetterAuthUser {
53
+ /** Unique user ID */
54
+ id: string;
55
+ /** User email address */
56
+ email: string;
57
+ /** Whether email is verified */
58
+ emailVerified: boolean;
59
+ /** Display name */
60
+ name: string;
61
+ /** Profile image URL */
62
+ image?: string | null;
63
+ /** Account creation timestamp */
64
+ createdAt: Date;
65
+ /** Account update timestamp */
66
+ updatedAt: Date;
67
+ }
68
+ /**
69
+ * BetterAuth session data
70
+ *
71
+ * Represents the session data returned by BetterAuth's getSession.
72
+ */
73
+ export interface BetterAuthSession {
74
+ /** Unique session ID */
75
+ id: string;
76
+ /** User ID that owns this session */
77
+ userId: string;
78
+ /** Session expiration timestamp */
79
+ expiresAt: Date;
80
+ /** Session token */
81
+ token: string;
82
+ /** IP address of session creator */
83
+ ipAddress?: string | null;
84
+ /** User agent of session creator */
85
+ userAgent?: string | null;
86
+ /** Session creation timestamp */
87
+ createdAt: Date;
88
+ /** Session update timestamp */
89
+ updatedAt: Date;
90
+ }
91
+ /**
92
+ * Result from BetterAuth getSession API
93
+ */
94
+ export interface BetterAuthSessionResult {
95
+ /** User data */
96
+ user: BetterAuthUser;
97
+ /** Session data */
98
+ session: BetterAuthSession;
99
+ }
100
+ /**
101
+ * BetterAuth API interface
102
+ *
103
+ * This is a minimal interface for the parts of BetterAuth API
104
+ * that the adapter uses. The actual BetterAuth instance has
105
+ * more methods, but we only type what we need.
106
+ */
107
+ export interface BetterAuthApi {
108
+ /**
109
+ * Get current session from headers
110
+ */
111
+ getSession(options: {
112
+ headers: Headers;
113
+ }): Promise<BetterAuthSessionResult | null>;
114
+ }
115
+ /**
116
+ * BetterAuth handler function type
117
+ *
118
+ * The handler processes auth requests and returns a Response object.
119
+ */
120
+ export type BetterAuthHandler = (request: Request) => Promise<Response>;
121
+ /**
122
+ * BetterAuth instance interface
123
+ *
124
+ * This represents the object returned by `betterAuth()`.
125
+ * We don't import the actual types to avoid requiring better-auth
126
+ * as a dependency - it's a peer dependency.
127
+ */
128
+ export interface BetterAuthInstance {
129
+ /** API methods for programmatic access */
130
+ api: BetterAuthApi;
131
+ /** Handler for processing auth requests */
132
+ handler: BetterAuthHandler;
133
+ /** Base path for auth routes (configured in betterAuth options) */
134
+ options?: {
135
+ basePath?: string;
136
+ };
137
+ }
138
+ /**
139
+ * BetterAuth adapter configuration
140
+ *
141
+ * @example
142
+ * ```typescript
143
+ * const config: BetterAuthAdapterConfig = {
144
+ * name: 'better-auth',
145
+ * auth: betterAuth({ ... }),
146
+ * basePath: '/api/auth',
147
+ * debug: true,
148
+ * };
149
+ * ```
150
+ */
151
+ export interface BetterAuthAdapterConfig extends AuthAdapterConfig {
152
+ /**
153
+ * BetterAuth instance
154
+ *
155
+ * Created using `betterAuth()` from the 'better-auth' package.
156
+ */
157
+ auth: BetterAuthInstance;
158
+ /**
159
+ * Base path for auth routes
160
+ *
161
+ * This should match the basePath configured in your BetterAuth options.
162
+ * Routes will be mounted at `${basePath}/*`.
163
+ *
164
+ * @default '/api/auth'
165
+ */
166
+ basePath?: string;
167
+ /**
168
+ * Whether to handle all HTTP methods
169
+ *
170
+ * When true, mounts routes for GET, POST, PUT, PATCH, DELETE.
171
+ * When false, only mounts GET and POST (BetterAuth's primary methods).
172
+ *
173
+ * @default false
174
+ */
175
+ handleAllMethods?: boolean;
176
+ }
177
+ /**
178
+ * BetterAuth Adapter
179
+ *
180
+ * Integrates BetterAuth with VeloxTS by:
181
+ * - Mounting BetterAuth's handler at the configured base path
182
+ * - Loading sessions from BetterAuth on each request
183
+ * - Transforming BetterAuth's user/session to VeloxTS format
184
+ *
185
+ * @example
186
+ * ```typescript
187
+ * const adapter = new BetterAuthAdapter();
188
+ * const plugin = createAuthAdapterPlugin({
189
+ * adapter,
190
+ * config: {
191
+ * name: 'better-auth',
192
+ * auth: betterAuth({ ... }),
193
+ * },
194
+ * });
195
+ * ```
196
+ */
197
+ export declare class BetterAuthAdapter extends BaseAuthAdapter<BetterAuthAdapterConfig> {
198
+ private auth;
199
+ private basePath;
200
+ private handleAllMethods;
201
+ constructor();
202
+ /**
203
+ * Initialize the adapter with BetterAuth instance
204
+ */
205
+ initialize(fastify: FastifyInstance, config: BetterAuthAdapterConfig): Promise<void>;
206
+ /**
207
+ * Get session from BetterAuth
208
+ *
209
+ * Calls BetterAuth's getSession API with the request headers
210
+ * and transforms the result to VeloxTS format.
211
+ */
212
+ getSession(request: FastifyRequest): Promise<AdapterSessionResult | null>;
213
+ /**
214
+ * Get routes for BetterAuth handler
215
+ *
216
+ * Mounts a wildcard route at the base path that forwards
217
+ * all requests to BetterAuth's handler.
218
+ */
219
+ getRoutes(): AdapterRoute[];
220
+ /**
221
+ * Create the Fastify route handler
222
+ *
223
+ * Converts Fastify request/reply to Web Request/Response
224
+ * and delegates to BetterAuth's handler.
225
+ */
226
+ private createHandler;
227
+ /**
228
+ * Clean up adapter resources
229
+ */
230
+ cleanup(): Promise<void>;
231
+ }
232
+ /**
233
+ * Create a BetterAuth adapter
234
+ *
235
+ * This is the recommended way to create a BetterAuth adapter.
236
+ * It returns an adapter instance with the configuration attached.
237
+ *
238
+ * @param config - Adapter configuration
239
+ * @returns BetterAuth adapter with configuration
240
+ *
241
+ * @example
242
+ * ```typescript
243
+ * import { createBetterAuthAdapter } from '@veloxts/auth/adapters/better-auth';
244
+ * import { createAuthAdapterPlugin } from '@veloxts/auth';
245
+ * import { betterAuth } from 'better-auth';
246
+ *
247
+ * const auth = betterAuth({
248
+ * database: prismaAdapter(prisma, { provider: 'postgresql' }),
249
+ * trustedOrigins: ['http://localhost:3000'],
250
+ * emailAndPassword: { enabled: true },
251
+ * });
252
+ *
253
+ * const adapter = createBetterAuthAdapter({
254
+ * name: 'better-auth',
255
+ * auth,
256
+ * debug: process.env.NODE_ENV === 'development',
257
+ * });
258
+ *
259
+ * const authPlugin = createAuthAdapterPlugin({
260
+ * adapter,
261
+ * config: adapter.config,
262
+ * });
263
+ *
264
+ * app.use(authPlugin);
265
+ * ```
266
+ */
267
+ export declare function createBetterAuthAdapter(config: BetterAuthAdapterConfig): BetterAuthAdapter & {
268
+ config: BetterAuthAdapterConfig;
269
+ };
270
+ export { AuthAdapterError } from '../adapter.js';
271
+ //# sourceMappingURL=better-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"better-auth.d.ts","sourceRoot":"","sources":["../../src/adapters/better-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAgB,cAAc,EAAE,MAAM,SAAS,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAoB,eAAe,EAAE,MAAM,eAAe,CAAC;AAMlE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,qBAAqB;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,iCAAiC;IACjC,SAAS,EAAE,IAAI,CAAC;IAChB,+BAA+B;IAC/B,SAAS,EAA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;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,iBAAkB,SAAQ,eAAe,CAAC,uBAAuB,CAAC;IAC7E,OAAO,CAAC,IAAI,CAAmC;IAC/C,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,gBAAgB,CAAkB;;IAM1C;;OAEG;IACY,UAAU,CACvB,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAkBhB;;;;;OAKG;IACY,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA8DxF;;;;;OAKG;IACM,SAAS,IAAI,YAAY,EAAE;IAepC;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAgCrB;;OAEG;IACY,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAKxC;AAiHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,uBAAuB,GAC9B,iBAAiB,GAAG;IAAE,MAAM,EAAE,uBAAuB,CAAA;CAAE,CAKzD;AAMD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,341 @@
1
+ /**
2
+ * BetterAuth Adapter for @veloxts/auth
3
+ *
4
+ * Integrates BetterAuth (https://better-auth.com) with VeloxTS's
5
+ * pluggable authentication system. BetterAuth is a comprehensive,
6
+ * framework-agnostic TypeScript authentication library.
7
+ *
8
+ * @module auth/adapters/better-auth
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { createAuthAdapterPlugin } from '@veloxts/auth';
13
+ * import { createBetterAuthAdapter } from '@veloxts/auth/adapters/better-auth';
14
+ * import { betterAuth } from 'better-auth';
15
+ * import { prismaAdapter } from 'better-auth/adapters/prisma';
16
+ *
17
+ * // Create BetterAuth instance
18
+ * const auth = betterAuth({
19
+ * database: prismaAdapter(prisma, {
20
+ * provider: 'postgresql',
21
+ * }),
22
+ * trustedOrigins: ['http://localhost:3000'],
23
+ * emailAndPassword: {
24
+ * enabled: true,
25
+ * },
26
+ * });
27
+ *
28
+ * // Create adapter
29
+ * const adapter = createBetterAuthAdapter({
30
+ * name: 'better-auth',
31
+ * auth,
32
+ * basePath: '/api/auth',
33
+ * });
34
+ *
35
+ * // Create plugin and register
36
+ * const authPlugin = createAuthAdapterPlugin({
37
+ * adapter,
38
+ * config: adapter.config,
39
+ * });
40
+ *
41
+ * app.use(authPlugin);
42
+ * ```
43
+ */
44
+ import { AuthAdapterError, BaseAuthAdapter } from '../adapter.js';
45
+ // ============================================================================
46
+ // BetterAuth Adapter Implementation
47
+ // ============================================================================
48
+ /**
49
+ * BetterAuth Adapter
50
+ *
51
+ * Integrates BetterAuth with VeloxTS by:
52
+ * - Mounting BetterAuth's handler at the configured base path
53
+ * - Loading sessions from BetterAuth on each request
54
+ * - Transforming BetterAuth's user/session to VeloxTS format
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * const adapter = new BetterAuthAdapter();
59
+ * const plugin = createAuthAdapterPlugin({
60
+ * adapter,
61
+ * config: {
62
+ * name: 'better-auth',
63
+ * auth: betterAuth({ ... }),
64
+ * },
65
+ * });
66
+ * ```
67
+ */
68
+ export class BetterAuthAdapter extends BaseAuthAdapter {
69
+ auth = null;
70
+ basePath = '/api/auth';
71
+ handleAllMethods = false;
72
+ constructor() {
73
+ super('better-auth', '1.0.0');
74
+ }
75
+ /**
76
+ * Initialize the adapter with BetterAuth instance
77
+ */
78
+ async initialize(fastify, config) {
79
+ await super.initialize(fastify, config);
80
+ if (!config.auth) {
81
+ throw new AuthAdapterError('BetterAuth instance is required in adapter config', 500, 'ADAPTER_NOT_CONFIGURED');
82
+ }
83
+ this.auth = config.auth;
84
+ this.basePath = config.basePath ?? config.auth.options?.basePath ?? '/api/auth';
85
+ this.handleAllMethods = config.handleAllMethods ?? false;
86
+ this.debug(`Initialized with basePath: ${this.basePath}`);
87
+ }
88
+ /**
89
+ * Get session from BetterAuth
90
+ *
91
+ * Calls BetterAuth's getSession API with the request headers
92
+ * and transforms the result to VeloxTS format.
93
+ */
94
+ async getSession(request) {
95
+ if (!this.auth) {
96
+ throw new AuthAdapterError('BetterAuth adapter not initialized', 500, 'ADAPTER_NOT_CONFIGURED');
97
+ }
98
+ try {
99
+ // Convert Fastify headers to standard Headers
100
+ const headers = convertToWebHeaders(request.headers);
101
+ // Get session from BetterAuth
102
+ const result = await this.auth.api.getSession({ headers });
103
+ if (!result) {
104
+ this.debug('No session found');
105
+ return null;
106
+ }
107
+ this.debug(`Session found for user: ${result.user.id}`);
108
+ // Transform to VeloxTS format
109
+ return {
110
+ user: {
111
+ id: result.user.id,
112
+ email: result.user.email,
113
+ name: result.user.name,
114
+ emailVerified: result.user.emailVerified,
115
+ image: result.user.image ?? undefined,
116
+ providerData: {
117
+ createdAt: result.user.createdAt,
118
+ updatedAt: result.user.updatedAt,
119
+ },
120
+ },
121
+ session: {
122
+ sessionId: result.session.id,
123
+ userId: result.session.userId,
124
+ expiresAt: result.session.expiresAt.getTime(),
125
+ isActive: true,
126
+ providerData: {
127
+ token: result.session.token,
128
+ ipAddress: result.session.ipAddress,
129
+ userAgent: result.session.userAgent,
130
+ createdAt: result.session.createdAt,
131
+ updatedAt: result.session.updatedAt,
132
+ },
133
+ },
134
+ };
135
+ }
136
+ catch (error) {
137
+ this.error('Failed to get session', error instanceof Error ? error : undefined);
138
+ throw new AuthAdapterError('Failed to load session from BetterAuth', 500, 'ADAPTER_SESSION_ERROR', error instanceof Error ? error : undefined);
139
+ }
140
+ }
141
+ /**
142
+ * Get routes for BetterAuth handler
143
+ *
144
+ * Mounts a wildcard route at the base path that forwards
145
+ * all requests to BetterAuth's handler.
146
+ */
147
+ getRoutes() {
148
+ const methods = this.handleAllMethods
149
+ ? ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']
150
+ : ['GET', 'POST'];
151
+ return [
152
+ {
153
+ path: `${this.basePath}/*`,
154
+ methods: [...methods],
155
+ description: 'BetterAuth handler routes',
156
+ handler: this.createHandler(),
157
+ },
158
+ ];
159
+ }
160
+ /**
161
+ * Create the Fastify route handler
162
+ *
163
+ * Converts Fastify request/reply to Web Request/Response
164
+ * and delegates to BetterAuth's handler.
165
+ */
166
+ createHandler() {
167
+ return async (request, reply) => {
168
+ if (!this.auth) {
169
+ throw new AuthAdapterError('BetterAuth adapter not initialized', 500, 'ADAPTER_NOT_CONFIGURED');
170
+ }
171
+ try {
172
+ // Convert Fastify request to Web Request
173
+ const webRequest = convertToWebRequest(request);
174
+ // Call BetterAuth handler
175
+ const response = await this.auth.handler(webRequest);
176
+ // Convert Web Response to Fastify reply
177
+ await sendWebResponse(reply, response);
178
+ }
179
+ catch (error) {
180
+ this.error('Handler error', error instanceof Error ? error : undefined);
181
+ throw new AuthAdapterError('BetterAuth handler failed', 500, 'ADAPTER_ROUTE_ERROR', error instanceof Error ? error : undefined);
182
+ }
183
+ };
184
+ }
185
+ /**
186
+ * Clean up adapter resources
187
+ */
188
+ async cleanup() {
189
+ await super.cleanup();
190
+ this.auth = null;
191
+ this.debug('Adapter cleaned up');
192
+ }
193
+ }
194
+ // ============================================================================
195
+ // Request/Response Conversion Utilities
196
+ // ============================================================================
197
+ /**
198
+ * Convert Fastify headers to Web API Headers
199
+ *
200
+ * @param fastifyHeaders - Headers from Fastify request
201
+ * @returns Web API Headers object
202
+ *
203
+ * @internal
204
+ */
205
+ function convertToWebHeaders(fastifyHeaders) {
206
+ const headers = new Headers();
207
+ for (const [key, value] of Object.entries(fastifyHeaders)) {
208
+ if (value !== undefined) {
209
+ if (Array.isArray(value)) {
210
+ for (const v of value) {
211
+ headers.append(key, v);
212
+ }
213
+ }
214
+ else {
215
+ headers.set(key, value);
216
+ }
217
+ }
218
+ }
219
+ return headers;
220
+ }
221
+ /**
222
+ * Convert Fastify request to Web API Request
223
+ *
224
+ * @param request - Fastify request object
225
+ * @returns Web API Request object
226
+ *
227
+ * @internal
228
+ */
229
+ function convertToWebRequest(request) {
230
+ const protocol = request.protocol || 'http';
231
+ const host = request.hostname || 'localhost';
232
+ const url = `${protocol}://${host}${request.url}`;
233
+ const headers = convertToWebHeaders(request.headers);
234
+ // Handle request body based on method
235
+ const method = request.method.toUpperCase();
236
+ const hasBody = !['GET', 'HEAD', 'OPTIONS'].includes(method);
237
+ let body;
238
+ if (hasBody && request.body !== undefined) {
239
+ // Body could be various types - serialize appropriately
240
+ if (typeof request.body === 'string') {
241
+ body = request.body;
242
+ }
243
+ else if (Buffer.isBuffer(request.body)) {
244
+ body = request.body;
245
+ }
246
+ else {
247
+ // Assume JSON-serializable object
248
+ body = JSON.stringify(request.body);
249
+ // Ensure content-type is set for JSON
250
+ if (!headers.has('content-type')) {
251
+ headers.set('content-type', 'application/json');
252
+ }
253
+ }
254
+ }
255
+ return new Request(url, {
256
+ method,
257
+ headers,
258
+ body,
259
+ });
260
+ }
261
+ /**
262
+ * Send Web API Response through Fastify reply
263
+ *
264
+ * @param reply - Fastify reply object
265
+ * @param response - Web API Response object
266
+ *
267
+ * @internal
268
+ */
269
+ async function sendWebResponse(reply, response) {
270
+ // Set status code
271
+ reply.status(response.status);
272
+ // Set headers
273
+ response.headers.forEach((value, key) => {
274
+ // Skip headers that Fastify handles internally
275
+ if (key.toLowerCase() === 'transfer-encoding') {
276
+ return;
277
+ }
278
+ reply.header(key, value);
279
+ });
280
+ // Send body
281
+ if (response.body) {
282
+ const body = await response.text();
283
+ if (body) {
284
+ reply.send(body);
285
+ }
286
+ else {
287
+ reply.send();
288
+ }
289
+ }
290
+ else {
291
+ reply.send();
292
+ }
293
+ }
294
+ // ============================================================================
295
+ // Factory Function
296
+ // ============================================================================
297
+ /**
298
+ * Create a BetterAuth adapter
299
+ *
300
+ * This is the recommended way to create a BetterAuth adapter.
301
+ * It returns an adapter instance with the configuration attached.
302
+ *
303
+ * @param config - Adapter configuration
304
+ * @returns BetterAuth adapter with configuration
305
+ *
306
+ * @example
307
+ * ```typescript
308
+ * import { createBetterAuthAdapter } from '@veloxts/auth/adapters/better-auth';
309
+ * import { createAuthAdapterPlugin } from '@veloxts/auth';
310
+ * import { betterAuth } from 'better-auth';
311
+ *
312
+ * const auth = betterAuth({
313
+ * database: prismaAdapter(prisma, { provider: 'postgresql' }),
314
+ * trustedOrigins: ['http://localhost:3000'],
315
+ * emailAndPassword: { enabled: true },
316
+ * });
317
+ *
318
+ * const adapter = createBetterAuthAdapter({
319
+ * name: 'better-auth',
320
+ * auth,
321
+ * debug: process.env.NODE_ENV === 'development',
322
+ * });
323
+ *
324
+ * const authPlugin = createAuthAdapterPlugin({
325
+ * adapter,
326
+ * config: adapter.config,
327
+ * });
328
+ *
329
+ * app.use(authPlugin);
330
+ * ```
331
+ */
332
+ export function createBetterAuthAdapter(config) {
333
+ const adapter = new BetterAuthAdapter();
334
+ // Attach config for easy access when creating plugin
335
+ return Object.assign(adapter, { config });
336
+ }
337
+ // ============================================================================
338
+ // Re-exports
339
+ // ============================================================================
340
+ export { AuthAdapterError } from '../adapter.js';
341
+ //# sourceMappingURL=better-auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"better-auth.js","sourceRoot":"","sources":["../../src/adapters/better-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAKH,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAmJlE,+EAA+E;AAC/E,oCAAoC;AACpC,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,iBAAkB,SAAQ,eAAwC;IACrE,IAAI,GAA8B,IAAI,CAAC;IACvC,QAAQ,GAAW,WAAW,CAAC;IAC/B,gBAAgB,GAAY,KAAK,CAAC;IAE1C;QACE,KAAK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AC,WAAW,EAAE,KAAK,mBAAmB,EAAE,CAAC;YAC9C,OAAO;QACT,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,YAAY;IACZ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QAClB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,IAAI,EAAE,CAAC;YACT,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,CAAC;IACH,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,EAAE,CAAC;IACf,CAAC;AACH,CAAC;AAED,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAA+B;IAE/B,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAExC,qDAAqD;IACrD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Auth Adapters - External authentication provider integrations
3
+ *
4
+ * This module exports adapters for integrating external authentication
5
+ * providers with VeloxTS. Each adapter implements the AuthAdapter interface
6
+ * and can be used with createAuthAdapterPlugin.
7
+ *
8
+ * @module auth/adapters
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { createBetterAuthAdapter } from '@veloxts/auth/adapters';
13
+ * import { createAuthAdapterPlugin } from '@veloxts/auth';
14
+ *
15
+ * const adapter = createBetterAuthAdapter({
16
+ * name: 'better-auth',
17
+ * auth: betterAuth({ ... }),
18
+ * });
19
+ *
20
+ * const plugin = createAuthAdapterPlugin({
21
+ * adapter,
22
+ * config: adapter.config,
23
+ * });
24
+ * ```
25
+ */
26
+ export type { BetterAuthAdapterConfig, BetterAuthApi, BetterAuthHandler, BetterAuthInstance, BetterAuthSession, BetterAuthSessionResult, BetterAuthUser, } from './better-auth.js';
27
+ export { AuthAdapterError, BetterAuthAdapter, createBetterAuthAdapter, } from './better-auth.js';
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,YAAY,EACV,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Auth Adapters - External authentication provider integrations
3
+ *
4
+ * This module exports adapters for integrating external authentication
5
+ * providers with VeloxTS. Each adapter implements the AuthAdapter interface
6
+ * and can be used with createAuthAdapterPlugin.
7
+ *
8
+ * @module auth/adapters
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { createBetterAuthAdapter } from '@veloxts/auth/adapters';
13
+ * import { createAuthAdapterPlugin } from '@veloxts/auth';
14
+ *
15
+ * const adapter = createBetterAuthAdapter({
16
+ * name: 'better-auth',
17
+ * auth: betterAuth({ ... }),
18
+ * });
19
+ *
20
+ * const plugin = createAuthAdapterPlugin({
21
+ * adapter,
22
+ * config: adapter.config,
23
+ * });
24
+ * ```
25
+ */
26
+ // BetterAuth Adapter
27
+ export { AuthAdapterError, BetterAuthAdapter, createBetterAuthAdapter, } from './better-auth.js';
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAWH,qBAAqB;AACrB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}