@finueva/auth 0.18.1 → 0.20.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.
@@ -0,0 +1,591 @@
1
+ //#region src/user-api/credential.d.ts
2
+ interface UserApiCredentialInput {
3
+ applicationId: string;
4
+ forceRefresh?: boolean;
5
+ }
6
+ interface UserApiCredential {
7
+ tokenType: "Bearer";
8
+ token: string;
9
+ expiresAt: Date;
10
+ }
11
+ //#endregion
12
+ //#region src/errors.d.ts
13
+ type AuthErrorCode = "invalid_credentials" | "invalid_auth_input" | "account_conflict" | "google_recovery_in_progress" | "google_recovery_not_required" | "google_recovery_invalid" | "google_recovery_expired" | "google_recovery_account_mismatch" | "password_reset_invalid" | "authentication_required" | "request_origin_denied" | "invalid_request" | "invalid_invitation" | "invitation_unavailable" | "recipient_unavailable" | "invitation_recipient_mismatch" | "invitation_recovery_required" | "membership_removal_recovery_required" | "email_verification_required" | "invalid_workspace_selection" | "organization_context_too_large" | "credential_rate_limited" | "auth_request_rate_limited" | "state_conflict" | "access_denied" | "platform_target_unavailable" | "platform_quorum_unavailable" | "platform_recovery_required" | "identity_authority_unavailable" | "two_factor_required" | "two_factor_code_invalid" | "two_factor_challenge_expired" | "two_factor_locked" | "recent_sign_in_required" | "enterprise_recovery_required" | "recent_authentication_required" | "organization_closure_confirmation_mismatch" | "organization_closure_cancellation_ended" | "ceremony_return_refused" | "password_sign_in_required";
14
+ type AuthErrorStatus = 400 | 401 | 403 | 404 | 405 | 409 | 410 | 413 | 415 | 422 | 429 | 503;
15
+ declare class AuthError extends Error {
16
+ readonly code: AuthErrorCode;
17
+ readonly status: AuthErrorStatus;
18
+ readonly retryAfterSeconds?: number;
19
+ constructor(code: AuthErrorCode, status: AuthErrorStatus, retryAfterSeconds?: number);
20
+ }
21
+ //#endregion
22
+ //#region src/types.d.ts
23
+ interface AuthUser {
24
+ id: string;
25
+ name: string;
26
+ email: string;
27
+ emailVerified: boolean;
28
+ image: string | null;
29
+ }
30
+ interface AuthSession {
31
+ id: string;
32
+ expiresAt: Date;
33
+ user: AuthUser;
34
+ }
35
+ interface AuthOrganization {
36
+ id: string;
37
+ name: string;
38
+ slug: string;
39
+ logo: string | null;
40
+ lifecycle: "ordinary" | "managed";
41
+ role: "owner" | "admin" | "member";
42
+ capabilities: {
43
+ readMembers: true;
44
+ readTeams: true;
45
+ readInvitations: boolean;
46
+ };
47
+ }
48
+ interface OrganizationDisplay {
49
+ name: string;
50
+ slug: string;
51
+ logo: string | null;
52
+ }
53
+ type UpdateOrganizationDisplayInput = OrganizationDisplay;
54
+ interface OrganizationTeamDisplay {
55
+ name: string;
56
+ }
57
+ type UpdateOrganizationTeamDisplayInput = OrganizationTeamDisplay;
58
+ interface OrganizationPageInput {
59
+ limit?: number;
60
+ cursor?: string;
61
+ }
62
+ interface OrganizationPage {
63
+ organizations: AuthOrganization[];
64
+ nextCursor: string | null;
65
+ }
66
+ interface OrganizationMember {
67
+ id: string;
68
+ userId: string;
69
+ name: string;
70
+ email: string;
71
+ image: string | null;
72
+ role: "owner" | "admin" | "member";
73
+ owner: boolean;
74
+ joinedAt: Date;
75
+ teamIds: string[];
76
+ }
77
+ interface OrganizationMemberPage {
78
+ members: OrganizationMember[];
79
+ nextCursor: string | null;
80
+ }
81
+ interface OrganizationTeam {
82
+ id: string;
83
+ name: string;
84
+ category: "manual" | "managed";
85
+ createdAt: Date;
86
+ }
87
+ interface CreatedOrganization {
88
+ id: string;
89
+ name: string;
90
+ slug: string;
91
+ }
92
+ interface CreatedOrganizationTeam {
93
+ id: string;
94
+ name: string;
95
+ }
96
+ interface CreateOrganizationMemberInvitationInput {
97
+ email: string;
98
+ teamIds?: string[];
99
+ idempotencyKey: string;
100
+ }
101
+ interface CreatedOrganizationMemberInvitation {
102
+ id: string;
103
+ expiresAt: Date;
104
+ }
105
+ interface ResentOrganizationInvitation {
106
+ id: string;
107
+ expiresAt: Date;
108
+ }
109
+ interface CanceledOrganizationInvitation {
110
+ status: "canceled";
111
+ }
112
+ interface RemovedOrganizationMember {
113
+ status: "removed";
114
+ }
115
+ interface OrganizationDeparture {
116
+ status: "left";
117
+ }
118
+ interface SuspendedOrganizationMemberStatus {
119
+ status: "suspended";
120
+ }
121
+ /** A suspended membership. `id` is the suspension ID that restore and removal act on. */
122
+ interface SuspendedOrganizationMember {
123
+ id: string;
124
+ userId: string;
125
+ name: string;
126
+ email: string;
127
+ image: string | null;
128
+ role: "admin" | "member";
129
+ teamIds: string[];
130
+ suspendedAt: Date;
131
+ }
132
+ interface SuspendedOrganizationMemberPage {
133
+ members: SuspendedOrganizationMember[];
134
+ nextCursor: string | null;
135
+ }
136
+ /** A User who left or was removed and is neither a member nor suspended now. */
137
+ interface DepartedOrganizationMember {
138
+ userId: string;
139
+ name: string;
140
+ email: string;
141
+ image: string | null;
142
+ departure: "removed" | "left";
143
+ departedAt: Date;
144
+ }
145
+ interface DepartedOrganizationMemberPage {
146
+ members: DepartedOrganizationMember[];
147
+ nextCursor: string | null;
148
+ }
149
+ interface RestoredOrganizationMember {
150
+ status: "restored";
151
+ memberId: string;
152
+ }
153
+ interface AddedOrganizationTeamMember {
154
+ status: "added";
155
+ }
156
+ interface RemovedOrganizationTeamMember {
157
+ status: "removed";
158
+ }
159
+ interface DeletedOrganizationTeam {
160
+ status: "deleted";
161
+ }
162
+ interface OrganizationTeamPage {
163
+ teams: OrganizationTeam[];
164
+ nextCursor: string | null;
165
+ }
166
+ interface OrganizationTeamMemberPage {
167
+ memberIds: string[];
168
+ nextCursor: string | null;
169
+ }
170
+ interface OrganizationInvitation {
171
+ id: string;
172
+ email: string;
173
+ role: "owner" | "admin" | "member";
174
+ teamIds: string[];
175
+ inviter: {
176
+ membershipId: string;
177
+ name: string;
178
+ };
179
+ createdAt: Date;
180
+ expiresAt: Date;
181
+ status: "pending";
182
+ }
183
+ interface OrganizationInvitationPage {
184
+ invitations: OrganizationInvitation[];
185
+ nextCursor: string | null;
186
+ }
187
+ interface ReceivedOrganizationInvitation {
188
+ id: string;
189
+ organization: Pick<AuthOrganization, "id" | "name" | "slug" | "logo">;
190
+ role: "owner" | "admin" | "member";
191
+ teams: Array<{
192
+ id: string;
193
+ name: string;
194
+ }>;
195
+ inviterName: string;
196
+ expiresAt: Date;
197
+ }
198
+ interface ReceivedOrganizationInvitationPage {
199
+ invitations: ReceivedOrganizationInvitation[];
200
+ nextCursor: string | null;
201
+ }
202
+ interface AcceptInvitationInput {
203
+ invitationId: string;
204
+ }
205
+ interface InvitationAcceptance {
206
+ organizationId: string;
207
+ }
208
+ interface DeclineInvitationInput {
209
+ invitationId: string;
210
+ }
211
+ interface InvitationDecline {
212
+ status: "declined";
213
+ }
214
+ type AuthState = {
215
+ status: "loading";
216
+ } | {
217
+ status: "cached";
218
+ session: AuthSession;
219
+ authoritative: false;
220
+ } | {
221
+ status: "authenticated";
222
+ session: AuthSession;
223
+ authoritative: true;
224
+ } | {
225
+ status: "unauthenticated";
226
+ session: null;
227
+ authoritative: true;
228
+ } | {
229
+ status: "unavailable";
230
+ session: AuthSession | null;
231
+ authoritative: false;
232
+ };
233
+ interface AuthPersistenceDriver {
234
+ getItem(key: string): string | null | Promise<string | null>;
235
+ setItem(key: string, value: string): void | Promise<void>;
236
+ removeItem(key: string): void | Promise<void>;
237
+ }
238
+ type AuthPersistence = "local" | "session" | "memory" | AuthPersistenceDriver;
239
+ interface PersonalWorkspaceSelection {
240
+ type: "personal";
241
+ }
242
+ interface OrganizationWorkspaceSelection {
243
+ type: "organization";
244
+ organizationId: string;
245
+ }
246
+ type WorkspaceSelection = PersonalWorkspaceSelection | OrganizationWorkspaceSelection;
247
+ interface DriveCredential {
248
+ tokenType: "Bearer";
249
+ token: string;
250
+ expiresAt: Date;
251
+ }
252
+ interface SignInInput {
253
+ email: string;
254
+ password: string;
255
+ }
256
+ /** A new, unconfirmed authenticator secret. Show it once; Auth cannot show it again. */
257
+ interface TwoFactorEnrollment {
258
+ /** The `otpauth://totp/...` address for a QR code. */
259
+ totpUri: string;
260
+ /** The Base32 secret for manual entry. */
261
+ secret: string;
262
+ /** Ten one-use backup codes. They become usable after confirmation. */
263
+ backupCodes: string[];
264
+ }
265
+ /** The password and one current authenticator code or unused backup code. */
266
+ interface TwoFactorStepUpInput {
267
+ password: string;
268
+ code: string;
269
+ }
270
+ interface TwoFactorStatus {
271
+ enabled: boolean;
272
+ }
273
+ /** One active session of the current User. It never carries a token. */
274
+ interface AuthSessionSummary {
275
+ id: string;
276
+ /** True for the session that made the request. */
277
+ current: boolean;
278
+ createdAt: Date;
279
+ /** The last time Auth refreshed the session. It is coarse and is not a presence signal. */
280
+ updatedAt: Date;
281
+ expiresAt: Date;
282
+ userAgent: string | null;
283
+ ipAddress: string | null;
284
+ }
285
+ interface AuthSessionInventory {
286
+ /** Up to 50 active sessions, most recently updated first. */
287
+ sessions: AuthSessionSummary[];
288
+ /** True when the User has more active sessions than the page shows. */
289
+ truncated: boolean;
290
+ }
291
+ /** Where the browser returns after an Auth-Origin ceremony. Auth checks it against the application's registration. */
292
+ interface CeremonyReturnInput {
293
+ /** The application ID in Auth's `AUTH_CEREMONY_RETURN_ORIGINS` registration. */
294
+ applicationId: string;
295
+ /** The exact address to return to. Auth adds one value-free `finueva_ceremony` outcome parameter. */
296
+ returnTo: string;
297
+ }
298
+ type CeremonyRecentAuthenticationRequest = ({
299
+ action: "organization_ownership_transfer";
300
+ organizationId: string;
301
+ } & OrganizationOwnershipTransferInput) | ({
302
+ action: "organization_closure_start";
303
+ organizationId: string;
304
+ } & OrganizationClosureStartInput) | ({
305
+ action: "organization_closure_cancel";
306
+ organizationId: string;
307
+ } & OrganizationClosureCancelInput);
308
+ type CeremonyHandoffInput = CeremonyReturnInput & ({
309
+ purpose: "passkey_enrollment";
310
+ } | {
311
+ purpose: "passkey_removal";
312
+ passkeyId: string;
313
+ } | {
314
+ purpose: "recent_authentication";
315
+ request: CeremonyRecentAuthenticationRequest;
316
+ });
317
+ /** An Auth-Origin ceremony address. The fragment carries a single-use code that expires at `expiresAt`. */
318
+ interface CeremonyHandoff {
319
+ url: string;
320
+ expiresAt: Date;
321
+ }
322
+ /** One passkey of the current User. It never carries a credential ID or public key. */
323
+ interface PasskeySummary {
324
+ id: string;
325
+ name: string | null;
326
+ createdAt: Date | null;
327
+ deviceType: "singleDevice" | "multiDevice";
328
+ backedUp: boolean;
329
+ }
330
+ interface PasskeyInventory {
331
+ /** Up to 50 passkeys, newest first. */
332
+ passkeys: PasskeySummary[];
333
+ truncated: boolean;
334
+ }
335
+ /** Safe status of one enterprise OIDC connection. The client secret and role-mapping groups are never returned. */
336
+ interface EnterpriseConnection {
337
+ id: string;
338
+ issuer: string;
339
+ clientId: string;
340
+ capability: "federated_sign_in" | "managed_lifecycle";
341
+ enabled: boolean;
342
+ domainVerified: boolean;
343
+ validatedAt: Date | null;
344
+ memberJit: boolean;
345
+ requireVerifiedEmail: boolean;
346
+ roleMappingConfigured: boolean;
347
+ updatedAt: Date;
348
+ }
349
+ interface ScimCredentialState {
350
+ status: "active" | "revoked" | "unissued";
351
+ revision: number | null;
352
+ currentCredentialId: string | null;
353
+ retiringExpiresAt: Date | null;
354
+ revokedAt: Date | null;
355
+ }
356
+ /** Shown once. Auth stores only a hash and cannot show the credential again. */
357
+ interface ScimCredentialIssuance extends ScimCredentialState {
358
+ credential: string;
359
+ }
360
+ interface RotateScimCredentialInput {
361
+ expectedRevision: number;
362
+ /** Seconds, from 0 through 86400, during which the previous credential still works. */
363
+ overlapSeconds: number;
364
+ }
365
+ type SocialIdTokenProvider = "google" | "apple";
366
+ interface SocialIdTokenInput {
367
+ provider: SocialIdTokenProvider;
368
+ idToken: string;
369
+ nonce?: string;
370
+ signUp: boolean;
371
+ }
372
+ interface UpdateProfileInput {
373
+ name?: string;
374
+ image?: string | null;
375
+ }
376
+ interface SendVerificationEmailInput {
377
+ email: string;
378
+ callbackURL?: string;
379
+ }
380
+ interface DriveCredentialInput {
381
+ workspace: WorkspaceSelection;
382
+ forceRefresh?: boolean;
383
+ }
384
+ type PlatformRole = "administrator" | "investigator";
385
+ interface PlatformStatus {
386
+ eligible: boolean;
387
+ globalRevision: number;
388
+ roles: PlatformRole[];
389
+ }
390
+ interface PlatformRoleChangeRecentAuthenticationInput {
391
+ targetUserId: string;
392
+ requestedRoles: PlatformRole[];
393
+ expectedTargetRevision: number;
394
+ expectedGlobalRevision: number;
395
+ reasonCategory: "initial_bootstrap" | "personnel_change" | "privilege_review" | "quorum_recovery" | "security_response";
396
+ changeReference: string;
397
+ idempotencyKey: string;
398
+ }
399
+ interface PlatformBootstrapRoleChangeInput extends Omit<PlatformRoleChangeRecentAuthenticationInput, "reasonCategory" | "requestedRoles"> {
400
+ requestedRoles: ["administrator"] | ["administrator", "investigator"] | ["investigator", "administrator"];
401
+ reasonCategory: "initial_bootstrap";
402
+ }
403
+ interface PlatformRoleFirstApproval {
404
+ status: "awaiting_second_approval";
405
+ targetUserId: string;
406
+ targetRevision: number;
407
+ globalRevision: number;
408
+ roles: [];
409
+ }
410
+ interface PlatformRoleApplied {
411
+ status: "applied";
412
+ targetUserId: string;
413
+ targetRevision: number;
414
+ globalRevision: number;
415
+ roles: PlatformRole[];
416
+ }
417
+ type PlatformRoleApproval = PlatformRoleFirstApproval | PlatformRoleApplied;
418
+ interface RecentAuthenticationStatus {
419
+ status: "pending" | "ready";
420
+ }
421
+ type OrganizationManualRole = "owner" | "admin" | "member";
422
+ interface OrganizationManualRoleChangeInput {
423
+ requestedManualRole: OrganizationManualRole;
424
+ expectedActorAuthorityRevision: number;
425
+ expectedTargetAuthorityRevision: number;
426
+ idempotencyKey: string;
427
+ }
428
+ interface OrganizationManualRoleChangeResult {
429
+ status: "applied";
430
+ memberId: string;
431
+ manualRole: OrganizationManualRole;
432
+ role: OrganizationManualRole;
433
+ authorityRevision: number;
434
+ }
435
+ interface OrganizationMemberAuthority {
436
+ organizationId: string;
437
+ actor: Omit<OrganizationManualRoleChangeResult, "status">;
438
+ target: Omit<OrganizationManualRoleChangeResult, "status">;
439
+ }
440
+ interface OrganizationOwnershipTransferInput {
441
+ outgoingOwnerMembershipId: string;
442
+ successorMembershipId: string;
443
+ outgoingOwnerRole: "admin" | "member";
444
+ expectedActorAuthorityRevision: number;
445
+ expectedOutgoingOwnerAuthorityRevision: number;
446
+ expectedSuccessorAuthorityRevision: number;
447
+ idempotencyKey: string;
448
+ }
449
+ interface OrganizationOwnershipTransferResult {
450
+ status: "applied";
451
+ outgoingOwner: Omit<OrganizationManualRoleChangeResult, "status">;
452
+ successor: Omit<OrganizationManualRoleChangeResult, "status">;
453
+ }
454
+ interface OrganizationClosureStartInput {
455
+ /** The organization's current name, typed by the owner. Auth compares it exactly. */
456
+ confirmationName: string;
457
+ idempotencyKey: string;
458
+ }
459
+ interface OrganizationClosureCancelInput {
460
+ idempotencyKey: string;
461
+ }
462
+ interface OrganizationClosure {
463
+ organizationId: string;
464
+ state: "closing" | "cancelled";
465
+ startedAt: string;
466
+ /** Exactly 30 times 24 hours after `startedAt`. */
467
+ cancelUntil: string;
468
+ canCancel: boolean;
469
+ }
470
+ interface ClosingOrganization {
471
+ id: string;
472
+ name: string;
473
+ slug: string | null;
474
+ startedAt: string;
475
+ cancelUntil: string;
476
+ canCancel: boolean;
477
+ }
478
+ interface ClosingOrganizationList {
479
+ organizations: ClosingOrganization[];
480
+ }
481
+ interface AuthClientOptions {
482
+ authOrigin: string;
483
+ appOrigin: string;
484
+ fetch?: typeof globalThis.fetch;
485
+ now?: () => number;
486
+ persistence?: AuthPersistence;
487
+ timeoutMs?: number;
488
+ }
489
+ interface FinuevaAuthClient {
490
+ readonly _type: "browser";
491
+ getPlatformStatus(): Promise<PlatformStatus>;
492
+ startPlatformRoleChangeRecentAuthentication(input: PlatformRoleChangeRecentAuthenticationInput): Promise<RecentAuthenticationStatus>;
493
+ startOrganizationOwnerRoleChangeRecentAuthentication(organizationId: string, targetMembershipId: string, input: OrganizationManualRoleChangeInput): Promise<RecentAuthenticationStatus>;
494
+ startOrganizationOwnershipTransferRecentAuthentication(organizationId: string, input: OrganizationOwnershipTransferInput): Promise<RecentAuthenticationStatus>;
495
+ /** Starts the `organization_closure_start` action on the exact Auth Origin. */
496
+ startOrganizationClosureRecentAuthentication(organizationId: string, input: OrganizationClosureStartInput): Promise<RecentAuthenticationStatus>;
497
+ /** Starts the `organization_closure_cancel` action on the exact Auth Origin. */
498
+ startOrganizationClosureCancellationRecentAuthentication(organizationId: string, input: OrganizationClosureCancelInput): Promise<RecentAuthenticationStatus>;
499
+ approveBootstrapPlatformRoleChange(input: PlatformBootstrapRoleChangeInput): Promise<PlatformRoleApproval>;
500
+ addPasskey(): Promise<void>;
501
+ verifyRecentAuthenticationWithPasskey(): Promise<void>;
502
+ getRecentAuthenticationStatus(): Promise<RecentAuthenticationStatus>;
503
+ acceptInvitation(input: AcceptInvitationInput): Promise<InvitationAcceptance>;
504
+ declineInvitation(input: DeclineInvitationInput): Promise<InvitationDecline>;
505
+ getSession(): Promise<AuthSession | null>;
506
+ listOrganizations(input?: OrganizationPageInput): Promise<OrganizationPage>;
507
+ getOrganization(organizationId: string): Promise<AuthOrganization>;
508
+ getOrganizationMemberAuthority(organizationId: string, memberId: string): Promise<OrganizationMemberAuthority>;
509
+ createOrganization(name: string, slug: string, idempotencyKey: string): Promise<CreatedOrganization>;
510
+ createOrganizationTeam(organizationId: string, name: string, idempotencyKey: string): Promise<CreatedOrganizationTeam>;
511
+ createOrganizationMemberInvitation(organizationId: string, input: CreateOrganizationMemberInvitationInput): Promise<CreatedOrganizationMemberInvitation>;
512
+ resendOrganizationInvitation(organizationId: string, invitationId: string, idempotencyKey: string): Promise<ResentOrganizationInvitation>;
513
+ cancelOrganizationInvitation(organizationId: string, invitationId: string, idempotencyKey: string): Promise<CanceledOrganizationInvitation>;
514
+ removeOrganizationMember(organizationId: string, memberId: string, idempotencyKey: string): Promise<RemovedOrganizationMember>;
515
+ leaveOrganization(organizationId: string, idempotencyKey: string): Promise<OrganizationDeparture>;
516
+ suspendOrganizationMember(organizationId: string, memberId: string, idempotencyKey: string): Promise<SuspendedOrganizationMemberStatus>;
517
+ listSuspendedOrganizationMembers(organizationId: string, input?: OrganizationPageInput): Promise<SuspendedOrganizationMemberPage>;
518
+ restoreSuspendedOrganizationMember(organizationId: string, suspensionId: string, idempotencyKey: string): Promise<RestoredOrganizationMember>;
519
+ removeSuspendedOrganizationMember(organizationId: string, suspensionId: string, idempotencyKey: string): Promise<RemovedOrganizationMember>;
520
+ listRemovedOrganizationMembers(organizationId: string, input?: OrganizationPageInput): Promise<DepartedOrganizationMemberPage>;
521
+ addOrganizationTeamMember(organizationId: string, teamId: string, memberId: string, idempotencyKey: string): Promise<AddedOrganizationTeamMember>;
522
+ removeOrganizationTeamMember(organizationId: string, teamId: string, memberId: string, idempotencyKey: string): Promise<RemovedOrganizationTeamMember>;
523
+ deleteOrganizationTeam(organizationId: string, teamId: string, idempotencyKey: string): Promise<DeletedOrganizationTeam>;
524
+ updateOrganizationDisplay(organizationId: string, input: UpdateOrganizationDisplayInput): Promise<OrganizationDisplay>;
525
+ updateOrganizationTeamDisplay(organizationId: string, teamId: string, input: UpdateOrganizationTeamDisplayInput): Promise<OrganizationTeamDisplay>;
526
+ changeOrganizationMemberManualRole(organizationId: string, targetMembershipId: string, input: OrganizationManualRoleChangeInput): Promise<OrganizationManualRoleChangeResult>;
527
+ transferOrganizationOwnership(organizationId: string, input: OrganizationOwnershipTransferInput): Promise<OrganizationOwnershipTransferResult>;
528
+ /** Starts closure with a ready `organization_closure_start` proof. The organization then grants no authority. */
529
+ startOrganizationClosure(organizationId: string, input: OrganizationClosureStartInput): Promise<OrganizationClosure>;
530
+ /** Reads the latest closure. Only the owner who started it can read it. */
531
+ getOrganizationClosure(organizationId: string): Promise<OrganizationClosure>;
532
+ /** Cancels closure before `cancelUntil` with a ready `organization_closure_cancel` proof. */
533
+ cancelOrganizationClosure(organizationId: string, input: OrganizationClosureCancelInput): Promise<OrganizationClosure>;
534
+ /** Lists the caller's own closing organizations. They are absent from `listOrganizations()`. */
535
+ listClosingOrganizations(): Promise<ClosingOrganizationList>;
536
+ listOrganizationMembers(organizationId: string, input?: OrganizationPageInput): Promise<OrganizationMemberPage>;
537
+ listOrganizationTeams(organizationId: string, input?: OrganizationPageInput): Promise<OrganizationTeamPage>;
538
+ listOrganizationTeamMembers(organizationId: string, teamId: string, input?: OrganizationPageInput): Promise<OrganizationTeamMemberPage>;
539
+ listOrganizationInvitations(organizationId: string, input?: OrganizationPageInput): Promise<OrganizationInvitationPage>;
540
+ getOrganizationInvitation(organizationId: string, invitationId: string): Promise<OrganizationInvitation>;
541
+ listReceivedInvitations(input?: OrganizationPageInput): Promise<ReceivedOrganizationInvitationPage>;
542
+ getReceivedInvitation(invitationId: string): Promise<ReceivedOrganizationInvitation>;
543
+ sendVerificationEmail(input: SendVerificationEmailInput): Promise<void>;
544
+ signUp(email: string, password: string, name: string): Promise<AuthSession>;
545
+ signIn(input: SignInInput): Promise<AuthSession>;
546
+ /** Cookie-only. A manual owner or admin reads the organization's enterprise connection status. */
547
+ listEnterpriseConnections(organizationId: string): Promise<EnterpriseConnection[]>;
548
+ /** Cookie-only. Reads SCIM credential state for an eligible managed-lifecycle connection. */
549
+ getScimCredential(organizationId: string, connectionId: string): Promise<ScimCredentialState>;
550
+ issueScimCredential(organizationId: string, connectionId: string): Promise<ScimCredentialIssuance>;
551
+ rotateScimCredential(organizationId: string, connectionId: string, input: RotateScimCredentialInput): Promise<ScimCredentialIssuance>;
552
+ revokeScimCredential(organizationId: string, connectionId: string, input: {
553
+ expectedRevision: number;
554
+ }): Promise<ScimCredentialState>;
555
+ /** Completes a password sign-in that failed with `two_factor_required`, with a TOTP or backup code. */
556
+ verifyTwoFactor(code: string): Promise<AuthSession>;
557
+ getTwoFactorStatus(): Promise<TwoFactorStatus>;
558
+ startTwoFactorEnrollment(password: string): Promise<TwoFactorEnrollment>;
559
+ /** Turns the second factor on with a current code from the new authenticator. The session is replaced. */
560
+ confirmTwoFactorEnrollment(code: string): Promise<AuthSession>;
561
+ /** Turns the second factor off. The session is replaced. */
562
+ disableTwoFactor(input: TwoFactorStepUpInput): Promise<AuthSession>;
563
+ /** Replaces all backup codes. Earlier codes stop working. */
564
+ regenerateTwoFactorBackupCodes(input: TwoFactorStepUpInput): Promise<string[]>;
565
+ listSessions(): Promise<AuthSessionInventory>;
566
+ /** Signs out one other session. Use `signOut()` for the current session. */
567
+ revokeSession(sessionId: string): Promise<void>;
568
+ /** Signs out every session except the current one. */
569
+ revokeOtherSessions(): Promise<{
570
+ revoked: number;
571
+ }>;
572
+ /**
573
+ * Starts one Auth-Origin ceremony for the current session: passkey enrollment, passkey removal, or one
574
+ * organization recent-authentication action. Open the returned address in a top-level browser context.
575
+ */
576
+ createCeremonyHandoff(input: CeremonyHandoffInput): Promise<CeremonyHandoff>;
577
+ listPasskeys(): Promise<PasskeyInventory>;
578
+ renamePasskey(passkeyId: string, name: string): Promise<void>;
579
+ signInWithSocialIdToken(input: SocialIdTokenInput): Promise<AuthSession>;
580
+ updateProfile(input: UpdateProfileInput): Promise<AuthSession>;
581
+ changePassword(currentPassword: string, newPassword: string, revokeOtherSessions?: boolean): Promise<AuthSession>;
582
+ requestPasswordReset(email: string, redirectTo: string): Promise<void>;
583
+ resetPassword(token: string, newPassword: string): Promise<void>;
584
+ signOut(): Promise<void>;
585
+ getDriveCredential(input: DriveCredentialInput): Promise<DriveCredential>;
586
+ getUserApiCredential(input: UserApiCredentialInput): Promise<UserApiCredential>;
587
+ onAuthStateChange(listener: (state: AuthState) => void): () => void;
588
+ onSessionChange(listener: (session: AuthSession | null) => void): () => void;
589
+ }
590
+ //#endregion
591
+ export { PlatformBootstrapRoleChangeInput as $, FinuevaAuthClient as A, AuthError as At, OrganizationMember as B, DeclineInvitationInput as C, TwoFactorEnrollment as Ct, DriveCredential as D, UpdateOrganizationTeamDisplayInput as Dt, DepartedOrganizationMemberPage as E, UpdateOrganizationDisplayInput as Et, OrganizationClosureStartInput as F, OrganizationTeam as G, OrganizationMemberPage as H, OrganizationDeparture as I, OrganizationTeamPage as J, OrganizationTeamDisplay as K, OrganizationDisplay as L, InvitationDecline as M, AuthErrorStatus as Mt, OrganizationClosure as N, UserApiCredential as Nt, DriveCredentialInput as O, UpdateProfileInput as Ot, OrganizationClosureCancelInput as P, UserApiCredentialInput as Pt, PersonalWorkspaceSelection as Q, OrganizationInvitation as R, CreatedOrganizationTeam as S, SuspendedOrganizationMemberStatus as St, DepartedOrganizationMember as T, TwoFactorStepUpInput as Tt, OrganizationPage as U, OrganizationMemberAuthority as V, OrganizationPageInput as W, PasskeyInventory as X, OrganizationWorkspaceSelection as Y, PasskeySummary as Z, ClosingOrganization as _, SignInInput as _t, AuthPersistence as a, PlatformStatus as at, CreatedOrganization as b, SuspendedOrganizationMember as bt, AuthSessionInventory as c, RecentAuthenticationStatus as ct, AuthUser as d, ResentOrganizationInvitation as dt, PlatformRole as et, CanceledOrganizationInvitation as f, RestoredOrganizationMember as ft, CeremonyReturnInput as g, SendVerificationEmailInput as gt, CeremonyRecentAuthenticationRequest as h, ScimCredentialState as ht, AuthOrganization as i, PlatformRoleFirstApproval as it, InvitationAcceptance as j, AuthErrorCode as jt, EnterpriseConnection as k, WorkspaceSelection as kt, AuthSessionSummary as l, RemovedOrganizationMember as lt, CeremonyHandoffInput as m, ScimCredentialIssuance as mt, AddedOrganizationTeamMember as n, PlatformRoleApproval as nt, AuthPersistenceDriver as o, ReceivedOrganizationInvitation as ot, CeremonyHandoff as p, RotateScimCredentialInput as pt, OrganizationTeamMemberPage as q, AuthClientOptions as r, PlatformRoleChangeRecentAuthenticationInput as rt, AuthSession as s, ReceivedOrganizationInvitationPage as st, AcceptInvitationInput as t, PlatformRoleApplied as tt, AuthState as u, RemovedOrganizationTeamMember as ut, ClosingOrganizationList as v, SocialIdTokenInput as vt, DeletedOrganizationTeam as w, TwoFactorStatus as wt, CreatedOrganizationMemberInvitation as x, SuspendedOrganizationMemberPage as xt, CreateOrganizationMemberInvitationInput as y, SocialIdTokenProvider as yt, OrganizationInvitationPage as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finueva/auth",
3
- "version": "0.18.1",
3
+ "version": "0.20.0",
4
4
  "description": "Public browser and server SDK for Finueva Auth",
5
5
  "type": "module",
6
6
  "sideEffects": false,