@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarch/contract",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "yarch 前端契约 SDK(三端同源 MP4):信封解包/错误码表/ApiError 四要素/traceId 会话复用/401 刷新重放——@yarch/contract/core 零环境依赖,/wx 微信小程序适配,主入口含微前端运行时件",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,4 +1,4 @@
1
- /** 错误码常量表 —— 与 contract/api/error-codes.md v1.0 同源(0/1xxx/2xxx 归 yarch;3xxx+ 业务侧扩展) */
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];
@@ -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;