@finueva/auth 0.10.1 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -16
- package/THIRD_PARTY_NOTICES.md +26 -0
- package/dist/device.d.ts +1 -1
- package/dist/device.js +3 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1035 -8
- package/dist/server.d.ts +1 -1
- package/dist/server.js +3 -0
- package/dist/{types-Byw9JQwL.d.ts → types--G_Gwf2r.d.ts} +78 -3
- package/package.json +4 -2
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as OrganizationTeam, D as OrganizationWorkspaceSelection, E as OrganizationTeamPage, H as SocialIdTokenProvider, I as ReceivedOrganizationInvitation, J as AuthErrorCode, K as WorkspaceSelection, L as ReceivedOrganizationInvitationPage, O as PersonalWorkspaceSelection, S as OrganizationPageInput, T as OrganizationTeamMemberPage, U as UpdateOrganizationDisplayInput, V as SocialIdTokenInput, W as UpdateOrganizationTeamDisplayInput, Y as AuthErrorStatus, _ as OrganizationInvitation, b as OrganizationMemberPage, c as AuthUser, d as CreatedOrganizationTeam, f as DriveCredential, g as OrganizationDisplay, h as InvitationAcceptance, l as CreateOrganizationMemberInvitationInput, o as AuthSession, p as DriveCredentialInput, q as AuthError, r as AuthOrganization, t as AcceptInvitationInput, u as CreatedOrganizationMemberInvitation, v as OrganizationInvitationPage, w as OrganizationTeamDisplay, x as OrganizationPage, y as OrganizationMember } from "./types--G_Gwf2r.js";
|
|
2
2
|
//#region src/server.d.ts
|
|
3
3
|
interface ServerAuthOptions {
|
|
4
4
|
authOrigin: string;
|
package/dist/server.js
CHANGED
|
@@ -192,6 +192,9 @@ const messages = {
|
|
|
192
192
|
auth_request_rate_limited: "Authentication requests are temporarily limited.",
|
|
193
193
|
state_conflict: "The authentication state conflicts with the request.",
|
|
194
194
|
access_denied: "Access is denied.",
|
|
195
|
+
platform_target_unavailable: "The platform administration target is unavailable.",
|
|
196
|
+
platform_quorum_unavailable: "Platform administration quorum is unavailable.",
|
|
197
|
+
platform_recovery_required: "Platform administration requires separate recovery.",
|
|
195
198
|
identity_authority_unavailable: "Authentication is temporarily unavailable."
|
|
196
199
|
};
|
|
197
200
|
var AuthError = class extends Error {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/errors.d.ts
|
|
2
|
-
type AuthErrorCode = "invalid_credentials" | "invalid_auth_input" | "account_conflict" | "password_reset_invalid" | "authentication_required" | "request_origin_denied" | "invalid_request" | "invalid_invitation" | "invitation_unavailable" | "invitation_recipient_mismatch" | "email_verification_required" | "invalid_workspace_selection" | "organization_context_too_large" | "credential_rate_limited" | "auth_request_rate_limited" | "state_conflict" | "access_denied" | "identity_authority_unavailable";
|
|
3
|
-
type AuthErrorStatus = 400 | 401 | 403 | 409 | 422 | 429 | 503;
|
|
2
|
+
type AuthErrorCode = "invalid_credentials" | "invalid_auth_input" | "account_conflict" | "password_reset_invalid" | "authentication_required" | "request_origin_denied" | "invalid_request" | "invalid_invitation" | "invitation_unavailable" | "invitation_recipient_mismatch" | "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";
|
|
3
|
+
type AuthErrorStatus = 400 | 401 | 403 | 404 | 409 | 413 | 415 | 422 | 429 | 503;
|
|
4
4
|
declare class AuthError extends Error {
|
|
5
5
|
readonly code: AuthErrorCode;
|
|
6
6
|
readonly status: AuthErrorStatus;
|
|
@@ -193,6 +193,71 @@ interface DriveCredentialInput {
|
|
|
193
193
|
workspace: WorkspaceSelection;
|
|
194
194
|
forceRefresh?: boolean;
|
|
195
195
|
}
|
|
196
|
+
type PlatformRole = "administrator" | "investigator";
|
|
197
|
+
interface PlatformStatus {
|
|
198
|
+
eligible: boolean;
|
|
199
|
+
globalRevision: number;
|
|
200
|
+
roles: PlatformRole[];
|
|
201
|
+
}
|
|
202
|
+
interface PlatformRoleChangeRecentAuthenticationInput {
|
|
203
|
+
targetUserId: string;
|
|
204
|
+
requestedRoles: PlatformRole[];
|
|
205
|
+
expectedTargetRevision: number;
|
|
206
|
+
expectedGlobalRevision: number;
|
|
207
|
+
reasonCategory: "initial_bootstrap" | "personnel_change" | "privilege_review" | "quorum_recovery" | "security_response";
|
|
208
|
+
changeReference: string;
|
|
209
|
+
idempotencyKey: string;
|
|
210
|
+
}
|
|
211
|
+
interface PlatformBootstrapRoleChangeInput extends Omit<PlatformRoleChangeRecentAuthenticationInput, "reasonCategory" | "requestedRoles"> {
|
|
212
|
+
requestedRoles: ["administrator"] | ["administrator", "investigator"] | ["investigator", "administrator"];
|
|
213
|
+
reasonCategory: "initial_bootstrap";
|
|
214
|
+
}
|
|
215
|
+
interface PlatformRoleFirstApproval {
|
|
216
|
+
status: "awaiting_second_approval";
|
|
217
|
+
targetUserId: string;
|
|
218
|
+
targetRevision: number;
|
|
219
|
+
globalRevision: number;
|
|
220
|
+
roles: [];
|
|
221
|
+
}
|
|
222
|
+
interface PlatformRoleApplied {
|
|
223
|
+
status: "applied";
|
|
224
|
+
targetUserId: string;
|
|
225
|
+
targetRevision: number;
|
|
226
|
+
globalRevision: number;
|
|
227
|
+
roles: PlatformRole[];
|
|
228
|
+
}
|
|
229
|
+
type PlatformRoleApproval = PlatformRoleFirstApproval | PlatformRoleApplied;
|
|
230
|
+
interface RecentAuthenticationStatus {
|
|
231
|
+
status: "pending" | "ready";
|
|
232
|
+
}
|
|
233
|
+
type OrganizationManualRole = "owner" | "admin" | "member";
|
|
234
|
+
interface OrganizationManualRoleChangeInput {
|
|
235
|
+
requestedManualRole: OrganizationManualRole;
|
|
236
|
+
expectedActorAuthorityRevision: number;
|
|
237
|
+
expectedTargetAuthorityRevision: number;
|
|
238
|
+
idempotencyKey: string;
|
|
239
|
+
}
|
|
240
|
+
interface OrganizationManualRoleChangeResult {
|
|
241
|
+
status: "applied";
|
|
242
|
+
memberId: string;
|
|
243
|
+
manualRole: OrganizationManualRole;
|
|
244
|
+
role: OrganizationManualRole;
|
|
245
|
+
authorityRevision: number;
|
|
246
|
+
}
|
|
247
|
+
interface OrganizationOwnershipTransferInput {
|
|
248
|
+
outgoingOwnerMembershipId: string;
|
|
249
|
+
successorMembershipId: string;
|
|
250
|
+
outgoingOwnerRole: "admin" | "member";
|
|
251
|
+
expectedActorAuthorityRevision: number;
|
|
252
|
+
expectedOutgoingOwnerAuthorityRevision: number;
|
|
253
|
+
expectedSuccessorAuthorityRevision: number;
|
|
254
|
+
idempotencyKey: string;
|
|
255
|
+
}
|
|
256
|
+
interface OrganizationOwnershipTransferResult {
|
|
257
|
+
status: "applied";
|
|
258
|
+
outgoingOwner: Omit<OrganizationManualRoleChangeResult, "status">;
|
|
259
|
+
successor: Omit<OrganizationManualRoleChangeResult, "status">;
|
|
260
|
+
}
|
|
196
261
|
interface AuthClientOptions {
|
|
197
262
|
authOrigin: string;
|
|
198
263
|
appOrigin: string;
|
|
@@ -203,6 +268,14 @@ interface AuthClientOptions {
|
|
|
203
268
|
}
|
|
204
269
|
interface FinuevaAuthClient {
|
|
205
270
|
readonly _type: "browser";
|
|
271
|
+
getPlatformStatus(): Promise<PlatformStatus>;
|
|
272
|
+
startPlatformRoleChangeRecentAuthentication(input: PlatformRoleChangeRecentAuthenticationInput): Promise<RecentAuthenticationStatus>;
|
|
273
|
+
startOrganizationOwnerRoleChangeRecentAuthentication(organizationId: string, targetMembershipId: string, input: OrganizationManualRoleChangeInput): Promise<RecentAuthenticationStatus>;
|
|
274
|
+
startOrganizationOwnershipTransferRecentAuthentication(organizationId: string, input: OrganizationOwnershipTransferInput): Promise<RecentAuthenticationStatus>;
|
|
275
|
+
approveBootstrapPlatformRoleChange(input: PlatformBootstrapRoleChangeInput): Promise<PlatformRoleApproval>;
|
|
276
|
+
addPasskey(): Promise<void>;
|
|
277
|
+
verifyRecentAuthenticationWithPasskey(): Promise<void>;
|
|
278
|
+
getRecentAuthenticationStatus(): Promise<RecentAuthenticationStatus>;
|
|
206
279
|
acceptInvitation(input: AcceptInvitationInput): Promise<InvitationAcceptance>;
|
|
207
280
|
getSession(): Promise<AuthSession | null>;
|
|
208
281
|
listOrganizations(input?: OrganizationPageInput): Promise<OrganizationPage>;
|
|
@@ -211,6 +284,8 @@ interface FinuevaAuthClient {
|
|
|
211
284
|
createOrganizationMemberInvitation(organizationId: string, input: CreateOrganizationMemberInvitationInput): Promise<CreatedOrganizationMemberInvitation>;
|
|
212
285
|
updateOrganizationDisplay(organizationId: string, input: UpdateOrganizationDisplayInput): Promise<OrganizationDisplay>;
|
|
213
286
|
updateOrganizationTeamDisplay(organizationId: string, teamId: string, input: UpdateOrganizationTeamDisplayInput): Promise<OrganizationTeamDisplay>;
|
|
287
|
+
changeOrganizationMemberManualRole(organizationId: string, targetMembershipId: string, input: OrganizationManualRoleChangeInput): Promise<OrganizationManualRoleChangeResult>;
|
|
288
|
+
transferOrganizationOwnership(organizationId: string, input: OrganizationOwnershipTransferInput): Promise<OrganizationOwnershipTransferResult>;
|
|
214
289
|
listOrganizationMembers(organizationId: string, input?: OrganizationPageInput): Promise<OrganizationMemberPage>;
|
|
215
290
|
listOrganizationTeams(organizationId: string, input?: OrganizationPageInput): Promise<OrganizationTeamPage>;
|
|
216
291
|
listOrganizationTeamMembers(organizationId: string, teamId: string, input?: OrganizationPageInput): Promise<OrganizationTeamMemberPage>;
|
|
@@ -232,4 +307,4 @@ interface FinuevaAuthClient {
|
|
|
232
307
|
onSessionChange(listener: (session: AuthSession | null) => void): () => void;
|
|
233
308
|
}
|
|
234
309
|
//#endregion
|
|
235
|
-
export {
|
|
310
|
+
export { PlatformRole as A, SignInInput as B, OrganizationTeam as C, OrganizationWorkspaceSelection as D, OrganizationTeamPage as E, PlatformStatus as F, UpdateProfileInput as G, SocialIdTokenProvider as H, ReceivedOrganizationInvitation as I, AuthErrorCode as J, WorkspaceSelection as K, ReceivedOrganizationInvitationPage as L, PlatformRoleApproval as M, PlatformRoleChangeRecentAuthenticationInput as N, PersonalWorkspaceSelection as O, PlatformRoleFirstApproval as P, RecentAuthenticationStatus as R, OrganizationPageInput as S, OrganizationTeamMemberPage as T, UpdateOrganizationDisplayInput as U, SocialIdTokenInput as V, UpdateOrganizationTeamDisplayInput as W, AuthErrorStatus as Y, OrganizationInvitation as _, AuthPersistenceDriver as a, OrganizationMemberPage as b, AuthUser as c, CreatedOrganizationTeam as d, DriveCredential as f, OrganizationDisplay as g, InvitationAcceptance as h, AuthPersistence as i, PlatformRoleApplied as j, PlatformBootstrapRoleChangeInput as k, CreateOrganizationMemberInvitationInput as l, FinuevaAuthClient as m, AuthClientOptions as n, AuthSession as o, DriveCredentialInput as p, AuthError as q, AuthOrganization as r, AuthState as s, AcceptInvitationInput as t, CreatedOrganizationMemberInvitation as u, OrganizationInvitationPage as v, OrganizationTeamDisplay as w, OrganizationPage as x, OrganizationMember as y, SendVerificationEmailInput as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finueva/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Public browser and server SDK for Finueva Auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -49,7 +49,9 @@
|
|
|
49
49
|
"typecheck": "tsc --noEmit"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@
|
|
52
|
+
"@better-auth/core": "1.6.22",
|
|
53
|
+
"@better-auth/passkey": "1.6.22",
|
|
54
|
+
"@chiballc/utils": "2.5.1",
|
|
53
55
|
"@types/node": "24.13.3",
|
|
54
56
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
55
57
|
"@vitest/coverage-v8": "4.1.10",
|