@better-auth/api-key 1.7.0-rc.5 → 1.7.0-rc.6

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/client.d.mts CHANGED
@@ -1,5 +1,7 @@
1
- import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-BLGcz4fR.mjs";
2
- import { i as API_KEY_ERROR_CODES, n as apiKey } from "./index-CWMXfmdp.mjs";
1
+ import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-y22rgFHR.mjs";
2
+ import { i as API_KEY_ERROR_CODES, n as apiKey } from "./index-BBbNwDdO.mjs";
3
+ import * as _$better_auth0 from "better-auth";
4
+
3
5
  //#region src/client.d.ts
4
6
  declare const apiKeyClient: () => {
5
7
  id: "api-key";
@@ -11,39 +13,39 @@ declare const apiKeyClient: () => {
11
13
  "/api-key/delete-all-expired-api-keys": "POST";
12
14
  };
13
15
  $ERROR_CODES: {
14
- INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
15
- REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
16
- REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
17
- USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
18
- UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
19
- KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
20
- KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
21
- KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
22
- USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
23
- KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
24
- EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
25
- EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
26
- INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
27
- INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
28
- INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
29
- METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
30
- RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
31
- NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
32
- KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
33
- INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
34
- INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
35
- INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
36
- INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
37
- SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
38
- FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
39
- NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
40
- ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
41
- USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
42
- INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
43
- NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
44
- ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
16
+ INVALID_METADATA_TYPE: _$better_auth0.RawError<"INVALID_METADATA_TYPE">;
17
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: _$better_auth0.RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
18
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: _$better_auth0.RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
19
+ USER_BANNED: _$better_auth0.RawError<"USER_BANNED">;
20
+ UNAUTHORIZED_SESSION: _$better_auth0.RawError<"UNAUTHORIZED_SESSION">;
21
+ KEY_NOT_FOUND: _$better_auth0.RawError<"KEY_NOT_FOUND">;
22
+ KEY_DISABLED: _$better_auth0.RawError<"KEY_DISABLED">;
23
+ KEY_EXPIRED: _$better_auth0.RawError<"KEY_EXPIRED">;
24
+ USAGE_EXCEEDED: _$better_auth0.RawError<"USAGE_EXCEEDED">;
25
+ KEY_NOT_RECOVERABLE: _$better_auth0.RawError<"KEY_NOT_RECOVERABLE">;
26
+ EXPIRES_IN_IS_TOO_SMALL: _$better_auth0.RawError<"EXPIRES_IN_IS_TOO_SMALL">;
27
+ EXPIRES_IN_IS_TOO_LARGE: _$better_auth0.RawError<"EXPIRES_IN_IS_TOO_LARGE">;
28
+ INVALID_REMAINING: _$better_auth0.RawError<"INVALID_REMAINING">;
29
+ INVALID_PREFIX_LENGTH: _$better_auth0.RawError<"INVALID_PREFIX_LENGTH">;
30
+ INVALID_NAME_LENGTH: _$better_auth0.RawError<"INVALID_NAME_LENGTH">;
31
+ METADATA_DISABLED: _$better_auth0.RawError<"METADATA_DISABLED">;
32
+ RATE_LIMIT_EXCEEDED: _$better_auth0.RawError<"RATE_LIMIT_EXCEEDED">;
33
+ NO_VALUES_TO_UPDATE: _$better_auth0.RawError<"NO_VALUES_TO_UPDATE">;
34
+ KEY_DISABLED_EXPIRATION: _$better_auth0.RawError<"KEY_DISABLED_EXPIRATION">;
35
+ INVALID_API_KEY: _$better_auth0.RawError<"INVALID_API_KEY">;
36
+ INVALID_USER_ID_FROM_API_KEY: _$better_auth0.RawError<"INVALID_USER_ID_FROM_API_KEY">;
37
+ INVALID_REFERENCE_ID_FROM_API_KEY: _$better_auth0.RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
38
+ INVALID_API_KEY_GETTER_RETURN_TYPE: _$better_auth0.RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
39
+ SERVER_ONLY_PROPERTY: _$better_auth0.RawError<"SERVER_ONLY_PROPERTY">;
40
+ FAILED_TO_UPDATE_API_KEY: _$better_auth0.RawError<"FAILED_TO_UPDATE_API_KEY">;
41
+ NAME_REQUIRED: _$better_auth0.RawError<"NAME_REQUIRED">;
42
+ ORGANIZATION_ID_REQUIRED: _$better_auth0.RawError<"ORGANIZATION_ID_REQUIRED">;
43
+ USER_NOT_MEMBER_OF_ORGANIZATION: _$better_auth0.RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
44
+ INSUFFICIENT_API_KEY_PERMISSIONS: _$better_auth0.RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
45
+ NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: _$better_auth0.RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
46
+ ORGANIZATION_PLUGIN_REQUIRED: _$better_auth0.RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
45
47
  };
46
48
  };
