import { Logger } from 'pino'; import { IPermitConfig } from '../config'; export interface ISyncedRole { id: string; name: string; tenant_id?: string; metadata?: Record; permissions?: string[]; } export interface ISyncedUser { id: string; name?: string; email?: string; metadata?: Record; roles: ISyncedRole[]; } export interface IPermitCache { isUser(userId: string): Promise; getUser(userId: string): Promise; getUsers(): Promise; getUserTenants(userId: string): Promise; getAssignedRoles(userId: string): Promise; getRoles(): Promise; getRoleById(roleId: string): Promise; getRoleByName(roleName: string): Promise; refresh(): Promise; } /** * The LocalCacheClient is able to fetch the latest cached (i.e: synced) * state from the policy agent (i.e: OPA). This client is very performant * and DOES NOT go outside the local network (i.e: VPC), in other words, * queries made by this client are complete private, and do not reach * the permit.io control plane in the cloud. */ export declare class LocalCacheClient implements IPermitCache { private config; private logger; private client; constructor(config: IPermitConfig, logger: Logger); isUser(userId: string): Promise; getUser(userId: string): Promise; getUsers(): Promise; getUserTenants(userId: string): Promise; getAssignedRoles(userId: string): Promise; getRoles(): Promise; getRoleById(roleId: string): Promise; getRoleByName(roleName: string): Promise; private updatePolicy; private updatePolicyData; refresh(): Promise; getMethods(): IPermitCache; }