@lovrabet/sdk 1.2.4 → 1.2.5-beta.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.
|
@@ -23,9 +23,15 @@ export declare class ModelManager implements IModelManager {
|
|
|
23
23
|
* 解析访问名称,返回 datasetCode
|
|
24
24
|
* @param accessName 访问名称,可能是 dataset_{datasetCode} 格式或 alias
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
* 1. dataset_{
|
|
28
|
-
* 2. alias -
|
|
26
|
+
* 解析优先级:
|
|
27
|
+
* 1. dataset_{xxx} 前缀格式 - 去掉前缀后查 datasetCodeMap
|
|
28
|
+
* 2. alias - 用户自定义的别名(包括以 dataset_ 开头的 alias)
|
|
29
|
+
* 3. 无配置时动态创建 - 仅当 datasetCodeMap 为空时允许
|
|
30
|
+
*
|
|
31
|
+
* 规则:
|
|
32
|
+
* - 存在就正常访问
|
|
33
|
+
* - 有配置但不存在,返回 undefined 以便抛出友好错误
|
|
34
|
+
* - 无配置时允许动态创建(用于无预配置场景)
|
|
29
35
|
*/
|
|
30
36
|
private resolveDatasetCode;
|
|
31
37
|
/**
|
|
@@ -17,12 +17,12 @@ export declare class OpenApiModel extends AbstractBaseModel {
|
|
|
17
17
|
protected buildRequestBody(method: string, data: any, sortList?: SortList): any;
|
|
18
18
|
/**
|
|
19
19
|
* OpenAPI 模式暂不支持 delete 操作
|
|
20
|
-
* @throws
|
|
20
|
+
* @throws LovrabetError 当尝试调用 delete 时抛出错误
|
|
21
21
|
*/
|
|
22
22
|
delete(): Promise<void>;
|
|
23
23
|
/**
|
|
24
24
|
* OpenAPI 模式暂不支持 excelExport 操作
|
|
25
|
-
* @throws
|
|
25
|
+
* @throws LovrabetError 当尝试调用 excelExport 时抛出错误
|
|
26
26
|
*/
|
|
27
27
|
excelExport(params?: any): Promise<any>;
|
|
28
28
|
}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
export type ErrorDescription = string | Record<string, unknown> | unknown[];
|
|
1
2
|
export declare class LovrabetError extends Error {
|
|
2
3
|
readonly status?: number;
|
|
3
4
|
readonly code?: string;
|
|
4
5
|
readonly response?: any;
|
|
5
|
-
|
|
6
|
+
readonly description?: ErrorDescription;
|
|
7
|
+
constructor(message: string, options?: {
|
|
8
|
+
status?: number;
|
|
9
|
+
code?: string;
|
|
10
|
+
response?: any;
|
|
11
|
+
description?: ErrorDescription;
|
|
12
|
+
});
|
|
6
13
|
toJSON(): {
|
|
7
14
|
name: string;
|
|
8
15
|
message: string;
|
|
9
16
|
status: number;
|
|
10
17
|
code: string;
|
|
11
18
|
response: any;
|
|
19
|
+
description: ErrorDescription;
|
|
12
20
|
};
|
|
13
21
|
}
|
|
14
22
|
export declare function createErrorHandler(onError?: (error: any) => void): (error: any) => Promise<never>;
|