@lovrabet/sdk 1.2.0-beta.2 → 1.2.2

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.
@@ -1,4 +1,4 @@
1
- import type { ClientConfig, LovrabetClient as ILovrabetClient, Environment } from '../types';
1
+ import type { ClientConfig, LovrabetClient as ILovrabetClient, Environment, BaseModelMethods } from '../types';
2
2
  import { ApiNamespace } from '../api';
3
3
  /**
4
4
  * Lovrabet SDK 核心客户端类
@@ -21,7 +21,9 @@ export declare class LovrabetClient implements ILovrabetClient {
21
21
  * 模型访问 Proxy - 纯粹的语法糖,支持 client.models.ModelName 访问
22
22
  * 内部调用 client.getModel() 方法,避免命名冲突
23
23
  */
24
- models: any;
24
+ models: {
25
+ [modelName: string]: BaseModelMethods;
26
+ };
25
27
  /**
26
28
  * API 命名空间 - 提供通用 API 调用(SQL、Function 等)
27
29
  */
@@ -99,7 +101,7 @@ export declare class LovrabetClient implements ILovrabetClient {
99
101
  * 2. 支持按索引快速获取第一个模型,便于演示和快速开发
100
102
  * 3. 作为 models.xxx 语法糖的底层实现
101
103
  */
102
- getModel(indexOrName: number | string): import("../types").BaseModelMethods;
104
+ getModel(indexOrName: number | string): BaseModelMethods;
103
105
  /**
104
106
  * 检查当前是否为 OpenAPI 模式
105
107
  * 为什么提供这个方法:
@@ -7,7 +7,7 @@
7
7
  * 3. 简化 API - 让 createClient() 可以无参数调用
8
8
  * 4. 类型安全 - 通过命名常量避免字符串拼写错误
9
9
  */
10
- import { ModelsConfig } from '../types';
10
+ import type { ModelsConfig } from '../types';
11
11
  /**
12
12
  * 注册模型配置
13
13
  *
@@ -182,6 +182,8 @@ export interface ModelConfig {
182
182
  name?: string;
183
183
  /** 别名,用于人类友好的访问方式(可选) */
184
184
  alias?: string;
185
+ /** 数据库名称(可选,用于区分不同数据库中的同名表) */
186
+ dbName?: string;
185
187
  }
186
188
  /**
187
189
  * 模型配置集合接口
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/sdk",
3
- "version": "1.2.0-beta.2",
3
+ "version": "1.2.2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",