@rdfx/graph-store 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ForwardingGraphStore.d.ts +20 -0
- package/dist/ForwardingGraphStore.js +34 -0
- package/dist/LoggingGraphStore.d.ts +2 -2
- package/dist/LoggingGraphStore.js +11 -11
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Stream } from "@rdfjs/types";
|
|
2
|
+
import type { Either, Maybe } from "purify-ts";
|
|
3
|
+
import type { GraphIdentifier } from "./GraphIdentifier.js";
|
|
4
|
+
import type { GraphStore } from "./GraphStore.js";
|
|
5
|
+
/**
|
|
6
|
+
* A GraphStore implementation that forwards to another GraphStore implementation.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ForwardingGraphStore<ClearOptionsT extends object, ClearReturnT extends object, DeleteOptionsT extends object, DeleteReturnT extends object, GetOptionsT extends object, HeadOptionsT extends object, PostOptionsT extends object, PostReturnT extends object, PutOptionsT extends object, PutReturnT extends object> implements GraphStore<ClearOptionsT, ClearReturnT, DeleteOptionsT, DeleteReturnT, GetOptionsT, HeadOptionsT, PostOptionsT, PostReturnT, PutOptionsT, PutReturnT> {
|
|
9
|
+
private readonly delegate;
|
|
10
|
+
constructor(delegate: GraphStore<ClearOptionsT, ClearReturnT, DeleteOptionsT, DeleteReturnT, GetOptionsT, HeadOptionsT, PostOptionsT, PostReturnT, PutOptionsT, PutReturnT>);
|
|
11
|
+
clear(options?: ClearOptionsT): Promise<Either<Error, ClearReturnT>>;
|
|
12
|
+
delete(identifier: GraphIdentifier, options?: DeleteOptionsT): Promise<Either<Error, DeleteReturnT>>;
|
|
13
|
+
get(identifier: GraphIdentifier, options?: GetOptionsT): Promise<Either<Error, Maybe<Stream>>>;
|
|
14
|
+
head(identifier: GraphIdentifier, options?: HeadOptionsT): Promise<Either<Error, boolean>>;
|
|
15
|
+
identifiers(): Promise<Either<Error, readonly GraphIdentifier[]>>;
|
|
16
|
+
isEmpty(): Promise<Either<Error, boolean>>;
|
|
17
|
+
post(quads: Stream, options?: PostOptionsT): Promise<Either<Error, PostReturnT>>;
|
|
18
|
+
put(quads: Stream, options?: PutOptionsT): Promise<Either<Error, PutReturnT>>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ForwardingGraphStore.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A GraphStore implementation that forwards to another GraphStore implementation.
|
|
3
|
+
*/
|
|
4
|
+
export class ForwardingGraphStore {
|
|
5
|
+
delegate;
|
|
6
|
+
constructor(delegate) {
|
|
7
|
+
this.delegate = delegate;
|
|
8
|
+
}
|
|
9
|
+
async clear(options) {
|
|
10
|
+
return this.delegate.clear(options);
|
|
11
|
+
}
|
|
12
|
+
async delete(identifier, options) {
|
|
13
|
+
return this.delegate.delete(identifier, options);
|
|
14
|
+
}
|
|
15
|
+
async get(identifier, options) {
|
|
16
|
+
return this.delegate.get(identifier, options);
|
|
17
|
+
}
|
|
18
|
+
async head(identifier, options) {
|
|
19
|
+
return this.delegate.head(identifier, options);
|
|
20
|
+
}
|
|
21
|
+
async identifiers() {
|
|
22
|
+
return this.delegate.identifiers();
|
|
23
|
+
}
|
|
24
|
+
async isEmpty() {
|
|
25
|
+
return this.delegate.isEmpty();
|
|
26
|
+
}
|
|
27
|
+
async post(quads, options) {
|
|
28
|
+
return this.delegate.post(quads, options);
|
|
29
|
+
}
|
|
30
|
+
async put(quads, options) {
|
|
31
|
+
return this.delegate.put(quads, options);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=ForwardingGraphStore.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Stream } from "@rdfjs/types";
|
|
2
2
|
import type { Either, Maybe } from "purify-ts";
|
|
3
3
|
import type { Logger } from "ts-log";
|
|
4
|
+
import { ForwardingGraphStore } from "./ForwardingGraphStore.js";
|
|
4
5
|
import type { GraphIdentifier } from "./GraphIdentifier.js";
|
|
5
6
|
import type { GraphStore } from "./GraphStore.js";
|
|
6
7
|
/**
|
|
7
8
|
* Wrap a GraphStore implementation and log its operations.
|
|
8
9
|
*/
|
|
9
|
-
export declare class LoggingGraphStore<ClearOptionsT extends object, ClearReturnT extends object, DeleteOptionsT extends object, DeleteReturnT extends object, GetOptionsT extends object, HeadOptionsT extends object, PostOptionsT extends object, PostReturnT extends object, PutOptionsT extends object, PutReturnT extends object>
|
|
10
|
-
private readonly delegate;
|
|
10
|
+
export declare class LoggingGraphStore<ClearOptionsT extends object, ClearReturnT extends object, DeleteOptionsT extends object, DeleteReturnT extends object, GetOptionsT extends object, HeadOptionsT extends object, PostOptionsT extends object, PostReturnT extends object, PutOptionsT extends object, PutReturnT extends object> extends ForwardingGraphStore<ClearOptionsT, ClearReturnT, DeleteOptionsT, DeleteReturnT, GetOptionsT, HeadOptionsT, PostOptionsT, PostReturnT, PutOptionsT, PutReturnT> {
|
|
11
11
|
private readonly logger;
|
|
12
12
|
constructor(delegate: GraphStore<ClearOptionsT, ClearReturnT, DeleteOptionsT, DeleteReturnT, GetOptionsT, HeadOptionsT, PostOptionsT, PostReturnT, PutOptionsT, PutReturnT>, logger: Logger);
|
|
13
13
|
clear(options?: ClearOptionsT): Promise<Either<Error, ClearReturnT>>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import { ForwardingGraphStore } from "./ForwardingGraphStore.js";
|
|
1
2
|
/**
|
|
2
3
|
* Wrap a GraphStore implementation and log its operations.
|
|
3
4
|
*/
|
|
4
|
-
export class LoggingGraphStore {
|
|
5
|
-
delegate;
|
|
5
|
+
export class LoggingGraphStore extends ForwardingGraphStore {
|
|
6
6
|
logger;
|
|
7
7
|
constructor(delegate, logger) {
|
|
8
|
-
|
|
8
|
+
super(delegate);
|
|
9
9
|
this.logger = logger;
|
|
10
10
|
}
|
|
11
11
|
async clear(options) {
|
|
12
12
|
this.logger.debug("clear(options=%s)", options);
|
|
13
|
-
return
|
|
13
|
+
return super.clear(options).then((either) => either
|
|
14
14
|
.ifLeft((error) => {
|
|
15
15
|
this.logger.error("clear(options=%s) -> ERROR: %s", options, error.message);
|
|
16
16
|
})
|
|
@@ -20,7 +20,7 @@ export class LoggingGraphStore {
|
|
|
20
20
|
}
|
|
21
21
|
async delete(identifier, options) {
|
|
22
22
|
this.logger.debug("delete(identifier=%s, options=%s)", identifier, options);
|
|
23
|
-
return
|
|
23
|
+
return super.delete(identifier, options).then((either) => either
|
|
24
24
|
.ifLeft((error) => {
|
|
25
25
|
this.logger.error("delete(identifier=%s, options=%s) -> ERROR: %s", identifier, options, error.message);
|
|
26
26
|
})
|
|
@@ -30,7 +30,7 @@ export class LoggingGraphStore {
|
|
|
30
30
|
}
|
|
31
31
|
async get(identifier, options) {
|
|
32
32
|
this.logger.debug("get(identifier=%s, options=%s)", identifier, options);
|
|
33
|
-
return
|
|
33
|
+
return super.get(identifier, options).then((either) => either
|
|
34
34
|
.ifLeft((error) => {
|
|
35
35
|
this.logger.error("get(identifier=%s, options=%s) -> ERROR: %s", identifier, options, error.message);
|
|
36
36
|
})
|
|
@@ -40,7 +40,7 @@ export class LoggingGraphStore {
|
|
|
40
40
|
}
|
|
41
41
|
async head(identifier, options) {
|
|
42
42
|
this.logger.debug("head(identifier=%s, options=%s)", identifier, options);
|
|
43
|
-
return
|
|
43
|
+
return super.head(identifier, options).then((either) => either
|
|
44
44
|
.ifLeft((error) => {
|
|
45
45
|
this.logger.error("head(identifier=%s, options=%s) -> ERROR: %s", identifier, options, error.message);
|
|
46
46
|
})
|
|
@@ -50,7 +50,7 @@ export class LoggingGraphStore {
|
|
|
50
50
|
}
|
|
51
51
|
async identifiers() {
|
|
52
52
|
this.logger.debug("identifiers()");
|
|
53
|
-
return
|
|
53
|
+
return super.identifiers().then((either) => either
|
|
54
54
|
.ifLeft((error) => {
|
|
55
55
|
this.logger.error("identifiers() -> ERROR: %s", error.message);
|
|
56
56
|
})
|
|
@@ -60,7 +60,7 @@ export class LoggingGraphStore {
|
|
|
60
60
|
}
|
|
61
61
|
async isEmpty() {
|
|
62
62
|
this.logger.debug("isEmpty()");
|
|
63
|
-
return
|
|
63
|
+
return super.isEmpty().then((either) => either
|
|
64
64
|
.ifLeft((error) => {
|
|
65
65
|
this.logger.error("isEmpty() -> ERROR: %s", error.message);
|
|
66
66
|
})
|
|
@@ -70,7 +70,7 @@ export class LoggingGraphStore {
|
|
|
70
70
|
}
|
|
71
71
|
async post(quads, options) {
|
|
72
72
|
this.logger.debug("post(quads, options=%s)", options);
|
|
73
|
-
return
|
|
73
|
+
return super.post(quads, options).then((either) => either
|
|
74
74
|
.ifLeft((error) => {
|
|
75
75
|
this.logger.error("post(quads, options=%s) -> ERROR: %s", options, error.message);
|
|
76
76
|
})
|
|
@@ -80,7 +80,7 @@ export class LoggingGraphStore {
|
|
|
80
80
|
}
|
|
81
81
|
async put(quads, options) {
|
|
82
82
|
this.logger.debug("put(quads, options=%s)", options);
|
|
83
|
-
return
|
|
83
|
+
return super.put(quads, options).then((either) => either
|
|
84
84
|
.ifLeft((error) => {
|
|
85
85
|
this.logger.error("put(quads, options=%s) -> ERROR: %s", options, error.message);
|
|
86
86
|
})
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"ts-log": "~3.0.2"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@rdfx/data-factory": "0.0.
|
|
10
|
+
"@rdfx/data-factory": "0.0.30",
|
|
11
11
|
"@rdfjs/dataset": "~2.0.2",
|
|
12
12
|
"get-stream": "~9.0.1",
|
|
13
13
|
"into-stream": "~9.1.0"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
},
|
|
36
36
|
"type": "module",
|
|
37
37
|
"types": "./dist/index.d.ts",
|
|
38
|
-
"version": "0.0.
|
|
38
|
+
"version": "0.0.30"
|
|
39
39
|
}
|