@lovrabet/sdk 1.2.4 → 1.2.6

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/LICENSE CHANGED
@@ -51,7 +51,7 @@
51
51
  如有疑问或需要商业授权,请联系:
52
52
  - 网站:https://www.lovrabet.com
53
53
  - 邮箱:support@lovrabet.com
54
- - 文档:https://docs.lovrabet.com
54
+ - 文档:https://help.lovrabet.com
55
55
 
56
56
  ---
57
57
 
package/README.md CHANGED
@@ -570,18 +570,6 @@ const result = await client.models.users.filter({
570
570
  });
571
571
  ```
572
572
 
573
- #### filter vs getList
574
-
575
- | 特性 | `filter()` | `getList()` |
576
- |------|-----------|------------|
577
- | 复杂条件查询 | ✅ 支持 $and, $or 等 | ❌ 仅支持简单参数 |
578
- | 字段选择 | ✅ 支持 select | ❌ 返回所有字段 |
579
- | 条件操作符 | ✅ 支持 11 种操作符 | ❌ 仅支持精确匹配 |
580
- | 排序 | ✅ 支持多字段排序 | ✅ 支持多字段排序 |
581
- | 分页 | ✅ 支持 | ✅ 支持 |
582
- | 性能 | 更优(减少数据传输) | 一般 |
583
- | 使用场景 | **推荐用于复杂查询** | 简单列表查询 |
584
-
585
573
  ### ⚠️ 操作限制
586
574
 
587
575
  **OpenAPI 模式暂不支持以下操作:**
@@ -657,6 +645,33 @@ const client = createClient({ token });
657
645
 
658
646
  ## 📝 What's New
659
647
 
648
+ ### v1.2.5 (2026-01-02)
649
+
650
+ **错误处理增强 (Error Handling):**
651
+
652
+ - 🤖 **AI 友好的错误信息** - `LovrabetError` 新增 `description` 字段,提供 LLM 可理解的错误描述和修复建议
653
+
654
+ ```typescript
655
+ try {
656
+ await client.models.users.create({ invalid_field: 'value' });
657
+ } catch (error) {
658
+ if (error instanceof LovrabetError) {
659
+ console.log(error.message); // "invalid_field列不存在"
660
+ console.log(error.code); // "SERVER_ERROR"
661
+ console.log(error.description); // "服务端返回错误: invalid_field列不存在。错误类型: 参数错误。状态码: 400。建议: 字段 \"invalid_field\" 不存在,请检查字段名是否拼写正确; 使用 MCP 工具获取数据集的正确字段列表"
662
+ }
663
+ }
664
+ ```
665
+
666
+ **错误类型覆盖:**
667
+ - `MODEL_NOT_FOUND` - 模型不存在,提供可用模型列表
668
+ - `CONFIG_NOT_FOUND` - 配置不存在,提供已注册配置列表
669
+ - `SERVER_ERROR` - 服务端参数错误,提供字段修复建议
670
+ - `401 权限不足` - 登录过期/appCode无权限/HTTPS/CORS 等建议
671
+ - `TIMEOUT` - 请求超时,提供超时配置建议
672
+
673
+ ---
674
+
660
675
  ### v1.2.2 (2025-12-30)
661
676
 
662
677
  **重大更新 (Major Changes):**
package/dist/index.d.ts CHANGED
@@ -8,6 +8,6 @@ export { ApiNamespace } from "./src/api/index";
8
8
  export { AuthManager, } from "./src/auth/index";
9
9
  export { generateOpenApiToken, TokenGenerator, isTokenExpiring, getTokenRemainingTime, type GenerateTokenParams, type TokenResult } from "./src/auth/index";
10
10
  export type { ClientConfig, LovrabetClient, ModelConfig, ModelsConfig, } from "./src/types/index";
11
- export type { ListParams, ListResponse, FilterParams, WhereCondition, FieldCondition, ConditionOperator, Environment, BaseModelMethods, SortList, SelectOption, SelectOptionsParams, } from "./src/types/index";
11
+ export type { ListParams, ListResponse, FilterParams, WhereCondition, FieldCondition, ConditionOperator, Environment, BaseModelMethods, SortList, SelectOption, SelectOptionsParams, AggregateParams, AggregateField, HavingCondition, } from "./src/types/index";
12
12
  export type { SqlExecuteRequest, SqlExecuteResult, } from "./src/api/types";
13
13
  export { SortOrder, } from "./src/types/index";