feat: Add file based ResourceStore (#52)

* feat: Add file resource store

* test: Write some tests for FileResourceStore

* fix: Reformat code and fix various small things from reviews

* fix: Change constants to just be the corresponding URL

* fix: Remove extra unnecessary wrap in a Promise

* fix: Write some more tests and fix related bugs

* fix: Use old way to import fs promises to support older Node versions

* refactor: Refactor code and tests

* refactor: Refactor and better document code

* fix: Change comparison with undefined by typeof check

* fix: Invert typeof check
This commit is contained in:
smessie
2020-08-18 14:19:25 +02:00
committed by GitHub
parent e06d0bc8c5
commit 381dae42f6
13 changed files with 1199 additions and 7 deletions

View File

@@ -12,9 +12,9 @@ export interface RepresentationMetadata {
*/
raw: Quad[];
/**
* The metadata profiles.
* Optional metadata profiles.
*/
profiles: string[];
profiles?: string[];
/**
* Optional size of the representation.
*/
@@ -35,4 +35,13 @@ export interface RepresentationMetadata {
* Optional timestamp of the representation.
*/
dateTime?: Date;
/**
* Optional link relationships of the representation.
*/
linkRel?: { [id: string]: Set<string> };
/**
* Optional slug of the representation.
* Used to suggest the URI for the resource created.
*/
slug?: string;
}