import type { SecurityPermission } from "../../../types/security.js"; export declare namespace Identity { type Profile = IdentityProfile; } export interface IdentityContext { /** * Which tenant is the home tenant for this identity? * If omitted, it will default to `root`. */ defaultTenantId?: string; /** * Can this identity access the current tenant? * If omitted, it will default to `true`. */ canAccessTenant?: boolean; /** * Any other custom context data. */ [key: string]: any; } interface IdentityProfileContext { canAccessTenant?: boolean; defaultTenantId?: string; [key: string]: any; } export type IdentityData = { id: string; displayName: string; type: string; roles?: string[]; teams?: string[]; permissions?: SecurityPermission[]; profile?: IdentityProfileData; context?: IdentityProfileContext; }; /** * Abstract base class for all identity types. * Provides a common interface for identity checks across the codebase. */ export declare abstract class Identity { private readonly data; readonly profile: IdentityProfile; readonly context: IdentityContext; constructor(identityData: IdentityData); get id(): string; get displayName(): string; get type(): string; get permissions(): SecurityPermission[]; get roles(): string[]; get teams(): string[]; /** * Check if this identity represents an anonymous (unauthenticated) user. */ abstract isAnonymous(): boolean; isAdmin(): boolean; toJson(): Required>; } interface IdentityProfileData { firstName?: string; lastName?: string; email?: string; external?: boolean; } declare class IdentityProfile { private id; private data; constructor(id: string, data: Partial); get firstName(): string; get lastName(): string; get email(): string; get external(): boolean; toJson(): { firstName: string; lastName: string; email: string; external: boolean; }; } export {};