1 |
|
2 | import { NextFunction, Request, Response } from "express";
|
3 | export interface IMarvelErrorMessage {
|
4 | UNAUTHORIZED_ACCESS: string;
|
5 | }
|
6 | export interface IMarvelErrorCode {
|
7 | AUTH_FAIL: number;
|
8 | }
|
9 | export interface IMarvelOption {
|
10 | query?: any;
|
11 | body?: any;
|
12 | headers?: {
|
13 | [key: string]: string;
|
14 | };
|
15 | method?: string;
|
16 | }
|
17 | export interface IMarvelClientOption {
|
18 | marvelApi: string;
|
19 | projectName: string;
|
20 | secret: string;
|
21 | }
|
22 | export interface IMarvelRequest extends Request {
|
23 | marvel: (url: string, params?: IMarvelOption, projectSuffix?: string) => Promise<any>;
|
24 | }
|
25 | export declare const checkAuth: (errorMessage: IMarvelErrorMessage, errorCode: IMarvelErrorCode, secret: string) => (req: Request, res: Response, next: NextFunction) => void;
|
26 | export declare let marvel: (url: string, params?: IMarvelOption) => Promise<never>;
|
27 | export declare const marvelMiddleWare: (options: IMarvelClientOption) => (req: IMarvelRequest, res: Response, next: NextFunction) => void;
|