@oomol-lab/open-flow 0.1.0-beta.3 → 0.1.0-beta.5
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-XKBRy_0Q.js +2066 -0
- package/dist/browser/{createResourceDialog-BkZns-oZ.js → createResourceDialog-Cf7QpXp6.js} +161 -160
- package/dist/browser/{dist-BMqL-qR5.js → dist-BMRLCebL.js} +291 -292
- package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
- package/dist/browser/{dist-CJpzJrLM.js → dist-Cc0y2Pli.js} +811 -812
- package/dist/browser/{dist-DUzA0Ukh.js → dist-Dg_VXC8f.js} +134 -135
- package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
- package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
- package/dist/browser/dist-DxahK_I8.js +2688 -0
- package/dist/browser/{dist-CPuF50D9.js → dist-meg_oHVR.js} +335 -335
- package/dist/browser/{esm-C2UUqIUP.js → esm-xWDFFpGd.js} +5 -6
- package/dist/browser/flow-authoring-module.d.ts +2 -2
- package/dist/browser/flow-authoring-node.d.ts +5 -2
- package/dist/browser/flow-authoring.d.ts +1 -1
- package/dist/browser/flow-authoring.js +489 -209
- package/dist/browser/flow-change.d.ts +110 -9
- package/dist/browser/flow-change.js +319 -96
- package/dist/browser/flow-notifications.d.ts +5 -0
- package/dist/browser/{diagnostics-SDCyFuxm.js → flowChanges-CeMiiZIO.js} +4234 -3825
- package/dist/browser/{flowRunInputEditorStore-CwvOiIiU.js → flowRunInputEditorStore-DDidwd8h.js} +10 -2
- package/dist/browser/{flowWorkspace-BZ_eiQNR.js → flowWorkspace-VnS8nLMT.js} +35268 -35081
- package/dist/browser/{getPseudoElementBounds-ESJExRFX.js → getPseudoElementBounds-5LArT6Xc.js} +1827 -2322
- package/dist/browser/icons-CRxvozBE.js +726 -0
- package/dist/browser/{typeScriptSession-mPCiA9sV.js → typeScriptSession-Bj2HDFRd.js} +256 -257
- package/dist/browser/waitNotificationInputs-ClCAEIAM.js +26 -0
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -0
- package/dist/browser/workbench.js +851 -840
- package/dist/browser/{workbenchSelect-B2s1HV-Y.js → workbenchSelect-Cf1zlVm9.js} +479 -478
- package/dist/common/control-api-conformance.d.ts +1 -0
- package/dist/common/control-api-conformance.js +80 -19
- package/dist/common/control-api-errors.d.ts +4 -0
- package/dist/common/control-api.d.ts +26 -14
- package/dist/common/control-api.js +138 -89
- package/dist/common/flow-encoding.js +20 -8
- package/dist/common/flow-notifications.d.ts +5 -0
- package/dist/common/flow-semantics.d.ts +1 -0
- package/dist/common/flow-semantics.js +467 -381
- package/dist/common/run-events.js +2 -1
- package/dist/common/run-lifecycle.d.ts +17 -2
- package/dist/common/run-lifecycle.js +53 -2
- package/dist/common/scheduler.d.ts +64 -3
- package/dist/common/scheduler.js +417 -142
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/browser/dist-BpopSHwP.js +0 -1543
- package/dist/browser/dist-CUSrALSX.js +0 -1620
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { a as e, f as t, i as n } from "./dist-C46JByB-.js";
|
|
2
2
|
import { a as r, i, s as a, t as o } from "./main-DmjVyuWr.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { Un as s, Vn as c, jt as l } from "./getPseudoElementBounds-5LArT6Xc.js";
|
|
4
|
+
import { a as u, c as d, d as f, f as p, i as m, n as h, o as g, p as _, t as v, u as y } from "./icons-CRxvozBE.js";
|
|
5
|
+
import { t as b } from "./workbenchSelect-Cf1zlVm9.js";
|
|
6
|
+
import { $ as x, A as S, C as ee, D as C, E as w, F as T, G as E, H as D, I as O, J as k, M as A, N as j, O as M, P as N, Q as P, S as F, U as I, V as L, W as te, X as ne, Y as re, Z as ie, _ as ae, a as oe, at as se, b as ce, c as le, ct as ue, d as de, dt as fe, et as pe, f as me, ft as R, g as he, h as ge, i as _e, it as ve, j as z, l as ye, lt as be, m as xe, mt as B, n as V, nt as Se, o as Ce, ot as we, p as Te, pt as Ee, q as De, rt as Oe, s as ke, st as Ae, t as je, tt as H, u as Me, ut as U, v as Ne, w as Pe, x as Fe, y as Ie, z as Le } from "./flowChanges-CeMiiZIO.js";
|
|
7
|
+
import { a as Re, i as ze, n as Be, r as Ve } from "./languages-DgJehE1g.js";
|
|
8
|
+
import { Suspense as He, lazy as Ue, useEffect as W, useRef as We, useState as G } from "react";
|
|
9
|
+
import { Fragment as Ge, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
9
10
|
//#region src/workbench/browser/runtime/navigation.ts
|
|
10
|
-
var
|
|
11
|
+
var Ke = class {
|
|
11
12
|
#e;
|
|
12
13
|
#t;
|
|
13
14
|
#n;
|
|
@@ -66,7 +67,7 @@ var He = class {
|
|
|
66
67
|
this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
|
|
67
68
|
}
|
|
68
69
|
async apply(e) {
|
|
69
|
-
if (
|
|
70
|
+
if (qe(e, this.#t)) return;
|
|
70
71
|
this.#t = e;
|
|
71
72
|
let t = ++this.#i;
|
|
72
73
|
this.#s = !0;
|
|
@@ -82,49 +83,49 @@ var He = class {
|
|
|
82
83
|
flowId: this.#n.workspace.$.flowId.value,
|
|
83
84
|
view: e
|
|
84
85
|
};
|
|
85
|
-
|
|
86
|
+
qe(n, this.#t) || (this.#t = n, this.#e(n, { replace: t })), this.#r.set(e);
|
|
86
87
|
}
|
|
87
88
|
};
|
|
88
|
-
function
|
|
89
|
+
function qe(e, t) {
|
|
89
90
|
return e.flowId == t.flowId && e.view == t.view;
|
|
90
91
|
}
|
|
91
92
|
//#endregion
|
|
92
93
|
//#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
|
|
93
|
-
var
|
|
94
|
-
label:
|
|
94
|
+
var Je = Ue(() => import("./createResourceDialog-Cf7QpXp6.js")), Ye = Re.map((e) => ({
|
|
95
|
+
label: ze[e],
|
|
95
96
|
value: e
|
|
96
97
|
}));
|
|
97
|
-
function
|
|
98
|
-
let n = r(), [i, a] =
|
|
99
|
-
return t == null ? null : /* @__PURE__ */
|
|
98
|
+
function Xe({ language: e, onLanguageChange: t }) {
|
|
99
|
+
let n = r(), [i, a] = G(null);
|
|
100
|
+
return t == null ? null : /* @__PURE__ */ q("div", {
|
|
100
101
|
className: "resource-language",
|
|
101
102
|
ref: a,
|
|
102
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ K("span", {
|
|
103
104
|
className: "sr-only",
|
|
104
105
|
children: n("language.label")
|
|
105
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ K(b, {
|
|
106
107
|
ariaLabel: n("language.label"),
|
|
107
108
|
onValueChange: (e) => t(e),
|
|
108
|
-
options:
|
|
109
|
+
options: Ye,
|
|
109
110
|
portalRoot: i,
|
|
110
111
|
value: e
|
|
111
112
|
})]
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
let
|
|
115
|
+
function Ze({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: d }) {
|
|
116
|
+
let f = i(), p = r(), [m, h] = G("idle"), [g, y] = G(n.name), b = u(g);
|
|
116
117
|
async function x(e) {
|
|
117
118
|
e.preventDefault();
|
|
118
|
-
let t =
|
|
119
|
-
|
|
119
|
+
let t = g.trim();
|
|
120
|
+
u(t) == null && await d.workspace.renameFlow(n.flowId, t) && h("idle");
|
|
120
121
|
}
|
|
121
122
|
async function S() {
|
|
122
|
-
await
|
|
123
|
+
await d.workspace.deleteFlow(n.flowId) && h("idle");
|
|
123
124
|
}
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ q("div", {
|
|
125
126
|
className: "resource-item-row",
|
|
126
127
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ q(c, {
|
|
128
129
|
"aria-disabled": n.status == "retiring",
|
|
129
130
|
className: "resource-list-row flow-columns",
|
|
130
131
|
nativeButton: !1,
|
|
@@ -133,310 +134,307 @@ function qe({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
|
|
|
133
134
|
e.preventDefault();
|
|
134
135
|
return;
|
|
135
136
|
}
|
|
136
|
-
|
|
137
|
+
pe(e, () => o(n));
|
|
137
138
|
},
|
|
138
|
-
render: /* @__PURE__ */
|
|
139
|
+
render: /* @__PURE__ */ K("a", { href: n.status == "retiring" ? void 0 : a }),
|
|
139
140
|
tabIndex: n.status == "retiring" ? -1 : void 0,
|
|
140
141
|
variant: "ghost",
|
|
141
142
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ q("span", {
|
|
143
144
|
className: "resource-primary-cell",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ K("span", {
|
|
145
146
|
className: "resource-icon",
|
|
146
|
-
children: /* @__PURE__ */
|
|
147
|
-
}), /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ K(v, { name: "flow" })
|
|
148
|
+
}), /* @__PURE__ */ q("span", { children: [/* @__PURE__ */ q("span", {
|
|
148
149
|
className: "flex min-w-0 items-center gap-2",
|
|
149
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ K("strong", {
|
|
150
151
|
className: "min-w-0 truncate",
|
|
151
152
|
children: n.name
|
|
152
|
-
}), e != null && /* @__PURE__ */
|
|
153
|
+
}), e != null && /* @__PURE__ */ K(fe, {
|
|
153
154
|
className: "min-w-0 shrink",
|
|
154
155
|
title: e,
|
|
155
156
|
variant: "secondary",
|
|
156
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ K("span", {
|
|
157
158
|
className: "truncate",
|
|
158
159
|
children: e
|
|
159
160
|
})
|
|
160
161
|
})]
|
|
161
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ K("code", {
|
|
162
163
|
translate: "no",
|
|
163
164
|
children: n.flowId
|
|
164
165
|
})] })]
|
|
165
166
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ K("time", {
|
|
167
168
|
dateTime: n.updatedAt,
|
|
168
|
-
children: new Date(n.updatedAt).toLocaleString(
|
|
169
|
+
children: new Date(n.updatedAt).toLocaleString(f)
|
|
169
170
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ q("span", {
|
|
171
172
|
className: `resource-status ${n.status == "active" ? "active" : "warning"}`,
|
|
172
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ K("span", {
|
|
173
174
|
"aria-hidden": "true",
|
|
174
175
|
className: `status-dot ${n.status == "active" ? "success" : "running"}`
|
|
175
|
-
}),
|
|
176
|
+
}), p(n.status == "active" ? "resource.active" : "resource.retiring")]
|
|
176
177
|
})
|
|
177
178
|
]
|
|
178
179
|
}),
|
|
179
|
-
n.status == "active" && /* @__PURE__ */
|
|
180
|
-
"aria-expanded":
|
|
181
|
-
"aria-label":
|
|
182
|
-
className:
|
|
180
|
+
n.status == "active" && /* @__PURE__ */ K(c, {
|
|
181
|
+
"aria-expanded": m != "idle",
|
|
182
|
+
"aria-label": p("sidebar.flowActions", { name: n.name }),
|
|
183
|
+
className: s("resource-row-more", m != "idle" && "active"),
|
|
183
184
|
disabled: t != null,
|
|
184
|
-
onClick: () => m
|
|
185
|
+
onClick: () => h(m == "idle" ? "actions" : "idle"),
|
|
185
186
|
size: "icon-sm",
|
|
186
187
|
variant: "ghost",
|
|
187
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ K(v, { name: "more" })
|
|
188
189
|
}),
|
|
189
|
-
|
|
190
|
+
m == "actions" && /* @__PURE__ */ q("div", {
|
|
190
191
|
className: "resource-row-actions",
|
|
191
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ K(c, {
|
|
192
193
|
onClick: () => {
|
|
193
|
-
y(n.name),
|
|
194
|
+
y(n.name), h("rename");
|
|
194
195
|
},
|
|
195
196
|
size: "sm",
|
|
196
197
|
variant: "outline",
|
|
197
|
-
children:
|
|
198
|
-
}), /* @__PURE__ */
|
|
199
|
-
onClick: () =>
|
|
198
|
+
children: p("common.rename")
|
|
199
|
+
}), /* @__PURE__ */ K(c, {
|
|
200
|
+
onClick: () => h("delete"),
|
|
200
201
|
size: "sm",
|
|
201
202
|
variant: "destructive",
|
|
202
|
-
children:
|
|
203
|
+
children: p("common.delete")
|
|
203
204
|
})]
|
|
204
205
|
}),
|
|
205
|
-
|
|
206
|
+
m == "rename" && /* @__PURE__ */ q("form", {
|
|
206
207
|
className: "resource-row-form",
|
|
207
208
|
onSubmit: (e) => void x(e),
|
|
208
209
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ K(_, {
|
|
210
211
|
htmlFor: `rename-flow-${n.flowId}`,
|
|
211
|
-
children:
|
|
212
|
+
children: p("sidebar.renameFlow", { name: n.name })
|
|
212
213
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ q("span", {
|
|
214
215
|
className: "resource-row-field",
|
|
215
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ K(l, {
|
|
216
217
|
autoComplete: "off",
|
|
217
|
-
"aria-invalid":
|
|
218
|
+
"aria-invalid": g.length > 0 && b != null,
|
|
218
219
|
autoFocus: !0,
|
|
219
220
|
id: `rename-flow-${n.flowId}`,
|
|
220
221
|
name: "flow-name",
|
|
221
222
|
onChange: (e) => y(e.target.value),
|
|
222
223
|
required: !0,
|
|
223
|
-
value:
|
|
224
|
-
}),
|
|
224
|
+
value: g
|
|
225
|
+
}), g.length > 0 && b != null && /* @__PURE__ */ K("small", {
|
|
225
226
|
className: "resource-name-message error",
|
|
226
|
-
children:
|
|
227
|
+
children: p(`resource.nameIssue.${b}`, { max: 80 })
|
|
227
228
|
})]
|
|
228
229
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
onClick: () =>
|
|
230
|
+
/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(c, {
|
|
231
|
+
onClick: () => h("idle"),
|
|
231
232
|
size: "sm",
|
|
232
233
|
variant: "outline",
|
|
233
|
-
children:
|
|
234
|
-
}), /* @__PURE__ */
|
|
234
|
+
children: p("common.cancel")
|
|
235
|
+
}), /* @__PURE__ */ K(c, {
|
|
235
236
|
disabled: t != null || b != null,
|
|
236
237
|
size: "sm",
|
|
237
238
|
type: "submit",
|
|
238
|
-
children:
|
|
239
|
+
children: p("common.save")
|
|
239
240
|
})] })
|
|
240
241
|
]
|
|
241
242
|
}),
|
|
242
|
-
|
|
243
|
+
m == "delete" && /* @__PURE__ */ q("div", {
|
|
243
244
|
className: "resource-row-confirm",
|
|
244
245
|
role: "group",
|
|
245
|
-
"aria-label":
|
|
246
|
-
children: [/* @__PURE__ */
|
|
247
|
-
onClick: () =>
|
|
246
|
+
"aria-label": p("sidebar.deleteFlow", { name: n.name }),
|
|
247
|
+
children: [/* @__PURE__ */ K("span", { children: /* @__PURE__ */ K("strong", { children: p("sidebar.deleteFlowConfirm", { name: n.name }) }) }), /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(c, {
|
|
248
|
+
onClick: () => h("idle"),
|
|
248
249
|
size: "sm",
|
|
249
250
|
variant: "outline",
|
|
250
|
-
children:
|
|
251
|
-
}), /* @__PURE__ */
|
|
251
|
+
children: p("common.cancel")
|
|
252
|
+
}), /* @__PURE__ */ K(c, {
|
|
252
253
|
disabled: t != null,
|
|
253
254
|
onClick: () => void S(),
|
|
254
255
|
size: "sm",
|
|
255
256
|
variant: "destructive",
|
|
256
|
-
children:
|
|
257
|
+
children: p(t == "flow" ? "common.deleting" : "common.delete")
|
|
257
258
|
})] })]
|
|
258
259
|
})
|
|
259
260
|
]
|
|
260
261
|
});
|
|
261
262
|
}
|
|
262
|
-
function
|
|
263
|
-
return /* @__PURE__ */
|
|
263
|
+
function Qe() {
|
|
264
|
+
return /* @__PURE__ */ q("div", {
|
|
264
265
|
"aria-hidden": "true",
|
|
265
266
|
className: "resource-list-row resource-skeleton-row flow-columns",
|
|
266
267
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ q("span", {
|
|
268
269
|
className: "resource-primary-cell",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ K(H, { className: "size-8 shrink-0" }), /* @__PURE__ */ q("span", {
|
|
270
271
|
className: "resource-skeleton-copy",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ K(H, { className: "h-3.5 w-36" }), /* @__PURE__ */ K(H, { className: "h-2.5 w-48 max-w-full" })]
|
|
272
273
|
})]
|
|
273
274
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ K(H, { className: "h-3 w-28" }),
|
|
276
|
+
/* @__PURE__ */ K(H, { className: "h-3 w-16" })
|
|
276
277
|
]
|
|
277
278
|
});
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
-
let
|
|
281
|
-
async function
|
|
280
|
+
function $e({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: i, hrefForFlow: o, hostAction: l, hostTitle: d, language: f, onCreateFlow: p, onHostAction: m, onLanguageChange: h, onSelectFlow: g, store: _ }) {
|
|
281
|
+
let y = r(), b = a(_.workspace.$.busy), S = a(_.workspace.$.flowLoadFailed), ee = a(_.workspace.$.flowLoadMoreFailed), C = a(_.workspace.$.flowLoading), w = a(_.workspace.$.flowLoadingMore), T = a(_.workspace.$.flowNextCursor), E = a(_.workspace.$.flows), D = a(_.workspace.$.flowTotal), [O, k] = G(!1), [A, j] = G(""), [M, N] = G(""), P = A.trim().toLocaleLowerCase(), F = E.filter((e) => e.name.toLocaleLowerCase().includes(P));
|
|
282
|
+
async function I(e) {
|
|
282
283
|
e.preventDefault();
|
|
283
|
-
let t =
|
|
284
|
-
|
|
284
|
+
let t = M.trim();
|
|
285
|
+
u(t) != null || !await p(t) || (k(!1), N(""));
|
|
285
286
|
}
|
|
286
|
-
return /* @__PURE__ */
|
|
287
|
+
return /* @__PURE__ */ K("main", {
|
|
287
288
|
className: "resource-browser",
|
|
288
|
-
children: /* @__PURE__ */
|
|
289
|
-
className: "resource-page",
|
|
289
|
+
children: /* @__PURE__ */ q("div", {
|
|
290
|
+
className: s("resource-page", e != "default" && "resource-page-full"),
|
|
290
291
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
className: "
|
|
293
|
-
children:
|
|
294
|
-
className: "resource-heading",
|
|
295
|
-
children: /* @__PURE__ */ W("h1", { children: g("resource.flows") })
|
|
296
|
-
}), /* @__PURE__ */ G("div", {
|
|
297
|
-
className: "resource-page-actions",
|
|
298
|
-
children: [
|
|
299
|
-
/* @__PURE__ */ W(Ke, {
|
|
300
|
-
language: c,
|
|
301
|
-
onLanguageChange: d
|
|
302
|
-
}),
|
|
303
|
-
/* @__PURE__ */ G(p, {
|
|
304
|
-
disabled: _ != null,
|
|
305
|
-
onClick: () => T(!0),
|
|
306
|
-
children: [/* @__PURE__ */ W(f, {
|
|
307
|
-
"data-icon": "inline-start",
|
|
308
|
-
name: "plus"
|
|
309
|
-
}), g("resource.newFlow")]
|
|
310
|
-
}),
|
|
311
|
-
o != null && s != null && u != null && /* @__PURE__ */ W(ae, {
|
|
312
|
-
action: o,
|
|
313
|
-
onAction: u,
|
|
314
|
-
title: s
|
|
315
|
-
})
|
|
316
|
-
]
|
|
317
|
-
})]
|
|
292
|
+
/* @__PURE__ */ K("h1", {
|
|
293
|
+
className: "sr-only",
|
|
294
|
+
children: y("resource.flows")
|
|
318
295
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ q("section", {
|
|
320
297
|
"aria-labelledby": "flow-list-title",
|
|
321
298
|
className: "resource-list-section",
|
|
322
299
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ q("div", {
|
|
324
301
|
className: "resource-list-title",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ q("div", {
|
|
326
303
|
className: "resource-list-heading",
|
|
327
|
-
children: [/* @__PURE__ */
|
|
304
|
+
children: [/* @__PURE__ */ K("h2", {
|
|
328
305
|
id: "flow-list-title",
|
|
329
|
-
children:
|
|
330
|
-
}), !
|
|
331
|
-
}), /* @__PURE__ */
|
|
306
|
+
children: y("resource.allFlows")
|
|
307
|
+
}), !C && /* @__PURE__ */ K("span", { children: y("resource.flowCount", { count: D ?? E.length }) })]
|
|
308
|
+
}), /* @__PURE__ */ q("div", {
|
|
332
309
|
className: "resource-list-actions",
|
|
333
|
-
children: [
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
310
|
+
children: [
|
|
311
|
+
/* @__PURE__ */ K(Xe, {
|
|
312
|
+
language: f,
|
|
313
|
+
onLanguageChange: h
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ q(Se, {
|
|
316
|
+
className: "w-full sm:w-56",
|
|
317
|
+
children: [/* @__PURE__ */ K(Oe, { children: /* @__PURE__ */ K(v, {
|
|
318
|
+
name: "search",
|
|
319
|
+
size: 17
|
|
320
|
+
}) }), /* @__PURE__ */ K(ve, {
|
|
321
|
+
autoComplete: "off",
|
|
322
|
+
"aria-label": y("resource.searchFlows"),
|
|
323
|
+
name: "flow-search",
|
|
324
|
+
onChange: (e) => j(e.target.value),
|
|
325
|
+
placeholder: y("resource.searchFlows"),
|
|
326
|
+
value: A
|
|
327
|
+
})]
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ K(c, {
|
|
330
|
+
"aria-label": y("common.refresh"),
|
|
331
|
+
disabled: C || b != null,
|
|
332
|
+
onClick: () => void _.workspace.reloadFlows(),
|
|
333
|
+
size: "icon",
|
|
334
|
+
title: y("common.refresh"),
|
|
335
|
+
variant: "outline",
|
|
336
|
+
children: /* @__PURE__ */ K(v, { name: "refresh" })
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ q(c, {
|
|
339
|
+
className: "resource-page-primary-action",
|
|
340
|
+
disabled: b != null,
|
|
341
|
+
onClick: () => k(!0),
|
|
342
|
+
children: [/* @__PURE__ */ K(v, {
|
|
343
|
+
"data-icon": "inline-start",
|
|
344
|
+
name: "plus"
|
|
345
|
+
}), y("resource.newFlow")]
|
|
346
|
+
}),
|
|
347
|
+
l != null && d != null && m != null && /* @__PURE__ */ K(x, {
|
|
348
|
+
action: l,
|
|
349
|
+
onAction: m,
|
|
350
|
+
title: d
|
|
351
|
+
})
|
|
352
|
+
]
|
|
355
353
|
})]
|
|
356
354
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ q("div", {
|
|
358
356
|
"aria-hidden": "true",
|
|
359
357
|
className: "resource-list-columns flow-columns",
|
|
360
358
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ K("span", { children: y("resource.name") }),
|
|
360
|
+
/* @__PURE__ */ K("span", { children: y("resource.updated") }),
|
|
361
|
+
/* @__PURE__ */ K("span", { children: y("resource.status") })
|
|
364
362
|
]
|
|
365
363
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ K("div", {
|
|
367
365
|
className: "resource-list",
|
|
368
|
-
children:
|
|
366
|
+
children: C ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ K(Qe, {}, t)) : S ? /* @__PURE__ */ q(se, {
|
|
369
367
|
className: "min-h-64",
|
|
370
368
|
role: "alert",
|
|
371
|
-
children: [/* @__PURE__ */
|
|
372
|
-
/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ q(ue, { children: [
|
|
370
|
+
/* @__PURE__ */ K(be, {
|
|
373
371
|
variant: "icon",
|
|
374
|
-
children: /* @__PURE__ */
|
|
372
|
+
children: /* @__PURE__ */ K(v, {
|
|
375
373
|
name: "alert",
|
|
376
374
|
size: 20
|
|
377
375
|
})
|
|
378
376
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
] }), /* @__PURE__ */
|
|
382
|
-
onClick: () => void
|
|
377
|
+
/* @__PURE__ */ K(U, { children: y("resource.flowsLoadFailed") }),
|
|
378
|
+
/* @__PURE__ */ K(Ae, { children: y("resource.flowsLoadFailedDescription") })
|
|
379
|
+
] }), /* @__PURE__ */ K(we, { children: /* @__PURE__ */ K(c, {
|
|
380
|
+
onClick: () => void _.retryFlows(),
|
|
383
381
|
variant: "outline",
|
|
384
|
-
children:
|
|
382
|
+
children: y("empty.retry")
|
|
385
383
|
}) })]
|
|
386
|
-
}) :
|
|
384
|
+
}) : F.length == 0 ? /* @__PURE__ */ q(se, {
|
|
387
385
|
className: "min-h-64",
|
|
388
|
-
children: [/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
386
|
+
children: [/* @__PURE__ */ q(ue, { children: [
|
|
387
|
+
/* @__PURE__ */ K(be, {
|
|
390
388
|
variant: "icon",
|
|
391
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ K(v, {
|
|
392
390
|
name: "flow",
|
|
393
391
|
size: 20
|
|
394
392
|
})
|
|
395
393
|
}),
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
] }),
|
|
399
|
-
onClick: () =>
|
|
394
|
+
/* @__PURE__ */ K(U, { children: y(P.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
|
|
395
|
+
/* @__PURE__ */ K(Ae, { children: y(P.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
|
|
396
|
+
] }), P.length == 0 && /* @__PURE__ */ K(we, { children: /* @__PURE__ */ q(c, {
|
|
397
|
+
onClick: () => k(!0),
|
|
400
398
|
variant: "outline",
|
|
401
|
-
children: [/* @__PURE__ */
|
|
399
|
+
children: [/* @__PURE__ */ K(v, {
|
|
402
400
|
"data-icon": "inline-start",
|
|
403
401
|
name: "plus"
|
|
404
|
-
}),
|
|
402
|
+
}), y("resource.newFlow")]
|
|
405
403
|
}) })]
|
|
406
|
-
}) :
|
|
407
|
-
badge:
|
|
408
|
-
busy:
|
|
404
|
+
}) : F.map((e) => /* @__PURE__ */ K(Ze, {
|
|
405
|
+
badge: i?.[e.flowId],
|
|
406
|
+
busy: b,
|
|
409
407
|
flow: e,
|
|
410
|
-
href:
|
|
411
|
-
onSelect:
|
|
412
|
-
store:
|
|
408
|
+
href: o(e),
|
|
409
|
+
onSelect: g,
|
|
410
|
+
store: _
|
|
413
411
|
}, e.flowId))
|
|
414
412
|
}),
|
|
415
|
-
|
|
413
|
+
T != null && /* @__PURE__ */ K("div", {
|
|
416
414
|
className: "resource-list-footer",
|
|
417
|
-
children: /* @__PURE__ */
|
|
418
|
-
disabled:
|
|
419
|
-
onClick: () => void
|
|
415
|
+
children: /* @__PURE__ */ K(c, {
|
|
416
|
+
disabled: w,
|
|
417
|
+
onClick: () => void _.workspace.loadMoreFlows(),
|
|
420
418
|
variant: "outline",
|
|
421
|
-
children:
|
|
419
|
+
children: y(w ? "resource.loadingMore" : ee ? "resource.retryLoadMore" : "resource.loadMore")
|
|
422
420
|
})
|
|
423
421
|
})
|
|
424
422
|
]
|
|
425
423
|
}),
|
|
426
|
-
|
|
424
|
+
O && /* @__PURE__ */ K(He, {
|
|
427
425
|
fallback: null,
|
|
428
|
-
children: /* @__PURE__ */
|
|
429
|
-
disabled:
|
|
430
|
-
field:
|
|
426
|
+
children: /* @__PURE__ */ K(Je, {
|
|
427
|
+
disabled: t,
|
|
428
|
+
field: n,
|
|
431
429
|
id: "flow-name",
|
|
432
|
-
issue:
|
|
433
|
-
label:
|
|
434
|
-
name:
|
|
435
|
-
onNameChange:
|
|
436
|
-
onOpenChange:
|
|
437
|
-
onSubmit: (e) => void
|
|
438
|
-
pending:
|
|
439
|
-
title:
|
|
430
|
+
issue: u(M),
|
|
431
|
+
label: y("resource.flowName"),
|
|
432
|
+
name: M,
|
|
433
|
+
onNameChange: N,
|
|
434
|
+
onOpenChange: k,
|
|
435
|
+
onSubmit: (e) => void I(e),
|
|
436
|
+
pending: b == "flow",
|
|
437
|
+
title: y("resource.newFlow")
|
|
440
438
|
})
|
|
441
439
|
})
|
|
442
440
|
]
|
|
@@ -445,7 +443,7 @@ function Ye({ createFlowDisabled: e, createFlowField: t, flowBadges: n, hrefForF
|
|
|
445
443
|
}
|
|
446
444
|
//#endregion
|
|
447
445
|
//#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
|
|
448
|
-
var
|
|
446
|
+
var et = (e) => crypto.getRandomValues(new Uint8Array(e)), tt = (e, t, n) => {
|
|
449
447
|
let r = 256 - 256 % e.length;
|
|
450
448
|
if (r === 256) {
|
|
451
449
|
let r = e.length - 1;
|
|
@@ -467,41 +465,43 @@ var Xe = (e) => crypto.getRandomValues(new Uint8Array(e)), Ze = (e, t, n) => {
|
|
|
467
465
|
for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
|
|
468
466
|
}
|
|
469
467
|
};
|
|
470
|
-
},
|
|
468
|
+
}, nt = (e, t = 21) => tt(e, t | 0, et);
|
|
471
469
|
//#endregion
|
|
472
470
|
//#region src/flow/common/edgeChanges.ts
|
|
473
|
-
function
|
|
471
|
+
function rt(e, t, n) {
|
|
474
472
|
let r = {
|
|
475
473
|
source: n.source,
|
|
476
474
|
sourceHandle: n.sourceHandle,
|
|
477
475
|
target: n.target,
|
|
478
476
|
targetHandle: n.targetHandle
|
|
479
|
-
}, i =
|
|
480
|
-
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] :
|
|
477
|
+
}, i = at(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
478
|
+
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : De(e, [{
|
|
479
|
+
before: a,
|
|
481
480
|
edge: r,
|
|
482
481
|
kind: "graph.edge.connect",
|
|
483
482
|
target: t
|
|
484
483
|
}]);
|
|
485
484
|
}
|
|
486
|
-
function
|
|
485
|
+
function it(e, t, n) {
|
|
487
486
|
let r = {
|
|
488
487
|
source: n.source,
|
|
489
488
|
sourceHandle: n.sourceHandle,
|
|
490
489
|
target: n.target,
|
|
491
490
|
targetHandle: n.targetHandle
|
|
492
|
-
}, i =
|
|
491
|
+
}, i = at(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
493
492
|
return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
|
|
493
|
+
before: a,
|
|
494
494
|
edge: r,
|
|
495
495
|
kind: "graph.edge.disconnect",
|
|
496
496
|
target: t
|
|
497
497
|
}];
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function at(e, t) {
|
|
500
500
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
501
501
|
}
|
|
502
502
|
//#endregion
|
|
503
503
|
//#region src/flow/common/moduleChanges.ts
|
|
504
|
-
async function
|
|
504
|
+
async function ot(e) {
|
|
505
505
|
try {
|
|
506
506
|
let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
|
|
507
507
|
errorRecovery: !0,
|
|
@@ -517,15 +517,17 @@ async function nt(e) {
|
|
|
517
517
|
return [];
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function st(e, t, n, r, i) {
|
|
521
521
|
return [{
|
|
522
|
-
|
|
522
|
+
beforeImports: n,
|
|
523
|
+
beforeSource: t,
|
|
524
|
+
imports: i,
|
|
523
525
|
kind: "module.source.replace",
|
|
524
526
|
moduleId: e,
|
|
525
|
-
source:
|
|
527
|
+
source: r
|
|
526
528
|
}];
|
|
527
529
|
}
|
|
528
|
-
var
|
|
530
|
+
var ct = nt("23456789abcdefghjkmnpqrstuvwxyz", 10), J = {
|
|
529
531
|
activities: [],
|
|
530
532
|
activitiesLoadFailed: !1,
|
|
531
533
|
activitiesLoading: !1,
|
|
@@ -538,24 +540,24 @@ var it = Qe("23456789abcdefghjkmnpqrstuvwxyz", 10), K = {
|
|
|
538
540
|
loadingMore: !1,
|
|
539
541
|
publications: [],
|
|
540
542
|
publishing: !1
|
|
541
|
-
},
|
|
542
|
-
function
|
|
543
|
+
}, lt = 20, ut = 50, dt = 750;
|
|
544
|
+
function Y(e, t) {
|
|
543
545
|
return e?.flowId == t.flowId;
|
|
544
546
|
}
|
|
545
|
-
var
|
|
547
|
+
var ft = class {
|
|
546
548
|
#e;
|
|
547
549
|
#t;
|
|
548
550
|
#n;
|
|
549
|
-
#r = new
|
|
550
|
-
#i = new
|
|
551
|
+
#r = new I();
|
|
552
|
+
#i = new I();
|
|
551
553
|
#a;
|
|
552
|
-
#o = new
|
|
553
|
-
#s = new
|
|
554
|
+
#o = new I();
|
|
555
|
+
#s = new I();
|
|
554
556
|
#c;
|
|
555
|
-
#l = t(
|
|
557
|
+
#l = t(J);
|
|
556
558
|
#u;
|
|
557
559
|
#d;
|
|
558
|
-
constructor(t, n, r, i, a = () => crypto.randomUUID(), o =
|
|
560
|
+
constructor(t, n, r, i, a = () => crypto.randomUUID(), o = R()) {
|
|
559
561
|
this.#e = t, this.#t = a, this.#n = o, this.#a = i, this.#c = r, this.#u = n, this.$ = {
|
|
560
562
|
activities: e(this.#l, (e) => e.activities),
|
|
561
563
|
activitiesLoadFailed: e(this.#l, (e) => e.activitiesLoadFailed),
|
|
@@ -588,12 +590,12 @@ var ct = class {
|
|
|
588
590
|
this.#l.dispose();
|
|
589
591
|
}
|
|
590
592
|
reset() {
|
|
591
|
-
this.#r.invalidate(), this.#i.invalidate(), this.#o.invalidate(), this.#s.invalidate(), this.#d = void 0, this.#l.set(
|
|
593
|
+
this.#r.invalidate(), this.#i.invalidate(), this.#o.invalidate(), this.#s.invalidate(), this.#d = void 0, this.#l.set(J);
|
|
592
594
|
}
|
|
593
595
|
async load(e) {
|
|
594
596
|
let t = { flowId: e }, n = this.#r.begin();
|
|
595
|
-
|
|
596
|
-
...
|
|
597
|
+
Y(this.#l.value.target, t) || (this.#i.invalidate(), this.#d = void 0), this.#c(void 0), this.#l.set({
|
|
598
|
+
...J,
|
|
597
599
|
loading: !0,
|
|
598
600
|
target: t
|
|
599
601
|
});
|
|
@@ -618,7 +620,7 @@ var ct = class {
|
|
|
618
620
|
this.#y({
|
|
619
621
|
loadFailed: !0,
|
|
620
622
|
loading: !1
|
|
621
|
-
}), this.#c(
|
|
623
|
+
}), this.#c(D(e, this.#n.t));
|
|
622
624
|
}
|
|
623
625
|
}
|
|
624
626
|
async loadMore() {
|
|
@@ -632,7 +634,7 @@ var ct = class {
|
|
|
632
634
|
try {
|
|
633
635
|
let e = await this.#e.listPublications(n.flowId, {
|
|
634
636
|
cursor: t,
|
|
635
|
-
limit:
|
|
637
|
+
limit: ut
|
|
636
638
|
});
|
|
637
639
|
if (!r()) return;
|
|
638
640
|
let i = new Set(this.#l.value.publications.map((e) => e.publicationId));
|
|
@@ -647,7 +649,7 @@ var ct = class {
|
|
|
647
649
|
this.#y({
|
|
648
650
|
loadMoreFailed: !0,
|
|
649
651
|
loadingMore: !1
|
|
650
|
-
}), this.#c(
|
|
652
|
+
}), this.#c(D(e, this.#n.t));
|
|
651
653
|
}
|
|
652
654
|
}
|
|
653
655
|
async publish() {
|
|
@@ -670,7 +672,7 @@ var ct = class {
|
|
|
670
672
|
publishing: i.status == "pending"
|
|
671
673
|
}), await this.#g(n, i, o, e.name)) : !1;
|
|
672
674
|
} catch (e) {
|
|
673
|
-
return o() ? (e instanceof B && e.code == "live.conflict" && await this.#p(n), this.#c(
|
|
675
|
+
return o() ? (e instanceof B && e.code == "live.conflict" && await this.#p(n), this.#c(D(e, this.#n.t)), !1) : !1;
|
|
674
676
|
} finally {
|
|
675
677
|
o() && this.#y({ publishing: !1 });
|
|
676
678
|
}
|
|
@@ -694,7 +696,7 @@ var ct = class {
|
|
|
694
696
|
message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
|
|
695
697
|
}), !0);
|
|
696
698
|
} catch (e) {
|
|
697
|
-
return s() ? (e instanceof B && e.code == "live.conflict" && await this.#p(r), this.#c(
|
|
699
|
+
return s() ? (e instanceof B && e.code == "live.conflict" && await this.#p(r), this.#c(D(e, this.#n.t)), !1) : !1;
|
|
698
700
|
} finally {
|
|
699
701
|
s() && this.#y({ rollingBackPublicationId: void 0 });
|
|
700
702
|
}
|
|
@@ -729,13 +731,13 @@ var ct = class {
|
|
|
729
731
|
testingTriggerId: void 0,
|
|
730
732
|
testResult: void 0
|
|
731
733
|
});
|
|
732
|
-
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit:
|
|
734
|
+
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: lt })]);
|
|
733
735
|
if (n()) {
|
|
734
736
|
if (r.status == "rejected") {
|
|
735
737
|
this.#y({
|
|
736
738
|
activitiesLoading: !1,
|
|
737
739
|
detailLoading: !1
|
|
738
|
-
}), this.#c(
|
|
740
|
+
}), this.#c(D(r.reason, this.#n.t));
|
|
739
741
|
return;
|
|
740
742
|
}
|
|
741
743
|
this.#y({
|
|
@@ -749,7 +751,7 @@ var ct = class {
|
|
|
749
751
|
}) : (this.#y({
|
|
750
752
|
activitiesLoadFailed: !0,
|
|
751
753
|
activitiesLoading: !1
|
|
752
|
-
}), this.#c(
|
|
754
|
+
}), this.#c(D(i.reason, this.#n.t)));
|
|
753
755
|
}
|
|
754
756
|
}
|
|
755
757
|
async loadMoreTriggerActivities() {
|
|
@@ -763,7 +765,7 @@ var ct = class {
|
|
|
763
765
|
try {
|
|
764
766
|
let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
|
|
765
767
|
cursor: t,
|
|
766
|
-
limit:
|
|
768
|
+
limit: lt
|
|
767
769
|
});
|
|
768
770
|
if (!i() || this.#l.value.selectedTriggerId != n) return;
|
|
769
771
|
let a = new Set(this.#l.value.activities.map((e) => e.activityId));
|
|
@@ -778,7 +780,7 @@ var ct = class {
|
|
|
778
780
|
this.#y({
|
|
779
781
|
activitiesLoadFailed: !0,
|
|
780
782
|
activitiesLoadingMore: !1
|
|
781
|
-
}), this.#c(
|
|
783
|
+
}), this.#c(D(e, this.#n.t));
|
|
782
784
|
}
|
|
783
785
|
}
|
|
784
786
|
async testTrigger() {
|
|
@@ -793,7 +795,7 @@ var ct = class {
|
|
|
793
795
|
let e = await this.#e.testFlowPollTrigger(n.flowId, t);
|
|
794
796
|
return !i() || this.#l.value.selectedTriggerId != t ? !1 : (this.#y({ testResult: e }), !0);
|
|
795
797
|
} catch (e) {
|
|
796
|
-
return i() && this.#l.value.selectedTriggerId == t && this.#c(
|
|
798
|
+
return i() && this.#l.value.selectedTriggerId == t && this.#c(D(e, this.#n.t)), !1;
|
|
797
799
|
} finally {
|
|
798
800
|
i() && this.#l.value.selectedTriggerId == t && this.#y({ testingTriggerId: void 0 });
|
|
799
801
|
}
|
|
@@ -811,14 +813,14 @@ var ct = class {
|
|
|
811
813
|
message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
|
|
812
814
|
}), !0) : !1;
|
|
813
815
|
} catch (e) {
|
|
814
|
-
return n() && this.#c(
|
|
816
|
+
return n() && this.#c(D(e, this.#n.t)), !1;
|
|
815
817
|
} finally {
|
|
816
818
|
n() && this.#y({ changingTriggerId: void 0 });
|
|
817
819
|
}
|
|
818
820
|
}
|
|
819
821
|
async #f(e) {
|
|
820
822
|
let [t, n, r] = await this.#m(e);
|
|
821
|
-
this.#u.updateLive(t), await this.#u.refreshFlows(),
|
|
823
|
+
this.#u.updateLive(t), await this.#u.refreshFlows(), Y(this.#l.value.target, e) && this.#y({
|
|
822
824
|
bindings: r,
|
|
823
825
|
live: t,
|
|
824
826
|
loadFailed: !1,
|
|
@@ -839,7 +841,7 @@ var ct = class {
|
|
|
839
841
|
this.#e.getLive(e.flowId),
|
|
840
842
|
this.#e.listPublications(e.flowId, {
|
|
841
843
|
includeTotal: !0,
|
|
842
|
-
limit:
|
|
844
|
+
limit: ut
|
|
843
845
|
}),
|
|
844
846
|
this.#e.listFlowTriggerBindings(e.flowId)
|
|
845
847
|
]);
|
|
@@ -859,7 +861,7 @@ var ct = class {
|
|
|
859
861
|
async #g(e, t, n, r) {
|
|
860
862
|
let i = t;
|
|
861
863
|
for (; i.status == "pending";) {
|
|
862
|
-
if (await new Promise((e) => setTimeout(e,
|
|
864
|
+
if (await new Promise((e) => setTimeout(e, dt)), !n()) return !1;
|
|
863
865
|
try {
|
|
864
866
|
i = await this.#e.getPublishOperation(e.flowId, i.operationId);
|
|
865
867
|
} catch (t) {
|
|
@@ -867,8 +869,8 @@ var ct = class {
|
|
|
867
869
|
if (t instanceof B && t.code == "publication.operation-not-found") return this.#a.setItem(this.#_(e.flowId), ""), this.#v(e, {
|
|
868
870
|
operation: void 0,
|
|
869
871
|
publishing: !1
|
|
870
|
-
}), this.#c(
|
|
871
|
-
this.#c(
|
|
872
|
+
}), this.#c(D(t, this.#n.t)), !1;
|
|
873
|
+
this.#c(D(t, this.#n.t));
|
|
872
874
|
continue;
|
|
873
875
|
}
|
|
874
876
|
if (!n()) return !1;
|
|
@@ -884,7 +886,7 @@ var ct = class {
|
|
|
884
886
|
try {
|
|
885
887
|
await this.#f(e);
|
|
886
888
|
} catch (e) {
|
|
887
|
-
return n() && this.#c(
|
|
889
|
+
return n() && this.#c(D(e, this.#n.t)), !0;
|
|
888
890
|
}
|
|
889
891
|
return n() ? (this.#c({
|
|
890
892
|
kind: "success",
|
|
@@ -895,8 +897,8 @@ var ct = class {
|
|
|
895
897
|
return `publish-operation:${e}`;
|
|
896
898
|
}
|
|
897
899
|
#v(e, t) {
|
|
898
|
-
|
|
899
|
-
...
|
|
900
|
+
Y(this.#l.value.target, e) ? this.#y(t) : this.#l.set({
|
|
901
|
+
...J,
|
|
900
902
|
...t,
|
|
901
903
|
target: e
|
|
902
904
|
});
|
|
@@ -907,24 +909,29 @@ var ct = class {
|
|
|
907
909
|
...e
|
|
908
910
|
});
|
|
909
911
|
}
|
|
910
|
-
},
|
|
911
|
-
function
|
|
912
|
+
}, pt = { starting: !1 };
|
|
913
|
+
function mt(e) {
|
|
912
914
|
switch (e.kind) {
|
|
913
915
|
case "condition": return { [e.node.input.handle]: e.node.input };
|
|
914
|
-
case "subflow": return
|
|
915
|
-
case "task": return
|
|
916
|
+
case "subflow": return m(e.definition?.inputs ?? []);
|
|
917
|
+
case "task": return m(e.definition?.inputs ?? []);
|
|
916
918
|
case "value": return {};
|
|
919
|
+
case "wait": return { value: {
|
|
920
|
+
jsonSchema: {},
|
|
921
|
+
nullable: !0,
|
|
922
|
+
value: null
|
|
923
|
+
} };
|
|
917
924
|
}
|
|
918
925
|
}
|
|
919
|
-
function
|
|
926
|
+
function ht(e) {
|
|
920
927
|
return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
|
|
921
928
|
}
|
|
922
|
-
async function
|
|
923
|
-
let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-
|
|
929
|
+
async function gt(e, t) {
|
|
930
|
+
let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-DDidwd8h.js").then((e) => e.r), r = L(e), i = r.graph({ kind: "flow" });
|
|
924
931
|
return i == null ? [] : Object.entries(i.nodes).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, i]) => {
|
|
925
932
|
let a = r.resolveNode(e, i);
|
|
926
933
|
if (a.kind == "trigger") return [];
|
|
927
|
-
let o = Object.entries(
|
|
934
|
+
let o = Object.entries(mt(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
|
|
928
935
|
handle: e,
|
|
929
936
|
jsonSchema: t.jsonSchema,
|
|
930
937
|
nullable: t.nullable
|
|
@@ -932,21 +939,21 @@ async function ft(e, t) {
|
|
|
932
939
|
return o.length == 0 ? [] : [{
|
|
933
940
|
editor: new n(o, t),
|
|
934
941
|
nodeId: e,
|
|
935
|
-
title:
|
|
942
|
+
title: ht(a)
|
|
936
943
|
}];
|
|
937
944
|
});
|
|
938
945
|
}
|
|
939
|
-
var
|
|
946
|
+
var _t = class {
|
|
940
947
|
#e;
|
|
941
948
|
#t;
|
|
942
949
|
#n;
|
|
943
|
-
#r = new
|
|
944
|
-
#i = new
|
|
950
|
+
#r = new I();
|
|
951
|
+
#i = new I();
|
|
945
952
|
#a;
|
|
946
953
|
#o;
|
|
947
|
-
#s = t(
|
|
954
|
+
#s = t(pt);
|
|
948
955
|
#c;
|
|
949
|
-
constructor(t, n, r, i =
|
|
956
|
+
constructor(t, n, r, i = R(), a = () => crypto.randomUUID()) {
|
|
950
957
|
this.#e = t, this.#a = n, this.#o = r, this.#n = i, this.#t = a, this.$ = {
|
|
951
958
|
inputRequest: e(this.#s, (e) => e.inputRequest),
|
|
952
959
|
starting: e(this.#s, (e) => e.starting),
|
|
@@ -961,7 +968,7 @@ var pt = class {
|
|
|
961
968
|
reset() {
|
|
962
969
|
this.#r.invalidate(), this.#i.invalidate(), this.#c = void 0;
|
|
963
970
|
let e = this.#s.value.inputRequest;
|
|
964
|
-
this.#s.set(
|
|
971
|
+
this.#s.set(pt), this.#d(e);
|
|
965
972
|
}
|
|
966
973
|
async requestDraft(e, t) {
|
|
967
974
|
let n = this.#i.begin();
|
|
@@ -976,7 +983,7 @@ var pt = class {
|
|
|
976
983
|
let r = await this.#e.getRevision(e.flowId, n.revisionId);
|
|
977
984
|
return t() ? await this.#l("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
|
|
978
985
|
} catch (e) {
|
|
979
|
-
return t() && this.#o(
|
|
986
|
+
return t() && this.#o(D(e, this.#n.t)), "unavailable";
|
|
980
987
|
} finally {
|
|
981
988
|
t() && this.#f({ starting: !1 });
|
|
982
989
|
}
|
|
@@ -1004,7 +1011,7 @@ var pt = class {
|
|
|
1004
1011
|
}), this.#d(s);
|
|
1005
1012
|
let c;
|
|
1006
1013
|
try {
|
|
1007
|
-
c = await
|
|
1014
|
+
c = await gt(r, this.#n.lang$);
|
|
1008
1015
|
} catch (e) {
|
|
1009
1016
|
throw a() && this.#f({
|
|
1010
1017
|
starting: !1,
|
|
@@ -1060,7 +1067,7 @@ var pt = class {
|
|
|
1060
1067
|
});
|
|
1061
1068
|
return !a() || !o() ? !1 : (this.#c = void 0, this.#a.follow(s, o));
|
|
1062
1069
|
} catch (e) {
|
|
1063
|
-
return a() && o() && this.#o(
|
|
1070
|
+
return a() && o() && this.#o(D(e, this.#n.t)), !1;
|
|
1064
1071
|
} finally {
|
|
1065
1072
|
a() && this.#f({
|
|
1066
1073
|
starting: !1,
|
|
@@ -1080,18 +1087,18 @@ var pt = class {
|
|
|
1080
1087
|
...e
|
|
1081
1088
|
});
|
|
1082
1089
|
}
|
|
1083
|
-
},
|
|
1090
|
+
}, vt = {
|
|
1084
1091
|
actions: {},
|
|
1085
1092
|
catalogs: {}
|
|
1086
1093
|
};
|
|
1087
|
-
function
|
|
1094
|
+
function yt(e) {
|
|
1088
1095
|
return Object.entries(e).map(([e, t]) => ({
|
|
1089
1096
|
description: t.description,
|
|
1090
1097
|
handle: e,
|
|
1091
1098
|
jsonSchema: t.jsonSchema
|
|
1092
1099
|
}));
|
|
1093
1100
|
}
|
|
1094
|
-
function
|
|
1101
|
+
function X(e, t) {
|
|
1095
1102
|
return {
|
|
1096
1103
|
connector: e,
|
|
1097
1104
|
description: e.authenticated && e.defaultConnection == null ? t("addNode.connectorNeedsConnection", {
|
|
@@ -1099,15 +1106,15 @@ function J(e, t) {
|
|
|
1099
1106
|
service: e.serviceName
|
|
1100
1107
|
}) : e.description,
|
|
1101
1108
|
group: t("addNode.connectorActions"),
|
|
1102
|
-
icon: e
|
|
1109
|
+
icon: T(e),
|
|
1103
1110
|
id: `connector:${e.actionId}`,
|
|
1104
|
-
inputs:
|
|
1111
|
+
inputs: yt(e.inputs),
|
|
1105
1112
|
kind: "connector",
|
|
1106
1113
|
label: e.name,
|
|
1107
|
-
outputs:
|
|
1114
|
+
outputs: yt(e.outputs)
|
|
1108
1115
|
};
|
|
1109
1116
|
}
|
|
1110
|
-
function
|
|
1117
|
+
function bt(e, t) {
|
|
1111
1118
|
let n = /* @__PURE__ */ new Map();
|
|
1112
1119
|
for (let t of e) {
|
|
1113
1120
|
let e = n.get(t.serviceId) ?? [];
|
|
@@ -1115,7 +1122,7 @@ function gt(e, t) {
|
|
|
1115
1122
|
}
|
|
1116
1123
|
return [...n.values()].toSorted((e, t) => e[0].serviceName.localeCompare(t[0].serviceName)).map((e) => {
|
|
1117
1124
|
let n = e[0], r = e.map((e) => {
|
|
1118
|
-
let n =
|
|
1125
|
+
let n = X(e, t);
|
|
1119
1126
|
return {
|
|
1120
1127
|
description: n.description,
|
|
1121
1128
|
label: n.label,
|
|
@@ -1126,7 +1133,7 @@ function gt(e, t) {
|
|
|
1126
1133
|
choices: r,
|
|
1127
1134
|
description: t(r.length == 1 ? "addNode.connectorActionCountOne" : "addNode.connectorActionCount", { count: r.length }),
|
|
1128
1135
|
group: t("addNode.connectorActions"),
|
|
1129
|
-
icon: n
|
|
1136
|
+
icon: T(n),
|
|
1130
1137
|
id: `connector-provider:${n.serviceId}`,
|
|
1131
1138
|
inputs: [],
|
|
1132
1139
|
kind: "connector-group",
|
|
@@ -1136,12 +1143,12 @@ function gt(e, t) {
|
|
|
1136
1143
|
};
|
|
1137
1144
|
});
|
|
1138
1145
|
}
|
|
1139
|
-
function
|
|
1146
|
+
function xt(e, t) {
|
|
1140
1147
|
return {
|
|
1141
1148
|
choices: [],
|
|
1142
1149
|
description: t("addNode.connectorBrowseActions"),
|
|
1143
1150
|
group: t("addNode.connectorActions"),
|
|
1144
|
-
icon: e
|
|
1151
|
+
icon: T(e),
|
|
1145
1152
|
id: `connector-provider:${e.serviceId}`,
|
|
1146
1153
|
inputs: [],
|
|
1147
1154
|
kind: "connector-group",
|
|
@@ -1150,17 +1157,39 @@ function _t(e, t) {
|
|
|
1150
1157
|
serviceId: e.serviceId
|
|
1151
1158
|
};
|
|
1152
1159
|
}
|
|
1153
|
-
function
|
|
1154
|
-
if (e
|
|
1155
|
-
let
|
|
1156
|
-
if (
|
|
1157
|
-
|
|
1158
|
-
|
|
1160
|
+
function St(e, t) {
|
|
1161
|
+
if (e == null) return;
|
|
1162
|
+
let n = e.kind == "wait" ? e.node.notification?.taskId : e.kind == "task" && e.node.task == null ? e.node.taskId : void 0;
|
|
1163
|
+
if (n == null) return;
|
|
1164
|
+
let r = e.kind == "task" ? e.definition : t?.task(n);
|
|
1165
|
+
if (!(r == null || !("executor" in r) || r.executor.kind != "connector")) return {
|
|
1166
|
+
actionId: r.executor.action,
|
|
1167
|
+
connectionId: r.executor.connectionId,
|
|
1159
1168
|
nodeId: e.id,
|
|
1160
|
-
taskId:
|
|
1169
|
+
taskId: n
|
|
1161
1170
|
};
|
|
1162
1171
|
}
|
|
1163
|
-
|
|
1172
|
+
function Ct(e, t, n) {
|
|
1173
|
+
if (e == null) return [];
|
|
1174
|
+
let r = [];
|
|
1175
|
+
for (let i of [...O(e.revision.content).tasks].toSorted()) {
|
|
1176
|
+
let a = e.task(i);
|
|
1177
|
+
if (a?.executor.kind != "connector") continue;
|
|
1178
|
+
let o = t[a.executor.action];
|
|
1179
|
+
if (o?.authenticated != 1) continue;
|
|
1180
|
+
let s = a.executor.connectionId == null ? void 0 : n[o.serviceId]?.byId.get(a.executor.connectionId);
|
|
1181
|
+
s == null && o.defaultConnection?.connectionId == a.executor.connectionId && (s = o.defaultConnection), (a.executor.connectionId == null || n[o.serviceId] != null && s?.status != "active") && r.push({
|
|
1182
|
+
code: "task.connector-connection-required",
|
|
1183
|
+
column: 0,
|
|
1184
|
+
line: 1,
|
|
1185
|
+
message: `Connector Task "${i}" requires an active Connection.`,
|
|
1186
|
+
path: `/document/tasks/${i}/executor/connectionId`,
|
|
1187
|
+
values: { taskId: i }
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
return r;
|
|
1191
|
+
}
|
|
1192
|
+
var wt = class {
|
|
1164
1193
|
#e;
|
|
1165
1194
|
#t;
|
|
1166
1195
|
#n;
|
|
@@ -1176,43 +1205,44 @@ var yt = class {
|
|
|
1176
1205
|
#f;
|
|
1177
1206
|
#p;
|
|
1178
1207
|
#m;
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1208
|
+
#h;
|
|
1209
|
+
constructor(r, i, a, o, s = R()) {
|
|
1210
|
+
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new I(), this.#o = new I(), this.#d = t(vt), this.#h = !1, this.browseAddNodeOptions = async (e) => {
|
|
1211
|
+
if (this.#h) return;
|
|
1212
|
+
let t = this.#f.$.flowId.value;
|
|
1183
1213
|
if (t == null) return;
|
|
1184
|
-
let n = this.#
|
|
1185
|
-
if (!(e.aborted || this.#
|
|
1214
|
+
let n = this.#m ?? await this.#e.listConnectorProviders(e, t);
|
|
1215
|
+
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) => xt(e, this.#t.t));
|
|
1186
1216
|
}, this.provideAddNodeOptionChoices = async (e, t) => {
|
|
1187
|
-
if (this.#
|
|
1188
|
-
let n = this.#
|
|
1217
|
+
if (this.#h) return;
|
|
1218
|
+
let n = this.#f.$.flowId.value, r = this.#m?.find((t) => `connector-provider:${t.serviceId}` == e);
|
|
1189
1219
|
if (n == null || r == null) return;
|
|
1190
1220
|
let i = this.#r.get(r.serviceId) ?? await this.#e.listConnectorActions(r.serviceId, t, n);
|
|
1191
|
-
if (t.aborted || this.#
|
|
1221
|
+
if (t.aborted || this.#h || n != this.#f.$.flowId.value) return;
|
|
1192
1222
|
let a = i.map((e) => Object.assign({}, e, e.icon == null && r.icon != null ? { icon: r.icon } : {}, { serviceName: r.serviceName }));
|
|
1193
|
-
return this.#r.set(r.serviceId, a), this.#
|
|
1194
|
-
...this.#
|
|
1223
|
+
return this.#r.set(r.serviceId, a), this.#b({ actions: {
|
|
1224
|
+
...this.#d.value.actions,
|
|
1195
1225
|
...Object.fromEntries(a.map((e) => [e.actionId, e]))
|
|
1196
|
-
} }), a.map((e) =>
|
|
1226
|
+
} }), a.map((e) => X(e, this.#t.t));
|
|
1197
1227
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
1198
|
-
if (this.#
|
|
1199
|
-
let n = this.#
|
|
1228
|
+
if (this.#h) return;
|
|
1229
|
+
let n = this.#f.$.flowId.value;
|
|
1200
1230
|
if (n == null) return;
|
|
1201
|
-
let r = e.trim(), i = r.length == 0 ? Object.values(this.#
|
|
1202
|
-
if (t.aborted || this.#
|
|
1203
|
-
let a = { ...this.#
|
|
1231
|
+
let r = e.trim(), i = r.length == 0 ? Object.values(this.#d.value.actions) : await this.#e.searchConnectorActions(r, t, n);
|
|
1232
|
+
if (t.aborted || this.#h || n != this.#f.$.flowId.value) return;
|
|
1233
|
+
let a = { ...this.#d.value.actions };
|
|
1204
1234
|
for (let e of i) a[e.actionId] = e;
|
|
1205
|
-
if (this.#
|
|
1235
|
+
if (this.#b({ actions: a }), r.length != 0) return i.map((e) => X(e, this.#t.t));
|
|
1206
1236
|
let o = new Map(i.map((e) => [e.actionId, e]));
|
|
1207
|
-
for (let e of this.#
|
|
1237
|
+
for (let e of this.#f.$.revision.value?.connectorActionIds ?? []) {
|
|
1208
1238
|
let t = a[e];
|
|
1209
1239
|
t != null && o.set(e, t);
|
|
1210
1240
|
}
|
|
1211
|
-
return
|
|
1212
|
-
}, this.#e = r, this.#n = o, this.#
|
|
1213
|
-
let c = e(this.#
|
|
1214
|
-
this.#
|
|
1215
|
-
let t =
|
|
1241
|
+
return bt([...o.values()], this.#t.t);
|
|
1242
|
+
}, this.#e = r, this.#n = o, this.#f = i, this.#u = a, this.#t = s;
|
|
1243
|
+
let c = e(this.#d, (e) => e.actions), l = e(this.#d, (e) => e.catalogs);
|
|
1244
|
+
this.#l = n((e) => {
|
|
1245
|
+
let t = St(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
|
|
1216
1246
|
if (t == null) return { authorizationPending: !1 };
|
|
1217
1247
|
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);
|
|
1218
1248
|
return o == null && r?.defaultConnection?.connectionId == t.connectionId && (o = r.defaultConnection), {
|
|
@@ -1224,157 +1254,167 @@ var yt = class {
|
|
|
1224
1254
|
connectionError: r != null && n.connectionError?.serviceId == r.serviceId ? n.connectionError.message : void 0
|
|
1225
1255
|
};
|
|
1226
1256
|
}), this.$ = {
|
|
1227
|
-
actionLoading: e(this.#
|
|
1257
|
+
actionLoading: e(this.#d, (e) => e.actionLoading),
|
|
1228
1258
|
actions: c,
|
|
1229
1259
|
catalogs: l,
|
|
1230
|
-
connectionLoading: e(this.#
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1260
|
+
connectionLoading: e(this.#d, (e) => e.connectionLoading),
|
|
1261
|
+
diagnostics: n((e) => Ct(e(i.$.revision), e(c), e(l))),
|
|
1262
|
+
selectedAction: e(this.#l, (e) => e.action),
|
|
1263
|
+
selectedActionError: e(this.#l, (e) => e.actionError),
|
|
1264
|
+
selectedActiveConnections: e(this.#l, (e) => e.activeConnections),
|
|
1265
|
+
selectedAuthorizationPending: e(this.#l, (e) => e.authorizationPending),
|
|
1266
|
+
selectedConnection: e(this.#l, (e) => e.connection),
|
|
1267
|
+
selectedConnectionError: e(this.#l, (e) => e.connectionError)
|
|
1268
|
+
}, this.#s = i.$.flowId.reaction(() => this.reset()), this.#c = i.$.revision.reaction(() => void this.#S());
|
|
1238
1269
|
}
|
|
1239
1270
|
dispose() {
|
|
1240
|
-
this.#
|
|
1271
|
+
this.#h = !0, this.#a.invalidate(), this.#o.invalidate(), this.#s(), this.#c();
|
|
1241
1272
|
for (let e of Object.values(this.$)) e.dispose();
|
|
1242
|
-
this.#
|
|
1273
|
+
this.#l.dispose(), this.#d.dispose();
|
|
1243
1274
|
}
|
|
1244
1275
|
reset() {
|
|
1245
|
-
this.#
|
|
1276
|
+
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));
|
|
1246
1277
|
}
|
|
1247
1278
|
async refresh(e = !1) {
|
|
1248
|
-
if (this.#
|
|
1249
|
-
let t = this.#
|
|
1279
|
+
if (this.#h) return;
|
|
1280
|
+
let t = this.#o.begin(), n = this.#f.$.flowId.value, r = St(this.#f.$.selection.value, this.#f.$.revision.value);
|
|
1250
1281
|
if (n == null || r == null) {
|
|
1251
|
-
(this.#
|
|
1282
|
+
(this.#d.value.actionLoading != null || this.#d.value.connectionLoading != null) && this.#b({
|
|
1252
1283
|
actionLoading: void 0,
|
|
1253
1284
|
connectionLoading: void 0
|
|
1254
1285
|
});
|
|
1255
1286
|
return;
|
|
1256
1287
|
}
|
|
1257
|
-
this.#
|
|
1288
|
+
this.#b({
|
|
1258
1289
|
actionError: void 0,
|
|
1259
1290
|
actionLoading: r.actionId,
|
|
1260
1291
|
connectionError: void 0,
|
|
1261
1292
|
connectionLoading: void 0
|
|
1262
1293
|
});
|
|
1263
1294
|
try {
|
|
1264
|
-
let i = await this.#
|
|
1265
|
-
if (!this.#
|
|
1266
|
-
this.#
|
|
1267
|
-
...this.#
|
|
1295
|
+
let i = await this.#g(r.actionId, e);
|
|
1296
|
+
if (!this.#x(t, n)) return;
|
|
1297
|
+
this.#b({ actions: {
|
|
1298
|
+
...this.#d.value.actions,
|
|
1268
1299
|
[i.actionId]: i
|
|
1269
|
-
} }), i.authenticated && await this.#
|
|
1300
|
+
} }), i.authenticated && await this.#_(n, r, i.serviceId, e, t);
|
|
1270
1301
|
} catch (e) {
|
|
1271
|
-
this.#
|
|
1302
|
+
this.#x(t, n) && this.#b({ actionError: {
|
|
1272
1303
|
actionId: r.actionId,
|
|
1273
|
-
message:
|
|
1304
|
+
message: D(e, this.#t.t).message
|
|
1274
1305
|
} });
|
|
1275
1306
|
} finally {
|
|
1276
|
-
this.#
|
|
1307
|
+
this.#x(t, n) && this.#d.value.actionLoading == r.actionId && this.#b({ actionLoading: void 0 });
|
|
1277
1308
|
}
|
|
1278
1309
|
}
|
|
1279
1310
|
async connect(e) {
|
|
1280
|
-
if (this.#
|
|
1281
|
-
let t = this.#
|
|
1311
|
+
if (this.#h) return;
|
|
1312
|
+
let t = this.#f.$.flowId.value;
|
|
1282
1313
|
if (t == null) return;
|
|
1283
|
-
let n = this.#
|
|
1314
|
+
let n = this.#d.value.catalogs[e];
|
|
1284
1315
|
try {
|
|
1285
1316
|
if (!await this.#n.openExternalPage(() => this.#e.createConnectorConnectionPage(e, t))) {
|
|
1286
|
-
this.#
|
|
1317
|
+
this.#u({
|
|
1287
1318
|
kind: "error",
|
|
1288
1319
|
message: this.#t.t("notice.connectionPopupBlocked")
|
|
1289
1320
|
});
|
|
1290
1321
|
return;
|
|
1291
1322
|
}
|
|
1292
|
-
if (this.#
|
|
1293
|
-
this.#
|
|
1323
|
+
if (this.#h || t != this.#f.$.flowId.value) return;
|
|
1324
|
+
this.#p = {
|
|
1294
1325
|
connectionIds: new Set(n?.all.map((e) => e.connectionId)),
|
|
1295
1326
|
serviceId: e
|
|
1296
|
-
}, this.#
|
|
1327
|
+
}, this.#b({ authorizationServiceId: e });
|
|
1297
1328
|
} catch (e) {
|
|
1298
|
-
this.#
|
|
1329
|
+
this.#h || this.#u(D(e, this.#t.t));
|
|
1299
1330
|
}
|
|
1300
1331
|
}
|
|
1301
1332
|
async setConnection(e, t) {
|
|
1302
|
-
return await this.#
|
|
1333
|
+
return await this.#f.setConnectorConnection(e, t);
|
|
1303
1334
|
}
|
|
1304
1335
|
async refreshAfterAuthorization() {
|
|
1305
|
-
if (this.#
|
|
1306
|
-
let e = this.#
|
|
1307
|
-
this.#r.delete(e), this.#
|
|
1336
|
+
if (this.#h || this.#p == null) return;
|
|
1337
|
+
let e = this.#p.serviceId;
|
|
1338
|
+
this.#r.delete(e), this.#b({ authorizationServiceId: void 0 }), this.$.selectedAction.value?.serviceId == e && await this.refresh(!0), !this.#h && this.#p?.serviceId == e && (this.#p = void 0);
|
|
1308
1339
|
}
|
|
1309
|
-
async #
|
|
1310
|
-
let n = this.#
|
|
1311
|
-
return !t && n != null ? n : await this.#e.getConnectorAction(e, void 0, this.#
|
|
1340
|
+
async #g(e, t) {
|
|
1341
|
+
let n = this.#d.value.actions[e];
|
|
1342
|
+
return !t && n != null ? n : await this.#e.getConnectorAction(e, void 0, this.#f.$.flowId.value);
|
|
1312
1343
|
}
|
|
1313
|
-
async #
|
|
1314
|
-
this.#
|
|
1344
|
+
async #_(e, t, n, r, i) {
|
|
1345
|
+
this.#b({ connectionLoading: n });
|
|
1315
1346
|
try {
|
|
1316
|
-
let a = await this.#
|
|
1317
|
-
if (a == null || !this.#
|
|
1318
|
-
await this.#
|
|
1347
|
+
let a = await this.#v(e, n, r, i);
|
|
1348
|
+
if (a == null || !this.#x(i, e)) return;
|
|
1349
|
+
await this.#y(t, n, a);
|
|
1319
1350
|
} finally {
|
|
1320
|
-
this.#
|
|
1351
|
+
this.#x(i, e) && this.#d.value.connectionLoading == n && this.#b({ connectionLoading: void 0 });
|
|
1321
1352
|
}
|
|
1322
1353
|
}
|
|
1323
|
-
async #
|
|
1324
|
-
let i = this.#
|
|
1354
|
+
async #v(e, t, n, r) {
|
|
1355
|
+
let i = this.#d.value.catalogs[t];
|
|
1325
1356
|
if (!n && i != null) return i;
|
|
1326
1357
|
let a;
|
|
1327
1358
|
try {
|
|
1328
1359
|
a = await this.#e.listConnectorConnections(t, void 0, e);
|
|
1329
1360
|
} catch (n) {
|
|
1330
|
-
this.#
|
|
1331
|
-
message:
|
|
1361
|
+
this.#x(r, e) && this.#b({ connectionError: {
|
|
1362
|
+
message: D(n, this.#t.t).message,
|
|
1332
1363
|
serviceId: t
|
|
1333
1364
|
} });
|
|
1334
1365
|
return;
|
|
1335
1366
|
}
|
|
1336
|
-
if (!this.#
|
|
1367
|
+
if (!this.#x(r, e)) return;
|
|
1337
1368
|
let o = C(a);
|
|
1338
|
-
return this.#
|
|
1339
|
-
...this.#
|
|
1369
|
+
return this.#b({ catalogs: {
|
|
1370
|
+
...this.#d.value.catalogs,
|
|
1340
1371
|
[t]: o
|
|
1341
1372
|
} }), o;
|
|
1342
1373
|
}
|
|
1343
|
-
async #
|
|
1344
|
-
let r = this.#
|
|
1345
|
-
a != null && this.#
|
|
1374
|
+
async #y(e, t, n) {
|
|
1375
|
+
let r = this.#p?.serviceId == t ? this.#p : void 0, i = r == null ? [] : n.active.filter((e) => !r.connectionIds.has(e.connectionId)), a = i.length == 1 ? i[0] : n.preferred, o = this.#f.$.revision.value?.task(e.taskId);
|
|
1376
|
+
a != null && this.#f.$.selectedNodeIds.value.includes(e.nodeId) && o != null && "executor" in o && o.executor.kind == "connector" && o.executor.connectionId == null && await this.#f.setConnectorConnection(e.taskId, a.connectionId);
|
|
1346
1377
|
}
|
|
1347
|
-
#
|
|
1348
|
-
this.#
|
|
1349
|
-
...this.#
|
|
1378
|
+
#b(e) {
|
|
1379
|
+
this.#h || this.#d.set({
|
|
1380
|
+
...this.#d.value,
|
|
1350
1381
|
...e
|
|
1351
1382
|
});
|
|
1352
1383
|
}
|
|
1353
|
-
#
|
|
1354
|
-
return !this.#
|
|
1384
|
+
#x(e, t) {
|
|
1385
|
+
return !this.#h && e() && t == this.#f.$.flowId.value;
|
|
1355
1386
|
}
|
|
1356
|
-
async #
|
|
1357
|
-
if (this.#
|
|
1358
|
-
let e = this.#a.
|
|
1387
|
+
async #S() {
|
|
1388
|
+
if (this.#h) return;
|
|
1389
|
+
let e = this.#a.begin(), t = this.#f.$.flowId.value, n = this.#f.$.revision.value;
|
|
1359
1390
|
if (t == null || n == null) return;
|
|
1360
|
-
let r = [...n.connectorActionIds].filter((e) => this.#
|
|
1361
|
-
if (r.length
|
|
1391
|
+
let r = [...n.connectorActionIds].filter((e) => this.#d.value.actions[e] == null && !this.#i.has(e));
|
|
1392
|
+
if (r.length > 0) {
|
|
1362
1393
|
for (let e of r) this.#i.add(e);
|
|
1363
1394
|
try {
|
|
1364
1395
|
let n = await Promise.all(r.map((e) => this.#e.getConnectorAction(e, void 0, t)));
|
|
1365
|
-
if (!this.#
|
|
1366
|
-
let i = { ...this.#
|
|
1396
|
+
if (!this.#x(e, t)) return;
|
|
1397
|
+
let i = { ...this.#d.value.actions };
|
|
1367
1398
|
for (let e of n) i[e.actionId] = e;
|
|
1368
|
-
this.#
|
|
1399
|
+
this.#b({ actions: i });
|
|
1369
1400
|
} catch {
|
|
1370
1401
|
return;
|
|
1371
1402
|
} finally {
|
|
1372
1403
|
for (let e of r) this.#i.delete(e);
|
|
1373
1404
|
}
|
|
1374
1405
|
}
|
|
1406
|
+
if (!this.#x(e, t)) return;
|
|
1407
|
+
let i = /* @__PURE__ */ new Set();
|
|
1408
|
+
for (let e of O(n.revision.content).tasks) {
|
|
1409
|
+
let t = n.task(e);
|
|
1410
|
+
if (t?.executor.kind != "connector") continue;
|
|
1411
|
+
let r = this.#d.value.actions[t.executor.action];
|
|
1412
|
+
r?.authenticated == 1 && i.add(r.serviceId);
|
|
1413
|
+
}
|
|
1414
|
+
await Promise.all([...i].map((n) => this.#v(t, n, !1, e)));
|
|
1375
1415
|
}
|
|
1376
|
-
},
|
|
1377
|
-
function
|
|
1416
|
+
}, Tt = { catalogs: {} }, Et = "trigger:";
|
|
1417
|
+
function Z(e, t) {
|
|
1378
1418
|
if (e?.kind != "trigger") return;
|
|
1379
1419
|
let n = e.trigger;
|
|
1380
1420
|
if (n.kind != "poll" && n.kind != "integration") return;
|
|
@@ -1385,11 +1425,15 @@ function Y(e, t) {
|
|
|
1385
1425
|
triggerId: e.id
|
|
1386
1426
|
};
|
|
1387
1427
|
}
|
|
1388
|
-
function
|
|
1428
|
+
function Dt(e, t) {
|
|
1389
1429
|
return {
|
|
1390
1430
|
description: t.t("addNode.triggerNeedsConnection", { provider: e.provider }),
|
|
1391
1431
|
group: t.t("addNode.triggers"),
|
|
1392
|
-
|
|
1432
|
+
icon: T({
|
|
1433
|
+
serviceId: e.provider,
|
|
1434
|
+
serviceName: e.provider
|
|
1435
|
+
}),
|
|
1436
|
+
id: `${Et}${e.key}`,
|
|
1393
1437
|
inputs: [],
|
|
1394
1438
|
kind: "trigger",
|
|
1395
1439
|
label: e.displayName,
|
|
@@ -1403,7 +1447,7 @@ function St(e, t) {
|
|
|
1403
1447
|
}
|
|
1404
1448
|
};
|
|
1405
1449
|
}
|
|
1406
|
-
var
|
|
1450
|
+
var Ot = class {
|
|
1407
1451
|
#e;
|
|
1408
1452
|
#t;
|
|
1409
1453
|
#n;
|
|
@@ -1415,12 +1459,12 @@ var Ct = class {
|
|
|
1415
1459
|
#c;
|
|
1416
1460
|
#l;
|
|
1417
1461
|
#u;
|
|
1418
|
-
constructor(r, i, a, o, s =
|
|
1419
|
-
this.#t = new AbortController(), this.#a = new
|
|
1462
|
+
constructor(r, i, a, o, s = R()) {
|
|
1463
|
+
this.#t = new AbortController(), this.#a = new I(), this.#c = t(Tt), this.#u = !1, this.browseAddNodeOptions = async (e) => {
|
|
1420
1464
|
let t = this.#l.$.flowId.value;
|
|
1421
1465
|
if (e.aborted || this.#u || t == null || this.#l.$.target.value?.kind != "flow") return [];
|
|
1422
1466
|
let n = await this.#d();
|
|
1423
|
-
if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) =>
|
|
1467
|
+
if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) => Dt(e, this.#i));
|
|
1424
1468
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
1425
1469
|
let n = this.#l.$.flowId.value;
|
|
1426
1470
|
if (t.aborted || this.#u || n == null || this.#l.$.target.value?.kind != "flow") return [];
|
|
@@ -1434,9 +1478,9 @@ var Ct = class {
|
|
|
1434
1478
|
e.name,
|
|
1435
1479
|
e.provider,
|
|
1436
1480
|
e.type
|
|
1437
|
-
].some((e) => e.toLowerCase().includes(r))).map((e) =>
|
|
1481
|
+
].some((e) => e.toLowerCase().includes(r))).map((e) => Dt(e, this.#i));
|
|
1438
1482
|
}, this.#n = r, this.#r = o, this.#i = s, this.#s = a, this.#l = i, this.#o = n((e) => {
|
|
1439
|
-
let t = e(i.$.selection), n =
|
|
1483
|
+
let t = e(i.$.selection), n = Z(t, i), r = e(this.#c);
|
|
1440
1484
|
if (t?.kind != "trigger") return { authorizationPending: !1 };
|
|
1441
1485
|
let a = t.trigger;
|
|
1442
1486
|
if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
|
|
@@ -1463,10 +1507,10 @@ var Ct = class {
|
|
|
1463
1507
|
this.#o.dispose(), this.#c.dispose();
|
|
1464
1508
|
}
|
|
1465
1509
|
reset() {
|
|
1466
|
-
this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(
|
|
1510
|
+
this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(Tt));
|
|
1467
1511
|
}
|
|
1468
1512
|
async refresh(e = !1) {
|
|
1469
|
-
let t = this.#a.begin(), n = this.#l.$.flowId.value, r =
|
|
1513
|
+
let t = this.#a.begin(), n = this.#l.$.flowId.value, r = Z(this.#l.$.selection.value, this.#l);
|
|
1470
1514
|
if (!this.#u) {
|
|
1471
1515
|
if (n == null || r == null) {
|
|
1472
1516
|
this.#c.value.connectionLoading != null && this.#f({ connectionLoading: void 0 });
|
|
@@ -1486,7 +1530,7 @@ var Ct = class {
|
|
|
1486
1530
|
} });
|
|
1487
1531
|
} catch (e) {
|
|
1488
1532
|
this.#p(t, n) && this.#f({ connectionError: {
|
|
1489
|
-
message:
|
|
1533
|
+
message: D(e, this.#i.t).message,
|
|
1490
1534
|
provider: r.provider
|
|
1491
1535
|
} });
|
|
1492
1536
|
} finally {
|
|
@@ -1507,7 +1551,7 @@ var Ct = class {
|
|
|
1507
1551
|
}
|
|
1508
1552
|
!this.#u && t == this.#l.$.flowId.value && this.#f({ authorizationProvider: e });
|
|
1509
1553
|
} catch (e) {
|
|
1510
|
-
this.#u || this.#s(
|
|
1554
|
+
this.#u || this.#s(D(e, this.#i.t));
|
|
1511
1555
|
}
|
|
1512
1556
|
}
|
|
1513
1557
|
async setConnection(e, t) {
|
|
@@ -1523,7 +1567,7 @@ var Ct = class {
|
|
|
1523
1567
|
delete t[e], this.#f({
|
|
1524
1568
|
authorizationProvider: void 0,
|
|
1525
1569
|
catalogs: t
|
|
1526
|
-
}),
|
|
1570
|
+
}), Z(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
|
|
1527
1571
|
}
|
|
1528
1572
|
#d() {
|
|
1529
1573
|
if (this.#e != null) return this.#e;
|
|
@@ -1543,46 +1587,28 @@ var Ct = class {
|
|
|
1543
1587
|
}
|
|
1544
1588
|
};
|
|
1545
1589
|
//#endregion
|
|
1546
|
-
//#region src/workbench/browser/runtime/designer/remoteChangeTargets.ts
|
|
1547
|
-
function wt(e, t) {
|
|
1548
|
-
return e.kind == t.kind && (e.kind != "subflow" || t.kind == "subflow" && e.id == t.id);
|
|
1549
|
-
}
|
|
1550
|
-
function X(e, t, n, r) {
|
|
1551
|
-
for (let [i, a] of Object.entries(t.graph(n)?.nodes ?? {})) r(a) && e.add(i);
|
|
1552
|
-
}
|
|
1553
|
-
function Tt(e, t, n, r) {
|
|
1554
|
-
let i = /* @__PURE__ */ new Set();
|
|
1555
|
-
for (let a of r) switch (a.kind) {
|
|
1556
|
-
case "graph.node.create":
|
|
1557
|
-
case "graph.node.replace":
|
|
1558
|
-
wt(a.target, n) && i.add(a.nodeId);
|
|
1559
|
-
break;
|
|
1560
|
-
case "task.replace":
|
|
1561
|
-
X(i, e, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId), X(i, t, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId);
|
|
1562
|
-
break;
|
|
1563
|
-
case "module.source.replace":
|
|
1564
|
-
X(i, e, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId), X(i, t, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId);
|
|
1565
|
-
break;
|
|
1566
|
-
case "subflow.definition.replace": X(i, e, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId), X(i, t, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId);
|
|
1567
|
-
}
|
|
1568
|
-
return new Set([...i].filter((e) => t.selection(n, e) != null));
|
|
1569
|
-
}
|
|
1570
|
-
//#endregion
|
|
1571
1590
|
//#region src/workbench/browser/runtime/stores/draftChanges.ts
|
|
1572
|
-
function
|
|
1573
|
-
if (e.length != 1) return;
|
|
1574
|
-
let
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1591
|
+
function kt(e, t) {
|
|
1592
|
+
if (e.length != 1 || t.length != 1) return;
|
|
1593
|
+
let n = e[0], r = t[0];
|
|
1594
|
+
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 : [{
|
|
1595
|
+
before: n.before,
|
|
1596
|
+
field: r.field,
|
|
1597
|
+
kind: r.kind,
|
|
1598
|
+
nodeId: r.nodeId,
|
|
1599
|
+
target: r.target,
|
|
1600
|
+
value: r.value
|
|
1601
|
+
}];
|
|
1602
|
+
if (n?.kind == "graph.node.input.set" && r?.kind == "graph.node.input.set") return n.nodeId != r.nodeId || n.handle != r.handle || n.target.kind != r.target.kind || n.target.kind == "subflow" && (r.target.kind != "subflow" || n.target.id != r.target.id) ? void 0 : [{
|
|
1603
|
+
before: n.before,
|
|
1604
|
+
handle: r.handle,
|
|
1605
|
+
kind: r.kind,
|
|
1606
|
+
nodeId: r.nodeId,
|
|
1607
|
+
target: r.target,
|
|
1608
|
+
value: r.value
|
|
1609
|
+
}];
|
|
1584
1610
|
}
|
|
1585
|
-
var
|
|
1611
|
+
var At = class {
|
|
1586
1612
|
#e;
|
|
1587
1613
|
#t;
|
|
1588
1614
|
#n;
|
|
@@ -1608,39 +1634,49 @@ var Dt = class {
|
|
|
1608
1634
|
}
|
|
1609
1635
|
replaceCommitted(e) {
|
|
1610
1636
|
this.#a = e;
|
|
1637
|
+
let t = e, n = [];
|
|
1638
|
+
for (let e of this.#o) try {
|
|
1639
|
+
t = V(t, e.changes), n.push(e);
|
|
1640
|
+
} catch (t) {
|
|
1641
|
+
if (!(t instanceof h)) throw t;
|
|
1642
|
+
e.active = !1;
|
|
1643
|
+
}
|
|
1644
|
+
return this.#o = n, t;
|
|
1611
1645
|
}
|
|
1612
1646
|
project(e) {
|
|
1613
|
-
return this.#o.reduce((e, t) =>
|
|
1647
|
+
return this.#o.reduce((e, t) => V(e, t.changes), e);
|
|
1614
1648
|
}
|
|
1615
1649
|
enqueue(e) {
|
|
1616
1650
|
let t = this.#s.then(e);
|
|
1617
1651
|
return this.#s = t, t;
|
|
1618
1652
|
}
|
|
1619
1653
|
async change(e, t, n, r = !0) {
|
|
1620
|
-
this.#
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
let
|
|
1654
|
+
let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 : kt(i.changes, n);
|
|
1655
|
+
if (i != null && a != null) return i.changes = a, this.#a != null && this.#t.apply(this.project(this.#a)), i.result;
|
|
1656
|
+
this.#t.beforeChange(r);
|
|
1657
|
+
let o = {
|
|
1624
1658
|
...e,
|
|
1659
|
+
active: !0,
|
|
1660
|
+
changeId: crypto.randomUUID(),
|
|
1625
1661
|
changes: n,
|
|
1626
1662
|
started: !1
|
|
1627
1663
|
};
|
|
1628
|
-
this.#a ??= t, this.#o.push(
|
|
1629
|
-
let
|
|
1630
|
-
|
|
1664
|
+
this.#a ??= t, this.#o.push(o), this.#t.apply(this.project(this.#a)), this.#i += 1;
|
|
1665
|
+
let s = this.#s.then(() => (o.started = !0, this.#c(o)));
|
|
1666
|
+
o.result = s, this.#s = s.then(() => void 0);
|
|
1631
1667
|
try {
|
|
1632
|
-
return await
|
|
1668
|
+
return await s;
|
|
1633
1669
|
} finally {
|
|
1634
1670
|
--this.#i, this.#i == 0 && this.#t.finishChanges();
|
|
1635
1671
|
}
|
|
1636
1672
|
}
|
|
1637
1673
|
async #c(e) {
|
|
1638
1674
|
let t = !1;
|
|
1639
|
-
for (; this.#t.current(e);) {
|
|
1675
|
+
for (; e.active && this.#t.current(e);) {
|
|
1640
1676
|
let n = this.#a;
|
|
1641
1677
|
if (n == null) return;
|
|
1642
1678
|
try {
|
|
1643
|
-
let t = await this.#e.changeDraft(e.flowId, n.revisionId, e.changes);
|
|
1679
|
+
let t = await this.#e.changeDraft(e.flowId, n.revisionId, e.changes, e.changeId);
|
|
1644
1680
|
if (!this.#t.current(e)) return;
|
|
1645
1681
|
if (t.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft change response.");
|
|
1646
1682
|
let r = this.#l(e, n, t);
|
|
@@ -1648,14 +1684,20 @@ var Dt = class {
|
|
|
1648
1684
|
} catch (n) {
|
|
1649
1685
|
if (n instanceof B && n.code == "flow.revision-conflict") {
|
|
1650
1686
|
if (!t && await this.#t.recover(e)) {
|
|
1651
|
-
t = !0;
|
|
1687
|
+
t = !0, e.changeId = crypto.randomUUID();
|
|
1652
1688
|
continue;
|
|
1653
1689
|
}
|
|
1654
|
-
t && await this.#t.recover(e), this.#u(e)
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1690
|
+
t && await this.#t.recover(e), this.#u(e);
|
|
1691
|
+
} else {
|
|
1692
|
+
if (!(n instanceof B) && !t) {
|
|
1693
|
+
let n = this.#a?.revisionId;
|
|
1694
|
+
if (await this.#t.recover(e)) {
|
|
1695
|
+
t = !0, e.active && this.#a?.revisionId != n && (e.changeId = crypto.randomUUID());
|
|
1696
|
+
continue;
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
this.#u(e), this.#t.current(e) && this.#r(D(n, this.#n.t));
|
|
1700
|
+
}
|
|
1659
1701
|
return;
|
|
1660
1702
|
}
|
|
1661
1703
|
}
|
|
@@ -1663,28 +1705,28 @@ var Dt = class {
|
|
|
1663
1705
|
#l(e, t, n) {
|
|
1664
1706
|
let r = {
|
|
1665
1707
|
...n.revision,
|
|
1666
|
-
content:
|
|
1708
|
+
content: V(t, e.changes).content
|
|
1667
1709
|
};
|
|
1668
1710
|
this.#o = this.#o.filter((t) => t !== e), this.#a = r;
|
|
1669
1711
|
let i = this.#t.diagnostics(), a = this.#o.length == 0 && i?.revisionId == r.revisionId;
|
|
1670
1712
|
return this.#t.apply(this.project(r), a), this.#t.headChanged(e.flowId, r.revisionId), r;
|
|
1671
1713
|
}
|
|
1672
1714
|
#u(e) {
|
|
1673
|
-
this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
|
|
1715
|
+
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));
|
|
1674
1716
|
}
|
|
1675
|
-
},
|
|
1717
|
+
}, jt = 50, Mt = {
|
|
1676
1718
|
failed: !1,
|
|
1677
1719
|
loaded: !1,
|
|
1678
1720
|
loading: !0,
|
|
1679
1721
|
loadingMore: !1,
|
|
1680
1722
|
loadMoreFailed: !1,
|
|
1681
1723
|
flows: []
|
|
1682
|
-
},
|
|
1724
|
+
}, Nt = class {
|
|
1683
1725
|
#e;
|
|
1684
1726
|
#t;
|
|
1685
|
-
#n = new
|
|
1727
|
+
#n = new I();
|
|
1686
1728
|
#r;
|
|
1687
|
-
#i = t(
|
|
1729
|
+
#i = t(Mt);
|
|
1688
1730
|
#a = !1;
|
|
1689
1731
|
constructor(t, n, r) {
|
|
1690
1732
|
this.#e = t, this.#t = r, this.#r = n, this.$ = {
|
|
@@ -1726,7 +1768,7 @@ var Dt = class {
|
|
|
1726
1768
|
try {
|
|
1727
1769
|
let t = await this.#e.listFlows({
|
|
1728
1770
|
includeTotal: !0,
|
|
1729
|
-
limit:
|
|
1771
|
+
limit: jt
|
|
1730
1772
|
});
|
|
1731
1773
|
if (!e()) return;
|
|
1732
1774
|
this.#o({
|
|
@@ -1741,7 +1783,7 @@ var Dt = class {
|
|
|
1741
1783
|
this.#o({
|
|
1742
1784
|
failed: !0,
|
|
1743
1785
|
loading: !1
|
|
1744
|
-
}), this.#r(
|
|
1786
|
+
}), this.#r(D(t, this.#t.t));
|
|
1745
1787
|
}
|
|
1746
1788
|
}
|
|
1747
1789
|
async loadMore() {
|
|
@@ -1755,7 +1797,7 @@ var Dt = class {
|
|
|
1755
1797
|
try {
|
|
1756
1798
|
let e = await this.#e.listFlows({
|
|
1757
1799
|
cursor: t,
|
|
1758
|
-
limit:
|
|
1800
|
+
limit: jt
|
|
1759
1801
|
});
|
|
1760
1802
|
if (!n()) return;
|
|
1761
1803
|
let r = new Set(this.#i.value.flows.map((e) => e.flowId));
|
|
@@ -1769,7 +1811,7 @@ var Dt = class {
|
|
|
1769
1811
|
this.#o({
|
|
1770
1812
|
loadingMore: !1,
|
|
1771
1813
|
loadMoreFailed: !0
|
|
1772
|
-
}), this.#r(
|
|
1814
|
+
}), this.#r(D(e, this.#t.t));
|
|
1773
1815
|
}
|
|
1774
1816
|
}
|
|
1775
1817
|
async create(e) {
|
|
@@ -1811,7 +1853,7 @@ var Dt = class {
|
|
|
1811
1853
|
...e
|
|
1812
1854
|
});
|
|
1813
1855
|
}
|
|
1814
|
-
},
|
|
1856
|
+
}, Pt = class {
|
|
1815
1857
|
#e;
|
|
1816
1858
|
#t;
|
|
1817
1859
|
#n;
|
|
@@ -1862,9 +1904,9 @@ var Dt = class {
|
|
|
1862
1904
|
message: this.#t.t("notice.layoutConflict")
|
|
1863
1905
|
});
|
|
1864
1906
|
} catch (e) {
|
|
1865
|
-
!this.#o && n() && this.#n(
|
|
1907
|
+
!this.#o && n() && this.#n(D(e, this.#t.t));
|
|
1866
1908
|
}
|
|
1867
|
-
else this.#c(a, t), this.#n(
|
|
1909
|
+
else this.#c(a, t), this.#n(D(r, this.#t.t));
|
|
1868
1910
|
}
|
|
1869
1911
|
}), await this.#i;
|
|
1870
1912
|
}
|
|
@@ -1876,21 +1918,21 @@ var Dt = class {
|
|
|
1876
1918
|
value: n
|
|
1877
1919
|
});
|
|
1878
1920
|
}
|
|
1879
|
-
},
|
|
1921
|
+
}, Ft = {
|
|
1880
1922
|
checkLoading: !1,
|
|
1881
1923
|
selectedNodeIds: [],
|
|
1882
1924
|
workspaceLoadFailed: !1,
|
|
1883
1925
|
workspaceLoading: !1
|
|
1884
1926
|
};
|
|
1885
|
-
function
|
|
1927
|
+
function It(e) {
|
|
1886
1928
|
return e.workspaceLoading ? "loading" : e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved";
|
|
1887
1929
|
}
|
|
1888
|
-
function
|
|
1930
|
+
function Q(e, t) {
|
|
1889
1931
|
if (t.phase != null) return t.phase;
|
|
1890
1932
|
let n = e?.content.modules[t.moduleId];
|
|
1891
1933
|
return n == null ? "failed" : t.source == n.source ? "saved" : "dirty";
|
|
1892
1934
|
}
|
|
1893
|
-
function
|
|
1935
|
+
function $(e, t, n) {
|
|
1894
1936
|
if (e == null || t == null || n.length != 1) return;
|
|
1895
1937
|
let r = e.node(t, n[0]);
|
|
1896
1938
|
if (!(r?.kind != "task" || r.definition == null || !("moduleId" in r.definition) || r.module == null)) return {
|
|
@@ -1898,9 +1940,9 @@ function Q(e, t, n) {
|
|
|
1898
1940
|
source: r.module.source
|
|
1899
1941
|
};
|
|
1900
1942
|
}
|
|
1901
|
-
var
|
|
1943
|
+
var Lt = class {
|
|
1902
1944
|
#e;
|
|
1903
|
-
#t = t(
|
|
1945
|
+
#t = t(Ft);
|
|
1904
1946
|
#n;
|
|
1905
1947
|
constructor(t, r) {
|
|
1906
1948
|
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) => {
|
|
@@ -1908,25 +1950,25 @@ var Pt = class {
|
|
|
1908
1950
|
let { phase: t, ...n } = e.moduleEditor;
|
|
1909
1951
|
return {
|
|
1910
1952
|
...n,
|
|
1911
|
-
status:
|
|
1953
|
+
status: Q(e.draft, e.moduleEditor)
|
|
1912
1954
|
};
|
|
1913
|
-
}), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 :
|
|
1955
|
+
}), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 : L(e.draft)), h = e(this.#t, (e) => e.selectedNodeIds), g = e(this.#t, (e) => e.target), _ = e(this.#t, (e) => e.workspaceLoadFailed), v = e(this.#t, (e) => e.workspaceLoading);
|
|
1914
1956
|
this.#e = e(this.#t, (e) => ({
|
|
1915
|
-
revision: e.draft == null ? void 0 :
|
|
1957
|
+
revision: e.draft == null ? void 0 : L(e.draft),
|
|
1916
1958
|
target: e.target
|
|
1917
1959
|
}), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
|
|
1918
1960
|
let y = e(this.#t, (e) => {
|
|
1919
|
-
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return
|
|
1961
|
+
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return L(e.draft).selection(e.target, e.selectedNodeIds[0]);
|
|
1920
1962
|
});
|
|
1921
1963
|
this.$ = {
|
|
1922
1964
|
addNodeOptions: n((e) => {
|
|
1923
1965
|
let { revision: n, target: r } = e(this.#e);
|
|
1924
|
-
return
|
|
1966
|
+
return Pe(n?.revision, r, e(t.t$));
|
|
1925
1967
|
}),
|
|
1926
1968
|
busy: i,
|
|
1927
1969
|
checkLoading: a,
|
|
1928
1970
|
diagnosticFocus: o,
|
|
1929
|
-
diagnosticItems: e(this.#t, (e) =>
|
|
1971
|
+
diagnosticItems: e(this.#t, (e) => E(e.draft == null ? void 0 : L(e.draft), e.target, e.diagnostics)),
|
|
1930
1972
|
diagnostics: s,
|
|
1931
1973
|
draft: c,
|
|
1932
1974
|
flow: n((e) => {
|
|
@@ -1941,7 +1983,7 @@ var Pt = class {
|
|
|
1941
1983
|
flowNextCursor: r.$.nextCursor,
|
|
1942
1984
|
flowTotal: r.$.total,
|
|
1943
1985
|
flows: r.$.flows,
|
|
1944
|
-
inspectorDiagnostics: e(this.#t, (e) =>
|
|
1986
|
+
inspectorDiagnostics: e(this.#t, (e) => te(e.draft == null ? void 0 : L(e.draft), e.target, e.diagnostics, y.value)),
|
|
1945
1987
|
live: p,
|
|
1946
1988
|
moduleDiagnostics: e(this.#t, (e) => {
|
|
1947
1989
|
let t = e.moduleEditor?.moduleId;
|
|
@@ -1953,11 +1995,11 @@ var Pt = class {
|
|
|
1953
1995
|
revision: m,
|
|
1954
1996
|
selection: y,
|
|
1955
1997
|
selectedNodeIds: h,
|
|
1956
|
-
status: e(this.#t,
|
|
1998
|
+
status: e(this.#t, It),
|
|
1957
1999
|
target: g,
|
|
1958
2000
|
targetFlow: n((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
|
|
1959
2001
|
targetName: e(this.#t, (e) => {
|
|
1960
|
-
if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id :
|
|
2002
|
+
if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : L(e.draft).subflow(e.target.id)?.name ?? e.target.id;
|
|
1961
2003
|
}),
|
|
1962
2004
|
workspaceLoadFailed: _,
|
|
1963
2005
|
workspaceLoading: v
|
|
@@ -1976,17 +2018,16 @@ var Pt = class {
|
|
|
1976
2018
|
for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
|
|
1977
2019
|
this.#e.dispose(), this.#t.dispose();
|
|
1978
2020
|
}
|
|
1979
|
-
}
|
|
1980
|
-
|
|
2021
|
+
};
|
|
2022
|
+
//#endregion
|
|
2023
|
+
//#region src/workbench/browser/runtime/stores/workspaceStore.ts
|
|
2024
|
+
function Rt(e, t) {
|
|
1981
2025
|
if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
|
|
1982
2026
|
}
|
|
1983
|
-
|
|
1984
|
-
return e?.kind == t?.kind ? e?.kind != "subflow" || t?.kind == "subflow" && e.id == t.id : !1;
|
|
1985
|
-
}
|
|
1986
|
-
var Lt = class {
|
|
2027
|
+
var zt = class {
|
|
1987
2028
|
#e;
|
|
1988
2029
|
#t;
|
|
1989
|
-
#n = new
|
|
2030
|
+
#n = new I();
|
|
1990
2031
|
#r;
|
|
1991
2032
|
#i;
|
|
1992
2033
|
#a;
|
|
@@ -1997,36 +2038,33 @@ var Lt = class {
|
|
|
1997
2038
|
#u;
|
|
1998
2039
|
#d = 0;
|
|
1999
2040
|
#f = 0;
|
|
2000
|
-
#p;
|
|
2001
|
-
#m =
|
|
2041
|
+
#p = !1;
|
|
2042
|
+
#m = !1;
|
|
2002
2043
|
#h = !1;
|
|
2003
|
-
#g =
|
|
2004
|
-
#_
|
|
2005
|
-
#v
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
constructor(e, t, n = it, r = T(), i = () => {}) {
|
|
2010
|
-
this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new At(e, t, r), this.#l = new Pt(r, this.#o), this.#t = new Dt(e, t, r, {
|
|
2011
|
-
apply: (e, t) => this.#w(e, t),
|
|
2044
|
+
#g = 0;
|
|
2045
|
+
#_;
|
|
2046
|
+
#v;
|
|
2047
|
+
constructor(e, t, n = ct, r = R(), i = () => {}) {
|
|
2048
|
+
this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new Nt(e, t, r), this.#l = new Lt(r, this.#o), this.#t = new At(e, t, r, {
|
|
2049
|
+
apply: (e, t) => this.#x(e, t),
|
|
2012
2050
|
beforeChange: (e) => {
|
|
2013
|
-
|
|
2051
|
+
e && (this.#N({ busy: "designer" }), this.#c(void 0));
|
|
2014
2052
|
},
|
|
2015
|
-
check: () => void this.#
|
|
2016
|
-
current: (e) => this.#
|
|
2053
|
+
check: () => void this.#C(),
|
|
2054
|
+
current: (e) => this.#M(e),
|
|
2017
2055
|
diagnostics: () => this.#l.value.diagnostics,
|
|
2018
2056
|
finishChanges: () => {
|
|
2019
|
-
!this.#
|
|
2057
|
+
!this.#m && this.#l.value.busy == "designer" && this.#N({ busy: void 0 });
|
|
2020
2058
|
},
|
|
2021
|
-
headChanged: (e, t) => this.#
|
|
2022
|
-
recover: (e) => this.#
|
|
2023
|
-
}), this.#a = new
|
|
2059
|
+
headChanged: (e, t) => this.#E(e, t),
|
|
2060
|
+
recover: (e) => this.#T(e, !0)
|
|
2061
|
+
}), this.#a = new Pt(e, t, (e) => this.#N({ presentation: e }), r), this.$ = this.#l.$;
|
|
2024
2062
|
}
|
|
2025
2063
|
dispose() {
|
|
2026
|
-
this.#
|
|
2064
|
+
this.#m = !0, this.#n.invalidate(), this.#a.dispose(), this.#_?.(), this.#v?.(), this.#l.dispose(), this.#o.dispose();
|
|
2027
2065
|
}
|
|
2028
2066
|
async start(e) {
|
|
2029
|
-
this.#
|
|
2067
|
+
this.#_ ??= this.#e.watchFlowCatalog(() => void this.reloadFlows()), await this.reloadFlows(), await this.selectFlow(e);
|
|
2030
2068
|
}
|
|
2031
2069
|
async reloadFlows() {
|
|
2032
2070
|
await this.#o.reload();
|
|
@@ -2035,10 +2073,9 @@ var Lt = class {
|
|
|
2035
2073
|
await this.#o.loadMore();
|
|
2036
2074
|
}
|
|
2037
2075
|
async selectFlow(e) {
|
|
2038
|
-
if (!this.#
|
|
2039
|
-
this.#M();
|
|
2076
|
+
if (!this.#O()) return !1;
|
|
2040
2077
|
let t = this.#n.begin();
|
|
2041
|
-
if (this.#t.reset(), this.#a.reset(), this.#f = 0, this.#
|
|
2078
|
+
if (this.#t.reset(), this.#a.reset(), this.#f = 0, this.#p = !1, this.#h = !1, this.#v?.(), this.#v = void 0, this.#N({
|
|
2042
2079
|
checkLoading: !1,
|
|
2043
2080
|
diagnosticFocus: void 0,
|
|
2044
2081
|
diagnostics: void 0,
|
|
@@ -2061,78 +2098,78 @@ var Lt = class {
|
|
|
2061
2098
|
this.#e.getPresentation(e)
|
|
2062
2099
|
]);
|
|
2063
2100
|
if (!t()) return !1;
|
|
2064
|
-
this.#t.reset(i), this.#a.reset(o), this.#o.include(r), this.#
|
|
2101
|
+
this.#t.reset(i), this.#a.reset(o), this.#o.include(r), this.#N({
|
|
2065
2102
|
draft: i,
|
|
2066
2103
|
live: a,
|
|
2067
2104
|
presentation: o,
|
|
2068
2105
|
target: { kind: "flow" },
|
|
2069
2106
|
workspaceLoadFailed: !1,
|
|
2070
2107
|
workspaceLoading: !1
|
|
2071
|
-
}), this.#
|
|
2072
|
-
!this.#
|
|
2108
|
+
}), this.#C(), this.#v = this.#e.watchFlow(e, (e) => {
|
|
2109
|
+
!this.#m && e != this.#t.committed?.revisionId && this.#w(e);
|
|
2073
2110
|
}, this.#s);
|
|
2074
2111
|
} catch (e) {
|
|
2075
|
-
return t() ? (this.#
|
|
2112
|
+
return t() ? (this.#N({
|
|
2076
2113
|
workspaceLoadFailed: !0,
|
|
2077
2114
|
workspaceLoading: !1
|
|
2078
|
-
}), this.#c(
|
|
2115
|
+
}), this.#c(D(e, this.#r.t)), !1) : !1;
|
|
2079
2116
|
}
|
|
2080
2117
|
return !0;
|
|
2081
2118
|
}
|
|
2082
2119
|
selectTarget(e) {
|
|
2083
|
-
return this.#
|
|
2120
|
+
return this.#O() ? (this.#N({
|
|
2084
2121
|
diagnosticFocus: void 0,
|
|
2085
2122
|
diagnostics: void 0,
|
|
2086
2123
|
moduleEditor: void 0,
|
|
2087
2124
|
nodeFocus: void 0,
|
|
2088
2125
|
selectedNodeIds: [],
|
|
2089
2126
|
target: e
|
|
2090
|
-
}), this.#
|
|
2127
|
+
}), this.#C(), !0) : !1;
|
|
2091
2128
|
}
|
|
2092
2129
|
selectNodes(e) {
|
|
2093
|
-
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#
|
|
2130
|
+
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#O() ? (this.#N({
|
|
2094
2131
|
diagnosticFocus: void 0,
|
|
2095
|
-
moduleEditor:
|
|
2132
|
+
moduleEditor: $(this.#l.value.draft == null ? void 0 : L(this.#l.value.draft), this.#l.value.target, e),
|
|
2096
2133
|
nodeFocus: void 0,
|
|
2097
2134
|
selectedNodeIds: e
|
|
2098
2135
|
}), !0) : !1;
|
|
2099
2136
|
}
|
|
2100
2137
|
async createFlow(e, t) {
|
|
2101
|
-
if (this.#
|
|
2102
|
-
this.#
|
|
2138
|
+
if (this.#O()) {
|
|
2139
|
+
this.#N({ busy: "flow" }), this.#c(void 0);
|
|
2103
2140
|
try {
|
|
2104
2141
|
if (t == null) return await this.#o.create(e);
|
|
2105
2142
|
let n = await this.#e.getFlow(await t(e));
|
|
2106
2143
|
return this.#o.insert(n), n;
|
|
2107
2144
|
} catch (e) {
|
|
2108
|
-
this.#
|
|
2145
|
+
this.#m || this.#c(D(e, this.#r.t));
|
|
2109
2146
|
} finally {
|
|
2110
|
-
this.#
|
|
2147
|
+
this.#N({ busy: void 0 });
|
|
2111
2148
|
}
|
|
2112
2149
|
}
|
|
2113
2150
|
}
|
|
2114
2151
|
async deleteFlow(e) {
|
|
2115
|
-
if (!this.#
|
|
2152
|
+
if (!this.#O()) return !1;
|
|
2116
2153
|
let t = this.#o.flow(e);
|
|
2117
2154
|
if (t == null || t.status == "retiring") return !1;
|
|
2118
|
-
this.#
|
|
2155
|
+
this.#N({ busy: "flow" }), this.#c(void 0);
|
|
2119
2156
|
try {
|
|
2120
|
-
return await this.#e.deleteFlow(e), !this.#
|
|
2157
|
+
return await this.#e.deleteFlow(e), !this.#m && (this.#o.remove(e), this.#c({
|
|
2121
2158
|
kind: "success",
|
|
2122
2159
|
message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
|
|
2123
2160
|
}), !0);
|
|
2124
2161
|
} catch (e) {
|
|
2125
|
-
return this.#
|
|
2162
|
+
return this.#m || this.#c(D(e, this.#r.t)), !1;
|
|
2126
2163
|
} finally {
|
|
2127
|
-
this.#
|
|
2164
|
+
this.#N({ busy: void 0 });
|
|
2128
2165
|
}
|
|
2129
2166
|
}
|
|
2130
2167
|
async createResource(e) {
|
|
2131
|
-
if (!this.#
|
|
2168
|
+
if (!this.#O() || this.#l.value.draft == null) return !1;
|
|
2132
2169
|
let t = this.#i();
|
|
2133
|
-
this.#
|
|
2134
|
-
let n = await this.#
|
|
2135
|
-
return this.#
|
|
2170
|
+
this.#N({ busy: "resource" }), this.#c(void 0);
|
|
2171
|
+
let n = await this.#b(oe(t, e), !1);
|
|
2172
|
+
return this.#N({ busy: void 0 }), n != null && (this.selectTarget({
|
|
2136
2173
|
id: t,
|
|
2137
2174
|
kind: "subflow"
|
|
2138
2175
|
}), this.#c({
|
|
@@ -2144,53 +2181,53 @@ var Lt = class {
|
|
|
2144
2181
|
let n = this.#o.flow(e), r = t.trim();
|
|
2145
2182
|
if (n == null || r.length == 0) return !1;
|
|
2146
2183
|
if (n.name == r) return !0;
|
|
2147
|
-
this.#
|
|
2184
|
+
this.#N({ busy: "flow" }), this.#c(void 0);
|
|
2148
2185
|
let i;
|
|
2149
2186
|
try {
|
|
2150
2187
|
i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
|
|
2151
2188
|
} catch (e) {
|
|
2152
|
-
this.#
|
|
2189
|
+
this.#m || this.#c(D(e, this.#r.t));
|
|
2153
2190
|
}
|
|
2154
|
-
return this.#
|
|
2191
|
+
return this.#N({ busy: void 0 }), i != null && (this.#c({
|
|
2155
2192
|
kind: "success",
|
|
2156
2193
|
message: this.#r.t("notice.flowRenamed", { name: r })
|
|
2157
2194
|
}), !0);
|
|
2158
2195
|
}
|
|
2159
2196
|
async addNode(e, t, n) {
|
|
2160
|
-
if (!this.#
|
|
2197
|
+
if (!this.#O()) return;
|
|
2161
2198
|
let r = this.#l.value.draft, i = this.#l.value.target;
|
|
2162
2199
|
if (r == null || i == null) return;
|
|
2163
2200
|
let a = this.#i();
|
|
2164
|
-
if (e.kind == "comment") return await this.#
|
|
2165
|
-
let o =
|
|
2201
|
+
if (e.kind == "comment") return await this.#y(i, a, t);
|
|
2202
|
+
let o = L(r), s = ee(e, o, i, this.#r.t);
|
|
2166
2203
|
if (s == null) return;
|
|
2167
|
-
let c =
|
|
2204
|
+
let c = je(o, i, a, s, this.#i);
|
|
2168
2205
|
if (c == null) return;
|
|
2169
|
-
let l = n == null ? c : [...c,
|
|
2206
|
+
let l = n == null ? c : [...c, ...rt(V(r, c).content, i, n(a))], u = this.#b(l);
|
|
2170
2207
|
this.selectNodes([a]);
|
|
2171
2208
|
let d = this.moveNodes({ [a]: t });
|
|
2172
|
-
if (await u != null && (await d, !this.#
|
|
2209
|
+
if (await u != null && (await d, !this.#m)) return this.#N({ nodeFocus: {
|
|
2173
2210
|
nodeId: a,
|
|
2174
|
-
requestId: ++this.#
|
|
2211
|
+
requestId: ++this.#g
|
|
2175
2212
|
} }), a;
|
|
2176
2213
|
}
|
|
2177
2214
|
async connect(e) {
|
|
2178
2215
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2179
2216
|
if (t == null || n == null) return;
|
|
2180
|
-
let r =
|
|
2181
|
-
r.length > 0 && await this.#
|
|
2217
|
+
let r = rt(t.revision.content, n, e);
|
|
2218
|
+
r.length > 0 && await this.#b(r);
|
|
2182
2219
|
}
|
|
2183
2220
|
async disconnect(e) {
|
|
2184
2221
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2185
2222
|
if (t == null || n == null) return;
|
|
2186
|
-
let r =
|
|
2187
|
-
r.length > 0 && await this.#
|
|
2223
|
+
let r = it(t.revision.content, n, e);
|
|
2224
|
+
r.length > 0 && await this.#b(r);
|
|
2188
2225
|
}
|
|
2189
2226
|
async deleteSelectedNodes() {
|
|
2190
|
-
if (!this.#
|
|
2227
|
+
if (!this.#O()) return;
|
|
2191
2228
|
let e = this.$.revision.value, t = this.#l.value.target;
|
|
2192
2229
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
2193
|
-
let n =
|
|
2230
|
+
let n = w(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = Ce(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#b(i), o = r.size == 0 ? void 0 : this.#S((e) => S(e, t, r));
|
|
2194
2231
|
this.selectNodes([]), (a == null || await a != null) && await o;
|
|
2195
2232
|
}
|
|
2196
2233
|
copySelectedNodes() {
|
|
@@ -2198,33 +2235,33 @@ var Lt = class {
|
|
|
2198
2235
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
2199
2236
|
let n = new Set(this.#l.value.selectedNodeIds);
|
|
2200
2237
|
this.#u = {
|
|
2201
|
-
comments: this.#
|
|
2238
|
+
comments: this.#D().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
|
|
2202
2239
|
content: e.content,
|
|
2203
2240
|
position: e.position,
|
|
2204
2241
|
sourceId: e.id,
|
|
2205
2242
|
title: e.title
|
|
2206
2243
|
}] : []),
|
|
2207
|
-
nodes:
|
|
2244
|
+
nodes: _e(e, t, this.#l.value.selectedNodeIds)
|
|
2208
2245
|
};
|
|
2209
2246
|
}
|
|
2210
2247
|
async pasteNodes(e) {
|
|
2211
|
-
if (!this.#
|
|
2248
|
+
if (!this.#O()) return;
|
|
2212
2249
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2213
2250
|
if (t == null || n == null || this.#u == null) return;
|
|
2214
|
-
let r =
|
|
2251
|
+
let r = ke(t, n, this.#u.nodes, this.#i), i = r.changes.length == 0 ? void 0 : this.#b(r.changes), a = this.#u.comments.map((e) => ({
|
|
2215
2252
|
...e,
|
|
2216
2253
|
nodeId: this.#i()
|
|
2217
2254
|
}));
|
|
2218
2255
|
if (r.nodeIds.length == 0 && a.length == 0) return;
|
|
2219
|
-
let o = new Map(this.#
|
|
2256
|
+
let o = new Map(this.#D().nodes.map((e) => [e.id, e])), s = Object.fromEntries(r.sourceIds.map((t, n) => {
|
|
2220
2257
|
let i = e?.[t] ?? o.get(t)?.position;
|
|
2221
2258
|
return [r.nodeIds[n], {
|
|
2222
2259
|
x: (i?.x ?? 80) + 40,
|
|
2223
2260
|
y: (i?.y ?? 80) + 40
|
|
2224
2261
|
}];
|
|
2225
|
-
})), c = this.#
|
|
2226
|
-
let t =
|
|
2227
|
-
for (let e of a) t =
|
|
2262
|
+
})), c = this.#S((e) => {
|
|
2263
|
+
let t = j(e, n, s);
|
|
2264
|
+
for (let e of a) t = z(t, n, e.nodeId, {
|
|
2228
2265
|
content: e.content,
|
|
2229
2266
|
position: {
|
|
2230
2267
|
x: e.position.x + 40,
|
|
@@ -2242,56 +2279,66 @@ var Lt = class {
|
|
|
2242
2279
|
async saveNodeSettings(e, t) {
|
|
2243
2280
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2244
2281
|
if (n == null || r == null) return !1;
|
|
2245
|
-
let i =
|
|
2246
|
-
return i != null && await this.#
|
|
2282
|
+
let i = he(n, r, e, t);
|
|
2283
|
+
return i != null && await this.#b(i) != null;
|
|
2247
2284
|
}
|
|
2248
2285
|
async saveNodeDescription(e, t) {
|
|
2249
2286
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2250
2287
|
if (n == null || r == null) return !1;
|
|
2251
|
-
let i =
|
|
2252
|
-
return i != null && await this.#
|
|
2288
|
+
let i = Te(n, r, e, t);
|
|
2289
|
+
return i != null && await this.#b(i) != null;
|
|
2253
2290
|
}
|
|
2254
2291
|
async saveNodeIcon(e, t) {
|
|
2255
2292
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2256
2293
|
if (n == null || r == null) return !1;
|
|
2257
|
-
let i =
|
|
2258
|
-
return i != null && await this.#
|
|
2294
|
+
let i = xe(n, r, e, t);
|
|
2295
|
+
return i != null && await this.#b(i) != null;
|
|
2259
2296
|
}
|
|
2260
2297
|
async saveNodeTitle(e, t) {
|
|
2261
2298
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2262
2299
|
if (n == null || r == null) return !1;
|
|
2263
|
-
let i =
|
|
2264
|
-
return i != null && await this.#
|
|
2300
|
+
let i = ge(n, r, e, t);
|
|
2301
|
+
return i != null && await this.#b(i) != null;
|
|
2265
2302
|
}
|
|
2266
2303
|
async setInputValue(e, t, n) {
|
|
2267
2304
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2268
2305
|
if (r == null || i == null) return !1;
|
|
2269
|
-
let a =
|
|
2270
|
-
return a != null && await this.#
|
|
2306
|
+
let a = le(r, i, e, t, n);
|
|
2307
|
+
return a != null && await this.#b(a) != null;
|
|
2271
2308
|
}
|
|
2272
2309
|
async setInputVariable(e, t, n) {
|
|
2273
2310
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2274
2311
|
if (r == null || i == null) return !1;
|
|
2275
|
-
let a = n == null ?
|
|
2276
|
-
return a != null && await this.#
|
|
2312
|
+
let a = n == null ? le(r, i, e, t, void 0) : ye(r, i, e, t, n, this.#i());
|
|
2313
|
+
return a != null && await this.#b(a) != null;
|
|
2277
2314
|
}
|
|
2278
2315
|
async saveCondition(e, t) {
|
|
2279
2316
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2280
2317
|
if (n == null || r == null) return !1;
|
|
2281
|
-
let i =
|
|
2282
|
-
return i != null && await this.#
|
|
2318
|
+
let i = me(n, r, e, t);
|
|
2319
|
+
return i != null && await this.#b(i) != null;
|
|
2283
2320
|
}
|
|
2284
2321
|
async saveValue(e, t) {
|
|
2285
2322
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2286
2323
|
if (n == null || r == null) return !1;
|
|
2287
|
-
let i =
|
|
2288
|
-
return i != null && await this.#
|
|
2324
|
+
let i = ce(n, r, e, t);
|
|
2325
|
+
return i != null && await this.#b(i) != null;
|
|
2326
|
+
}
|
|
2327
|
+
async saveWait(e, t) {
|
|
2328
|
+
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2329
|
+
if (n == null || r?.kind != "flow") return !1;
|
|
2330
|
+
let i = Fe(n, r, e, t);
|
|
2331
|
+
return i != null && await this.#b(i) != null;
|
|
2332
|
+
}
|
|
2333
|
+
async setWaitNotification(e, t) {
|
|
2334
|
+
let n = this.$.revision.value, r = n == null ? void 0 : Me(n, e, t, this.#i());
|
|
2335
|
+
return r != null && await this.#b(r) != null;
|
|
2289
2336
|
}
|
|
2290
2337
|
async saveComment(e, t) {
|
|
2291
2338
|
let n = this.#l.value.target;
|
|
2292
2339
|
if (n == null) return;
|
|
2293
|
-
let r = this.#
|
|
2294
|
-
r != null && await this.#
|
|
2340
|
+
let r = this.#D().nodes.find((t) => t.id == e)?.position;
|
|
2341
|
+
r != null && await this.#S((i) => z(i, n, e, {
|
|
2295
2342
|
...t,
|
|
2296
2343
|
position: r
|
|
2297
2344
|
}));
|
|
@@ -2299,60 +2346,66 @@ var Lt = class {
|
|
|
2299
2346
|
async saveTaskSettings(e, t) {
|
|
2300
2347
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2301
2348
|
if (n == null || r == null) return !1;
|
|
2302
|
-
let i =
|
|
2303
|
-
return i != null && await this.#
|
|
2349
|
+
let i = Ne(n, r, e, t);
|
|
2350
|
+
return i != null && await this.#b(i) != null;
|
|
2304
2351
|
}
|
|
2305
2352
|
async saveCodeTaskPorts(e, t) {
|
|
2306
2353
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2307
2354
|
if (n == null || r == null) return !1;
|
|
2308
|
-
let i =
|
|
2309
|
-
return i != null && await this.#
|
|
2355
|
+
let i = de(n, r, e, t);
|
|
2356
|
+
return i != null && await this.#b(i) != null;
|
|
2357
|
+
}
|
|
2358
|
+
async saveTaskAdditionalInputs(e, t) {
|
|
2359
|
+
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2360
|
+
if (n == null || r == null) return !1;
|
|
2361
|
+
let i = Ie(n, r, e, t);
|
|
2362
|
+
return i != null && await this.#b(i) != null;
|
|
2310
2363
|
}
|
|
2311
2364
|
async setConnectorConnection(e, t) {
|
|
2312
2365
|
let n = this.$.revision.value;
|
|
2313
2366
|
if (n == null) return !1;
|
|
2314
|
-
let r =
|
|
2315
|
-
return r != null && await this.#
|
|
2367
|
+
let r = k(n.revision.content, e, t);
|
|
2368
|
+
return r != null && await this.#b(r) != null;
|
|
2316
2369
|
}
|
|
2317
2370
|
async saveTriggerSettings(e, t) {
|
|
2318
2371
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2319
2372
|
if (n == null || r?.kind != "flow") return !1;
|
|
2320
|
-
let i =
|
|
2321
|
-
return i != null && await this.#
|
|
2373
|
+
let i = ne(n.revision.content, r, e, t);
|
|
2374
|
+
return i != null && await this.#b(i) != null;
|
|
2322
2375
|
}
|
|
2323
2376
|
async saveTriggerConfig(e, t, n) {
|
|
2324
2377
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2325
2378
|
if (r == null || i?.kind != "flow") return !1;
|
|
2326
|
-
let a =
|
|
2327
|
-
return a != null && await this.#
|
|
2379
|
+
let a = ie(r.revision.content, i, e, t, n);
|
|
2380
|
+
return a != null && await this.#b(a) != null;
|
|
2328
2381
|
}
|
|
2329
2382
|
async saveTriggerSchedule(e, t) {
|
|
2330
2383
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2331
2384
|
if (n == null || r?.kind != "flow") return !1;
|
|
2332
|
-
let i =
|
|
2333
|
-
return i != null && await this.#
|
|
2385
|
+
let i = P(n.revision.content, r, e, t);
|
|
2386
|
+
return i != null && await this.#b(i) != null;
|
|
2334
2387
|
}
|
|
2335
2388
|
async saveWebhook(e, t) {
|
|
2336
2389
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2337
2390
|
if (n == null || r?.kind != "flow") return !1;
|
|
2338
|
-
let i =
|
|
2339
|
-
return i != null && await this.#
|
|
2391
|
+
let i = F(n, r, e, t);
|
|
2392
|
+
return i != null && await this.#b(i) != null;
|
|
2340
2393
|
}
|
|
2341
2394
|
async setTriggerConnection(e, t) {
|
|
2342
2395
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2343
2396
|
if (n == null || r?.kind != "flow") return !1;
|
|
2344
|
-
let i =
|
|
2345
|
-
return i != null && await this.#
|
|
2397
|
+
let i = re(n.revision.content, r, e, t);
|
|
2398
|
+
return i != null && await this.#b(i) != null;
|
|
2346
2399
|
}
|
|
2347
2400
|
async saveSubflowSettings(e, t) {
|
|
2348
2401
|
let n = this.$.revision.value;
|
|
2349
2402
|
if (n == null) return !1;
|
|
2350
|
-
let r =
|
|
2351
|
-
return r != null && await this.#
|
|
2403
|
+
let r = ae(n, e, t);
|
|
2404
|
+
return r != null && await this.#b(r) != null;
|
|
2352
2405
|
}
|
|
2353
2406
|
updateModuleSource(e) {
|
|
2354
2407
|
let t = this.#l.value.moduleEditor;
|
|
2355
|
-
t != null && t.source != e && this.#
|
|
2408
|
+
t != null && t.source != e && this.#N({ moduleEditor: {
|
|
2356
2409
|
...t,
|
|
2357
2410
|
phase: void 0,
|
|
2358
2411
|
source: e
|
|
@@ -2363,10 +2416,10 @@ var Lt = class {
|
|
|
2363
2416
|
if (e == null) return;
|
|
2364
2417
|
let t = this.#l.value.draft?.content.modules[e.moduleId];
|
|
2365
2418
|
if (t == null) {
|
|
2366
|
-
this.#
|
|
2419
|
+
this.#N({ moduleEditor: void 0 });
|
|
2367
2420
|
return;
|
|
2368
2421
|
}
|
|
2369
|
-
this.#
|
|
2422
|
+
this.#N({ moduleEditor: {
|
|
2370
2423
|
moduleId: e.moduleId,
|
|
2371
2424
|
source: t.source
|
|
2372
2425
|
} });
|
|
@@ -2374,104 +2427,104 @@ var Lt = class {
|
|
|
2374
2427
|
async saveModuleEditor() {
|
|
2375
2428
|
let e = this.#l.value.moduleEditor;
|
|
2376
2429
|
if (e == null || e.phase == "saving") return !1;
|
|
2377
|
-
this.#
|
|
2430
|
+
this.#N({ moduleEditor: {
|
|
2378
2431
|
...e,
|
|
2379
2432
|
phase: "saving"
|
|
2380
2433
|
} });
|
|
2381
|
-
let t = await
|
|
2382
|
-
if (this.#
|
|
2383
|
-
let n =
|
|
2384
|
-
|
|
2434
|
+
let t = await ot(e.source);
|
|
2435
|
+
if (this.#m) return !1;
|
|
2436
|
+
let n = this.#l.value.draft?.content.modules[e.moduleId];
|
|
2437
|
+
if (n == null) return !1;
|
|
2438
|
+
let r = await this.#b(st(e.moduleId, n.source, n.imports, e.source, t));
|
|
2439
|
+
return !this.#m && this.#l.value.moduleEditor?.moduleId == e.moduleId && this.#N({ moduleEditor: {
|
|
2385
2440
|
...this.#l.value.moduleEditor,
|
|
2386
|
-
phase:
|
|
2387
|
-
} }),
|
|
2441
|
+
phase: r == null ? "failed" : void 0
|
|
2442
|
+
} }), r != null;
|
|
2388
2443
|
}
|
|
2389
2444
|
async moveNodes(e, t = "detail") {
|
|
2390
2445
|
let n = this.#l.value.target;
|
|
2391
|
-
n != null && await this.#
|
|
2446
|
+
n != null && await this.#S((r) => j(r, n, e, t));
|
|
2392
2447
|
}
|
|
2393
2448
|
async moveViewport(e, t = "detail") {
|
|
2394
2449
|
let n = this.#l.value.target;
|
|
2395
|
-
|
|
2396
|
-
let r = this.#P().viewport;
|
|
2397
|
-
(r.x != e.x || r.y != e.y || r.zoom != e.zoom) && this.#M(), await this.#T((r) => O(r, n, e, t));
|
|
2450
|
+
n != null && await this.#S((r) => A(r, n, e, t));
|
|
2398
2451
|
}
|
|
2399
2452
|
async check() {
|
|
2400
|
-
await this.#
|
|
2453
|
+
await this.#C();
|
|
2401
2454
|
}
|
|
2402
2455
|
async refreshFlows() {
|
|
2403
2456
|
await this.reloadFlows();
|
|
2404
2457
|
}
|
|
2405
2458
|
updateLive(e) {
|
|
2406
|
-
e.flowId == this.#l.value.flowId && this.#
|
|
2459
|
+
e.flowId == this.#l.value.flowId && this.#N({ live: e });
|
|
2407
2460
|
}
|
|
2408
2461
|
locateNode(e) {
|
|
2409
2462
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2410
|
-
return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#
|
|
2463
|
+
return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#N({ nodeFocus: {
|
|
2411
2464
|
nodeId: e,
|
|
2412
|
-
requestId: ++this.#
|
|
2465
|
+
requestId: ++this.#g
|
|
2413
2466
|
} }), !0);
|
|
2414
2467
|
}
|
|
2415
2468
|
locateDiagnostic(e) {
|
|
2416
|
-
return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#
|
|
2469
|
+
return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#N({ diagnosticFocus: {
|
|
2417
2470
|
...e.location,
|
|
2418
2471
|
diagnostic: e.diagnostic,
|
|
2419
2472
|
requestId: ++this.#d
|
|
2420
2473
|
} }), !0);
|
|
2421
2474
|
}
|
|
2422
|
-
async #
|
|
2423
|
-
let r = Math.max(0, ...this.#
|
|
2475
|
+
async #y(e, t, n) {
|
|
2476
|
+
let r = Math.max(0, ...this.#D().nodes.flatMap((e) => {
|
|
2424
2477
|
if (e.kind != "comment") return [];
|
|
2425
2478
|
let t = /#(\d+)$/.exec(e.title);
|
|
2426
2479
|
return t == null ? [] : [Number(t[1])];
|
|
2427
|
-
})), i = this.#
|
|
2480
|
+
})), i = this.#S((i) => z(i, e, t, {
|
|
2428
2481
|
content: "",
|
|
2429
2482
|
position: n,
|
|
2430
2483
|
title: this.#r.t("addNode.commentName", { number: r + 1 })
|
|
2431
2484
|
}));
|
|
2432
|
-
if (this.selectNodes([t]), await i, !this.#
|
|
2485
|
+
if (this.selectNodes([t]), await i, !this.#m) return t;
|
|
2433
2486
|
}
|
|
2434
|
-
async #
|
|
2487
|
+
async #b(e, t = !0) {
|
|
2435
2488
|
let n = this.#l.value.flowId, r = this.#l.value.draft;
|
|
2436
|
-
if (n != null && r != null) return await this.#t.change({
|
|
2489
|
+
if (n != null && r != null) return e.length == 0 ? r : await this.#t.change({
|
|
2437
2490
|
current: this.#n.capture(),
|
|
2438
2491
|
flowId: n
|
|
2439
2492
|
}, r, e, t);
|
|
2440
2493
|
}
|
|
2441
|
-
#
|
|
2442
|
-
let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#
|
|
2443
|
-
return this.#
|
|
2494
|
+
#x(e, t = !1) {
|
|
2495
|
+
let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#k(e), o = this.#l.value.moduleEditor;
|
|
2496
|
+
return this.#N({
|
|
2444
2497
|
diagnostics: t ? this.#l.value.diagnostics : void 0,
|
|
2445
2498
|
draft: e,
|
|
2446
|
-
moduleEditor: o != null && n != null &&
|
|
2499
|
+
moduleEditor: o != null && n != null && Q(n, o) != "saved" ? o : $(r, a, i),
|
|
2447
2500
|
selectedNodeIds: i,
|
|
2448
2501
|
target: a
|
|
2449
2502
|
}), r;
|
|
2450
2503
|
}
|
|
2451
|
-
async #
|
|
2452
|
-
if (this.#
|
|
2504
|
+
async #S(e) {
|
|
2505
|
+
if (this.#m) return;
|
|
2453
2506
|
let t = this.#l.value.flowId, n = this.#l.value.presentation;
|
|
2454
2507
|
t != null && n != null && await this.#a.change(t, n, this.#o.capture(), e);
|
|
2455
2508
|
}
|
|
2456
|
-
async #
|
|
2457
|
-
if (this.#
|
|
2509
|
+
async #C() {
|
|
2510
|
+
if (this.#m) return;
|
|
2458
2511
|
let e = this.#l.value.flowId, t = this.#l.value.draft, n = this.#l.value.target;
|
|
2459
2512
|
if (e == null || t == null || n == null) {
|
|
2460
|
-
n ?? this.#
|
|
2513
|
+
n ?? this.#N({
|
|
2461
2514
|
checkLoading: !1,
|
|
2462
2515
|
diagnostics: void 0
|
|
2463
2516
|
});
|
|
2464
2517
|
return;
|
|
2465
2518
|
}
|
|
2466
|
-
this.#
|
|
2519
|
+
this.#N({
|
|
2467
2520
|
checkLoading: !0,
|
|
2468
2521
|
diagnosticFocus: void 0
|
|
2469
2522
|
});
|
|
2470
2523
|
try {
|
|
2471
2524
|
let n = await this.#e.checkFlow(e, t.revisionId);
|
|
2472
|
-
if (!this.#
|
|
2525
|
+
if (!this.#m && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId) {
|
|
2473
2526
|
let e = this.#l.value.live;
|
|
2474
|
-
this.#
|
|
2527
|
+
this.#N({
|
|
2475
2528
|
diagnostics: n,
|
|
2476
2529
|
live: e == null ? void 0 : {
|
|
2477
2530
|
...e,
|
|
@@ -2480,16 +2533,16 @@ var Lt = class {
|
|
|
2480
2533
|
});
|
|
2481
2534
|
}
|
|
2482
2535
|
} catch (n) {
|
|
2483
|
-
!this.#
|
|
2536
|
+
!this.#m && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(D(n, this.#r.t));
|
|
2484
2537
|
} finally {
|
|
2485
|
-
!this.#
|
|
2538
|
+
!this.#m && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#N({ checkLoading: !1 });
|
|
2486
2539
|
}
|
|
2487
2540
|
}
|
|
2488
|
-
async #
|
|
2489
|
-
if (this.#
|
|
2541
|
+
async #w(e) {
|
|
2542
|
+
if (this.#m) return;
|
|
2490
2543
|
let t = this.#l.value.flowId;
|
|
2491
|
-
if (t == null || (this.#f += 1, e != null && (this.#
|
|
2492
|
-
this.#
|
|
2544
|
+
if (t == null || (this.#f += 1, e != null && (this.#p = !0), this.#h)) return;
|
|
2545
|
+
this.#h = !0;
|
|
2493
2546
|
let n = {
|
|
2494
2547
|
current: this.#n.capture(),
|
|
2495
2548
|
flowId: t
|
|
@@ -2498,144 +2551,83 @@ var Lt = class {
|
|
|
2498
2551
|
let e;
|
|
2499
2552
|
do {
|
|
2500
2553
|
e = this.#f;
|
|
2501
|
-
let t = this.#
|
|
2502
|
-
this.#
|
|
2503
|
-
} while (this.#
|
|
2504
|
-
}), this.#
|
|
2554
|
+
let t = this.#p;
|
|
2555
|
+
this.#p = !1, await this.#T(n, !1, t);
|
|
2556
|
+
} while (this.#M(n) && e != this.#f);
|
|
2557
|
+
}), this.#M(n) && (this.#h = !1);
|
|
2505
2558
|
}
|
|
2506
|
-
async #
|
|
2559
|
+
async #T(e, t, n = !1) {
|
|
2507
2560
|
try {
|
|
2508
|
-
let t =
|
|
2509
|
-
if (
|
|
2510
|
-
let
|
|
2511
|
-
if (!this.#
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
}
|
|
2520
|
-
if (s.revisionId == a.revisionId) return !0;
|
|
2521
|
-
let c = o.kind == "changes" && t != null ? Tt(z(a), z(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
|
|
2522
|
-
o.kind == "snapshot" && this.#M();
|
|
2523
|
-
let l = this.#L(s, !1);
|
|
2524
|
-
return this.#N(e.flowId, s.revisionId), o.kind == "changes" && o.revisions.length > 0 && t != null && c != null && i == this.#m && this.#A(e, t, c, i), n && (this.#c({
|
|
2525
|
-
kind: l ? "error" : "success",
|
|
2526
|
-
message: this.#r.t(l ? "notice.moduleUpdated" : "notice.draftUpdated")
|
|
2527
|
-
}), this.#E()), !0;
|
|
2561
|
+
let t = this.#t.committed;
|
|
2562
|
+
if (t == null) return !1;
|
|
2563
|
+
let r = await this.#e.syncDraft(e.flowId);
|
|
2564
|
+
if (!this.#M(e)) return !1;
|
|
2565
|
+
let i = r.draft;
|
|
2566
|
+
if (i.revisionId == t.revisionId) return !0;
|
|
2567
|
+
let a = this.#A(i, !1);
|
|
2568
|
+
return this.#E(e.flowId, i.revisionId), n && (this.#c({
|
|
2569
|
+
kind: a ? "error" : "success",
|
|
2570
|
+
message: this.#r.t(a ? "notice.moduleUpdated" : "notice.draftUpdated")
|
|
2571
|
+
}), this.#C()), !0;
|
|
2528
2572
|
} catch (n) {
|
|
2529
|
-
return t && this.#
|
|
2530
|
-
}
|
|
2531
|
-
}
|
|
2532
|
-
#k(e, t) {
|
|
2533
|
-
if (t.kind == "snapshot") return t.draft;
|
|
2534
|
-
let n = e;
|
|
2535
|
-
for (let e of t.revisions) {
|
|
2536
|
-
if (e.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft revision chain.");
|
|
2537
|
-
n = {
|
|
2538
|
-
...e.revision,
|
|
2539
|
-
content: P(n, e.operations).content
|
|
2540
|
-
};
|
|
2573
|
+
return t && this.#M(e) && this.#c(D(n, this.#r.t)), !1;
|
|
2541
2574
|
}
|
|
2542
|
-
return n;
|
|
2543
|
-
}
|
|
2544
|
-
#A(e, t, n, r) {
|
|
2545
|
-
let i = this.#l.value;
|
|
2546
|
-
if (!this.#z(e) || r != this.#m || !$(i.target, t)) return;
|
|
2547
|
-
let a = this.#p;
|
|
2548
|
-
if (a != null) {
|
|
2549
|
-
if (a.flowId != e.flowId || !$(a.target, t)) {
|
|
2550
|
-
this.#M();
|
|
2551
|
-
return;
|
|
2552
|
-
}
|
|
2553
|
-
for (let e of n) a.targets.add(e);
|
|
2554
|
-
globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#j(), Ft);
|
|
2555
|
-
return;
|
|
2556
|
-
}
|
|
2557
|
-
n.size == 0 || i.selectedNodeIds.length > 0 || (this.#p = {
|
|
2558
|
-
current: e.current,
|
|
2559
|
-
generation: r,
|
|
2560
|
-
flowId: e.flowId,
|
|
2561
|
-
target: t,
|
|
2562
|
-
targets: new Set(n),
|
|
2563
|
-
timer: globalThis.setTimeout(() => this.#j(), Ft),
|
|
2564
|
-
viewport: this.#P().viewport
|
|
2565
|
-
});
|
|
2566
2575
|
}
|
|
2567
|
-
#
|
|
2568
|
-
let e = this.#p;
|
|
2569
|
-
if (this.#p = void 0, e == null || !e.current() || e.generation != this.#m) return;
|
|
2570
|
-
let t = this.#l.value;
|
|
2571
|
-
if (t.flowId != e.flowId || !$(t.target, e.target) || t.selectedNodeIds.length > 0) return;
|
|
2572
|
-
let n = this.#P().viewport;
|
|
2573
|
-
if (n.x != e.viewport.x || n.y != e.viewport.y || n.zoom != e.viewport.zoom || t.draft == null) return;
|
|
2574
|
-
let r = z(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
|
|
2575
|
-
i.length == 1 && this.#B({ nodeFocus: {
|
|
2576
|
-
nodeId: i[0],
|
|
2577
|
-
requestId: ++this.#y
|
|
2578
|
-
} });
|
|
2579
|
-
}
|
|
2580
|
-
#M() {
|
|
2581
|
-
this.#m += 1, this.#p != null && globalThis.clearTimeout(this.#p.timer), this.#p = void 0;
|
|
2582
|
-
}
|
|
2583
|
-
#N(e, t) {
|
|
2576
|
+
#E(e, t) {
|
|
2584
2577
|
this.#o.advanceHead(e, t);
|
|
2585
2578
|
}
|
|
2586
|
-
#
|
|
2579
|
+
#D() {
|
|
2587
2580
|
let e = this.#l.value;
|
|
2588
|
-
return
|
|
2581
|
+
return M(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
|
|
2589
2582
|
}
|
|
2590
|
-
#
|
|
2583
|
+
#O() {
|
|
2591
2584
|
let e = this.#l.value.moduleEditor;
|
|
2592
|
-
return e == null ||
|
|
2585
|
+
return e == null || Q(this.#l.value.draft, e) == "saved" || (this.#c({
|
|
2593
2586
|
kind: "error",
|
|
2594
2587
|
message: this.#r.t("notice.unsavedCode")
|
|
2595
2588
|
}), !1);
|
|
2596
2589
|
}
|
|
2597
|
-
#
|
|
2598
|
-
let t =
|
|
2590
|
+
#k(e) {
|
|
2591
|
+
let t = L(e), n = Rt(t, this.#l.value.target);
|
|
2599
2592
|
return {
|
|
2600
2593
|
revision: t,
|
|
2601
2594
|
selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
|
|
2602
2595
|
target: n
|
|
2603
2596
|
};
|
|
2604
2597
|
}
|
|
2605
|
-
#
|
|
2606
|
-
this.#t.replaceCommitted(e);
|
|
2607
|
-
|
|
2608
|
-
return this.#B({
|
|
2598
|
+
#A(e, t) {
|
|
2599
|
+
let n = this.#t.replaceCommitted(e), r = this.#l.value.moduleEditor, i = r != null && Q(this.#l.value.draft, r) != "saved", a = this.#k(n), o = a.target;
|
|
2600
|
+
return this.#N({
|
|
2609
2601
|
diagnostics: t ? this.#l.value.diagnostics : void 0,
|
|
2610
2602
|
draft: n,
|
|
2611
|
-
moduleEditor: this.#
|
|
2603
|
+
moduleEditor: this.#j(a.revision, o, a.selectedNodeIds),
|
|
2612
2604
|
selectedNodeIds: a.selectedNodeIds,
|
|
2613
2605
|
target: o
|
|
2614
2606
|
}), i;
|
|
2615
2607
|
}
|
|
2616
|
-
#
|
|
2608
|
+
#j(e, t, n) {
|
|
2617
2609
|
let r = this.#l.value.moduleEditor;
|
|
2618
|
-
return r == null ||
|
|
2610
|
+
return r == null || Q(this.#l.value.draft, r) == "saved" ? $(e, t, n) : {
|
|
2619
2611
|
...r,
|
|
2620
2612
|
phase: "failed"
|
|
2621
2613
|
};
|
|
2622
2614
|
}
|
|
2623
|
-
#
|
|
2624
|
-
return !this.#
|
|
2615
|
+
#M(e) {
|
|
2616
|
+
return !this.#m && e.flowId == this.#l.value.flowId && e.current();
|
|
2625
2617
|
}
|
|
2626
|
-
#
|
|
2627
|
-
this.#
|
|
2618
|
+
#N(e) {
|
|
2619
|
+
this.#m || this.#l.set(e);
|
|
2628
2620
|
}
|
|
2629
2621
|
};
|
|
2630
2622
|
//#endregion
|
|
2631
2623
|
//#region src/workbench/browser/runtime/stores/workbenchStore.ts
|
|
2632
|
-
function
|
|
2624
|
+
function Bt(e) {
|
|
2633
2625
|
return new Map(e.nodes.map((e) => [e.id, e]));
|
|
2634
2626
|
}
|
|
2635
|
-
function
|
|
2636
|
-
return e == null || t == null ? [] :
|
|
2627
|
+
function Vt(e, t) {
|
|
2628
|
+
return e == null || t == null ? [] : L(e).designerInputs(t);
|
|
2637
2629
|
}
|
|
2638
|
-
function
|
|
2630
|
+
function Ht(e, t, n, r, i) {
|
|
2639
2631
|
if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
|
|
2640
2632
|
let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
|
|
2641
2633
|
return typeof a == "string" ? new Map(r.flatMap((t) => {
|
|
@@ -2643,7 +2635,7 @@ function Bt(e, t, n, r, i) {
|
|
|
2643
2635
|
return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
|
|
2644
2636
|
})) : /* @__PURE__ */ new Map();
|
|
2645
2637
|
}
|
|
2646
|
-
var
|
|
2638
|
+
var Ut = { openExternalPage: async () => !1 }, Wt = class {
|
|
2647
2639
|
#e;
|
|
2648
2640
|
#t;
|
|
2649
2641
|
#n;
|
|
@@ -2654,38 +2646,49 @@ var Vt = { openExternalPage: async () => !1 }, Ht = class {
|
|
|
2654
2646
|
#s;
|
|
2655
2647
|
#c;
|
|
2656
2648
|
#l;
|
|
2657
|
-
constructor(r, i, a = () => crypto.randomUUID(), o =
|
|
2658
|
-
this.#t = new
|
|
2649
|
+
constructor(r, i, a = () => crypto.randomUUID(), o = R(), s = Ut, c = !0) {
|
|
2650
|
+
this.#t = new I(), this.#r = t(), this.#a = t([]), this.#o = t(!1), this.#s = t(!1), this.#c = new I(), this.#l = !1, this.provideAddNodeOptions = async (e, t) => await this.#u([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => await this.#u([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)], e), this.provideAddNodeOptionChoices = async (e, t) => {
|
|
2659
2651
|
if (!e.startsWith("trigger:")) return await this.connectors.provideAddNodeOptionChoices(e, t);
|
|
2660
2652
|
}, this.#e = r, this.#n = o, this.#i = c;
|
|
2661
2653
|
let l = (e) => {
|
|
2662
2654
|
this.#l || this.#r.set(e);
|
|
2663
2655
|
};
|
|
2664
|
-
this.runs = new
|
|
2665
|
-
|
|
2656
|
+
this.runs = new Le(r, l, o), this.workspace = new zt(r, l, ct, o, (e) => {
|
|
2657
|
+
e.kind == "run.created" ? this.#d(r, e) : this.runs.changed(e.runId);
|
|
2658
|
+
}), this.connectors = new wt(r, this.workspace, l, s, o), this.triggers = new Ot(r, this.workspace, l, s, o), this.publications = new ft(r, this.workspace, l, i, a, o), this.runRequests = new _t(r, this.runs, l, o, a);
|
|
2659
|
+
let u = n((e) => {
|
|
2660
|
+
let t = e(this.workspace.$.diagnostics);
|
|
2661
|
+
if (t == null) return;
|
|
2662
|
+
let n = e(this.connectors.$.diagnostics);
|
|
2663
|
+
return n.length == 0 ? t : {
|
|
2664
|
+
...t,
|
|
2665
|
+
diagnostics: [...t.diagnostics, ...n],
|
|
2666
|
+
valid: !1
|
|
2667
|
+
};
|
|
2668
|
+
}), d = /* @__PURE__ */ new Map(), f, p = n((e) => {
|
|
2666
2669
|
let t = e(this.workspace.$.draft);
|
|
2667
|
-
|
|
2668
|
-
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(this.
|
|
2669
|
-
...
|
|
2670
|
-
r == null || n == null ? void 0 :
|
|
2670
|
+
f != t?.flowId && (d.clear(), f = t?.flowId);
|
|
2671
|
+
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(u)?.diagnostics ?? e(this.connectors.$.diagnostics), a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), l = e(this.runs.$.run), p = e(this.runs.$.events), m = e(this.#a), h = e(this.#o), g = e(this.#s), _ = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, v = [
|
|
2672
|
+
...Vt(t, n),
|
|
2673
|
+
r == null || n == null ? void 0 : N(r, n),
|
|
2671
2674
|
i,
|
|
2672
2675
|
a,
|
|
2673
2676
|
s,
|
|
2674
2677
|
c,
|
|
2675
2678
|
l,
|
|
2676
|
-
f,
|
|
2677
2679
|
p,
|
|
2678
2680
|
m,
|
|
2679
2681
|
h,
|
|
2682
|
+
g,
|
|
2680
2683
|
...l == null ? [] : [t?.revisionId]
|
|
2681
|
-
],
|
|
2682
|
-
if (
|
|
2683
|
-
let
|
|
2684
|
-
return
|
|
2685
|
-
graph:
|
|
2686
|
-
inputs:
|
|
2687
|
-
}),
|
|
2688
|
-
}),
|
|
2684
|
+
], y = d.get(_);
|
|
2685
|
+
if (y != null && y.inputs.length == v.length && y.inputs.every((e, t) => e === v[t])) return y.graph;
|
|
2686
|
+
let b = M(t, n, r, i, a, s, c, l, p, m, h, g, this.#i);
|
|
2687
|
+
return d.set(_, {
|
|
2688
|
+
graph: b,
|
|
2689
|
+
inputs: v
|
|
2690
|
+
}), b;
|
|
2691
|
+
}), m = e(p, Bt);
|
|
2689
2692
|
this.$ = {
|
|
2690
2693
|
busy: n((e) => {
|
|
2691
2694
|
let t = e(this.workspace.$.busy);
|
|
@@ -2696,13 +2699,15 @@ var Vt = { openExternalPage: async () => !1 }, Ht = class {
|
|
|
2696
2699
|
if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
|
|
2697
2700
|
if (e(this.publications.$.changingTriggerId) != null) return "trigger";
|
|
2698
2701
|
}),
|
|
2699
|
-
|
|
2700
|
-
|
|
2702
|
+
diagnosticItems: n((e) => E(e(this.workspace.$.revision), e(this.workspace.$.target), e(u))),
|
|
2703
|
+
diagnostics: u,
|
|
2704
|
+
designer: p,
|
|
2705
|
+
designerNodeById: m,
|
|
2701
2706
|
notice: this.#r,
|
|
2702
|
-
runEventNodes: n((e) =>
|
|
2707
|
+
runEventNodes: n((e) => Ht(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(m))),
|
|
2703
2708
|
selectedDesignerNode: n((e) => {
|
|
2704
2709
|
let t = e(this.workspace.$.selectedNodeIds);
|
|
2705
|
-
return t.length == 1 ? e(
|
|
2710
|
+
return t.length == 1 ? e(m).get(t[0]) : void 0;
|
|
2706
2711
|
}),
|
|
2707
2712
|
variableNames: this.#a,
|
|
2708
2713
|
variableNamesLoaded: this.#o,
|
|
@@ -2732,7 +2737,7 @@ var Vt = { openExternalPage: async () => !1 }, Ht = class {
|
|
|
2732
2737
|
if (!e() || this.#l) return;
|
|
2733
2738
|
this.#a.set(t.map((e) => e.name)), this.#o.set(!0);
|
|
2734
2739
|
} catch (t) {
|
|
2735
|
-
e() && !this.#l && this.#r.set(
|
|
2740
|
+
e() && !this.#l && this.#r.set(D(t, this.#n.t));
|
|
2736
2741
|
} finally {
|
|
2737
2742
|
e() && !this.#l && this.#s.set(!1);
|
|
2738
2743
|
}
|
|
@@ -2758,6 +2763,10 @@ var Vt = { openExternalPage: async () => !1 }, Ht = class {
|
|
|
2758
2763
|
let t = this.$.runEventNodes.value.get(e);
|
|
2759
2764
|
return t != null && this.workspace.locateNode(t);
|
|
2760
2765
|
}
|
|
2766
|
+
locateRunWait() {
|
|
2767
|
+
let e = this.runs.$.run.value;
|
|
2768
|
+
return e?.status == "waiting" && "waiting" in e && e.waiting != null && this.workspace.locateNode(e.waiting.nodeId);
|
|
2769
|
+
}
|
|
2761
2770
|
async addNode(e, t, n) {
|
|
2762
2771
|
if (e.kind == "trigger" && "trigger" in e && e.trigger.kind == "connect") {
|
|
2763
2772
|
await this.triggers.connect(e.trigger.provider);
|
|
@@ -2771,7 +2780,7 @@ var Vt = { openExternalPage: async () => !1 }, Ht = class {
|
|
|
2771
2780
|
if (t.aborted || this.#l) return;
|
|
2772
2781
|
let r = n.filter((e) => e.status == "rejected");
|
|
2773
2782
|
if (r.length > 0 && r.length == n.length) throw r[0].reason;
|
|
2774
|
-
return r.length > 0 && this.#r.set(
|
|
2783
|
+
return r.length > 0 && this.#r.set(D(r[0].reason, this.#n.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
|
|
2775
2784
|
}
|
|
2776
2785
|
async refreshSelectedConnector(e = !1) {
|
|
2777
2786
|
await this.connectors.refresh(e);
|
|
@@ -2796,13 +2805,13 @@ var Vt = { openExternalPage: async () => !1 }, Ht = class {
|
|
|
2796
2805
|
return;
|
|
2797
2806
|
}
|
|
2798
2807
|
}
|
|
2799
|
-
},
|
|
2800
|
-
function
|
|
2801
|
-
let
|
|
2802
|
-
/* @__PURE__ */
|
|
2808
|
+
}, Gt = Ue(() => import("./flowWorkspace-VnS8nLMT.js").then((e) => e.t));
|
|
2809
|
+
function Kt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: s, tokenLabel: u }) {
|
|
2810
|
+
let m = s != null && u != null && i != null, h = s ?? "", _ = /* @__PURE__ */ q(Ge, { children: [
|
|
2811
|
+
/* @__PURE__ */ K("div", {
|
|
2803
2812
|
"aria-hidden": "true",
|
|
2804
2813
|
className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
|
|
2805
|
-
children: /* @__PURE__ */
|
|
2814
|
+
children: /* @__PURE__ */ q("svg", {
|
|
2806
2815
|
className: "size-5",
|
|
2807
2816
|
fill: "none",
|
|
2808
2817
|
stroke: "currentColor",
|
|
@@ -2810,40 +2819,40 @@ function Wt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
2810
2819
|
strokeLinejoin: "round",
|
|
2811
2820
|
strokeWidth: "1.8",
|
|
2812
2821
|
viewBox: "0 0 24 24",
|
|
2813
|
-
children: [/* @__PURE__ */
|
|
2822
|
+
children: [/* @__PURE__ */ K("rect", {
|
|
2814
2823
|
height: "9",
|
|
2815
2824
|
rx: "2",
|
|
2816
2825
|
width: "14",
|
|
2817
2826
|
x: "5",
|
|
2818
2827
|
y: "11"
|
|
2819
|
-
}), /* @__PURE__ */
|
|
2828
|
+
}), /* @__PURE__ */ K("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
|
|
2820
2829
|
})
|
|
2821
2830
|
}),
|
|
2822
|
-
/* @__PURE__ */
|
|
2831
|
+
/* @__PURE__ */ q("header", {
|
|
2823
2832
|
className: "flex flex-col gap-2",
|
|
2824
|
-
children: [/* @__PURE__ */
|
|
2833
|
+
children: [/* @__PURE__ */ K("h1", {
|
|
2825
2834
|
className: "text-xl font-semibold tracking-tight text-balance",
|
|
2826
2835
|
children: o
|
|
2827
|
-
}), /* @__PURE__ */
|
|
2836
|
+
}), /* @__PURE__ */ K("p", {
|
|
2828
2837
|
className: "text-sm/relaxed text-muted-foreground text-pretty",
|
|
2829
2838
|
children: t
|
|
2830
2839
|
})]
|
|
2831
2840
|
}),
|
|
2832
|
-
|
|
2841
|
+
m && /* @__PURE__ */ K(f, { children: /* @__PURE__ */ q(d, {
|
|
2833
2842
|
"data-invalid": n != null,
|
|
2834
2843
|
children: [
|
|
2835
|
-
/* @__PURE__ */
|
|
2844
|
+
/* @__PURE__ */ K(p, {
|
|
2836
2845
|
htmlFor: "session-token",
|
|
2837
|
-
children:
|
|
2846
|
+
children: u
|
|
2838
2847
|
}),
|
|
2839
|
-
/* @__PURE__ */
|
|
2848
|
+
/* @__PURE__ */ K(l, {
|
|
2840
2849
|
autoComplete: "username",
|
|
2841
2850
|
name: "username",
|
|
2842
2851
|
type: "hidden",
|
|
2843
2852
|
value: "open-flow",
|
|
2844
2853
|
readOnly: !0
|
|
2845
2854
|
}),
|
|
2846
|
-
/* @__PURE__ */
|
|
2855
|
+
/* @__PURE__ */ K(l, {
|
|
2847
2856
|
autoComplete: "current-password",
|
|
2848
2857
|
"aria-invalid": n != null,
|
|
2849
2858
|
autoFocus: !0,
|
|
@@ -2853,135 +2862,137 @@ function Wt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
2853
2862
|
onChange: (e) => i?.(e.target.value),
|
|
2854
2863
|
spellCheck: !1,
|
|
2855
2864
|
type: "password",
|
|
2856
|
-
value:
|
|
2865
|
+
value: h
|
|
2857
2866
|
}),
|
|
2858
|
-
n != null && /* @__PURE__ */
|
|
2867
|
+
n != null && /* @__PURE__ */ K(y, { children: n })
|
|
2859
2868
|
]
|
|
2860
2869
|
}) }),
|
|
2861
|
-
e != null && r != null && /* @__PURE__ */
|
|
2862
|
-
disabled: a ||
|
|
2870
|
+
e != null && r != null && /* @__PURE__ */ q(c, {
|
|
2871
|
+
disabled: a || m && h.length == 0,
|
|
2863
2872
|
size: "lg",
|
|
2864
2873
|
type: "submit",
|
|
2865
|
-
children: [a && /* @__PURE__ */
|
|
2874
|
+
children: [a && /* @__PURE__ */ K(g, {
|
|
2866
2875
|
"aria-label": e,
|
|
2867
2876
|
"data-icon": "inline-start"
|
|
2868
2877
|
}), e]
|
|
2869
2878
|
}),
|
|
2870
|
-
a && e == null && /* @__PURE__ */
|
|
2871
|
-
] }),
|
|
2872
|
-
return /* @__PURE__ */
|
|
2879
|
+
a && e == null && /* @__PURE__ */ K(g, { "aria-label": t })
|
|
2880
|
+
] }), v = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
|
|
2881
|
+
return /* @__PURE__ */ K("main", {
|
|
2873
2882
|
className: "open-flow-workbench",
|
|
2874
|
-
children: /* @__PURE__ */
|
|
2883
|
+
children: /* @__PURE__ */ K("div", {
|
|
2875
2884
|
className: "grid h-full overflow-auto bg-muted/20 p-4",
|
|
2876
|
-
children: r == null ? /* @__PURE__ */
|
|
2885
|
+
children: r == null ? /* @__PURE__ */ K("section", {
|
|
2877
2886
|
"aria-busy": a,
|
|
2878
|
-
className:
|
|
2879
|
-
children:
|
|
2880
|
-
}) : /* @__PURE__ */
|
|
2887
|
+
className: v,
|
|
2888
|
+
children: _
|
|
2889
|
+
}) : /* @__PURE__ */ K("form", {
|
|
2881
2890
|
"aria-busy": a,
|
|
2882
|
-
className:
|
|
2891
|
+
className: v,
|
|
2883
2892
|
onSubmit: r,
|
|
2884
|
-
children:
|
|
2893
|
+
children: _
|
|
2885
2894
|
})
|
|
2886
2895
|
})
|
|
2887
2896
|
});
|
|
2888
2897
|
}
|
|
2889
|
-
function
|
|
2898
|
+
function qt({ host: e, store: t }) {
|
|
2890
2899
|
let n = a(t.$.notice);
|
|
2891
|
-
return
|
|
2900
|
+
return W(() => e.notify(n), [e, n]), W(() => () => e.notify(void 0), [e]), null;
|
|
2892
2901
|
}
|
|
2893
|
-
function
|
|
2894
|
-
let
|
|
2895
|
-
return /* @__PURE__ */
|
|
2902
|
+
function Jt({ 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 }) {
|
|
2903
|
+
let g = a(m.workspace.$.flowId);
|
|
2904
|
+
return /* @__PURE__ */ K("div", {
|
|
2896
2905
|
className: "app-shell",
|
|
2897
|
-
children:
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2906
|
+
children: g == null ? /* @__PURE__ */ K($e, {
|
|
2907
|
+
catalogWidth: e,
|
|
2908
|
+
createFlowDisabled: n,
|
|
2909
|
+
createFlowField: r,
|
|
2910
|
+
flowBadges: i,
|
|
2911
|
+
hrefForFlow: (e) => o({
|
|
2902
2912
|
flowId: e.flowId,
|
|
2903
2913
|
view: "design"
|
|
2904
2914
|
}),
|
|
2905
|
-
hostAction:
|
|
2906
|
-
hostTitle:
|
|
2907
|
-
language:
|
|
2908
|
-
onCreateFlow: (
|
|
2909
|
-
onHostAction:
|
|
2910
|
-
onLanguageChange:
|
|
2911
|
-
onSelectFlow: (e) => void
|
|
2912
|
-
store:
|
|
2913
|
-
}) : /* @__PURE__ */
|
|
2914
|
-
fallback: /* @__PURE__ */
|
|
2915
|
+
hostAction: s,
|
|
2916
|
+
hostTitle: c,
|
|
2917
|
+
language: l,
|
|
2918
|
+
onCreateFlow: (e) => u.createFlow(e, t),
|
|
2919
|
+
onHostAction: f,
|
|
2920
|
+
onLanguageChange: p,
|
|
2921
|
+
onSelectFlow: (e) => void u.selectFlow(e),
|
|
2922
|
+
store: m
|
|
2923
|
+
}) : /* @__PURE__ */ K(He, {
|
|
2924
|
+
fallback: /* @__PURE__ */ K("main", {
|
|
2915
2925
|
"aria-busy": "true",
|
|
2916
2926
|
className: "workspace"
|
|
2917
2927
|
}),
|
|
2918
|
-
children: /* @__PURE__ */
|
|
2919
|
-
hostAction:
|
|
2920
|
-
hostTitle:
|
|
2921
|
-
hrefFor:
|
|
2922
|
-
navigation:
|
|
2923
|
-
onConfigureConnector:
|
|
2924
|
-
onHostAction:
|
|
2925
|
-
store:
|
|
2926
|
-
theme:
|
|
2928
|
+
children: /* @__PURE__ */ K(Gt, {
|
|
2929
|
+
hostAction: s,
|
|
2930
|
+
hostTitle: c,
|
|
2931
|
+
hrefFor: o,
|
|
2932
|
+
navigation: u,
|
|
2933
|
+
onConfigureConnector: d,
|
|
2934
|
+
onHostAction: f,
|
|
2935
|
+
store: m,
|
|
2936
|
+
theme: h
|
|
2927
2937
|
})
|
|
2928
2938
|
})
|
|
2929
2939
|
});
|
|
2930
2940
|
}
|
|
2931
|
-
function
|
|
2932
|
-
let
|
|
2933
|
-
|
|
2934
|
-
let [{ i18n:
|
|
2935
|
-
let e =
|
|
2941
|
+
function Yt({ 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 }) {
|
|
2942
|
+
let y = We(h);
|
|
2943
|
+
y.current = h;
|
|
2944
|
+
let [{ i18n: b, navigation: x, store: S }] = G(() => {
|
|
2945
|
+
let e = R(u), t = new Wt(new Ee((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), g, () => crypto.randomUUID(), e, a, v);
|
|
2936
2946
|
return {
|
|
2937
2947
|
i18n: e,
|
|
2938
|
-
navigation: new
|
|
2948
|
+
navigation: new Ke(t, d, (e, t) => y.current(e, t)),
|
|
2939
2949
|
store: t
|
|
2940
2950
|
};
|
|
2941
2951
|
});
|
|
2942
|
-
return
|
|
2943
|
-
|
|
2952
|
+
return W(() => {
|
|
2953
|
+
x.start();
|
|
2944
2954
|
let e = () => {
|
|
2945
|
-
|
|
2955
|
+
S.connectors.refreshAfterAuthorization(), S.triggers.refreshAfterAuthorization(), S.refreshVariableNames();
|
|
2946
2956
|
};
|
|
2947
2957
|
return globalThis.addEventListener("focus", e), () => {
|
|
2948
|
-
globalThis.removeEventListener("focus", e),
|
|
2958
|
+
globalThis.removeEventListener("focus", e), x.dispose(), S.dispose(), b.dispose();
|
|
2949
2959
|
};
|
|
2950
2960
|
}, [
|
|
2951
|
-
y,
|
|
2952
2961
|
b,
|
|
2953
|
-
x
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2962
|
+
x,
|
|
2963
|
+
S
|
|
2964
|
+
]), W(() => void x.apply(d), [d, x]), W(() => {
|
|
2965
|
+
b.lang != u && b.switchLang(u);
|
|
2966
|
+
}, [b, u]), /* @__PURE__ */ K(o, {
|
|
2967
|
+
i18n: b,
|
|
2968
|
+
children: /* @__PURE__ */ q("div", {
|
|
2959
2969
|
className: "open-flow-theme open-flow-workbench",
|
|
2960
|
-
"data-theme":
|
|
2961
|
-
children: [/* @__PURE__ */
|
|
2962
|
-
host:
|
|
2963
|
-
store:
|
|
2964
|
-
}), /* @__PURE__ */
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2970
|
+
"data-theme": _,
|
|
2971
|
+
children: [/* @__PURE__ */ K(qt, {
|
|
2972
|
+
host: a,
|
|
2973
|
+
store: S
|
|
2974
|
+
}), /* @__PURE__ */ K(Jt, {
|
|
2975
|
+
catalogWidth: e,
|
|
2976
|
+
createFlow: t,
|
|
2977
|
+
createFlowDisabled: n,
|
|
2978
|
+
createFlowField: r,
|
|
2979
|
+
flowBadges: i,
|
|
2980
|
+
hostAction: s,
|
|
2981
|
+
hostTitle: c,
|
|
2982
|
+
hrefFor: l,
|
|
2983
|
+
language: u,
|
|
2984
|
+
navigation: x,
|
|
2985
|
+
onConfigureConnector: f,
|
|
2986
|
+
onHostAction: p,
|
|
2987
|
+
onLanguageChange: m,
|
|
2988
|
+
store: S,
|
|
2989
|
+
theme: _
|
|
2979
2990
|
})]
|
|
2980
2991
|
})
|
|
2981
2992
|
});
|
|
2982
2993
|
}
|
|
2983
|
-
function
|
|
2984
|
-
return /* @__PURE__ */
|
|
2994
|
+
function Xt({ sessionKey: e, ...t }) {
|
|
2995
|
+
return /* @__PURE__ */ K(Yt, { ...t }, e);
|
|
2985
2996
|
}
|
|
2986
2997
|
//#endregion
|
|
2987
|
-
export {
|
|
2998
|
+
export { Kt as OpenFlowSessionGate, Xt as OpenFlowWorkbench, Be as isWorkbenchLanguage, Ve as resolveWorkbenchLanguage, ze as workbenchLanguageNames, Re as workbenchLanguages };
|