@finueva/auth 0.10.0 → 0.11.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.
- package/README.md +153 -385
- 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 +863 -8
- package/dist/server.d.ts +1 -1
- package/dist/server.js +3 -0
- package/dist/{types-Byw9JQwL.d.ts → types-BqpgLkQB.d.ts} +40 -3
- package/package.json +4 -2
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as SocialIdTokenInput, C as OrganizationTeam, D as OrganizationWorkspaceSelection, E as OrganizationTeamPage, F as ReceivedOrganizationInvitation, G as WorkspaceSelection, H as UpdateOrganizationDisplayInput, I as ReceivedOrganizationInvitationPage, J as AuthErrorStatus, K as AuthError, O as PersonalWorkspaceSelection, S as OrganizationPageInput, T as OrganizationTeamMemberPage, U as UpdateOrganizationTeamDisplayInput, V as SocialIdTokenProvider, _ 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 AuthErrorCode, r as AuthOrganization, t as AcceptInvitationInput, u as CreatedOrganizationMemberInvitation, v as OrganizationInvitationPage, w as OrganizationTeamDisplay, x as OrganizationPage, y as OrganizationMember } from "./types-BqpgLkQB.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,38 @@ interface DriveCredentialInput {
|
|
|
193
193
|
workspace: WorkspaceSelection;
|
|
194
194
|
forceRefresh?: boolean;
|
|
195
195
|
}
|
|
196
|
+
type PlatformRole = "administrator" | "investigator";
|
|
197
|
+
interface PlatformRoleChangeRecentAuthenticationInput {
|
|
198
|
+
targetUserId: string;
|
|
199
|
+
requestedRoles: PlatformRole[];
|
|
200
|
+
expectedTargetRevision: number;
|
|
201
|
+
expectedGlobalRevision: number;
|
|
202
|
+
reasonCategory: "initial_bootstrap" | "personnel_change" | "privilege_review" | "quorum_recovery" | "security_response";
|
|
203
|
+
changeReference: string;
|
|
204
|
+
idempotencyKey: string;
|
|
205
|
+
}
|
|
206
|
+
interface PlatformBootstrapRoleChangeInput extends Omit<PlatformRoleChangeRecentAuthenticationInput, "reasonCategory" | "requestedRoles"> {
|
|
207
|
+
requestedRoles: ["administrator"] | ["administrator", "investigator"] | ["investigator", "administrator"];
|
|
208
|
+
reasonCategory: "initial_bootstrap";
|
|
209
|
+
}
|
|
210
|
+
interface PlatformRoleFirstApproval {
|
|
211
|
+
status: "awaiting_second_approval";
|
|
212
|
+
targetUserId: string;
|
|
213
|
+
targetRevision: number;
|
|
214
|
+
globalRevision: number;
|
|
215
|
+
roles: [];
|
|
216
|
+
}
|
|
217
|
+
interface PlatformRoleApplied {
|
|
218
|
+
status: "applied";
|
|
219
|
+
targetUserId: string;
|
|
220
|
+
targetRevision: number;
|
|
221
|
+
globalRevision: number;
|
|
222
|
+
roles: PlatformRole[];
|
|
223
|
+
}
|
|
224
|
+
type PlatformRoleApproval = PlatformRoleFirstApproval | PlatformRoleApplied;
|
|
225
|
+
interface RecentAuthenticationStatus {
|
|
226
|
+
status: "pending" | "ready";
|
|
227
|
+
}
|
|
196
228
|
interface AuthClientOptions {
|
|
197
229
|
authOrigin: string;
|
|
198
230
|
appOrigin: string;
|
|
@@ -203,6 +235,11 @@ interface AuthClientOptions {
|
|
|
203
235
|
}
|
|
204
236
|
interface FinuevaAuthClient {
|
|
205
237
|
readonly _type: "browser";
|
|
238
|
+
startPlatformRoleChangeRecentAuthentication(input: PlatformRoleChangeRecentAuthenticationInput): Promise<RecentAuthenticationStatus>;
|
|
239
|
+
approveBootstrapPlatformRoleChange(input: PlatformBootstrapRoleChangeInput): Promise<PlatformRoleApproval>;
|
|
240
|
+
addPasskey(): Promise<void>;
|
|
241
|
+
verifyRecentAuthenticationWithPasskey(): Promise<void>;
|
|
242
|
+
getRecentAuthenticationStatus(): Promise<RecentAuthenticationStatus>;
|
|
206
243
|
acceptInvitation(input: AcceptInvitationInput): Promise<InvitationAcceptance>;
|
|
207
244
|
getSession(): Promise<AuthSession | null>;
|
|
208
245
|
listOrganizations(input?: OrganizationPageInput): Promise<OrganizationPage>;
|
|
@@ -232,4 +269,4 @@ interface FinuevaAuthClient {
|
|
|
232
269
|
onSessionChange(listener: (session: AuthSession | null) => void): () => void;
|
|
233
270
|
}
|
|
234
271
|
//#endregion
|
|
235
|
-
export {
|
|
272
|
+
export { PlatformRole as A, SocialIdTokenInput as B, OrganizationTeam as C, OrganizationWorkspaceSelection as D, OrganizationTeamPage as E, ReceivedOrganizationInvitation as F, WorkspaceSelection as G, UpdateOrganizationDisplayInput as H, ReceivedOrganizationInvitationPage as I, AuthErrorStatus as J, AuthError as K, RecentAuthenticationStatus as L, PlatformRoleApproval as M, PlatformRoleChangeRecentAuthenticationInput as N, PersonalWorkspaceSelection as O, PlatformRoleFirstApproval as P, SendVerificationEmailInput as R, OrganizationPageInput as S, OrganizationTeamMemberPage as T, UpdateOrganizationTeamDisplayInput as U, SocialIdTokenProvider as V, UpdateProfileInput as W, 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, AuthErrorCode 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, SignInInput as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finueva/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
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",
|