1 | import HttpErrors from 'http-errors';
|
2 | export declare namespace RestHttpErrors {
|
3 | function invalidData<T, Props extends object = {}>(data: T, name: string, extraProperties?: Props): HttpErrors.HttpError & Props;
|
4 | function unsupportedMediaType(contentType: string, allowedTypes?: string[]): HttpErrors.HttpError<415> & {
|
5 | code: string;
|
6 | contentType: string;
|
7 | allowedMediaTypes: string[];
|
8 | };
|
9 | function missingRequired(name: string): HttpErrors.HttpError;
|
10 | function invalidParamLocation(location: string): HttpErrors.HttpError;
|
11 | const INVALID_REQUEST_BODY_MESSAGE = "The request body is invalid. See error object `details` property for more info.";
|
12 | function invalidRequestBody(details: ValidationErrorDetails[]): HttpErrors.HttpError & {
|
13 | details: ValidationErrorDetails[];
|
14 | };
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | interface ValidationErrorDetails {
|
22 | |
23 |
|
24 |
|
25 | path: string;
|
26 | |
27 |
|
28 |
|
29 | code: string;
|
30 | |
31 |
|
32 |
|
33 | message: string;
|
34 | |
35 |
|
36 |
|
37 | info: object;
|
38 | }
|
39 | }
|