rimecms 0.30.2 → 0.31.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.
Files changed (191) hide show
  1. package/README.md +2 -40
  2. package/dist/.rime-modules.d.ts +23 -0
  3. package/dist/.rime-modules.json +1 -0
  4. package/dist/adapter-sqlite/generate-schema/column.server.js +1 -4
  5. package/dist/adapter-sqlite/generate-schema/write.server.js +7 -9
  6. package/dist/core/areas/config/builder.server.d.ts +0 -1
  7. package/dist/core/collections/auth/hooks/before-upsert/augment-fields-password.server.d.ts +1 -1
  8. package/dist/core/collections/config/builder.server.d.ts +0 -1
  9. package/dist/core/collections/upload/hooks/convert-base64.server.d.ts +1 -1
  10. package/dist/core/collections/upload/hooks/extract-path.server.d.ts +1 -1
  11. package/dist/core/collections/upload/hooks/handle-path-creation.server.d.ts +1 -1
  12. package/dist/core/collections/upload/hooks/process-file-upload.server.d.ts +1 -1
  13. package/dist/core/config/auth/better-auth-hooks.server.js +6 -3
  14. package/dist/core/config/auth/better-auth.server.d.ts +3 -3
  15. package/dist/core/config/client/augment-plugins.d.ts +1 -5
  16. package/dist/core/config/client/augment-plugins.js +3 -3
  17. package/dist/core/config/client/build-config.d.ts +1 -5
  18. package/dist/core/config/config-context.server.d.ts +1 -1
  19. package/dist/core/config/server/augment-plugins.server.d.ts +2 -42
  20. package/dist/core/config/server/augment-plugins.server.js +11 -6
  21. package/dist/core/config/server/build-config.server.d.ts +9 -4007
  22. package/dist/core/config/types.d.ts +12 -11
  23. package/dist/core/dev/cache/index.server.js +1 -1
  24. package/dist/core/dev/cli/build/index.d.ts +1 -0
  25. package/dist/core/dev/cli/build/index.js +10 -5
  26. package/dist/core/dev/cli/build/templates.d.ts +1 -1
  27. package/dist/core/dev/cli/build/templates.js +10 -7
  28. package/dist/core/dev/cli/clear/index.server.js +2 -0
  29. package/dist/core/dev/cli/generate-manifest/index.server.d.ts +17 -0
  30. package/dist/core/dev/cli/generate-manifest/index.server.js +221 -0
  31. package/dist/core/dev/cli/index.js +43 -0
  32. package/dist/core/dev/cli/init/index.server.js +13 -6
  33. package/dist/core/dev/cli/init/templates.d.ts +1 -1
  34. package/dist/core/dev/cli/init/templates.js +13 -4
  35. package/dist/core/dev/cli/util/package-manager.server.js +29 -26
  36. package/dist/core/dev/constants.d.ts +21 -2
  37. package/dist/core/dev/constants.js +26 -0
  38. package/dist/core/dev/generate/routes/common.server.js +4 -7
  39. package/dist/core/dev/generate/routes/index.server.js +25 -4
  40. package/dist/core/dev/generate/runtime/index.server.d.ts +40 -0
  41. package/dist/core/dev/generate/runtime/index.server.js +85 -0
  42. package/dist/core/dev/generate/runtime/parse-exports.server.d.ts +7 -0
  43. package/dist/core/dev/generate/runtime/parse-exports.server.js +40 -0
  44. package/dist/core/dev/generate/sanitize/index.server.d.ts +0 -7
  45. package/dist/core/dev/generate/sanitize/index.server.js +57 -5
  46. package/dist/core/dev/generate/types/index.server.js +21 -20
  47. package/dist/core/dev/vite/index.server.js +227 -33
  48. package/dist/core/ensure.server.d.ts +4 -3
  49. package/dist/core/ensure.server.js +8 -8
  50. package/dist/core/fields/builders/boolean-builder.d.ts +1 -2
  51. package/dist/core/fields/builders/field-builder.d.ts +11 -6
  52. package/dist/core/fields/builders/field-builder.js +12 -5
  53. package/dist/core/fields/builders/form-field-builder.d.ts +11 -14
  54. package/dist/core/fields/builders/form-field-builder.js +17 -15
  55. package/dist/core/fields/util.js +1 -1
  56. package/dist/core/handlers/index.js +2 -2
  57. package/dist/core/operations/blocks/extract.server.js +1 -1
  58. package/dist/core/operations/hooks/before-read/process-document-fields.server.js +3 -3
  59. package/dist/core/operations/hooks/before-upsert/data-config-map.server.d.ts +1 -1
  60. package/dist/core/operations/hooks/before-upsert/handle-new-version.server.d.ts +1 -1
  61. package/dist/core/operations/hooks/before-upsert/original-config-map.server.d.ts +1 -1
  62. package/dist/core/operations/hooks/before-upsert/set-default-values.server.d.ts +1 -1
  63. package/dist/core/operations/hooks/before-upsert/set-default-values.server.js +3 -3
  64. package/dist/core/operations/hooks/before-upsert/validate-fields.server.d.ts +1 -1
  65. package/dist/core/operations/hooks/before-upsert/validate-fields.server.js +7 -7
  66. package/dist/core/operations/hooks/index.server.d.ts +0 -4
  67. package/dist/core/operations/hooks/index.server.js +0 -4
  68. package/dist/core/operations/shared/fallback-data-from-original.js +1 -1
  69. package/dist/core/operations/tree/extract.server.js +1 -1
  70. package/dist/core/plugins/api-init/index.d.ts +2 -0
  71. package/dist/core/plugins/api-init/index.js +1 -0
  72. package/dist/core/plugins/api-init/{index.server.d.ts → module.server.d.ts} +0 -1
  73. package/dist/core/plugins/api-init/{index.server.js → module.server.js} +2 -3
  74. package/dist/core/plugins/cache/index.d.ts +2 -5
  75. package/dist/core/plugins/cache/index.js +1 -21
  76. package/dist/core/plugins/cache/module.d.ts +4 -0
  77. package/dist/core/plugins/cache/module.js +22 -0
  78. package/dist/core/plugins/cache/{index.server.d.ts → module.server.d.ts} +1 -2
  79. package/dist/core/plugins/cache/{index.server.js → module.server.js} +0 -1
  80. package/dist/core/plugins/index.d.ts +1 -8
  81. package/dist/core/plugins/index.js +0 -3
  82. package/dist/core/plugins/mailer/index.d.ts +2 -0
  83. package/dist/core/plugins/mailer/index.js +1 -0
  84. package/dist/core/plugins/mailer/{index.server.d.ts → module.server.d.ts} +0 -1
  85. package/dist/core/plugins/mailer/{index.server.js → module.server.js} +0 -1
  86. package/dist/core/plugins/sse/index.d.ts +2 -0
  87. package/dist/core/plugins/sse/index.js +1 -0
  88. package/dist/core/plugins/sse/{index.server.d.ts → module.server.d.ts} +0 -1
  89. package/dist/core/plugins/sse/{index.server.js → module.server.js} +0 -1
  90. package/dist/core/rime.server.d.ts +16 -16
  91. package/dist/fields/blocks/index.d.ts +1 -1
  92. package/dist/fields/blocks/index.js +5 -2
  93. package/dist/fields/checkbox/index.d.ts +1 -1
  94. package/dist/fields/checkbox/index.js +3 -2
  95. package/dist/fields/combobox/index.d.ts +1 -1
  96. package/dist/fields/combobox/index.js +4 -2
  97. package/dist/fields/date/index.d.ts +2 -2
  98. package/dist/fields/date/index.js +7 -5
  99. package/dist/fields/email/index.d.ts +3 -3
  100. package/dist/fields/email/index.js +9 -8
  101. package/dist/fields/group/component/Group.svelte +1 -1
  102. package/dist/fields/group/index.d.ts +1 -1
  103. package/dist/fields/group/index.js +4 -2
  104. package/dist/fields/link/index.d.ts +1 -1
  105. package/dist/fields/link/index.js +63 -56
  106. package/dist/fields/link/module.server.d.ts +2 -0
  107. package/dist/fields/link/{runtime.server.js → module.server.js} +0 -8
  108. package/dist/fields/number/index.d.ts +1 -1
  109. package/dist/fields/number/index.js +3 -2
  110. package/dist/fields/radio/index.d.ts +1 -1
  111. package/dist/fields/radio/index.js +4 -2
  112. package/dist/fields/relation/index.d.ts +2 -6
  113. package/dist/fields/relation/index.js +64 -75
  114. package/dist/fields/relation/{runtime.d.ts → module.d.ts} +2 -2
  115. package/dist/fields/relation/module.js +4 -0
  116. package/dist/fields/relation/module.server.d.ts +5 -0
  117. package/dist/fields/relation/{runtime.server.js → module.server.js} +3 -6
  118. package/dist/fields/rich-text/index.d.ts +1 -1
  119. package/dist/fields/rich-text/index.js +3 -2
  120. package/dist/fields/select/index.d.ts +1 -1
  121. package/dist/fields/select/index.js +4 -1
  122. package/dist/fields/slug/index.d.ts +1 -1
  123. package/dist/fields/slug/index.js +3 -2
  124. package/dist/fields/tabs/index.d.ts +1 -1
  125. package/dist/fields/tabs/index.js +10 -2
  126. package/dist/fields/text/index.d.ts +1 -1
  127. package/dist/fields/text/index.js +3 -2
  128. package/dist/fields/textarea/index.d.ts +1 -1
  129. package/dist/fields/textarea/index.js +3 -2
  130. package/dist/fields/time/index.d.ts +1 -1
  131. package/dist/fields/time/index.js +3 -2
  132. package/dist/fields/toggle/index.d.ts +1 -1
  133. package/dist/fields/toggle/index.js +3 -3
  134. package/dist/fields/tree/index.d.ts +1 -1
  135. package/dist/fields/tree/index.js +4 -2
  136. package/dist/index.d.ts +3 -3
  137. package/dist/index.js +3 -3
  138. package/dist/panel/components/fields/RenderFields.svelte +1 -1
  139. package/dist/panel/context/collection.svelte.js +5 -3
  140. package/dist/panel/context/config.svelte.d.ts +2 -2
  141. package/dist/panel/context/documentForm.svelte.d.ts +2 -2
  142. package/dist/panel/context/documentForm.svelte.js +47 -28
  143. package/dist/panel/context/form.svelte.js +3 -3
  144. package/dist/panel/context/live.svelte.js +1 -1
  145. package/dist/panel/pages/auth/sign-in/SignIn.svelte +6 -1
  146. package/dist/server.d.ts +4 -4
  147. package/dist/server.js +4 -4
  148. package/dist/types.d.ts +1 -1
  149. package/dist/util/doc.js +1 -1
  150. package/package.json +2 -9
  151. package/dist/fields/blocks/index.server.d.ts +0 -3
  152. package/dist/fields/blocks/index.server.js +0 -5
  153. package/dist/fields/checkbox/index.server.d.ts +0 -3
  154. package/dist/fields/checkbox/index.server.js +0 -3
  155. package/dist/fields/combobox/index.server.d.ts +0 -3
  156. package/dist/fields/combobox/index.server.js +0 -4
  157. package/dist/fields/date/index.server.d.ts +0 -3
  158. package/dist/fields/date/index.server.js +0 -3
  159. package/dist/fields/email/index.server.d.ts +0 -4
  160. package/dist/fields/email/index.server.js +0 -3
  161. package/dist/fields/group/index.server.d.ts +0 -2
  162. package/dist/fields/group/index.server.js +0 -12
  163. package/dist/fields/index.server.d.ts +0 -14
  164. package/dist/fields/index.server.js +0 -65
  165. package/dist/fields/link/runtime.server.d.ts +0 -5
  166. package/dist/fields/number/index.server.d.ts +0 -3
  167. package/dist/fields/number/index.server.js +0 -3
  168. package/dist/fields/radio/index.server.d.ts +0 -3
  169. package/dist/fields/radio/index.server.js +0 -4
  170. package/dist/fields/relation/runtime.js +0 -4
  171. package/dist/fields/relation/runtime.server.d.ts +0 -8
  172. package/dist/fields/rich-text/index.server.d.ts +0 -3
  173. package/dist/fields/rich-text/index.server.js +0 -3
  174. package/dist/fields/select/index.server.d.ts +0 -3
  175. package/dist/fields/select/index.server.js +0 -4
  176. package/dist/fields/slug/index.server.d.ts +0 -3
  177. package/dist/fields/slug/index.server.js +0 -3
  178. package/dist/fields/tabs/index.server.d.ts +0 -3
  179. package/dist/fields/tabs/index.server.js +0 -18
  180. package/dist/fields/text/index.server.d.ts +0 -3
  181. package/dist/fields/text/index.server.js +0 -3
  182. package/dist/fields/textarea/index.server.d.ts +0 -3
  183. package/dist/fields/textarea/index.server.js +0 -3
  184. package/dist/fields/time/index.server.d.ts +0 -3
  185. package/dist/fields/time/index.server.js +0 -3
  186. package/dist/fields/toggle/index.server.d.ts +0 -3
  187. package/dist/fields/toggle/index.server.js +0 -3
  188. package/dist/fields/tree/index.server.d.ts +0 -3
  189. package/dist/fields/tree/index.server.js +0 -4
  190. /package/dist/fields/link/{runtime.d.ts → module.d.ts} +0 -0
  191. /package/dist/fields/link/{runtime.js → module.js} +0 -0
@@ -1,3960 +1,7 @@
1
- import type { SMTPConfig } from '../../plugins/mailer/index.server.js';
1
+ import type { SMTPConfig } from '../../plugins/mailer/module.server.js';
2
+ import { type Rime } from '../../rime.server.js';
2
3
  import type { Config } from '../types.js';
