@oomol-lab/open-flow 0.1.0-beta.10 → 0.1.0-beta.11
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/DesignerIcon-ckcKnxxJ.js +2267 -0
- package/dist/browser/createResourceDialog-DhIU-HYW.js +111 -0
- package/dist/browser/{dist-meg_oHVR.js → dist-BZ5PTFAs.js} +335 -335
- package/dist/browser/dist-Bmb2mZvW.js +795 -0
- package/dist/browser/{dist-Cc0y2Pli.js → dist-Ce71Szg7.js} +622 -622
- package/dist/browser/dist-DSe6KRsr.js +1224 -0
- package/dist/browser/{dist-Dg_VXC8f.js → dist-DY4qlXTK.js} +134 -134
- package/dist/browser/{esm-yhVU_KbQ.js → esm-C64_h7HF.js} +59 -59
- package/dist/browser/flow-authoring-node.d.ts +11 -4
- package/dist/browser/flow-authoring.d.ts +1 -1
- package/dist/browser/flow-authoring.js +5018 -275
- package/dist/browser/flow-change-schema.d.ts +3 -0
- package/dist/browser/flow-change.d.ts +21 -8
- package/dist/browser/flow-change.js +5030 -155
- package/dist/browser/{flowChanges-B2ttnaj9.js → flowChanges-BINNGoug.js} +4397 -3766
- package/dist/browser/{flowRunInputEditorStore-DDidwd8h.js → flowRunInputEditorStore-NPGePkvP.js} +679 -689
- package/dist/browser/flowWorkspace-Dp_b8KXF.js +158409 -0
- package/dist/browser/{getPseudoElementBounds-5LArT6Xc.js → getPseudoElementBounds-Dfqo78k7.js} +691 -687
- package/dist/browser/{languages-DgJehE1g.js → languages-i3Xmpt6S.js} +6 -15
- package/dist/browser/licenses.md +82 -0
- package/dist/browser/{markdownContent-DUfLdnUt.js → markdownContent-BawLYUjh.js} +23 -23
- package/dist/browser/select-CbQHq-GM.js +6851 -0
- package/dist/browser/theme.css +34 -34
- package/dist/browser/{typeScriptSession-_TgJ_7Oq.js → typeScriptSession-BoV-FDl3.js} +257 -257
- package/dist/browser/waitNotificationInputs-fzyKN6mk.js +29 -0
- package/dist/browser/workbench-contract.d.ts +8 -2
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +1256 -1006
- package/dist/browser/workbenchSelect-BjbJjlNd.js +435 -0
- package/dist/common/control-api-conformance.js +234 -85
- package/dist/common/control-api.d.ts +37 -10
- package/dist/common/control-api.js +421 -342
- package/dist/common/engine-contract.d.ts +1 -1
- package/dist/common/flow-encoding.js +9 -7
- package/dist/common/flow-graph.d.ts +6 -0
- package/dist/common/flow-modules.d.ts +20 -0
- package/dist/common/flow-schema.d.ts +8 -0
- package/dist/common/flow-semantics.d.ts +6 -5
- package/dist/common/flow-semantics.js +14651 -9824
- package/dist/common/integration-trigger.d.ts +1 -0
- package/dist/common/run-events.d.ts +2 -2
- package/dist/common/run-events.js +8 -15
- package/dist/common/runtime-contract.d.ts +9 -1
- package/dist/common/runtime-contract.js +137 -27
- package/dist/common/scheduler.d.ts +11 -33
- package/dist/common/scheduler.js +7227 -428
- package/dist/index.d.ts +5 -5
- package/package.json +1 -1
- package/dist/browser/DesignerIcon-DjgOMYI5.js +0 -2065
- package/dist/browser/createResourceDialog-DNBueSYZ.js +0 -505
- package/dist/browser/dist-BMRLCebL.js +0 -1893
- package/dist/browser/flowWorkspace-Dr8-Hut9.js +0 -45541
- package/dist/browser/icons-KIOgjHpD.js +0 -730
- package/dist/browser/waitNotificationInputs-BPulOxYt.js +0 -26
- package/dist/browser/workbenchSelect-CbXrdwxW.js +0 -1375
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { a as e, f as t, i as n } from "./dist-C46JByB-.js";
|
|
2
2
|
import { a as r, i, s as a, t as o } from "./main-DmjVyuWr.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { $ as s, A as c, B as l, C as u, D as d, E as f, F as p, H as m, I as h, J as g, K as _, M as v, N as y, O as b, P as x, Q as S, R as C, S as w, U as T, V as E, W as D, X as O, Y as ee, Z as k, _ as A, a as j, at as te, b as M, c as N, ct as ne, d as re, dt as ie, et as ae, f as oe, ft as P, g as se, gt as F, h as ce, ht as le, i as ue, it as de, j as I, l as fe, lt as pe, m as me, mt as L, n as R, nt as he, o as ge, ot as _e, p as ve, pt as ye, q as be, rt as xe, s as Se, st as Ce, t as we, tt as z, u as Te, ut as Ee, v as De, w as Oe, x as ke, y as Ae, z as je } from "./flowChanges-BINNGoug.js";
|
|
4
|
+
import { Ot as Me, Un as Ne, Vn as B, jt as V } from "./getPseudoElementBounds-Dfqo78k7.js";
|
|
5
|
+
import { C as Pe, S as Fe, c as H, g as Ie, h as U, l as Le, m as Re, w as ze, x as Be, y as Ve } from "./select-CbQHq-GM.js";
|
|
6
|
+
import { _ as He, c as Ue, f as We, s as Ge, u as Ke } from "./DesignerIcon-ckcKnxxJ.js";
|
|
7
|
+
import { i as qe, n as Je, r as Ye, t as Xe } from "./languages-i3Xmpt6S.js";
|
|
8
|
+
import { a as Ze, c as Qe, i as $e, n as et, o as tt, r as nt, s as rt, t as it } from "./workbenchSelect-BjbJjlNd.js";
|
|
9
|
+
import { Suspense as at, lazy as ot, useEffect as W, useRef as G, useState as K } from "react";
|
|
10
|
+
import { Fragment as st, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
11
|
+
import * as ct from "effect/Cause";
|
|
12
|
+
import * as Y from "effect/Effect";
|
|
13
|
+
import * as lt from "effect/Exit";
|
|
14
|
+
import * as ut from "effect/Fiber";
|
|
10
15
|
//#region src/workbench/browser/runtime/navigation.ts
|
|
11
|
-
var
|
|
16
|
+
var dt = class {
|
|
12
17
|
#e;
|
|
13
18
|
#t;
|
|
14
19
|
#n;
|
|
@@ -67,7 +72,7 @@ var Je = class {
|
|
|
67
72
|
this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
|
|
68
73
|
}
|
|
69
74
|
async apply(e) {
|
|
70
|
-
if (
|
|
75
|
+
if (ft(e, this.#t)) return;
|
|
71
76
|
this.#t = e;
|
|
72
77
|
let t = ++this.#i;
|
|
73
78
|
this.#s = !0;
|
|
@@ -83,49 +88,59 @@ var Je = class {
|
|
|
83
88
|
flowId: n,
|
|
84
89
|
view: n == null ? "design" : e
|
|
85
90
|
};
|
|
86
|
-
|
|
91
|
+
ft(r, this.#t) || (this.#t = r, this.#e(r, { replace: t })), this.#r.set(r.view);
|
|
87
92
|
}
|
|
88
93
|
};
|
|
89
|
-
function
|
|
94
|
+
function ft(e, t) {
|
|
90
95
|
return e.flowId == t.flowId && e.view == t.view;
|
|
91
96
|
}
|
|
92
97
|
//#endregion
|
|
93
98
|
//#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
|
|
94
|
-
var
|
|
95
|
-
label:
|
|
99
|
+
var pt = ot(() => import("./createResourceDialog-DhIU-HYW.js")), mt = qe.map((e) => ({
|
|
100
|
+
label: Ye[e],
|
|
96
101
|
value: e
|
|
97
102
|
}));
|
|
98
|
-
function
|
|
99
|
-
let n = r(), [i, a] =
|
|
100
|
-
return t == null ? null : /* @__PURE__ */
|
|
103
|
+
function ht({ language: e, onLanguageChange: t }) {
|
|
104
|
+
let n = r(), [i, a] = K(null);
|
|
105
|
+
return t == null ? null : /* @__PURE__ */ J("div", {
|
|
101
106
|
className: "resource-language",
|
|
102
107
|
ref: a,
|
|
103
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ q("span", {
|
|
104
109
|
className: "sr-only",
|
|
105
110
|
children: n("language.label")
|
|
106
|
-
}), /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ q(it, {
|
|
107
112
|
ariaLabel: n("language.label"),
|
|
108
113
|
onValueChange: (e) => t(e),
|
|
109
|
-
options:
|
|
114
|
+
options: mt,
|
|
110
115
|
portalRoot: i,
|
|
111
116
|
value: e
|
|
112
117
|
})]
|
|
113
118
|
});
|
|
114
119
|
}
|
|
115
|
-
function
|
|
116
|
-
let f =
|
|
117
|
-
async function
|
|
120
|
+
function gt({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
|
|
121
|
+
let [c, l] = K(null), u = G(null), d = G(null), f = G(null), p = i(), m = r(), [h, g] = K("idle"), [_, v] = K(n.name), [y, b] = K(), x = n.live != null && n.live.revisionId != n.draftRevisionId;
|
|
122
|
+
async function S(e) {
|
|
123
|
+
b(e == "publish" ? "publish" : "enabled");
|
|
124
|
+
try {
|
|
125
|
+
e == "publish" ? await s.workspace.publishFlow(n) : await s.workspace.setFlowEnabled(n, e);
|
|
126
|
+
} finally {
|
|
127
|
+
b(void 0);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
let C = U(_);
|
|
131
|
+
async function w(e) {
|
|
118
132
|
e.preventDefault();
|
|
119
|
-
let t =
|
|
120
|
-
|
|
133
|
+
let t = _.trim();
|
|
134
|
+
U(t) == null && await s.workspace.renameFlow(n.flowId, t) && g("idle");
|
|
121
135
|
}
|
|
122
|
-
async function
|
|
123
|
-
await
|
|
136
|
+
async function T() {
|
|
137
|
+
await s.workspace.deleteFlow(n.flowId) && g("idle");
|
|
124
138
|
}
|
|
125
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ J("div", {
|
|
126
140
|
className: "resource-item-row",
|
|
141
|
+
ref: l,
|
|
127
142
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ J(B, {
|
|
129
144
|
"aria-disabled": n.status == "retiring",
|
|
130
145
|
className: "resource-list-row flow-columns",
|
|
131
146
|
nativeButton: !1,
|
|
@@ -134,310 +149,355 @@ function $e({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: d }) {
|
|
|
134
149
|
e.preventDefault();
|
|
135
150
|
return;
|
|
136
151
|
}
|
|
137
|
-
|
|
152
|
+
ae(e, () => o(n));
|
|
138
153
|
},
|
|
139
|
-
render: /* @__PURE__ */
|
|
154
|
+
render: /* @__PURE__ */ q("a", { href: n.status == "retiring" ? void 0 : a }),
|
|
140
155
|
tabIndex: n.status == "retiring" ? -1 : void 0,
|
|
141
156
|
variant: "ghost",
|
|
142
157
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ J("span", {
|
|
144
159
|
className: "resource-primary-cell",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ q("span", {
|
|
146
161
|
className: "resource-icon",
|
|
147
|
-
children: /* @__PURE__ */
|
|
148
|
-
}), /* @__PURE__ */
|
|
162
|
+
children: /* @__PURE__ */ q(H, { name: "flow" })
|
|
163
|
+
}), /* @__PURE__ */ J("span", { children: [/* @__PURE__ */ J("span", {
|
|
149
164
|
className: "flex min-w-0 items-center gap-2",
|
|
150
|
-
children: [/* @__PURE__ */
|
|
165
|
+
children: [/* @__PURE__ */ q("strong", {
|
|
151
166
|
className: "min-w-0 truncate",
|
|
152
167
|
children: n.name
|
|
153
|
-
}), e != null && /* @__PURE__ */
|
|
168
|
+
}), e != null && /* @__PURE__ */ q(ie, {
|
|
154
169
|
className: "min-w-0 shrink",
|
|
155
170
|
title: e,
|
|
156
171
|
variant: "secondary",
|
|
157
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ q("span", {
|
|
158
173
|
className: "truncate",
|
|
159
174
|
children: e
|
|
160
175
|
})
|
|
161
176
|
})]
|
|
162
|
-
}), /* @__PURE__ */
|
|
177
|
+
}), /* @__PURE__ */ q("code", {
|
|
163
178
|
translate: "no",
|
|
164
179
|
children: n.flowId
|
|
165
180
|
})] })]
|
|
166
181
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ q("time", {
|
|
168
183
|
dateTime: n.updatedAt,
|
|
169
|
-
children: new Date(n.updatedAt).toLocaleString(
|
|
184
|
+
children: new Date(n.updatedAt).toLocaleString(p)
|
|
170
185
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
className:
|
|
173
|
-
children:
|
|
174
|
-
"aria-hidden": "true",
|
|
175
|
-
className: `status-dot ${n.status == "active" ? "success" : "running"}`
|
|
176
|
-
}), p(n.status == "active" ? "resource.active" : "resource.retiring")]
|
|
186
|
+
/* @__PURE__ */ q("span", {
|
|
187
|
+
className: "resource-status",
|
|
188
|
+
children: m(n.status == "retiring" ? "resource.retiring" : n.live == null ? "resource.notPublished" : x ? "resource.unpublishedChanges" : "resource.isPublished")
|
|
177
189
|
})
|
|
178
190
|
]
|
|
179
191
|
}),
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
"aria-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
192
|
+
/* @__PURE__ */ J("div", {
|
|
193
|
+
className: "resource-live-controls",
|
|
194
|
+
"aria-busy": y != null,
|
|
195
|
+
children: [n.live == null ? /* @__PURE__ */ q("span", {
|
|
196
|
+
className: "resource-status",
|
|
197
|
+
title: m("resource.publishFirst"),
|
|
198
|
+
children: "—"
|
|
199
|
+
}) : /* @__PURE__ */ J(ze, {
|
|
200
|
+
className: "resource-enable",
|
|
201
|
+
title: m("resource.enabledHint"),
|
|
202
|
+
children: [/* @__PURE__ */ q(Ge, {
|
|
203
|
+
"aria-label": m("resource.enableFlow", { name: n.name }),
|
|
204
|
+
checked: n.live?.enabled ?? !1,
|
|
205
|
+
disabled: n.status != "active" || n.live == null || t != null || y != null,
|
|
206
|
+
onCheckedChange: (e) => void S(e),
|
|
207
|
+
size: "sm"
|
|
208
|
+
}), /* @__PURE__ */ q("span", { children: m(n.live?.enabled ? "resource.enabled" : "resource.disabled") })]
|
|
209
|
+
}), /* @__PURE__ */ q(B, {
|
|
210
|
+
disabled: n.status != "active" || t != null || y != null || n.live != null && !x,
|
|
211
|
+
onClick: () => void S("publish"),
|
|
212
|
+
size: "sm",
|
|
213
|
+
variant: "outline",
|
|
214
|
+
children: m(y == "publish" ? "workspace.publishing" : n.live == null ? "resource.publish" : "resource.publishUpdate")
|
|
215
|
+
})]
|
|
189
216
|
}),
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
217
|
+
n.status == "active" && /* @__PURE__ */ J(Ue, { children: [/* @__PURE__ */ q(He, {
|
|
218
|
+
"aria-label": m("sidebar.flowActions", { name: n.name }),
|
|
219
|
+
disabled: t != null || y != null,
|
|
220
|
+
render: /* @__PURE__ */ q(B, {
|
|
221
|
+
className: "resource-row-more",
|
|
222
|
+
ref: u,
|
|
223
|
+
size: "icon-sm",
|
|
224
|
+
variant: "ghost",
|
|
225
|
+
children: /* @__PURE__ */ q(H, { name: "more" })
|
|
226
|
+
})
|
|
227
|
+
}), /* @__PURE__ */ J(Ke, {
|
|
228
|
+
align: "end",
|
|
229
|
+
className: "min-w-36",
|
|
230
|
+
container: c,
|
|
231
|
+
finalFocus: h == "idle",
|
|
232
|
+
children: [/* @__PURE__ */ q(We, {
|
|
193
233
|
onClick: () => {
|
|
194
|
-
|
|
234
|
+
v(n.name), g("rename");
|
|
195
235
|
},
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}), /* @__PURE__ */ G(c, {
|
|
200
|
-
onClick: () => h("delete"),
|
|
201
|
-
size: "sm",
|
|
236
|
+
children: m("common.rename")
|
|
237
|
+
}), /* @__PURE__ */ q(We, {
|
|
238
|
+
onClick: () => g("delete"),
|
|
202
239
|
variant: "destructive",
|
|
203
|
-
children:
|
|
240
|
+
children: m("common.delete")
|
|
204
241
|
})]
|
|
242
|
+
})] }),
|
|
243
|
+
/* @__PURE__ */ q(et, {
|
|
244
|
+
open: h == "rename",
|
|
245
|
+
onOpenChange: (e) => {
|
|
246
|
+
e || g("idle");
|
|
247
|
+
},
|
|
248
|
+
children: /* @__PURE__ */ q($e, {
|
|
249
|
+
container: c,
|
|
250
|
+
initialFocus: d,
|
|
251
|
+
finalFocus: u,
|
|
252
|
+
closeLabel: m("common.cancel"),
|
|
253
|
+
children: /* @__PURE__ */ J("form", {
|
|
254
|
+
className: "flex flex-col gap-4",
|
|
255
|
+
onSubmit: (e) => void w(e),
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ q(rt, { children: /* @__PURE__ */ q(Qe, { children: m("sidebar.renameFlow", { name: n.name }) }) }),
|
|
258
|
+
/* @__PURE__ */ J(Ve, {
|
|
259
|
+
"data-invalid": _.length > 0 && C != null,
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ q(Pe, {
|
|
262
|
+
htmlFor: `rename-flow-${n.flowId}`,
|
|
263
|
+
children: m("resource.flowName")
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ q(V, {
|
|
266
|
+
autoComplete: "off",
|
|
267
|
+
"aria-invalid": _.length > 0 && C != null,
|
|
268
|
+
"aria-describedby": _.length > 0 && C != null ? `rename-error-${n.flowId}` : void 0,
|
|
269
|
+
id: `rename-flow-${n.flowId}`,
|
|
270
|
+
name: "flow-name",
|
|
271
|
+
onChange: (e) => v(e.target.value),
|
|
272
|
+
ref: d,
|
|
273
|
+
required: !0,
|
|
274
|
+
value: _
|
|
275
|
+
}),
|
|
276
|
+
_.length > 0 && C != null && /* @__PURE__ */ q(Be, {
|
|
277
|
+
id: `rename-error-${n.flowId}`,
|
|
278
|
+
children: m(`resource.nameIssue.${C}`, { max: 80 })
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
}),
|
|
282
|
+
/* @__PURE__ */ J(tt, { children: [/* @__PURE__ */ q(nt, {
|
|
283
|
+
render: /* @__PURE__ */ q(B, { variant: "outline" }),
|
|
284
|
+
type: "button",
|
|
285
|
+
children: m("common.cancel")
|
|
286
|
+
}), /* @__PURE__ */ q(B, {
|
|
287
|
+
disabled: t != null || C != null,
|
|
288
|
+
type: "submit",
|
|
289
|
+
children: m("common.save")
|
|
290
|
+
})] })
|
|
291
|
+
]
|
|
292
|
+
})
|
|
293
|
+
})
|
|
205
294
|
}),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}),
|
|
230
|
-
/* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G(c, {
|
|
231
|
-
onClick: () => h("idle"),
|
|
232
|
-
size: "sm",
|
|
233
|
-
variant: "outline",
|
|
234
|
-
children: p("common.cancel")
|
|
235
|
-
}), /* @__PURE__ */ G(c, {
|
|
236
|
-
disabled: t != null || b != null,
|
|
237
|
-
size: "sm",
|
|
238
|
-
type: "submit",
|
|
239
|
-
children: p("common.save")
|
|
240
|
-
})] })
|
|
241
|
-
]
|
|
242
|
-
}),
|
|
243
|
-
m == "delete" && /* @__PURE__ */ K("div", {
|
|
244
|
-
className: "resource-row-confirm",
|
|
245
|
-
role: "group",
|
|
246
|
-
"aria-label": p("sidebar.deleteFlow", { name: n.name }),
|
|
247
|
-
children: [/* @__PURE__ */ G("span", { children: /* @__PURE__ */ G("strong", { children: p("sidebar.deleteFlowConfirm", { name: n.name }) }) }), /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G(c, {
|
|
248
|
-
onClick: () => h("idle"),
|
|
249
|
-
size: "sm",
|
|
250
|
-
variant: "outline",
|
|
251
|
-
children: p("common.cancel")
|
|
252
|
-
}), /* @__PURE__ */ G(c, {
|
|
253
|
-
disabled: t != null,
|
|
254
|
-
onClick: () => void S(),
|
|
255
|
-
size: "sm",
|
|
256
|
-
variant: "destructive",
|
|
257
|
-
children: p(t == "flow" ? "common.deleting" : "common.delete")
|
|
258
|
-
})] })]
|
|
295
|
+
/* @__PURE__ */ q(et, {
|
|
296
|
+
open: h == "delete",
|
|
297
|
+
onOpenChange: (e) => {
|
|
298
|
+
e || g("idle");
|
|
299
|
+
},
|
|
300
|
+
children: /* @__PURE__ */ J($e, {
|
|
301
|
+
container: c,
|
|
302
|
+
initialFocus: f,
|
|
303
|
+
finalFocus: u,
|
|
304
|
+
showCloseButton: !1,
|
|
305
|
+
children: [/* @__PURE__ */ J(rt, { children: [/* @__PURE__ */ q(Qe, { children: m("sidebar.deleteFlowConfirm", { name: n.name }) }), /* @__PURE__ */ q(Ze, { children: m("resource.deleteDescription") })] }), /* @__PURE__ */ J(tt, { children: [/* @__PURE__ */ q(nt, {
|
|
306
|
+
render: /* @__PURE__ */ q(B, {
|
|
307
|
+
ref: f,
|
|
308
|
+
variant: "outline"
|
|
309
|
+
}),
|
|
310
|
+
children: m("common.cancel")
|
|
311
|
+
}), /* @__PURE__ */ q(B, {
|
|
312
|
+
disabled: t != null,
|
|
313
|
+
onClick: () => void T(),
|
|
314
|
+
variant: "destructive",
|
|
315
|
+
children: m(t == "flow" ? "common.deleting" : "common.delete")
|
|
316
|
+
})] })]
|
|
317
|
+
})
|
|
259
318
|
})
|
|
260
319
|
]
|
|
261
320
|
});
|
|
262
321
|
}
|
|
263
|
-
function
|
|
264
|
-
return /* @__PURE__ */
|
|
322
|
+
function _t() {
|
|
323
|
+
return /* @__PURE__ */ J("div", {
|
|
265
324
|
"aria-hidden": "true",
|
|
266
325
|
className: "resource-list-row resource-skeleton-row flow-columns",
|
|
267
326
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ J("span", {
|
|
269
328
|
className: "resource-primary-cell",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ q(z, { className: "size-8 shrink-0" }), /* @__PURE__ */ J("span", {
|
|
271
330
|
className: "resource-skeleton-copy",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ q(z, { className: "h-3.5 w-36" }), /* @__PURE__ */ q(z, { className: "h-2.5 w-48 max-w-full" })]
|
|
273
332
|
})]
|
|
274
333
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ q(z, { className: "h-3 w-28" }),
|
|
335
|
+
/* @__PURE__ */ q(z, { className: "h-3 w-16" })
|
|
277
336
|
]
|
|
278
337
|
});
|
|
279
338
|
}
|
|
280
|
-
function
|
|
281
|
-
let
|
|
282
|
-
async function
|
|
339
|
+
function vt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: i, hrefForFlow: o, hostAction: c, hostTitle: l, language: u, onCreateFlow: d, onHostAction: f, onLanguageChange: p, onSelectFlow: m, store: h }) {
|
|
340
|
+
let g = r(), _ = a(h.workspace.$.busy), v = a(h.workspace.$.flowLoadFailed), y = a(h.workspace.$.flowLoadMoreFailed), b = a(h.workspace.$.flowLoading), x = a(h.workspace.$.flowLoadingMore), S = a(h.workspace.$.flowNextCursor), C = a(h.workspace.$.flowRefreshing), w = a(h.workspace.$.flows), T = a(h.workspace.$.flowTotal), [E, D] = K(!1), [O, ee] = K(""), [k, A] = K(""), j = O.trim().toLocaleLowerCase(), M = w.filter((e) => e.name.toLocaleLowerCase().includes(j));
|
|
341
|
+
async function N(e) {
|
|
283
342
|
e.preventDefault();
|
|
284
|
-
let t =
|
|
285
|
-
|
|
343
|
+
let t = k.trim();
|
|
344
|
+
U(t) != null || !await d(t) || (D(!1), A(""));
|
|
286
345
|
}
|
|
287
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ q("main", {
|
|
288
347
|
className: "resource-browser",
|
|
289
|
-
children: /* @__PURE__ */
|
|
290
|
-
className:
|
|
348
|
+
children: /* @__PURE__ */ J("div", {
|
|
349
|
+
className: Ne("resource-page", e != "default" && "resource-page-full"),
|
|
291
350
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ q("h1", {
|
|
293
352
|
className: "sr-only",
|
|
294
|
-
children:
|
|
353
|
+
children: g("resource.flows")
|
|
295
354
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ J("section", {
|
|
297
356
|
"aria-labelledby": "flow-list-title",
|
|
298
357
|
className: "resource-list-section",
|
|
299
358
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ J("div", {
|
|
301
360
|
className: "resource-list-title",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ J("div", {
|
|
303
362
|
className: "resource-list-heading",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ q("h2", {
|
|
305
364
|
id: "flow-list-title",
|
|
306
|
-
children:
|
|
307
|
-
}), !
|
|
308
|
-
}), /* @__PURE__ */
|
|
365
|
+
children: g("resource.allFlows")
|
|
366
|
+
}), !b && /* @__PURE__ */ q("span", { children: g("resource.flowCount", { count: T ?? w.length }) })]
|
|
367
|
+
}), /* @__PURE__ */ J("div", {
|
|
309
368
|
className: "resource-list-actions",
|
|
310
369
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
language:
|
|
313
|
-
onLanguageChange:
|
|
370
|
+
/* @__PURE__ */ q(ht, {
|
|
371
|
+
language: u,
|
|
372
|
+
onLanguageChange: p
|
|
314
373
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ J(he, {
|
|
316
375
|
className: "w-full sm:w-56",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ q(xe, { children: /* @__PURE__ */ q(H, {
|
|
318
377
|
name: "search",
|
|
319
378
|
size: 17
|
|
320
|
-
}) }), /* @__PURE__ */
|
|
379
|
+
}) }), /* @__PURE__ */ q(de, {
|
|
321
380
|
autoComplete: "off",
|
|
322
|
-
"aria-label":
|
|
381
|
+
"aria-label": g("resource.searchFlows"),
|
|
323
382
|
name: "flow-search",
|
|
324
|
-
onChange: (e) =>
|
|
325
|
-
placeholder:
|
|
326
|
-
value:
|
|
383
|
+
onChange: (e) => ee(e.target.value),
|
|
384
|
+
placeholder: g("resource.searchFlows"),
|
|
385
|
+
value: O
|
|
327
386
|
})]
|
|
328
387
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
"aria-label":
|
|
331
|
-
disabled:
|
|
332
|
-
onClick: () => void
|
|
388
|
+
/* @__PURE__ */ q(B, {
|
|
389
|
+
"aria-label": g("common.refresh"),
|
|
390
|
+
disabled: b || C || _ != null,
|
|
391
|
+
onClick: () => void h.workspace.reloadFlows(),
|
|
333
392
|
size: "icon",
|
|
334
|
-
title:
|
|
393
|
+
title: g("common.refresh"),
|
|
335
394
|
variant: "outline",
|
|
336
|
-
children: /* @__PURE__ */
|
|
337
|
-
className:
|
|
395
|
+
children: /* @__PURE__ */ q(H, {
|
|
396
|
+
className: C ? "animate-spin" : void 0,
|
|
338
397
|
name: "refresh"
|
|
339
398
|
})
|
|
340
399
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ J(B, {
|
|
342
401
|
className: "resource-page-primary-action",
|
|
343
|
-
disabled:
|
|
344
|
-
onClick: () =>
|
|
345
|
-
children: [/* @__PURE__ */
|
|
402
|
+
disabled: _ != null,
|
|
403
|
+
onClick: () => D(!0),
|
|
404
|
+
children: [/* @__PURE__ */ q(H, {
|
|
346
405
|
"data-icon": "inline-start",
|
|
347
406
|
name: "plus"
|
|
348
|
-
}),
|
|
407
|
+
}), g("resource.newFlow")]
|
|
349
408
|
}),
|
|
350
|
-
|
|
351
|
-
action:
|
|
352
|
-
onAction:
|
|
353
|
-
title:
|
|
409
|
+
c != null && l != null && f != null && /* @__PURE__ */ q(s, {
|
|
410
|
+
action: c,
|
|
411
|
+
onAction: f,
|
|
412
|
+
title: l
|
|
354
413
|
})
|
|
355
414
|
]
|
|
356
415
|
})]
|
|
357
416
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ J("div", {
|
|
359
418
|
"aria-hidden": "true",
|
|
360
419
|
className: "resource-list-columns flow-columns",
|
|
361
420
|
children: [
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ q("span", { children: g("resource.name") }),
|
|
422
|
+
/* @__PURE__ */ q("span", { children: g("resource.updated") }),
|
|
423
|
+
/* @__PURE__ */ q("span", { children: g("resource.publication") }),
|
|
424
|
+
/* @__PURE__ */ q("span", { children: g("resource.enabledColumn") })
|
|
365
425
|
]
|
|
366
426
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ q("div", {
|
|
368
428
|
className: "resource-list",
|
|
369
|
-
children:
|
|
429
|
+
children: b ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ q(_t, {}, t)) : v ? /* @__PURE__ */ J(te, {
|
|
370
430
|
className: "min-h-64",
|
|
371
431
|
role: "alert",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
373
|
-
/* @__PURE__ */
|
|
432
|
+
children: [/* @__PURE__ */ J(ne, { children: [
|
|
433
|
+
/* @__PURE__ */ q(pe, {
|
|
374
434
|
variant: "icon",
|
|
375
|
-
children: /* @__PURE__ */
|
|
435
|
+
children: /* @__PURE__ */ q(H, {
|
|
376
436
|
name: "alert",
|
|
377
437
|
size: 20
|
|
378
438
|
})
|
|
379
439
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
] }), /* @__PURE__ */
|
|
383
|
-
onClick: () => void
|
|
440
|
+
/* @__PURE__ */ q(Ee, { children: g("resource.flowsLoadFailed") }),
|
|
441
|
+
/* @__PURE__ */ q(Ce, { children: g("resource.flowsLoadFailedDescription") })
|
|
442
|
+
] }), /* @__PURE__ */ q(_e, { children: /* @__PURE__ */ q(B, {
|
|
443
|
+
onClick: () => void h.retryFlows(),
|
|
384
444
|
variant: "outline",
|
|
385
|
-
children:
|
|
445
|
+
children: g("empty.retry")
|
|
386
446
|
}) })]
|
|
387
|
-
}) :
|
|
447
|
+
}) : M.length == 0 ? /* @__PURE__ */ J(te, {
|
|
388
448
|
className: "min-h-64",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
449
|
+
children: [/* @__PURE__ */ J(ne, { children: [
|
|
450
|
+
/* @__PURE__ */ q(pe, {
|
|
391
451
|
variant: "icon",
|
|
392
|
-
children: /* @__PURE__ */
|
|
452
|
+
children: /* @__PURE__ */ q(H, {
|
|
393
453
|
name: "flow",
|
|
394
454
|
size: 20
|
|
395
455
|
})
|
|
396
456
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
] }),
|
|
400
|
-
onClick: () =>
|
|
457
|
+
/* @__PURE__ */ q(Ee, { children: g(j.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
|
|
458
|
+
/* @__PURE__ */ q(Ce, { children: g(j.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
|
|
459
|
+
] }), j.length == 0 && /* @__PURE__ */ q(_e, { children: /* @__PURE__ */ J(B, {
|
|
460
|
+
onClick: () => D(!0),
|
|
401
461
|
variant: "outline",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
462
|
+
children: [/* @__PURE__ */ q(H, {
|
|
403
463
|
"data-icon": "inline-start",
|
|
404
464
|
name: "plus"
|
|
405
|
-
}),
|
|
465
|
+
}), g("resource.newFlow")]
|
|
406
466
|
}) })]
|
|
407
|
-
}) :
|
|
467
|
+
}) : M.map((e) => /* @__PURE__ */ q(gt, {
|
|
408
468
|
badge: i?.[e.flowId],
|
|
409
|
-
busy:
|
|
469
|
+
busy: _,
|
|
410
470
|
flow: e,
|
|
411
471
|
href: o(e),
|
|
412
|
-
onSelect:
|
|
413
|
-
store:
|
|
472
|
+
onSelect: m,
|
|
473
|
+
store: h
|
|
414
474
|
}, e.flowId))
|
|
415
475
|
}),
|
|
416
|
-
|
|
476
|
+
S != null && /* @__PURE__ */ q("div", {
|
|
417
477
|
className: "resource-list-footer",
|
|
418
|
-
children: /* @__PURE__ */
|
|
419
|
-
disabled:
|
|
420
|
-
onClick: () => void
|
|
478
|
+
children: /* @__PURE__ */ q(B, {
|
|
479
|
+
disabled: x || C,
|
|
480
|
+
onClick: () => void h.workspace.loadMoreFlows(),
|
|
421
481
|
variant: "outline",
|
|
422
|
-
children:
|
|
482
|
+
children: g(x ? "resource.loadingMore" : y ? "resource.retryLoadMore" : "resource.loadMore")
|
|
423
483
|
})
|
|
424
484
|
})
|
|
425
485
|
]
|
|
426
486
|
}),
|
|
427
|
-
|
|
487
|
+
E && /* @__PURE__ */ q(at, {
|
|
428
488
|
fallback: null,
|
|
429
|
-
children: /* @__PURE__ */
|
|
489
|
+
children: /* @__PURE__ */ q(pt, {
|
|
430
490
|
disabled: t,
|
|
431
491
|
field: n,
|
|
432
492
|
id: "flow-name",
|
|
433
|
-
issue:
|
|
434
|
-
label:
|
|
435
|
-
name:
|
|
436
|
-
onNameChange:
|
|
437
|
-
onOpenChange:
|
|
438
|
-
onSubmit: (e) => void
|
|
439
|
-
pending:
|
|
440
|
-
title:
|
|
493
|
+
issue: U(k),
|
|
494
|
+
label: g("resource.flowName"),
|
|
495
|
+
name: k,
|
|
496
|
+
onNameChange: A,
|
|
497
|
+
onOpenChange: D,
|
|
498
|
+
onSubmit: (e) => void N(e),
|
|
499
|
+
pending: _ == "flow",
|
|
500
|
+
title: g("resource.newFlow")
|
|
441
501
|
})
|
|
442
502
|
})
|
|
443
503
|
]
|
|
@@ -446,7 +506,7 @@ function tt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
446
506
|
}
|
|
447
507
|
//#endregion
|
|
448
508
|
//#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
|
|
449
|
-
var
|
|
509
|
+
var yt = (e) => crypto.getRandomValues(new Uint8Array(e)), bt = (e, t, n) => {
|
|
450
510
|
let r = 256 - 256 % e.length;
|
|
451
511
|
if (r === 256) {
|
|
452
512
|
let r = e.length - 1;
|
|
@@ -468,43 +528,29 @@ var nt = (e) => crypto.getRandomValues(new Uint8Array(e)), rt = (e, t, n) => {
|
|
|
468
528
|
for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
|
|
469
529
|
}
|
|
470
530
|
};
|
|
471
|
-
},
|
|
531
|
+
}, xt = (e, t = 21) => bt(e, t | 0, yt);
|
|
472
532
|
//#endregion
|
|
473
533
|
//#region src/flow/common/edgeChanges.ts
|
|
474
|
-
function
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
sourceHandle: n.sourceHandle,
|
|
478
|
-
target: n.target,
|
|
479
|
-
targetHandle: n.targetHandle
|
|
480
|
-
}, i = st(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
481
|
-
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : ke(e, [{
|
|
482
|
-
before: a,
|
|
483
|
-
edge: r,
|
|
534
|
+
function St(e, t, n) {
|
|
535
|
+
return wt(e, t)?.edges.some((e) => Me(e, n)) ? [] : [{
|
|
536
|
+
edge: n,
|
|
484
537
|
kind: "graph.edge.connect",
|
|
485
538
|
target: t
|
|
486
|
-
}]
|
|
539
|
+
}];
|
|
487
540
|
}
|
|
488
|
-
function
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
sourceHandle: n.sourceHandle,
|
|
492
|
-
target: n.target,
|
|
493
|
-
targetHandle: n.targetHandle
|
|
494
|
-
}, i = st(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
495
|
-
return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
|
|
496
|
-
before: a,
|
|
497
|
-
edge: r,
|
|
541
|
+
function Ct(e, t, n) {
|
|
542
|
+
return wt(e, t)?.edges.some((e) => Me(e, n)) ? [{
|
|
543
|
+
edge: n,
|
|
498
544
|
kind: "graph.edge.disconnect",
|
|
499
545
|
target: t
|
|
500
|
-
}];
|
|
546
|
+
}] : [];
|
|
501
547
|
}
|
|
502
|
-
function
|
|
548
|
+
function wt(e, t) {
|
|
503
549
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
504
550
|
}
|
|
505
551
|
//#endregion
|
|
506
552
|
//#region src/flow/common/moduleChanges.ts
|
|
507
|
-
async function
|
|
553
|
+
async function Tt(e) {
|
|
508
554
|
try {
|
|
509
555
|
let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
|
|
510
556
|
errorRecovery: !0,
|
|
@@ -520,7 +566,7 @@ async function ct(e) {
|
|
|
520
566
|
return [];
|
|
521
567
|
}
|
|
522
568
|
}
|
|
523
|
-
function
|
|
569
|
+
function Et(e, t, n, r, i) {
|
|
524
570
|
return [{
|
|
525
571
|
beforeImports: n,
|
|
526
572
|
beforeSource: t,
|
|
@@ -530,7 +576,7 @@ function lt(e, t, n, r, i) {
|
|
|
530
576
|
source: r
|
|
531
577
|
}];
|
|
532
578
|
}
|
|
533
|
-
var
|
|
579
|
+
var Dt = xt("23456789abcdefghjkmnpqrstuvwxyz", 10), X = {
|
|
534
580
|
activities: [],
|
|
535
581
|
activitiesLoadFailed: !1,
|
|
536
582
|
activitiesLoading: !1,
|
|
@@ -545,24 +591,25 @@ var ut = it("23456789abcdefghjkmnpqrstuvwxyz", 10), q = {
|
|
|
545
591
|
publications: [],
|
|
546
592
|
publishing: !1,
|
|
547
593
|
refreshing: !1
|
|
548
|
-
},
|
|
549
|
-
function
|
|
594
|
+
}, Ot = 20, kt = 50, At = 750;
|
|
595
|
+
function Z(e, t) {
|
|
550
596
|
return e?.flowId == t.flowId;
|
|
551
597
|
}
|
|
552
|
-
var
|
|
598
|
+
var jt = class {
|
|
553
599
|
#e;
|
|
554
600
|
#t;
|
|
555
601
|
#n;
|
|
556
|
-
#r = new
|
|
557
|
-
#i = new
|
|
602
|
+
#r = new m();
|
|
603
|
+
#i = new m();
|
|
558
604
|
#a;
|
|
559
|
-
#o = new
|
|
560
|
-
#s = new
|
|
605
|
+
#o = new m();
|
|
606
|
+
#s = new m();
|
|
561
607
|
#c;
|
|
562
|
-
#l = t(
|
|
608
|
+
#l = t(X);
|
|
563
609
|
#u;
|
|
564
610
|
#d;
|
|
565
|
-
|
|
611
|
+
#f;
|
|
612
|
+
constructor(t, n, r, i, a = F, o = P()) {
|
|
566
613
|
this.#e = t, this.#t = a, this.#n = o, this.#a = i, this.#c = r, this.#u = n, this.$ = {
|
|
567
614
|
activities: e(this.#l, (e) => e.activities),
|
|
568
615
|
activitiesLoadFailed: e(this.#l, (e) => e.activitiesLoadFailed),
|
|
@@ -591,29 +638,29 @@ var mt = class {
|
|
|
591
638
|
};
|
|
592
639
|
}
|
|
593
640
|
dispose() {
|
|
594
|
-
this.#r.invalidate(), this.#i.invalidate(), this.#o.invalidate(), this.#s.invalidate();
|
|
641
|
+
this.#r.invalidate(), this.#i.invalidate(), this.#v(), this.#o.invalidate(), this.#s.invalidate();
|
|
595
642
|
for (let e of Object.values(this.$)) e.dispose();
|
|
596
643
|
this.#l.dispose();
|
|
597
644
|
}
|
|
598
645
|
reset() {
|
|
599
|
-
this.#r.invalidate(), this.#i.invalidate(), this.#o.invalidate(), this.#s.invalidate(), this.#
|
|
646
|
+
this.#r.invalidate(), this.#i.invalidate(), this.#v(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(X);
|
|
600
647
|
}
|
|
601
648
|
async load(e) {
|
|
602
|
-
let t = { flowId: e }, n = this.#l.value, r = n.loaded &&
|
|
603
|
-
|
|
649
|
+
let t = { flowId: e }, n = this.#l.value, r = n.loaded && Z(n.target, t), i = this.#r.begin();
|
|
650
|
+
Z(n.target, t) || (this.#i.invalidate(), this.#v(), this.#f = void 0), r ? this.#x({
|
|
604
651
|
loadFailed: !1,
|
|
605
652
|
loadingMore: !1,
|
|
606
653
|
loadMoreFailed: !1,
|
|
607
654
|
refreshing: !0
|
|
608
655
|
}) : (this.#c(void 0), this.#l.set({
|
|
609
|
-
...
|
|
656
|
+
...X,
|
|
610
657
|
loading: !0,
|
|
611
658
|
target: t
|
|
612
659
|
}));
|
|
613
660
|
try {
|
|
614
|
-
let e = r ? n.operation : await this.#
|
|
661
|
+
let e = r ? n.operation : await this.#g(t), [a, o, s] = await this.#h(t);
|
|
615
662
|
if (!i()) return;
|
|
616
|
-
if (this.#u.updateLive(a), this.#
|
|
663
|
+
if (this.#u.updateLive(a), this.#x({
|
|
617
664
|
bindings: s,
|
|
618
665
|
live: a,
|
|
619
666
|
loaded: !0,
|
|
@@ -628,33 +675,33 @@ var mt = class {
|
|
|
628
675
|
}
|
|
629
676
|
}), !r && e?.status == "pending") {
|
|
630
677
|
let n = this.#u.$.targetFlow.value;
|
|
631
|
-
this.#
|
|
678
|
+
this.#_(t, e, this.#i.begin(), n?.flowId == t.flowId ? n.name : t.flowId);
|
|
632
679
|
}
|
|
633
680
|
} catch (e) {
|
|
634
681
|
if (!i()) return;
|
|
635
|
-
this.#
|
|
682
|
+
this.#x({
|
|
636
683
|
loadFailed: !r,
|
|
637
684
|
loading: !1,
|
|
638
685
|
refreshing: !1
|
|
639
|
-
}), this.#c(
|
|
686
|
+
}), this.#c(E(e, this.#n.t));
|
|
640
687
|
}
|
|
641
688
|
}
|
|
642
689
|
async loadMore() {
|
|
643
690
|
let { loadingMore: e, nextCursor: t, target: n } = this.#l.value;
|
|
644
691
|
if (e || t == null || n == null) return;
|
|
645
692
|
let r = this.#r.capture();
|
|
646
|
-
this.#
|
|
693
|
+
this.#x({
|
|
647
694
|
loadMoreFailed: !1,
|
|
648
695
|
loadingMore: !0
|
|
649
696
|
});
|
|
650
697
|
try {
|
|
651
698
|
let e = await this.#e.listPublications(n.flowId, {
|
|
652
699
|
cursor: t,
|
|
653
|
-
limit:
|
|
700
|
+
limit: kt
|
|
654
701
|
});
|
|
655
702
|
if (!r()) return;
|
|
656
703
|
let i = new Set(this.#l.value.publications.map((e) => e.publicationId));
|
|
657
|
-
this.#
|
|
704
|
+
this.#x({
|
|
658
705
|
loadingMore: !1,
|
|
659
706
|
loadMoreFailed: !1,
|
|
660
707
|
nextCursor: e.nextCursor,
|
|
@@ -662,35 +709,39 @@ var mt = class {
|
|
|
662
709
|
});
|
|
663
710
|
} catch (e) {
|
|
664
711
|
if (!r()) return;
|
|
665
|
-
this.#
|
|
712
|
+
this.#x({
|
|
666
713
|
loadMoreFailed: !0,
|
|
667
714
|
loadingMore: !1
|
|
668
|
-
}), this.#c(
|
|
715
|
+
}), this.#c(E(e, this.#n.t));
|
|
669
716
|
}
|
|
670
717
|
}
|
|
671
718
|
async publish() {
|
|
672
|
-
let e = this.#u.$.
|
|
673
|
-
if (
|
|
674
|
-
let
|
|
675
|
-
|
|
676
|
-
|
|
719
|
+
let e = this.#u.$.flowId.value;
|
|
720
|
+
if (!await this.#u.saveModuleEditor() || e != this.#u.$.flowId.value) return !1;
|
|
721
|
+
let t = this.#u.$.targetFlow.value, n = this.#u.$.draft.value;
|
|
722
|
+
if (t == null || n == null || this.#l.value.changingTriggerId != null || this.#l.value.publishing || this.#l.value.rollingBackPublicationId != null) return !1;
|
|
723
|
+
let r = { flowId: t.flowId }, i = this.#u.$.live.value?.publication?.publicationId ?? null, a = JSON.stringify({
|
|
724
|
+
expectedLivePublicationId: i,
|
|
725
|
+
flowId: t.flowId,
|
|
677
726
|
kind: "publish",
|
|
678
|
-
revisionId:
|
|
679
|
-
}),
|
|
727
|
+
revisionId: n.revisionId
|
|
728
|
+
}), o = this.#f?.signature == a ? this.#f : {
|
|
680
729
|
key: this.#t(),
|
|
681
|
-
signature:
|
|
682
|
-
}
|
|
683
|
-
this.#
|
|
730
|
+
signature: a
|
|
731
|
+
};
|
|
732
|
+
this.#v();
|
|
733
|
+
let s = this.#i.begin();
|
|
734
|
+
this.#f = o, this.#c(void 0), this.#b(r, { publishing: !0 });
|
|
684
735
|
try {
|
|
685
|
-
let
|
|
686
|
-
return
|
|
687
|
-
operation:
|
|
688
|
-
publishing:
|
|
689
|
-
}), await this.#
|
|
736
|
+
let e = await this.#e.publishFlow(t.flowId, n.revisionId, i, { idempotencyKey: o.key });
|
|
737
|
+
return s() ? (this.#a.setItem(this.#y(r.flowId), e.operationId), this.#x({
|
|
738
|
+
operation: e,
|
|
739
|
+
publishing: e.status == "pending"
|
|
740
|
+
}), await this.#_(r, e, s, t.name)) : !1;
|
|
690
741
|
} catch (e) {
|
|
691
|
-
return
|
|
742
|
+
return s() ? (e instanceof L && e.code == "live.conflict" && await this.#m(r), this.#c(E(e, this.#n.t)), !1) : !1;
|
|
692
743
|
} finally {
|
|
693
|
-
|
|
744
|
+
s() && this.#x({ publishing: !1 });
|
|
694
745
|
}
|
|
695
746
|
}
|
|
696
747
|
async rollback(e) {
|
|
@@ -701,24 +752,26 @@ var mt = class {
|
|
|
701
752
|
flowId: r.flowId,
|
|
702
753
|
kind: "rollback",
|
|
703
754
|
targetPublicationId: e.publicationId
|
|
704
|
-
}), o = this.#
|
|
755
|
+
}), o = this.#f?.signature == a ? this.#f : {
|
|
705
756
|
key: this.#t(),
|
|
706
757
|
signature: a
|
|
707
|
-
}
|
|
708
|
-
this.#
|
|
758
|
+
};
|
|
759
|
+
this.#v();
|
|
760
|
+
let s = this.#i.begin();
|
|
761
|
+
this.#f = o, this.#c(void 0), this.#x({ rollingBackPublicationId: e.publicationId });
|
|
709
762
|
try {
|
|
710
|
-
return await this.#e.rollbackFlow(r.flowId, e.publicationId, i, { idempotencyKey: o.key }), !s() || (await this.#
|
|
763
|
+
return await this.#e.rollbackFlow(r.flowId, e.publicationId, i, { idempotencyKey: o.key }), !s() || (await this.#p(r), !s()) ? !1 : (this.#f = void 0, this.#c({
|
|
711
764
|
kind: "success",
|
|
712
765
|
message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
|
|
713
766
|
}), !0);
|
|
714
767
|
} catch (e) {
|
|
715
|
-
return s() ? (e instanceof
|
|
768
|
+
return s() ? (e instanceof L && e.code == "live.conflict" && await this.#m(r), this.#c(E(e, this.#n.t)), !1) : !1;
|
|
716
769
|
} finally {
|
|
717
|
-
s() && this.#
|
|
770
|
+
s() && this.#x({ rollingBackPublicationId: void 0 });
|
|
718
771
|
}
|
|
719
772
|
}
|
|
720
773
|
closeTrigger() {
|
|
721
|
-
this.#o.invalidate(), this.#s.invalidate(), this.#
|
|
774
|
+
this.#o.invalidate(), this.#s.invalidate(), this.#x({
|
|
722
775
|
activities: [],
|
|
723
776
|
activitiesLoadFailed: !1,
|
|
724
777
|
activitiesLoading: !1,
|
|
@@ -735,7 +788,7 @@ var mt = class {
|
|
|
735
788
|
let t = this.#l.value.target;
|
|
736
789
|
if (t == null) return;
|
|
737
790
|
let n = this.#o.begin();
|
|
738
|
-
this.#s.invalidate(), this.#
|
|
791
|
+
this.#s.invalidate(), this.#x({
|
|
739
792
|
activities: [],
|
|
740
793
|
activitiesLoadFailed: !1,
|
|
741
794
|
activitiesLoading: !0,
|
|
@@ -747,45 +800,45 @@ var mt = class {
|
|
|
747
800
|
testingTriggerId: void 0,
|
|
748
801
|
testResult: void 0
|
|
749
802
|
});
|
|
750
|
-
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit:
|
|
803
|
+
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: Ot })]);
|
|
751
804
|
if (n()) {
|
|
752
805
|
if (r.status == "rejected") {
|
|
753
|
-
this.#
|
|
806
|
+
this.#x({
|
|
754
807
|
activitiesLoading: !1,
|
|
755
808
|
detailLoading: !1
|
|
756
|
-
}), this.#c(
|
|
809
|
+
}), this.#c(E(r.reason, this.#n.t));
|
|
757
810
|
return;
|
|
758
811
|
}
|
|
759
|
-
this.#
|
|
812
|
+
this.#x({
|
|
760
813
|
detail: r.value,
|
|
761
814
|
detailLoading: !1
|
|
762
|
-
}), i.status == "fulfilled" ? this.#
|
|
815
|
+
}), i.status == "fulfilled" ? this.#x({
|
|
763
816
|
activities: i.value.activities,
|
|
764
817
|
activitiesLoadFailed: !1,
|
|
765
818
|
activitiesLoading: !1,
|
|
766
819
|
activitiesNextCursor: i.value.nextCursor
|
|
767
|
-
}) : (this.#
|
|
820
|
+
}) : (this.#x({
|
|
768
821
|
activitiesLoadFailed: !0,
|
|
769
822
|
activitiesLoading: !1
|
|
770
|
-
}), this.#c(
|
|
823
|
+
}), this.#c(E(i.reason, this.#n.t)));
|
|
771
824
|
}
|
|
772
825
|
}
|
|
773
826
|
async loadMoreTriggerActivities() {
|
|
774
827
|
let { activitiesLoadingMore: e, activitiesNextCursor: t, selectedTriggerId: n, target: r } = this.#l.value;
|
|
775
828
|
if (e || t == null || n == null || r == null) return;
|
|
776
829
|
let i = this.#o.capture();
|
|
777
|
-
this.#
|
|
830
|
+
this.#x({
|
|
778
831
|
activitiesLoadFailed: !1,
|
|
779
832
|
activitiesLoadingMore: !0
|
|
780
833
|
});
|
|
781
834
|
try {
|
|
782
835
|
let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
|
|
783
836
|
cursor: t,
|
|
784
|
-
limit:
|
|
837
|
+
limit: Ot
|
|
785
838
|
});
|
|
786
839
|
if (!i() || this.#l.value.selectedTriggerId != n) return;
|
|
787
840
|
let a = new Set(this.#l.value.activities.map((e) => e.activityId));
|
|
788
|
-
this.#
|
|
841
|
+
this.#x({
|
|
789
842
|
activities: [...this.#l.value.activities, ...e.activities.filter((e) => !a.has(e.activityId))],
|
|
790
843
|
activitiesLoadFailed: !1,
|
|
791
844
|
activitiesLoadingMore: !1,
|
|
@@ -793,329 +846,421 @@ var mt = class {
|
|
|
793
846
|
});
|
|
794
847
|
} catch (e) {
|
|
795
848
|
if (!i() || this.#l.value.selectedTriggerId != n) return;
|
|
796
|
-
this.#
|
|
849
|
+
this.#x({
|
|
797
850
|
activitiesLoadFailed: !0,
|
|
798
851
|
activitiesLoadingMore: !1
|
|
799
|
-
}), this.#c(
|
|
852
|
+
}), this.#c(E(e, this.#n.t));
|
|
800
853
|
}
|
|
801
854
|
}
|
|
802
855
|
async testTrigger() {
|
|
803
856
|
let { detail: e, selectedTriggerId: t, target: n, testingTriggerId: r } = this.#l.value;
|
|
804
857
|
if (e?.binding.kind != "poll" || e.binding.currentPublicationId == null || t == null || n == null || r != null) return !1;
|
|
805
858
|
let i = this.#s.begin();
|
|
806
|
-
this.#
|
|
859
|
+
this.#x({
|
|
807
860
|
testingTriggerId: t,
|
|
808
861
|
testResult: void 0
|
|
809
862
|
});
|
|
810
863
|
try {
|
|
811
864
|
let e = await this.#e.testFlowPollTrigger(n.flowId, t);
|
|
812
|
-
return !i() || this.#l.value.selectedTriggerId != t ? !1 : (this.#
|
|
865
|
+
return !i() || this.#l.value.selectedTriggerId != t ? !1 : (this.#x({ testResult: e }), !0);
|
|
813
866
|
} catch (e) {
|
|
814
|
-
return i() && this.#l.value.selectedTriggerId == t && this.#c(
|
|
867
|
+
return i() && this.#l.value.selectedTriggerId == t && this.#c(E(e, this.#n.t)), !1;
|
|
815
868
|
} finally {
|
|
816
|
-
i() && this.#l.value.selectedTriggerId == t && this.#
|
|
869
|
+
i() && this.#l.value.selectedTriggerId == t && this.#x({ testingTriggerId: void 0 });
|
|
817
870
|
}
|
|
818
871
|
}
|
|
819
872
|
async toggleTrigger(e) {
|
|
820
873
|
let t = this.#l.value.target;
|
|
821
874
|
if (t == null || this.#l.value.changingTriggerId != null || this.#l.value.publishing || this.#l.value.rollingBackPublicationId != null) return !1;
|
|
875
|
+
this.#v();
|
|
822
876
|
let n = this.#i.begin();
|
|
823
|
-
this.#
|
|
877
|
+
this.#x({ changingTriggerId: e.triggerNodeId });
|
|
824
878
|
try {
|
|
825
879
|
if (e.operatorState == "active" ? await this.#e.pauseFlowTrigger(t.flowId, e.triggerNodeId) : await this.#e.resumeFlowTrigger(t.flowId, e.triggerNodeId), !n()) return !1;
|
|
826
880
|
let r = await this.#e.listFlowTriggerBindings(t.flowId);
|
|
827
|
-
return n() ? (this.#
|
|
881
|
+
return n() ? (this.#x({ bindings: r }), this.#l.value.selectedTriggerId == e.triggerNodeId && this.openTrigger(e.triggerNodeId), this.#c({
|
|
828
882
|
kind: "success",
|
|
829
883
|
message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
|
|
830
884
|
}), !0) : !1;
|
|
831
885
|
} catch (e) {
|
|
832
|
-
return n() && this.#c(
|
|
886
|
+
return n() && this.#c(E(e, this.#n.t)), !1;
|
|
833
887
|
} finally {
|
|
834
|
-
n() && this.#
|
|
888
|
+
n() && this.#x({ changingTriggerId: void 0 });
|
|
835
889
|
}
|
|
836
890
|
}
|
|
837
|
-
async #
|
|
838
|
-
let
|
|
839
|
-
throw
|
|
891
|
+
async #p(e, t) {
|
|
892
|
+
let n = this.#r.begin(), [r, i, a] = await this.#h(e, t).catch((t) => {
|
|
893
|
+
throw n() && Z(this.#l.value.target, e) && this.#x({ refreshing: !1 }), t;
|
|
840
894
|
});
|
|
841
|
-
t() && this.#u.updateLive(
|
|
842
|
-
bindings:
|
|
843
|
-
live:
|
|
895
|
+
t?.throwIfAborted(), n() && this.#u.updateLive(r), n() && Z(this.#l.value.target, e) && this.#x({
|
|
896
|
+
bindings: a,
|
|
897
|
+
live: r,
|
|
844
898
|
loaded: !0,
|
|
845
899
|
loadFailed: !1,
|
|
846
900
|
loadingMore: !1,
|
|
847
|
-
nextCursor:
|
|
848
|
-
publications:
|
|
901
|
+
nextCursor: i.nextCursor,
|
|
902
|
+
publications: i.publications,
|
|
849
903
|
refreshing: !1,
|
|
850
|
-
total:
|
|
904
|
+
total: i.total
|
|
851
905
|
}), await this.#u.refreshFlows();
|
|
852
906
|
}
|
|
853
|
-
async #
|
|
907
|
+
async #m(e) {
|
|
854
908
|
try {
|
|
855
|
-
await this.#
|
|
909
|
+
await this.#p(e), this.#f = void 0;
|
|
856
910
|
} catch {
|
|
857
911
|
return;
|
|
858
912
|
}
|
|
859
913
|
}
|
|
860
|
-
async #
|
|
914
|
+
async #h(e, t) {
|
|
861
915
|
return await Promise.all([
|
|
862
|
-
this.#e.getLive(e.flowId),
|
|
916
|
+
this.#e.getLive(e.flowId, t),
|
|
863
917
|
this.#e.listPublications(e.flowId, {
|
|
864
918
|
includeTotal: !0,
|
|
865
|
-
limit:
|
|
866
|
-
}),
|
|
867
|
-
this.#e.listFlowTriggerBindings(e.flowId)
|
|
919
|
+
limit: kt
|
|
920
|
+
}, t),
|
|
921
|
+
this.#e.listFlowTriggerBindings(e.flowId, t)
|
|
868
922
|
]);
|
|
869
923
|
}
|
|
870
|
-
async #
|
|
871
|
-
let t = this.#a.getItem(this.#
|
|
924
|
+
async #g(e) {
|
|
925
|
+
let t = this.#a.getItem(this.#y(e.flowId));
|
|
872
926
|
if (t != null && t != "") try {
|
|
873
927
|
return await this.#e.getPublishOperation(e.flowId, t);
|
|
874
928
|
} catch (t) {
|
|
875
|
-
if (t instanceof
|
|
876
|
-
this.#a.setItem(this.#
|
|
929
|
+
if (t instanceof L && t.code == "publication.operation-not-found") {
|
|
930
|
+
this.#a.setItem(this.#y(e.flowId), "");
|
|
877
931
|
return;
|
|
878
932
|
}
|
|
879
933
|
throw t;
|
|
880
934
|
}
|
|
881
935
|
}
|
|
882
|
-
async #
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
936
|
+
async #_(e, t, n, r) {
|
|
937
|
+
this.#v();
|
|
938
|
+
let i = Y.runFork(Y.gen({ self: this }, function* () {
|
|
939
|
+
let i = t;
|
|
940
|
+
for (; i.status == "pending";) {
|
|
941
|
+
if (yield* Y.sleep(At), !n()) return !1;
|
|
942
|
+
let t = yield* Y.tryPromise({
|
|
943
|
+
try: (t) => this.#e.getPublishOperation(e.flowId, i.operationId, t),
|
|
944
|
+
catch: (e) => e
|
|
945
|
+
}).pipe(Y.match({
|
|
946
|
+
onFailure: (e) => ({ error: e }),
|
|
947
|
+
onSuccess: (e) => ({ value: e })
|
|
948
|
+
}));
|
|
889
949
|
if (!n()) return !1;
|
|
890
|
-
if (
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
950
|
+
if ("error" in t) {
|
|
951
|
+
let n = t.error;
|
|
952
|
+
if (n instanceof L && n.code == "publication.operation-not-found") return this.#a.setItem(this.#y(e.flowId), ""), this.#b(e, {
|
|
953
|
+
operation: void 0,
|
|
954
|
+
publishing: !1
|
|
955
|
+
}), this.#c(E(n, this.#n.t)), !1;
|
|
956
|
+
this.#c(E(n, this.#n.t));
|
|
957
|
+
continue;
|
|
958
|
+
}
|
|
959
|
+
i = t.value, this.#b(e, { operation: i });
|
|
896
960
|
}
|
|
897
961
|
if (!n()) return !1;
|
|
898
|
-
this.#
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
962
|
+
if (this.#f = void 0, this.#b(e, {
|
|
963
|
+
operation: i,
|
|
964
|
+
publishing: !1
|
|
965
|
+
}), i.status == "failed") return this.#c({
|
|
966
|
+
kind: "error",
|
|
967
|
+
message: i.issue.message
|
|
968
|
+
}), !1;
|
|
969
|
+
let a = yield* Y.tryPromise({
|
|
970
|
+
try: (t) => this.#p(e, t),
|
|
971
|
+
catch: (e) => e
|
|
972
|
+
}).pipe(Y.match({
|
|
973
|
+
onFailure: (e) => (n() && this.#c(E(e, this.#n.t)), !1),
|
|
974
|
+
onSuccess: () => !0
|
|
975
|
+
}));
|
|
976
|
+
return n() ? (a && this.#c({
|
|
977
|
+
kind: "success",
|
|
978
|
+
message: this.#n.t("notice.published", { name: r })
|
|
979
|
+
}), !0) : !1;
|
|
980
|
+
}));
|
|
981
|
+
this.#d = i;
|
|
982
|
+
let a = await Y.runPromiseExit(ut.join(i));
|
|
983
|
+
if (lt.isSuccess(a)) return a.value;
|
|
984
|
+
if (ct.hasInterruptsOnly(a.cause)) return !1;
|
|
985
|
+
throw ct.squash(a.cause);
|
|
916
986
|
}
|
|
917
|
-
#
|
|
987
|
+
#v() {
|
|
988
|
+
this.#d?.interruptUnsafe(), this.#d = void 0;
|
|
989
|
+
}
|
|
990
|
+
#y(e) {
|
|
918
991
|
return `publish-operation:${e}`;
|
|
919
992
|
}
|
|
920
|
-
#
|
|
921
|
-
|
|
922
|
-
...
|
|
993
|
+
#b(e, t) {
|
|
994
|
+
Z(this.#l.value.target, e) ? this.#x(t) : this.#l.set({
|
|
995
|
+
...X,
|
|
923
996
|
...t,
|
|
924
997
|
target: e
|
|
925
998
|
});
|
|
926
999
|
}
|
|
927
|
-
#
|
|
1000
|
+
#x(e) {
|
|
928
1001
|
this.#l.set({
|
|
929
1002
|
...this.#l.value,
|
|
930
1003
|
...e
|
|
931
1004
|
});
|
|
932
1005
|
}
|
|
933
|
-
},
|
|
934
|
-
function
|
|
1006
|
+
}, Mt = { starting: !1 };
|
|
1007
|
+
function Nt(e) {
|
|
935
1008
|
switch (e.kind) {
|
|
936
1009
|
case "condition": return { [e.node.input.handle]: e.node.input };
|
|
937
|
-
case "subflow": return
|
|
938
|
-
case "task": return
|
|
1010
|
+
case "subflow": return Re(e.definition?.inputs ?? []);
|
|
1011
|
+
case "task": return Re(e.definition?.inputs ?? []);
|
|
939
1012
|
case "value": return {};
|
|
940
1013
|
case "wait": return { [e.node.input.handle]: e.node.input };
|
|
941
1014
|
}
|
|
942
1015
|
}
|
|
943
|
-
function
|
|
1016
|
+
function Pt(e) {
|
|
944
1017
|
return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
|
|
945
1018
|
}
|
|
946
|
-
async function
|
|
947
|
-
let { FlowRunInputEditorStore:
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
let
|
|
1019
|
+
async function Ft(e, t, n) {
|
|
1020
|
+
let { FlowRunInputEditorStore: r } = await import("./flowRunInputEditorStore-NPGePkvP.js").then((e) => e.r), i = C(e), a = i.graph({ kind: "flow" });
|
|
1021
|
+
if (a == null) return [];
|
|
1022
|
+
let o = /* @__PURE__ */ new Set([n]), s = [n];
|
|
1023
|
+
for (; s.length > 0;) {
|
|
1024
|
+
let e = s.pop();
|
|
1025
|
+
for (let t of a.edges) t.source != e || o.has(t.target) || (o.add(t.target), s.push(t.target));
|
|
1026
|
+
}
|
|
1027
|
+
return Object.entries(a.nodes).filter(([e]) => o.has(e)).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, n]) => {
|
|
1028
|
+
let a = i.resolveNode(e, n);
|
|
1029
|
+
if (a.kind == "trigger") {
|
|
1030
|
+
if (a.trigger.kind == "manual" || a.trigger.kind == "cron") return [];
|
|
1031
|
+
let n = new r([{
|
|
1032
|
+
handle: "payload",
|
|
1033
|
+
jsonSchema: l(a.trigger),
|
|
1034
|
+
nullable: !1
|
|
1035
|
+
}], t);
|
|
1036
|
+
return n.replaceValues({ payload: {} }), [{
|
|
1037
|
+
editor: n,
|
|
1038
|
+
nodeId: e,
|
|
1039
|
+
title: a.trigger.name
|
|
1040
|
+
}];
|
|
1041
|
+
}
|
|
1042
|
+
let o = Object.entries(Nt(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
|
|
952
1043
|
handle: e,
|
|
953
1044
|
jsonSchema: t.jsonSchema,
|
|
954
1045
|
nullable: t.nullable
|
|
955
1046
|
}, t.description == null ? {} : { description: t.description }));
|
|
956
1047
|
return o.length == 0 ? [] : [{
|
|
957
|
-
editor: new
|
|
1048
|
+
editor: new r(o, t),
|
|
958
1049
|
nodeId: e,
|
|
959
|
-
title:
|
|
1050
|
+
title: Pt(a)
|
|
960
1051
|
}];
|
|
961
1052
|
});
|
|
962
1053
|
}
|
|
963
|
-
var
|
|
1054
|
+
var It = class {
|
|
964
1055
|
#e;
|
|
965
1056
|
#t;
|
|
966
1057
|
#n;
|
|
967
|
-
#r
|
|
968
|
-
#i = new
|
|
969
|
-
#a;
|
|
1058
|
+
#r;
|
|
1059
|
+
#i = new m();
|
|
1060
|
+
#a = new m();
|
|
970
1061
|
#o;
|
|
971
|
-
#s
|
|
972
|
-
#c;
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1062
|
+
#s;
|
|
1063
|
+
#c = t(Mt);
|
|
1064
|
+
#l;
|
|
1065
|
+
constructor(t, n, r, i, a = P(), o = F) {
|
|
1066
|
+
this.#e = i, this.#t = t, this.#o = n, this.#s = r, this.#r = a, this.#n = o, this.$ = {
|
|
1067
|
+
inputRequest: e(this.#c, (e) => e.inputRequest),
|
|
1068
|
+
starting: e(this.#c, (e) => e.starting),
|
|
1069
|
+
submitting: e(this.#c, (e) => e.submitting)
|
|
978
1070
|
};
|
|
979
1071
|
}
|
|
980
1072
|
dispose() {
|
|
981
|
-
this.#
|
|
1073
|
+
this.#i.invalidate(), this.#a.invalidate(), this.#f();
|
|
982
1074
|
for (let e of Object.values(this.$)) e.dispose();
|
|
983
|
-
this.#
|
|
1075
|
+
this.#c.dispose();
|
|
984
1076
|
}
|
|
985
1077
|
reset() {
|
|
986
|
-
this.#
|
|
987
|
-
let e = this.#
|
|
988
|
-
this.#
|
|
1078
|
+
this.#i.invalidate(), this.#a.invalidate(), this.#l = void 0;
|
|
1079
|
+
let e = this.#c.value.inputRequest;
|
|
1080
|
+
this.#c.set(Mt), this.#f(e);
|
|
989
1081
|
}
|
|
990
|
-
async requestDraft(e, t) {
|
|
991
|
-
let
|
|
992
|
-
|
|
1082
|
+
async requestDraft(e, t, n) {
|
|
1083
|
+
let r = this.#a.begin();
|
|
1084
|
+
try {
|
|
1085
|
+
return await this.#u("draft", e, t, t.revisionId, r, void 0, n);
|
|
1086
|
+
} catch (e) {
|
|
1087
|
+
return r() && this.#s(E(e, this.#r.t)), "unavailable";
|
|
1088
|
+
} finally {
|
|
1089
|
+
r() && this.#p({ starting: !1 });
|
|
1090
|
+
}
|
|
993
1091
|
}
|
|
994
1092
|
async requestLive(e) {
|
|
995
|
-
let t = this.#
|
|
996
|
-
this.#
|
|
1093
|
+
let t = this.#a.begin();
|
|
1094
|
+
this.#s(void 0), this.#p({ starting: !0 });
|
|
997
1095
|
try {
|
|
998
|
-
let n = (await this.#
|
|
1096
|
+
let n = (await this.#t.getLive(e.flowId)).publication;
|
|
999
1097
|
if (n == null) return "unavailable";
|
|
1000
|
-
let r = await this.#
|
|
1001
|
-
return t() ? await this.#
|
|
1098
|
+
let r = await this.#t.getRevision(e.flowId, n.revisionId);
|
|
1099
|
+
return t() ? await this.#u("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
|
|
1002
1100
|
} catch (e) {
|
|
1003
|
-
return t() && this.#
|
|
1101
|
+
return t() && this.#s(E(e, this.#r.t)), "unavailable";
|
|
1004
1102
|
} finally {
|
|
1005
|
-
t() && this.#
|
|
1103
|
+
t() && this.#p({ starting: !1 });
|
|
1006
1104
|
}
|
|
1007
1105
|
}
|
|
1008
1106
|
dismissInputs() {
|
|
1009
|
-
let e = this.#
|
|
1010
|
-
this.#
|
|
1107
|
+
let e = this.#c.value.inputRequest;
|
|
1108
|
+
this.#p({ inputRequest: void 0 }), this.#f(e);
|
|
1011
1109
|
}
|
|
1012
1110
|
async confirmInputs() {
|
|
1013
|
-
let e = this.#
|
|
1014
|
-
if (e == null) return !1;
|
|
1015
|
-
if (!e.valid.value) return this.#
|
|
1111
|
+
let e = this.#c.value.inputRequest;
|
|
1112
|
+
if (e == null || e.triggerId == null) return !1;
|
|
1113
|
+
if (!e.valid.value) return this.#p({ inputRequest: {
|
|
1016
1114
|
...e,
|
|
1017
1115
|
attempted: !0
|
|
1018
1116
|
} }), !1;
|
|
1019
|
-
let t = Object.fromEntries(e.groups.map((e) => [e.nodeId, e.editor.values()])), n = await this.#
|
|
1020
|
-
|
|
1117
|
+
let t = Object.fromEntries(e.groups.filter((t) => t.nodeId != e.triggerId).map((e) => [e.nodeId, e.editor.values()])), n = e.groups.find((t) => t.nodeId == e.triggerId)?.editor.values().payload ?? {}, r = await this.#d(e.source, e.flow, e.revisionId, {
|
|
1118
|
+
nodeId: e.triggerId,
|
|
1119
|
+
payload: n
|
|
1120
|
+
}, t, e.publicationId);
|
|
1121
|
+
return r && this.#c.value.inputRequest === e && this.dismissInputs(), r;
|
|
1122
|
+
}
|
|
1123
|
+
async selectTrigger(e) {
|
|
1124
|
+
let t = this.#c.value.inputRequest;
|
|
1125
|
+
if (t == null || !t.triggers.some((t) => t.nodeId == e)) return;
|
|
1126
|
+
let r = this.#a.begin();
|
|
1127
|
+
this.#p({ starting: !0 });
|
|
1128
|
+
try {
|
|
1129
|
+
let i = await Ft(t.revision, this.#r.lang$, e);
|
|
1130
|
+
if (!r() || this.#c.value.inputRequest !== t) {
|
|
1131
|
+
for (let e of i) e.editor.dispose();
|
|
1132
|
+
return;
|
|
1133
|
+
}
|
|
1134
|
+
let a = n((e) => i.every((t) => e(t.editor.valid$)));
|
|
1135
|
+
this.#p({ inputRequest: {
|
|
1136
|
+
...t,
|
|
1137
|
+
attempted: !1,
|
|
1138
|
+
groups: i,
|
|
1139
|
+
triggerId: e,
|
|
1140
|
+
valid: a
|
|
1141
|
+
} }), this.#f(t);
|
|
1142
|
+
} catch (e) {
|
|
1143
|
+
r() && this.#s(E(e, this.#r.t));
|
|
1144
|
+
} finally {
|
|
1145
|
+
r() && this.#p({ starting: !1 });
|
|
1146
|
+
}
|
|
1021
1147
|
}
|
|
1022
|
-
async #
|
|
1023
|
-
let
|
|
1024
|
-
this.#
|
|
1148
|
+
async #u(e, t, r, i, a, o, s) {
|
|
1149
|
+
let c = this.#c.value.inputRequest;
|
|
1150
|
+
this.#p({
|
|
1025
1151
|
inputRequest: void 0,
|
|
1026
1152
|
starting: !0,
|
|
1027
1153
|
submitting: void 0
|
|
1028
|
-
}), this.#
|
|
1029
|
-
let
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1154
|
+
}), this.#f(c);
|
|
1155
|
+
let l = C(r).graph({ kind: "flow" }), u = Object.entries(l?.nodes ?? {}).flatMap(([e, t]) => "inputs" in t ? [] : [{
|
|
1156
|
+
nodeId: e,
|
|
1157
|
+
title: t.name
|
|
1158
|
+
}]);
|
|
1159
|
+
if (u.length == 0) return this.#p({ starting: !1 }), this.#s({
|
|
1160
|
+
kind: "error",
|
|
1161
|
+
message: this.#r.t("runInput.noTrigger")
|
|
1162
|
+
}), "unavailable";
|
|
1163
|
+
let d = s == null ? u.length == 1 ? u[0] : void 0 : u.find((e) => e.nodeId == s);
|
|
1164
|
+
if (s != null && d == null) return this.#p({ starting: !1 }), this.#s({
|
|
1165
|
+
kind: "error",
|
|
1166
|
+
message: this.#r.t("runInput.selectTrigger")
|
|
1167
|
+
}), "unavailable";
|
|
1168
|
+
let f = d == null ? [] : await Ft(r, this.#r.lang$, d.nodeId);
|
|
1038
1169
|
if (!a()) {
|
|
1039
|
-
for (let e of
|
|
1170
|
+
for (let e of f) e.editor.dispose();
|
|
1040
1171
|
return "unavailable";
|
|
1041
1172
|
}
|
|
1042
|
-
if (
|
|
1043
|
-
|
|
1044
|
-
|
|
1173
|
+
if (d != null && f.length == 0) return await this.#d(e, t, i, {
|
|
1174
|
+
nodeId: d.nodeId,
|
|
1175
|
+
payload: {}
|
|
1176
|
+
}, {}, o) ? "started" : "unavailable";
|
|
1177
|
+
let p = n((e) => d != null && f.every((t) => e(t.editor.valid$)));
|
|
1178
|
+
return this.#p({
|
|
1045
1179
|
inputRequest: {
|
|
1046
1180
|
attempted: !1,
|
|
1047
1181
|
flow: t,
|
|
1048
|
-
groups:
|
|
1182
|
+
groups: f,
|
|
1183
|
+
revision: r,
|
|
1184
|
+
triggers: u,
|
|
1185
|
+
triggerId: d?.nodeId,
|
|
1049
1186
|
...o == null ? {} : { publicationId: o },
|
|
1050
1187
|
revisionId: i,
|
|
1051
1188
|
source: e,
|
|
1052
|
-
valid:
|
|
1189
|
+
valid: p
|
|
1053
1190
|
},
|
|
1054
1191
|
starting: !1,
|
|
1055
1192
|
submitting: void 0
|
|
1056
1193
|
}), "input";
|
|
1057
1194
|
}
|
|
1058
|
-
async #
|
|
1059
|
-
if (e == "live" &&
|
|
1060
|
-
let
|
|
1061
|
-
this.#
|
|
1195
|
+
async #d(e, t, n, r, i = {}, a) {
|
|
1196
|
+
if (e == "live" && a == null) return !1;
|
|
1197
|
+
let o = this.#i.capture(), s = this.#o.prepareStart();
|
|
1198
|
+
this.#s(void 0), this.#p({
|
|
1062
1199
|
starting: !0,
|
|
1063
1200
|
submitting: e
|
|
1064
1201
|
});
|
|
1065
|
-
let s = e == "draft" ? {
|
|
1066
|
-
flowId: t.flowId,
|
|
1067
|
-
revisionId: n
|
|
1068
|
-
} : { publicationId: i }, c = JSON.stringify({
|
|
1069
|
-
inputs: r,
|
|
1070
|
-
source: e,
|
|
1071
|
-
...s
|
|
1072
|
-
}), l = this.#c?.signature == c ? this.#c : {
|
|
1073
|
-
key: this.#t(),
|
|
1074
|
-
signature: c
|
|
1075
|
-
};
|
|
1076
|
-
this.#c = l;
|
|
1077
1202
|
try {
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1203
|
+
if (e == "draft") {
|
|
1204
|
+
let e = await this.#e(t.flowId);
|
|
1205
|
+
if (e == null || !o() || !s()) return !1;
|
|
1206
|
+
n = e;
|
|
1207
|
+
}
|
|
1208
|
+
let c = e == "draft" ? {
|
|
1209
|
+
flowId: t.flowId,
|
|
1210
|
+
revisionId: n
|
|
1211
|
+
} : { publicationId: a }, l = JSON.stringify({
|
|
1212
|
+
inputs: i,
|
|
1213
|
+
trigger: r,
|
|
1214
|
+
source: e,
|
|
1215
|
+
...c
|
|
1216
|
+
}), u = this.#l?.signature == l ? this.#l : {
|
|
1217
|
+
key: this.#n(),
|
|
1218
|
+
signature: l
|
|
1219
|
+
};
|
|
1220
|
+
this.#l = u;
|
|
1221
|
+
let d = e == "draft" ? await this.#t.createDraftRun(t.flowId, n, {
|
|
1222
|
+
idempotencyKey: u.key,
|
|
1223
|
+
inputs: i,
|
|
1224
|
+
trigger: r
|
|
1225
|
+
}) : await this.#t.createLiveRun(a, {
|
|
1226
|
+
idempotencyKey: u.key,
|
|
1227
|
+
inputs: i,
|
|
1228
|
+
trigger: r
|
|
1084
1229
|
});
|
|
1085
|
-
return !
|
|
1230
|
+
return !o() || !s() ? !1 : (this.#l = void 0, this.#o.follow(d, s));
|
|
1086
1231
|
} catch (e) {
|
|
1087
|
-
return
|
|
1232
|
+
return o() && s() && this.#s(E(e, this.#r.t)), !1;
|
|
1088
1233
|
} finally {
|
|
1089
|
-
|
|
1234
|
+
o() && this.#p({
|
|
1090
1235
|
starting: !1,
|
|
1091
1236
|
submitting: void 0
|
|
1092
1237
|
});
|
|
1093
1238
|
}
|
|
1094
1239
|
}
|
|
1095
|
-
#
|
|
1240
|
+
#f(e = this.#c.value.inputRequest) {
|
|
1096
1241
|
if (e != null) {
|
|
1097
1242
|
e.valid.dispose();
|
|
1098
1243
|
for (let t of e.groups) t.editor.dispose();
|
|
1099
1244
|
}
|
|
1100
1245
|
}
|
|
1101
|
-
#
|
|
1102
|
-
this.#
|
|
1103
|
-
...this.#
|
|
1246
|
+
#p(e) {
|
|
1247
|
+
this.#c.set({
|
|
1248
|
+
...this.#c.value,
|
|
1104
1249
|
...e
|
|
1105
1250
|
});
|
|
1106
1251
|
}
|
|
1107
|
-
},
|
|
1252
|
+
}, Lt = {
|
|
1108
1253
|
actions: {},
|
|
1109
1254
|
catalogs: {}
|
|
1110
1255
|
};
|
|
1111
|
-
function
|
|
1256
|
+
function Rt(e) {
|
|
1112
1257
|
return Object.entries(e).map(([e, t]) => ({
|
|
1113
1258
|
description: t.description,
|
|
1114
1259
|
handle: e,
|
|
1115
1260
|
jsonSchema: t.jsonSchema
|
|
1116
1261
|
}));
|
|
1117
1262
|
}
|
|
1118
|
-
function
|
|
1263
|
+
function Q(e, t) {
|
|
1119
1264
|
return {
|
|
1120
1265
|
connector: e,
|
|
1121
1266
|
description: e.authenticated && e.defaultConnection == null ? t("addNode.connectorNeedsConnection", {
|
|
@@ -1123,15 +1268,15 @@ function Y(e, t) {
|
|
|
1123
1268
|
service: e.serviceName
|
|
1124
1269
|
}) : e.description,
|
|
1125
1270
|
group: t("addNode.connectorActions"),
|
|
1126
|
-
icon:
|
|
1271
|
+
icon: p(e),
|
|
1127
1272
|
id: `connector:${e.actionId}`,
|
|
1128
|
-
inputs:
|
|
1273
|
+
inputs: Rt(e.inputs),
|
|
1129
1274
|
kind: "connector",
|
|
1130
1275
|
label: e.name,
|
|
1131
|
-
outputs:
|
|
1276
|
+
outputs: Rt(e.outputs)
|
|
1132
1277
|
};
|
|
1133
1278
|
}
|
|
1134
|
-
function
|
|
1279
|
+
function zt(e, t) {
|
|
1135
1280
|
let n = /* @__PURE__ */ new Map();
|
|
1136
1281
|
for (let t of e) {
|
|
1137
1282
|
let e = n.get(t.serviceId) ?? [];
|
|
@@ -1139,7 +1284,7 @@ function St(e, t) {
|
|
|
1139
1284
|
}
|
|
1140
1285
|
return [...n.values()].toSorted((e, t) => e[0].serviceName.localeCompare(t[0].serviceName)).map((e) => {
|
|
1141
1286
|
let n = e[0], r = e.map((e) => {
|
|
1142
|
-
let n =
|
|
1287
|
+
let n = Q(e, t);
|
|
1143
1288
|
return {
|
|
1144
1289
|
description: n.description,
|
|
1145
1290
|
label: n.label,
|
|
@@ -1150,7 +1295,7 @@ function St(e, t) {
|
|
|
1150
1295
|
choices: r,
|
|
1151
1296
|
description: t(r.length == 1 ? "addNode.connectorActionCountOne" : "addNode.connectorActionCount", { count: r.length }),
|
|
1152
1297
|
group: t("addNode.connectorActions"),
|
|
1153
|
-
icon:
|
|
1298
|
+
icon: p(n),
|
|
1154
1299
|
id: `connector-provider:${n.serviceId}`,
|
|
1155
1300
|
inputs: [],
|
|
1156
1301
|
kind: "connector-group",
|
|
@@ -1160,12 +1305,12 @@ function St(e, t) {
|
|
|
1160
1305
|
};
|
|
1161
1306
|
});
|
|
1162
1307
|
}
|
|
1163
|
-
function
|
|
1308
|
+
function Bt(e, t) {
|
|
1164
1309
|
return {
|
|
1165
1310
|
choices: [],
|
|
1166
1311
|
description: t("addNode.connectorBrowseActions"),
|
|
1167
1312
|
group: t("addNode.connectorActions"),
|
|
1168
|
-
icon:
|
|
1313
|
+
icon: p(e),
|
|
1169
1314
|
id: `connector-provider:${e.serviceId}`,
|
|
1170
1315
|
inputs: [],
|
|
1171
1316
|
kind: "connector-group",
|
|
@@ -1174,7 +1319,7 @@ function Ct(e, t) {
|
|
|
1174
1319
|
serviceId: e.serviceId
|
|
1175
1320
|
};
|
|
1176
1321
|
}
|
|
1177
|
-
function
|
|
1322
|
+
function Vt(e, t) {
|
|
1178
1323
|
if (e == null) return;
|
|
1179
1324
|
let n = e.kind == "wait" ? e.node.notification?.taskId : e.kind == "task" && e.node.task == null ? e.node.taskId : void 0;
|
|
1180
1325
|
if (n == null) return;
|
|
@@ -1186,10 +1331,10 @@ function wt(e, t) {
|
|
|
1186
1331
|
taskId: n
|
|
1187
1332
|
};
|
|
1188
1333
|
}
|
|
1189
|
-
function
|
|
1334
|
+
function Ht(e, t, n) {
|
|
1190
1335
|
if (e == null) return [];
|
|
1191
1336
|
let r = [];
|
|
1192
|
-
for (let i of [...
|
|
1337
|
+
for (let i of [...je(e.revision.content).tasks].toSorted()) {
|
|
1193
1338
|
let a = e.task(i);
|
|
1194
1339
|
if (a?.executor.kind != "connector") continue;
|
|
1195
1340
|
let o = t[a.executor.action];
|
|
@@ -1206,7 +1351,7 @@ function Tt(e, t, n) {
|
|
|
1206
1351
|
}
|
|
1207
1352
|
return r;
|
|
1208
1353
|
}
|
|
1209
|
-
var
|
|
1354
|
+
var Ut = class {
|
|
1210
1355
|
#e;
|
|
1211
1356
|
#t;
|
|
1212
1357
|
#n;
|
|
@@ -1223,13 +1368,13 @@ var Et = class {
|
|
|
1223
1368
|
#p;
|
|
1224
1369
|
#m;
|
|
1225
1370
|
#h;
|
|
1226
|
-
constructor(r, i, a, o, s =
|
|
1227
|
-
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new
|
|
1371
|
+
constructor(r, i, a, o, s = P()) {
|
|
1372
|
+
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new m(), this.#o = new m(), this.#d = t(Lt), this.#h = !1, this.browseAddNodeOptions = async (e) => {
|
|
1228
1373
|
if (this.#h) return;
|
|
1229
1374
|
let t = this.#f.$.flowId.value;
|
|
1230
1375
|
if (t == null) return;
|
|
1231
1376
|
let n = this.#m ?? await this.#e.listConnectorProviders(e, t);
|
|
1232
|
-
if (!(e.aborted || this.#h || t != this.#f.$.flowId.value)) return this.#m = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) =>
|
|
1377
|
+
if (!(e.aborted || this.#h || t != this.#f.$.flowId.value)) return this.#m = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => Bt(e, this.#t.t));
|
|
1233
1378
|
}, this.provideAddNodeOptionChoices = async (e, t) => {
|
|
1234
1379
|
if (this.#h) return;
|
|
1235
1380
|
let n = this.#f.$.flowId.value, r = this.#m?.find((t) => `connector-provider:${t.serviceId}` == e);
|
|
@@ -1240,7 +1385,7 @@ var Et = class {
|
|
|
1240
1385
|
return this.#r.set(r.serviceId, a), this.#b({ actions: {
|
|
1241
1386
|
...this.#d.value.actions,
|
|
1242
1387
|
...Object.fromEntries(a.map((e) => [e.actionId, e]))
|
|
1243
|
-
} }), a.map((e) =>
|
|
1388
|
+
} }), a.map((e) => Q(e, this.#t.t));
|
|
1244
1389
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
1245
1390
|
if (this.#h) return;
|
|
1246
1391
|
let n = this.#f.$.flowId.value;
|
|
@@ -1249,17 +1394,17 @@ var Et = class {
|
|
|
1249
1394
|
if (t.aborted || this.#h || n != this.#f.$.flowId.value) return;
|
|
1250
1395
|
let a = { ...this.#d.value.actions };
|
|
1251
1396
|
for (let e of i) a[e.actionId] = e;
|
|
1252
|
-
if (this.#b({ actions: a }), r.length != 0) return i.map((e) =>
|
|
1397
|
+
if (this.#b({ actions: a }), r.length != 0) return i.map((e) => Q(e, this.#t.t));
|
|
1253
1398
|
let o = new Map(i.map((e) => [e.actionId, e]));
|
|
1254
1399
|
for (let e of this.#f.$.revision.value?.connectorActionIds ?? []) {
|
|
1255
1400
|
let t = a[e];
|
|
1256
1401
|
t != null && o.set(e, t);
|
|
1257
1402
|
}
|
|
1258
|
-
return
|
|
1403
|
+
return zt([...o.values()], this.#t.t);
|
|
1259
1404
|
}, this.#e = r, this.#n = o, this.#f = i, this.#u = a, this.#t = s;
|
|
1260
1405
|
let c = e(this.#d, (e) => e.actions), l = e(this.#d, (e) => e.catalogs);
|
|
1261
1406
|
this.#l = n((e) => {
|
|
1262
|
-
let t =
|
|
1407
|
+
let t = Vt(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
|
|
1263
1408
|
if (t == null) return { authorizationPending: !1 };
|
|
1264
1409
|
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);
|
|
1265
1410
|
return o == null && r?.defaultConnection?.connectionId == t.connectionId && (o = r.defaultConnection), {
|
|
@@ -1275,7 +1420,7 @@ var Et = class {
|
|
|
1275
1420
|
actions: c,
|
|
1276
1421
|
catalogs: l,
|
|
1277
1422
|
connectionLoading: e(this.#d, (e) => e.connectionLoading),
|
|
1278
|
-
diagnostics: n((e) =>
|
|
1423
|
+
diagnostics: n((e) => Ht(e(i.$.revision), e(c), e(l))),
|
|
1279
1424
|
selectedAction: e(this.#l, (e) => e.action),
|
|
1280
1425
|
selectedActionError: e(this.#l, (e) => e.actionError),
|
|
1281
1426
|
selectedActiveConnections: e(this.#l, (e) => e.activeConnections),
|
|
@@ -1290,11 +1435,11 @@ var Et = class {
|
|
|
1290
1435
|
this.#l.dispose(), this.#d.dispose();
|
|
1291
1436
|
}
|
|
1292
1437
|
reset() {
|
|
1293
|
-
this.#h || (this.#a.invalidate(), this.#o.invalidate(), this.#p = void 0, this.#r.clear(), this.#m = void 0, this.#i.clear(), this.#d.set(
|
|
1438
|
+
this.#h || (this.#a.invalidate(), this.#o.invalidate(), this.#p = void 0, this.#r.clear(), this.#m = void 0, this.#i.clear(), this.#d.set(Lt));
|
|
1294
1439
|
}
|
|
1295
1440
|
async refresh(e = !1) {
|
|
1296
1441
|
if (this.#h) return;
|
|
1297
|
-
let t = this.#o.begin(), n = this.#f.$.flowId.value, r =
|
|
1442
|
+
let t = this.#o.begin(), n = this.#f.$.flowId.value, r = Vt(this.#f.$.selection.value, this.#f.$.revision.value);
|
|
1298
1443
|
if (n == null || r == null) {
|
|
1299
1444
|
(this.#d.value.actionLoading != null || this.#d.value.connectionLoading != null) && this.#b({
|
|
1300
1445
|
actionLoading: void 0,
|
|
@@ -1318,12 +1463,30 @@ var Et = class {
|
|
|
1318
1463
|
} catch (e) {
|
|
1319
1464
|
this.#x(t, n) && this.#b({ actionError: {
|
|
1320
1465
|
actionId: r.actionId,
|
|
1321
|
-
message:
|
|
1466
|
+
message: E(e, this.#t.t).message
|
|
1322
1467
|
} });
|
|
1323
1468
|
} finally {
|
|
1324
1469
|
this.#x(t, n) && this.#d.value.actionLoading == r.actionId && this.#b({ actionLoading: void 0 });
|
|
1325
1470
|
}
|
|
1326
1471
|
}
|
|
1472
|
+
async loadCodeConnections(e, t) {
|
|
1473
|
+
let n = this.#f.$.flowId.value;
|
|
1474
|
+
if (n == null || this.#h) return;
|
|
1475
|
+
let r = await this.#e.listConnectorConnections(e, t, n);
|
|
1476
|
+
t.aborted || this.#h || n != this.#f.$.flowId.value || this.#b({ catalogs: {
|
|
1477
|
+
...this.#d.value.catalogs,
|
|
1478
|
+
[e]: d(r)
|
|
1479
|
+
} });
|
|
1480
|
+
}
|
|
1481
|
+
async loadCodeAction(e, t) {
|
|
1482
|
+
let n = this.#f.$.flowId.value;
|
|
1483
|
+
if (n == null || this.#h) return;
|
|
1484
|
+
let r = await this.#e.getConnectorAction(e, t, n);
|
|
1485
|
+
t.aborted || this.#h || n != this.#f.$.flowId.value || this.#b({ actions: {
|
|
1486
|
+
...this.#d.value.actions,
|
|
1487
|
+
[e]: r
|
|
1488
|
+
} });
|
|
1489
|
+
}
|
|
1327
1490
|
async connect(e) {
|
|
1328
1491
|
if (this.#h) return;
|
|
1329
1492
|
let t = this.#f.$.flowId.value;
|
|
@@ -1343,7 +1506,7 @@ var Et = class {
|
|
|
1343
1506
|
serviceId: e
|
|
1344
1507
|
}, this.#b({ authorizationServiceId: e });
|
|
1345
1508
|
} catch (e) {
|
|
1346
|
-
this.#h || this.#u(
|
|
1509
|
+
this.#h || this.#u(E(e, this.#t.t));
|
|
1347
1510
|
}
|
|
1348
1511
|
}
|
|
1349
1512
|
async setConnection(e, t) {
|
|
@@ -1376,13 +1539,13 @@ var Et = class {
|
|
|
1376
1539
|
a = await this.#e.listConnectorConnections(t, void 0, e);
|
|
1377
1540
|
} catch (n) {
|
|
1378
1541
|
this.#x(r, e) && this.#b({ connectionError: {
|
|
1379
|
-
message:
|
|
1542
|
+
message: E(n, this.#t.t).message,
|
|
1380
1543
|
serviceId: t
|
|
1381
1544
|
} });
|
|
1382
1545
|
return;
|
|
1383
1546
|
}
|
|
1384
1547
|
if (!this.#x(r, e)) return;
|
|
1385
|
-
let o =
|
|
1548
|
+
let o = d(a);
|
|
1386
1549
|
return this.#b({ catalogs: {
|
|
1387
1550
|
...this.#d.value.catalogs,
|
|
1388
1551
|
[t]: o
|
|
@@ -1422,7 +1585,7 @@ var Et = class {
|
|
|
1422
1585
|
}
|
|
1423
1586
|
if (!this.#x(e, t)) return;
|
|
1424
1587
|
let i = /* @__PURE__ */ new Set();
|
|
1425
|
-
for (let e of
|
|
1588
|
+
for (let e of je(n.revision.content).tasks) {
|
|
1426
1589
|
let t = n.task(e);
|
|
1427
1590
|
if (t?.executor.kind != "connector") continue;
|
|
1428
1591
|
let r = this.#d.value.actions[t.executor.action];
|
|
@@ -1430,8 +1593,8 @@ var Et = class {
|
|
|
1430
1593
|
}
|
|
1431
1594
|
await Promise.all([...i].map((n) => this.#v(t, n, !1, e)));
|
|
1432
1595
|
}
|
|
1433
|
-
},
|
|
1434
|
-
function
|
|
1596
|
+
}, Wt = { catalogs: {} }, Gt = "trigger:";
|
|
1597
|
+
function Kt(e, t) {
|
|
1435
1598
|
if (e?.kind != "trigger") return;
|
|
1436
1599
|
let n = e.trigger;
|
|
1437
1600
|
if (n.kind != "poll" && n.kind != "integration") return;
|
|
@@ -1442,15 +1605,15 @@ function X(e, t) {
|
|
|
1442
1605
|
triggerId: e.id
|
|
1443
1606
|
};
|
|
1444
1607
|
}
|
|
1445
|
-
function
|
|
1608
|
+
function qt(e, t) {
|
|
1446
1609
|
return {
|
|
1447
1610
|
description: t.t("addNode.triggerNeedsConnection", { provider: e.provider }),
|
|
1448
|
-
group: t.t("addNode.
|
|
1449
|
-
icon:
|
|
1611
|
+
group: t.t("addNode.integrationTriggers"),
|
|
1612
|
+
icon: p({
|
|
1450
1613
|
serviceId: e.provider,
|
|
1451
1614
|
serviceName: e.provider
|
|
1452
1615
|
}),
|
|
1453
|
-
id: `${
|
|
1616
|
+
id: `${Gt}${e.key}`,
|
|
1454
1617
|
inputs: [],
|
|
1455
1618
|
kind: "trigger",
|
|
1456
1619
|
label: e.displayName,
|
|
@@ -1464,7 +1627,7 @@ function kt(e, t) {
|
|
|
1464
1627
|
}
|
|
1465
1628
|
};
|
|
1466
1629
|
}
|
|
1467
|
-
var
|
|
1630
|
+
var Jt = class {
|
|
1468
1631
|
#e;
|
|
1469
1632
|
#t;
|
|
1470
1633
|
#n;
|
|
@@ -1476,28 +1639,29 @@ var At = class {
|
|
|
1476
1639
|
#c;
|
|
1477
1640
|
#l;
|
|
1478
1641
|
#u;
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1642
|
+
#d;
|
|
1643
|
+
constructor(r, i, a, o, s = P()) {
|
|
1644
|
+
this.#t = new AbortController(), this.#a = new m(), this.#o = /* @__PURE__ */ new Set(), this.#l = t(Wt), this.#d = !1, this.browseAddNodeOptions = async (e) => {
|
|
1645
|
+
let t = this.#u.$.flowId.value;
|
|
1646
|
+
if (e.aborted || this.#d || t == null || this.#u.$.target.value?.kind != "flow") return [];
|
|
1647
|
+
let n = await this.#f();
|
|
1648
|
+
if (!(e.aborted || this.#d || t != this.#u.$.flowId.value)) return [...n.values()].map((e) => qt(e, this.#i));
|
|
1485
1649
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
1486
|
-
let n = this.#
|
|
1487
|
-
if (t.aborted || this.#
|
|
1650
|
+
let n = this.#u.$.flowId.value;
|
|
1651
|
+
if (t.aborted || this.#d || n == null || this.#u.$.target.value?.kind != "flow") return [];
|
|
1488
1652
|
let r = e.trim().toLowerCase();
|
|
1489
1653
|
if (r.length == 0) return [];
|
|
1490
|
-
let i = await this.#
|
|
1491
|
-
if (!(t.aborted || this.#
|
|
1654
|
+
let i = await this.#f();
|
|
1655
|
+
if (!(t.aborted || this.#d || n != this.#u.$.flowId.value)) return [...i.values()].filter((e) => [
|
|
1492
1656
|
e.description,
|
|
1493
1657
|
e.displayName,
|
|
1494
1658
|
e.key,
|
|
1495
1659
|
e.name,
|
|
1496
1660
|
e.provider,
|
|
1497
1661
|
e.type
|
|
1498
|
-
].some((e) => e.toLowerCase().includes(r))).map((e) =>
|
|
1499
|
-
}, this.#n = r, this.#r = o, this.#i = s, this.#
|
|
1500
|
-
let t = e(i.$.selection), n =
|
|
1662
|
+
].some((e) => e.toLowerCase().includes(r))).map((e) => qt(e, this.#i));
|
|
1663
|
+
}, this.#n = r, this.#r = o, this.#i = s, this.#c = a, this.#u = i, this.#s = n((e) => {
|
|
1664
|
+
let t = e(i.$.selection), n = Kt(t, i), r = e(this.#l);
|
|
1501
1665
|
if (t?.kind != "trigger") return { authorizationPending: !1 };
|
|
1502
1666
|
let a = t.trigger;
|
|
1503
1667
|
if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
|
|
@@ -1510,102 +1674,96 @@ var At = class {
|
|
|
1510
1674
|
definition: a.definition
|
|
1511
1675
|
};
|
|
1512
1676
|
}), this.$ = {
|
|
1513
|
-
connectionLoading: e(this.#
|
|
1514
|
-
selectedActiveConnections: e(this.#
|
|
1515
|
-
selectedAuthorizationPending: e(this.#
|
|
1516
|
-
selectedConnection: e(this.#
|
|
1517
|
-
selectedConnectionError: e(this.#
|
|
1518
|
-
selectedDefinition: e(this.#
|
|
1677
|
+
connectionLoading: e(this.#l, (e) => e.connectionLoading),
|
|
1678
|
+
selectedActiveConnections: e(this.#s, (e) => e.activeConnections),
|
|
1679
|
+
selectedAuthorizationPending: e(this.#s, (e) => e.authorizationPending),
|
|
1680
|
+
selectedConnection: e(this.#s, (e) => e.connection),
|
|
1681
|
+
selectedConnectionError: e(this.#s, (e) => e.connectionError),
|
|
1682
|
+
selectedDefinition: e(this.#s, (e) => e.definition)
|
|
1519
1683
|
};
|
|
1520
1684
|
}
|
|
1521
1685
|
dispose() {
|
|
1522
|
-
this.#
|
|
1686
|
+
this.#d = !0, this.#t.abort(), this.#a.invalidate();
|
|
1523
1687
|
for (let e of Object.values(this.$)) e.dispose();
|
|
1524
|
-
this.#
|
|
1688
|
+
this.#s.dispose(), this.#l.dispose();
|
|
1525
1689
|
}
|
|
1526
1690
|
reset() {
|
|
1527
|
-
this.#
|
|
1691
|
+
this.#d || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#o.clear(), this.#a.invalidate(), this.#l.set(Wt));
|
|
1528
1692
|
}
|
|
1529
1693
|
async refresh(e = !1) {
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1694
|
+
if (this.#d) return;
|
|
1695
|
+
let t = this.#a.begin(), n = this.#u.$.flowId.value, r = Kt(this.#u.$.selection.value, this.#u);
|
|
1696
|
+
if (n == null || r == null) {
|
|
1697
|
+
this.#l.value.connectionLoading != null && this.#p({ connectionLoading: void 0 });
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
if (!e && !this.#o.has(r.provider) && this.#l.value.catalogs[r.provider] != null) {
|
|
1701
|
+
this.#l.value.connectionLoading != null && this.#p({ connectionLoading: void 0 });
|
|
1702
|
+
return;
|
|
1703
|
+
}
|
|
1704
|
+
this.#p({
|
|
1705
|
+
connectionError: void 0,
|
|
1706
|
+
connectionLoading: r.provider
|
|
1707
|
+
});
|
|
1708
|
+
try {
|
|
1709
|
+
let e = d(await this.#n.listConnectorConnections(r.provider, void 0, n));
|
|
1710
|
+
if (!this.#m(t, n)) return;
|
|
1711
|
+
this.#o.delete(r.provider), this.#p({ catalogs: {
|
|
1712
|
+
...this.#l.value.catalogs,
|
|
1713
|
+
[r.provider]: e
|
|
1714
|
+
} });
|
|
1715
|
+
} catch (e) {
|
|
1716
|
+
this.#m(t, n) && this.#p({ connectionError: {
|
|
1717
|
+
message: E(e, this.#i.t).message,
|
|
1718
|
+
provider: r.provider
|
|
1719
|
+
} });
|
|
1720
|
+
} finally {
|
|
1721
|
+
this.#m(t, n) && this.#l.value.connectionLoading == r.provider && this.#p({ connectionLoading: void 0 });
|
|
1557
1722
|
}
|
|
1558
1723
|
}
|
|
1559
1724
|
async connect(e) {
|
|
1560
|
-
let t = this.#
|
|
1561
|
-
if (!(this.#
|
|
1725
|
+
let t = this.#u.$.flowId.value;
|
|
1726
|
+
if (!(this.#d || t == null)) try {
|
|
1562
1727
|
if (!await this.#r.openExternalPage(() => this.#n.createConnectorConnectionPage(e, t))) {
|
|
1563
|
-
this.#
|
|
1728
|
+
this.#c({
|
|
1564
1729
|
kind: "error",
|
|
1565
1730
|
message: this.#i.t("notice.connectionPopupBlocked")
|
|
1566
1731
|
});
|
|
1567
1732
|
return;
|
|
1568
1733
|
}
|
|
1569
|
-
!this.#
|
|
1734
|
+
!this.#d && t == this.#u.$.flowId.value && this.#p({ authorizationProvider: e });
|
|
1570
1735
|
} catch (e) {
|
|
1571
|
-
this.#
|
|
1736
|
+
this.#d || this.#c(E(e, this.#i.t));
|
|
1572
1737
|
}
|
|
1573
1738
|
}
|
|
1574
1739
|
async setConnection(e, t) {
|
|
1575
|
-
return await this.#
|
|
1576
|
-
}
|
|
1577
|
-
async saveSettings(e, t) {
|
|
1578
|
-
return await this.#l.saveTriggerSettings(e, t);
|
|
1740
|
+
return await this.#u.setTriggerConnection(e, t);
|
|
1579
1741
|
}
|
|
1580
1742
|
async refreshAfterAuthorization() {
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
catalogs: t
|
|
1587
|
-
}), X(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
|
|
1588
|
-
}
|
|
1589
|
-
#d() {
|
|
1743
|
+
if (this.#d) return;
|
|
1744
|
+
let e = this.#l.value.authorizationProvider;
|
|
1745
|
+
e != null && (this.#o.add(e), this.#p({ authorizationProvider: void 0 }), Kt(this.#u.$.selection.value, this.#u)?.provider == e && await this.refresh(!0));
|
|
1746
|
+
}
|
|
1747
|
+
#f() {
|
|
1590
1748
|
if (this.#e != null) return this.#e;
|
|
1591
1749
|
let e = this.#n.listTriggerDefinitions(this.#t.signal).then((e) => new Map(e.map((e) => [e.key, e])));
|
|
1592
1750
|
return this.#e = e, e.catch(() => {
|
|
1593
1751
|
this.#e == e && (this.#e = void 0);
|
|
1594
1752
|
}), e;
|
|
1595
1753
|
}
|
|
1596
|
-
#
|
|
1597
|
-
this.#
|
|
1598
|
-
...this.#
|
|
1754
|
+
#p(e) {
|
|
1755
|
+
this.#d || this.#l.set({
|
|
1756
|
+
...this.#l.value,
|
|
1599
1757
|
...e
|
|
1600
1758
|
});
|
|
1601
1759
|
}
|
|
1602
|
-
#
|
|
1603
|
-
return !this.#
|
|
1760
|
+
#m(e, t) {
|
|
1761
|
+
return !this.#d && e() && t == this.#u.$.flowId.value;
|
|
1604
1762
|
}
|
|
1605
1763
|
};
|
|
1606
1764
|
//#endregion
|
|
1607
1765
|
//#region src/workbench/browser/runtime/stores/draftChanges.ts
|
|
1608
|
-
function
|
|
1766
|
+
function Yt(e, t) {
|
|
1609
1767
|
if (e.length != 1 || t.length != 1) return;
|
|
1610
1768
|
let n = e[0], r = t[0];
|
|
1611
1769
|
if (n?.kind == "graph.node.field.set" && r?.kind == "graph.node.field.set") return n.nodeId != r.nodeId || n.field != r.field || n.target.kind != r.target.kind || n.target.kind == "subflow" && (r.target.kind != "subflow" || n.target.id != r.target.id) ? void 0 : [{
|
|
@@ -1625,7 +1783,7 @@ function jt(e, t) {
|
|
|
1625
1783
|
value: r.value
|
|
1626
1784
|
}];
|
|
1627
1785
|
}
|
|
1628
|
-
var
|
|
1786
|
+
var Xt = class {
|
|
1629
1787
|
#e;
|
|
1630
1788
|
#t;
|
|
1631
1789
|
#n;
|
|
@@ -1653,28 +1811,28 @@ var Mt = class {
|
|
|
1653
1811
|
this.#a = e;
|
|
1654
1812
|
let t = e, n = [];
|
|
1655
1813
|
for (let e of this.#o) try {
|
|
1656
|
-
t =
|
|
1814
|
+
t = R(t, e.changes), n.push(e);
|
|
1657
1815
|
} catch (t) {
|
|
1658
|
-
if (!(t instanceof
|
|
1816
|
+
if (!(t instanceof Le)) throw t;
|
|
1659
1817
|
e.active = !1;
|
|
1660
1818
|
}
|
|
1661
1819
|
return this.#o = n, t;
|
|
1662
1820
|
}
|
|
1663
1821
|
project(e) {
|
|
1664
|
-
return this.#o.reduce((e, t) =>
|
|
1822
|
+
return this.#o.reduce((e, t) => R(e, t.changes), e);
|
|
1665
1823
|
}
|
|
1666
1824
|
enqueue(e) {
|
|
1667
1825
|
let t = this.#s.then(e);
|
|
1668
1826
|
return this.#s = t, t;
|
|
1669
1827
|
}
|
|
1670
1828
|
async change(e, t, n, r = !0) {
|
|
1671
|
-
let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 :
|
|
1829
|
+
let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 : Yt(i.changes, n);
|
|
1672
1830
|
if (i != null && a != null) return i.changes = a, this.#a != null && this.#t.apply(this.project(this.#a)), i.result;
|
|
1673
1831
|
this.#t.beforeChange(r);
|
|
1674
1832
|
let o = {
|
|
1675
1833
|
...e,
|
|
1676
1834
|
active: !0,
|
|
1677
|
-
changeId:
|
|
1835
|
+
changeId: F(),
|
|
1678
1836
|
changes: n,
|
|
1679
1837
|
started: !1
|
|
1680
1838
|
};
|
|
@@ -1699,21 +1857,21 @@ var Mt = class {
|
|
|
1699
1857
|
let r = this.#l(e, n, t);
|
|
1700
1858
|
return this.#o.length == 0 && this.#t.check(), r;
|
|
1701
1859
|
} catch (n) {
|
|
1702
|
-
if (n instanceof
|
|
1860
|
+
if (n instanceof L && n.code == "flow.revision-conflict") {
|
|
1703
1861
|
if (!t && await this.#t.recover(e)) {
|
|
1704
|
-
t = !0, e.changeId =
|
|
1862
|
+
t = !0, e.changeId = F();
|
|
1705
1863
|
continue;
|
|
1706
1864
|
}
|
|
1707
1865
|
t && await this.#t.recover(e), this.#u(e);
|
|
1708
1866
|
} else {
|
|
1709
|
-
if (!(n instanceof
|
|
1867
|
+
if (!(n instanceof L) && !t) {
|
|
1710
1868
|
let n = this.#a?.revisionId;
|
|
1711
1869
|
if (await this.#t.recover(e)) {
|
|
1712
|
-
t = !0, e.active && this.#a?.revisionId != n && (e.changeId =
|
|
1870
|
+
t = !0, e.active && this.#a?.revisionId != n && (e.changeId = F());
|
|
1713
1871
|
continue;
|
|
1714
1872
|
}
|
|
1715
1873
|
}
|
|
1716
|
-
this.#u(e), this.#t.current(e) && this.#r(
|
|
1874
|
+
this.#u(e), this.#t.current(e) && this.#r(E(n, this.#n.t));
|
|
1717
1875
|
}
|
|
1718
1876
|
return;
|
|
1719
1877
|
}
|
|
@@ -1722,7 +1880,7 @@ var Mt = class {
|
|
|
1722
1880
|
#l(e, t, n) {
|
|
1723
1881
|
let r = {
|
|
1724
1882
|
...n.revision,
|
|
1725
|
-
content:
|
|
1883
|
+
content: R(t, e.changes).content
|
|
1726
1884
|
};
|
|
1727
1885
|
this.#o = this.#o.filter((t) => t !== e), this.#a = r;
|
|
1728
1886
|
let i = this.#t.diagnostics(), a = this.#o.length == 0 && i?.revisionId == r.revisionId;
|
|
@@ -1731,7 +1889,7 @@ var Mt = class {
|
|
|
1731
1889
|
#u(e) {
|
|
1732
1890
|
e.active = !1, this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
|
|
1733
1891
|
}
|
|
1734
|
-
},
|
|
1892
|
+
}, Zt = 50, Qt = {
|
|
1735
1893
|
failed: !1,
|
|
1736
1894
|
loaded: !1,
|
|
1737
1895
|
loading: !0,
|
|
@@ -1739,13 +1897,15 @@ var Mt = class {
|
|
|
1739
1897
|
loadMoreFailed: !1,
|
|
1740
1898
|
refreshing: !1,
|
|
1741
1899
|
flows: []
|
|
1742
|
-
},
|
|
1900
|
+
}, $t = class {
|
|
1743
1901
|
#e;
|
|
1744
1902
|
#t;
|
|
1745
|
-
#n = new
|
|
1903
|
+
#n = new m();
|
|
1746
1904
|
#r;
|
|
1747
|
-
#i = t(
|
|
1748
|
-
#a =
|
|
1905
|
+
#i = t(Qt);
|
|
1906
|
+
#a = new AbortController();
|
|
1907
|
+
#o = /* @__PURE__ */ new Set();
|
|
1908
|
+
#s = !1;
|
|
1749
1909
|
constructor(t, n, r) {
|
|
1750
1910
|
this.#e = t, this.#t = r, this.#r = n, this.$ = {
|
|
1751
1911
|
failed: e(this.#i, (e) => e.failed),
|
|
@@ -1762,24 +1922,21 @@ var Mt = class {
|
|
|
1762
1922
|
return this.#i.value.loaded;
|
|
1763
1923
|
}
|
|
1764
1924
|
dispose() {
|
|
1765
|
-
this.#
|
|
1925
|
+
this.#s = !0, this.#a.abort(), this.#n.invalidate();
|
|
1766
1926
|
for (let e of Object.values(this.$)) e.dispose();
|
|
1767
1927
|
this.#i.dispose();
|
|
1768
1928
|
}
|
|
1769
|
-
capture() {
|
|
1770
|
-
return this.#n.capture();
|
|
1771
|
-
}
|
|
1772
1929
|
flow(e) {
|
|
1773
1930
|
return this.#i.value.flows.find((t) => t.flowId == e);
|
|
1774
1931
|
}
|
|
1775
1932
|
async reload() {
|
|
1776
1933
|
let e = this.#n.begin(), t = this.#i.value.loaded;
|
|
1777
|
-
t ? this.#
|
|
1934
|
+
t ? this.#c({
|
|
1778
1935
|
failed: !1,
|
|
1779
1936
|
loadingMore: !1,
|
|
1780
1937
|
loadMoreFailed: !1,
|
|
1781
1938
|
refreshing: !0
|
|
1782
|
-
}) : this.#
|
|
1939
|
+
}) : this.#c({
|
|
1783
1940
|
failed: !1,
|
|
1784
1941
|
loading: !0,
|
|
1785
1942
|
loadingMore: !1,
|
|
@@ -1792,10 +1949,10 @@ var Mt = class {
|
|
|
1792
1949
|
try {
|
|
1793
1950
|
let t = await this.#e.listFlows({
|
|
1794
1951
|
includeTotal: !0,
|
|
1795
|
-
limit:
|
|
1952
|
+
limit: Zt
|
|
1796
1953
|
});
|
|
1797
1954
|
if (!e()) return;
|
|
1798
|
-
this.#
|
|
1955
|
+
this.#c({
|
|
1799
1956
|
loaded: !0,
|
|
1800
1957
|
loading: !1,
|
|
1801
1958
|
refreshing: !1,
|
|
@@ -1805,81 +1962,117 @@ var Mt = class {
|
|
|
1805
1962
|
});
|
|
1806
1963
|
} catch (n) {
|
|
1807
1964
|
if (!e()) return;
|
|
1808
|
-
this.#
|
|
1965
|
+
this.#c({
|
|
1809
1966
|
failed: !t,
|
|
1810
1967
|
loading: !1,
|
|
1811
1968
|
refreshing: !1
|
|
1812
|
-
}), this.#r(
|
|
1969
|
+
}), this.#r(E(n, this.#t.t));
|
|
1813
1970
|
}
|
|
1814
1971
|
}
|
|
1815
1972
|
async loadMore() {
|
|
1816
1973
|
let { loadingMore: e, nextCursor: t, refreshing: n } = this.#i.value;
|
|
1817
1974
|
if (e || n || t == null) return;
|
|
1818
1975
|
let r = this.#n.capture();
|
|
1819
|
-
this.#
|
|
1976
|
+
this.#c({
|
|
1820
1977
|
loadingMore: !0,
|
|
1821
1978
|
loadMoreFailed: !1
|
|
1822
1979
|
});
|
|
1823
1980
|
try {
|
|
1824
1981
|
let e = await this.#e.listFlows({
|
|
1825
1982
|
cursor: t,
|
|
1826
|
-
limit:
|
|
1983
|
+
limit: Zt
|
|
1827
1984
|
});
|
|
1828
1985
|
if (!r()) return;
|
|
1829
1986
|
let n = new Set(this.#i.value.flows.map((e) => e.flowId));
|
|
1830
|
-
this.#
|
|
1987
|
+
this.#c({
|
|
1831
1988
|
loadingMore: !1,
|
|
1832
1989
|
nextCursor: e.nextCursor,
|
|
1833
1990
|
flows: [...this.#i.value.flows, ...e.flows.filter((e) => !n.has(e.flowId))]
|
|
1834
1991
|
});
|
|
1835
1992
|
} catch (e) {
|
|
1836
1993
|
if (!r()) return;
|
|
1837
|
-
this.#
|
|
1994
|
+
this.#c({
|
|
1838
1995
|
loadingMore: !1,
|
|
1839
1996
|
loadMoreFailed: !0
|
|
1840
|
-
}), this.#r(
|
|
1997
|
+
}), this.#r(E(e, this.#t.t));
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
async setEnabled(e, t) {
|
|
2001
|
+
if (!(e.live == null || this.#o.has(e.flowId))) {
|
|
2002
|
+
this.#o.add(e.flowId);
|
|
2003
|
+
try {
|
|
2004
|
+
let n = await this.#e.setFlowEnabled(e.flowId, e.live.publicationId, t);
|
|
2005
|
+
this.#s || this.include(n);
|
|
2006
|
+
} catch (e) {
|
|
2007
|
+
this.#s || (this.#r(E(e, this.#t.t)), await this.reload());
|
|
2008
|
+
} finally {
|
|
2009
|
+
this.#o.delete(e.flowId);
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
async publish(e) {
|
|
2014
|
+
if (!this.#o.has(e.flowId)) {
|
|
2015
|
+
this.#o.add(e.flowId);
|
|
2016
|
+
try {
|
|
2017
|
+
let t = await this.#e.publishFlow(e.flowId, e.draftRevisionId, e.live?.publicationId ?? null);
|
|
2018
|
+
if (this.#s) return;
|
|
2019
|
+
let n = await Y.runPromise(Y.gen({ self: this }, function* () {
|
|
2020
|
+
let n = t;
|
|
2021
|
+
for (; n.status == "pending";) yield* Y.sleep(1e3), n = yield* Y.tryPromise((t) => this.#e.getPublishOperation(e.flowId, n.operationId, t));
|
|
2022
|
+
return n;
|
|
2023
|
+
}), { signal: this.#a.signal });
|
|
2024
|
+
if (this.#s) return;
|
|
2025
|
+
n.status == "failed" ? this.#r({
|
|
2026
|
+
kind: "error",
|
|
2027
|
+
message: n.issue.message
|
|
2028
|
+
}) : this.#r({
|
|
2029
|
+
kind: "success",
|
|
2030
|
+
message: this.#t.t("notice.published", { name: e.name })
|
|
2031
|
+
}), this.include(await this.#e.getFlow(e.flowId));
|
|
2032
|
+
} catch (e) {
|
|
2033
|
+
this.#s || this.#r(E(e, this.#t.t));
|
|
2034
|
+
} finally {
|
|
2035
|
+
this.#o.delete(e.flowId);
|
|
2036
|
+
}
|
|
1841
2037
|
}
|
|
1842
2038
|
}
|
|
1843
2039
|
async create(e) {
|
|
1844
2040
|
let t = await this.#e.createFlow(e);
|
|
1845
|
-
if (!this.#
|
|
1846
|
-
flows: [...this.#i.value.flows, t],
|
|
1847
|
-
total: this.#i.value.total == null ? void 0 : this.#i.value.total + 1
|
|
1848
|
-
}), t;
|
|
2041
|
+
if (!this.#s) return this.insert(t), t;
|
|
1849
2042
|
}
|
|
1850
2043
|
include(e) {
|
|
1851
2044
|
let t = this.#i.value.flows.findIndex((t) => t.flowId == e.flowId);
|
|
1852
2045
|
if (t < 0) {
|
|
1853
|
-
this.#
|
|
2046
|
+
this.#c({ flows: [...this.#i.value.flows, e] });
|
|
1854
2047
|
return;
|
|
1855
2048
|
}
|
|
1856
|
-
this.#
|
|
2049
|
+
this.#c({ flows: this.#i.value.flows.with(t, e) });
|
|
1857
2050
|
}
|
|
1858
2051
|
insert(e) {
|
|
1859
|
-
this.#i.value.flows.some((t) => t.flowId == e.flowId) || this.#
|
|
2052
|
+
this.#i.value.flows.some((t) => t.flowId == e.flowId) || this.#c({
|
|
1860
2053
|
flows: [...this.#i.value.flows, e],
|
|
1861
2054
|
total: this.#i.value.total == null ? void 0 : this.#i.value.total + 1
|
|
1862
2055
|
});
|
|
1863
2056
|
}
|
|
1864
2057
|
remove(e) {
|
|
1865
|
-
this.#
|
|
2058
|
+
this.#c({
|
|
1866
2059
|
flows: this.#i.value.flows.filter((t) => t.flowId != e),
|
|
1867
2060
|
total: this.#i.value.total == null ? void 0 : this.#i.value.total - 1
|
|
1868
2061
|
});
|
|
1869
2062
|
}
|
|
1870
2063
|
advanceHead(e, t) {
|
|
1871
|
-
this.#
|
|
2064
|
+
this.#c({ flows: this.#i.value.flows.map((n) => n.flowId == e ? {
|
|
1872
2065
|
...n,
|
|
1873
2066
|
draftRevisionId: t
|
|
1874
2067
|
} : n) });
|
|
1875
2068
|
}
|
|
1876
|
-
#
|
|
1877
|
-
this.#
|
|
2069
|
+
#c(e) {
|
|
2070
|
+
this.#s || this.#i.set({
|
|
1878
2071
|
...this.#i.value,
|
|
1879
2072
|
...e
|
|
1880
2073
|
});
|
|
1881
2074
|
}
|
|
1882
|
-
},
|
|
2075
|
+
}, en = class {
|
|
1883
2076
|
#e;
|
|
1884
2077
|
#t;
|
|
1885
2078
|
#n;
|
|
@@ -1922,7 +2115,7 @@ var Mt = class {
|
|
|
1922
2115
|
this.#c(a, r);
|
|
1923
2116
|
} catch (r) {
|
|
1924
2117
|
if (this.#o || !n()) return;
|
|
1925
|
-
if (r instanceof
|
|
2118
|
+
if (r instanceof L && r.code == "flow.presentation-conflict") try {
|
|
1926
2119
|
let t = await this.#e.getPresentation(e);
|
|
1927
2120
|
if (this.#o || !n()) return;
|
|
1928
2121
|
this.#c(a, t), this.#n({
|
|
@@ -1930,9 +2123,9 @@ var Mt = class {
|
|
|
1930
2123
|
message: this.#t.t("notice.layoutConflict")
|
|
1931
2124
|
});
|
|
1932
2125
|
} catch (e) {
|
|
1933
|
-
!this.#o && n() && this.#n(
|
|
2126
|
+
!this.#o && n() && this.#n(E(e, this.#t.t));
|
|
1934
2127
|
}
|
|
1935
|
-
else this.#c(a, t), this.#n(
|
|
2128
|
+
else this.#c(a, t), this.#n(E(r, this.#t.t));
|
|
1936
2129
|
}
|
|
1937
2130
|
}), await this.#i;
|
|
1938
2131
|
}
|
|
@@ -1944,21 +2137,21 @@ var Mt = class {
|
|
|
1944
2137
|
value: n
|
|
1945
2138
|
});
|
|
1946
2139
|
}
|
|
1947
|
-
},
|
|
2140
|
+
}, tn = {
|
|
1948
2141
|
checkLoading: !1,
|
|
1949
2142
|
selectedNodeIds: [],
|
|
1950
2143
|
workspaceLoadFailed: !1,
|
|
1951
2144
|
workspaceLoading: !1
|
|
1952
2145
|
};
|
|
1953
|
-
function
|
|
1954
|
-
return e.workspaceLoading ? "loading" : e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved";
|
|
2146
|
+
function nn(e) {
|
|
2147
|
+
return e.workspaceLoading ? "loading" : e.moduleSaveStatus == null ? e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved" : e.moduleSaveStatus;
|
|
1955
2148
|
}
|
|
1956
|
-
function
|
|
2149
|
+
function $(e, t) {
|
|
1957
2150
|
if (t.phase != null) return t.phase;
|
|
1958
2151
|
let n = e?.content.modules[t.moduleId];
|
|
1959
2152
|
return n == null ? "failed" : t.source == n.source ? "saved" : "dirty";
|
|
1960
2153
|
}
|
|
1961
|
-
function
|
|
2154
|
+
function rn(e, t, n) {
|
|
1962
2155
|
if (e == null || t == null || n.length != 1) return;
|
|
1963
2156
|
let r = e.node(t, n[0]);
|
|
1964
2157
|
if (!(r?.kind != "task" || r.definition == null || !("moduleId" in r.definition) || r.module == null)) return {
|
|
@@ -1966,9 +2159,9 @@ function $(e, t, n) {
|
|
|
1966
2159
|
source: r.module.source
|
|
1967
2160
|
};
|
|
1968
2161
|
}
|
|
1969
|
-
var
|
|
2162
|
+
var an = class {
|
|
1970
2163
|
#e;
|
|
1971
|
-
#t = t(
|
|
2164
|
+
#t = t(tn);
|
|
1972
2165
|
#n;
|
|
1973
2166
|
constructor(t, r) {
|
|
1974
2167
|
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) => {
|
|
@@ -1976,25 +2169,25 @@ var Rt = class {
|
|
|
1976
2169
|
let { phase: t, ...n } = e.moduleEditor;
|
|
1977
2170
|
return {
|
|
1978
2171
|
...n,
|
|
1979
|
-
status:
|
|
2172
|
+
status: $(e.draft, e.moduleEditor)
|
|
1980
2173
|
};
|
|
1981
|
-
}), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 :
|
|
2174
|
+
}), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 : C(e.draft)), h = e(this.#t, (e) => e.selectedNodeIds), g = e(this.#t, (e) => e.target), _ = e(this.#t, (e) => e.workspaceLoadFailed), v = e(this.#t, (e) => e.workspaceLoading);
|
|
1982
2175
|
this.#e = e(this.#t, (e) => ({
|
|
1983
|
-
revision: e.draft == null ? void 0 :
|
|
2176
|
+
revision: e.draft == null ? void 0 : C(e.draft),
|
|
1984
2177
|
target: e.target
|
|
1985
2178
|
}), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
|
|
1986
2179
|
let y = e(this.#t, (e) => {
|
|
1987
|
-
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return
|
|
2180
|
+
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return C(e.draft).selection(e.target, e.selectedNodeIds[0]);
|
|
1988
2181
|
});
|
|
1989
2182
|
this.$ = {
|
|
1990
2183
|
addNodeOptions: n((e) => {
|
|
1991
2184
|
let { revision: n, target: r } = e(this.#e);
|
|
1992
|
-
return
|
|
2185
|
+
return Oe(n?.revision, r, e(t.t$));
|
|
1993
2186
|
}),
|
|
1994
2187
|
busy: i,
|
|
1995
2188
|
checkLoading: a,
|
|
1996
2189
|
diagnosticFocus: o,
|
|
1997
|
-
diagnosticItems: e(this.#t, (e) =>
|
|
2190
|
+
diagnosticItems: e(this.#t, (e) => D(e.draft == null ? void 0 : C(e.draft), e.target, e.diagnostics)),
|
|
1998
2191
|
diagnostics: s,
|
|
1999
2192
|
draft: c,
|
|
2000
2193
|
flow: n((e) => {
|
|
@@ -2010,7 +2203,7 @@ var Rt = class {
|
|
|
2010
2203
|
flowRefreshing: r.$.refreshing,
|
|
2011
2204
|
flowTotal: r.$.total,
|
|
2012
2205
|
flows: r.$.flows,
|
|
2013
|
-
inspectorDiagnostics: e(this.#t, (e) =>
|
|
2206
|
+
inspectorDiagnostics: e(this.#t, (e) => T(e.draft == null ? void 0 : C(e.draft), e.target, e.diagnostics, y.value)),
|
|
2014
2207
|
live: p,
|
|
2015
2208
|
moduleDiagnostics: e(this.#t, (e) => {
|
|
2016
2209
|
let t = e.moduleEditor?.moduleId;
|
|
@@ -2022,11 +2215,11 @@ var Rt = class {
|
|
|
2022
2215
|
revision: m,
|
|
2023
2216
|
selection: y,
|
|
2024
2217
|
selectedNodeIds: h,
|
|
2025
|
-
status: e(this.#t,
|
|
2218
|
+
status: e(this.#t, nn),
|
|
2026
2219
|
target: g,
|
|
2027
2220
|
targetFlow: n((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
|
|
2028
2221
|
targetName: e(this.#t, (e) => {
|
|
2029
|
-
if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id :
|
|
2222
|
+
if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : C(e.draft).subflow(e.target.id)?.name ?? e.target.id;
|
|
2030
2223
|
}),
|
|
2031
2224
|
workspaceLoadFailed: _,
|
|
2032
2225
|
workspaceLoading: v
|
|
@@ -2048,54 +2241,13 @@ var Rt = class {
|
|
|
2048
2241
|
};
|
|
2049
2242
|
//#endregion
|
|
2050
2243
|
//#region src/workbench/browser/runtime/stores/workspaceStore.ts
|
|
2051
|
-
function
|
|
2244
|
+
function on(e, t) {
|
|
2052
2245
|
if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
|
|
2053
2246
|
}
|
|
2054
|
-
|
|
2055
|
-
let i = j(e, t).nodes;
|
|
2056
|
-
if (r.target == n) {
|
|
2057
|
-
let e = i.find((e) => e.id == r.source);
|
|
2058
|
-
if (e == null || e.kind == "comment") return;
|
|
2059
|
-
let t = e.outputs.find((e) => "handle" in e && e.handle == r.sourceHandle);
|
|
2060
|
-
return t == null || !("handle" in t) ? void 0 : {
|
|
2061
|
-
inputs: [{
|
|
2062
|
-
description: t.description,
|
|
2063
|
-
handle: r.targetHandle,
|
|
2064
|
-
jsonSchema: t.jsonSchema ?? {},
|
|
2065
|
-
nullable: t.nullable ?? !1,
|
|
2066
|
-
value: null
|
|
2067
|
-
}],
|
|
2068
|
-
outputs: [{
|
|
2069
|
-
handle: "result",
|
|
2070
|
-
jsonSchema: {},
|
|
2071
|
-
nullable: !0
|
|
2072
|
-
}]
|
|
2073
|
-
};
|
|
2074
|
-
}
|
|
2075
|
-
if (r.source == n) {
|
|
2076
|
-
let e = i.find((e) => e.id == r.target);
|
|
2077
|
-
if (e == null || e.kind == "comment") return;
|
|
2078
|
-
let t = e.inputs.find((e) => "handle" in e && e.handle == r.targetHandle);
|
|
2079
|
-
return t == null || !("handle" in t) ? void 0 : {
|
|
2080
|
-
inputs: [{
|
|
2081
|
-
handle: "value",
|
|
2082
|
-
jsonSchema: {},
|
|
2083
|
-
nullable: !0,
|
|
2084
|
-
value: null
|
|
2085
|
-
}],
|
|
2086
|
-
outputs: [{
|
|
2087
|
-
description: t.description,
|
|
2088
|
-
handle: r.sourceHandle,
|
|
2089
|
-
jsonSchema: t.jsonSchema ?? {},
|
|
2090
|
-
nullable: t.nullable ?? !1
|
|
2091
|
-
}]
|
|
2092
|
-
};
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
2095
|
-
var Vt = class {
|
|
2247
|
+
var sn = class {
|
|
2096
2248
|
#e;
|
|
2097
2249
|
#t;
|
|
2098
|
-
#n = new
|
|
2250
|
+
#n = new m();
|
|
2099
2251
|
#r;
|
|
2100
2252
|
#i;
|
|
2101
2253
|
#a;
|
|
@@ -2103,47 +2255,60 @@ var Vt = class {
|
|
|
2103
2255
|
#s;
|
|
2104
2256
|
#c;
|
|
2105
2257
|
#l;
|
|
2106
|
-
#u;
|
|
2107
|
-
#d
|
|
2108
|
-
#f
|
|
2109
|
-
#p
|
|
2110
|
-
#m =
|
|
2111
|
-
#h =
|
|
2112
|
-
#g =
|
|
2113
|
-
#_;
|
|
2114
|
-
#v;
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2258
|
+
#u = /* @__PURE__ */ new Map();
|
|
2259
|
+
#d;
|
|
2260
|
+
#f;
|
|
2261
|
+
#p;
|
|
2262
|
+
#m = 0;
|
|
2263
|
+
#h = 0;
|
|
2264
|
+
#g = !1;
|
|
2265
|
+
#_ = !1;
|
|
2266
|
+
#v = !1;
|
|
2267
|
+
#y = 0;
|
|
2268
|
+
#b;
|
|
2269
|
+
#x;
|
|
2270
|
+
constructor(e, t, n = Dt, r = P(), i = () => {}) {
|
|
2271
|
+
this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new $t(e, t, r), this.#l = new an(r, this.#o), this.#t = new Xt(e, t, r, {
|
|
2272
|
+
apply: (e, t) => this.#D(e, t),
|
|
2118
2273
|
beforeChange: (e) => {
|
|
2119
|
-
e && (this.#
|
|
2274
|
+
e && (this.#R({ busy: "designer" }), this.#c(void 0));
|
|
2120
2275
|
},
|
|
2121
|
-
check: () => void this.#
|
|
2122
|
-
current: (e) => this.#
|
|
2276
|
+
check: () => void this.#k(),
|
|
2277
|
+
current: (e) => this.#L(e),
|
|
2123
2278
|
diagnostics: () => this.#l.value.diagnostics,
|
|
2124
2279
|
finishChanges: () => {
|
|
2125
|
-
!this.#
|
|
2280
|
+
!this.#_ && this.#l.value.busy == "designer" && this.#R({ busy: void 0 });
|
|
2126
2281
|
},
|
|
2127
|
-
headChanged: (e, t) => this.#
|
|
2128
|
-
recover: (e) => this.#
|
|
2129
|
-
}), this.#a = new
|
|
2282
|
+
headChanged: (e, t) => this.#M(e, t),
|
|
2283
|
+
recover: (e) => this.#j(e, !0)
|
|
2284
|
+
}), this.#a = new en(e, t, (e) => this.#R({ presentation: e }), r), this.$ = this.#l.$;
|
|
2130
2285
|
}
|
|
2131
2286
|
dispose() {
|
|
2132
|
-
this.#
|
|
2287
|
+
this.#_ = !0, clearTimeout(this.#d), this.#n.invalidate(), this.#a.dispose(), this.#b?.(), this.#x?.(), this.#l.dispose(), this.#o.dispose();
|
|
2133
2288
|
}
|
|
2134
2289
|
async start(e) {
|
|
2135
|
-
|
|
2290
|
+
if (this.#b == null) {
|
|
2291
|
+
let e = this.#e.watchFlowCatalog(() => void this.reloadFlows());
|
|
2292
|
+
this.#b = e.stop, await e.ready;
|
|
2293
|
+
}
|
|
2294
|
+
this.#_ || (await this.reloadFlows(), this.#_ || await this.selectFlow(e));
|
|
2136
2295
|
}
|
|
2137
2296
|
async reloadFlows() {
|
|
2138
2297
|
await this.#o.reload();
|
|
2139
2298
|
}
|
|
2299
|
+
async setFlowEnabled(e, t) {
|
|
2300
|
+
await this.#o.setEnabled(e, t);
|
|
2301
|
+
}
|
|
2302
|
+
async publishFlow(e) {
|
|
2303
|
+
await this.#o.publish(e);
|
|
2304
|
+
}
|
|
2140
2305
|
async loadMoreFlows() {
|
|
2141
2306
|
await this.#o.loadMore();
|
|
2142
2307
|
}
|
|
2143
2308
|
async selectFlow(e) {
|
|
2144
|
-
if (!this
|
|
2309
|
+
if (!await this.saveModuleEditor()) return !1;
|
|
2145
2310
|
let t = this.#n.begin();
|
|
2146
|
-
if (this.#t.reset(), this.#a.reset(), this.#
|
|
2311
|
+
if (this.#t.reset(), this.#a.reset(), this.#h = 0, this.#g = !1, this.#v = !1, this.#x?.(), this.#x = void 0, this.#R({
|
|
2147
2312
|
checkLoading: !1,
|
|
2148
2313
|
diagnosticFocus: void 0,
|
|
2149
2314
|
diagnostics: void 0,
|
|
@@ -2159,27 +2324,27 @@ var Vt = class {
|
|
|
2159
2324
|
workspaceLoading: e != null
|
|
2160
2325
|
}), e == null) return !0;
|
|
2161
2326
|
try {
|
|
2162
|
-
let n =
|
|
2163
|
-
n
|
|
2164
|
-
|
|
2165
|
-
this.#
|
|
2166
|
-
|
|
2167
|
-
|
|
2327
|
+
let n = !1, r, i = this.#e.watchFlow(e, (e) => {
|
|
2328
|
+
t() && (this.#t.committed == null ? (n = !0, r = e) : e != this.#t.committed.revisionId && this.#A(e));
|
|
2329
|
+
}, (e) => {
|
|
2330
|
+
t() && this.#s(e);
|
|
2331
|
+
});
|
|
2332
|
+
if (this.#x = i.stop, await i.ready, !t()) return !1;
|
|
2333
|
+
let { flow: a, draft: o, live: s, presentation: c } = await this.#e.getEditor(e);
|
|
2168
2334
|
if (!t()) return !1;
|
|
2169
|
-
this.#t.reset(
|
|
2170
|
-
draft:
|
|
2171
|
-
live:
|
|
2172
|
-
presentation:
|
|
2335
|
+
this.#t.reset(o), this.#a.reset(c), this.#o.include(a), this.#R({
|
|
2336
|
+
draft: o,
|
|
2337
|
+
live: s,
|
|
2338
|
+
presentation: c,
|
|
2173
2339
|
target: { kind: "flow" },
|
|
2174
2340
|
workspaceLoadFailed: !1,
|
|
2175
2341
|
workspaceLoading: !1
|
|
2176
|
-
}), this.#
|
|
2177
|
-
!this.#m && e != this.#t.committed?.revisionId && this.#w(e);
|
|
2178
|
-
}, this.#s);
|
|
2342
|
+
}), await this.#E(t), n && r != o.revisionId && this.#A(r);
|
|
2179
2343
|
} catch (e) {
|
|
2180
2344
|
if (!t()) return !1;
|
|
2181
|
-
|
|
2182
|
-
|
|
2345
|
+
this.#x?.(), this.#x = void 0;
|
|
2346
|
+
let n = e instanceof L && e.code == le.flowNotFound;
|
|
2347
|
+
return this.#R(n ? {
|
|
2183
2348
|
flowId: void 0,
|
|
2184
2349
|
target: void 0,
|
|
2185
2350
|
workspaceLoadFailed: !1,
|
|
@@ -2190,64 +2355,64 @@ var Vt = class {
|
|
|
2190
2355
|
}), this.#c(n ? {
|
|
2191
2356
|
kind: "error",
|
|
2192
2357
|
message: this.#r.t("notice.flowMissing")
|
|
2193
|
-
} :
|
|
2358
|
+
} : E(e, this.#r.t)), !1;
|
|
2194
2359
|
}
|
|
2195
2360
|
return !0;
|
|
2196
2361
|
}
|
|
2197
2362
|
selectTarget(e) {
|
|
2198
|
-
return this.#
|
|
2363
|
+
return this.#S(), this.#R({
|
|
2199
2364
|
diagnosticFocus: void 0,
|
|
2200
2365
|
diagnostics: void 0,
|
|
2201
2366
|
moduleEditor: void 0,
|
|
2202
2367
|
nodeFocus: void 0,
|
|
2203
2368
|
selectedNodeIds: [],
|
|
2204
2369
|
target: e
|
|
2205
|
-
}), this.#
|
|
2370
|
+
}), this.#k(), !0;
|
|
2206
2371
|
}
|
|
2207
2372
|
selectNodes(e) {
|
|
2208
|
-
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#
|
|
2373
|
+
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : (this.#S(), this.#R({
|
|
2209
2374
|
diagnosticFocus: void 0,
|
|
2210
|
-
moduleEditor:
|
|
2375
|
+
moduleEditor: rn(this.#l.value.draft == null ? void 0 : C(this.#l.value.draft), this.#l.value.target, e),
|
|
2211
2376
|
nodeFocus: void 0,
|
|
2212
2377
|
selectedNodeIds: e
|
|
2213
|
-
}), !0)
|
|
2378
|
+
}), !0);
|
|
2214
2379
|
}
|
|
2215
2380
|
async createFlow(e, t) {
|
|
2216
|
-
if (this
|
|
2217
|
-
this.#
|
|
2381
|
+
if (await this.saveModuleEditor()) {
|
|
2382
|
+
this.#R({ busy: "flow" }), this.#c(void 0);
|
|
2218
2383
|
try {
|
|
2219
2384
|
if (t == null) return await this.#o.create(e);
|
|
2220
2385
|
let n = await this.#e.getFlow(await t(e));
|
|
2221
2386
|
return this.#o.insert(n), n;
|
|
2222
2387
|
} catch (e) {
|
|
2223
|
-
this.#
|
|
2388
|
+
this.#_ || this.#c(E(e, this.#r.t));
|
|
2224
2389
|
} finally {
|
|
2225
|
-
this.#
|
|
2390
|
+
this.#R({ busy: void 0 });
|
|
2226
2391
|
}
|
|
2227
2392
|
}
|
|
2228
2393
|
}
|
|
2229
2394
|
async deleteFlow(e) {
|
|
2230
|
-
if (!this
|
|
2395
|
+
if (!await this.saveModuleEditor()) return !1;
|
|
2231
2396
|
let t = this.#o.flow(e);
|
|
2232
2397
|
if (t == null || t.status == "retiring") return !1;
|
|
2233
|
-
this.#
|
|
2398
|
+
this.#R({ busy: "flow" }), this.#c(void 0);
|
|
2234
2399
|
try {
|
|
2235
|
-
return await this.#e.deleteFlow(e), !this.#
|
|
2400
|
+
return await this.#e.deleteFlow(e), !this.#_ && (this.#o.remove(e), this.#c({
|
|
2236
2401
|
kind: "success",
|
|
2237
2402
|
message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
|
|
2238
2403
|
}), !0);
|
|
2239
2404
|
} catch (e) {
|
|
2240
|
-
return this.#
|
|
2405
|
+
return this.#_ || this.#c(E(e, this.#r.t)), !1;
|
|
2241
2406
|
} finally {
|
|
2242
|
-
this.#
|
|
2407
|
+
this.#R({ busy: void 0 });
|
|
2243
2408
|
}
|
|
2244
2409
|
}
|
|
2245
2410
|
async createResource(e) {
|
|
2246
|
-
if (!this
|
|
2411
|
+
if (!await this.saveModuleEditor() || this.#l.value.draft == null) return !1;
|
|
2247
2412
|
let t = this.#i();
|
|
2248
|
-
this.#
|
|
2249
|
-
let n = await this.#
|
|
2250
|
-
return this.#
|
|
2413
|
+
this.#R({ busy: "resource" }), this.#c(void 0);
|
|
2414
|
+
let n = await this.#T(j(t, e), !1);
|
|
2415
|
+
return this.#R({ busy: void 0 }), n != null && (this.selectTarget({
|
|
2251
2416
|
id: t,
|
|
2252
2417
|
kind: "subflow"
|
|
2253
2418
|
}), this.#c({
|
|
@@ -2259,96 +2424,99 @@ var Vt = class {
|
|
|
2259
2424
|
let n = this.#o.flow(e), r = t.trim();
|
|
2260
2425
|
if (n == null || r.length == 0) return !1;
|
|
2261
2426
|
if (n.name == r) return !0;
|
|
2262
|
-
this.#
|
|
2427
|
+
this.#R({ busy: "flow" }), this.#c(void 0);
|
|
2263
2428
|
let i;
|
|
2264
2429
|
try {
|
|
2265
2430
|
i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
|
|
2266
2431
|
} catch (e) {
|
|
2267
|
-
this.#
|
|
2432
|
+
this.#_ || this.#c(E(e, this.#r.t));
|
|
2268
2433
|
}
|
|
2269
|
-
return this.#
|
|
2434
|
+
return this.#R({ busy: void 0 }), i != null && (this.#c({
|
|
2270
2435
|
kind: "success",
|
|
2271
2436
|
message: this.#r.t("notice.flowRenamed", { name: r })
|
|
2272
2437
|
}), !0);
|
|
2273
2438
|
}
|
|
2274
2439
|
async addNode(e, t, n) {
|
|
2275
|
-
if (!this
|
|
2440
|
+
if (!await this.saveModuleEditor()) return;
|
|
2276
2441
|
let r = this.#l.value.draft, i = this.#l.value.target;
|
|
2277
2442
|
if (r == null || i == null) return;
|
|
2278
2443
|
let a = this.#i();
|
|
2279
|
-
if (e.kind == "comment") return await this.#
|
|
2280
|
-
let o =
|
|
2444
|
+
if (e.kind == "comment") return await this.#w(i, a, t);
|
|
2445
|
+
let o = C(r), s = u(e, o, i, this.#r.t);
|
|
2281
2446
|
if (s == null) return;
|
|
2282
|
-
let c = n?.(a);
|
|
2283
|
-
if (s.kind == "code" && c != null) {
|
|
2284
|
-
let e = Bt(r, i, a, c);
|
|
2285
|
-
if (e == null) return;
|
|
2286
|
-
s = {
|
|
2287
|
-
...s,
|
|
2288
|
-
ports: e
|
|
2289
|
-
};
|
|
2290
|
-
}
|
|
2291
|
-
let l = Ne(o, i, a, s, this.#i);
|
|
2447
|
+
let c = n?.(a), l = we(o, i, a, s, this.#i);
|
|
2292
2448
|
if (l == null) return;
|
|
2293
|
-
let
|
|
2449
|
+
let d = c == null ? l : [...l, ...St(R(r, l).content, i, {
|
|
2450
|
+
source: c.source,
|
|
2451
|
+
target: c.target,
|
|
2452
|
+
...c.sourceHandle.startsWith("$branch:") ? { sourceHandle: c.sourceHandle.slice(8) } : {}
|
|
2453
|
+
})], f = this.#T(d);
|
|
2294
2454
|
this.selectNodes([a]);
|
|
2295
|
-
let
|
|
2296
|
-
if (await
|
|
2455
|
+
let p = this.moveNodes({ [a]: t });
|
|
2456
|
+
if (await f != null && (await p, !this.#_)) return this.#R({ nodeFocus: {
|
|
2297
2457
|
nodeId: a,
|
|
2298
|
-
requestId: ++this.#
|
|
2458
|
+
requestId: ++this.#y
|
|
2299
2459
|
} }), a;
|
|
2300
2460
|
}
|
|
2301
2461
|
async connect(e) {
|
|
2302
2462
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2303
2463
|
if (t == null || n == null) return;
|
|
2304
|
-
let r =
|
|
2305
|
-
|
|
2464
|
+
let r = St(t.revision.content, n, {
|
|
2465
|
+
source: e.source,
|
|
2466
|
+
target: e.target,
|
|
2467
|
+
...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
|
|
2468
|
+
});
|
|
2469
|
+
r.length > 0 && await this.#T(r);
|
|
2306
2470
|
}
|
|
2307
2471
|
async disconnect(e) {
|
|
2308
2472
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2309
2473
|
if (t == null || n == null) return;
|
|
2310
|
-
let r =
|
|
2311
|
-
|
|
2474
|
+
let r = Ct(t.revision.content, n, {
|
|
2475
|
+
source: e.source,
|
|
2476
|
+
target: e.target,
|
|
2477
|
+
...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
|
|
2478
|
+
});
|
|
2479
|
+
r.length > 0 && await this.#T(r);
|
|
2312
2480
|
}
|
|
2313
2481
|
async deleteSelectedNodes() {
|
|
2314
|
-
if (!this
|
|
2482
|
+
if (!await this.saveModuleEditor()) return;
|
|
2315
2483
|
let e = this.$.revision.value, t = this.#l.value.target;
|
|
2316
2484
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
2317
|
-
let n =
|
|
2485
|
+
let n = f(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = ge(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#T(i), o = r.size == 0 ? void 0 : this.#O((e) => c(e, t, r));
|
|
2318
2486
|
this.selectNodes([]), (a == null || await a != null) && await o;
|
|
2319
2487
|
}
|
|
2320
2488
|
copySelectedNodes() {
|
|
2321
2489
|
let e = this.$.revision.value, t = this.#l.value.target;
|
|
2322
2490
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
2323
2491
|
let n = new Set(this.#l.value.selectedNodeIds);
|
|
2324
|
-
this.#
|
|
2325
|
-
comments: this.#
|
|
2492
|
+
this.#p = {
|
|
2493
|
+
comments: this.#N().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
|
|
2326
2494
|
content: e.content,
|
|
2327
2495
|
position: e.position,
|
|
2328
2496
|
sourceId: e.id,
|
|
2329
2497
|
title: e.title
|
|
2330
2498
|
}] : []),
|
|
2331
|
-
nodes:
|
|
2499
|
+
nodes: ue(e, t, this.#l.value.selectedNodeIds)
|
|
2332
2500
|
};
|
|
2333
2501
|
}
|
|
2334
2502
|
async pasteNodes(e) {
|
|
2335
|
-
if (!this
|
|
2503
|
+
if (!await this.saveModuleEditor()) return;
|
|
2336
2504
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2337
|
-
if (t == null || n == null || this.#
|
|
2338
|
-
let r =
|
|
2505
|
+
if (t == null || n == null || this.#p == null) return;
|
|
2506
|
+
let r = Se(t, n, this.#p.nodes, this.#i), i = r.changes.length == 0 ? void 0 : this.#T(r.changes), a = this.#p.comments.map((e) => ({
|
|
2339
2507
|
...e,
|
|
2340
2508
|
nodeId: this.#i()
|
|
2341
2509
|
}));
|
|
2342
2510
|
if (r.nodeIds.length == 0 && a.length == 0) return;
|
|
2343
|
-
let o = new Map(this.#
|
|
2511
|
+
let o = new Map(this.#N().nodes.map((e) => [e.id, e])), s = Object.fromEntries(r.sourceIds.map((t, n) => {
|
|
2344
2512
|
let i = e?.[t] ?? o.get(t)?.position;
|
|
2345
2513
|
return [r.nodeIds[n], {
|
|
2346
2514
|
x: (i?.x ?? 80) + 40,
|
|
2347
2515
|
y: (i?.y ?? 80) + 40
|
|
2348
2516
|
}];
|
|
2349
|
-
})), c = this.#
|
|
2350
|
-
let t =
|
|
2351
|
-
for (let e of a) t =
|
|
2517
|
+
})), c = this.#O((e) => {
|
|
2518
|
+
let t = y(e, n, s);
|
|
2519
|
+
for (let e of a) t = I(t, n, e.nodeId, {
|
|
2352
2520
|
content: e.content,
|
|
2353
2521
|
position: {
|
|
2354
2522
|
x: e.position.x + 40,
|
|
@@ -2366,66 +2534,73 @@ var Vt = class {
|
|
|
2366
2534
|
async saveNodeSettings(e, t) {
|
|
2367
2535
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2368
2536
|
if (n == null || r == null) return !1;
|
|
2369
|
-
let i =
|
|
2370
|
-
return i != null && await this.#
|
|
2537
|
+
let i = se(n, r, e, t);
|
|
2538
|
+
return i != null && await this.#T(i) != null;
|
|
2371
2539
|
}
|
|
2372
2540
|
async saveNodeDescription(e, t) {
|
|
2373
2541
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2374
2542
|
if (n == null || r == null) return !1;
|
|
2375
|
-
let i =
|
|
2376
|
-
return i != null && await this.#
|
|
2543
|
+
let i = ve(n, r, e, t);
|
|
2544
|
+
return i != null && await this.#T(i) != null;
|
|
2377
2545
|
}
|
|
2378
2546
|
async saveNodeIcon(e, t) {
|
|
2379
2547
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2380
2548
|
if (n == null || r == null) return !1;
|
|
2381
|
-
let i =
|
|
2382
|
-
return i != null && await this.#
|
|
2549
|
+
let i = me(n, r, e, t);
|
|
2550
|
+
return i != null && await this.#T(i) != null;
|
|
2383
2551
|
}
|
|
2384
2552
|
async saveNodeTitle(e, t) {
|
|
2385
2553
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2386
2554
|
if (n == null || r == null) return !1;
|
|
2387
|
-
let i =
|
|
2388
|
-
return i != null && await this.#
|
|
2555
|
+
let i = ce(n, r, e, t);
|
|
2556
|
+
return i != null && await this.#T(i) != null;
|
|
2389
2557
|
}
|
|
2390
2558
|
async setInputValue(e, t, n) {
|
|
2391
2559
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2392
2560
|
if (r == null || i == null) return !1;
|
|
2393
|
-
let a =
|
|
2394
|
-
return a != null && await this.#
|
|
2561
|
+
let a = N(r, i, e, t, n);
|
|
2562
|
+
return a != null && await this.#T(a) != null;
|
|
2563
|
+
}
|
|
2564
|
+
async setInputSource(e, t, n) {
|
|
2565
|
+
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2566
|
+
return r == null || i == null ? !1 : await this.#T(ee(r.revision.content, i, e, t, [{
|
|
2567
|
+
kind: "node",
|
|
2568
|
+
...n
|
|
2569
|
+
}])) != null;
|
|
2395
2570
|
}
|
|
2396
2571
|
async setInputVariable(e, t, n) {
|
|
2397
2572
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2398
2573
|
if (r == null || i == null) return !1;
|
|
2399
|
-
let a = n == null ?
|
|
2400
|
-
return a != null && await this.#
|
|
2574
|
+
let a = n == null ? N(r, i, e, t, void 0) : fe(r, i, e, t, n, this.#i());
|
|
2575
|
+
return a != null && await this.#T(a) != null;
|
|
2401
2576
|
}
|
|
2402
2577
|
async saveCondition(e, t) {
|
|
2403
2578
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2404
2579
|
if (n == null || r == null) return !1;
|
|
2405
|
-
let i =
|
|
2406
|
-
return i != null && await this.#
|
|
2580
|
+
let i = oe(n, r, e, t);
|
|
2581
|
+
return i != null && await this.#T(i) != null;
|
|
2407
2582
|
}
|
|
2408
2583
|
async saveValue(e, t) {
|
|
2409
2584
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2410
2585
|
if (n == null || r == null) return !1;
|
|
2411
|
-
let i =
|
|
2412
|
-
return i != null && await this.#
|
|
2586
|
+
let i = M(n, r, e, t);
|
|
2587
|
+
return i != null && await this.#T(i) != null;
|
|
2413
2588
|
}
|
|
2414
2589
|
async saveWait(e, t) {
|
|
2415
2590
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2416
2591
|
if (n == null || r?.kind != "flow") return !1;
|
|
2417
|
-
let i =
|
|
2418
|
-
return i != null && await this.#
|
|
2592
|
+
let i = ke(n, r, e, t);
|
|
2593
|
+
return i != null && await this.#T(i) != null;
|
|
2419
2594
|
}
|
|
2420
2595
|
async setWaitNotification(e, t) {
|
|
2421
|
-
let n = this.$.revision.value, r = n == null ? void 0 :
|
|
2422
|
-
return r != null && await this.#
|
|
2596
|
+
let n = this.$.revision.value, r = n == null ? void 0 : Te(n, e, t, this.#i());
|
|
2597
|
+
return r != null && await this.#T(r) != null;
|
|
2423
2598
|
}
|
|
2424
2599
|
async saveComment(e, t) {
|
|
2425
2600
|
let n = this.#l.value.target;
|
|
2426
2601
|
if (n == null) return;
|
|
2427
|
-
let r = this.#
|
|
2428
|
-
r != null && await this.#
|
|
2602
|
+
let r = this.#N().nodes.find((t) => t.id == e)?.position;
|
|
2603
|
+
r != null && await this.#O((i) => I(i, n, e, {
|
|
2429
2604
|
...t,
|
|
2430
2605
|
position: r
|
|
2431
2606
|
}));
|
|
@@ -2433,185 +2608,248 @@ var Vt = class {
|
|
|
2433
2608
|
async saveTaskSettings(e, t) {
|
|
2434
2609
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2435
2610
|
if (n == null || r == null) return !1;
|
|
2436
|
-
let i =
|
|
2437
|
-
return i != null && await this.#
|
|
2611
|
+
let i = De(n, r, e, t);
|
|
2612
|
+
return i != null && await this.#T(i) != null;
|
|
2613
|
+
}
|
|
2614
|
+
async saveCodeActions(e, t) {
|
|
2615
|
+
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2616
|
+
if (n == null || r == null) return !1;
|
|
2617
|
+
let i = be(n.revision.content, r, e, t);
|
|
2618
|
+
return i == null || await this.#T(i) != null;
|
|
2438
2619
|
}
|
|
2439
2620
|
async saveCodeTaskPorts(e, t) {
|
|
2440
2621
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2441
2622
|
if (n == null || r == null) return !1;
|
|
2442
|
-
let i =
|
|
2443
|
-
return i != null && await this.#
|
|
2623
|
+
let i = re(n, r, e, t);
|
|
2624
|
+
return i != null && await this.#T(i) != null;
|
|
2444
2625
|
}
|
|
2445
2626
|
async saveTaskAdditionalInputs(e, t) {
|
|
2446
2627
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2447
2628
|
if (n == null || r == null) return !1;
|
|
2448
|
-
let i =
|
|
2449
|
-
return i != null && await this.#
|
|
2629
|
+
let i = Ae(n, r, e, t);
|
|
2630
|
+
return i != null && await this.#T(i) != null;
|
|
2450
2631
|
}
|
|
2451
2632
|
async setConnectorConnection(e, t) {
|
|
2452
2633
|
let n = this.$.revision.value;
|
|
2453
2634
|
if (n == null) return !1;
|
|
2454
|
-
let r =
|
|
2455
|
-
return r != null && await this.#
|
|
2456
|
-
}
|
|
2457
|
-
async saveTriggerSettings(e, t) {
|
|
2458
|
-
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2459
|
-
if (n == null || r?.kind != "flow") return !1;
|
|
2460
|
-
let i = re(n.revision.content, r, e, t);
|
|
2461
|
-
return i != null && await this.#b(i) != null;
|
|
2635
|
+
let r = g(n.revision.content, e, t);
|
|
2636
|
+
return r != null && await this.#T(r) != null;
|
|
2462
2637
|
}
|
|
2463
2638
|
async saveTriggerConfig(e, t, n) {
|
|
2464
2639
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2465
2640
|
if (r == null || i?.kind != "flow") return !1;
|
|
2466
|
-
let a =
|
|
2467
|
-
return a != null && await this.#
|
|
2641
|
+
let a = k(r.revision.content, i, e, t, n);
|
|
2642
|
+
return a != null && await this.#T(a) != null;
|
|
2468
2643
|
}
|
|
2469
2644
|
async saveTriggerSchedule(e, t) {
|
|
2470
2645
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2471
2646
|
if (n == null || r?.kind != "flow") return !1;
|
|
2472
|
-
let i =
|
|
2473
|
-
return i != null && await this.#
|
|
2647
|
+
let i = S(n.revision.content, r, e, t);
|
|
2648
|
+
return i != null && await this.#T(i) != null;
|
|
2474
2649
|
}
|
|
2475
2650
|
async saveWebhook(e, t) {
|
|
2476
2651
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2477
2652
|
if (n == null || r?.kind != "flow") return !1;
|
|
2478
|
-
let i =
|
|
2479
|
-
return i != null && await this.#
|
|
2653
|
+
let i = w(n, r, e, t);
|
|
2654
|
+
return i != null && await this.#T(i) != null;
|
|
2480
2655
|
}
|
|
2481
2656
|
async setTriggerConnection(e, t) {
|
|
2482
2657
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2483
2658
|
if (n == null || r?.kind != "flow") return !1;
|
|
2484
|
-
let i =
|
|
2485
|
-
return i != null && await this.#
|
|
2659
|
+
let i = O(n.revision.content, r, e, t);
|
|
2660
|
+
return i != null && await this.#T(i) != null;
|
|
2486
2661
|
}
|
|
2487
2662
|
async saveSubflowSettings(e, t) {
|
|
2488
2663
|
let n = this.$.revision.value;
|
|
2489
2664
|
if (n == null) return !1;
|
|
2490
|
-
let r =
|
|
2491
|
-
return r != null && await this.#
|
|
2665
|
+
let r = A(n, e, t);
|
|
2666
|
+
return r != null && await this.#T(r) != null;
|
|
2492
2667
|
}
|
|
2493
2668
|
updateModuleSource(e) {
|
|
2494
2669
|
let t = this.#l.value.moduleEditor;
|
|
2495
|
-
t
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2670
|
+
if (t == null || t.source == e) return;
|
|
2671
|
+
let n = this.#u.get(t.moduleId)?.base ?? this.#l.value.draft?.content.modules[t.moduleId];
|
|
2672
|
+
n != null && (this.#u.set(t.moduleId, {
|
|
2673
|
+
base: n,
|
|
2674
|
+
editor: {
|
|
2675
|
+
...t,
|
|
2676
|
+
phase: void 0,
|
|
2677
|
+
source: e
|
|
2678
|
+
}
|
|
2679
|
+
}), this.#R({}), clearTimeout(this.#d), this.#d = setTimeout(() => void this.#S(), 800));
|
|
2500
2680
|
}
|
|
2501
2681
|
discardModuleChanges() {
|
|
2502
2682
|
let e = this.#l.value.moduleEditor;
|
|
2503
|
-
if (e == null) return;
|
|
2683
|
+
if (e == null || this.#f != null) return;
|
|
2684
|
+
this.#u.delete(e.moduleId);
|
|
2504
2685
|
let t = this.#l.value.draft?.content.modules[e.moduleId];
|
|
2505
|
-
|
|
2506
|
-
this.#N({ moduleEditor: void 0 });
|
|
2507
|
-
return;
|
|
2508
|
-
}
|
|
2509
|
-
this.#N({ moduleEditor: {
|
|
2686
|
+
this.#R({ moduleEditor: t == null ? void 0 : {
|
|
2510
2687
|
moduleId: e.moduleId,
|
|
2511
2688
|
source: t.source
|
|
2512
2689
|
} });
|
|
2513
2690
|
}
|
|
2691
|
+
get hasUnsavedCode() {
|
|
2692
|
+
return this.#u.size > 0;
|
|
2693
|
+
}
|
|
2514
2694
|
async saveModuleEditor() {
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
if (
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
}
|
|
2695
|
+
if (this.#_) return !1;
|
|
2696
|
+
for (let e of this.#u.values()) e.editor.phase == "failed" && (e.editor = {
|
|
2697
|
+
...e.editor,
|
|
2698
|
+
phase: void 0
|
|
2699
|
+
});
|
|
2700
|
+
return this.#R({}), await this.#S();
|
|
2701
|
+
}
|
|
2702
|
+
#S() {
|
|
2703
|
+
if (clearTimeout(this.#d), this.#f != null) return this.#f;
|
|
2704
|
+
if (this.#_) return Promise.resolve(!1);
|
|
2705
|
+
if (![...this.#u.values()].some((e) => e.editor.phase != "failed")) return Promise.resolve(this.#u.size == 0);
|
|
2706
|
+
let e = this.#n.capture();
|
|
2707
|
+
return this.#f = this.#C(e).finally(() => {
|
|
2708
|
+
this.#f = void 0;
|
|
2709
|
+
}), this.#f;
|
|
2710
|
+
}
|
|
2711
|
+
async #C(e) {
|
|
2712
|
+
for (; !this.#_ && e();) {
|
|
2713
|
+
let t = [...this.#u.entries()].find(([, e]) => e.editor.phase != "failed");
|
|
2714
|
+
if (t == null) return this.#u.size == 0;
|
|
2715
|
+
let [n, r] = t, i = r.editor.source;
|
|
2716
|
+
r.editor = {
|
|
2717
|
+
...r.editor,
|
|
2718
|
+
phase: "saving"
|
|
2719
|
+
}, this.#R({});
|
|
2720
|
+
try {
|
|
2721
|
+
let t = await Tt(i);
|
|
2722
|
+
if (this.#_ || !e()) return !1;
|
|
2723
|
+
let a = this.#l.value.draft?.content.modules[n];
|
|
2724
|
+
if (a == null || a.source != r.base.source || JSON.stringify(a.imports) != JSON.stringify(r.base.imports)) throw Error(this.#r.t("notice.moduleUpdated"));
|
|
2725
|
+
let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#l.value.draft : await this.#T(Et(n, r.base.source, r.base.imports, i, t), !1);
|
|
2726
|
+
if (this.#_ || !e()) return !1;
|
|
2727
|
+
let s = this.#u.get(n);
|
|
2728
|
+
if (s == null) continue;
|
|
2729
|
+
o == null ? s.editor = {
|
|
2730
|
+
...s.editor,
|
|
2731
|
+
phase: "failed"
|
|
2732
|
+
} : s.editor.source == i ? (this.#u.delete(n), this.#l.value.moduleEditor?.moduleId == n && this.#R({ moduleEditor: {
|
|
2733
|
+
moduleId: n,
|
|
2734
|
+
source: i
|
|
2735
|
+
} })) : (s.base = {
|
|
2736
|
+
...r.base,
|
|
2737
|
+
source: i,
|
|
2738
|
+
imports: t
|
|
2739
|
+
}, s.editor = {
|
|
2740
|
+
...s.editor,
|
|
2741
|
+
phase: void 0
|
|
2742
|
+
});
|
|
2743
|
+
} catch (t) {
|
|
2744
|
+
if (this.#_ || !e()) return !1;
|
|
2745
|
+
let r = this.#u.get(n);
|
|
2746
|
+
r != null && (r.editor = {
|
|
2747
|
+
...r.editor,
|
|
2748
|
+
phase: "failed"
|
|
2749
|
+
}), this.#c(E(t, this.#r.t));
|
|
2750
|
+
}
|
|
2751
|
+
this.#R({});
|
|
2752
|
+
}
|
|
2753
|
+
return !1;
|
|
2530
2754
|
}
|
|
2531
2755
|
async moveNodes(e) {
|
|
2532
2756
|
let t = this.#l.value.target;
|
|
2533
|
-
t != null && await this.#
|
|
2757
|
+
t != null && await this.#O((n) => y(n, t, e));
|
|
2534
2758
|
}
|
|
2535
|
-
async moveViewport(e
|
|
2536
|
-
let
|
|
2537
|
-
|
|
2759
|
+
async moveViewport(e) {
|
|
2760
|
+
let t = this.#l.value.target;
|
|
2761
|
+
t != null && await this.#O((n) => v(n, t, e));
|
|
2538
2762
|
}
|
|
2539
2763
|
async check() {
|
|
2540
|
-
await this.#
|
|
2764
|
+
await this.#k();
|
|
2541
2765
|
}
|
|
2542
2766
|
async refreshFlows() {
|
|
2543
2767
|
await this.reloadFlows();
|
|
2544
2768
|
}
|
|
2545
2769
|
updateLive(e) {
|
|
2546
|
-
e.flowId == this.#l.value.flowId && this.#
|
|
2770
|
+
e.flowId == this.#l.value.flowId && this.#R({ live: e });
|
|
2547
2771
|
}
|
|
2548
2772
|
locateNode(e) {
|
|
2549
2773
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2550
|
-
return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#
|
|
2774
|
+
return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#R({ nodeFocus: {
|
|
2551
2775
|
nodeId: e,
|
|
2552
|
-
requestId: ++this.#
|
|
2776
|
+
requestId: ++this.#y
|
|
2553
2777
|
} }), !0);
|
|
2554
2778
|
}
|
|
2555
2779
|
locateDiagnostic(e) {
|
|
2556
|
-
return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#
|
|
2780
|
+
return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#R({ diagnosticFocus: {
|
|
2557
2781
|
...e.location,
|
|
2558
2782
|
diagnostic: e.diagnostic,
|
|
2559
|
-
requestId: ++this.#
|
|
2783
|
+
requestId: ++this.#m
|
|
2560
2784
|
} }), !0);
|
|
2561
2785
|
}
|
|
2562
|
-
async #
|
|
2563
|
-
let r = Math.max(0, ...this.#
|
|
2786
|
+
async #w(e, t, n) {
|
|
2787
|
+
let r = Math.max(0, ...this.#N().nodes.flatMap((e) => {
|
|
2564
2788
|
if (e.kind != "comment") return [];
|
|
2565
2789
|
let t = /#(\d+)$/.exec(e.title);
|
|
2566
2790
|
return t == null ? [] : [Number(t[1])];
|
|
2567
|
-
})), i = this.#
|
|
2791
|
+
})), i = this.#O((i) => I(i, e, t, {
|
|
2568
2792
|
content: "",
|
|
2569
2793
|
position: n,
|
|
2570
2794
|
title: this.#r.t("addNode.commentName", { number: r + 1 })
|
|
2571
2795
|
}));
|
|
2572
|
-
if (this.selectNodes([t]), await i, !this.#
|
|
2796
|
+
if (this.selectNodes([t]), await i, !this.#_) return t;
|
|
2573
2797
|
}
|
|
2574
|
-
async #
|
|
2798
|
+
async #T(e, t = !0) {
|
|
2575
2799
|
let n = this.#l.value.flowId, r = this.#l.value.draft;
|
|
2576
2800
|
if (n != null && r != null) return e.length == 0 ? r : await this.#t.change({
|
|
2577
2801
|
current: this.#n.capture(),
|
|
2578
2802
|
flowId: n
|
|
2579
2803
|
}, r, e, t);
|
|
2580
2804
|
}
|
|
2581
|
-
#
|
|
2582
|
-
let
|
|
2583
|
-
|
|
2805
|
+
async #E(e) {
|
|
2806
|
+
for (let t = 0; t < 2 && e(); t += 1) {
|
|
2807
|
+
let t = this.#l.value.draft;
|
|
2808
|
+
if (t == null) return;
|
|
2809
|
+
let n = _(t.content);
|
|
2810
|
+
if (n.length == 0) {
|
|
2811
|
+
this.#k();
|
|
2812
|
+
return;
|
|
2813
|
+
}
|
|
2814
|
+
if (await this.#T(n, !1) != null || !e()) return;
|
|
2815
|
+
if (this.#l.value.draft?.revisionId == t.revisionId) break;
|
|
2816
|
+
}
|
|
2817
|
+
e() && this.#k();
|
|
2818
|
+
}
|
|
2819
|
+
#D(e, t = !1) {
|
|
2820
|
+
let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#P(e), o = this.#l.value.moduleEditor;
|
|
2821
|
+
return this.#R({
|
|
2584
2822
|
diagnostics: t ? this.#l.value.diagnostics : void 0,
|
|
2585
2823
|
draft: e,
|
|
2586
|
-
moduleEditor: o != null && n != null &&
|
|
2824
|
+
moduleEditor: o != null && n != null && $(n, o) != "saved" ? o : rn(r, a, i),
|
|
2587
2825
|
selectedNodeIds: i,
|
|
2588
2826
|
target: a
|
|
2589
2827
|
}), r;
|
|
2590
2828
|
}
|
|
2591
|
-
async #
|
|
2592
|
-
if (this.#
|
|
2829
|
+
async #O(e) {
|
|
2830
|
+
if (this.#_) return;
|
|
2593
2831
|
let t = this.#l.value.flowId, n = this.#l.value.presentation;
|
|
2594
|
-
t != null && n != null && await this.#a.change(t, n, this.#
|
|
2832
|
+
t != null && n != null && await this.#a.change(t, n, this.#n.capture(), e);
|
|
2595
2833
|
}
|
|
2596
|
-
async #
|
|
2597
|
-
if (this.#
|
|
2834
|
+
async #k() {
|
|
2835
|
+
if (this.#_) return;
|
|
2598
2836
|
let e = this.#l.value.flowId, t = this.#l.value.draft, n = this.#l.value.target;
|
|
2599
2837
|
if (e == null || t == null || n == null) {
|
|
2600
|
-
n ?? this.#
|
|
2838
|
+
n ?? this.#R({
|
|
2601
2839
|
checkLoading: !1,
|
|
2602
2840
|
diagnostics: void 0
|
|
2603
2841
|
});
|
|
2604
2842
|
return;
|
|
2605
2843
|
}
|
|
2606
|
-
this.#
|
|
2844
|
+
this.#R({
|
|
2607
2845
|
checkLoading: !0,
|
|
2608
2846
|
diagnosticFocus: void 0
|
|
2609
2847
|
});
|
|
2610
2848
|
try {
|
|
2611
2849
|
let n = await this.#e.checkFlow(e, t.revisionId);
|
|
2612
|
-
if (!this.#
|
|
2850
|
+
if (!this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId) {
|
|
2613
2851
|
let e = this.#l.value.live;
|
|
2614
|
-
this.#
|
|
2852
|
+
this.#R({
|
|
2615
2853
|
diagnostics: n,
|
|
2616
2854
|
live: e == null ? void 0 : {
|
|
2617
2855
|
...e,
|
|
@@ -2620,16 +2858,16 @@ var Vt = class {
|
|
|
2620
2858
|
});
|
|
2621
2859
|
}
|
|
2622
2860
|
} catch (n) {
|
|
2623
|
-
!this.#
|
|
2861
|
+
!this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(E(n, this.#r.t));
|
|
2624
2862
|
} finally {
|
|
2625
|
-
!this.#
|
|
2863
|
+
!this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#R({ checkLoading: !1 });
|
|
2626
2864
|
}
|
|
2627
2865
|
}
|
|
2628
|
-
async #
|
|
2629
|
-
if (this.#
|
|
2866
|
+
async #A(e) {
|
|
2867
|
+
if (this.#_) return;
|
|
2630
2868
|
let t = this.#l.value.flowId;
|
|
2631
|
-
if (t == null || (this.#
|
|
2632
|
-
this.#
|
|
2869
|
+
if (t == null || (this.#h += 1, e != null && (this.#g = !0), this.#v)) return;
|
|
2870
|
+
this.#v = !0;
|
|
2633
2871
|
let n = {
|
|
2634
2872
|
current: this.#n.capture(),
|
|
2635
2873
|
flowId: t
|
|
@@ -2637,84 +2875,83 @@ var Vt = class {
|
|
|
2637
2875
|
await this.#t.enqueue(async () => {
|
|
2638
2876
|
let e;
|
|
2639
2877
|
do {
|
|
2640
|
-
e = this.#
|
|
2641
|
-
let t = this.#
|
|
2642
|
-
this.#
|
|
2643
|
-
} while (this.#
|
|
2644
|
-
}), this.#
|
|
2878
|
+
e = this.#h;
|
|
2879
|
+
let t = this.#g;
|
|
2880
|
+
this.#g = !1, await this.#j(n, !1, t);
|
|
2881
|
+
} while (this.#L(n) && e != this.#h);
|
|
2882
|
+
}), this.#L(n) && (this.#v = !1);
|
|
2645
2883
|
}
|
|
2646
|
-
async #
|
|
2884
|
+
async #j(e, t, n = !1) {
|
|
2647
2885
|
try {
|
|
2648
2886
|
let t = this.#t.committed;
|
|
2649
2887
|
if (t == null) return !1;
|
|
2650
2888
|
let r = await this.#e.syncDraft(e.flowId);
|
|
2651
|
-
if (!this.#
|
|
2889
|
+
if (!this.#L(e)) return !1;
|
|
2652
2890
|
let i = r.draft;
|
|
2653
2891
|
if (i.revisionId == t.revisionId) return !0;
|
|
2654
|
-
let a = this.#
|
|
2655
|
-
return this.#
|
|
2892
|
+
let a = this.#F(i, !1);
|
|
2893
|
+
return this.#M(e.flowId, i.revisionId), n && this.#c({
|
|
2656
2894
|
kind: a ? "error" : "success",
|
|
2657
2895
|
message: this.#r.t(a ? "notice.moduleUpdated" : "notice.draftUpdated")
|
|
2658
|
-
}), this.#
|
|
2896
|
+
}), this.#k(), !0;
|
|
2659
2897
|
} catch (n) {
|
|
2660
|
-
return t && this.#
|
|
2898
|
+
return t && this.#L(e) && this.#c(E(n, this.#r.t)), !1;
|
|
2661
2899
|
}
|
|
2662
2900
|
}
|
|
2663
|
-
#
|
|
2901
|
+
#M(e, t) {
|
|
2664
2902
|
this.#o.advanceHead(e, t);
|
|
2665
2903
|
}
|
|
2666
|
-
#
|
|
2904
|
+
#N() {
|
|
2667
2905
|
let e = this.#l.value;
|
|
2668
|
-
return
|
|
2906
|
+
return b(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
|
|
2669
2907
|
}
|
|
2670
|
-
#
|
|
2671
|
-
let e = this.#l.value.
|
|
2672
|
-
return e == null || Q(this.#l.value.draft, e) == "saved" || (this.#c({
|
|
2673
|
-
kind: "error",
|
|
2674
|
-
message: this.#r.t("notice.unsavedCode")
|
|
2675
|
-
}), !1);
|
|
2676
|
-
}
|
|
2677
|
-
#k(e) {
|
|
2678
|
-
let t = I(e), n = zt(t, this.#l.value.target);
|
|
2908
|
+
#P(e) {
|
|
2909
|
+
let t = C(e), n = on(t, this.#l.value.target);
|
|
2679
2910
|
return {
|
|
2680
2911
|
revision: t,
|
|
2681
2912
|
selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
|
|
2682
2913
|
target: n
|
|
2683
2914
|
};
|
|
2684
2915
|
}
|
|
2685
|
-
#
|
|
2686
|
-
let n = this.#t.replaceCommitted(e), r = this.#l.value.moduleEditor, i = r != null &&
|
|
2687
|
-
return this.#
|
|
2916
|
+
#F(e, t) {
|
|
2917
|
+
let n = this.#t.replaceCommitted(e), r = this.#l.value.moduleEditor, i = r != null && $(this.#l.value.draft, r) != "saved", a = this.#P(n), o = a.target;
|
|
2918
|
+
return this.#R({
|
|
2688
2919
|
diagnostics: t ? this.#l.value.diagnostics : void 0,
|
|
2689
2920
|
draft: n,
|
|
2690
|
-
moduleEditor: this.#
|
|
2921
|
+
moduleEditor: this.#I(a.revision, o, a.selectedNodeIds),
|
|
2691
2922
|
selectedNodeIds: a.selectedNodeIds,
|
|
2692
2923
|
target: o
|
|
2693
2924
|
}), i;
|
|
2694
2925
|
}
|
|
2695
|
-
#
|
|
2926
|
+
#I(e, t, n) {
|
|
2696
2927
|
let r = this.#l.value.moduleEditor;
|
|
2697
|
-
return r == null ||
|
|
2928
|
+
return r == null || $(this.#l.value.draft, r) == "saved" ? rn(e, t, n) : {
|
|
2698
2929
|
...r,
|
|
2699
2930
|
phase: "failed"
|
|
2700
2931
|
};
|
|
2701
2932
|
}
|
|
2702
|
-
#
|
|
2703
|
-
return !this.#
|
|
2933
|
+
#L(e) {
|
|
2934
|
+
return !this.#_ && e.flowId == this.#l.value.flowId && e.current();
|
|
2704
2935
|
}
|
|
2705
|
-
#
|
|
2706
|
-
|
|
2936
|
+
#R(e) {
|
|
2937
|
+
if (this.#_) return;
|
|
2938
|
+
let t = Object.hasOwn(e, "moduleEditor") ? e.moduleEditor : this.#l.value.moduleEditor, n = t == null ? void 0 : this.#u.get(t.moduleId)?.editor ?? t, r = [...this.#u.values()].some((e) => e.editor.phase == "failed") ? "failed" : this.#u.size > 0 ? "saving" : void 0;
|
|
2939
|
+
this.#l.set({
|
|
2940
|
+
...e,
|
|
2941
|
+
moduleEditor: n,
|
|
2942
|
+
moduleSaveStatus: r
|
|
2943
|
+
});
|
|
2707
2944
|
}
|
|
2708
2945
|
};
|
|
2709
2946
|
//#endregion
|
|
2710
2947
|
//#region src/workbench/browser/runtime/stores/workbenchStore.ts
|
|
2711
|
-
function
|
|
2948
|
+
function cn(e) {
|
|
2712
2949
|
return new Map(e.nodes.map((e) => [e.id, e]));
|
|
2713
2950
|
}
|
|
2714
|
-
function
|
|
2715
|
-
return e == null || t == null ? [] :
|
|
2951
|
+
function ln(e, t) {
|
|
2952
|
+
return e == null || t == null ? [] : C(e).designerInputs(t);
|
|
2716
2953
|
}
|
|
2717
|
-
function
|
|
2954
|
+
function un(e, t, n, r, i) {
|
|
2718
2955
|
if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
|
|
2719
2956
|
let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
|
|
2720
2957
|
return typeof a == "string" ? new Map(r.flatMap((t) => {
|
|
@@ -2722,7 +2959,7 @@ function Wt(e, t, n, r, i) {
|
|
|
2722
2959
|
return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
|
|
2723
2960
|
})) : /* @__PURE__ */ new Map();
|
|
2724
2961
|
}
|
|
2725
|
-
var
|
|
2962
|
+
var dn = { openExternalPage: async () => !1 }, fn = class {
|
|
2726
2963
|
#e;
|
|
2727
2964
|
#t;
|
|
2728
2965
|
#n;
|
|
@@ -2733,16 +2970,22 @@ var Gt = { openExternalPage: async () => !1 }, Kt = class {
|
|
|
2733
2970
|
#s;
|
|
2734
2971
|
#c;
|
|
2735
2972
|
#l;
|
|
2736
|
-
|
|
2737
|
-
|
|
2973
|
+
#u;
|
|
2974
|
+
constructor(r, i, a = F, o = P(), s = dn, c = !0) {
|
|
2975
|
+
this.#t = new m(), this.#r = t(), this.#a = t([]), this.#o = t(!1), this.#s = t(!1), this.#c = !0, this.#u = !1, this.provideAddNodeOptions = async (e, t) => await this.#d([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => {
|
|
2976
|
+
let t = await Promise.all([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)]);
|
|
2977
|
+
if (!(e.aborted || this.#u)) return t.flatMap((e) => e ?? []);
|
|
2978
|
+
}, this.provideAddNodeOptionChoices = async (e, t) => {
|
|
2738
2979
|
if (!e.startsWith("trigger:")) return await this.connectors.provideAddNodeOptionChoices(e, t);
|
|
2739
2980
|
}, this.#e = r, this.#n = o, this.#i = c;
|
|
2740
2981
|
let l = (e) => {
|
|
2741
|
-
this.#
|
|
2982
|
+
this.#u || this.#r.set(e);
|
|
2742
2983
|
};
|
|
2743
|
-
this.runs = new
|
|
2744
|
-
e.kind == "run.created" ? this.#
|
|
2745
|
-
}), this.connectors = new
|
|
2984
|
+
this.runs = new h(r, l, o), this.workspace = new sn(r, l, Dt, o, (e) => {
|
|
2985
|
+
e.kind == "run.created" ? this.#f(r, e) : this.runs.changed(e.runId);
|
|
2986
|
+
}), this.connectors = new Ut(r, this.workspace, l, s, o), this.triggers = new Jt(r, this.workspace, l, s, o), this.publications = new jt(r, this.workspace, l, i, a, o), this.runRequests = new It(r, this.runs, l, async (e) => {
|
|
2987
|
+
if (!(e != this.workspace.$.flowId.value || !await this.workspace.saveModuleEditor() || this.#u || e != this.workspace.$.flowId.value)) return this.workspace.$.draft.value?.revisionId;
|
|
2988
|
+
}, o, a);
|
|
2746
2989
|
let u = n((e) => {
|
|
2747
2990
|
let t = e(this.workspace.$.diagnostics);
|
|
2748
2991
|
if (t == null) return;
|
|
@@ -2756,8 +2999,8 @@ var Gt = { openExternalPage: async () => !1 }, Kt = class {
|
|
|
2756
2999
|
let t = e(this.workspace.$.draft);
|
|
2757
3000
|
f != t?.flowId && (d.clear(), f = t?.flowId);
|
|
2758
3001
|
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(u)?.diagnostics ?? e(this.connectors.$.diagnostics), a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), l = e(this.runs.$.run), p = e(this.runs.$.events), m = e(this.#a), h = e(this.#o), g = e(this.#s), _ = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, v = [
|
|
2759
|
-
...
|
|
2760
|
-
r == null || n == null ? void 0 :
|
|
3002
|
+
...ln(t, n),
|
|
3003
|
+
r == null || n == null ? void 0 : x(r, n),
|
|
2761
3004
|
i,
|
|
2762
3005
|
a,
|
|
2763
3006
|
s,
|
|
@@ -2770,12 +3013,12 @@ var Gt = { openExternalPage: async () => !1 }, Kt = class {
|
|
|
2770
3013
|
...l == null ? [] : [t?.revisionId]
|
|
2771
3014
|
], y = d.get(_);
|
|
2772
3015
|
if (y != null && y.inputs.length == v.length && y.inputs.every((e, t) => e === v[t])) return y.graph;
|
|
2773
|
-
let
|
|
3016
|
+
let S = b(t, n, r, i, a, s, c, l, p, m, h, g, this.#i);
|
|
2774
3017
|
return d.set(_, {
|
|
2775
|
-
graph:
|
|
3018
|
+
graph: S,
|
|
2776
3019
|
inputs: v
|
|
2777
|
-
}),
|
|
2778
|
-
}),
|
|
3020
|
+
}), S;
|
|
3021
|
+
}), g = e(p, cn);
|
|
2779
3022
|
this.$ = {
|
|
2780
3023
|
busy: n((e) => {
|
|
2781
3024
|
let t = e(this.workspace.$.busy);
|
|
@@ -2786,15 +3029,15 @@ var Gt = { openExternalPage: async () => !1 }, Kt = class {
|
|
|
2786
3029
|
if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
|
|
2787
3030
|
if (e(this.publications.$.changingTriggerId) != null) return "trigger";
|
|
2788
3031
|
}),
|
|
2789
|
-
diagnosticItems: n((e) =>
|
|
3032
|
+
diagnosticItems: n((e) => D(e(this.workspace.$.revision), e(this.workspace.$.target), e(u))),
|
|
2790
3033
|
diagnostics: u,
|
|
2791
3034
|
designer: p,
|
|
2792
|
-
designerNodeById:
|
|
3035
|
+
designerNodeById: g,
|
|
2793
3036
|
notice: this.#r,
|
|
2794
|
-
runEventNodes: n((e) =>
|
|
3037
|
+
runEventNodes: n((e) => un(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(g))),
|
|
2795
3038
|
selectedDesignerNode: n((e) => {
|
|
2796
3039
|
let t = e(this.workspace.$.selectedNodeIds);
|
|
2797
|
-
return t.length == 1 ? e(
|
|
3040
|
+
return t.length == 1 ? e(g).get(t[0]) : void 0;
|
|
2798
3041
|
}),
|
|
2799
3042
|
variableNames: this.#a,
|
|
2800
3043
|
variableNamesLoaded: this.#o,
|
|
@@ -2802,7 +3045,7 @@ var Gt = { openExternalPage: async () => !1 }, Kt = class {
|
|
|
2802
3045
|
};
|
|
2803
3046
|
}
|
|
2804
3047
|
dispose() {
|
|
2805
|
-
this.#
|
|
3048
|
+
this.#u = !0, this.#t.invalidate();
|
|
2806
3049
|
for (let e of Object.values(this.$)) e.dispose();
|
|
2807
3050
|
this.connectors.dispose(), this.publications.dispose(), this.runRequests.dispose(), this.runs.dispose(), this.triggers.dispose(), this.workspace.dispose(), this.#a.dispose(), this.#o.dispose(), this.#s.dispose();
|
|
2808
3051
|
}
|
|
@@ -2813,28 +3056,33 @@ var Gt = { openExternalPage: async () => !1 }, Kt = class {
|
|
|
2813
3056
|
await this.workspace.reloadFlows();
|
|
2814
3057
|
}
|
|
2815
3058
|
dismissNotice() {
|
|
2816
|
-
this.#
|
|
3059
|
+
this.#u || this.#r.set(void 0);
|
|
3060
|
+
}
|
|
3061
|
+
invalidateVariableNames() {
|
|
3062
|
+
this.#c = !0;
|
|
2817
3063
|
}
|
|
2818
3064
|
async refreshVariableNames() {
|
|
2819
|
-
if (this.#
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
3065
|
+
if (!(this.#u || !this.#i)) {
|
|
3066
|
+
if (this.#l != null) return this.#l;
|
|
3067
|
+
if (this.#c) return this.#c = !1, this.#s.set(!0), this.#l = (async () => {
|
|
3068
|
+
try {
|
|
3069
|
+
let { variables: e } = await this.#e.listVariables();
|
|
3070
|
+
if (this.#u) return;
|
|
3071
|
+
this.#a.set(e.map((e) => e.name)), this.#o.set(!0);
|
|
3072
|
+
} catch (e) {
|
|
3073
|
+
this.#c = !0, this.#u || this.#r.set(E(e, this.#n.t));
|
|
3074
|
+
} finally {
|
|
3075
|
+
this.#l = void 0, this.#u || this.#s.set(!1);
|
|
3076
|
+
}
|
|
3077
|
+
})(), this.#l;
|
|
2830
3078
|
}
|
|
2831
3079
|
}
|
|
2832
3080
|
async selectFlow(e) {
|
|
2833
|
-
return this.#
|
|
3081
|
+
return this.#u || (this.#t.invalidate(), this.#r.set(void 0), !await this.workspace.selectFlow(e)) ? !1 : (this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), !0);
|
|
2834
3082
|
}
|
|
2835
3083
|
async createFlow(e, t) {
|
|
2836
3084
|
let n = await this.workspace.createFlow(e, t);
|
|
2837
|
-
return this.#
|
|
3085
|
+
return this.#u || n == null ? !1 : (await this.selectFlow(n.flowId), this.#u || this.#r.set({
|
|
2838
3086
|
kind: "success",
|
|
2839
3087
|
message: this.#n.t("notice.created", { name: n.name })
|
|
2840
3088
|
}), !0);
|
|
@@ -2862,43 +3110,45 @@ var Gt = { openExternalPage: async () => !1 }, Kt = class {
|
|
|
2862
3110
|
let r = await this.workspace.addNode(e, t, n);
|
|
2863
3111
|
return r != null && e.kind == "connector" && this.connectors.refresh(), r != null && e.kind == "trigger" && this.triggers.refresh(), r;
|
|
2864
3112
|
}
|
|
2865
|
-
async #
|
|
3113
|
+
async #d(e, t) {
|
|
2866
3114
|
let n = await Promise.allSettled(e);
|
|
2867
|
-
if (t.aborted || this.#
|
|
3115
|
+
if (t.aborted || this.#u) return;
|
|
2868
3116
|
let r = n.filter((e) => e.status == "rejected");
|
|
2869
3117
|
if (r.length > 0 && r.length == n.length) throw r[0].reason;
|
|
2870
|
-
return r.length > 0 && this.#r.set(
|
|
3118
|
+
return r.length > 0 && this.#r.set(E(r[0].reason, this.#n.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
|
|
2871
3119
|
}
|
|
2872
3120
|
async refreshSelectedConnector(e = !1) {
|
|
2873
3121
|
await this.connectors.refresh(e);
|
|
2874
3122
|
}
|
|
2875
|
-
async requestDraftRun() {
|
|
2876
|
-
let
|
|
2877
|
-
|
|
3123
|
+
async requestDraftRun(e) {
|
|
3124
|
+
let t = this.workspace.$.flowId.value;
|
|
3125
|
+
if (!await this.workspace.saveModuleEditor() || this.#u || t != this.workspace.$.flowId.value) return "unavailable";
|
|
3126
|
+
let n = this.workspace.$.targetFlow.value, r = this.workspace.$.draft.value;
|
|
3127
|
+
return n == null || r == null ? "unavailable" : await this.runRequests.requestDraft(n, r, e);
|
|
2878
3128
|
}
|
|
2879
3129
|
async requestLiveRun() {
|
|
2880
3130
|
let e = this.workspace.$.targetFlow.value;
|
|
2881
3131
|
return e == null ? "unavailable" : await this.runRequests.requestLive(e);
|
|
2882
3132
|
}
|
|
2883
|
-
async #
|
|
3133
|
+
async #f(e, t) {
|
|
2884
3134
|
let n = this.workspace.$.target.value;
|
|
2885
|
-
if (this.#
|
|
3135
|
+
if (this.#u || this.runRequests.$.submitting.value != null || n?.kind != "flow" || this.workspace.$.flowId.value != t.flowId) return;
|
|
2886
3136
|
let r = this.#t.begin();
|
|
2887
3137
|
try {
|
|
2888
3138
|
let n = await e.getRun(t.runId), i = this.workspace.$.target.value;
|
|
2889
|
-
if (!r() || this.#
|
|
3139
|
+
if (!r() || this.#u || i?.kind != "flow" || this.workspace.$.flowId.value != t.flowId || n.flowId != t.flowId || n.runId != t.runId) return;
|
|
2890
3140
|
this.runs.followExternal(n);
|
|
2891
3141
|
} catch {
|
|
2892
3142
|
return;
|
|
2893
3143
|
}
|
|
2894
3144
|
}
|
|
2895
|
-
},
|
|
2896
|
-
function
|
|
2897
|
-
let
|
|
2898
|
-
/* @__PURE__ */
|
|
3145
|
+
}, pn = ot(() => import("./flowWorkspace-Dp_b8KXF.js").then((e) => e.t));
|
|
3146
|
+
function mn({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: s, tokenLabel: c }) {
|
|
3147
|
+
let l = s != null && c != null && i != null, u = s ?? "", d = /* @__PURE__ */ J(st, { children: [
|
|
3148
|
+
/* @__PURE__ */ q("div", {
|
|
2899
3149
|
"aria-hidden": "true",
|
|
2900
3150
|
className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
|
|
2901
|
-
children: /* @__PURE__ */
|
|
3151
|
+
children: /* @__PURE__ */ J("svg", {
|
|
2902
3152
|
className: "size-5",
|
|
2903
3153
|
fill: "none",
|
|
2904
3154
|
stroke: "currentColor",
|
|
@@ -2906,40 +3156,40 @@ function Jt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
2906
3156
|
strokeLinejoin: "round",
|
|
2907
3157
|
strokeWidth: "1.8",
|
|
2908
3158
|
viewBox: "0 0 24 24",
|
|
2909
|
-
children: [/* @__PURE__ */
|
|
3159
|
+
children: [/* @__PURE__ */ q("rect", {
|
|
2910
3160
|
height: "9",
|
|
2911
3161
|
rx: "2",
|
|
2912
3162
|
width: "14",
|
|
2913
3163
|
x: "5",
|
|
2914
3164
|
y: "11"
|
|
2915
|
-
}), /* @__PURE__ */
|
|
3165
|
+
}), /* @__PURE__ */ q("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
|
|
2916
3166
|
})
|
|
2917
3167
|
}),
|
|
2918
|
-
/* @__PURE__ */
|
|
3168
|
+
/* @__PURE__ */ J("header", {
|
|
2919
3169
|
className: "flex flex-col gap-2",
|
|
2920
|
-
children: [/* @__PURE__ */
|
|
3170
|
+
children: [/* @__PURE__ */ q("h1", {
|
|
2921
3171
|
className: "text-xl font-semibold tracking-tight text-balance",
|
|
2922
3172
|
children: o
|
|
2923
|
-
}), /* @__PURE__ */
|
|
3173
|
+
}), /* @__PURE__ */ q("p", {
|
|
2924
3174
|
className: "text-sm/relaxed text-muted-foreground text-pretty",
|
|
2925
3175
|
children: t
|
|
2926
3176
|
})]
|
|
2927
3177
|
}),
|
|
2928
|
-
|
|
3178
|
+
l && /* @__PURE__ */ q(Fe, { children: /* @__PURE__ */ J(Ve, {
|
|
2929
3179
|
"data-invalid": n != null,
|
|
2930
3180
|
children: [
|
|
2931
|
-
/* @__PURE__ */
|
|
3181
|
+
/* @__PURE__ */ q(Pe, {
|
|
2932
3182
|
htmlFor: "session-token",
|
|
2933
|
-
children:
|
|
3183
|
+
children: c
|
|
2934
3184
|
}),
|
|
2935
|
-
/* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ q(V, {
|
|
2936
3186
|
autoComplete: "username",
|
|
2937
3187
|
name: "username",
|
|
2938
3188
|
type: "hidden",
|
|
2939
3189
|
value: "open-flow",
|
|
2940
3190
|
readOnly: !0
|
|
2941
3191
|
}),
|
|
2942
|
-
/* @__PURE__ */
|
|
3192
|
+
/* @__PURE__ */ q(V, {
|
|
2943
3193
|
autoComplete: "current-password",
|
|
2944
3194
|
"aria-invalid": n != null,
|
|
2945
3195
|
autoFocus: !0,
|
|
@@ -2949,48 +3199,48 @@ function Jt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
2949
3199
|
onChange: (e) => i?.(e.target.value),
|
|
2950
3200
|
spellCheck: !1,
|
|
2951
3201
|
type: "password",
|
|
2952
|
-
value:
|
|
3202
|
+
value: u
|
|
2953
3203
|
}),
|
|
2954
|
-
n != null && /* @__PURE__ */
|
|
3204
|
+
n != null && /* @__PURE__ */ q(Be, { children: n })
|
|
2955
3205
|
]
|
|
2956
3206
|
}) }),
|
|
2957
|
-
e != null && r != null && /* @__PURE__ */
|
|
2958
|
-
disabled: a ||
|
|
3207
|
+
e != null && r != null && /* @__PURE__ */ J(B, {
|
|
3208
|
+
disabled: a || l && u.length == 0,
|
|
2959
3209
|
size: "lg",
|
|
2960
3210
|
type: "submit",
|
|
2961
|
-
children: [a && /* @__PURE__ */
|
|
3211
|
+
children: [a && /* @__PURE__ */ q(Ie, {
|
|
2962
3212
|
"aria-label": e,
|
|
2963
3213
|
"data-icon": "inline-start"
|
|
2964
3214
|
}), e]
|
|
2965
3215
|
}),
|
|
2966
|
-
a && e == null && /* @__PURE__ */
|
|
2967
|
-
] }),
|
|
2968
|
-
return /* @__PURE__ */
|
|
3216
|
+
a && e == null && /* @__PURE__ */ q(Ie, { "aria-label": t })
|
|
3217
|
+
] }), f = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
|
|
3218
|
+
return /* @__PURE__ */ q("main", {
|
|
2969
3219
|
className: "open-flow-workbench",
|
|
2970
|
-
children: /* @__PURE__ */
|
|
3220
|
+
children: /* @__PURE__ */ q("div", {
|
|
2971
3221
|
className: "grid h-full overflow-auto bg-muted/20 p-4",
|
|
2972
|
-
children: r == null ? /* @__PURE__ */
|
|
3222
|
+
children: r == null ? /* @__PURE__ */ q("section", {
|
|
2973
3223
|
"aria-busy": a,
|
|
2974
|
-
className:
|
|
2975
|
-
children:
|
|
2976
|
-
}) : /* @__PURE__ */
|
|
3224
|
+
className: f,
|
|
3225
|
+
children: d
|
|
3226
|
+
}) : /* @__PURE__ */ q("form", {
|
|
2977
3227
|
"aria-busy": a,
|
|
2978
|
-
className:
|
|
3228
|
+
className: f,
|
|
2979
3229
|
onSubmit: r,
|
|
2980
|
-
children:
|
|
3230
|
+
children: d
|
|
2981
3231
|
})
|
|
2982
3232
|
})
|
|
2983
3233
|
});
|
|
2984
3234
|
}
|
|
2985
|
-
function
|
|
3235
|
+
function hn({ host: e, store: t }) {
|
|
2986
3236
|
let n = a(t.$.notice);
|
|
2987
|
-
return
|
|
3237
|
+
return W(() => e.notify(n), [e, n]), W(() => () => e.notify(void 0), [e]), null;
|
|
2988
3238
|
}
|
|
2989
|
-
function
|
|
3239
|
+
function gn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, hrefFor: o, hostAction: s, hostTitle: c, language: l, navigation: u, onConfigureConnector: d, onHostAction: f, onLanguageChange: p, store: m, theme: h }) {
|
|
2990
3240
|
let g = a(m.workspace.$.flowId);
|
|
2991
|
-
return /* @__PURE__ */
|
|
3241
|
+
return /* @__PURE__ */ q("div", {
|
|
2992
3242
|
className: "app-shell",
|
|
2993
|
-
children: g == null ? /* @__PURE__ */
|
|
3243
|
+
children: g == null ? /* @__PURE__ */ q(vt, {
|
|
2994
3244
|
catalogWidth: e,
|
|
2995
3245
|
createFlowDisabled: n,
|
|
2996
3246
|
createFlowField: r,
|
|
@@ -3007,12 +3257,12 @@ function Xt({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3007
3257
|
onLanguageChange: p,
|
|
3008
3258
|
onSelectFlow: (e) => void u.selectFlow(e),
|
|
3009
3259
|
store: m
|
|
3010
|
-
}) : /* @__PURE__ */
|
|
3011
|
-
fallback: /* @__PURE__ */
|
|
3260
|
+
}) : /* @__PURE__ */ q(at, {
|
|
3261
|
+
fallback: /* @__PURE__ */ q("main", {
|
|
3012
3262
|
"aria-busy": "true",
|
|
3013
3263
|
className: "workspace"
|
|
3014
3264
|
}),
|
|
3015
|
-
children: /* @__PURE__ */
|
|
3265
|
+
children: /* @__PURE__ */ q(pn, {
|
|
3016
3266
|
hostAction: s,
|
|
3017
3267
|
hostTitle: c,
|
|
3018
3268
|
hrefFor: o,
|
|
@@ -3025,21 +3275,21 @@ function Xt({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3025
3275
|
})
|
|
3026
3276
|
});
|
|
3027
3277
|
}
|
|
3028
|
-
function
|
|
3029
|
-
let y =
|
|
3278
|
+
function _n({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, host: a, hostAction: s, hostTitle: c, hrefFor: l, language: u, location: d, onConfigureConnector: f, onHostAction: p, onLanguageChange: m, onNavigate: h, preferences: g, theme: _, variables: v = !0 }) {
|
|
3279
|
+
let y = G(h);
|
|
3030
3280
|
y.current = h;
|
|
3031
|
-
let [{ i18n: b, navigation: x, store: S }] =
|
|
3032
|
-
let e =
|
|
3281
|
+
let [{ i18n: b, navigation: x, store: S }] = K(() => {
|
|
3282
|
+
let e = P(u), t = new fn(new ye((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), g, F, e, a, v);
|
|
3033
3283
|
return {
|
|
3034
3284
|
i18n: e,
|
|
3035
|
-
navigation: new
|
|
3285
|
+
navigation: new dt(t, d, (e, t) => y.current(e, t)),
|
|
3036
3286
|
store: t
|
|
3037
3287
|
};
|
|
3038
3288
|
});
|
|
3039
|
-
return
|
|
3289
|
+
return W(() => {
|
|
3040
3290
|
x.start();
|
|
3041
3291
|
let e = () => {
|
|
3042
|
-
S.connectors.refreshAfterAuthorization(), S.triggers.refreshAfterAuthorization(), S.
|
|
3292
|
+
S.connectors.refreshAfterAuthorization(), S.triggers.refreshAfterAuthorization(), S.invalidateVariableNames();
|
|
3043
3293
|
};
|
|
3044
3294
|
return globalThis.addEventListener("focus", e), () => {
|
|
3045
3295
|
globalThis.removeEventListener("focus", e), x.dispose(), S.dispose(), b.dispose();
|
|
@@ -3048,17 +3298,17 @@ function Zt({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3048
3298
|
b,
|
|
3049
3299
|
x,
|
|
3050
3300
|
S
|
|
3051
|
-
]),
|
|
3301
|
+
]), W(() => void x.apply(d), [d, x]), W(() => {
|
|
3052
3302
|
b.lang != u && b.switchLang(u);
|
|
3053
|
-
}, [b, u]), /* @__PURE__ */
|
|
3303
|
+
}, [b, u]), /* @__PURE__ */ q(o, {
|
|
3054
3304
|
i18n: b,
|
|
3055
|
-
children: /* @__PURE__ */
|
|
3305
|
+
children: /* @__PURE__ */ J("div", {
|
|
3056
3306
|
className: "open-flow-theme open-flow-workbench",
|
|
3057
3307
|
"data-theme": _,
|
|
3058
|
-
children: [/* @__PURE__ */
|
|
3308
|
+
children: [/* @__PURE__ */ q(hn, {
|
|
3059
3309
|
host: a,
|
|
3060
3310
|
store: S
|
|
3061
|
-
}), /* @__PURE__ */
|
|
3311
|
+
}), /* @__PURE__ */ q(gn, {
|
|
3062
3312
|
catalogWidth: e,
|
|
3063
3313
|
createFlow: t,
|
|
3064
3314
|
createFlowDisabled: n,
|
|
@@ -3078,8 +3328,8 @@ function Zt({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3078
3328
|
})
|
|
3079
3329
|
});
|
|
3080
3330
|
}
|
|
3081
|
-
function
|
|
3082
|
-
return /* @__PURE__ */
|
|
3331
|
+
function vn({ sessionKey: e, ...t }) {
|
|
3332
|
+
return /* @__PURE__ */ q(_n, { ...t }, e);
|
|
3083
3333
|
}
|
|
3084
3334
|
//#endregion
|
|
3085
|
-
export {
|
|
3335
|
+
export { mn as OpenFlowSessionGate, vn as OpenFlowWorkbench, Xe as isWorkbenchLanguage, Je as resolveWorkbenchLanguage, Ye as workbenchLanguageNames, qe as workbenchLanguages };
|