mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Update eslint related dependencies
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { HttpRequest } from '../../server/HttpRequest';
|
||||
import type { HttpRequest } from '../../server/HttpRequest';
|
||||
import type { AcceptHeader } from '../../util/AcceptParser';
|
||||
import {
|
||||
AcceptHeader,
|
||||
parseAccept,
|
||||
parseAcceptCharset,
|
||||
parseAcceptEncoding,
|
||||
parseAcceptLanguage,
|
||||
} from '../../util/AcceptParser';
|
||||
import { RepresentationPreference } from '../representation/RepresentationPreference';
|
||||
import { RepresentationPreferences } from '../representation/RepresentationPreferences';
|
||||
import type { RepresentationPreference } from '../representation/RepresentationPreference';
|
||||
import type { RepresentationPreferences } from '../representation/RepresentationPreferences';
|
||||
import { PreferenceParser } from './PreferenceParser';
|
||||
|
||||
/**
|
||||
@@ -26,7 +26,7 @@ export class AcceptPreferenceParser extends PreferenceParser {
|
||||
public async handle(input: HttpRequest): Promise<RepresentationPreferences> {
|
||||
const result: RepresentationPreferences = {};
|
||||
const headers:
|
||||
{ [T in keyof RepresentationPreferences]: { val?: string; func: (input: string) => AcceptHeader[] }} = {
|
||||
{ [T in keyof RepresentationPreferences]: { val?: string; func: (inp: string) => AcceptHeader[] }} = {
|
||||
type: { val: input.headers.accept, func: parseAccept },
|
||||
charset: { val: input.headers['accept-charset'] as string, func: parseAcceptCharset },
|
||||
encoding: { val: input.headers['accept-encoding'] as string, func: parseAcceptEncoding },
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { HttpRequest } from '../../server/HttpRequest';
|
||||
import { Operation } from '../operations/Operation';
|
||||
import { BodyParser } from './BodyParser';
|
||||
import { PreferenceParser } from './PreferenceParser';
|
||||
import type { HttpRequest } from '../../server/HttpRequest';
|
||||
import type { Operation } from '../operations/Operation';
|
||||
import type { BodyParser } from './BodyParser';
|
||||
import type { PreferenceParser } from './PreferenceParser';
|
||||
import { RequestParser } from './RequestParser';
|
||||
import { TargetExtractor } from './TargetExtractor';
|
||||
import type { TargetExtractor } from './TargetExtractor';
|
||||
|
||||
/**
|
||||
* Input parsers required for a {@link BasicRequestParser}.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { HttpResponse } from '../../server/HttpResponse';
|
||||
import type { HttpResponse } from '../../server/HttpResponse';
|
||||
import { HttpError } from '../../util/errors/HttpError';
|
||||
import { UnsupportedHttpError } from '../../util/errors/UnsupportedHttpError';
|
||||
import { ResponseDescription } from '../operations/ResponseDescription';
|
||||
import type { ResponseDescription } from '../operations/ResponseDescription';
|
||||
import { ResponseWriter } from './ResponseWriter';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { TLSSocket } from 'tls';
|
||||
import type { TLSSocket } from 'tls';
|
||||
import { format } from 'url';
|
||||
import { HttpRequest } from '../../server/HttpRequest';
|
||||
import { ResourceIdentifier } from '../representation/ResourceIdentifier';
|
||||
import type { HttpRequest } from '../../server/HttpRequest';
|
||||
import type { ResourceIdentifier } from '../representation/ResourceIdentifier';
|
||||
import { TargetExtractor } from './TargetExtractor';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HttpRequest } from '../../server/HttpRequest';
|
||||
import type { HttpRequest } from '../../server/HttpRequest';
|
||||
import { AsyncHandler } from '../../util/AsyncHandler';
|
||||
import { Representation } from '../representation/Representation';
|
||||
import type { Representation } from '../representation/Representation';
|
||||
|
||||
/**
|
||||
* Parses the body of an incoming {@link HttpRequest} and converts it to a {@link Representation}.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Representation } from '../representation/Representation';
|
||||
import type { Representation } from '../representation/Representation';
|
||||
|
||||
/**
|
||||
* Represents the changes needed for a PATCH request.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HttpRequest } from '../../server/HttpRequest';
|
||||
import type { HttpRequest } from '../../server/HttpRequest';
|
||||
import { AsyncHandler } from '../../util/AsyncHandler';
|
||||
import { RepresentationPreferences } from '../representation/RepresentationPreferences';
|
||||
import type { RepresentationPreferences } from '../representation/RepresentationPreferences';
|
||||
|
||||
/**
|
||||
* Creates {@link RepresentationPreferences} based on the incoming HTTP headers in a {@link HttpRequest}.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { HttpRequest } from '../../server/HttpRequest';
|
||||
import type { HttpRequest } from '../../server/HttpRequest';
|
||||
import { UnsupportedHttpError } from '../../util/errors/UnsupportedHttpError';
|
||||
import { CONTENT_TYPE, HTTP, RDF } from '../../util/UriConstants';
|
||||
import { Representation } from '../representation/Representation';
|
||||
import type { Representation } from '../representation/Representation';
|
||||
import { RepresentationMetadata } from '../representation/RepresentationMetadata';
|
||||
import { BodyParser } from './BodyParser';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HttpRequest } from '../../server/HttpRequest';
|
||||
import type { HttpRequest } from '../../server/HttpRequest';
|
||||
import { AsyncHandler } from '../../util/AsyncHandler';
|
||||
import { Operation } from '../operations/Operation';
|
||||
import type { Operation } from '../operations/Operation';
|
||||
|
||||
/**
|
||||
* Converts an incoming HttpRequest to an Operation.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HttpResponse } from '../../server/HttpResponse';
|
||||
import type { HttpResponse } from '../../server/HttpResponse';
|
||||
import { AsyncHandler } from '../../util/AsyncHandler';
|
||||
import { ResponseDescription } from '../operations/ResponseDescription';
|
||||
import type { ResponseDescription } from '../operations/ResponseDescription';
|
||||
|
||||
/**
|
||||
* Writes to the HttpResponse.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { PassThrough } from 'stream';
|
||||
import { translate } from 'sparqlalgebrajs';
|
||||
import { HttpRequest } from '../../server/HttpRequest';
|
||||
import type { HttpRequest } from '../../server/HttpRequest';
|
||||
import { UnsupportedHttpError } from '../../util/errors/UnsupportedHttpError';
|
||||
import { UnsupportedMediaTypeHttpError } from '../../util/errors/UnsupportedMediaTypeHttpError';
|
||||
import { CONTENT_TYPE } from '../../util/UriConstants';
|
||||
import { readableToString } from '../../util/Util';
|
||||
import { RepresentationMetadata } from '../representation/RepresentationMetadata';
|
||||
import { BodyParser } from './BodyParser';
|
||||
import { SparqlUpdatePatch } from './SparqlUpdatePatch';
|
||||
import type { SparqlUpdatePatch } from './SparqlUpdatePatch';
|
||||
|
||||
/**
|
||||
* {@link BodyParser} that supports `application/sparql-update` content.
|
||||
@@ -44,8 +44,11 @@ export class SparqlUpdateBodyParser extends BodyParser {
|
||||
data: dataCopy,
|
||||
metadata,
|
||||
};
|
||||
} catch (error) {
|
||||
throw new UnsupportedHttpError(error);
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof Error) {
|
||||
throw new UnsupportedHttpError(error.message);
|
||||
}
|
||||
throw new UnsupportedHttpError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Algebra } from 'sparqlalgebrajs';
|
||||
import { Patch } from './Patch';
|
||||
import type { Algebra } from 'sparqlalgebrajs';
|
||||
import type { Patch } from './Patch';
|
||||
|
||||
/**
|
||||
* A specific type of {@link Patch} corresponding to a SPARQL update.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HttpRequest } from '../../server/HttpRequest';
|
||||
import type { HttpRequest } from '../../server/HttpRequest';
|
||||
import { AsyncHandler } from '../../util/AsyncHandler';
|
||||
import { ResourceIdentifier } from '../representation/ResourceIdentifier';
|
||||
import type { ResourceIdentifier } from '../representation/ResourceIdentifier';
|
||||
|
||||
/**
|
||||
* Extracts a {@link ResourceIdentifier} from an incoming {@link HttpRequest}.
|
||||
|
||||
Reference in New Issue
Block a user