export interface EntraSyncStatusDto {
    resourceType: string;
    status: string;
    lastFullSyncAt: string | null;
    lastDeltaSyncAt: string | null;
    totalItemsSynced: number;
    pendingConflicts: number;
    lastError: string | null;
}
export interface EntraSyncResultDto {
    syncSessionId: string;
    resourceType: string;
    success: boolean;
    errorMessage: string | null;
    startedAt: string;
    completedAt: string;
    totalProcessed: number;
    created: number;
    updated: number;
    deleted: number;
    skipped: number;
    conflicts: number;
    pendingConflicts: EntraSyncConflictDto[];
}
export interface EntraSyncOptionsDto {
    useDeltaSync?: boolean;
    syncUsers?: boolean;
    syncGroups?: boolean;
    syncMemberships?: boolean;
    conflictPriority?: 'ManualReview' | 'EntraWins' | 'LocalWins';
    autoCreateReferences?: boolean;
}
export interface EntraSyncSessionDto {
    id: string;
    resourceType: string;
    isFullSync: boolean;
    status: string;
    startedAt: string;
    completedAt: string | null;
    errorMessage: string | null;
    totalProcessed: number;
    created: number;
    updated: number;
    deleted: number;
    skipped: number;
    conflicts: number;
    triggerType: string;
    triggeredByUserId: string | null;
    triggeredByUserName: string | null;
    duration: string | null;
}
export interface EntraSyncHistoryResponse {
    sessions: EntraSyncSessionDto[];
    totalCount: number;
    page: number;
    pageSize: number;
}
export interface ConflictDataDto {
    firstName: string | null;
    lastName: string | null;
    displayName: string | null;
    email: string | null;
    phoneNumber: string | null;
    mobilePhone: string | null;
    department: string | null;
    jobTitle: string | null;
}
export interface EntraSyncConflictDto {
    id: string;
    resourceType: string;
    entraObjectId: string;
    entraDisplayName: string;
    entraEmail: string | null;
    existingLocalEntityId: string | null;
    existingLocalDisplayName: string | null;
    conflictType: string;
    conflictDescription: string;
    resolution: string;
    createdAt: string;
    entraData: ConflictDataDto | null;
    localData: ConflictDataDto | null;
}
export interface ResolveConflictRequest {
    resolution: 'EntraPriority' | 'LocalPriority' | 'SkipImport' | 'MergeToExisting' | 'CreateNew';
    notes?: string;
}
export interface EntraGroupDto {
    id: string;
    entraObjectId: string;
    displayName: string;
    description: string | null;
    mail: string | null;
    isSecurityGroup: boolean;
    isActive: boolean;
    lastSyncedAt: string;
    memberCount: number;
    assignedRoles: EntraGroupRoleDto[];
    /** Roles inherited from parent groups in the hierarchy */
    inheritedRoles: InheritedRoleDto[];
    parentGroupId: string | null;
    parentGroupName: string | null;
    childGroupCount: number;
    childGroups: EntraGroupSummaryDto[];
}
export interface EntraGroupSummaryDto {
    id: string;
    entraObjectId: string;
    displayName: string;
    isSecurityGroup: boolean;
    memberCount: number;
    childGroupCount: number;
}
export interface EntraGroupRoleDto {
    roleId: string;
    roleName: string;
    assignedAt: string;
    assignedBy: string;
    /** If true, this role is inherited by child groups in the hierarchy */
    isInheritable: boolean;
}
/**
 * Represents a role inherited from a parent group in the hierarchy
 */
