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