import { JSONObject, Status, Timestamp, XID } from './index';
import { MFAMethod, PasskeyCredential } from './auth';
import { Session } from './session';
import { OrganizationSummary } from './organization';
export type UserType = 'internal' | 'external' | 'end_user';
export interface User {
    id: XID;
    externalId?: string;
    customerId?: string;
    userType: UserType;
    status: Status;
    active: boolean;
    blocked: boolean;
    firstName?: string;
    lastName?: string;
    fullName?: string;
    username?: string;
    nickname?: string;
    emailAddress?: string;
    emailVerified: boolean;
    phoneNumber?: string;
    phoneVerified: boolean;
    profileImageUrl?: string;
    bio?: string;
    website?: string;
    locale?: string;
    timezone?: string;
    hasPassword: boolean;
    passwordLastChanged?: Timestamp;
    mfaEnabled: boolean;
    mfaMethods?: MFAMethod[];
    passkeyCount: number;
    passkeys?: PasskeyCredential[];
    primaryOrganizationId?: XID;
    organizationId?: XID;
    organizations?: OrganizationSummary[];
    roles?: UserRoleAssignment[];
    permissions?: UserPermissionAssignment[];
    loginCount: number;
    lastLoginAt?: Timestamp;
    lastActiveAt?: Timestamp;
    createdAt: Timestamp;
    updatedAt: Timestamp;
    metadata?: JSONObject;
    customAttributes?: JSONObject;
    createdBy?: XID;
    authProvider: string;
    sessions?: Session[];
}
export interface UserSummary {
    id: XID;
    userType: UserType;
    firstName?: string;
    lastName?: string;
    fullName?: string;
    username?: string;
    emailAddress?: string;
    profileImageUrl?: string;
    status: Status;
    lastActiveAt?: Timestamp;
}
export interface UserProfileUpdateRequest {
    firstName?: string;
    lastName?: string;
    username?: string;
    nickname?: string;
    bio?: string;
    website?: string;
    locale?: string;
    timezone?: string;
    metadata?: JSONObject;
    customAttributes?: JSONObject;
}
export interface CreateUserRequest {
    userType: UserType;
    emailAddress?: string;
    phoneNumber?: string;
    username?: string;
    password?: string;
    firstName?: string;
    lastName?: string;
    organizationId?: XID;
    skipVerification?: boolean;
    metadata?: JSONObject;
    customAttributes?: JSONObject;
}
export interface UpdateUserRequest {
    firstName?: string;
    lastName?: string;
    username?: string;
    emailAddress?: string;
    phoneNumber?: string;
    status?: Status;
    active?: boolean;
    blocked?: boolean;
    metadata?: JSONObject;
    customAttributes?: JSONObject;
}
export interface UserRoleAssignment {
    id: XID;
    userId: XID;
    roleId: XID;
    roleName: string;
    roleType: 'system' | 'organization' | 'application';
    contextType: 'system' | 'organization' | 'application';
    contextId?: XID;
    assignedAt: Timestamp;
    assignedBy: XID;
    expiresAt?: Timestamp;
}
export interface UserPermissionAssignment {
    id: XID;
    userId: XID;
    permissionId: XID;
    permissionName: string;
    resourceType: string;
    resourceId?: XID;
    contextType: 'system' | 'organization' | 'application';
    contextId?: XID;
    assignedAt: Timestamp;
    assignedBy: XID;
    expiresAt?: Timestamp;
}
export interface UserActivity {
    id: XID;
    userId: XID;
    activityType: string;
    description: string;
    timestamp: Timestamp;
    ipAddress?: string;
    userAgent?: string;
    sessionId?: XID;
    organizationId?: XID;
    metadata?: JSONObject;
}
export interface UserPreferences {
    theme: 'light' | 'dark' | 'system';
    language: string;
    timezone: string;
    emailNotifications: boolean;
    smsNotifications: boolean;
    securityEmails: boolean;
    marketingEmails: boolean;
    twoFactorBackupShown: boolean;
    onboardingCompleted: boolean;
    customPreferences?: JSONObject;
}
export interface UserStats {
    totalUsers: number;
    activeUsers: number;
    newUsers: number;
    internalUsers: number;
    externalUsers: number;
    endUsers: number;
    verifiedUsers: number;
    mfaEnabledUsers: number;
    passkeyUsers: number;
    blockedUsers: number;
    organizationBreakdown?: Record<XID, number>;
    timeSeriesData?: Array<{
        date: string;
        total: number;
        active: number;
        new: number;
    }>;
}
export interface UserSearchParams {
    query?: string;
    userType?: UserType;
    status?: Status;
    organizationId?: XID;
    hasPassword?: boolean;
    mfaEnabled?: boolean;
    emailVerified?: boolean;
    phoneVerified?: boolean;
    createdBefore?: Timestamp;
    createdAfter?: Timestamp;
    lastActiveBefore?: Timestamp;
    lastActiveAfter?: Timestamp;
    sortBy?: 'createdAt' | 'lastActiveAt' | 'loginCount' | 'firstName' | 'lastName';
    sortOrder?: 'asc' | 'desc';
}
export interface BulkUserOperation {
    operation: 'update' | 'delete' | 'activate' | 'deactivate' | 'block' | 'unblock';
    userIds: XID[];
    data?: Partial<UpdateUserRequest>;
    reason?: string;
}
export interface BulkUserOperationResult {
    success: boolean;
    processedCount: number;
    failedCount: number;
    errors?: Array<{
        userId: XID;
        error: string;
    }>;
}
export interface PasswordChangeRequest {
    currentPassword: string;
    newPassword: string;
}
export interface SetPasswordRequest {
    password: string;
    signOutAllOtherSessions?: boolean;
}
export interface DeleteUserRequest {
    transferDataTo?: XID;
    reason?: string;
    hardDelete?: boolean;
}
export interface UserInvitation {
    id: XID;
    organizationId: XID;
    inviterUserId: XID;
    emailAddress: string;
    roleId?: XID;
    status: 'pending' | 'accepted' | 'expired' | 'revoked';
    token: string;
    expiresAt: Timestamp;
    createdAt: Timestamp;
    acceptedAt?: Timestamp;
    metadata?: JSONObject;
}
export interface ImpersonationSession {
    id: XID;
    impersonatorId: XID;
    targetUserId: XID;
    organizationId?: XID;
    reason: string;
    startedAt: Timestamp;
    expiresAt: Timestamp;
    endedAt?: Timestamp;
    ipAddress: string;
    userAgent: string;
}
//# sourceMappingURL=user.d.ts.map