@finueva/auth 0.16.1 → 0.18.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 +36 -22
- package/dist/device.d.ts +4 -2
- package/dist/device.js +163 -39
- package/dist/index.d.ts +2 -2
- package/dist/index.js +165 -1
- package/dist/server.d.ts +56 -2
- package/dist/server.js +2631 -1161
- package/dist/{types-Dpy17xNC.d.ts → types-CrdIcEJ3.d.ts} +28 -2
- package/package.json +4 -2
|
@@ -1,5 +1,16 @@
|
|
|
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
|
|
1
12
|
//#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" | "recipient_unavailable" | "invitation_recipient_mismatch" | "invitation_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";
|
|
13
|
+
type AuthErrorCode = "invalid_credentials" | "invalid_auth_input" | "account_conflict" | "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";
|
|
3
14
|
type AuthErrorStatus = 400 | 401 | 403 | 404 | 405 | 409 | 413 | 415 | 422 | 429 | 503;
|
|
4
15
|
declare class AuthError extends Error {
|
|
5
16
|
readonly code: AuthErrorCode;
|
|
@@ -73,6 +84,11 @@ interface OrganizationTeam {
|
|
|
73
84
|
category: "manual" | "managed";
|
|
74
85
|
createdAt: Date;
|
|
75
86
|
}
|
|
87
|
+
interface CreatedOrganization {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
slug: string;
|
|
91
|
+
}
|
|
76
92
|
interface CreatedOrganizationTeam {
|
|
77
93
|
id: string;
|
|
78
94
|
name: string;
|
|
@@ -93,6 +109,12 @@ interface ResentOrganizationInvitation {
|
|
|
93
109
|
interface CanceledOrganizationInvitation {
|
|
94
110
|
status: "canceled";
|
|
95
111
|
}
|
|
112
|
+
interface RemovedOrganizationMember {
|
|
113
|
+
status: "removed";
|
|
114
|
+
}
|
|
115
|
+
interface OrganizationDeparture {
|
|
116
|
+
status: "left";
|
|
117
|
+
}
|
|
96
118
|
interface OrganizationTeamPage {
|
|
97
119
|
teams: OrganizationTeam[];
|
|
98
120
|
nextCursor: string | null;
|
|
@@ -293,10 +315,13 @@ interface FinuevaAuthClient {
|
|
|
293
315
|
listOrganizations(input?: OrganizationPageInput): Promise<OrganizationPage>;
|
|
294
316
|
getOrganization(organizationId: string): Promise<AuthOrganization>;
|
|
295
317
|
getOrganizationMemberAuthority(organizationId: string, memberId: string): Promise<OrganizationMemberAuthority>;
|
|
318
|
+
createOrganization(name: string, slug: string, idempotencyKey: string): Promise<CreatedOrganization>;
|
|
296
319
|
createOrganizationTeam(organizationId: string, name: string, idempotencyKey: string): Promise<CreatedOrganizationTeam>;
|
|
297
320
|
createOrganizationMemberInvitation(organizationId: string, input: CreateOrganizationMemberInvitationInput): Promise<CreatedOrganizationMemberInvitation>;
|
|
298
321
|
resendOrganizationInvitation(organizationId: string, invitationId: string, idempotencyKey: string): Promise<ResentOrganizationInvitation>;
|
|
299
322
|
cancelOrganizationInvitation(organizationId: string, invitationId: string, idempotencyKey: string): Promise<CanceledOrganizationInvitation>;
|
|
323
|
+
removeOrganizationMember(organizationId: string, memberId: string, idempotencyKey: string): Promise<RemovedOrganizationMember>;
|
|
324
|
+
leaveOrganization(organizationId: string, idempotencyKey: string): Promise<OrganizationDeparture>;
|
|
300
325
|
updateOrganizationDisplay(organizationId: string, input: UpdateOrganizationDisplayInput): Promise<OrganizationDisplay>;
|
|
301
326
|
updateOrganizationTeamDisplay(organizationId: string, teamId: string, input: UpdateOrganizationTeamDisplayInput): Promise<OrganizationTeamDisplay>;
|
|
302
327
|
changeOrganizationMemberManualRole(organizationId: string, targetMembershipId: string, input: OrganizationManualRoleChangeInput): Promise<OrganizationManualRoleChangeResult>;
|
|
@@ -318,8 +343,9 @@ interface FinuevaAuthClient {
|
|
|
318
343
|
resetPassword(token: string, newPassword: string): Promise<void>;
|
|
319
344
|
signOut(): Promise<void>;
|
|
320
345
|
getDriveCredential(input: DriveCredentialInput): Promise<DriveCredential>;
|
|
346
|
+
getUserApiCredential(input: UserApiCredentialInput): Promise<UserApiCredential>;
|
|
321
347
|
onAuthStateChange(listener: (state: AuthState) => void): () => void;
|
|
322
348
|
onSessionChange(listener: (session: AuthSession | null) => void): () => void;
|
|
323
349
|
}
|
|
324
350
|
//#endregion
|
|
325
|
-
export {
|
|
351
|
+
export { AuthError as $, OrganizationTeamPage as A, ReceivedOrganizationInvitation as B, OrganizationMemberAuthority as C, OrganizationTeam as D, OrganizationPageInput as E, PlatformRoleApplied as F, SendVerificationEmailInput as G, RecentAuthenticationStatus as H, PlatformRoleApproval as I, SocialIdTokenProvider as J, SignInInput as K, PlatformRoleChangeRecentAuthenticationInput as L, PersonalWorkspaceSelection as M, PlatformBootstrapRoleChangeInput as N, OrganizationTeamDisplay as O, PlatformRole as P, WorkspaceSelection as Q, PlatformRoleFirstApproval as R, OrganizationMember as S, OrganizationPage as T, RemovedOrganizationMember as U, ReceivedOrganizationInvitationPage as V, ResentOrganizationInvitation as W, UpdateOrganizationTeamDisplayInput as X, UpdateOrganizationDisplayInput as Y, UpdateProfileInput as Z, InvitationAcceptance as _, AuthPersistenceDriver as a, OrganizationInvitation as b, AuthUser as c, CreatedOrganization as d, AuthErrorCode as et, CreatedOrganizationMemberInvitation as f, FinuevaAuthClient as g, DriveCredentialInput as h, AuthPersistence as i, OrganizationWorkspaceSelection as j, OrganizationTeamMemberPage as k, CanceledOrganizationInvitation as l, DriveCredential as m, AuthClientOptions as n, UserApiCredential as nt, AuthSession as o, CreatedOrganizationTeam as p, SocialIdTokenInput as q, AuthOrganization as r, UserApiCredentialInput as rt, AuthState as s, AcceptInvitationInput as t, AuthErrorStatus as tt, CreateOrganizationMemberInvitationInput as u, OrganizationDeparture as v, OrganizationMemberPage as w, OrganizationInvitationPage as x, OrganizationDisplay as y, PlatformStatus as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finueva/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Public browser and server SDK for Finueva Auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
"coverage": "vitest run --coverage",
|
|
43
43
|
"lint": "oxlint . --deny-warnings",
|
|
44
44
|
"prepack": "pnpm build",
|
|
45
|
-
"test": "pnpm test:unit && pnpm build && pnpm test:package",
|
|
45
|
+
"test": "pnpm test:unit && pnpm build && pnpm test:package && pnpm test:user-api",
|
|
46
46
|
"test:composition": "node scripts/test/composition/runner.mjs",
|
|
47
47
|
"test:package": "node scripts/test/package.mjs",
|
|
48
48
|
"test:unit": "vitest run",
|
|
49
|
+
"test:user-api": "node scripts/test/user-api.mjs",
|
|
49
50
|
"typecheck": "tsc --noEmit"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
57
58
|
"@vitest/coverage-v8": "4.1.10",
|
|
58
59
|
"better-auth": "1.6.22",
|
|
60
|
+
"jose": "6.2.4",
|
|
59
61
|
"miniflare": "4.20260722.0",
|
|
60
62
|
"ofetch": "1.5.1",
|
|
61
63
|
"playwright": "1.62.0",
|