@djvlc/contracts-types 1.8.3 → 1.8.4
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/dist/index.d.mts +19 -9
- package/dist/index.d.ts +19 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -248,16 +248,23 @@ declare function isDjvlcError(error: unknown): error is DjvlcError;
|
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
250
|
* 成功响应
|
|
251
|
+
* 与 platform 仓库的 BaseResponse 保持一致
|
|
251
252
|
*/
|
|
252
253
|
interface ApiSuccessResponse<T = unknown> {
|
|
253
254
|
/** 是否成功 */
|
|
254
255
|
success: true;
|
|
256
|
+
/** 业务状态码 */
|
|
257
|
+
code: string;
|
|
258
|
+
/** 响应消息 */
|
|
259
|
+
message: string;
|
|
255
260
|
/** 响应数据 */
|
|
256
261
|
data: T;
|
|
262
|
+
/** 响应时间戳(Unix 毫秒时间戳) */
|
|
263
|
+
timestamp: number;
|
|
264
|
+
/** 请求路径 */
|
|
265
|
+
path: string;
|
|
257
266
|
/** 请求 ID */
|
|
258
|
-
requestId
|
|
259
|
-
/** 响应时间戳 */
|
|
260
|
-
timestamp: ISODateTime;
|
|
267
|
+
requestId?: string;
|
|
261
268
|
}
|
|
262
269
|
/**
|
|
263
270
|
* 错误详情
|
|
@@ -272,6 +279,7 @@ interface ApiErrorDetail {
|
|
|
272
279
|
}
|
|
273
280
|
/**
|
|
274
281
|
* 错误响应
|
|
282
|
+
* 与 platform 仓库的 ErrorResponse 保持一致
|
|
275
283
|
*/
|
|
276
284
|
interface ApiErrorResponse {
|
|
277
285
|
/** 是否成功 */
|
|
@@ -280,14 +288,16 @@ interface ApiErrorResponse {
|
|
|
280
288
|
code: ErrorCode | string;
|
|
281
289
|
/** 错误消息(用户可读) */
|
|
282
290
|
message: string;
|
|
283
|
-
/**
|
|
284
|
-
|
|
291
|
+
/** 错误详情(验证错误时使用,放在 data 字段中) */
|
|
292
|
+
data?: ApiErrorDetail[] | Record<string, unknown>;
|
|
293
|
+
/** 响应时间戳(Unix 毫秒时间戳) */
|
|
294
|
+
timestamp: number;
|
|
295
|
+
/** 请求路径 */
|
|
296
|
+
path: string;
|
|
285
297
|
/** 请求 ID */
|
|
286
|
-
requestId
|
|
287
|
-
/** 链路追踪 ID */
|
|
298
|
+
requestId?: string;
|
|
299
|
+
/** 链路追踪 ID(可选,用于分布式追踪) */
|
|
288
300
|
traceId?: string;
|
|
289
|
-
/** 响应时间戳 */
|
|
290
|
-
timestamp: ISODateTime;
|
|
291
301
|
}
|
|
292
302
|
/**
|
|
293
303
|
* 统一 API 响应类型
|
package/dist/index.d.ts
CHANGED
|
@@ -248,16 +248,23 @@ declare function isDjvlcError(error: unknown): error is DjvlcError;
|
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
250
|
* 成功响应
|
|
251
|
+
* 与 platform 仓库的 BaseResponse 保持一致
|
|
251
252
|
*/
|
|
252
253
|
interface ApiSuccessResponse<T = unknown> {
|
|
253
254
|
/** 是否成功 */
|
|
254
255
|
success: true;
|
|
256
|
+
/** 业务状态码 */
|
|
257
|
+
code: string;
|
|
258
|
+
/** 响应消息 */
|
|
259
|
+
message: string;
|
|
255
260
|
/** 响应数据 */
|
|
256
261
|
data: T;
|
|
262
|
+
/** 响应时间戳(Unix 毫秒时间戳) */
|
|
263
|
+
timestamp: number;
|
|
264
|
+
/** 请求路径 */
|
|
265
|
+
path: string;
|
|
257
266
|
/** 请求 ID */
|
|
258
|
-
requestId
|
|
259
|
-
/** 响应时间戳 */
|
|
260
|
-
timestamp: ISODateTime;
|
|
267
|
+
requestId?: string;
|
|
261
268
|
}
|
|
262
269
|
/**
|
|
263
270
|
* 错误详情
|
|
@@ -272,6 +279,7 @@ interface ApiErrorDetail {
|
|
|
272
279
|
}
|
|
273
280
|
/**
|
|
274
281
|
* 错误响应
|
|
282
|
+
* 与 platform 仓库的 ErrorResponse 保持一致
|
|
275
283
|
*/
|
|
276
284
|
interface ApiErrorResponse {
|
|
277
285
|
/** 是否成功 */
|
|
@@ -280,14 +288,16 @@ interface ApiErrorResponse {
|
|
|
280
288
|
code: ErrorCode | string;
|
|
281
289
|
/** 错误消息(用户可读) */
|
|
282
290
|
message: string;
|
|
283
|
-
/**
|
|
284
|
-
|
|
291
|
+
/** 错误详情(验证错误时使用,放在 data 字段中) */
|
|
292
|
+
data?: ApiErrorDetail[] | Record<string, unknown>;
|
|
293
|
+
/** 响应时间戳(Unix 毫秒时间戳) */
|
|
294
|
+
timestamp: number;
|
|
295
|
+
/** 请求路径 */
|
|
296
|
+
path: string;
|
|
285
297
|
/** 请求 ID */
|
|
286
|
-
requestId
|
|
287
|
-
/** 链路追踪 ID */
|
|
298
|
+
requestId?: string;
|
|
299
|
+
/** 链路追踪 ID(可选,用于分布式追踪) */
|
|
288
300
|
traceId?: string;
|
|
289
|
-
/** 响应时间戳 */
|
|
290
|
-
timestamp: ISODateTime;
|
|
291
301
|
}
|
|
292
302
|
/**
|
|
293
303
|
* 统一 API 响应类型
|