@rebasepro/types 0.17.3 → 0.18.1

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 (71) hide show
  1. package/README.md +4 -0
  2. package/dist/call_context.d.ts +20 -0
  3. package/dist/controllers/client.d.ts +36 -4
  4. package/dist/controllers/data.d.ts +120 -10
  5. package/dist/errors.d.ts +83 -4
  6. package/dist/index.es.js +522 -160
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/types/admin_block.d.ts +2 -2
  9. package/dist/types/auth_adapter.d.ts +41 -6
  10. package/dist/types/backend.d.ts +48 -0
  11. package/dist/types/collections.d.ts +25 -1
  12. package/dist/types/cron.d.ts +34 -0
  13. package/dist/types/database_adapter.d.ts +39 -0
  14. package/dist/types/entity_callbacks.d.ts +14 -1
  15. package/dist/types/filter-operators.d.ts +24 -1
  16. package/dist/types/policy.d.ts +29 -1
  17. package/dist/types/properties.d.ts +216 -3
  18. package/dist/types/relations.d.ts +65 -7
  19. package/dist/types/resource_kinds.d.ts +173 -17
  20. package/dist/types/resources.d.ts +108 -7
  21. package/dist/types/rls-functions.d.ts +11 -0
  22. package/dist/types/storage_source.d.ts +12 -23
  23. package/package.json +24 -23
  24. package/src/call_context.ts +0 -120
  25. package/src/controllers/auth_state.ts +0 -24
  26. package/src/controllers/client.ts +0 -494
  27. package/src/controllers/collection_registry.ts +0 -62
  28. package/src/controllers/data.ts +0 -1012
  29. package/src/controllers/data_driver.ts +0 -576
  30. package/src/controllers/effective_role.ts +0 -4
  31. package/src/controllers/email.ts +0 -91
  32. package/src/controllers/index.ts +0 -11
  33. package/src/controllers/storage.ts +0 -252
  34. package/src/errors.ts +0 -119
  35. package/src/index.ts +0 -5
  36. package/src/types/admin_block.ts +0 -209
  37. package/src/types/api_keys.ts +0 -108
  38. package/src/types/auth_adapter.ts +0 -580
  39. package/src/types/backend.ts +0 -987
  40. package/src/types/backup.ts +0 -26
  41. package/src/types/channel_bus.ts +0 -202
  42. package/src/types/chips.ts +0 -34
  43. package/src/types/collection_contract.ts +0 -278
  44. package/src/types/collections.ts +0 -763
  45. package/src/types/component_ref.ts +0 -92
  46. package/src/types/cron.ts +0 -213
  47. package/src/types/data_source.ts +0 -357
  48. package/src/types/database_adapter.ts +0 -267
  49. package/src/types/entities.ts +0 -226
  50. package/src/types/entity_callbacks.ts +0 -229
  51. package/src/types/filter-operators.ts +0 -444
  52. package/src/types/history.ts +0 -66
  53. package/src/types/index.ts +0 -36
  54. package/src/types/indexes.ts +0 -180
  55. package/src/types/policy.ts +0 -328
  56. package/src/types/postgres_introspection.ts +0 -101
  57. package/src/types/project_manifest.ts +0 -598
  58. package/src/types/properties.ts +0 -1368
  59. package/src/types/relations.ts +0 -417
  60. package/src/types/resource_kinds.ts +0 -390
  61. package/src/types/resources.ts +0 -368
  62. package/src/types/rls-functions.ts +0 -98
  63. package/src/types/schema_editing.ts +0 -157
  64. package/src/types/schema_version.ts +0 -112
  65. package/src/types/search.ts +0 -247
  66. package/src/types/security_rules.ts +0 -344
  67. package/src/types/storage_authorize.ts +0 -77
  68. package/src/types/storage_source.ts +0 -248
  69. package/src/types/websockets.ts +0 -117
  70. package/src/users/index.ts +0 -2
  71. package/src/users/user.ts +0 -69
