@lunora/auth 1.0.0-alpha.27 → 1.0.0-alpha.271

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 (101) hide show
  1. package/LICENSE.md +233 -104
  2. package/README.md +107 -15
  3. package/dist/adapter.d.mts +4 -43
  4. package/dist/adapter.d.ts +4 -43
  5. package/dist/adapter.mjs +1 -48
  6. package/dist/audit.d.mts +170 -0
  7. package/dist/audit.d.ts +170 -0
  8. package/dist/audit.mjs +1 -0
  9. package/dist/cimd-node.d.mts +1 -0
  10. package/dist/cimd-node.d.ts +1 -0
  11. package/dist/cimd-node.mjs +1 -0
  12. package/dist/cimd-workers.d.mts +64 -0
  13. package/dist/cimd-workers.d.ts +64 -0
  14. package/dist/cimd-workers.mjs +1 -0
  15. package/dist/email-guard.d.mts +143 -0
  16. package/dist/email-guard.d.ts +143 -0
  17. package/dist/email-guard.mjs +1 -0
  18. package/dist/index.d.mts +469 -544
  19. package/dist/index.d.ts +469 -544
  20. package/dist/index.mjs +1 -12
  21. package/dist/middleware.d.mts +165 -155
  22. package/dist/middleware.d.ts +165 -155
  23. package/dist/middleware.mjs +1 -56
  24. package/dist/migrate.d.mts +47 -0
  25. package/dist/migrate.d.ts +47 -0
  26. package/dist/migrate.mjs +1 -0
  27. package/dist/packem_shared/AUTH_DO_AUDIT_PATH-g8a4JMZh.mjs +1 -0
  28. package/dist/packem_shared/DEFAULT_AUTH_BASE_PATH-C3SqYG3N.mjs +1 -0
  29. package/dist/packem_shared/LunoraAuthAdminError-BlqAvB2e.mjs +1 -0
  30. package/dist/packem_shared/adapter-CBZ17jKi.mjs +2 -0
  31. package/dist/packem_shared/adapter.d-CElAPJ1U.d.ts +88 -0
  32. package/dist/packem_shared/adapter.d-CaPwF2v3.d.mts +88 -0
  33. package/dist/packem_shared/api-key-storage-D15k9_CF.mjs +1 -0
  34. package/dist/packem_shared/apiKey-B9uGt5Nc.mjs +1 -0
  35. package/dist/packem_shared/audit-CR2Ajocb.mjs +12 -0
  36. package/dist/packem_shared/auth-do-CNQGEk_e.mjs +1 -0
  37. package/dist/packem_shared/authAuditBeforeHook-C-DhJkg1.mjs +1 -0
  38. package/dist/packem_shared/authCredentialColumns-C7Xz3nVo.mjs +1 -0
  39. package/dist/packem_shared/authDiscoveryPaths-BtKCs_3V.mjs +1 -0
  40. package/dist/packem_shared/authDoColumnAdditions-UwF3Rl41.mjs +1 -0
  41. package/dist/packem_shared/create-auth.d-QQ66RlWp.d.mts +149 -0
  42. package/dist/packem_shared/create-auth.d-QQ66RlWp.d.ts +149 -0
  43. package/dist/packem_shared/createAuth-EjuBT-g8.mjs +1 -0
  44. package/dist/packem_shared/createDoAuthWiring-C6V-YYuv.mjs +1 -0
  45. package/dist/packem_shared/createLunoraAuthClient-Ca1AdNhq.mjs +1 -0
  46. package/dist/packem_shared/createSignUpInvitation-CwrPh0XH.mjs +1 -0
  47. package/dist/packem_shared/effectiveCookieCache-JvL6i6YO.mjs +1 -0
  48. package/dist/packem_shared/emailGateDatabaseHooks-Dvyliwxx.mjs +1 -0
  49. package/dist/packem_shared/handleAuthRequest-Id9Vv_Tk.mjs +1 -0
  50. package/dist/packem_shared/identity-claims-hAvIl2wm.mjs +1 -0
  51. package/dist/packem_shared/invite-only.d-C5_mvDx4.d.mts +126 -0
  52. package/dist/packem_shared/invite-only.d-CYPBrNgv.d.ts +126 -0
  53. package/dist/packem_shared/isDevEnvironment-yLbPngwn.mjs +1 -0
  54. package/dist/packem_shared/legacyIssuerCleanupStatements-D9Kf8OD1.mjs +1 -0
  55. package/dist/packem_shared/mcp-CK5XkDFp.mjs +1 -0
  56. package/dist/packem_shared/on-cloudflare-edge-Dx6gFjBO.mjs +1 -0
  57. package/dist/packem_shared/quote-identifier-CGiYFBvY.mjs +1 -0
  58. package/dist/packem_shared/resolveSessionIdentity-EBhckRBW.mjs +1 -0
  59. package/dist/packem_shared/sessionPresets-DQQYAOER.mjs +1 -0
  60. package/dist/packem_shared/sql-store-uMubPYI9.mjs +1 -0
  61. package/dist/packem_shared/uiConfig-B8pN6pks.mjs +1 -0
  62. package/dist/packem_shared/worker.d-BZ9zDaZC.d.mts +873 -0
  63. package/dist/packem_shared/worker.d-Ckaeq8QN.d.ts +873 -0
  64. package/dist/plugins-client.d.mts +251 -1
  65. package/dist/plugins-client.d.ts +251 -1
  66. package/dist/plugins-client.mjs +1 -2
  67. package/dist/plugins-enterprise-client.d.mts +13 -0
  68. package/dist/plugins-enterprise-client.d.ts +13 -0
  69. package/dist/plugins-enterprise-client.mjs +1 -0
  70. package/dist/plugins-enterprise.d.mts +1669 -0
  71. package/dist/plugins-enterprise.d.ts +1669 -0
  72. package/dist/plugins-enterprise.mjs +1 -0
  73. package/dist/plugins.d.mts +180 -2
  74. package/dist/plugins.d.ts +180 -2
  75. package/dist/plugins.mjs +1 -22
  76. package/dist/schema.d.mts +39 -39
  77. package/dist/schema.d.ts +39 -39
  78. package/dist/schema.mjs +1 -62
  79. package/dist/sql-store.d.mts +43 -28
  80. package/dist/sql-store.d.ts +43 -28
  81. package/dist/sql-store.mjs +1 -184
  82. package/dist/store.d.mts +65 -47
  83. package/dist/store.d.ts +65 -47
  84. package/dist/store.mjs +1 -183
  85. package/dist/turnstile-middleware.d.mts +73 -55
  86. package/dist/turnstile-middleware.d.ts +73 -55
  87. package/dist/turnstile-middleware.mjs +1 -34
  88. package/dist/turnstile.d.mts +42 -49
  89. package/dist/turnstile.d.ts +42 -49
  90. package/dist/turnstile.mjs +1 -54
  91. package/dist/worker.d.mts +9 -0
  92. package/dist/worker.d.ts +9 -0
  93. package/dist/worker.mjs +1 -0
  94. package/package.json +58 -7
  95. package/dist/packem_shared/DEFAULT_AUTH_BASE_PATH-DjcUWEQl.mjs +0 -11
  96. package/dist/packem_shared/LunoraAuthAdminError-D4L7n6gN.mjs +0 -510
  97. package/dist/packem_shared/compileMigrationsSql-B9bj-mJv.mjs +0 -29
  98. package/dist/packem_shared/create-auth.d-Mwhb4gSc.d.mts +0 -128
  99. package/dist/packem_shared/create-auth.d-Mwhb4gSc.d.ts +0 -128
  100. package/dist/packem_shared/createAuth-BVMMllTm.mjs +0 -87
  101. package/dist/packem_shared/sessionPresets-Dwwd74_J.mjs +0 -38
