import type { KeycloakAdminClient } from "../client.js"; import type CredentialRepresentation from "../defs/credentialRepresentation.js"; import type FederatedIdentityRepresentation from "../defs/federatedIdentityRepresentation.js"; import type GroupRepresentation from "../defs/groupRepresentation.js"; import type MappingsRepresentation from "../defs/mappingsRepresentation.js"; import type { RequiredActionAlias } from "../defs/requiredActionProviderRepresentation.js"; import type RoleRepresentation from "../defs/roleRepresentation.js"; import type { RoleMappingPayload } from "../defs/roleRepresentation.js"; import type UserConsentRepresentation from "../defs/userConsentRepresentation.js"; import type { UserProfileConfig, UserProfileMetadata } from "../defs/userProfileMetadata.js"; import type UserRepresentation from "../defs/userRepresentation.js"; import type UserSessionRepresentation from "../defs/userSessionRepresentation.js"; import Resource from "./resource.js"; interface SearchQuery { search?: string; } interface PaginationQuery { first?: number; max?: number; } interface UserBaseQuery { email?: string; firstName?: string; lastName?: string; username?: string; q?: string; } export interface UserQuery extends PaginationQuery, SearchQuery, UserBaseQuery { exact?: boolean; [key: string]: string | number | undefined | boolean; } export declare class Users extends Resource<{ realm?: string; }> { find: (payload?: (UserQuery & { realm?: string; }) | undefined, options?: Pick) => Promise; create: (payload?: (UserRepresentation & { realm?: string; }) | undefined, options?: Pick) => Promise<{ id: string; }>; /** * Single user */ findOne: (payload?: ({ id: string; userProfileMetadata?: boolean; } & { realm?: string; }) | undefined, options?: Pick) => Promise; update: (query: { id: string; } & { realm?: string; }, payload: UserRepresentation) => Promise; del: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; count: (payload?: (UserBaseQuery & SearchQuery & { realm?: string; }) | undefined, options?: Pick) => Promise; getProfile: (payload?: { realm?: string; } | undefined, options?: Pick) => Promise; updateProfile: (payload?: (UserProfileConfig & { realm?: string; }) | undefined, options?: Pick) => Promise; getProfileMetadata: (payload?: { realm?: string; } | undefined, options?: Pick) => Promise; /** * role mappings */ 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; /** * Send a update account email to the user * an email contains a link the user can click to perform a set of required actions. */ executeActionsEmail: (payload?: ({ id: string; clientId?: string; lifespan?: number; redirectUri?: string; actions?: (RequiredActionAlias | string)[]; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Group */ listGroups: (payload?: ({ id: string; briefRepresentation?: boolean; } & PaginationQuery & SearchQuery & { realm?: string; }) | undefined, options?: Pick) => Promise; addToGroup: (payload?: ({ id: string; groupId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; delFromGroup: (payload?: ({ id: string; groupId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; countGroups: (payload?: ({ id: string; search?: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise<{ count: number; }>; /** * Federated Identity */ listFederatedIdentities: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; addToFederatedIdentity: (payload?: ({ id: string; federatedIdentityId: string; federatedIdentity: FederatedIdentityRepresentation; } & { realm?: string; }) | undefined, options?: Pick) => Promise; delFromFederatedIdentity: (payload?: ({ id: string; federatedIdentityId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * remove totp */ removeTotp: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * reset password */ resetPassword: (payload?: ({ id: string; credential: CredentialRepresentation; } & { realm?: string; }) | undefined, options?: Pick) => Promise; getUserStorageCredentialTypes: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * get user credentials */ getCredentials: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * delete user credentials */ deleteCredential: (payload?: ({ id: string; credentialId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * update a credential label for a user */ updateCredentialLabel: (query: { id: string; credentialId: string; } & { realm?: string; }, payload: string) => Promise; moveCredentialPositionDown: (payload?: ({ id: string; credentialId: string; newPreviousCredentialId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; moveCredentialPositionUp: (payload?: ({ id: string; credentialId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * send verify email */ sendVerifyEmail: (payload?: ({ id: string; clientId?: string; redirectUri?: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * list user sessions */ listSessions: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * list offline sessions associated with the user and client */ listOfflineSessions: (payload?: ({ id: string; clientId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * logout user from all sessions */ logout: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * list consents granted by the user */ listConsents: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; impersonation: (query: { id: string; } & { realm?: string; }, payload: { user: string; realm: string; }) => Promise>; /** * revoke consent and offline tokens for particular client from user */ revokeConsent: (payload?: ({ id: string; clientId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; getUnmanagedAttributes: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise>; constructor(client: KeycloakAdminClient); } export {};