@better-auth/api-key 1.5.6 → 1.6.0-beta.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.
@@ -0,0 +1,1966 @@
1
+ import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-CCe5L05Y.mjs";
2
+ import * as better_auth0 from "better-auth";
3
+ import { HookEndpointContext } from "@better-auth/core";
4
+
5
+ //#region ../../node_modules/.pnpm/better-call@2.0.3_zod@4.3.6/node_modules/better-call/dist/cookies.d.mts
6
+ //#region src/cookies.d.ts
7
+ type CookiePrefixOptions = "host" | "secure";
8
+ type CookieOptions = {
9
+ /**
10
+ * Domain of the cookie
11
+ *
12
+ * The Domain attribute specifies which server can receive a cookie. If specified, cookies are
13
+ * available on the specified server and its subdomains. If the it is not
14
+ * specified, the cookies are available on the server that sets it but not on
15
+ * its subdomains.
16
+ *
17
+ * @example
18
+ * `domain: "example.com"`
19
+ */
20
+ domain?: string;
21
+ /**
22
+ * A lifetime of a cookie. Permanent cookies are deleted after the date specified in the
23
+ * Expires attribute:
24
+ *
25
+ * Expires has been available for longer than Max-Age, however Max-Age is less error-prone, and
26
+ * takes precedence when both are set. The rationale behind this is that when you set an
27
+ * Expires date and time, they're relative to the client the cookie is being set on. If the
28
+ * server is set to a different time, this could cause errors
29
+ */
30
+ expires?: Date;
31
+ /**
32
+ * Forbids JavaScript from accessing the cookie, for example, through the Document.cookie
33
+ * property. Note that a cookie that has been created with HttpOnly will still be sent with
34
+ * JavaScript-initiated requests, for example, when calling XMLHttpRequest.send() or fetch().
35
+ * This mitigates attacks against cross-site scripting
36
+ */
37
+ httpOnly?: boolean;
38
+ /**
39
+ * Indicates the number of seconds until the cookie expires. A zero or negative number will
40
+ * expire the cookie immediately. If both Expires and Max-Age are set, Max-Age has precedence.
41
+ *
42
+ * @example 604800 - 7 days
43
+ */
44
+ maxAge?: number;
45
+ /**
46
+ * Indicates the path that must exist in the requested URL for the browser to send the Cookie
47
+ * header.
48
+ *
49
+ * @example
50
+ * "/docs"
51
+ * // -> the request paths /docs, /docs/, /docs/Web/, and /docs/Web/HTTP will all match. the request paths /, /fr/docs will not match.
52
+ */
53
+ path?: string;
54
+ /**
55
+ * Indicates that the cookie is sent to the server only when a request is made with the https:
56
+ * scheme (except on localhost), and therefore, is more resistant to man-in-the-middle attacks.
57
+ */
58
+ secure?: boolean;
59
+ /**
60
+ * Controls whether or not a cookie is sent with cross-site requests, providing some protection
61
+ * against cross-site request forgery attacks (CSRF).
62
+ *
63
+ * Strict - Means that the browser sends the cookie only for same-site requests, that is,
64
+ * requests originating from the same site that set the cookie. If a request originates from a
65
+ * different domain or scheme (even with the same domain), no cookies with the SameSite=Strict
66
+ * attribute are sent.
67
+ *
68
+ * Lax - Means that the cookie is not sent on cross-site requests, such as on requests to load
69
+ * images or frames, but is sent when a user is navigating to the origin site from an external
70
+ * site (for example, when following a link). This is the default behavior if the SameSite
71
+ * attribute is not specified.
72
+ *
73
+ * None - Means that the browser sends the cookie with both cross-site and same-site requests.
74
+ * The Secure attribute must also be set when setting this value.
75
+ */
76
+ sameSite?: "Strict" | "Lax" | "None" | "strict" | "lax" | "none";
77
+ /**
78
+ * Indicates that the cookie should be stored using partitioned storage. Note that if this is
79
+ * set, the Secure directive must also be set.
80
+ *
81
+ * @see https://developer.mozilla.org/en-US/docs/Web/Privacy/Privacy_sandbox/Partitioned_cookies
82
+ */
83
+ partitioned?: boolean;
84
+ /**
85
+ * Cooke Prefix
86
+ *
87
+ * - secure: `__Secure-` -> `__Secure-cookie-name`
88
+ * - host: `__Host-` -> `__Host-cookie-name`
89
+ *
90
+ * `secure` must be set to true to use prefixes
91
+ */
92
+ prefix?: CookiePrefixOptions;
93
+ };
94
+ //#endregion
95
+ //#region ../../node_modules/.pnpm/better-call@2.0.3_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
96
+ //#region src/standard-schema.d.ts
97
+ /** The Standard Schema interface. */
98
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
99
+ /** The Standard Schema properties. */
100
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
101
+ }
102
+ declare namespace StandardSchemaV1 {
103
+ /** The Standard Schema properties interface. */
104
+ interface Props<Input = unknown, Output = Input> {
105
+ /** The version number of the standard. */
106
+ readonly version: 1;
107
+ /** The vendor name of the schema library. */
108
+ readonly vendor: string;
109
+ /** Validates unknown input values. */
110
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
111
+ /** Inferred types associated with the schema. */
112
+ readonly types?: Types<Input, Output> | undefined;
113
+ }
114
+ /** The result interface of the validate function. */
115
+ type Result<Output> = SuccessResult<Output> | FailureResult;
116
+ /** The result interface if validation succeeds. */
117
+ interface SuccessResult<Output> {
118
+ /** The typed output value. */
119
+ readonly value: Output;
120
+ /** The non-existent issues. */
121
+ readonly issues?: undefined;
122
+ }
123
+ /** The result interface if validation fails. */
124
+ interface FailureResult {
125
+ /** The issues of failed validation. */
126
+ readonly issues: ReadonlyArray<Issue>;
127
+ }
128
+ /** The issue interface of the failure output. */
129
+ interface Issue {
130
+ /** The error message of the issue. */
131
+ readonly message: string;
132
+ /** The path of the issue, if any. */
133
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
134
+ }
135
+ /** The path segment interface of the issue. */
136
+ interface PathSegment {
137
+ /** The key representing a path segment. */
138
+ readonly key: PropertyKey;
139
+ }
140
+ /** The Standard Schema types interface. */
141
+ interface Types<Input = unknown, Output = Input> {
142
+ /** The input type of the schema. */
143
+ readonly input: Input;
144
+ /** The output type of the schema. */
145
+ readonly output: Output;
146
+ }
147
+ /** Infers the input type of a Standard Schema. */
148
+ type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
149
+ /** Infers the output type of a Standard Schema. */
150
+ type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
151
+ } //#endregion
152
+ //#endregion
153
+ //#region ../../node_modules/.pnpm/better-call@2.0.3_zod@4.3.6/node_modules/better-call/dist/error.d.mts
154
+ declare const statusCodes: {
155
+ OK: number;
156
+ CREATED: number;
157
+ ACCEPTED: number;
158
+ NO_CONTENT: number;
159
+ MULTIPLE_CHOICES: number;
160
+ MOVED_PERMANENTLY: number;
161
+ FOUND: number;
162
+ SEE_OTHER: number;
163
+ NOT_MODIFIED: number;
164
+ TEMPORARY_REDIRECT: number;
165
+ BAD_REQUEST: number;
166
+ UNAUTHORIZED: number;
167
+ PAYMENT_REQUIRED: number;
168
+ FORBIDDEN: number;
169
+ NOT_FOUND: number;
170
+ METHOD_NOT_ALLOWED: number;
171
+ NOT_ACCEPTABLE: number;
172
+ PROXY_AUTHENTICATION_REQUIRED: number;
173
+ REQUEST_TIMEOUT: number;
174
+ CONFLICT: number;
175
+ GONE: number;
176
+ LENGTH_REQUIRED: number;
177
+ PRECONDITION_FAILED: number;
178
+ PAYLOAD_TOO_LARGE: number;
179
+ URI_TOO_LONG: number;
180
+ UNSUPPORTED_MEDIA_TYPE: number;
181
+ RANGE_NOT_SATISFIABLE: number;
182
+ EXPECTATION_FAILED: number;
183
+ "I'M_A_TEAPOT": number;
184
+ MISDIRECTED_REQUEST: number;
185
+ UNPROCESSABLE_ENTITY: number;
186
+ LOCKED: number;
187
+ FAILED_DEPENDENCY: number;
188
+ TOO_EARLY: number;
189
+ UPGRADE_REQUIRED: number;
190
+ PRECONDITION_REQUIRED: number;
191
+ TOO_MANY_REQUESTS: number;
192
+ REQUEST_HEADER_FIELDS_TOO_LARGE: number;
193
+ UNAVAILABLE_FOR_LEGAL_REASONS: number;
194
+ INTERNAL_SERVER_ERROR: number;
195
+ NOT_IMPLEMENTED: number;
196
+ BAD_GATEWAY: number;
197
+ SERVICE_UNAVAILABLE: number;
198
+ GATEWAY_TIMEOUT: number;
199
+ HTTP_VERSION_NOT_SUPPORTED: number;
200
+ VARIANT_ALSO_NEGOTIATES: number;
201
+ INSUFFICIENT_STORAGE: number;
202
+ LOOP_DETECTED: number;
203
+ NOT_EXTENDED: number;
204
+ NETWORK_AUTHENTICATION_REQUIRED: number;
205
+ };
206
+ type Status = 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
207
+ declare class InternalAPIError extends Error {
208
+ status: keyof typeof statusCodes | Status;
209
+ body: ({
210
+ message?: string;
211
+ code?: string;
212
+ cause?: unknown;
213
+ } & Record<string, any>) | undefined;
214
+ headers: HeadersInit;
215
+ statusCode: number;
216
+ constructor(status?: keyof typeof statusCodes | Status, body?: ({
217
+ message?: string;
218
+ code?: string;
219
+ cause?: unknown;
220
+ } & Record<string, any>) | undefined, headers?: HeadersInit, statusCode?: number);
221
+ }
222
+ type APIError = InstanceType<typeof InternalAPIError>;
223
+ declare const APIError: new (status?: Status | "OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "BAD_REQUEST" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "LENGTH_REQUIRED" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "URI_TOO_LONG" | "UNSUPPORTED_MEDIA_TYPE" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "TOO_MANY_REQUESTS" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED" | undefined, body?: ({
224
+ message?: string;
225
+ code?: string;
226
+ cause?: unknown;
227
+ } & Record<string, any>) | undefined, headers?: HeadersInit | undefined, statusCode?: number | undefined) => InternalAPIError & {
228
+ errorStack: string | undefined;
229
+ }; //#endregion
230
+ //#endregion
231
+ //#region ../../node_modules/.pnpm/better-call@2.0.3_zod@4.3.6/node_modules/better-call/dist/helper.d.mts
232
+ type Prettify<T> = 0 extends 1 & T ? any : { [K in keyof T]: T[K] } & {};
233
+ type IsEmptyObject<T> = keyof T extends never ? true : false;
234
+ type InferParamPath<Path> = Path extends `${infer _Start}:${infer Param}/${infer Rest}` ? { [K in Param | keyof InferParamPath<Rest>]: string } : Path extends `${infer _Start}:${infer Param}` ? { [K in Param]: string } : Path extends `${infer _Start}/${infer Rest}` ? InferParamPath<Rest> : {};
235
+ type InferParamWildCard<Path> = Path extends `${infer _Start}/*:${infer Param}/${infer Rest}` | `${infer _Start}/**:${infer Param}/${infer Rest}` ? { [K in Param | keyof InferParamPath<Rest>]: string } : Path extends `${infer _Start}/*` ? { [K in "_"]: string } : Path extends `${infer _Start}/${infer Rest}` ? InferParamWildCard<Rest> : {}; //#endregion
236
+ //#endregion
237
+ //#region ../../node_modules/.pnpm/better-call@2.0.3_zod@4.3.6/node_modules/better-call/dist/middleware.d.mts
238
+ //#region src/middleware.d.ts
239
+ type MiddlewareContext<Context = {}> = {
240
+ /**
241
+ * Method
242
+ *
243
+ * The request method
244
+ */
245
+ method: string;
246
+ /**
247
+ * Path
248
+ *
249
+ * The path of the endpoint
250
+ */
251
+ path: string;
252
+ /**
253
+ * Body
254
+ *
255
+ * The body object will be the parsed JSON from the request and validated
256
+ * against the body schema if it exists
257
+ */
258
+ body: any;
259
+ /**
260
+ * Query
261
+ *
262
+ * The query object will be the parsed query string from the request
263
+ * and validated against the query schema if it exists
264
+ */
265
+ query: Record<string, any> | undefined;
266
+ /**
267
+ * Params
268
+ *
269
+ * If the path is `/user/:id` and the request is `/user/1` then the
270
+ * params will be `{ id: "1" }` and if the path includes a wildcard like
271
+ * `/user/*` then the params will be `{ _: "1" }` where `_` is the wildcard
272
+ * key. If the wildcard is named like `/user/**:name` then the params will
273
+ * be `{ name: string }`
274
+ */
275
+ params: Record<string, any> | undefined;
276
+ /**
277
+ * Request object
278
+ *
279
+ * If `requireRequest` is set to true in the endpoint options this will be
280
+ * required
281
+ */
282
+ request: Request | undefined;
283
+ /**
284
+ * Headers
285
+ *
286
+ * If `requireHeaders` is set to true in the endpoint options this will be
287
+ * required
288
+ */
289
+ headers: Headers | undefined;
290
+ /**
291
+ * Set header
292
+ *
293
+ * If it's called outside of a request it will just be ignored.
294
+ */
295
+ setHeader: (key: string, value: string) => void;
296
+ /**
297
+ * Set the response status code
298
+ */
299
+ setStatus: (status: Status) => void;
300
+ /**
301
+ * Get header
302
+ *
303
+ * If it's called outside of a request it will just return null
304
+ *
305
+ * @param key - The key of the header
306
+ */
307
+ getHeader: (key: string) => string | null;
308
+ /**
309
+ * Get a cookie value from the request
310
+ *
311
+ * @param key - The key of the cookie
312
+ * @param prefix - The prefix of the cookie between `__Secure-` and `__Host-`
313
+ * @returns The value of the cookie
314
+ */
315
+ getCookie: (key: string, prefix?: CookiePrefixOptions) => string | null;
316
+ /**
317
+ * Get a signed cookie value from the request
318
+ *
319
+ * @param key - The key of the cookie
320
+ * @param secret - The secret of the signed cookie
321
+ * @param prefix - The prefix of the cookie between `__Secure-` and `__Host-`
322
+ * @returns The value of the cookie or null if the cookie is not found or false if the signature is invalid
323
+ */
324
+ getSignedCookie: (key: string, secret: string, prefix?: CookiePrefixOptions) => Promise<string | null | false>;
325
+ /**
326
+ * Set a cookie value in the response
327
+ *
328
+ * @param key - The key of the cookie
329
+ * @param value - The value to set
330
+ * @param options - The options of the cookie
331
+ * @returns The cookie string
332
+ */
333
+ setCookie: (key: string, value: string, options?: CookieOptions) => string;
334
+ /**
335
+ * Set signed cookie
336
+ *
337
+ * @param key - The key of the cookie
338
+ * @param value - The value to set
339
+ * @param secret - The secret to sign the cookie with
340
+ * @param options - The options of the cookie
341
+ * @returns The cookie string
342
+ */
343
+ setSignedCookie: (key: string, value: string, secret: string, options?: CookieOptions) => Promise<string>;
344
+ /**
345
+ * JSON
346
+ *
347
+ * A helper function to create a JSON response with the correct headers
348
+ * and status code. If `asResponse` is set to true in the context then
349
+ * it will return a Response object instead of the JSON object.
350
+ *
351
+ * @param json - The JSON object to return
352
+ * @param routerResponse - The response object to return if `asResponse` is
353
+ * true in the context this will take precedence
354
+ */
355
+ json: <R extends Record<string, any> | null>(json: R, routerResponse?: {
356
+ status?: number;
357
+ headers?: Record<string, string>;
358
+ response?: Response;
359
+ body?: Record<string, any>;
360
+ } | Response) => R;
361
+ /**
362
+ * Middleware context
363
+ */
364
+ context: Prettify<Context>;
365
+ /**
366
+ * Redirect to a new URL
367
+ */
368
+ redirect: (url: string) => APIError;
369
+ /**
370
+ * Return error
371
+ */
372
+ error: (status: keyof typeof statusCodes | Status, body?: {
373
+ message?: string;
374
+ code?: string;
375
+ } & Record<string, any>, headers?: HeadersInit) => APIError;
376
+ asResponse?: boolean;
377
+ returnHeaders?: boolean;
378
+ returnStatus?: boolean;
379
+ responseHeaders: Headers;
380
+ };
381
+ type DefaultHandler = (inputCtx: MiddlewareContext<any>) => Promise<any>;
382
+ type Middleware<Handler extends (inputCtx: MiddlewareContext<any>) => Promise<any> = DefaultHandler> = Handler & {
383
+ options: Record<string, any>;
384
+ };
385
+ //#endregion
386
+ //#region ../../node_modules/.pnpm/better-call@2.0.3_zod@4.3.6/node_modules/better-call/dist/types.d.mts
387
+ //#region src/types.d.ts
388
+ type HTTPMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD";
389
+ /**
390
+ * Resolves a method type parameter to its effective runtime type.
391
+ */
392
+ /**
393
+ * Infer param input (required vs optional based on whether path has params).
394
+ */
395
+ type InferParamInput<Path extends string> = [Path] extends [never] ? {
396
+ params?: Record<string, any>;
397
+ } : IsEmptyObject<InferParamPath<Path> & InferParamWildCard<Path>> extends true ? {
398
+ params?: Record<string, any>;
399
+ } : {
400
+ params: Prettify<InferParamPath<Path> & InferParamWildCard<Path>>;
401
+ };
402
+ /**
403
+ * Infer body input from an already-resolved body type.
404
+ * Body is the plain resolved type (not a schema).
405
+ */
406
+ type InferBodyInput<Body> = undefined extends Body ? {
407
+ body?: Body;
408
+ } : {
409
+ body: Body;
410
+ };
411
+ /**
412
+ * Infer query input from an already-resolved query type.
413
+ * Query is the plain resolved type (not a schema).
414
+ */
415
+ type InferQueryInput<Query> = undefined extends Query ? {
416
+ query?: Query;
417
+ } : {
418
+ query: Query;
419
+ };
420
+ /**
421
+ * Infer method input: required for wildcard, optional for arrays and single methods.
422
+ */
423
+ type InferMethodInput<M> = 0 extends 1 & M ? {
424
+ method?: HTTPMethod | undefined;
425
+ } : M extends "*" ? {
426
+ method: HTTPMethod;
427
+ } : M extends Array<any> ? {
428
+ method?: M[number] | undefined;
429
+ } : {
430
+ method?: M | undefined;
431
+ };
432
+ /**
433
+ * Infer request input.
434
+ */
435
+ type InferRequestInput<ReqRequest extends boolean> = 0 extends 1 & ReqRequest ? {
436
+ request?: Request;
437
+ } : ReqRequest extends true ? {
438
+ request: Request;
439
+ } : {
440
+ request?: Request;
441
+ };
442
+ /**
443
+ * Infer headers input.
444
+ */
445
+ type InferHeadersInput<ReqHeaders extends boolean> = 0 extends 1 & ReqHeaders ? {
446
+ headers?: HeadersInit;
447
+ } : ReqHeaders extends true ? {
448
+ headers: HeadersInit;
449
+ } : {
450
+ headers?: HeadersInit;
451
+ };
452
+ /**
453
+ * Infer the use (middleware) context union.
454
+ * Guards against `any` and `[]` to avoid poisoning the Context type.
455
+ */
456
+ /**
457
+ * The full InputContext type for the Endpoint call signature.
458
+ * Body and Query are already-resolved plain types.
459
+ */
460
+ type InputContext<Path extends string, M, Body, Query, ReqHeaders extends boolean, ReqRequest extends boolean> = InferBodyInput<Body> & InferMethodInput<M> & InferQueryInput<Query> & InferParamInput<Path> & InferRequestInput<ReqRequest> & InferHeadersInput<ReqHeaders> & {
461
+ asResponse?: boolean;
462
+ returnHeaders?: boolean;
463
+ returnStatus?: boolean;
464
+ use?: Middleware[];
465
+ path?: string;
466
+ context?: Record<string, any>;
467
+ }; //#endregion
468
+ //#endregion
469
+ //#region ../../node_modules/.pnpm/better-call@2.0.3_zod@4.3.6/node_modules/better-call/dist/endpoint.d.mts
470
+ //#region src/endpoint.d.ts
471
+ interface EndpointMetadata {
472
+ /**
473
+ * Open API definition
474
+ */
475
+ openapi?: {
476
+ summary?: string;
477
+ description?: string;
478
+ tags?: string[];
479
+ operationId?: string;
480
+ parameters?: OpenAPIParameter[];
481
+ requestBody?: {
482
+ content: {
483
+ "application/json": {
484
+ schema: {
485
+ type?: OpenAPISchemaType;
486
+ properties?: Record<string, any>;
487
+ required?: string[];
488
+ $ref?: string;
489
+ };
490
+ };
491
+ };
492
+ };
493
+ responses?: {
494
+ [status: string]: {
495
+ description: string;
496
+ content?: {
497
+ "application/json"?: {
498
+ schema: {
499
+ type?: OpenAPISchemaType;
500
+ properties?: Record<string, any>;
501
+ required?: string[];
502
+ $ref?: string;
503
+ };
504
+ };
505
+ "text/plain"?: {
506
+ schema?: {
507
+ type?: OpenAPISchemaType;
508
+ properties?: Record<string, any>;
509
+ required?: string[];
510
+ $ref?: string;
511
+ };
512
+ };
513
+ "text/html"?: {
514
+ schema?: {
515
+ type?: OpenAPISchemaType;
516
+ properties?: Record<string, any>;
517
+ required?: string[];
518
+ $ref?: string;
519
+ };
520
+ };
521
+ };
522
+ };
523
+ };
524
+ };
525
+ /**
526
+ * Infer body and query type from ts interface
527
+ *
528
+ * useful for generic and dynamic types
529
+ *
530
+ * @example
531
+ * ```ts
532
+ * const endpoint = createEndpoint("/path", {
533
+ * method: "POST",
534
+ * body: z.record(z.string()),
535
+ * $Infer: {
536
+ * body: {} as {
537
+ * type: InferTypeFromOptions<Option> // custom type inference
538
+ * }
539
+ * }
540
+ * }, async(ctx)=>{
541
+ * const body = ctx.body
542
+ * })
543
+ * ```
544
+ */
545
+ $Infer?: {
546
+ /**
547
+ * Body
548
+ */
549
+ body?: any;
550
+ /**
551
+ * Query
552
+ */
553
+ query?: Record<string, any>;
554
+ /**
555
+ * Error
556
+ */
557
+ error?: any;
558
+ };
559
+ /**
560
+ * If enabled, endpoint won't be exposed over a router
561
+ * @deprecated Use path-less endpoints instead
562
+ */
563
+ SERVER_ONLY?: boolean;
564
+ /**
565
+ * If enabled, endpoint won't be exposed as an action to the client
566
+ * @deprecated Use path-less endpoints instead
567
+ */
568
+ isAction?: boolean;
569
+ /**
570
+ * Defines the places where the endpoint will be available
571
+ *
572
+ * Possible options:
573
+ * - `rpc` - the endpoint is exposed to the router, can be invoked directly and is available to the client
574
+ * - `server` - the endpoint is exposed to the router, can be invoked directly, but is not available to the client
575
+ * - `http` - the endpoint is only exposed to the router
576
+ * @default "rpc"
577
+ */
578
+ scope?: "rpc" | "server" | "http";
579
+ /**
580
+ * List of allowed media types (MIME types) for the endpoint
581
+ *
582
+ * if provided, only the media types in the list will be allowed to be passed in the body
583
+ *
584
+ * @example
585
+ * ```ts
586
+ * const endpoint = createEndpoint("/path", {
587
+ * method: "POST",
588
+ * allowedMediaTypes: ["application/json", "application/x-www-form-urlencoded"],
589
+ * }, async(ctx)=>{
590
+ * const body = ctx.body
591
+ * })
592
+ * ```
593
+ */
594
+ allowedMediaTypes?: string[];
595
+ /**
596
+ * Extra metadata
597
+ */
598
+ [key: string]: any;
599
+ }
600
+ interface EndpointRuntimeOptions {
601
+ method: string | string[];
602
+ body?: StandardSchemaV1;
603
+ /**
604
+ * Query Schema
605
+ */
606
+ query?: StandardSchemaV1;
607
+ /**
608
+ * Error Schema
609
+ */
610
+ error?: StandardSchemaV1;
611
+ /**
612
+ * If true headers will be required to be passed in the context
613
+ */
614
+ requireHeaders?: boolean;
615
+ /**
616
+ * If true request object will be required
617
+ */
618
+ requireRequest?: boolean;
619
+ /**
620
+ * Clone the request object from the router
621
+ */
622
+ cloneRequest?: boolean;
623
+ /**
624
+ * If true the body will be undefined
625
+ */
626
+ disableBody?: boolean;
627
+ /**
628
+ * Endpoint metadata
629
+ */
630
+ metadata?: EndpointMetadata;
631
+ /**
632
+ * List of middlewares to use
633
+ */
634
+ use?: Middleware[];
635
+ /**
636
+ * A callback to run before any API error is thrown or returned
637
+ *
638
+ * @param e - The API error
639
+ */
640
+ onAPIError?: (e: APIError) => void | Promise<void>;
641
+ /**
642
+ * A callback to run before a validation error is thrown.
643
+ * You can customize the validation error message by throwing your own APIError.
644
+ */
645
+ onValidationError?: (info: {
646
+ message: string;
647
+ issues: readonly StandardSchemaV1.Issue[];
648
+ }) => void | Promise<void>;
649
+ }
650
+ type Endpoint<Path extends string = string, Method = any, Body = any, Query = any, Use extends Middleware[] = any, R = any, Meta extends EndpointMetadata | undefined = EndpointMetadata | undefined, Error = any> = {
651
+ (context: InputContext<Path, Method, Body, Query, false, false> & {
652
+ asResponse: true;
653
+ }): Promise<Response>;
654
+ (context: InputContext<Path, Method, Body, Query, false, false> & {
655
+ returnHeaders: true;
656
+ returnStatus: true;
657
+ }): Promise<{
658
+ headers: Headers;
659
+ status: number;
660
+ response: Awaited<R>;
661
+ }>;
662
+ (context: InputContext<Path, Method, Body, Query, false, false> & {
663
+ returnHeaders: true;
664
+ }): Promise<{
665
+ headers: Headers;
666
+ response: Awaited<R>;
667
+ }>;
668
+ (context: InputContext<Path, Method, Body, Query, false, false> & {
669
+ returnStatus: true;
670
+ }): Promise<{
671
+ status: number;
672
+ response: Awaited<R>;
673
+ }>;
674
+ (context?: InputContext<Path, Method, Body, Query, false, false>): Promise<Awaited<R>>;
675
+ readonly options: Omit<EndpointRuntimeOptions, "method" | "metadata"> & {
676
+ readonly method: Method;
677
+ readonly metadata?: Meta;
678
+ };
679
+ readonly path: Path;
680
+ };
681
+ //#endregion
682
+ //#region ../../node_modules/.pnpm/better-call@2.0.3_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
683
+ //#region src/openapi.d.ts
684
+ type OpenAPISchemaType = "string" | "number" | "integer" | "boolean" | "array" | "object";
685
+ interface OpenAPIParameter {
686
+ in: "query" | "path" | "header" | "cookie";
687
+ name?: string;
688
+ description?: string;
689
+ required?: boolean;
690
+ schema?: {
691
+ type: OpenAPISchemaType;
692
+ format?: string | undefined;
693
+ items?: {
694
+ type: OpenAPISchemaType;
695
+ };
696
+ enum?: string[];
697
+ minLength?: number;
698
+ description?: string | undefined;
699
+ default?: string | undefined;
700
+ example?: string | undefined;
701
+ };
702
+ }
703
+ //#endregion
704
+ //#region src/error-codes.d.ts
705
+ declare const API_KEY_ERROR_CODES: {
706
+ INVALID_METADATA_TYPE: better_auth0.RawError<"INVALID_METADATA_TYPE">;
707
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: better_auth0.RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
708
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: better_auth0.RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
709
+ USER_BANNED: better_auth0.RawError<"USER_BANNED">;
710
+ UNAUTHORIZED_SESSION: better_auth0.RawError<"UNAUTHORIZED_SESSION">;
711
+ KEY_NOT_FOUND: better_auth0.RawError<"KEY_NOT_FOUND">;
712
+ KEY_DISABLED: better_auth0.RawError<"KEY_DISABLED">;
713
+ KEY_EXPIRED: better_auth0.RawError<"KEY_EXPIRED">;
714
+ USAGE_EXCEEDED: better_auth0.RawError<"USAGE_EXCEEDED">;
715
+ KEY_NOT_RECOVERABLE: better_auth0.RawError<"KEY_NOT_RECOVERABLE">;
716
+ EXPIRES_IN_IS_TOO_SMALL: better_auth0.RawError<"EXPIRES_IN_IS_TOO_SMALL">;
717
+ EXPIRES_IN_IS_TOO_LARGE: better_auth0.RawError<"EXPIRES_IN_IS_TOO_LARGE">;
718
+ INVALID_REMAINING: better_auth0.RawError<"INVALID_REMAINING">;
719
+ INVALID_PREFIX_LENGTH: better_auth0.RawError<"INVALID_PREFIX_LENGTH">;
720
+ INVALID_NAME_LENGTH: better_auth0.RawError<"INVALID_NAME_LENGTH">;
721
+ METADATA_DISABLED: better_auth0.RawError<"METADATA_DISABLED">;
722
+ RATE_LIMIT_EXCEEDED: better_auth0.RawError<"RATE_LIMIT_EXCEEDED">;
723
+ NO_VALUES_TO_UPDATE: better_auth0.RawError<"NO_VALUES_TO_UPDATE">;
724
+ KEY_DISABLED_EXPIRATION: better_auth0.RawError<"KEY_DISABLED_EXPIRATION">;
725
+ INVALID_API_KEY: better_auth0.RawError<"INVALID_API_KEY">;
726
+ INVALID_USER_ID_FROM_API_KEY: better_auth0.RawError<"INVALID_USER_ID_FROM_API_KEY">;
727
+ INVALID_REFERENCE_ID_FROM_API_KEY: better_auth0.RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
728
+ INVALID_API_KEY_GETTER_RETURN_TYPE: better_auth0.RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
729
+ SERVER_ONLY_PROPERTY: better_auth0.RawError<"SERVER_ONLY_PROPERTY">;
730
+ FAILED_TO_UPDATE_API_KEY: better_auth0.RawError<"FAILED_TO_UPDATE_API_KEY">;
731
+ NAME_REQUIRED: better_auth0.RawError<"NAME_REQUIRED">;
732
+ ORGANIZATION_ID_REQUIRED: better_auth0.RawError<"ORGANIZATION_ID_REQUIRED">;
733
+ USER_NOT_MEMBER_OF_ORGANIZATION: better_auth0.RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
734
+ INSUFFICIENT_API_KEY_PERMISSIONS: better_auth0.RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
735
+ NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: better_auth0.RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
736
+ ORGANIZATION_PLUGIN_REQUIRED: better_auth0.RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
737
+ };
738
+ //#endregion
739
+ //#region src/index.d.ts
740
+ declare module "@better-auth/core" {
741
+ interface BetterAuthPluginRegistry<AuthOptions, Options> {
742
+ "api-key": {
743
+ creator: typeof apiKey;
744
+ };
745
+ }
746
+ }
747
+ declare const defaultKeyHasher: (key: string) => Promise<string>;
748
+ declare const API_KEY_TABLE_NAME = "apikey";
749
+ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOptions) | ApiKeyConfigurationOptions[] | undefined, _options?: ApiKeyOptions | undefined): {
750
+ id: "api-key";
751
+ version: string;
752
+ $ERROR_CODES: {
753
+ INVALID_METADATA_TYPE: better_auth0.RawError<"INVALID_METADATA_TYPE">;
754
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: better_auth0.RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
755
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: better_auth0.RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
756
+ USER_BANNED: better_auth0.RawError<"USER_BANNED">;
757
+ UNAUTHORIZED_SESSION: better_auth0.RawError<"UNAUTHORIZED_SESSION">;
758
+ KEY_NOT_FOUND: better_auth0.RawError<"KEY_NOT_FOUND">;
759
+ KEY_DISABLED: better_auth0.RawError<"KEY_DISABLED">;
760
+ KEY_EXPIRED: better_auth0.RawError<"KEY_EXPIRED">;
761
+ USAGE_EXCEEDED: better_auth0.RawError<"USAGE_EXCEEDED">;
762
+ KEY_NOT_RECOVERABLE: better_auth0.RawError<"KEY_NOT_RECOVERABLE">;
763
+ EXPIRES_IN_IS_TOO_SMALL: better_auth0.RawError<"EXPIRES_IN_IS_TOO_SMALL">;
764
+ EXPIRES_IN_IS_TOO_LARGE: better_auth0.RawError<"EXPIRES_IN_IS_TOO_LARGE">;
765
+ INVALID_REMAINING: better_auth0.RawError<"INVALID_REMAINING">;
766
+ INVALID_PREFIX_LENGTH: better_auth0.RawError<"INVALID_PREFIX_LENGTH">;
767
+ INVALID_NAME_LENGTH: better_auth0.RawError<"INVALID_NAME_LENGTH">;
768
+ METADATA_DISABLED: better_auth0.RawError<"METADATA_DISABLED">;
769
+ RATE_LIMIT_EXCEEDED: better_auth0.RawError<"RATE_LIMIT_EXCEEDED">;
770
+ NO_VALUES_TO_UPDATE: better_auth0.RawError<"NO_VALUES_TO_UPDATE">;
771
+ KEY_DISABLED_EXPIRATION: better_auth0.RawError<"KEY_DISABLED_EXPIRATION">;
772
+ INVALID_API_KEY: better_auth0.RawError<"INVALID_API_KEY">;
773
+ INVALID_USER_ID_FROM_API_KEY: better_auth0.RawError<"INVALID_USER_ID_FROM_API_KEY">;
774
+ INVALID_REFERENCE_ID_FROM_API_KEY: better_auth0.RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
775
+ INVALID_API_KEY_GETTER_RETURN_TYPE: better_auth0.RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
776
+ SERVER_ONLY_PROPERTY: better_auth0.RawError<"SERVER_ONLY_PROPERTY">;
777
+ FAILED_TO_UPDATE_API_KEY: better_auth0.RawError<"FAILED_TO_UPDATE_API_KEY">;
778
+ NAME_REQUIRED: better_auth0.RawError<"NAME_REQUIRED">;
779
+ ORGANIZATION_ID_REQUIRED: better_auth0.RawError<"ORGANIZATION_ID_REQUIRED">;
780
+ USER_NOT_MEMBER_OF_ORGANIZATION: better_auth0.RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
781
+ INSUFFICIENT_API_KEY_PERMISSIONS: better_auth0.RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
782
+ NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: better_auth0.RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
783
+ ORGANIZATION_PLUGIN_REQUIRED: better_auth0.RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
784
+ };
785
+ hooks: {
786
+ before: {
787
+ matcher: (ctx: HookEndpointContext) => boolean;
788
+ handler: Middleware<(inputContext: Record<string, any>) => Promise<{
789
+ user: {
790
+ id: string;
791
+ createdAt: Date;
792
+ updatedAt: Date;
793
+ email: string;
794
+ emailVerified: boolean;
795
+ name: string;
796
+ image?: string | null | undefined;
797
+ };
798
+ session: {
799
+ id: string;
800
+ token: string;
801
+ userId: string;
802
+ userAgent: string | null;
803
+ ipAddress: string | null;
804
+ createdAt: Date;
805
+ updatedAt: Date;
806
+ expiresAt: Date;
807
+ };
808
+ } | {
809
+ context: MiddlewareContext<{
810
+ returned?: unknown | undefined;
811
+ responseHeaders?: Headers | undefined;
812
+ } & better_auth0.PluginContext<better_auth0.BetterAuthOptions> & better_auth0.InfoContext & {
813
+ options: better_auth0.BetterAuthOptions;
814
+ trustedOrigins: string[];
815
+ trustedProviders: string[];
816
+ isTrustedOrigin: (url: string, settings?: {
817
+ allowRelativePaths: boolean;
818
+ }) => boolean;
819
+ oauthConfig: {
820
+ skipStateCookieCheck?: boolean | undefined;
821
+ storeStateStrategy: "database" | "cookie";
822
+ };
823
+ newSession: {
824
+ session: {
825
+ id: string;
826
+ createdAt: Date;
827
+ updatedAt: Date;
828
+ userId: string;
829
+ expiresAt: Date;
830
+ token: string;
831
+ ipAddress?: string | null | undefined;
832
+ userAgent?: string | null | undefined;
833
+ } & Record<string, any>;
834
+ user: {
835
+ id: string;
836
+ createdAt: Date;
837
+ updatedAt: Date;
838
+ email: string;
839
+ emailVerified: boolean;
840
+ name: string;
841
+ image?: string | null | undefined;
842
+ } & Record<string, any>;
843
+ } | null;
844
+ session: {
845
+ session: {
846
+ id: string;
847
+ createdAt: Date;
848
+ updatedAt: Date;
849
+ userId: string;
850
+ expiresAt: Date;
851
+ token: string;
852
+ ipAddress?: string | null | undefined;
853
+ userAgent?: string | null | undefined;
854
+ } & Record<string, any>;
855
+ user: {
856
+ id: string;
857
+ createdAt: Date;
858
+ updatedAt: Date;
859
+ email: string;
860
+ emailVerified: boolean;
861
+ name: string;
862
+ image?: string | null | undefined;
863
+ } & Record<string, any>;
864
+ } | null;
865
+ setNewSession: (session: {
866
+ session: {
867
+ id: string;
868
+ createdAt: Date;
869
+ updatedAt: Date;
870
+ userId: string;
871
+ expiresAt: Date;
872
+ token: string;
873
+ ipAddress?: string | null | undefined;
874
+ userAgent?: string | null | undefined;
875
+ } & Record<string, any>;
876
+ user: {
877
+ id: string;
878
+ createdAt: Date;
879
+ updatedAt: Date;
880
+ email: string;
881
+ emailVerified: boolean;
882
+ name: string;
883
+ image?: string | null | undefined;
884
+ } & Record<string, any>;
885
+ } | null) => void;
886
+ socialProviders: better_auth0.OAuthProvider[];
887
+ authCookies: better_auth0.BetterAuthCookies;
888
+ logger: ReturnType<typeof better_auth0.createLogger>;
889
+ rateLimit: {
890
+ enabled: boolean;
891
+ window: number;
892
+ max: number;
893
+ storage: "memory" | "database" | "secondary-storage";
894
+ } & Omit<better_auth0.BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
895
+ adapter: better_auth0.DBAdapter<better_auth0.BetterAuthOptions>;
896
+ internalAdapter: better_auth0.InternalAdapter<better_auth0.BetterAuthOptions>;
897
+ createAuthCookie: (cookieName: string, overrideAttributes?: Partial<CookieOptions> | undefined) => better_auth0.BetterAuthCookie;
898
+ secret: string;
899
+ secretConfig: string | better_auth0.SecretConfig;
900
+ sessionConfig: {
901
+ updateAge: number;
902
+ expiresIn: number;
903
+ freshAge: number;
904
+ cookieRefreshCache: false | {
905
+ enabled: true;
906
+ updateAge: number;
907
+ };
908
+ };
909
+ generateId: (options: {
910
+ model: better_auth0.ModelNames;
911
+ size?: number | undefined;
912
+ }) => string | false;
913
+ secondaryStorage: better_auth0.SecondaryStorage | undefined;
914
+ password: {
915
+ hash: (password: string) => Promise<string>;
916
+ verify: (data: {
917
+ password: string;
918
+ hash: string;
919
+ }) => Promise<boolean>;
920
+ config: {
921
+ minPasswordLength: number;
922
+ maxPasswordLength: number;
923
+ };
924
+ checkPassword: (userId: string, ctx: better_auth0.GenericEndpointContext<better_auth0.BetterAuthOptions>) => Promise<boolean>;
925
+ };
926
+ tables: better_auth0.BetterAuthDBSchema;
927
+ runMigrations: () => Promise<void>;
928
+ publishTelemetry: (event: {
929
+ type: string;
930
+ anonymousId?: string | undefined;
931
+ payload: Record<string, any>;
932
+ }) => Promise<void>;
933
+ skipOriginCheck: boolean | string[];
934
+ skipCSRFCheck: boolean;
935
+ runInBackground: (promise: Promise<unknown>) => void;
936
+ runInBackgroundOrAwait: (promise: Promise<unknown> | void) => better_auth0.Awaitable<unknown>;
937
+ }>;
938
+ }>>;
939
+ }[];
940
+ };
941
+ endpoints: {
942
+ /**
943
+ * ### Endpoint
944
+ *
945
+ * POST `/api-key/create`
946
+ *
947
+ * ### API Methods
948
+ *
949
+ * **server:**
950
+ * `auth.api.createApiKey`
951
+ *
952
+ * **client:**
953
+ * `authClient.apiKey.create`
954
+ *
955
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-create)
956
+ */
957
+ createApiKey: Endpoint<"/api-key/create", "POST", {
958
+ configId?: string | undefined;
959
+ name?: string | undefined;
960
+ expiresIn?: number | null | undefined;
961
+ prefix?: string | undefined;
962
+ remaining?: number | null | undefined;
963
+ metadata?: any;
964
+ refillAmount?: number | undefined;
965
+ refillInterval?: number | undefined;
966
+ rateLimitTimeWindow?: number | undefined;
967
+ rateLimitMax?: number | undefined;
968
+ rateLimitEnabled?: boolean | undefined;
969
+ permissions?: Record<string, string[]> | undefined;
970
+ userId?: unknown;
971
+ organizationId?: unknown;
972
+ }, Record<string, any> | undefined, [], {
973
+ key: string;
974
+ metadata: any;
975
+ permissions: any;
976
+ id: string;
977
+ configId: string;
978
+ name: string | null;
979
+ start: string | null;
980
+ prefix: string | null;
981
+ referenceId: string;
982
+ refillInterval: number | null;
983
+ refillAmount: number | null;
984
+ lastRefillAt: Date | null;
985
+ enabled: boolean;
986
+ rateLimitEnabled: boolean;
987
+ rateLimitTimeWindow: number | null;
988
+ rateLimitMax: number | null;
989
+ requestCount: number;
990
+ remaining: number | null;
991
+ lastRequest: Date | null;
992
+ expiresAt: Date | null;
993
+ createdAt: Date;
994
+ updatedAt: Date;
995
+ }, {
996
+ openapi: {
997
+ description: string;
998
+ responses: {
999
+ "200": {
1000
+ description: string;
1001
+ content: {
1002
+ "application/json": {
1003
+ schema: {
1004
+ type: "object";
1005
+ properties: {
1006
+ id: {
1007
+ type: string;
1008
+ description: string;
1009
+ };
1010
+ createdAt: {
1011
+ type: string;
1012
+ format: string;
1013
+ description: string;
1014
+ };
1015
+ updatedAt: {
1016
+ type: string;
1017
+ format: string;
1018
+ description: string;
1019
+ };
1020
+ name: {
1021
+ type: string;
1022
+ nullable: boolean;
1023
+ description: string;
1024
+ };
1025
+ prefix: {
1026
+ type: string;
1027
+ nullable: boolean;
1028
+ description: string;
1029
+ };
1030
+ start: {
1031
+ type: string;
1032
+ nullable: boolean;
1033
+ description: string;
1034
+ };
1035
+ key: {
1036
+ type: string;
1037
+ description: string;
1038
+ };
1039
+ enabled: {
1040
+ type: string;
1041
+ description: string;
1042
+ };
1043
+ expiresAt: {
1044
+ type: string;
1045
+ format: string;
1046
+ nullable: boolean;
1047
+ description: string;
1048
+ };
1049
+ referenceId: {
1050
+ type: string;
1051
+ description: string;
1052
+ };
1053
+ lastRefillAt: {
1054
+ type: string;
1055
+ format: string;
1056
+ nullable: boolean;
1057
+ description: string;
1058
+ };
1059
+ lastRequest: {
1060
+ type: string;
1061
+ format: string;
1062
+ nullable: boolean;
1063
+ description: string;
1064
+ };
1065
+ metadata: {
1066
+ type: string;
1067
+ nullable: boolean;
1068
+ additionalProperties: boolean;
1069
+ description: string;
1070
+ };
1071
+ rateLimitMax: {
1072
+ type: string;
1073
+ nullable: boolean;
1074
+ description: string;
1075
+ };
1076
+ rateLimitTimeWindow: {
1077
+ type: string;
1078
+ nullable: boolean;
1079
+ description: string;
1080
+ };
1081
+ remaining: {
1082
+ type: string;
1083
+ nullable: boolean;
1084
+ description: string;
1085
+ };
1086
+ refillAmount: {
1087
+ type: string;
1088
+ nullable: boolean;
1089
+ description: string;
1090
+ };
1091
+ refillInterval: {
1092
+ type: string;
1093
+ nullable: boolean;
1094
+ description: string;
1095
+ };
1096
+ rateLimitEnabled: {
1097
+ type: string;
1098
+ description: string;
1099
+ };
1100
+ requestCount: {
1101
+ type: string;
1102
+ description: string;
1103
+ };
1104
+ permissions: {
1105
+ type: string;
1106
+ nullable: boolean;
1107
+ additionalProperties: {
1108
+ type: string;
1109
+ items: {
1110
+ type: string;
1111
+ };
1112
+ };
1113
+ description: string;
1114
+ };
1115
+ };
1116
+ required: string[];
1117
+ };
1118
+ };
1119
+ };
1120
+ };
1121
+ };
1122
+ };
1123
+ }, undefined>;
1124
+ /**
1125
+ * ### Endpoint
1126
+ *
1127
+ * POST `/api-key/verify`
1128
+ *
1129
+ * ### API Methods
1130
+ *
1131
+ * **server:**
1132
+ * `auth.api.verifyApiKey`
1133
+ *
1134
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-verify)
1135
+ */
1136
+ verifyApiKey: Endpoint<string, "POST", {
1137
+ key: string;
1138
+ configId?: string | undefined;
1139
+ permissions?: Record<string, string[]> | undefined;
1140
+ }, Record<string, any> | undefined, [], {
1141
+ valid: boolean;
1142
+ error: {
1143
+ message: better_auth0.RawError<"INVALID_API_KEY">;
1144
+ code: "KEY_NOT_FOUND";
1145
+ };
1146
+ key: null;
1147
+ } | {
1148
+ valid: boolean;
1149
+ error: {
1150
+ message: string | undefined;
1151
+ code: string;
1152
+ cause?: unknown;
1153
+ };
1154
+ key: null;
1155
+ } | {
1156
+ valid: boolean;
1157
+ error: {
1158
+ message: better_auth0.RawError<"INVALID_API_KEY">;
1159
+ code: "INVALID_API_KEY";
1160
+ };
1161
+ key: null;
1162
+ } | {
1163
+ valid: boolean;
1164
+ error: null;
1165
+ key: Omit<ApiKey, "key"> | null;
1166
+ }, undefined, undefined>;
1167
+ /**
1168
+ * ### Endpoint
1169
+ *
1170
+ * GET `/api-key/get`
1171
+ *
1172
+ * ### API Methods
1173
+ *
1174
+ * **server:**
1175
+ * `auth.api.getApiKey`
1176
+ *
1177
+ * **client:**
1178
+ * `authClient.apiKey.get`
1179
+ *
1180
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-get)
1181
+ */
1182
+ getApiKey: Endpoint<"/api-key/get", "GET", undefined, {
1183
+ id: string;
1184
+ configId?: string | undefined;
1185
+ }, [Middleware<(inputContext: Record<string, any>) => Promise<{
1186
+ session: {
1187
+ session: Record<string, any> & {
1188
+ id: string;
1189
+ createdAt: Date;
1190
+ updatedAt: Date;
1191
+ userId: string;
1192
+ expiresAt: Date;
1193
+ token: string;
1194
+ ipAddress?: string | null | undefined;
1195
+ userAgent?: string | null | undefined;
1196
+ };
1197
+ user: Record<string, any> & {
1198
+ id: string;
1199
+ createdAt: Date;
1200
+ updatedAt: Date;
1201
+ email: string;
1202
+ emailVerified: boolean;
1203
+ name: string;
1204
+ image?: string | null | undefined;
1205
+ };
1206
+ };
1207
+ }>>], {
1208
+ metadata: Record<string, any> | null;
1209
+ permissions: {
1210
+ [key: string]: string[];
1211
+ } | null;
1212
+ id: string;
1213
+ configId: string;
1214
+ name: string | null;
1215
+ start: string | null;
1216
+ prefix: string | null;
1217
+ referenceId: string;
1218
+ refillInterval: number | null;
1219
+ refillAmount: number | null;
1220
+ lastRefillAt: Date | null;
1221
+ enabled: boolean;
1222
+ rateLimitEnabled: boolean;
1223
+ rateLimitTimeWindow: number | null;
1224
+ rateLimitMax: number | null;
1225
+ requestCount: number;
1226
+ remaining: number | null;
1227
+ lastRequest: Date | null;
1228
+ expiresAt: Date | null;
1229
+ createdAt: Date;
1230
+ updatedAt: Date;
1231
+ }, {
1232
+ openapi: {
1233
+ description: string;
1234
+ responses: {
1235
+ "200": {
1236
+ description: string;
1237
+ content: {
1238
+ "application/json": {
1239
+ schema: {
1240
+ type: "object";
1241
+ properties: {
1242
+ id: {
1243
+ type: string;
1244
+ description: string;
1245
+ };
1246
+ name: {
1247
+ type: string;
1248
+ nullable: boolean;
1249
+ description: string;
1250
+ };
1251
+ start: {
1252
+ type: string;
1253
+ nullable: boolean;
1254
+ description: string;
1255
+ };
1256
+ prefix: {
1257
+ type: string;
1258
+ nullable: boolean;
1259
+ description: string;
1260
+ };
1261
+ userId: {
1262
+ type: string;
1263
+ description: string;
1264
+ };
1265
+ refillInterval: {
1266
+ type: string;
1267
+ nullable: boolean;
1268
+ description: string;
1269
+ };
1270
+ refillAmount: {
1271
+ type: string;
1272
+ nullable: boolean;
1273
+ description: string;
1274
+ };
1275
+ lastRefillAt: {
1276
+ type: string;
1277
+ format: string;
1278
+ nullable: boolean;
1279
+ description: string;
1280
+ };
1281
+ enabled: {
1282
+ type: string;
1283
+ description: string;
1284
+ default: boolean;
1285
+ };
1286
+ rateLimitEnabled: {
1287
+ type: string;
1288
+ description: string;
1289
+ };
1290
+ rateLimitTimeWindow: {
1291
+ type: string;
1292
+ nullable: boolean;
1293
+ description: string;
1294
+ };
1295
+ rateLimitMax: {
1296
+ type: string;
1297
+ nullable: boolean;
1298
+ description: string;
1299
+ };
1300
+ requestCount: {
1301
+ type: string;
1302
+ description: string;
1303
+ };
1304
+ remaining: {
1305
+ type: string;
1306
+ nullable: boolean;
1307
+ description: string;
1308
+ };
1309
+ lastRequest: {
1310
+ type: string;
1311
+ format: string;
1312
+ nullable: boolean;
1313
+ description: string;
1314
+ };
1315
+ expiresAt: {
1316
+ type: string;
1317
+ format: string;
1318
+ nullable: boolean;
1319
+ description: string;
1320
+ };
1321
+ createdAt: {
1322
+ type: string;
1323
+ format: string;
1324
+ description: string;
1325
+ };
1326
+ updatedAt: {
1327
+ type: string;
1328
+ format: string;
1329
+ description: string;
1330
+ };
1331
+ metadata: {
1332
+ type: string;
1333
+ nullable: boolean;
1334
+ additionalProperties: boolean;
1335
+ description: string;
1336
+ };
1337
+ permissions: {
1338
+ type: string;
1339
+ nullable: boolean;
1340
+ description: string;
1341
+ };
1342
+ };
1343
+ required: string[];
1344
+ };
1345
+ };
1346
+ };
1347
+ };
1348
+ };
1349
+ };
1350
+ }, undefined>;
1351
+ /**
1352
+ * ### Endpoint
1353
+ *
1354
+ * POST `/api-key/update`
1355
+ *
1356
+ * ### API Methods
1357
+ *
1358
+ * **server:**
1359
+ * `auth.api.updateApiKey`
1360
+ *
1361
+ * **client:**
1362
+ * `authClient.apiKey.update`
1363
+ *
1364
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-update)
1365
+ */
1366
+ updateApiKey: Endpoint<"/api-key/update", "POST", {
1367
+ keyId: string;
1368
+ configId?: string | undefined;
1369
+ userId?: unknown;
1370
+ name?: string | undefined;
1371
+ enabled?: boolean | undefined;
1372
+ remaining?: number | undefined;
1373
+ refillAmount?: number | undefined;
1374
+ refillInterval?: number | undefined;
1375
+ metadata?: any;
1376
+ expiresIn?: number | null | undefined;
1377
+ rateLimitEnabled?: boolean | undefined;
1378
+ rateLimitTimeWindow?: number | undefined;
1379
+ rateLimitMax?: number | undefined;
1380
+ permissions?: Record<string, string[]> | null | undefined;
1381
+ }, Record<string, any> | undefined, [], {
1382
+ metadata: Record<string, any> | null;
1383
+ permissions: {
1384
+ [key: string]: string[];
1385
+ } | null;
1386
+ id: string;
1387
+ configId: string;
1388
+ name: string | null;
1389
+ start: string | null;
1390
+ prefix: string | null;
1391
+ referenceId: string;
1392
+ refillInterval: number | null;
1393
+ refillAmount: number | null;
1394
+ lastRefillAt: Date | null;
1395
+ enabled: boolean;
1396
+ rateLimitEnabled: boolean;
1397
+ rateLimitTimeWindow: number | null;
1398
+ rateLimitMax: number | null;
1399
+ requestCount: number;
1400
+ remaining: number | null;
1401
+ lastRequest: Date | null;
1402
+ expiresAt: Date | null;
1403
+ createdAt: Date;
1404
+ updatedAt: Date;
1405
+ }, {
1406
+ openapi: {
1407
+ description: string;
1408
+ responses: {
1409
+ "200": {
1410
+ description: string;
1411
+ content: {
1412
+ "application/json": {
1413
+ schema: {
1414
+ type: "object";
1415
+ properties: {
1416
+ id: {
1417
+ type: string;
1418
+ description: string;
1419
+ };
1420
+ name: {
1421
+ type: string;
1422
+ nullable: boolean;
1423
+ description: string;
1424
+ };
1425
+ start: {
1426
+ type: string;
1427
+ nullable: boolean;
1428
+ description: string;
1429
+ };
1430
+ prefix: {
1431
+ type: string;
1432
+ nullable: boolean;
1433
+ description: string;
1434
+ };
1435
+ userId: {
1436
+ type: string;
1437
+ description: string;
1438
+ };
1439
+ refillInterval: {
1440
+ type: string;
1441
+ nullable: boolean;
1442
+ description: string;
1443
+ };
1444
+ refillAmount: {
1445
+ type: string;
1446
+ nullable: boolean;
1447
+ description: string;
1448
+ };
1449
+ lastRefillAt: {
1450
+ type: string;
1451
+ format: string;
1452
+ nullable: boolean;
1453
+ description: string;
1454
+ };
1455
+ enabled: {
1456
+ type: string;
1457
+ description: string;
1458
+ default: boolean;
1459
+ };
1460
+ rateLimitEnabled: {
1461
+ type: string;
1462
+ description: string;
1463
+ };
1464
+ rateLimitTimeWindow: {
1465
+ type: string;
1466
+ nullable: boolean;
1467
+ description: string;
1468
+ };
1469
+ rateLimitMax: {
1470
+ type: string;
1471
+ nullable: boolean;
1472
+ description: string;
1473
+ };
1474
+ requestCount: {
1475
+ type: string;
1476
+ description: string;
1477
+ };
1478
+ remaining: {
1479
+ type: string;
1480
+ nullable: boolean;
1481
+ description: string;
1482
+ };
1483
+ lastRequest: {
1484
+ type: string;
1485
+ format: string;
1486
+ nullable: boolean;
1487
+ description: string;
1488
+ };
1489
+ expiresAt: {
1490
+ type: string;
1491
+ format: string;
1492
+ nullable: boolean;
1493
+ description: string;
1494
+ };
1495
+ createdAt: {
1496
+ type: string;
1497
+ format: string;
1498
+ description: string;
1499
+ };
1500
+ updatedAt: {
1501
+ type: string;
1502
+ format: string;
1503
+ description: string;
1504
+ };
1505
+ metadata: {
1506
+ type: string;
1507
+ nullable: boolean;
1508
+ additionalProperties: boolean;
1509
+ description: string;
1510
+ };
1511
+ permissions: {
1512
+ type: string;
1513
+ nullable: boolean;
1514
+ description: string;
1515
+ };
1516
+ };
1517
+ required: string[];
1518
+ };
1519
+ };
1520
+ };
1521
+ };
1522
+ };
1523
+ };
1524
+ }, undefined>;
1525
+ /**
1526
+ * ### Endpoint
1527
+ *
1528
+ * POST `/api-key/delete`
1529
+ *
1530
+ * ### API Methods
1531
+ *
1532
+ * **server:**
1533
+ * `auth.api.deleteApiKey`
1534
+ *
1535
+ * **client:**
1536
+ * `authClient.apiKey.delete`
1537
+ *
1538
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-delete)
1539
+ */
1540
+ deleteApiKey: Endpoint<"/api-key/delete", "POST", {
1541
+ keyId: string;
1542
+ configId?: string | undefined;
1543
+ }, Record<string, any> | undefined, [Middleware<(inputContext: Record<string, any>) => Promise<{
1544
+ session: {
1545
+ session: Record<string, any> & {
1546
+ id: string;
1547
+ createdAt: Date;
1548
+ updatedAt: Date;
1549
+ userId: string;
1550
+ expiresAt: Date;
1551
+ token: string;
1552
+ ipAddress?: string | null | undefined;
1553
+ userAgent?: string | null | undefined;
1554
+ };
1555
+ user: Record<string, any> & {
1556
+ id: string;
1557
+ createdAt: Date;
1558
+ updatedAt: Date;
1559
+ email: string;
1560
+ emailVerified: boolean;
1561
+ name: string;
1562
+ image?: string | null | undefined;
1563
+ };
1564
+ };
1565
+ }>>], {
1566
+ success: boolean;
1567
+ }, {
1568
+ openapi: {
1569
+ description: string;
1570
+ requestBody: {
1571
+ content: {
1572
+ "application/json": {
1573
+ schema: {
1574
+ type: "object";
1575
+ properties: {
1576
+ keyId: {
1577
+ type: string;
1578
+ description: string;
1579
+ };
1580
+ };
1581
+ required: string[];
1582
+ };
1583
+ };
1584
+ };
1585
+ };
1586
+ responses: {
1587
+ "200": {
1588
+ description: string;
1589
+ content: {
1590
+ "application/json": {
1591
+ schema: {
1592
+ type: "object";
1593
+ properties: {
1594
+ success: {
1595
+ type: string;
1596
+ description: string;
1597
+ };
1598
+ };
1599
+ required: string[];
1600
+ };
1601
+ };
1602
+ };
1603
+ };
1604
+ };
1605
+ };
1606
+ }, undefined>;
1607
+ /**
1608
+ * ### Endpoint
1609
+ *
1610
+ * GET `/api-key/list`
1611
+ *
1612
+ * ### API Methods
1613
+ *
1614
+ * **server:**
1615
+ * `auth.api.listApiKeys`
1616
+ *
1617
+ * **client:**
1618
+ * `authClient.apiKey.list`
1619
+ *
1620
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-list)
1621
+ */
1622
+ listApiKeys: Endpoint<"/api-key/list", "GET", undefined, {
1623
+ configId?: string | undefined;
1624
+ organizationId?: string | undefined;
1625
+ limit?: unknown;
1626
+ offset?: unknown;
1627
+ sortBy?: string | undefined;
1628
+ sortDirection?: "asc" | "desc" | undefined;
1629
+ } | undefined, [Middleware<(inputContext: Record<string, any>) => Promise<{
1630
+ session: {
1631
+ session: Record<string, any> & {
1632
+ id: string;
1633
+ createdAt: Date;
1634
+ updatedAt: Date;
1635
+ userId: string;
1636
+ expiresAt: Date;
1637
+ token: string;
1638
+ ipAddress?: string | null | undefined;
1639
+ userAgent?: string | null | undefined;
1640
+ };
1641
+ user: Record<string, any> & {
1642
+ id: string;
1643
+ createdAt: Date;
1644
+ updatedAt: Date;
1645
+ email: string;
1646
+ emailVerified: boolean;
1647
+ name: string;
1648
+ image?: string | null | undefined;
1649
+ };
1650
+ };
1651
+ }>>], {
1652
+ apiKeys: {
1653
+ metadata: Record<string, any> | null;
1654
+ permissions: {
1655
+ [key: string]: string[];
1656
+ } | null;
1657
+ id: string;
1658
+ configId: string;
1659
+ name: string | null;
1660
+ start: string | null;
1661
+ prefix: string | null;
1662
+ referenceId: string;
1663
+ refillInterval: number | null;
1664
+ refillAmount: number | null;
1665
+ lastRefillAt: Date | null;
1666
+ enabled: boolean;
1667
+ rateLimitEnabled: boolean;
1668
+ rateLimitTimeWindow: number | null;
1669
+ rateLimitMax: number | null;
1670
+ requestCount: number;
1671
+ remaining: number | null;
1672
+ lastRequest: Date | null;
1673
+ expiresAt: Date | null;
1674
+ createdAt: Date;
1675
+ updatedAt: Date;
1676
+ }[];
1677
+ total: number;
1678
+ limit: number | undefined;
1679
+ offset: number | undefined;
1680
+ }, {
1681
+ openapi: {
1682
+ description: string;
1683
+ responses: {
1684
+ "200": {
1685
+ description: string;
1686
+ content: {
1687
+ "application/json": {
1688
+ schema: {
1689
+ type: "object";
1690
+ properties: {
1691
+ apiKeys: {
1692
+ type: string;
1693
+ items: {
1694
+ type: string;
1695
+ properties: {
1696
+ id: {
1697
+ type: string;
1698
+ description: string;
1699
+ };
1700
+ name: {
1701
+ type: string;
1702
+ nullable: boolean;
1703
+ description: string;
1704
+ };
1705
+ start: {
1706
+ type: string;
1707
+ nullable: boolean;
1708
+ description: string;
1709
+ };
1710
+ prefix: {
1711
+ type: string;
1712
+ nullable: boolean;
1713
+ description: string;
1714
+ };
1715
+ userId: {
1716
+ type: string;
1717
+ description: string;
1718
+ };
1719
+ refillInterval: {
1720
+ type: string;
1721
+ nullable: boolean;
1722
+ description: string;
1723
+ };
1724
+ refillAmount: {
1725
+ type: string;
1726
+ nullable: boolean;
1727
+ description: string;
1728
+ };
1729
+ lastRefillAt: {
1730
+ type: string;
1731
+ format: string;
1732
+ nullable: boolean;
1733
+ description: string;
1734
+ };
1735
+ enabled: {
1736
+ type: string;
1737
+ description: string;
1738
+ default: boolean;
1739
+ };
1740
+ rateLimitEnabled: {
1741
+ type: string;
1742
+ description: string;
1743
+ };
1744
+ rateLimitTimeWindow: {
1745
+ type: string;
1746
+ nullable: boolean;
1747
+ description: string;
1748
+ };
1749
+ rateLimitMax: {
1750
+ type: string;
1751
+ nullable: boolean;
1752
+ description: string;
1753
+ };
1754
+ requestCount: {
1755
+ type: string;
1756
+ description: string;
1757
+ };
1758
+ remaining: {
1759
+ type: string;
1760
+ nullable: boolean;
1761
+ description: string;
1762
+ };
1763
+ lastRequest: {
1764
+ type: string;
1765
+ format: string;
1766
+ nullable: boolean;
1767
+ description: string;
1768
+ };
1769
+ expiresAt: {
1770
+ type: string;
1771
+ format: string;
1772
+ nullable: boolean;
1773
+ description: string;
1774
+ };
1775
+ createdAt: {
1776
+ type: string;
1777
+ format: string;
1778
+ description: string;
1779
+ };
1780
+ updatedAt: {
1781
+ type: string;
1782
+ format: string;
1783
+ description: string;
1784
+ };
1785
+ metadata: {
1786
+ type: string;
1787
+ nullable: boolean;
1788
+ additionalProperties: boolean;
1789
+ description: string;
1790
+ };
1791
+ permissions: {
1792
+ type: string;
1793
+ nullable: boolean;
1794
+ description: string;
1795
+ };
1796
+ };
1797
+ required: string[];
1798
+ };
1799
+ };
1800
+ total: {
1801
+ type: string;
1802
+ description: string;
1803
+ };
1804
+ limit: {
1805
+ type: string;
1806
+ nullable: boolean;
1807
+ description: string;
1808
+ };
1809
+ offset: {
1810
+ type: string;
1811
+ nullable: boolean;
1812
+ description: string;
1813
+ };
1814
+ };
1815
+ required: string[];
1816
+ };
1817
+ };
1818
+ };
1819
+ };
1820
+ };
1821
+ };
1822
+ }, undefined>;
1823
+ /**
1824
+ * ### Endpoint
1825
+ *
1826
+ * POST `/api-key/delete-all-expired-api-keys`
1827
+ *
1828
+ * ### API Methods
1829
+ *
1830
+ * **server:**
1831
+ * `auth.api.deleteAllExpiredApiKeys`
1832
+ *
1833
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-delete-all-expired-api-keys)
1834
+ */
1835
+ deleteAllExpiredApiKeys: Endpoint<string, "POST", undefined, Record<string, any> | undefined, [], {
1836
+ success: boolean;
1837
+ error: unknown;
1838
+ }, undefined, undefined>;
1839
+ };
1840
+ schema: {
1841
+ apikey: {
1842
+ fields: {
1843
+ configId: {
1844
+ type: "string";
1845
+ required: true;
1846
+ defaultValue: string;
1847
+ input: false;
1848
+ index: true;
1849
+ };
1850
+ name: {
1851
+ type: "string";
1852
+ required: false;
1853
+ input: false;
1854
+ };
1855
+ start: {
1856
+ type: "string";
1857
+ required: false;
1858
+ input: false;
1859
+ };
1860
+ referenceId: {
1861
+ type: "string";
1862
+ required: true;
1863
+ input: false;
1864
+ index: true;
1865
+ };
1866
+ prefix: {
1867
+ type: "string";
1868
+ required: false;
1869
+ input: false;
1870
+ };
1871
+ key: {
1872
+ type: "string";
1873
+ required: true;
1874
+ input: false;
1875
+ index: true;
1876
+ };
1877
+ refillInterval: {
1878
+ type: "number";
1879
+ required: false;
1880
+ input: false;
1881
+ };
1882
+ refillAmount: {
1883
+ type: "number";
1884
+ required: false;
1885
+ input: false;
1886
+ };
1887
+ lastRefillAt: {
1888
+ type: "date";
1889
+ required: false;
1890
+ input: false;
1891
+ };
1892
+ enabled: {
1893
+ type: "boolean";
1894
+ required: false;
1895
+ input: false;
1896
+ defaultValue: true;
1897
+ };
1898
+ rateLimitEnabled: {
1899
+ type: "boolean";
1900
+ required: false;
1901
+ input: false;
1902
+ defaultValue: true;
1903
+ };
1904
+ rateLimitTimeWindow: {
1905
+ type: "number";
1906
+ required: false;
1907
+ input: false;
1908
+ defaultValue: number;
1909
+ };
1910
+ rateLimitMax: {
1911
+ type: "number";
1912
+ required: false;
1913
+ input: false;
1914
+ defaultValue: number;
1915
+ };
1916
+ requestCount: {
1917
+ type: "number";
1918
+ required: false;
1919
+ input: false;
1920
+ defaultValue: number;
1921
+ };
1922
+ remaining: {
1923
+ type: "number";
1924
+ required: false;
1925
+ input: false;
1926
+ };
1927
+ lastRequest: {
1928
+ type: "date";
1929
+ required: false;
1930
+ input: false;
1931
+ };
1932
+ expiresAt: {
1933
+ type: "date";
1934
+ required: false;
1935
+ input: false;
1936
+ };
1937
+ createdAt: {
1938
+ type: "date";
1939
+ required: true;
1940
+ input: false;
1941
+ };
1942
+ updatedAt: {
1943
+ type: "date";
1944
+ required: true;
1945
+ input: false;
1946
+ };
1947
+ permissions: {
1948
+ type: "string";
1949
+ required: false;
1950
+ input: false;
1951
+ };
1952
+ metadata: {
1953
+ type: "string";
1954
+ required: false;
1955
+ input: true;
1956
+ transform: {
1957
+ input(value: better_auth0.DBPrimitive): string;
1958
+ output(value: better_auth0.DBPrimitive): any;
1959
+ };
1960
+ };
1961
+ };
1962
+ };
1963
+ };
1964
+ };
1965
+ //#endregion
1966
+ export { API_KEY_ERROR_CODES as i, apiKey as n, defaultKeyHasher as r, API_KEY_TABLE_NAME as t };