API Reference
Rockets Core API
nestjs-cache
classes
CacheService

Class: CacheService

Implements

  • CacheServiceInterface

Constructors

new CacheService()

new CacheService(allCacheRepos, settings): CacheService

Parameters

ParameterType
allCacheReposRecord<string, Repository<CacheInterface>>
settingsCacheSettingsInterface

Returns

CacheService

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:28 (opens in a new tab)

Properties

PropertyModifierType
settingsreadonlyCacheSettingsInterface

Methods

clear()

clear(assignment, cache, queryOptions?): Promise<void>

Clear all caches for a given assignee.

Parameters

ParameterTypeDescription
assignmentstringThe assignment of the repository
cachePick<CacheInterface, "assignee">The cache to clear
queryOptions?QueryOptionsInterface-

Returns

Promise<void>

Implementation of

CacheServiceInterface.clear

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:196 (opens in a new tab)


create()

create(assignment, cache, queryOptions?): Promise<CacheInterface>

Create a cache with a for the given assignee.

Parameters

ParameterTypeDescription
assignmentstringThe cache assignment
cacheCacheCreateDtoThe data to create
queryOptions?QueryOptionsInterface-

Returns

Promise<CacheInterface>

Implementation of

CacheServiceInterface.create

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:41 (opens in a new tab)


delete()

delete(assignment, cache, queryOptions?): Promise<void>

Delete a cache based on params

Parameters

ParameterTypeDescription
assignmentstringThe cache assignment
cachePick<CacheInterface, "key" | "type" | "assignee">The cache to delete
queryOptions?QueryOptionsInterface-

Returns

Promise<void>

Implementation of

CacheServiceInterface.delete

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:126 (opens in a new tab)


deleteCache()

protected deleteCache(assignment, id, queryOptions?): Promise<void>

Internal

Delete CACHE based on assignment

Parameters

ParameterTypeDescription
assignmentstringThe assignment to delete id from
idstring | string[]The id or ids to delete
queryOptions?QueryOptionsInterface-

Returns

Promise<void>

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:224 (opens in a new tab)


findCache()

protected findCache(repoProxy, cache, queryOptions?): Promise<null | CacheInterface>

Parameters

ParameterType
repoProxyRepositoryProxy<CacheInterface>
cachePick<CacheInterface, "key" | "type" | "assignee">
queryOptions?QueryOptionsInterface

Returns

Promise<null | CacheInterface>

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:278 (opens in a new tab)


get()

get(assignment, cache, queryOptions?): Promise<null | CacheInterface>

Parameters

ParameterType
assignmentstring
cachePick<CacheInterface, "key" | "type" | "assignee">
queryOptions?QueryOptionsInterface

Returns

Promise<null | CacheInterface>

Implementation of

CacheServiceInterface.get

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:176 (opens in a new tab)


getAssignedCaches()

getAssignedCaches(assignment, cache, queryOptions?): Promise<CacheInterface[]>

Get all CACHEs for assignee.

Parameters

ParameterTypeDescription
assignmentstringThe assignment of the check
cachePick<CacheInterface, "assignee">The cache to get assignments
queryOptions?QueryOptionsInterface-

Returns

Promise<CacheInterface[]>

Implementation of

CacheServiceInterface.getAssignedCaches

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:145 (opens in a new tab)


getAssignmentRepo()

protected getAssignmentRepo(assignment): Repository<CacheInterface>

Internal

Get the assignment repo for the given assignment.

Parameters

ParameterTypeDescription
assignmentstringThe cache assignment

Returns

Repository<CacheInterface>

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:312 (opens in a new tab)


update()

update(assignment, cache, queryOptions?): Promise<CacheInterface>

Parameters

ParameterType
assignmentstring
cacheCacheUpdatableInterface
queryOptions?QueryOptionsInterface

Returns

Promise<CacheInterface>

Implementation of

CacheServiceInterface.update

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:78 (opens in a new tab)


updateOrCreate()

updateOrCreate(assignment, cache, queryOptions?): Promise<CacheInterface>

Parameters

ParameterType
assignmentstring
cacheCacheCreateDto
queryOptions?QueryOptionsInterface

Returns

Promise<CacheInterface>

Implementation of

CacheServiceInterface.updateOrCreate

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:242 (opens in a new tab)


validateDto()

protected validateDto<T>(type, data): Promise<T>

Type Parameters

Type Parameter
T extends DeepPartial<CacheInterface>

Parameters

ParameterType
typeType<T>
dataT

Returns

Promise<T>

Defined in

.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:256 (opens in a new tab)