47
49
  type ApiKeyClientPlugin = ReturnType<typeof apiKeyClient>;
48
50
  //#endregion
49
- export { API_KEY_ERROR_CODES, type ApiKey, ApiKeyClientPlugin, type ApiKeyConfigurationOptions, type ApiKeyOptions, apiKeyClient };
51
+ export { API_KEY_ERROR_CODES, ApiKey, ApiKeyClientPlugin, ApiKeyConfigurationOptions, ApiKeyOptions, apiKeyClient };
package/dist/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as API_KEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-02DBVaKF.mjs";
1
+ import { n as API_KEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-D3yqYqY2.mjs";
2
2
  //#region src/client.ts
3
3
  const apiKeyClient = () => {
4
4
  return {
@@ -1,38 +1,43 @@
1
- import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-BLGcz4fR.mjs";
1
+ import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-y22rgFHR.mjs";
2
+ import * as _$better_auth0 from "better-auth";
3
+ import * as _$zod from "zod";
4
+ import * as _$better_call0 from "better-call";
5
+ import * as _$zod_v4_core0 from "zod/v4/core";
2
6
  import { HookEndpointContext } from "@better-auth/core";
7
+
3
8
  //#region src/error-codes.d.ts
4
9
  declare const API_KEY_ERROR_CODES: {
5
- INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
6
- REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
7
- REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
8
- USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
9
- UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
10
- KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
11
- KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
12
- KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
13
- USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
14
- KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
15
- EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
16
- EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
17
- INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
18
- INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
19
- INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
20
- METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
21
- RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
22
- NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
23
- KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
24
- INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
25
- INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
26
- INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
27
- INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
28
- SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
29
- FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
30
- NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
31
- ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
32
- USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
33
- INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
34
- NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
35
- ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
10
+ INVALID_METADATA_TYPE: _$better_auth0.RawError<"INVALID_METADATA_TYPE">;
11
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: _$better_auth0.RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
12
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: _$better_auth0.RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
13
+ USER_BANNED: _$better_auth0.RawError<"USER_BANNED">;
14
+ UNAUTHORIZED_SESSION: _$better_auth0.RawError<"UNAUTHORIZED_SESSION">;
15
+ KEY_NOT_FOUND: _$better_auth0.RawError<"KEY_NOT_FOUND">;
16
+ KEY_DISABLED: _$better_auth0.RawError<"KEY_DISABLED">;
17
+ KEY_EXPIRED: _$better_auth0.RawError<"KEY_EXPIRED">;
18
+ USAGE_EXCEEDED: _$better_auth0.RawError<"USAGE_EXCEEDED">;
19
+ KEY_NOT_RECOVERABLE: _$better_auth0.RawError<"KEY_NOT_RECOVERABLE">;
20
+ EXPIRES_IN_IS_TOO_SMALL: _$better_auth0.RawError<"EXPIRES_IN_IS_TOO_SMALL">;
21
+ EXPIRES_IN_IS_TOO_LARGE: _$better_auth0.RawError<"EXPIRES_IN_IS_TOO_LARGE">;
22
+ INVALID_REMAINING: _$better_auth0.RawError<"INVALID_REMAINING">;
23
+ INVALID_PREFIX_LENGTH: _$better_auth0.RawError<"INVALID_PREFIX_LENGTH">;
24
+ INVALID_NAME_LENGTH: _$better_auth0.RawError<"INVALID_NAME_LENGTH">;
25
+ METADATA_DISABLED: _$better_auth0.RawError<"METADATA_DISABLED">;
26
+ RATE_LIMIT_EXCEEDED: _$better_auth0.RawError<"RATE_LIMIT_EXCEEDED">;
27
+ NO_VALUES_TO_UPDATE: _$better_auth0.RawError<"NO_VALUES_TO_UPDATE">;
28
+ KEY_DISABLED_EXPIRATION: _$better_auth0.RawError<"KEY_DISABLED_EXPIRATION">;
29
+ INVALID_API_KEY: _$better_auth0.RawError<"INVALID_API_KEY">;
30
+ INVALID_USER_ID_FROM_API_KEY: _$better_auth0.RawError<"INVALID_USER_ID_FROM_API_KEY">;
31
+ INVALID_REFERENCE_ID_FROM_API_KEY: _$better_auth0.RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
32
+ INVALID_API_KEY_GETTER_RETURN_TYPE: _$better_auth0.RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
33
+ SERVER_ONLY_PROPERTY: _$better_auth0.RawError<"SERVER_ONLY_PROPERTY">;
34
+ FAILED_TO_UPDATE_API_KEY: _$better_auth0.RawError<"FAILED_TO_UPDATE_API_KEY">;
35
+ NAME_REQUIRED: _$better_auth0.RawError<"NAME_REQUIRED">;
36
+ ORGANIZATION_ID_REQUIRED: _$better_auth0.RawError<"ORGANIZATION_ID_REQUIRED">;
37
+ USER_NOT_MEMBER_OF_ORGANIZATION: _$better_auth0.RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
38
+ INSUFFICIENT_API_KEY_PERMISSIONS: _$better_auth0.RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
39
+ NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: _$better_auth0.RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
40
+ ORGANIZATION_PLUGIN_REQUIRED: _$better_auth0.RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
36
41
  };
37
42
  //#endregion
38
43
  //#region src/index.d.ts
@@ -49,42 +54,42 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
49
54
  id: "api-key";
50
55
  version: string;
51
56
  $ERROR_CODES: {
52
- INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
53
- REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
54
- REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
55
- USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
56
- UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
57
- KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
58
- KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
59
- KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
60
- USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
61
- KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
62
- EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
63
- EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
64
- INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
65
- INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
66
- INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
67
- METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
68
- RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
69
- NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
70
- KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
71
- INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
72
- INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
73
- INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
74
- INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
75
- SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
76
- FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
77
- NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
78
- ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
79
- USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
80
- INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
81
- NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
82
- ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
57
+ INVALID_METADATA_TYPE: _$better_auth0.RawError<"INVALID_METADATA_TYPE">;
58
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: _$better_auth0.RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
59
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: _$better_auth0.RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
60
+ USER_BANNED: _$better_auth0.RawError<"USER_BANNED">;
61
+ UNAUTHORIZED_SESSION: _$better_auth0.RawError<"UNAUTHORIZED_SESSION">;
62
+ KEY_NOT_FOUND: _$better_auth0.RawError<"KEY_NOT_FOUND">;
63
+ KEY_DISABLED: _$better_auth0.RawError<"KEY_DISABLED">;
64
+ KEY_EXPIRED: _$better_auth0.RawError<"KEY_EXPIRED">;
65
+ USAGE_EXCEEDED: _$better_auth0.RawError<"USAGE_EXCEEDED">;
66
+ KEY_NOT_RECOVERABLE: _$better_auth0.RawError<"KEY_NOT_RECOVERABLE">;
67
+ EXPIRES_IN_IS_TOO_SMALL: _$better_auth0.RawError<"EXPIRES_IN_IS_TOO_SMALL">;
68
+ EXPIRES_IN_IS_TOO_LARGE: _$better_auth0.RawError<"EXPIRES_IN_IS_TOO_LARGE">;
69
+ INVALID_REMAINING: _$better_auth0.RawError<"INVALID_REMAINING">;
70
+ INVALID_PREFIX_LENGTH: _$better_auth0.RawError<"INVALID_PREFIX_LENGTH">;
71
+ INVALID_NAME_LENGTH: _$better_auth0.RawError<"INVALID_NAME_LENGTH">;
72
+ METADATA_DISABLED: _$better_auth0.RawError<"METADATA_DISABLED">;
73
+ RATE_LIMIT_EXCEEDED: _$better_auth0.RawError<"RATE_LIMIT_EXCEEDED">;
74
+ NO_VALUES_TO_UPDATE: _$better_auth0.RawError<"NO_VALUES_TO_UPDATE">;
75
+ KEY_DISABLED_EXPIRATION: _$better_auth0.RawError<"KEY_DISABLED_EXPIRATION">;
76
+ INVALID_API_KEY: _$better_auth0.RawError<"INVALID_API_KEY">;
77
+ INVALID_USER_ID_FROM_API_KEY: _$better_auth0.RawError<"INVALID_USER_ID_FROM_API_KEY">;
78
+ INVALID_REFERENCE_ID_FROM_API_KEY: _$better_auth0.RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
79
+ INVALID_API_KEY_GETTER_RETURN_TYPE: _$better_auth0.RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
80
+ SERVER_ONLY_PROPERTY: _$better_auth0.RawError<"SERVER_ONLY_PROPERTY">;
81
+ FAILED_TO_UPDATE_API_KEY: _$better_auth0.RawError<"FAILED_TO_UPDATE_API_KEY">;
82
+ NAME_REQUIRED: _$better_auth0.RawError<"NAME_REQUIRED">;
83
+ ORGANIZATION_ID_REQUIRED: _$better_auth0.RawError<"ORGANIZATION_ID_REQUIRED">;
84
+ USER_NOT_MEMBER_OF_ORGANIZATION: _$better_auth0.RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
85
+ INSUFFICIENT_API_KEY_PERMISSIONS: _$better_auth0.RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
86
+ NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: _$better_auth0.RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
87
+ ORGANIZATION_PLUGIN_REQUIRED: _$better_auth0.RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
83
88
  };
84
89
  hooks: {
85
90
  before: {
86
91
  matcher: (ctx: HookEndpointContext) => boolean;
87
- handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
92
+ handler: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
88
93
  user: {
89
94
  id: string;
90
95
  createdAt: Date;
@@ -105,8 +110,8 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
105
110
  expiresAt: Date;
106
111
  };
107
112
  } | {
108
- context: import("better-call").MiddlewareContext<import("better-call").MiddlewareOptions, import("better-auth").PluginContext<import("better-auth").BetterAuthOptions> & import("better-auth").InfoContext & {
109
- options: import("better-auth").BetterAuthOptions;
113
+ context: _$better_call0.MiddlewareContext<_$better_call0.MiddlewareOptions, _$better_auth0.PluginContext<_$better_auth0.BetterAuthOptions> & _$better_auth0.InfoContext & {
114
+ options: _$better_auth0.BetterAuthOptions;
110
115
  trustedOrigins: string[];
111
116
  trustedProviders: string[];
112
117
  isTrustedOrigin: (url: string, settings?: {
@@ -179,35 +184,35 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
179
184
  image?: string | null | undefined;
180
185
  } & Record<string, any>;
181
186
  } | null) => void;
182
- socialProviders: import("better-auth").OAuthProvider[];
183
- authCookies: import("better-auth").BetterAuthCookies;
184
- logger: ReturnType<typeof import("better-auth").createLogger>;
187
+ socialProviders: _$better_auth0.OAuthProvider[];
188
+ authCookies: _$better_auth0.BetterAuthCookies;
189
+ logger: ReturnType<typeof _$better_auth0.createLogger>;
185
190
  rateLimit: {
186
191
  enabled: boolean;
187
192
  window: number;
188
193
  max: number;
189
194
  storage: "memory" | "database" | "secondary-storage";
190
- } & Omit<import("better-auth").BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
191
- adapter: import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
192
- internalAdapter: import("better-auth").InternalAdapter<import("better-auth").BetterAuthOptions>;
193
- createAuthCookie: (cookieName: string, overrideAttributes?: Partial<import("better-call").CookieOptions> | undefined) => import("better-auth").BetterAuthCookie;
195
+ } & Omit<_$better_auth0.BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
196
+ adapter: _$better_auth0.DBAdapter<_$better_auth0.BetterAuthOptions>;
197
+ internalAdapter: _$better_auth0.InternalAdapter<_$better_auth0.BetterAuthOptions>;
198
+ createAuthCookie: (cookieName: string, overrideAttributes?: Partial<_$better_call0.CookieOptions> | undefined) => _$better_auth0.BetterAuthCookie;
194
199
  secret: string;
195
- secretConfig: string | import("better-auth").SecretConfig;
200
+ secretConfig: string | _$better_auth0.SecretConfig;
196
201
  sessionConfig: {
197
202
  updateAge: number;
198
203
  expiresIn: number;
199
204
  freshAge: number;
200
- cookieCacheSigner?: import("better-auth").CookieCacheSigner | undefined;
205
+ cookieCacheSigner?: _$better_auth0.CookieCacheSigner | undefined;
201
206
  cookieRefreshCache: false | {
202
207
  enabled: true;
203
208
  updateAge: number;
204
209
  };
205
210
  };
206
211
  generateId: (options: {
207
- model: import("better-auth").ModelNames;
212
+ model: _$better_auth0.ModelNames;
208
213
  size?: number | undefined;
209
214
  }) => string | false;
210
- secondaryStorage: import("better-auth").SecondaryStorage | undefined;
215
+ secondaryStorage: _$better_auth0.SecondaryStorage | undefined;
211
216
  password: {
212
217
  hash: (password: string) => Promise<string>;
213
218
  verify: (data: {
@@ -218,9 +223,9 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
218
223
  minPasswordLength: number;
219
224
  maxPasswordLength: number;
220
225
  };
221
- checkPassword: (userId: string, ctx: import("better-auth").GenericEndpointContext<import("better-auth").BetterAuthOptions>) => Promise<boolean>;
226
+ checkPassword: (userId: string, ctx: _$better_auth0.GenericEndpointContext<_$better_auth0.BetterAuthOptions>) => Promise<boolean>;
222
227
  };
223
- tables: import("better-auth").BetterAuthDBSchema;
228
+ tables: _$better_auth0.BetterAuthDBSchema;
224
229
  runMigrations: () => Promise<void>;
225
230
  publishTelemetry: (event: {
226
231
  type: string;
@@ -230,7 +235,7 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
230
235
  skipOriginCheck: boolean | string[];
231
236
  skipCSRFCheck: boolean;
232
237
  runInBackground: (promise: Promise<unknown>) => void;
233
- runInBackgroundOrAwait: (promise: Promise<unknown> | void) => import("better-auth").Awaitable<unknown>;
238
+ runInBackgroundOrAwait: (promise: Promise<unknown> | void) => _$better_auth0.Awaitable<unknown>;
234
239
  } & {
235
240
  returned?: unknown | undefined;
236
241
  responseHeaders?: Headers | undefined;
@@ -254,24 +259,24 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
254
259
  *
255
260
  * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-create)
256
261
  */
257
- createApiKey: import("better-call").StrictEndpoint<"/api-key/create", {
262
+ createApiKey: _$better_call0.StrictEndpoint<"/api-key/create", {
258
263
  method: "POST";
259
- body: import("zod").ZodObject<{
260
- configId: import("zod").ZodOptional<import("zod").ZodString>;
261
- name: import("zod").ZodOptional<import("zod").ZodString>;
262
- expiresIn: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
263
- prefix: import("zod").ZodOptional<import("zod").ZodString>;
264
- remaining: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
265
- metadata: import("zod").ZodOptional<import("zod").ZodAny>;
266
- refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
267
- refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
268
- rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
269
- rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
270
- rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
271
- permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
272
- userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
273
- organizationId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
274
- }, import("zod/v4/core").$strip>;
264
+ body: _$zod.ZodObject<{
265
+ configId: _$zod.ZodOptional<_$zod.ZodString>;
266
+ name: _$zod.ZodOptional<_$zod.ZodString>;
267
+ expiresIn: _$zod.ZodDefault<_$zod.ZodNullable<_$zod.ZodOptional<_$zod.ZodNumber>>>;
268
+ prefix: _$zod.ZodOptional<_$zod.ZodString>;
269
+ remaining: _$zod.ZodDefault<_$zod.ZodNullable<_$zod.ZodOptional<_$zod.ZodNumber>>>;
270
+ metadata: _$zod.ZodOptional<_$zod.ZodAny>;
271
+ refillAmount: _$zod.ZodOptional<_$zod.ZodNumber>;
272
+ refillInterval: _$zod.ZodOptional<_$zod.ZodNumber>;
273
+ rateLimitTimeWindow: _$zod.ZodOptional<_$zod.ZodNumber>;
274
+ rateLimitMax: _$zod.ZodOptional<_$zod.ZodNumber>;
275
+ rateLimitEnabled: _$zod.ZodOptional<_$zod.ZodBoolean>;
276
+ permissions: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodArray<_$zod.ZodString>>>;
277
+ userId: _$zod.ZodOptional<_$zod.ZodCoercedString<unknown>>;
278
+ organizationId: _$zod.ZodOptional<_$zod.ZodCoercedString<unknown>>;
279
+ }, _$zod_v4_core0.$strip>;
275
280
  metadata: {
276
281
  openapi: {
277
282
  description: string;
@@ -437,17 +442,17 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
437
442
  *
438
443
  * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-verify)
439
444
  */
440
- verifyApiKey: import("better-call").StrictEndpoint<string, {
445
+ verifyApiKey: _$better_call0.StrictEndpoint<string, {
441
446
  method: "POST";
442
- body: import("zod").ZodObject<{
443
- configId: import("zod").ZodOptional<import("zod").ZodString>;
444
- key: import("zod").ZodString;
445
- permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
446
- }, import("zod/v4/core").$strip>;
447
+ body: _$zod.ZodObject<{
448
+ configId: _$zod.ZodOptional<_$zod.ZodString>;
449
+ key: _$zod.ZodString;
450
+ permissions: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodArray<_$zod.ZodString>>>;
451
+ }, _$zod_v4_core0.$strip>;
447
452
  }, {
448
453
  valid: boolean;
449
454
  error: {
450
- message: import("better-auth").RawError<"INVALID_API_KEY">;
455
+ message: _$better_auth0.RawError<"INVALID_API_KEY">;
451
456
  code: "KEY_NOT_FOUND";
452
457
  };
453
458
  key: null;
@@ -462,7 +467,7 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
462
467
  } | {
463
468
  valid: boolean;
464
469
  error: {
465
- message: import("better-auth").RawError<"INVALID_API_KEY">;
470
+ message: _$better_auth0.RawError<"INVALID_API_KEY">;
466
471
  code: "INVALID_API_KEY";
467
472
  };
468
473
  key: null;
@@ -486,13 +491,13 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
486
491
  *
487
492
  * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-get)
488
493
  */
489
- getApiKey: import("better-call").StrictEndpoint<"/api-key/get", {
494
+ getApiKey: _$better_call0.StrictEndpoint<"/api-key/get", {
490
495
  method: "GET";
491
- query: import("zod").ZodObject<{
492
- configId: import("zod").ZodOptional<import("zod").ZodString>;
493
- id: import("zod").ZodString;
494
- }, import("zod/v4/core").$strip>;
495
- use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
496
+ query: _$zod.ZodObject<{
497
+ configId: _$zod.ZodOptional<_$zod.ZodString>;
498
+ id: _$zod.ZodString;
499
+ }, _$zod_v4_core0.$strip>;
500
+ use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
496
501
  session: {
497
502
  session: Record<string, any> & {
498
503
  id: string;
@@ -675,24 +680,24 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
675
680
  *
676
681
  * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-update)
677
682
  */
678
- updateApiKey: import("better-call").StrictEndpoint<"/api-key/update", {
683
+ updateApiKey: _$better_call0.StrictEndpoint<"/api-key/update", {
679
684
  method: "POST";
680
- body: import("zod").ZodObject<{
681
- configId: import("zod").ZodOptional<import("zod").ZodString>;
682
- keyId: import("zod").ZodString;
683
- userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
684
- name: import("zod").ZodOptional<import("zod").ZodString>;
685
- enabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
686
- remaining: import("zod").ZodOptional<import("zod").ZodNumber>;
687
- refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
688
- refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
689
- metadata: import("zod").ZodOptional<import("zod").ZodAny>;
690
- expiresIn: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
691
- rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
692
- rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
693
- rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
694
- permissions: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>>;
695
- }, import("zod/v4/core").$strip>;
685
+ body: _$zod.ZodObject<{
686
+ configId: _$zod.ZodOptional<_$zod.ZodString>;
687
+ keyId: _$zod.ZodString;
688
+ userId: _$zod.ZodOptional<_$zod.ZodCoercedString<unknown>>;
689
+ name: _$zod.ZodOptional<_$zod.ZodString>;
690
+ enabled: _$zod.ZodOptional<_$zod.ZodBoolean>;
691
+ remaining: _$zod.ZodOptional<_$zod.ZodNumber>;
692
+ refillAmount: _$zod.ZodOptional<_$zod.ZodNumber>;
693
+ refillInterval: _$zod.ZodOptional<_$zod.ZodNumber>;
694
+ metadata: _$zod.ZodOptional<_$zod.ZodAny>;
695
+ expiresIn: _$zod.ZodNullable<_$zod.ZodOptional<_$zod.ZodNumber>>;
696
+ rateLimitEnabled: _$zod.ZodOptional<_$zod.ZodBoolean>;
697
+ rateLimitTimeWindow: _$zod.ZodOptional<_$zod.ZodNumber>;
698
+ rateLimitMax: _$zod.ZodOptional<_$zod.ZodNumber>;
699
+ permissions: _$zod.ZodNullable<_$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodArray<_$zod.ZodString>>>>;
700
+ }, _$zod_v4_core0.$strip>;
696
701
  metadata: {
697
702
  openapi: {
698
703
  description: string;
@@ -853,13 +858,13 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
853
858
  *
854
859
  * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-delete)
855
860
  */
856
- deleteApiKey: import("better-call").StrictEndpoint<"/api-key/delete", {
861
+ deleteApiKey: _$better_call0.StrictEndpoint<"/api-key/delete", {
857
862
  method: "POST";
858
- body: import("zod").ZodObject<{
859
- configId: import("zod").ZodOptional<import("zod").ZodString>;
860
- keyId: import("zod").ZodString;
861
- }, import("zod/v4/core").$strip>;
862
- use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
863
+ body: _$zod.ZodObject<{
864
+ configId: _$zod.ZodOptional<_$zod.ZodString>;
865
+ keyId: _$zod.ZodString;
866
+ }, _$zod_v4_core0.$strip>;
867
+ use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
863
868
  session: {
864
869
  session: Record<string, any> & {
865
870
  id: string;
@@ -940,9 +945,9 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
940
945
  *
941
946
  * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-list)
942
947
  */
943
- listApiKeys: import("better-call").StrictEndpoint<"/api-key/list", {
948
+ listApiKeys: _$better_call0.StrictEndpoint<"/api-key/list", {
944
949
  method: "GET";
945
- use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
950
+ use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
946
951
  session: {
947
952
  session: Record<string, any> & {
948
953
  id: string;
@@ -965,17 +970,17 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
965
970
  };
966
971
  };
967
972
  }>>[];
968
- query: import("zod").ZodOptional<import("zod").ZodObject<{
969
- configId: import("zod").ZodOptional<import("zod").ZodString>;
970
- organizationId: import("zod").ZodOptional<import("zod").ZodString>;
971
- limit: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
972
- offset: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
973
- sortBy: import("zod").ZodOptional<import("zod").ZodString>;
974
- sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
973
+ query: _$zod.ZodOptional<_$zod.ZodObject<{
974
+ configId: _$zod.ZodOptional<_$zod.ZodString>;
975
+ organizationId: _$zod.ZodOptional<_$zod.ZodString>;
976
+ limit: _$zod.ZodOptional<_$zod.ZodCoercedNumber<unknown>>;
977
+ offset: _$zod.ZodOptional<_$zod.ZodCoercedNumber<unknown>>;
978
+ sortBy: _$zod.ZodOptional<_$zod.ZodString>;
979
+ sortDirection: _$zod.ZodOptional<_$zod.ZodEnum<{
975
980
  asc: "asc";
976
981
  desc: "desc";
977
982
  }>>;
978
- }, import("zod/v4/core").$strip>>;
983
+ }, _$zod_v4_core0.$strip>>;
979
984
  metadata: {
980
985
  openapi: {
981
986
  description: string;
@@ -1161,7 +1166,7 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
1161
1166
  *
1162
1167
  * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-delete-all-expired-api-keys)
1163
1168
  */
1164
- deleteAllExpiredApiKeys: import("better-call").StrictEndpoint<string, {
1169
+ deleteAllExpiredApiKeys: _$better_call0.StrictEndpoint<string, {
1165
1170
  method: "POST";
1166
1171
  }, {
1167
1172
  success: boolean;
@@ -1285,8 +1290,8 @@ declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOp
1285
1290
  required: false;
1286
1291
  input: true;
1287
1292
  transform: {
1288
- input(value: import("better-auth").DBPrimitive): string;
1289
- output(value: import("better-auth").DBPrimitive): any;
1293
+ input(value: _$better_auth0.DBPrimitive): string;
1294
+ output(value: _$better_auth0.DBPrimitive): any;
1290
1295
  };
1291
1296
  };
1292
1297
  };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-BLGcz4fR.mjs";
2
- import { i as API_KEY_ERROR_CODES, n as apiKey, r as defaultKeyHasher, t as API_KEY_TABLE_NAME } from "./index-CWMXfmdp.mjs";
3
- export { API_KEY_ERROR_CODES, API_KEY_TABLE_NAME, type ApiKey, type ApiKeyConfigurationOptions, type ApiKeyOptions, apiKey, defaultKeyHasher };
1
+ import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-y22rgFHR.mjs";
2
+ import { i as API_KEY_ERROR_CODES, n as apiKey, r as defaultKeyHasher, t as API_KEY_TABLE_NAME } from "./index-BBbNwDdO.mjs";
3
+ export { API_KEY_ERROR_CODES, API_KEY_TABLE_NAME, ApiKey, ApiKeyConfigurationOptions, ApiKeyOptions, apiKey, defaultKeyHasher };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as API_KEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-02DBVaKF.mjs";
1
+ import { n as API_KEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-D3yqYqY2.mjs";
2
2
  import { createAuthEndpoint, createAuthMiddleware } from "@better-auth/core/api";
3
3
  import { getIP } from "@better-auth/core/utils/ip";
4
4
  import { base64Url } from "@better-auth/utils/base64";
@@ -731,9 +731,7 @@ function createApiKey({ defaultKeyGenerator, configurations, schema, deleteAllEx
731
731
  const keyGenerator = opts.customKeyGenerator || defaultKeyGenerator;
732
732
  const session = await getSessionFromCtx(ctx, { disableCookieCache: true });
733
733
  const isClientRequest = ctx.request || ctx.headers;
734
- if (isClientRequest && (() => {
735
- return refillAmount !== void 0 || refillInterval !== void 0 || rateLimitMax !== void 0 || rateLimitTimeWindow !== void 0 || rateLimitEnabled !== void 0 || permissions !== void 0 || remaining !== null;
736
- })()) throw APIError$1.from("BAD_REQUEST", API_KEY_ERROR_CODES.SERVER_ONLY_PROPERTY);
734
+ if (isClientRequest && (refillAmount !== void 0 || refillInterval !== void 0 || rateLimitMax !== void 0 || rateLimitTimeWindow !== void 0 || rateLimitEnabled !== void 0 || permissions !== void 0 || remaining !== null)) throw APIError$1.from("BAD_REQUEST", API_KEY_ERROR_CODES.SERVER_ONLY_PROPERTY);
737
735
  if (ctx.request && ctx.body.userId !== void 0) throw APIError$1.from("UNAUTHORIZED", API_KEY_ERROR_CODES.UNAUTHORIZED_SESSION);
738
736
  const referencesType = opts.references ?? "user";
739
737
  let referenceId;
@@ -1,9 +1,14 @@
1
+ import * as _$better_auth0 from "better-auth";
1
2
  import { Statements } from "better-auth/plugins/access";
2
3
  import { Awaitable, GenericEndpointContext, HookEndpointContext, LiteralString } from "@better-auth/core";
3
4
  import { SecondaryStorage } from "@better-auth/core/db";
4
5
  import { InferOptionSchema } from "better-auth/types";
6
+
5
7
  //#region src/schema.d.ts
6
- declare const apiKeySchema: ({ defaultRateLimitMax, defaultTimeWindow }: {
8
+ declare const apiKeySchema: ({
9
+ defaultRateLimitMax,
10
+ defaultTimeWindow
11
+ }: {
7
12
  defaultTimeWindow: number;
8
13
  defaultRateLimitMax: number;
9
14
  }) => {
@@ -188,8 +193,8 @@ declare const apiKeySchema: ({ defaultRateLimitMax, defaultTimeWindow }: {
188
193
  required: false;
189
194
  input: true;
190
195
  transform: {
191
- input(value: import("better-auth").DBPrimitive): string;
192
- output(value: import("better-auth").DBPrimitive): any;
196
+ input(value: _$better_auth0.DBPrimitive): string;
197
+ output(value: _$better_auth0.DBPrimitive): any;
193
198
  };
194
199
  };
195
200
  };
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-BLGcz4fR.mjs";
1
+ import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-y22rgFHR.mjs";
2
2
  export { ApiKey, ApiKeyConfigurationOptions, ApiKeyOptions };
@@ -35,6 +35,6 @@ const API_KEY_ERROR_CODES = defineErrorCodes({
35
35
  });
36
36
  //#endregion
37
37
  //#region src/version.ts
38
- const PACKAGE_VERSION = "1.7.0-rc.5";
38
+ const PACKAGE_VERSION = "1.7.0-rc.6";
39
39
  //#endregion
40
40
  export { API_KEY_ERROR_CODES as n, PACKAGE_VERSION as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/api-key",
3
- "version": "1.7.0-rc.5",
3
+ "version": "1.7.0-rc.6",
4
4
  "description": "API Key plugin for Better Auth.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -60,15 +60,15 @@
60
60
  "zod": "^4.3.6"
61
61
  },
62
62
  "devDependencies": {
63
- "tsdown": "0.22.7",
64
- "@better-auth/core": "1.7.0-rc.5",
65
- "better-auth": "1.7.0-rc.5"
63
+ "tsdown": "0.21.10",
64
+ "@better-auth/core": "1.7.0-rc.6",
65
+ "better-auth": "1.7.0-rc.6"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@better-auth/utils": "0.4.2",
69
69
  "better-call": "1.4.0",
70
- "@better-auth/core": "^1.7.0-rc.5",
71
- "better-auth": "^1.7.0-rc.5"
70
+ "@better-auth/core": "^1.7.0-rc.6",
71
+ "better-auth": "^1.7.0-rc.6"
72
72
  },
73
73
  "scripts": {
74
74
  "build": "tsdown",