@finueva/auth 0.17.0 → 0.18.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 CHANGED
@@ -94,28 +94,31 @@ The browser owns the session cookie. The SDK does not expose or persist it.
94
94
 
95
95
  ## Common Tasks
96
96
 
97
- | Task | Browser | Server | Device |
98
- | ----------------------------- | ------------------------------------------- | ----------------------------------------- | -------------------------------------- |
99
- | Create an account | `signUp()` | Not available | `signUpWithEmail()` |
100
- | Read the current session | `getSession()` | `getSession()` | `getSession()` |
101
- | Observe session state | `onAuthStateChange()` | Not available | Not available |
102
- | Update a profile | `updateProfile()` | Not available | `updateProfile()` |
103
- | Change a password | `changePassword()` | Not available | `changePassword()` |
104
- | Reset a password | `requestPasswordReset()`, `resetPassword()` | Not available | Not available |
105
- | Verify an email | `sendVerificationEmail()` | Not available | Not available |
106
- | List organizations | `listOrganizations()` | `listOrganizations()` | `listOrganizations()` |
107
- | Read member authority | `getOrganizationMemberAuthority()` | `getOrganizationMemberAuthority()` | `getOrganizationMemberAuthority()` |
108
- | Create an ordinary team | `createOrganizationTeam()` | `createOrganizationTeam()` | `createOrganizationTeam()` |
109
- | Invite an ordinary member | `createOrganizationMemberInvitation()` | `createOrganizationMemberInvitation()` | `createOrganizationMemberInvitation()` |
110
- | Resend a member invitation | `resendOrganizationInvitation()` | `resendOrganizationInvitation()` (cookie) | Not available |
111
- | Cancel a member invitation | `cancelOrganizationInvitation()` | `cancelOrganizationInvitation()` (cookie) | Not available |
112
- | Accept an invitation | `acceptInvitation()` | `acceptInvitation()` | Not available |
113
- | Enroll a passkey | `addPasskey()` | Not available | Not available |
114
- | Perform recent authentication | Platform and organization action methods | Not available | Not available |
115
- | Change manual roles or owners | Organization authority methods | Not available | Not available |
116
- | Read current platform roles | `getPlatformStatus()` | Not available | Not available |
117
- | Request Drive access | `getDriveCredential()` | `getDriveCredential()` | `getDriveCredential()` |
118
- | End the current session | `signOut()` | `signOut()` | `revokeCurrentDevice()` |
97
+ | Task | Browser | Server | Device |
98
+ | ------------------------------- | ------------------------------------------- | ----------------------------------------- | -------------------------------------- |
99
+ | Create an account | `signUp()` | Not available | `signUpWithEmail()` |
100
+ | Read the current session | `getSession()` | `getSession()` | `getSession()` |
101
+ | Observe session state | `onAuthStateChange()` | Not available | Not available |
102
+ | Update a profile | `updateProfile()` | Not available | `updateProfile()` |
103
+ | Change a password | `changePassword()` | Not available | `changePassword()` |
104
+ | Reset a password | `requestPasswordReset()`, `resetPassword()` | Not available | Not available |
105
+ | Verify an email | `sendVerificationEmail()` | Not available | Not available |
106
+ | List organizations | `listOrganizations()` | `listOrganizations()` | `listOrganizations()` |
107
+ | Read member authority | `getOrganizationMemberAuthority()` | `getOrganizationMemberAuthority()` | `getOrganizationMemberAuthority()` |
108
+ | Create an ordinary organization | `createOrganization()` | `createOrganization()` | `createOrganization()` |
109
+ | Create an ordinary team | `createOrganizationTeam()` | `createOrganizationTeam()` | `createOrganizationTeam()` |
110
+ | Invite an ordinary member | `createOrganizationMemberInvitation()` | `createOrganizationMemberInvitation()` | `createOrganizationMemberInvitation()` |
111
+ | Resend a member invitation | `resendOrganizationInvitation()` | `resendOrganizationInvitation()` (cookie) | Not available |
112
+ | Cancel a member invitation | `cancelOrganizationInvitation()` | `cancelOrganizationInvitation()` (cookie) | Not available |
113
+ | Remove an ordinary member | `removeOrganizationMember()` | `removeOrganizationMember()` (cookie) | Not available |
114
+ | Leave an organization | `leaveOrganization()` | `leaveOrganization()` (cookie) | Not available |
115
+ | Accept an invitation | `acceptInvitation()` | `acceptInvitation()` | Not available |
116
+ | Enroll a passkey | `addPasskey()` | Not available | Not available |
117
+ | Perform recent authentication | Platform and organization action methods | Not available | Not available |
118
+ | Change manual roles or owners | Organization authority methods | Not available | Not available |
119
+ | Read current platform roles | `getPlatformStatus()` | Not available | Not available |
120
+ | Request Drive access | `getDriveCredential()` | `getDriveCredential()` | `getDriveCredential()` |
121
+ | End the current session | `signOut()` | `signOut()` | `revokeCurrentDevice()` |
119
122
 
