/** * 规则引擎 API 配置 * * serviceName + path 由 apiInstance 生成完整的 basePrefix, * 最终请求路径为:/{serviceName}/{path}/具体操作 * * 示例:serviceName="userdb-manage", path="userdb/ruleEngine" * → basePrefix="/userdb-manage/userdb/ruleEngine" * → POST /userdb-manage/userdb/ruleEngine/executeByForm/{formId}?triggerEvent=xxx */ export interface RuleEngineApiConfig { serviceName: string; ruleDefinitionPath: string; ruleConditionPath: string; ruleActionPath: string; ruleSetPath: string; ruleSetItemPath: string; ruleVariablePath: string; ruleExecutionLogPath: string; ruleEnginePath: string; ruleVersionPath: string; } /** * 配置规则引擎 API 端点 * * 无状态 lib 库原则:所有后端交互必须通过此函数注入配置, * 不绑定任何特定业务的接口路径。 * * @example 完全自定义 * ```ts * import { configureRuleEngine } from "star-horse-form"; * configureRuleEngine({ * serviceName: "my-service", * ruleEnginePath: "api/v2/ruleEngine", * }); * ``` * * @example 仅改 serviceName,其余路径沿用默认 * ```ts * configureRuleEngine({ serviceName: "custom-gateway" }); * ``` */ export declare function configureRuleEngine(cfg: Partial): void; /** 获取当前规则引擎 API 配置(只读) */ export declare function getRuleEngineConfig(): Readonly; export declare const ruleDefinitionApi: { getRuleList: (params?: any) => Promise>; getRuleById: (id: string) => Promise>; saveRule: (data: any) => Promise>; updateRule: (data: any) => Promise>; deleteRule: (id: string) => Promise>; listByRuleType: (ruleType: string) => Promise>; listByFormId: (formId: string) => Promise>; getByRuleCode: (ruleCode: string) => Promise>; }; export declare const ruleConditionApi: { getConditionList: (params?: any) => Promise>; listByRuleId: (ruleId: string) => Promise>; saveCondition: (data: any) => Promise>; batchSaveConditions: (conditions: any[]) => Promise>; deleteCondition: (id: string) => Promise>; deleteByRuleId: (ruleId: string) => Promise>; }; export declare const ruleActionApi: { getActionList: (params?: any) => Promise>; listByRuleId: (ruleId: string) => Promise>; saveAction: (data: any) => Promise>; batchSaveActions: (actions: any[]) => Promise>; deleteAction: (id: string) => Promise>; deleteByRuleId: (ruleId: string) => Promise>; }; export declare const ruleSetApi: { getRuleSetList: (params?: any) => Promise>; getRuleSetById: (id: string) => Promise>; saveRuleSet: (data: any) => Promise>; updateRuleSet: (data: any) => Promise>; deleteRuleSet: (id: string) => Promise>; listBySetType: (setType: string) => Promise>; listByFormId: (formId: string) => Promise>; }; export declare const ruleSetItemApi: { getSetItemList: (params?: any) => Promise>; listBySetId: (setId: string) => Promise>; saveSetItem: (data: any) => Promise>; batchSaveSetItems: (items: any[]) => Promise>; deleteSetItem: (id: string) => Promise>; deleteBySetId: (setId: string) => Promise>; }; export declare const ruleVariableApi: { getVariableList: (params?: any) => Promise>; getByVariableCode: (code: string) => Promise>; listByFormId: (formId: string) => Promise>; saveVariable: (data: any) => Promise>; updateVariable: (data: any) => Promise>; deleteVariable: (id: string) => Promise>; }; export declare const ruleExecutionLogApi: { getLogList: (params?: any) => Promise>; listByRuleId: (ruleId: string) => Promise>; listBySetId: (setId: string) => Promise>; listByFormId: (formId: string) => Promise>; }; export declare const ruleEngineApi: { executeRule: (ruleId: string, context: any) => Promise>; executeRuleSet: (setId: string, context: any) => Promise>; executeByForm: (formId: string, triggerEvent: string, context: any) => Promise>; }; export declare const ruleVersionApi: { getVersionList: (params?: any) => Promise>; listByRuleId: (ruleId: string) => Promise>; getByRuleIdAndVersion: (ruleId: string, version: number) => Promise>; getPublishedVersion: (ruleId: string) => Promise>; publishVersion: (versionId: string) => Promise>; getVersionById: (id: string) => Promise>; saveVersion: (data: any) => Promise>; updateVersion: (data: any) => Promise>; deleteVersion: (id: string) => Promise>; };