@oomol-lab/open-flow 0.1.0-alpha.2 → 0.1.0-alpha.4
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-CGyTkP99.js +7272 -0
- package/dist/browser/{composite-7VwgfnXx.js → createLucideIcon-MmUpJrIU.js} +1570 -2087
- package/dist/browser/createResourceDialog-CIVfStiE.js +467 -0
- package/dist/browser/dist-0lWKriL5.js +252 -0
- package/dist/browser/field-runIpvMd.js +312 -0
- package/dist/browser/flowRunInputEditorStore-B49C0ZmK.js +8044 -0
- package/dist/browser/flowWorkspace-CGsEHe2F.js +40889 -0
- package/dist/browser/{markdownContent-ZZFfSRqO.js → markdownContent-BvYiwIwR.js} +1 -1
- package/dist/browser/project-authoring-edge.d.ts +3 -0
- package/dist/browser/project-authoring-flow.d.ts +4 -0
- package/dist/browser/project-authoring-module.d.ts +4 -0
- package/dist/browser/project-authoring-node.d.ts +90 -0
- package/dist/browser/project-authoring.d.ts +4 -0
- package/dist/browser/project-authoring.js +426 -0
- package/dist/browser/workbench-contract.d.ts +0 -1
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -0
- package/dist/browser/workbench.js +516 -443
- package/dist/common/control-api-conformance.js +14 -17
- package/dist/common/control-api-errors.d.ts +4 -0
- package/dist/common/control-api.d.ts +6 -6
- package/dist/common/control-api.js +24 -24
- package/dist/common/integration-trigger.d.ts +1 -0
- package/dist/common/provider-triggers.js +928 -796
- package/dist/common/scheduler.js +3 -3
- package/dist/common/webhook-trigger.js +34 -0
- package/package.json +5 -1
- package/dist/browser/addNodeOptions-DqoIueCR.js +0 -33746
- 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
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { a as e, f as t, i as n } from "./dist-0lWKriL5.js";
|
|
2
|
+
import { Ir as r, Rr as i, Wr as a } from "./createLucideIcon-MmUpJrIU.js";
|
|
3
|
+
import { _ as o, a as s, c, d as l, dt as u, f as d, g as f, i as p, l as m, m as h, n as g, o as _, p as v, st as y, t as b, u as x, ut as ee, v as S, x as te, y as ne } from "./addNodeOptions-CGyTkP99.js";
|
|
4
|
+
import { Suspense as re, lazy as ie, useEffect as C, useRef as ae, useState as oe } from "react";
|
|
5
|
+
import { jsx as w, jsxs as se } from "react/jsx-runtime";
|
|
5
6
|
//#region src/workbench/browser/runtime/navigation.ts
|
|
6
|
-
function
|
|
7
|
+
function ce(e, t) {
|
|
7
8
|
return t == null ? "design" : e == "design" && t?.draft == null && t != null ? "publications" : e;
|
|
8
9
|
}
|
|
9
|
-
var
|
|
10
|
+
var le = class {
|
|
10
11
|
#e;
|
|
11
12
|
#t;
|
|
12
13
|
#n;
|
|
@@ -16,10 +17,10 @@ var ue = class {
|
|
|
16
17
|
#o;
|
|
17
18
|
#s;
|
|
18
19
|
#c;
|
|
19
|
-
constructor(e,
|
|
20
|
-
this.#r =
|
|
20
|
+
constructor(e, n, r) {
|
|
21
|
+
this.#r = t("design"), this.#i = 0, this.#a = !1, this.#o = !1, this.#s = !1, this.#c = [], this.$ = { view: this.#r }, this.#l = () => {
|
|
21
22
|
this.#o && !this.#s && this.#d(this.#r.value, !0);
|
|
22
|
-
}, this.#t =
|
|
23
|
+
}, this.#t = n, this.#e = r, this.#n = e, this.#r.set(n.view);
|
|
23
24
|
}
|
|
24
25
|
async start() {
|
|
25
26
|
let e = this.#t, t = ++this.#i;
|
|
@@ -93,7 +94,7 @@ var ue = class {
|
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
async apply(e) {
|
|
96
|
-
|
|
97
|
+
T(e, this.#t) || (this.#t = e, await this.#u(e));
|
|
97
98
|
}
|
|
98
99
|
#l;
|
|
99
100
|
async #u(e) {
|
|
@@ -116,20 +117,20 @@ var ue = class {
|
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
#d(e, t) {
|
|
119
|
-
let n = this.#n.workspace.$.targetFlow.value, r =
|
|
120
|
+
let n = this.#n.workspace.$.targetFlow.value, r = ce(e, n), i = {
|
|
120
121
|
flowId: n?.flowId,
|
|
121
122
|
projectId: this.#n.workspace.$.projectId.value,
|
|
122
123
|
view: r
|
|
123
124
|
};
|
|
124
|
-
|
|
125
|
+
T(i, this.#t) || (this.#t = i, this.#e(i, { replace: t })), this.#r.set(r);
|
|
125
126
|
}
|
|
126
127
|
};
|
|
127
|
-
function
|
|
128
|
+
function T(e, t) {
|
|
128
129
|
return e.projectId == t.projectId && e.flowId == t.flowId && e.view == t.view;
|
|
129
130
|
}
|
|
130
131
|
//#endregion
|
|
131
132
|
//#region src/workbench/browser/runtime/publications/publicationStore.ts
|
|
132
|
-
var
|
|
133
|
+
var E = {
|
|
133
134
|
activities: [],
|
|
134
135
|
activitiesLoadFailed: !1,
|
|
135
136
|
activitiesLoading: !1,
|
|
@@ -142,46 +143,46 @@ var T = {
|
|
|
142
143
|
loadingMore: !1,
|
|
143
144
|
publications: [],
|
|
144
145
|
publishing: !1
|
|
145
|
-
},
|
|
146
|
+
}, ue = 20, de = 50;
|
|
146
147
|
function D(e, t) {
|
|
147
148
|
return e?.projectId == t.projectId && e.flowId == t.flowId;
|
|
148
149
|
}
|
|
149
|
-
var
|
|
150
|
+
var fe = class {
|
|
150
151
|
#e;
|
|
151
152
|
#t;
|
|
152
153
|
#n;
|
|
153
|
-
#r = new
|
|
154
|
-
#i = new
|
|
155
|
-
#a = new
|
|
156
|
-
#o = new
|
|
154
|
+
#r = new S();
|
|
155
|
+
#i = new S();
|
|
156
|
+
#a = new S();
|
|
157
|
+
#o = new S();
|
|
157
158
|
#s;
|
|
158
|
-
#c =
|
|
159
|
+
#c = t(E);
|
|
159
160
|
#l;
|
|
160
161
|
#u;
|
|
161
|
-
constructor(
|
|
162
|
-
this.#e =
|
|
163
|
-
activities:
|
|
164
|
-
activitiesLoadFailed:
|
|
165
|
-
activitiesLoading:
|
|
166
|
-
activitiesLoadingMore:
|
|
167
|
-
activitiesNextCursor:
|
|
168
|
-
bindings:
|
|
169
|
-
changingTriggerId:
|
|
170
|
-
detail:
|
|
171
|
-
detailLoading:
|
|
172
|
-
live:
|
|
173
|
-
loadFailed:
|
|
174
|
-
loading:
|
|
175
|
-
loadMoreFailed:
|
|
176
|
-
loadingMore:
|
|
177
|
-
nextCursor:
|
|
178
|
-
publications:
|
|
179
|
-
publishing:
|
|
180
|
-
rollingBackPublicationId:
|
|
181
|
-
selectedTriggerId:
|
|
182
|
-
testingTriggerId:
|
|
183
|
-
testResult:
|
|
184
|
-
total:
|
|
162
|
+
constructor(t, n, r, i = () => crypto.randomUUID(), a = y()) {
|
|
163
|
+
this.#e = t, this.#t = i, this.#n = a, this.#s = r, this.#l = n, this.$ = {
|
|
164
|
+
activities: e(this.#c, (e) => e.activities),
|
|
165
|
+
activitiesLoadFailed: e(this.#c, (e) => e.activitiesLoadFailed),
|
|
166
|
+
activitiesLoading: e(this.#c, (e) => e.activitiesLoading),
|
|
167
|
+
activitiesLoadingMore: e(this.#c, (e) => e.activitiesLoadingMore),
|
|
168
|
+
activitiesNextCursor: e(this.#c, (e) => e.activitiesNextCursor),
|
|
169
|
+
bindings: e(this.#c, (e) => e.bindings),
|
|
170
|
+
changingTriggerId: e(this.#c, (e) => e.changingTriggerId),
|
|
171
|
+
detail: e(this.#c, (e) => e.detail),
|
|
172
|
+
detailLoading: e(this.#c, (e) => e.detailLoading),
|
|
173
|
+
live: e(this.#c, (e) => e.live),
|
|
174
|
+
loadFailed: e(this.#c, (e) => e.loadFailed),
|
|
175
|
+
loading: e(this.#c, (e) => e.loading),
|
|
176
|
+
loadMoreFailed: e(this.#c, (e) => e.loadMoreFailed),
|
|
177
|
+
loadingMore: e(this.#c, (e) => e.loadingMore),
|
|
178
|
+
nextCursor: e(this.#c, (e) => e.nextCursor),
|
|
179
|
+
publications: e(this.#c, (e) => e.publications),
|
|
180
|
+
publishing: e(this.#c, (e) => e.publishing),
|
|
181
|
+
rollingBackPublicationId: e(this.#c, (e) => e.rollingBackPublicationId),
|
|
182
|
+
selectedTriggerId: e(this.#c, (e) => e.selectedTriggerId),
|
|
183
|
+
testingTriggerId: e(this.#c, (e) => e.testingTriggerId),
|
|
184
|
+
testResult: e(this.#c, (e) => e.testResult),
|
|
185
|
+
total: e(this.#c, (e) => e.total)
|
|
185
186
|
};
|
|
186
187
|
}
|
|
187
188
|
dispose() {
|
|
@@ -190,7 +191,7 @@ var pe = class {
|
|
|
190
191
|
this.#c.dispose();
|
|
191
192
|
}
|
|
192
193
|
reset() {
|
|
193
|
-
this.#r.invalidate(), this.#i.invalidate(), this.#a.invalidate(), this.#o.invalidate(), this.#u = void 0, this.#c.set(
|
|
194
|
+
this.#r.invalidate(), this.#i.invalidate(), this.#a.invalidate(), this.#o.invalidate(), this.#u = void 0, this.#c.set(E);
|
|
194
195
|
}
|
|
195
196
|
async load(e, t) {
|
|
196
197
|
let n = {
|
|
@@ -198,7 +199,7 @@ var pe = class {
|
|
|
198
199
|
projectId: e
|
|
199
200
|
}, r = this.#r.begin();
|
|
200
201
|
D(this.#c.value.target, n) || (this.#u = void 0), this.#s(void 0), this.#c.set({
|
|
201
|
-
...
|
|
202
|
+
...E,
|
|
202
203
|
loading: !0,
|
|
203
204
|
target: n
|
|
204
205
|
});
|
|
@@ -232,7 +233,7 @@ var pe = class {
|
|
|
232
233
|
try {
|
|
233
234
|
let e = await this.#e.listPublications(n.projectId, n.flowId, {
|
|
234
235
|
cursor: t,
|
|
235
|
-
limit:
|
|
236
|
+
limit: de
|
|
236
237
|
});
|
|
237
238
|
if (!r()) return;
|
|
238
239
|
let i = new Set(this.#c.value.publications.map((e) => e.publicationId));
|
|
@@ -273,7 +274,7 @@ var pe = class {
|
|
|
273
274
|
message: this.#n.t("notice.published", { name: t.draft.name })
|
|
274
275
|
}), !0);
|
|
275
276
|
} catch (e) {
|
|
276
|
-
return s() ? (e instanceof
|
|
277
|
+
return s() ? (e instanceof u && e.code == "live.conflict" && await this.#f(n), this.#s(o(e, this.#n.t)), !1) : !1;
|
|
277
278
|
} finally {
|
|
278
279
|
s() && this.#h({ publishing: !1 });
|
|
279
280
|
}
|
|
@@ -298,7 +299,7 @@ var pe = class {
|
|
|
298
299
|
message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
|
|
299
300
|
}), !0);
|
|
300
301
|
} catch (e) {
|
|
301
|
-
return c() ? (e instanceof
|
|
302
|
+
return c() ? (e instanceof u && e.code == "live.conflict" && await this.#f(r), this.#s(o(e, this.#n.t)), !1) : !1;
|
|
302
303
|
} finally {
|
|
303
304
|
c() && this.#h({ rollingBackPublicationId: void 0 });
|
|
304
305
|
}
|
|
@@ -333,7 +334,7 @@ var pe = class {
|
|
|
333
334
|
testingTriggerId: void 0,
|
|
334
335
|
testResult: void 0
|
|
335
336
|
});
|
|
336
|
-
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.projectId, t.flowId, e), this.#e.listFlowTriggerActivities(t.projectId, t.flowId, e, { limit:
|
|
337
|
+
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.projectId, t.flowId, e), this.#e.listFlowTriggerActivities(t.projectId, t.flowId, e, { limit: ue })]);
|
|
337
338
|
if (n()) {
|
|
338
339
|
if (r.status == "rejected") {
|
|
339
340
|
this.#h({
|
|
@@ -367,7 +368,7 @@ var pe = class {
|
|
|
367
368
|
try {
|
|
368
369
|
let e = await this.#e.listFlowTriggerActivities(r.projectId, r.flowId, n, {
|
|
369
370
|
cursor: t,
|
|
370
|
-
limit:
|
|
371
|
+
limit: ue
|
|
371
372
|
});
|
|
372
373
|
if (!i() || this.#c.value.selectedTriggerId != n) return;
|
|
373
374
|
let a = new Set(this.#c.value.activities.map((e) => e.activityId));
|
|
@@ -443,14 +444,14 @@ var pe = class {
|
|
|
443
444
|
this.#e.getLive(e.projectId, e.flowId),
|
|
444
445
|
this.#e.listPublications(e.projectId, e.flowId, {
|
|
445
446
|
includeTotal: !0,
|
|
446
|
-
limit:
|
|
447
|
+
limit: de
|
|
447
448
|
}),
|
|
448
449
|
this.#e.listFlowTriggerBindings(e.projectId, e.flowId)
|
|
449
450
|
]);
|
|
450
451
|
}
|
|
451
452
|
#m(e, t) {
|
|
452
453
|
D(this.#c.value.target, e) ? this.#h(t) : this.#c.set({
|
|
453
|
-
...
|
|
454
|
+
...E,
|
|
454
455
|
...t,
|
|
455
456
|
target: e
|
|
456
457
|
});
|
|
@@ -462,7 +463,7 @@ var pe = class {
|
|
|
462
463
|
});
|
|
463
464
|
}
|
|
464
465
|
}, O = { starting: !1 };
|
|
465
|
-
function
|
|
466
|
+
function pe(e) {
|
|
466
467
|
switch (e.kind) {
|
|
467
468
|
case "condition": return { [e.node.input.handle]: e.node.input };
|
|
468
469
|
case "subflow": return e.definition?.inputs ?? {};
|
|
@@ -470,44 +471,44 @@ function me(e) {
|
|
|
470
471
|
case "value": return {};
|
|
471
472
|
}
|
|
472
473
|
}
|
|
473
|
-
function
|
|
474
|
+
function me(e) {
|
|
474
475
|
return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
|
|
475
476
|
}
|
|
476
|
-
function
|
|
477
|
-
let r =
|
|
477
|
+
async function he(e, t, n) {
|
|
478
|
+
let { FlowRunInputEditorStore: r } = await import("./flowRunInputEditorStore-B49C0ZmK.js").then((e) => e.n), i = f(e), a = i.graph({
|
|
478
479
|
id: t,
|
|
479
480
|
kind: "flow"
|
|
480
481
|
});
|
|
481
|
-
return
|
|
482
|
-
let
|
|
483
|
-
if (
|
|
484
|
-
let
|
|
482
|
+
return a == null ? [] : Object.entries(a.nodes).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, t]) => {
|
|
483
|
+
let a = i.resolveNode(e, t);
|
|
484
|
+
if (a.kind == "trigger") return [];
|
|
485
|
+
let o = Object.entries(pe(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
|
|
485
486
|
handle: e,
|
|
486
487
|
jsonSchema: t.jsonSchema,
|
|
487
488
|
nullable: t.nullable
|
|
488
489
|
}, t.description == null ? {} : { description: t.description }));
|
|
489
|
-
return
|
|
490
|
-
editor: new
|
|
490
|
+
return o.length == 0 ? [] : [{
|
|
491
|
+
editor: new r(o, n),
|
|
491
492
|
nodeId: e,
|
|
492
|
-
title:
|
|
493
|
+
title: me(a)
|
|
493
494
|
}];
|
|
494
495
|
});
|
|
495
496
|
}
|
|
496
|
-
var
|
|
497
|
+
var ge = class {
|
|
497
498
|
#e;
|
|
498
499
|
#t;
|
|
499
500
|
#n;
|
|
500
|
-
#r = new
|
|
501
|
-
#i = new
|
|
501
|
+
#r = new S();
|
|
502
|
+
#i = new S();
|
|
502
503
|
#a;
|
|
503
504
|
#o;
|
|
504
|
-
#s =
|
|
505
|
+
#s = t(O);
|
|
505
506
|
#c;
|
|
506
|
-
constructor(
|
|
507
|
-
this.#e =
|
|
508
|
-
inputRequest:
|
|
509
|
-
starting:
|
|
510
|
-
submitting:
|
|
507
|
+
constructor(t, n, r, i = y(), a = () => crypto.randomUUID()) {
|
|
508
|
+
this.#e = t, this.#a = n, this.#o = r, this.#n = i, this.#t = a, this.$ = {
|
|
509
|
+
inputRequest: e(this.#s, (e) => e.inputRequest),
|
|
510
|
+
starting: e(this.#s, (e) => e.starting),
|
|
511
|
+
submitting: e(this.#s, (e) => e.submitting)
|
|
511
512
|
};
|
|
512
513
|
}
|
|
513
514
|
dispose() {
|
|
@@ -521,7 +522,9 @@ var _e = class {
|
|
|
521
522
|
this.#s.set(O), this.#d(e);
|
|
522
523
|
}
|
|
523
524
|
async requestDraft(e, t, n) {
|
|
524
|
-
|
|
525
|
+
if (t.draft == null) return "unavailable";
|
|
526
|
+
let r = this.#i.begin();
|
|
527
|
+
return await this.#l("draft", e, t, n, t.draft.revisionId, r);
|
|
525
528
|
}
|
|
526
529
|
async requestLive(e, t) {
|
|
527
530
|
let n = t.live?.publication.revisionId;
|
|
@@ -530,7 +533,7 @@ var _e = class {
|
|
|
530
533
|
this.#o(void 0), this.#f({ starting: !0 });
|
|
531
534
|
try {
|
|
532
535
|
let i = await this.#e.getRevision(e, n);
|
|
533
|
-
return r() ? await this.#l("live", e, t, i, n) : "unavailable";
|
|
536
|
+
return r() ? await this.#l("live", e, t, i, n, r) : "unavailable";
|
|
534
537
|
} catch (e) {
|
|
535
538
|
return r() && this.#o(o(e, this.#n.t)), "unavailable";
|
|
536
539
|
} finally {
|
|
@@ -551,21 +554,41 @@ var _e = class {
|
|
|
551
554
|
let t = Object.fromEntries(e.groups.map((e) => [e.nodeId, e.editor.values()])), n = await this.#u(e.source, e.projectId, e.flow, e.revisionId, t);
|
|
552
555
|
return n && this.#s.value.inputRequest === e && this.dismissInputs(), n;
|
|
553
556
|
}
|
|
554
|
-
async #l(e, t,
|
|
555
|
-
let
|
|
556
|
-
this.#f({
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
557
|
+
async #l(e, t, r, i, a, o) {
|
|
558
|
+
let s = this.#s.value.inputRequest;
|
|
559
|
+
this.#f({
|
|
560
|
+
inputRequest: void 0,
|
|
561
|
+
starting: !0,
|
|
562
|
+
submitting: e
|
|
563
|
+
}), this.#d(s);
|
|
564
|
+
let c;
|
|
565
|
+
try {
|
|
566
|
+
c = await he(i, r.flowId, this.#n.lang$);
|
|
567
|
+
} catch (e) {
|
|
568
|
+
throw o() && this.#f({
|
|
569
|
+
starting: !1,
|
|
570
|
+
submitting: void 0
|
|
571
|
+
}), e;
|
|
572
|
+
}
|
|
573
|
+
if (!o()) {
|
|
574
|
+
for (let e of c) e.editor.dispose();
|
|
575
|
+
return "unavailable";
|
|
576
|
+
}
|
|
577
|
+
if (c.length == 0) return await this.#u(e, t, r, a) ? "started" : "unavailable";
|
|
578
|
+
let l = n((e) => c.every((t) => e(t.editor.valid$)));
|
|
579
|
+
return this.#f({
|
|
580
|
+
inputRequest: {
|
|
581
|
+
attempted: !1,
|
|
582
|
+
flow: r,
|
|
583
|
+
groups: c,
|
|
584
|
+
projectId: t,
|
|
585
|
+
revisionId: a,
|
|
586
|
+
source: e,
|
|
587
|
+
valid: l
|
|
588
|
+
},
|
|
589
|
+
starting: !1,
|
|
590
|
+
submitting: void 0
|
|
591
|
+
}), "input";
|
|
569
592
|
}
|
|
570
593
|
async #u(e, t, n, r, i = {}) {
|
|
571
594
|
if (e == "draft" && n.draft == null || e == "live" && n.live == null) return !1;
|
|
@@ -574,23 +597,25 @@ var _e = class {
|
|
|
574
597
|
starting: !0,
|
|
575
598
|
submitting: e
|
|
576
599
|
});
|
|
577
|
-
let c =
|
|
600
|
+
let c = e == "draft" ? {
|
|
578
601
|
flowId: n.flowId,
|
|
579
|
-
inputs: i,
|
|
580
602
|
projectId: t,
|
|
581
|
-
revisionId: r
|
|
582
|
-
|
|
583
|
-
|
|
603
|
+
revisionId: r
|
|
604
|
+
} : { publicationId: n.live.publication.publicationId }, l = JSON.stringify({
|
|
605
|
+
inputs: i,
|
|
606
|
+
source: e,
|
|
607
|
+
...c
|
|
608
|
+
}), u = this.#c?.signature == l ? this.#c : {
|
|
584
609
|
key: this.#t(),
|
|
585
|
-
signature:
|
|
610
|
+
signature: l
|
|
586
611
|
};
|
|
587
|
-
this.#c =
|
|
612
|
+
this.#c = u;
|
|
588
613
|
try {
|
|
589
614
|
let o = e == "draft" ? await this.#e.createDraftRun(t, r, n.flowId, {
|
|
590
|
-
idempotencyKey:
|
|
615
|
+
idempotencyKey: u.key,
|
|
591
616
|
inputs: i
|
|
592
|
-
}) : await this.#e.createLiveRun(
|
|
593
|
-
idempotencyKey:
|
|
617
|
+
}) : await this.#e.createLiveRun(n.live.publication.publicationId, {
|
|
618
|
+
idempotencyKey: u.key,
|
|
594
619
|
inputs: i
|
|
595
620
|
});
|
|
596
621
|
return !a() || !s() ? !1 : (this.#c = void 0, this.#a.follow(o, s));
|
|
@@ -642,7 +667,7 @@ function j(e, t) {
|
|
|
642
667
|
outputs: A(e.outputs)
|
|
643
668
|
};
|
|
644
669
|
}
|
|
645
|
-
function
|
|
670
|
+
function _e(e, t) {
|
|
646
671
|
let n = /* @__PURE__ */ new Map();
|
|
647
672
|
for (let t of e) {
|
|
648
673
|
let e = n.get(t.serviceId) ?? [];
|
|
@@ -671,7 +696,7 @@ function ve(e, t) {
|
|
|
671
696
|
};
|
|
672
697
|
});
|
|
673
698
|
}
|
|
674
|
-
function
|
|
699
|
+
function ve(e, t) {
|
|
675
700
|
return {
|
|
676
701
|
choices: [],
|
|
677
702
|
description: t("addNode.connectorBrowseActions"),
|
|
@@ -685,7 +710,7 @@ function ye(e, t) {
|
|
|
685
710
|
serviceId: e.serviceId
|
|
686
711
|
};
|
|
687
712
|
}
|
|
688
|
-
function
|
|
713
|
+
function ye(e) {
|
|
689
714
|
if (e?.kind != "task" || e.node.task != null) return;
|
|
690
715
|
let t = e.definition;
|
|
691
716
|
if (!(t == null || !("executor" in t) || t.executor.kind != "connector")) return {
|
|
@@ -710,13 +735,13 @@ var be = class {
|
|
|
710
735
|
#d;
|
|
711
736
|
#f;
|
|
712
737
|
#p;
|
|
713
|
-
constructor(
|
|
714
|
-
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new
|
|
738
|
+
constructor(r, i, a, o, s = y()) {
|
|
739
|
+
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new S(), this.#l = t(k), this.#p = !1, this.browseAddNodeOptions = async (e) => {
|
|
715
740
|
if (this.#p) return;
|
|
716
741
|
let t = this.#u.$.projectId.value;
|
|
717
742
|
if (t == null) return;
|
|
718
743
|
let n = this.#f ?? await this.#e.listConnectorProviders(t, e);
|
|
719
|
-
if (!(e.aborted || this.#p || t != this.#u.$.projectId.value)) return this.#f = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) =>
|
|
744
|
+
if (!(e.aborted || this.#p || t != this.#u.$.projectId.value)) return this.#f = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => ve(e, this.#t.t));
|
|
720
745
|
}, this.provideAddNodeOptionChoices = async (e, t) => {
|
|
721
746
|
if (this.#p) return;
|
|
722
747
|
let n = this.#u.$.projectId.value, r = this.#f?.find((t) => `connector-provider:${t.serviceId}` == e);
|
|
@@ -742,33 +767,33 @@ var be = class {
|
|
|
742
767
|
let t = a[e];
|
|
743
768
|
t != null && o.set(e, t);
|
|
744
769
|
}
|
|
745
|
-
return
|
|
746
|
-
}, this.#e =
|
|
747
|
-
let c =
|
|
748
|
-
this.#s =
|
|
749
|
-
let
|
|
750
|
-
if (
|
|
751
|
-
let
|
|
752
|
-
return o == null &&
|
|
753
|
-
action:
|
|
754
|
-
actionError:
|
|
770
|
+
return _e([...o.values()], this.#t.t);
|
|
771
|
+
}, this.#e = r, this.#n = o, this.#u = i, this.#c = a, this.#t = s;
|
|
772
|
+
let c = e(this.#l, (e) => e.actions), l = e(this.#l, (e) => e.catalogs);
|
|
773
|
+
this.#s = n((e) => {
|
|
774
|
+
let t = ye(e(i.$.selection)), n = e(this.#l);
|
|
775
|
+
if (t == null) return { authorizationPending: !1 };
|
|
776
|
+
let r = n.actions[t.actionId], a = r == null ? void 0 : n.catalogs[r.serviceId], o = t.connectionId == null ? void 0 : a?.byId.get(t.connectionId);
|
|
777
|
+
return o == null && r?.defaultConnection?.connectionId == t.connectionId && (o = r.defaultConnection), {
|
|
778
|
+
action: r,
|
|
779
|
+
actionError: n.actionError?.actionId == t.actionId ? n.actionError.message : void 0,
|
|
755
780
|
activeConnections: a?.active,
|
|
756
|
-
authorizationPending:
|
|
781
|
+
authorizationPending: r != null && n.authorizationServiceId == r.serviceId,
|
|
757
782
|
connection: o,
|
|
758
|
-
connectionError:
|
|
783
|
+
connectionError: r != null && n.connectionError?.serviceId == r.serviceId ? n.connectionError.message : void 0
|
|
759
784
|
};
|
|
760
785
|
}), this.$ = {
|
|
761
|
-
actionLoading:
|
|
786
|
+
actionLoading: e(this.#l, (e) => e.actionLoading),
|
|
762
787
|
actions: c,
|
|
763
|
-
catalogs:
|
|
764
|
-
connectionLoading:
|
|
765
|
-
selectedAction:
|
|
766
|
-
selectedActionError:
|
|
767
|
-
selectedActiveConnections:
|
|
768
|
-
selectedAuthorizationPending:
|
|
769
|
-
selectedConnection:
|
|
770
|
-
selectedConnectionError:
|
|
771
|
-
}, this.#o =
|
|
788
|
+
catalogs: l,
|
|
789
|
+
connectionLoading: e(this.#l, (e) => e.connectionLoading),
|
|
790
|
+
selectedAction: e(this.#s, (e) => e.action),
|
|
791
|
+
selectedActionError: e(this.#s, (e) => e.actionError),
|
|
792
|
+
selectedActiveConnections: e(this.#s, (e) => e.activeConnections),
|
|
793
|
+
selectedAuthorizationPending: e(this.#s, (e) => e.authorizationPending),
|
|
794
|
+
selectedConnection: e(this.#s, (e) => e.connection),
|
|
795
|
+
selectedConnectionError: e(this.#s, (e) => e.connectionError)
|
|
796
|
+
}, this.#o = i.$.revision.reaction(() => void this.#b());
|
|
772
797
|
}
|
|
773
798
|
dispose() {
|
|
774
799
|
this.#p = !0, this.#a.invalidate(), this.#o();
|
|
@@ -780,7 +805,7 @@ var be = class {
|
|
|
780
805
|
}
|
|
781
806
|
async refresh(e = !1) {
|
|
782
807
|
if (this.#p) return;
|
|
783
|
-
let t = this.#a.begin(), n = this.#u.$.projectId.value, r =
|
|
808
|
+
let t = this.#a.begin(), n = this.#u.$.projectId.value, r = ye(this.#u.$.selection.value);
|
|
784
809
|
if (n == null || r == null) {
|
|
785
810
|
(this.#l.value.actionLoading != null || this.#l.value.connectionLoading != null) && this.#v({
|
|
786
811
|
actionLoading: void 0,
|
|
@@ -816,7 +841,7 @@ var be = class {
|
|
|
816
841
|
if (t == null) return;
|
|
817
842
|
let n = this.#l.value.catalogs[e];
|
|
818
843
|
try {
|
|
819
|
-
if (!await this.#n.openExternalPage(() => this.#e.createConnectorConnectionPage(t, e
|
|
844
|
+
if (!await this.#n.openExternalPage(() => this.#e.createConnectorConnectionPage(t, e))) {
|
|
820
845
|
this.#c({
|
|
821
846
|
kind: "error",
|
|
822
847
|
message: this.#t.t("notice.connectionPopupBlocked")
|
|
@@ -868,11 +893,11 @@ var be = class {
|
|
|
868
893
|
return;
|
|
869
894
|
}
|
|
870
895
|
if (!this.#y(r, e)) return;
|
|
871
|
-
let
|
|
896
|
+
let c = s(a);
|
|
872
897
|
return this.#v({ catalogs: {
|
|
873
898
|
...this.#l.value.catalogs,
|
|
874
|
-
[t]:
|
|
875
|
-
} }),
|
|
899
|
+
[t]: c
|
|
900
|
+
} }), c;
|
|
876
901
|
}
|
|
877
902
|
async #_(e, t, n) {
|
|
878
903
|
let r = this.#d?.serviceId == t ? this.#d : void 0, i = r == null ? [] : n.active.filter((e) => !r.connectionIds.has(e.connectionId)), a = i.length == 1 ? i[0] : n.preferred, o = this.#u.$.revision.value?.task(e.taskId);
|
|
@@ -907,8 +932,8 @@ var be = class {
|
|
|
907
932
|
}
|
|
908
933
|
}
|
|
909
934
|
}
|
|
910
|
-
},
|
|
911
|
-
function
|
|
935
|
+
}, M = { catalogs: {} }, N = 4, P = "trigger:";
|
|
936
|
+
function F(e, t) {
|
|
912
937
|
if (e?.kind != "trigger") return;
|
|
913
938
|
let n = e.trigger;
|
|
914
939
|
if (n.kind != "poll" && n.kind != "integration") return;
|
|
@@ -919,7 +944,7 @@ function I(e, t) {
|
|
|
919
944
|
triggerId: e.id
|
|
920
945
|
};
|
|
921
946
|
}
|
|
922
|
-
function
|
|
947
|
+
function I(e, t, n, r) {
|
|
923
948
|
return {
|
|
924
949
|
description: n,
|
|
925
950
|
group: r,
|
|
@@ -938,24 +963,24 @@ function L(e, t, n, r) {
|
|
|
938
963
|
}
|
|
939
964
|
};
|
|
940
965
|
}
|
|
941
|
-
function
|
|
966
|
+
function xe(e, t) {
|
|
942
967
|
return {
|
|
943
968
|
choices: [],
|
|
944
969
|
description: t.t("addNode.triggerChooseConnection"),
|
|
945
970
|
group: t.t("addNode.triggers"),
|
|
946
|
-
id: `${
|
|
971
|
+
id: `${P}${e.key}`,
|
|
947
972
|
inputs: [],
|
|
948
973
|
kind: "trigger",
|
|
949
974
|
label: e.displayName,
|
|
950
975
|
outputs: []
|
|
951
976
|
};
|
|
952
977
|
}
|
|
953
|
-
function
|
|
978
|
+
function L(e, t, n) {
|
|
954
979
|
let r = n.t("addNode.triggers"), i = t.preferred;
|
|
955
|
-
return i == null ? t.active.length > 0 ? t.active.map((t) =>
|
|
980
|
+
return i == null ? t.active.length > 0 ? t.active.map((t) => I(e, t.connectionId, t.displayName, r)) : [{
|
|
956
981
|
description: n.t("addNode.triggerNeedsConnection", { provider: e.provider }),
|
|
957
982
|
group: r,
|
|
958
|
-
id: `${
|
|
983
|
+
id: `${P}${e.key}:connect`,
|
|
959
984
|
inputs: [],
|
|
960
985
|
kind: "trigger",
|
|
961
986
|
label: n.t("addNode.triggerAddConnection"),
|
|
@@ -964,12 +989,12 @@ function z(e, t, n) {
|
|
|
964
989
|
kind: "connect",
|
|
965
990
|
provider: e.provider
|
|
966
991
|
}
|
|
967
|
-
}] : [
|
|
992
|
+
}] : [I(e, i.connectionId, i.displayName, r)];
|
|
968
993
|
}
|
|
969
|
-
function
|
|
994
|
+
function Se(e, t, n) {
|
|
970
995
|
let r = t.preferred;
|
|
971
|
-
if (r != null) return
|
|
972
|
-
let i =
|
|
996
|
+
if (r != null) return I(e, r.connectionId, r.displayName, n.t("addNode.triggers"));
|
|
997
|
+
let i = xe(e, n), a = L(e, t, n);
|
|
973
998
|
return {
|
|
974
999
|
...i,
|
|
975
1000
|
description: t.active.length == 0 ? n.t("addNode.triggerNeedsConnection", { provider: e.provider }) : i.description,
|
|
@@ -984,7 +1009,7 @@ function xe(e, t, n) {
|
|
|
984
1009
|
}))
|
|
985
1010
|
};
|
|
986
1011
|
}
|
|
987
|
-
var
|
|
1012
|
+
var Ce = class {
|
|
988
1013
|
#e;
|
|
989
1014
|
#t;
|
|
990
1015
|
#n;
|
|
@@ -996,12 +1021,12 @@ var Se = class {
|
|
|
996
1021
|
#c;
|
|
997
1022
|
#l;
|
|
998
1023
|
#u;
|
|
999
|
-
constructor(
|
|
1000
|
-
this.#t = new AbortController(), this.#a = new
|
|
1024
|
+
constructor(r, i, a, o, c = y()) {
|
|
1025
|
+
this.#t = new AbortController(), this.#a = new S(), this.#c = t(M), this.#u = !1, this.browseAddNodeOptions = async (e) => {
|
|
1001
1026
|
let t = this.#l.$.projectId.value;
|
|
1002
1027
|
if (e.aborted || this.#u || t == null || this.#l.$.target.value?.kind != "flow") return [];
|
|
1003
1028
|
let n = await this.#d();
|
|
1004
|
-
if (!(e.aborted || this.#u || t != this.#l.$.projectId.value)) return [...n.values()].map((e) =>
|
|
1029
|
+
if (!(e.aborted || this.#u || t != this.#l.$.projectId.value)) return [...n.values()].map((e) => xe(e, this.#i));
|
|
1005
1030
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
1006
1031
|
let n = this.#l.$.projectId.value;
|
|
1007
1032
|
if (t.aborted || this.#u || n == null || this.#l.$.target.value?.kind != "flow") return [];
|
|
@@ -1017,49 +1042,49 @@ var Se = class {
|
|
|
1017
1042
|
e.provider,
|
|
1018
1043
|
e.type
|
|
1019
1044
|
].some((e) => e.toLowerCase().includes(r))), o = [...new Set(a.map((e) => e.provider))].filter((e) => this.#c.value.catalogs[e] == null);
|
|
1020
|
-
for (let e = 0; e < o.length; e +=
|
|
1021
|
-
let r = await Promise.all(o.slice(e, e +
|
|
1045
|
+
for (let e = 0; e < o.length; e += N) {
|
|
1046
|
+
let r = await Promise.all(o.slice(e, e + N).map(async (e) => [e, s(await this.#n.listConnectorConnections(n, e, t))]));
|
|
1022
1047
|
if (t.aborted || this.#u || n != this.#l.$.projectId.value) return;
|
|
1023
1048
|
this.#f({ catalogs: {
|
|
1024
1049
|
...this.#c.value.catalogs,
|
|
1025
1050
|
...Object.fromEntries(r)
|
|
1026
1051
|
} });
|
|
1027
1052
|
}
|
|
1028
|
-
return a.map((e) =>
|
|
1053
|
+
return a.map((e) => Se(e, this.#c.value.catalogs[e.provider], this.#i));
|
|
1029
1054
|
}, this.provideAddNodeOptionChoices = async (e, t) => {
|
|
1030
|
-
let n = this.#l.$.projectId.value, r = e.startsWith(
|
|
1055
|
+
let n = this.#l.$.projectId.value, r = e.startsWith(P) ? e.slice(8) : void 0;
|
|
1031
1056
|
if (t.aborted || this.#u || n == null || r == null || this.#l.$.target.value?.kind != "flow") return;
|
|
1032
1057
|
let i = (await this.#d()).get(r);
|
|
1033
1058
|
if (t.aborted || this.#u || n != this.#l.$.projectId.value || i == null) return;
|
|
1034
1059
|
let a = this.#c.value.catalogs[i.provider];
|
|
1035
1060
|
if (a == null) {
|
|
1036
|
-
if (a =
|
|
1061
|
+
if (a = s(await this.#n.listConnectorConnections(n, i.provider, t)), t.aborted || this.#u || n != this.#l.$.projectId.value) return;
|
|
1037
1062
|
this.#f({ catalogs: {
|
|
1038
1063
|
...this.#c.value.catalogs,
|
|
1039
1064
|
[i.provider]: a
|
|
1040
1065
|
} });
|
|
1041
1066
|
}
|
|
1042
|
-
return
|
|
1043
|
-
}, this.#n =
|
|
1044
|
-
let
|
|
1045
|
-
if (
|
|
1046
|
-
let a =
|
|
1067
|
+
return L(i, a, this.#i);
|
|
1068
|
+
}, this.#n = r, this.#r = o, this.#i = c, this.#s = a, this.#l = i, this.#o = n((e) => {
|
|
1069
|
+
let t = e(i.$.selection), n = F(t, i), r = e(this.#c);
|
|
1070
|
+
if (t?.kind != "trigger") return { authorizationPending: !1 };
|
|
1071
|
+
let a = t.trigger;
|
|
1047
1072
|
if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
|
|
1048
|
-
let o =
|
|
1073
|
+
let o = n == null ? void 0 : r.catalogs[n.provider], s = r.connectionError;
|
|
1049
1074
|
return {
|
|
1050
1075
|
activeConnections: o?.active,
|
|
1051
|
-
authorizationPending:
|
|
1052
|
-
connection:
|
|
1053
|
-
connectionError: s != null && s.provider ==
|
|
1076
|
+
authorizationPending: r.authorizationProvider == n?.provider,
|
|
1077
|
+
connection: n?.connectionId == null ? void 0 : o?.byId.get(n.connectionId),
|
|
1078
|
+
connectionError: s != null && s.provider == n?.provider ? s.message : void 0,
|
|
1054
1079
|
definition: a.definition
|
|
1055
1080
|
};
|
|
1056
1081
|
}), this.$ = {
|
|
1057
|
-
connectionLoading:
|
|
1058
|
-
selectedActiveConnections:
|
|
1059
|
-
selectedAuthorizationPending:
|
|
1060
|
-
selectedConnection:
|
|
1061
|
-
selectedConnectionError:
|
|
1062
|
-
selectedDefinition:
|
|
1082
|
+
connectionLoading: e(this.#c, (e) => e.connectionLoading),
|
|
1083
|
+
selectedActiveConnections: e(this.#o, (e) => e.activeConnections),
|
|
1084
|
+
selectedAuthorizationPending: e(this.#o, (e) => e.authorizationPending),
|
|
1085
|
+
selectedConnection: e(this.#o, (e) => e.connection),
|
|
1086
|
+
selectedConnectionError: e(this.#o, (e) => e.connectionError),
|
|
1087
|
+
selectedDefinition: e(this.#o, (e) => e.definition)
|
|
1063
1088
|
};
|
|
1064
1089
|
}
|
|
1065
1090
|
dispose() {
|
|
@@ -1068,10 +1093,10 @@ var Se = class {
|
|
|
1068
1093
|
this.#o.dispose(), this.#c.dispose();
|
|
1069
1094
|
}
|
|
1070
1095
|
reset() {
|
|
1071
|
-
this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(
|
|
1096
|
+
this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(M));
|
|
1072
1097
|
}
|
|
1073
1098
|
async refresh(e = !1) {
|
|
1074
|
-
let t = this.#a.begin(), n = this.#l.$.projectId.value, r =
|
|
1099
|
+
let t = this.#a.begin(), n = this.#l.$.projectId.value, r = F(this.#l.$.selection.value, this.#l);
|
|
1075
1100
|
if (!this.#u) {
|
|
1076
1101
|
if (n == null || r == null) {
|
|
1077
1102
|
this.#c.value.connectionLoading != null && this.#f({ connectionLoading: void 0 });
|
|
@@ -1083,7 +1108,7 @@ var Se = class {
|
|
|
1083
1108
|
connectionLoading: r.provider
|
|
1084
1109
|
});
|
|
1085
1110
|
try {
|
|
1086
|
-
let e =
|
|
1111
|
+
let e = s(await this.#n.listConnectorConnections(n, r.provider));
|
|
1087
1112
|
if (!this.#p(t, n)) return;
|
|
1088
1113
|
this.#f({ catalogs: {
|
|
1089
1114
|
...this.#c.value.catalogs,
|
|
@@ -1103,7 +1128,7 @@ var Se = class {
|
|
|
1103
1128
|
async connect(e) {
|
|
1104
1129
|
let t = this.#l.$.projectId.value;
|
|
1105
1130
|
if (!(this.#u || t == null)) try {
|
|
1106
|
-
if (!await this.#r.openExternalPage(() => this.#n.createConnectorConnectionPage(t, e
|
|
1131
|
+
if (!await this.#r.openExternalPage(() => this.#n.createConnectorConnectionPage(t, e))) {
|
|
1107
1132
|
this.#s({
|
|
1108
1133
|
kind: "error",
|
|
1109
1134
|
message: this.#i.t("notice.connectionPopupBlocked")
|
|
@@ -1128,7 +1153,7 @@ var Se = class {
|
|
|
1128
1153
|
delete t[e], this.#f({
|
|
1129
1154
|
authorizationProvider: void 0,
|
|
1130
1155
|
catalogs: t
|
|
1131
|
-
}),
|
|
1156
|
+
}), F(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
|
|
1132
1157
|
}
|
|
1133
1158
|
#d() {
|
|
1134
1159
|
if (this.#e != null) return this.#e;
|
|
@@ -1149,38 +1174,38 @@ var Se = class {
|
|
|
1149
1174
|
};
|
|
1150
1175
|
//#endregion
|
|
1151
1176
|
//#region src/project/common/edgeChanges.ts
|
|
1152
|
-
function
|
|
1177
|
+
function R(e, t, n) {
|
|
1153
1178
|
let r = {
|
|
1154
1179
|
source: n.source,
|
|
1155
1180
|
sourceHandle: n.sourceHandle,
|
|
1156
1181
|
target: n.target,
|
|
1157
1182
|
targetHandle: n.targetHandle
|
|
1158
|
-
}, i =
|
|
1183
|
+
}, i = z(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
1159
1184
|
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
|
|
1160
1185
|
edge: r,
|
|
1161
1186
|
kind: "graph.edge.connect",
|
|
1162
1187
|
target: t
|
|
1163
1188
|
}];
|
|
1164
1189
|
}
|
|
1165
|
-
function
|
|
1190
|
+
function we(e, t, n) {
|
|
1166
1191
|
let r = {
|
|
1167
1192
|
source: n.source,
|
|
1168
1193
|
sourceHandle: n.sourceHandle,
|
|
1169
1194
|
target: n.target,
|
|
1170
1195
|
targetHandle: n.targetHandle
|
|
1171
|
-
}, i =
|
|
1196
|
+
}, i = z(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
1172
1197
|
return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
|
|
1173
1198
|
edge: r,
|
|
1174
1199
|
kind: "graph.edge.disconnect",
|
|
1175
1200
|
target: t
|
|
1176
1201
|
}];
|
|
1177
1202
|
}
|
|
1178
|
-
function
|
|
1203
|
+
function z(e, t) {
|
|
1179
1204
|
return t.kind == "flow" ? e.document.flows[t.id]?.graph : e.document.subflows[t.id]?.graph;
|
|
1180
1205
|
}
|
|
1181
1206
|
//#endregion
|
|
1182
1207
|
//#region src/project/common/flowChanges.ts
|
|
1183
|
-
function
|
|
1208
|
+
function Te(e, t) {
|
|
1184
1209
|
return [{
|
|
1185
1210
|
flow: {
|
|
1186
1211
|
graph: { nodes: {} },
|
|
@@ -1190,14 +1215,14 @@ function we(e, t) {
|
|
|
1190
1215
|
kind: "flow.create"
|
|
1191
1216
|
}];
|
|
1192
1217
|
}
|
|
1193
|
-
function
|
|
1218
|
+
function Ee(e, t) {
|
|
1194
1219
|
return [{
|
|
1195
1220
|
flowId: e,
|
|
1196
1221
|
kind: "flow.rename",
|
|
1197
1222
|
name: t
|
|
1198
1223
|
}];
|
|
1199
1224
|
}
|
|
1200
|
-
function
|
|
1225
|
+
function De(e) {
|
|
1201
1226
|
return [{
|
|
1202
1227
|
flowId: e,
|
|
1203
1228
|
kind: "flow.delete"
|
|
@@ -1205,7 +1230,7 @@ function Ee(e) {
|
|
|
1205
1230
|
}
|
|
1206
1231
|
//#endregion
|
|
1207
1232
|
//#region src/project/common/moduleChanges.ts
|
|
1208
|
-
async function
|
|
1233
|
+
async function Oe(e) {
|
|
1209
1234
|
try {
|
|
1210
1235
|
let { parse: t } = await import("./lib-S4ccuMeT.js"), n = t(e, {
|
|
1211
1236
|
errorRecovery: !0,
|
|
@@ -1221,7 +1246,7 @@ async function De(e) {
|
|
|
1221
1246
|
return [];
|
|
1222
1247
|
}
|
|
1223
1248
|
}
|
|
1224
|
-
function
|
|
1249
|
+
function ke(e, t, n) {
|
|
1225
1250
|
return [{
|
|
1226
1251
|
imports: n,
|
|
1227
1252
|
kind: "module.source.replace",
|
|
@@ -1231,7 +1256,7 @@ function Oe(e, t, n) {
|
|
|
1231
1256
|
}
|
|
1232
1257
|
//#endregion
|
|
1233
1258
|
//#region src/project/common/nodeChanges.ts
|
|
1234
|
-
function
|
|
1259
|
+
function Ae(e, t, n, r = {
|
|
1235
1260
|
imports: [],
|
|
1236
1261
|
source: "export default function run(input) {\n return { result: input.value }\n}\n"
|
|
1237
1262
|
}, i = {
|
|
@@ -1256,7 +1281,7 @@ function ke(e, t, n, r = {
|
|
|
1256
1281
|
kind: "graph.node.create",
|
|
1257
1282
|
node: {
|
|
1258
1283
|
concurrency: 1,
|
|
1259
|
-
inputs:
|
|
1284
|
+
inputs: U(i.inputs),
|
|
1260
1285
|
kind: "task",
|
|
1261
1286
|
name: n,
|
|
1262
1287
|
task: {
|
|
@@ -1270,7 +1295,7 @@ function ke(e, t, n, r = {
|
|
|
1270
1295
|
target: e
|
|
1271
1296
|
}];
|
|
1272
1297
|
}
|
|
1273
|
-
function
|
|
1298
|
+
function B(e, t, n) {
|
|
1274
1299
|
return [{
|
|
1275
1300
|
kind: "task.create",
|
|
1276
1301
|
task: n,
|
|
@@ -1279,7 +1304,7 @@ function H(e, t, n) {
|
|
|
1279
1304
|
kind: "graph.node.create",
|
|
1280
1305
|
node: {
|
|
1281
1306
|
concurrency: 1,
|
|
1282
|
-
inputs:
|
|
1307
|
+
inputs: U(n.inputs),
|
|
1283
1308
|
kind: "task",
|
|
1284
1309
|
name: n.name,
|
|
1285
1310
|
taskId: t.taskId
|
|
@@ -1288,9 +1313,9 @@ function H(e, t, n) {
|
|
|
1288
1313
|
target: e
|
|
1289
1314
|
}];
|
|
1290
1315
|
}
|
|
1291
|
-
function
|
|
1316
|
+
function je(e, t, n, r, i, a = {}) {
|
|
1292
1317
|
let o = a.inputs ?? {};
|
|
1293
|
-
return
|
|
1318
|
+
return B(e, t, {
|
|
1294
1319
|
executor: {
|
|
1295
1320
|
kind: "llm",
|
|
1296
1321
|
mode: r
|
|
@@ -1302,12 +1327,12 @@ function Ae(e, t, n, r, i, a = {}) {
|
|
|
1302
1327
|
type: "array"
|
|
1303
1328
|
},
|
|
1304
1329
|
nullable: !0,
|
|
1305
|
-
value:
|
|
1330
|
+
value: W(o, "messages", null)
|
|
1306
1331
|
},
|
|
1307
1332
|
input: {
|
|
1308
1333
|
jsonSchema: { type: "string" },
|
|
1309
1334
|
nullable: !1,
|
|
1310
|
-
value:
|
|
1335
|
+
value: W(o, "input", "Alex")
|
|
1311
1336
|
},
|
|
1312
1337
|
template: {
|
|
1313
1338
|
jsonSchema: {
|
|
@@ -1316,7 +1341,7 @@ function Ae(e, t, n, r, i, a = {}) {
|
|
|
1316
1341
|
type: "array"
|
|
1317
1342
|
},
|
|
1318
1343
|
nullable: !1,
|
|
1319
|
-
value:
|
|
1344
|
+
value: W(o, "template", [{
|
|
1320
1345
|
content: "Hello, I'm {{input}}",
|
|
1321
1346
|
role: "user"
|
|
1322
1347
|
}])
|
|
@@ -1324,7 +1349,7 @@ function Ae(e, t, n, r, i, a = {}) {
|
|
|
1324
1349
|
model: {
|
|
1325
1350
|
jsonSchema: { type: "object" },
|
|
1326
1351
|
nullable: !1,
|
|
1327
|
-
value:
|
|
1352
|
+
value: W(o, "model", { model: "deepseek-v4-flash" })
|
|
1328
1353
|
}
|
|
1329
1354
|
},
|
|
1330
1355
|
name: n,
|
|
@@ -1335,7 +1360,7 @@ function Ae(e, t, n, r, i, a = {}) {
|
|
|
1335
1360
|
} }
|
|
1336
1361
|
});
|
|
1337
1362
|
}
|
|
1338
|
-
function
|
|
1363
|
+
function Me(e, t, n) {
|
|
1339
1364
|
return [{
|
|
1340
1365
|
kind: "graph.node.create",
|
|
1341
1366
|
node: {
|
|
@@ -1366,7 +1391,7 @@ function je(e, t, n) {
|
|
|
1366
1391
|
target: e
|
|
1367
1392
|
}];
|
|
1368
1393
|
}
|
|
1369
|
-
function
|
|
1394
|
+
function Ne(e, t, n) {
|
|
1370
1395
|
return [{
|
|
1371
1396
|
kind: "graph.node.create",
|
|
1372
1397
|
node: {
|
|
@@ -1384,7 +1409,7 @@ function Me(e, t, n) {
|
|
|
1384
1409
|
target: e
|
|
1385
1410
|
}];
|
|
1386
1411
|
}
|
|
1387
|
-
function
|
|
1412
|
+
function V(e, t, n) {
|
|
1388
1413
|
return [{
|
|
1389
1414
|
kind: "graph.node.create",
|
|
1390
1415
|
node: n,
|
|
@@ -1392,7 +1417,7 @@ function U(e, t, n) {
|
|
|
1392
1417
|
target: e
|
|
1393
1418
|
}];
|
|
1394
1419
|
}
|
|
1395
|
-
function
|
|
1420
|
+
function Pe(e, t, n, r) {
|
|
1396
1421
|
let i = r.name ?? n.displayName, a = n.type == "poll" ? {
|
|
1397
1422
|
bindingId: t.bindingId,
|
|
1398
1423
|
config: r.config,
|
|
@@ -1425,8 +1450,8 @@ function Ne(e, t, n, r) {
|
|
|
1425
1450
|
target: e
|
|
1426
1451
|
}];
|
|
1427
1452
|
}
|
|
1428
|
-
function
|
|
1429
|
-
let r =
|
|
1453
|
+
function Fe(e, t, n) {
|
|
1454
|
+
let r = H(e, t)?.nodes;
|
|
1430
1455
|
if (r == null) return [];
|
|
1431
1456
|
let i = new Set(n), a = n.flatMap((e) => {
|
|
1432
1457
|
let n = r[e];
|
|
@@ -1450,32 +1475,32 @@ function Pe(e, t, n) {
|
|
|
1450
1475
|
});
|
|
1451
1476
|
return a;
|
|
1452
1477
|
}
|
|
1453
|
-
function
|
|
1454
|
-
let i =
|
|
1478
|
+
function Ie(e, t, n, r) {
|
|
1479
|
+
let i = H(e, t)?.nodes[n];
|
|
1455
1480
|
if (i == null || !("inputs" in i)) return;
|
|
1456
1481
|
let { concurrency: a, name: o, timeoutMs: s, ...c } = i;
|
|
1457
|
-
return
|
|
1482
|
+
return G(t, n, {
|
|
1458
1483
|
...c,
|
|
1459
1484
|
...r
|
|
1460
1485
|
});
|
|
1461
1486
|
}
|
|
1462
|
-
function
|
|
1463
|
-
return
|
|
1487
|
+
function Le(e, t, n, r, i) {
|
|
1488
|
+
return Re(e, t, n, { [r]: i });
|
|
1464
1489
|
}
|
|
1465
|
-
function
|
|
1466
|
-
let i =
|
|
1490
|
+
function Re(e, t, n, r) {
|
|
1491
|
+
let i = H(e, t)?.nodes[n];
|
|
1467
1492
|
if (i == null || !("inputs" in i)) return;
|
|
1468
1493
|
let a = { ...i.inputs };
|
|
1469
1494
|
for (let [e, t] of Object.entries(r)) t === void 0 ? delete a[e] : a[e] = {
|
|
1470
1495
|
kind: "value",
|
|
1471
1496
|
value: t
|
|
1472
1497
|
};
|
|
1473
|
-
return
|
|
1498
|
+
return G(t, n, {
|
|
1474
1499
|
...i,
|
|
1475
1500
|
inputs: a
|
|
1476
1501
|
});
|
|
1477
1502
|
}
|
|
1478
|
-
function
|
|
1503
|
+
function ze(e, t, n) {
|
|
1479
1504
|
let r = e.document.tasks[t];
|
|
1480
1505
|
if (!(r == null || !("executor" in r) || r.executor.kind != "connector")) return [{
|
|
1481
1506
|
kind: "task.replace",
|
|
@@ -1489,7 +1514,7 @@ function Re(e, t, n) {
|
|
|
1489
1514
|
taskId: t
|
|
1490
1515
|
}];
|
|
1491
1516
|
}
|
|
1492
|
-
function
|
|
1517
|
+
function Be(e, t, n, r) {
|
|
1493
1518
|
let i = e.document.flows[t.id]?.graph.nodes[n];
|
|
1494
1519
|
if (i == null) return;
|
|
1495
1520
|
let a = {
|
|
@@ -1535,25 +1560,25 @@ function ze(e, t, n, r) {
|
|
|
1535
1560
|
config: r.config
|
|
1536
1561
|
};
|
|
1537
1562
|
}
|
|
1538
|
-
return
|
|
1563
|
+
return G(t, n, o);
|
|
1539
1564
|
}
|
|
1540
|
-
function
|
|
1565
|
+
function Ve(e, t, n, r, i) {
|
|
1541
1566
|
let a = e.document.flows[t.id]?.graph.nodes[n];
|
|
1542
1567
|
if (a == null || a.kind != "integration" && a.kind != "poll") return;
|
|
1543
1568
|
let o = { ...a.config };
|
|
1544
|
-
return i === void 0 ? delete o[r] : o[r] = i,
|
|
1569
|
+
return i === void 0 ? delete o[r] : o[r] = i, G(t, n, {
|
|
1545
1570
|
...a,
|
|
1546
1571
|
config: o
|
|
1547
1572
|
});
|
|
1548
1573
|
}
|
|
1549
|
-
function
|
|
1574
|
+
function He(e, t, n, r) {
|
|
1550
1575
|
let i = e.document.flows[t.id]?.graph.nodes[n];
|
|
1551
1576
|
if (i != null) switch (i.kind) {
|
|
1552
|
-
case "cron": return
|
|
1577
|
+
case "cron": return G(t, n, {
|
|
1553
1578
|
...i,
|
|
1554
1579
|
cronTimes: r
|
|
1555
1580
|
});
|
|
1556
|
-
case "poll": return
|
|
1581
|
+
case "poll": return G(t, n, {
|
|
1557
1582
|
...i,
|
|
1558
1583
|
pollTimes: r
|
|
1559
1584
|
});
|
|
@@ -1562,7 +1587,7 @@ function Ve(e, t, n, r) {
|
|
|
1562
1587
|
default: return;
|
|
1563
1588
|
}
|
|
1564
1589
|
}
|
|
1565
|
-
function
|
|
1590
|
+
function Ue(e, t, n, r) {
|
|
1566
1591
|
let i = e.document.flows[t.id]?.graph.nodes[n];
|
|
1567
1592
|
if (!(i == null || i.kind != "poll" && i.kind != "integration") && e.document.bindings[i.bindingId]?.kind == "connection") return [{
|
|
1568
1593
|
binding: {
|
|
@@ -1573,19 +1598,19 @@ function He(e, t, n, r) {
|
|
|
1573
1598
|
kind: "binding.replace"
|
|
1574
1599
|
}];
|
|
1575
1600
|
}
|
|
1576
|
-
function
|
|
1601
|
+
function H(e, t) {
|
|
1577
1602
|
return t.kind == "flow" ? e.document.flows[t.id]?.graph : e.document.subflows[t.id]?.graph;
|
|
1578
1603
|
}
|
|
1579
|
-
function
|
|
1604
|
+
function U(e) {
|
|
1580
1605
|
return Object.fromEntries(Object.entries(e).flatMap(([e, t]) => Object.hasOwn(t, "value") ? [[e, {
|
|
1581
1606
|
kind: "value",
|
|
1582
1607
|
value: t.value
|
|
1583
1608
|
}]] : []));
|
|
1584
1609
|
}
|
|
1585
|
-
function
|
|
1610
|
+
function W(e, t, n) {
|
|
1586
1611
|
return e != null && Object.hasOwn(e, t) ? e[t] : n;
|
|
1587
1612
|
}
|
|
1588
|
-
function
|
|
1613
|
+
function G(e, t, n) {
|
|
1589
1614
|
return [{
|
|
1590
1615
|
kind: "graph.node.replace",
|
|
1591
1616
|
node: n,
|
|
@@ -1595,7 +1620,7 @@ function q(e, t, n) {
|
|
|
1595
1620
|
}
|
|
1596
1621
|
//#endregion
|
|
1597
1622
|
//#region src/workbench/browser/runtime/designer/diagnostics.ts
|
|
1598
|
-
function
|
|
1623
|
+
function K(e, t) {
|
|
1599
1624
|
return t == e || t.startsWith(`${e}/`);
|
|
1600
1625
|
}
|
|
1601
1626
|
function We(e, t) {
|
|
@@ -1605,7 +1630,7 @@ function Ge(e, t, n, r) {
|
|
|
1605
1630
|
if (e == null || t == null || n == null) return [];
|
|
1606
1631
|
if (r != null) return Xe(t, r, n.diagnostics);
|
|
1607
1632
|
let i = `/document/${t.kind == "flow" ? "flows" : "subflows"}/${t.id}`;
|
|
1608
|
-
return n.diagnostics.filter((e) =>
|
|
1633
|
+
return n.diagnostics.filter((e) => K(i, e.path));
|
|
1609
1634
|
}
|
|
1610
1635
|
function Ke(e) {
|
|
1611
1636
|
return e.startsWith("/modules/") ? "code" : /\/graph\/nodes\/[^/]+\/task(?:\/|$)/.test(e) ? "task" : e.includes("/graph/nodes/") ? "node" : e.startsWith("/document/tasks/") ? "task" : e.startsWith("/document/flows/") ? "flow" : "project";
|
|
@@ -1654,18 +1679,18 @@ function Xe(e, t, n) {
|
|
|
1654
1679
|
let e = t.definition != null && "moduleId" in t.definition ? t.definition.moduleId : void 0;
|
|
1655
1680
|
e != null && i.push(`/modules/${e}`);
|
|
1656
1681
|
} else t.kind == "subflow" && i.push(`/document/subflows/${t.node.subflowId}`);
|
|
1657
|
-
return n.filter((e) => i.some((t) =>
|
|
1682
|
+
return n.filter((e) => i.some((t) => K(t, e.path)));
|
|
1658
1683
|
}
|
|
1659
1684
|
//#endregion
|
|
1660
1685
|
//#region src/workbench/browser/runtime/designer/projectChanges.ts
|
|
1661
|
-
function
|
|
1686
|
+
function q(e, t) {
|
|
1662
1687
|
return {
|
|
1663
1688
|
...e,
|
|
1664
|
-
content:
|
|
1689
|
+
content: r(e.content, t)
|
|
1665
1690
|
};
|
|
1666
1691
|
}
|
|
1667
1692
|
function Ze(e, t, n) {
|
|
1668
|
-
return e == "flow" ?
|
|
1693
|
+
return e == "flow" ? Te(t, n) : [{
|
|
1669
1694
|
kind: "subflow.create",
|
|
1670
1695
|
subflow: {
|
|
1671
1696
|
graph: { nodes: {} },
|
|
@@ -1689,15 +1714,15 @@ function Ze(e, t, n) {
|
|
|
1689
1714
|
}
|
|
1690
1715
|
function Qe(e, t, n, r, i) {
|
|
1691
1716
|
switch (r.kind) {
|
|
1692
|
-
case "code": return
|
|
1717
|
+
case "code": return Ae(t, {
|
|
1693
1718
|
moduleId: i(),
|
|
1694
1719
|
nodeId: n
|
|
1695
1720
|
}, r.name);
|
|
1696
|
-
case "llm": return
|
|
1721
|
+
case "llm": return je(t, {
|
|
1697
1722
|
nodeId: n,
|
|
1698
1723
|
taskId: i()
|
|
1699
1724
|
}, r.name, r.mode, r.outputDescription);
|
|
1700
|
-
case "connector": return
|
|
1725
|
+
case "connector": return B(t, {
|
|
1701
1726
|
nodeId: n,
|
|
1702
1727
|
taskId: i()
|
|
1703
1728
|
}, {
|
|
@@ -1710,18 +1735,18 @@ function Qe(e, t, n, r, i) {
|
|
|
1710
1735
|
name: r.action.name,
|
|
1711
1736
|
outputs: r.action.outputs
|
|
1712
1737
|
});
|
|
1713
|
-
case "condition": return
|
|
1714
|
-
case "value": return
|
|
1738
|
+
case "condition": return Me(t, n, r.name);
|
|
1739
|
+
case "value": return Ne(t, n, r.name);
|
|
1715
1740
|
case "subflow": {
|
|
1716
1741
|
let i = e.subflow(r.subflowId);
|
|
1717
1742
|
return i == null ? void 0 : dt(t, n, r.subflowId, i.inputs);
|
|
1718
1743
|
}
|
|
1719
|
-
case "webhook": return t.kind == "flow" ?
|
|
1744
|
+
case "webhook": return t.kind == "flow" ? V(t, n, {
|
|
1720
1745
|
inputsDef: [],
|
|
1721
1746
|
kind: "webhook",
|
|
1722
1747
|
name: r.name
|
|
1723
1748
|
}) : void 0;
|
|
1724
|
-
case "cron": return t.kind == "flow" ?
|
|
1749
|
+
case "cron": return t.kind == "flow" ? V(t, n, {
|
|
1725
1750
|
cronTimes: [{
|
|
1726
1751
|
type: "every",
|
|
1727
1752
|
unit: "hour",
|
|
@@ -1730,7 +1755,7 @@ function Qe(e, t, n, r, i) {
|
|
|
1730
1755
|
kind: "cron",
|
|
1731
1756
|
name: r.name
|
|
1732
1757
|
}) : void 0;
|
|
1733
|
-
case "provider-trigger": return t.kind == "flow" ?
|
|
1758
|
+
case "provider-trigger": return t.kind == "flow" ? Pe(t, {
|
|
1734
1759
|
bindingId: i(),
|
|
1735
1760
|
nodeId: n
|
|
1736
1761
|
}, r.definition, {
|
|
@@ -1740,7 +1765,7 @@ function Qe(e, t, n, r, i) {
|
|
|
1740
1765
|
}
|
|
1741
1766
|
}
|
|
1742
1767
|
function $e(e, t, n) {
|
|
1743
|
-
return
|
|
1768
|
+
return Fe(e.revision.content, t, n);
|
|
1744
1769
|
}
|
|
1745
1770
|
function et(e, t, n) {
|
|
1746
1771
|
let r = e.graph(t)?.nodes ?? {}, i = Object.fromEntries(n.flatMap((e) => r[e] == null ? [] : [[e, r[e]]]));
|
|
@@ -1854,32 +1879,71 @@ function tt(e, t, n, r) {
|
|
|
1854
1879
|
};
|
|
1855
1880
|
}
|
|
1856
1881
|
function nt(e, t, n, r) {
|
|
1857
|
-
return
|
|
1882
|
+
return Ie(e.revision.content, t, n, r);
|
|
1858
1883
|
}
|
|
1859
1884
|
function rt(e, t, n, r) {
|
|
1860
1885
|
let i = e.node(t, n)?.node;
|
|
1861
1886
|
if (i == null) return;
|
|
1862
1887
|
let { description: a, ...o } = i;
|
|
1863
|
-
return
|
|
1888
|
+
return X(t, n, r == null ? o : {
|
|
1864
1889
|
...o,
|
|
1865
1890
|
description: r
|
|
1866
1891
|
});
|
|
1867
1892
|
}
|
|
1868
1893
|
function it(e, t, n, r, i) {
|
|
1869
|
-
return
|
|
1894
|
+
return Le(e.revision.content, t, n, r, i);
|
|
1870
1895
|
}
|
|
1871
1896
|
function at(e, t, n, r) {
|
|
1872
|
-
let i = e.
|
|
1873
|
-
if (i?.kind != "condition") return;
|
|
1874
|
-
let
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
...
|
|
1878
|
-
|
|
1897
|
+
let i = e.graph(t), a = i?.nodes[n];
|
|
1898
|
+
if (i == null || a?.kind != "condition") return;
|
|
1899
|
+
let o = Object.fromEntries([...a.cases.map((e) => [e.output, !0]), ...a.defaultOutput == null ? [] : [[a.defaultOutput, !0]]]), s = Object.fromEntries([...r.cases.map((e) => [e.output, !0]), ...r.defaultOutput == null ? [] : [[r.defaultOutput, !0]]]), c = a.input.handle == r.input.handle ? void 0 : [a.input.handle, r.input.handle], l = J(o, s), u = new Set(Object.keys(s)), d = [];
|
|
1900
|
+
for (let [e, o] of Object.entries(i.nodes)) {
|
|
1901
|
+
if (!("inputs" in o)) continue;
|
|
1902
|
+
let i = e == n, s = { ...o.inputs };
|
|
1903
|
+
if (e == n) {
|
|
1904
|
+
c != null && Object.hasOwn(s, c[0]) && (s[c[1]] = s[c[0]], delete s[c[0]]);
|
|
1905
|
+
for (let e of Object.keys(s)) e != r.input.handle && delete s[e];
|
|
1906
|
+
}
|
|
1907
|
+
for (let [e, t] of Object.entries(s)) {
|
|
1908
|
+
if (t.kind != "sources") continue;
|
|
1909
|
+
let r = t.sources.flatMap((e) => e.kind != "node" || e.nodeId != n ? [e] : l != null && e.output == l[0] ? [{
|
|
1910
|
+
...e,
|
|
1911
|
+
output: l[1]
|
|
1912
|
+
}] : u.has(e.output) ? [e] : []);
|
|
1913
|
+
r.length == t.sources.length && r.every((e, n) => e === t.sources[n]) || (i = !0, r.length == 0 ? delete s[e] : s[e] = {
|
|
1914
|
+
kind: "sources",
|
|
1915
|
+
sources: r
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
if (i) {
|
|
1919
|
+
if (e == n) {
|
|
1920
|
+
let { defaultOutput: n, ...i } = a;
|
|
1921
|
+
d.push({
|
|
1922
|
+
kind: "graph.node.replace",
|
|
1923
|
+
node: {
|
|
1924
|
+
...i,
|
|
1925
|
+
...r,
|
|
1926
|
+
inputs: s
|
|
1927
|
+
},
|
|
1928
|
+
nodeId: e,
|
|
1929
|
+
target: t
|
|
1930
|
+
});
|
|
1931
|
+
} else d.push({
|
|
1932
|
+
kind: "graph.node.replace",
|
|
1933
|
+
node: {
|
|
1934
|
+
...o,
|
|
1935
|
+
inputs: s
|
|
1936
|
+
},
|
|
1937
|
+
nodeId: e,
|
|
1938
|
+
target: t
|
|
1939
|
+
});
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
return d;
|
|
1879
1943
|
}
|
|
1880
1944
|
function ot(e, t, n, r) {
|
|
1881
1945
|
let i = e.node(t, n)?.node;
|
|
1882
|
-
if (i?.kind == "value") return
|
|
1946
|
+
if (i?.kind == "value") return X(t, n, {
|
|
1883
1947
|
...i,
|
|
1884
1948
|
values: Object.fromEntries(r.map((e) => [e.handle, {
|
|
1885
1949
|
...e.description == null ? {} : { description: e.description },
|
|
@@ -1892,7 +1956,7 @@ function ot(e, t, n, r) {
|
|
|
1892
1956
|
function st(e, t, n, r) {
|
|
1893
1957
|
let i = e.graph(t)?.nodes[n];
|
|
1894
1958
|
if (i?.kind == "task") switch (r.kind) {
|
|
1895
|
-
case "code": return i.task == null ? void 0 :
|
|
1959
|
+
case "code": return i.task == null ? void 0 : Y(e, t, n, {
|
|
1896
1960
|
...i.task,
|
|
1897
1961
|
inputs: r.inputs,
|
|
1898
1962
|
name: r.name,
|
|
@@ -1929,7 +1993,7 @@ function st(e, t, n, r) {
|
|
|
1929
1993
|
}
|
|
1930
1994
|
function ct(e, t, n, r) {
|
|
1931
1995
|
let i = e.graph(t)?.nodes[n];
|
|
1932
|
-
if (i?.kind == "task" && i.task != null) return
|
|
1996
|
+
if (i?.kind == "task" && i.task != null) return Y(e, t, n, {
|
|
1933
1997
|
...i.task,
|
|
1934
1998
|
...r
|
|
1935
1999
|
});
|
|
@@ -1938,7 +2002,7 @@ function lt(e, t, n, r) {
|
|
|
1938
2002
|
let i = e.trigger(t.id, n);
|
|
1939
2003
|
if (i == null || i.kind != "webhook") return;
|
|
1940
2004
|
let { options: a, ...o } = i;
|
|
1941
|
-
return
|
|
2005
|
+
return X(t, n, Object.keys(r.options).length == 0 ? {
|
|
1942
2006
|
...o,
|
|
1943
2007
|
inputsDef: r.inputs
|
|
1944
2008
|
} : {
|
|
@@ -1973,14 +2037,14 @@ function ft(e) {
|
|
|
1973
2037
|
value: t.value
|
|
1974
2038
|
}]] : []));
|
|
1975
2039
|
}
|
|
1976
|
-
function
|
|
2040
|
+
function J(e, t) {
|
|
1977
2041
|
let n = Object.keys(e).filter((e) => !Object.hasOwn(t, e)), r = Object.keys(t).filter((t) => !Object.hasOwn(e, t));
|
|
1978
2042
|
return n.length == 1 && r.length == 1 ? [n[0], r[0]] : void 0;
|
|
1979
2043
|
}
|
|
1980
|
-
function
|
|
2044
|
+
function Y(e, t, n, r) {
|
|
1981
2045
|
let i = e.graph(t), a = i?.nodes[n];
|
|
1982
2046
|
if (i == null || a?.kind != "task" || a.task == null) return;
|
|
1983
|
-
let o =
|
|
2047
|
+
let o = J(a.task.inputs, r.inputs), s = J(a.task.outputs, r.outputs), c = new Set(Object.keys(r.outputs)), l = [];
|
|
1984
2048
|
for (let [e, u] of Object.entries(i.nodes)) {
|
|
1985
2049
|
if (!("inputs" in u)) continue;
|
|
1986
2050
|
let i = e == n, d = { ...u.inputs };
|
|
@@ -2017,7 +2081,7 @@ function mt(e, t, n, r) {
|
|
|
2017
2081
|
}
|
|
2018
2082
|
return l;
|
|
2019
2083
|
}
|
|
2020
|
-
function
|
|
2084
|
+
function X(e, t, n) {
|
|
2021
2085
|
return [{
|
|
2022
2086
|
kind: "graph.node.replace",
|
|
2023
2087
|
node: n,
|
|
@@ -2027,32 +2091,32 @@ function Y(e, t, n) {
|
|
|
2027
2091
|
}
|
|
2028
2092
|
//#endregion
|
|
2029
2093
|
//#region src/workbench/browser/runtime/designer/remoteChangeTargets.ts
|
|
2030
|
-
function
|
|
2094
|
+
function pt(e, t) {
|
|
2031
2095
|
return e.kind == t.kind && e.id == t.id;
|
|
2032
2096
|
}
|
|
2033
|
-
function
|
|
2097
|
+
function Z(e, t, n, r) {
|
|
2034
2098
|
for (let [i, a] of Object.entries(t.graph(n)?.nodes ?? {})) r(a) && e.add(i);
|
|
2035
2099
|
}
|
|
2036
|
-
function
|
|
2100
|
+
function mt(e, t, n, r) {
|
|
2037
2101
|
let i = /* @__PURE__ */ new Set();
|
|
2038
2102
|
for (let a of r) switch (a.kind) {
|
|
2039
2103
|
case "graph.node.create":
|
|
2040
2104
|
case "graph.node.replace":
|
|
2041
|
-
|
|
2105
|
+
pt(a.target, n) && i.add(a.nodeId);
|
|
2042
2106
|
break;
|
|
2043
2107
|
case "task.replace":
|
|
2044
|
-
|
|
2108
|
+
Z(i, e, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId), Z(i, t, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId);
|
|
2045
2109
|
break;
|
|
2046
2110
|
case "module.source.replace":
|
|
2047
|
-
|
|
2111
|
+
Z(i, e, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId), Z(i, t, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId);
|
|
2048
2112
|
break;
|
|
2049
|
-
case "subflow.definition.replace":
|
|
2113
|
+
case "subflow.definition.replace": Z(i, e, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId), Z(i, t, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId);
|
|
2050
2114
|
}
|
|
2051
2115
|
return new Set([...i].filter((e) => t.selection(n, e) != null));
|
|
2052
2116
|
}
|
|
2053
2117
|
//#endregion
|
|
2054
2118
|
//#region src/workbench/browser/runtime/stores/draftChanges.ts
|
|
2055
|
-
function
|
|
2119
|
+
function ht(e) {
|
|
2056
2120
|
if (e.length != 1) return;
|
|
2057
2121
|
let t = e[0];
|
|
2058
2122
|
switch (t.kind) {
|
|
@@ -2066,7 +2130,7 @@ function _t(e) {
|
|
|
2066
2130
|
default: return;
|
|
2067
2131
|
}
|
|
2068
2132
|
}
|
|
2069
|
-
function
|
|
2133
|
+
function gt(e, t, n) {
|
|
2070
2134
|
let r = new Map(e.map((e) => [e.flowId, e])), i = new Map(t.map((e) => [e.flowId, e]));
|
|
2071
2135
|
return [...i.keys()].toSorted().map((e) => {
|
|
2072
2136
|
let t = r.get(e), a = i.get(e), o = t?.live ?? null;
|
|
@@ -2083,7 +2147,7 @@ function vt(e, t, n) {
|
|
|
2083
2147
|
};
|
|
2084
2148
|
});
|
|
2085
2149
|
}
|
|
2086
|
-
var
|
|
2150
|
+
var _t = class {
|
|
2087
2151
|
#e;
|
|
2088
2152
|
#t;
|
|
2089
2153
|
#n;
|
|
@@ -2111,7 +2175,7 @@ var yt = class {
|
|
|
2111
2175
|
this.#a = e;
|
|
2112
2176
|
}
|
|
2113
2177
|
project(e) {
|
|
2114
|
-
return this.#o.reduce((e, t) =>
|
|
2178
|
+
return this.#o.reduce((e, t) => q(e, t.changes), e);
|
|
2115
2179
|
}
|
|
2116
2180
|
enqueue(e) {
|
|
2117
2181
|
let t = this.#s.then(e);
|
|
@@ -2120,8 +2184,8 @@ var yt = class {
|
|
|
2120
2184
|
async change(e, t, n, r = !0) {
|
|
2121
2185
|
this.#t.beforeChange(r);
|
|
2122
2186
|
let i = this.#t.flows();
|
|
2123
|
-
this.#t.apply(
|
|
2124
|
-
let a =
|
|
2187
|
+
this.#t.apply(q(t, n), i, i);
|
|
2188
|
+
let a = ht(n), o = this.#o.at(-1), s = a != null && o != null && !o.started && ht(o.changes) == a ? o : void 0;
|
|
2125
2189
|
if (s != null) return s.changes = n, await s.result;
|
|
2126
2190
|
let c = {
|
|
2127
2191
|
...e,
|
|
@@ -2149,7 +2213,7 @@ var yt = class {
|
|
|
2149
2213
|
let r = this.#l(e, n, t);
|
|
2150
2214
|
return this.#o.length == 0 && this.#t.check(), r;
|
|
2151
2215
|
} catch (n) {
|
|
2152
|
-
if (n instanceof
|
|
2216
|
+
if (n instanceof u && n.code == "project.revision-conflict") {
|
|
2153
2217
|
if (!t && await this.#t.recover(e)) {
|
|
2154
2218
|
t = !0;
|
|
2155
2219
|
continue;
|
|
@@ -2166,10 +2230,10 @@ var yt = class {
|
|
|
2166
2230
|
#l(e, t, n) {
|
|
2167
2231
|
let r = {
|
|
2168
2232
|
...n.revision,
|
|
2169
|
-
content:
|
|
2233
|
+
content: q(t, e.changes).content
|
|
2170
2234
|
};
|
|
2171
2235
|
this.#o = this.#o.filter((t) => t !== e), this.#a = r;
|
|
2172
|
-
let i = this.#t.flows(), a =
|
|
2236
|
+
let i = this.#t.flows(), a = gt(i, n.draftFlows, r), o = this.#t.diagnostics(), s = this.#o.length == 0 && o != null && a.find((e) => e.flowId == o.flowId)?.draft?.closureDigest == o.closureDigest;
|
|
2173
2237
|
return this.#t.apply(this.project(r), a, i, s), this.#t.headChanged(e.projectId, r.revisionId), r;
|
|
2174
2238
|
}
|
|
2175
2239
|
#u(e) {
|
|
@@ -2177,7 +2241,7 @@ var yt = class {
|
|
|
2177
2241
|
let t = this.#t.flows();
|
|
2178
2242
|
this.#t.apply(this.project(this.#a), t, t);
|
|
2179
2243
|
}
|
|
2180
|
-
},
|
|
2244
|
+
}, vt = class {
|
|
2181
2245
|
#e;
|
|
2182
2246
|
#t;
|
|
2183
2247
|
#n;
|
|
@@ -2220,7 +2284,7 @@ var yt = class {
|
|
|
2220
2284
|
this.#c(a, r);
|
|
2221
2285
|
} catch (r) {
|
|
2222
2286
|
if (this.#o || !n()) return;
|
|
2223
|
-
if (r instanceof
|
|
2287
|
+
if (r instanceof u && r.code == "project.presentation-conflict") try {
|
|
2224
2288
|
let t = await this.#e.getPresentation(e);
|
|
2225
2289
|
if (this.#o || !n()) return;
|
|
2226
2290
|
this.#c(a, t), this.#n({
|
|
@@ -2242,29 +2306,29 @@ var yt = class {
|
|
|
2242
2306
|
value: n
|
|
2243
2307
|
});
|
|
2244
2308
|
}
|
|
2245
|
-
},
|
|
2309
|
+
}, yt = 50, bt = {
|
|
2246
2310
|
failed: !1,
|
|
2247
2311
|
loaded: !1,
|
|
2248
2312
|
loading: !0,
|
|
2249
2313
|
loadingMore: !1,
|
|
2250
2314
|
loadMoreFailed: !1,
|
|
2251
2315
|
projects: []
|
|
2252
|
-
},
|
|
2316
|
+
}, xt = class {
|
|
2253
2317
|
#e;
|
|
2254
2318
|
#t;
|
|
2255
|
-
#n = new
|
|
2319
|
+
#n = new S();
|
|
2256
2320
|
#r;
|
|
2257
|
-
#i =
|
|
2321
|
+
#i = t(bt);
|
|
2258
2322
|
#a = !1;
|
|
2259
|
-
constructor(
|
|
2260
|
-
this.#e =
|
|
2261
|
-
failed:
|
|
2262
|
-
loading:
|
|
2263
|
-
loadingMore:
|
|
2264
|
-
loadMoreFailed:
|
|
2265
|
-
nextCursor:
|
|
2266
|
-
projects:
|
|
2267
|
-
total:
|
|
2323
|
+
constructor(t, n, r) {
|
|
2324
|
+
this.#e = t, this.#t = r, this.#r = n, this.$ = {
|
|
2325
|
+
failed: e(this.#i, (e) => e.failed),
|
|
2326
|
+
loading: e(this.#i, (e) => e.loading),
|
|
2327
|
+
loadingMore: e(this.#i, (e) => e.loadingMore),
|
|
2328
|
+
loadMoreFailed: e(this.#i, (e) => e.loadMoreFailed),
|
|
2329
|
+
nextCursor: e(this.#i, (e) => e.nextCursor),
|
|
2330
|
+
projects: e(this.#i, (e) => e.projects),
|
|
2331
|
+
total: e(this.#i, (e) => e.total)
|
|
2268
2332
|
};
|
|
2269
2333
|
}
|
|
2270
2334
|
get loaded() {
|
|
@@ -2300,7 +2364,7 @@ var yt = class {
|
|
|
2300
2364
|
try {
|
|
2301
2365
|
let t = await this.#e.listProjects({
|
|
2302
2366
|
includeTotal: !0,
|
|
2303
|
-
limit:
|
|
2367
|
+
limit: yt
|
|
2304
2368
|
});
|
|
2305
2369
|
if (!e()) return;
|
|
2306
2370
|
this.#o({
|
|
@@ -2329,7 +2393,7 @@ var yt = class {
|
|
|
2329
2393
|
try {
|
|
2330
2394
|
let e = await this.#e.listProjects({
|
|
2331
2395
|
cursor: t,
|
|
2332
|
-
limit:
|
|
2396
|
+
limit: yt
|
|
2333
2397
|
});
|
|
2334
2398
|
if (!n()) return;
|
|
2335
2399
|
let r = new Set(this.#i.value.projects.map((e) => e.projectId));
|
|
@@ -2374,14 +2438,14 @@ var yt = class {
|
|
|
2374
2438
|
...e
|
|
2375
2439
|
});
|
|
2376
2440
|
}
|
|
2377
|
-
},
|
|
2441
|
+
}, St = {
|
|
2378
2442
|
checkLoading: !1,
|
|
2379
2443
|
flows: [],
|
|
2380
2444
|
selectedNodeIds: [],
|
|
2381
2445
|
workspaceLoadFailed: !1,
|
|
2382
2446
|
workspaceLoading: !1
|
|
2383
2447
|
};
|
|
2384
|
-
function
|
|
2448
|
+
function Ct(e) {
|
|
2385
2449
|
return e.workspaceLoading ? "loading" : e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved";
|
|
2386
2450
|
}
|
|
2387
2451
|
function Q(e, t) {
|
|
@@ -2397,73 +2461,73 @@ function $(e, t, n) {
|
|
|
2397
2461
|
source: r.module.source
|
|
2398
2462
|
};
|
|
2399
2463
|
}
|
|
2400
|
-
var
|
|
2464
|
+
var wt = class {
|
|
2401
2465
|
#e;
|
|
2402
|
-
#t =
|
|
2466
|
+
#t = t(St);
|
|
2403
2467
|
#n;
|
|
2404
|
-
constructor(
|
|
2405
|
-
let
|
|
2468
|
+
constructor(t, r) {
|
|
2469
|
+
let i = e(this.#t, (e) => e.busy), a = e(this.#t, (e) => e.checkLoading), o = e(this.#t, (e) => e.diagnosticFocus), s = e(this.#t, (e) => e.diagnostics), c = e(this.#t, (e) => e.draft), l = e(this.#t, (e) => e.flows), u = e(this.#t, (e) => {
|
|
2406
2470
|
if (e.moduleEditor == null) return;
|
|
2407
2471
|
let { phase: t, ...n } = e.moduleEditor;
|
|
2408
2472
|
return {
|
|
2409
2473
|
...n,
|
|
2410
2474
|
status: Q(e.draft, e.moduleEditor)
|
|
2411
2475
|
};
|
|
2412
|
-
}),
|
|
2413
|
-
this.#e =
|
|
2414
|
-
revision: e.draft == null ? void 0 :
|
|
2476
|
+
}), d = e(this.#t, (e) => e.nodeFocus), p = e(this.#t, (e) => e.presentation), m = e(this.#t, (e) => e.projectId), h = e(this.#t, (e) => e.draft == null ? void 0 : f(e.draft)), _ = e(this.#t, (e) => e.selectedNodeIds), v = e(this.#t, (e) => e.target), y = e(this.#t, (e) => e.workspaceLoadFailed), b = e(this.#t, (e) => e.workspaceLoading);
|
|
2477
|
+
this.#e = e(this.#t, (e) => ({
|
|
2478
|
+
revision: e.draft == null ? void 0 : f(e.draft),
|
|
2415
2479
|
target: e.target
|
|
2416
2480
|
}), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
|
|
2417
|
-
let
|
|
2418
|
-
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return
|
|
2481
|
+
let x = e(this.#t, (e) => {
|
|
2482
|
+
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return f(e.draft).selection(e.target, e.selectedNodeIds[0]);
|
|
2419
2483
|
});
|
|
2420
2484
|
this.$ = {
|
|
2421
|
-
addNodeOptions:
|
|
2422
|
-
let { revision: n, target: r } =
|
|
2423
|
-
return
|
|
2485
|
+
addNodeOptions: n((e) => {
|
|
2486
|
+
let { revision: n, target: r } = e(this.#e);
|
|
2487
|
+
return g(n?.revision, r, e(t.t$));
|
|
2424
2488
|
}),
|
|
2425
|
-
busy:
|
|
2426
|
-
checkLoading:
|
|
2489
|
+
busy: i,
|
|
2490
|
+
checkLoading: a,
|
|
2427
2491
|
diagnosticFocus: o,
|
|
2428
|
-
diagnosticItems:
|
|
2429
|
-
diagnostics:
|
|
2430
|
-
draft:
|
|
2431
|
-
flows:
|
|
2432
|
-
inspectorDiagnostics:
|
|
2433
|
-
moduleDiagnostics:
|
|
2492
|
+
diagnosticItems: e(this.#t, (e) => Ye(e.draft == null ? void 0 : f(e.draft), e.target, e.diagnostics)),
|
|
2493
|
+
diagnostics: s,
|
|
2494
|
+
draft: c,
|
|
2495
|
+
flows: l,
|
|
2496
|
+
inspectorDiagnostics: e(this.#t, (e) => Ge(e.draft == null ? void 0 : f(e.draft), e.target, e.diagnostics, x.value)),
|
|
2497
|
+
moduleDiagnostics: e(this.#t, (e) => {
|
|
2434
2498
|
let t = e.moduleEditor?.moduleId;
|
|
2435
2499
|
return t == null ? [] : e.diagnostics?.diagnostics.filter((e) => e.path.startsWith(`/modules/${t}/source`)) ?? [];
|
|
2436
2500
|
}),
|
|
2437
|
-
moduleEditor:
|
|
2438
|
-
nodeFocus:
|
|
2501
|
+
moduleEditor: u,
|
|
2502
|
+
nodeFocus: d,
|
|
2439
2503
|
presentation: p,
|
|
2440
|
-
project:
|
|
2441
|
-
let
|
|
2442
|
-
return
|
|
2504
|
+
project: n((e) => {
|
|
2505
|
+
let t = e(m);
|
|
2506
|
+
return t == null ? void 0 : e(r.$.projects).find((e) => e.projectId == t);
|
|
2443
2507
|
}),
|
|
2444
2508
|
projectId: m,
|
|
2445
|
-
projectLoadFailed:
|
|
2446
|
-
projectLoadMoreFailed:
|
|
2447
|
-
projectLoading:
|
|
2448
|
-
projectLoadingMore:
|
|
2449
|
-
projectNextCursor:
|
|
2450
|
-
projectTotal:
|
|
2451
|
-
projects:
|
|
2509
|
+
projectLoadFailed: r.$.failed,
|
|
2510
|
+
projectLoadMoreFailed: r.$.loadMoreFailed,
|
|
2511
|
+
projectLoading: r.$.loading,
|
|
2512
|
+
projectLoadingMore: r.$.loadingMore,
|
|
2513
|
+
projectNextCursor: r.$.nextCursor,
|
|
2514
|
+
projectTotal: r.$.total,
|
|
2515
|
+
projects: r.$.projects,
|
|
2452
2516
|
revision: h,
|
|
2453
|
-
selection:
|
|
2454
|
-
selectedNodeIds:
|
|
2455
|
-
status:
|
|
2456
|
-
target:
|
|
2457
|
-
targetFlow:
|
|
2458
|
-
targetName:
|
|
2517
|
+
selection: x,
|
|
2518
|
+
selectedNodeIds: _,
|
|
2519
|
+
status: e(this.#t, Ct),
|
|
2520
|
+
target: v,
|
|
2521
|
+
targetFlow: e(this.#t, (e) => e.target?.kind == "flow" ? e.flows.find((t) => t.flowId == e.target?.id) : void 0),
|
|
2522
|
+
targetName: e(this.#t, (e) => {
|
|
2459
2523
|
if (e.target == null) return;
|
|
2460
2524
|
if (e.draft == null) return e.target.id;
|
|
2461
|
-
let t =
|
|
2525
|
+
let t = f(e.draft);
|
|
2462
2526
|
return (e.target.kind == "flow" ? t.flow(e.target.id)?.name : t.subflow(e.target.id)?.name) ?? e.target.id;
|
|
2463
2527
|
}),
|
|
2464
|
-
workspaceLoadFailed:
|
|
2465
|
-
workspaceLoading:
|
|
2466
|
-
}, this.#n = new Set(Object.values(
|
|
2528
|
+
workspaceLoadFailed: y,
|
|
2529
|
+
workspaceLoading: b
|
|
2530
|
+
}, this.#n = new Set(Object.values(r.$));
|
|
2467
2531
|
}
|
|
2468
2532
|
get value() {
|
|
2469
2533
|
return this.#t.value;
|
|
@@ -2478,12 +2542,12 @@ var Tt = class {
|
|
|
2478
2542
|
for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
|
|
2479
2543
|
this.#e.dispose(), this.#t.dispose();
|
|
2480
2544
|
}
|
|
2481
|
-
},
|
|
2482
|
-
function
|
|
2545
|
+
}, Tt = 250;
|
|
2546
|
+
function Et(e, t, n, r) {
|
|
2483
2547
|
if (r == null) return;
|
|
2484
2548
|
if (r.kind == "subflow") {
|
|
2485
2549
|
if (e.subflow(r.id) != null) return r;
|
|
2486
|
-
let n =
|
|
2550
|
+
let n = c(t, null);
|
|
2487
2551
|
return n == null ? void 0 : {
|
|
2488
2552
|
id: n.flowId,
|
|
2489
2553
|
kind: "flow"
|
|
@@ -2496,10 +2560,10 @@ function Dt(e, t, n, r) {
|
|
|
2496
2560
|
kind: "flow"
|
|
2497
2561
|
};
|
|
2498
2562
|
}
|
|
2499
|
-
var
|
|
2563
|
+
var Dt = class {
|
|
2500
2564
|
#e;
|
|
2501
2565
|
#t;
|
|
2502
|
-
#n = new
|
|
2566
|
+
#n = new S();
|
|
2503
2567
|
#r;
|
|
2504
2568
|
#i;
|
|
2505
2569
|
#a;
|
|
@@ -2518,8 +2582,8 @@ var Ot = class {
|
|
|
2518
2582
|
#v = !1;
|
|
2519
2583
|
#y = 0;
|
|
2520
2584
|
#b;
|
|
2521
|
-
constructor(e, t, n = () => crypto.randomUUID(), r =
|
|
2522
|
-
this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new
|
|
2585
|
+
constructor(e, t, n = () => crypto.randomUUID(), r = y(), i = () => {}) {
|
|
2586
|
+
this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new xt(e, t, r), this.#l = new wt(r, this.#o), this.#t = new _t(e, t, r, {
|
|
2523
2587
|
apply: (e, t, n, r) => this.#C(e, t, n, r),
|
|
2524
2588
|
beforeChange: (e) => {
|
|
2525
2589
|
this.#j(), this.#h = !1, e && (this.#z({ busy: "designer" }), this.#c(void 0));
|
|
@@ -2533,7 +2597,7 @@ var Ot = class {
|
|
|
2533
2597
|
flows: () => this.#l.value.flows,
|
|
2534
2598
|
headChanged: (e, t) => this.#M(e, t),
|
|
2535
2599
|
recover: (e) => this.#D(e, !0)
|
|
2536
|
-
}), this.#a = new
|
|
2600
|
+
}), this.#a = new vt(e, t, (e) => this.#z({ presentation: e }), r), this.$ = this.#l.$;
|
|
2537
2601
|
}
|
|
2538
2602
|
dispose() {
|
|
2539
2603
|
this.#j(), this.#_ = !0, this.#n.invalidate(), this.#a.dispose(), this.#b?.(), this.#l.dispose(), this.#o.dispose();
|
|
@@ -2616,7 +2680,7 @@ var Ot = class {
|
|
|
2616
2680
|
selectNodes(e) {
|
|
2617
2681
|
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#P() ? (this.#j(), this.#z({
|
|
2618
2682
|
diagnosticFocus: void 0,
|
|
2619
|
-
moduleEditor: $(this.#l.value.draft == null ? void 0 :
|
|
2683
|
+
moduleEditor: $(this.#l.value.draft == null ? void 0 : f(this.#l.value.draft), this.#l.value.target, e),
|
|
2620
2684
|
nodeFocus: void 0,
|
|
2621
2685
|
selectedNodeIds: e
|
|
2622
2686
|
}), !0) : !1;
|
|
@@ -2667,7 +2731,7 @@ var Ot = class {
|
|
|
2667
2731
|
if (n == null || r.length == 0) return !1;
|
|
2668
2732
|
if (n.name == r) return !0;
|
|
2669
2733
|
this.#z({ busy: "resource" }), this.#c(void 0);
|
|
2670
|
-
let i = await this.#S(
|
|
2734
|
+
let i = await this.#S(Ee(e, r), !1);
|
|
2671
2735
|
return this.#z({ busy: void 0 }), i != null && (this.#c({
|
|
2672
2736
|
kind: "success",
|
|
2673
2737
|
message: this.#r.t("notice.flowRenamed", { name: r })
|
|
@@ -2677,7 +2741,7 @@ var Ot = class {
|
|
|
2677
2741
|
let t = this.#l.value.flows.find((t) => t.flowId == e);
|
|
2678
2742
|
if (t?.draft == null || this.#l.value.target?.kind == "flow" && this.#l.value.target.id == e && !this.#P()) return !1;
|
|
2679
2743
|
this.#z({ busy: "resource" }), this.#c(void 0);
|
|
2680
|
-
let n = await this.#S(
|
|
2744
|
+
let n = await this.#S(De(e), !1);
|
|
2681
2745
|
return this.#z({ busy: void 0 }), n != null && (this.#c({
|
|
2682
2746
|
kind: "success",
|
|
2683
2747
|
message: this.#r.t("notice.flowDeleted", { name: t.draft.name })
|
|
@@ -2689,32 +2753,32 @@ var Ot = class {
|
|
|
2689
2753
|
if (r == null || i == null) return;
|
|
2690
2754
|
let a = this.#i();
|
|
2691
2755
|
if (e.kind == "comment") return await this.#x(i, a, t);
|
|
2692
|
-
let o =
|
|
2756
|
+
let o = f(r), s = b(e, o, i, this.#r.t);
|
|
2757
|
+
if (s == null) return;
|
|
2758
|
+
let c = Qe(o, i, a, s, this.#i);
|
|
2693
2759
|
if (c == null) return;
|
|
2694
|
-
let l =
|
|
2695
|
-
if (l == null) return;
|
|
2696
|
-
let u = n == null ? l : [...l, ...B(J(r, l).content, i, n(a))], d = this.#S(u);
|
|
2760
|
+
let l = n == null ? c : [...c, ...R(q(r, c).content, i, n(a))], u = this.#S(l);
|
|
2697
2761
|
this.selectNodes([a]);
|
|
2698
|
-
let
|
|
2699
|
-
if (await
|
|
2762
|
+
let d = this.moveNodes({ [a]: t });
|
|
2763
|
+
if (await u != null) return await d, a;
|
|
2700
2764
|
}
|
|
2701
2765
|
async connect(e) {
|
|
2702
2766
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2703
2767
|
if (t == null || n == null) return;
|
|
2704
|
-
let r =
|
|
2768
|
+
let r = R(t.revision.content, n, e);
|
|
2705
2769
|
r.length > 0 && await this.#S(r);
|
|
2706
2770
|
}
|
|
2707
2771
|
async disconnect(e) {
|
|
2708
2772
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2709
2773
|
if (t == null || n == null) return;
|
|
2710
|
-
let r =
|
|
2774
|
+
let r = we(t.revision.content, n, e);
|
|
2711
2775
|
r.length > 0 && await this.#S(r);
|
|
2712
2776
|
}
|
|
2713
2777
|
async deleteSelectedNodes() {
|
|
2714
2778
|
if (!this.#P()) return;
|
|
2715
2779
|
let e = this.$.revision.value, t = this.#l.value.target;
|
|
2716
2780
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
2717
|
-
let n =
|
|
2781
|
+
let n = p(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = $e(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#S(i), o = r.size == 0 ? void 0 : this.#w((e) => m(e, t, r));
|
|
2718
2782
|
this.selectNodes([]), (a == null || await a != null) && await o;
|
|
2719
2783
|
}
|
|
2720
2784
|
copySelectedNodes() {
|
|
@@ -2747,7 +2811,7 @@ var Ot = class {
|
|
|
2747
2811
|
y: (r?.position.y ?? 80) + 40
|
|
2748
2812
|
}];
|
|
2749
2813
|
})), s = this.#w((e) => {
|
|
2750
|
-
let n =
|
|
2814
|
+
let n = d(e, t, o);
|
|
2751
2815
|
for (let e of i) n = x(n, t, e.nodeId, {
|
|
2752
2816
|
content: e.content,
|
|
2753
2817
|
position: {
|
|
@@ -2817,25 +2881,25 @@ var Ot = class {
|
|
|
2817
2881
|
async setConnectorConnection(e, t) {
|
|
2818
2882
|
let n = this.$.revision.value;
|
|
2819
2883
|
if (n == null) return !1;
|
|
2820
|
-
let r =
|
|
2884
|
+
let r = ze(n.revision.content, e, t);
|
|
2821
2885
|
return r != null && await this.#S(r) != null;
|
|
2822
2886
|
}
|
|
2823
2887
|
async saveTriggerSettings(e, t) {
|
|
2824
2888
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2825
2889
|
if (n == null || r?.kind != "flow") return !1;
|
|
2826
|
-
let i =
|
|
2890
|
+
let i = Be(n.revision.content, r, e, t);
|
|
2827
2891
|
return i != null && await this.#S(i) != null;
|
|
2828
2892
|
}
|
|
2829
2893
|
async saveTriggerConfig(e, t, n) {
|
|
2830
2894
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2831
2895
|
if (r == null || i?.kind != "flow") return !1;
|
|
2832
|
-
let a =
|
|
2896
|
+
let a = Ve(r.revision.content, i, e, t, n);
|
|
2833
2897
|
return a != null && await this.#S(a) != null;
|
|
2834
2898
|
}
|
|
2835
2899
|
async saveTriggerSchedule(e, t) {
|
|
2836
2900
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2837
2901
|
if (n == null || r?.kind != "flow") return !1;
|
|
2838
|
-
let i =
|
|
2902
|
+
let i = He(n.revision.content, r, e, t);
|
|
2839
2903
|
return i != null && await this.#S(i) != null;
|
|
2840
2904
|
}
|
|
2841
2905
|
async saveWebhook(e, t) {
|
|
@@ -2847,7 +2911,7 @@ var Ot = class {
|
|
|
2847
2911
|
async setTriggerConnection(e, t) {
|
|
2848
2912
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2849
2913
|
if (n == null || r?.kind != "flow") return !1;
|
|
2850
|
-
let i =
|
|
2914
|
+
let i = Ue(n.revision.content, r, e, t);
|
|
2851
2915
|
return i != null && await this.#S(i) != null;
|
|
2852
2916
|
}
|
|
2853
2917
|
async saveSubflowSettings(e, t) {
|
|
@@ -2884,9 +2948,9 @@ var Ot = class {
|
|
|
2884
2948
|
...e,
|
|
2885
2949
|
phase: "saving"
|
|
2886
2950
|
} });
|
|
2887
|
-
let t = await
|
|
2951
|
+
let t = await Oe(e.source);
|
|
2888
2952
|
if (this.#_) return !1;
|
|
2889
|
-
let n = await this.#S(
|
|
2953
|
+
let n = await this.#S(ke(e.moduleId, e.source, t));
|
|
2890
2954
|
return !this.#_ && this.#l.value.moduleEditor?.moduleId == e.moduleId && this.#z({ moduleEditor: {
|
|
2891
2955
|
...this.#l.value.moduleEditor,
|
|
2892
2956
|
phase: n == null ? "failed" : void 0
|
|
@@ -2894,13 +2958,13 @@ var Ot = class {
|
|
|
2894
2958
|
}
|
|
2895
2959
|
async moveNodes(e) {
|
|
2896
2960
|
let t = this.#l.value.target;
|
|
2897
|
-
t != null && await this.#w((n) =>
|
|
2961
|
+
t != null && await this.#w((n) => d(n, t, e));
|
|
2898
2962
|
}
|
|
2899
2963
|
async moveViewport(e) {
|
|
2900
2964
|
let t = this.#l.value.target;
|
|
2901
2965
|
if (t == null) return;
|
|
2902
2966
|
let n = this.#N().viewport;
|
|
2903
|
-
(n.x != e.x || n.y != e.y || n.zoom != e.zoom) && this.#j(), await this.#w((n) =>
|
|
2967
|
+
(n.x != e.x || n.y != e.y || n.zoom != e.zoom) && this.#j(), await this.#w((n) => l(n, t, e));
|
|
2904
2968
|
}
|
|
2905
2969
|
async check() {
|
|
2906
2970
|
await this.#T();
|
|
@@ -2970,7 +3034,7 @@ var Ot = class {
|
|
|
2970
3034
|
});
|
|
2971
3035
|
return;
|
|
2972
3036
|
}
|
|
2973
|
-
let r = We(
|
|
3037
|
+
let r = We(f(t), n);
|
|
2974
3038
|
if (r == null) {
|
|
2975
3039
|
this.#z({
|
|
2976
3040
|
checkLoading: !1,
|
|
@@ -3016,18 +3080,18 @@ var Ot = class {
|
|
|
3016
3080
|
let o = await this.#e.syncDraft(e.projectId, a.revisionId);
|
|
3017
3081
|
if (!this.#R(e)) return !1;
|
|
3018
3082
|
if (o.kind == "changes" && o.revisions.length == 0) return !0;
|
|
3019
|
-
let
|
|
3083
|
+
let s;
|
|
3020
3084
|
try {
|
|
3021
|
-
|
|
3085
|
+
s = this.#O(a, o);
|
|
3022
3086
|
} catch {
|
|
3023
3087
|
if (o = await this.#e.syncDraft(e.projectId), !this.#R(e)) return !1;
|
|
3024
|
-
|
|
3088
|
+
s = this.#O(a, o);
|
|
3025
3089
|
}
|
|
3026
|
-
if (
|
|
3027
|
-
let
|
|
3090
|
+
if (s.revisionId == a.revisionId) return !0;
|
|
3091
|
+
let c = o.kind == "changes" && t != null ? mt(f(a), f(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
|
|
3028
3092
|
o.kind == "snapshot" && this.#j();
|
|
3029
|
-
let
|
|
3030
|
-
return this.#M(e.projectId,
|
|
3093
|
+
let l = this.#l.value.flows, u = gt(l, o.draftFlows, s), d = this.#l.value.diagnostics, p = this.#t.pendingCount == 0 && d != null && u.find((e) => e.flowId == d.flowId)?.draft?.closureDigest == d.closureDigest, m = this.#I(s, u, p);
|
|
3094
|
+
return this.#M(e.projectId, s.revisionId), o.kind == "changes" && o.revisions.length > 0 && t != null && c != null && i == this.#m && this.#k(e, t, c, i), n && (this.#c({
|
|
3031
3095
|
kind: m ? "error" : "success",
|
|
3032
3096
|
message: this.#r.t(m ? "notice.moduleUpdated" : "notice.draftUpdated")
|
|
3033
3097
|
}), p || this.#T()), !0;
|
|
@@ -3042,7 +3106,7 @@ var Ot = class {
|
|
|
3042
3106
|
if (e.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft revision chain.");
|
|
3043
3107
|
n = {
|
|
3044
3108
|
...e.revision,
|
|
3045
|
-
content:
|
|
3109
|
+
content: q(n, e.operations).content
|
|
3046
3110
|
};
|
|
3047
3111
|
}
|
|
3048
3112
|
return n;
|
|
@@ -3057,7 +3121,7 @@ var Ot = class {
|
|
|
3057
3121
|
return;
|
|
3058
3122
|
}
|
|
3059
3123
|
for (let e of n) a.targets.add(e);
|
|
3060
|
-
globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#A(),
|
|
3124
|
+
globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#A(), Tt);
|
|
3061
3125
|
return;
|
|
3062
3126
|
}
|
|
3063
3127
|
n.size == 0 || i.selectedNodeIds.length > 0 || (this.#p = {
|
|
@@ -3066,7 +3130,7 @@ var Ot = class {
|
|
|
3066
3130
|
projectId: e.projectId,
|
|
3067
3131
|
target: t,
|
|
3068
3132
|
targets: new Set(n),
|
|
3069
|
-
timer: globalThis.setTimeout(() => this.#A(),
|
|
3133
|
+
timer: globalThis.setTimeout(() => this.#A(), Tt),
|
|
3070
3134
|
viewport: this.#N().viewport
|
|
3071
3135
|
});
|
|
3072
3136
|
}
|
|
@@ -3077,7 +3141,7 @@ var Ot = class {
|
|
|
3077
3141
|
if (t.projectId != e.projectId || t.target?.kind != e.target.kind || t.target.id != e.target.id || t.selectedNodeIds.length > 0) return;
|
|
3078
3142
|
let n = this.#N().viewport;
|
|
3079
3143
|
if (n.x != e.viewport.x || n.y != e.viewport.y || n.zoom != e.viewport.zoom || t.draft == null) return;
|
|
3080
|
-
let r =
|
|
3144
|
+
let r = f(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
|
|
3081
3145
|
i.length == 1 && this.#z({ nodeFocus: {
|
|
3082
3146
|
nodeId: i[0],
|
|
3083
3147
|
requestId: ++this.#y
|
|
@@ -3091,7 +3155,7 @@ var Ot = class {
|
|
|
3091
3155
|
}
|
|
3092
3156
|
#N() {
|
|
3093
3157
|
let e = this.#l.value;
|
|
3094
|
-
return
|
|
3158
|
+
return _(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
|
|
3095
3159
|
}
|
|
3096
3160
|
#P() {
|
|
3097
3161
|
let e = this.#l.value.moduleEditor;
|
|
@@ -3101,7 +3165,7 @@ var Ot = class {
|
|
|
3101
3165
|
}), !1);
|
|
3102
3166
|
}
|
|
3103
3167
|
#F(e, t, n) {
|
|
3104
|
-
let r =
|
|
3168
|
+
let r = f(e), i = Et(r, t, n, this.#l.value.target);
|
|
3105
3169
|
return {
|
|
3106
3170
|
revision: r,
|
|
3107
3171
|
selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => i != null && r.selection(i, e) != null),
|
|
@@ -3139,13 +3203,13 @@ var Ot = class {
|
|
|
3139
3203
|
};
|
|
3140
3204
|
//#endregion
|
|
3141
3205
|
//#region src/workbench/browser/runtime/stores/workbenchStore.ts
|
|
3142
|
-
function
|
|
3206
|
+
function Ot(e) {
|
|
3143
3207
|
return new Map(e.nodes.map((e) => [e.id, e]));
|
|
3144
3208
|
}
|
|
3145
|
-
function
|
|
3146
|
-
return e == null || t == null ? [] :
|
|
3209
|
+
function kt(e, t) {
|
|
3210
|
+
return e == null || t == null ? [] : f(e).designerInputs(t);
|
|
3147
3211
|
}
|
|
3148
|
-
function
|
|
3212
|
+
function At(e, t, n, r, i) {
|
|
3149
3213
|
if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != t.id) return /* @__PURE__ */ new Map();
|
|
3150
3214
|
let a = r.find((e) => e.kind == "run.started" && e.payload.flowId == t.id)?.payload.scopeId;
|
|
3151
3215
|
return typeof a == "string" ? new Map(r.flatMap((e) => {
|
|
@@ -3153,43 +3217,40 @@ function jt(e, t, n, r, i) {
|
|
|
3153
3217
|
return e.payload.scopeId == a && e.payload.flowId == t.id && typeof n == "string" && i.has(n) ? [[e.sequence, n]] : [];
|
|
3154
3218
|
})) : /* @__PURE__ */ new Map();
|
|
3155
3219
|
}
|
|
3156
|
-
var Mt = {
|
|
3157
|
-
openExternalPage: async () => !1,
|
|
3158
|
-
returnUrl: ""
|
|
3159
|
-
}, Nt = class {
|
|
3220
|
+
var jt = { openExternalPage: async () => !1 }, Mt = class {
|
|
3160
3221
|
#e;
|
|
3161
3222
|
#t;
|
|
3162
3223
|
#n;
|
|
3163
3224
|
#r;
|
|
3164
|
-
constructor(
|
|
3165
|
-
this.#e = new
|
|
3225
|
+
constructor(r, i, a = () => crypto.randomUUID(), o = y(), s = jt) {
|
|
3226
|
+
this.#e = new S(), this.#n = t(), this.#r = !1, this.provideAddNodeOptions = async (e, t) => await this.#i([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => await this.#i([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)], e), this.provideAddNodeOptionChoices = async (e, t) => await (e.startsWith("trigger:") ? this.triggers.provideAddNodeOptionChoices(e, t) : this.connectors.provideAddNodeOptionChoices(e, t)), this.#t = o;
|
|
3166
3227
|
let c = (e) => {
|
|
3167
3228
|
this.#r || this.#n.set(e);
|
|
3168
3229
|
};
|
|
3169
|
-
this.runs = new
|
|
3170
|
-
let
|
|
3230
|
+
this.runs = new h(r, c, o), this.workspace = new Dt(r, c, a, o, (e) => void this.#a(r, e)), this.connectors = new be(r, this.workspace, c, s, o), this.triggers = new Ce(r, this.workspace, c, s, o), this.publications = new fe(r, this.workspace, c, a, o), this.runRequests = new ge(r, this.runs, c, o, a);
|
|
3231
|
+
let l = /* @__PURE__ */ new Map(), u, d = n((e) => {
|
|
3171
3232
|
let t = e(this.workspace.$.draft);
|
|
3172
|
-
|
|
3173
|
-
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(this.workspace.$.diagnostics)?.diagnostics, a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$),
|
|
3174
|
-
...
|
|
3175
|
-
r == null || n == null ? void 0 :
|
|
3233
|
+
u != t?.projectId && (l.clear(), u = t?.projectId);
|
|
3234
|
+
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(this.workspace.$.diagnostics)?.diagnostics, a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), d = e(this.runs.$.run), f = e(this.runs.$.events), p = n == null ? "" : `${n.kind}:${n.id}`, m = [
|
|
3235
|
+
...kt(t, n),
|
|
3236
|
+
r == null || n == null ? void 0 : v(r, n),
|
|
3176
3237
|
i,
|
|
3177
3238
|
a,
|
|
3178
3239
|
s,
|
|
3179
3240
|
c,
|
|
3180
|
-
|
|
3241
|
+
d,
|
|
3181
3242
|
f,
|
|
3182
|
-
...
|
|
3183
|
-
], h =
|
|
3243
|
+
...d == null ? [] : [t?.revisionId]
|
|
3244
|
+
], h = l.get(p);
|
|
3184
3245
|
if (h != null && h.inputs.length == m.length && h.inputs.every((e, t) => e === m[t])) return h.graph;
|
|
3185
|
-
let g =
|
|
3186
|
-
return
|
|
3246
|
+
let g = _(t, n, r, i, a, s, c, d, f);
|
|
3247
|
+
return l.set(p, {
|
|
3187
3248
|
graph: g,
|
|
3188
3249
|
inputs: m
|
|
3189
3250
|
}), g;
|
|
3190
|
-
}),
|
|
3251
|
+
}), f = e(d, Ot);
|
|
3191
3252
|
this.$ = {
|
|
3192
|
-
busy:
|
|
3253
|
+
busy: n((e) => {
|
|
3193
3254
|
let t = e(this.workspace.$.busy);
|
|
3194
3255
|
if (t != null) return t;
|
|
3195
3256
|
if (e(this.runRequests.$.starting)) return "run";
|
|
@@ -3198,13 +3259,13 @@ var Mt = {
|
|
|
3198
3259
|
if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
|
|
3199
3260
|
if (e(this.publications.$.changingTriggerId) != null) return "trigger";
|
|
3200
3261
|
}),
|
|
3201
|
-
designer:
|
|
3202
|
-
designerNodeById:
|
|
3262
|
+
designer: d,
|
|
3263
|
+
designerNodeById: f,
|
|
3203
3264
|
notice: this.#n,
|
|
3204
|
-
runEventNodes:
|
|
3205
|
-
selectedDesignerNode:
|
|
3265
|
+
runEventNodes: n((e) => At(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(f))),
|
|
3266
|
+
selectedDesignerNode: n((e) => {
|
|
3206
3267
|
let t = e(this.workspace.$.selectedNodeIds);
|
|
3207
|
-
return t.length == 1 ? e(
|
|
3268
|
+
return t.length == 1 ? e(f).get(t[0]) : void 0;
|
|
3208
3269
|
})
|
|
3209
3270
|
};
|
|
3210
3271
|
}
|
|
@@ -3270,58 +3331,69 @@ var Mt = {
|
|
|
3270
3331
|
if (this.#r || this.runRequests.$.submitting.value != null || this.workspace.$.projectId.value != t.projectId || n?.kind != "flow" || n.id != t.flowId) return;
|
|
3271
3332
|
let r = this.#e.begin();
|
|
3272
3333
|
try {
|
|
3273
|
-
let n = await e.getRun(t.
|
|
3334
|
+
let n = await e.getRun(t.runId), i = this.workspace.$.target.value;
|
|
3274
3335
|
if (!r() || this.#r || this.workspace.$.projectId.value != t.projectId || i?.kind != "flow" || i.id != t.flowId || n.projectId != t.projectId || n.flowId != t.flowId || n.runId != t.runId) return;
|
|
3275
3336
|
this.runs.followExternal(n);
|
|
3276
3337
|
} catch {
|
|
3277
3338
|
return;
|
|
3278
3339
|
}
|
|
3279
3340
|
}
|
|
3280
|
-
},
|
|
3281
|
-
function
|
|
3282
|
-
let
|
|
3283
|
-
return C(() => e.notify(
|
|
3341
|
+
}, Nt = ie(() => import("./flowWorkspace-CGsEHe2F.js"));
|
|
3342
|
+
function Pt({ host: e, store: t }) {
|
|
3343
|
+
let n = a(t.$.notice);
|
|
3344
|
+
return C(() => e.notify(n), [e, n]), C(() => () => e.notify(void 0), [e]), null;
|
|
3284
3345
|
}
|
|
3285
|
-
function
|
|
3286
|
-
let
|
|
3346
|
+
function Ft({ hrefFor: e, language: t, navigation: n, onLanguageChange: r, store: i, theme: o }) {
|
|
3347
|
+
let s = a(i.workspace.$.projectId), c = a(i.workspace.$.target);
|
|
3287
3348
|
return /* @__PURE__ */ w("div", {
|
|
3288
3349
|
className: "app-shell",
|
|
3289
|
-
children:
|
|
3290
|
-
|
|
3291
|
-
|
|
3350
|
+
children: s == null ? /* @__PURE__ */ w(te, {
|
|
3351
|
+
hrefForProject: (t) => e({
|
|
3352
|
+
projectId: t,
|
|
3353
|
+
view: "design"
|
|
3354
|
+
}),
|
|
3355
|
+
language: t,
|
|
3356
|
+
onCreateProject: (e) => n.createProject(e),
|
|
3292
3357
|
onLanguageChange: r,
|
|
3293
|
-
onSelectProject: (e) => void
|
|
3358
|
+
onSelectProject: (e) => void n.selectProject(e),
|
|
3294
3359
|
store: i
|
|
3295
|
-
}) :
|
|
3296
|
-
|
|
3297
|
-
|
|
3360
|
+
}) : c == null ? /* @__PURE__ */ w(ne, {
|
|
3361
|
+
hrefForFlow: (t) => e({
|
|
3362
|
+
flowId: t.flowId,
|
|
3363
|
+
projectId: s,
|
|
3364
|
+
view: t.draft == null ? "publications" : "design"
|
|
3365
|
+
}),
|
|
3366
|
+
language: t,
|
|
3367
|
+
onCreateFlow: (e) => n.createFlow(e),
|
|
3298
3368
|
onLanguageChange: r,
|
|
3299
|
-
onOpenProjects: () => void
|
|
3300
|
-
onSelectFlow: (e) =>
|
|
3369
|
+
onOpenProjects: () => void n.openProjects(),
|
|
3370
|
+
onSelectFlow: (e) => n.selectFlow(e),
|
|
3371
|
+
projectsHref: e({ view: "design" }),
|
|
3301
3372
|
store: i
|
|
3302
|
-
}) : /* @__PURE__ */ w(
|
|
3373
|
+
}) : /* @__PURE__ */ w(re, {
|
|
3303
3374
|
fallback: /* @__PURE__ */ w("main", {
|
|
3304
3375
|
"aria-busy": "true",
|
|
3305
3376
|
className: "workspace"
|
|
3306
3377
|
}),
|
|
3307
|
-
children: /* @__PURE__ */ w(
|
|
3308
|
-
|
|
3309
|
-
|
|
3378
|
+
children: /* @__PURE__ */ w(Nt, {
|
|
3379
|
+
hrefFor: e,
|
|
3380
|
+
language: t,
|
|
3381
|
+
navigation: n,
|
|
3310
3382
|
onLanguageChange: r,
|
|
3311
3383
|
store: i,
|
|
3312
|
-
theme:
|
|
3384
|
+
theme: o
|
|
3313
3385
|
})
|
|
3314
3386
|
})
|
|
3315
3387
|
});
|
|
3316
3388
|
}
|
|
3317
|
-
function
|
|
3318
|
-
let
|
|
3319
|
-
|
|
3320
|
-
let [{ i18n: u, navigation: d, store: f }] =
|
|
3321
|
-
let
|
|
3389
|
+
function It({ host: e, hrefFor: t, language: n, location: r, onLanguageChange: a, onNavigate: o, preferences: s, theme: c }) {
|
|
3390
|
+
let l = ae(o);
|
|
3391
|
+
l.current = o;
|
|
3392
|
+
let [{ i18n: u, navigation: d, store: f }] = oe(() => {
|
|
3393
|
+
let t = y(n), i = new Mt(new ee((t, n) => e.request(t, n), (t, n) => e.subscribeProject(t, n)), s, () => crypto.randomUUID(), t, e);
|
|
3322
3394
|
return {
|
|
3323
|
-
i18n:
|
|
3324
|
-
navigation: new
|
|
3395
|
+
i18n: t,
|
|
3396
|
+
navigation: new le(i, r, (e, t) => l.current(e, t)),
|
|
3325
3397
|
store: i
|
|
3326
3398
|
};
|
|
3327
3399
|
});
|
|
@@ -3339,26 +3411,27 @@ function Lt({ host: t, language: n, location: r, onLanguageChange: i, onNavigate
|
|
|
3339
3411
|
f
|
|
3340
3412
|
]), C(() => void d.apply(r), [r, d]), C(() => {
|
|
3341
3413
|
u.lang != n && u.switchLang(n);
|
|
3342
|
-
}, [u, n]), /* @__PURE__ */ w(
|
|
3414
|
+
}, [u, n]), /* @__PURE__ */ w(i, {
|
|
3343
3415
|
i18n: u,
|
|
3344
|
-
children: /* @__PURE__ */
|
|
3416
|
+
children: /* @__PURE__ */ se("div", {
|
|
3345
3417
|
className: "open-flow-workbench",
|
|
3346
|
-
"data-theme":
|
|
3347
|
-
children: [/* @__PURE__ */ w(
|
|
3348
|
-
host:
|
|
3418
|
+
"data-theme": c,
|
|
3419
|
+
children: [/* @__PURE__ */ w(Pt, {
|
|
3420
|
+
host: e,
|
|
3349
3421
|
store: f
|
|
3350
|
-
}), /* @__PURE__ */ w(
|
|
3422
|
+
}), /* @__PURE__ */ w(Ft, {
|
|
3423
|
+
hrefFor: t,
|
|
3351
3424
|
language: n,
|
|
3352
3425
|
navigation: d,
|
|
3353
|
-
onLanguageChange:
|
|
3426
|
+
onLanguageChange: a,
|
|
3354
3427
|
store: f,
|
|
3355
|
-
theme:
|
|
3428
|
+
theme: c
|
|
3356
3429
|
})]
|
|
3357
3430
|
})
|
|
3358
3431
|
});
|
|
3359
3432
|
}
|
|
3360
|
-
function
|
|
3361
|
-
return /* @__PURE__ */ w(
|
|
3433
|
+
function Lt({ sessionKey: e, ...t }) {
|
|
3434
|
+
return /* @__PURE__ */ w(It, { ...t }, e);
|
|
3362
3435
|
}
|
|
3363
3436
|
//#endregion
|
|
3364
|
-
export {
|
|
3437
|
+
export { Lt as OpenFlowWorkbench };
|