Options
All
  • Public
  • Public/Protected
  • All
Menu

A ResourceStore of which all operations are atomic.

Hierarchy

Index

Properties

addResource

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

Creates a new resource in the container.

param

Container in which to create a resource.

param

Representation of the new resource

param

Optional conditions under which to proceed.

returns

The identifier of the newly created resource.

Type declaration

deleteResource

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

Deletes a resource.

param

Identifier of resource to delete.

param

Optional conditions under which to proceed.

returns

Identifiers of resources that were possibly modified.

Type declaration

getRepresentation

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

Retrieves a representation of a resource.

param

Identifier of the resource to read.

param

Preferences indicating desired representations.

param

Optional conditions under which to proceed.

returns

A representation corresponding to the identifier.

Type declaration

modifyResource

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

Sets or updates the representation of a resource, creating a new resource and intermediary containers as needed.

param

Identifier of resource to update.

param

Description of which parts to update.

param

Optional conditions under which to proceed.

returns

Identifiers of resources that were possibly modified.

Type declaration

resourceExists

resourceExists: (identifier: ResourceIdentifier, conditions?: Conditions) => Promise<boolean>

Check if a resource exists.

param

Identifier of resource to check.

returns

A promise resolving if the resource already exists

Type declaration

setRepresentation

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

Sets or replaces the representation of a resource, creating a new resource and intermediary containers as needed.

param

Identifier of resource to update.

param

New representation of the resource.

param

Optional conditions under which to proceed.

returns

Identifiers of resources that were possibly modified.

Type declaration