@huanban/rulego-editor-core 1.3.18 → 1.4.0
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/README.md +153 -2
- package/assets/images/discovery-dark.svg +1 -0
- package/assets/images/discovery.svg +1 -0
- package/assets/images/nacos-dark.svg +1 -0
- package/assets/images/nacos.svg +1 -0
- package/assets/theme-icons/ant-blue/discovery-dark.svg +1 -0
- package/assets/theme-icons/ant-blue/discovery.svg +1 -0
- package/assets/theme-icons/ant-blue/nacos-dark.svg +1 -0
- package/assets/theme-icons/ant-blue/nacos.svg +1 -0
- package/assets/theme-icons/apple/discovery-dark.svg +1 -0
- package/assets/theme-icons/apple/discovery.svg +1 -0
- package/assets/theme-icons/apple/nacos-dark.svg +1 -0
- package/assets/theme-icons/apple/nacos.svg +1 -0
- package/assets/theme-icons/colorful/discovery-dark.svg +1 -0
- package/assets/theme-icons/colorful/discovery.svg +1 -0
- package/assets/theme-icons/colorful/nacos-dark.svg +1 -0
- package/assets/theme-icons/colorful/nacos.svg +1 -0
- package/assets/theme-icons/dark/discovery-dark.svg +1 -0
- package/assets/theme-icons/dark/discovery.svg +1 -0
- package/assets/theme-icons/dark/nacos-dark.svg +1 -0
- package/assets/theme-icons/dark/nacos.svg +1 -0
- package/assets/theme-icons/default/discovery-dark.svg +1 -0
- package/assets/theme-icons/default/discovery.svg +1 -0
- package/assets/theme-icons/default/nacos-dark.svg +1 -0
- package/assets/theme-icons/default/nacos.svg +1 -0
- package/assets/theme-icons/elegant/discovery-dark.svg +1 -0
- package/assets/theme-icons/elegant/discovery.svg +1 -0
- package/assets/theme-icons/elegant/nacos-dark.svg +1 -0
- package/assets/theme-icons/elegant/nacos.svg +1 -0
- package/assets/theme-icons/github/discovery-dark.svg +1 -0
- package/assets/theme-icons/github/discovery.svg +1 -0
- package/assets/theme-icons/github/nacos-dark.svg +1 -0
- package/assets/theme-icons/github/nacos.svg +1 -0
- package/assets/theme-icons/icon-theme-manifest.json +30 -14
- package/assets/theme-icons/icon-theme-overview.svg +1599 -1287
- package/assets/theme-icons/material/discovery-dark.svg +1 -0
- package/assets/theme-icons/material/discovery.svg +1 -0
- package/assets/theme-icons/material/nacos-dark.svg +1 -0
- package/assets/theme-icons/material/nacos.svg +1 -0
- package/assets/theme-icons/modern/discovery-dark.svg +1 -0
- package/assets/theme-icons/modern/discovery.svg +1 -0
- package/assets/theme-icons/modern/nacos-dark.svg +1 -0
- package/assets/theme-icons/modern/nacos.svg +1 -0
- package/assets/theme-icons/nature/discovery-dark.svg +1 -0
- package/assets/theme-icons/nature/discovery.svg +1 -0
- package/assets/theme-icons/nature/nacos-dark.svg +1 -0
- package/assets/theme-icons/nature/nacos.svg +1 -0
- package/assets/theme-icons/tailwind/discovery-dark.svg +1 -0
- package/assets/theme-icons/tailwind/discovery.svg +1 -0
- package/assets/theme-icons/tailwind/nacos-dark.svg +1 -0
- package/assets/theme-icons/tailwind/nacos.svg +1 -0
- package/assets/theme-icons/tech/discovery-dark.svg +1 -0
- package/assets/theme-icons/tech/discovery.svg +1 -0
- package/assets/theme-icons/tech/nacos-dark.svg +1 -0
- package/assets/theme-icons/tech/nacos.svg +1 -0
- package/assets/theme-icons/vscode/discovery-dark.svg +1 -0
- package/assets/theme-icons/vscode/discovery.svg +1 -0
- package/assets/theme-icons/vscode/nacos-dark.svg +1 -0
- package/assets/theme-icons/vscode/nacos.svg +1 -0
- package/dist/ai/copilot-markdown.d.ts +40 -0
- package/dist/ai/copilot-transport.d.ts +39 -0
- package/dist/api/AIManager.d.ts +5 -4
- package/dist/api/ApiProvider.d.ts +17 -69
- package/dist/api/ComponentCatalogCache.d.ts +27 -0
- package/dist/api/DebugSocketClient.d.ts +18 -25
- package/dist/api/RuleChainAPI.d.ts +24 -145
- package/dist/api/StreamParser.d.ts +0 -10
- package/dist/api/index.d.ts +4 -14
- package/dist/api/response-utils.d.ts +4 -22
- package/dist/api/types.d.ts +44 -179
- package/dist/chunks/editor-core-code-editor-CRki2wA_.js +512 -0
- package/dist/chunks/editor-core-default-components-BjF65lar.js +9448 -0
- package/dist/chunks/editor-core-dialogs-CkFLaC8Q.js +17176 -0
- package/dist/chunks/editor-core-icons-BqeFofNA.js +668 -0
- package/dist/chunks/editor-core-json-diff-RHsPeX-w.js +199 -0
- package/dist/chunks/editor-core-locales-i6o28vm2.js +4159 -0
- package/dist/chunks/editor-core-node-patches-BJTT3TuX.js +8060 -0
- package/dist/chunks/editor-core-node-views-BOaPVdmN.js +1288 -0
- package/dist/chunks/editor-core-property-drawers-lLsBIoCa.js +8035 -0
- package/dist/chunks/editor-core-standalone-CHXk3ukc.js +11270 -0
- package/dist/chunks/editor-core-styles-C1TbLgCK.js +8841 -0
- package/dist/chunks/vendor-logicflow-core-runtime-Cp6IBEjB.js +217 -0
- package/dist/chunks/vendor-logicflow-shared-C7YynLDn.js +4 -0
- package/dist/chunks/xlsx-BopDBbWb.js +24176 -0
- package/dist/core/ActionRegistry.d.ts +47 -0
- package/dist/core/AutoLayout.d.ts +1 -48
- package/dist/core/ComponentDocService.d.ts +28 -0
- package/dist/core/ComponentRegistry.d.ts +1 -125
- package/dist/core/DataAdapter.d.ts +4 -89
- package/dist/core/DiagnosticService.d.ts +15 -0
- package/dist/core/EditorCore.d.ts +22 -212
- package/dist/core/EditorWorkspace.d.ts +111 -0
- package/dist/core/EventBus.d.ts +0 -86
- package/dist/core/ExplorerTreeStore.d.ts +43 -0
- package/dist/core/FieldCapabilityRegistry.d.ts +16 -0
- package/dist/core/FieldChangeRegistry.d.ts +48 -0
- package/dist/core/HistoryManager.d.ts +0 -123
- package/dist/core/I18nManager.d.ts +0 -120
- package/dist/core/Optimizations.d.ts +0 -14
- package/dist/core/OptionSourceRegistry.d.ts +38 -0
- package/dist/core/RuleChainChatManager.d.ts +0 -37
- package/dist/core/RuleChainValidator.d.ts +0 -79
- package/dist/core/StateStore.d.ts +4 -140
- package/dist/core/ThemeManager.d.ts +0 -141
- package/dist/core/ValidationEngine.d.ts +0 -103
- package/dist/core/component-palette.d.ts +20 -0
- package/dist/core/component-payload.d.ts +0 -9
- package/dist/core/connection-status.d.ts +77 -0
- package/dist/core/context-menu-position.d.ts +27 -0
- package/dist/core/cron-schedule.d.ts +85 -0
- package/dist/core/debug-panel.d.ts +6 -0
- package/dist/core/editor-capabilities.d.ts +95 -0
- package/dist/core/editor-dock.d.ts +100 -0
- package/dist/core/editor-panel.d.ts +68 -0
- package/dist/core/explorer-tree.d.ts +27 -0
- package/dist/core/field-protocol.d.ts +32 -0
- package/dist/core/foundation-tokens.d.ts +38 -0
- package/dist/core/graph-operations.d.ts +34 -0
- package/dist/core/hover-tools.d.ts +26 -0
- package/dist/core/index.d.ts +68 -16
- package/dist/core/infer-run-input.d.ts +11 -0
- package/dist/core/key-value-editor.d.ts +6 -0
- package/dist/core/overlay-layers.d.ts +28 -0
- package/dist/core/recent-components.d.ts +51 -0
- package/dist/core/run-guard.d.ts +7 -0
- package/dist/core/runtime-field-dictionary.d.ts +68 -0
- package/dist/core/runtime-limits.d.ts +0 -5
- package/dist/core/save-conflict.d.ts +4 -0
- package/dist/core/server-status.d.ts +34 -0
- package/dist/core/simple-array.d.ts +4 -0
- package/dist/core/table-protocol.d.ts +36 -0
- package/dist/core/table-spreadsheet.d.ts +3 -0
- package/dist/core/test-cases.d.ts +54 -0
- package/dist/core/toolbar-icons.d.ts +4 -0
- package/dist/core/topology-rules.d.ts +17 -0
- package/dist/core/virtual-window.d.ts +20 -0
- package/dist/core/workspace-tab-actions.d.ts +13 -0
- package/dist/defaults/components.d.ts +0 -9
- package/dist/defaults/index.d.ts +0 -15
- package/dist/defaults/locale-en-US.d.ts +0 -24
- package/dist/defaults/locale-zh-CN.d.ts +0 -39
- package/dist/defaults/official-component-fallbacks.d.ts +0 -8
- package/dist/extensions/ClipboardExtension.d.ts +0 -23
- package/dist/extensions/KeyboardExtension.d.ts +0 -17
- package/dist/extensions/MenuExtension.d.ts +0 -23
- package/dist/iconRegistry.d.ts +0 -22
- package/dist/index.cjs +11320 -0
- package/dist/index.d.ts +25 -47
- package/dist/index.esm.js +1123 -99614
- package/dist/index.umd.js +3380 -1471
- package/dist/models/BaseNodeModel.d.ts +0 -32
- package/dist/models/index.d.ts +0 -1
- package/dist/nodes/AgentOrchestrationNode.d.ts +0 -24
- package/dist/nodes/GroupNode.d.ts +0 -38
- package/dist/nodes/HeadlessHtmlNode.d.ts +0 -16
- package/dist/nodes/SwitchNode.d.ts +0 -22
- package/dist/nodes/UnknownNodeModel.d.ts +0 -19
- package/dist/standalone/HuanbanRulegoEditor.d.ts +202 -401
- package/dist/standalone/ai-model-policy.d.ts +0 -1
- package/dist/standalone/ai-providers.d.ts +0 -1
- package/dist/standalone/auth-fetch.d.ts +2 -46
- package/dist/standalone/browser-assets.d.ts +0 -8
- package/dist/standalone/canvas-view.d.ts +6 -0
- package/dist/standalone/code-editor-language-loaders.d.ts +2 -0
- package/dist/standalone/code-editor-language-loaders.legacy.d.ts +7 -0
- package/dist/standalone/code-editor.d.ts +3 -87
- package/dist/standalone/connection-status-binding.d.ts +8 -0
- package/dist/standalone/custom-nodes.d.ts +0 -26
- package/dist/standalone/drawer-unsaved-guard.d.ts +2 -9
- package/dist/standalone/edge-label-quick-editor.d.ts +2 -0
- package/dist/standalone/editor-actions.d.ts +4 -0
- package/dist/standalone/editor-chain-info.d.ts +5 -38
- package/dist/standalone/editor-context-menu.d.ts +0 -21
- package/dist/standalone/editor-debug-ws.d.ts +37 -145
- package/dist/standalone/editor-delete.d.ts +0 -1
- package/dist/standalone/editor-dialogs.d.ts +16 -66
- package/dist/standalone/editor-events.d.ts +0 -27
- package/dist/standalone/editor-overlays.d.ts +14 -0
- package/dist/standalone/editor-property-drawers.d.ts +13 -71
- package/dist/standalone/editor-route-settings.d.ts +7 -55
- package/dist/standalone/editor-sidebar.d.ts +0 -18
- package/dist/standalone/editor-styles.d.ts +0 -11
- package/dist/standalone/editor-toast.d.ts +1 -2
- package/dist/standalone/editor-toolbar.d.ts +5 -80
- package/dist/standalone/editor-tour.d.ts +7 -0
- package/dist/standalone/editor-trace-overlay.d.ts +0 -5
- package/dist/standalone/full-json-dialog.d.ts +5 -1
- package/dist/standalone/group-node.d.ts +1 -51
- package/dist/standalone/icon-utils.d.ts +0 -20
- package/dist/standalone/index.d.ts +10 -7
- package/dist/standalone/json-diff.d.ts +0 -1
- package/dist/standalone/keyboard-events.d.ts +0 -1
- package/dist/standalone/layout-scheduler.d.ts +0 -6
- package/dist/standalone/lifecycle.d.ts +0 -5
- package/dist/standalone/logger.d.ts +0 -32
- package/dist/standalone/models-dev-catalog.d.ts +0 -1
- package/dist/standalone/node-copy.d.ts +7 -4
- package/dist/standalone/node-definitions.d.ts +0 -63
- package/dist/standalone/node-identity.d.ts +0 -1
- package/dist/standalone/node-theme.d.ts +8 -0
- package/dist/standalone/node-views-data.d.ts +0 -20
- package/dist/standalone/official-node-view-patches.d.ts +1 -14
- package/dist/standalone/outline-style.d.ts +7 -0
- package/dist/standalone/run-history-format.d.ts +0 -1
- package/dist/standalone/security-utils.d.ts +1 -5
- package/dist/standalone/shared-node-manager.d.ts +31 -0
- package/dist/standalone/themes.d.ts +0 -48
- package/dist/tools/tool-editor.d.ts +0 -1
- package/dist/types/component.d.ts +105 -87
- package/dist/types/editor.d.ts +16 -169
- package/dist/types/events.d.ts +30 -107
- package/dist/types/index.d.ts +3 -10
- package/dist/types/rule-chain.d.ts +0 -90
- package/dist/utils/GraphUtils.d.ts +0 -10
- package/dist/utils/helpers.d.ts +0 -80
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/pinyin-search.d.ts +0 -57
- package/dist/utils/relation-utils.d.ts +0 -1
- package/dist/utils/textUtils.d.ts +0 -12
- package/dist/version.d.ts +2 -3
- package/dist/xlsx-qn1xoUuv.cjs +105 -0
- package/package.json +19 -5
- package/vite-chunks.d.ts +11 -0
- package/vite-chunks.mjs +120 -0
- package/dist/index.cjs.js +0 -9515
|
@@ -1,28 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unwrap common backend envelopes while keeping native RuleGo payloads intact.
|
|
3
|
-
*
|
|
4
|
-
* Supported:
|
|
5
|
-
* - { code: 0, data: ... }
|
|
6
|
-
* - { success: true, data: ... }
|
|
7
|
-
* - { status: "ok", data: ... }
|
|
8
|
-
* - { data: ... }
|
|
9
|
-
*/
|
|
10
1
|
export declare function unwrapApiEnvelope<T = unknown>(raw: unknown): T;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* Supported list shapes:
|
|
15
|
-
* - [...]
|
|
16
|
-
* - { items, total, page, size }
|
|
17
|
-
* - { records, total, current, size }
|
|
18
|
-
* - { rows, count }
|
|
19
|
-
* - { data: { items|records|rows|list, total } }
|
|
20
|
-
* - { code, data: ... }
|
|
21
|
-
*/
|
|
22
|
-
export declare function normalizePagedResponse<T>(raw: unknown, mapItem: (item: unknown) => T, fallbackPage?: number, fallbackPageSize?: number): {
|
|
2
|
+
export declare function normalizePagedResponse<T>(raw: unknown, mapItem: (item: unknown) => T, fallbackPage?: number, fallbackPageSize?: number, options?: {
|
|
3
|
+
includeMetadata?: boolean;
|
|
4
|
+
}): {
|
|
23
5
|
items: T[];
|
|
24
6
|
total: number;
|
|
7
|
+
totalIsAuthoritative?: boolean;
|
|
25
8
|
page: number;
|
|
26
9
|
pageSize: number;
|
|
27
10
|
};
|
|
28
|
-
//# sourceMappingURL=response-utils.d.ts.map
|
package/dist/api/types.d.ts
CHANGED
|
@@ -1,64 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file api/types.ts
|
|
3
|
-
* @description 规则链 API 通用类型定义 — 框架无关
|
|
4
|
-
*
|
|
5
|
-
* 这些类型在 editor-core / editor-react / editor-vue 三个包之间共享。
|
|
6
|
-
* 消费者通过实现 WorkflowFetcher 接口来替换默认的请求实现。
|
|
7
|
-
*
|
|
8
|
-
* @module @huanban/rulego-editor-core/api
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* 工作流列表项(前端扁平化结构)
|
|
12
|
-
*
|
|
13
|
-
* @description 后端返回嵌套 { ruleChain: {...}, metadata: {...} },
|
|
14
|
-
* 经过 parseRuleChain() 转换为此扁平结构供 UI 消费。
|
|
15
|
-
*/
|
|
16
1
|
export interface WorkflowItem {
|
|
17
|
-
/** 规则链 ID */
|
|
18
2
|
id: string;
|
|
19
|
-
/** 规则链名称 */
|
|
20
3
|
name: string;
|
|
21
|
-
/** 是否为根规则链 */
|
|
22
4
|
root: boolean;
|
|
23
|
-
/** 是否禁用 */
|
|
24
5
|
disabled: boolean;
|
|
25
|
-
/** 是否开启调试模式 */
|
|
26
6
|
debugMode: boolean;
|
|
27
|
-
/** 描述 */
|
|
28
7
|
description: string;
|
|
29
|
-
/** 附加信息(保留原始字段) */
|
|
30
8
|
additionalInfo: Record<string, unknown>;
|
|
31
|
-
/** 创建时间 */
|
|
32
9
|
createTime: string;
|
|
33
|
-
/** 更新时间 */
|
|
34
10
|
updateTime: string;
|
|
35
|
-
/** 是否运行中 (原版协议: disabled=false -> 运行, disabled=true -> 停用) */
|
|
36
11
|
deployed: boolean;
|
|
37
12
|
}
|
|
38
|
-
/**
|
|
39
|
-
* 分页响应
|
|
40
|
-
*/
|
|
41
13
|
export interface PagedResponse<T> {
|
|
42
|
-
/** 数据列表 */
|
|
43
14
|
items: T[];
|
|
44
|
-
/** 总记录数 */
|
|
45
15
|
total: number;
|
|
46
|
-
|
|
16
|
+
totalIsAuthoritative?: boolean;
|
|
47
17
|
page: number;
|
|
48
|
-
/** 每页条数 */
|
|
49
18
|
pageSize: number;
|
|
50
19
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
20
|
+
export interface ListAllResult<T> {
|
|
21
|
+
items: T[];
|
|
22
|
+
complete: boolean;
|
|
23
|
+
pages: number;
|
|
24
|
+
total: number | null;
|
|
25
|
+
maxPages: number;
|
|
26
|
+
}
|
|
54
27
|
export interface ApiResult {
|
|
55
|
-
/** 是否成功 */
|
|
56
28
|
success: boolean;
|
|
57
|
-
/** 消息 */
|
|
58
29
|
msg?: string;
|
|
59
|
-
/** 可选数据 */
|
|
60
30
|
data?: unknown;
|
|
61
31
|
}
|
|
32
|
+
export interface SharedNode {
|
|
33
|
+
[field: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface SharedNodeFetcher {
|
|
36
|
+
getSharedNodes: (keywords: string, page: number, size: number, type?: string) => Promise<PagedResponse<SharedNode>>;
|
|
37
|
+
getSharedNode: (id: string, type: string) => Promise<SharedNode>;
|
|
38
|
+
saveSharedNode: (id: string, type: string, body: SharedNode) => Promise<unknown>;
|
|
39
|
+
deleteSharedNode: (id: string, type: string) => Promise<unknown>;
|
|
40
|
+
}
|
|
62
41
|
export type RuleMaintenanceSeverity = 'info' | 'warning' | 'error';
|
|
63
42
|
export type RuleMaintenanceCategory = 'request' | 'dsl' | 'component' | 'endpoint' | 'runtime' | 'security' | 'compatibility';
|
|
64
43
|
export interface RuleMaintenanceIssue {
|
|
@@ -110,202 +89,88 @@ export interface RulePatchPreviewResponse {
|
|
|
110
89
|
rejected: RuleMaintenanceIssue[];
|
|
111
90
|
issues?: RuleMaintenanceIssue[];
|
|
112
91
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
* ```ts
|
|
122
|
-
* const myFetcher: WorkflowFetcher = {
|
|
123
|
-
* list: async (page, size, kw) => {
|
|
124
|
-
* const res = await axios.get('/api/v1/rules', { params: { page, size, keywords: kw } })
|
|
125
|
-
* return res.data
|
|
126
|
-
* },
|
|
127
|
-
* create: async (data) => {
|
|
128
|
-
* await axios.post(`/api/v1/rules/${data.ruleChain.id}`, data)
|
|
129
|
-
* return { success: true }
|
|
130
|
-
* },
|
|
131
|
-
* // ...
|
|
132
|
-
* }
|
|
133
|
-
* ```
|
|
134
|
-
*
|
|
135
|
-
* @example 使用 systemGateway (HuanbanClaw):
|
|
136
|
-
* ```ts
|
|
137
|
-
* const myFetcher: WorkflowFetcher = {
|
|
138
|
-
* list: (p, s, kw) => systemGateway.getRuleChains(p, s, kw),
|
|
139
|
-
* create: (data) => systemGateway.createRuleChain(data),
|
|
140
|
-
* remove: (id) => systemGateway.deleteRuleChain(id),
|
|
141
|
-
* operate: (id, type) => systemGateway.operateRuleChain(id, type),
|
|
142
|
-
* copy: (id) => systemGateway.copyRuleChain(id),
|
|
143
|
-
* getContent: (id) => systemGateway.getRuleChainContent(id),
|
|
144
|
-
* saveBaseInfo: (id, data) => systemGateway.saveRuleChainBaseInfo(id, data),
|
|
145
|
-
* saveConfig: (id, type, data) => systemGateway.saveRuleChainConfig(id, type, data),
|
|
146
|
-
* }
|
|
147
|
-
* ```
|
|
148
|
-
*/
|
|
92
|
+
export type ApiRequestHeaders = Record<string, string> | (() => Record<string, string>);
|
|
93
|
+
export type ApiCustomFetch = (url: string, init?: RequestInit) => Promise<Response>;
|
|
94
|
+
export type ApiCacheKey = string;
|
|
95
|
+
export interface ApiAuthRequiredDetails {
|
|
96
|
+
status: 401 | 403;
|
|
97
|
+
url: string;
|
|
98
|
+
}
|
|
99
|
+
export type ApiAuthRequiredHandler = (details: ApiAuthRequiredDetails) => void;
|
|
149
100
|
export interface WorkflowFetcher {
|
|
150
|
-
/** 查询列表(分页 + 搜索) */
|
|
151
101
|
list: (page: number, size: number, keywords: string) => Promise<PagedResponse<WorkflowItem>>;
|
|
152
|
-
|
|
102
|
+
listAll?: (size?: number, keywords?: string, maxPages?: number) => Promise<WorkflowItem[]>;
|
|
103
|
+
listAllDetailed?: (size?: number, keywords?: string, maxPages?: number) => Promise<ListAllResult<WorkflowItem>>;
|
|
153
104
|
create: (data: Record<string, unknown>) => Promise<ApiResult>;
|
|
154
|
-
/** 删除规则链 */
|
|
155
105
|
remove: (id: string) => Promise<ApiResult>;
|
|
156
|
-
/** 部署/下线 (原版接口动作: start=部署/启动, stop=下线) */
|
|
157
106
|
operate: (id: string, type: 'start' | 'stop') => Promise<ApiResult>;
|
|
158
|
-
|
|
107
|
+
restart?: (id: string) => Promise<ApiResult>;
|
|
159
108
|
copy: (id: string, newName?: string) => Promise<ApiResult>;
|
|
160
|
-
/** 获取完整内容 */
|
|
161
109
|
getContent: (id: string) => Promise<Record<string, unknown>>;
|
|
162
|
-
|
|
110
|
+
getChainStatuses?: (id: string, signal?: AbortSignal) => Promise<unknown>;
|
|
111
|
+
getSharedNodeStatuses?: (signal?: AbortSignal) => Promise<unknown>;
|
|
163
112
|
saveBaseInfo: (id: string, info: Record<string, unknown>) => Promise<ApiResult>;
|
|
164
|
-
/** 保存配置(变量或秘钥) */
|
|
165
113
|
saveConfig: (id: string, configType: 'vars' | 'secrets', data: Record<string, string>) => Promise<ApiResult>;
|
|
166
|
-
/** 运行上游兼容校验,只读,不保存、不部署 */
|
|
167
114
|
validateUpstream?: (id: string, dsl: Record<string, unknown>, options?: Record<string, unknown>) => Promise<RuleValidateUpstreamResponse>;
|
|
168
|
-
/** 获取结构差异,只读 */
|
|
169
115
|
getSchemaDiff?: (id: string) => Promise<RuleSchemaDiffResponse>;
|
|
170
|
-
/** 获取修复建议,只读,不保存 */
|
|
171
116
|
getRepairPlan?: (id: string, dsl: Record<string, unknown>, options?: Record<string, unknown>) => Promise<RuleRepairPlanResponse>;
|
|
172
|
-
/** 预览补丁结果,只读,不保存、不部署 */
|
|
173
117
|
previewPatch?: (id: string, dsl: Record<string, unknown>, operations: JSONPatchOperation[]) => Promise<RulePatchPreviewResponse>;
|
|
174
118
|
}
|
|
175
|
-
/**
|
|
176
|
-
* 工作流列表图标映射
|
|
177
|
-
*
|
|
178
|
-
* @description 消费者可传入自定义图标(React/Vue 节点或字符串)。
|
|
179
|
-
* 不传时使用包内置的 emoji 图标(零依赖)。
|
|
180
|
-
*
|
|
181
|
-
* 在 原生 JS 中传 HTML 字符串:
|
|
182
|
-
* ```js
|
|
183
|
-
* icons: { design: '<svg>...</svg>', delete: '🗑' }
|
|
184
|
-
* ```
|
|
185
|
-
*
|
|
186
|
-
* 在 React 中传 JSX:
|
|
187
|
-
* ```tsx
|
|
188
|
-
* icons={{ design: <EditOutlined />, delete: <DeleteOutlined /> }}
|
|
189
|
-
* ```
|
|
190
|
-
*/
|
|
191
119
|
export interface WorkflowListIcons {
|
|
192
|
-
/** 设计按钮图标 */
|
|
193
120
|
design?: unknown;
|
|
194
|
-
/** 信息按钮图标 */
|
|
195
121
|
info?: unknown;
|
|
196
|
-
/** 部署按钮图标 */
|
|
197
122
|
start?: unknown;
|
|
198
|
-
/** 下线按钮图标 */
|
|
199
123
|
stop?: unknown;
|
|
200
|
-
/** 复制按钮图标 */
|
|
201
124
|
copy?: unknown;
|
|
202
|
-
/** 删除按钮图标 */
|
|
203
125
|
delete?: unknown;
|
|
204
|
-
/** 搜索图标 */
|
|
205
126
|
search?: unknown;
|
|
206
|
-
/** 刷新图标 */
|
|
207
127
|
refresh?: unknown;
|
|
208
|
-
/** 添加图标 */
|
|
209
128
|
add?: unknown;
|
|
210
|
-
/** 工作流图标 */
|
|
211
129
|
workflow?: unknown;
|
|
212
|
-
|
|
130
|
+
subWorkflow?: unknown;
|
|
213
131
|
logs?: unknown;
|
|
214
132
|
}
|
|
215
|
-
/**
|
|
216
|
-
* 工作流信息面板图标映射
|
|
217
|
-
*/
|
|
218
133
|
export interface WorkflowInfoIcons {
|
|
219
|
-
/** 变量图标 */
|
|
220
134
|
variable?: unknown;
|
|
221
|
-
/** 秘钥图标 */
|
|
222
135
|
secret?: unknown;
|
|
223
|
-
/** API 集成图标 */
|
|
224
136
|
api?: unknown;
|
|
225
|
-
/** MCP 集成图标 */
|
|
226
137
|
mcp?: unknown;
|
|
227
|
-
/** 复制图标 */
|
|
228
138
|
copy?: unknown;
|
|
229
|
-
/** 删除图标 */
|
|
230
139
|
delete?: unknown;
|
|
231
|
-
/** 添加图标 */
|
|
232
140
|
add?: unknown;
|
|
233
|
-
/** 保存图标 */
|
|
234
141
|
save?: unknown;
|
|
235
142
|
}
|
|
236
|
-
/**
|
|
237
|
-
* 支持的主题类型
|
|
238
|
-
*/
|
|
239
143
|
export type WorkflowTheme = 'light' | 'dark' | string;
|
|
240
|
-
/**
|
|
241
|
-
* API 路由映射
|
|
242
|
-
*
|
|
243
|
-
* @description 消费者可逐个覆盖 API 路径。
|
|
244
|
-
* 支持字符串模板或函数两种形式,函数接收动态参数返回完整路径。
|
|
245
|
-
*
|
|
246
|
-
* @example 自定义路由:
|
|
247
|
-
* ```ts
|
|
248
|
-
* const routes: Partial<RuleChainRoutes> = {
|
|
249
|
-
* list: '/my-api/chains', // 字符串
|
|
250
|
-
* getContent: (id) => `/my-api/chains/${id}`, // 函数
|
|
251
|
-
* operate: (id, type) => `/my-api/chains/${id}/action/${type}`,
|
|
252
|
-
* saveBaseInfo: (id) => `/custom/${id}/info`,
|
|
253
|
-
* }
|
|
254
|
-
* ```
|
|
255
|
-
*/
|
|
256
144
|
export interface RuleChainRoutes {
|
|
257
|
-
/** 列表路径,默认 '/rules' */
|
|
258
145
|
list: string;
|
|
259
|
-
/** 创建/保存路径模板,默认 '/rules/:id' */
|
|
260
146
|
create: string;
|
|
261
|
-
/** 删除路径,接收 (id) => string,默认 '/rules/:id' */
|
|
262
147
|
remove: (id: string) => string;
|
|
263
|
-
/** 部署/下线路径,接收 (id, type) => string,默认 '/rules/:id/operate/:type' */
|
|
264
148
|
operate: (id: string, type: string) => string;
|
|
265
|
-
/** 获取内容路径,接收 (id) => string,默认 '/rules/:id' */
|
|
266
149
|
getContent: (id: string) => string;
|
|
267
|
-
|
|
150
|
+
status?: (id: string) => string;
|
|
151
|
+
sharedNodeStatuses?: string;
|
|
152
|
+
sharedNodes?: string;
|
|
153
|
+
sharedNode?: (encodedId: string, encodedType: string) => string;
|
|
268
154
|
saveBaseInfo: (id: string) => string;
|
|
269
|
-
/** 保存配置路径,接收 (id, configType) => string,默认 '/rules/:id/config/:configType' */
|
|
270
155
|
saveConfig: (id: string, configType: string) => string;
|
|
271
|
-
/** 上游兼容校验路径,默认 '/rules/:id/validate-upstream' */
|
|
272
156
|
validateUpstream: (id: string) => string;
|
|
273
|
-
/** 结构差异路径,默认 '/rules/:id/schema-diff' */
|
|
274
157
|
schemaDiff: (id: string) => string;
|
|
275
|
-
/** 修复建议路径,默认 '/rules/:id/repair-plan' */
|
|
276
158
|
repairPlan: (id: string) => string;
|
|
277
|
-
/** 补丁预览路径,默认 '/rules/:id/patch-preview' */
|
|
278
159
|
patchPreview: (id: string) => string;
|
|
279
160
|
}
|
|
280
|
-
/**
|
|
281
|
-
* 默认路由映射
|
|
282
|
-
*
|
|
283
|
-
* @description 对齐原版前端 rules.js: operateWorkflow(id, operateType)
|
|
284
|
-
*/
|
|
285
161
|
export declare const DEFAULT_ROUTES: RuleChainRoutes;
|
|
286
|
-
/**
|
|
287
|
-
* 内置 API 客户端配置
|
|
288
|
-
*/
|
|
289
162
|
export interface RuleChainAPIOptions {
|
|
290
|
-
/** API 基础地址(如 'http://127.0.0.1:9090/api/v1') */
|
|
291
163
|
apiBase: string;
|
|
292
|
-
/** 请求超时毫秒数,默认 8000 */
|
|
293
164
|
timeout?: number;
|
|
294
|
-
|
|
295
|
-
headers?: Record<string, string> | (() => Record<string, string>);
|
|
296
|
-
/** 认证 Token */
|
|
165
|
+
headers?: ApiRequestHeaders;
|
|
297
166
|
authToken?: string;
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
* }
|
|
307
|
-
* ```
|
|
308
|
-
*/
|
|
167
|
+
includeStoredToken?: boolean;
|
|
168
|
+
customFetch?: ApiCustomFetch;
|
|
169
|
+
credentials?: RequestCredentials;
|
|
170
|
+
onAuthRequired?: (details: {
|
|
171
|
+
status: 401 | 403;
|
|
172
|
+
url: string;
|
|
173
|
+
}) => void;
|
|
174
|
+
serverStatus?: import('../core/server-status').ServerStatusStore;
|
|
309
175
|
routes?: Partial<RuleChainRoutes>;
|
|
310
176
|
}
|
|
311
|
-
//# sourceMappingURL=types.d.ts.map
|