import type { KeycloakAdminClient } from "../client.js"; import type CertificateRepresentation from "../defs/certificateRepresentation.js"; import type ClientRepresentation from "../defs/clientRepresentation.js"; import type ClientScopeRepresentation from "../defs/clientScopeRepresentation.js"; import type CredentialRepresentation from "../defs/credentialRepresentation.js"; import type GlobalRequestResult from "../defs/globalRequestResult.js"; import type KeyStoreConfig from "../defs/keystoreConfig.js"; import type { ManagementPermissionReference } from "../defs/managementPermissionReference.js"; import type MappingsRepresentation from "../defs/mappingsRepresentation.js"; import type PolicyEvaluationResponse from "../defs/policyEvaluationResponse.js"; import type PolicyProviderRepresentation from "../defs/policyProviderRepresentation.js"; import type PolicyRepresentation from "../defs/policyRepresentation.js"; import type ProtocolMapperRepresentation from "../defs/protocolMapperRepresentation.js"; import type ResourceEvaluation from "../defs/resourceEvaluation.js"; import type ResourceRepresentation from "../defs/resourceRepresentation.js"; import type ResourceServerRepresentation from "../defs/resourceServerRepresentation.js"; import type RoleRepresentation from "../defs/roleRepresentation.js"; import type ScopeRepresentation from "../defs/scopeRepresentation.js"; import type UserRepresentation from "../defs/userRepresentation.js"; import type UserSessionRepresentation from "../defs/userSessionRepresentation.js"; import Resource from "./resource.js"; export interface PaginatedQuery { first?: number; max?: number; } export interface ClientQuery extends PaginatedQuery { clientId?: string; viewableOnly?: boolean; search?: boolean; q?: string; } export interface ResourceQuery extends PaginatedQuery { id?: string; name?: string; type?: string; owner?: string; uri?: string; deep?: boolean; } export interface PolicyQuery extends PaginatedQuery { id?: string; name?: string; type?: string; resource?: string; scope?: string; permission?: string; owner?: string; fields?: string; } export declare class Clients extends Resource<{ realm?: string; }> { find: (payload?: (ClientQuery & { realm?: string; }) | undefined, options?: Pick) => Promise; create: (payload?: (ClientRepresentation & { realm?: string; }) | undefined, options?: Pick) => Promise<{ id: string; }>; /** * Single client */ findOne: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; update: (query: { id: string; } & { realm?: string; }, payload: ClientRepresentation) => Promise; del: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Client roles */ createRole: (payload?: (RoleRepresentation & { realm?: string; }) | undefined, options?: Pick) => Promise<{ roleName: string; }>; listRoles: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; findRole: (payload?: ({ id: string; roleName: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; updateRole: (query: { id: string; roleName: string; } & { realm?: string; }, payload: RoleRepresentation) => Promise; delRole: (payload?: ({ id: string; roleName: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; findUsersWithRole: (payload?: ({ id: string; roleName: string; briefRepresentation?: boolean; first?: number; max?: number; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Service account user */ getServiceAccountUser: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Client secret */ generateNewClientSecret: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; invalidateSecret: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; generateRegistrationAccessToken: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise<{ registrationAccessToken: string; }>; getClientSecret: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Client Scopes */ listDefaultClientScopes: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; addDefaultClientScope: (payload?: ({ id: string; clientScopeId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; delDefaultClientScope: (payload?: ({ id: string; clientScopeId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listOptionalClientScopes: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; addOptionalClientScope: (payload?: ({ id: string; clientScopeId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; delOptionalClientScope: (payload?: ({ id: string; clientScopeId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Protocol Mappers */ addMultipleProtocolMappers: (query: { id: string; } & { realm?: string; }, payload: ProtocolMapperRepresentation[]) => Promise; addProtocolMapper: (query: { id: string; } & { realm?: string; }, payload: ProtocolMapperRepresentation) => Promise; listProtocolMappers: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; findProtocolMapperById: (payload?: ({ id: string; mapperId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; findProtocolMappersByProtocol: (payload?: ({ id: string; protocol: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; updateProtocolMapper: (query: { id: string; mapperId: string; } & { realm?: string; }, payload: ProtocolMapperRepresentation) => Promise; delProtocolMapper: (payload?: ({ id: string; mapperId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Scope Mappings */ listScopeMappings: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; addClientScopeMappings: (query: { id: string; client: string; } & { realm?: string; }, payload: RoleRepresentation[]) => Promise; listClientScopeMappings: (payload?: ({ id: string; client: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listAvailableClientScopeMappings: (payload?: ({ id: string; client: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listCompositeClientScopeMappings: (payload?: ({ id: string; client: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; delClientScopeMappings: (query: { id: string; client: string; } & { realm?: string; }, payload: RoleRepresentation[]) => Promise; evaluatePermission: (payload?: ({ id: string; roleContainer: string; type: "granted" | "not-granted"; scope: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; evaluateListProtocolMapper: (payload?: ({ id: string; scope: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; evaluateGenerateAccessToken: (payload?: ({ id: string; scope: string; userId: string; audience: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise>; evaluateGenerateUserInfo: (payload?: ({ id: string; scope: string; userId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise>; evaluateGenerateIdToken: (payload?: ({ id: string; scope: string; userId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise>; addRealmScopeMappings: (query: { id: string; } & { realm?: string; }, payload: RoleRepresentation[]) => Promise; listRealmScopeMappings: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listAvailableRealmScopeMappings: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listCompositeRealmScopeMappings: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; delRealmScopeMappings: (query: { id: string; } & { realm?: string; }, payload: RoleRepresentation[]) => Promise; /** * Sessions */ listSessions: (payload?: ({ id: string; first?: number; max?: number; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listOfflineSessions: (payload?: ({ id: string; first?: number; max?: number; } & { realm?: string; }) | undefined, options?: Pick) => Promise; getSessionCount: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise<{ count: number; }>; /** * Resource */ getResourceServer: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; updateResourceServer: (query: { id: string; } & { realm?: string; }, payload: ResourceServerRepresentation) => Promise; listResources: (payload?: (ResourceQuery & { realm?: string; }) | undefined, options?: Pick) => Promise; createResource: (query: { id: string; } & { realm?: string; }, payload: ResourceRepresentation) => Promise; getResource: (payload?: ({ id: string; resourceId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; updateResource: (query: { id: string; resourceId: string; } & { realm?: string; }, payload: ResourceRepresentation) => Promise; delResource: (payload?: ({ id: string; resourceId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; importResource: (query: { id: string; } & { realm?: string; }, payload: ResourceServerRepresentation) => Promise; exportResource: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; evaluateResource: (query: { id: string; } & { realm?: string; }, payload: ResourceEvaluation) => Promise; /** * Policy */ listPolicies: (payload?: (PolicyQuery & { realm?: string; }) | undefined, options?: Pick) => Promise<"" | PolicyRepresentation[]>; findPolicyByName: (payload?: ({ id: string; name: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; updatePolicy: (query: { id: string; type: string; policyId: string; } & { realm?: string; }, payload: PolicyRepresentation) => Promise; createPolicy: (query: { id: string; type: string; } & { realm?: string; }, payload: PolicyRepresentation) => Promise; findOnePolicy: (payload?: ({ id: string; type: string; policyId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listDependentPolicies: (payload?: ({ id: string; policyId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; delPolicy: (payload?: ({ id: string; policyId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listPolicyProviders: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; createOrUpdatePolicy(payload: { id: string; policyName: string; policy: PolicyRepresentation; }): Promise; /** * Scopes */ listAllScopes: (payload?: ({ id: string; name?: string; deep?: boolean; } & PaginatedQuery & { realm?: string; }) | undefined, options?: Pick) => Promise; listAllResourcesByScope: (payload?: ({ id: string; scopeId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listAllPermissionsByScope: (payload?: ({ id: string; scopeId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listPermissionsByResource: (payload?: ({ id: string; resourceId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; listScopesByResource: (payload?: ({ id: string; resourceName: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise<{ id: string; name: string; }[]>; listPermissionScope: (payload?: ({ id: string; policyId?: string; name?: string; resource?: string; } & PaginatedQuery & { realm?: string; }) | undefined, options?: Pick) => Promise; createAuthorizationScope: (query: { id: string; } & { realm?: string; }, payload: ScopeRepresentation) => Promise; updateAuthorizationScope: (query: { id: string; scopeId: string; } & { realm?: string; }, payload: ScopeRepresentation) => Promise; getAuthorizationScope: (payload?: ({ id: string; scopeId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; delAuthorizationScope: (payload?: ({ id: string; scopeId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; /** * Permissions */ findPermissions: (payload?: ({ id: string; name?: string; resource?: string; scope?: string; } & PaginatedQuery & { realm?: string; }) | undefined, options?: Pick) => Promise; createPermission: (query: { id: string; type: string; } & { realm?: string; }, payload: PolicyRepresentation) => Promise; updatePermission: (query: { id: string; type: string; permissionId: string; } & { realm?: string; }, payload: PolicyRepresentation) => Promise; delPermission: (payload?: ({ id: string; type: string; permissionId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; findOnePermission: (payload?: ({ id: string; type: string; permissionId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; getAssociatedScopes: (payload?: ({ id: string; permissionId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise<{ id: string; name: string; }[]>; getAssociatedResources: (payload?: ({ id: string; permissionId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise<{ _id: string; name: string; }[]>; getAssociatedPolicies: (payload?: ({ id: string; permissionId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; getOfflineSessionCount: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise<{ count: number; }>; getInstallationProviders: (payload?: ({ id: string; providerId: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; pushRevocation: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; addClusterNode: (payload?: ({ id: string; node: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; deleteClusterNode: (payload?: ({ id: string; node: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; testNodesAvailable: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; getKeyInfo: (payload?: ({ id: string; attr: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; generateKey: (payload?: ({ id: string; attr: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; downloadKey: (query: { id: string; attr: string; } & { realm?: string; }, payload: KeyStoreConfig) => Promise; generateAndDownloadKey: (query: { id: string; attr: string; } & { realm?: string; }, payload: KeyStoreConfig) => Promise; uploadKey: (query: { id: string; attr: string; } & { realm?: string; }, payload: FormData) => Promise; uploadCertificate: (query: { id: string; attr: string; } & { realm?: string; }, payload: FormData) => Promise; updateFineGrainPermission: (query: { id: string; } & { realm?: string; }, payload: ManagementPermissionReference) => Promise; listFineGrainPermissions: (payload?: ({ id: string; } & { realm?: string; }) | undefined, options?: Pick) => Promise; constructor(client: KeycloakAdminClient); /** * Find single protocol mapper by name. */ findProtocolMapperByName(payload: { realm?: string; id: string; name: string; }): Promise; }