@finueva/auth 0.30.0 → 0.32.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 +2 -2
- package/dist/device.d.ts +3 -2
- package/dist/device.js +42 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +114 -4
- package/dist/server.d.ts +166 -2
- package/dist/server.js +516 -87
- package/dist/{types-B_5eALVZ.d.ts → types-BU8vZrhF.d.ts} +53 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -339,7 +339,7 @@ const recipient = await recipients.resolveRecipient(
|
|
|
339
339
|
|
|
340
340
|
The result contains only `{ userId, name, email }`. The SDK trims and lowercases the exact email input. It accepts no additional input fields. Email has a 320-byte UTF-8 limit. The JSON request has a 1024-byte limit. The response has a 4096-byte limit. The canonical ID contains 1 to 128 URL-safe characters. The nonempty name has a 1024-byte UTF-8 limit. A response email must be normalized and match the requested email.
|
|
341
341
|
|
|
342
|
-
The caller generates one Ed25519 assertion with `typ: "finueva-drive-recipient-assertion+jwt"` and the registered JWK-thumbprint `kid`. Set `aud` to the exact Auth endpoint, such as `https://auth.finueva.com/api/v1/auth/drive-share-recipients/resolve`. Set `iss` and `sub` to the same registered service ID. Include the registered `environment`, `ver: 1`, `principal_type: "ecosystem-service"`, a new bounded `jti`, and `exp = iat + 60` in seconds. Auth permits 30 seconds of clock tolerance. A provisioning assertion cannot replace this assertion. The SDK accepts no keys. Auth verifies the assertion; the SDK checks only its compact syntax and the 16 KiB bearer-header limit.
|
|
342
|
+
The caller generates one Ed25519 assertion with `typ: "finueva-drive-recipient-assertion+jwt"` and the registered JWK-thumbprint `kid`. Set `aud` to the exact Auth endpoint, such as `https://auth.finueva.com/api/v1/auth/drive-share-recipients/resolve`. Set `iss` and `sub` to the same registered service ID. Include the registered `environment`, `ver: 1`, `principal_type: "ecosystem-service"`, a new bounded `jti`, and `exp = iat + 60` in seconds. Optionally include `actorUserId`, the canonical Auth User ID of the User for whom the server resolves the recipient. Take it from the server's verified session, not from request values. It contains 1 to 128 URL-safe characters. Auth limits each actor to 30 resolutions per 60 seconds and rejects an invalid `actorUserId` with status 401. Without `actorUserId`, all requests from the service share 10 resolutions per 60 seconds. Auth permits 30 seconds of clock tolerance. A provisioning assertion cannot replace this assertion. The SDK accepts no keys. Auth verifies the assertion; the SDK checks only its compact syntax and the 16 KiB bearer-header limit.
|
|
343
343
|
|
|
344
344
|
This client sends no cookies or Origin. It follows no redirects, retains no recipient cache, and makes no automatic retries. It permits one active request per client and no queue. The default deadline is 10 seconds. `timeoutMs` accepts an integer from 1 to 60000. If a custom transport ignores abort, the client rejects new calls until that transport settles. A custom `fetch` must preserve the request's credential and redirect restrictions.
|
|
345
345
|
|
|
@@ -458,4 +458,4 @@ The request-scoped server method `authorizeOrganizationPresence(organizationId,
|
|
|
458
458
|
|
|
459
459
|
### Organization admission candidate
|
|
460
460
|
|
|
461
|
-
Import `createOrganizationAdmissionAuth`, `createOrganizationAdmissionBillingAuth`, and `createOrganizationAdmissionDirectoryAuth` from `@finueva/auth/server`. These separate clients expose actor setup operations, private billing attestations, and the pending setup directory. Actor operations require a current incoming request and a separate service assertion. Use `organizationAdmissionBodyDigest(operation, input)` and the client's `audience(operation)` when signing each fresh assertion. A pending setup grants no organization membership or Drive authority. This source candidate requires release and hosted qualification before use.
|
|
461
|
+
Import `createOrganizationAdmissionAuth`, `createOrganizationAdmissionBillingAuth`, and `createOrganizationAdmissionDirectoryAuth` from `@finueva/auth/server`. These separate clients expose actor setup operations, private billing attestations, and the pending setup directory. Actor operations require a current incoming request and a separate service assertion. Use `organizationAdmissionBodyDigest(operation, input)` and the client's `audience(operation)` when signing each fresh assertion. A pending setup grants no organization membership or Drive authority. `getCurrentAdmission` returns `null` or an admission whose `state` is `pending` or `active`. Auth keeps no admission policy, cohort, or seal. This source candidate requires release and hosted qualification before use.
|
package/dist/device.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as OrganizationTeam, C as CreatedOrganizationTeam, Dt as SocialIdTokenProvider, Et as SocialIdTokenInput, Ft as UpdateOrganizationDisplayInput, G as OrganizationMemberAuthority, Gt as AuthErrorStatus, H as OrganizationInvitation, It as UpdateOrganizationTeamDisplayInput, J as OrganizationMemberPageInput, K as OrganizationMemberAuthorityV2, Kt as UserApiCredential, Lt as UpdateProfileInput, Mt as TwoFactorStatus, O as DriveCredential, S as CreatedOrganizationMemberInvitation, U as OrganizationInvitationPage, Ut as AuthError, V as OrganizationDisplay, W as OrganizationMember, Wt as AuthErrorCode, X as OrganizationPageInput, Y as OrganizationPage, b as CreateOrganizationMemberInvitationInput, c as AuthSessionInventory, et as OrganizationTeamDisplay, ht as ReceivedOrganizationInvitationPage, i as AuthOrganization, it as PasskeyInventory, k as DriveCredentialInput, m as CeremonyHandoffInput, mt as ReceivedOrganizationInvitation, nt as OrganizationTeamPage, p as CeremonyHandoff, q as OrganizationMemberPage, qt as UserApiCredentialInput, s as AuthSession, tt as OrganizationTeamMemberPage, x as CreatedOrganization } from "./types-BU8vZrhF.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
|
+
getOrganizationMemberAuthorityV2(organizationId: string, memberId: string): Promise<OrganizationMemberAuthorityV2>;
|
|
49
50
|
createOrganization(name: string, slug: string, idempotencyKey: string): Promise<CreatedOrganization>;
|
|
50
51
|
createOrganizationTeam(organizationId: string, name: string, idempotencyKey: string): Promise<CreatedOrganizationTeam>;
|
|
51
52
|
createOrganizationMemberInvitation(organizationId: string, input: CreateOrganizationMemberInvitationInput): Promise<CreatedOrganizationMemberInvitation>;
|
|
@@ -91,4 +92,4 @@ interface DeviceAuthClient {
|
|
|
91
92
|
}
|
|
92
93
|
declare function createDeviceAuth(options: DeviceAuthOptions): DeviceAuthClient;
|
|
93
94
|
//#endregion
|
|
94
|
-
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 OrganizationMemberPageInput, type OrganizationPage, type OrganizationPageInput, type OrganizationTeam, type OrganizationTeamDisplay, type OrganizationTeamMemberPage, type OrganizationTeamPage, PollDeviceOptions, type ReceivedOrganizationInvitation, type ReceivedOrganizationInvitationPage, type SocialIdTokenInput, type SocialIdTokenProvider, type TwoFactorStatus, type UpdateOrganizationDisplayInput, type UpdateOrganizationTeamDisplayInput, type UserApiCredential, type UserApiCredentialInput, createDeviceAuth };
|
|
95
|
+
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 OrganizationMemberAuthorityV2, type OrganizationMemberPage, type OrganizationMemberPageInput, type OrganizationPage, type OrganizationPageInput, type OrganizationTeam, type OrganizationTeamDisplay, type OrganizationTeamMemberPage, type OrganizationTeamPage, PollDeviceOptions, type ReceivedOrganizationInvitation, type ReceivedOrganizationInvitationPage, type SocialIdTokenInput, type SocialIdTokenProvider, type TwoFactorStatus, type UpdateOrganizationDisplayInput, type UpdateOrganizationTeamDisplayInput, type UserApiCredential, type UserApiCredentialInput, createDeviceAuth };
|
package/dist/device.js
CHANGED
|
@@ -743,6 +743,43 @@ function normalizeOrganizationMemberAuthority(value, organizationId, memberId) {
|
|
|
743
743
|
target
|
|
744
744
|
};
|
|
745
745
|
}
|
|
746
|
+
function normalizeOrganizationMemberAuthorityV2(value, organizationId, memberId) {
|
|
747
|
+
exact$2(value, [
|
|
748
|
+
"version",
|
|
749
|
+
"organizationId",
|
|
750
|
+
"actor",
|
|
751
|
+
"target"
|
|
752
|
+
]);
|
|
753
|
+
if (value.version !== 2 || value.organizationId !== organizationId || !isId(value.organizationId)) throw authorityUnavailable();
|
|
754
|
+
const target = value.target;
|
|
755
|
+
exact$2(target, [
|
|
756
|
+
"memberId",
|
|
757
|
+
"manualRole",
|
|
758
|
+
"role",
|
|
759
|
+
"authorityRevision"
|
|
760
|
+
]);
|
|
761
|
+
if (target.manualRole !== null) return {
|
|
762
|
+
version: 2,
|
|
763
|
+
...normalizeOrganizationMemberAuthority({
|
|
764
|
+
organizationId: value.organizationId,
|
|
765
|
+
actor: value.actor,
|
|
766
|
+
target
|
|
767
|
+
}, organizationId, memberId)
|
|
768
|
+
};
|
|
769
|
+
const actor = normalizeOrganizationAuthorityMemberOutcome(value.actor);
|
|
770
|
+
if (actor.manualRole !== "owner" && actor.manualRole !== "admin" || actor.role !== actor.manualRole || !isId(target.memberId) || target.memberId !== memberId || target.memberId === actor.memberId || target.role !== "member" && target.role !== "admin") throw authorityUnavailable();
|
|
771
|
+
return {
|
|
772
|
+
version: 2,
|
|
773
|
+
organizationId: value.organizationId,
|
|
774
|
+
actor,
|
|
775
|
+
target: {
|
|
776
|
+
memberId: target.memberId,
|
|
777
|
+
manualRole: null,
|
|
778
|
+
role: target.role,
|
|
779
|
+
authorityRevision: normalizeAuthorityResultRevision(target.authorityRevision)
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
}
|
|
746
783
|
function normalizeOrganizationAuthorityMemberOutcome(value, includesStatus = false) {
|
|
747
784
|
exact$2(value, [
|
|
748
785
|
"memberId",
|
|
@@ -1985,6 +2022,11 @@ function createDeviceAuth(options) {
|
|
|
1985
2022
|
const member = normalizeIdInput(memberId);
|
|
1986
2023
|
return serializeAuthority(() => organizationRead(`${organization}/members/${member}/authority`, void 0, (value) => normalizeOrganizationMemberAuthority(value, organization, member)));
|
|
1987
2024
|
},
|
|
2025
|
+
async getOrganizationMemberAuthorityV2(organizationId, memberId) {
|
|
2026
|
+
const organization = normalizeIdInput(organizationId);
|
|
2027
|
+
const member = normalizeIdInput(memberId);
|
|
2028
|
+
return serializeAuthority(() => organizationRead(`${organization}/members/${member}/authority`, void 0, (value) => normalizeOrganizationMemberAuthorityV2(value, organization, member), () => new URLSearchParams({ version: "2" })));
|
|
2029
|
+
},
|
|
1988
2030
|
createOrganization(name, slug, idempotencyKey) {
|
|
1989
2031
|
let body;
|
|
1990
2032
|
try {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as OrganizationTeam, A as EnterpriseConnection, At as SuspendedOrganizationMemberStatus, B as OrganizationDeparture, Bt as RegisterOrganizationApplicationInput, C as CreatedOrganizationTeam, Ct as ScimCredentialState, D as DepartedOrganizationMemberPage, Dt as SocialIdTokenProvider, E as DepartedOrganizationMember, Et as SocialIdTokenInput, F as InvitationAcceptance, Ft as UpdateOrganizationDisplayInput, G as OrganizationMemberAuthority, Gt as AuthErrorStatus, H as OrganizationInvitation, I as InvitationDecline, It as UpdateOrganizationTeamDisplayInput, J as OrganizationMemberPageInput, K as OrganizationMemberAuthorityV2, Kt as UserApiCredential, L as OrganizationClosure, Lt as UpdateProfileInput, M as EnterpriseConnectionDomain, Mt as TwoFactorStatus, N as EnterpriseConnectionSetup, Nt as TwoFactorStepUpInput, O as DriveCredential, Ot as SuspendedOrganizationMember, P as FinuevaAuthClient, Pt as UpdateEnterpriseConnectionInput, Q as OrganizationSignInStates, R as OrganizationClosureCancelInput, Rt as WorkspaceSelection, S as CreatedOrganizationMemberInvitation, St as ScimCredentialIssuance, T as DeletedOrganizationTeam, Tt as SignInInput, U as OrganizationInvitationPage, Ut as AuthError, V as OrganizationDisplay, Vt as RegisteredOrganizationApplication, W as OrganizationMember, Wt as AuthErrorCode, X as OrganizationPageInput, Y as OrganizationPage, Z as OrganizationSignInState, _ as ClosingOrganization, _t as RemovedOrganizationMember, a as AuthPersistence, at as PasskeySummary, b as CreateOrganizationMemberInvitationInput, bt as RestoredOrganizationMember, c as AuthSessionInventory, ct as PlatformRole, d as AuthUser, dt as PlatformRoleChangeRecentAuthenticationInput, et as OrganizationTeamDisplay, f as CanceledOrganizationInvitation, ft as PlatformRoleFirstApproval, g as CeremonyReturnInput, gt as RecentAuthenticationStatus, h as CeremonyRecentAuthenticationRequest, ht as ReceivedOrganizationInvitationPage, i as AuthOrganization, it as PasskeyInventory, j as EnterpriseConnectionAction, jt as TwoFactorEnrollment, k as DriveCredentialInput, kt as SuspendedOrganizationMemberPage, l as AuthSessionSummary, lt as PlatformRoleApplied, m as CeremonyHandoffInput, mt as ReceivedOrganizationInvitation, n as AddedOrganizationTeamMember, nt as OrganizationTeamPage, o as AuthPersistenceDriver, ot as PersonalWorkspaceSelection, p as CeremonyHandoff, pt as PlatformStatus, q as OrganizationMemberPage, qt as UserApiCredentialInput, r as AuthClientOptions, rt as OrganizationWorkspaceSelection, s as AuthSession, st as PlatformBootstrapRoleChangeInput, t as AcceptInvitationInput, tt as OrganizationTeamMemberPage, u as AuthState, ut as PlatformRoleApproval, v as ClosingOrganizationList, vt as RemovedOrganizationTeamMember, w as DeclineInvitationInput, wt as SendVerificationEmailInput, x as CreatedOrganization, xt as RotateScimCredentialInput, y as CreateEnterpriseConnectionInput, yt as ResentOrganizationInvitation, z as OrganizationClosureStartInput, zt as OrganizationApplicationRegistration } from "./types-BU8vZrhF.js";
|
|
2
2
|
//#region src/client.d.ts
|
|
3
3
|
declare function createAuthClient(options: AuthClientOptions): FinuevaAuthClient;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { type AcceptInvitationInput, type AddedOrganizationTeamMember, type AuthClientOptions, AuthError, type AuthErrorCode, type AuthErrorStatus, type AuthOrganization, type AuthPersistence, type AuthPersistenceDriver, type AuthSession, type AuthSessionInventory, type AuthSessionSummary, type AuthState, type AuthUser, type CanceledOrganizationInvitation, type CeremonyHandoff, type CeremonyHandoffInput, type CeremonyRecentAuthenticationRequest, type CeremonyReturnInput, type ClosingOrganization, type ClosingOrganizationList, type CreateEnterpriseConnectionInput, type CreateOrganizationMemberInvitationInput, type CreatedOrganization, type CreatedOrganizationMemberInvitation, type CreatedOrganizationTeam, type DeclineInvitationInput, type DeletedOrganizationTeam, type DepartedOrganizationMember, type DepartedOrganizationMemberPage, type DriveCredential, type DriveCredentialInput, type EnterpriseConnection, type EnterpriseConnectionAction, type EnterpriseConnectionSetup, type FinuevaAuthClient, type InvitationAcceptance, type InvitationDecline, type OrganizationApplicationRegistration, type OrganizationClosure, type OrganizationClosureCancelInput, type OrganizationClosureStartInput, type OrganizationDeparture, type OrganizationDisplay, type OrganizationInvitation, type OrganizationInvitationPage, type OrganizationMember, type OrganizationMemberAuthority, type OrganizationMemberPage, type OrganizationMemberPageInput, type OrganizationPage, type OrganizationPageInput, type OrganizationTeam, type OrganizationTeamDisplay, type OrganizationTeamMemberPage, type OrganizationTeamPage, type OrganizationWorkspaceSelection, type PasskeyInventory, type PasskeySummary, type PersonalWorkspaceSelection, type PlatformBootstrapRoleChangeInput, type PlatformRole, type PlatformRoleApplied, type PlatformRoleApproval, type PlatformRoleChangeRecentAuthenticationInput, type PlatformRoleFirstApproval, type PlatformStatus, type ReceivedOrganizationInvitation, type ReceivedOrganizationInvitationPage, type RecentAuthenticationStatus, type RegisterOrganizationApplicationInput, type RegisteredOrganizationApplication, type RemovedOrganizationMember, type RemovedOrganizationTeamMember, type ResentOrganizationInvitation, type RestoredOrganizationMember, type RotateScimCredentialInput, type ScimCredentialIssuance, type ScimCredentialState, type SendVerificationEmailInput, type SignInInput, type SocialIdTokenInput, type SocialIdTokenProvider, type SuspendedOrganizationMember, type SuspendedOrganizationMemberPage, type SuspendedOrganizationMemberStatus, type TwoFactorEnrollment, type TwoFactorStatus, type TwoFactorStepUpInput, type UpdateEnterpriseConnectionInput, type UpdateOrganizationDisplayInput, type UpdateOrganizationTeamDisplayInput, type UpdateProfileInput, type UserApiCredential, type UserApiCredentialInput, type WorkspaceSelection, createAuthClient };
|
|
5
|
+
export { type AcceptInvitationInput, type AddedOrganizationTeamMember, type AuthClientOptions, AuthError, type AuthErrorCode, type AuthErrorStatus, type AuthOrganization, type AuthPersistence, type AuthPersistenceDriver, type AuthSession, type AuthSessionInventory, type AuthSessionSummary, type AuthState, type AuthUser, type CanceledOrganizationInvitation, type CeremonyHandoff, type CeremonyHandoffInput, type CeremonyRecentAuthenticationRequest, type CeremonyReturnInput, type ClosingOrganization, type ClosingOrganizationList, type CreateEnterpriseConnectionInput, type CreateOrganizationMemberInvitationInput, type CreatedOrganization, type CreatedOrganizationMemberInvitation, type CreatedOrganizationTeam, type DeclineInvitationInput, type DeletedOrganizationTeam, type DepartedOrganizationMember, type DepartedOrganizationMemberPage, type DriveCredential, type DriveCredentialInput, type EnterpriseConnection, type EnterpriseConnectionAction, type EnterpriseConnectionDomain, type EnterpriseConnectionSetup, type FinuevaAuthClient, type InvitationAcceptance, type InvitationDecline, type OrganizationApplicationRegistration, type OrganizationClosure, type OrganizationClosureCancelInput, type OrganizationClosureStartInput, type OrganizationDeparture, type OrganizationDisplay, type OrganizationInvitation, type OrganizationInvitationPage, type OrganizationMember, type OrganizationMemberAuthority, type OrganizationMemberAuthorityV2, type OrganizationMemberPage, type OrganizationMemberPageInput, type OrganizationPage, type OrganizationPageInput, type OrganizationSignInState, type OrganizationSignInStates, type OrganizationTeam, type OrganizationTeamDisplay, type OrganizationTeamMemberPage, type OrganizationTeamPage, type OrganizationWorkspaceSelection, type PasskeyInventory, type PasskeySummary, type PersonalWorkspaceSelection, type PlatformBootstrapRoleChangeInput, type PlatformRole, type PlatformRoleApplied, type PlatformRoleApproval, type PlatformRoleChangeRecentAuthenticationInput, type PlatformRoleFirstApproval, type PlatformStatus, type ReceivedOrganizationInvitation, type ReceivedOrganizationInvitationPage, type RecentAuthenticationStatus, type RegisterOrganizationApplicationInput, type RegisteredOrganizationApplication, type RemovedOrganizationMember, type RemovedOrganizationTeamMember, type ResentOrganizationInvitation, type RestoredOrganizationMember, type RotateScimCredentialInput, type ScimCredentialIssuance, type ScimCredentialState, type SendVerificationEmailInput, type SignInInput, type SocialIdTokenInput, type SocialIdTokenProvider, type SuspendedOrganizationMember, type SuspendedOrganizationMemberPage, type SuspendedOrganizationMemberStatus, type TwoFactorEnrollment, type TwoFactorStatus, type TwoFactorStepUpInput, type UpdateEnterpriseConnectionInput, type UpdateOrganizationDisplayInput, type UpdateOrganizationTeamDisplayInput, type UpdateProfileInput, type UserApiCredential, type UserApiCredentialInput, type WorkspaceSelection, createAuthClient };
|
package/dist/index.js
CHANGED
|
@@ -865,6 +865,43 @@ function normalizeOrganizationMemberAuthority(value, organizationId, memberId) {
|
|
|
865
865
|
target
|
|
866
866
|
};
|
|
867
867
|
}
|
|
868
|
+
function normalizeOrganizationMemberAuthorityV2(value, organizationId, memberId) {
|
|
869
|
+
exact$4(value, [
|
|
870
|
+
"version",
|
|
871
|
+
"organizationId",
|
|
872
|
+
"actor",
|
|
873
|
+
"target"
|
|
874
|
+
]);
|
|
875
|
+
if (value.version !== 2 || value.organizationId !== organizationId || !isId(value.organizationId)) throw authorityUnavailable();
|
|
876
|
+
const target = value.target;
|
|
877
|
+
exact$4(target, [
|
|
878
|
+
"memberId",
|
|
879
|
+
"manualRole",
|
|
880
|
+
"role",
|
|
881
|
+
"authorityRevision"
|
|
882
|
+
]);
|
|
883
|
+
if (target.manualRole !== null) return {
|
|
884
|
+
version: 2,
|
|
885
|
+
...normalizeOrganizationMemberAuthority({
|
|
886
|
+
organizationId: value.organizationId,
|
|
887
|
+
actor: value.actor,
|
|
888
|
+
target
|
|
889
|
+
}, organizationId, memberId)
|
|
890
|
+
};
|
|
891
|
+
const actor = normalizeOrganizationAuthorityMemberOutcome(value.actor);
|
|
892
|
+
if (actor.manualRole !== "owner" && actor.manualRole !== "admin" || actor.role !== actor.manualRole || !isId(target.memberId) || target.memberId !== memberId || target.memberId === actor.memberId || target.role !== "member" && target.role !== "admin") throw authorityUnavailable();
|
|
893
|
+
return {
|
|
894
|
+
version: 2,
|
|
895
|
+
organizationId: value.organizationId,
|
|
896
|
+
actor,
|
|
897
|
+
target: {
|
|
898
|
+
memberId: target.memberId,
|
|
899
|
+
manualRole: null,
|
|
900
|
+
role: target.role,
|
|
901
|
+
authorityRevision: normalizeAuthorityResultRevision(target.authorityRevision)
|
|
902
|
+
}
|
|
903
|
+
};
|
|
904
|
+
}
|
|
868
905
|
function normalizeOrganizationOwnershipTransferResult(value) {
|
|
869
906
|
exact$4(value, [
|
|
870
907
|
"status",
|
|
@@ -5197,9 +5234,11 @@ const setupKeys = [
|
|
|
5197
5234
|
"enabled",
|
|
5198
5235
|
"memberJit",
|
|
5199
5236
|
"requireVerifiedEmail",
|
|
5237
|
+
"requireOrganizationSignIn",
|
|
5200
5238
|
"capability",
|
|
5201
5239
|
"groupsSync",
|
|
5202
5240
|
"domain",
|
|
5241
|
+
"domains",
|
|
5203
5242
|
"domainVerified",
|
|
5204
5243
|
"validatedAt",
|
|
5205
5244
|
"testedAt",
|
|
@@ -5208,8 +5247,37 @@ const setupKeys = [
|
|
|
5208
5247
|
"challengeExpiresAt",
|
|
5209
5248
|
"redirectUri"
|
|
5210
5249
|
];
|
|
5250
|
+
const domainPattern = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
|
|
5251
|
+
function normalizeConnectionDomain(value) {
|
|
5252
|
+
if (!exact(value, [
|
|
5253
|
+
"domain",
|
|
5254
|
+
"revision",
|
|
5255
|
+
"primary",
|
|
5256
|
+
"verified",
|
|
5257
|
+
"dnsRecordName",
|
|
5258
|
+
"dnsRecordValue",
|
|
5259
|
+
"challengeExpiresAt"
|
|
5260
|
+
]) || typeof value.domain !== "string" || value.domain.length > 253 || !domainPattern.test(value.domain) || !Number.isSafeInteger(value.revision) || value.revision < 0 || value.dnsRecordName !== `_finueva-sso.${value.domain}` || typeof value.dnsRecordValue !== "string" || !/^finueva-sso=[A-Za-z0-9_-]{43}$/.test(value.dnsRecordValue)) throw authorityUnavailable();
|
|
5261
|
+
return {
|
|
5262
|
+
domain: value.domain,
|
|
5263
|
+
revision: value.revision,
|
|
5264
|
+
primary: bool(value.primary),
|
|
5265
|
+
verified: bool(value.verified),
|
|
5266
|
+
dnsRecordName: value.dnsRecordName,
|
|
5267
|
+
dnsRecordValue: value.dnsRecordValue,
|
|
5268
|
+
challengeExpiresAt: date(value.challengeExpiresAt, false)
|
|
5269
|
+
};
|
|
5270
|
+
}
|
|
5271
|
+
function enterpriseDomainInput(value) {
|
|
5272
|
+
if (typeof value !== "string" || value.length > 253 || !domainPattern.test(value)) throw new TypeError("Enterprise domain is invalid");
|
|
5273
|
+
return value;
|
|
5274
|
+
}
|
|
5211
5275
|
function normalizeEnterpriseConnectionSetup(value) {
|
|
5212
|
-
if (!exact(value, setupKeys) || value.capability !== "federated_sign_in" && value.capability !== "managed_lifecycle" || typeof value.id !== "string" || !idPattern.test(value.id) || typeof value.issuer !== "string" || value.issuer.length > 2048 || !value.issuer.startsWith("https://") || typeof value.clientId !== "string" || value.clientId.length < 1 || value.clientId.length > 256 || typeof value.domain !== "string" ||
|
|
5276
|
+
if (!exact(value, setupKeys) || value.capability !== "federated_sign_in" && value.capability !== "managed_lifecycle" || typeof value.id !== "string" || !idPattern.test(value.id) || typeof value.issuer !== "string" || value.issuer.length > 2048 || !value.issuer.startsWith("https://") || typeof value.clientId !== "string" || value.clientId.length < 1 || value.clientId.length > 256 || value.domain !== null && (typeof value.domain !== "string" || !domainPattern.test(value.domain) || value.domain.length > 253 || value.dnsRecordName !== `_finueva-sso.${value.domain}` || typeof value.dnsRecordValue !== "string" || !/^finueva-sso=[A-Za-z0-9_-]{43}$/.test(value.dnsRecordValue)) || value.domain === null && (value.dnsRecordName !== null || value.dnsRecordValue !== null || value.challengeExpiresAt !== null || value.domainVerified !== false) || !Array.isArray(value.domains) || value.domains.length > 10 || typeof value.redirectUri !== "string" || value.redirectUri.length > 2048 || !Number.isSafeInteger(value.revision) || value.revision < 0) throw authorityUnavailable();
|
|
5277
|
+
const domains = value.domains.map(normalizeConnectionDomain);
|
|
5278
|
+
const primary = domains.filter((domain) => domain.primary);
|
|
5279
|
+
const challengeExpiresAt = date(value.challengeExpiresAt, value.domain === null);
|
|
5280
|
+
if (new Set(domains.map((domain) => domain.domain)).size !== domains.length || (value.domain === null ? primary.length !== 0 : primary.length !== 1 || primary[0].domain !== value.domain || primary[0].dnsRecordName !== value.dnsRecordName || primary[0].dnsRecordValue !== value.dnsRecordValue || primary[0].verified !== value.domainVerified || primary[0].challengeExpiresAt.getTime() !== challengeExpiresAt?.getTime())) throw authorityUnavailable();
|
|
5213
5281
|
let redirect;
|
|
5214
5282
|
try {
|
|
5215
5283
|
redirect = new URL(value.redirectUri);
|
|
@@ -5225,15 +5293,17 @@ function normalizeEnterpriseConnectionSetup(value) {
|
|
|
5225
5293
|
enabled: bool(value.enabled),
|
|
5226
5294
|
memberJit: bool(value.memberJit),
|
|
5227
5295
|
requireVerifiedEmail: bool(value.requireVerifiedEmail),
|
|
5296
|
+
requireOrganizationSignIn: bool(value.requireOrganizationSignIn),
|
|
5228
5297
|
capability: value.capability,
|
|
5229
5298
|
groupsSync: bool(value.groupsSync),
|
|
5230
5299
|
domain: value.domain,
|
|
5300
|
+
domains,
|
|
5231
5301
|
domainVerified: bool(value.domainVerified),
|
|
5232
5302
|
validatedAt: date(value.validatedAt, true),
|
|
5233
5303
|
testedAt: date(value.testedAt, true),
|
|
5234
5304
|
dnsRecordName: value.dnsRecordName,
|
|
5235
5305
|
dnsRecordValue: value.dnsRecordValue,
|
|
5236
|
-
challengeExpiresAt
|
|
5306
|
+
challengeExpiresAt,
|
|
5237
5307
|
redirectUri: value.redirectUri
|
|
5238
5308
|
};
|
|
5239
5309
|
}
|
|
@@ -5264,6 +5334,17 @@ function normalizeEnterpriseTestAuthorization(value) {
|
|
|
5264
5334
|
if (url.protocol !== "https:" || url.username || url.password || url.hash || !url.searchParams.get("state") || url.searchParams.get("response_type") !== "code") throw authorityUnavailable();
|
|
5265
5335
|
return { url: value.url };
|
|
5266
5336
|
}
|
|
5337
|
+
function normalizeOrganizationSignInState(value) {
|
|
5338
|
+
if (exact(value, ["status", "mode"]) && value.status === "available" && (value.mode === "membership" || value.mode === "provider")) return {
|
|
5339
|
+
status: value.status,
|
|
5340
|
+
mode: value.mode
|
|
5341
|
+
};
|
|
5342
|
+
if (exact(value, ["status", "connectionId"]) && value.status === "sign_in_required" && typeof value.connectionId === "string" && idPattern.test(value.connectionId)) return {
|
|
5343
|
+
status: value.status,
|
|
5344
|
+
connectionId: value.connectionId
|
|
5345
|
+
};
|
|
5346
|
+
throw authorityUnavailable();
|
|
5347
|
+
}
|
|
5267
5348
|
//#endregion
|
|
5268
5349
|
//#region src/user-api/credential.ts
|
|
5269
5350
|
function userApiApplication(input) {
|
|
@@ -5762,7 +5843,7 @@ function createAuthClient(options) {
|
|
|
5762
5843
|
method,
|
|
5763
5844
|
headers: {
|
|
5764
5845
|
...body ? { "content-type": "application/json" } : {},
|
|
5765
|
-
...path.includes("/connection-setup") ? { "x-finueva-connection-setup": "
|
|
5846
|
+
...path.includes("/connection-setup") ? { "x-finueva-connection-setup": "domains" } : {}
|
|
5766
5847
|
},
|
|
5767
5848
|
...body ? { body } : {},
|
|
5768
5849
|
mapError: fromEnterpriseAdministrationError
|
|
@@ -5999,11 +6080,19 @@ function createAuthClient(options) {
|
|
|
5999
6080
|
async getOrganization(organizationId) {
|
|
6000
6081
|
return organizationRead(normalizeIdInput(organizationId), void 0, normalizeOrganization);
|
|
6001
6082
|
},
|
|
6083
|
+
async getOrganizationSignInState(organizationId) {
|
|
6084
|
+
return organizationRead(`${normalizeIdInput(organizationId)}/sign-in-state`, void 0, normalizeOrganizationSignInState);
|
|
6085
|
+
},
|
|
6002
6086
|
async getOrganizationMemberAuthority(organizationId, memberId) {
|
|
6003
6087
|
const organization = normalizeIdInput(organizationId);
|
|
6004
6088
|
const member = normalizeIdInput(memberId);
|
|
6005
6089
|
return organizationRead(`${organization}/members/${member}/authority`, void 0, (value) => normalizeOrganizationMemberAuthority(value, organization, member));
|
|
6006
6090
|
},
|
|
6091
|
+
async getOrganizationMemberAuthorityV2(organizationId, memberId) {
|
|
6092
|
+
const organization = normalizeIdInput(organizationId);
|
|
6093
|
+
const member = normalizeIdInput(memberId);
|
|
6094
|
+
return organizationRead(`${organization}/members/${member}/authority`, void 0, (value) => normalizeOrganizationMemberAuthorityV2(value, organization, member), () => new URLSearchParams({ version: "2" }));
|
|
6095
|
+
},
|
|
6007
6096
|
getOrganizationApplicationRegistration(organizationId, applicationId) {
|
|
6008
6097
|
return organizationRead(registrationTarget(organizationId, applicationId), void 0, (value) => normalizeOrganizationApplicationRegistration(value, organizationId, applicationId));
|
|
6009
6098
|
},
|
|
@@ -6315,12 +6404,14 @@ function createAuthClient(options) {
|
|
|
6315
6404
|
issuer: enterpriseInputString(input?.issuer, 2048),
|
|
6316
6405
|
clientId: enterpriseInputString(input?.clientId, 256),
|
|
6317
6406
|
clientSecret: enterpriseInputString(input?.clientSecret, 512),
|
|
6318
|
-
domain:
|
|
6407
|
+
domain: input?.domain === null ? null : enterpriseDomainInput(input?.domain),
|
|
6319
6408
|
memberJit: enterpriseInputBoolean(input?.memberJit),
|
|
6320
6409
|
...input?.requireVerifiedEmail === void 0 ? {} : { requireVerifiedEmail: enterpriseInputBoolean(input.requireVerifiedEmail) },
|
|
6410
|
+
...input?.requireOrganizationSignIn === void 0 ? {} : { requireOrganizationSignIn: enterpriseInputBoolean(input.requireOrganizationSignIn) },
|
|
6321
6411
|
...input?.provisioning === void 0 ? {} : { provisioning: enterpriseInputBoolean(input.provisioning) },
|
|
6322
6412
|
...input?.groupsSync === void 0 ? {} : { groupsSync: enterpriseInputBoolean(input.groupsSync) }
|
|
6323
6413
|
};
|
|
6414
|
+
if (body.domain === null && body.memberJit) throw new TypeError("Automatic membership requires an enterprise domain");
|
|
6324
6415
|
return enterpriseRequest("POST", `${normalizeIdInput(organizationId)}/connection-setup`, body, normalizeEnterpriseConnectionSetup);
|
|
6325
6416
|
},
|
|
6326
6417
|
async updateEnterpriseConnection(organizationId, connectionId, input) {
|
|
@@ -6330,6 +6421,7 @@ function createAuthClient(options) {
|
|
|
6330
6421
|
clientId: enterpriseInputString(input?.clientId, 256),
|
|
6331
6422
|
memberJit: enterpriseInputBoolean(input?.memberJit),
|
|
6332
6423
|
...input?.requireVerifiedEmail === void 0 ? {} : { requireVerifiedEmail: enterpriseInputBoolean(input.requireVerifiedEmail) },
|
|
6424
|
+
...input?.requireOrganizationSignIn === void 0 ? {} : { requireOrganizationSignIn: enterpriseInputBoolean(input.requireOrganizationSignIn) },
|
|
6333
6425
|
...input?.provisioning === void 0 ? {} : { provisioning: enterpriseInputBoolean(input.provisioning) },
|
|
6334
6426
|
...input?.groupsSync === void 0 ? {} : { groupsSync: enterpriseInputBoolean(input.groupsSync) },
|
|
6335
6427
|
...input?.clientSecret === void 0 ? {} : { clientSecret: enterpriseInputString(input.clientSecret, 512) }
|
|
@@ -6353,6 +6445,24 @@ function createAuthClient(options) {
|
|
|
6353
6445
|
};
|
|
6354
6446
|
return enterpriseRequest("POST", `${normalizeIdInput(organizationId)}/connection-setup/${normalizeIdInput(connectionId)}/actions`, body, normalizeEnterpriseConnectionAction);
|
|
6355
6447
|
},
|
|
6448
|
+
async addEnterpriseConnectionDomain(organizationId, connectionId, input) {
|
|
6449
|
+
return enterpriseRequest("POST", `${normalizeIdInput(organizationId)}/connection-setup/${normalizeIdInput(connectionId)}/domains`, {
|
|
6450
|
+
expectedRevision: normalizeRevision(input?.expectedRevision),
|
|
6451
|
+
domain: enterpriseDomainInput(input?.domain)
|
|
6452
|
+
}, normalizeEnterpriseConnectionSetup);
|
|
6453
|
+
},
|
|
6454
|
+
async actOnEnterpriseConnectionDomain(organizationId, connectionId, domain, input) {
|
|
6455
|
+
if (![
|
|
6456
|
+
"challenge",
|
|
6457
|
+
"verify",
|
|
6458
|
+
"remove"
|
|
6459
|
+
].includes(input?.action)) throw new TypeError("Enterprise domain action is invalid");
|
|
6460
|
+
return enterpriseRequest("POST", `${normalizeIdInput(organizationId)}/connection-setup/${normalizeIdInput(connectionId)}/domains/${encodeURIComponent(enterpriseDomainInput(domain))}/actions`, {
|
|
6461
|
+
expectedRevision: normalizeRevision(input?.expectedRevision),
|
|
6462
|
+
expectedDomainRevision: normalizeRevision(input?.expectedDomainRevision),
|
|
6463
|
+
action: input.action
|
|
6464
|
+
}, normalizeEnterpriseConnectionSetup);
|
|
6465
|
+
},
|
|
6356
6466
|
async getScimCredential(organizationId, connectionId) {
|
|
6357
6467
|
return enterpriseRequest("GET", scimCredentialPath(organizationId, connectionId), void 0, (value) => normalizeScimCredentialState(value));
|
|
6358
6468
|
},
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as OrganizationTeam, B as OrganizationDeparture, Bt as RegisterOrganizationApplicationInput, C as CreatedOrganizationTeam, Dt as SocialIdTokenProvider, Et as SocialIdTokenInput, F as InvitationAcceptance, Ft as UpdateOrganizationDisplayInput, G as OrganizationMemberAuthority, Gt as AuthErrorStatus, H as OrganizationInvitation, Ht as OrganizationDirectoryEntry, I as InvitationDecline, It as UpdateOrganizationTeamDisplayInput, J as OrganizationMemberPageInput, K as OrganizationMemberAuthorityV2, Kt as UserApiCredential, O as DriveCredential, Q as OrganizationSignInStates, Rt as WorkspaceSelection, S as CreatedOrganizationMemberInvitation, T as DeletedOrganizationTeam, U as OrganizationInvitationPage, Ut as AuthError, V as OrganizationDisplay, Vt as RegisteredOrganizationApplication, W as OrganizationMember, Wt as AuthErrorCode, X as OrganizationPageInput, Y as OrganizationPage, Z as OrganizationSignInState, _t as RemovedOrganizationMember, b as CreateOrganizationMemberInvitationInput, d as AuthUser, et as OrganizationTeamDisplay, f as CanceledOrganizationInvitation, ht as ReceivedOrganizationInvitationPage, i as AuthOrganization, k as DriveCredentialInput, mt as ReceivedOrganizationInvitation, n as AddedOrganizationTeamMember, nt as OrganizationTeamPage, ot as PersonalWorkspaceSelection, q as OrganizationMemberPage, qt as UserApiCredentialInput, rt as OrganizationWorkspaceSelection, s as AuthSession, t as AcceptInvitationInput, tt as OrganizationTeamMemberPage, vt as RemovedOrganizationTeamMember, w as DeclineInvitationInput, x as CreatedOrganization, yt as ResentOrganizationInvitation, zt as OrganizationApplicationRegistration } from "./types-BU8vZrhF.js";
|
|
2
2
|
//#region src/organization-directory/service.d.ts
|
|
3
3
|
interface OrganizationDirectoryLookupInput {
|
|
4
4
|
organizationId: string;
|
|
@@ -203,6 +203,8 @@ interface OrganizationAdmissionInputs {
|
|
|
203
203
|
withdraw: WithdrawOrganizationAdmissionInput;
|
|
204
204
|
finalize: FinalizeOrganizationAdmissionInput;
|
|
205
205
|
}
|
|
206
|
+
/** Sorted-key JSON. Auth hashes the same form before it compares a signed `bodyDigest` claim. */
|
|
207
|
+
declare function canonical(value: unknown): string;
|
|
206
208
|
/** Hash the strict normalized operation input before signing its bodyDigest claim. No authority is created. */
|
|
207
209
|
declare function organizationAdmissionBodyDigest<Operation extends OrganizationAdmissionOperation>(operation: Operation, input: OrganizationAdmissionInputs[Operation]): Promise<string>;
|
|
208
210
|
/** Server-only actor and current-admission client. Each call needs a fresh exact-body service assertion. */
|
|
@@ -505,6 +507,165 @@ interface FinuevaUserDirectoryAuth {
|
|
|
505
507
|
/** Server-only service assertions. This client has no session authority and performs no automatic retry. */
|
|
506
508
|
declare function createUserDirectoryAuth(options: UserDirectoryAuthOptions): FinuevaUserDirectoryAuth;
|
|
507
509
|
//#endregion
|
|
510
|
+
//#region src/organization-role-events/index.d.ts
|
|
511
|
+
type Role = "owner" | "admin" | "member";
|
|
512
|
+
type OrganizationRoleEventReason = "manual_role_change" | "ownership_transferred_out" | "ownership_transferred_in";
|
|
513
|
+
interface OrganizationRoleEventRoles {
|
|
514
|
+
manualRole: Role;
|
|
515
|
+
effectiveRole: Role;
|
|
516
|
+
}
|
|
517
|
+
interface OrganizationRoleEventPriorRoles {
|
|
518
|
+
/** Null means that no manual contribution existed before the change. */
|
|
519
|
+
manualRole: Role | null;
|
|
520
|
+
effectiveRole: Role;
|
|
521
|
+
}
|
|
522
|
+
/** The application-scoped pseudonymous pair of the User Directory. It is not the canonical Auth User ID. */
|
|
523
|
+
interface OrganizationRoleEventUser {
|
|
524
|
+
userId: string;
|
|
525
|
+
userGeneration: string;
|
|
526
|
+
}
|
|
527
|
+
interface OrganizationRoleEvent {
|
|
528
|
+
/** Immutable. A consumer applies each event identifier once. */
|
|
529
|
+
eventId: string;
|
|
530
|
+
/** Decimal commit order within the feed. Gaps are normal. Compare as numbers. */
|
|
531
|
+
sequence: string;
|
|
532
|
+
occurredAt: number;
|
|
533
|
+
organization: {
|
|
534
|
+
id: string;
|
|
535
|
+
generation: string;
|
|
536
|
+
name: string;
|
|
537
|
+
};
|
|
538
|
+
reason: OrganizationRoleEventReason;
|
|
539
|
+
/** Equal on the two events of one ownership transfer. */
|
|
540
|
+
correlationId: string;
|
|
541
|
+
subject: OrganizationRoleEventUser;
|
|
542
|
+
/** Null when the actor can no longer be addressed. */
|
|
543
|
+
actor: OrganizationRoleEventUser | null;
|
|
544
|
+
before: OrganizationRoleEventRoles;
|
|
545
|
+
after: OrganizationRoleEventRoles;
|
|
546
|
+
}
|
|
547
|
+
interface OrganizationRoleEventV2 extends Omit<OrganizationRoleEvent, "before"> {
|
|
548
|
+
before: OrganizationRoleEventPriorRoles;
|
|
549
|
+
}
|
|
550
|
+
interface OrganizationRoleEventsInput {
|
|
551
|
+
applicationId: string;
|
|
552
|
+
/** The last checkpoint the consumer stored. Omit it to start at the retained beginning. */
|
|
553
|
+
after?: string;
|
|
554
|
+
limit?: number;
|
|
555
|
+
}
|
|
556
|
+
interface OrganizationRoleEventsPage {
|
|
557
|
+
version: 1;
|
|
558
|
+
applicationId: string;
|
|
559
|
+
events: OrganizationRoleEvent[];
|
|
560
|
+
/** The highest sequence Auth examined. Store it, even when `events` is empty. */
|
|
561
|
+
checkpoint: string;
|
|
562
|
+
/** Only `false` means the feed reached its head. */
|
|
563
|
+
hasMore: boolean;
|
|
564
|
+
}
|
|
565
|
+
interface OrganizationRoleEventsV2Page extends Omit<OrganizationRoleEventsPage, "version" | "events"> {
|
|
566
|
+
version: 2;
|
|
567
|
+
events: OrganizationRoleEventV2[];
|
|
568
|
+
}
|
|
569
|
+
interface OrganizationRoleEventsAuthOptions {
|
|
570
|
+
authOrigin: string;
|
|
571
|
+
fetch?: typeof globalThis.fetch;
|
|
572
|
+
timeoutMs?: number;
|
|
573
|
+
}
|
|
574
|
+
interface FinuevaOrganizationRoleEventsAuth {
|
|
575
|
+
listRoleEvents(input: OrganizationRoleEventsInput, assertion: string): Promise<OrganizationRoleEventsPage>;
|
|
576
|
+
}
|
|
577
|
+
interface FinuevaOrganizationRoleEventsV2Auth {
|
|
578
|
+
listRoleEvents(input: OrganizationRoleEventsInput, assertion: string): Promise<OrganizationRoleEventsV2Page>;
|
|
579
|
+
}
|
|
580
|
+
/** The stored checkpoint is older than the history Auth retains. Events between it and `earliest` are gone. */
|
|
581
|
+
declare class OrganizationRoleEventCheckpointExpiredError extends AuthError {
|
|
582
|
+
readonly earliest: string;
|
|
583
|
+
constructor(earliest: string);
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Server-only service assertions. The client has no session authority and performs no automatic retry.
|
|
587
|
+
* Each page is checked against the request: the application, an ordered and unique event list, and a checkpoint
|
|
588
|
+
* that never moves backwards.
|
|
589
|
+
*/
|
|
590
|
+
declare function createOrganizationRoleEventsAuth(options: OrganizationRoleEventsAuthOptions): FinuevaOrganizationRoleEventsAuth;
|
|
591
|
+
/** Explicit version 2. Never downgrades or retries a version 1 response. */
|
|
592
|
+
declare function createOrganizationRoleEventsV2Auth(options: OrganizationRoleEventsAuthOptions): FinuevaOrganizationRoleEventsV2Auth;
|
|
593
|
+
//#endregion
|
|
594
|
+
//#region src/organization-lifecycle/index.d.ts
|
|
595
|
+
/** The only reason Auth accepts. Auth records it; Auth does not verify billing state. */
|
|
596
|
+
type OrganizationServiceClosureReason = "plan_lapsed_retention_expired";
|
|
597
|
+
interface OrganizationServiceClosureInput {
|
|
598
|
+
applicationId: string;
|
|
599
|
+
organizationId: string;
|
|
600
|
+
/** The exact generation the application knows. A recreated organization has another generation. */
|
|
601
|
+
organizationGeneration: string;
|
|
602
|
+
reason: OrganizationServiceClosureReason;
|
|
603
|
+
/** One key for one intended closure. A retry with the same key and request replays the result. */
|
|
604
|
+
idempotencyKey: string;
|
|
605
|
+
}
|
|
606
|
+
type OrganizationServiceClosure = {
|
|
607
|
+
/** `started` for this key, also on replay. `already_closing` when another closure is live. */
|
|
608
|
+
outcome: "started" | "already_closing";
|
|
609
|
+
organizationId: string;
|
|
610
|
+
organizationGeneration: string;
|
|
611
|
+
state: "closing" | "cancelled";
|
|
612
|
+
startedAt: string;
|
|
613
|
+
cancelUntil: string;
|
|
614
|
+
/** The organization's owner can cancel the closure until `cancelUntil`. */
|
|
615
|
+
canCancel: boolean;
|
|
616
|
+
} |
|
|
617
|
+
/** Auth has no such organization generation registered for the application. */
|
|
618
|
+
{
|
|
619
|
+
outcome: "not_found";
|
|
620
|
+
} |
|
|
621
|
+
/** The organization cannot enter ordinary closure, for example because it has an enterprise connection. */
|
|
622
|
+
{
|
|
623
|
+
outcome: "not_eligible";
|
|
624
|
+
};
|
|
625
|
+
interface OrganizationAdminContactsInput {
|
|
626
|
+
applicationId: string;
|
|
627
|
+
organizationId: string;
|
|
628
|
+
organizationGeneration: string;
|
|
629
|
+
}
|
|
630
|
+
interface OrganizationAdminContact {
|
|
631
|
+
/** The canonical Auth User ID. */
|
|
632
|
+
userId: string;
|
|
633
|
+
role: "owner" | "admin";
|
|
634
|
+
/** A verified address. */
|
|
635
|
+
email: string;
|
|
636
|
+
name: string;
|
|
637
|
+
}
|
|
638
|
+
interface OrganizationAdminContacts {
|
|
639
|
+
applicationId: string;
|
|
640
|
+
organizationId: string;
|
|
641
|
+
organizationGeneration: string;
|
|
642
|
+
/** Owners first. At most 100. */
|
|
643
|
+
contacts: OrganizationAdminContact[];
|
|
644
|
+
/** False when the organization has more than 100 owners and administrators with a verified address. */
|
|
645
|
+
complete: boolean;
|
|
646
|
+
}
|
|
647
|
+
interface OrganizationLifecycleAuthOptions {
|
|
648
|
+
authOrigin: string;
|
|
649
|
+
fetch?: typeof globalThis.fetch;
|
|
650
|
+
timeoutMs?: number;
|
|
651
|
+
}
|
|
652
|
+
interface FinuevaOrganizationLifecycleAuth {
|
|
653
|
+
/** Needs `organizations:close-lapsed` and an assertion whose `bodyDigest` signs this exact input. */
|
|
654
|
+
closeOrganization(input: OrganizationServiceClosureInput, assertion: string): Promise<OrganizationServiceClosure>;
|
|
655
|
+
/** Needs `organizations:admin-contacts`. Null when the active generation is not registered for the application. */
|
|
656
|
+
listAdminContacts(input: OrganizationAdminContactsInput, assertion: string): Promise<OrganizationAdminContacts | null>;
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Hash the strict closure input before signing it as the assertion's `bodyDigest` claim, with `applicationId` as a
|
|
660
|
+
* claim too. Auth refuses an assertion whose digest does not match the request it receives. No authority is created.
|
|
661
|
+
*/
|
|
662
|
+
declare function organizationServiceClosureBodyDigest(input: OrganizationServiceClosureInput): Promise<string>;
|
|
663
|
+
/**
|
|
664
|
+
* Server-only service assertions for an application's organization lifecycle work. The client has no session
|
|
665
|
+
* authority and performs no automatic retry. Each answer is checked against its request.
|
|
666
|
+
*/
|
|
667
|
+
declare function createOrganizationLifecycleAuth(options: OrganizationLifecycleAuthOptions): FinuevaOrganizationLifecycleAuth;
|
|
668
|
+
//#endregion
|
|
508
669
|
//#region src/server.d.ts
|
|
509
670
|
interface ServerAuthOptions {
|
|
510
671
|
authOrigin: string;
|
|
@@ -529,6 +690,8 @@ interface FinuevaServerAuth {
|
|
|
529
690
|
getSession(): Promise<AuthSession | null>;
|
|
530
691
|
listOrganizations(input?: OrganizationPageInput): Promise<OrganizationPage>;
|
|
531
692
|
getOrganization(organizationId: string): Promise<AuthOrganization>;
|
|
693
|
+
getOrganizationSignInState(organizationId: string): Promise<OrganizationSignInState>;
|
|
694
|
+
getOrganizationSignInStates(organizationIds: string[]): Promise<OrganizationSignInStates>;
|
|
532
695
|
authorizeOrganizationPresence(organizationId: string, input: OrganizationPresenceInput, serviceAssertion: string, options?: {
|
|
533
696
|
applicationCredential: string;
|
|
534
697
|
}): Promise<OrganizationPresenceAuthorization>;
|
|
@@ -536,6 +699,7 @@ interface FinuevaServerAuth {
|
|
|
536
699
|
applicationCredential: string;
|
|
537
700
|
}): Promise<OrganizationMemberApplicationAccess>;
|
|
538
701
|
getOrganizationMemberAuthority(organizationId: string, memberId: string): Promise<OrganizationMemberAuthority>;
|
|
702
|
+
getOrganizationMemberAuthorityV2(organizationId: string, memberId: string): Promise<OrganizationMemberAuthorityV2>;
|
|
539
703
|
/** Browser cookie session and exact registered app Origin required. Native bearer setup is not supported. */
|
|
540
704
|
getOrganizationApplicationRegistration(organizationId: string, applicationId: string): Promise<OrganizationApplicationRegistration>;
|
|
541
705
|
registerOrganizationApplication(organizationId: string, applicationId: string, input: RegisterOrganizationApplicationInput): Promise<RegisteredOrganizationApplication>;
|
|
@@ -569,4 +733,4 @@ interface FinuevaServerAuth {
|
|
|
569
733
|
}
|
|
570
734
|
declare function createServerAuth(options: ServerAuthOptions): FinuevaServerAuth;
|
|
571
735
|
//#endregion
|
|
572
|
-
export { type AcceptInvitationInput, type AccountProductOperationAuthOptions, type AccountProductOperationConsumer, type AccountProductOperationInput, type AccountProductOperationPhase, type AccountProductOperationProof, type AccountProductOperationReceipt, type AccountProductOperationSnapshot, type AccountProductOperationSnapshotInput, type AddedOrganizationTeamMember, type AmendOrganizationAdmissionInput, type AttestOrganizationAdmissionInput, AuthError, type AuthErrorCode, type AuthErrorStatus, type AuthOrganization, type AuthSession, type AuthUser, type CanceledOrganizationInvitation, type CompleteGoogleAccountRecoveryInput, type CreateOrganizationMemberInvitationInput, type CreatedOrganization, type CreatedOrganizationMemberInvitation, type CreatedOrganizationTeam, type CurrentOrganizationAdmissionInput, type DeclineInvitationInput, type DeletedOrganizationTeam, type DriveCredential, type DriveCredentialInput, type DriveProvisioningAuthOptions, type DriveProvisioningCredential, type DriveRecipient, type DriveRecipientAuthOptions, type FinalizeOrganizationAdmissionInput, type FinalizedOrganizationAdmission, type FinuevaDriveProvisioningAuth, type FinuevaDriveRecipientAuth, type FinuevaIdentityResolverAuth, type FinuevaMembershipResolverAuth, type FinuevaOrganizationAdmissionAuth, type FinuevaOrganizationAdmissionBillingAuth, type FinuevaOrganizationAdmissionDirectoryAuth, type FinuevaOrganizationDirectoryAuth, FinuevaServerAuth, type FinuevaUserDirectoryAuth, type GoogleAccountRecovery, type GoogleAccountRecoveryInput, type IdentityResolverAuthOptions, type InvitationAcceptance, type InvitationDecline, type MembershipResolverAuthOptions, type OrganizationAdmission, type OrganizationAdmissionActorOperation, type OrganizationAdmissionActorProof, type OrganizationAdmissionAuthOptions, type OrganizationAdmissionBillingSetup, type OrganizationAdmissionCreator, type OrganizationAdmissionIdentity, type OrganizationAdmissionIdentityInput, type OrganizationAdmissionInputs, type OrganizationAdmissionOperation, type OrganizationAdmissionPage, type OrganizationAdmissionPageInput, type OrganizationAdmissionReceipt, type OrganizationAdmissionSelection, type OrganizationAdmissionSetup, type OrganizationAdmissionSetupInput, type OrganizationApplicationRegistration, type OrganizationDeparture, type OrganizationDirectoryAuthOptions, type OrganizationDirectoryEntry, type OrganizationDirectoryLookupInput, type OrganizationDirectoryPage, type OrganizationDirectorySearchInput, type OrganizationDisplay, type OrganizationInvitation, type OrganizationInvitationPage, type OrganizationMember, type OrganizationMemberApplicationAccess, type OrganizationMemberApplicationAccessInput, type OrganizationMemberAuthority, type OrganizationMemberPage, type OrganizationMemberPageInput, type OrganizationPage, type OrganizationPageInput, type OrganizationPresenceAuthorization, type OrganizationPresenceInput, type OrganizationTeam, type OrganizationTeamDisplay, type OrganizationTeamMemberPage, type OrganizationTeamPage, type OrganizationWorkspaceSelection, type PersonalWorkspaceSelection, type ReceivedOrganizationInvitation, type ReceivedOrganizationInvitationPage, type RegisterOrganizationApplicationInput, type RegisteredOrganizationApplication, type RemovedOrganizationMember, type RemovedOrganizationTeamMember, type ResentOrganizationInvitation, type ReserveOrganizationAdmissionInput, type ResolveDriveRecipientInput, type ResolveIdentityInput, type ResolveMembershipBatchInput, type ResolveMembershipInput, type ResolvedIdentity, type ResolvedMembership, type ResolvedMembershipBatch, type ResolvedMembershipRole, ServerAuthOptions, ServerInvitationAcceptance, ServerSignOutResult, ServerSocialIdTokenSession, type SocialIdTokenInput, type SocialIdTokenProvider, type UpdateOrganizationDisplayInput, type UpdateOrganizationTeamDisplayInput, type UserApiCredential, type UserApiCredentialInput, type UserApiIdentity, type UserApiVerifierOptions, type UserDirectoryAuthOptions, type UserDirectoryBinding, type UserDirectoryEntry, type UserDirectoryListInput, type UserDirectoryLookupInput, type UserDirectoryMember, type UserDirectoryMembersInput, type UserDirectoryMembersPage, type UserDirectoryPage, type UserDirectoryResolveInput, type WithdrawOrganizationAdmissionInput, type WorkspaceSelection, createAccountProductOperationAuth, createDriveProvisioningAuth, createDriveRecipientAuth, createIdentityResolverAuth, createMembershipResolverAuth, createOrganizationAdmissionAuth, createOrganizationAdmissionBillingAuth, createOrganizationAdmissionDirectoryAuth, createOrganizationDirectoryAuth, createServerAuth, createUserApiVerifier, createUserDirectoryAuth, organizationAdmissionBodyDigest };
|
|
736
|
+
export { type AcceptInvitationInput, type AccountProductOperationAuthOptions, type AccountProductOperationConsumer, type AccountProductOperationInput, type AccountProductOperationPhase, type AccountProductOperationProof, type AccountProductOperationReceipt, type AccountProductOperationSnapshot, type AccountProductOperationSnapshotInput, type AddedOrganizationTeamMember, type AmendOrganizationAdmissionInput, type AttestOrganizationAdmissionInput, AuthError, type AuthErrorCode, type AuthErrorStatus, type AuthOrganization, type AuthSession, type AuthUser, type CanceledOrganizationInvitation, type CompleteGoogleAccountRecoveryInput, type CreateOrganizationMemberInvitationInput, type CreatedOrganization, type CreatedOrganizationMemberInvitation, type CreatedOrganizationTeam, type CurrentOrganizationAdmissionInput, type DeclineInvitationInput, type DeletedOrganizationTeam, type DriveCredential, type DriveCredentialInput, type DriveProvisioningAuthOptions, type DriveProvisioningCredential, type DriveRecipient, type DriveRecipientAuthOptions, type FinalizeOrganizationAdmissionInput, type FinalizedOrganizationAdmission, type FinuevaDriveProvisioningAuth, type FinuevaDriveRecipientAuth, type FinuevaIdentityResolverAuth, type FinuevaMembershipResolverAuth, type FinuevaOrganizationAdmissionAuth, type FinuevaOrganizationAdmissionBillingAuth, type FinuevaOrganizationAdmissionDirectoryAuth, type FinuevaOrganizationDirectoryAuth, type FinuevaOrganizationLifecycleAuth, type FinuevaOrganizationRoleEventsAuth, type FinuevaOrganizationRoleEventsV2Auth, FinuevaServerAuth, type FinuevaUserDirectoryAuth, type GoogleAccountRecovery, type GoogleAccountRecoveryInput, type IdentityResolverAuthOptions, type InvitationAcceptance, type InvitationDecline, type MembershipResolverAuthOptions, type OrganizationAdminContact, type OrganizationAdminContacts, type OrganizationAdminContactsInput, type OrganizationAdmission, type OrganizationAdmissionActorOperation, type OrganizationAdmissionActorProof, type OrganizationAdmissionAuthOptions, type OrganizationAdmissionBillingSetup, type OrganizationAdmissionCreator, type OrganizationAdmissionIdentity, type OrganizationAdmissionIdentityInput, type OrganizationAdmissionInputs, type OrganizationAdmissionOperation, type OrganizationAdmissionPage, type OrganizationAdmissionPageInput, type OrganizationAdmissionReceipt, type OrganizationAdmissionSelection, type OrganizationAdmissionSetup, type OrganizationAdmissionSetupInput, type OrganizationApplicationRegistration, type OrganizationDeparture, type OrganizationDirectoryAuthOptions, type OrganizationDirectoryEntry, type OrganizationDirectoryLookupInput, type OrganizationDirectoryPage, type OrganizationDirectorySearchInput, type OrganizationDisplay, type OrganizationInvitation, type OrganizationInvitationPage, type OrganizationLifecycleAuthOptions, type OrganizationMember, type OrganizationMemberApplicationAccess, type OrganizationMemberApplicationAccessInput, type OrganizationMemberAuthority, type OrganizationMemberAuthorityV2, type OrganizationMemberPage, type OrganizationMemberPageInput, type OrganizationPage, type OrganizationPageInput, type OrganizationPresenceAuthorization, type OrganizationPresenceInput, type OrganizationRoleEvent, OrganizationRoleEventCheckpointExpiredError, type OrganizationRoleEventPriorRoles, type OrganizationRoleEventReason, type OrganizationRoleEventRoles, type OrganizationRoleEventUser, type OrganizationRoleEventV2, type OrganizationRoleEventsAuthOptions, type OrganizationRoleEventsInput, type OrganizationRoleEventsPage, type OrganizationRoleEventsV2Page, type OrganizationServiceClosure, type OrganizationServiceClosureInput, type OrganizationServiceClosureReason, type OrganizationSignInState, type OrganizationSignInStates, type OrganizationTeam, type OrganizationTeamDisplay, type OrganizationTeamMemberPage, type OrganizationTeamPage, type OrganizationWorkspaceSelection, type PersonalWorkspaceSelection, type ReceivedOrganizationInvitation, type ReceivedOrganizationInvitationPage, type RegisterOrganizationApplicationInput, type RegisteredOrganizationApplication, type RemovedOrganizationMember, type RemovedOrganizationTeamMember, type ResentOrganizationInvitation, type ReserveOrganizationAdmissionInput, type ResolveDriveRecipientInput, type ResolveIdentityInput, type ResolveMembershipBatchInput, type ResolveMembershipInput, type ResolvedIdentity, type ResolvedMembership, type ResolvedMembershipBatch, type ResolvedMembershipRole, ServerAuthOptions, ServerInvitationAcceptance, ServerSignOutResult, ServerSocialIdTokenSession, type SocialIdTokenInput, type SocialIdTokenProvider, type UpdateOrganizationDisplayInput, type UpdateOrganizationTeamDisplayInput, type UserApiCredential, type UserApiCredentialInput, type UserApiIdentity, type UserApiVerifierOptions, type UserDirectoryAuthOptions, type UserDirectoryBinding, type UserDirectoryEntry, type UserDirectoryListInput, type UserDirectoryLookupInput, type UserDirectoryMember, type UserDirectoryMembersInput, type UserDirectoryMembersPage, type UserDirectoryPage, type UserDirectoryResolveInput, type WithdrawOrganizationAdmissionInput, type WorkspaceSelection, type canonical, createAccountProductOperationAuth, createDriveProvisioningAuth, createDriveRecipientAuth, createIdentityResolverAuth, createMembershipResolverAuth, createOrganizationAdmissionAuth, createOrganizationAdmissionBillingAuth, createOrganizationAdmissionDirectoryAuth, createOrganizationDirectoryAuth, createOrganizationLifecycleAuth, createOrganizationRoleEventsAuth, createOrganizationRoleEventsV2Auth, createServerAuth, createUserApiVerifier, createUserDirectoryAuth, organizationAdmissionBodyDigest, organizationServiceClosureBodyDigest };
|