@@ -0,0 +1,873 @@
1
+ import "./adapter.d-CElAPJ1U.js";
2
+ import { LunoraError } from '@lunora/errors';
3
+ import { L as LunoraAuth, a as LunoraAuthOptions } from "./create-auth.d-QQ66RlWp.js";
4
+ import { AuthAuditReader } from "../audit.js";
5
+ import { BetterAuthOptions } from 'better-auth';
6
+ import { SqlExecutor } from "../sql-store.js";
7
+ /**
8
+ * A timestamp as it leaves the admin API: epoch-ms (better-auth stores `Date`s,
9
+ * which we normalize on output) or `null` when the column is unset.
10
+ */
11
+ type AuthTimestamp = null | number;
12
+ /**
13
+ * One user row as the admin API surfaces it. The fixed keys mirror better-auth's
14
+ * core `user` table plus the `admin()` plugin columns (`role`/`banned`/…); the
15
+ * index signature carries any app-defined `user.additionalFields` so callers
16
+ * (the studio) can render them generically. Password material never lives on
17
+ * this row (it's in the `account` table) and is never returned.
18
+ */
19
+ interface AuthAdminUser {
20
+ [key: string]: unknown;
21
+ banExpires?: AuthTimestamp;
22
+ banned?: boolean | null;
23
+ banReason?: null | string;
24
+ createdAt?: AuthTimestamp;
25
+ email?: null | string;
26
+ emailVerified?: boolean | null;
27
+ id: string;
28
+ image?: null | string;
29
+ name?: null | string;
30
+ role?: null | string;
31
+ updatedAt?: AuthTimestamp;
32
+ }
33
+ /**
34
+ * One session row as the admin API surfaces it. Mirrors better-auth's `session`
35
+ * table; `impersonatedBy` is set when the session was minted by
36
+ * {@link AuthAdmin.impersonateUser}. The signing `token` is stripped — it's a
37
+ * bearer credential, and the only place we hand one back is the explicit
38
+ * impersonation flow.
39
+ */
40
+ interface AuthAdminSession {
41
+ [key: string]: unknown;
42
+ createdAt?: AuthTimestamp;
43
+ expiresAt?: AuthTimestamp;
44
+ id: string;
45
+ impersonatedBy?: null | string;
46
+ ipAddress?: null | string;
47
+ userAgent?: null | string;
48
+ userId: string;
49
+ }
50
+ /** One linked account (a credential or OAuth provider). All token material is stripped. */
51
+ interface AuthAccount {
52
+ [key: string]: unknown;
53
+ accountId?: null | string;
54
+ createdAt?: AuthTimestamp;
55
+ id: string;
56
+ providerId?: null | string;
57
+ scope?: null | string;
58
+ userId: string;
59
+ }
60
+ /** One organization row (from the `organization` plugin). */
61
+ interface AuthOrganization {
62
+ [key: string]: unknown;
63
+ createdAt?: AuthTimestamp;
64
+ id: string;
65
+ name?: null | string;
66
+ slug?: null | string;
67
+ }
68
+ /** One organization membership row. */
69
+ interface AuthMember {
70
+ [key: string]: unknown;
71
+ createdAt?: AuthTimestamp;
72
+ id: string;
73
+ organizationId: string;
74
+ role?: null | string;
75
+ userId: string;
76
+ }
77
+ /** One pending organization invitation. */
78
+ interface AuthInvitation {
79
+ [key: string]: unknown;
80
+ email?: null | string;
81
+ expiresAt?: AuthTimestamp;
82
+ id: string;
83
+ organizationId: string;
84
+ role?: null | string;
85
+ status?: null | string;
86
+ }
87
+ /**
88
+ * One sign-up invitation (from the `inviteOnly` plugin). Distinct from
89
+ * {@link AuthInvitation}, which invites an existing account into an organization:
90
+ * this one is what lets an address create an account at all.
91
+ */
92
+ interface AuthSignUpInvitation {
93
+ [key: string]: unknown;
94
+ /** When an account was created for this address; `null` while the invitation is unspent. */
95
+ acceptedAt?: AuthTimestamp;
96
+ createdAt?: AuthTimestamp;
97
+ email?: null | string;
98
+ expiresAt?: AuthTimestamp;
99
+ id: string;
100
+ invitedBy?: null | string;
101
+ /**
102
+ * The plaintext invitation token — present **only** on the row
103
+ * {@link AuthAdmin.createSignUpInvitation} returns, never on a listed one.
104
+ * The stored `tokenHash` is in {@link SENSITIVE_FIELDS}, so it cannot leave
105
+ * this plane by accident.
106
+ */
107
+ token?: string;
108
+ }
109
+ /** One team row (from the `organization` plugin with `teams.enabled`). */
110
+ interface AuthTeam {
111
+ [key: string]: unknown;
112
+ createdAt?: AuthTimestamp;
113
+ id: string;
114
+ name?: null | string;
115
+ organizationId: string;
116
+ }
117
+ /** One team-membership row (teams). */
118
+ interface AuthTeamMember {
119
+ [key: string]: unknown;
120
+ createdAt?: AuthTimestamp;
121
+ id: string;
122
+ teamId: string;
123
+ userId: string;
124
+ }
125
+ /**
126
+ * One custom organization role (from the organization plugin's dynamic
127
+ * access-control). `permission` is a JSON string of a `resource → actions[]` map
128
+ * as stored; the studio parses it for display/editing.
129
+ */
130
+ interface AuthOrgRole {
131
+ [key: string]: unknown;
132
+ createdAt?: AuthTimestamp;
133
+ id: string;
134
+ organizationId: string;
135
+ permission?: null | string;
136
+ role?: null | string;
137
+ }
138
+ /**
139
+ * One API key. The hash (`key`) is stripped: the row is shown by its `start` /
140
+ * `prefix`, and the plaintext was only ever returned to the creator.
141
+ */
142
+ interface AuthApiKey {
143
+ [key: string]: unknown;
144
+ createdAt?: AuthTimestamp;
145
+ enabled?: boolean;
146
+ expiresAt?: AuthTimestamp | null;
147
+ id: string;
148
+ lastRequest?: AuthTimestamp | null;
149
+ name?: null | string;
150
+ prefix?: null | string;
151
+ referenceId: string;
152
+ start?: null | string;
153
+ }
154
+ /** One registered passkey. Credential secrets (`publicKey`) are stripped. */
155
+ interface AuthPasskey {
156
+ [key: string]: unknown;
157
+ createdAt?: AuthTimestamp;
158
+ deviceType?: null | string;
159
+ id: string;
160
+ name?: null | string;
161
+ userId: string;
162
+ }
163
+ /** A page of rows plus the unpaginated total. */
164
+ interface AuthPage<T> {
165
+ rows: T[];
166
+ total: number;
167
+ }
168
+ /**
169
+ * Which admin surfaces a given auth instance supports, derived from the enabled
170
+ * better-auth plugins (and any {@link CreateAuthAdminOptions.features} overrides).
171
+ * The studio calls {@link AuthAdmin.capabilities} once and renders only the
172
+ * panels whose capability is `true` — so a deployment that doesn't enable, say,
173
+ * the `organization` plugin never shows an Organizations section.
174
+ */
175
+ interface AuthCapabilities {
176
+ /** Linked-account browsing/unlinking — core (the `account` table always exists). */
177
+ accounts: boolean;
178
+ /** The `admin()` plugin: ban/role/impersonate/create/delete/set-password. */
179
+ admin: boolean;
180
+ /** The `apiKey()` plugin: per-user API keys, listed and revoked from the user drawer. */
181
+ apiKey: boolean;
182
+ /** The `inviteOnly` plugin: sign-up invitations. */
183
+ inviteOnly: boolean;
184
+ /** The `organization` plugin: orgs, members, invitations. */
185
+ organization: boolean;
186
+ /** The `@better-auth/passkey` plugin: per-user passkeys. */
187
+ passkey: boolean;
188
+ /** The `two-factor` plugin: per-user 2FA status / disable. */
189
+ twoFactor: boolean;
190
+ }
191
+ /**
192
+ * One app/plugin-defined field the create-user form should render, derived from
193
+ * the merged better-auth `user` table (core + plugin + `additionalFields`). Only
194
+ * user-settable columns are surfaced — server-managed flags (`input: false`),
195
+ * foreign keys (`references`), and the core columns the form already handles
196
+ * (`email`/`name`/`role`/ban state/…) are filtered out upstream.
197
+ */
198
+ interface AuthUserFieldSpec {
199
+ /** Logical field name (the key passed back in `createUser`'s `data`). */
200
+ name: string;
201
+ /** Best-effort plugin id the field originates from (`username`, `phone-number`, …); `undefined` for app `additionalFields`. */
202
+ plugin?: string;
203
+ required: boolean;
204
+ /** Coarse input kind the studio maps to a control (checkbox / number / date / text). */
205
+ type: "boolean" | "date" | "number" | "string";
206
+ unique: boolean;
207
+ }
208
+ /**
209
+ * A rich, read-only description of the deployment's auth configuration for the
210
+ * studio's config panel and dynamic create-user form. Unlike
211
+ * {@link AuthCapabilities} (five booleans that gate panels), this exposes *what*
212
+ * is configured — enabled plugins, email/password + social sign-in, the
213
+ * user-settable fields, organization sub-features (teams / custom roles), and
214
+ * the session + rate-limit policy — without ever leaking a secret.
215
+ */
216
+ interface AuthConfigInfo {
217
+ /** The same capability booleans {@link AuthAdmin.capabilities} returns, embedded so a single call drives the whole panel. */
218
+ capabilities: AuthCapabilities;
219
+ /** Whether email + password sign-in is enabled. */
220
+ emailAndPassword: boolean;
221
+ /** Organization plugin sub-features. */
222
+ organization: {
223
+ enabled: boolean;
224
+ /** Custom roles / dynamic access control (`organizationRole` table present). */
225
+ roles: boolean;
226
+ /** Teams (`team` table present). */
227
+ teams: boolean;
228
+ };
229
+ /** Enabled better-auth plugin ids, sorted. */
230
+ plugins: string[];
231
+ /** Rate-limit policy (window is in seconds). */
232
+ rateLimit: {
233
+ enabled: boolean;
234
+ max?: number;
235
+ window?: number;
236
+ };
237
+ /** Session policy (all durations in seconds). */
238
+ session: {
239
+ cookieCache?: boolean;
240
+ expiresIn?: number;
241
+ freshAge?: number;
242
+ updateAge?: number;
243
+ };
244
+ /** Configured social/OAuth provider ids, sorted. */
245
+ socialProviders: string[];
246
+ /** User-settable extra fields for the create-user form (plugin + app `additionalFields`). */
247
+ userFields: AuthUserFieldSpec[];
248
+ }
249
+ /** A scalar value usable in an adapter `where` clause / filter. */
250
+ type WhereValue = boolean | number | string;
251
+ /** Filtering / paging options for {@link AuthAdmin.listUsers}. */
252
+ interface ListUsersOptions {
253
+ /** Column to filter on with `=` (defaults to `email` when `filterValue` is set). */
254
+ filterField?: string;
255
+ /** Exact-match filter value. */
256
+ filterValue?: WhereValue;
257
+ limit?: number;
258
+ offset?: number;
259
+ /** Substring search value (matched with `contains`). */
260
+ search?: string;
261
+ /** Column the `search` substring matches against (default `email`). */
262
+ searchField?: string;
263
+ /** Column to order by (default `createdAt`). */
264
+ sortBy?: string;
265
+ sortDirection?: "asc" | "desc";
266
+ }
267
+ /** The result of {@link AuthAdmin.impersonateUser}: a fresh session token to act as the target user. */
268
+ interface ImpersonationResult {
269
+ expiresAt: AuthTimestamp;
270
+ /** Bearer session token for the impersonated user. The caller is responsible for using it (e.g. setting the cookie). */
271
+ token: string;
272
+ user: AuthAdminUser;
273
+ }
274
+ /**
275
+ * The full read + write surface the studio's auth dashboard drives, backed by
276
+ * better-auth's tables. Returned by {@link createAuthAdmin}. The runtime accepts
277
+ * a structurally-compatible object as its `authAdmin` option and exposes each
278
+ * method behind an admin-token-gated endpoint. Methods whose backing plugin is
279
+ * absent still exist (they're not conditionally omitted) but the studio gates
280
+ * them on {@link AuthAdmin.capabilities}; calling one for an unconfigured plugin
281
+ * surfaces the underlying adapter error.
282
+ */
283
+ interface AuthAdmin {
284
+ /** Directly add an existing user as an org member (server-side, no invitation/acceptance). */
285
+ addMember: (input: {
286
+ organizationId: string;
287
+ role?: string;
288
+ userId: string;
289
+ }) => Promise<AuthMember>;
290
+ /** Add a user to a team. */
291
+ addTeamMember: (input: {
292
+ teamId: string;
293
+ userId: string;
294
+ }) => Promise<AuthTeamMember>;
295
+ banUser: (input: {
296
+ expiresInSeconds?: number;
297
+ reason?: string;
298
+ userId: string;
299
+ }) => Promise<AuthAdminUser>;
300
+ cancelInvitation: (input: {
301
+ invitationId: string;
302
+ }) => Promise<void>;
303
+ capabilities: () => Promise<AuthCapabilities>;
304
+ /** Rich, read-only description of the auth configuration (plugins, fields, session policy, …). */
305
+ config: () => Promise<AuthConfigInfo>;
306
+ /** Create an organization; optionally seed an `owner` member for `ownerId`. */
307
+ createOrganization: (input: {
308
+ logo?: string;
309
+ metadata?: Record<string, unknown>;
310
+ name: string;
311
+ ownerId?: string;
312
+ slug?: string;
313
+ }) => Promise<AuthOrganization>;
314
+ /** Create a custom org role with a permission grant (a `resource → actions[]` map). */
315
+ createOrgRole: (input: {
316
+ organizationId: string;
317
+ permission: Record<string, string[]>;
318
+ role: string;
319
+ }) => Promise<AuthOrgRole>;
320
+ /**
321
+ * Invite an address to sign up, or refresh an existing invitation for it.
322
+ * Needs the `inviteOnly` plugin — without it the row is written to a table
323
+ * nothing reads, which is why the studio gates the panel on
324
+ * {@link AuthCapabilities.inviteOnly}.
325
+ */
326
+ createSignUpInvitation: (input: {
327
+ email: string;
328
+ expiresInSeconds?: number;
329
+ invitedBy?: string;
330
+ }) => Promise<AuthSignUpInvitation>;
331
+ /** Create a team under an organization. */
332
+ createTeam: (input: {
333
+ name: string;
334
+ organizationId: string;
335
+ }) => Promise<AuthTeam>;
336
+ createUser: (input: {
337
+ data?: Record<string, unknown>;
338
+ email: string;
339
+ name: string;
340
+ password?: string;
341
+ role?: string | string[];
342
+ }) => Promise<AuthAdminUser>;
343
+ /**
344
+ * Revoke (delete) one API key by id. Needs the `apiKey()` plugin from `@lunora/auth/plugins`;
345
+ * refuses with `API_KEY_STORAGE_UNSUPPORTED` for a key whose configuration uses
346
+ * `storage: "secondary-storage"`, or when the plugin's storage is unknown.
347
+ */
348
+ deleteApiKey: (input: {
349
+ apiKeyId: string;
350
+ }) => Promise<void>;
351
+ /** Delete an organization and cascade-delete its members, invitations, teams, and custom roles. */
352
+ deleteOrganization: (input: {
353
+ organizationId: string;
354
+ }) => Promise<void>;
355
+ /** Delete a custom org role. */
356
+ deleteOrgRole: (input: {
357
+ roleId: string;
358
+ }) => Promise<void>;
359
+ deletePasskey: (input: {
360
+ passkeyId: string;
361
+ }) => Promise<void>;
362
+ disableTwoFactor: (input: {
363
+ userId: string;
364
+ }) => Promise<void>;
365
+ impersonateUser: (input: {
366
+ userId: string;
367
+ }) => Promise<ImpersonationResult>;
368
+ /** Create a pending email invitation to an org (no acceptance side effects). */
369
+ inviteMember: (input: {
370
+ email: string;
371
+ inviterId?: string;
372
+ organizationId: string;
373
+ role?: string;
374
+ }) => Promise<AuthInvitation>;
375
+ listAccounts: (input: {
376
+ userId: string;
377
+ }) => Promise<AuthAccount[]>;
378
+ /** List a user's API keys (hash stripped). Needs the `apiKey()` plugin. */
379
+ listApiKeys: (input: {
380
+ userId: string;
381
+ }) => Promise<AuthApiKey[]>;
382
+ listInvitations: (options: {
383
+ limit?: number;
384
+ offset?: number;
385
+ organizationId: string;
386
+ }) => Promise<AuthPage<AuthInvitation>>;
387
+ listMembers: (options: {
388
+ limit?: number;
389
+ offset?: number;
390
+ organizationId: string;
391
+ }) => Promise<AuthPage<AuthMember>>;
392
+ listOrganizations: (options: {
393
+ limit?: number;
394
+ offset?: number;
395
+ }) => Promise<AuthPage<AuthOrganization>>;
396
+ /** List an org's custom roles. */
397
+ listOrgRoles: (options: {
398
+ limit?: number;
399
+ offset?: number;
400
+ organizationId: string;
401
+ }) => Promise<AuthPage<AuthOrgRole>>;
402
+ listPasskeys: (input: {
403
+ userId: string;
404
+ }) => Promise<AuthPasskey[]>;
405
+ listSessions: (options: {
406
+ limit?: number;
407
+ offset?: number;
408
+ userId?: string;
409
+ }) => Promise<AuthPage<AuthAdminSession>>;
410
+ /**
411
+ * Sign-up invitations, newest first. Unfiltered on purpose: "pending" is
412
+ * `acceptedAt === null && expiresAt > now`, and applying that after a page
413
+ * would let page 1 come back empty while pending rows sat on page 2. The
414
+ * caller has both columns and can label each row itself.
415
+ */
416
+ listSignUpInvitations: (options: {
417
+ limit?: number;
418
+ offset?: number;
419
+ }) => Promise<AuthPage<AuthSignUpInvitation>>;
420
+ /** List a team's members. */
421
+ listTeamMembers: (options: {
422
+ limit?: number;
423
+ offset?: number;
424
+ teamId: string;
425
+ }) => Promise<AuthPage<AuthTeamMember>>;
426
+ /** List an org's teams. */
427
+ listTeams: (options: {
428
+ limit?: number;
429
+ offset?: number;
430
+ organizationId: string;
431
+ }) => Promise<AuthPage<AuthTeam>>;
432
+ listUsers: (options: ListUsersOptions) => Promise<AuthPage<AuthAdminUser>>;
433
+ removeMember: (input: {
434
+ memberId: string;
435
+ }) => Promise<void>;
436
+ /** Delete a team and its memberships. */
437
+ removeTeam: (input: {
438
+ teamId: string;
439
+ }) => Promise<void>;
440
+ /** Remove a member from a team. */
441
+ removeTeamMember: (input: {
442
+ teamMemberId: string;
443
+ }) => Promise<void>;
444
+ removeUser: (input: {
445
+ userId: string;
446
+ }) => Promise<void>;
447
+ /** Withdraw a sign-up invitation. Not retroactive — an account already created keeps existing; use {@link AuthAdmin.removeUser} for that. */
448
+ revokeSignUpInvitation: (input: {
449
+ email: string;
450
+ }) => Promise<void>;
451
+ revokeUserSession: (input: {
452
+ sessionId: string;
453
+ }) => Promise<void>;
454
+ revokeUserSessions: (input: {
455
+ userId: string;
456
+ }) => Promise<void>;
457
+ setRole: (input: {
458
+ role: string | string[];
459
+ userId: string;
460
+ }) => Promise<AuthAdminUser>;
461
+ setUserPassword: (input: {
462
+ newPassword: string;
463
+ userId: string;
464
+ }) => Promise<void>;
465
+ unbanUser: (input: {
466
+ userId: string;
467
+ }) => Promise<AuthAdminUser>;
468
+ unlinkAccount: (input: {
469
+ accountId: string;
470
+ userId: string;
471
+ }) => Promise<void>;
472
+ /** Change a member's role. */
473
+ updateMemberRole: (input: {
474
+ memberId: string;
475
+ role: string | string[];
476
+ }) => Promise<AuthMember>;
477
+ /** Update an organization's name/slug/logo/metadata. */
478
+ updateOrganization: (input: {
479
+ logo?: string;
480
+ metadata?: Record<string, unknown>;
481
+ name?: string;
482
+ organizationId: string;
483
+ slug?: string;
484
+ }) => Promise<AuthOrganization>;
485
+ /** Replace a custom org role's permission grant. */
486
+ updateOrgRole: (input: {
487
+ permission: Record<string, string[]>;
488
+ roleId: string;
489
+ }) => Promise<AuthOrgRole>;
490
+ /** Rename a team. */
491
+ updateTeam: (input: {
492
+ name: string;
493
+ teamId: string;
494
+ }) => Promise<AuthTeam>;
495
+ updateUser: (input: {
496
+ data: Record<string, unknown>;
497
+ userId: string;
498
+ }) => Promise<AuthAdminUser>;
499
+ }
500
+ /** Options for {@link createAuthAdmin}. */
501
+ interface CreateAuthAdminOptions {
502
+ /**
503
+ * Force individual {@link AuthCapabilities} on or off regardless of which
504
+ * plugins are detected — e.g. `{ impersonate: false }`-style opt-outs by
505
+ * setting `admin: false`, or hiding linked accounts with `accounts: false`.
506
+ * A capability is reported only when both its plugin is enabled *and* its
507
+ * override isn't `false`.
508
+ */
509
+ features?: Partial<AuthCapabilities>;
510
+ /**
511
+ * User id recorded as the impersonator on sessions minted by
512
+ * {@link AuthAdmin.impersonateUser}. Defaults to the impersonated user's own
513
+ * id (a self-reference) since the trusted admin plane has no acting user.
514
+ */
515
+ impersonatedBy?: string;
516
+ /**
517
+ * How long (in seconds) an impersonation session lives. Must be a positive
518
+ * finite integer. Capped at 24 × {@link DEFAULT_IMPERSONATION_SECONDS}
519
+ * (86 400 s / 24 h). Defaults to {@link DEFAULT_IMPERSONATION_SECONDS}
520
+ * (3 600 s / 1 h).
521
+ */
522
+ impersonationSeconds?: number;
523
+ }
524
+ /**
525
+ * A normalized failure from an admin operation. better-auth throws `APIError`s
526
+ * carrying a `body.code` (e.g. `USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL`); we
527
+ * surface that `code` so the runtime can map it onto an HTTP status and the
528
+ * studio can show a meaningful message instead of a generic 500.
529
+ */
530
+ declare class LunoraAuthAdminError extends LunoraError {
531
+ constructor(message: string, code: string);
532
+ }
533
+ /**
534
+ * Build the studio's auth user-management plane on top of better-auth.
535
+ *
536
+ * Pass the result as the runtime's `authAdmin` option; the runtime exposes each
537
+ * method behind an admin-token-gated `/_lunora/admin/auth/*` endpoint. The set
538
+ * of usable surfaces is reported by {@link AuthAdmin.capabilities} — derived
539
+ * from the enabled better-auth plugins, so enabling `admin()`, `organization()`,
540
+ * `twoFactor()`, or the passkey plugin in the auth config is what lights up the
541
+ * matching dashboard panels.
542
+ *
543
+ * **Trust model — important.** These operations talk to better-auth's
544
+ * `internalAdapter` (and `adapter`/password hasher) **directly**, deliberately
545
+ * bypassing the plugins' own endpoints, which require the caller to hold an
546
+ * admin-role session. That session check is the wrong gate here: the runtime
547
+ * already authorizes every call with `LUNORA_ADMIN_TOKEN`, so this helper acts
548
+ * as a trusted server-side operator. It is therefore not an end-user-callable
549
+ * API — never expose it on a path that isn't admin-token gated.
550
+ *
551
+ * `auth.$context` is a promise (better-auth resolves the adapter, password
552
+ * config, etc. lazily); we memoize it so the first call pays the cost once.
553
+ */
554
+ declare const createAuthAdmin: (auth: LunoraAuth, options?: CreateAuthAdminOptions) => AuthAdmin;
555
+ type CookieCache = NonNullable<NonNullable<BetterAuthOptions["session"]>["cookieCache"]>;
556
+ /**
557
+ * The session cookie cache `createAuth` runs `options` with: the caller's own when set, else the default. The
558
+ * default is a 60 s cache, or none with better-auth's `admin()` plugin: the cache serves the pre-ban user and
559
+ * `banUser` deletes sessions the cache does not consult, so a ban would wait out the window. The worker's identity
560
+ * memo derives its window from this too, so the two cannot disagree about whether a ban is immediate.
561
+ */
562
+ declare const effectiveCookieCache: (options: Pick<BetterAuthOptions, "plugins" | "session">) => CookieCache;
563
+ type Row = Record<string, unknown>;
564
+ interface AuthImportResult {
565
+ conflicts: number;
566
+ /** `index` is the row's position in the batch. Messages name the table and a SQLite error class, never row data. */
567
+ errors: {
568
+ index: number;
569
+ message: string;
570
+ table: string;
571
+ }[];
572
+ inserted: number;
573
+ }
574
+ /** What a replace did: rows removed because the snapshot does not hold them, rows written. Any error ⇒ nothing changed. */
575
+ interface AuthReplaceResult {
576
+ deleted: number;
577
+ errors: {
578
+ index: number;
579
+ message: string;
580
+ table: string;
581
+ }[];
582
+ inserted: number;
583
+ }
584
+ /** What the runtime's admin export / import reads and writes auth rows through. */
585
+ interface AuthDataPortLike {
586
+ exportRows: () => AsyncIterable<{
587
+ doc: Row;
588
+ table: string;
589
+ }>;
590
+ importRows: (rows: ReadonlyArray<{
591
+ doc: Row;
592
+ table: string;
593
+ }>) => Promise<AuthImportResult>;
594
+ /**
595
+ * Absent when the store has no atomic unit to replace in (an executor without `batch`). With
596
+ * `dryRun`, only checks that every row names a table it would write, and writes nothing.
597
+ */
598
+ replaceRows?: (rows: ReadonlyArray<{
599
+ doc: Row;
600
+ table: string;
601
+ }>, options?: {
602
+ dryRun?: boolean;
603
+ }) => Promise<AuthReplaceResult>;
604
+ }
605
+ declare const authTableNames: (options: LunoraAuthOptions) => string[];
606
+ /**
607
+ * The physical names of the {@link LIVE_CREDENTIAL_TABLES} — never exported, and
608
+ * cleared by a replace.
609
+ * @param options The resolved auth options — a built instance's `auth.options`.
610
+ */
611
+ declare const authCredentialTableNames: (options: LunoraAuthOptions) => string[];
612
+ /** Physical table name → physical column names never exported nor imported. */
613
+ type CredentialColumns = Readonly<Record<string, ReadonlyArray<string>>>;
614
+ /**
615
+ * The {@link LIVE_CREDENTIAL_COLUMNS} by physical name, so a renamed `account`
616
+ * model or a renamed token field is still recognised.
617
+ * @param options The resolved auth options — a built instance's `auth.options`.
618
+ */
619
+ declare const authCredentialColumns: (options: LunoraAuthOptions) => Record<string, string[]>;
620
+ /**
621
+ * The auth data port over the auth D1 database (or any {@link SqlExecutor}).
622
+ * @param executor The auth database, e.g. `d1Executor(env.DB)`.
623
+ * @param tables The auth tables to carry, parents first — {@link authTableNames}, minus any the schema already declares (those travel as ordinary table rows).
624
+ * @param credentialTables The live-credential tables a replace clears — {@link authCredentialTableNames}, minus the same.
625
+ * @param credentialColumns The provider-token columns an export nulls and an import drops — {@link authCredentialColumns}.
626
+ */
627
+ declare const createSqlAuthDataPort: (executor: SqlExecutor, tables: ReadonlyArray<string>, credentialTables?: ReadonlyArray<string>, credentialColumns?: CredentialColumns) => AuthDataPortLike;
628
+ /**
629
+ * The exact `.well-known` paths this auth configuration serves outside its base
630
+ * path: the protected-resource metadata for each MCP resource, and the
631
+ * authorization-server metadata for the issuer. Empty unless an
632
+ * `oauthProvider()` or `mcp()` plugin is configured.
633
+ * @throws LunoraError `AUTH_MCP_RESOURCE_AMBIGUOUS` — see {@link mcpResourceOf}.
634
+ */
635
+ declare const authDiscoveryPaths: (options: LunoraAuthOptions) => ReadonlyArray<string>;
636
+ /**
637
+ * Derive {@link authDiscoveryPaths} for an `.auth()` declaration, memoised on the
638
+ * declaration object. A generated worker builds its options again for every new
639
+ * `env` object, and calling `options(env)` each time would rebuild every plugin.
640
+ */
641
+ declare const authDiscoveryPathsFor: <Env>(declaration: {
642
+ options: (env: Env) => LunoraAuthOptions;
643
+ }, env: Env) => ReadonlyArray<string>;
644
+ /**
645
+ * Serve an OAuth discovery document from `auth` when `request` asks for one of the
646
+ * paths {@link authDiscoveryPaths} derives from its options; `undefined` for
647
+ * anything else, so the caller's own 404 stands. A 404 from better-auth itself is
648
+ * also passed over as `undefined`.
649
+ */
650
+ declare const handleAuthDiscoveryRequest: (auth: LunoraAuth, request: Request) => Promise<Response | undefined>;
651
+ /** What one table looked like after a copy call. */
652
+ interface AuthMoveTableReport {
653
+ /** Rows that collided with a row the pinned object holds on its own, kept as they are (only under `force`). */
654
+ conflicts: number;
655
+ /** Rows this call inserted into the target. */
656
+ copied: number;
657
+ /** Rows this call deleted from the target because the source deleted them since they were copied. */
658
+ deleted: number;
659
+ /** Rows in the source object. */
660
+ sourceRows: number;
661
+ table: string;
662
+ /** Rows in the target object after this call. */
663
+ targetRows: number;
664
+ /** Rows this call read that the target already held exactly. */
665
+ unchanged: number;
666
+ /** Rows this call updated in the target because the source changed them since they were copied. */
667
+ updated: number;
668
+ }
669
+ /** The answer to one copy call. */
670
+ interface AuthMoveResult {
671
+ /** `true` once every table is copied and matches the source's fingerprint; otherwise call again. */
672
+ done: boolean;
673
+ tables: AuthMoveTableReport[];
674
+ }
675
+ /** The worker-side move between the un-pinned and the pinned auth object. */
676
+ interface AuthJurisdictionMove {
677
+ /**
678
+ * Copy every table from the un-pinned object into the pinned one. Refuses, unless
679
+ * `force` is set, a pinned object holding users the copy did not write, and a row
680
+ * that collides with one.
681
+ */
682
+ copy: (options?: {
683
+ force?: boolean;
684
+ }) => Promise<AuthMoveResult>;
685
+ /**
686
+ * Drop every table in the un-pinned object. Refused unless every table was copied
687
+ * and still matches what was copied.
688
+ */
689
+ purge: () => Promise<{
690
+ dropped: string[];
691
+ }>;
692
+ }
693
+ /**
694
+ * The claims both built-in wirings (D1 and the auth Durable Object) put on the
695
+ * Lunora identity, derived from one better-auth `getSession` result. Each optional
696
+ * claim is absent — never `undefined`, `null` or `""` — when the session does not
697
+ * carry it, so the identity header stays minimal and an absent claim reads as absent.
698
+ */
699
+ type SessionIdentity = {
700
+ /** Profile claim `ctx.auth.getIdentity()` is documented to carry. */
701
+ email?: string;
702
+ /**
703
+ * The session's expiry (epoch ms). The runtime forwards it as the socket's
704
+ * credential expiry (`x-lunora-identity-exp`); without it a signed-out, banned or
705
+ * lapsed user keeps streaming RLS-scoped rows over an already-open WebSocket.
706
+ */
707
+ expiresAtMs?: number;
708
+ /** Profile claim `ctx.auth.getIdentity()` is documented to carry. */
709
+ name?: string;
710
+ /**
711
+ * The session's active organization (`organization()` plugin), present only
712
+ * while the user is still a member of it. Named `orgId` because that is the claim
713
+ * the `@lunora/jwt-auth` presets emit, so tenant-scoped code reads one name
714
+ * whichever authority issued the identity.
715
+ */
716
+ orgId?: string;
717
+ /**
718
+ * better-auth's `admin()` column, comma-joined for several roles — what
719
+ * `rls(policies, { roles })` and `auth.can(...)` read. Only an administrator can
720
+ * write it.
721
+ */
722
+ role?: string;
723
+ /**
724
+ * The session's active team (`organization({ teams: { enabled: true } })`),
725
+ * present only while it belongs to `orgId` and the user is still on it.
726
+ */
727
+ teamId?: string;
728
+ userId: string;
729
+ };
730
+ /**
731
+ * Resolve a request's session to the Lunora identity: `ctx.auth.userId` plus the
732
+ * claims `ctx.auth.getIdentity()` returns. Both built-in wirings (the D1 resolver
733
+ * codegen emits and the auth Durable Object) call this.
734
+ *
735
+ * `orgId` / `teamId` are checked against the store before they are emitted, because
736
+ * the session's `activeOrganizationId` / `activeTeamId` outlive the membership they
737
+ * stand for. better-auth (1.7.7) clears them only on the caller's own current
738
+ * session: a member removed by someone else, the other sessions of a member who
739
+ * left, every member of a deleted organization, and anyone removed through
740
+ * `createAuthAdmin` or SCIM (which write the tables directly, past any endpoint
741
+ * hook) keep them. `setActiveOrganization` never clears `activeTeamId` either, so a
742
+ * switch leaves the previous organization's team behind. Checking here covers every
743
+ * one of those paths; clearing sessions on removal would cover only the endpoints,
744
+ * and the session cookie cache would still serve the old value on top.
745
+ *
746
+ * The cost is one `member` read (plus `team` and `teamMember` when a team is active)
747
+ * per resolution of a session that has an active organization, and the worker
748
+ * memoises resolutions per credential, so the claim can lag a removal by up to that
749
+ * memo window. A read that throws propagates rather than emitting an unchecked claim.
750
+ * @param auth The better-auth instance.
751
+ * @param headers The request headers carrying the session.
752
+ * @returns The identity, or `null` for an anonymous request.
753
+ */
754
+ declare const resolveSessionIdentity: (auth: LunoraAuth, headers: Headers, claims?: ReadonlyArray<string>) => Promise<SessionIdentity | null>;
755
+ /** The slice of a Durable Object namespace this needs — structural, so tests need no runtime. */
756
+ interface AuthNamespaceLike {
757
+ get(this: void, id: unknown): {
758
+ fetch: (request: Request) => Promise<Response>;
759
+ };
760
+ idFromName(this: void, name: string): unknown;
761
+ /** Jurisdiction-restricted subnamespace. Optional only so older binding types still fit; {@link createDoAuthWiring} fails closed without it when a jurisdiction is set. */
762
+ jurisdiction?(this: void, jurisdiction: AuthJurisdiction): AuthNamespaceLike;
763
+ }
764
+ /**
765
+ * Cloudflare Durable Object data-residency jurisdiction. Widening union —
766
+ * Cloudflare adds values over time.
767
+ */
768
+ type AuthJurisdiction = "eu" | "fedramp" | "us";
769
+ /** What {@link createDoAuthWiring} needs, already resolved against `env`. */
770
+ interface DoAuthWiringOptions {
771
+ /**
772
+ * App-declared user columns to forward onto the identity, the same names the D1
773
+ * wiring passes to `resolveSessionIdentity`. Sent to the object as the `claims`
774
+ * query parameter on the internal session route. Empty or absent: none forwarded.
775
+ */
776
+ claims?: ReadonlyArray<string>;
777
+ /**
778
+ * The OAuth discovery paths the object serves outside `/api/auth` —
779
+ * `authDiscoveryPaths(options)` over the same auth options the object builds.
780
+ * Derived in the worker so a probe of any other path never costs a round-trip
781
+ * to the object. Empty or absent: nothing is forwarded.
782
+ */
783
+ discoveryPaths?: ReadonlyArray<string>;
784
+ /**
785
+ * Shared secret presented on the object's internal session route. `undefined`
786
+ * means identity resolution fails closed — see {@link DoAuthWiring.resolveIdentity}.
787
+ */
788
+ internalSecret: string | undefined;
789
+ /**
790
+ * Pin the auth object to a data-residency jurisdiction — pass the worker's
791
+ * `jurisdiction`. The object holds users, sessions, and credentials, so it must
792
+ * live where the rest of the app's data does. The same name maps to a different
793
+ * object per jurisdiction, so toggling this on an existing deployment starts a
794
+ * fresh, empty auth object.
795
+ */
796
+ jurisdiction?: AuthJurisdiction;
797
+ /** The bound namespace, or `undefined` when the binding is absent from `env`. */
798
+ namespace: AuthNamespaceLike | undefined;
799
+ /**
800
+ * Name of the object instance holding the auth tables. Defaults to `"auth"`.
801
+ *
802
+ * One object owns the whole auth schema, so this exists to let an app pick the
803
+ * name (or run separate objects per deployment/tenant) rather than being pinned to
804
+ * a hardcoded one.
805
+ */
806
+ objectName?: string;
807
+ }
808
+ /** The worker options DO-backed auth replaces. */
809
+ interface DoAuthWiring {
810
+ /**
811
+ * Reads the audit log out of the object, so the studio's audit feed works in DO
812
+ * mode. Answers an empty page rather than throwing when the object is unreachable
813
+ * or no secret is configured — an unavailable feed should read as empty, not 500
814
+ * the studio.
815
+ */
816
+ auditReader: AuthAuditReader;
817
+ /**
818
+ * Forwards `/api/auth/*` to the object; `undefined` for anything else.
819
+ *
820
+ * The base path is fixed. It was configurable on both halves of DO-backed auth
821
+ * and settable on neither: codegen's `AuthDeclaration` has no field for it, so
822
+ * the emitted `createDoAuthWiring(...)` never passed one and an `AuthDO`
823
+ * subclass that set its own served nothing.
824
+ */
825
+ authHandler: (request: Request) => Promise<Response | undefined>;
826
+ /**
827
+ * Reads every table of the object out, and writes rows back, for the worker's
828
+ * admin export / import (`authData`). Present only with an internal secret and
829
+ * a bound namespace; reaches the pinned object when auth is pinned.
830
+ */
831
+ dataPort?: AuthDataPortLike;
832
+ /**
833
+ * Forwards a `GET`/`HEAD` for one of {@link DoAuthWiringOptions.discoveryPaths}
834
+ * to the object; `undefined` for anything else, and for the object's 404. The
835
+ * worker calls it only after the app's own routes missed.
836
+ */
837
+ discoveryHandler: (request: Request) => Promise<Response | undefined>;
838
+ /**
839
+ * Copy the auth tables from the un-pinned object into the pinned one, and later
840
+ * purge the un-pinned copy. Present only when a `jurisdiction` is set. Backs the
841
+ * worker's `copyAuthToJurisdiction` and `purgeUnpinnedAuth` admin ops.
842
+ */
843
+ jurisdictionMove?: AuthJurisdictionMove;
844
+ /**
845
+ * Resolves a request's identity by asking the object. `null` when anonymous,
846
+ * unreachable, or ungated.
847
+ *
848
+ * The claims are the D1 wiring's ({@link SessionIdentity}); each is absent when
849
+ * the session does not carry it.
850
+ */
851
+ resolveIdentity: (request: Request) => Promise<SessionIdentity | null>;
852
+ }
853
+ /**
854
+ * Build the worker-side wiring for an auth Durable Object.
855
+ *
856
+ * Every failure path answers "not authenticated" rather than throwing: this runs on
857
+ * the request path for every request that touches `ctx.auth`, and a throw there would
858
+ * turn a misconfiguration into a 500 on traffic that has nothing to do with auth.
859
+ * The exception is a `jurisdiction` the namespace cannot express, which throws here.
860
+ * @param options The resolved namespace, secret, and names.
861
+ * @returns The `authHandler` / `resolveIdentity` pair.
862
+ */
863
+ declare const createDoAuthWiring: (options: DoAuthWiringOptions) => DoAuthWiring;
864
+ /**
865
+ * Route an inbound `Request` to better-auth if the path falls under
866
+ * `basePath`; otherwise return `undefined` so the caller can continue dispatching.
867
+ *
868
+ * Better-auth handles arbitrarily nested paths (`/api/auth/sign-in/email`,
869
+ * `/api/auth/callback/github`, …), so we use prefix matching instead of the
870
+ * exact-path map `createWorker` consumes for top-level routes.
871
+ */
872
+ declare const handleAuthRequest: (auth: LunoraAuth, request: Request, basePath?: string) => Promise<Response | undefined>;
873
+ export { AuthAccount as A, DoAuthWiringOptions as B, CookieCache as C, DoAuthWiring as D, LunoraAuthAdminError as E, authCredentialColumns as F, authCredentialTableNames as G, authDiscoveryPaths as H, ImpersonationResult as I, authDiscoveryPathsFor as J, authTableNames as K, ListUsersOptions as L, createAuthAdmin as M, createDoAuthWiring as N, createSqlAuthDataPort as O, effectiveCookieCache as P, handleAuthDiscoveryRequest as Q, handleAuthRequest as R, SessionIdentity as S, resolveSessionIdentity as T, AuthAdmin as a, AuthAdminSession as b, AuthAdminUser as c, AuthApiKey as d, AuthCapabilities as e, AuthConfigInfo as f, AuthDataPortLike as g, AuthImportResult as h, AuthInvitation as i, AuthJurisdiction as j, AuthJurisdictionMove as k, AuthMember as l, AuthMoveResult as m, AuthMoveTableReport as n, AuthNamespaceLike as o, AuthOrgRole as p, AuthOrganization as q, AuthPage as r, AuthPasskey as s, AuthReplaceResult as t, AuthSignUpInvitation as u, AuthTeam as v, AuthTeamMember as w, AuthTimestamp as x, AuthUserFieldSpec as y, CreateAuthAdminOptions as z };