import type { ApiContext } from './_shared';
export type RoleCategory = 'Global' | 'Admin' | 'Manager' | 'Contributor' | 'Viewer' | 'Custom';
export interface RoleDto {
    id: string;
    name: string;
    shortName: string;
    category: RoleCategory;
    description: string | null;
}
export interface RoleListDto {
    id: string;
    name: string;
    shortName: string;
    code: string | null;
    category: RoleCategory;
    description: string | null;
    isSystem: boolean;
    usersCount: number;
    permissionsCount: number;
    createdAt: string;
    applicationId: string | null;
    applicationName: string | null;
    contextId: string | null;
    contextName: string | null;
}
export interface RoleDetailDto {
    id: string;
    name: string;
    shortName: string;
    code: string | null;
    category: RoleCategory;
    description: string | null;
    isSystem: boolean;
    parentRoleId: string | null;
    users: RoleUserDto[];
    permissions: RolePermissionDto[];
    groups: RoleGroupDto[];
    createdAt: string;
    updatedAt: string | null;
}
export interface RoleUserDto {
    id: string;
    email: string;
    fullName: string;
}
export interface RolePermissionDto {
    id: string;
    path: string;
    description: string | null;
}
export interface RoleGroupDto {
    id: string;
    name: string;
    description: string | null;
    membersCount: number;
}
export interface CreateRoleRequest {
    name: string;
    shortName?: string;
    category?: RoleCategory;
    description?: string;
    parentRoleId?: string;
    permissionIds?: string[];
}
export interface UpdateRoleRequest {
    name: string;
    shortName?: string;
    category?: RoleCategory;
    description?: string;
    parentRoleId?: string;
    permissionIds?: string[];
}
export interface RoleTranslationDto {
    id: string;
    languageCode: string;
    name: string;
    shortName: string;
    description: string | null;
}
export interface UpdateRoleTranslationRequest {
    name: string;
    shortName: string;
    description?: string;
}
export interface PermissionListDto {
    id: string;
    path: string;
    level: string;
    action: string | null;
    isWildcard: boolean;
    description: string | null;
    rolesCount: number;
}
export interface PermissionDetailDto {
    id: string;
    path: string;
    level: string;
    action: string | null;
    isWildcard: boolean;
    description: string | null;
    contextId: string | null;
    applicationId: string | null;
    moduleId: string | null;
    sectionId: string | null;
    resourceId: string | null;
    roles: PermissionRoleDto[];
    users: PermissionUserDto[];
    entraGroups: PermissionEntraGroupDto[];
    createdAt: string;
}
export interface PermissionRoleDto {
    id: string;
    name: string;
    isSystem: boolean;
}
export interface PermissionUserDto {
    id: string;
    email: string;
    firstName: string;
    lastName: string;
    roleNames: string[];
}
export interface PermissionEntraGroupDto {
    id: string;
    displayName: string;
    isSecurityGroup: boolean;
    memberCount: number;
    roleNames: string[];
}
export interface PermissionTreeDto {
    applications: PermissionApplicationNode[];
}
export interface PermissionApplicationNode {
    id: string;
    code: string;
    label: string;
    permissionPath: string;
    modules: PermissionModuleNode[];
}
export interface PermissionModuleNode {
    id: string;
    code: string;
    label: string;
    permissionPath: string;
    sections: PermissionSectionNode[];
}
export interface PermissionSectionNode {
    id: string;
    code: string;
    label: string;
    permissionPath: string;
    resources: PermissionResourceNode[];
}
export interface PermissionResourceNode {
    id: string;
    code: string;
    label: string;
    permissionPath: string;
}
export interface MatrixRoleDto {
    id: string;
    name: string;
    shortName: string;
    category: RoleCategory;
    description: string | null;
    isSystem: boolean;
    permissionIds: string[];
}
export interface PermissionMatrixDto {
    roles: MatrixRoleDto[];
    permissions: PermissionListDto[];
    tree: PermissionTreeDto;
}
declare const _createRolesApi: (apiContext: ApiContext) => {
    getAll: (params?: {
        search?: string;
        excludeCategories?: string;
        minPermissionsCount?: number;
    }) => Promise<RoleListDto[]>;
    /** Get roles that can be assigned to groups/users (excludes Custom category and roles with 0 permissions) */
    getAssignable: () => Promise<RoleListDto[]>;
    /** Get roles assignable to external applications/services (only roles with data export permissions) */
    getServiceAssignable: () => Promise<RoleListDto[]>;
    /** Get roles scoped to a specific application (for access request approval) */
    getByApplication: (applicationId: string) => Promise<RoleListDto[]>;
    getById: (id: string) => Promise<RoleDetailDto>;
    create: (data: CreateRoleRequest) => Promise<RoleDetailDto>;
    update: (id: string, data: UpdateRoleRequest) => Promise<RoleDetailDto>;
    delete: (id: string) => Promise<unknown>;
    assignUser: (roleId: string, userId: string) => Promise<unknown>;
    removeUser: (roleId: string, userId: string) => Promise<unknown>;
    getGroups: (roleId: string) => Promise<RoleGroupDto[]>;
    assignGroup: (roleId: string, groupId: string) => Promise<unknown>;
    removeGroup: (roleId: string, groupId: string) => Promise<unknown>;
    getTranslations: (roleId: string) => Promise<RoleTranslationDto[]>;
    upsertTranslation: (roleId: string, languageCode: string, data: UpdateRoleTranslationRequest) => Promise<RoleTranslationDto>;
    deleteTranslation: (roleId: string, languageCode: string) => Promise<unknown>;
};
export type RolesApi = ReturnType<typeof _createRolesApi>;
export declare const createRolesApi: (apiContext: ApiContext) => RolesApi;
declare const _createPermissionsApi: (apiContext: ApiContext) => {
    getAll: (params?: {
        search?: string;
        level?: string;
    }) => Promise<PermissionListDto[]>;
    getById: (id: string) => Promise<PermissionDetailDto>;
    getTree: () => Promise<PermissionTreeDto>;
    getMatrix: () => Promise<PermissionMatrixDto>;
    delete: (id: string) => Promise<unknown>;
};
export type PermissionsApi = ReturnType<typeof _createPermissionsApi>;
export declare const createPermissionsApi: (apiContext: ApiContext) => PermissionsApi;
export {};
//# sourceMappingURL=roles.d.ts.map