1 | import { AxiosInstance } from "axios";
|
2 | import BunqJSClient from "./BunqJSClient";
|
3 | import Session from "./Session";
|
4 | import LoggerInterface from "./Interfaces/LoggerInterface";
|
5 | import ApiAdapterOptions from "./Types/ApiAdapterOptions";
|
6 | import { Method } from "./Types/Method";
|
7 | import Headers from "./Types/Headers";
|
8 | import RequestLimitFactory from "./RequestLimitFactory";
|
9 | import SignRequestHandler from "./HTTP/SignRequestHandler";
|
10 | import EncryptRequestHandler from "./HTTP/EncryptRequestHandler";
|
11 | import VerifyResponseHandler from "./HTTP/VerifyResponseHandler";
|
12 | export declare const BUNQ_SERVER_SIGNATURE_HEADER_KEY = "X-Bunq-Server-Signature";
|
13 | export declare const BUNQ_REQUEST_SIGNATURE_HEADER_KEY = "X-Bunq-Client-Signature";
|
14 | export declare const BUNQ_REQUEST_AUTHENTICATION_HEADER_KEY = "X-Bunq-Client-Authentication";
|
15 | export default class ApiAdapter {
|
16 | Session: Session;
|
17 | logger: LoggerInterface;
|
18 | BunqJSClient: BunqJSClient;
|
19 | RequestLimitFactory: RequestLimitFactory;
|
20 | SignRequestHandler: SignRequestHandler;
|
21 | EncryptRequestHandler: EncryptRequestHandler;
|
22 | VerifyResponseHandler: VerifyResponseHandler;
|
23 | language: string;
|
24 | region: string;
|
25 | geoLocation: string;
|
26 | constructor(Session: Session, loggerInterface: LoggerInterface, BunqJSClient: BunqJSClient);
|
27 | setup(): Promise<void>;
|
28 | /**
|
29 | * @param {string} url
|
30 | * @param headers
|
31 | * @param {ApiAdapterOptions} options
|
32 | * @param {AxiosInstance | false} axiosInstance
|
33 | * @returns {Promise<void>}
|
34 | */
|
35 | get(url: string, headers?: any, options?: ApiAdapterOptions, axiosInstance?: AxiosInstance | false): Promise<any>;
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | delete(url: string, headers?: any, options?: ApiAdapterOptions, axiosInstance?: AxiosInstance | false): Promise<any>;
|
44 | |
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | post(url: string, data?: any, headers?: any, options?: ApiAdapterOptions, axiosInstance?: AxiosInstance | false): Promise<any>;
|
53 | |
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | put(url: string, data?: any, headers?: any, options?: ApiAdapterOptions, axiosInstance?: AxiosInstance | false): Promise<any>;
|
62 | |
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 | request(url: string, method?: Method, data?: any, headers?: Headers, options?: ApiAdapterOptions, axiosInstance?: AxiosInstance | false): Promise<any>;
|
72 | |
73 |
|
74 |
|
75 |
|
76 | private sessionValidationCheck;
|
77 | |
78 |
|
79 |
|
80 |
|
81 | private requestErrorHandler;
|
82 | }
|