@yiyi_zhang/reactflow-ui 1.2.0 → 1.3.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.
Files changed (49) hide show
  1. package/dist/AiWorkflowIDE.d.ts +7 -0
  2. package/dist/WorkflowIDE.d.ts +9 -0
  3. package/dist/ai.d.ts +16 -0
  4. package/dist/components/business/StepFlowEditor.d.ts +6 -0
  5. package/dist/components/import/ApiImportDialog.d.ts +27 -0
  6. package/dist/components/onboarding/ModalShell.d.ts +15 -0
  7. package/dist/components/onboarding/OnboardingController.d.ts +67 -0
  8. package/dist/components/onboarding/OnboardingGuideCard.d.ts +10 -0
  9. package/dist/components/onboarding/OnboardingWizard.d.ts +42 -0
  10. package/dist/components/onboarding/PromotionPanel.d.ts +20 -0
  11. package/dist/components/onboarding/WorkflowNameBuilder.d.ts +19 -0
  12. package/dist/components/onboarding/index.d.ts +8 -0
  13. package/dist/components/onboarding/styles.d.ts +11 -0
  14. package/dist/components/onboarding/useOnboardingData.d.ts +17 -0
  15. package/dist/components/template/TemplateGallery.d.ts +2 -0
  16. package/dist/components/template/TemplateSetupWizard.d.ts +2 -0
  17. package/dist/import/buildAction.d.ts +23 -0
  18. package/dist/import/common.d.ts +17 -0
  19. package/dist/import/curl.d.ts +12 -0
  20. package/dist/import/detect.d.ts +9 -0
  21. package/dist/import/index.d.ts +10 -0
  22. package/dist/import/insert.d.ts +16 -0
  23. package/dist/import/openapi.d.ts +9 -0
  24. package/dist/import/postman.d.ts +9 -0
  25. package/dist/import/schema.d.ts +15 -0
  26. package/dist/import/sensitive.d.ts +18 -0
  27. package/dist/import/types.d.ts +62 -0
  28. package/dist/import/util.d.ts +23 -0
  29. package/dist/index.d.ts +16 -0
  30. package/dist/onboarding/index.d.ts +6 -0
  31. package/dist/onboarding/naming.d.ts +41 -0
  32. package/dist/onboarding/poll.d.ts +39 -0
  33. package/dist/onboarding/wizardState.d.ts +44 -0
  34. package/dist/providers/WorkflowIdeProvider.d.ts +23 -0
  35. package/dist/providers/resolve.d.ts +20 -0
  36. package/dist/providers/types.d.ts +65 -0
  37. package/dist/reactflow-ui-ai.es.js +11657 -9031
  38. package/dist/reactflow-ui.es.js +10254 -7554
  39. package/dist/reactflow-ui.umd.js +40 -28
  40. package/dist/sample-imports/cmdb-openapi3.json +334 -0
  41. package/dist/sample-imports/cmdb-postman.json +100 -0
  42. package/dist/sample-imports/ticket-swagger2.json +231 -0
  43. package/dist/store/sandboxRunObserver.d.ts +19 -0
  44. package/dist/telemetry/buffer.d.ts +37 -0
  45. package/dist/telemetry/once.d.ts +11 -0
  46. package/dist/telemetry/track.d.ts +17 -0
  47. package/dist/telemetry/types.d.ts +24 -0
  48. package/dist/telemetry/useTelemetry.d.ts +22 -0
  49. package/package.json +1 -1
