mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: update N3 typings
This commit is contained in:
20
package-lock.json
generated
20
package-lock.json
generated
@@ -920,9 +920,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/n3": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/n3/-/n3-1.1.6.tgz",
|
||||
"integrity": "sha512-ZUZsoA13IkJOLZCXG9bgZGuzvGqhPQJ3CisPvZJ5Yfi+RxVtDCcezyTRw7olArfmxpD0UuEOtrIP/1PUCfkEBw==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/n3/-/n3-1.4.0.tgz",
|
||||
"integrity": "sha512-lVesnHn2/3wv6EqdR42JGel9pZ4PcRS31M0osht7cGEUVVzBVNBlyFq/8Z3e8EdAFGZrYVYyDnaBRX0bZsFUvA==",
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"@types/rdf-js": "*"
|
||||
@@ -4312,9 +4312,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"n3": {
|
||||
"version": "1.3.7",
|
||||
"resolved": "https://registry.npmjs.org/n3/-/n3-1.3.7.tgz",
|
||||
"integrity": "sha512-IREbOmZyTlc34vxlp31ECT5jliRNZqHg3THhzrVd5bcSWGto5xsN8fF5xWKYXZr8TdZX+GXFkCxttTKM1N3JZg=="
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/n3/-/n3-1.4.0.tgz",
|
||||
"integrity": "sha512-aEo8Jc+ZM9GoBtt7/OW+7aczMh4wLdt1IUcT8JCgv/b+ko5PCvkR0793rzWdu7+wJmA93sNb/3yM+01i9pz6fA==",
|
||||
"requires": {
|
||||
"queue-microtask": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"nanomatch": {
|
||||
"version": "1.2.13",
|
||||
@@ -4835,6 +4838,11 @@
|
||||
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
|
||||
"dev": true
|
||||
},
|
||||
"queue-microtask": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.1.3.tgz",
|
||||
"integrity": "sha512-zC1ZDLKFhZSa8vAdFbkOGouHcOUMgUAI/2/3on/KktpY+BaVqABkzDSsCSvJfmLbICOnrEuF9VIMezZf+T0mBA=="
|
||||
},
|
||||
"ramda": {
|
||||
"version": "0.27.0",
|
||||
"resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.0.tgz",
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@rdfjs/data-model": "^1.1.2",
|
||||
"@types/n3": "^1.1.6",
|
||||
"@types/n3": "^1.4.0",
|
||||
"@types/node": "^14.0.1",
|
||||
"@types/rdf-js": "^3.0.0",
|
||||
"n3": "^1.3.7"
|
||||
"n3": "^1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/arrayify-stream": "^1.0.0",
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { BodyParser } from './BodyParser';
|
||||
import { HttpRequest } from '../../server/HttpRequest';
|
||||
import { Quad } from 'rdf-js';
|
||||
import { QuadRepresentation } from '../representation/QuadRepresentation';
|
||||
import { RepresentationMetadata } from '../representation/RepresentationMetadata';
|
||||
import { StreamParser } from 'n3';
|
||||
import { TypedReadable } from '../../util/TypedReadable';
|
||||
import { UnsupportedMediaTypeHttpError } from '../../util/errors/UnsupportedMediaTypeHttpError';
|
||||
|
||||
export class SimpleBodyParser extends BodyParser {
|
||||
@@ -39,12 +37,9 @@ export class SimpleBodyParser extends BodyParser {
|
||||
contentType: mediaType,
|
||||
};
|
||||
|
||||
// StreamParser is a Readable but typings are incorrect at time of writing
|
||||
const quads: TypedReadable<Quad> = input.pipe(new StreamParser()) as unknown as TypedReadable<Quad>;
|
||||
|
||||
return {
|
||||
dataType: 'quad',
|
||||
data: quads,
|
||||
data: input.pipe(new StreamParser()),
|
||||
metadata,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import { BinaryRepresentation } from '../ldp/representation/BinaryRepresentation
|
||||
import { NotFoundHttpError } from '../util/errors/NotFoundHttpError';
|
||||
import { Quad } from 'rdf-js';
|
||||
import { QuadRepresentation } from '../ldp/representation/QuadRepresentation';
|
||||
import { Readable } from 'stream';
|
||||
import { Representation } from '../ldp/representation/Representation';
|
||||
import { RepresentationPreferences } from '../ldp/representation/RepresentationPreferences';
|
||||
import { ResourceIdentifier } from '../ldp/representation/ResourceIdentifier';
|
||||
@@ -74,7 +73,7 @@ export class SimpleResourceStore implements ResourceStore {
|
||||
private generateBinaryRepresentation(data: Quad[]): BinaryRepresentation {
|
||||
return {
|
||||
dataType: 'binary',
|
||||
data: streamifyArray(data).pipe(new StreamWriter({ format: 'text/turtle' })) as unknown as Readable,
|
||||
data: streamifyArray(data).pipe(new StreamWriter({ format: 'text/turtle' })),
|
||||
metadata: { raw: [], profiles: [], contentType: 'text/turtle' },
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user