import type { KeycloakAdminClient } from "../client.js"; import type GroupRepresentation from "../defs/groupRepresentation.js"; import type { ManagementPermissionReference } from "../defs/managementPermissionReference.js"; import type MappingsRepresentation from "../defs/mappingsRepresentation.js"; import type RoleRepresentation from "../defs/roleRepresentation.js"; import type { RoleMappingPayload } from "../defs/roleRepresentation.js"; import type UserRepresentation from "../defs/userRepresentation.js"; import Resource from "./resource.js"; interface Query { q?: string; search?: string; exact?: boolean; } interface PaginatedQuery { first?: number; max?: number; } interface SummarizedQuery { briefRepresentation?: boolean; populateHierarchy?: boolean; } export type GroupQuery = Query & PaginatedQuery & SummarizedQuery; export type SubGroupQuery = Query & PaginatedQuery & SummarizedQuery & { parentId: string; }; export interface GroupCountQuery { search?: string; top?: boolean; } export declare class Groups extends Resource<{ realm?: string; }> { find: (payload?: (Query & PaginatedQuery & SummarizedQuery & { realm?: string; }) | undefined, options?: Pick) => Promise; create: (payload?: (GroupRepresentation & { realm?: string; }) | undefined, options?: Pick) => Promise<{ id: string; }>; updateRoot: (payload?: (GroupRepresentation & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Single user */ findOne: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; update: (query: { id: string; } & { realm?: string; }, payload: GroupRepresentation) => Promise; del: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; count: (payload?: (GroupCountQuery & { realm?: string; }) | undefined, options?: Pick) => Promise<{ count: number; }>; /** * Creates a child group on the specified parent group. If the group already exists, then an error is returned. */ createChildGroup: (query: { id: string; } & { realm?: string; }, payload: Omit) => Promise<{ id: string; }>; /** * Updates a child group on the specified parent group. If the group doesn’t exist, then an error is returned. * Can be used to move a group from one parent to another. */ updateChildGroup: (query: { id: string; } & { realm?: string; }, payload: GroupRepresentation) => Promise; /** * Finds all subgroups on the specified parent group matching the provided parameters. */ listSubGroups: (payload?: (Query & PaginatedQuery & SummarizedQuery & { parentId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Members */ listMembers: (payload?: ({ id: string; first?: number; max?: number; briefRepresentation?: boolean; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Role mappings * https://www.keycloak.org/docs-api/11.0/rest-api/#_role_mapper_resource */ listRoleMappings: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; addRealmRoleMappings: (payload?: ({ id: string; roles: RoleMappingPayload[]; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listRealmRoleMappings: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; delRealmRoleMappings: (payload?: ({ id: string; roles: RoleMappingPayload[]; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listAvailableRealmRoleMappings: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listCompositeRealmRoleMappings: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Client role mappings * https://www.keycloak.org/docs-api/11.0/rest-api/#_client_role_mappings_resource */ listClientRoleMappings: (payload?: ({ id: string; clientUniqueId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; addClientRoleMappings: (payload?: ({ id: string; clientUniqueId: string; roles: RoleMappingPayload[]; } & { realm?: string; }) | undefined, options?: Pick) => Promise; delClientRoleMappings: (payload?: ({ id: string; clientUniqueId: string; roles: RoleMappingPayload[]; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listAvailableClientRoleMappings: (payload?: ({ id: string; clientUniqueId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listCompositeClientRoleMappings: (payload?: ({ id: string; clientUniqueId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Authorization permissions */ updatePermission: (query: { id: string; } & { realm?: string; }, payload: ManagementPermissionReference) => Promise; listPermissions: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; constructor(client: KeycloakAdminClient); } export {};