export type ServiceType = 'BACKEND' | 'INTEGRATION' | 'FRONTEND' | 'MOBILE' | 'IOT' | 'PUBLIC_DEVICE' | 'OTHER'; export declare enum InternalTokenScope { SINGLE_REALM = "SINGLE_REALM", MULTI_REALM = "MULTI_REALM", ALL_REALMS_NAMESPACE = "ALL_REALMS_NAMESPACE" } export interface IdentityApiClientOptions { baseUrl?: string | undefined; internalToken: string; serviceTokenProvider?: () => Promise; allowInternalTokenFallback?: boolean; timeoutMs?: number; } export interface RegisterServiceRequest { name: string; displayName: string; description?: string; serviceType?: ServiceType; regenerateSecret?: boolean; realm?: string; } export interface RegisterServiceResponse { id: string; clientSecret: string | null; tokenEndpoint: string; alreadyExisted: boolean; secretRegenerated: boolean; roles: string[]; keycloakBaseUrl: string; allowedRealms: string[]; primaryRealm: string | null; internalTokenScope: InternalTokenScope; } export interface ServiceCredentials { clientId: string; clientSecret: string | null; tokenEndpoint: string; roles: string[]; keycloakBaseUrl: string; allowedRealms: string[]; primaryRealm: string | null; internalTokenScope: InternalTokenScope; } export interface EnsureSystemOrgRequest { name: string; displayName: string; description?: string; metadata?: Record; } export interface Organization { id: string; name: string; displayName: string; description?: string; metadata?: Record; } export interface OrganizationRecord { id: string; name: string; displayName: string; domain: string | null; isActive: boolean; role: string | null; metadata: Record; createdAt: string | null; updatedAt: string | null; } export interface OrganizationListPagination { page: number; limit: number; total: number; totalPages: number; } export interface OrganizationListResponse { data: OrganizationRecord[]; pagination: OrganizationListPagination; } export interface OrganizationListParams { skip?: number; take?: number; } export interface CreateOrganizationRequest { name: string; displayName: string; domain?: string; metadata?: Record; realm?: string; } export interface UpdateOrganizationRequest { displayName?: string; domain?: string; isActive?: boolean; metadata?: Record; realm?: string; } export declare enum OrgRole { ORG_OWNER = "org_owner", ORG_ADMIN = "org_admin", ORG_MEMBER = "org_member" } export declare const ORG_ADMIN_ROLES: ReadonlySet; export interface VerifyMembershipParams { userId: string; orgId: string; realm?: string; } export interface VerifyMembershipResponse { isMember: boolean; role?: OrgRole; } export interface OnBehalfOfTokenRequest { userId: string; actorSubject: string; orgId: string; realm?: string; audience?: string; scopes?: string[]; } export interface OnBehalfOfTokenResponse { accessToken: string; expiresIn: number; tokenType: 'Bearer'; realm: string; subject: string; actorSubject: string; } export interface DelegatedPrincipalTokenRequest { principalId: string; tokenClass: string; onBehalfOfUserId: string; orgId: string; realm?: string; audience?: string; scopes?: string[]; } export interface DelegatedPrincipalTokenResponse extends OnBehalfOfTokenResponse { tokenClass: string; } export interface ScopedClaimGrantRequest { realm: string; callerPrincipal: string; claimName: string; claimValue: string; } export interface ScopedClaimGrantResponse extends ScopedClaimGrantRequest { id: string; revokedAt: string | null; } export interface ScopedClaimTokenRequest { realm: string; claimName: string; claimValue: string; } export interface ScopedClaimTokenResponse extends ScopedClaimTokenRequest { accessToken: string; expiresIn: number; tokenType: 'Bearer'; } export interface ApiEnvelope { data: T; }