120
123
  ## Create An Organization Invitation
121
124
 
@@ -142,6 +145,17 @@ const canceled = await auth.cancelOrganizationInvitation(organizationId, invitat
142
145
 
143
146
  Resend success confirms the committed expiry. It does not confirm email delivery. Repeat an action with the same key only after a lost response. A bearer-backed server client rejects both methods before network I/O.
144
147
 
148
+ ## Remove An Organization Member
149
+
150
+ Manual owners and manual administrators remove one other member. Every current member can leave. Both operations use browser-cookie or server-cookie authority:
151
+
152
+ ```ts
153
+ const removed = await auth.removeOrganizationMember(organizationId, memberId, crypto.randomUUID());
154
+ const left = await auth.leaveOrganization(organizationId, crypto.randomUUID());
155
+ ```
156
+
157
+ An owner target is refused. Transfer ownership first. Repeat a removal with the same key only after a lost response; a membership that is already gone under that key replays the same result. A bearer-backed server client rejects both methods before network I/O.
158
+
145
159
  ## Perform Recent Authentication
146
160
 
147
161
  The experimental passkey methods run only when the browser page uses the exact Auth Origin. To enroll a passkey, first create a new password-authenticated session on that origin:
package/dist/device.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as UserApiCredential, C as OrganizationPage, D as OrganizationTeamMemberPage, E as OrganizationTeamDisplay, G as SocialIdTokenProvider, J as UpdateProfileInput, K as UpdateOrganizationDisplayInput, O as OrganizationTeamPage, Q as AuthErrorStatus, R as ReceivedOrganizationInvitation, S as OrganizationMemberPage, T as OrganizationTeam, W as SocialIdTokenInput, X as AuthError, Z as AuthErrorCode, _ as OrganizationDisplay, b as OrganizationMember, d as CreatedOrganizationMemberInvitation, et as UserApiCredentialInput, f as CreatedOrganizationTeam, m as DriveCredentialInput, o as AuthSession, p as DriveCredential, q as UpdateOrganizationTeamDisplayInput, r as AuthOrganization, u as CreateOrganizationMemberInvitationInput, v as OrganizationInvitation, w as OrganizationPageInput, x as OrganizationMemberAuthority, y as OrganizationInvitationPage, z as ReceivedOrganizationInvitationPage } from "./types-CqFT4G95.js";
1
+ import { $ as AuthError, A as OrganizationTeamPage, B as ReceivedOrganizationInvitation, C as OrganizationMemberAuthority, D as OrganizationTeam, E as OrganizationPageInput, J as SocialIdTokenProvider, O as OrganizationTeamDisplay, S as OrganizationMember, T as OrganizationPage, V as ReceivedOrganizationInvitationPage, X as UpdateOrganizationTeamDisplayInput, Y as UpdateOrganizationDisplayInput, Z as UpdateProfileInput, b as OrganizationInvitation, d as CreatedOrganization, et as AuthErrorCode, f as CreatedOrganizationMemberInvitation, h as DriveCredentialInput, k as OrganizationTeamMemberPage, m as DriveCredential, nt as UserApiCredential, o as AuthSession, p as CreatedOrganizationTeam, q as SocialIdTokenInput, r as AuthOrganization, rt as UserApiCredentialInput, tt as AuthErrorStatus, u as CreateOrganizationMemberInvitationInput, w as OrganizationMemberPage, x as OrganizationInvitationPage, y as OrganizationDisplay } from "./types-CrdIcEJ3.js";
2
2
  //#region src/device.d.ts
