Home Manual Reference Source
import CacheRepository from 'pvbid-sdk/src/repositories/CacheRepository.js'
public class | source

CacheRepository

Extends:

BaseRepository → CacheRepository

Constructor Summary

Public Constructor
public

constructor(endpoint: string, singleMap: string, multiMap: string)

Creates an instance of BaseRepository.

Member Summary

Public Members
public

params: {}

Method Summary

Public Methods
public

async create(entity: BidEntity): Promise<BidEntity>

Creates a single entity and invalidates the cached data

public

async delete(id: number): Promise<object>

Deletes resource and removes resource from cache.

public

async findById(id: int, forceReload: boolean): *

Retrieves a single domain object by its id.

public

async get(params: object, forceReload: boolean): *

Retrieves an array of results for the endpoint

public

async save(entity: BidEntity): Promise<BidEntity>

Saves resource and stores response to cache by resource id.

Inherited Summary

From class BaseRepository
public
public

http: *

public
public

map: {"single": *, "multi": *}

public
public

params: {}

public

async create(entity: BidEntity): Promise<BidEntity>

Persists a new entity

public

async delete(id: number | string): Promise<Object>

Deletes a single entity by its id

public

Retrieves a single domain object by its id.

public

async get(params: Object): Promise<BidEntity[]>

Retrieves an array of results for the endpoint

public

async save(entity: BidEntity): Promise<BidEntity>

Persists an update to the entity

Public Constructors

public constructor(endpoint: string, singleMap: string, multiMap: string) source

Creates an instance of BaseRepository.

Override:

BaseRepository#constructor

Params:

NameTypeAttributeDescription
endpoint string
singleMap string
multiMap string

Public Members

public params: {} source

Override:

BaseRepository#params

Public Methods

public async create(entity: BidEntity): Promise<BidEntity> source

Creates a single entity and invalidates the cached data

Override:

BaseRepository#create

Params:

NameTypeAttributeDescription
entity BidEntity

bid entity data object

Return:

Promise<BidEntity>

public async delete(id: number): Promise<object> source

Deletes resource and removes resource from cache.

Override:

BaseRepository#delete

Params:

NameTypeAttributeDescription
id number

The id of the resource to delete

Return:

Promise<object>

Returns the response data.

public async findById(id: int, forceReload: boolean): * source

Retrieves a single domain object by its id.

Override:

BaseRepository#findById

Params:

NameTypeAttributeDescription
id int

The id of the entity to retrieve.

forceReload boolean

Flags repository to force reload skipping cached data.

Return:

*

public async get(params: object, forceReload: boolean): * source

Retrieves an array of results for the endpoint

Override:

BaseRepository#get

Params:

NameTypeAttributeDescription
params object

A set of parameters to include for the endpoint.

forceReload boolean

Flags repository to force reload skipping cached data.

Return:

*

public async save(entity: BidEntity): Promise<BidEntity> source

Saves resource and stores response to cache by resource id.

Override:

BaseRepository#save

Params:

NameTypeAttributeDescription
entity BidEntity

bid entity data object

Return:

Promise<BidEntity>