export interface InheritedRoleDto {
    roleId: string;
    roleName: string;
    assignedAt: string;
    assignedBy: string;
    /** The source group from which this role is inherited */
    sourceGroupId: string;
    sourceGroupName: string;
    /** How many levels up in the hierarchy (1 = direct parent) */
    inheritanceLevel: number;
}
export interface EntraGroupMemberDto {
    userId: string;
    fullName: string;
    email: string;
    entraObjectId: string | null;
    isActive: boolean;
    addedAt: string;
    /** True if the member is directly in this group, false if via a child group */
    isDirect: boolean;
    /** Source group ID if member comes from a child group (null if direct) */
    sourceGroupId: string | null;
    /** Source group name if member comes from a child group */
    sourceGroupName: string | null;
}
export interface AssignGroupToRoleRequest {
    roleId: string;
    /** If true, this role will be inherited by child groups. Default: true */
    isInheritable?: boolean;
}
export interface TestConnectionRequest {
    tenantId: string;
    clientId: string;
    clientSecret: string;
}
export interface TestConnectionResult {
    success: boolean;
    errorMessage: string | null;
    tenantName: string | null;
    userCount: number | null;
    groupCount: number | null;
}
export interface EntraConfigurationDto {
    tenantId: string | null;
    clientId: string | null;
    hasClientSecret: boolean;
    syncEnabled: boolean;
    syncIntervalMinutes: number;
    useDeltaSync: boolean;
    defaultConflictResolution: string;
    autoCreateReferences: boolean;
    isConfigured: boolean;
    syncOnlyActiveUsers: boolean;
    /** Comma-separated list of user types to sync: member, guest, shared, room, equipment */
    syncUserTypes: string;
}
export interface SaveEntraCredentialsRequest {
    tenantId: string;
    clientId: string;
    clientSecret: string;
}
export interface SaveEntraSyncSettingsRequest {
    syncEnabled: boolean;
    syncIntervalMinutes: number;
    useDeltaSync: boolean;
    defaultConflictResolution: string;
    autoCreateReferences: boolean;
    syncOnlyActiveUsers?: boolean;
    /** Comma-separated list of user types to sync: member, guest, shared, room, equipment */
    syncUserTypes?: string;
}
/**
 * Creates the Entra API service with an optional tenant context.
 * When tenantSlug is provided, all API calls will include the X-Tenant-Slug header.
 * This is needed for Super Admins viewing tenant-specific pages without "switching" to that tenant.
 */
