@ctil/gql 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,300 @@
1
+ import { DocumentNode } from 'graphql';
2
+
3
+ interface RequestConfig {
4
+ endpoint?: string;
5
+ Authorization?: string;
6
+ headers?: Record<string, string>;
7
+ loginInfo?: UserToken | null | undefined;
8
+ }
9
+ /** 拦截器接口 */
10
+ interface RequestInterceptor {
11
+ /** 请求发出前拦截,可修改 query、variables、headers */
12
+ onRequest?: (params: {
13
+ query: string;
14
+ variables?: Record<string, any>;
15
+ headers: Record<string, string | undefined> & {
16
+ "X-Device-Id"?: string;
17
+ "X-Device-Name"?: string;
18
+ };
19
+ }) => Promise<typeof params> | typeof params;
20
+ /** 响应成功拦截,可修改返回结构 */
21
+ onResponse?: (response: any) => Promise<any> | any;
22
+ /** 错误拦截,可做统一错误处理或重试 */
23
+ onError?: (error: any) => Promise<any> | any;
24
+ }
25
+ interface requestResult<T = any> {
26
+ [key: string]: T;
27
+ }
28
+ interface UserToken {
29
+ /** 用户 ID */
30
+ userId: number;
31
+ /** 登录账号 */
32
+ loginAccount: string;
33
+ /** 访问 Token */
34
+ token: string;
35
+ /** 刷新 Token */
36
+ refreshToken: string;
37
+ /** 访问 Token 过期时间 */
38
+ expireAt: string;
39
+ /** 刷新 Token 过期时间 */
40
+ refreshExpireAt: string;
41
+ /** 设备 ID */
42
+ deviceId?: string;
43
+ /** 设备名称 */
44
+ deviceName?: string;
45
+ /** 登录时间 */
46
+ loginTime?: string;
47
+ /** 登录 IP */
48
+ requestIp?: string;
49
+ /** 客户端信息 */
50
+ userAgent?: string;
51
+ /** 上次刷新时间 */
52
+ lastRefreshTime?: string;
53
+ /** 用户角色编码列表 */
54
+ roles: string[];
55
+ /** 用户权限编码列表 */
56
+ permissions: string[];
57
+ }
58
+
59
+ declare class CCRequest {
60
+ private config;
61
+ private client;
62
+ private headers;
63
+ private deviceInfoPromise;
64
+ private interceptors;
65
+ constructor(config: RequestConfig);
66
+ /** 注册一个拦截器(支持多个) */
67
+ use(interceptor: RequestInterceptor): void;
68
+ /** 构建 GraphQLClient 实例 */
69
+ private buildClient;
70
+ /** 构建初始 headers */
71
+ private buildHeaders;
72
+ setToken(token: string): void;
73
+ removeToken(): void;
74
+ setLoginInfo(loginInfo: UserToken, remember?: boolean): void;
75
+ /** 加载登录信息(含访问 token 和刷新 token 过期检查) */
76
+ /** 加载登录信息(仅负责加载,不负责刷新) */
77
+ loadLoginInfo(): UserToken | null;
78
+ getLoginInfo(): UserToken | null;
79
+ removeLoginInfo(): void;
80
+ setEndpoint(endpoint: string): void;
81
+ setHeader(key: string, value: string): void;
82
+ setHeaders(headers: Record<string, string>): void;
83
+ removeHeader(key: string): void;
84
+ clearHeaders(): void;
85
+ private ensureTokenValid;
86
+ request<T = any>(query: string | DocumentNode, variables?: Record<string, any>): Promise<T>;
87
+ }
88
+
89
+ /** 初始化全局客户端 */
90
+ declare function initGraphQLClient(config: RequestConfig): CCRequest;
91
+ /** 获取全局客户端实例 */
92
+ declare function getClient(): CCRequest;
93
+ /** 注册全局拦截器 */
94
+ declare const useInterceptor: (interceptor: RequestInterceptor) => void;
95
+ declare const setToken: (token: string) => void;
96
+ declare const removeToken: () => void;
97
+ declare const setEndpoint: (endpoint: string) => void;
98
+ declare const setHeader: (key: string, value: string) => void;
99
+ declare const setHeaders: (headers: Record<string, string>) => void;
100
+ declare const removeHeader: (key: string) => void;
101
+ declare const clearHeaders: () => void;
102
+
103
+ type FieldInput = string | {
104
+ [key: string]: FieldNode;
105
+ };
106
+ interface FieldNode {
107
+ fields: FieldInput[];
108
+ where?: WhereInput;
109
+ orderBy?: Record<string, any>;
110
+ distinctOn?: string[];
111
+ limit?: number;
112
+ offset?: number;
113
+ }
114
+ interface WhereInput {
115
+ _and?: WhereInput[];
116
+ _or?: WhereInput[];
117
+ _not?: WhereInput;
118
+ [field: string]: any;
119
+ }
120
+
121
+ interface QueryInput {
122
+ operationName: string;
123
+ fields?: FieldInput[];
124
+ variables?: Record<string, any>;
125
+ where?: WhereInput;
126
+ orderBy?: Record<string, any>;
127
+ distinctOn?: string[];
128
+ limit?: number;
129
+ offset?: number;
130
+ }
131
+ interface QueryPageListInput {
132
+ operationName: string;
133
+ fields: FieldInput[];
134
+ variables?: Record<string, any>;
135
+ where?: WhereInput;
136
+ orderBy?: Record<string, any>;
137
+ distinctOn?: string[];
138
+ size?: number;
139
+ page?: number;
140
+ }
141
+ interface QueryByIdInput {
142
+ operationName: string;
143
+ fields: FieldInput[];
144
+ pk: string | number;
145
+ }
146
+ interface QueryAggregateInput {
147
+ operationName: string;
148
+ fields: FieldInput[];
149
+ aggregateFields?: AggregateFieldInput;
150
+ variables?: Record<string, any>;
151
+ where?: WhereInput;
152
+ distinctOn?: string[];
153
+ }
154
+ interface AggregateFieldInput {
155
+ count?: boolean;
156
+ sum?: string[];
157
+ avg?: string[];
158
+ max?: string[];
159
+ min?: string[];
160
+ }
161
+
162
+ interface InsertOneInput {
163
+ operationName: string;
164
+ fields: FieldInput[];
165
+ data: Record<string, any>;
166
+ variables?: Record<string, any>;
167
+ }
168
+ interface BatchInsertInput {
169
+ operationName: string;
170
+ fields: FieldInput[];
171
+ datas: Record<string, any>[];
172
+ variables?: Record<string, any>;
173
+ }
174
+ interface UpdateInput {
175
+ operationName: string;
176
+ fields: FieldInput[];
177
+ _set: Record<string, any>;
178
+ where: WhereInput;
179
+ variables?: Record<string, any>;
180
+ }
181
+ interface BatchUpdateInput {
182
+ operationName: string;
183
+ fields: FieldInput[];
184
+ _set: Record<string, any>[];
185
+ variables?: Record<string, any>;
186
+ }
187
+ interface UpdateByPkInput {
188
+ operationName: string;
189
+ fields: FieldInput[];
190
+ _set: Record<string, any>;
191
+ pk_columns: string | number;
192
+ variables?: Record<string, any>;
193
+ }
194
+ interface DeleteByIdInput {
195
+ operationName: string;
196
+ fields: FieldInput[];
197
+ pk_columns: string | number;
198
+ variables?: Record<string, any>;
199
+ }
200
+ interface DeleteInput {
201
+ operationName: string;
202
+ fields: FieldInput[];
203
+ where: WhereInput;
204
+ variables?: Record<string, any>;
205
+ }
206
+
207
+ interface SendCodeInput {
208
+ phone: string;
209
+ dataFields?: FieldInput[];
210
+ variables?: Record<string, any>;
211
+ }
212
+ interface VerifyCodeInput {
213
+ code: string;
214
+ phone: string;
215
+ variables?: Record<string, any>;
216
+ }
217
+
218
+ interface LoginInput {
219
+ account: string;
220
+ password: string;
221
+ deviceId?: string;
222
+ variables?: Record<string, any>;
223
+ remember?: boolean;
224
+ }
225
+ interface RegisterUserInput {
226
+ user: Record<string, any>;
227
+ fields: FieldInput[];
228
+ variables?: Record<string, any>;
229
+ }
230
+ interface LogoutInput {
231
+ dataFields?: FieldInput[];
232
+ variables?: Record<string, any>;
233
+ }
234
+ interface LogoutDeviceInput {
235
+ deviceId: string;
236
+ dataFields?: FieldInput[];
237
+ variables?: Record<string, any>;
238
+ }
239
+ interface RefreshTokenInput {
240
+ refreshToken: string;
241
+ variables?: Record<string, any>;
242
+ remember?: boolean;
243
+ }
244
+
245
+ declare const auth: {
246
+ login<T = requestResult<UserToken>>(input: LoginInput): Promise<T>;
247
+ refreshToken<T = requestResult<UserToken>>(input: RefreshTokenInput): Promise<T>;
248
+ register<T = requestResult<any>>(input: RegisterUserInput): Promise<T>;
249
+ logout<T = requestResult<any>>(): Promise<T>;
250
+ logoutAllDevices<T = requestResult<any>>(): Promise<T>;
251
+ logoutDevice<T = requestResult<any>>(deviceId: string): Promise<T>;
252
+ };
253
+
254
+ declare const query: {
255
+ list<T = requestResult<any>>(input: QueryInput, useCache?: boolean, ttl?: number): Promise<T>;
256
+ byId<T = requestResult<any>>(input: QueryByIdInput, useCache?: boolean, ttl?: number): Promise<T>;
257
+ page<T = requestResult<any>>(input: QueryPageListInput, useCache?: boolean, ttl?: number): Promise<T>;
258
+ aggregate<T = requestResult<any>>(input: QueryAggregateInput, useCache?: boolean, ttl?: number): Promise<T>;
259
+ };
260
+
261
+ declare const mutation: {
262
+ insertOne<T = requestResult<any>>(input: InsertOneInput): Promise<T>;
263
+ batchInsert<T = requestResult<any>>(input: BatchInsertInput): Promise<T>;
264
+ update<T = requestResult<any>>(input: UpdateInput): Promise<T>;
265
+ batchUpdate<T = requestResult<any>>(input: BatchUpdateInput): Promise<T>;
266
+ updateByPk<T = requestResult<any>>(input: UpdateByPkInput): Promise<T>;
267
+ delete<T = requestResult<any>>(input: DeleteInput): Promise<T>;
268
+ deleteById<T = requestResult<any>>(input: DeleteByIdInput): Promise<T>;
269
+ };
270
+
271
+ declare const sms: {
272
+ send<T = requestResult<any>>(input: SendCodeInput): Promise<T>;
273
+ verify<T = requestResult<any>>(input: VerifyCodeInput): Promise<T>;
274
+ };
275
+
276
+ /**
277
+ * 原生 GraphQL 执行模块
278
+ * 可执行任意 query / mutation / subscription
279
+ */
280
+ declare const gql: {
281
+ /**
282
+ * 执行任意 GraphQL 文本或 DocumentNode
283
+ * @param query 原生 GQL 文本或 DocumentNode
284
+ * @param variables 可选变量
285
+ * @returns Promise<T>
286
+ */
287
+ execute<T = requestResult<any>>(query: string | DocumentNode, variables?: Record<string, any>): Promise<T>;
288
+ };
289
+
290
+ interface DeviceInfo {
291
+ deviceId: string;
292
+ deviceName: string;
293
+ env: "node" | "browser";
294
+ }
295
+ /** 浏览器端设备信息 */
296
+ declare function getBrowserDeviceInfo(): Promise<DeviceInfo>;
297
+ /** 跨平台获取设备信息 */
298
+ declare function getDeviceInfo(): Promise<DeviceInfo>;
299
+
300
+ export { type AggregateFieldInput, type BatchInsertInput, type BatchUpdateInput, type DeleteByIdInput, type DeleteInput, type DeviceInfo, type InsertOneInput, type LoginInput, type LogoutDeviceInput, type LogoutInput, type QueryAggregateInput, type QueryByIdInput, type QueryInput, type QueryPageListInput, type RefreshTokenInput, type RegisterUserInput, type RequestConfig, type RequestInterceptor, type SendCodeInput, type UpdateByPkInput, type UpdateInput, type UserToken, type VerifyCodeInput, auth, clearHeaders, getBrowserDeviceInfo, getClient, getDeviceInfo, gql, initGraphQLClient, mutation, query, removeHeader, removeToken, type requestResult, setEndpoint, setHeader, setHeaders, setToken, sms, useInterceptor };
@@ -0,0 +1,300 @@
1
+ import { DocumentNode } from 'graphql';
2
+
3
+ interface RequestConfig {
4
+ endpoint?: string;
5
+ Authorization?: string;
6
+ headers?: Record<string, string>;
7
+ loginInfo?: UserToken | null | undefined;
8
+ }
9
+ /** 拦截器接口 */
10
+ interface RequestInterceptor {
11
+ /** 请求发出前拦截,可修改 query、variables、headers */
12
+ onRequest?: (params: {
13
+ query: string;
14
+ variables?: Record<string, any>;
15
+ headers: Record<string, string | undefined> & {
16
+ "X-Device-Id"?: string;
17
+ "X-Device-Name"?: string;
18
+ };
19
+ }) => Promise<typeof params> | typeof params;
20
+ /** 响应成功拦截,可修改返回结构 */
21
+ onResponse?: (response: any) => Promise<any> | any;
22
+ /** 错误拦截,可做统一错误处理或重试 */
23
+ onError?: (error: any) => Promise<any> | any;
24
+ }
25
+ interface requestResult<T = any> {
26
+ [key: string]: T;
27
+ }
28
+ interface UserToken {
29
+ /** 用户 ID */
30
+ userId: number;
31
+ /** 登录账号 */
32
+ loginAccount: string;
33
+ /** 访问 Token */
34
+ token: string;
35
+ /** 刷新 Token */
36
+ refreshToken: string;
37
+ /** 访问 Token 过期时间 */
38
+ expireAt: string;
39
+ /** 刷新 Token 过期时间 */
40
+ refreshExpireAt: string;
41
+ /** 设备 ID */
42
+ deviceId?: string;
43
+ /** 设备名称 */
44
+ deviceName?: string;
45
+ /** 登录时间 */
46
+ loginTime?: string;
47
+ /** 登录 IP */
48
+ requestIp?: string;
49
+ /** 客户端信息 */
50
+ userAgent?: string;
51
+ /** 上次刷新时间 */
52
+ lastRefreshTime?: string;
53
+ /** 用户角色编码列表 */
54
+ roles: string[];
55
+ /** 用户权限编码列表 */
56
+ permissions: string[];
57
+ }
58
+
59
+ declare class CCRequest {
60
+ private config;
61
+ private client;
62
+ private headers;
63
+ private deviceInfoPromise;
64
+ private interceptors;
65
+ constructor(config: RequestConfig);
66
+ /** 注册一个拦截器(支持多个) */
67
+ use(interceptor: RequestInterceptor): void;
68
+ /** 构建 GraphQLClient 实例 */
69
+ private buildClient;
70
+ /** 构建初始 headers */
71
+ private buildHeaders;
72
+ setToken(token: string): void;
73
+ removeToken(): void;
74
+ setLoginInfo(loginInfo: UserToken, remember?: boolean): void;
75
+ /** 加载登录信息(含访问 token 和刷新 token 过期检查) */
76
+ /** 加载登录信息(仅负责加载,不负责刷新) */
77
+ loadLoginInfo(): UserToken | null;
78
+ getLoginInfo(): UserToken | null;
79
+ removeLoginInfo(): void;
80
+ setEndpoint(endpoint: string): void;
81
+ setHeader(key: string, value: string): void;
82
+ setHeaders(headers: Record<string, string>): void;
83
+ removeHeader(key: string): void;
84
+ clearHeaders(): void;
85
+ private ensureTokenValid;
86
+ request<T = any>(query: string | DocumentNode, variables?: Record<string, any>): Promise<T>;
87
+ }
88
+
89
+ /** 初始化全局客户端 */
90
+ declare function initGraphQLClient(config: RequestConfig): CCRequest;
91
+ /** 获取全局客户端实例 */
92
+ declare function getClient(): CCRequest;
93
+ /** 注册全局拦截器 */
94
+ declare const useInterceptor: (interceptor: RequestInterceptor) => void;
95
+ declare const setToken: (token: string) => void;
96
+ declare const removeToken: () => void;
97
+ declare const setEndpoint: (endpoint: string) => void;
98
+ declare const setHeader: (key: string, value: string) => void;
99
+ declare const setHeaders: (headers: Record<string, string>) => void;
100
+ declare const removeHeader: (key: string) => void;
101
+ declare const clearHeaders: () => void;
102
+
103
+ type FieldInput = string | {
104
+ [key: string]: FieldNode;
105
+ };
106
+ interface FieldNode {
107
+ fields: FieldInput[];
108
+ where?: WhereInput;
109
+ orderBy?: Record<string, any>;
110
+ distinctOn?: string[];
111
+ limit?: number;
112
+ offset?: number;
113
+ }
114
+ interface WhereInput {
115
+ _and?: WhereInput[];
116
+ _or?: WhereInput[];
117
+ _not?: WhereInput;
118
+ [field: string]: any;
119
+ }
120
+
121
+ interface QueryInput {
122
+ operationName: string;
123
+ fields?: FieldInput[];
124
+ variables?: Record<string, any>;
125
+ where?: WhereInput;
126
+ orderBy?: Record<string, any>;
127
+ distinctOn?: string[];
128
+ limit?: number;
129
+ offset?: number;
130
+ }
131
+ interface QueryPageListInput {
132
+ operationName: string;
133
+ fields: FieldInput[];
134
+ variables?: Record<string, any>;
135
+ where?: WhereInput;
136
+ orderBy?: Record<string, any>;
137
+ distinctOn?: string[];
138
+ size?: number;
139
+ page?: number;
140
+ }
141
+ interface QueryByIdInput {
142
+ operationName: string;
143
+ fields: FieldInput[];
144
+ pk: string | number;
145
+ }
146
+ interface QueryAggregateInput {
147
+ operationName: string;
148
+ fields: FieldInput[];
149
+ aggregateFields?: AggregateFieldInput;
150
+ variables?: Record<string, any>;
151
+ where?: WhereInput;
152
+ distinctOn?: string[];
153
+ }
154
+ interface AggregateFieldInput {
155
+ count?: boolean;
156
+ sum?: string[];
157
+ avg?: string[];
158
+ max?: string[];
159
+ min?: string[];
160
+ }
161
+
162
+ interface InsertOneInput {
163
+ operationName: string;
164
+ fields: FieldInput[];
165
+ data: Record<string, any>;
166
+ variables?: Record<string, any>;
167
+ }
168
+ interface BatchInsertInput {
169
+ operationName: string;
170
+ fields: FieldInput[];
171
+ datas: Record<string, any>[];
172
+ variables?: Record<string, any>;
173
+ }
174
+ interface UpdateInput {
175
+ operationName: string;
176
+ fields: FieldInput[];
177
+ _set: Record<string, any>;
178
+ where: WhereInput;
179
+ variables?: Record<string, any>;
180
+ }
181
+ interface BatchUpdateInput {
182
+ operationName: string;
183
+ fields: FieldInput[];
184
+ _set: Record<string, any>[];
185
+ variables?: Record<string, any>;
186
+ }
187
+ interface UpdateByPkInput {
188
+ operationName: string;
189
+ fields: FieldInput[];
190
+ _set: Record<string, any>;
191
+ pk_columns: string | number;
192
+ variables?: Record<string, any>;
193
+ }
194
+ interface DeleteByIdInput {
195
+ operationName: string;
196
+ fields: FieldInput[];
197
+ pk_columns: string | number;
198
+ variables?: Record<string, any>;
199
+ }
200
+ interface DeleteInput {
201
+ operationName: string;
202
+ fields: FieldInput[];
203
+ where: WhereInput;
204
+ variables?: Record<string, any>;
205
+ }
206
+
207
+ interface SendCodeInput {
208
+ phone: string;
209
+ dataFields?: FieldInput[];
210
+ variables?: Record<string, any>;
211
+ }
212
+ interface VerifyCodeInput {
213
+ code: string;
214
+ phone: string;
215
+ variables?: Record<string, any>;
216
+ }
217
+
218
+ interface LoginInput {
219
+ account: string;
220
+ password: string;
221
+ deviceId?: string;
222
+ variables?: Record<string, any>;
223
+ remember?: boolean;
224
+ }
225
+ interface RegisterUserInput {
226
+ user: Record<string, any>;
227
+ fields: FieldInput[];
228
+ variables?: Record<string, any>;
229
+ }
230
+ interface LogoutInput {
231
+ dataFields?: FieldInput[];
232
+ variables?: Record<string, any>;
233
+ }
234
+ interface LogoutDeviceInput {
235
+ deviceId: string;
236
+ dataFields?: FieldInput[];
237
+ variables?: Record<string, any>;
238
+ }
239
+ interface RefreshTokenInput {
240
+ refreshToken: string;
241
+ variables?: Record<string, any>;
242
+ remember?: boolean;
243
+ }
244
+
245
+ declare const auth: {
246
+ login<T = requestResult<UserToken>>(input: LoginInput): Promise<T>;
247
+ refreshToken<T = requestResult<UserToken>>(input: RefreshTokenInput): Promise<T>;
248
+ register<T = requestResult<any>>(input: RegisterUserInput): Promise<T>;
249
+ logout<T = requestResult<any>>(): Promise<T>;
250
+ logoutAllDevices<T = requestResult<any>>(): Promise<T>;
251
+ logoutDevice<T = requestResult<any>>(deviceId: string): Promise<T>;
252
+ };
253
+
254
+ declare const query: {
255
+ list<T = requestResult<any>>(input: QueryInput, useCache?: boolean, ttl?: number): Promise<T>;
256
+ byId<T = requestResult<any>>(input: QueryByIdInput, useCache?: boolean, ttl?: number): Promise<T>;
257
+ page<T = requestResult<any>>(input: QueryPageListInput, useCache?: boolean, ttl?: number): Promise<T>;
258
+ aggregate<T = requestResult<any>>(input: QueryAggregateInput, useCache?: boolean, ttl?: number): Promise<T>;
259
+ };
260
+
261
+ declare const mutation: {
262
+ insertOne<T = requestResult<any>>(input: InsertOneInput): Promise<T>;
263
+ batchInsert<T = requestResult<any>>(input: BatchInsertInput): Promise<T>;
264
+ update<T = requestResult<any>>(input: UpdateInput): Promise<T>;
265
+ batchUpdate<T = requestResult<any>>(input: BatchUpdateInput): Promise<T>;
266
+ updateByPk<T = requestResult<any>>(input: UpdateByPkInput): Promise<T>;
267
+ delete<T = requestResult<any>>(input: DeleteInput): Promise<T>;
268
+ deleteById<T = requestResult<any>>(input: DeleteByIdInput): Promise<T>;
269
+ };
270
+
271
+ declare const sms: {
272
+ send<T = requestResult<any>>(input: SendCodeInput): Promise<T>;
273
+ verify<T = requestResult<any>>(input: VerifyCodeInput): Promise<T>;
274
+ };
275
+
276
+ /**
277
+ * 原生 GraphQL 执行模块
278
+ * 可执行任意 query / mutation / subscription
279
+ */
280
+ declare const gql: {
281
+ /**
282
+ * 执行任意 GraphQL 文本或 DocumentNode
283
+ * @param query 原生 GQL 文本或 DocumentNode
284
+ * @param variables 可选变量
285
+ * @returns Promise<T>
286
+ */
287
+ execute<T = requestResult<any>>(query: string | DocumentNode, variables?: Record<string, any>): Promise<T>;
288
+ };
289
+
290
+ interface DeviceInfo {
291
+ deviceId: string;
292
+ deviceName: string;
293
+ env: "node" | "browser";
294
+ }
295
+ /** 浏览器端设备信息 */
296
+ declare function getBrowserDeviceInfo(): Promise<DeviceInfo>;
297
+ /** 跨平台获取设备信息 */
298
+ declare function getDeviceInfo(): Promise<DeviceInfo>;
299
+
300
+ export { type AggregateFieldInput, type BatchInsertInput, type BatchUpdateInput, type DeleteByIdInput, type DeleteInput, type DeviceInfo, type InsertOneInput, type LoginInput, type LogoutDeviceInput, type LogoutInput, type QueryAggregateInput, type QueryByIdInput, type QueryInput, type QueryPageListInput, type RefreshTokenInput, type RegisterUserInput, type RequestConfig, type RequestInterceptor, type SendCodeInput, type UpdateByPkInput, type UpdateInput, type UserToken, type VerifyCodeInput, auth, clearHeaders, getBrowserDeviceInfo, getClient, getDeviceInfo, gql, initGraphQLClient, mutation, query, removeHeader, removeToken, type requestResult, setEndpoint, setHeader, setHeaders, setToken, sms, useInterceptor };