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.

ResourceStores are also responsible for taking auxiliary resources into account should those be relevant to the store.

Hierarchy

Implemented by

Properties

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

Type declaration

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

Type declaration

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

Type declaration

hasResource: ((identifier: ResourceIdentifier) => Promise<boolean>)

Type declaration

    • (identifier: ResourceIdentifier): Promise<boolean>
    • Check if a resource exists in this ResourceSet.

      Returns

      A promise resolving if the resource already exists.

      Parameters

      Returns Promise<boolean>

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

Type declaration

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

Type declaration