@lovrabet/sdk 1.6.1-beta.2 → 1.6.1-beta.3
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/dist/index.d.ts +71 -20
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ declare class HttpClient {
|
|
|
20
20
|
* 通用的错误处理包装器
|
|
21
21
|
*/
|
|
22
22
|
private executeWithErrorHandling;
|
|
23
|
+
/** Apply the request deadline until response parsing finishes, preserving caller cancellation. */
|
|
24
|
+
private withTimeout;
|
|
23
25
|
/**
|
|
24
26
|
* 通用的fetch请求方法(用于PUT/DELETE等没有专门优化函数的方法)
|
|
25
27
|
*/
|
|
@@ -257,12 +259,14 @@ declare class DatasetMetaClient {
|
|
|
257
259
|
}
|
|
258
260
|
|
|
259
261
|
/**
|
|
260
|
-
* 登录用户信息(后端 `UserSessionHolder.getUser()
|
|
262
|
+
* 登录用户信息(后端 `UserSessionHolder.getUser()` 返回的 `User`)。
|
|
261
263
|
*/
|
|
262
264
|
interface LoginUserInfo {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
265
|
+
id?: string;
|
|
266
|
+
userId?: number;
|
|
267
|
+
username?: string;
|
|
268
|
+
nickname?: string;
|
|
269
|
+
name?: string | null;
|
|
266
270
|
mobile?: string;
|
|
267
271
|
email?: string;
|
|
268
272
|
avatar?: string;
|
|
@@ -308,6 +312,12 @@ interface NotificationChannelConfig {
|
|
|
308
312
|
channelType?: string;
|
|
309
313
|
description?: string;
|
|
310
314
|
}
|
|
315
|
+
/** Client AK 应用/用户接口配置;身份查询不需要 appCode。 */
|
|
316
|
+
type AppClientConfig = Pick<ClientConfig, 'appCode' | 'runtimeDomain' | 'serverUrl' | 'env' | 'region' | 'options'> & {
|
|
317
|
+
accessKey: string;
|
|
318
|
+
};
|
|
319
|
+
/** 创建应用/用户客户端,适用于尚未选定应用的身份查询。 */
|
|
320
|
+
declare function createAppClient(config: AppClientConfig): AppClient;
|
|
311
321
|
/**
|
|
312
322
|
* 应用与用户配置客户端(仅 client-ak 模式)。
|
|
313
323
|
*
|
|
@@ -318,7 +328,7 @@ declare class AppClient {
|
|
|
318
328
|
private readonly httpClient;
|
|
319
329
|
private readonly appCode;
|
|
320
330
|
private readonly authMode;
|
|
321
|
-
constructor(httpClient: HttpClient, appCode: string, authMode: AuthMode);
|
|
331
|
+
constructor(httpClient: HttpClient, appCode: string | undefined, authMode: AuthMode);
|
|
322
332
|
/** 当前用户可见的应用(`GET /client/app/my-apps`) */
|
|
323
333
|
myApps(): Promise<SmartApp[]>;
|
|
324
334
|
/** 当前登录用户信息(`GET /client/user/loginUserInfo`) */
|
|
@@ -330,6 +340,7 @@ declare class AppClient {
|
|
|
330
340
|
/** 查询通知渠道配置(`GET /client/notification/channel-config/list`) */
|
|
331
341
|
listNotificationChannels(channelType?: string): Promise<NotificationChannelConfig[]>;
|
|
332
342
|
private assertMode;
|
|
343
|
+
private requireAppCode;
|
|
333
344
|
}
|
|
334
345
|
|
|
335
346
|
/**
|
|
@@ -2026,8 +2037,10 @@ interface ClientConfig {
|
|
|
2026
2037
|
apiConfigName?: string;
|
|
2027
2038
|
/** 额外配置选项 */
|
|
2028
2039
|
options?: {
|
|
2029
|
-
/**
|
|
2040
|
+
/** 请求超时时间(毫秒),包含响应体读取;未配置时保留原行为(PUT/DELETE 默认 30000,其他不限时)。 */
|
|
2030
2041
|
timeout?: number;
|
|
2042
|
+
/** Fetch 重定向策略;未配置时沿用 Fetch 默认行为。 */
|
|
2043
|
+
redirect?: RequestRedirect;
|
|
2031
2044
|
/** 重试次数 */
|
|
2032
2045
|
retryCount?: number;
|
|
2033
2046
|
/** 错误处理回调函数 */
|
|
@@ -3000,23 +3013,26 @@ declare class LovrabetError extends Error {
|
|
|
3000
3013
|
readonly status?: number;
|
|
3001
3014
|
readonly code?: string;
|
|
3002
3015
|
readonly response?: any;
|
|
3016
|
+
readonly retryAfter?: string;
|
|
3003
3017
|
readonly description?: ErrorDescription;
|
|
3004
3018
|
readonly cause?: unknown;
|
|
3005
3019
|
constructor(message: string, options?: {
|
|
3006
3020
|
status?: number;
|
|
3007
3021
|
code?: string;
|
|
3008
3022
|
response?: any;
|
|
3023
|
+
retryAfter?: string;
|
|
3009
3024
|
description?: ErrorDescription;
|
|
3010
3025
|
cause?: unknown;
|
|
3011
3026
|
});
|
|
3012
3027
|
toJSON(): {
|
|
3028
|
+
description: ErrorDescription;
|
|
3029
|
+
cause: unknown;
|
|
3030
|
+
retryAfter?: string;
|
|
3013
3031
|
name: string;
|
|
3014
3032
|
message: string;
|
|
3015
3033
|
status: number;
|
|
3016
3034
|
code: string;
|
|
3017
3035
|
response: any;
|
|
3018
|
-
description: ErrorDescription;
|
|
3019
|
-
cause: unknown;
|
|
3020
3036
|
};
|
|
3021
3037
|
}
|
|
3022
3038
|
|
|
@@ -3277,6 +3293,25 @@ declare class WebApiModel extends AbstractBaseModel {
|
|
|
3277
3293
|
protected buildRequestBody(method: string, data: any, sortList?: SortList): any;
|
|
3278
3294
|
}
|
|
3279
3295
|
|
|
3296
|
+
/** 导入协商结果(后端 DatasetImportService.contract)。 */
|
|
3297
|
+
interface DatasetImportContract {
|
|
3298
|
+
schemaVersion: number;
|
|
3299
|
+
strategy: string;
|
|
3300
|
+
source: string;
|
|
3301
|
+
appCode: string;
|
|
3302
|
+
datasetCode: string;
|
|
3303
|
+
actorId: string;
|
|
3304
|
+
schemaFingerprint: string;
|
|
3305
|
+
maxBatchSize: number;
|
|
3306
|
+
maxBatchBytes: number;
|
|
3307
|
+
imageImport?: {
|
|
3308
|
+
version: number;
|
|
3309
|
+
maxFileBytes: number;
|
|
3310
|
+
maxPixels: number;
|
|
3311
|
+
types: string[];
|
|
3312
|
+
uploadId: string;
|
|
3313
|
+
};
|
|
3314
|
+
}
|
|
3280
3315
|
/**
|
|
3281
3316
|
* 可恢复导入的批次请求体(后端 `import-batch`)。
|
|
3282
3317
|
*
|
|
@@ -3284,20 +3319,27 @@ declare class WebApiModel extends AbstractBaseModel {
|
|
|
3284
3319
|
* 传入 `taskId` 时走 auto-id 分支。
|
|
3285
3320
|
*/
|
|
3286
3321
|
interface DatasetImportBatchRequest {
|
|
3287
|
-
schemaFingerprint
|
|
3322
|
+
schemaFingerprint: string;
|
|
3288
3323
|
items: Record<string, unknown>[];
|
|
3289
|
-
|
|
3324
|
+
/** 正安全整数,以 JSON 数字发送。 */
|
|
3325
|
+
taskId?: number;
|
|
3290
3326
|
}
|
|
3291
3327
|
/**
|
|
3292
3328
|
* 可恢复导入的批次响应(后端返回 `{ ids, count }`)。
|
|
3293
3329
|
*/
|
|
3294
3330
|
interface DatasetImportBatchResult {
|
|
3295
|
-
ids:
|
|
3331
|
+
ids: number[];
|
|
3296
3332
|
count: number;
|
|
3297
3333
|
}
|
|
3298
|
-
/**
|
|
3299
|
-
|
|
3300
|
-
|
|
3334
|
+
/** 回读请求只允许 ids 或 taskId;ID 均须为安全整数。 */
|
|
3335
|
+
type DatasetImportReadbackRequest = {
|
|
3336
|
+
ids: number[];
|
|
3337
|
+
taskId?: never;
|
|
3338
|
+
} | {
|
|
3339
|
+
taskId: number;
|
|
3340
|
+
ids?: never;
|
|
3341
|
+
};
|
|
3342
|
+
/** 导入回读结果。 */
|
|
3301
3343
|
interface DatasetImportReadbackResult<T = Record<string, unknown>> {
|
|
3302
3344
|
items: T[];
|
|
3303
3345
|
}
|
|
@@ -3319,6 +3361,15 @@ interface DatasetImportImageReadbackRequest {
|
|
|
3319
3361
|
type: string;
|
|
3320
3362
|
size: number;
|
|
3321
3363
|
}
|
|
3364
|
+
/** 图片上传及回读结果;missing 时仅返回 status 和 contentHash。 */
|
|
3365
|
+
interface DatasetImportImageResult {
|
|
3366
|
+
status: 'succeeded' | 'missing';
|
|
3367
|
+
contentHash: string;
|
|
3368
|
+
filePath?: string;
|
|
3369
|
+
fileName?: string;
|
|
3370
|
+
type?: string;
|
|
3371
|
+
size?: number;
|
|
3372
|
+
}
|
|
3322
3373
|
/**
|
|
3323
3374
|
* Client AK 模型实现
|
|
3324
3375
|
*
|
|
@@ -3336,15 +3387,15 @@ declare class ClientAkModel extends AbstractBaseModel {
|
|
|
3336
3387
|
protected getApiPath(sdkMethod: string): string;
|
|
3337
3388
|
protected buildRequestBody(method: string, data: any, sortList?: SortList): any;
|
|
3338
3389
|
/** 导入契约(`GET /client/{appCode}/{datasetCode}/import-contract`) */
|
|
3339
|
-
importContract<T =
|
|
3390
|
+
importContract<T = DatasetImportContract>(): Promise<T>;
|
|
3340
3391
|
/** 批量导入(`POST /client/{appCode}/{datasetCode}/import-batch`) */
|
|
3341
3392
|
importBatch(request: DatasetImportBatchRequest): Promise<DatasetImportBatchResult>;
|
|
3342
3393
|
/** 回读导入结果(`POST /client/{appCode}/{datasetCode}/import-readback`) */
|
|
3343
|
-
importReadback<T = Record<string, unknown>>(
|
|
3394
|
+
importReadback<T = Record<string, unknown>>(request: number[] | DatasetImportReadbackRequest): Promise<DatasetImportReadbackResult<T>>;
|
|
3344
3395
|
/** 上传导入图片(`POST /client/{appCode}/{datasetCode}/import-image`,multipart) */
|
|
3345
|
-
importImage<T =
|
|
3396
|
+
importImage<T = DatasetImportImageResult>(request: DatasetImportImageRequest): Promise<T>;
|
|
3346
3397
|
/** 回读导入图片(`POST /client/{appCode}/{datasetCode}/import-image-readback`) */
|
|
3347
|
-
importImageReadback<T =
|
|
3398
|
+
importImageReadback<T = DatasetImportImageResult>(request: DatasetImportImageReadbackRequest): Promise<T>;
|
|
3348
3399
|
private importPath;
|
|
3349
3400
|
}
|
|
3350
3401
|
|
|
@@ -3537,5 +3588,5 @@ declare const isTokenExpiring: typeof isTokenExpiring$1;
|
|
|
3537
3588
|
*/
|
|
3538
3589
|
declare const getTokenRemainingTime: typeof getTokenRemainingTime$1;
|
|
3539
3590
|
|
|
3540
|
-
export { API_PATHS, AbstractBaseModel, ApiNamespace, AppClient, ApprovalClient, ArtifactClient, AuthManager, CONFIG_NAMES, ClientAkBffClient, ClientAkModel, ClientAkSqlClient, DEFAULTS, DatasetMetaClient, ENVIRONMENTS, ERROR_MESSAGES, FileClient, HTTP_STATUS, LovrabetError, LovrabetFlowClient, ManagementClient, ModelFactory, OCR_TYPES, OcrClient, OcrType, OpenApiModel, PermitClient, PersonalBffClient, PersonalNamespace, REGIONS, ServicesNamespace, SortOrder, TokenGenerator, WebApiModel, clearAllRegistrations, createClient, generateFlowOpenApiToken, generateOpenApiToken, getApiEndpoint, getAvailableEnvironments, getAvailableRegions, getRegisteredConfigNames, getRegisteredModels, getTokenRemainingTime, isTokenExpiring, registerModels, safe, sqlSafe, unregisterModels };
|
|
3541
|
-
export type { AggregateField, AggregateParams, AppDatasetActionRolePermitVO, AppDatasetPermitVO, AppDatasetRolePermitVO, AppEmployee, AppMenuPermitVO, AppPermitBaseVO, AppResourceMenuParam, AppRoleCreateParam, AppRolePermitQueryParam, AppRoleRequest, AppRoleUpdateParam, AppRoleUserVO, AppRoleVO, AppUserBaseVO, ApprovalFlowApproveRequest, ApprovalFlowIdentityLink, ApprovalFlowTaskDetail, ApprovalFlowTaskItem, ApprovalFlowTransferCandidate, ApprovalFlowTransferRequest, ApprovalTodoQuery, ArtifactListQuery, ArtifactUpsertRequest, AuthMode, BaseModelMethods, BaseRoleVO, ClientAkBffExecuteRequest, ClientConfig, ConditionOperator, CustomSqlQueryRequest, DataList, DatasetDrivenDataQuery, DatasetImportBatchRequest, DatasetImportBatchResult, DatasetImportImageReadbackRequest, DatasetImportImageRequest, DatasetImportReadbackResult, DatasetMeta, DatasetPermitListVO, DatasetRequest, DatasetRolePermitListVO, EndpointScriptSummary, Environment$1 as Environment, FieldCondition, FileQueryUrlRequest, FileService, FileUploadRequest, FileUploadResponse, FileUrlResponse, FilterParams, FlowBatchTaskActionRequest, FlowBatchTransferRequest, FlowCcQuery, FlowCcRequest, FlowCustomPageCcDetail, FlowCustomPageDefinition, FlowCustomPageStartResponse, FlowCustomPageSubmittedProcess, FlowCustomPageTaskDetail, FlowCustomPageTaskItem, FlowCustomPageTimeline, FlowDefinitionQuery, FlowPage, FlowPageQuery, FlowProcessReasonRequest, FlowRecord, FlowResubmitRequest, FlowReturnRequest, FlowReturnTarget, FlowStartRequest, FlowSubmittedQuery, FlowTaskActionRequest, FlowTransferRequest, FlowUpdateVariablesRequest, FlowVariableProjectionQuery, FlowVariableQuery, GenerateFlowTokenParams, GenerateTokenParams, HavingCondition, ListParams, ListResponse, LoginUserInfo, LovrabetClient$1 as LovrabetClient, LovrabetPersonal, LovrabetServices, MenuPermitDTO, MenuRolePermitListVO, MenuRolePermitNodeVO, ModelConfig, ModelsConfig, NotificationChannelConfig, OcrRecognizeRequest, OcrRecognizeResponse, OcrService, PageResult, Paging$1 as Paging, PersonalBffExecuteRequest, PersonalBffScript, PersonalBffService, PersonalBffUpsertRequest, PersonalRequestOptions, Region, ResourcePermitDTO, ResourcePermitParam, RoleUserUpdateParam, RuntimeArtifactDTO, RuntimeIdentityPermission, SafeResult, ScriptDefinition, ScriptLogQuery, SelectOption, SelectOptionsParams, ServiceRequestOptions, SmartApp, SortList, SqlExecuteRequest, SqlExecuteResult, SqlSafeResult, TokenResult, UserAccountBindRequest, UserAppRelation, UserAppRelationQueryParam, UserCustomSqlDTO, WhereCondition };
|
|
3591
|
+
export { API_PATHS, AbstractBaseModel, ApiNamespace, AppClient, ApprovalClient, ArtifactClient, AuthManager, CONFIG_NAMES, ClientAkBffClient, ClientAkModel, ClientAkSqlClient, DEFAULTS, DatasetMetaClient, ENVIRONMENTS, ERROR_MESSAGES, FileClient, HTTP_STATUS, LovrabetError, LovrabetFlowClient, ManagementClient, ModelFactory, OCR_TYPES, OcrClient, OcrType, OpenApiModel, PermitClient, PersonalBffClient, PersonalNamespace, REGIONS, ServicesNamespace, SortOrder, TokenGenerator, WebApiModel, clearAllRegistrations, createAppClient, createClient, generateFlowOpenApiToken, generateOpenApiToken, getApiEndpoint, getAvailableEnvironments, getAvailableRegions, getRegisteredConfigNames, getRegisteredModels, getTokenRemainingTime, isTokenExpiring, registerModels, safe, sqlSafe, unregisterModels };
|
|
3592
|
+
export type { AggregateField, AggregateParams, AppClientConfig, AppDatasetActionRolePermitVO, AppDatasetPermitVO, AppDatasetRolePermitVO, AppEmployee, AppMenuPermitVO, AppPermitBaseVO, AppResourceMenuParam, AppRoleCreateParam, AppRolePermitQueryParam, AppRoleRequest, AppRoleUpdateParam, AppRoleUserVO, AppRoleVO, AppUserBaseVO, ApprovalFlowApproveRequest, ApprovalFlowIdentityLink, ApprovalFlowTaskDetail, ApprovalFlowTaskItem, ApprovalFlowTransferCandidate, ApprovalFlowTransferRequest, ApprovalTodoQuery, ArtifactListQuery, ArtifactUpsertRequest, AuthMode, BaseModelMethods, BaseRoleVO, ClientAkBffExecuteRequest, ClientConfig, ConditionOperator, CustomSqlQueryRequest, DataList, DatasetDrivenDataQuery, DatasetImportBatchRequest, DatasetImportBatchResult, DatasetImportContract, DatasetImportImageReadbackRequest, DatasetImportImageRequest, DatasetImportImageResult, DatasetImportReadbackRequest, DatasetImportReadbackResult, DatasetMeta, DatasetPermitListVO, DatasetRequest, DatasetRolePermitListVO, EndpointScriptSummary, Environment$1 as Environment, FieldCondition, FileQueryUrlRequest, FileService, FileUploadRequest, FileUploadResponse, FileUrlResponse, FilterParams, FlowBatchTaskActionRequest, FlowBatchTransferRequest, FlowCcQuery, FlowCcRequest, FlowCustomPageCcDetail, FlowCustomPageDefinition, FlowCustomPageStartResponse, FlowCustomPageSubmittedProcess, FlowCustomPageTaskDetail, FlowCustomPageTaskItem, FlowCustomPageTimeline, FlowDefinitionQuery, FlowPage, FlowPageQuery, FlowProcessReasonRequest, FlowRecord, FlowResubmitRequest, FlowReturnRequest, FlowReturnTarget, FlowStartRequest, FlowSubmittedQuery, FlowTaskActionRequest, FlowTransferRequest, FlowUpdateVariablesRequest, FlowVariableProjectionQuery, FlowVariableQuery, GenerateFlowTokenParams, GenerateTokenParams, HavingCondition, ListParams, ListResponse, LoginUserInfo, LovrabetClient$1 as LovrabetClient, LovrabetPersonal, LovrabetServices, MenuPermitDTO, MenuRolePermitListVO, MenuRolePermitNodeVO, ModelConfig, ModelsConfig, NotificationChannelConfig, OcrRecognizeRequest, OcrRecognizeResponse, OcrService, PageResult, Paging$1 as Paging, PersonalBffExecuteRequest, PersonalBffScript, PersonalBffService, PersonalBffUpsertRequest, PersonalRequestOptions, Region, ResourcePermitDTO, ResourcePermitParam, RoleUserUpdateParam, RuntimeArtifactDTO, RuntimeIdentityPermission, SafeResult, ScriptDefinition, ScriptLogQuery, SelectOption, SelectOptionsParams, ServiceRequestOptions, SmartApp, SortList, SqlExecuteRequest, SqlExecuteResult, SqlSafeResult, TokenResult, UserAccountBindRequest, UserAppRelation, UserAppRelationQueryParam, UserCustomSqlDTO, WhereCondition };
|