UNPKG

jsm-core

Version:
38 lines (37 loc) 1.48 kB
import { CacheManager } from '../../cache-manager.class'; type TEntity = Jsm.Core.Auth.Entity.Role; type TListRequest = Jsm.Core.Auth.Api.Roles.List.Request; type TSDKClient = Jsm.Core.CacheManager.TSDKClient<TEntity>; /** * @description Cache manager for Roles */ export default class RolesCacheManager implements Jsm.Core.CacheManager.EntityCacheManager<TEntity, TListRequest, TSDKClient> { private static instance; private readonly logger; private readonly sdkClient; private readonly cache; private readonly EXPIRATION; private readonly ENTITY; private constructor(); static getInstance(cache: CacheManager, sdkClient?: TSDKClient): RolesCacheManager; get(id: string, config?: { expiration?: number; forceLoadFromDb?: boolean; company?: string | null; }): Promise<Jsm.Core.Auth.Entity.Role | undefined>; getMany(ids: string[], config?: { expiration?: number; forceLoadFromDb?: boolean; company?: string | null; }): Promise<(Jsm.Core.Auth.Entity.Role | undefined)[]>; list(config?: { company?: string | null; query?: TListRequest; forceLoadFromDb?: boolean; filter?: (item: TEntity) => boolean; }): Promise<TEntity[]>; set(id: string, value: Partial<TEntity>, company?: string | null): Promise<void>; unset(id: string, company?: string | null): Promise<void>; unsetAll(company?: string | null): Promise<void>; } export {};