@oomol-lab/open-flow 0.1.0-alpha.0 → 0.1.0-alpha.10
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/browser/addNodeOptions-BwrMvPQC.js +5230 -0
- package/dist/browser/assets/typeScriptWorker-CaA4llbX.js +59850 -0
- package/dist/browser/carbon-DMCVsjHo.js +53 -0
- package/dist/browser/{project-change.js → change-Cu6pQIit.js} +15 -45
- package/dist/browser/createLucideIcon-COMgwa_u.js +5317 -0
- package/dist/browser/createResourceDialog-YgMLylQz.js +467 -0
- package/dist/browser/{dist-o4dBuwiG.js → dist-3Mj8q8Pr.js} +28 -28
- package/dist/browser/{dist-CIq6ue3I.js → dist-BKuSVKCC.js} +1115 -1103
- package/dist/browser/{dist-DL0SDskM.js → dist-BMqL-qR5.js} +473 -906
- package/dist/browser/{dist-CLZJNoWB.js → dist-BN4ZCyOB.js} +10 -10
- package/dist/browser/{dist-zyY--HOV.js → dist-BpopSHwP.js} +3 -3
- package/dist/browser/dist-C46JByB-.js +252 -0
- package/dist/browser/{dist-BbyiRq3c.js → dist-CJpzJrLM.js} +294 -284
- package/dist/browser/{dist-Djd02JSy.js → dist-CPuF50D9.js} +198 -198
- package/dist/browser/{dist-CvcmLAMW.js → dist-CUSrALSX.js} +115 -115
- package/dist/browser/dist-CeSZ2xSM.js +444 -0
- package/dist/browser/{dist-7oZK9QXZ.js → dist-DMi8_lU3.js} +5 -5
- package/dist/browser/{dist-B9OV3YTx.js → dist-DUzA0Ukh.js} +22 -22
- package/dist/browser/{dist-aWSZx4q1.js → dist-DWADUsVB.js} +75 -75
- package/dist/browser/{dist-BLk5M0uK.js → dist-Mecbzdl2.js} +3 -3
- package/dist/browser/{esm-DXw7EADW.js → esm-CvAs_mAS.js} +14 -24
- package/dist/browser/field-BrEG-7ap.js +312 -0
- package/dist/browser/flow-authoring-edge.d.ts +3 -0
- package/dist/browser/flow-authoring-module.d.ts +4 -0
- package/dist/browser/flow-authoring-node.d.ts +84 -0
- package/dist/browser/flow-authoring.d.ts +4 -0
- package/dist/browser/flow-authoring.js +522 -0
- package/dist/browser/{project-change.d.ts → flow-change.d.ts} +27 -36
- package/dist/browser/flow-change.js +231 -0
- package/dist/browser/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
- package/dist/browser/flowRunInputEditorStore-DXOyyY7o.js +8219 -0
- package/dist/browser/flowWorkspace-X_T_DcQf.js +46003 -0
- package/dist/browser/{lib-S4ccuMeT.js → lib-GrGxYjsJ.js} +3 -5
- package/dist/browser/licenses.md +620 -12
- package/dist/browser/{markdownContent-ZZFfSRqO.js → markdownContent-BI-2PmDX.js} +4071 -4035
- package/dist/browser/typeScriptSession-Dagu_tRs.js +2549 -0
- package/dist/browser/workbench-contract.d.ts +4 -5
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +2 -1
- package/dist/browser/workbench.js +3920 -2138
- package/dist/common/connector-action.d.ts +6 -0
- package/dist/common/connector-action.js +38 -30
- package/dist/common/control-api-conformance.js +223 -359
- package/dist/common/control-api-errors.d.ts +20 -24
- package/dist/common/control-api.d.ts +44 -73
- package/dist/common/control-api.js +150 -203
- package/dist/common/cron-trigger.d.ts +1 -1
- package/dist/common/cron-trigger.js +1 -1
- package/dist/common/flow-encoding.d.ts +11 -0
- package/dist/common/{project-encoding.js → flow-encoding.js} +14 -13
- package/dist/common/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
- package/dist/common/{project-semantics.d.ts → flow-semantics.d.ts} +9 -12
- package/dist/common/{project-semantics.js → flow-semantics.js} +594 -597
- package/dist/common/integration-trigger.d.ts +2 -1
- package/dist/common/integration-trigger.js +1 -1
- package/dist/common/poll-trigger.d.ts +1 -1
- package/dist/common/provider-triggers.js +1057 -948
- package/dist/common/run-lifecycle.js +1 -1
- package/dist/common/runtime-contract.d.ts +1 -1
- package/dist/common/runtime-contract.js +1 -1
- package/dist/common/scheduler.d.ts +7 -7
- package/dist/common/scheduler.js +237 -232
- package/dist/common/webhook-trigger.d.ts +1 -1
- package/dist/common/webhook-trigger.js +35 -1
- package/package.json +20 -10
- package/dist/browser/addNodeOptions-DqoIueCR.js +0 -33746
- package/dist/browser/carbon-nMY84Amv.js +0 -53
- package/dist/browser/composite-7VwgfnXx.js +0 -6088
- package/dist/browser/createResourceDialog-ByuJWdSL.js +0 -439
- package/dist/browser/dist-n-z5HtaO.js +0 -4
- package/dist/browser/flowWorkspace-DwVMpcar.js +0 -22092
- package/dist/common/project-encoding.d.ts +0 -11
|
@@ -12,6 +12,13 @@ export interface PortDefinition {
|
|
|
12
12
|
export interface InputPortDefinition extends PortDefinition {
|
|
13
13
|
readonly value?: JsonValue;
|
|
14
14
|
}
|
|
15
|
+
export interface Port extends PortDefinition {
|
|
16
|
+
readonly handle: string;
|
|
17
|
+
}
|
|
18
|
+
export interface InputPort extends InputPortDefinition {
|
|
19
|
+
readonly handle: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function portsByHandle<Value extends Port>(ports: readonly Value[]): Readonly<Record<string, Value>>;
|
|
15
22
|
export interface NodeSource {
|
|
16
23
|
readonly kind: 'node';
|
|
17
24
|
readonly nodeId: string;
|
|
@@ -38,6 +45,7 @@ export interface OutputMapping {
|
|
|
38
45
|
interface GraphNodeBase {
|
|
39
46
|
readonly concurrency: number;
|
|
40
47
|
readonly description?: string;
|
|
48
|
+
readonly icon?: string;
|
|
41
49
|
readonly inputs: Readonly<Record<string, InputMapping>>;
|
|
42
50
|
readonly name?: string;
|
|
43
51
|
readonly timeoutMs?: number;
|
|
@@ -48,7 +56,7 @@ export interface SubflowNode extends GraphNodeBase {
|
|
|
48
56
|
}
|
|
49
57
|
export interface ValueNode extends GraphNodeBase {
|
|
50
58
|
readonly kind: 'value';
|
|
51
|
-
readonly values:
|
|
59
|
+
readonly values: readonly InputPort[];
|
|
52
60
|
}
|
|
53
61
|
export type ConditionOperator = '!=' | '<' | '<=' | '==' | '>' | '>=' | 'contains' | 'endsWith' | 'hasKey' | 'hasValue' | 'isEmpty' | 'isFalse' | 'isNotEmpty' | 'isNotNull' | 'isNull' | 'isTrue' | 'notContains' | 'notHasKey' | 'notHasValue' | 'startsWith';
|
|
54
62
|
export interface ConditionExpression {
|
|
@@ -64,9 +72,7 @@ export interface ConditionCase {
|
|
|
64
72
|
export interface ConditionNode extends GraphNodeBase {
|
|
65
73
|
readonly cases: readonly ConditionCase[];
|
|
66
74
|
readonly defaultOutput?: string;
|
|
67
|
-
readonly input:
|
|
68
|
-
readonly handle: string;
|
|
69
|
-
};
|
|
75
|
+
readonly input: InputPort;
|
|
70
76
|
readonly kind: 'condition';
|
|
71
77
|
}
|
|
72
78
|
export type ManagedTaskExecutor = {
|
|
@@ -83,9 +89,9 @@ export interface ConnectorCapability {
|
|
|
83
89
|
readonly kind: 'connector';
|
|
84
90
|
}
|
|
85
91
|
interface TaskDefinitionBase {
|
|
86
|
-
readonly inputs:
|
|
92
|
+
readonly inputs: readonly InputPort[];
|
|
87
93
|
readonly name: string;
|
|
88
|
-
readonly outputs:
|
|
94
|
+
readonly outputs: readonly Port[];
|
|
89
95
|
}
|
|
90
96
|
export interface InlineTaskDefinition extends TaskDefinitionBase {
|
|
91
97
|
readonly capabilities?: readonly ConnectorCapability[];
|
|
@@ -143,8 +149,7 @@ export type TriggerKeySnapshot = (TriggerKeySnapshotBase & {
|
|
|
143
149
|
readonly endpoint: IntegrationEndpointDeclaration;
|
|
144
150
|
readonly type: 'integration';
|
|
145
151
|
});
|
|
146
|
-
export interface WebhookInputDefinition extends
|
|
147
|
-
readonly handle: string;
|
|
152
|
+
export interface WebhookInputDefinition extends InputPort {
|
|
148
153
|
}
|
|
149
154
|
export interface WebhookOptions {
|
|
150
155
|
readonly allowedMethods?: readonly string[];
|
|
@@ -156,6 +161,7 @@ export interface WebhookOptions {
|
|
|
156
161
|
}
|
|
157
162
|
interface TriggerNodeBase {
|
|
158
163
|
readonly description?: string;
|
|
164
|
+
readonly icon?: string;
|
|
159
165
|
readonly name: string;
|
|
160
166
|
}
|
|
161
167
|
export type TriggerNode = (TriggerNodeBase & {
|
|
@@ -182,20 +188,17 @@ export type TriggerNode = (TriggerNodeBase & {
|
|
|
182
188
|
readonly kind: 'integration';
|
|
183
189
|
});
|
|
184
190
|
export type GraphNode = ConditionNode | SubflowNode | TaskNode | TriggerNode | ValueNode;
|
|
185
|
-
export interface
|
|
191
|
+
export interface FlowDocument {
|
|
186
192
|
readonly bindings: Readonly<Record<string, {
|
|
187
193
|
readonly kind: 'connection' | 'secret';
|
|
188
194
|
readonly target: string;
|
|
189
195
|
}>>;
|
|
190
|
-
readonly
|
|
191
|
-
readonly graph: Graph;
|
|
192
|
-
readonly name: string;
|
|
193
|
-
}>>;
|
|
196
|
+
readonly graph: Graph;
|
|
194
197
|
readonly subflows: Readonly<Record<string, {
|
|
195
198
|
readonly graph: Graph;
|
|
196
|
-
readonly inputs:
|
|
199
|
+
readonly inputs: readonly InputPort[];
|
|
197
200
|
readonly name: string;
|
|
198
|
-
readonly outputs:
|
|
201
|
+
readonly outputs: readonly (OutputMapping & Port)[];
|
|
199
202
|
}>>;
|
|
200
203
|
readonly tasks: Readonly<Record<string, ManagedTaskDefinition>>;
|
|
201
204
|
}
|
|
@@ -205,12 +208,11 @@ export interface CodeModule {
|
|
|
205
208
|
readonly source: string;
|
|
206
209
|
}
|
|
207
210
|
export interface RevisionContent {
|
|
208
|
-
readonly document:
|
|
211
|
+
readonly document: FlowDocument;
|
|
209
212
|
readonly modelVersion: 1;
|
|
210
213
|
readonly modules: Readonly<Record<string, CodeModule>>;
|
|
211
214
|
}
|
|
212
215
|
export type GraphTarget = {
|
|
213
|
-
readonly id: string;
|
|
214
216
|
readonly kind: 'flow';
|
|
215
217
|
} | {
|
|
216
218
|
readonly id: string;
|
|
@@ -223,27 +225,16 @@ export interface GraphEdge {
|
|
|
223
225
|
readonly targetHandle: string;
|
|
224
226
|
}
|
|
225
227
|
export type ChangeOperation = {
|
|
226
|
-
readonly binding:
|
|
228
|
+
readonly binding: FlowDocument['bindings'][string];
|
|
227
229
|
readonly bindingId: string;
|
|
228
230
|
readonly kind: 'binding.create';
|
|
229
231
|
} | {
|
|
230
|
-
readonly binding:
|
|
232
|
+
readonly binding: FlowDocument['bindings'][string];
|
|
231
233
|
readonly bindingId: string;
|
|
232
234
|
readonly kind: 'binding.replace';
|
|
233
235
|
} | {
|
|
234
236
|
readonly bindingId: string;
|
|
235
237
|
readonly kind: 'binding.delete';
|
|
236
|
-
} | {
|
|
237
|
-
readonly flow: ProjectDocument['flows'][string];
|
|
238
|
-
readonly flowId: string;
|
|
239
|
-
readonly kind: 'flow.create';
|
|
240
|
-
} | {
|
|
241
|
-
readonly flowId: string;
|
|
242
|
-
readonly kind: 'flow.delete';
|
|
243
|
-
} | {
|
|
244
|
-
readonly flowId: string;
|
|
245
|
-
readonly kind: 'flow.rename';
|
|
246
|
-
readonly name: string;
|
|
247
238
|
} | {
|
|
248
239
|
readonly kind: 'graph.edge.connect';
|
|
249
240
|
readonly edge: GraphEdge;
|
|
@@ -284,10 +275,10 @@ export type ChangeOperation = {
|
|
|
284
275
|
readonly source: string;
|
|
285
276
|
} | {
|
|
286
277
|
readonly kind: 'subflow.create';
|
|
287
|
-
readonly subflow:
|
|
278
|
+
readonly subflow: FlowDocument['subflows'][string];
|
|
288
279
|
readonly subflowId: string;
|
|
289
280
|
} | {
|
|
290
|
-
readonly definition: Omit<
|
|
281
|
+
readonly definition: Omit<FlowDocument['subflows'][string], 'graph'>;
|
|
291
282
|
readonly kind: 'subflow.definition.replace';
|
|
292
283
|
readonly subflowId: string;
|
|
293
284
|
} | {
|
|
@@ -295,17 +286,17 @@ export type ChangeOperation = {
|
|
|
295
286
|
readonly subflowId: string;
|
|
296
287
|
} | {
|
|
297
288
|
readonly kind: 'task.create';
|
|
298
|
-
readonly task:
|
|
289
|
+
readonly task: FlowDocument['tasks'][string];
|
|
299
290
|
readonly taskId: string;
|
|
300
291
|
} | {
|
|
301
292
|
readonly kind: 'task.delete';
|
|
302
293
|
readonly taskId: string;
|
|
303
294
|
} | {
|
|
304
295
|
readonly kind: 'task.replace';
|
|
305
|
-
readonly task:
|
|
296
|
+
readonly task: FlowDocument['tasks'][string];
|
|
306
297
|
readonly taskId: string;
|
|
307
298
|
};
|
|
308
|
-
export declare class
|
|
299
|
+
export declare class FlowChangeError extends Error {
|
|
309
300
|
}
|
|
310
|
-
export declare function
|
|
301
|
+
export declare function applyFlowChanges(content: RevisionContent, operations: readonly ChangeOperation[]): RevisionContent;
|
|
311
302
|
export {};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
//#region src/flow/common/change.ts
|
|
2
|
+
var e = 80;
|
|
3
|
+
function t(e) {
|
|
4
|
+
let t = e.trim();
|
|
5
|
+
if (t.length == 0) return "empty";
|
|
6
|
+
if (t.length > 80) return "tooLong";
|
|
7
|
+
for (let e of t) {
|
|
8
|
+
let t = e.charCodeAt(0);
|
|
9
|
+
if (t <= 31 || t >= 127 && t <= 159) return "controlCharacter";
|
|
10
|
+
}
|
|
11
|
+
if (!/^[\p{L}\p{N}](?:[\p{L}\p{N} _-]*[\p{L}\p{N}])?$/u.test(t)) return "specialCharacter";
|
|
12
|
+
}
|
|
13
|
+
function n(e) {
|
|
14
|
+
return Object.fromEntries(e.map((e) => [e.handle, e]));
|
|
15
|
+
}
|
|
16
|
+
var r = class extends Error {};
|
|
17
|
+
function i() {
|
|
18
|
+
throw new r();
|
|
19
|
+
}
|
|
20
|
+
function a(e, t) {
|
|
21
|
+
if (t.kind == "flow") return e.graph;
|
|
22
|
+
let n = e.subflows[t.id];
|
|
23
|
+
return n ?? i(), n.graph;
|
|
24
|
+
}
|
|
25
|
+
function o(e, t, n) {
|
|
26
|
+
if (t.kind == "flow") return {
|
|
27
|
+
...e,
|
|
28
|
+
graph: n
|
|
29
|
+
};
|
|
30
|
+
let r = e.subflows[t.id];
|
|
31
|
+
return r ?? i(), {
|
|
32
|
+
...e,
|
|
33
|
+
subflows: {
|
|
34
|
+
...e.subflows,
|
|
35
|
+
[t.id]: {
|
|
36
|
+
...r,
|
|
37
|
+
graph: n
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function s(e, t) {
|
|
43
|
+
if (!("inputs" in e)) return e;
|
|
44
|
+
let n = { ...e.inputs };
|
|
45
|
+
for (let [e, r] of Object.entries(n)) {
|
|
46
|
+
if (r.kind != "sources") continue;
|
|
47
|
+
let i = r.sources.filter((e) => e.kind != "node" || !t.has(e.nodeId));
|
|
48
|
+
i.length == 0 ? delete n[e] : n[e] = {
|
|
49
|
+
kind: "sources",
|
|
50
|
+
sources: i
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
...e,
|
|
55
|
+
inputs: n
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function c(e, t) {
|
|
59
|
+
let n = { ...e.document }, r = { ...e.modules };
|
|
60
|
+
for (let e of t) switch (e.kind) {
|
|
61
|
+
case "binding.create":
|
|
62
|
+
n.bindings[e.bindingId] != null && i(), n.bindings = {
|
|
63
|
+
...n.bindings,
|
|
64
|
+
[e.bindingId]: e.binding
|
|
65
|
+
};
|
|
66
|
+
break;
|
|
67
|
+
case "binding.replace":
|
|
68
|
+
n.bindings[e.bindingId] ?? i(), n.bindings = {
|
|
69
|
+
...n.bindings,
|
|
70
|
+
[e.bindingId]: e.binding
|
|
71
|
+
};
|
|
72
|
+
break;
|
|
73
|
+
case "binding.delete": {
|
|
74
|
+
n.bindings[e.bindingId] ?? i();
|
|
75
|
+
let t = { ...n.bindings };
|
|
76
|
+
delete t[e.bindingId], n.bindings = t;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
case "graph.edge.connect": {
|
|
80
|
+
let t = a(n, e.target);
|
|
81
|
+
t.nodes[e.edge.source] ?? i();
|
|
82
|
+
let r = t.nodes[e.edge.target];
|
|
83
|
+
(r == null || !("inputs" in r)) && i();
|
|
84
|
+
let s = r.inputs[e.edge.targetHandle], c = {
|
|
85
|
+
kind: "node",
|
|
86
|
+
nodeId: e.edge.source,
|
|
87
|
+
output: e.edge.sourceHandle
|
|
88
|
+
}, l = s?.kind == "sources" ? s.sources : [];
|
|
89
|
+
l.some((e) => e.kind == "node" && e.nodeId == c.nodeId && e.output == c.output) && i();
|
|
90
|
+
let u = {
|
|
91
|
+
...r,
|
|
92
|
+
inputs: {
|
|
93
|
+
...r.inputs,
|
|
94
|
+
[e.edge.targetHandle]: {
|
|
95
|
+
kind: "sources",
|
|
96
|
+
sources: [...l, c]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
Object.assign(n, o(n, e.target, { nodes: {
|
|
101
|
+
...t.nodes,
|
|
102
|
+
[e.edge.target]: u
|
|
103
|
+
} }));
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
case "graph.edge.disconnect": {
|
|
107
|
+
let t = a(n, e.target), r = t.nodes[e.edge.target];
|
|
108
|
+
(r == null || !("inputs" in r)) && i();
|
|
109
|
+
let s = r.inputs[e.edge.targetHandle];
|
|
110
|
+
s?.kind != "sources" && i();
|
|
111
|
+
let c = s.sources.filter((t) => t.kind != "node" || t.nodeId != e.edge.source || t.output != e.edge.sourceHandle);
|
|
112
|
+
c.length == s.sources.length && i();
|
|
113
|
+
let l = { ...r.inputs };
|
|
114
|
+
c.length == 0 ? delete l[e.edge.targetHandle] : l[e.edge.targetHandle] = {
|
|
115
|
+
kind: "sources",
|
|
116
|
+
sources: c
|
|
117
|
+
}, Object.assign(n, o(n, e.target, { nodes: {
|
|
118
|
+
...t.nodes,
|
|
119
|
+
[e.edge.target]: {
|
|
120
|
+
...r,
|
|
121
|
+
inputs: l
|
|
122
|
+
}
|
|
123
|
+
} }));
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
case "graph.node.create": {
|
|
127
|
+
let t = a(n, e.target);
|
|
128
|
+
(t.nodes[e.nodeId] != null || e.target.kind == "subflow" && !("inputs" in e.node)) && i(), Object.assign(n, o(n, e.target, { nodes: {
|
|
129
|
+
...t.nodes,
|
|
130
|
+
[e.nodeId]: e.node
|
|
131
|
+
} }));
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case "graph.node.delete": {
|
|
135
|
+
let t = a(n, e.target);
|
|
136
|
+
t.nodes[e.nodeId] ?? i();
|
|
137
|
+
let r = /* @__PURE__ */ new Set([e.nodeId]), c = Object.fromEntries(Object.entries(t.nodes).flatMap(([e, t]) => r.has(e) ? [] : [[e, s(t, r)]]));
|
|
138
|
+
if (Object.assign(n, o(n, e.target, { nodes: c })), e.target.kind == "subflow") {
|
|
139
|
+
let t = n.subflows[e.target.id], i = t.outputs.map((e) => ({
|
|
140
|
+
...e,
|
|
141
|
+
sources: e.sources.filter((e) => e.kind != "node" || !r.has(e.nodeId))
|
|
142
|
+
}));
|
|
143
|
+
n.subflows = {
|
|
144
|
+
...n.subflows,
|
|
145
|
+
[e.target.id]: {
|
|
146
|
+
...t,
|
|
147
|
+
outputs: i
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
case "graph.node.replace": {
|
|
154
|
+
let t = a(n, e.target);
|
|
155
|
+
(t.nodes[e.nodeId] == null || e.target.kind == "subflow" && !("inputs" in e.node)) && i(), Object.assign(n, o(n, e.target, { nodes: {
|
|
156
|
+
...t.nodes,
|
|
157
|
+
[e.nodeId]: e.node
|
|
158
|
+
} }));
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
case "module.create":
|
|
162
|
+
r[e.moduleId] != null && i(), r[e.moduleId] = e.module;
|
|
163
|
+
break;
|
|
164
|
+
case "module.delete":
|
|
165
|
+
r[e.moduleId] ?? i(), delete r[e.moduleId];
|
|
166
|
+
break;
|
|
167
|
+
case "module.rename": {
|
|
168
|
+
let t = r[e.moduleId];
|
|
169
|
+
t ?? i(), r[e.moduleId] = {
|
|
170
|
+
...t,
|
|
171
|
+
name: e.name
|
|
172
|
+
};
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
case "module.source.replace": {
|
|
176
|
+
let t = r[e.moduleId];
|
|
177
|
+
t ?? i(), r[e.moduleId] = {
|
|
178
|
+
...t,
|
|
179
|
+
imports: e.imports,
|
|
180
|
+
source: e.source
|
|
181
|
+
};
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
case "subflow.create":
|
|
185
|
+
n.subflows[e.subflowId] != null && i(), n.subflows = {
|
|
186
|
+
...n.subflows,
|
|
187
|
+
[e.subflowId]: e.subflow
|
|
188
|
+
};
|
|
189
|
+
break;
|
|
190
|
+
case "subflow.definition.replace": {
|
|
191
|
+
let t = n.subflows[e.subflowId];
|
|
192
|
+
t ?? i(), n.subflows = {
|
|
193
|
+
...n.subflows,
|
|
194
|
+
[e.subflowId]: {
|
|
195
|
+
...e.definition,
|
|
196
|
+
graph: t.graph
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
case "subflow.delete": {
|
|
202
|
+
n.subflows[e.subflowId] ?? i();
|
|
203
|
+
let t = { ...n.subflows };
|
|
204
|
+
delete t[e.subflowId], n.subflows = t;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
case "task.create":
|
|
208
|
+
n.tasks[e.taskId] != null && i(), n.tasks = {
|
|
209
|
+
...n.tasks,
|
|
210
|
+
[e.taskId]: e.task
|
|
211
|
+
};
|
|
212
|
+
break;
|
|
213
|
+
case "task.delete": {
|
|
214
|
+
n.tasks[e.taskId] ?? i();
|
|
215
|
+
let t = { ...n.tasks };
|
|
216
|
+
delete t[e.taskId], n.tasks = t;
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
case "task.replace": n.tasks[e.taskId] ?? i(), n.tasks = {
|
|
220
|
+
...n.tasks,
|
|
221
|
+
[e.taskId]: e.task
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
document: n,
|
|
226
|
+
modelVersion: e.modelVersion,
|
|
227
|
+
modules: r
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
//#endregion
|
|
231
|
+
export { r as FlowChangeError, c as applyFlowChanges, n as portsByHandle, t as resourceNameIssue, e as resourceNameMaxLength };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface FlowCatalogEvent {
|
|
2
|
+
readonly kind: 'flows.changed';
|
|
3
|
+
readonly version: 1;
|
|
4
|
+
}
|
|
5
|
+
export type FlowChangeEvent = {
|
|
2
6
|
readonly kind: 'draft.changed';
|
|
3
|
-
readonly
|
|
7
|
+
readonly flowId: string;
|
|
4
8
|
readonly revisionId: string;
|
|
5
9
|
readonly version: 1;
|
|
6
10
|
} | {
|
|
7
11
|
readonly flowId: string;
|
|
8
12
|
readonly kind: 'run.created';
|
|
9
|
-
readonly projectId: string;
|
|
10
13
|
readonly runId: string;
|
|
11
14
|
readonly version: 1;
|
|
12
15
|
};
|