test-api-client 0.0.1
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.
- package/README.md +587 -0
- package/dist/index.d.mts +597 -0
- package/dist/index.d.ts +597 -0
- package/dist/index.js +1092 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1068 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +39 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
type ApiLogLevel = 'ALL' | 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'FATAL' | 'OFF';
|
|
2
|
+
type LogFormatType = 1 | 2;
|
|
3
|
+
type LogOutputOption = 1 | 2;
|
|
4
|
+
/**
|
|
5
|
+
* 错误级别枚举
|
|
6
|
+
*/
|
|
7
|
+
declare enum ErrorLevel {
|
|
8
|
+
SUCCESS = 0,// 成功(业务成功)
|
|
9
|
+
SYSTEM = 1,// 系统级错误
|
|
10
|
+
CLIENT_PARAM = 2,// 客户端参数错误
|
|
11
|
+
AUTH = 3,// 认证授权错误
|
|
12
|
+
BUSINESS = 4,// 业务逻辑错误
|
|
13
|
+
RESOURCE = 5,// 资源操作错误
|
|
14
|
+
NETWORK = 6,// 网络通信错误
|
|
15
|
+
FILE_MEDIA = 7,// 文件/媒体错误
|
|
16
|
+
DEVICE_HARDWARE = 8,// 设备硬件错误
|
|
17
|
+
THIRD_PARTY = 9
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 功能模块枚举
|
|
21
|
+
*/
|
|
22
|
+
declare enum FunctionModule {
|
|
23
|
+
GENERAL = "00",// 通用/系统
|
|
24
|
+
USER_AUTH = "01",// 用户认证
|
|
25
|
+
SELF_CHECK = "02",// 自检维护
|
|
26
|
+
AIRLINE = "03",// 航线管理
|
|
27
|
+
FENCE = "04",// 电子围栏
|
|
28
|
+
REAL_TIME_DATA = "05",// 实时数据
|
|
29
|
+
VIDEO_STREAM = "06",// 视频流
|
|
30
|
+
AUDIO_STREAM = "07",// 音频流
|
|
31
|
+
MEDIA_SERVICE = "08",// 流媒体服务
|
|
32
|
+
AV_CONTROL = "09",// 音视频控制
|
|
33
|
+
LOG_FILE = "10",// 日志文件
|
|
34
|
+
REMOTE_CONTROL = "11",// 遥控指令
|
|
35
|
+
FLIGHT_STATUS = "12"
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* API错误类型
|
|
39
|
+
*/
|
|
40
|
+
type ApiErrorType = 'network' | 'server' | 'auth' | 'business' | 'unknown';
|
|
41
|
+
/**
|
|
42
|
+
* Api API响应通用格式
|
|
43
|
+
* @template T - 响应数据类型
|
|
44
|
+
* @property {number} code - 响应状态码
|
|
45
|
+
* @property {string} [msg] - 响应消息(短)
|
|
46
|
+
* @property {string} [message] - 响应消息(长)
|
|
47
|
+
* @property {number} [sub_code] - 子错误码
|
|
48
|
+
* @property {string} [sub_msg] - 子错误消息
|
|
49
|
+
* @property {T} [data] - 响应数据
|
|
50
|
+
*/
|
|
51
|
+
interface ApiApiResponse<T> {
|
|
52
|
+
code: number;
|
|
53
|
+
msg?: string;
|
|
54
|
+
message?: string;
|
|
55
|
+
sub_code?: number;
|
|
56
|
+
sub_msg?: string;
|
|
57
|
+
data?: T;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Api客户端配置
|
|
61
|
+
* @property {string} baseUrl - API基础URL
|
|
62
|
+
* @property {string} secret - 密钥
|
|
63
|
+
* @property {string} salt - 加密盐值
|
|
64
|
+
* @property {boolean} [debug] - 是否开启调试模式
|
|
65
|
+
* @property {ApiLogLevel} [logLevel] - 日志等级
|
|
66
|
+
* @property {LogFormatType} [logFormat] - 日志格式类型,1: json格式, 2: 传统文本格式
|
|
67
|
+
* @property {LogOutputOption[]} [logOutput] - 日志输出选项,1: 控制台打印, 2: 客户端上报
|
|
68
|
+
* @property {(log: object | string, level: ApiLogLevel, meta?: unknown) => void} [logger] - 自定义日志输出方法(用于外部系统集成)
|
|
69
|
+
* @property {(error: ApiError) => void} [onError] - 统一错误回调(可用于埋点/上报)
|
|
70
|
+
* @property {Record<number, string>} [businessErrorMessageMap] - 业务错误码映射(优先使用 sub_code,其次 code)
|
|
71
|
+
* @property {number} [tokenRefreshMaxRetries] - Token失效时的最大重试次数,设置为0则一直重试
|
|
72
|
+
*/
|
|
73
|
+
interface ApiClientConfig {
|
|
74
|
+
baseUrl: string;
|
|
75
|
+
secret: string;
|
|
76
|
+
salt: string;
|
|
77
|
+
debug?: boolean;
|
|
78
|
+
logLevel?: ApiLogLevel;
|
|
79
|
+
logFormat?: LogFormatType;
|
|
80
|
+
logOutput?: LogOutputOption[];
|
|
81
|
+
logger?: (log: object | string, level: ApiLogLevel, meta?: unknown) => void;
|
|
82
|
+
onError?: (error: ApiError) => void;
|
|
83
|
+
businessErrorMessageMap?: Record<number, string>;
|
|
84
|
+
tokenRefreshMaxRetries?: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Api结构化HTTP日志
|
|
88
|
+
* @property {string} url - 请求URL
|
|
89
|
+
* @property {string} name - API名称
|
|
90
|
+
* @property {string} [method] - 请求方法
|
|
91
|
+
* @property {unknown} [headers] - 请求头
|
|
92
|
+
* @property {unknown} [request] - 请求体
|
|
93
|
+
* @property {unknown} [response] - 响应体
|
|
94
|
+
* @property {number} [durationMs] - 请求时长(毫秒)
|
|
95
|
+
* @property {number} [status] - HTTP状态码
|
|
96
|
+
* @property {string} [message] - 日志消息
|
|
97
|
+
*/
|
|
98
|
+
interface ApiStructuredHttpLog {
|
|
99
|
+
name?: string;
|
|
100
|
+
url?: string;
|
|
101
|
+
method?: string;
|
|
102
|
+
headers?: unknown;
|
|
103
|
+
request?: unknown;
|
|
104
|
+
response?: unknown;
|
|
105
|
+
durationMs?: number;
|
|
106
|
+
status?: number;
|
|
107
|
+
message?: string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Api客户端错误类
|
|
111
|
+
* 用于封装各种类型的错误信息
|
|
112
|
+
*/
|
|
113
|
+
declare class ApiError extends Error {
|
|
114
|
+
readonly type: ApiErrorType;
|
|
115
|
+
readonly httpStatus?: number;
|
|
116
|
+
readonly code?: number;
|
|
117
|
+
readonly subCode?: number;
|
|
118
|
+
readonly subMsg?: string;
|
|
119
|
+
readonly errorLevel?: ErrorLevel;
|
|
120
|
+
readonly module?: FunctionModule;
|
|
121
|
+
readonly raw?: unknown;
|
|
122
|
+
/**
|
|
123
|
+
* 创建ApiError实例
|
|
124
|
+
* @param params - 错误参数
|
|
125
|
+
* @param params.message - 错误消息
|
|
126
|
+
* @param params.type - 错误类型
|
|
127
|
+
* @param params.httpStatus - HTTP状态码(可选)
|
|
128
|
+
* @param params.code - 业务错误码(可选)
|
|
129
|
+
* @param params.subCode - 业务子错误码(可选)
|
|
130
|
+
* @param params.subMsg - 业务子错误消息(可选)
|
|
131
|
+
* @param params.errorLevel - 错误级别(可选)
|
|
132
|
+
* @param params.module - 功能模块(可选)
|
|
133
|
+
* @param params.raw - 原始错误数据(可选)
|
|
134
|
+
*/
|
|
135
|
+
constructor(params: {
|
|
136
|
+
message: string;
|
|
137
|
+
type: ApiErrorType;
|
|
138
|
+
httpStatus?: number;
|
|
139
|
+
code?: number;
|
|
140
|
+
subCode?: number;
|
|
141
|
+
subMsg?: string;
|
|
142
|
+
errorLevel?: ErrorLevel;
|
|
143
|
+
module?: FunctionModule;
|
|
144
|
+
raw?: unknown;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* 模拟后续请求返回401错误,用于测试token刷新逻辑
|
|
150
|
+
* @export
|
|
151
|
+
* @param {number} [count=1] - 模拟401错误的请求次数
|
|
152
|
+
*/
|
|
153
|
+
declare function simulateNext401(count?: number): void;
|
|
154
|
+
/**
|
|
155
|
+
* 初始化Api客户端
|
|
156
|
+
* @export
|
|
157
|
+
* @param {ApiClientConfig} config - Api客户端配置
|
|
158
|
+
*/
|
|
159
|
+
declare function initApiClient(config: ApiClientConfig): void;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* 设置Api令牌
|
|
163
|
+
* @param token - 令牌字符串或undefined
|
|
164
|
+
*/
|
|
165
|
+
declare function setApiToken(token: string | undefined): void;
|
|
166
|
+
/**
|
|
167
|
+
* 获取Api令牌
|
|
168
|
+
* @returns 令牌字符串或undefined
|
|
169
|
+
*/
|
|
170
|
+
declare function getApiToken(): string | undefined;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 登录请求
|
|
174
|
+
* @property {string} username - 登录用户名
|
|
175
|
+
* @property {string} password - 登录密码
|
|
176
|
+
*/
|
|
177
|
+
interface LoginRequest {
|
|
178
|
+
username: string;
|
|
179
|
+
password: string;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 登录响应
|
|
183
|
+
* @property {string} token - 接口调用的token
|
|
184
|
+
* @property {number} expires_in - token有效期(秒)
|
|
185
|
+
* @property {string} nickName - 昵称
|
|
186
|
+
* @property {string} avatar - 头像
|
|
187
|
+
*/
|
|
188
|
+
interface LoginResponse {
|
|
189
|
+
token: string;
|
|
190
|
+
expires_in: number;
|
|
191
|
+
nickName: string;
|
|
192
|
+
avatar: string;
|
|
193
|
+
}
|
|
194
|
+
/** 刷新token请求 */
|
|
195
|
+
type RefreshTokenRequest = Record<string, never>;
|
|
196
|
+
/**
|
|
197
|
+
* 刷新token响应
|
|
198
|
+
* @property {string} token - 新的token
|
|
199
|
+
* @property {number} expires_in - token有效期(秒)
|
|
200
|
+
*/
|
|
201
|
+
interface RefreshTokenResponse {
|
|
202
|
+
token: string;
|
|
203
|
+
expires_in: number;
|
|
204
|
+
}
|
|
205
|
+
/** 退出登录请求 */
|
|
206
|
+
type LogoutRequest = Record<string, never>;
|
|
207
|
+
/** 退出登录响应 */
|
|
208
|
+
type LogoutResponse = Record<string, never>;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* 用户登录
|
|
212
|
+
* @param req - 登录请求参数
|
|
213
|
+
* @returns 登录响应结果
|
|
214
|
+
*/
|
|
215
|
+
declare const loginApi: (req: Partial<LoginRequest>) => Promise<LoginResponse>;
|
|
216
|
+
/**
|
|
217
|
+
* 刷新令牌
|
|
218
|
+
* @param req - 刷新令牌请求参数
|
|
219
|
+
* @returns 刷新令牌响应结果
|
|
220
|
+
*/
|
|
221
|
+
declare const refreshTokenApi: (req: Partial<RefreshTokenRequest>) => Promise<RefreshTokenResponse>;
|
|
222
|
+
/**
|
|
223
|
+
* 用户登出
|
|
224
|
+
* @param req - 登出请求参数
|
|
225
|
+
* @returns 登出响应结果
|
|
226
|
+
*/
|
|
227
|
+
declare const logoutApi: (req: Partial<LogoutRequest>) => Promise<LogoutResponse>;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* 航点信息
|
|
231
|
+
* @property {string} routeId - 航线ID
|
|
232
|
+
* @property {number} no - 航点序号(从1开始递增)
|
|
233
|
+
* @property {string | number} type - 航点类型
|
|
234
|
+
* @property {string} longitude - 经度(保留6位小数)
|
|
235
|
+
* @property {string} latitude - 纬度(保留6位小数)
|
|
236
|
+
* @property {string} altitude - 高度(米)
|
|
237
|
+
* @property {string} velocity - 速度
|
|
238
|
+
* @property {string | number} switchMode - 航点切换方式
|
|
239
|
+
*/
|
|
240
|
+
interface AirlineRoutePoint {
|
|
241
|
+
routeId: string;
|
|
242
|
+
no: number;
|
|
243
|
+
type: string | number;
|
|
244
|
+
longitude: string;
|
|
245
|
+
latitude: string;
|
|
246
|
+
altitude: string;
|
|
247
|
+
velocity: string;
|
|
248
|
+
switchMode: string | number;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* 航线新增请求
|
|
252
|
+
* @property {AirlineRoutePoint[]} routePoints - 航点列表
|
|
253
|
+
* @property {string} routeId - 航线ID
|
|
254
|
+
* @property {string} routeName - 航线名称
|
|
255
|
+
* @property {string} duration - 预计飞行时长
|
|
256
|
+
* @property {string} distance - 总航程
|
|
257
|
+
* @property {number} pointCount - 航点总数
|
|
258
|
+
*/
|
|
259
|
+
interface AirlineAddRequest {
|
|
260
|
+
routePoints: AirlineRoutePoint[];
|
|
261
|
+
routeId: string;
|
|
262
|
+
routeName: string;
|
|
263
|
+
duration: string;
|
|
264
|
+
distance: string;
|
|
265
|
+
pointCount: number;
|
|
266
|
+
}
|
|
267
|
+
/** 航线新增响应 */
|
|
268
|
+
type AirlineAddResponse = Record<string, never>;
|
|
269
|
+
/**
|
|
270
|
+
* 获取航线列表请求
|
|
271
|
+
* @property {number} current - 分页页码
|
|
272
|
+
* @property {number} size - 页大小
|
|
273
|
+
* @property {number} [auditStatus] - 审核状态
|
|
274
|
+
*/
|
|
275
|
+
interface AirlineListRequest {
|
|
276
|
+
current: number;
|
|
277
|
+
size: number;
|
|
278
|
+
auditStatus?: number;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* 航线信息
|
|
282
|
+
* @property {AirlineRoutePoint[]} routePoints - 航点列表
|
|
283
|
+
* @property {string} routeId - 航线ID
|
|
284
|
+
* @property {string} routeName - 航线名称
|
|
285
|
+
* @property {string} duration - 预计飞行时长
|
|
286
|
+
* @property {string} distance - 总航程
|
|
287
|
+
* @property {number} pointCount - 航点总数
|
|
288
|
+
* @property {string} [areaId] - 空域ID
|
|
289
|
+
* @property {string} [areaName] - 空域名称
|
|
290
|
+
* @property {string} [submitUid] - 提交人ID
|
|
291
|
+
* @property {string} [submitUname] - 提交人名称
|
|
292
|
+
* @property {string} [auditUid] - 审核人ID
|
|
293
|
+
* @property {string} [auditUname] - 审核人名称
|
|
294
|
+
* @property {string} [auditStatus] - 审核状态
|
|
295
|
+
* @property {string} [auditRemark] - 审核意见
|
|
296
|
+
* @property {string} [auditTime] - 审核时间
|
|
297
|
+
* @property {string | number} [updateAt] - 更新时间
|
|
298
|
+
* @property {string} [auditType] - 审核类型
|
|
299
|
+
* @property {string} [homeboundAltitude] - 返航高度
|
|
300
|
+
* @property {string} [homeboundSpeed] - 返航速度
|
|
301
|
+
*/
|
|
302
|
+
interface AirlineItem {
|
|
303
|
+
routePoints: AirlineRoutePoint[];
|
|
304
|
+
routeId: string;
|
|
305
|
+
routeName: string;
|
|
306
|
+
duration: string;
|
|
307
|
+
distance: string;
|
|
308
|
+
pointCount: number;
|
|
309
|
+
areaId?: string;
|
|
310
|
+
areaName?: string;
|
|
311
|
+
submitUid?: string;
|
|
312
|
+
submitUname?: string;
|
|
313
|
+
auditUid?: string;
|
|
314
|
+
auditUname?: string;
|
|
315
|
+
auditStatus?: string;
|
|
316
|
+
auditRemark?: string;
|
|
317
|
+
auditTime?: string;
|
|
318
|
+
updateAt?: string | number;
|
|
319
|
+
auditType?: string;
|
|
320
|
+
homeboundAltitude?: string;
|
|
321
|
+
homeboundSpeed?: string;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* 获取航线列表响应
|
|
325
|
+
* @property {AirlineItem[]} records - 航线列表
|
|
326
|
+
* @property {string | number} current - 当前页
|
|
327
|
+
* @property {string | number} size - 每页条数
|
|
328
|
+
* @property {string | number} total - 总条数
|
|
329
|
+
*/
|
|
330
|
+
interface AirlineListResponse {
|
|
331
|
+
records: AirlineItem[];
|
|
332
|
+
current: string | number;
|
|
333
|
+
size: string | number;
|
|
334
|
+
total: string | number;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* 航线查询请求
|
|
338
|
+
* @property {string} routeId - 航线ID
|
|
339
|
+
*/
|
|
340
|
+
interface AirlineQueryRequest {
|
|
341
|
+
routeId: string;
|
|
342
|
+
}
|
|
343
|
+
/** 航线查询响应 */
|
|
344
|
+
type AirlineQueryResponse = AirlineItem;
|
|
345
|
+
/**
|
|
346
|
+
* 航线更新请求
|
|
347
|
+
* @property {string} routeId - 航线ID
|
|
348
|
+
* @property {string} routeName - 航线名称
|
|
349
|
+
* @property {string} duration - 预计飞行时长
|
|
350
|
+
* @property {string} distance - 总航程
|
|
351
|
+
* @property {number} pointCount - 航点总数
|
|
352
|
+
* @property {string | number} [auditType] - 审核类型
|
|
353
|
+
* @property {string} [areaId] - 空域ID
|
|
354
|
+
* @property {string} [areaName] - 空域名称
|
|
355
|
+
* @property {string} [homeboundAltitude] - 返航高度
|
|
356
|
+
* @property {string} [homeboundSpeed] - 返航速度
|
|
357
|
+
* @property {number} [updateAt] - 更新时间
|
|
358
|
+
* @property {AirlineRoutePoint[]} routePoints - 航点列表
|
|
359
|
+
*/
|
|
360
|
+
interface AirlineUpdateRequest {
|
|
361
|
+
routeId: string;
|
|
362
|
+
routeName: string;
|
|
363
|
+
duration: string;
|
|
364
|
+
distance: string;
|
|
365
|
+
pointCount: number;
|
|
366
|
+
auditType?: string | number;
|
|
367
|
+
areaId?: string;
|
|
368
|
+
areaName?: string;
|
|
369
|
+
homeboundAltitude?: string;
|
|
370
|
+
homeboundSpeed?: string;
|
|
371
|
+
updateAt?: number;
|
|
372
|
+
routePoints: AirlineRoutePoint[];
|
|
373
|
+
}
|
|
374
|
+
/** 航线更新响应 */
|
|
375
|
+
type AirlineUpdateResponse = Record<string, never>;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* 添加航线信息
|
|
379
|
+
* @param req - 航线添加请求参数
|
|
380
|
+
* @returns 航线添加响应结果
|
|
381
|
+
*/
|
|
382
|
+
declare const airlineAddApi: (req: Partial<AirlineAddRequest>) => Promise<AirlineAddResponse>;
|
|
383
|
+
/**
|
|
384
|
+
* 获取航线列表
|
|
385
|
+
* @param req - 航线列表请求参数
|
|
386
|
+
* @returns 航线列表响应结果
|
|
387
|
+
*/
|
|
388
|
+
declare const airlineListApi: (req: Partial<AirlineListRequest>) => Promise<AirlineListResponse>;
|
|
389
|
+
/**
|
|
390
|
+
* 查询航线详情
|
|
391
|
+
* @param req - 航线查询请求参数
|
|
392
|
+
* @returns 航线查询响应结果
|
|
393
|
+
*/
|
|
394
|
+
declare const airlineQueryApi: (req: Partial<AirlineQueryRequest>) => Promise<AirlineQueryResponse>;
|
|
395
|
+
/**
|
|
396
|
+
* 更新航线信息
|
|
397
|
+
* @param req - 航线更新请求参数
|
|
398
|
+
* @returns 航线更新响应结果
|
|
399
|
+
*/
|
|
400
|
+
declare const airlineUpdateApi: (req: Partial<AirlineUpdateRequest>) => Promise<AirlineUpdateResponse>;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* 电子围栏有效时间段
|
|
404
|
+
* @property {number} timeDomainIndex - 时间域序号
|
|
405
|
+
* @property {number} startTime - 开始时间(时间戳,秒)
|
|
406
|
+
* @property {number} endTime - 结束时间(时间戳,秒)
|
|
407
|
+
*/
|
|
408
|
+
interface FenceEffectiveTime {
|
|
409
|
+
timeDomainIndex: number;
|
|
410
|
+
startTime: number;
|
|
411
|
+
endTime: number;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* 多边形顶点信息
|
|
415
|
+
* @property {number} vertexIndex - 顶点序号
|
|
416
|
+
* @property {number} longitude - 经度(经度×1e7)
|
|
417
|
+
* @property {number} latitude - 纬度(纬度×1e7)
|
|
418
|
+
*/
|
|
419
|
+
interface FencePolygonVertex {
|
|
420
|
+
vertexIndex: number;
|
|
421
|
+
longitude: number;
|
|
422
|
+
latitude: number;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* 扇区信息
|
|
426
|
+
* @property {number} [longitude] - 圆点经度(经度×1e7)
|
|
427
|
+
* @property {number} [latitude] - 圆点纬度(纬度×1e7)
|
|
428
|
+
* @property {number} [radius] - 半径(半径×100,单位:米)
|
|
429
|
+
* @property {number} [startDirection] - 开始真方向
|
|
430
|
+
* @property {number} [endDirection] - 结束真方向
|
|
431
|
+
*/
|
|
432
|
+
interface FenceSectorInfo {
|
|
433
|
+
longitude?: number;
|
|
434
|
+
latitude?: number;
|
|
435
|
+
radius?: number;
|
|
436
|
+
startDirection?: number;
|
|
437
|
+
endDirection?: number;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* 电子围栏新增请求
|
|
441
|
+
* @property {string} fenceName - 围栏名称
|
|
442
|
+
* @property {number} geometryType - 几何类型
|
|
443
|
+
* @property {number} airspaceType - 空域属性
|
|
444
|
+
* @property {number} relativeHeight - 顶面相对高度(×100,单位:米)
|
|
445
|
+
* @property {string} [areaId] - 区域ID
|
|
446
|
+
* @property {string} [areaName] - 区域名称
|
|
447
|
+
* @property {number} [auditType] - 审核类型
|
|
448
|
+
* @property {number} [auditStatus] - 审核状态
|
|
449
|
+
* @property {FencePolygonVertex[]} [polygonVertices] - 多边形顶点列表
|
|
450
|
+
* @property {FenceSectorInfo} [sectorInfo] - 扇区信息
|
|
451
|
+
* @property {FenceEffectiveTime[]} [effectiveTimes] - 有效时间段
|
|
452
|
+
*/
|
|
453
|
+
interface FenceAddRequest {
|
|
454
|
+
fenceName: string;
|
|
455
|
+
geometryType: number;
|
|
456
|
+
airspaceType: number;
|
|
457
|
+
relativeHeight: number;
|
|
458
|
+
areaId?: string;
|
|
459
|
+
areaName?: string;
|
|
460
|
+
auditType?: number;
|
|
461
|
+
auditStatus?: number;
|
|
462
|
+
polygonVertices?: FencePolygonVertex[];
|
|
463
|
+
sectorInfo?: FenceSectorInfo;
|
|
464
|
+
effectiveTimes?: FenceEffectiveTime[];
|
|
465
|
+
}
|
|
466
|
+
/** 电子围栏新增响应 */
|
|
467
|
+
type FenceAddResponse = Record<string, never>;
|
|
468
|
+
/**
|
|
469
|
+
* 获取电子围栏列表请求
|
|
470
|
+
* @property {number} current - 分页页码
|
|
471
|
+
* @property {number} size - 页大小
|
|
472
|
+
* @property {number} [auditStatus] - 审核状态
|
|
473
|
+
*/
|
|
474
|
+
interface FenceListRequest {
|
|
475
|
+
current: number;
|
|
476
|
+
size: number;
|
|
477
|
+
auditStatus?: number;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* 电子围栏信息
|
|
481
|
+
* @property {FencePolygonVertex[]} [polygonVertices] - 多边形顶点列表
|
|
482
|
+
* @property {FenceEffectiveTime[]} [effectiveTimes] - 有效时间段
|
|
483
|
+
* @property {string} fenceId - 围栏ID
|
|
484
|
+
* @property {string} fenceName - 围栏名称
|
|
485
|
+
* @property {string | number} geometryType - 几何类型
|
|
486
|
+
* @property {string | number} airspaceType - 空域属性
|
|
487
|
+
* @property {number} relativeHeight - 顶面相对高度
|
|
488
|
+
* @property {string} [areaId] - 区域ID
|
|
489
|
+
* @property {string} [areaName] - 区域名称
|
|
490
|
+
* @property {string} [submitUid] - 提交人ID
|
|
491
|
+
* @property {string} [submitUname] - 提交人名称
|
|
492
|
+
* @property {string} [auditUid] - 审核人ID
|
|
493
|
+
* @property {string} [auditUname] - 审核人名称
|
|
494
|
+
* @property {string | number} [auditType] - 审核类型
|
|
495
|
+
* @property {string | number} [auditStatus] - 审核状态
|
|
496
|
+
* @property {string} [auditRemark] - 审核意见
|
|
497
|
+
* @property {string} [auditTime] - 审核时间
|
|
498
|
+
* @property {string | number} [updateAt] - 更新时间
|
|
499
|
+
* @property {FenceSectorInfo | null} [sectorInfo] - 扇区信息
|
|
500
|
+
*/
|
|
501
|
+
interface FenceItem {
|
|
502
|
+
polygonVertices?: FencePolygonVertex[];
|
|
503
|
+
effectiveTimes?: FenceEffectiveTime[];
|
|
504
|
+
fenceId: string;
|
|
505
|
+
fenceName: string;
|
|
506
|
+
geometryType: string | number;
|
|
507
|
+
airspaceType: string | number;
|
|
508
|
+
relativeHeight: number;
|
|
509
|
+
areaId?: string;
|
|
510
|
+
areaName?: string;
|
|
511
|
+
submitUid?: string;
|
|
512
|
+
submitUname?: string;
|
|
513
|
+
auditUid?: string;
|
|
514
|
+
auditUname?: string;
|
|
515
|
+
auditType?: string | number;
|
|
516
|
+
auditStatus?: string | number;
|
|
517
|
+
auditRemark?: string;
|
|
518
|
+
auditTime?: string;
|
|
519
|
+
updateAt?: string | number;
|
|
520
|
+
sectorInfo?: FenceSectorInfo | null;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* 获取电子围栏列表响应
|
|
524
|
+
* @property {FenceItem[]} records - 围栏列表
|
|
525
|
+
* @property {string | number} current - 当前页
|
|
526
|
+
* @property {string | number} size - 每页条数
|
|
527
|
+
* @property {string | number} total - 总条数
|
|
528
|
+
*/
|
|
529
|
+
interface FenceListResponse {
|
|
530
|
+
records: FenceItem[];
|
|
531
|
+
current: string | number;
|
|
532
|
+
size: string | number;
|
|
533
|
+
total: string | number;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* 电子围栏查询请求
|
|
537
|
+
* @property {string} fenceId - 围栏ID
|
|
538
|
+
*/
|
|
539
|
+
interface FenceQueryRequest {
|
|
540
|
+
fenceId: string;
|
|
541
|
+
}
|
|
542
|
+
/** 电子围栏查询响应 */
|
|
543
|
+
type FenceQueryResponse = FenceItem;
|
|
544
|
+
/**
|
|
545
|
+
* 电子围栏更新请求
|
|
546
|
+
* @property {string} fenceId - 围栏ID
|
|
547
|
+
* @property {string} [fenceName] - 围栏名称
|
|
548
|
+
* @property {string | number} geometryType - 几何类型
|
|
549
|
+
* @property {string | number} airspaceType - 空域属性
|
|
550
|
+
* @property {number} relativeHeight - 顶面相对高度
|
|
551
|
+
* @property {string} [areaId] - 区域ID
|
|
552
|
+
* @property {string} [areaName] - 区域名称
|
|
553
|
+
* @property {FencePolygonVertex[]} [polygonVertices] - 多边形顶点列表
|
|
554
|
+
* @property {FenceSectorInfo} [sectorInfo] - 扇区信息
|
|
555
|
+
* @property {FenceEffectiveTime[]} [effectiveTimes] - 有效时间段
|
|
556
|
+
*/
|
|
557
|
+
interface FenceUpdateRequest {
|
|
558
|
+
fenceId: string;
|
|
559
|
+
fenceName?: string;
|
|
560
|
+
geometryType: string | number;
|
|
561
|
+
airspaceType: string | number;
|
|
562
|
+
relativeHeight: number;
|
|
563
|
+
areaId?: string;
|
|
564
|
+
areaName?: string;
|
|
565
|
+
polygonVertices?: FencePolygonVertex[];
|
|
566
|
+
sectorInfo?: FenceSectorInfo;
|
|
567
|
+
effectiveTimes?: FenceEffectiveTime[];
|
|
568
|
+
}
|
|
569
|
+
/** 电子围栏更新响应 */
|
|
570
|
+
type FenceUpdateResponse = Record<string, never>;
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* 添加电子围栏
|
|
574
|
+
* @param req - 电子围栏添加请求参数
|
|
575
|
+
* @returns 电子围栏添加响应结果
|
|
576
|
+
*/
|
|
577
|
+
declare const fenceAddApi: (req: Partial<FenceAddRequest>) => Promise<FenceAddResponse>;
|
|
578
|
+
/**
|
|
579
|
+
* 获取电子围栏列表
|
|
580
|
+
* @param req - 电子围栏列表请求参数
|
|
581
|
+
* @returns 电子围栏列表响应结果
|
|
582
|
+
*/
|
|
583
|
+
declare const fenceListApi: (req: Partial<FenceListRequest>) => Promise<FenceListResponse>;
|
|
584
|
+
/**
|
|
585
|
+
* 查询电子围栏详情
|
|
586
|
+
* @param req - 电子围栏查询请求参数
|
|
587
|
+
* @returns 电子围栏查询响应结果
|
|
588
|
+
*/
|
|
589
|
+
declare const fenceQueryApi: (req: Partial<FenceQueryRequest>) => Promise<FenceQueryResponse>;
|
|
590
|
+
/**
|
|
591
|
+
* 更新电子围栏
|
|
592
|
+
* @param req - 电子围栏更新请求参数
|
|
593
|
+
* @returns 电子围栏更新响应结果
|
|
594
|
+
*/
|
|
595
|
+
declare const fenceUpdateApi: (req: Partial<FenceUpdateRequest>) => Promise<FenceUpdateResponse>;
|
|
596
|
+
|
|
597
|
+
export { type ApiApiResponse, type ApiClientConfig, ApiError, type ApiErrorType, type ApiLogLevel, type ApiStructuredHttpLog, ErrorLevel, FunctionModule, airlineAddApi, airlineListApi, airlineQueryApi, airlineUpdateApi, fenceAddApi, fenceListApi, fenceQueryApi, fenceUpdateApi, getApiToken, initApiClient, loginApi, logoutApi, refreshTokenApi, setApiToken, simulateNext401 };
|