3
- export declare const buildConfig: <const C extends Config>(config: C) => Promise<{
4
- readonly defineLocale: (event: import("@sveltejs/kit").RequestEvent) => string | undefined;
5
- readonly auth: import("better-auth/types").Auth<{
6
- plugins: ({
7
- id: "api-key";
8
- $ERROR_CODES: {
9
- readonly INVALID_METADATA_TYPE: "metadata must be an object or undefined";
10
- readonly REFILL_AMOUNT_AND_INTERVAL_REQUIRED: "refillAmount is required when refillInterval is provided";
11
- readonly REFILL_INTERVAL_AND_AMOUNT_REQUIRED: "refillInterval is required when refillAmount is provided";
12
- readonly USER_BANNED: "User is banned";
13
- readonly UNAUTHORIZED_SESSION: "Unauthorized or invalid session";
14
- readonly KEY_NOT_FOUND: "API Key not found";
15
- readonly KEY_DISABLED: "API Key is disabled";
16
- readonly KEY_EXPIRED: "API Key has expired";
17
- readonly USAGE_EXCEEDED: "API Key has reached its usage limit";
18
- readonly KEY_NOT_RECOVERABLE: "API Key is not recoverable";
19
- readonly EXPIRES_IN_IS_TOO_SMALL: "The expiresIn is smaller than the predefined minimum value.";
20
- readonly EXPIRES_IN_IS_TOO_LARGE: "The expiresIn is larger than the predefined maximum value.";
21
- readonly INVALID_REMAINING: "The remaining count is either too large or too small.";
22
- readonly INVALID_PREFIX_LENGTH: "The prefix length is either too large or too small.";
23
- readonly INVALID_NAME_LENGTH: "The name length is either too large or too small.";
24
- readonly METADATA_DISABLED: "Metadata is disabled.";
25
- readonly RATE_LIMIT_EXCEEDED: "Rate limit exceeded.";
26
- readonly NO_VALUES_TO_UPDATE: "No values to update.";
27
- readonly KEY_DISABLED_EXPIRATION: "Custom key expiration values are disabled.";
28
- readonly INVALID_API_KEY: "Invalid API key.";
29
- readonly INVALID_USER_ID_FROM_API_KEY: "The user id from the API key is invalid.";
30
- readonly INVALID_API_KEY_GETTER_RETURN_TYPE: "API Key getter returned an invalid key type. Expected string.";
31
- readonly SERVER_ONLY_PROPERTY: "The property you're trying to set can only be set from the server auth instance only.";
32
- readonly FAILED_TO_UPDATE_API_KEY: "Failed to update API key";
33
- readonly NAME_REQUIRED: "API Key name is required.";
34
- };
35
- hooks: {
36
- before: {
37
- matcher: (ctx: import("better-auth/*").HookEndpointContext) => boolean;
38
- handler: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
39
- user: {
40
- id: string;
41
- createdAt: Date;
42
- updatedAt: Date;
43
- email: string;
44
- emailVerified: boolean;
45
- name: string;
46
- image?: string | null | undefined;
47
- };
48
- session: {
49
- id: string;
50
- token: string;
51
- userId: string;
52
- userAgent: string | null;
53
- ipAddress: string | null;
54
- createdAt: Date;
55
- updatedAt: Date;
56
- expiresAt: Date;
57
- };
58
- } | {
59
- context: import("better-auth/*").MiddlewareContext<import("better-auth/*").MiddlewareOptions, {
60
- returned?: unknown | undefined;
61
- responseHeaders?: Headers | undefined;
62
- } & import("better-auth/*").PluginContext & import("better-auth/*").InfoContext & {
63
- options: import("better-auth/types").BetterAuthOptions;
64
- appName: string;
65
- baseURL: string;
66
- trustedOrigins: string[];
67
- isTrustedOrigin: (url: string, settings?: {
68
- allowRelativePaths: boolean;
69
- }) => boolean;
70
- oauthConfig: {
71
- skipStateCookieCheck?: boolean | undefined;
72
- storeStateStrategy: "database" | "cookie";
73
- };
74
- newSession: {
75
- session: import("better-auth/types").Session & Record<string, any>;
76
- user: import("better-auth/types").User & Record<string, any>;
77
- } | null;
78
- session: {
79
- session: import("better-auth/types").Session & Record<string, any>;
80
- user: import("better-auth/types").User & Record<string, any>;
81
- } | null;
82
- setNewSession: (session: {
83
- session: import("better-auth/types").Session & Record<string, any>;
84
- user: import("better-auth/types").User & Record<string, any>;
85
- } | null) => void;
86
- socialProviders: import("better-auth/*").OAuthProvider[];
87
- authCookies: import("better-auth/types").BetterAuthCookies;
88
- logger: ReturnType<(options?: import("better-auth/*").Logger | undefined) => import("better-auth/*").InternalLogger>;
89
- rateLimit: {
90
- enabled: boolean;
91
- window: number;
92
- max: number;
93
- storage: "memory" | "database" | "secondary-storage";
94
- } & Omit<import("better-auth/types").BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
95
- adapter: import("better-auth/types").DBAdapter<import("better-auth/types").BetterAuthOptions>;
96
- internalAdapter: import("better-auth/*").InternalAdapter<import("better-auth/types").BetterAuthOptions>;
97
- createAuthCookie: (cookieName: string, overrideAttributes?: Partial<import("better-auth/*").CookieOptions> | undefined) => import("better-auth/*").BetterAuthCookie;
98
- secret: string;
99
- sessionConfig: {
100
- updateAge: number;
101
- expiresIn: number;
102
- freshAge: number;
103
- cookieRefreshCache: false | {
104
- enabled: true;
105
- updateAge: number;
106
- };
107
- };
108
- generateId: (options: {
109
- model: import("better-auth/db").ModelNames;
110
- size?: number | undefined;
111
- }) => string | false;
112
- secondaryStorage: import("better-auth/db").SecondaryStorage | undefined;
113
- password: {
114
- hash: (password: string) => Promise<string>;
115
- verify: (data: {
116
- password: string;
117
- hash: string;
118
- }) => Promise<boolean>;
119
- config: {
120
- minPasswordLength: number;
121
- maxPasswordLength: number;
122
- };
123
- checkPassword: (userId: string, ctx: import("better-auth/*").GenericEndpointContext<import("better-auth/types").BetterAuthOptions>) => Promise<boolean>;
124
- };
125
- tables: import("better-auth/db").BetterAuthDBSchema;
126
- runMigrations: () => Promise<void>;
127
- publishTelemetry: (event: {
128
- type: string;
129
- anonymousId?: string | undefined;
130
- payload: Record<string, any>;
131
- }) => Promise<void>;
132
- skipOriginCheck: boolean | string[];
133
- skipCSRFCheck: boolean;
134
- runInBackground: (promise: Promise<unknown>) => void;
135
- runInBackgroundOrAwait: (promise: Promise<unknown> | void) => import("better-auth/*").Awaitable<unknown>;
136
- }>;
137
- }>;
138
- }[];
139
- };
140
- endpoints: {
141
- createApiKey: import("better-auth/*").StrictEndpoint<"/api-key/create", {
142
- method: "POST";
143
- body: import("better-auth/*").ZodObject<{
144
- name: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
145
- expiresIn: import("better-auth/*").ZodDefault<import("better-auth/*").ZodNullable<import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>>>;
146
- userId: import("better-auth/*").ZodOptional<import("better-auth/*").ZodCoercedString<unknown>>;
147
- prefix: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
148
- remaining: import("better-auth/*").ZodDefault<import("better-auth/*").ZodNullable<import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>>>;
149
- metadata: import("better-auth/*").ZodOptional<import("better-auth/*").ZodAny>;
150
- refillAmount: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
151
- refillInterval: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
152
- rateLimitTimeWindow: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
153
- rateLimitMax: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
154
- rateLimitEnabled: import("better-auth/*").ZodOptional<import("better-auth/*").ZodBoolean>;
155
- permissions: import("better-auth/*").ZodOptional<import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>>>;
156
- }, import("better-auth/*").$strip>;
157
- metadata: {
158
- openapi: {
159
- description: string;
160
- responses: {
161
- "200": {
162
- description: string;
163
- content: {
164
- "application/json": {
165
- schema: {
166
- type: "object";
167
- properties: {
168
- id: {
169
- type: string;
170
- description: string;
171
- };
172
- createdAt: {
173
- type: string;
174
- format: string;
175
- description: string;
176
- };
177
- updatedAt: {
178
- type: string;
179
- format: string;
180
- description: string;
181
- };
182
- name: {
183
- type: string;
184
- nullable: boolean;
185
- description: string;
186
- };
187
- prefix: {
188
- type: string;
189
- nullable: boolean;
190
- description: string;
191
- };
192
- start: {
193
- type: string;
194
- nullable: boolean;
195
- description: string;
196
- };
197
- key: {
198
- type: string;
199
- description: string;
200
- };
201
- enabled: {
202
- type: string;
203
- description: string;
204
- };
205
- expiresAt: {
206
- type: string;
207
- format: string;
208
- nullable: boolean;
209
- description: string;
210
- };
211
- userId: {
212
- type: string;
213
- description: string;
214
- };
215
- lastRefillAt: {
216
- type: string;
217
- format: string;
218
- nullable: boolean;
219
- description: string;
220
- };
221
- lastRequest: {
222
- type: string;
223
- format: string;
224
- nullable: boolean;
225
- description: string;
226
- };
227
- metadata: {
228
- type: string;
229
- nullable: boolean;
230
- additionalProperties: boolean;
231
- description: string;
232
- };
233
- rateLimitMax: {
234
- type: string;
235
- nullable: boolean;
236
- description: string;
237
- };
238
- rateLimitTimeWindow: {
239
- type: string;
240
- nullable: boolean;
241
- description: string;
242
- };
243
- remaining: {
244
- type: string;
245
- nullable: boolean;
246
- description: string;
247
- };
248
- refillAmount: {
249
- type: string;
250
- nullable: boolean;
251
- description: string;
252
- };
253
- refillInterval: {
254
- type: string;
255
- nullable: boolean;
256
- description: string;
257
- };
258
- rateLimitEnabled: {
259
- type: string;
260
- description: string;
261
- };
262
- requestCount: {
263
- type: string;
264
- description: string;
265
- };
266
- permissions: {
267
- type: string;
268
- nullable: boolean;
269
- additionalProperties: {
270
- type: string;
271
- items: {
272
- type: string;
273
- };
274
- };
275
- description: string;
276
- };
277
- };
278
- required: string[];
279
- };
280
- };
281
- };
282
- };
283
- };
284
- };
285
- };
286
- }, {
287
- key: string;
288
- metadata: any;
289
- permissions: any;
290
- id: string;
291
- name: string | null;
292
- start: string | null;
293
- prefix: string | null;
294
- userId: string;
295
- refillInterval: number | null;
296
- refillAmount: number | null;
297
- lastRefillAt: Date | null;
298
- enabled: boolean;
299
- rateLimitEnabled: boolean;
300
- rateLimitTimeWindow: number | null;
301
- rateLimitMax: number | null;
302
- requestCount: number;
303
- remaining: number | null;
304
- lastRequest: Date | null;
305
- expiresAt: Date | null;
306
- createdAt: Date;
307
- updatedAt: Date;
308
- }>;
309
- verifyApiKey: import("better-auth/*").StrictEndpoint<string, {
310
- method: "POST";
311
- body: import("better-auth/*").ZodObject<{
312
- key: import("better-auth/*").ZodString;
313
- permissions: import("better-auth/*").ZodOptional<import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>>>;
314
- }, import("better-auth/*").$strip>;
315
- }, {
316
- valid: boolean;
317
- error: {
318
- message: "Invalid API key.";
319
- code: "KEY_NOT_FOUND";
320
- };
321
- key: null;
322
- } | {
323
- valid: boolean;
324
- error: {
325
- message: string | undefined;
326
- code: string;
327
- cause?: unknown;
328
- };
329
- key: null;
330
- } | {
331
- valid: boolean;
332
- error: {
333
- message: "Invalid API key.";
334
- code: "INVALID_API_KEY";
335
- };
336
- key: null;
337
- } | {
338
- valid: boolean;
339
- error: null;
340
- key: Omit<import("better-auth/plugins").ApiKey, "key"> | null;
341
- }>;
342
- getApiKey: import("better-auth/*").StrictEndpoint<"/api-key/get", {
343
- method: "GET";
344
- query: import("better-auth/*").ZodObject<{
345
- id: import("better-auth/*").ZodString;
346
- }, import("better-auth/*").$strip>;
347
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
348
- session: {
349
- session: Record<string, any> & {
350
- id: string;
351
- createdAt: Date;
352
- updatedAt: Date;
353
- userId: string;
354
- expiresAt: Date;
355
- token: string;
356
- ipAddress?: string | null | undefined;
357
- userAgent?: string | null | undefined;
358
- };
359
- user: Record<string, any> & {
360
- id: string;
361
- createdAt: Date;
362
- updatedAt: Date;
363
- email: string;
364
- emailVerified: boolean;
365
- name: string;
366
- image?: string | null | undefined;
367
- };
368
- };
369
- }>)[];
370
- metadata: {
371
- openapi: {
372
- description: string;
373
- responses: {
374
- "200": {
375
- description: string;
376
- content: {
377
- "application/json": {
378
- schema: {
379
- type: "object";
380
- properties: {
381
- id: {
382
- type: string;
383
- description: string;
384
- };
385
- name: {
386
- type: string;
387
- nullable: boolean;
388
- description: string;
389
- };
390
- start: {
391
- type: string;
392
- nullable: boolean;
393
- description: string;
394
- };
395
- prefix: {
396
- type: string;
397
- nullable: boolean;
398
- description: string;
399
- };
400
- userId: {
401
- type: string;
402
- description: string;
403
- };
404
- refillInterval: {
405
- type: string;
406
- nullable: boolean;
407
- description: string;
408
- };
409
- refillAmount: {
410
- type: string;
411
- nullable: boolean;
412
- description: string;
413
- };
414
- lastRefillAt: {
415
- type: string;
416
- format: string;
417
- nullable: boolean;
418
- description: string;
419
- };
420
- enabled: {
421
- type: string;
422
- description: string;
423
- default: boolean;
424
- };
425
- rateLimitEnabled: {
426
- type: string;
427
- description: string;
428
- };
429
- rateLimitTimeWindow: {
430
- type: string;
431
- nullable: boolean;
432
- description: string;
433
- };
434
- rateLimitMax: {
435
- type: string;
436
- nullable: boolean;
437
- description: string;
438
- };
439
- requestCount: {
440
- type: string;
441
- description: string;
442
- };
443
- remaining: {
444
- type: string;
445
- nullable: boolean;
446
- description: string;
447
- };
448
- lastRequest: {
449
- type: string;
450
- format: string;
451
- nullable: boolean;
452
- description: string;
453
- };
454
- expiresAt: {
455
- type: string;
456
- format: string;
457
- nullable: boolean;
458
- description: string;
459
- };
460
- createdAt: {
461
- type: string;
462
- format: string;
463
- description: string;
464
- };
465
- updatedAt: {
466
- type: string;
467
- format: string;
468
- description: string;
469
- };
470
- metadata: {
471
- type: string;
472
- nullable: boolean;
473
- additionalProperties: boolean;
474
- description: string;
475
- };
476
- permissions: {
477
- type: string;
478
- nullable: boolean;
479
- description: string;
480
- };
481
- };
482
- required: string[];
483
- };
484
- };
485
- };
486
- };
487
- };
488
- };
489
- };
490
- }, {
491
- metadata: Record<string, any> | null;
492
- permissions: {
493
- [key: string]: string[];
494
- } | null;
495
- id: string;
496
- name: string | null;
497
- start: string | null;
498
- prefix: string | null;
499
- userId: string;
500
- refillInterval: number | null;
501
- refillAmount: number | null;
502
- lastRefillAt: Date | null;
503
- enabled: boolean;
504
- rateLimitEnabled: boolean;
505
- rateLimitTimeWindow: number | null;
506
- rateLimitMax: number | null;
507
- requestCount: number;
508
- remaining: number | null;
509
- lastRequest: Date | null;
510
- expiresAt: Date | null;
511
- createdAt: Date;
512
- updatedAt: Date;
513
- }>;
514
- updateApiKey: import("better-auth/*").StrictEndpoint<"/api-key/update", {
515
- method: "POST";
516
- body: import("better-auth/*").ZodObject<{
517
- keyId: import("better-auth/*").ZodString;
518
- userId: import("better-auth/*").ZodOptional<import("better-auth/*").ZodCoercedString<unknown>>;
519
- name: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
520
- enabled: import("better-auth/*").ZodOptional<import("better-auth/*").ZodBoolean>;
521
- remaining: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
522
- refillAmount: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
523
- refillInterval: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
524
- metadata: import("better-auth/*").ZodOptional<import("better-auth/*").ZodAny>;
525
- expiresIn: import("better-auth/*").ZodNullable<import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>>;
526
- rateLimitEnabled: import("better-auth/*").ZodOptional<import("better-auth/*").ZodBoolean>;
527
- rateLimitTimeWindow: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
528
- rateLimitMax: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
529
- permissions: import("better-auth/*").ZodNullable<import("better-auth/*").ZodOptional<import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>>>>;
530
- }, import("better-auth/*").$strip>;
531
- metadata: {
532
- openapi: {
533
- description: string;
534
- responses: {
535
- "200": {
536
- description: string;
537
- content: {
538
- "application/json": {
539
- schema: {
540
- type: "object";
541
- properties: {
542
- id: {
543
- type: string;
544
- description: string;
545
- };
546
- name: {
547
- type: string;
548
- nullable: boolean;
549
- description: string;
550
- };
551
- start: {
552
- type: string;
553
- nullable: boolean;
554
- description: string;
555
- };
556
- prefix: {
557
- type: string;
558
- nullable: boolean;
559
- description: string;
560
- };
561
- userId: {
562
- type: string;
563
- description: string;
564
- };
565
- refillInterval: {
566
- type: string;
567
- nullable: boolean;
568
- description: string;
569
- };
570
- refillAmount: {
571
- type: string;
572
- nullable: boolean;
573
- description: string;
574
- };
575
- lastRefillAt: {
576
- type: string;
577
- format: string;
578
- nullable: boolean;
579
- description: string;
580
- };
581
- enabled: {
582
- type: string;
583
- description: string;
584
- default: boolean;
585
- };
586
- rateLimitEnabled: {
587
- type: string;
588
- description: string;
589
- };
590
- rateLimitTimeWindow: {
591
- type: string;
592
- nullable: boolean;
593
- description: string;
594
- };
595
- rateLimitMax: {
596
- type: string;
597
- nullable: boolean;
598
- description: string;
599
- };
600
- requestCount: {
601
- type: string;
602
- description: string;
603
- };
604
- remaining: {
605
- type: string;
606
- nullable: boolean;
607
- description: string;
608
- };
609
- lastRequest: {
610
- type: string;
611
- format: string;
612
- nullable: boolean;
613
- description: string;
614
- };
615
- expiresAt: {
616
- type: string;
617
- format: string;
618
- nullable: boolean;
619
- description: string;
620
- };
621
- createdAt: {
622
- type: string;
623
- format: string;
624
- description: string;
625
- };
626
- updatedAt: {
627
- type: string;
628
- format: string;
629
- description: string;
630
- };
631
- metadata: {
632
- type: string;
633
- nullable: boolean;
634
- additionalProperties: boolean;
635
- description: string;
636
- };
637
- permissions: {
638
- type: string;
639
- nullable: boolean;
640
- description: string;
641
- };
642
- };
643
- required: string[];
644
- };
645
- };
646
- };
647
- };
648
- };
649
- };
650
- };
651
- }, {
652
- metadata: Record<string, any> | null;
653
- permissions: {
654
- [key: string]: string[];
655
- } | null;
656
- id: string;
657
- name: string | null;
658
- start: string | null;
659
- prefix: string | null;
660
- userId: string;
661
- refillInterval: number | null;
662
- refillAmount: number | null;
663
- lastRefillAt: Date | null;
664
- enabled: boolean;
665
- rateLimitEnabled: boolean;
666
- rateLimitTimeWindow: number | null;
667
- rateLimitMax: number | null;
668
- requestCount: number;
669
- remaining: number | null;
670
- lastRequest: Date | null;
671
- expiresAt: Date | null;
672
- createdAt: Date;
673
- updatedAt: Date;
674
- }>;
675
- deleteApiKey: import("better-auth/*").StrictEndpoint<"/api-key/delete", {
676
- method: "POST";
677
- body: import("better-auth/*").ZodObject<{
678
- keyId: import("better-auth/*").ZodString;
679
- }, import("better-auth/*").$strip>;
680
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
681
- session: {
682
- session: Record<string, any> & {
683
- id: string;
684
- createdAt: Date;
685
- updatedAt: Date;
686
- userId: string;
687
- expiresAt: Date;
688
- token: string;
689
- ipAddress?: string | null | undefined;
690
- userAgent?: string | null | undefined;
691
- };
692
- user: Record<string, any> & {
693
- id: string;
694
- createdAt: Date;
695
- updatedAt: Date;
696
- email: string;
697
- emailVerified: boolean;
698
- name: string;
699
- image?: string | null | undefined;
700
- };
701
- };
702
- }>)[];
703
- metadata: {
704
- openapi: {
705
- description: string;
706
- requestBody: {
707
- content: {
708
- "application/json": {
709
- schema: {
710
- type: "object";
711
- properties: {
712
- keyId: {
713
- type: string;
714
- description: string;
715
- };
716
- };
717
- required: string[];
718
- };
719
- };
720
- };
721
- };
722
- responses: {
723
- "200": {
724
- description: string;
725
- content: {
726
- "application/json": {
727
- schema: {
728
- type: "object";
729
- properties: {
730
- success: {
731
- type: string;
732
- description: string;
733
- };
734
- };
735
- required: string[];
736
- };
737
- };
738
- };
739
- };
740
- };
741
- };
742
- };
743
- }, {
744
- success: boolean;
745
- }>;
746
- listApiKeys: import("better-auth/*").StrictEndpoint<"/api-key/list", {
747
- method: "GET";
748
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
749
- session: {
750
- session: Record<string, any> & {
751
- id: string;
752
- createdAt: Date;
753
- updatedAt: Date;
754
- userId: string;
755
- expiresAt: Date;
756
- token: string;
757
- ipAddress?: string | null | undefined;
758
- userAgent?: string | null | undefined;
759
- };
760
- user: Record<string, any> & {
761
- id: string;
762
- createdAt: Date;
763
- updatedAt: Date;
764
- email: string;
765
- emailVerified: boolean;
766
- name: string;
767
- image?: string | null | undefined;
768
- };
769
- };
770
- }>)[];
771
- metadata: {
772
- openapi: {
773
- description: string;
774
- responses: {
775
- "200": {
776
- description: string;
777
- content: {
778
- "application/json": {
779
- schema: {
780
- type: "array";
781
- items: {
782
- type: string;
783
- properties: {
784
- id: {
785
- type: string;
786
- description: string;
787
- };
788
- name: {
789
- type: string;
790
- nullable: boolean;
791
- description: string;
792
- };
793
- start: {
794
- type: string;
795
- nullable: boolean;
796
- description: string;
797
- };
798
- prefix: {
799
- type: string;
800
- nullable: boolean;
801
- description: string;
802
- };
803
- userId: {
804
- type: string;
805
- description: string;
806
- };
807
- refillInterval: {
808
- type: string;
809
- nullable: boolean;
810
- description: string;
811
- };
812
- refillAmount: {
813
- type: string;
814
- nullable: boolean;
815
- description: string;
816
- };
817
- lastRefillAt: {
818
- type: string;
819
- format: string;
820
- nullable: boolean;
821
- description: string;
822
- };
823
- enabled: {
824
- type: string;
825
- description: string;
826
- default: boolean;
827
- };
828
- rateLimitEnabled: {
829
- type: string;
830
- description: string;
831
- };
832
- rateLimitTimeWindow: {
833
- type: string;
834
- nullable: boolean;
835
- description: string;
836
- };
837
- rateLimitMax: {
838
- type: string;
839
- nullable: boolean;
840
- description: string;
841
- };
842
- requestCount: {
843
- type: string;
844
- description: string;
845
- };
846
- remaining: {
847
- type: string;
848
- nullable: boolean;
849
- description: string;
850
- };
851
- lastRequest: {
852
- type: string;
853
- format: string;
854
- nullable: boolean;
855
- description: string;
856
- };
857
- expiresAt: {
858
- type: string;
859
- format: string;
860
- nullable: boolean;
861
- description: string;
862
- };
863
- createdAt: {
864
- type: string;
865
- format: string;
866
- description: string;
867
- };
868
- updatedAt: {
869
- type: string;
870
- format: string;
871
- description: string;
872
- };
873
- metadata: {
874
- type: string;
875
- nullable: boolean;
876
- additionalProperties: boolean;
877
- description: string;
878
- };
879
- permissions: {
880
- type: string;
881
- nullable: boolean;
882
- description: string;
883
- };
884
- };
885
- required: string[];
886
- };
887
- };
888
- };
889
- };
890
- };
891
- };
892
- };
893
- };
894
- }, {
895
- metadata: Record<string, any> | null;
896
- permissions: {
897
- [key: string]: string[];
898
- } | null;
899
- id: string;
900
- name: string | null;
901
- start: string | null;
902
- prefix: string | null;
903
- userId: string;
904
- refillInterval: number | null;
905
- refillAmount: number | null;
906
- lastRefillAt: Date | null;
907
- enabled: boolean;
908
- rateLimitEnabled: boolean;
909
- rateLimitTimeWindow: number | null;
910
- rateLimitMax: number | null;
911
- requestCount: number;
912
- remaining: number | null;
913
- lastRequest: Date | null;
914
- expiresAt: Date | null;
915
- createdAt: Date;
916
- updatedAt: Date;
917
- }[]>;
918
- deleteAllExpiredApiKeys: import("better-auth/*").StrictEndpoint<string, {
919
- method: "POST";
920
- }, {
921
- success: boolean;
922
- error: unknown;
923
- }>;
924
- };
925
- schema: {
926
- apikey: {
927
- fields: {
928
- name: {
929
- type: "string";
930
- required: false;
931
- input: false;
932
- };
933
- start: {
934
- type: "string";
935
- required: false;
936
- input: false;
937
- };
938
- prefix: {
939
- type: "string";
940
- required: false;
941
- input: false;
942
- };
943
- key: {
944
- type: "string";
945
- required: true;
946
- input: false;
947
- index: true;
948
- };
949
- userId: {
950
- type: "string";
951
- references: {
952
- model: string;
953
- field: string;
954
- onDelete: "cascade";
955
- };
956
- required: true;
957
- input: false;
958
- index: true;
959
- };
960
- refillInterval: {
961
- type: "number";
962
- required: false;
963
- input: false;
964
- };
965
- refillAmount: {
966
- type: "number";
967
- required: false;
968
- input: false;
969
- };
970
- lastRefillAt: {
971
- type: "date";
972
- required: false;
973
- input: false;
974
- };
975
- enabled: {
976
- type: "boolean";
977
- required: false;
978
- input: false;
979
- defaultValue: true;
980
- };
981
- rateLimitEnabled: {
982
- type: "boolean";
983
- required: false;
984
- input: false;
985
- defaultValue: true;
986
- };
987
- rateLimitTimeWindow: {
988
- type: "number";
989
- required: false;
990
- input: false;
991
- defaultValue: number;
992
- };
993
- rateLimitMax: {
994
- type: "number";
995
- required: false;
996
- input: false;
997
- defaultValue: number;
998
- };
999
- requestCount: {
1000
- type: "number";
1001
- required: false;
1002
- input: false;
1003
- defaultValue: number;
1004
- };
1005
- remaining: {
1006
- type: "number";
1007
- required: false;
1008
- input: false;
1009
- };
1010
- lastRequest: {
1011
- type: "date";
1012
- required: false;
1013
- input: false;
1014
- };
1015
- expiresAt: {
1016
- type: "date";
1017
- required: false;
1018
- input: false;
1019
- };
1020
- createdAt: {
1021
- type: "date";
1022
- required: true;
1023
- input: false;
1024
- };
1025
- updatedAt: {
1026
- type: "date";
1027
- required: true;
1028
- input: false;
1029
- };
1030
- permissions: {
1031
- type: "string";
1032
- required: false;
1033
- input: false;
1034
- };
1035
- metadata: {
1036
- type: "string";
1037
- required: false;
1038
- input: true;
1039
- transform: {
1040
- input(value: import("better-auth/db").DBPrimitive): string;
1041
- output(value: import("better-auth/db").DBPrimitive): any;
1042
- };
1043
- };
1044
- };
1045
- };
1046
- };
1047
- options: import("better-auth/plugins").ApiKeyOptions | undefined;
1048
- } | {
1049
- id: "admin";
1050
- init(): {
1051
- options: {
1052
- databaseHooks: {
1053
- user: {
1054
- create: {
1055
- before(user: {
1056
- id: string;
1057
- createdAt: Date;
1058
- updatedAt: Date;
1059
- email: string;
1060
- emailVerified: boolean;
1061
- name: string;
1062
- image?: string | null | undefined;
1063
- } & Record<string, unknown>): Promise<{
1064
- data: {
1065
- id: string;
1066
- createdAt: Date;
1067
- updatedAt: Date;
1068
- email: string;
1069
- emailVerified: boolean;
1070
- name: string;
1071
- image?: string | null | undefined;
1072
- role: string;
1073
- };
1074
- }>;
1075
- };
1076
- };
1077
- session: {
1078
- create: {
1079
- before(session: {
1080
- id: string;
1081
- createdAt: Date;
1082
- updatedAt: Date;
1083
- userId: string;
1084
- expiresAt: Date;
1085
- token: string;
1086
- ipAddress?: string | null | undefined;
1087
- userAgent?: string | null | undefined;
1088
- } & Record<string, unknown>, ctx: import("better-auth/*").GenericEndpointContext | null): Promise<void>;
1089
- };
1090
- };
1091
- };
1092
- };
1093
- };
1094
- hooks: {
1095
- after: {
1096
- matcher(context: import("better-auth/*").HookEndpointContext): boolean;
1097
- handler: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>;
1098
- }[];
1099
- };
1100
- endpoints: {
1101
- setRole: import("better-auth/*").StrictEndpoint<"/admin/set-role", {
1102
- method: "POST";
1103
- body: import("better-auth/*").ZodObject<{
1104
- userId: import("better-auth/*").ZodCoercedString<unknown>;
1105
- role: import("better-auth/*").ZodUnion<readonly [import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>]>;
1106
- }, import("better-auth/*").$strip>;
1107
- requireHeaders: true;
1108
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1109
- session: {
1110
- user: import("better-auth/plugins").UserWithRole;
1111
- session: import("better-auth/types").Session;
1112
- };
1113
- }>)[];
1114
- metadata: {
1115
- openapi: {
1116
- operationId: string;
1117
- summary: string;
1118
- description: string;
1119
- responses: {
1120
- 200: {
1121
- description: string;
1122
- content: {
1123
- "application/json": {
1124
- schema: {
1125
- type: "object";
1126
- properties: {
1127
- user: {
1128
- $ref: string;
1129
- };
1130
- };
1131
- };
1132
- };
1133
- };
1134
- };
1135
- };
1136
- };
1137
- $Infer: {
1138
- body: {
1139
- userId: string;
1140
- role: "user" | "admin" | "staff" | ("user" | "admin" | "staff")[];
1141
- };
1142
- };
1143
- };
1144
- }, {
1145
- user: import("better-auth/plugins").UserWithRole;
1146
- }>;
1147
- getUser: import("better-auth/*").StrictEndpoint<"/admin/get-user", {
1148
- method: "GET";
1149
- query: import("better-auth/*").ZodObject<{
1150
- id: import("better-auth/*").ZodString;
1151
- }, import("better-auth/*").$strip>;
1152
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1153
- session: {
1154
- user: import("better-auth/plugins").UserWithRole;
1155
- session: import("better-auth/types").Session;
1156
- };
1157
- }>)[];
1158
- metadata: {
1159
- openapi: {
1160
- operationId: string;
1161
- summary: string;
1162
- description: string;
1163
- responses: {
1164
- 200: {
1165
- description: string;
1166
- content: {
1167
- "application/json": {
1168
- schema: {
1169
- type: "object";
1170
- properties: {
1171
- user: {
1172
- $ref: string;
1173
- };
1174
- };
1175
- };
1176
- };
1177
- };
1178
- };
1179
- };
1180
- };
1181
- };
1182
- }, import("better-auth/plugins").UserWithRole>;
1183
- createUser: import("better-auth/*").StrictEndpoint<"/admin/create-user", {
1184
- method: "POST";
1185
- body: import("better-auth/*").ZodObject<{
1186
- email: import("better-auth/*").ZodString;
1187
- password: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
1188
- name: import("better-auth/*").ZodString;
1189
- role: import("better-auth/*").ZodOptional<import("better-auth/*").ZodUnion<readonly [import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>]>>;
1190
- data: import("better-auth/*").ZodOptional<import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodAny>>;
1191
- }, import("better-auth/*").$strip>;
1192
- metadata: {
1193
- openapi: {
1194
- operationId: string;
1195
- summary: string;
1196
- description: string;
1197
- responses: {
1198
- 200: {
1199
- description: string;
1200
- content: {
1201
- "application/json": {
1202
- schema: {
1203
- type: "object";
1204
- properties: {
1205
- user: {
1206
- $ref: string;
1207
- };
1208
- };
1209
- };
1210
- };
1211
- };
1212
- };
1213
- };
1214
- };
1215
- $Infer: {
1216
- body: {
1217
- email: string;
1218
- password?: string | undefined;
1219
- name: string;
1220
- role?: "user" | "admin" | "staff" | ("user" | "admin" | "staff")[] | undefined;
1221
- data?: Record<string, any> | undefined;
1222
- };
1223
- };
1224
- };
1225
- }, {
1226
- user: import("better-auth/plugins").UserWithRole;
1227
- }>;
1228
- adminUpdateUser: import("better-auth/*").StrictEndpoint<"/admin/update-user", {
1229
- method: "POST";
1230
- body: import("better-auth/*").ZodObject<{
1231
- userId: import("better-auth/*").ZodCoercedString<unknown>;
1232
- data: import("better-auth/*").ZodRecord<import("better-auth/*").ZodAny, import("better-auth/*").ZodAny>;
1233
- }, import("better-auth/*").$strip>;
1234
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1235
- session: {
1236
- user: import("better-auth/plugins").UserWithRole;
1237
- session: import("better-auth/types").Session;
1238
- };
1239
- }>)[];
1240
- metadata: {
1241
- openapi: {
1242
- operationId: string;
1243
- summary: string;
1244
- description: string;
1245
- responses: {
1246
- 200: {
1247
- description: string;
1248
- content: {
1249
- "application/json": {
1250
- schema: {
1251
- type: "object";
1252
- properties: {
1253
- user: {
1254
- $ref: string;
1255
- };
1256
- };
1257
- };
1258
- };
1259
- };
1260
- };
1261
- };
1262
- };
1263
- };
1264
- }, import("better-auth/plugins").UserWithRole>;
1265
- listUsers: import("better-auth/*").StrictEndpoint<"/admin/list-users", {
1266
- method: "GET";
1267
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1268
- session: {
1269
- user: import("better-auth/plugins").UserWithRole;
1270
- session: import("better-auth/types").Session;
1271
- };
1272
- }>)[];
1273
- query: import("better-auth/*").ZodObject<{
1274
- searchValue: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
1275
- searchField: import("better-auth/*").ZodOptional<import("better-auth/*").ZodEnum<{
1276
- name: "name";
1277
- email: "email";
1278
- }>>;
1279
- searchOperator: import("better-auth/*").ZodOptional<import("better-auth/*").ZodEnum<{
1280
- contains: "contains";
1281
- starts_with: "starts_with";
1282
- ends_with: "ends_with";
1283
- }>>;
1284
- limit: import("better-auth/*").ZodOptional<import("better-auth/*").ZodUnion<[import("better-auth/*").ZodString, import("better-auth/*").ZodNumber]>>;
1285
- offset: import("better-auth/*").ZodOptional<import("better-auth/*").ZodUnion<[import("better-auth/*").ZodString, import("better-auth/*").ZodNumber]>>;
1286
- sortBy: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
1287
- sortDirection: import("better-auth/*").ZodOptional<import("better-auth/*").ZodEnum<{
1288
- asc: "asc";
1289
- desc: "desc";
1290
- }>>;
1291
- filterField: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
1292
- filterValue: import("better-auth/*").ZodOptional<import("better-auth/*").ZodUnion<[import("better-auth/*").ZodUnion<[import("better-auth/*").ZodString, import("better-auth/*").ZodNumber]>, import("better-auth/*").ZodBoolean]>>;
1293
- filterOperator: import("better-auth/*").ZodOptional<import("better-auth/*").ZodEnum<{
1294
- eq: "eq";
1295
- ne: "ne";
1296
- lt: "lt";
1297
- lte: "lte";
1298
- gt: "gt";
1299
- gte: "gte";
1300
- contains: "contains";
1301
- }>>;
1302
- }, import("better-auth/*").$strip>;
1303
- metadata: {
1304
- openapi: {
1305
- operationId: string;
1306
- summary: string;
1307
- description: string;
1308
- responses: {
1309
- 200: {
1310
- description: string;
1311
- content: {
1312
- "application/json": {
1313
- schema: {
1314
- type: "object";
1315
- properties: {
1316
- users: {
1317
- type: string;
1318
- items: {
1319
- $ref: string;
1320
- };
1321
- };
1322
- total: {
1323
- type: string;
1324
- };
1325
- limit: {
1326
- type: string;
1327
- };
1328
- offset: {
1329
- type: string;
1330
- };
1331
- };
1332
- required: string[];
1333
- };
1334
- };
1335
- };
1336
- };
1337
- };
1338
- };
1339
- };
1340
- }, {
1341
- users: import("better-auth/plugins").UserWithRole[];
1342
- total: number;
1343
- }>;
1344
- listUserSessions: import("better-auth/*").StrictEndpoint<"/admin/list-user-sessions", {
1345
- method: "POST";
1346
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1347
- session: {
1348
- user: import("better-auth/plugins").UserWithRole;
1349
- session: import("better-auth/types").Session;
1350
- };
1351
- }>)[];
1352
- body: import("better-auth/*").ZodObject<{
1353
- userId: import("better-auth/*").ZodCoercedString<unknown>;
1354
- }, import("better-auth/*").$strip>;
1355
- metadata: {
1356
- openapi: {
1357
- operationId: string;
1358
- summary: string;
1359
- description: string;
1360
- responses: {
1361
- 200: {
1362
- description: string;
1363
- content: {
1364
- "application/json": {
1365
- schema: {
1366
- type: "object";
1367
- properties: {
1368
- sessions: {
1369
- type: string;
1370
- items: {
1371
- $ref: string;
1372
- };
1373
- };
1374
- };
1375
- };
1376
- };
1377
- };
1378
- };
1379
- };
1380
- };
1381
- };
1382
- }, {
1383
- sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
1384
- }>;
1385
- unbanUser: import("better-auth/*").StrictEndpoint<"/admin/unban-user", {
1386
- method: "POST";
1387
- body: import("better-auth/*").ZodObject<{
1388
- userId: import("better-auth/*").ZodCoercedString<unknown>;
1389
- }, import("better-auth/*").$strip>;
1390
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1391
- session: {
1392
- user: import("better-auth/plugins").UserWithRole;
1393
- session: import("better-auth/types").Session;
1394
- };
1395
- }>)[];
1396
- metadata: {
1397
- openapi: {
1398
- operationId: string;
1399
- summary: string;
1400
- description: string;
1401
- responses: {
1402
- 200: {
1403
- description: string;
1404
- content: {
1405
- "application/json": {
1406
- schema: {
1407
- type: "object";
1408
- properties: {
1409
- user: {
1410
- $ref: string;
1411
- };
1412
- };
1413
- };
1414
- };
1415
- };
1416
- };
1417
- };
1418
- };
1419
- };
1420
- }, {
1421
- user: import("better-auth/plugins").UserWithRole;
1422
- }>;
1423
- banUser: import("better-auth/*").StrictEndpoint<"/admin/ban-user", {
1424
- method: "POST";
1425
- body: import("better-auth/*").ZodObject<{
1426
- userId: import("better-auth/*").ZodCoercedString<unknown>;
1427
- banReason: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
1428
- banExpiresIn: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
1429
- }, import("better-auth/*").$strip>;
1430
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1431
- session: {
1432
- user: import("better-auth/plugins").UserWithRole;
1433
- session: import("better-auth/types").Session;
1434
- };
1435
- }>)[];
1436
- metadata: {
1437
- openapi: {
1438
- operationId: string;
1439
- summary: string;
1440
- description: string;
1441
- responses: {
1442
- 200: {
1443
- description: string;
1444
- content: {
1445
- "application/json": {
1446
- schema: {
1447
- type: "object";
1448
- properties: {
1449
- user: {
1450
- $ref: string;
1451
- };
1452
- };
1453
- };
1454
- };
1455
- };
1456
- };
1457
- };
1458
- };
1459
- };
1460
- }, {
1461
- user: import("better-auth/plugins").UserWithRole;
1462
- }>;
1463
- impersonateUser: import("better-auth/*").StrictEndpoint<"/admin/impersonate-user", {
1464
- method: "POST";
1465
- body: import("better-auth/*").ZodObject<{
1466
- userId: import("better-auth/*").ZodCoercedString<unknown>;
1467
- }, import("better-auth/*").$strip>;
1468
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1469
- session: {
1470
- user: import("better-auth/plugins").UserWithRole;
1471
- session: import("better-auth/types").Session;
1472
- };
1473
- }>)[];
1474
- metadata: {
1475
- openapi: {
1476
- operationId: string;
1477
- summary: string;
1478
- description: string;
1479
- responses: {
1480
- 200: {
1481
- description: string;
1482
- content: {
1483
- "application/json": {
1484
- schema: {
1485
- type: "object";
1486
- properties: {
1487
- session: {
1488
- $ref: string;
1489
- };
1490
- user: {
1491
- $ref: string;
1492
- };
1493
- };
1494
- };
1495
- };
1496
- };
1497
- };
1498
- };
1499
- };
1500
- };
1501
- }, {
1502
- session: {
1503
- id: string;
1504
- createdAt: Date;
1505
- updatedAt: Date;
1506
- userId: string;
1507
- expiresAt: Date;
1508
- token: string;
1509
- ipAddress?: string | null | undefined;
1510
- userAgent?: string | null | undefined;
1511
- };
1512
- user: import("better-auth/plugins").UserWithRole;
1513
- }>;
1514
- stopImpersonating: import("better-auth/*").StrictEndpoint<"/admin/stop-impersonating", {
1515
- method: "POST";
1516
- requireHeaders: true;
1517
- }, {
1518
- session: {
1519
- id: string;
1520
- createdAt: Date;
1521
- updatedAt: Date;
1522
- userId: string;
1523
- expiresAt: Date;
1524
- token: string;
1525
- ipAddress?: string | null | undefined;
1526
- userAgent?: string | null | undefined;
1527
- } & Record<string, any>;
1528
- user: {
1529
- id: string;
1530
- createdAt: Date;
1531
- updatedAt: Date;
1532
- email: string;
1533
- emailVerified: boolean;
1534
- name: string;
1535
- image?: string | null | undefined;
1536
- } & Record<string, any>;
1537
- }>;
1538
- revokeUserSession: import("better-auth/*").StrictEndpoint<"/admin/revoke-user-session", {
1539
- method: "POST";
1540
- body: import("better-auth/*").ZodObject<{
1541
- sessionToken: import("better-auth/*").ZodString;
1542
- }, import("better-auth/*").$strip>;
1543
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1544
- session: {
1545
- user: import("better-auth/plugins").UserWithRole;
1546
- session: import("better-auth/types").Session;
1547
- };
1548
- }>)[];
1549
- metadata: {
1550
- openapi: {
1551
- operationId: string;
1552
- summary: string;
1553
- description: string;
1554
- responses: {
1555
- 200: {
1556
- description: string;
1557
- content: {
1558
- "application/json": {
1559
- schema: {
1560
- type: "object";
1561
- properties: {
1562
- success: {
1563
- type: string;
1564
- };
1565
- };
1566
- };
1567
- };
1568
- };
1569
- };
1570
- };
1571
- };
1572
- };
1573
- }, {
1574
- success: boolean;
1575
- }>;
1576
- revokeUserSessions: import("better-auth/*").StrictEndpoint<"/admin/revoke-user-sessions", {
1577
- method: "POST";
1578
- body: import("better-auth/*").ZodObject<{
1579
- userId: import("better-auth/*").ZodCoercedString<unknown>;
1580
- }, import("better-auth/*").$strip>;
1581
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1582
- session: {
1583
- user: import("better-auth/plugins").UserWithRole;
1584
- session: import("better-auth/types").Session;
1585
- };
1586
- }>)[];
1587
- metadata: {
1588
- openapi: {
1589
- operationId: string;
1590
- summary: string;
1591
- description: string;
1592
- responses: {
1593
- 200: {
1594
- description: string;
1595
- content: {
1596
- "application/json": {
1597
- schema: {
1598
- type: "object";
1599
- properties: {
1600
- success: {
1601
- type: string;
1602
- };
1603
- };
1604
- };
1605
- };
1606
- };
1607
- };
1608
- };
1609
- };
1610
- };
1611
- }, {
1612
- success: boolean;
1613
- }>;
1614
- removeUser: import("better-auth/*").StrictEndpoint<"/admin/remove-user", {
1615
- method: "POST";
1616
- body: import("better-auth/*").ZodObject<{
1617
- userId: import("better-auth/*").ZodCoercedString<unknown>;
1618
- }, import("better-auth/*").$strip>;
1619
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1620
- session: {
1621
- user: import("better-auth/plugins").UserWithRole;
1622
- session: import("better-auth/types").Session;
1623
- };
1624
- }>)[];
1625
- metadata: {
1626
- openapi: {
1627
- operationId: string;
1628
- summary: string;
1629
- description: string;
1630
- responses: {
1631
- 200: {
1632
- description: string;
1633
- content: {
1634
- "application/json": {
1635
- schema: {
1636
- type: "object";
1637
- properties: {
1638
- success: {
1639
- type: string;
1640
- };
1641
- };
1642
- };
1643
- };
1644
- };
1645
- };
1646
- };
1647
- };
1648
- };
1649
- }, {
1650
- success: boolean;
1651
- }>;
1652
- setUserPassword: import("better-auth/*").StrictEndpoint<"/admin/set-user-password", {
1653
- method: "POST";
1654
- body: import("better-auth/*").ZodObject<{
1655
- newPassword: import("better-auth/*").ZodString;
1656
- userId: import("better-auth/*").ZodCoercedString<unknown>;
1657
- }, import("better-auth/*").$strip>;
1658
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
1659
- session: {
1660
- user: import("better-auth/plugins").UserWithRole;
1661
- session: import("better-auth/types").Session;
1662
- };
1663
- }>)[];
1664
- metadata: {
1665
- openapi: {
1666
- operationId: string;
1667
- summary: string;
1668
- description: string;
1669
- responses: {
1670
- 200: {
1671
- description: string;
1672
- content: {
1673
- "application/json": {
1674
- schema: {
1675
- type: "object";
1676
- properties: {
1677
- status: {
1678
- type: string;
1679
- };
1680
- };
1681
- };
1682
- };
1683
- };
1684
- };
1685
- };
1686
- };
1687
- };
1688
- }, {
1689
- status: boolean;
1690
- }>;
1691
- userHasPermission: import("better-auth/*").StrictEndpoint<"/admin/has-permission", {
1692
- method: "POST";
1693
- body: import("better-auth/*").ZodIntersection<import("better-auth/*").ZodObject<{
1694
- userId: import("better-auth/*").ZodOptional<import("better-auth/*").ZodCoercedString<unknown>>;
1695
- role: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
1696
- }, import("better-auth/*").$strip>, import("better-auth/*").ZodUnion<readonly [import("better-auth/*").ZodObject<{
1697
- permission: import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>>;
1698
- permissions: import("better-auth/*").ZodUndefined;
1699
- }, import("better-auth/*").$strip>, import("better-auth/*").ZodObject<{
1700
- permission: import("better-auth/*").ZodUndefined;
1701
- permissions: import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>>;
1702
- }, import("better-auth/*").$strip>]>>;
1703
- metadata: {
1704
- openapi: {
1705
- description: string;
1706
- requestBody: {
1707
- content: {
1708
- "application/json": {
1709
- schema: {
1710
- type: "object";
1711
- properties: {
1712
- permission: {
1713
- type: string;
1714
- description: string;
1715
- deprecated: boolean;
1716
- };
1717
- permissions: {
1718
- type: string;
1719
- description: string;
1720
- };
1721
- };
1722
- required: string[];
1723
- };
1724
- };
1725
- };
1726
- };
1727
- responses: {
1728
- "200": {
1729
- description: string;
1730
- content: {
1731
- "application/json": {
1732
- schema: {
1733
- type: "object";
1734
- properties: {
1735
- error: {
1736
- type: string;
1737
- };
1738
- success: {
1739
- type: string;
1740
- };
1741
- };
1742
- required: string[];
1743
- };
1744
- };
1745
- };
1746
- };
1747
- };
1748
- };
1749
- $Infer: {
1750
- body: ({
1751
- permission: {
1752
- readonly user?: ("update" | "create" | "delete" | "list" | "get" | "set-role" | "ban" | "impersonate" | "set-password")[] | undefined;
1753
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1754
- };
1755
- permissions?: never | undefined;
1756
- } | {
1757
- permissions: {
1758
- readonly user?: ("update" | "create" | "delete" | "list" | "get" | "set-role" | "ban" | "impersonate" | "set-password")[] | undefined;
1759
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1760
- };
1761
- permission?: never | undefined;
1762
- }) & {
1763
- userId?: string | undefined;
1764
- role?: "user" | "admin" | "staff" | undefined;
1765
- };
1766
- };
1767
- };
1768
- }, {
1769
- error: null;
1770
- success: boolean;
1771
- }>;
1772
- };
1773
- $ERROR_CODES: {
1774
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
1775
- readonly USER_ALREADY_EXISTS: "User already exists.";
1776
- readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
1777
- readonly YOU_CANNOT_BAN_YOURSELF: "You cannot ban yourself";
1778
- readonly YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: "You are not allowed to change users role";
1779
- readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: "You are not allowed to create users";
1780
- readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: "You are not allowed to list users";
1781
- readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: "You are not allowed to list users sessions";
1782
- readonly YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: "You are not allowed to ban users";
1783
- readonly YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: "You are not allowed to impersonate users";
1784
- readonly YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: "You are not allowed to revoke users sessions";
1785
- readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: "You are not allowed to delete users";
1786
- readonly YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: "You are not allowed to set users password";
1787
- readonly BANNED_USER: "You have been banned from this application";
1788
- readonly YOU_ARE_NOT_ALLOWED_TO_GET_USER: "You are not allowed to get user";
1789
- readonly NO_DATA_TO_UPDATE: "No data to update";
1790
- readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users";
1791
- readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
1792
- readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
1793
- readonly YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins";
1794
- readonly INVALID_ROLE_TYPE: "Invalid role type";
1795
- };
1796
- schema: {
1797
- user: {
1798
- fields: {
1799
- role: {
1800
- type: "string";
1801
- required: false;
1802
- input: false;
1803
- };
1804
- banned: {
1805
- type: "boolean";
1806
- defaultValue: false;
1807
- required: false;
1808
- input: false;
1809
- };
1810
- banReason: {
1811
- type: "string";
1812
- required: false;
1813
- input: false;
1814
- };
1815
- banExpires: {
1816
- type: "date";
1817
- required: false;
1818
- input: false;
1819
- };
1820
- };
1821
- };
1822
- session: {
1823
- fields: {
1824
- impersonatedBy: {
1825
- type: "string";
1826
- required: false;
1827
- };
1828
- };
1829
- };
1830
- };
1831
- options: NoInfer<{
1832
- accessControl: {
1833
- newRole<K extends "user" | "session">(statements: import("better-auth/plugins").Subset<K, {
1834
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1835
- readonly session: readonly ["list", "revoke", "delete"];
1836
- }>): {
1837
- authorize<K_1 extends K>(request: K_1 extends infer T extends K_2 ? { [key in T]?: import("better-auth/plugins").Subset<K, {
1838
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1839
- readonly session: readonly ["list", "revoke", "delete"];
1840
- }>[key] | {
1841
- actions: import("better-auth/plugins").Subset<K, {
1842
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1843
- readonly session: readonly ["list", "revoke", "delete"];
1844
- }>[key];
1845
- connector: "OR" | "AND";
1846
- } | undefined; } : never, connector?: "OR" | "AND"): import("better-auth/plugins").AuthorizeResponse;
1847
- statements: import("better-auth/plugins").Subset<K, {
1848
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1849
- readonly session: readonly ["list", "revoke", "delete"];
1850
- }>;
1851
- };
1852
- statements: {
1853
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1854
- readonly session: readonly ["list", "revoke", "delete"];
1855
- };
1856
- };
1857
- roles: {
1858
- admin: {
1859
- authorize<K_1 extends "user" | "session">(request: K_1 extends infer T extends K ? { [key in T]?: import("better-auth/plugins").Subset<"user" | "session", {
1860
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1861
- readonly session: readonly ["list", "revoke", "delete"];
1862
- }>[key] | {
1863
- actions: import("better-auth/plugins").Subset<"user" | "session", {
1864
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1865
- readonly session: readonly ["list", "revoke", "delete"];
1866
- }>[key];
1867
- connector: "OR" | "AND";
1868
- } | undefined; } : never, connector?: "OR" | "AND"): import("better-auth/plugins").AuthorizeResponse;
1869
- statements: import("better-auth/plugins").Subset<"user" | "session", {
1870
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1871
- readonly session: readonly ["list", "revoke", "delete"];
1872
- }>;
1873
- };
1874
- user: {
1875
- authorize<K_1 extends "user" | "session">(request: K_1 extends infer T extends K ? { [key in T]?: import("better-auth/plugins").Subset<"user" | "session", {
1876
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1877
- readonly session: readonly ["list", "revoke", "delete"];
1878
- }>[key] | {
1879
- actions: import("better-auth/plugins").Subset<"user" | "session", {
1880
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1881
- readonly session: readonly ["list", "revoke", "delete"];
1882
- }>[key];
1883
- connector: "OR" | "AND";
1884
- } | undefined; } : never, connector?: "OR" | "AND"): import("better-auth/plugins").AuthorizeResponse;
1885
- statements: import("better-auth/plugins").Subset<"user" | "session", {
1886
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1887
- readonly session: readonly ["list", "revoke", "delete"];
1888
- }>;
1889
- };
1890
- staff: {
1891
- authorize<K_1 extends "user">(request: K_1 extends infer T extends K ? { [key in T]?: import("better-auth/plugins").Subset<"user", {
1892
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1893
- readonly session: readonly ["list", "revoke", "delete"];
1894
- }>[key] | {
1895
- actions: import("better-auth/plugins").Subset<"user", {
1896
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1897
- readonly session: readonly ["list", "revoke", "delete"];
1898
- }>[key];
1899
- connector: "OR" | "AND";
1900
- } | undefined; } : never, connector?: "OR" | "AND"): import("better-auth/plugins").AuthorizeResponse;
1901
- statements: import("better-auth/plugins").Subset<"user", {
1902
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1903
- readonly session: readonly ["list", "revoke", "delete"];
1904
- }>;
1905
- };
1906
- };
1907
- }>;
1908
- } | (C["$auth"] extends {
1909
- plugins: any;
1910
- } ? C["$auth"]["plugins"] : [])[number])[];
1911
- database: (options: import("better-auth/types").BetterAuthOptions) => import("better-auth/types").DBAdapter<import("better-auth/types").BetterAuthOptions>;
1912
- baseURL: any;
1913
- rateLimit: {
1914
- readonly enabled: boolean;
1915
- readonly window: 10;
1916
- readonly max: 30;
1917
- };
1918
- trustedOrigins: string[];
1919
- session: {
1920
- readonly modelName: "authSessions";
1921
- };
1922
- account: {
1923
- readonly modelName: "authAccounts";
1924
- };
1925
- verification: {
1926
- readonly modelName: "authVerifications";
1927
- };
1928
- user: {
1929
- readonly modelName: "authUsers";
1930
- readonly changeEmail: {
1931
- readonly enabled: true;
1932
- };
1933
- readonly deleteUser: {
1934
- readonly enabled: true;
1935
- };
1936
- readonly additionalFields: {
1937
- readonly type: {
1938
- readonly type: "string";
1939
- readonly required: true;
1940
- };
1941
- };
1942
- };
1943
- hooks: {
1944
- readonly before: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<unknown>;
1945
- readonly after: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<unknown>;
1946
- };
1947
- emailAndPassword: {
1948
- readonly enabled: true;
1949
- readonly sendResetPassword: (data: {
1950
- user: any;
1951
- url: string;
1952
- }) => Promise<void>;
1953
- };
1954
- }>;
1955
- readonly adapter: import("../../../adapter-sqlite/index.server.js").Adapter;
1956
- readonly config: {
1957
- readonly raw: BuildConfig<C>;
1958
- readonly collections: InferCollections<C>;
1959
- readonly areas: InferAreas<C>;
1960
- getDefaultLocale(): string | undefined;
1961
- getLocalesCodes: () => string[];
1962
- isValidLocale: (locale: string) => boolean;
1963
- getArea: (slug: string) => import("../types.js").BuiltArea;
1964
- getCollection: (slug: string) => import("../types.js").BuiltCollection;
1965
- getBySlug: (slug: string) => import("../types.js").BuiltArea | import("../types.js").BuiltCollection;
1966
- isCollection: (slug?: string) => slug is import("../../types/doc.js").CollectionSlug;
1967
- isArea: (slug?: string) => slug is import("../../types/doc.js").AreaSlug;
1968
- getDocumentPrototype(slug: import("../../types/doc.js").PrototypeSlug): "area" | "collection";
1969
- };
1970
- readonly plugins: InferPluginsServer<C>;
1971
- readonly createRimeContext: (event: import("@sveltejs/kit").RequestEvent) => {
1972
- logger: {
1973
- setLevel: (level: any) => void;
1974
- getLevel: () => string | undefined;
1975
- trace: (...args: any[]) => void;
1976
- debug: (...args: any[]) => void;
1977
- info: (...args: any[]) => void;
1978
- warn: (...args: any[]) => void;
1979
- error: (...args: any[]) => void;
1980
- };
1981
- } & {
1982
- cache: import("../../plugins/cache/index.server.js").CacheActions;
1983
- sse: import("../../plugins/sse/index.server.js").SSEActions;
1984
- } & (C["$smtp"] extends SMTPConfig ? {
1985
- mailer: import("../../plugins/mailer/index.server.js").MailerActions;
1986
- } : Record<string, never>) & ExtractCustomPlugins<C> & {
1987
- readonly auth: import("better-auth/types").Auth<{
1988
- plugins: ({
1989
- id: "api-key";
1990
- $ERROR_CODES: {
1991
- readonly INVALID_METADATA_TYPE: "metadata must be an object or undefined";
1992
- readonly REFILL_AMOUNT_AND_INTERVAL_REQUIRED: "refillAmount is required when refillInterval is provided";
1993
- readonly REFILL_INTERVAL_AND_AMOUNT_REQUIRED: "refillInterval is required when refillAmount is provided";
1994
- readonly USER_BANNED: "User is banned";
1995
- readonly UNAUTHORIZED_SESSION: "Unauthorized or invalid session";
1996
- readonly KEY_NOT_FOUND: "API Key not found";
1997
- readonly KEY_DISABLED: "API Key is disabled";
1998
- readonly KEY_EXPIRED: "API Key has expired";
1999
- readonly USAGE_EXCEEDED: "API Key has reached its usage limit";
2000
- readonly KEY_NOT_RECOVERABLE: "API Key is not recoverable";
2001
- readonly EXPIRES_IN_IS_TOO_SMALL: "The expiresIn is smaller than the predefined minimum value.";
2002
- readonly EXPIRES_IN_IS_TOO_LARGE: "The expiresIn is larger than the predefined maximum value.";
2003
- readonly INVALID_REMAINING: "The remaining count is either too large or too small.";
2004
- readonly INVALID_PREFIX_LENGTH: "The prefix length is either too large or too small.";
2005
- readonly INVALID_NAME_LENGTH: "The name length is either too large or too small.";
2006
- readonly METADATA_DISABLED: "Metadata is disabled.";
2007
- readonly RATE_LIMIT_EXCEEDED: "Rate limit exceeded.";
2008
- readonly NO_VALUES_TO_UPDATE: "No values to update.";
2009
- readonly KEY_DISABLED_EXPIRATION: "Custom key expiration values are disabled.";
2010
- readonly INVALID_API_KEY: "Invalid API key.";
2011
- readonly INVALID_USER_ID_FROM_API_KEY: "The user id from the API key is invalid.";
2012
- readonly INVALID_API_KEY_GETTER_RETURN_TYPE: "API Key getter returned an invalid key type. Expected string.";
2013
- readonly SERVER_ONLY_PROPERTY: "The property you're trying to set can only be set from the server auth instance only.";
2014
- readonly FAILED_TO_UPDATE_API_KEY: "Failed to update API key";
2015
- readonly NAME_REQUIRED: "API Key name is required.";
2016
- };
2017
- hooks: {
2018
- before: {
2019
- matcher: (ctx: import("better-auth/*").HookEndpointContext) => boolean;
2020
- handler: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
2021
- user: {
2022
- id: string;
2023
- createdAt: Date;
2024
- updatedAt: Date;
2025
- email: string;
2026
- emailVerified: boolean;
2027
- name: string;
2028
- image?: string | null | undefined;
2029
- };
2030
- session: {
2031
- id: string;
2032
- token: string;
2033
- userId: string;
2034
- userAgent: string | null;
2035
- ipAddress: string | null;
2036
- createdAt: Date;
2037
- updatedAt: Date;
2038
- expiresAt: Date;
2039
- };
2040
- } | {
2041
- context: import("better-auth/*").MiddlewareContext<import("better-auth/*").MiddlewareOptions, {
2042
- returned?: unknown | undefined;
2043
- responseHeaders?: Headers | undefined;
2044
- } & import("better-auth/*").PluginContext & import("better-auth/*").InfoContext & {
2045
- options: import("better-auth/types").BetterAuthOptions;
2046
- appName: string;
2047
- baseURL: string;
2048
- trustedOrigins: string[];
2049
- isTrustedOrigin: (url: string, settings?: {
2050
- allowRelativePaths: boolean;
2051
- }) => boolean;
2052
- oauthConfig: {
2053
- skipStateCookieCheck?: boolean | undefined;
2054
- storeStateStrategy: "database" | "cookie";
2055
- };
2056
- newSession: {
2057
- session: import("better-auth/types").Session & Record<string, any>;
2058
- user: import("better-auth/types").User & Record<string, any>;
2059
- } | null;
2060
- session: {
2061
- session: import("better-auth/types").Session & Record<string, any>;
2062
- user: import("better-auth/types").User & Record<string, any>;
2063
- } | null;
2064
- setNewSession: (session: {
2065
- session: import("better-auth/types").Session & Record<string, any>;
2066
- user: import("better-auth/types").User & Record<string, any>;
2067
- } | null) => void;
2068
- socialProviders: import("better-auth/*").OAuthProvider[];
2069
- authCookies: import("better-auth/types").BetterAuthCookies;
2070
- logger: ReturnType<(options?: import("better-auth/*").Logger | undefined) => import("better-auth/*").InternalLogger>;
2071
- rateLimit: {
2072
- enabled: boolean;
2073
- window: number;
2074
- max: number;
2075
- storage: "memory" | "database" | "secondary-storage";
2076
- } & Omit<import("better-auth/types").BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
2077
- adapter: import("better-auth/types").DBAdapter<import("better-auth/types").BetterAuthOptions>;
2078
- internalAdapter: import("better-auth/*").InternalAdapter<import("better-auth/types").BetterAuthOptions>;
2079
- createAuthCookie: (cookieName: string, overrideAttributes?: Partial<import("better-auth/*").CookieOptions> | undefined) => import("better-auth/*").BetterAuthCookie;
2080
- secret: string;
2081
- sessionConfig: {
2082
- updateAge: number;
2083
- expiresIn: number;
2084
- freshAge: number;
2085
- cookieRefreshCache: false | {
2086
- enabled: true;
2087
- updateAge: number;
2088
- };
2089
- };
2090
- generateId: (options: {
2091
- model: import("better-auth/db").ModelNames;
2092
- size?: number | undefined;
2093
- }) => string | false;
2094
- secondaryStorage: import("better-auth/db").SecondaryStorage | undefined;
2095
- password: {
2096
- hash: (password: string) => Promise<string>;
2097
- verify: (data: {
2098
- password: string;
2099
- hash: string;
2100
- }) => Promise<boolean>;
2101
- config: {
2102
- minPasswordLength: number;
2103
- maxPasswordLength: number;
2104
- };
2105
- checkPassword: (userId: string, ctx: import("better-auth/*").GenericEndpointContext<import("better-auth/types").BetterAuthOptions>) => Promise<boolean>;
2106
- };
2107
- tables: import("better-auth/db").BetterAuthDBSchema;
2108
- runMigrations: () => Promise<void>;
2109
- publishTelemetry: (event: {
2110
- type: string;
2111
- anonymousId?: string | undefined;
2112
- payload: Record<string, any>;
2113
- }) => Promise<void>;
2114
- skipOriginCheck: boolean | string[];
2115
- skipCSRFCheck: boolean;
2116
- runInBackground: (promise: Promise<unknown>) => void;
2117
- runInBackgroundOrAwait: (promise: Promise<unknown> | void) => import("better-auth/*").Awaitable<unknown>;
2118
- }>;
2119
- }>;
2120
- }[];
2121
- };
2122
- endpoints: {
2123
- createApiKey: import("better-auth/*").StrictEndpoint<"/api-key/create", {
2124
- method: "POST";
2125
- body: import("better-auth/*").ZodObject<{
2126
- name: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
2127
- expiresIn: import("better-auth/*").ZodDefault<import("better-auth/*").ZodNullable<import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>>>;
2128
- userId: import("better-auth/*").ZodOptional<import("better-auth/*").ZodCoercedString<unknown>>;
2129
- prefix: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
2130
- remaining: import("better-auth/*").ZodDefault<import("better-auth/*").ZodNullable<import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>>>;
2131
- metadata: import("better-auth/*").ZodOptional<import("better-auth/*").ZodAny>;
2132
- refillAmount: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
2133
- refillInterval: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
2134
- rateLimitTimeWindow: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
2135
- rateLimitMax: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
2136
- rateLimitEnabled: import("better-auth/*").ZodOptional<import("better-auth/*").ZodBoolean>;
2137
- permissions: import("better-auth/*").ZodOptional<import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>>>;
2138
- }, import("better-auth/*").$strip>;
2139
- metadata: {
2140
- openapi: {
2141
- description: string;
2142
- responses: {
2143
- "200": {
2144
- description: string;
2145
- content: {
2146
- "application/json": {
2147
- schema: {
2148
- type: "object";
2149
- properties: {
2150
- id: {
2151
- type: string;
2152
- description: string;
2153
- };
2154
- createdAt: {
2155
- type: string;
2156
- format: string;
2157
- description: string;
2158
- };
2159
- updatedAt: {
2160
- type: string;
2161
- format: string;
2162
- description: string;
2163
- };
2164
- name: {
2165
- type: string;
2166
- nullable: boolean;
2167
- description: string;
2168
- };
2169
- prefix: {
2170
- type: string;
2171
- nullable: boolean;
2172
- description: string;
2173
- };
2174
- start: {
2175
- type: string;
2176
- nullable: boolean;
2177
- description: string;
2178
- };
2179
- key: {
2180
- type: string;
2181
- description: string;
2182
- };
2183
- enabled: {
2184
- type: string;
2185
- description: string;
2186
- };
2187
- expiresAt: {
2188
- type: string;
2189
- format: string;
2190
- nullable: boolean;
2191
- description: string;
2192
- };
2193
- userId: {
2194
- type: string;
2195
- description: string;
2196
- };
2197
- lastRefillAt: {
2198
- type: string;
2199
- format: string;
2200
- nullable: boolean;
2201
- description: string;
2202
- };
2203
- lastRequest: {
2204
- type: string;
2205
- format: string;
2206
- nullable: boolean;
2207
- description: string;
2208
- };
2209
- metadata: {
2210
- type: string;
2211
- nullable: boolean;
2212
- additionalProperties: boolean;
2213
- description: string;
2214
- };
2215
- rateLimitMax: {
2216
- type: string;
2217
- nullable: boolean;
2218
- description: string;
2219
- };
2220
- rateLimitTimeWindow: {
2221
- type: string;
2222
- nullable: boolean;
2223
- description: string;
2224
- };
2225
- remaining: {
2226
- type: string;
2227
- nullable: boolean;
2228
- description: string;
2229
- };
2230
- refillAmount: {
2231
- type: string;
2232
- nullable: boolean;
2233
- description: string;
2234
- };
2235
- refillInterval: {
2236
- type: string;
2237
- nullable: boolean;
2238
- description: string;
2239
- };
2240
- rateLimitEnabled: {
2241
- type: string;
2242
- description: string;
2243
- };
2244
- requestCount: {
2245
- type: string;
2246
- description: string;
2247
- };
2248
- permissions: {
2249
- type: string;
2250
- nullable: boolean;
2251
- additionalProperties: {
2252
- type: string;
2253
- items: {
2254
- type: string;
2255
- };
2256
- };
2257
- description: string;
2258
- };
2259
- };
2260
- required: string[];
2261
- };
2262
- };
2263
- };
2264
- };
2265
- };
2266
- };
2267
- };
2268
- }, {
2269
- key: string;
2270
- metadata: any;
2271
- permissions: any;
2272
- id: string;
2273
- name: string | null;
2274
- start: string | null;
2275
- prefix: string | null;
2276
- userId: string;
2277
- refillInterval: number | null;
2278
- refillAmount: number | null;
2279
- lastRefillAt: Date | null;
2280
- enabled: boolean;
2281
- rateLimitEnabled: boolean;
2282
- rateLimitTimeWindow: number | null;
2283
- rateLimitMax: number | null;
2284
- requestCount: number;
2285
- remaining: number | null;
2286
- lastRequest: Date | null;
2287
- expiresAt: Date | null;
2288
- createdAt: Date;
2289
- updatedAt: Date;
2290
- }>;
2291
- verifyApiKey: import("better-auth/*").StrictEndpoint<string, {
2292
- method: "POST";
2293
- body: import("better-auth/*").ZodObject<{
2294
- key: import("better-auth/*").ZodString;
2295
- permissions: import("better-auth/*").ZodOptional<import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>>>;
2296
- }, import("better-auth/*").$strip>;
2297
- }, {
2298
- valid: boolean;
2299
- error: {
2300
- message: "Invalid API key.";
2301
- code: "KEY_NOT_FOUND";
2302
- };
2303
- key: null;
2304
- } | {
2305
- valid: boolean;
2306
- error: {
2307
- message: string | undefined;
2308
- code: string;
2309
- cause?: unknown;
2310
- };
2311
- key: null;
2312
- } | {
2313
- valid: boolean;
2314
- error: {
2315
- message: "Invalid API key.";
2316
- code: "INVALID_API_KEY";
2317
- };
2318
- key: null;
2319
- } | {
2320
- valid: boolean;
2321
- error: null;
2322
- key: Omit<import("better-auth/plugins").ApiKey, "key"> | null;
2323
- }>;
2324
- getApiKey: import("better-auth/*").StrictEndpoint<"/api-key/get", {
2325
- method: "GET";
2326
- query: import("better-auth/*").ZodObject<{
2327
- id: import("better-auth/*").ZodString;
2328
- }, import("better-auth/*").$strip>;
2329
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
2330
- session: {
2331
- session: Record<string, any> & {
2332
- id: string;
2333
- createdAt: Date;
2334
- updatedAt: Date;
2335
- userId: string;
2336
- expiresAt: Date;
2337
- token: string;
2338
- ipAddress?: string | null | undefined;
2339
- userAgent?: string | null | undefined;
2340
- };
2341
- user: Record<string, any> & {
2342
- id: string;
2343
- createdAt: Date;
2344
- updatedAt: Date;
2345
- email: string;
2346
- emailVerified: boolean;
2347
- name: string;
2348
- image?: string | null | undefined;
2349
- };
2350
- };
2351
- }>)[];
2352
- metadata: {
2353
- openapi: {
2354
- description: string;
2355
- responses: {
2356
- "200": {
2357
- description: string;
2358
- content: {
2359
- "application/json": {
2360
- schema: {
2361
- type: "object";
2362
- properties: {
2363
- id: {
2364
- type: string;
2365
- description: string;
2366
- };
2367
- name: {
2368
- type: string;
2369
- nullable: boolean;
2370
- description: string;
2371
- };
2372
- start: {
2373
- type: string;
2374
- nullable: boolean;
2375
- description: string;
2376
- };
2377
- prefix: {
2378
- type: string;
2379
- nullable: boolean;
2380
- description: string;
2381
- };
2382
- userId: {
2383
- type: string;
2384
- description: string;
2385
- };
2386
- refillInterval: {
2387
- type: string;
2388
- nullable: boolean;
2389
- description: string;
2390
- };
2391
- refillAmount: {
2392
- type: string;
2393
- nullable: boolean;
2394
- description: string;
2395
- };
2396
- lastRefillAt: {
2397
- type: string;
2398
- format: string;
2399
- nullable: boolean;
2400
- description: string;
2401
- };
2402
- enabled: {
2403
- type: string;
2404
- description: string;
2405
- default: boolean;
2406
- };
2407
- rateLimitEnabled: {
2408
- type: string;
2409
- description: string;
2410
- };
2411
- rateLimitTimeWindow: {
2412
- type: string;
2413
- nullable: boolean;
2414
- description: string;
2415
- };
2416
- rateLimitMax: {
2417
- type: string;
2418
- nullable: boolean;
2419
- description: string;
2420
- };
2421
- requestCount: {
2422
- type: string;
2423
- description: string;
2424
- };
2425
- remaining: {
2426
- type: string;
2427
- nullable: boolean;
2428
- description: string;
2429
- };
2430
- lastRequest: {
2431
- type: string;
2432
- format: string;
2433
- nullable: boolean;
2434
- description: string;
2435
- };
2436
- expiresAt: {
2437
- type: string;
2438
- format: string;
2439
- nullable: boolean;
2440
- description: string;
2441
- };
2442
- createdAt: {
2443
- type: string;
2444
- format: string;
2445
- description: string;
2446
- };
2447
- updatedAt: {
2448
- type: string;
2449
- format: string;
2450
- description: string;
2451
- };
2452
- metadata: {
2453
- type: string;
2454
- nullable: boolean;
2455
- additionalProperties: boolean;
2456
- description: string;
2457
- };
2458
- permissions: {
2459
- type: string;
2460
- nullable: boolean;
2461
- description: string;
2462
- };
2463
- };
2464
- required: string[];
2465
- };
2466
- };
2467
- };
2468
- };
2469
- };
2470
- };
2471
- };
2472
- }, {
2473
- metadata: Record<string, any> | null;
2474
- permissions: {
2475
- [key: string]: string[];
2476
- } | null;
2477
- id: string;
2478
- name: string | null;
2479
- start: string | null;
2480
- prefix: string | null;
2481
- userId: string;
2482
- refillInterval: number | null;
2483
- refillAmount: number | null;
2484
- lastRefillAt: Date | null;
2485
- enabled: boolean;
2486
- rateLimitEnabled: boolean;
2487
- rateLimitTimeWindow: number | null;
2488
- rateLimitMax: number | null;
2489
- requestCount: number;
2490
- remaining: number | null;
2491
- lastRequest: Date | null;
2492
- expiresAt: Date | null;
2493
- createdAt: Date;
2494
- updatedAt: Date;
2495
- }>;
2496
- updateApiKey: import("better-auth/*").StrictEndpoint<"/api-key/update", {
2497
- method: "POST";
2498
- body: import("better-auth/*").ZodObject<{
2499
- keyId: import("better-auth/*").ZodString;
2500
- userId: import("better-auth/*").ZodOptional<import("better-auth/*").ZodCoercedString<unknown>>;
2501
- name: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
2502
- enabled: import("better-auth/*").ZodOptional<import("better-auth/*").ZodBoolean>;
2503
- remaining: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
2504
- refillAmount: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
2505
- refillInterval: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
2506
- metadata: import("better-auth/*").ZodOptional<import("better-auth/*").ZodAny>;
2507
- expiresIn: import("better-auth/*").ZodNullable<import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>>;
2508
- rateLimitEnabled: import("better-auth/*").ZodOptional<import("better-auth/*").ZodBoolean>;
2509
- rateLimitTimeWindow: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
2510
- rateLimitMax: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
2511
- permissions: import("better-auth/*").ZodNullable<import("better-auth/*").ZodOptional<import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>>>>;
2512
- }, import("better-auth/*").$strip>;
2513
- metadata: {
2514
- openapi: {
2515
- description: string;
2516
- responses: {
2517
- "200": {
2518
- description: string;
2519
- content: {
2520
- "application/json": {
2521
- schema: {
2522
- type: "object";
2523
- properties: {
2524
- id: {
2525
- type: string;
2526
- description: string;
2527
- };
2528
- name: {
2529
- type: string;
2530
- nullable: boolean;
2531
- description: string;
2532
- };
2533
- start: {
2534
- type: string;
2535
- nullable: boolean;
2536
- description: string;
2537
- };
2538
- prefix: {
2539
- type: string;
2540
- nullable: boolean;
2541
- description: string;
2542
- };
2543
- userId: {
2544
- type: string;
2545
- description: string;
2546
- };
2547
- refillInterval: {
2548
- type: string;
2549
- nullable: boolean;
2550
- description: string;
2551
- };
2552
- refillAmount: {
2553
- type: string;
2554
- nullable: boolean;
2555
- description: string;
2556
- };
2557
- lastRefillAt: {
2558
- type: string;
2559
- format: string;
2560
- nullable: boolean;
2561
- description: string;
2562
- };
2563
- enabled: {
2564
- type: string;
2565
- description: string;
2566
- default: boolean;
2567
- };
2568
- rateLimitEnabled: {
2569
- type: string;
2570
- description: string;
2571
- };
2572
- rateLimitTimeWindow: {
2573
- type: string;
2574
- nullable: boolean;
2575
- description: string;
2576
- };
2577
- rateLimitMax: {
2578
- type: string;
2579
- nullable: boolean;
2580
- description: string;
2581
- };
2582
- requestCount: {
2583
- type: string;
2584
- description: string;
2585
- };
2586
- remaining: {
2587
- type: string;
2588
- nullable: boolean;
2589
- description: string;
2590
- };
2591
- lastRequest: {
2592
- type: string;
2593
- format: string;
2594
- nullable: boolean;
2595
- description: string;
2596
- };
2597
- expiresAt: {
2598
- type: string;
2599
- format: string;
2600
- nullable: boolean;
2601
- description: string;
2602
- };
2603
- createdAt: {
2604
- type: string;
2605
- format: string;
2606
- description: string;
2607
- };
2608
- updatedAt: {
2609
- type: string;
2610
- format: string;
2611
- description: string;
2612
- };
2613
- metadata: {
2614
- type: string;
2615
- nullable: boolean;
2616
- additionalProperties: boolean;
2617
- description: string;
2618
- };
2619
- permissions: {
2620
- type: string;
2621
- nullable: boolean;
2622
- description: string;
2623
- };
2624
- };
2625
- required: string[];
2626
- };
2627
- };
2628
- };
2629
- };
2630
- };
2631
- };
2632
- };
2633
- }, {
2634
- metadata: Record<string, any> | null;
2635
- permissions: {
2636
- [key: string]: string[];
2637
- } | null;
2638
- id: string;
2639
- name: string | null;
2640
- start: string | null;
2641
- prefix: string | null;
2642
- userId: string;
2643
- refillInterval: number | null;
2644
- refillAmount: number | null;
2645
- lastRefillAt: Date | null;
2646
- enabled: boolean;
2647
- rateLimitEnabled: boolean;
2648
- rateLimitTimeWindow: number | null;
2649
- rateLimitMax: number | null;
2650
- requestCount: number;
2651
- remaining: number | null;
2652
- lastRequest: Date | null;
2653
- expiresAt: Date | null;
2654
- createdAt: Date;
2655
- updatedAt: Date;
2656
- }>;
2657
- deleteApiKey: import("better-auth/*").StrictEndpoint<"/api-key/delete", {
2658
- method: "POST";
2659
- body: import("better-auth/*").ZodObject<{
2660
- keyId: import("better-auth/*").ZodString;
2661
- }, import("better-auth/*").$strip>;
2662
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
2663
- session: {
2664
- session: Record<string, any> & {
2665
- id: string;
2666
- createdAt: Date;
2667
- updatedAt: Date;
2668
- userId: string;
2669
- expiresAt: Date;
2670
- token: string;
2671
- ipAddress?: string | null | undefined;
2672
- userAgent?: string | null | undefined;
2673
- };
2674
- user: Record<string, any> & {
2675
- id: string;
2676
- createdAt: Date;
2677
- updatedAt: Date;
2678
- email: string;
2679
- emailVerified: boolean;
2680
- name: string;
2681
- image?: string | null | undefined;
2682
- };
2683
- };
2684
- }>)[];
2685
- metadata: {
2686
- openapi: {
2687
- description: string;
2688
- requestBody: {
2689
- content: {
2690
- "application/json": {
2691
- schema: {
2692
- type: "object";
2693
- properties: {
2694
- keyId: {
2695
- type: string;
2696
- description: string;
2697
- };
2698
- };
2699
- required: string[];
2700
- };
2701
- };
2702
- };
2703
- };
2704
- responses: {
2705
- "200": {
2706
- description: string;
2707
- content: {
2708
- "application/json": {
2709
- schema: {
2710
- type: "object";
2711
- properties: {
2712
- success: {
2713
- type: string;
2714
- description: string;
2715
- };
2716
- };
2717
- required: string[];
2718
- };
2719
- };
2720
- };
2721
- };
2722
- };
2723
- };
2724
- };
2725
- }, {
2726
- success: boolean;
2727
- }>;
2728
- listApiKeys: import("better-auth/*").StrictEndpoint<"/api-key/list", {
2729
- method: "GET";
2730
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
2731
- session: {
2732
- session: Record<string, any> & {
2733
- id: string;
2734
- createdAt: Date;
2735
- updatedAt: Date;
2736
- userId: string;
2737
- expiresAt: Date;
2738
- token: string;
2739
- ipAddress?: string | null | undefined;
2740
- userAgent?: string | null | undefined;
2741
- };
2742
- user: Record<string, any> & {
2743
- id: string;
2744
- createdAt: Date;
2745
- updatedAt: Date;
2746
- email: string;
2747
- emailVerified: boolean;
2748
- name: string;
2749
- image?: string | null | undefined;
2750
- };
2751
- };
2752
- }>)[];
2753
- metadata: {
2754
- openapi: {
2755
- description: string;
2756
- responses: {
2757
- "200": {
2758
- description: string;
2759
- content: {
2760
- "application/json": {
2761
- schema: {
2762
- type: "array";
2763
- items: {
2764
- type: string;
2765
- properties: {
2766
- id: {
2767
- type: string;
2768
- description: string;
2769
- };
2770
- name: {
2771
- type: string;
2772
- nullable: boolean;
2773
- description: string;
2774
- };
2775
- start: {
2776
- type: string;
2777
- nullable: boolean;
2778
- description: string;
2779
- };
2780
- prefix: {
2781
- type: string;
2782
- nullable: boolean;
2783
- description: string;
2784
- };
2785
- userId: {
2786
- type: string;
2787
- description: string;
2788
- };
2789
- refillInterval: {
2790
- type: string;
2791
- nullable: boolean;
2792
- description: string;
2793
- };
2794
- refillAmount: {
2795
- type: string;
2796
- nullable: boolean;
2797
- description: string;
2798
- };
2799
- lastRefillAt: {
2800
- type: string;
2801
- format: string;
2802
- nullable: boolean;
2803
- description: string;
2804
- };
2805
- enabled: {
2806
- type: string;
2807
- description: string;
2808
- default: boolean;
2809
- };
2810
- rateLimitEnabled: {
2811
- type: string;
2812
- description: string;
2813
- };
2814
- rateLimitTimeWindow: {
2815
- type: string;
2816
- nullable: boolean;
2817
- description: string;
2818
- };
2819
- rateLimitMax: {
2820
- type: string;
2821
- nullable: boolean;
2822
- description: string;
2823
- };
2824
- requestCount: {
2825
- type: string;
2826
- description: string;
2827
- };
2828
- remaining: {
2829
- type: string;
2830
- nullable: boolean;
2831
- description: string;
2832
- };
2833
- lastRequest: {
2834
- type: string;
2835
- format: string;
2836
- nullable: boolean;
2837
- description: string;
2838
- };
2839
- expiresAt: {
2840
- type: string;
2841
- format: string;
2842
- nullable: boolean;
2843
- description: string;
2844
- };
2845
- createdAt: {
2846
- type: string;
2847
- format: string;
2848
- description: string;
2849
- };
2850
- updatedAt: {
2851
- type: string;
2852
- format: string;
2853
- description: string;
2854
- };
2855
- metadata: {
2856
- type: string;
2857
- nullable: boolean;
2858
- additionalProperties: boolean;
2859
- description: string;
2860
- };
2861
- permissions: {
2862
- type: string;
2863
- nullable: boolean;
2864
- description: string;
2865
- };
2866
- };
2867
- required: string[];
2868
- };
2869
- };
2870
- };
2871
- };
2872
- };
2873
- };
2874
- };
2875
- };
2876
- }, {
2877
- metadata: Record<string, any> | null;
2878
- permissions: {
2879
- [key: string]: string[];
2880
- } | null;
2881
- id: string;
2882
- name: string | null;
2883
- start: string | null;
2884
- prefix: string | null;
2885
- userId: string;
2886
- refillInterval: number | null;
2887
- refillAmount: number | null;
2888
- lastRefillAt: Date | null;
2889
- enabled: boolean;
2890
- rateLimitEnabled: boolean;
2891
- rateLimitTimeWindow: number | null;
2892
- rateLimitMax: number | null;
2893
- requestCount: number;
2894
- remaining: number | null;
2895
- lastRequest: Date | null;
2896
- expiresAt: Date | null;
2897
- createdAt: Date;
2898
- updatedAt: Date;
2899
- }[]>;
2900
- deleteAllExpiredApiKeys: import("better-auth/*").StrictEndpoint<string, {
2901
- method: "POST";
2902
- }, {
2903
- success: boolean;
2904
- error: unknown;
2905
- }>;
2906
- };
2907
- schema: {
2908
- apikey: {
2909
- fields: {
2910
- name: {
2911
- type: "string";
2912
- required: false;
2913
- input: false;
2914
- };
2915
- start: {
2916
- type: "string";
2917
- required: false;
2918
- input: false;
2919
- };
2920
- prefix: {
2921
- type: "string";
2922
- required: false;
2923
- input: false;
2924
- };
2925
- key: {
2926
- type: "string";
2927
- required: true;
2928
- input: false;
2929
- index: true;
2930
- };
2931
- userId: {
2932
- type: "string";
2933
- references: {
2934
- model: string;
2935
- field: string;
2936
- onDelete: "cascade";
2937
- };
2938
- required: true;
2939
- input: false;
2940
- index: true;
2941
- };
2942
- refillInterval: {
2943
- type: "number";
2944
- required: false;
2945
- input: false;
2946
- };
2947
- refillAmount: {
2948
- type: "number";
2949
- required: false;
2950
- input: false;
2951
- };
2952
- lastRefillAt: {
2953
- type: "date";
2954
- required: false;
2955
- input: false;
2956
- };
2957
- enabled: {
2958
- type: "boolean";
2959
- required: false;
2960
- input: false;
2961
- defaultValue: true;
2962
- };
2963
- rateLimitEnabled: {
2964
- type: "boolean";
2965
- required: false;
2966
- input: false;
2967
- defaultValue: true;
2968
- };
2969
- rateLimitTimeWindow: {
2970
- type: "number";
2971
- required: false;
2972
- input: false;
2973
- defaultValue: number;
2974
- };
2975
- rateLimitMax: {
2976
- type: "number";
2977
- required: false;
2978
- input: false;
2979
- defaultValue: number;
2980
- };
2981
- requestCount: {
2982
- type: "number";
2983
- required: false;
2984
- input: false;
2985
- defaultValue: number;
2986
- };
2987
- remaining: {
2988
- type: "number";
2989
- required: false;
2990
- input: false;
2991
- };
2992
- lastRequest: {
2993
- type: "date";
2994
- required: false;
2995
- input: false;
2996
- };
2997
- expiresAt: {
2998
- type: "date";
2999
- required: false;
3000
- input: false;
3001
- };
3002
- createdAt: {
3003
- type: "date";
3004
- required: true;
3005
- input: false;
3006
- };
3007
- updatedAt: {
3008
- type: "date";
3009
- required: true;
3010
- input: false;
3011
- };
3012
- permissions: {
3013
- type: "string";
3014
- required: false;
3015
- input: false;
3016
- };
3017
- metadata: {
3018
- type: "string";
3019
- required: false;
3020
- input: true;
3021
- transform: {
3022
- input(value: import("better-auth/db").DBPrimitive): string;
3023
- output(value: import("better-auth/db").DBPrimitive): any;
3024
- };
3025
- };
3026
- };
3027
- };
3028
- };
3029
- options: import("better-auth/plugins").ApiKeyOptions | undefined;
3030
- } | {
3031
- id: "admin";
3032
- init(): {
3033
- options: {
3034
- databaseHooks: {
3035
- user: {
3036
- create: {
3037
- before(user: {
3038
- id: string;
3039
- createdAt: Date;
3040
- updatedAt: Date;
3041
- email: string;
3042
- emailVerified: boolean;
3043
- name: string;
3044
- image?: string | null | undefined;
3045
- } & Record<string, unknown>): Promise<{
3046
- data: {
3047
- id: string;
3048
- createdAt: Date;
3049
- updatedAt: Date;
3050
- email: string;
3051
- emailVerified: boolean;
3052
- name: string;
3053
- image?: string | null | undefined;
3054
- role: string;
3055
- };
3056
- }>;
3057
- };
3058
- };
3059
- session: {
3060
- create: {
3061
- before(session: {
3062
- id: string;
3063
- createdAt: Date;
3064
- updatedAt: Date;
3065
- userId: string;
3066
- expiresAt: Date;
3067
- token: string;
3068
- ipAddress?: string | null | undefined;
3069
- userAgent?: string | null | undefined;
3070
- } & Record<string, unknown>, ctx: import("better-auth/*").GenericEndpointContext | null): Promise<void>;
3071
- };
3072
- };
3073
- };
3074
- };
3075
- };
3076
- hooks: {
3077
- after: {
3078
- matcher(context: import("better-auth/*").HookEndpointContext): boolean;
3079
- handler: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>;
3080
- }[];
3081
- };
3082
- endpoints: {
3083
- setRole: import("better-auth/*").StrictEndpoint<"/admin/set-role", {
3084
- method: "POST";
3085
- body: import("better-auth/*").ZodObject<{
3086
- userId: import("better-auth/*").ZodCoercedString<unknown>;
3087
- role: import("better-auth/*").ZodUnion<readonly [import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>]>;
3088
- }, import("better-auth/*").$strip>;
3089
- requireHeaders: true;
3090
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3091
- session: {
3092
- user: import("better-auth/plugins").UserWithRole;
3093
- session: import("better-auth/types").Session;
3094
- };
3095
- }>)[];
3096
- metadata: {
3097
- openapi: {
3098
- operationId: string;
3099
- summary: string;
3100
- description: string;
3101
- responses: {
3102
- 200: {
3103
- description: string;
3104
- content: {
3105
- "application/json": {
3106
- schema: {
3107
- type: "object";
3108
- properties: {
3109
- user: {
3110
- $ref: string;
3111
- };
3112
- };
3113
- };
3114
- };
3115
- };
3116
- };
3117
- };
3118
- };
3119
- $Infer: {
3120
- body: {
3121
- userId: string;
3122
- role: "user" | "admin" | "staff" | ("user" | "admin" | "staff")[];
3123
- };
3124
- };
3125
- };
3126
- }, {
3127
- user: import("better-auth/plugins").UserWithRole;
3128
- }>;
3129
- getUser: import("better-auth/*").StrictEndpoint<"/admin/get-user", {
3130
- method: "GET";
3131
- query: import("better-auth/*").ZodObject<{
3132
- id: import("better-auth/*").ZodString;
3133
- }, import("better-auth/*").$strip>;
3134
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3135
- session: {
3136
- user: import("better-auth/plugins").UserWithRole;
3137
- session: import("better-auth/types").Session;
3138
- };
3139
- }>)[];
3140
- metadata: {
3141
- openapi: {
3142
- operationId: string;
3143
- summary: string;
3144
- description: string;
3145
- responses: {
3146
- 200: {
3147
- description: string;
3148
- content: {
3149
- "application/json": {
3150
- schema: {
3151
- type: "object";
3152
- properties: {
3153
- user: {
3154
- $ref: string;
3155
- };
3156
- };
3157
- };
3158
- };
3159
- };
3160
- };
3161
- };
3162
- };
3163
- };
3164
- }, import("better-auth/plugins").UserWithRole>;
3165
- createUser: import("better-auth/*").StrictEndpoint<"/admin/create-user", {
3166
- method: "POST";
3167
- body: import("better-auth/*").ZodObject<{
3168
- email: import("better-auth/*").ZodString;
3169
- password: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
3170
- name: import("better-auth/*").ZodString;
3171
- role: import("better-auth/*").ZodOptional<import("better-auth/*").ZodUnion<readonly [import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>]>>;
3172
- data: import("better-auth/*").ZodOptional<import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodAny>>;
3173
- }, import("better-auth/*").$strip>;
3174
- metadata: {
3175
- openapi: {
3176
- operationId: string;
3177
- summary: string;
3178
- description: string;
3179
- responses: {
3180
- 200: {
3181
- description: string;
3182
- content: {
3183
- "application/json": {
3184
- schema: {
3185
- type: "object";
3186
- properties: {
3187
- user: {
3188
- $ref: string;
3189
- };
3190
- };
3191
- };
3192
- };
3193
- };
3194
- };
3195
- };
3196
- };
3197
- $Infer: {
3198
- body: {
3199
- email: string;
3200
- password?: string | undefined;
3201
- name: string;
3202
- role?: "user" | "admin" | "staff" | ("user" | "admin" | "staff")[] | undefined;
3203
- data?: Record<string, any> | undefined;
3204
- };
3205
- };
3206
- };
3207
- }, {
3208
- user: import("better-auth/plugins").UserWithRole;
3209
- }>;
3210
- adminUpdateUser: import("better-auth/*").StrictEndpoint<"/admin/update-user", {
3211
- method: "POST";
3212
- body: import("better-auth/*").ZodObject<{
3213
- userId: import("better-auth/*").ZodCoercedString<unknown>;
3214
- data: import("better-auth/*").ZodRecord<import("better-auth/*").ZodAny, import("better-auth/*").ZodAny>;
3215
- }, import("better-auth/*").$strip>;
3216
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3217
- session: {
3218
- user: import("better-auth/plugins").UserWithRole;
3219
- session: import("better-auth/types").Session;
3220
- };
3221
- }>)[];
3222
- metadata: {
3223
- openapi: {
3224
- operationId: string;
3225
- summary: string;
3226
- description: string;
3227
- responses: {
3228
- 200: {
3229
- description: string;
3230
- content: {
3231
- "application/json": {
3232
- schema: {
3233
- type: "object";
3234
- properties: {
3235
- user: {
3236
- $ref: string;
3237
- };
3238
- };
3239
- };
3240
- };
3241
- };
3242
- };
3243
- };
3244
- };
3245
- };
3246
- }, import("better-auth/plugins").UserWithRole>;
3247
- listUsers: import("better-auth/*").StrictEndpoint<"/admin/list-users", {
3248
- method: "GET";
3249
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3250
- session: {
3251
- user: import("better-auth/plugins").UserWithRole;
3252
- session: import("better-auth/types").Session;
3253
- };
3254
- }>)[];
3255
- query: import("better-auth/*").ZodObject<{
3256
- searchValue: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
3257
- searchField: import("better-auth/*").ZodOptional<import("better-auth/*").ZodEnum<{
3258
- name: "name";
3259
- email: "email";
3260
- }>>;
3261
- searchOperator: import("better-auth/*").ZodOptional<import("better-auth/*").ZodEnum<{
3262
- contains: "contains";
3263
- starts_with: "starts_with";
3264
- ends_with: "ends_with";
3265
- }>>;
3266
- limit: import("better-auth/*").ZodOptional<import("better-auth/*").ZodUnion<[import("better-auth/*").ZodString, import("better-auth/*").ZodNumber]>>;
3267
- offset: import("better-auth/*").ZodOptional<import("better-auth/*").ZodUnion<[import("better-auth/*").ZodString, import("better-auth/*").ZodNumber]>>;
3268
- sortBy: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
3269
- sortDirection: import("better-auth/*").ZodOptional<import("better-auth/*").ZodEnum<{
3270
- asc: "asc";
3271
- desc: "desc";
3272
- }>>;
3273
- filterField: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
3274
- filterValue: import("better-auth/*").ZodOptional<import("better-auth/*").ZodUnion<[import("better-auth/*").ZodUnion<[import("better-auth/*").ZodString, import("better-auth/*").ZodNumber]>, import("better-auth/*").ZodBoolean]>>;
3275
- filterOperator: import("better-auth/*").ZodOptional<import("better-auth/*").ZodEnum<{
3276
- eq: "eq";
3277
- ne: "ne";
3278
- lt: "lt";
3279
- lte: "lte";
3280
- gt: "gt";
3281
- gte: "gte";
3282
- contains: "contains";
3283
- }>>;
3284
- }, import("better-auth/*").$strip>;
3285
- metadata: {
3286
- openapi: {
3287
- operationId: string;
3288
- summary: string;
3289
- description: string;
3290
- responses: {
3291
- 200: {
3292
- description: string;
3293
- content: {
3294
- "application/json": {
3295
- schema: {
3296
- type: "object";
3297
- properties: {
3298
- users: {
3299
- type: string;
3300
- items: {
3301
- $ref: string;
3302
- };
3303
- };
3304
- total: {
3305
- type: string;
3306
- };
3307
- limit: {
3308
- type: string;
3309
- };
3310
- offset: {
3311
- type: string;
3312
- };
3313
- };
3314
- required: string[];
3315
- };
3316
- };
3317
- };
3318
- };
3319
- };
3320
- };
3321
- };
3322
- }, {
3323
- users: import("better-auth/plugins").UserWithRole[];
3324
- total: number;
3325
- }>;
3326
- listUserSessions: import("better-auth/*").StrictEndpoint<"/admin/list-user-sessions", {
3327
- method: "POST";
3328
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3329
- session: {
3330
- user: import("better-auth/plugins").UserWithRole;
3331
- session: import("better-auth/types").Session;
3332
- };
3333
- }>)[];
3334
- body: import("better-auth/*").ZodObject<{
3335
- userId: import("better-auth/*").ZodCoercedString<unknown>;
3336
- }, import("better-auth/*").$strip>;
3337
- metadata: {
3338
- openapi: {
3339
- operationId: string;
3340
- summary: string;
3341
- description: string;
3342
- responses: {
3343
- 200: {
3344
- description: string;
3345
- content: {
3346
- "application/json": {
3347
- schema: {
3348
- type: "object";
3349
- properties: {
3350
- sessions: {
3351
- type: string;
3352
- items: {
3353
- $ref: string;
3354
- };
3355
- };
3356
- };
3357
- };
3358
- };
3359
- };
3360
- };
3361
- };
3362
- };
3363
- };
3364
- }, {
3365
- sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
3366
- }>;
3367
- unbanUser: import("better-auth/*").StrictEndpoint<"/admin/unban-user", {
3368
- method: "POST";
3369
- body: import("better-auth/*").ZodObject<{
3370
- userId: import("better-auth/*").ZodCoercedString<unknown>;
3371
- }, import("better-auth/*").$strip>;
3372
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3373
- session: {
3374
- user: import("better-auth/plugins").UserWithRole;
3375
- session: import("better-auth/types").Session;
3376
- };
3377
- }>)[];
3378
- metadata: {
3379
- openapi: {
3380
- operationId: string;
3381
- summary: string;
3382
- description: string;
3383
- responses: {
3384
- 200: {
3385
- description: string;
3386
- content: {
3387
- "application/json": {
3388
- schema: {
3389
- type: "object";
3390
- properties: {
3391
- user: {
3392
- $ref: string;
3393
- };
3394
- };
3395
- };
3396
- };
3397
- };
3398
- };
3399
- };
3400
- };
3401
- };
3402
- }, {
3403
- user: import("better-auth/plugins").UserWithRole;
3404
- }>;
3405
- banUser: import("better-auth/*").StrictEndpoint<"/admin/ban-user", {
3406
- method: "POST";
3407
- body: import("better-auth/*").ZodObject<{
3408
- userId: import("better-auth/*").ZodCoercedString<unknown>;
3409
- banReason: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
3410
- banExpiresIn: import("better-auth/*").ZodOptional<import("better-auth/*").ZodNumber>;
3411
- }, import("better-auth/*").$strip>;
3412
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3413
- session: {
3414
- user: import("better-auth/plugins").UserWithRole;
3415
- session: import("better-auth/types").Session;
3416
- };
3417
- }>)[];
3418
- metadata: {
3419
- openapi: {
3420
- operationId: string;
3421
- summary: string;
3422
- description: string;
3423
- responses: {
3424
- 200: {
3425
- description: string;
3426
- content: {
3427
- "application/json": {
3428
- schema: {
3429
- type: "object";
3430
- properties: {
3431
- user: {
3432
- $ref: string;
3433
- };
3434
- };
3435
- };
3436
- };
3437
- };
3438
- };
3439
- };
3440
- };
3441
- };
3442
- }, {
3443
- user: import("better-auth/plugins").UserWithRole;
3444
- }>;
3445
- impersonateUser: import("better-auth/*").StrictEndpoint<"/admin/impersonate-user", {
3446
- method: "POST";
3447
- body: import("better-auth/*").ZodObject<{
3448
- userId: import("better-auth/*").ZodCoercedString<unknown>;
3449
- }, import("better-auth/*").$strip>;
3450
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3451
- session: {
3452
- user: import("better-auth/plugins").UserWithRole;
3453
- session: import("better-auth/types").Session;
3454
- };
3455
- }>)[];
3456
- metadata: {
3457
- openapi: {
3458
- operationId: string;
3459
- summary: string;
3460
- description: string;
3461
- responses: {
3462
- 200: {
3463
- description: string;
3464
- content: {
3465
- "application/json": {
3466
- schema: {
3467
- type: "object";
3468
- properties: {
3469
- session: {
3470
- $ref: string;
3471
- };
3472
- user: {
3473
- $ref: string;
3474
- };
3475
- };
3476
- };
3477
- };
3478
- };
3479
- };
3480
- };
3481
- };
3482
- };
3483
- }, {
3484
- session: {
3485
- id: string;
3486
- createdAt: Date;
3487
- updatedAt: Date;
3488
- userId: string;
3489
- expiresAt: Date;
3490
- token: string;
3491
- ipAddress?: string | null | undefined;
3492
- userAgent?: string | null | undefined;
3493
- };
3494
- user: import("better-auth/plugins").UserWithRole;
3495
- }>;
3496
- stopImpersonating: import("better-auth/*").StrictEndpoint<"/admin/stop-impersonating", {
3497
- method: "POST";
3498
- requireHeaders: true;
3499
- }, {
3500
- session: {
3501
- id: string;
3502
- createdAt: Date;
3503
- updatedAt: Date;
3504
- userId: string;
3505
- expiresAt: Date;
3506
- token: string;
3507
- ipAddress?: string | null | undefined;
3508
- userAgent?: string | null | undefined;
3509
- } & Record<string, any>;
3510
- user: {
3511
- id: string;
3512
- createdAt: Date;
3513
- updatedAt: Date;
3514
- email: string;
3515
- emailVerified: boolean;
3516
- name: string;
3517
- image?: string | null | undefined;
3518
- } & Record<string, any>;
3519
- }>;
3520
- revokeUserSession: import("better-auth/*").StrictEndpoint<"/admin/revoke-user-session", {
3521
- method: "POST";
3522
- body: import("better-auth/*").ZodObject<{
3523
- sessionToken: import("better-auth/*").ZodString;
3524
- }, import("better-auth/*").$strip>;
3525
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3526
- session: {
3527
- user: import("better-auth/plugins").UserWithRole;
3528
- session: import("better-auth/types").Session;
3529
- };
3530
- }>)[];
3531
- metadata: {
3532
- openapi: {
3533
- operationId: string;
3534
- summary: string;
3535
- description: string;
3536
- responses: {
3537
- 200: {
3538
- description: string;
3539
- content: {
3540
- "application/json": {
3541
- schema: {
3542
- type: "object";
3543
- properties: {
3544
- success: {
3545
- type: string;
3546
- };
3547
- };
3548
- };
3549
- };
3550
- };
3551
- };
3552
- };
3553
- };
3554
- };
3555
- }, {
3556
- success: boolean;
3557
- }>;
3558
- revokeUserSessions: import("better-auth/*").StrictEndpoint<"/admin/revoke-user-sessions", {
3559
- method: "POST";
3560
- body: import("better-auth/*").ZodObject<{
3561
- userId: import("better-auth/*").ZodCoercedString<unknown>;
3562
- }, import("better-auth/*").$strip>;
3563
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3564
- session: {
3565
- user: import("better-auth/plugins").UserWithRole;
3566
- session: import("better-auth/types").Session;
3567
- };
3568
- }>)[];
3569
- metadata: {
3570
- openapi: {
3571
- operationId: string;
3572
- summary: string;
3573
- description: string;
3574
- responses: {
3575
- 200: {
3576
- description: string;
3577
- content: {
3578
- "application/json": {
3579
- schema: {
3580
- type: "object";
3581
- properties: {
3582
- success: {
3583
- type: string;
3584
- };
3585
- };
3586
- };
3587
- };
3588
- };
3589
- };
3590
- };
3591
- };
3592
- };
3593
- }, {
3594
- success: boolean;
3595
- }>;
3596
- removeUser: import("better-auth/*").StrictEndpoint<"/admin/remove-user", {
3597
- method: "POST";
3598
- body: import("better-auth/*").ZodObject<{
3599
- userId: import("better-auth/*").ZodCoercedString<unknown>;
3600
- }, import("better-auth/*").$strip>;
3601
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3602
- session: {
3603
- user: import("better-auth/plugins").UserWithRole;
3604
- session: import("better-auth/types").Session;
3605
- };
3606
- }>)[];
3607
- metadata: {
3608
- openapi: {
3609
- operationId: string;
3610
- summary: string;
3611
- description: string;
3612
- responses: {
3613
- 200: {
3614
- description: string;
3615
- content: {
3616
- "application/json": {
3617
- schema: {
3618
- type: "object";
3619
- properties: {
3620
- success: {
3621
- type: string;
3622
- };
3623
- };
3624
- };
3625
- };
3626
- };
3627
- };
3628
- };
3629
- };
3630
- };
3631
- }, {
3632
- success: boolean;
3633
- }>;
3634
- setUserPassword: import("better-auth/*").StrictEndpoint<"/admin/set-user-password", {
3635
- method: "POST";
3636
- body: import("better-auth/*").ZodObject<{
3637
- newPassword: import("better-auth/*").ZodString;
3638
- userId: import("better-auth/*").ZodCoercedString<unknown>;
3639
- }, import("better-auth/*").$strip>;
3640
- use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
3641
- session: {
3642
- user: import("better-auth/plugins").UserWithRole;
3643
- session: import("better-auth/types").Session;
3644
- };
3645
- }>)[];
3646
- metadata: {
3647
- openapi: {
3648
- operationId: string;
3649
- summary: string;
3650
- description: string;
3651
- responses: {
3652
- 200: {
3653
- description: string;
3654
- content: {
3655
- "application/json": {
3656
- schema: {
3657
- type: "object";
3658
- properties: {
3659
- status: {
3660
- type: string;
3661
- };
3662
- };
3663
- };
3664
- };
3665
- };
3666
- };
3667
- };
3668
- };
3669
- };
3670
- }, {
3671
- status: boolean;
3672
- }>;
3673
- userHasPermission: import("better-auth/*").StrictEndpoint<"/admin/has-permission", {
3674
- method: "POST";
3675
- body: import("better-auth/*").ZodIntersection<import("better-auth/*").ZodObject<{
3676
- userId: import("better-auth/*").ZodOptional<import("better-auth/*").ZodCoercedString<unknown>>;
3677
- role: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
3678
- }, import("better-auth/*").$strip>, import("better-auth/*").ZodUnion<readonly [import("better-auth/*").ZodObject<{
3679
- permission: import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>>;
3680
- permissions: import("better-auth/*").ZodUndefined;
3681
- }, import("better-auth/*").$strip>, import("better-auth/*").ZodObject<{
3682
- permission: import("better-auth/*").ZodUndefined;
3683
- permissions: import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodArray<import("better-auth/*").ZodString>>;
3684
- }, import("better-auth/*").$strip>]>>;
3685
- metadata: {
3686
- openapi: {
3687
- description: string;
3688
- requestBody: {
3689
- content: {
3690
- "application/json": {
3691
- schema: {
3692
- type: "object";
3693
- properties: {
3694
- permission: {
3695
- type: string;
3696
- description: string;
3697
- deprecated: boolean;
3698
- };
3699
- permissions: {
3700
- type: string;
3701
- description: string;
3702
- };
3703
- };
3704
- required: string[];
3705
- };
3706
- };
3707
- };
3708
- };
3709
- responses: {
3710
- "200": {
3711
- description: string;
3712
- content: {
3713
- "application/json": {
3714
- schema: {
3715
- type: "object";
3716
- properties: {
3717
- error: {
3718
- type: string;
3719
- };
3720
- success: {
3721
- type: string;
3722
- };
3723
- };
3724
- required: string[];
3725
- };
3726
- };
3727
- };
3728
- };
3729
- };
3730
- };
3731
- $Infer: {
3732
- body: ({
3733
- permission: {
3734
- readonly user?: ("update" | "create" | "delete" | "list" | "get" | "set-role" | "ban" | "impersonate" | "set-password")[] | undefined;
3735
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
3736
- };
3737
- permissions?: never | undefined;
3738
- } | {
3739
- permissions: {
3740
- readonly user?: ("update" | "create" | "delete" | "list" | "get" | "set-role" | "ban" | "impersonate" | "set-password")[] | undefined;
3741
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
3742
- };
3743
- permission?: never | undefined;
3744
- }) & {
3745
- userId?: string | undefined;
3746
- role?: "user" | "admin" | "staff" | undefined;
3747
- };
3748
- };
3749
- };
3750
- }, {
3751
- error: null;
3752
- success: boolean;
3753
- }>;
3754
- };
3755
- $ERROR_CODES: {
3756
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
3757
- readonly USER_ALREADY_EXISTS: "User already exists.";
3758
- readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
3759
- readonly YOU_CANNOT_BAN_YOURSELF: "You cannot ban yourself";
3760
- readonly YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: "You are not allowed to change users role";
3761
- readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: "You are not allowed to create users";
3762
- readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: "You are not allowed to list users";
3763
- readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: "You are not allowed to list users sessions";
3764
- readonly YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: "You are not allowed to ban users";
3765
- readonly YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: "You are not allowed to impersonate users";
3766
- readonly YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: "You are not allowed to revoke users sessions";
3767
- readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: "You are not allowed to delete users";
3768
- readonly YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: "You are not allowed to set users password";
3769
- readonly BANNED_USER: "You have been banned from this application";
3770
- readonly YOU_ARE_NOT_ALLOWED_TO_GET_USER: "You are not allowed to get user";
3771
- readonly NO_DATA_TO_UPDATE: "No data to update";
3772
- readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users";
3773
- readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
3774
- readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
3775
- readonly YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins";
3776
- readonly INVALID_ROLE_TYPE: "Invalid role type";
3777
- };
3778
- schema: {
3779
- user: {
3780
- fields: {
3781
- role: {
3782
- type: "string";
3783
- required: false;
3784
- input: false;
3785
- };
3786
- banned: {
3787
- type: "boolean";
3788
- defaultValue: false;
3789
- required: false;
3790
- input: false;
3791
- };
3792
- banReason: {
3793
- type: "string";
3794
- required: false;
3795
- input: false;
3796
- };
3797
- banExpires: {
3798
- type: "date";
3799
- required: false;
3800
- input: false;
3801
- };
3802
- };
3803
- };
3804
- session: {
3805
- fields: {
3806
- impersonatedBy: {
3807
- type: "string";
3808
- required: false;
3809
- };
3810
- };
3811
- };
3812
- };
3813
- options: NoInfer<{
3814
- accessControl: {
3815
- newRole<K extends "user" | "session">(statements: import("better-auth/plugins").Subset<K, {
3816
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3817
- readonly session: readonly ["list", "revoke", "delete"];
3818
- }>): {
3819
- authorize<K_1 extends K>(request: K_1 extends infer T extends K_2 ? { [key in T]?: import("better-auth/plugins").Subset<K, {
3820
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3821
- readonly session: readonly ["list", "revoke", "delete"];
3822
- }>[key] | {
3823
- actions: import("better-auth/plugins").Subset<K, {
3824
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3825
- readonly session: readonly ["list", "revoke", "delete"];
3826
- }>[key];
3827
- connector: "OR" | "AND";
3828
- } | undefined; } : never, connector?: "OR" | "AND"): import("better-auth/plugins").AuthorizeResponse;
3829
- statements: import("better-auth/plugins").Subset<K, {
3830
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3831
- readonly session: readonly ["list", "revoke", "delete"];
3832
- }>;
3833
- };
3834
- statements: {
3835
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3836
- readonly session: readonly ["list", "revoke", "delete"];
3837
- };
3838
- };
3839
- roles: {
3840
- admin: {
3841
- authorize<K_1 extends "user" | "session">(request: K_1 extends infer T extends K ? { [key in T]?: import("better-auth/plugins").Subset<"user" | "session", {
3842
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3843
- readonly session: readonly ["list", "revoke", "delete"];
3844
- }>[key] | {
3845
- actions: import("better-auth/plugins").Subset<"user" | "session", {
3846
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3847
- readonly session: readonly ["list", "revoke", "delete"];
3848
- }>[key];
3849
- connector: "OR" | "AND";
3850
- } | undefined; } : never, connector?: "OR" | "AND"): import("better-auth/plugins").AuthorizeResponse;
3851
- statements: import("better-auth/plugins").Subset<"user" | "session", {
3852
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3853
- readonly session: readonly ["list", "revoke", "delete"];
3854
- }>;
3855
- };
3856
- user: {
3857
- authorize<K_1 extends "user" | "session">(request: K_1 extends infer T extends K ? { [key in T]?: import("better-auth/plugins").Subset<"user" | "session", {
3858
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3859
- readonly session: readonly ["list", "revoke", "delete"];
3860
- }>[key] | {
3861
- actions: import("better-auth/plugins").Subset<"user" | "session", {
3862
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3863
- readonly session: readonly ["list", "revoke", "delete"];
3864
- }>[key];
3865
- connector: "OR" | "AND";
3866
- } | undefined; } : never, connector?: "OR" | "AND"): import("better-auth/plugins").AuthorizeResponse;
3867
- statements: import("better-auth/plugins").Subset<"user" | "session", {
3868
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3869
- readonly session: readonly ["list", "revoke", "delete"];
3870
- }>;
3871
- };
3872
- staff: {
3873
- authorize<K_1 extends "user">(request: K_1 extends infer T extends K ? { [key in T]?: import("better-auth/plugins").Subset<"user", {
3874
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3875
- readonly session: readonly ["list", "revoke", "delete"];
3876
- }>[key] | {
3877
- actions: import("better-auth/plugins").Subset<"user", {
3878
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3879
- readonly session: readonly ["list", "revoke", "delete"];
3880
- }>[key];
3881
- connector: "OR" | "AND";
3882
- } | undefined; } : never, connector?: "OR" | "AND"): import("better-auth/plugins").AuthorizeResponse;
3883
- statements: import("better-auth/plugins").Subset<"user", {
3884
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
3885
- readonly session: readonly ["list", "revoke", "delete"];
3886
- }>;
3887
- };
3888
- };
3889
- }>;
3890
- } | (C["$auth"] extends {
3891
- plugins: any;
3892
- } ? C["$auth"]["plugins"] : [])[number])[];
3893
- database: (options: import("better-auth/types").BetterAuthOptions) => import("better-auth/types").DBAdapter<import("better-auth/types").BetterAuthOptions>;
3894
- baseURL: any;
3895
- rateLimit: {
3896
- readonly enabled: boolean;
3897
- readonly window: 10;
3898
- readonly max: 30;
3899
- };
3900
- trustedOrigins: string[];
3901
- session: {
3902
- readonly modelName: "authSessions";
3903
- };
3904
- account: {
3905
- readonly modelName: "authAccounts";
3906
- };
3907
- verification: {
3908
- readonly modelName: "authVerifications";
3909
- };
3910
- user: {
3911
- readonly modelName: "authUsers";
3912
- readonly changeEmail: {
3913
- readonly enabled: true;
3914
- };
3915
- readonly deleteUser: {
3916
- readonly enabled: true;
3917
- };
3918
- readonly additionalFields: {
3919
- readonly type: {
3920
- readonly type: "string";
3921
- readonly required: true;
3922
- };
3923
- };
3924
- };
3925
- hooks: {
3926
- readonly before: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<unknown>;
3927
- readonly after: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<unknown>;
3928
- };
3929
- emailAndPassword: {
3930
- readonly enabled: true;
3931
- readonly sendResetPassword: (data: {
3932
- user: any;
3933
- url: string;
3934
- }) => Promise<void>;
3935
- };
3936
- }>;
3937
- readonly adapter: import("../../../adapter-sqlite/index.server.js").Adapter;
3938
- readonly config: {
3939
- readonly raw: BuildConfig<C>;
3940
- readonly collections: InferCollections<C>;
3941
- readonly areas: InferAreas<C>;
3942
- getDefaultLocale(): string | undefined;
3943
- getLocalesCodes: () => string[];
3944
- isValidLocale: (locale: string) => boolean;
3945
- getArea: (slug: string) => import("../types.js").BuiltArea;
3946
- getCollection: (slug: string) => import("../types.js").BuiltCollection;
3947
- getBySlug: (slug: string) => import("../types.js").BuiltArea | import("../types.js").BuiltCollection;
3948
- isCollection: (slug?: string) => slug is import("../../types/doc.js").CollectionSlug;
3949
- isArea: (slug?: string) => slug is import("../../types/doc.js").AreaSlug;
3950
- getDocumentPrototype(slug: import("../../types/doc.js").PrototypeSlug): "area" | "collection";
3951
- };
3952
- setLocale(locale: string | undefined): void;
3953
- getLocale(): any;
3954
- collection<Slug extends keyof import("../../..").RegisterCollection>(slug: Slug): import("../../collections/local-api.server.js").CollectionAPI<import("../../..").RegisterCollection[Slug]>;
3955
- area<Slug extends keyof import("../../..").RegisterArea>(slug: Slug): import("../../areas/local-api.server.js").AreaAPI<import("../../..").RegisterArea[Slug]>;
3956
- };
3957
- }>;
4
+ export declare const buildConfig: <const C extends Config>(config: C) => Promise<Rime<C>>;
3958
5
  declare function augmentConfig<T extends Config>(config: T): T & {
3959
6
  readonly collections: readonly [...import("../types.js").BuiltCollection[], import("../types.js").BuiltCollection];
3960
7
  } & {
@@ -4017,56 +64,11 @@ declare function augmentConfig<T extends Config>(config: T): T & {
4017
64
  } & {
4018
65
  readonly $trustedOrigins: string[];
4019
66
  } & {
4020
- readonly $plugins: readonly [{
4021
- readonly name: "sse";
4022
- readonly type: "server";
4023
- readonly actions: {
4024
- readonly broadcast: (data: import("../../plugins/sse/types.js").ContentUpdatePayload) => void;
4025
- };
4026
- readonly routes: {
4027
- readonly '/api/sse': {
4028
- readonly GET: import("@sveltejs/kit").RequestHandler;
4029
- };
4030
- };
4031
- }, {
4032
- readonly name: "cache";
4033
- readonly type: "server";
4034
- readonly configure: <const C extends Config>(config: C) => C;
4035
- readonly routes: {
4036
- readonly '/api/clear-cache': {
4037
- readonly POST: () => Response;
4038
- };
4039
- };
4040
- readonly actions: import("../../plugins/cache/index.server.js").CacheActions;
4041
- readonly handler: import("@sveltejs/kit").Handle;
4042
- }, ...(import("../../plugins/index.js").Plugin | {
4043
- readonly name: "apiInit";
4044
- readonly type: "server";
4045
- readonly routes: {
4046
- readonly '/api/init': {
4047
- readonly POST: import("@sveltejs/kit").RequestHandler;
4048
- };
4049
- };
4050
- } | {
4051
- readonly name: "mailer";
4052
- readonly type: "server";
4053
- readonly actions: {
4054
- readonly sendMail: (args: {
4055
- to: string;
4056
- subject: string;
4057
- text: string;
4058
- html?: string;
4059
- }) => Promise<import("nodemailer/lib/smtp-transport/index.js").SentMessageInfo>;
4060
- };
4061
- })[]];
67
+ readonly $plugins: import("../../plugins/index.js").Plugin[];
4062
68
  } & {
4063
69
  readonly collections: readonly import("../types.js").BuiltCollection[];
4064
70
  } & {
4065
- readonly plugins: (import("../../plugins/index.js").PluginClient | {
4066
- readonly name: "cache/client";
4067
- readonly type: "client";
4068
- readonly configure: <const C extends import("../types.js").SanitizedConfigClient>(config: C) => C;
4069
- })[];
71
+ readonly plugins: any[];
4070
72
  };
4071
73
  type InferCollections<C> = C extends {
4072
74
  collections?: readonly any[];
@@ -4093,13 +95,13 @@ type InferAreasSlug<C> = C extends {
4093
95
  slug: infer N;
4094
96
  } ? N extends string ? N : never : never : Array<never>;
4095
97
  type InferCorePlugins<C extends Config> = {
4096
- cache: import('../../plugins/cache/index.server.js').CacheActions;
4097
- sse: import('../../plugins/sse/index.server.js').SSEActions;
98
+ cache: import('../../plugins/cache/module.server.js').CacheActions;
99
+ sse: import('../../plugins/sse/module.server.js').SSEActions;
4098
100
  } & (C['$smtp'] extends SMTPConfig ? {
4099
- mailer: import('../../plugins/mailer/index.server.js').MailerActions;
101
+ mailer: import('../../plugins/mailer/module.server.js').MailerActions;
4100
102
  } : Record<string, never>);
4101
103
  type ExtractCustomPlugins<C> = C extends {
4102
- $plugins: readonly (infer P)[];
104
+ plugins: readonly (infer P)[];
4103
105
  } ? P extends {
4104
106
  name: infer N;
4105
107
  actions?: infer A;