@huanban/rulego-editor-core 1.4.1 → 2.0.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 +20 -8
- package/dist/ai/ai-chat-options.d.ts +12 -0
- package/dist/api/AIAssistantAPI.d.ts +29 -0
- package/dist/api/AIManager.d.ts +7 -1
- package/dist/api/ApiProvider.d.ts +17 -4
- package/dist/api/DebugSocketClient.d.ts +2 -0
- package/dist/api/GlobalConfigAPI.d.ts +35 -0
- package/dist/api/IoTPointTemplateAPI.d.ts +32 -0
- package/dist/api/MarketplaceAPI.d.ts +39 -0
- package/dist/api/RuleChainAPI.d.ts +23 -4
- package/dist/api/RuleChainVersionsAPI.d.ts +28 -0
- package/dist/api/SkillsAPI.d.ts +31 -0
- package/dist/api/UserAPI.d.ts +39 -0
- package/dist/api/extended-api-shared.d.ts +25 -0
- package/dist/api/index.d.ts +19 -2
- package/dist/api/public-api.test-d.d.ts +87 -0
- package/dist/api/response-utils.d.ts +1 -0
- package/dist/api/types.d.ts +86 -14
- package/dist/chunks/editor-core-api-BQiYFuIO.js +1157 -0
- package/dist/chunks/editor-core-canvas-nodes-BE9eN51s.js +6921 -0
- package/dist/chunks/editor-core-code-editor-DFm5Owtv.js +660 -0
- package/dist/chunks/{editor-core-default-components-BjF65lar.js → editor-core-default-components-BsNP8ma1.js} +98 -98
- package/dist/chunks/editor-core-dialogs-D9YHvzys.js +12009 -0
- package/dist/chunks/{editor-core-locales-i6o28vm2.js → editor-core-locales-CsqTh7Wh.js} +1723 -11
- package/dist/chunks/{editor-core-node-patches-BJTT3TuX.js → editor-core-node-patches-Dbi8XYxu.js} +633 -184
- package/dist/chunks/{editor-core-node-views-BOaPVdmN.js → editor-core-node-views-C8FQYC3E.js} +39 -29
- package/dist/chunks/editor-core-property-drawers-Bqmp9B_J.js +9562 -0
- package/dist/chunks/editor-core-settings-DcGCJSc7.js +4161 -0
- package/dist/chunks/editor-core-standalone-C7pzm8ZB.js +10013 -0
- package/dist/chunks/{editor-core-styles-C1TbLgCK.js → editor-core-styles-CwjFPfAo.js} +1203 -507
- package/dist/chunks/vendor-highlight-acC2fLd8.js +5868 -0
- package/dist/chunks/vendor-logicflow-core-runtime-DpsWXOGl.js +4 -0
- package/dist/chunks/vendor-logicflow-shared-C_kIdBKO.js +4 -0
- package/dist/core/ActionRegistry.d.ts +4 -2
- package/dist/core/DataAdapter.d.ts +17 -1
- package/dist/core/DialogProvider.d.ts +33 -0
- package/dist/core/EditorCore.d.ts +16 -3
- package/dist/core/FieldCapabilityRegistry.d.ts +4 -1
- package/dist/core/FieldChangeRegistry.d.ts +3 -1
- package/dist/core/I18nManager.d.ts +1 -1
- package/dist/core/IdentityProvider.d.ts +32 -0
- package/dist/core/OptionSourceRegistry.d.ts +4 -1
- package/dist/core/PropertyControlRegistry.d.ts +29 -0
- package/dist/core/ThemeManager.d.ts +7 -0
- package/dist/core/anchored-popover.d.ts +16 -0
- package/dist/core/assistant-dsl.d.ts +18 -0
- package/dist/core/business-log-config.d.ts +18 -0
- package/dist/core/clean-snapshot.d.ts +14 -0
- package/dist/core/component-localization.d.ts +17 -0
- package/dist/core/component-palette.d.ts +3 -0
- package/dist/core/connection-status.d.ts +11 -0
- package/dist/core/dialog-styles.d.ts +1 -0
- package/dist/core/editor-capabilities.d.ts +82 -1
- package/dist/core/editor-edge-anchors.d.ts +16 -0
- package/dist/core/endpoint-protocol.d.ts +15 -0
- package/dist/core/expression-preview.d.ts +6 -0
- package/dist/core/field-protocol.d.ts +19 -4
- package/dist/core/global-config.d.ts +47 -0
- package/dist/core/global-search.d.ts +31 -0
- package/dist/core/group-protocol.d.ts +56 -0
- package/dist/core/identity-provider-default.d.ts +32 -0
- package/dist/core/index.d.ts +31 -5
- package/dist/core/keymap.d.ts +10 -0
- package/dist/core/payload-kv.d.ts +7 -0
- package/dist/core/rule-chain-versions.d.ts +143 -0
- package/dist/core/run-analysis.d.ts +126 -0
- package/dist/core/runtime-field-dictionary.d.ts +3 -0
- package/dist/core/save-conflict.d.ts +1 -0
- package/dist/core/server-status.d.ts +1 -0
- package/dist/core/toolbar-icons.d.ts +1 -1
- package/dist/core/variable-completion.d.ts +13 -0
- package/dist/core/websocket-auth.d.ts +2 -0
- package/dist/defaults/analysis-locales.d.ts +241 -0
- package/dist/defaults/component-locale-categories.d.ts +14 -0
- package/dist/defaults/component-locale-data.d.ts +4 -0
- package/dist/defaults/component-locale-en-US.d.ts +10 -0
- package/dist/defaults/component-locale-summaries.d.ts +15 -0
- package/dist/defaults/component-locale-zh-CN.d.ts +10 -0
- package/dist/defaults/editor-shell-locales.d.ts +290 -0
- package/dist/defaults/example-chain.d.ts +2 -0
- package/dist/defaults/field-interaction-locales.d.ts +19 -0
- package/dist/defaults/global-config-locales.d.ts +166 -0
- package/dist/defaults/official-component-fallbacks.d.ts +2 -1
- package/dist/defaults/point-template-locales.d.ts +64 -0
- package/dist/index.cjs +2897 -2115
- package/dist/index.d.ts +33 -10
- package/dist/index.esm.js +1184 -809
- package/dist/index.umd.js +2874 -2092
- package/dist/nodes/UnknownNodeModel.d.ts +12 -1
- package/dist/standalone/HuanbanRulegoEditor.d.ts +145 -13
- package/dist/standalone/auth-fetch.d.ts +1 -0
- package/dist/standalone/auth-ui-defaults.d.ts +15 -0
- package/dist/standalone/code-editor.d.ts +7 -5
- package/dist/standalone/connection-status-binding.d.ts +3 -2
- package/dist/standalone/custom-nodes.d.ts +13 -0
- package/dist/standalone/drawer-locale.d.ts +12 -0
- package/dist/standalone/drawer-unsaved-guard.d.ts +6 -1
- package/dist/standalone/dynamic-field-browse.d.ts +25 -0
- package/dist/standalone/edge-label-quick-editor.d.ts +2 -1
- package/dist/standalone/editor-actions.d.ts +1 -0
- package/dist/standalone/editor-canvas-anchors.d.ts +19 -0
- package/dist/standalone/editor-canvas-shortcuts.d.ts +1 -0
- package/dist/standalone/editor-chain-info.d.ts +1 -0
- package/dist/standalone/editor-debug-data.d.ts +18 -0
- package/dist/standalone/editor-debug-ws.d.ts +2 -0
- package/dist/standalone/editor-delete.d.ts +5 -3
- package/dist/standalone/editor-dialog-provider.d.ts +3 -0
- package/dist/standalone/editor-dialogs.d.ts +25 -2
- package/dist/standalone/editor-global-config.d.ts +44 -0
- package/dist/standalone/editor-group-interactions.d.ts +1 -0
- package/dist/standalone/editor-host-region-styles.d.ts +1 -0
- package/dist/standalone/editor-host-regions.d.ts +53 -0
- package/dist/standalone/editor-login.d.ts +15 -0
- package/dist/standalone/editor-overlays.d.ts +5 -0
- package/dist/standalone/editor-property-drawers.d.ts +3 -1
- package/dist/standalone/editor-run-analysis.d.ts +81 -0
- package/dist/standalone/editor-run-compare.d.ts +20 -0
- package/dist/standalone/editor-run-waterfall.d.ts +11 -0
- package/dist/standalone/editor-toast.d.ts +1 -1
- package/dist/standalone/editor-toolbar-presentation.d.ts +12 -0
- package/dist/standalone/editor-toolbar.d.ts +5 -1
- package/dist/standalone/editor-ui-configuration.d.ts +55 -0
- package/dist/standalone/editor-ui-settings.d.ts +26 -0
- package/dist/standalone/editor-user-menu.d.ts +8 -0
- package/dist/standalone/editor-version-history.d.ts +82 -0
- package/dist/standalone/editor-workspace-shell.d.ts +47 -0
- package/dist/standalone/editor-workspace-styles.d.ts +1 -0
- package/dist/standalone/field-expression-preview.d.ts +12 -0
- package/dist/standalone/group-node.d.ts +19 -3
- package/dist/standalone/icon-utils.d.ts +7 -0
- package/dist/standalone/index.d.ts +17 -5
- package/dist/standalone/keyboard-events.d.ts +3 -0
- package/dist/standalone/multi-select-popover.d.ts +16 -0
- package/dist/standalone/node-copy.d.ts +1 -0
- package/dist/standalone/node-definitions.d.ts +4 -0
- package/dist/standalone/node-renderer-utils.d.ts +21 -0
- package/dist/standalone/node-theme.d.ts +2 -1
- package/dist/standalone/point-template-actions.d.ts +43 -0
- package/dist/standalone/property-field-draft.d.ts +5 -0
- package/dist/standalone/question-list-editor.d.ts +35 -0
- package/dist/standalone/shared-node-manager.d.ts +14 -0
- package/dist/standalone/single-select-popover.d.ts +6 -0
- package/dist/standalone/theme-scope.d.ts +15 -0
- package/dist/standalone/themes.d.ts +8 -0
- package/dist/standalone/variable-completion-dropdown.d.ts +18 -0
- package/dist/types/component.d.ts +24 -1
- package/dist/types/editor.d.ts +41 -0
- package/dist/utils/relation-utils.d.ts +19 -1
- package/dist/version.d.ts +2 -2
- package/package.json +3 -3
- package/vite-chunks.mjs +66 -0
- package/dist/chunks/editor-core-code-editor-CRki2wA_.js +0 -512
- package/dist/chunks/editor-core-dialogs-BMWb0WRN.js +0 -17228
- package/dist/chunks/editor-core-property-drawers-BPh-jj1b.js +0 -7998
- package/dist/chunks/editor-core-standalone-CJDytHO9.js +0 -11269
- package/dist/chunks/vendor-logicflow-core-runtime-Cp6IBEjB.js +0 -217
- package/dist/chunks/vendor-logicflow-shared-C7YynLDn.js +0 -4
package/dist/api/types.d.ts
CHANGED
|
@@ -33,10 +33,10 @@ export interface SharedNode {
|
|
|
33
33
|
[field: string]: unknown;
|
|
34
34
|
}
|
|
35
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>;
|
|
36
|
+
getSharedNodes: (keywords: string, page: number, size: number, type?: string, signal?: AbortSignal) => Promise<PagedResponse<SharedNode>>;
|
|
37
|
+
getSharedNode: (id: string, type: string, signal?: AbortSignal) => Promise<SharedNode>;
|
|
38
|
+
saveSharedNode: (id: string, type: string, body: SharedNode, signal?: AbortSignal) => Promise<unknown>;
|
|
39
|
+
deleteSharedNode: (id: string, type: string, signal?: AbortSignal) => Promise<unknown>;
|
|
40
40
|
}
|
|
41
41
|
export type RuleMaintenanceSeverity = 'info' | 'warning' | 'error';
|
|
42
42
|
export type RuleMaintenanceCategory = 'request' | 'dsl' | 'component' | 'endpoint' | 'runtime' | 'security' | 'compatibility';
|
|
@@ -89,6 +89,38 @@ export interface RulePatchPreviewResponse {
|
|
|
89
89
|
rejected: RuleMaintenanceIssue[];
|
|
90
90
|
issues?: RuleMaintenanceIssue[];
|
|
91
91
|
}
|
|
92
|
+
export type RuleMessageMetadata = Record<string, string> | URLSearchParams | string;
|
|
93
|
+
export interface RuleMessageBody {
|
|
94
|
+
msgId?: string;
|
|
95
|
+
metadata?: RuleMessageMetadata;
|
|
96
|
+
body?: unknown;
|
|
97
|
+
config?: Omit<RequestInit, 'method' | 'body'>;
|
|
98
|
+
}
|
|
99
|
+
export interface RunsListOptions {
|
|
100
|
+
page?: number;
|
|
101
|
+
size?: number;
|
|
102
|
+
status?: string;
|
|
103
|
+
msgType?: string;
|
|
104
|
+
source?: string;
|
|
105
|
+
startTime?: number | string;
|
|
106
|
+
endTime?: number | string;
|
|
107
|
+
startDate?: string;
|
|
108
|
+
endDate?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface RunRecord {
|
|
111
|
+
[field: string]: unknown;
|
|
112
|
+
}
|
|
113
|
+
export interface ComponentDSL {
|
|
114
|
+
[field: string]: unknown;
|
|
115
|
+
}
|
|
116
|
+
export interface RuleListOptions {
|
|
117
|
+
page?: number;
|
|
118
|
+
size?: number;
|
|
119
|
+
keywords?: string;
|
|
120
|
+
root?: boolean;
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
category?: string;
|
|
123
|
+
}
|
|
92
124
|
export type ApiRequestHeaders = Record<string, string> | (() => Record<string, string>);
|
|
93
125
|
export type ApiCustomFetch = (url: string, init?: RequestInit) => Promise<Response>;
|
|
94
126
|
export type ApiCacheKey = string;
|
|
@@ -98,15 +130,17 @@ export interface ApiAuthRequiredDetails {
|
|
|
98
130
|
}
|
|
99
131
|
export type ApiAuthRequiredHandler = (details: ApiAuthRequiredDetails) => void;
|
|
100
132
|
export interface WorkflowFetcher {
|
|
101
|
-
list: (page: number, size: number, keywords: string) => Promise<PagedResponse<WorkflowItem>>;
|
|
133
|
+
list: (page: number, size: number, keywords: string, signal?: AbortSignal) => Promise<PagedResponse<WorkflowItem>>;
|
|
102
134
|
listAll?: (size?: number, keywords?: string, maxPages?: number) => Promise<WorkflowItem[]>;
|
|
103
135
|
listAllDetailed?: (size?: number, keywords?: string, maxPages?: number) => Promise<ListAllResult<WorkflowItem>>;
|
|
104
|
-
create: (data: Record<string, unknown
|
|
136
|
+
create: (data: Record<string, unknown>, options?: {
|
|
137
|
+
draft?: boolean;
|
|
138
|
+
}) => Promise<ApiResult>;
|
|
105
139
|
remove: (id: string) => Promise<ApiResult>;
|
|
106
140
|
operate: (id: string, type: 'start' | 'stop') => Promise<ApiResult>;
|
|
107
141
|
restart?: (id: string) => Promise<ApiResult>;
|
|
108
142
|
copy: (id: string, newName?: string) => Promise<ApiResult>;
|
|
109
|
-
getContent: (id: string) => Promise<Record<string, unknown>>;
|
|
143
|
+
getContent: (id: string, signal?: AbortSignal) => Promise<Record<string, unknown>>;
|
|
110
144
|
getChainStatuses?: (id: string, signal?: AbortSignal) => Promise<unknown>;
|
|
111
145
|
getSharedNodeStatuses?: (signal?: AbortSignal) => Promise<unknown>;
|
|
112
146
|
saveBaseInfo: (id: string, info: Record<string, unknown>) => Promise<ApiResult>;
|
|
@@ -115,6 +149,18 @@ export interface WorkflowFetcher {
|
|
|
115
149
|
getSchemaDiff?: (id: string) => Promise<RuleSchemaDiffResponse>;
|
|
116
150
|
getRepairPlan?: (id: string, dsl: Record<string, unknown>, options?: Record<string, unknown>) => Promise<RuleRepairPlanResponse>;
|
|
117
151
|
previewPatch?: (id: string, dsl: Record<string, unknown>, operations: JSONPatchOperation[]) => Promise<RulePatchPreviewResponse>;
|
|
152
|
+
notifyRule?: (chainId: string, msgType: string, body?: RuleMessageBody) => Promise<void>;
|
|
153
|
+
executeRule?: (chainId: string, msgType: string, body?: RuleMessageBody) => Promise<unknown>;
|
|
154
|
+
listFiltered?: (options?: RuleListOptions, signal?: AbortSignal) => Promise<PagedResponse<WorkflowItem>>;
|
|
155
|
+
getRuleCategories?: (signal?: AbortSignal) => Promise<string[]>;
|
|
156
|
+
getDebugData?: (chainId: string, nodeId?: string, page?: number, size?: number, signal?: AbortSignal) => Promise<unknown[]>;
|
|
157
|
+
getRunsList?: (chainId: string, options?: RunsListOptions, signal?: AbortSignal) => Promise<PagedResponse<RunRecord>>;
|
|
158
|
+
getRuns?: (chainId: string, id: string, signal?: AbortSignal) => Promise<RunRecord>;
|
|
159
|
+
deleteRuns?: (chainId: string, ids?: string | string[], signal?: AbortSignal) => Promise<void>;
|
|
160
|
+
getComponentDSL?: (nodeType: string, signal?: AbortSignal) => Promise<ComponentDSL>;
|
|
161
|
+
installComponent?: (nodeType: string, dsl: ComponentDSL, signal?: AbortSignal) => Promise<void>;
|
|
162
|
+
uninstallComponent?: (nodeType: string, signal?: AbortSignal) => Promise<void>;
|
|
163
|
+
queryDynamicBuiltin?: (name: string, params?: Record<string, unknown>, signal?: AbortSignal) => Promise<unknown>;
|
|
118
164
|
}
|
|
119
165
|
export interface WorkflowListIcons {
|
|
120
166
|
design?: unknown;
|
|
@@ -150,15 +196,41 @@ export interface RuleChainRoutes {
|
|
|
150
196
|
status?: (id: string) => string;
|
|
151
197
|
sharedNodeStatuses?: string;
|
|
152
198
|
sharedNodes?: string;
|
|
153
|
-
sharedNode?: (encodedId: string,
|
|
199
|
+
sharedNode?: (encodedId: string, resourceType: string) => string;
|
|
154
200
|
saveBaseInfo: (id: string) => string;
|
|
155
201
|
saveConfig: (id: string, configType: string) => string;
|
|
156
|
-
validateUpstream
|
|
157
|
-
schemaDiff
|
|
158
|
-
repairPlan
|
|
159
|
-
patchPreview
|
|
160
|
-
|
|
161
|
-
|
|
202
|
+
validateUpstream?: (id: string) => string;
|
|
203
|
+
schemaDiff?: (id: string) => string;
|
|
204
|
+
repairPlan?: (id: string) => string;
|
|
205
|
+
patchPreview?: (id: string) => string;
|
|
206
|
+
notifyRule?: (id: string, msgType: string) => string;
|
|
207
|
+
executeRule?: (id: string, msgType: string) => string;
|
|
208
|
+
ruleCategories?: string;
|
|
209
|
+
debugData?: string;
|
|
210
|
+
runsList?: string;
|
|
211
|
+
dynamicComponent?: (nodeType: string) => string;
|
|
212
|
+
queryDynamicBuiltin?: (name: string) => string;
|
|
213
|
+
}
|
|
214
|
+
export declare const DEFAULT_ROUTES: {
|
|
215
|
+
list: string;
|
|
216
|
+
create: string;
|
|
217
|
+
remove: (id: string) => string;
|
|
218
|
+
operate: (id: string, type: string) => string;
|
|
219
|
+
getContent: (id: string) => string;
|
|
220
|
+
status: (id: string) => string;
|
|
221
|
+
sharedNodeStatuses: string;
|
|
222
|
+
sharedNodes: string;
|
|
223
|
+
sharedNode: (encodedId: string, resourceType: string) => string;
|
|
224
|
+
saveBaseInfo: (id: string) => string;
|
|
225
|
+
saveConfig: (id: string, configType: string) => string;
|
|
226
|
+
notifyRule: (id: string, msgType: string) => string;
|
|
227
|
+
executeRule: (id: string, msgType: string) => string;
|
|
228
|
+
ruleCategories: string;
|
|
229
|
+
debugData: string;
|
|
230
|
+
runsList: string;
|
|
231
|
+
dynamicComponent: (nodeType: string) => string;
|
|
232
|
+
queryDynamicBuiltin: (name: string) => string;
|
|
233
|
+
};
|
|
162
234
|
export interface RuleChainAPIOptions {
|
|
163
235
|
apiBase: string;
|
|
164
236
|
timeout?: number;
|