@@ -1,580 +0,0 @@
1
- /**
2
- * @module AuthAdapter
3
- *
4
- * Pluggable authentication abstraction for Rebase.
5
- *
6
- * An `AuthAdapter` decouples authentication from the database layer,
7
- * allowing users to bring their own auth system (Clerk, Auth0, or other
8
- * external providers) while keeping the Rebase admin frontend fully functional.
9
- *
10
- * @example Built-in auth (default — zero config change)
11
- * ```ts
12
- * initializeRebaseBackend({
13
- * auth: { jwtSecret: "...", google: { clientId: "..." } },
14
- * database: createPostgresAdapter({ ... }),
15
- * });
16
- * ```
17
- *
18
- * @example Custom auth
19
- * ```ts
20
- * import { createCustomAuthAdapter } from "@rebasepro/server";
21
- *
22
- * initializeRebaseBackend({
23
- * auth: createCustomAuthAdapter({
24
- * verifyRequest: async (req) => { ... },
25
- * }),
26
- * database: createPostgresAdapter({ ... }),
27
- * });
28
- * ```
29
- *
30
- * @group Auth
31
- */
32
-
33
- import type { Hono } from "hono";
34
-
35
- // ─── Authenticated User ──────────────────────────────────────────────────────
36
-
37
- /**
38
- * The normalized user object returned by `AuthAdapter.verifyRequest()`.
39
- *
40
- * Regardless of the auth provider, every request is resolved to this shape
41
- * so that downstream middleware (RLS scoping, route guards) can work uniformly.
42
- *
43
- * @group Auth
44
- */
45
- export interface AuthenticatedUser {
46
- /** Unique user identifier (provider-specific). */
47
- uid: string;
48
- /** Primary email address. */
49
- email: string;
50
- /** Human-readable display name. */
51
- displayName?: string | null;
52
- /** Avatar URL. */
53
- photoUrl?: string | null;
54
- /** Role identifiers the user holds. */
55
- roles: string[];
56
- /** Whether the user has admin privileges. */
57
- isAdmin: boolean;
58
- /** Raw bearer token from the request (for forwarding). */
59
- rawToken?: string;
60
- /** Extra claims/metadata from the auth provider. */
61
- claims?: Record<string, unknown>;
62
- }
63
-
64
- // ─── Capabilities ────────────────────────────────────────────────────────────
65
-
66
- /**
67
- * Feature flags advertised by an auth adapter.
68
- *
69
- * The frontend reads these from `GET /api/auth/config` to dynamically
70
- * show/hide UI elements (login form, registration, password reset, etc.).
71
- *
72
- * @group Auth
73
- */
74
- export interface AuthAdapterCapabilities {
75
- /**
76
- * Whether this adapter mounts its own `/auth/*` routes.
77
- *
78
- * - `true` for the built-in Rebase auth (login, register, refresh, etc.)
79
- * - `false` for external providers like Clerk or Auth0 that handle
80
- * auth flows outside of the Rebase backend.
81
- */
82
- hasBuiltInAuthRoutes: boolean;
83
-
84
- /** Supports email/password login. */
85
- emailPasswordLogin: boolean;
86
- /**
87
- * Whether self-registration is open **right now**.
88
- *
89
- * A runtime answer, not a static feature list: the built-in adapter also
90
- * reports `true` during the first-user bootstrap window (an empty user
91
- * table) and `false` the moment `disableSelfRegistration` is set. Whatever
92
- * this says, `POST /auth/register` does — both read the same predicate, so
93
- * the UI can never be sent to a form that can only 403.
94
- */
95
- registrationEnabled: boolean;
96
- /**
97
- * Supports the end-user password reset flow (emailing a reset link).
98
- *
99
- * This is about *self-service* reset, so it is typically tied to whether an
100
- * email service is configured. It says nothing about whether an admin can
101
- * reset someone else's password — see `adminPasswordReset`.
102
- */
103
- passwordReset: boolean;
104
- /**
105
- * Whether the adapter exposes `POST /admin/users/:uid/reset-password`,
106
- * letting an admin reset another user's password.
107
- *
108
- * Independent of `passwordReset`: the built-in adapter supports this even
109
- * with no email service configured (it returns a one-time temporary
110
- * password instead of sending a link). Adapters that mount their own admin
111
- * routes must set this to `true` only once that route actually exists —
112
- * the admin UI hides the "Reset Password" action when it is `false`.
113
- */
114
- adminPasswordReset: boolean;
115
- /** Supports session listing/revocation. */
116
- sessionManagement: boolean;
117
- /** Supports profile updates (display name, photo). */
118
- profileUpdate: boolean;
119
- /** Supports email verification. */
120
- emailVerification: boolean;
121
- /** Supports passwordless magic link login. */
122
- magicLink: boolean;
123
- /**
124
- * Supports passwordless sign-in with a six-digit code sent by email.
125
- *
126
- * Optional so that an external adapter written before this existed still
127
- * satisfies the interface; absent reads as "no", which is what an adapter
128
- * that has never heard of the flow means.
129
- */
130
- emailOtp?: boolean;
131
- /** Whether `POST /auth/anonymous` will mint a credential-less session. */
132
- anonymousLogin: boolean;
133
- /** List of enabled OAuth provider IDs (e.g. `["google", "github"]`). */
134
- enabledProviders: string[];
135
-
136
- /**
137
- * For external auth (Clerk, Auth0, etc.): the URL where the user should
138
- * be redirected for login. The Rebase frontend will navigate here instead
139
- * of showing its own login form.
140
- */
141
- externalLoginUrl?: string;
142
-
143
- /**
144
- * True when no users exist yet — first-user bootstrap mode.
145
- * Only applicable for built-in auth.
146
- */
147
- needsSetup?: boolean;
148
- }
149
-
150
- // ─── User Management ────────────────────────────────────────────────────────
151
-
152
- /**
153
- * Options for paginated user listing.
154
- * @group Auth
155
- */
156
- export interface AuthUserListOptions {
157
- limit?: number;
158
- offset?: number;
159
- search?: string;
160
- orderBy?: string;
161
- orderDir?: "asc" | "desc";
162
- roleId?: string;
163
- }
164
-
165
- /**
166
- * Paginated user listing result.
167
- * @group Auth
168
- */
169
- export interface AuthUserListResult {
170
- users: AuthUserData[];
171
- total: number;
172
- limit: number;
173
- offset: number;
174
- }
175
-
176
- /**
177
- * User data exposed by the auth adapter.
178
- * @group Auth
179
- */
180
- export interface AuthUserData {
181
- id: string;
182
- email: string;
183
- displayName?: string | null;
184
- photoUrl?: string | null;
185
- emailVerified?: boolean;
186
- metadata?: Record<string, unknown>;
187
- createdAt?: Date;
188
- updatedAt?: Date;
189
- }
190
-
191
- /**
192
- * Data for creating a user.
193
- * @group Auth
194
- */
195
- export interface AuthCreateUserData {
196
- email: string;
197
- password?: string;
198
- displayName?: string;
199
- photoUrl?: string;
200
- metadata?: Record<string, unknown>;
201
- }
202
-
203
- /**
204
- * User management operations for the admin panel.
205
- *
206
- * Optional — if not provided by the adapter, the user management UI is hidden.
207
- *
208
- * @group Auth
209
- */
210
- export interface UserManagementAdapter {
211
- listUsers(options?: AuthUserListOptions): Promise<AuthUserListResult>;
212
- getUserById(id: string): Promise<AuthUserData | null>;
213
- createUser(data: AuthCreateUserData): Promise<AuthUserData>;
214
- updateUser(id: string, data: Partial<AuthCreateUserData>): Promise<AuthUserData | null>;
215
- deleteUser(id: string): Promise<void>;
216
- getUserRoles(uid: string): Promise<string[]>;
217
- setUserRoles(uid: string, roleIds: string[]): Promise<void>;
218
- }
219
-
220
- // ─── User Creation Lifecycle ─────────────────────────────────────────────────
221
-
222
- /**
223
- * Result of `AuthAdapter.prepareUserCreation()`.
224
- *
225
- * Contains the processed values ready for persistence and metadata
226
- * needed by the finalization step.
227
- *
228
- * @group Auth
229
- */
230
- export interface UserCreationPrepareResult {
231
- /** Processed values to persist (passwordHash instead of raw password, etc.). */
232
- values: Record<string, unknown>;
233
- /** Cleartext password for post-save processing (email or admin display). */
234
- clearPassword?: string;
235
- /** Whether the hook already handled the invitation (email, etc.). */
236
- hookHandledEmail: boolean;
237
- /** Whether an invitation was sent (only relevant when hookHandledEmail is true). */
238
- invitationSent: boolean;
239
- }
240
-
241
- /**
242
- * What a create body for an auth collection may name beyond the collection's
243
- * own declared fields — see `AuthAdapter.describeUserCreationContract()`.
244
- *
245
- * @group Auth
246
- */
247
- export interface UserCreationWriteContract {
248
- /**
249
- * Whether to check the body for fields neither the collection nor
250
- * {@link extraFields} declares. `false` skips the check entirely.
251
- */
252
- validate: boolean;
253
- /**
254
- * Credential and provider keys the adapter consumes itself, which the
255
- * collection therefore does not declare as columns. `password` is the
256
- * canonical one: `prepareUserCreation` hashes it into `passwordHash` and
257
- * deletes it before the row is ever built.
258
- */
259
- extraFields: string[];
260
- }
261
-
262
- /**
263
- * Result of `AuthAdapter.finalizeUserCreation()`.
264
- *
265
- * Returned to the REST API for inclusion in the response.
266
- *
267
- * @group Auth
268
- */
269
- export interface UserCreationFinalizeResult {
270
- /** If set, returned to the admin in the API response. */
271
- temporaryPassword?: string;
272
- /** Whether an invitation email was sent. */
273
- invitationSent: boolean;
274
- /**
275
- * Whether an email service was configured but delivery failed, causing the
276
- * fallback to `temporaryPassword`. Absent when no email service is configured.
277
- */
278
- emailDeliveryFailed?: boolean;
279
- }
280
-
281
- // ─── Auth Response Transform ─────────────────────────────────────────────────
282
-
283
- /**
284
- * The auth response payload shape that flows through `transformAuthResponse`.
285
- *
286
- * For login, register, OAuth, anonymous, and magic-link flows the payload
287
- * contains both `user` and `tokens`. For refresh and MFA flows the payload
288
- * contains only `tokens` (no `user`).
289
- *
290
- * @group Auth
291
- */
292
- export interface AuthResponsePayload {
293
- user?: {
294
- uid: string;
295
- email: string;
296
- displayName: string | null;
297
- photoURL: string | null;
298
- providerId?: string;
299
- isAnonymous?: boolean;
300
- emailVerified?: boolean;
301
- roles: string[];
302
- metadata: Record<string, unknown>;
303
- };
304
- tokens: {
305
- accessToken: string;
306
- refreshToken: string;
307
- accessTokenExpiresAt: number;
308
- /** Additional tokens injected by `transformAuthResponse`. */
309
- [key: string]: unknown;
310
- };
311
- }
312
-
313
- /**
314
- * Context passed to the `transformAuthResponse` hook.
315
- *
316
- * @group Auth
317
- */
318
- export interface TransformAuthResponseContext {
319
- /** The authenticated user's ID. */
320
- uid: string;
321
- /** The auth method that triggered this response. */
322
- method: "login" | "register" | "oauth" | "refresh" | "anonymous" | "magic-link" | "otp" | "mfa";
323
- /** The raw HTTP request (for reading headers, IP, etc.). */
324
- request: Request;
325
- }
326
-
327
- // ─── Auth Adapter ────────────────────────────────────────────────────────────
328
-
329
- /**
330
- * Pluggable authentication adapter for Rebase.
331
- *
332
- * This is the **key interface** that decouples authentication from the
333
- * database layer. Each auth adapter knows how to:
334
- *
335
- * 1. Verify incoming HTTP requests (`verifyRequest`)
336
- * 2. Optionally manage users (for the admin panel)
337
- * 3. Optionally mount auth-specific routes (login, register, etc.)
338
- * 4. Advertise its capabilities so the frontend can adapt
339
- *
340
- * The built-in Rebase auth implements this interface internally.
341
- * External providers (Clerk, Auth0, or others) provide their own adapters.
342
- * Users with custom auth can use `createCustomAuthAdapter()` for a minimal setup.
343
- *
344
- * @group Auth
345
- */
346
- export interface AuthAdapter {
347
- /**
348
- * Unique identifier for this auth adapter.
349
- *
350
- * @example "rebase-builtin", "clerk", "auth0", "external-provider", "custom"
351
- */
352
- readonly id: string;
353
-
354
- // ── Request Authentication ──────────────────────────────────────────
355
-
356
- /**
357
- * Verify an incoming request and extract the authenticated user.
358
- *
359
- * This replaces the hardcoded JWT verification in server's middleware.
360
- * Each adapter implements its own token verification strategy:
361
- * - Built-in: verify Rebase JWT
362
- * - Clerk: call Clerk's `verifyToken()`
363
- * - Auth0: validate Auth0 JWT with JWKS
364
- * - Custom: whatever logic the user provides
365
- *
366
- * @param request - The raw `Request` object (portable across Hono, Express, Fastify)
367
- * @returns The authenticated user, or `null` for unauthenticated requests.
368
- * Throw an error to reject the request with 401.
369
- */
370
- verifyRequest(request: Request): Promise<AuthenticatedUser | null>;
371
-
372
- /**
373
- * Verify a raw bearer token and extract the authenticated user.
374
- *
375
- * Used for **WebSocket authentication**, where there is no HTTP `Request`
376
- * object — only a token string sent over the socket.
377
- *
378
- * If not implemented, the default behavior synthesizes a minimal `Request`
379
- * with an `Authorization: Bearer <token>` header and delegates to
380
- * `verifyRequest()`. Adapters should override this if their token
381
- * verification logic doesn't depend on request headers/cookies.
382
- *
383
- * @param token - The raw bearer token string.
384
- * @returns The authenticated user, or `null` if the token is invalid.
385
- */
386
- verifyToken?(token: string): Promise<AuthenticatedUser | null>;
387
-
388
- // ── User Management (for admin panel) ────────────────────────────
389
-
390
- /**
391
- * User CRUD for the admin panel's user management UI.
392
- * Optional — if not provided, user management UI is hidden.
393
- */
394
- userManagement?: UserManagementAdapter;
395
-
396
- // ── Auth Routes ─────────────────────────────────────────────────────
397
-
398
- /**
399
- * Mount adapter-specific auth routes (login, register, refresh, etc.).
400
- *
401
- * - Built-in adapter: mounts `/auth/login`, `/auth/register`, etc.
402
- * - External adapter: typically returns `undefined` (auth is handled externally).
403
- * - Custom adapter: user mounts their own routes.
404
- *
405
- * The return type uses `Hono<any, any, any>` because this sub-app will be
406
- * mounted into a parent app via `.route()`, which accepts any Hono env type.
407
- * Adapter implementations are free to use their own env (e.g. `Hono<HonoEnv>`).
408
- *
409
- * @returns A Hono sub-app with auth routes, or `undefined` to skip route mounting.
410
- */
411
- createAuthRoutes?(): Hono<any, any, any> | undefined;
412
-
413
- /**
414
- * Mount admin routes (e.g. password reset for users).
415
- *
416
- * @returns A Hono sub-app with admin routes, or `undefined` to skip.
417
- */
418
- createAdminRoutes?(): Hono<any, any, any> | undefined;
419
-
420
- // ── Feature Detection ───────────────────────────────────────────────
421
-
422
- /**
423
- * Advertise what this auth adapter supports.
424
- *
425
- * The frontend reads this from `GET /api/auth/config` to dynamically
426
- * show/hide UI elements. This is the bridge between backend capabilities
427
- * and the frontend's `AuthCapabilities` type.
428
- */
429
- getCapabilities(): AuthAdapterCapabilities | Promise<AuthAdapterCapabilities>;
430
-
431
- // ── Lifecycle ───────────────────────────────────────────────────────
432
-
433
- /**
434
- * Called during backend initialization.
435
- * Use for running migrations, creating tables, seeding initial data, etc.
436
- */
437
- initialize?(): Promise<void>;
438
-
439
- /**
440
- * Called during graceful shutdown.
441
- * Use for closing connections, flushing caches, etc.
442
- */
443
- destroy?(): Promise<void>;
444
-
445
- // ── Collection User Creation (for auth collections) ───────────────
446
-
447
- /**
448
- * Prepare values for creating a user via the auth collection's REST API.
449
- *
450
- * Called on POST to a collection with `auth: true`. Handles password
451
- * hashing, email normalization, and any collection/backend-level hooks.
452
- *
453
- * If not implemented, the collection saves values as-is (no password hashing).
454
- *
455
- * @param values - Raw request body from the client.
456
- * @param collectionAuth - The parsed `AuthCollectionConfig` from the collection (if `auth` is an object).
457
- * @returns Processed values ready for `driver.save()`, plus metadata for the post-save step.
458
- */
459
- prepareUserCreation?(
460
- values: Record<string, unknown>,
461
- collectionAuth?: unknown
462
- ): Promise<UserCreationPrepareResult>;
463
-
464
- /**
465
- * Describe what a create body for this auth collection is allowed to name,
466
- * so unknown-field validation can run on it.
467
- *
468
- * A signup body is not the collection's shape: it carries credential fields
469
- * like `password` that the users table never declares as columns, and
470
- * `prepareUserCreation` maps them onto real ones. Validating the raw body
471
- * against the collection alone would reject every legitimate signup — which
472
- * is why the check used to be skipped outright for auth collections. That
473
- * skip was total, so an undeclared field was silently dropped and the write
474
- * still returned 201, while the same typo on a normal collection was a 400.
475
- *
476
- * This narrows the exemption to the fields the adapter actually consumes.
477
- *
478
- * `validate: false` disables the check for this collection, and is the right
479
- * answer when a custom `onCreateUser` hook is configured: the body is then
480
- * the hook's contract, not the collection's, and this layer cannot know what
481
- * the hook accepts.
482
- *
483
- * If not implemented, validation is skipped — the pre-existing behaviour.
484
- *
485
- * @param collectionAuth - The parsed `AuthCollectionConfig` from the collection (if `auth` is an object).
486
- */
487
- describeUserCreationContract?(
488
- collectionAuth?: unknown
489
- ): UserCreationWriteContract;
490
-
491
- /**
492
- * Finalize a user creation after the entity has been persisted.
493
- *
494
- * Handles post-save work: sending invitation emails, generating
495
- * password-reset tokens, or falling back to returning a temporary password.
496
- *
497
- * @param entity - The persisted entity (id + values).
498
- * @param clearPassword - The cleartext password from the prepare step (if any).
499
- * @returns Metadata for the API response (temporary password, invitation status).
500
- */
501
- finalizeUserCreation?(
502
- entity: { id: string; values: Record<string, unknown> },
503
- clearPassword?: string
504
- ): Promise<UserCreationFinalizeResult>;
505
-
506
- // ── Service Key (optional) ──────────────────────────────────────────
507
-
508
- /**
509
- * A static secret key for server-to-server / script authentication.
510
- *
511
- * When set, requests with `Authorization: Bearer <serviceKey>` bypass
512
- * normal token verification and are granted admin-level access.
513
- */
514
- serviceKey?: string;
515
-
516
- // ── Response Transform ───────────────────────────────────────────────
517
-
518
- /**
519
- * Transform the auth response before sending it to the client.
520
- *
521
- * Called after successful login, register, refresh, OAuth, anonymous,
522
- * magic-link, and MFA flows. The hook receives the fully-formed
523
- * response and returns a (potentially enriched) response.
524
- *
525
- * Use cases:
526
- * - Inject tokens from external auth systems (custom provider tokens, etc.)
527
- * - Add project-specific metadata to the response
528
- * - Enrich the user object with data from external sources
529
- *
530
- * The hook runs in the request path — keep it fast.
531
- * Heavy work should be offloaded to `onAuthenticated` (fire-and-forget).
532
- */
533
- transformAuthResponse?(
534
- response: AuthResponsePayload,
535
- context: TransformAuthResponseContext
536
- ): Promise<AuthResponsePayload>;
537
- }
538
-
539
- // ─── Custom Auth Adapter Options ─────────────────────────────────────────────
540
-
541
- /**
542
- * Options for creating a minimal custom auth adapter via `createCustomAuthAdapter()`.
543
- *
544
- * This is the simplest way to plug an existing auth system into Rebase.
545
- * Only `verifyRequest` is required — everything else is optional.
546
- *
547
- * @group Auth
548
- */
549
- export interface CustomAuthAdapterOptions {
550
- /**
551
- * Verify an incoming request and return the authenticated user.
552
- * This is the only required method.
553
- */
554
- verifyRequest: (request: Request) => Promise<AuthenticatedUser | null>;
555
-
556
- /**
557
- * Verify a raw bearer token for WebSocket authentication.
558
- * Optional — if omitted, a synthetic `Request` is constructed and passed
559
- * to `verifyRequest`.
560
- */
561
- verifyToken?: (token: string) => Promise<AuthenticatedUser | null>;
562
-
563
- /** Optional user management for the admin panel. */
564
- userManagement?: UserManagementAdapter;
565
-
566
- /** Static service key for server-to-server auth. */
567
- serviceKey?: string;
568
-
569
- /** Override default capabilities. */
570
- capabilities?: Partial<AuthAdapterCapabilities>;
571
-
572
- /**
573
- * Transform the auth response before sending it to the client.
574
- * Same semantics as `AuthAdapter.transformAuthResponse`.
575
- */
576
- transformAuthResponse?: (
577
- response: AuthResponsePayload,
578
- context: TransformAuthResponseContext
579
- ) => Promise<AuthResponsePayload>;
580
- }