@@ -0,0 +1,334 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "title": "CMDB 资产管理",
5
+ "version": "1.0.0"
6
+ },
7
+ "servers": [
8
+ {
9
+ "url": "https://{env}.cmdb.example.com/api/{version}/",
10
+ "variables": {
11
+ "env": {
12
+ "default": "test",
13
+ "enum": [
14
+ "test",
15
+ "prod"
16
+ ]
17
+ },
18
+ "version": {
19
+ "default": "v1"
20
+ }
21
+ }
22
+ }
23
+ ],
24
+ "security": [
25
+ {
26
+ "bearerAuth": []
27
+ }
28
+ ],
29
+ "paths": {
30
+ "/assets": {
31
+ "get": {
32
+ "operationId": "listAssets",
33
+ "summary": "查询资产列表",
34
+ "tags": [
35
+ "资产"
36
+ ],
37
+ "parameters": [
38
+ {
39
+ "$ref": "#/components/parameters/Page"
40
+ },
41
+ {
42
+ "name": "type",
43
+ "in": "query",
44
+ "schema": {
45
+ "type": "string",
46
+ "enum": [
47
+ "server",
48
+ "network",
49
+ "storage"
50
+ ]
51
+ },
52
+ "description": "资产类型"
53
+ },
54
+ {
55
+ "name": "keyword",
56
+ "in": "query",
57
+ "schema": {
58
+ "type": "string"
59
+ },
60
+ "description": "名称关键字"
61
+ }
62
+ ],
63
+ "responses": {
64
+ "200": {
65
+ "description": "OK",
66
+ "content": {
67
+ "application/json": {
68
+ "schema": {
69
+ "$ref": "#/components/schemas/AssetPage"
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+ },
76
+ "post": {
77
+ "operationId": "createAsset",
78
+ "summary": "登记资产",
79
+ "tags": [
80
+ "资产"
81
+ ],
82
+ "requestBody": {
83
+ "required": true,
84
+ "content": {
85
+ "application/json": {
86
+ "schema": {
87
+ "$ref": "#/components/schemas/AssetCreate"
88
+ }
89
+ }
90
+ }
91
+ },
92
+ "responses": {
93
+ "201": {
94
+ "description": "Created",
95
+ "content": {
96
+ "application/json": {
97
+ "schema": {
98
+ "$ref": "#/components/schemas/Asset"
99
+ }
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+ },
106
+ "/assets/{assetId}": {
107
+ "parameters": [
108
+ {
109
+ "name": "assetId",
110
+ "in": "path",
111
+ "required": true,
112
+ "schema": {
113
+ "type": "string"
114
+ },
115
+ "description": "资产 ID"
116
+ }
117
+ ],
118
+ "get": {
119
+ "operationId": "getAsset",
120
+ "summary": "查询资产详情",
121
+ "tags": [
122
+ "资产"
123
+ ],
124
+ "responses": {
125
+ "200": {
126
+ "description": "OK",
127
+ "content": {
128
+ "application/json": {
129
+ "schema": {
130
+ "$ref": "#/components/schemas/Asset"
131
+ }
132
+ }
133
+ }
134
+ },
135
+ "404": {
136
+ "description": "Not Found"
137
+ }
138
+ }
139
+ },
140
+ "delete": {
141
+ "operationId": "deleteAsset",
142
+ "summary": "下线资产",
143
+ "tags": [
144
+ "资产"
145
+ ],
146
+ "responses": {
147
+ "204": {
148
+ "description": "No Content"
149
+ }
150
+ }
151
+ }
152
+ },
153
+ "/assets/{assetId}/relations": {
154
+ "get": {
155
+ "operationId": "listRelations",
156
+ "summary": "查询资产关联关系",
157
+ "tags": [
158
+ "关系"
159
+ ],
160
+ "parameters": [
161
+ {
162
+ "name": "assetId",
163
+ "in": "path",
164
+ "required": true,
165
+ "schema": {
166
+ "type": "string"
167
+ }
168
+ }
169
+ ],
170
+ "responses": {
171
+ "200": {
172
+ "description": "OK",
173
+ "content": {
174
+ "application/json": {
175
+ "schema": {
176
+ "$ref": "#/components/schemas/RelationNode"
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
182
+ }
183
+ }
184
+ },
185
+ "components": {
186
+ "securitySchemes": {
187
+ "bearerAuth": {
188
+ "type": "http",
189
+ "scheme": "bearer"
190
+ }
191
+ },
192
+ "parameters": {
193
+ "Page": {
194
+ "name": "page",
195
+ "in": "query",
196
+ "schema": {
197
+ "type": "integer",
198
+ "default": 1,
199
+ "minimum": 1
200
+ },
201
+ "description": "页码"
202
+ }
203
+ },
204
+ "schemas": {
205
+ "Asset": {
206
+ "type": "object",
207
+ "required": [
208
+ "id",
209
+ "name"
210
+ ],
211
+ "properties": {
212
+ "id": {
213
+ "type": "string",
214
+ "description": "资产 ID",
215
+ "example": "ast-001"
216
+ },
217
+ "name": {
218
+ "type": "string",
219
+ "title": "资产名称"
220
+ },
221
+ "type": {
222
+ "type": "string",
223
+ "enum": [
224
+ "server",
225
+ "network",
226
+ "storage"
227
+ ]
228
+ },
229
+ "owner": {
230
+ "type": "string",
231
+ "description": "负责人邮箱"
232
+ },
233
+ "status": {
234
+ "type": "string",
235
+ "enum": [
236
+ "online",
237
+ "offline"
238
+ ],
239
+ "example": "online"
240
+ },
241
+ "labels": {
242
+ "type": "object",
243
+ "additionalProperties": {
244
+ "type": "string"
245
+ }
246
+ },
247
+ "createdAt": {
248
+ "type": "string",
249
+ "format": "date-time"
250
+ }
251
+ }
252
+ },
253
+ "AssetCreate": {
254
+ "type": "object",
255
+ "required": [
256
+ "name",
257
+ "type"
258
+ ],
259
+ "properties": {
260
+ "name": {
261
+ "type": "string",
262
+ "title": "资产名称"
263
+ },
264
+ "type": {
265
+ "type": "string",
266
+ "enum": [
267
+ "server",
268
+ "network",
269
+ "storage"
270
+ ],
271
+ "title": "资产类型"
272
+ },
273
+ "owner": {
274
+ "type": "string",
275
+ "description": "负责人邮箱"
276
+ },
277
+ "cpuCores": {
278
+ "type": "integer",
279
+ "default": 4
280
+ },
281
+ "managed": {
282
+ "type": "boolean",
283
+ "default": true
284
+ },
285
+ "tags": {
286
+ "type": "array",
287
+ "items": {
288
+ "type": "string"
289
+ }
290
+ },
291
+ "attributes": {
292
+ "type": "object",
293
+ "description": "扩展属性"
294
+ }
295
+ }
296
+ },
297
+ "AssetPage": {
298
+ "type": "object",
299
+ "properties": {
300
+ "total": {
301
+ "type": "integer",
302
+ "description": "总数"
303
+ },
304
+ "page": {
305
+ "type": "integer"
306
+ },
307
+ "items": {
308
+ "type": "array",
309
+ "items": {
310
+ "$ref": "#/components/schemas/Asset"
311
+ }
312
+ }
313
+ }
314
+ },
315
+ "RelationNode": {
316
+ "type": "object",
317
+ "properties": {
318
+ "assetId": {
319
+ "type": "string"
320
+ },
321
+ "relation": {
322
+ "type": "string"
323
+ },
324
+ "children": {
325
+ "type": "array",
326
+ "items": {
327
+ "$ref": "#/components/schemas/RelationNode"
328
+ }
329
+ }
330
+ }
331
+ }
332
+ }
333
+ }
334
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "info": {
3
+ "_postman_id": "b3a1f6c0-0000-4000-8000-000000000001",
4
+ "name": "CMDB 资产",
5
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
6
+ },
7
+ "auth": {
8
+ "type": "bearer",
9
+ "bearer": [
10
+ {
11
+ "key": "token",
12
+ "value": "{{cmdbToken}}",
13
+ "type": "string"
14
+ }
15
+ ]
16
+ },
17
+ "variable": [
18
+ {
19
+ "key": "baseUrl",
20
+ "value": "https://test.cmdb.example.com/api/v1"
21
+ }
22
+ ],
23
+ "item": [
24
+ {
25
+ "name": "资产",
26
+ "item": [
27
+ {
28
+ "name": "查询资产列表",
29
+ "request": {
30
+ "method": "GET",
31
+ "header": [
32
+ {
33
+ "key": "Accept",
34
+ "value": "application/json"
35
+ }
36
+ ],
37
+ "url": {
38
+ "raw": "{{baseUrl}}/assets?page=1&type=server",
39
+ "host": [
40
+ "{{baseUrl}}"
41
+ ],
42
+ "path": [
43
+ "assets"
44
+ ],
45
+ "query": [
46
+ {
47
+ "key": "page",
48
+ "value": "1"
49
+ },
50
+ {
51
+ "key": "type",
52
+ "value": "server"
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ "response": [
58
+ {
59
+ "name": "成功",
60
+ "code": 200,
61
+ "body": "{\"total\": 2, \"items\": [{\"id\": \"ast-001\", \"name\": \"web-01\"}]}"
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "name": "登记资产",
67
+ "request": {
68
+ "method": "POST",
69
+ "header": [
70
+ {
71
+ "key": "Content-Type",
72
+ "value": "application/json"
73
+ },
74
+ {
75
+ "key": "X-Trace-Id",
76
+ "value": "trace-{{traceId}}"
77
+ },
78
+ {
79
+ "key": "X-Debug",
80
+ "value": "1",
81
+ "disabled": true
82
+ }
83
+ ],
84
+ "body": {
85
+ "mode": "raw",
86
+ "raw": "{\n \"name\": \"web-02\",\n \"type\": \"server\",\n \"owner\": \"{{ownerEmail}}\",\n \"cpuCores\": 8,\n \"managed\": true,\n \"tags\": [\"prod\", \"web\"]\n}",
87
+ "options": {
88
+ "raw": {
89
+ "language": "json"
90
+ }
91
+ }
92
+ },
93
+ "url": "{{baseUrl}}/assets",
94
+ "description": "登记一台新资产"
95
+ }
96
+ }
97
+ ]
98
+ }
99
+ ]
100
+ }
@@ -0,0 +1,231 @@
1
+ {
2
+ "swagger": "2.0",
3
+ "info": {
4
+ "title": "工单服务",
5
+ "version": "1.0"
6
+ },
7
+ "host": "itsm.example.com:8443",
8
+ "basePath": "/api/v2/",
9
+ "schemes": [
10
+ "https",
11
+ "http"
12
+ ],
13
+ "consumes": [
14
+ "application/json"
15
+ ],
16
+ "produces": [
17
+ "application/json"
18
+ ],
19
+ "securityDefinitions": {
20
+ "basicAuth": {
21
+ "type": "basic"
22
+ }
23
+ },
24
+ "security": [
25
+ {
26
+ "basicAuth": []
27
+ }
28
+ ],
29
+ "paths": {
30
+ "/tickets": {
31
+ "get": {
32
+ "operationId": "listTickets",
33
+ "summary": "查询工单列表",
34
+ "tags": [
35
+ "工单"
36
+ ],
37
+ "parameters": [
38
+ {
39
+ "name": "status",
40
+ "in": "query",
41
+ "type": "string",
42
+ "enum": [
43
+ "OPEN",
44
+ "PENDING",
45
+ "CLOSED"
46
+ ],
47
+ "description": "工单状态"
48
+ },
49
+ {
50
+ "name": "limit",
51
+ "in": "query",
52
+ "type": "integer",
53
+ "default": 20,
54
+ "maximum": 100
55
+ }
56
+ ],
57
+ "responses": {
58
+ "200": {
59
+ "description": "OK",
60
+ "schema": {
61
+ "type": "array",
62
+ "items": {
63
+ "$ref": "#/definitions/Ticket"
64
+ }
65
+ }
66
+ }
67
+ }
68
+ },
69
+ "post": {
70
+ "operationId": "createTicket",
71
+ "summary": "创建工单",
72
+ "tags": [
73
+ "工单"
74
+ ],
75
+ "parameters": [
76
+ {
77
+ "name": "body",
78
+ "in": "body",
79
+ "required": true,
80
+ "schema": {
81
+ "$ref": "#/definitions/TicketInput"
82
+ }
83
+ }
84
+ ],
85
+ "responses": {
86
+ "201": {
87
+ "description": "Created",
88
+ "schema": {
89
+ "$ref": "#/definitions/Ticket"
90
+ }
91
+ }
92
+ }
93
+ }
94
+ },
95
+ "/tickets/{id}": {
96
+ "parameters": [
97
+ {
98
+ "name": "id",
99
+ "in": "path",
100
+ "required": true,
101
+ "type": "string",
102
+ "description": "工单号"
103
+ }
104
+ ],
105
+ "get": {
106
+ "operationId": "getTicket",
107
+ "summary": "查询工单详情",
108
+ "tags": [
109
+ "工单"
110
+ ],
111
+ "responses": {
112
+ "200": {
113
+ "description": "OK",
114
+ "schema": {
115
+ "$ref": "#/definitions/Ticket"
116
+ }
117
+ }
118
+ }
119
+ },
120
+ "put": {
121
+ "operationId": "updateTicket",
122
+ "summary": "更新工单",
123
+ "tags": [
124
+ "工单"
125
+ ],
126
+ "parameters": [
127
+ {
128
+ "name": "body",
129
+ "in": "body",
130
+ "required": true,
131
+ "schema": {
132
+ "$ref": "#/definitions/TicketInput"
133
+ }
134
+ }
135
+ ],
136
+ "responses": {
137
+ "200": {
138
+ "description": "OK",
139
+ "schema": {
140
+ "$ref": "#/definitions/Ticket"
141
+ }
142
+ }
143
+ }
144
+ },
145
+ "delete": {
146
+ "operationId": "closeTicket",
147
+ "summary": "关闭工单",
148
+ "tags": [
149
+ "工单"
150
+ ],
151
+ "responses": {
152
+ "204": {
153
+ "description": "No Content"
154
+ }
155
+ }
156
+ }
157
+ }
158
+ },
159
+ "definitions": {
160
+ "User": {
161
+ "type": "object",
162
+ "properties": {
163
+ "id": {
164
+ "type": "string"
165
+ },
166
+ "name": {
167
+ "type": "string"
168
+ },
169
+ "email": {
170
+ "type": "string"
171
+ }
172
+ }
173
+ },
174
+ "Ticket": {
175
+ "type": "object",
176
+ "properties": {
177
+ "id": {
178
+ "type": "string",
179
+ "description": "工单号",
180
+ "example": "T-2026-0001"
181
+ },
182
+ "title": {
183
+ "type": "string"
184
+ },
185
+ "status": {
186
+ "type": "string",
187
+ "enum": [
188
+ "OPEN",
189
+ "PENDING",
190
+ "CLOSED"
191
+ ]
192
+ },
193
+ "reporter": {
194
+ "$ref": "#/definitions/User"
195
+ },
196
+ "createdAt": {
197
+ "type": "string"
198
+ }
199
+ }
200
+ },
201
+ "TicketInput": {
202
+ "type": "object",
203
+ "required": [
204
+ "title"
205
+ ],
206
+ "properties": {
207
+ "title": {
208
+ "type": "string",
209
+ "title": "工单标题"
210
+ },
211
+ "content": {
212
+ "type": "string",
213
+ "maxLength": 1000
214
+ },
215
+ "severity": {
216
+ "type": "integer",
217
+ "default": 3,
218
+ "enum": [
219
+ 1,
220
+ 2,
221
+ 3,
222
+ 4
223
+ ]
224
+ },
225
+ "reporter": {
226
+ "$ref": "#/definitions/User"
227
+ }
228
+ }
229
+ }
230
+ }
231
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * store 动作的观察者(专业模式埋点用)。
3
+ *
4
+ * - 试跑:专业模式的本地试跑统一经过 store 的 `runLocalSandboxDryRun`(ActionBar 一键试跑与
5
+ * SandboxConfigModal 都走它),在那里通知即可,不必在每个入口各自埋点。只传最终状态(或 'error'),
6
+ * 不传输入 / 输出数据。业务模式(StepFlowEditor)与模板试跑不经过该 action,由各自的回调上报,因此不会重复。
7
+ * - 新增步骤:画布「+」与 Cmd+K 内联 Copilot 都经过 store 的 `addNode`,来源固定为 'builtin'。
8
+ *
9
+ * 模块级集合:IDE 挂载时订阅、卸载时取消。store 本身是页面内单例,同一页面挂载多个 IDE 时各自都会收到通知。
10
+ */
11
+ export type SandboxRunObserver = (result: string) => void;
12
+ export type StepAddedObserver = (source: 'builtin') => void;
13
+ /** 订阅试跑结果;返回取消订阅函数 */
14
+ export declare function subscribeSandboxRun(observer: SandboxRunObserver): () => void;
15
+ /** 通知试跑结果;观察者抛错不影响试跑 */
16
+ export declare function notifySandboxRun(result: string): void;
17
+ /** 订阅专业模式新增步骤;返回取消订阅函数 */
18
+ export declare function subscribeStepAdded(observer: StepAddedObserver): () => void;
19
+ export declare function notifyStepAdded(source: 'builtin'): void;