declare const createEntraApi: (tenantSlug?: string) => {
    settings: {
        /**
         * Get current Entra configuration
         */
        getConfiguration: () => Promise<EntraConfigurationDto>;
        /**
         * Test connection to Microsoft Entra ID with provided credentials
         */
        testConnection: (request: TestConnectionRequest) => Promise<TestConnectionResult>;
        /**
         * Test connection using stored credentials from database
         */
        testStoredConnection: () => Promise<TestConnectionResult>;
        /**
         * Save Entra credentials (TenantId, ClientId, ClientSecret)
         */
        saveCredentials: (request: SaveEntraCredentialsRequest) => Promise<{
            message: string;
        }>;
        /**
         * Save Entra sync settings
         */
        saveSyncSettings: (request: SaveEntraSyncSettingsRequest) => Promise<{
            message: string;
        }>;
    };
    dashboard: {
        /**
         * Get sync status for all resource types (Users, Groups, Memberships)
         */
        getSyncStatus: () => Promise<EntraSyncStatusDto[]>;
    };
    sync: {
        /**
         * Trigger full synchronization of all resources
         */
        syncAll: (options?: EntraSyncOptionsDto) => Promise<EntraSyncResultDto>;
        /**
         * Trigger users synchronization only
         */
        syncUsers: (options?: EntraSyncOptionsDto) => Promise<EntraSyncResultDto>;
        /**
         * Trigger groups synchronization only
         */
        syncGroups: (options?: EntraSyncOptionsDto) => Promise<EntraSyncResultDto>;
        /**
         * Trigger memberships synchronization only
         */
        syncMemberships: () => Promise<EntraSyncResultDto>;
        /**
         * Force full sync (ignores delta tokens, re-syncs everything)
         */
        forceFullSync: () => Promise<{
            message: string;
        }>;
        /**
         * Get sync history with pagination
         */
        getHistory: (page?: number, pageSize?: number) => Promise<EntraSyncHistoryResponse>;
        /**
         * Cancel a running sync session
         */
        cancelSession: (sessionId: string) => Promise<{
            message: string;
        }>;
    };
    groups: {
        /**
         * Get all Entra groups
         */
        getAll: () => Promise<EntraGroupDto[]>;
        /**
         * Get a specific Entra group by ID
         */
        getById: (groupId: string) => Promise<EntraGroupDto>;
        /**
         * Assign a role to an Entra group
         */
        assignRole: (groupId: string, request: AssignGroupToRoleRequest) => Promise<{
            message: string;
        }>;
        /**
         * Remove a role from an Entra group
         */
        removeRole: (groupId: string, roleId: string) => Promise<{
            message: string;
        }>;
        /**
         * Get members of an Entra group
         */
        getMembers: (groupId: string) => Promise<EntraGroupMemberDto[]>;
    };
    users: {
        /**
         * Get Entra groups for a specific user
         */
        getGroups: (userId: string) => Promise<EntraGroupDto[]>;
    };
    conflicts: {
        /**
         * Get all pending sync conflicts
         */
        getAll: () => Promise<EntraSyncConflictDto[]>;
        /**
         * Resolve a specific conflict
         */
        resolve: (conflictId: string, data: ResolveConflictRequest) => Promise<{
            message: string;
        }>;
    };
};
export declare const entraApi: {
    settings: {
        /**
         * Get current Entra configuration
         */
        getConfiguration: () => Promise<EntraConfigurationDto>;
        /**
         * Test connection to Microsoft Entra ID with provided credentials
         */
        testConnection: (request: TestConnectionRequest) => Promise<TestConnectionResult>;
        /**
         * Test connection using stored credentials from database
         */
        testStoredConnection: () => Promise<TestConnectionResult>;
        /**
         * Save Entra credentials (TenantId, ClientId, ClientSecret)
         */
        saveCredentials: (request: SaveEntraCredentialsRequest) => Promise<{
            message: string;
        }>;
        /**
         * Save Entra sync settings
         */
        saveSyncSettings: (request: SaveEntraSyncSettingsRequest) => Promise<{
            message: string;
        }>;
    };
    dashboard: {
        /**
         * Get sync status for all resource types (Users, Groups, Memberships)
         */
        getSyncStatus: () => Promise<EntraSyncStatusDto[]>;
    };
    sync: {
        /**
         * Trigger full synchronization of all resources
         */
        syncAll: (options?: EntraSyncOptionsDto) => Promise<EntraSyncResultDto>;
        /**
         * Trigger users synchronization only
         */
        syncUsers: (options?: EntraSyncOptionsDto) => Promise<EntraSyncResultDto>;
        /**
         * Trigger groups synchronization only
         */
        syncGroups: (options?: EntraSyncOptionsDto) => Promise<EntraSyncResultDto>;
        /**
         * Trigger memberships synchronization only
         */
        syncMemberships: () => Promise<EntraSyncResultDto>;
        /**
         * Force full sync (ignores delta tokens, re-syncs everything)
         */
        forceFullSync: () => Promise<{
            message: string;
        }>;
        /**
         * Get sync history with pagination
         */
        getHistory: (page?: number, pageSize?: number) => Promise<EntraSyncHistoryResponse>;
        /**
         * Cancel a running sync session
         */
        cancelSession: (sessionId: string) => Promise<{
            message: string;
        }>;
    };
    groups: {
        /**
         * Get all Entra groups
         */
        getAll: () => Promise<EntraGroupDto[]>;
        /**
         * Get a specific Entra group by ID
         */
        getById: (groupId: string) => Promise<EntraGroupDto>;
        /**
         * Assign a role to an Entra group
         */
        assignRole: (groupId: string, request: AssignGroupToRoleRequest) => Promise<{
            message: string;
        }>;
        /**
         * Remove a role from an Entra group
         */
        removeRole: (groupId: string, roleId: string) => Promise<{
            message: string;
        }>;
        /**
         * Get members of an Entra group
         */
        getMembers: (groupId: string) => Promise<EntraGroupMemberDto[]>;
    };
    users: {
        /**
         * Get Entra groups for a specific user
         */
        getGroups: (userId: string) => Promise<EntraGroupDto[]>;
    };
    conflicts: {
        /**
         * Get all pending sync conflicts
         */
        getAll: () => Promise<EntraSyncConflictDto[]>;
        /**
         * Resolve a specific conflict
         */
        resolve: (conflictId: string, data: ResolveConflictRequest) => Promise<{
            message: string;
        }>;
    };
};
export { createEntraApi };
//# sourceMappingURL=entraApi.d.ts.map