@xylex-group/athena 2.6.0 → 2.8.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 (44) hide show
  1. package/README.md +210 -17
  2. package/dist/browser.cjs +2102 -527
  3. package/dist/browser.cjs.map +1 -1
  4. package/dist/browser.d.cts +8 -7
  5. package/dist/browser.d.ts +8 -7
  6. package/dist/browser.js +2096 -528
  7. package/dist/browser.js.map +1 -1
  8. package/dist/cli/index.cjs +2116 -559
  9. package/dist/cli/index.cjs.map +1 -1
  10. package/dist/cli/index.d.cts +3 -3
  11. package/dist/cli/index.d.ts +3 -3
  12. package/dist/cli/index.js +2116 -559
  13. package/dist/cli/index.js.map +1 -1
  14. package/dist/cookies.cjs +10 -3
  15. package/dist/cookies.cjs.map +1 -1
  16. package/dist/cookies.js +10 -3
  17. package/dist/cookies.js.map +1 -1
  18. package/dist/index.cjs +2694 -748
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +8 -7
  21. package/dist/index.d.ts +8 -7
  22. package/dist/index.js +2688 -749
  23. package/dist/index.js.map +1 -1
  24. package/dist/model-form-DMed05gE.d.cts +3037 -0
  25. package/dist/model-form-DXPlOnlI.d.ts +3037 -0
  26. package/dist/{pipeline-Ce3pTw5h.d.ts → pipeline-CkMnhwPI.d.ts} +1 -1
  27. package/dist/{pipeline-D1ZYeoH7.d.cts → pipeline-D4sJRKqN.d.cts} +1 -1
  28. package/dist/react-email-DZhDDlEl.d.cts +417 -0
  29. package/dist/react-email-Lrz9A-BW.d.ts +417 -0
  30. package/dist/react.cjs +178 -71
  31. package/dist/react.cjs.map +1 -1
  32. package/dist/react.d.cts +22 -5
  33. package/dist/react.d.ts +22 -5
  34. package/dist/react.js +92 -5
  35. package/dist/react.js.map +1 -1
  36. package/dist/{types-CUuo4NDi.d.cts → types-BzY6fETM.d.ts} +47 -5
  37. package/dist/{types-DapchQY5.d.ts → types-CAtTGGoz.d.cts} +47 -5
  38. package/dist/{types-DSX6AT5B.d.cts → types-vikz9YIO.d.cts} +23 -1
  39. package/dist/{types-DSX6AT5B.d.ts → types-vikz9YIO.d.ts} +23 -1
  40. package/package.json +194 -193
  41. package/dist/model-form-BaHWi3gm.d.cts +0 -1383
  42. package/dist/model-form-Dh6gWjL0.d.ts +0 -1383
  43. package/dist/react-email-B8O1Jeff.d.cts +0 -1230
  44. package/dist/react-email-CDEF0jij.d.ts +0 -1230
