UNPKG

jsm-core

Version:
38 lines (37 loc) 1.44 kB
import { CacheManager } from '../../cache-manager.class'; type TEntity = Jsm.Core.Users.Entity.User; type TListRequest = Jsm.Core.Users.Api.Users.List.Request; type TSDKClient = Jsm.Core.CacheManager.TSDKClient<TEntity>; /** * @description Cache manager for Users */ export default class UsersCacheManager 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): UsersCacheManager; get(id: string, config?: { expiration?: number; forceLoadFromDb?: boolean; company?: string | null; }): Promise<TEntity | undefined>; getMany(ids: string[], config?: { expiration?: number; forceLoadFromDb?: boolean; company?: string | null; }): Promise<(TEntity | 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 {};