@yarch/contract 0.3.0 → 0.3.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/package.json +1 -1
- package/src/error-codes.ts +2 -1
- package/src/rest-response.ts +6 -0
package/package.json
CHANGED
package/src/error-codes.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** 错误码常量表 —— 与 contract/api/error-codes.md v1.
|
|
1
|
+
/** 错误码常量表 —— 与 contract/api/error-codes.md v1.1 同源(0/1xxx/2xxx 归 yarch;3xxx+ 业务侧扩展) */
|
|
2
2
|
export const CODE_SUCCESS = 0;
|
|
3
3
|
|
|
4
4
|
export const errorCodes = {
|
|
@@ -15,6 +15,7 @@ export const errorCodes = {
|
|
|
15
15
|
CREDENTIALS_EXPIRED: 2002,
|
|
16
16
|
FORBIDDEN: 2003,
|
|
17
17
|
ACCOUNT_DISABLED: 2004,
|
|
18
|
+
CAPTCHA_INVALID: 2005,
|
|
18
19
|
} as const;
|
|
19
20
|
|
|
20
21
|
export type YarchErrorCode = (typeof errorCodes)[keyof typeof errorCodes];
|
package/src/rest-response.ts
CHANGED
|
@@ -8,6 +8,12 @@ export interface RestResponse<T> {
|
|
|
8
8
|
traceId: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
/** 分页查询参数(rest-conventions D6:1-based,pageSize 1~100;校验在服务端,前端仅形状——rust/python 内核同形) */
|
|
12
|
+
export interface PageQuery {
|
|
13
|
+
page: number;
|
|
14
|
+
pageSize: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
export interface PageData<T> {
|
|
12
18
|
list: T[];
|
|
13
19
|
total: number;
|