3
3
  type DeviceAuthorizationErrorCode = "device_access_denied" | "device_authorization_cancelled" | "device_code_expired" | "invalid_device_authorization" | "identity_authority_unavailable";
4
4
  declare class DeviceAuthorizationError extends Error {
@@ -46,6 +46,7 @@ interface DeviceAuthClient {
46
46
  listOrganizations(input?: OrganizationPageInput): Promise<OrganizationPage>;
47
47
  getOrganization(organizationId: string): Promise<AuthOrganization>;
48
48
  getOrganizationMemberAuthority(organizationId: string, memberId: string): Promise<OrganizationMemberAuthority>;
49
+ createOrganization(name: string, slug: string, idempotencyKey: string): Promise<CreatedOrganization>;
49
50
  createOrganizationTeam(organizationId: string, name: string, idempotencyKey: string): Promise<CreatedOrganizationTeam>;
50
51
  createOrganizationMemberInvitation(organizationId: string, input: CreateOrganizationMemberInvitationInput): Promise<CreatedOrganizationMemberInvitation>;
51
52
  updateOrganizationDisplay(organizationId: string, input: UpdateOrganizationDisplayInput): Promise<OrganizationDisplay>;
@@ -70,4 +71,4 @@ interface DeviceAuthClient {
70
71
  }
71
72
  declare function createDeviceAuth(options: DeviceAuthOptions): DeviceAuthClient;
72
73
  //#endregion
73
- export { AuthError, type AuthErrorCode, type AuthErrorStatus, type AuthOrganization, type CreateOrganizationMemberInvitationInput, type CreatedOrganizationMemberInvitation, type CreatedOrganizationTeam, DeviceAuthClient, DeviceAuthOptions, DeviceAuthorization, DeviceAuthorizationError, DeviceAuthorizationErrorCode, DeviceToken, DeviceTokenPersistence, type OrganizationDisplay, type OrganizationInvitation, type OrganizationInvitationPage, type OrganizationMember, type OrganizationMemberAuthority, type OrganizationMemberPage, type OrganizationPage, type OrganizationPageInput, type OrganizationTeam, type OrganizationTeamDisplay, type OrganizationTeamMemberPage, type OrganizationTeamPage, PollDeviceOptions, type ReceivedOrganizationInvitation, type ReceivedOrganizationInvitationPage, type SocialIdTokenInput, type SocialIdTokenProvider, type UpdateOrganizationDisplayInput, type UpdateOrganizationTeamDisplayInput, type UserApiCredential, type UserApiCredentialInput, createDeviceAuth };
74
+ export { AuthError, type AuthErrorCode, type AuthErrorStatus, type AuthOrganization, type CreateOrganizationMemberInvitationInput, type CreatedOrganization, type CreatedOrganizationMemberInvitation, type CreatedOrganizationTeam, DeviceAuthClient, DeviceAuthOptions, DeviceAuthorization, DeviceAuthorizationError, DeviceAuthorizationErrorCode, DeviceToken, DeviceTokenPersistence, type OrganizationDisplay, type OrganizationInvitation, type OrganizationInvitationPage, type OrganizationMember, type OrganizationMemberAuthority, type OrganizationMemberPage, type OrganizationPage, type OrganizationPageInput, type OrganizationTeam, type OrganizationTeamDisplay, type OrganizationTeamMemberPage, type OrganizationTeamPage, PollDeviceOptions, type ReceivedOrganizationInvitation, type ReceivedOrganizationInvitationPage, type SocialIdTokenInput, type SocialIdTokenProvider, type UpdateOrganizationDisplayInput, type UpdateOrganizationTeamDisplayInput, type UserApiCredential, type UserApiCredentialInput, createDeviceAuth };