1 | import { IClient, ITokenContext } from './definitions';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | export declare class Client implements IClient {
|
13 | |
14 |
|
15 |
|
16 | tokenContext: ITokenContext;
|
17 | |
18 |
|
19 |
|
20 | baseUrl: string;
|
21 | |
22 |
|
23 |
|
24 | private req;
|
25 | constructor(
|
26 | |
27 |
|
28 |
|
29 | tokenContext: ITokenContext,
|
30 | |
31 |
|
32 |
|
33 | baseUrl: string, req?: any);
|
34 | /**
|
35 | * GET request for retrieving a resource from the API.
|
36 | *
|
37 | * @param endpoint - The path of the API endpoint.
|
38 | */
|
39 | get(endpoint: string): any;
|
40 | /**
|
41 | * POST request for sending a new resource to the API.
|
42 | *
|
43 | * @param endpoint - The path of the API endpoint.
|
44 | */
|
45 | post(endpoint: string): any;
|
46 | /**
|
47 | * PUT request for replacing a resource in the API.
|
48 | *
|
49 | * @param endpoint - The path of the API endpoint.
|
50 | */
|
51 | put(endpoint: string): any;
|
52 | /**
|
53 | * PATCH request for performing partial updates to a resource in the API.
|
54 | *
|
55 | * @param endpoint - The path of the API endpoint.
|
56 | */
|
57 | patch(endpoint: string): any;
|
58 | /**
|
59 | * DELETE request for deleting a resource from the API.
|
60 | *
|
61 | * @param endpoint - The path of the API endpoint.
|
62 | */
|
63 | delete(endpoint: string): any;
|
64 | /**
|
65 | * @hidden
|
66 | */
|
67 | request(method: string, endpoint: string): any;
|
68 | /**
|
69 | * @private
|
70 | */
|
71 | private supplement(fn, endpoint);
|
72 | }
|