@@ -1,1383 +0,0 @@
1
- import { d as AthenaGatewayErrorCode, J as AthenaGatewayEndpointPath, K as AthenaGatewayMethod, e as AthenaGatewayErrorDetails, Y as AthenaGatewayResponse, O as AnyModelDef, E as RowOf, q as InsertOf, U as UpdateOf } from './types-DSX6AT5B.cjs';
2
-
3
- type AthenaAuthMethod = 'GET' | 'POST';
4
- type AthenaAuthCredentials = 'omit' | 'same-origin' | 'include';
5
- type AthenaAuthQueryPrimitive = string | number | boolean;
6
- type AthenaAuthQueryValue = AthenaAuthQueryPrimitive | AthenaAuthQueryPrimitive[] | null | undefined;
7
- type AthenaAuthEndpointPath = '/sign-in/social' | '/sign-in/email' | '/sign-in/username' | '/sign-up/email' | '/get-session' | '/sign-out' | '/forget-password' | '/reset-password' | '/verify-email' | '/send-verification-email' | '/change-email' | '/change-email/verify' | '/change-password' | '/set-password' | '/update-user' | '/delete-user' | '/delete-user/verify' | '/delete-user/callback' | '/email-list' | '/email/list' | '/list-sessions' | '/revoke-session' | '/revoke-sessions' | '/revoke-other-sessions' | '/link-social' | '/list-accounts' | '/unlink-account' | '/refresh-token' | '/get-access-token' | '/two-factor/get-totp-uri' | '/two-factor/verify-totp' | '/two-factor/send-otp' | '/two-factor/verify-otp' | '/two-factor/verify-backup-code' | '/two-factor/generate-backup-codes' | '/two-factor/enable' | '/two-factor/disable' | '/passkey/generate-register-options' | '/passkey/generate-authenticate-options' | '/passkey/verify-registration' | '/passkey/verify-authentication' | '/passkey/list-user-passkeys' | '/passkey/delete-passkey' | '/passkey/update-passkey' | '/.well-known/webauthn' | '/admin/set-role' | '/admin/list-users' | '/admin/list-user-sessions' | '/admin/create-user' | '/admin/unban-user' | '/admin/ban-user' | '/admin/impersonate-user' | '/admin/stop-impersonating' | '/admin/revoke-user-session' | '/admin/revoke-user-sessions' | '/admin/remove-user' | '/admin/set-user-password' | '/admin/has-permission' | '/admin/api-key/create' | '/admin/athena-client/create' | '/admin/athena-client/list' | '/admin/audit-log/list' | '/admin/email/get' | '/admin/email/create' | '/admin/email/update' | '/admin/email/delete' | '/admin/email-failure/list' | '/admin/email-failure/get' | '/admin/email-failure/create' | '/admin/email-failure/update' | '/admin/email-failure/delete' | '/admin/email-template/get' | '/admin/email-template/create' | '/admin/email-template/delete' | '/admin/email-template/list' | '/admin/email-template/update' | '/admin/email/list' | '/api-key/create' | '/api-key/get' | '/api-key/update' | '/api-key/delete' | '/api-key/list' | '/api-key/verify' | '/api-key/delete-all-expired-api-keys' | '/organization/create' | '/organization/check-slug' | '/organization/list' | '/organization/set-active' | '/organization/get-full-organization' | '/organization/update' | '/organization/delete' | '/organization/invite-member' | '/organization/accept-invitation' | '/organization/cancel-invitation' | '/organization/reject-invitation' | '/organization/get-invitation' | '/organization/list-invitations' | '/organization/list-user-invitations' | '/organization/list-members' | '/organization/remove-member' | '/organization/update-member-role' | '/organization/get-active-member' | '/organization/leave' | '/organization/has-permission' | `/callback/${string}` | '/health' | '/ok' | '/error' | `/reset-password/${string}`;
8
- type AthenaAuthErrorCode = 'NETWORK_ERROR' | 'HTTP_ERROR' | 'INVALID_JSON' | 'UNKNOWN_ERROR';
9
- interface AthenaAuthErrorDetails {
10
- code: AthenaAuthErrorCode;
11
- message: string;
12
- status: number;
13
- endpoint?: AthenaAuthEndpointPath;
14
- method?: AthenaAuthMethod;
15
- requestId?: string;
16
- hint?: string;
17
- cause?: string;
18
- }
19
- interface AthenaAuthResult<T = unknown> {
20
- ok: boolean;
21
- status: number;
22
- data: T | null;
23
- error: string | null;
24
- errorDetails?: AthenaAuthErrorDetails | null;
25
- raw: unknown;
26
- }
27
- interface AthenaAuthUser {
28
- id: string;
29
- email: string;
30
- name?: string | null;
31
- image?: string | null;
32
- emailVerified?: boolean;
33
- createdAt?: string;
34
- updatedAt?: string;
35
- username?: string | null;
36
- displayUsername?: string | null;
37
- twoFactorEnabled?: boolean;
38
- role?: string | null;
39
- banned?: boolean;
40
- banReason?: string | null;
41
- banExpires?: string | null;
42
- }
43
- interface AthenaAuthSession {
44
- id: string;
45
- expiresAt?: string;
46
- token?: string;
47
- createdAt?: string;
48
- updatedAt?: string;
49
- ipAddress?: string | null;
50
- userAgent?: string | null;
51
- userId?: string;
52
- impersonatedBy?: string | null;
53
- activeOrganizationId?: string | null;
54
- }
55
- interface AthenaAuthSessionResponse {
56
- session: AthenaAuthSession;
57
- user: AthenaAuthUser;
58
- }
59
- interface AthenaAuthOrganization {
60
- id: string;
61
- name: string;
62
- slug: string;
63
- logo?: string | null;
64
- metadata?: Record<string, unknown> | null;
65
- createdAt?: string;
66
- updatedAt?: string;
67
- }
68
- interface AthenaAuthOrganizationMember {
69
- id: string;
70
- organizationId?: string;
71
- userId?: string;
72
- role?: string | string[] | null;
73
- createdAt?: string;
74
- updatedAt?: string;
75
- user?: AthenaAuthUser;
76
- }
77
- interface AthenaAuthOrganizationInvitation {
78
- id: string;
79
- email?: string;
80
- role?: string | string[] | null;
81
- organizationId?: string;
82
- inviterId?: string;
83
- teamId?: string | null;
84
- status?: string;
85
- expiresAt?: string;
86
- createdAt?: string;
87
- updatedAt?: string;
88
- }
89
- interface AthenaEmailSignInRequest {
90
- email: string;
91
- password: string;
92
- callbackURL?: string;
93
- rememberMe?: boolean;
94
- }
95
- interface AthenaUsernameSignInRequest {
96
- username: string;
97
- password: string;
98
- rememberMe?: boolean;
99
- }
100
- interface AthenaSocialSignInRequest {
101
- provider: string;
102
- callbackURL?: string;
103
- newUserCallbackURL?: string;
104
- errorCallbackURL?: string;
105
- disableRedirect?: boolean;
106
- idToken?: string;
107
- scopes?: string[] | string;
108
- requestSignUp?: boolean;
109
- loginHint?: string;
110
- }
111
- interface AthenaEmailSignUpRequest {
112
- name: string;
113
- email: string;
114
- password: string;
115
- callbackURL?: string;
116
- }
117
- interface AthenaAuthSignInResponse {
118
- redirect: false;
119
- token: string;
120
- url?: string | null;
121
- user: AthenaAuthUser;
122
- }
123
- interface AthenaAuthSocialRedirectResponse {
124
- url: string;
125
- redirect: boolean;
126
- }
127
- interface AthenaAuthSignOutResponse {
128
- success: boolean;
129
- }
130
- interface AthenaAuthStatusResponse {
131
- status: boolean;
132
- }
133
- interface AthenaAuthRevokeSessionRequest {
134
- token: string;
135
- }
136
- interface AthenaForgetPasswordRequest {
137
- email: string;
138
- redirectTo?: string;
139
- }
140
- interface AthenaResetPasswordRequest {
141
- newPassword: string;
142
- token?: string;
143
- }
144
- interface AthenaVerifyEmailRequest {
145
- token: string;
146
- callbackURL?: string;
147
- }
148
- interface AthenaSendVerificationEmailRequest {
149
- email: string;
150
- callbackURL?: string;
151
- }
152
- interface AthenaChangeEmailRequest {
153
- newEmail: string;
154
- callbackURL?: string;
155
- }
156
- interface AthenaChangePasswordRequest {
157
- newPassword: string;
158
- currentPassword: string;
159
- revokeOtherSessions?: boolean;
160
- }
161
- interface AthenaUpdateUserRequest {
162
- name?: string;
163
- image?: string;
164
- }
165
- interface AthenaDeleteUserRequest {
166
- callbackURL?: string;
167
- password?: string;
168
- token?: string;
169
- }
170
- interface AthenaDeleteUserCallbackRequest {
171
- token?: string;
172
- callbackURL?: string;
173
- }
174
- interface AthenaDeleteUserResponse {
175
- success: boolean;
176
- message?: string;
177
- }
178
- interface AthenaAuthEmailChangeResponse {
179
- status: boolean;
180
- message?: string | null;
181
- }
182
- interface AthenaLinkSocialRequest {
183
- provider: string;
184
- callbackURL?: string;
185
- scopes?: string[] | string;
186
- }
187
- interface AthenaUnlinkAccountRequest {
188
- providerId: string;
189
- accountId?: string;
190
- }
191
- interface AthenaOAuthAccountTokenRequest {
192
- providerId: string;
193
- accountId?: string;
194
- userId?: string;
195
- }
196
- interface AthenaOAuthTokenBundle {
197
- tokenType?: string;
198
- idToken?: string;
199
- accessToken?: string;
200
- refreshToken?: string;
201
- accessTokenExpiresAt?: string;
202
- refreshTokenExpiresAt?: string;
203
- }
204
- interface AthenaAuthLinkedAccount {
205
- id: string;
206
- provider?: string;
207
- accountId?: string;
208
- scopes?: string[];
209
- createdAt?: string;
210
- updatedAt?: string;
211
- }
212
- type AthenaAuthPermissionSet = Record<string, unknown> | string[];
213
- type AthenaAuthLooseRecord = Record<string, unknown>;
214
- type AthenaAuthReactEmailProps = Record<string, unknown>;
215
- interface AthenaSetPasswordRequest {
216
- newPassword: string;
217
- }
218
- interface AthenaAuthTokenQuery {
219
- token: string;
220
- }
221
- interface AthenaAuthTokenVerificationResponse {
222
- status: boolean;
223
- message: string;
224
- }
225
- interface AthenaAuthEmailListQuery {
226
- limit?: number;
227
- offset?: number;
228
- }
229
- interface AthenaAuthEmailListResponse {
230
- total: number;
231
- limit: number;
232
- offset: number;
233
- emails: AthenaAuthLooseRecord[];
234
- }
235
- interface AthenaAuthHealthResponse {
236
- status?: string;
237
- service?: string;
238
- version?: string;
239
- }
240
- interface AthenaAuthOkResponse {
241
- ok: boolean;
242
- }
243
- interface AthenaAuthErrorResponse {
244
- message: string;
245
- }
246
- interface AthenaAuthCallbackProviderRequest {
247
- provider: string;
248
- code: string;
249
- state: string;
250
- }
251
- interface AthenaAuthCallbackProviderResponse {
252
- token?: string;
253
- user?: AthenaAuthLooseRecord;
254
- }
255
- interface AthenaTwoFactorGetTotpUriRequest {
256
- password: string;
257
- }
258
- interface AthenaTwoFactorGetTotpUriResponse {
259
- totpURI?: string;
260
- }
261
- interface AthenaTwoFactorVerifyTotpRequest {
262
- code: string;
263
- trustDevice?: string;
264
- }
265
- interface AthenaTwoFactorVerifyTotpResponse {
266
- status?: boolean;
267
- }
268
- interface AthenaTwoFactorVerifyOtpRequest {
269
- code: string;
270
- trustDevice?: string;
271
- }
272
- interface AthenaTwoFactorVerifyOtpResponse {
273
- token: string;
274
- user: AthenaAuthUser;
275
- }
276
- interface AthenaTwoFactorVerifyBackupCodeRequest {
277
- code: string;
278
- disableSession?: string;
279
- trustDevice?: string;
280
- }
281
- interface AthenaTwoFactorSessionSnapshot {
282
- token: string;
283
- userId: string;
284
- createdAt: string;
285
- expiresAt: string;
286
- }
287
- interface AthenaTwoFactorVerifyBackupCodeResponse {
288
- user: AthenaAuthUser;
289
- session: AthenaTwoFactorSessionSnapshot;
290
- }
291
- interface AthenaTwoFactorGenerateBackupCodesRequest {
292
- password: string;
293
- }
294
- interface AthenaTwoFactorGenerateBackupCodesResponse {
295
- status: true;
296
- backupCodes: string[];
297
- }
298
- interface AthenaTwoFactorEnableRequest {
299
- password: string;
300
- issuer?: string;
301
- }
302
- interface AthenaTwoFactorEnableResponse {
303
- totpURI?: string;
304
- backupCodes?: string[];
305
- }
306
- interface AthenaTwoFactorDisableRequest {
307
- password: string;
308
- }
309
- interface AthenaTwoFactorDisableResponse {
310
- status?: boolean;
311
- }
312
- interface AthenaPasskeyCredentialDescriptor {
313
- id?: string;
314
- type?: string;
315
- transports?: string[];
316
- }
317
- interface AthenaPasskeyPublicKeyCredentialParam {
318
- type?: string;
319
- alg?: number;
320
- }
321
- interface AthenaPasskeyUserDescriptor {
322
- id?: string;
323
- name?: string;
324
- displayName?: string;
325
- }
326
- interface AthenaPasskeyRelyingParty {
327
- name?: string;
328
- id?: string;
329
- }
330
- interface AthenaPasskeyAuthenticatorSelection {
331
- authenticatorAttachment?: string;
332
- requireResidentKey?: boolean;
333
- userVerification?: string;
334
- }
335
- interface AthenaPasskeyOptionsResponse {
336
- challenge?: string;
337
- rp?: AthenaPasskeyRelyingParty;
338
- user?: AthenaPasskeyUserDescriptor;
339
- timeout?: number;
340
- allowCredentials?: AthenaPasskeyCredentialDescriptor[];
341
- excludeCredentials?: AthenaPasskeyCredentialDescriptor[];
342
- pubKeyCredParams?: AthenaPasskeyPublicKeyCredentialParam[];
343
- userVerification?: string;
344
- authenticatorSelection?: AthenaPasskeyAuthenticatorSelection;
345
- attestation?: string;
346
- extensions?: AthenaAuthLooseRecord;
347
- }
348
- interface AthenaPasskeyRecord {
349
- id: string;
350
- name?: string | null;
351
- publicKey?: string;
352
- userId: string;
353
- credentialID?: string;
354
- counter?: number;
355
- deviceType?: string;
356
- backedUp?: boolean;
357
- transports?: string;
358
- createdAt?: string;
359
- }
360
- interface AthenaPasskeyVerifyRegistrationRequest {
361
- response: string;
362
- name?: string;
363
- }
364
- interface AthenaPasskeyVerifyAuthenticationRequest {
365
- response: string;
366
- }
367
- interface AthenaPasskeyVerifyAuthenticationResponse {
368
- session: AthenaAuthSession;
369
- user: AthenaAuthUser;
370
- }
371
- interface AthenaPasskeyDeleteRequest {
372
- id: string;
373
- }
374
- interface AthenaPasskeyDeleteResponse {
375
- status: boolean;
376
- }
377
- interface AthenaPasskeyUpdateRequest {
378
- id: string;
379
- name: string;
380
- }
381
- interface AthenaPasskeyUpdateResponse {
382
- passkey: AthenaPasskeyRecord;
383
- }
384
- interface AthenaAdminSetRoleRequest {
385
- userId: string;
386
- role: string;
387
- }
388
- interface AthenaAdminCreateUserRequest {
389
- email: string;
390
- password: string;
391
- name: string;
392
- role?: string;
393
- data?: string;
394
- }
395
- interface AthenaAdminTargetUserRequest {
396
- userId: string;
397
- }
398
- interface AthenaAdminBanUserRequest extends AthenaAdminTargetUserRequest {
399
- banReason?: string;
400
- banExpiresIn?: string;
401
- }
402
- type AthenaAuthSearchOperator = 'contains' | 'starts_with' | 'ends_with';
403
- type AthenaAuthFilterOperator = 'eq' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte' | 'in' | 'not_in' | 'contains' | 'starts_with' | 'ends_with';
404
- type AthenaAdminListUsersSearchOperator = AthenaAuthSearchOperator;
405
- type AthenaAdminListUsersFilterOperator = AthenaAuthFilterOperator;
406
- interface AthenaAdminListUsersQuery {
407
- searchValue?: string;
408
- searchField?: string;
409
- searchOperator?: AthenaAdminListUsersSearchOperator;
410
- limit?: number | string;
411
- offset?: number | string;
412
- sortBy?: string;
413
- sortDirection?: string;
414
- filterField?: string;
415
- filterValue?: string;
416
- filterOperator?: AthenaAdminListUsersFilterOperator;
417
- }
418
- interface AthenaAdminListUsersResponse {
419
- users: AthenaAuthUser[];
420
- total: number;
421
- limit?: number;
422
- offset?: number;
423
- }
424
- interface AthenaAdminListUserSessionsRequest {
425
- userId: string;
426
- }
427
- interface AthenaAdminListUserSessionsResponse {
428
- sessions: AthenaAuthSession[];
429
- }
430
- interface AthenaAdminImpersonateResponse {
431
- session: AthenaAuthSession;
432
- user: AthenaAuthUser;
433
- }
434
- interface AthenaAdminStopImpersonatingRequest {
435
- userId?: string;
436
- }
437
- interface AthenaAdminRevokeUserSessionRequest {
438
- sessionToken: string;
439
- userId: string;
440
- sessionId?: string;
441
- }
442
- interface AthenaAdminRevokeUserSessionsRequest {
443
- userId: string;
444
- }
445
- interface AthenaAdminSetUserPasswordRequest {
446
- userId: string;
447
- newPassword: string;
448
- }
449
- interface AthenaAdminUserResponse {
450
- user: AthenaAuthUser;
451
- }
452
- interface AthenaAdminSuccessResponse {
453
- success: boolean;
454
- }
455
- interface AthenaAdminHasPermissionRequest {
456
- permission?: AthenaAuthPermissionSet;
457
- permissions: AthenaAuthPermissionSet;
458
- }
459
- interface AthenaAdminHasPermissionResponse {
460
- success: boolean;
461
- error?: string;
462
- }
463
- interface AthenaAdminApiKeyCreateRequest {
464
- name?: string;
465
- expiresIn?: number;
466
- athenaClientName?: string;
467
- permissions?: AthenaAuthLooseRecord;
468
- metadata?: AthenaAuthLooseRecord;
469
- }
470
- interface AthenaAdminApiKeyCreateResponse {
471
- key?: string;
472
- apiKey?: AthenaAuthLooseRecord;
473
- }
474
- interface AthenaAdminAthenaClientCreateRequest {
475
- clientName: string;
476
- description?: string;
477
- isActive?: boolean;
478
- pgUriEnvVar?: string;
479
- metadata?: AthenaAuthLooseRecord;
480
- }
481
- interface AthenaAdminAthenaClientListResponse {
482
- athenaClients?: AthenaAuthLooseRecord[];
483
- }
484
- interface AthenaAdminAuditLogListQuery {
485
- limit?: number;
486
- offset?: number;
487
- actorUserId?: string;
488
- action?: string;
489
- targetType?: string;
490
- targetId?: string;
491
- success?: boolean;
492
- createdAfter?: string;
493
- createdBefore?: string;
494
- }
495
- interface AthenaAdminAuditLogListResponse {
496
- total?: number;
497
- limit?: number;
498
- offset?: number;
499
- auditLogs?: AthenaAuthLooseRecord[];
500
- }
501
- interface AthenaAdminEmailListQuery {
502
- limit?: number;
503
- offset?: number;
504
- recipientEmail?: string;
505
- provider?: string;
506
- flow?: string;
507
- subjectContains?: string;
508
- createdAfter?: string;
509
- createdBefore?: string;
510
- }
511
- interface AthenaAdminEmailListResponse {
512
- total?: number;
513
- limit?: number;
514
- offset?: number;
515
- emails?: AthenaAuthLooseRecord[];
516
- }
517
- interface AthenaAdminEmailGetQuery {
518
- id: string;
519
- }
520
- interface AthenaAdminEmailGetResponse {
521
- email?: AthenaAuthLooseRecord;
522
- }
523
- interface AthenaAuthReactEmailRenderInput {
524
- /**
525
- * React email element instance (for example: `<WelcomeEmail {...props} />`).
526
- */
527
- element?: unknown;
528
- /**
529
- * React email component function. Use with `props` when you prefer component + props inputs.
530
- */
531
- component?: AthenaAuthReactEmailComponent;
532
- /**
533
- * Props passed to `component` when `element` is omitted.
534
- */
535
- props?: AthenaAuthReactEmailProps;
536
- /**
537
- * When true, run `pretty(...)` on rendered HTML when available.
538
- */
539
- pretty?: boolean;
540
- /**
541
- * Override plain-text output. If omitted, text is auto-derived when possible.
542
- */
543
- text?: string;
544
- /**
545
- * Disable derived plain-text generation. Defaults to `true`.
546
- */
547
- includePlainText?: boolean;
548
- }
549
- type AthenaAuthReactEmailComponent<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps> = (props: TProps) => unknown;
550
- interface AthenaAuthReactEmailRenderOptions {
551
- pretty?: boolean;
552
- includePlainText?: boolean;
553
- }
554
- type AthenaAuthReactEmailEventPhase = 'render:start' | 'render:success' | 'render:error';
555
- interface AthenaAuthReactEmailRenderEvent {
556
- phase: AthenaAuthReactEmailEventPhase;
557
- timestamp: string;
558
- route?: string;
559
- durationMs?: number;
560
- message?: string;
561
- error?: string;
562
- }
563
- interface AthenaAuthReactEmailConfig {
564
- /**
565
- * Optional default render settings used when request payloads omit `pretty` or `includePlainText`.
566
- */
567
- defaults?: AthenaAuthReactEmailRenderOptions;
568
- /**
569
- * Optional observer for render lifecycle events.
570
- */
571
- observe?: (event: AthenaAuthReactEmailRenderEvent) => void;
572
- }
573
- interface AthenaAdminEmailCreateRequest {
574
- recipientEmail: string;
575
- subject: string;
576
- fromAddress: string;
577
- fromName?: string;
578
- textBody?: string;
579
- htmlBody?: string;
580
- /**
581
- * Optional React Email render input. When provided, `htmlBody` is derived automatically.
582
- */
583
- react?: AthenaAuthReactEmailRenderInput;
584
- provider: string;
585
- flow?: string;
586
- metadata?: AthenaAuthLooseRecord;
587
- }
588
- interface AthenaAdminEmailUpdateRequest {
589
- id: string;
590
- recipientEmail?: string;
591
- subject?: string;
592
- fromAddress?: string;
593
- fromName?: string | null;
594
- textBody?: string | null;
595
- htmlBody?: string | null;
596
- /**
597
- * Optional React Email render input. When provided, `htmlBody` is derived automatically.
598
- */
599
- react?: AthenaAuthReactEmailRenderInput;
600
- provider?: string;
601
- flow?: string | null;
602
- metadata?: AthenaAuthLooseRecord;
603
- }
604
- interface AthenaAdminEmailUpdateResponse {
605
- email?: AthenaAuthLooseRecord;
606
- }
607
- interface AthenaAdminEmailDeleteRequest {
608
- id: string;
609
- }
610
- interface AthenaAdminEmailFailureListQuery {
611
- limit?: number;
612
- offset?: number;
613
- recipientEmail?: string;
614
- provider?: string;
615
- flow?: string;
616
- resolved?: boolean;
617
- createdAfter?: string;
618
- createdBefore?: string;
619
- }
620
- interface AthenaAdminEmailFailureListResponse {
621
- total?: number;
622
- limit?: number;
623
- offset?: number;
624
- emailSendFailures?: AthenaAuthLooseRecord[];
625
- }
626
- interface AthenaAdminEmailFailureGetQuery {
627
- id: string;
628
- }
629
- interface AthenaAdminEmailFailureGetResponse {
630
- emailSendFailure?: AthenaAuthLooseRecord;
631
- }
632
- interface AthenaAdminEmailFailureCreateRequest {
633
- userId?: string;
634
- recipientEmail: string;
635
- flow: string;
636
- provider?: string;
637
- errorMessage: string;
638
- metadata?: AthenaAuthLooseRecord;
639
- }
640
- interface AthenaAdminEmailFailureUpdateRequest {
641
- id: string;
642
- resolved?: boolean;
643
- resolutionNote?: string | null;
644
- metadata?: AthenaAuthLooseRecord;
645
- }
646
- interface AthenaAdminEmailFailureUpdateResponse {
647
- emailSendFailure?: AthenaAuthLooseRecord;
648
- }
649
- interface AthenaAdminEmailFailureDeleteRequest {
650
- id: string;
651
- }
652
- interface AthenaAdminEmailTemplateListQuery {
653
- limit?: number;
654
- offset?: number;
655
- templateKey?: string;
656
- locale?: string;
657
- isActive?: boolean;
658
- }
659
- interface AthenaAdminEmailTemplateListResponse {
660
- total?: number;
661
- limit?: number;
662
- offset?: number;
663
- emailTemplates?: AthenaAuthLooseRecord[];
664
- }
665
- interface AthenaAdminEmailTemplateCreateRequest {
666
- templateKey: string;
667
- locale?: string;
668
- subjectTemplate: string;
669
- textTemplate?: string;
670
- htmlTemplate?: string;
671
- /**
672
- * Optional React Email render input. When provided, `htmlTemplate` is derived automatically.
673
- */
674
- react?: AthenaAuthReactEmailRenderInput;
675
- variables?: string[];
676
- isActive?: boolean;
677
- metadata?: AthenaAuthLooseRecord;
678
- }
679
- interface AthenaAdminEmailTemplateUpdateRequest {
680
- id: string;
681
- templateKey?: string;
682
- locale?: string;
683
- subjectTemplate?: string;
684
- textTemplate?: string | null;
685
- htmlTemplate?: string | null;
686
- /**
687
- * Optional React Email render input. When provided, `htmlTemplate` is derived automatically.
688
- */
689
- react?: AthenaAuthReactEmailRenderInput;
690
- variables?: string[];
691
- isActive?: boolean;
692
- metadata?: AthenaAuthLooseRecord;
693
- }
694
- interface AthenaAdminEmailTemplateDeleteRequest {
695
- id: string;
696
- }
697
- interface AthenaAdminEmailTemplateGetQuery {
698
- id: string;
699
- }
700
- interface AthenaAdminEmailTemplateGetResponse {
701
- emailTemplate?: AthenaAuthLooseRecord;
702
- }
703
- interface AthenaApiKeyCreateRequest {
704
- name?: string;
705
- expiresIn: string;
706
- userId?: string;
707
- prefix?: string;
708
- remaining: string;
709
- metadata?: string;
710
- refillAmount?: string;
711
- refillInterval?: string;
712
- rateLimitTimeWindow?: string;
713
- rateLimitMax?: string;
714
- rateLimitEnabled?: string;
715
- permissions?: string;
716
- }
717
- interface AthenaApiKeyRecord {
718
- id: string;
719
- name?: string | null;
720
- start?: string | null;
721
- prefix?: string | null;
722
- userId: string;
723
- refillInterval?: number | null;
724
- refillAmount?: number | null;
725
- lastRefillAt?: string | null;
726
- enabled: boolean;
727
- rateLimitEnabled: boolean;
728
- rateLimitTimeWindow?: number | null;
729
- rateLimitMax?: number | null;
730
- requestCount: number;
731
- remaining?: number | null;
732
- lastRequest?: string | null;
733
- expiresAt?: string | null;
734
- createdAt: string;
735
- updatedAt: string;
736
- metadata?: AthenaAuthLooseRecord | null;
737
- permissions?: string | null;
738
- key?: string;
739
- }
740
- interface AthenaApiKeyGetQuery {
741
- id?: string;
742
- }
743
- interface AthenaApiKeyUpdateRequest {
744
- keyId: string;
745
- userId?: string;
746
- name?: string;
747
- enabled?: string;
748
- remaining?: string;
749
- refillAmount?: string;
750
- refillInterval?: string;
751
- metadata?: string;
752
- expiresIn: string;
753
- rateLimitEnabled?: string;
754
- rateLimitTimeWindow?: string;
755
- rateLimitMax?: string;
756
- permissions: string;
757
- }
758
- interface AthenaApiKeyDeleteRequest {
759
- keyId: string;
760
- }
761
- interface AthenaApiKeyVerifyRequest {
762
- key: string;
763
- permissions?: AthenaAuthLooseRecord;
764
- }
765
- interface AthenaApiKeyVerifyResponse {
766
- valid?: boolean;
767
- error?: {
768
- message?: string;
769
- code?: string;
770
- } | null;
771
- key?: AthenaAuthLooseRecord | null;
772
- }
773
- interface AthenaApiKeyDeleteAllExpiredResponse {
774
- deleted?: number;
775
- }
776
- interface AthenaAuthOrganizationCreateRequest {
777
- name: string;
778
- slug: string;
779
- logo?: string;
780
- metadata?: Record<string, unknown>;
781
- userId?: string;
782
- keepCurrentActiveOrganization?: boolean;
783
- }
784
- interface AthenaAuthOrganizationCheckSlugRequest {
785
- slug: string;
786
- }
787
- interface AthenaAuthOrganizationSetActiveRequest {
788
- organizationId?: string | null;
789
- organizationSlug?: string | null;
790
- }
791
- interface AthenaAuthOrganizationGetFullQuery {
792
- organizationId?: string;
793
- organizationSlug?: string;
794
- membersLimit?: number;
795
- }
796
- interface AthenaAuthOrganizationUpdateRequest {
797
- data: {
798
- name?: string;
799
- slug?: string;
800
- logo?: string;
801
- metadata?: Record<string, unknown> | null;
802
- };
803
- organizationId?: string;
804
- }
805
- interface AthenaAuthOrganizationDeleteRequest {
806
- organizationId: string;
807
- }
808
- interface AthenaAuthOrganizationInviteMemberRequest {
809
- email: string;
810
- role: string | string[];
811
- organizationId?: string;
812
- resend?: boolean;
813
- teamId?: string;
814
- }
815
- interface AthenaAuthOrganizationInvitationActionRequest {
816
- invitationId: string;
817
- }
818
- interface AthenaAuthOrganizationGetInvitationQuery {
819
- id: string;
820
- }
821
- interface AthenaAuthOrganizationListInvitationsQuery {
822
- organizationId?: string;
823
- }
824
- interface AthenaAuthOrganizationListUserInvitationsQuery {
825
- email?: string;
826
- }
827
- type AthenaAuthOrganizationListMembersFilterOperator = AthenaAuthFilterOperator;
828
- interface AthenaAuthOrganizationListMembersQuery {
829
- organizationId?: string;
830
- limit?: number;
831
- offset?: number;
832
- sortBy?: string;
833
- sortDirection?: 'asc' | 'desc';
834
- filterField?: string;
835
- filterOperator?: AthenaAuthOrganizationListMembersFilterOperator;
836
- filterValue?: string | number | boolean | string[] | number[];
837
- }
838
- interface AthenaAuthOrganizationRemoveMemberRequest {
839
- memberIdOrEmail: string;
840
- organizationId?: string;
841
- }
842
- interface AthenaAuthOrganizationUpdateMemberRoleRequest {
843
- role: string | string[];
844
- memberId: string;
845
- organizationId?: string;
846
- }
847
- interface AthenaAuthOrganizationLeaveRequest {
848
- organizationId: string;
849
- }
850
- interface AthenaAuthRequestInput {
851
- endpoint: AthenaAuthEndpointPath;
852
- method?: AthenaAuthMethod;
853
- body?: unknown;
854
- query?: Record<string, AthenaAuthQueryValue>;
855
- fetchOptions?: AthenaAuthCallOptions;
856
- }
857
- interface AthenaAuthCallOptions {
858
- baseUrl?: string;
859
- apiKey?: string;
860
- bearerToken?: string;
861
- headers?: Record<string, string>;
862
- credentials?: AthenaAuthCredentials;
863
- signal?: AbortSignal;
864
- }
865
- interface AthenaAuthFetchCompatibleInput {
866
- fetchOptions?: AthenaAuthCallOptions;
867
- }
868
- interface AthenaAuthClientConfig extends AthenaAuthCallOptions {
869
- fetch?: typeof fetch;
870
- reactEmail?: AthenaAuthReactEmailConfig;
871
- }
872
- interface AthenaAuthEmailTemplateDefinition<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps> {
873
- component: AthenaAuthReactEmailComponent<TProps>;
874
- templateKey?: string;
875
- subjectTemplate?: string;
876
- defaults?: AthenaAuthReactEmailRenderOptions;
877
- }
878
- interface AthenaAuthEmailTemplateReactOverrides {
879
- pretty?: boolean;
880
- text?: string;
881
- includePlainText?: boolean;
882
- }
883
- interface AthenaAuthEmailTemplateCreateFromDefinitionInput<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps> extends Omit<AthenaAdminEmailTemplateCreateRequest, 'react' | 'htmlTemplate' | 'textTemplate' | 'variables' | 'templateKey' | 'subjectTemplate'> {
884
- props: TProps;
885
- templateKey?: string;
886
- subjectTemplate?: string;
887
- react?: AthenaAuthEmailTemplateReactOverrides;
888
- }
889
- interface AthenaAuthEmailTemplateUpdateFromDefinitionInput<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps> extends Omit<AthenaAdminEmailTemplateUpdateRequest, 'react' | 'htmlTemplate' | 'textTemplate' | 'variables'> {
890
- props: TProps;
891
- react?: AthenaAuthEmailTemplateReactOverrides;
892
- }
893
- interface AthenaAuthEmailTemplateBuilder<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps> {
894
- component: AthenaAuthReactEmailComponent<TProps>;
895
- react: (props: TProps, overrides?: AthenaAuthEmailTemplateReactOverrides) => AthenaAuthReactEmailRenderInput;
896
- toTemplateCreate: (input: AthenaAuthEmailTemplateCreateFromDefinitionInput<TProps>) => AthenaAdminEmailTemplateCreateRequest;
897
- toTemplateUpdate: (input: AthenaAuthEmailTemplateUpdateFromDefinitionInput<TProps>) => AthenaAdminEmailTemplateUpdateRequest;
898
- }
899
- type AthenaAuthGenericInput = AthenaAuthFetchCompatibleInput & Record<string, unknown>;
900
- type AthenaAuthGenericQueryInput = AthenaAuthFetchCompatibleInput & {
901
- query?: Record<string, AthenaAuthQueryValue>;
902
- };
903
- type AthenaAuthResetPasswordBinding = ((input: AthenaResetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>) & {
904
- token: (input: {
905
- token: string;
906
- callbackURL?: string;
907
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
908
- token?: string;
909
- }>>;
910
- };
911
- type AthenaAuthSessionRevokeBinding = (input: (AthenaAuthRevokeSessionRequest & AthenaAuthFetchCompatibleInput) | (AthenaAuthRevokeSessionRequest[] & AthenaAuthFetchCompatibleInput), options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
912
- type AthenaAuthAdminUserSessionRevokeBinding = (input: (AthenaAdminRevokeUserSessionRequest & AthenaAuthFetchCompatibleInput) | (AthenaAdminRevokeUserSessionsRequest & AthenaAuthFetchCompatibleInput) | ({
913
- sessions: AthenaAdminRevokeUserSessionRequest[];
914
- } & AthenaAuthFetchCompatibleInput) | ((AthenaAdminRevokeUserSessionRequest & AthenaAuthFetchCompatibleInput)[]), options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
915
- interface AthenaAuthOrganizationBindings {
916
- /** Create an organization. Route: `POST /organization/create`. */
917
- create: (input: AthenaAuthOrganizationCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganization>>;
918
- /** Update an organization. Route: `POST /organization/update`. */
919
- update: (input: AthenaAuthOrganizationUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganization>>;
920
- /** Delete an organization. Route: `POST /organization/delete`. */
921
- delete: (input: AthenaAuthOrganizationDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
922
- /** Set active organization for current session. Route: `POST /organization/set-active`. */
923
- setActive: (input: AthenaAuthOrganizationSetActiveRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
924
- /** List organizations visible to the current user. Route: `GET /organization/list`. */
925
- list: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganization[]>>;
926
- /** Get organization details including related members/invitations. Route: `GET /organization/get-full-organization`. */
927
- getFull: (input?: {
928
- query?: AthenaAuthOrganizationGetFullQuery;
929
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
930
- organization: AthenaAuthOrganization;
931
- members?: AthenaAuthOrganizationMember[];
932
- invitations?: AthenaAuthOrganizationInvitation[];
933
- }>>;
934
- /** Check if an organization slug is available. Route: `POST /organization/check-slug`. */
935
- checkSlug: (input: AthenaAuthOrganizationCheckSlugRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
936
- available: boolean;
937
- }>>;
938
- /** Leave an organization. Route: `POST /organization/leave`. */
939
- leave: (input: AthenaAuthOrganizationLeaveRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
940
- /** List invitations for the current user. Route: `GET /organization/list-user-invitations`. */
941
- listUserInvitations: (input?: {
942
- query?: AthenaAuthOrganizationListUserInvitationsQuery;
943
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation[]>>;
944
- /** Check organization-level permissions for the current principal. Route: `POST /organization/has-permission`. */
945
- hasPermission: (input: AthenaAdminHasPermissionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminHasPermissionResponse>>;
946
- invitation: {
947
- /** Cancel an organization invitation. Route: `POST /organization/cancel-invitation`. */
948
- cancel: (input: AthenaAuthOrganizationInvitationActionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
949
- /** Accept an organization invitation. Route: `POST /organization/accept-invitation`. */
950
- accept: (input: AthenaAuthOrganizationInvitationActionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
951
- /** Get an invitation by id. Route: `GET /organization/get-invitation`. */
952
- get: (input: {
953
- query: AthenaAuthOrganizationGetInvitationQuery;
954
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation>>;
955
- /** Reject an organization invitation. Route: `POST /organization/reject-invitation`. */
956
- reject: (input: AthenaAuthOrganizationInvitationActionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
957
- /** List invitations for an organization. Route: `GET /organization/list-invitations`. */
958
- list: (input?: {
959
- query?: AthenaAuthOrganizationListInvitationsQuery;
960
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation[]>>;
961
- };
962
- member: {
963
- /** Remove an organization member. Route: `POST /organization/remove-member`. */
964
- remove: (input: AthenaAuthOrganizationRemoveMemberRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
965
- /** Update a member role. Route: `POST /organization/update-member-role`. */
966
- updateRole: (input: AthenaAuthOrganizationUpdateMemberRoleRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
967
- /** Invite a member to an organization. Route: `POST /organization/invite-member`. */
968
- invite: (input: AthenaAuthOrganizationInviteMemberRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation>>;
969
- /** Get the active organization member context for the current session. Route: `GET /organization/get-active-member`. */
970
- getActive: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationMember>>;
971
- /** List organization members. Route: `GET /organization/list-members`. */
972
- list: (input?: {
973
- query?: AthenaAuthOrganizationListMembersQuery;
974
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationMember[]>>;
975
- };
976
- }
977
- interface AthenaAuthBindings {
978
- /** Get current session. Route: `GET /get-session`. */
979
- getSession: AthenaAuthSdkClient['getSession'];
980
- /** Sign out current session. Route: `POST /sign-out`. */
981
- signOut: AthenaAuthSdkClient['signOut'];
982
- /** Trigger password reset email flow. Route: `POST /forget-password`. */
983
- forgetPassword: AthenaAuthSdkClient['forgetPassword'];
984
- /** Reset password (`POST /reset-password`) and token resolver (`GET /reset-password/{token}`). */
985
- resetPassword: AthenaAuthResetPasswordBinding;
986
- /** Set password for the current authenticated user. Route: `POST /set-password`. */
987
- setPassword: (input: AthenaSetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
988
- /** Verify email token. Route: `GET /verify-email`. */
989
- verifyEmail: AthenaAuthSdkClient['verifyEmail'];
990
- /** Send verification email. Route: `POST /send-verification-email`. */
991
- sendVerificationEmail: AthenaAuthSdkClient['sendVerificationEmail'];
992
- /** Start change-email flow. Route: `POST /change-email`. */
993
- changeEmail: AthenaAuthSdkClient['changeEmail'];
994
- /** Verify pending email change. Route: `GET /change-email/verify`. */
995
- changeEmailVerify: (input: {
996
- query: AthenaAuthTokenQuery;
997
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthTokenVerificationResponse>>;
998
- /** Verify pending delete-user flow. Route: `GET /delete-user/verify`. */
999
- deleteUserVerify: (input: {
1000
- query: AthenaAuthTokenQuery;
1001
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthTokenVerificationResponse>>;
1002
- /** Change current user password. Route: `POST /change-password`. */
1003
- changePassword: AthenaAuthSdkClient['changePassword'];
1004
- user: {
1005
- /** Update current user profile fields. Route: `POST /update-user`. */
1006
- update: AthenaAuthSdkClient['updateUser'];
1007
- /** Delete current user. Route: `POST /delete-user`. */
1008
- delete: AthenaAuthSdkClient['deleteUser'];
1009
- email: {
1010
- /**
1011
- * List email identities for current user.
1012
- * Routes: primary `GET /email/list`; falls back to `GET /email-list` on `404`.
1013
- */
1014
- list: (input?: {
1015
- query?: AthenaAuthEmailListQuery;
1016
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthEmailListResponse>>;
1017
- };
1018
- };
1019
- session: {
1020
- /** List user sessions. Route: `GET /list-sessions`. */
1021
- list: AthenaAuthSdkClient['listSessions'];
1022
- /** Revoke one or multiple sessions; collapses to `/revoke-session` or `/revoke-sessions` by payload shape. */
1023
- revoke: AthenaAuthSessionRevokeBinding;
1024
- /** Revoke all other sessions for current user. Route: `POST /revoke-other-sessions`. */
1025
- revokeOther: AthenaAuthSdkClient['revokeOtherSessions'];
1026
- };
1027
- social: {
1028
- /** Link a social provider to current user. Route: `POST /link-social`. */
1029
- link: AthenaAuthSdkClient['linkSocial'];
1030
- };
1031
- account: {
1032
- /** List linked provider accounts. Route: `GET /list-accounts`. */
1033
- list: AthenaAuthSdkClient['listAccounts'];
1034
- /** Unlink a provider account. Route: `POST /unlink-account`. */
1035
- unlink: AthenaAuthSdkClient['unlinkAccount'];
1036
- };
1037
- deleteUser: {
1038
- /** Callback endpoint for delete-user verification flows. Route: `GET /delete-user/callback`. */
1039
- callback: AthenaAuthSdkClient['deleteUserCallback'];
1040
- };
1041
- /** Refresh provider token. Route: `POST /refresh-token`. */
1042
- refreshToken: AthenaAuthSdkClient['refreshToken'];
1043
- /** Get provider access token. Route: `POST /get-access-token`. */
1044
- getAccessToken: AthenaAuthSdkClient['getAccessToken'];
1045
- /** Auth health route. Primary `GET /health`; falls back to `GET /ok` on `404`. */
1046
- health: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthHealthResponse>>;
1047
- /** Health route passthrough. Route: `GET /ok`. */
1048
- ok: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOkResponse>>;
1049
- /** Error route passthrough. Route: `GET /error`. */
1050
- error: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthErrorResponse | string>>;
1051
- twoFactor: {
1052
- /** Get TOTP URI for setup. Route: `POST /two-factor/get-totp-uri`. */
1053
- getTotpUri: (input: AthenaTwoFactorGetTotpUriRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorGetTotpUriResponse>>;
1054
- /** Verify TOTP code. Route: `POST /two-factor/verify-totp`. */
1055
- verifyTotp: (input: AthenaTwoFactorVerifyTotpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorVerifyTotpResponse>>;
1056
- /** Send one-time passcode (OTP). Route: `POST /two-factor/send-otp`. */
1057
- sendOtp: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1058
- /** Verify OTP code. Route: `POST /two-factor/verify-otp`. */
1059
- verifyOtp: (input: AthenaTwoFactorVerifyOtpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorVerifyOtpResponse>>;
1060
- /** Verify backup code. Route: `POST /two-factor/verify-backup-code`. */
1061
- verifyBackupCode: (input: AthenaTwoFactorVerifyBackupCodeRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorVerifyBackupCodeResponse>>;
1062
- /** Generate backup codes. Route: `POST /two-factor/generate-backup-codes`. */
1063
- generateBackupCodes: (input: AthenaTwoFactorGenerateBackupCodesRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorGenerateBackupCodesResponse>>;
1064
- /** Enable two-factor auth. Route: `POST /two-factor/enable`. */
1065
- enable: (input: AthenaTwoFactorEnableRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorEnableResponse>>;
1066
- /** Disable two-factor auth. Route: `POST /two-factor/disable`. */
1067
- disable: (input: AthenaTwoFactorDisableRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorDisableResponse>>;
1068
- };
1069
- passkey: {
1070
- /** Generate WebAuthn registration options. Route: `GET /passkey/generate-register-options`. */
1071
- generateRegisterOptions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyOptionsResponse>>;
1072
- /** Generate WebAuthn authentication options. Route: `POST /passkey/generate-authenticate-options`. */
1073
- generateAuthenticateOptions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyOptionsResponse>>;
1074
- /** Verify passkey registration response. Route: `POST /passkey/verify-registration`. */
1075
- verifyRegistration: (input: AthenaPasskeyVerifyRegistrationRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyRecord>>;
1076
- /** Verify passkey authentication response. Route: `POST /passkey/verify-authentication`. */
1077
- verifyAuthentication: (input: AthenaPasskeyVerifyAuthenticationRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyVerifyAuthenticationResponse>>;
1078
- /** List current user's passkeys. Route: `GET /passkey/list-user-passkeys`. */
1079
- listUserPasskeys: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyRecord[]>>;
1080
- /** Delete a passkey. Route: `POST /passkey/delete-passkey`. */
1081
- deletePasskey: (input: AthenaPasskeyDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyDeleteResponse>>;
1082
- /** Update a passkey metadata record. Route: `POST /passkey/update-passkey`. */
1083
- updatePasskey: (input: AthenaPasskeyUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyUpdateResponse>>;
1084
- /** Return related origins for WebAuthn. Route: `GET /.well-known/webauthn`. */
1085
- getRelatedOrigins: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
1086
- origins?: string[];
1087
- }>>;
1088
- };
1089
- admin: {
1090
- role: {
1091
- /** Set a user role. Route: `POST /admin/set-role`. */
1092
- set: (input: AthenaAdminSetRoleRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>>;
1093
- };
1094
- user: {
1095
- /** List users. Route: `GET /admin/list-users`. */
1096
- list: (input?: {
1097
- query?: AthenaAdminListUsersQuery;
1098
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminListUsersResponse>>;
1099
- /** Create user. Route: `POST /admin/create-user`. */
1100
- create: (input: AthenaAdminCreateUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>>;
1101
- /** Unban user. Route: `POST /admin/unban-user`. */
1102
- unban: (input: AthenaAdminTargetUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>>;
1103
- /** Ban user. Route: `POST /admin/ban-user`. */
1104
- ban: (input: AthenaAdminBanUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>>;
1105
- /** Start impersonation. Route: `POST /admin/impersonate-user`. */
1106
- impersonate: (input: AthenaAdminTargetUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminImpersonateResponse>>;
1107
- /** Stop impersonation. Route: `POST /admin/stop-impersonating`. */
1108
- stopImpersonating: (input?: AthenaAdminStopImpersonatingRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
1109
- /** Remove user. Route: `POST /admin/remove-user`. */
1110
- remove: (input: AthenaAdminTargetUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
1111
- /** Set user password. Route: `POST /admin/set-user-password`. */
1112
- setPassword: (input: AthenaAdminSetUserPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1113
- session: {
1114
- /** List sessions for a target user. Route: `POST /admin/list-user-sessions`. */
1115
- list: (input: AthenaAdminListUserSessionsRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminListUserSessionsResponse>>;
1116
- /**
1117
- * Revoke one or multiple sessions; collapses to `/admin/revoke-user-session` or
1118
- * `/admin/revoke-user-sessions`. `userId` is required and plural payloads must share one `userId`.
1119
- */
1120
- revoke: AthenaAuthAdminUserSessionRevokeBinding;
1121
- };
1122
- };
1123
- /** Check permission under admin policy. Route: `POST /admin/has-permission`. */
1124
- hasPermission: (input: AthenaAdminHasPermissionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminHasPermissionResponse>>;
1125
- apiKey: {
1126
- /** Create admin-scoped API key. Route: `POST /admin/api-key/create`. */
1127
- create: (input?: AthenaAdminApiKeyCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminApiKeyCreateResponse>>;
1128
- };
1129
- athenaClient: {
1130
- /** Create Athena client credentials. Route: `POST /admin/athena-client/create`. */
1131
- create: (input: AthenaAdminAthenaClientCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
1132
- /** List Athena client credentials. Route: `GET /admin/athena-client/list`. */
1133
- list: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminAthenaClientListResponse>>;
1134
- };
1135
- auditLog: {
1136
- /** List auth audit events. Route: `GET /admin/audit-log/list`. */
1137
- list: (input?: {
1138
- query?: AthenaAdminAuditLogListQuery;
1139
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminAuditLogListResponse>>;
1140
- };
1141
- email: {
1142
- /** List emails. Route: `GET /admin/email/list`. */
1143
- list: (input?: {
1144
- query?: AthenaAdminEmailListQuery;
1145
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailListResponse>>;
1146
- /** Get a specific email record. Route: `GET /admin/email/get`. */
1147
- get: (input: {
1148
- query: AthenaAdminEmailGetQuery;
1149
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailGetResponse>>;
1150
- /** Create an email record. Route: `POST /admin/email/create`. */
1151
- create: (input: AthenaAdminEmailCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
1152
- /** Update an email record. Route: `POST /admin/email/update`. */
1153
- update: (input: AthenaAdminEmailUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailUpdateResponse>>;
1154
- /** Delete an email record. Route: `POST /admin/email/delete`. */
1155
- delete: (input: AthenaAdminEmailDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
1156
- failure: {
1157
- /** List email failure records. Route: `GET /admin/email-failure/list`. */
1158
- list: (input?: {
1159
- query?: AthenaAdminEmailFailureListQuery;
1160
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailFailureListResponse>>;
1161
- /** Get an email failure record. Route: `GET /admin/email-failure/get`. */
1162
- get: (input: {
1163
- query: AthenaAdminEmailFailureGetQuery;
1164
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailFailureGetResponse>>;
1165
- /** Create an email failure record. Route: `POST /admin/email-failure/create`. */
1166
- create: (input: AthenaAdminEmailFailureCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
1167
- /** Update an email failure record. Route: `POST /admin/email-failure/update`. */
1168
- update: (input: AthenaAdminEmailFailureUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailFailureUpdateResponse>>;
1169
- /** Delete an email failure record. Route: `POST /admin/email-failure/delete`. */
1170
- delete: (input: AthenaAdminEmailFailureDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
1171
- };
1172
- template: {
1173
- /** List email templates. Route: `GET /admin/email-template/list`. */
1174
- list: (input?: {
1175
- query?: AthenaAdminEmailTemplateListQuery;
1176
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateListResponse>>;
1177
- /** Get email template by ID. Route: `GET /admin/email-template/get`. */
1178
- get: (input: {
1179
- query: AthenaAdminEmailTemplateGetQuery;
1180
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateGetResponse>>;
1181
- /** Create email template. Route: `POST /admin/email-template/create`. */
1182
- create: (input: AthenaAdminEmailTemplateCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
1183
- /** Update email template. Route: `POST /admin/email-template/update`. */
1184
- update: (input: AthenaAdminEmailTemplateUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
1185
- /** Delete email template. Route: `POST /admin/email-template/delete`. */
1186
- delete: (input: AthenaAdminEmailTemplateDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
1187
- };
1188
- };
1189
- emailTemplate: {
1190
- /** Get email template by ID. Route: `GET /admin/email-template/get`. */
1191
- get: (input: {
1192
- query: AthenaAdminEmailTemplateGetQuery;
1193
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateGetResponse>>;
1194
- /** Create email template. Route: `POST /admin/email-template/create`. */
1195
- create: (input: AthenaAdminEmailTemplateCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
1196
- /** Delete email template. Route: `POST /admin/email-template/delete`. */
1197
- delete: (input: AthenaAdminEmailTemplateDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
1198
- /** List email templates. Route: `GET /admin/email-template/list`. */
1199
- list: (input?: {
1200
- query?: AthenaAdminEmailTemplateListQuery;
1201
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateListResponse>>;
1202
- /** Update email template. Route: `POST /admin/email-template/update`. */
1203
- update: (input: AthenaAdminEmailTemplateUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
1204
- };
1205
- };
1206
- apiKey: {
1207
- /** Create API key. Route: `POST /api-key/create`. */
1208
- create: (input: AthenaApiKeyCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord>>;
1209
- /** Get API key metadata. Route: `GET /api-key/get`. */
1210
- get: (input?: {
1211
- query?: AthenaApiKeyGetQuery;
1212
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord>>;
1213
- /** Update API key metadata. Route: `POST /api-key/update`. */
1214
- update: (input: AthenaApiKeyUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord>>;
1215
- /** Delete API key. Route: `POST /api-key/delete`. */
1216
- delete: (input: AthenaApiKeyDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
1217
- /** List API keys. Route: `GET /api-key/list`. */
1218
- list: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord[]>>;
1219
- /** Verify an API key. Route: `POST /api-key/verify`. */
1220
- verify: (input: AthenaApiKeyVerifyRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyVerifyResponse>>;
1221
- /** Delete all expired API keys. Route: `POST /api-key/delete-all-expired-api-keys`. */
1222
- deleteAllExpired: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyDeleteAllExpiredResponse>>;
1223
- };
1224
- signIn: {
1225
- /** Sign in with email and password. Route: `POST /sign-in/email`. */
1226
- email: AthenaAuthSdkClient['signIn']['email'];
1227
- /** Sign in with username and password. Route: `POST /sign-in/username`. */
1228
- username: AthenaAuthSdkClient['signIn']['username'];
1229
- /** Sign in with social provider. Route: `POST /sign-in/social`. */
1230
- social: AthenaAuthSdkClient['signIn']['social'];
1231
- };
1232
- signUp: {
1233
- /** Sign up with email/password identity. Route: `POST /sign-up/email`. */
1234
- email: AthenaAuthSdkClient['signUp']['email'];
1235
- };
1236
- /** Organization plugin helper surface. Routes: `/organization/*`. */
1237
- organization: AthenaAuthOrganizationBindings;
1238
- callback: {
1239
- /** OAuth provider callback passthrough. Route: `GET /callback/{provider}`. */
1240
- provider: (input: AthenaAuthCallbackProviderRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthCallbackProviderResponse>>;
1241
- };
1242
- }
1243
- interface AthenaAuthSdkClient {
1244
- baseUrl: string;
1245
- request: <T = unknown>(input: AthenaAuthRequestInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<T>>;
1246
- signIn: {
1247
- email: (input: AthenaEmailSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
1248
- username: (input: AthenaUsernameSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
1249
- social: (input: AthenaSocialSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSocialRedirectResponse | AthenaAuthSignInResponse>>;
1250
- };
1251
- signUp: {
1252
- email: (input: AthenaEmailSignUpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
1253
- };
1254
- signOut: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignOutResponse>>;
1255
- logout: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignOutResponse>>;
1256
- getSession: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSessionResponse>>;
1257
- listSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSession[]>>;
1258
- revokeSession: (input: AthenaAuthRevokeSessionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1259
- clearSession: (input: AthenaAuthRevokeSessionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1260
- revokeSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1261
- clearSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1262
- revokeOtherSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1263
- clearOtherSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1264
- forgetPassword: (input: AthenaForgetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1265
- resetPassword: (input: AthenaResetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1266
- resolveResetPasswordToken: (input: {
1267
- token: string;
1268
- callbackURL?: string;
1269
- } & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
1270
- token?: string;
1271
- }>>;
1272
- verifyEmail: (input: AthenaVerifyEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
1273
- user: AthenaAuthUser;
1274
- status: boolean;
1275
- }>>;
1276
- sendVerificationEmail: (input: AthenaSendVerificationEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1277
- changeEmail: (input: AthenaChangeEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthEmailChangeResponse>>;
1278
- changePassword: (input: AthenaChangePasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
1279
- token?: string | null;
1280
- user: AthenaAuthUser;
1281
- }>>;
1282
- updateUser: (input: AthenaUpdateUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1283
- deleteUser: (input?: AthenaDeleteUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaDeleteUserResponse>>;
1284
- deleteUserCallback: (input?: AthenaDeleteUserCallbackRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaDeleteUserResponse>>;
1285
- linkSocial: (input: AthenaLinkSocialRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSocialRedirectResponse>>;
1286
- listAccounts: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLinkedAccount[]>>;
1287
- unlinkAccount: (input: AthenaUnlinkAccountRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
1288
- refreshToken: (input: AthenaOAuthAccountTokenRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaOAuthTokenBundle>>;
1289
- getAccessToken: (input: AthenaOAuthAccountTokenRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaOAuthTokenBundle>>;
1290
- organization: AthenaAuthOrganizationBindings;
1291
- auth: AthenaAuthBindings;
1292
- }
1293
-
1294
- interface AthenaGatewayErrorInput {
1295
- code: AthenaGatewayErrorCode;
1296
- message: string;
1297
- status?: number;
1298
- endpoint?: AthenaGatewayEndpointPath;
1299
- method?: AthenaGatewayMethod;
1300
- requestId?: string;
1301
- hint?: string;
1302
- cause?: string;
1303
- }
1304
- /**
1305
- * Canonical error for gateway failures.
1306
- * Holds request context and machine-readable classification.
1307
- */
1308
- declare class AthenaGatewayError extends Error {
1309
- readonly code: AthenaGatewayErrorCode;
1310
- readonly status: number;
1311
- readonly endpoint?: AthenaGatewayEndpointPath;
1312
- readonly method?: AthenaGatewayMethod;
1313
- readonly requestId?: string;
1314
- readonly hint?: string;
1315
- readonly causeDetail?: string;
1316
- constructor(input: AthenaGatewayErrorInput);
1317
- toDetails(): AthenaGatewayErrorDetails;
1318
- static fromResponse<T>(response: AthenaGatewayResponse<T>, fallback: Omit<AthenaGatewayErrorInput, 'code' | 'message' | 'status'>): AthenaGatewayError;
1319
- }
1320
- declare function isAthenaGatewayError(error: unknown): error is AthenaGatewayError;
1321
-
1322
- type ModelFormNullishMode = 'empty-string' | 'undefined' | 'null';
1323
- type NullishValueByMode = {
1324
- 'empty-string': '';
1325
- undefined: undefined;
1326
- null: null;
1327
- };
1328
- type MapNullableToFormValue<TField, TMode extends ModelFormNullishMode> = null extends TField ? Exclude<TField, null> | NullishValueByMode[TMode] : TField;
1329
- /**
1330
- * Form value shape derived from a model insert payload.
1331
- * Nullable fields are remapped to the selected nullish representation.
1332
- */
1333
- type ModelFormValues<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = {
1334
- [K in keyof InsertOf<TModel>]: MapNullableToFormValue<InsertOf<TModel>[K], TMode>;
1335
- };
1336
- /**
1337
- * Default value shape for form initialization.
1338
- */
1339
- type ModelFormDefaults<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = Partial<ModelFormValues<TModel, TMode>>;
1340
- interface ToModelFormDefaultsOptions<TMode extends ModelFormNullishMode = 'empty-string'> {
1341
- /**
1342
- * Controls how nullable model values are represented in form defaults.
1343
- * - `empty-string` (default): `null -> ""`
1344
- * - `undefined`: `null -> undefined`
1345
- * - `null`: keeps `null`
1346
- */
1347
- nullishMode?: TMode;
1348
- }
1349
- interface ToModelPayloadOptions {
1350
- /**
1351
- * Converts `""` into `null` for nullable model fields.
1352
- * Defaults to `true`.
1353
- */
1354
- emptyStringAsNull?: boolean;
1355
- /**
1356
- * Omits `undefined` keys from the outgoing payload.
1357
- * Defaults to `true`.
1358
- */
1359
- stripUndefined?: boolean;
1360
- }
1361
- /**
1362
- * Normalizes model data into form-safe defaults using model nullability metadata.
1363
- */
1364
- declare function toModelFormDefaults<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'>(model: TModel, values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>): ModelFormDefaults<TModel, TMode>;
1365
- /**
1366
- * Normalizes form values back into model-compatible insert/update payloads.
1367
- */
1368
- declare function toModelPayload<TModel extends AnyModelDef>(model: TModel, formValues: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<InsertOf<TModel>>;
1369
- /**
1370
- * Runtime form adapter bound to a model contract.
1371
- */
1372
- interface ModelFormAdapter<TModel extends AnyModelDef> {
1373
- model: TModel;
1374
- toDefaults<TMode extends ModelFormNullishMode = 'empty-string'>(values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>): ModelFormDefaults<TModel, TMode>;
1375
- toInsert(values: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<InsertOf<TModel>>;
1376
- toUpdate(values: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<UpdateOf<TModel>>;
1377
- }
1378
- /**
1379
- * Creates a small model-aware adapter for form defaults and payload normalization.
1380
- */
1381
- declare function createModelFormAdapter<TModel extends AnyModelDef>(model: TModel): ModelFormAdapter<TModel>;
1382
-
1383
- export { type AthenaDeleteUserResponse as $, type AthenaAdminListUsersFilterOperator as A, type AthenaAuthQueryValue as B, type AthenaAuthReactEmailComponent as C, type AthenaAuthReactEmailConfig as D, type AthenaAuthReactEmailEventPhase as E, type AthenaAuthReactEmailProps as F, type AthenaAuthReactEmailRenderEvent as G, type AthenaAuthReactEmailRenderInput as H, type AthenaAuthReactEmailRenderOptions as I, type AthenaAuthRequestInput as J, type AthenaAuthResetPasswordBinding as K, type AthenaAuthResult as L, type AthenaAuthRevokeSessionRequest as M, type AthenaAuthSdkClient as N, type AthenaAuthSearchOperator as O, type AthenaAuthSession as P, type AthenaAuthSessionResponse as Q, type AthenaAuthSessionRevokeBinding as R, type AthenaAuthSignInResponse as S, type AthenaAuthSignOutResponse as T, type AthenaAuthSocialRedirectResponse as U, type AthenaAuthStatusResponse as V, type AthenaAuthUser as W, type AthenaChangeEmailRequest as X, type AthenaChangePasswordRequest as Y, type AthenaDeleteUserCallbackRequest as Z, type AthenaDeleteUserRequest as _, type AthenaAdminListUsersQuery as a, type AthenaEmailSignInRequest as a0, type AthenaEmailSignUpRequest as a1, type AthenaForgetPasswordRequest as a2, AthenaGatewayError as a3, type AthenaLinkSocialRequest as a4, type AthenaOAuthAccountTokenRequest as a5, type AthenaOAuthTokenBundle as a6, type AthenaResetPasswordRequest as a7, type AthenaSendVerificationEmailRequest as a8, type AthenaSocialSignInRequest as a9, type AthenaUnlinkAccountRequest as aa, type AthenaUpdateUserRequest as ab, type AthenaUsernameSignInRequest as ac, type AthenaVerifyEmailRequest as ad, type ModelFormAdapter as ae, type ModelFormDefaults as af, type ModelFormNullishMode as ag, type ModelFormValues as ah, type ToModelFormDefaultsOptions as ai, type ToModelPayloadOptions as aj, createModelFormAdapter as ak, isAthenaGatewayError as al, toModelFormDefaults as am, toModelPayload as an, type AthenaAuthFetchCompatibleInput as ao, type AthenaAdminListUsersSearchOperator as b, type AthenaAuthAdminUserSessionRevokeBinding as c, type AthenaAuthBindings as d, type AthenaAuthCallOptions as e, type AthenaAuthClientConfig as f, type AthenaAuthCredentials as g, type AthenaAuthEmailChangeResponse as h, type AthenaAuthEmailTemplateBuilder as i, type AthenaAuthEmailTemplateCreateFromDefinitionInput as j, type AthenaAuthEmailTemplateDefinition as k, type AthenaAuthEmailTemplateReactOverrides as l, type AthenaAuthEmailTemplateUpdateFromDefinitionInput as m, type AthenaAuthEndpointPath as n, type AthenaAuthErrorCode as o, type AthenaAuthErrorDetails as p, type AthenaAuthFilterOperator as q, type AthenaAuthGenericInput as r, type AthenaAuthGenericQueryInput as s, type AthenaAuthLinkedAccount as t, type AthenaAuthMethod as u, type AthenaAuthOrganization as v, type AthenaAuthOrganizationBindings as w, type AthenaAuthOrganizationInvitation as x, type AthenaAuthOrganizationMember as y, type AthenaAuthQueryPrimitive as z };