-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathtypes.ts
98 lines (84 loc) · 2.01 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
export type Fetch = typeof fetch;
export type FetchRequestInfo = Parameters<Fetch>[0];
export type FetchRequestInit = Parameters<Fetch>[1];
export type FetchWithAdditionalParams = (
input: FetchRequestInfo,
init?: FetchRequestInit,
additionalParams?: {
allowPassingTokenToThirdPartyDomains?: boolean;
},
) => Promise<Response>;
export interface TokenCreateVariables {
email: string;
password: string;
}
interface GraphQLError {
message: string;
}
export interface TokenCreateResponse {
data: {
tokenCreate: {
token: string | undefined;
refreshToken: string | undefined;
errors: GraphQLError[];
};
};
}
export interface TokenRefreshVariables {
refreshToken: string;
}
export interface TokenRefreshResponse {
errors?: unknown[];
data: {
tokenRefresh: {
token: string | undefined;
errors?: GraphQLError[];
};
};
}
export interface PasswordResetVariables {
email: string;
password: string;
token: string;
}
export interface PasswordResetResponse {
data: {
setPassword: {
token: string | undefined;
refreshToken: string | undefined;
errors: GraphQLError[];
};
};
}
export interface ExternalAuthenticationURLResponse {
externalAuthenticationUrl: {
authenticationData: string;
errors: GraphQLError[];
};
}
export interface ExternalAuthenticationURLVariables {
pluginId: string;
input: string;
}
export interface ExternalObtainAccessToken {
token: string;
refreshToken: string;
csrfToken: string;
user: unknown;
}
export interface ExternalObtainAccessTokenResponse {
externalObtainAccessTokens: ExternalObtainAccessToken;
}
export interface ExternalObtainAccessTokenVariables {
pluginId: string;
input: string;
}
export enum ExternalProvider {
OpenIDConnect = "mirumee.authentication.openidconnect",
SaleorCloud = "cloud_auth.CloudAuthorizationPlugin",
}
export interface StorageRepository {
getItem(key: string): string | null;
removeItem(key: string): void;
setItem(key: string, value: string): void;
}