Options
All
  • Public
  • Public/Protected
  • All
Menu

A ResourceStore represents a collection of resources. It has been designed such that each of its methods can be implemented in an atomic way: for each CRUD operation, only one dedicated method needs to be called. A fifth method enables the optimization of partial updates with PATCH. It is up to the implementer of the interface to (not) make an implementation atomic.

Hierarchy

Implemented by

Index

Properties

addResource

addResource: (container: ResourceIdentifier, representation: Representation, conditions?: Conditions) => Promise<ResourceIdentifier>

Create a resource.

param

Container in which to create a resource.

param

Representation of the new resource

param

Optional conditions.

returns

A promise containing the new identifier.

Type declaration

deleteResource

deleteResource: (identifier: ResourceIdentifier, conditions?: Conditions) => Promise<void>

Delete a resource.

param

Identifier of resource to delete.

param

Optional conditions.

returns

A promise resolving when the delete is finished.

Type declaration

getRepresentation

getRepresentation: (identifier: ResourceIdentifier, preferences: RepresentationPreferences, conditions?: Conditions) => Promise<Representation>

Read a resource.

param

Identifier of the resource to read.

param

Representation preferences.

param

Optional conditions.

returns

A promise containing the representation.

Type declaration

modifyResource

modifyResource: (identifier: ResourceIdentifier, patch: Patch, conditions?: Conditions) => Promise<void>

Partially update a resource.

param

Identifier of resource to update.

param

Description of which parts to update.

param

Optional conditions.

returns

A promise resolving when the update is finished.

Type declaration

setRepresentation

setRepresentation: (identifier: ResourceIdentifier, representation: Representation, conditions?: Conditions) => Promise<void>

Fully update a resource.

param

Identifier of resource to update.

param

New representation of the resource.

param

Optional conditions.

returns

A promise resolving when the update is finished.

Type declaration