1 | import { OAuth2Options } from 'fetch-mw-oauth2';
|
2 |
|
3 | export type ContentType = {
|
4 | mime: string,
|
5 | representor: string,
|
6 | q?: string
|
7 | };
|
8 |
|
9 | type AuthOptionsBasic = {
|
10 | type: 'basic'
|
11 | password: string
|
12 | userName: string
|
13 | };
|
14 | type AuthOptionsBearer = {
|
15 | type: 'bearer'
|
16 | token: string
|
17 | };
|
18 | type AuthOptionsOAuth2 = {
|
19 | type: 'oauth2',
|
20 | } & OAuth2Options;
|
21 |
|
22 | export type AuthOptions =
|
23 | AuthOptionsBasic |
|
24 | AuthOptionsBearer |
|
25 | AuthOptionsOAuth2;
|
26 |
|
27 | export type KettingInit = {
|
28 |
|
29 | |
30 |
|
31 |
|
32 | auth?: AuthOptions
|
33 |
|
34 | |
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | fetchInit?: RequestInit,
|
41 |
|
42 | |
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | match?: {
|
49 | [domain: string]: {
|
50 | auth?: AuthOptions
|
51 | fetchInit?: RequestInit,
|
52 | }
|
53 | }
|
54 | };
|