@rapharacing/mw-utils
Version:
Middleware Utils
39 lines • 1.01 kB
TypeScript
export declare type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
export interface IRequestConfig {
url?: string;
method?: Method;
data?: any;
headers?: any;
token?: string;
}
export interface IErrorResponseConfig {
error?: Error;
customError?: string;
}
export interface IErrorResponse {
statusCode?: number;
errors?: string | Error | Error[];
}
export interface Error {
response?: any;
stack?: any;
code?: any;
}
export interface IFormattedError {
code: number;
key: string;
message: string;
}
export interface IFormattedErrors {
code: number;
err: any | string;
message: string;
}
export interface IFormattedErrorsResponse {
errors: IFormattedError[];
}
export interface ICognitoError {
error?: Error;
customMessage?: string;
}
//# sourceMappingURL=index.d.ts.map