@oomol-lab/open-flow 0.1.0-beta.23 → 0.1.0-beta.26
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/{createResourceDialog-PKbMMpEk.js → createResourceDialog-BwI2JmPE.js} +7 -7
- package/dist/browser/flow-authoring.js +249 -250
- package/dist/browser/flow-change.d.ts +16 -7
- package/dist/browser/flow-change.js +824 -804
- package/dist/browser/{flowChanges-BUlMz4iC.js → flowChanges-BqPtWEI9.js} +2706 -2906
- package/dist/browser/{flowWorkspace-DLArN17T.js → flowWorkspace-CpMGzmfz.js} +37249 -35916
- package/dist/browser/{inputValues-CcGVt51C.js → inputValues-CeeJw_G8.js} +1 -1
- package/dist/browser/licenses.md +24 -0
- package/dist/browser/{lite-Cy6aeiL6.js → lite-BuKZ8joP.js} +50 -43
- package/dist/browser/{input-group-C2frNYAx.js → switch-CyZ96-UF.js} +1519 -612
- package/dist/browser/theme.css +30 -4
- package/dist/browser/ui-input.d.ts +3 -1
- package/dist/browser/ui.css +1 -1
- package/dist/browser/ui.js +10 -8
- package/dist/browser/warmCodeTheme-DVv4-rDO.js +35 -0
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +753 -714
- package/dist/browser/{workbenchSelect-CPRUXKbf.js → workbenchSelect-BUu7CjUA.js} +504 -490
- package/dist/common/control-api-conformance.js +18 -18
- package/dist/common/control-api.d.ts +43 -15
- package/dist/common/control-api.js +1803 -1755
- package/dist/common/control-requests.js +2 -7
- package/dist/common/engine-contract.d.ts +2 -2
- package/dist/common/flow-encoding.js +587 -589
- package/dist/common/flow-graph.d.ts +31 -1
- package/dist/common/flow-schema.d.ts +11 -1
- package/dist/common/flow-semantics.d.ts +2 -1
- package/dist/common/flow-semantics.js +1542 -1457
- package/dist/common/mcp.d.ts +1 -0
- package/dist/common/mcp.js +308 -260
- package/dist/common/provider-triggers.js +934 -931
- package/dist/common/run-lifecycle.d.ts +1 -1
- package/dist/common/run-lifecycle.js +5 -5
- package/dist/common/runtime-contract.d.ts +2 -0
- package/dist/common/runtime-contract.js +96 -32
- package/dist/common/scheduler.d.ts +39 -21
- package/dist/common/scheduler.js +2358 -2339
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { a as e, i as t, l as n } from "./dist-Dz6Nglsd.js";
|
|
2
2
|
import { a as r, i, r as a, t as o } from "./main-BDnNHhkU.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { B as
|
|
6
|
-
import { a as
|
|
7
|
-
import { i as
|
|
8
|
-
import { o as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { Suspense as
|
|
3
|
+
import { Bn as s, Hn as c, kt as l, t as u } from "./lite-BuKZ8joP.js";
|
|
4
|
+
import { i as d, n as f, o as p, r as m, t as h } from "./switch-CyZ96-UF.js";
|
|
5
|
+
import { At as g, B as _, C as v, Ct as y, D as b, Dt as x, E as S, Et as C, F as w, Ft as ee, G as te, H as T, I as E, J as ne, K as D, L as re, M as ie, Nt as ae, O, Ot as oe, P as k, R as se, S as ce, St as le, Tt as ue, U as de, Ut as A, W as j, Y as M, _ as fe, _n as pe, _t as me, a as he, an as ge, b as _e, bn as ve, bt as N, c as ye, d as be, dn as xe, dt as Se, f as Ce, fn as P, g as we, gn as Te, gt as Ee, h as De, hn as F, ht as Oe, in as ke, it as Ae, j as I, jt as je, k as Me, kt as Ne, l as Pe, lt as L, m as Fe, mn as Ie, o as Le, p as Re, pn as ze, q as Be, r as R, rt as z, s as Ve, st as He, t as Ue, tt as We, u as Ge, un as B, ut as Ke, v as qe, vn as V, vt as Je, w as Ye, wt as H, x as Xe, xt as Ze, y as Qe, yn as U, yt as $e, z as et } from "./flowChanges-BqPtWEI9.js";
|
|
6
|
+
import { C as tt, V as nt, _ as rt, a as it, c as at, d as ot, f as st, g as ct, h as lt, i as ut, l as dt, m as ft, n as W, o as pt, r as mt, s as ht, t as gt, v as _t, w as vt } from "./workbenchSelect-BUu7CjUA.js";
|
|
7
|
+
import { i as yt, n as bt, r as xt, t as St } from "./languages-C0zQ4GSo.js";
|
|
8
|
+
import { o as G } from "./dist-B_T-OpQp.js";
|
|
9
|
+
import { Fragment as Ct, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
10
|
+
import { Suspense as wt, lazy as Tt, useEffect as J, useRef as Et, useState as Y } from "react";
|
|
11
11
|
import * as Dt from "effect/Cause";
|
|
12
12
|
import * as X from "effect/Effect";
|
|
13
13
|
import * as Ot from "effect/Exit";
|
|
@@ -96,19 +96,19 @@ function jt(e, t) {
|
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
|
|
99
|
-
var Mt =
|
|
100
|
-
label:
|
|
99
|
+
var Mt = Tt(() => import("./createResourceDialog-BwI2JmPE.js")), Nt = yt.map((e) => ({
|
|
100
|
+
label: xt[e],
|
|
101
101
|
value: e
|
|
102
102
|
}));
|
|
103
103
|
function Pt({ language: e, onLanguageChange: t }) {
|
|
104
104
|
let n = i(), [r, a] = Y(null);
|
|
105
|
-
return t == null ? null : /* @__PURE__ */
|
|
105
|
+
return t == null ? null : /* @__PURE__ */ q("div", {
|
|
106
106
|
className: "resource-language",
|
|
107
107
|
ref: a,
|
|
108
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ K("span", {
|
|
109
109
|
className: "sr-only",
|
|
110
110
|
children: n("language.label")
|
|
111
|
-
}), /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ K(gt, {
|
|
112
112
|
ariaLabel: n("language.label"),
|
|
113
113
|
onValueChange: (e) => t(e),
|
|
114
114
|
options: Nt,
|
|
@@ -117,30 +117,30 @@ function Pt({ language: e, onLanguageChange: t }) {
|
|
|
117
117
|
})]
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store:
|
|
121
|
-
let [u, d] = Y(null), f =
|
|
122
|
-
async function
|
|
123
|
-
|
|
120
|
+
function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: c }) {
|
|
121
|
+
let [u, d] = Y(null), f = Et(null), p = Et(null), m = Et(null), g = a(), _ = i(), [v, b] = Y("idle"), [x, S] = Y(n.name), [C, w] = Y(), te = n.live != null && n.live.revisionId != n.draftRevisionId;
|
|
122
|
+
async function T(e) {
|
|
123
|
+
w(e == "publish" ? "publish" : "enabled");
|
|
124
124
|
try {
|
|
125
|
-
e == "publish" ? await
|
|
125
|
+
e == "publish" ? await c.workspace.publishFlow(n) : await c.workspace.setFlowEnabled(n, e);
|
|
126
126
|
} finally {
|
|
127
|
-
|
|
127
|
+
w(void 0);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
let
|
|
131
|
-
async function
|
|
130
|
+
let E = vt(x);
|
|
131
|
+
async function ne(e) {
|
|
132
132
|
e.preventDefault();
|
|
133
|
-
let t =
|
|
134
|
-
|
|
133
|
+
let t = x.trim();
|
|
134
|
+
vt(t) == null && await c.workspace.renameFlow(n.flowId, t) && b("idle");
|
|
135
135
|
}
|
|
136
|
-
async function
|
|
137
|
-
await
|
|
136
|
+
async function D() {
|
|
137
|
+
await c.workspace.deleteFlow(n.flowId) && b("idle");
|
|
138
138
|
}
|
|
139
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ q("div", {
|
|
140
140
|
className: "resource-item-row",
|
|
141
141
|
ref: d,
|
|
142
142
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ q(s, {
|
|
144
144
|
"aria-disabled": n.status == "retiring",
|
|
145
145
|
className: "resource-list-row flow-columns",
|
|
146
146
|
nativeButton: !1,
|
|
@@ -149,170 +149,170 @@ function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: l }) {
|
|
|
149
149
|
e.preventDefault();
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
y(e, () => o(n));
|
|
153
153
|
},
|
|
154
|
-
render: /* @__PURE__ */
|
|
154
|
+
render: /* @__PURE__ */ K("a", { href: n.status == "retiring" ? void 0 : r }),
|
|
155
155
|
tabIndex: n.status == "retiring" ? -1 : void 0,
|
|
156
156
|
variant: "ghost",
|
|
157
157
|
children: [
|
|
158
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ q("span", {
|
|
159
159
|
className: "resource-primary-cell",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ K("span", {
|
|
161
161
|
className: "resource-icon",
|
|
162
|
-
children: /* @__PURE__ */
|
|
163
|
-
}), /* @__PURE__ */
|
|
162
|
+
children: /* @__PURE__ */ K(W, { name: "flow" })
|
|
163
|
+
}), /* @__PURE__ */ q("span", { children: [/* @__PURE__ */ q("span", {
|
|
164
164
|
className: "flex min-w-0 items-center gap-2",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
165
|
+
children: [/* @__PURE__ */ K("strong", {
|
|
166
166
|
className: "min-w-0 truncate",
|
|
167
167
|
children: n.name
|
|
168
|
-
}), e != null && /* @__PURE__ */
|
|
168
|
+
}), e != null && /* @__PURE__ */ K(ke, {
|
|
169
169
|
className: "min-w-0 shrink",
|
|
170
170
|
title: e,
|
|
171
171
|
variant: "secondary",
|
|
172
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ K("span", {
|
|
173
173
|
className: "truncate",
|
|
174
174
|
children: e
|
|
175
175
|
})
|
|
176
176
|
})]
|
|
177
|
-
}), /* @__PURE__ */
|
|
177
|
+
}), /* @__PURE__ */ K("code", {
|
|
178
178
|
translate: "no",
|
|
179
179
|
children: n.flowId
|
|
180
180
|
})] })]
|
|
181
181
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ K("time", {
|
|
183
183
|
dateTime: n.updatedAt,
|
|
184
|
-
children: new Date(n.updatedAt).toLocaleString(
|
|
184
|
+
children: new Date(n.updatedAt).toLocaleString(g)
|
|
185
185
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ K("span", {
|
|
187
187
|
className: "resource-status",
|
|
188
|
-
children:
|
|
188
|
+
children: _(n.status == "retiring" ? "resource.retiring" : n.live == null ? "resource.notPublished" : te ? "resource.unpublishedChanges" : "resource.isPublished")
|
|
189
189
|
})
|
|
190
190
|
]
|
|
191
191
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ q("div", {
|
|
193
193
|
className: "resource-live-controls",
|
|
194
|
-
"aria-busy":
|
|
195
|
-
children: [n.live == null ? /* @__PURE__ */
|
|
194
|
+
"aria-busy": C != null,
|
|
195
|
+
children: [n.live == null ? /* @__PURE__ */ K("span", {
|
|
196
196
|
className: "resource-status",
|
|
197
|
-
title:
|
|
197
|
+
title: _("resource.publishFirst"),
|
|
198
198
|
children: "—"
|
|
199
|
-
}) : /* @__PURE__ */
|
|
199
|
+
}) : /* @__PURE__ */ q(nt, {
|
|
200
200
|
className: "resource-enable",
|
|
201
|
-
title:
|
|
202
|
-
children: [/* @__PURE__ */
|
|
203
|
-
"aria-label":
|
|
201
|
+
title: _("resource.enabledHint"),
|
|
202
|
+
children: [/* @__PURE__ */ K(h, {
|
|
203
|
+
"aria-label": _("resource.enableFlow", { name: n.name }),
|
|
204
204
|
checked: n.live?.enabled ?? !1,
|
|
205
|
-
disabled: n.status != "active" || n.live == null || t != null ||
|
|
206
|
-
onCheckedChange: (e) => void
|
|
205
|
+
disabled: n.status != "active" || n.live == null || t != null || C != null,
|
|
206
|
+
onCheckedChange: (e) => void T(e),
|
|
207
207
|
size: "sm"
|
|
208
|
-
}), /* @__PURE__ */
|
|
209
|
-
}), /* @__PURE__ */
|
|
210
|
-
disabled: n.status != "active" || t != null ||
|
|
211
|
-
onClick: () => void
|
|
208
|
+
}), /* @__PURE__ */ K("span", { children: _(n.live?.enabled ? "resource.enabled" : "resource.disabled") })]
|
|
209
|
+
}), /* @__PURE__ */ K(s, {
|
|
210
|
+
disabled: n.status != "active" || t != null || C != null || n.live != null && !te,
|
|
211
|
+
onClick: () => void T("publish"),
|
|
212
212
|
size: "sm",
|
|
213
213
|
variant: "outline",
|
|
214
|
-
children:
|
|
214
|
+
children: _(C == "publish" ? "workspace.publishing" : n.live == null ? "resource.publish" : "resource.publishUpdate")
|
|
215
215
|
})]
|
|
216
216
|
}),
|
|
217
|
-
n.status == "active" && /* @__PURE__ */
|
|
218
|
-
"aria-label":
|
|
219
|
-
disabled: t != null ||
|
|
220
|
-
render: /* @__PURE__ */
|
|
217
|
+
n.status == "active" && /* @__PURE__ */ q(je, { children: [/* @__PURE__ */ K(A, {
|
|
218
|
+
"aria-label": _("sidebar.flowActions", { name: n.name }),
|
|
219
|
+
disabled: t != null || C != null,
|
|
220
|
+
render: /* @__PURE__ */ K(s, {
|
|
221
221
|
className: "resource-row-more",
|
|
222
222
|
ref: f,
|
|
223
223
|
size: "icon-sm",
|
|
224
224
|
variant: "ghost",
|
|
225
|
-
children: /* @__PURE__ */
|
|
225
|
+
children: /* @__PURE__ */ K(W, { name: "more" })
|
|
226
226
|
})
|
|
227
|
-
}), /* @__PURE__ */
|
|
227
|
+
}), /* @__PURE__ */ q(ae, {
|
|
228
228
|
align: "end",
|
|
229
229
|
className: "min-w-36",
|
|
230
230
|
container: u,
|
|
231
|
-
finalFocus:
|
|
232
|
-
children: [/* @__PURE__ */
|
|
231
|
+
finalFocus: v == "idle",
|
|
232
|
+
children: [/* @__PURE__ */ K(ee, {
|
|
233
233
|
onClick: () => {
|
|
234
|
-
|
|
234
|
+
S(n.name), b("rename");
|
|
235
235
|
},
|
|
236
|
-
children:
|
|
237
|
-
}), /* @__PURE__ */
|
|
238
|
-
onClick: () =>
|
|
236
|
+
children: _("common.rename")
|
|
237
|
+
}), /* @__PURE__ */ K(ee, {
|
|
238
|
+
onClick: () => b("delete"),
|
|
239
239
|
variant: "destructive",
|
|
240
|
-
children:
|
|
240
|
+
children: _("common.delete")
|
|
241
241
|
})]
|
|
242
242
|
})] }),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
open:
|
|
243
|
+
/* @__PURE__ */ K(mt, {
|
|
244
|
+
open: v == "rename",
|
|
245
245
|
onOpenChange: (e) => {
|
|
246
|
-
e ||
|
|
246
|
+
e || b("idle");
|
|
247
247
|
},
|
|
248
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ K(it, {
|
|
249
249
|
container: u,
|
|
250
250
|
initialFocus: p,
|
|
251
251
|
finalFocus: f,
|
|
252
|
-
closeLabel:
|
|
253
|
-
children: /* @__PURE__ */
|
|
252
|
+
closeLabel: _("common.cancel"),
|
|
253
|
+
children: /* @__PURE__ */ q("form", {
|
|
254
254
|
className: "flex flex-col gap-4",
|
|
255
|
-
onSubmit: (e) => void
|
|
255
|
+
onSubmit: (e) => void ne(e),
|
|
256
256
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
"data-invalid":
|
|
257
|
+
/* @__PURE__ */ K(at, { children: /* @__PURE__ */ K(dt, { children: _("sidebar.renameFlow", { name: n.name }) }) }),
|
|
258
|
+
/* @__PURE__ */ q(st, {
|
|
259
|
+
"data-invalid": x.length > 0 && E != null,
|
|
260
260
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ K(ct, {
|
|
262
262
|
htmlFor: `rename-flow-${n.flowId}`,
|
|
263
|
-
children:
|
|
263
|
+
children: _("resource.flowName")
|
|
264
264
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ K(l, {
|
|
266
266
|
autoComplete: "off",
|
|
267
|
-
"aria-invalid":
|
|
268
|
-
"aria-describedby":
|
|
267
|
+
"aria-invalid": x.length > 0 && E != null,
|
|
268
|
+
"aria-describedby": x.length > 0 && E != null ? `rename-error-${n.flowId}` : void 0,
|
|
269
269
|
id: `rename-flow-${n.flowId}`,
|
|
270
270
|
name: "flow-name",
|
|
271
|
-
onChange: (e) =>
|
|
271
|
+
onChange: (e) => S(e.target.value),
|
|
272
272
|
ref: p,
|
|
273
273
|
required: !0,
|
|
274
|
-
value:
|
|
274
|
+
value: x
|
|
275
275
|
}),
|
|
276
|
-
|
|
276
|
+
x.length > 0 && E != null && /* @__PURE__ */ K(ft, {
|
|
277
277
|
id: `rename-error-${n.flowId}`,
|
|
278
|
-
children:
|
|
278
|
+
children: _(`resource.nameIssue.${E}`, { max: 80 })
|
|
279
279
|
})
|
|
280
280
|
]
|
|
281
281
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
render: /* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ q(ht, { children: [/* @__PURE__ */ K(ut, {
|
|
283
|
+
render: /* @__PURE__ */ K(s, { variant: "outline" }),
|
|
284
284
|
type: "button",
|
|
285
|
-
children:
|
|
286
|
-
}), /* @__PURE__ */
|
|
287
|
-
disabled: t != null ||
|
|
285
|
+
children: _("common.cancel")
|
|
286
|
+
}), /* @__PURE__ */ K(s, {
|
|
287
|
+
disabled: t != null || E != null,
|
|
288
288
|
type: "submit",
|
|
289
|
-
children:
|
|
289
|
+
children: _("common.save")
|
|
290
290
|
})] })
|
|
291
291
|
]
|
|
292
292
|
})
|
|
293
293
|
})
|
|
294
294
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
open:
|
|
295
|
+
/* @__PURE__ */ K(mt, {
|
|
296
|
+
open: v == "delete",
|
|
297
297
|
onOpenChange: (e) => {
|
|
298
|
-
e ||
|
|
298
|
+
e || b("idle");
|
|
299
299
|
},
|
|
300
|
-
children: /* @__PURE__ */
|
|
300
|
+
children: /* @__PURE__ */ q(it, {
|
|
301
301
|
container: u,
|
|
302
302
|
initialFocus: m,
|
|
303
303
|
finalFocus: f,
|
|
304
304
|
showCloseButton: !1,
|
|
305
|
-
children: [/* @__PURE__ */
|
|
306
|
-
render: /* @__PURE__ */
|
|
305
|
+
children: [/* @__PURE__ */ q(at, { children: [/* @__PURE__ */ K(dt, { children: _("sidebar.deleteFlowConfirm", { name: n.name }) }), /* @__PURE__ */ K(pt, { children: _("resource.deleteDescription") })] }), /* @__PURE__ */ q(ht, { children: [/* @__PURE__ */ K(ut, {
|
|
306
|
+
render: /* @__PURE__ */ K(s, {
|
|
307
307
|
ref: m,
|
|
308
308
|
variant: "outline"
|
|
309
309
|
}),
|
|
310
|
-
children:
|
|
311
|
-
}), /* @__PURE__ */
|
|
310
|
+
children: _("common.cancel")
|
|
311
|
+
}), /* @__PURE__ */ K(s, {
|
|
312
312
|
disabled: t != null,
|
|
313
|
-
onClick: () => void
|
|
313
|
+
onClick: () => void D(),
|
|
314
314
|
variant: "destructive",
|
|
315
|
-
children:
|
|
315
|
+
children: _(t == "flow" ? "common.deleting" : "common.delete")
|
|
316
316
|
})] })]
|
|
317
317
|
})
|
|
318
318
|
})
|
|
@@ -320,184 +320,184 @@ function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: l }) {
|
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
322
|
function It() {
|
|
323
|
-
return /* @__PURE__ */
|
|
323
|
+
return /* @__PURE__ */ q("div", {
|
|
324
324
|
"aria-hidden": "true",
|
|
325
325
|
className: "resource-list-row resource-skeleton-row flow-columns",
|
|
326
326
|
children: [
|
|
327
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ q("span", {
|
|
328
328
|
className: "resource-primary-cell",
|
|
329
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ K(H, { className: "size-8 shrink-0" }), /* @__PURE__ */ q("span", {
|
|
330
330
|
className: "resource-skeleton-copy",
|
|
331
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ K(H, { className: "h-3.5 w-36" }), /* @__PURE__ */ K(H, { className: "h-2.5 w-48 max-w-full" })]
|
|
332
332
|
})]
|
|
333
333
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ K(H, { className: "h-3 w-28" }),
|
|
335
|
+
/* @__PURE__ */ K(H, { className: "h-3 w-16" })
|
|
336
336
|
]
|
|
337
337
|
});
|
|
338
338
|
}
|
|
339
|
-
function Lt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: a, hrefForFlow: o, hostAction:
|
|
340
|
-
let
|
|
341
|
-
async function
|
|
339
|
+
function Lt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: a, hrefForFlow: o, hostAction: l, hostTitle: u, language: p, onCreateFlow: h, onHostAction: _, onLanguageChange: v, onSelectFlow: y, store: b }) {
|
|
340
|
+
let S = i(), w = r(b.workspace.$.busy), ee = r(b.workspace.$.flowLoadFailed), te = r(b.workspace.$.flowLoadMoreFailed), T = r(b.workspace.$.flowLoading), E = r(b.workspace.$.flowLoadingMore), ne = r(b.workspace.$.flowNextCursor), D = r(b.workspace.$.flowRefreshing), re = r(b.workspace.$.flows), ie = r(b.workspace.$.flowTotal), [ae, O] = Y(!1), [k, se] = Y(""), [ce, de] = Y(""), A = k.trim().toLocaleLowerCase(), j = re.filter((e) => e.name.toLocaleLowerCase().includes(A));
|
|
341
|
+
async function M(e) {
|
|
342
342
|
e.preventDefault();
|
|
343
|
-
let t =
|
|
344
|
-
|
|
343
|
+
let t = ce.trim();
|
|
344
|
+
vt(t) != null || !await h(t) || (O(!1), de(""));
|
|
345
345
|
}
|
|
346
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ K("main", {
|
|
347
347
|
className: "resource-browser",
|
|
348
|
-
children: /* @__PURE__ */
|
|
349
|
-
className:
|
|
348
|
+
children: /* @__PURE__ */ q("div", {
|
|
349
|
+
className: c("resource-page", e != "default" && "resource-page-full"),
|
|
350
350
|
children: [
|
|
351
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ K("h1", {
|
|
352
352
|
className: "sr-only",
|
|
353
|
-
children:
|
|
353
|
+
children: S("resource.flows")
|
|
354
354
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ q("section", {
|
|
356
356
|
"aria-labelledby": "flow-list-title",
|
|
357
357
|
className: "resource-list-section",
|
|
358
358
|
children: [
|
|
359
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ q("div", {
|
|
360
360
|
className: "resource-list-title",
|
|
361
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ q("div", {
|
|
362
362
|
className: "resource-list-heading",
|
|
363
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ K("h2", {
|
|
364
364
|
id: "flow-list-title",
|
|
365
|
-
children:
|
|
366
|
-
}), !
|
|
367
|
-
}), /* @__PURE__ */
|
|
365
|
+
children: S("resource.allFlows")
|
|
366
|
+
}), !T && /* @__PURE__ */ K("span", { children: S("resource.flowCount", { count: ie ?? re.length }) })]
|
|
367
|
+
}), /* @__PURE__ */ q("div", {
|
|
368
368
|
className: "resource-list-actions",
|
|
369
369
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
-
language:
|
|
372
|
-
onLanguageChange:
|
|
370
|
+
/* @__PURE__ */ K(Pt, {
|
|
371
|
+
language: p,
|
|
372
|
+
onLanguageChange: v
|
|
373
373
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ q(f, {
|
|
375
375
|
className: "w-full sm:w-56",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ K(m, { children: /* @__PURE__ */ K(W, {
|
|
377
377
|
name: "search",
|
|
378
378
|
size: 17
|
|
379
|
-
}) }), /* @__PURE__ */
|
|
379
|
+
}) }), /* @__PURE__ */ K(d, {
|
|
380
380
|
autoComplete: "off",
|
|
381
|
-
"aria-label":
|
|
381
|
+
"aria-label": S("resource.searchFlows"),
|
|
382
382
|
name: "flow-search",
|
|
383
|
-
onChange: (e) =>
|
|
384
|
-
placeholder:
|
|
385
|
-
value:
|
|
383
|
+
onChange: (e) => se(e.target.value),
|
|
384
|
+
placeholder: S("resource.searchFlows"),
|
|
385
|
+
value: k
|
|
386
386
|
})]
|
|
387
387
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
"aria-label":
|
|
390
|
-
disabled:
|
|
391
|
-
onClick: () => void
|
|
388
|
+
/* @__PURE__ */ K(s, {
|
|
389
|
+
"aria-label": S("common.refresh"),
|
|
390
|
+
disabled: T || D || w != null,
|
|
391
|
+
onClick: () => void b.workspace.reloadFlows(),
|
|
392
392
|
size: "icon",
|
|
393
|
-
title:
|
|
393
|
+
title: S("common.refresh"),
|
|
394
394
|
variant: "outline",
|
|
395
|
-
children: /* @__PURE__ */
|
|
396
|
-
className:
|
|
395
|
+
children: /* @__PURE__ */ K(W, {
|
|
396
|
+
className: D ? "animate-spin" : void 0,
|
|
397
397
|
name: "refresh"
|
|
398
398
|
})
|
|
399
399
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ q(s, {
|
|
401
401
|
className: "resource-page-primary-action",
|
|
402
|
-
disabled:
|
|
403
|
-
onClick: () =>
|
|
404
|
-
children: [/* @__PURE__ */
|
|
402
|
+
disabled: w != null,
|
|
403
|
+
onClick: () => O(!0),
|
|
404
|
+
children: [/* @__PURE__ */ K(W, {
|
|
405
405
|
"data-icon": "inline-start",
|
|
406
406
|
name: "plus"
|
|
407
|
-
}),
|
|
407
|
+
}), S("resource.newFlow")]
|
|
408
408
|
}),
|
|
409
|
-
|
|
410
|
-
action:
|
|
411
|
-
onAction:
|
|
412
|
-
title:
|
|
409
|
+
l != null && u != null && _ != null && /* @__PURE__ */ K(le, {
|
|
410
|
+
action: l,
|
|
411
|
+
onAction: _,
|
|
412
|
+
title: u
|
|
413
413
|
})
|
|
414
414
|
]
|
|
415
415
|
})]
|
|
416
416
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ q("div", {
|
|
418
418
|
"aria-hidden": "true",
|
|
419
419
|
className: "resource-list-columns flow-columns",
|
|
420
420
|
children: [
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ K("span", { children: S("resource.name") }),
|
|
422
|
+
/* @__PURE__ */ K("span", { children: S("resource.updated") }),
|
|
423
|
+
/* @__PURE__ */ K("span", { children: S("resource.publication") }),
|
|
424
|
+
/* @__PURE__ */ K("span", { children: S("resource.enabledColumn") })
|
|
425
425
|
]
|
|
426
426
|
}),
|
|
427
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ K("div", {
|
|
428
428
|
className: "resource-list",
|
|
429
|
-
children:
|
|
429
|
+
children: T ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ K(It, {}, t)) : ee ? /* @__PURE__ */ q(ue, {
|
|
430
430
|
className: "min-h-64",
|
|
431
431
|
role: "alert",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
432
|
+
children: [/* @__PURE__ */ q(oe, { children: [
|
|
433
|
+
/* @__PURE__ */ K(Ne, {
|
|
434
434
|
variant: "icon",
|
|
435
|
-
children: /* @__PURE__ */
|
|
435
|
+
children: /* @__PURE__ */ K(W, {
|
|
436
436
|
name: "alert",
|
|
437
437
|
size: 20
|
|
438
438
|
})
|
|
439
439
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
] }), /* @__PURE__ */
|
|
443
|
-
onClick: () => void
|
|
440
|
+
/* @__PURE__ */ K(g, { children: S("resource.flowsLoadFailed") }),
|
|
441
|
+
/* @__PURE__ */ K(x, { children: S("resource.flowsLoadFailedDescription") })
|
|
442
|
+
] }), /* @__PURE__ */ K(C, { children: /* @__PURE__ */ K(s, {
|
|
443
|
+
onClick: () => void b.retryFlows(),
|
|
444
444
|
variant: "outline",
|
|
445
|
-
children:
|
|
445
|
+
children: S("empty.retry")
|
|
446
446
|
}) })]
|
|
447
|
-
}) :
|
|
447
|
+
}) : j.length == 0 ? /* @__PURE__ */ q(ue, {
|
|
448
448
|
className: "min-h-64",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
450
|
-
/* @__PURE__ */
|
|
449
|
+
children: [/* @__PURE__ */ q(oe, { children: [
|
|
450
|
+
/* @__PURE__ */ K(Ne, {
|
|
451
451
|
variant: "icon",
|
|
452
|
-
children: /* @__PURE__ */
|
|
452
|
+
children: /* @__PURE__ */ K(W, {
|
|
453
453
|
name: "flow",
|
|
454
454
|
size: 20
|
|
455
455
|
})
|
|
456
456
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
] }),
|
|
460
|
-
onClick: () =>
|
|
457
|
+
/* @__PURE__ */ K(g, { children: S(A.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
|
|
458
|
+
/* @__PURE__ */ K(x, { children: S(A.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
|
|
459
|
+
] }), A.length == 0 && /* @__PURE__ */ K(C, { children: /* @__PURE__ */ q(s, {
|
|
460
|
+
onClick: () => O(!0),
|
|
461
461
|
variant: "outline",
|
|
462
|
-
children: [/* @__PURE__ */
|
|
462
|
+
children: [/* @__PURE__ */ K(W, {
|
|
463
463
|
"data-icon": "inline-start",
|
|
464
464
|
name: "plus"
|
|
465
|
-
}),
|
|
465
|
+
}), S("resource.newFlow")]
|
|
466
466
|
}) })]
|
|
467
|
-
}) :
|
|
467
|
+
}) : j.map((e) => /* @__PURE__ */ K(Ft, {
|
|
468
468
|
badge: a?.[e.flowId],
|
|
469
|
-
busy:
|
|
469
|
+
busy: w,
|
|
470
470
|
flow: e,
|
|
471
471
|
href: o(e),
|
|
472
|
-
onSelect:
|
|
473
|
-
store:
|
|
472
|
+
onSelect: y,
|
|
473
|
+
store: b
|
|
474
474
|
}, e.flowId))
|
|
475
475
|
}),
|
|
476
|
-
|
|
476
|
+
ne != null && /* @__PURE__ */ K("div", {
|
|
477
477
|
className: "resource-list-footer",
|
|
478
|
-
children: /* @__PURE__ */
|
|
479
|
-
disabled:
|
|
480
|
-
onClick: () => void
|
|
478
|
+
children: /* @__PURE__ */ K(s, {
|
|
479
|
+
disabled: E || D,
|
|
480
|
+
onClick: () => void b.workspace.loadMoreFlows(),
|
|
481
481
|
variant: "outline",
|
|
482
|
-
children:
|
|
482
|
+
children: S(E ? "resource.loadingMore" : te ? "resource.retryLoadMore" : "resource.loadMore")
|
|
483
483
|
})
|
|
484
484
|
})
|
|
485
485
|
]
|
|
486
486
|
}),
|
|
487
|
-
|
|
487
|
+
ae && /* @__PURE__ */ K(wt, {
|
|
488
488
|
fallback: null,
|
|
489
|
-
children: /* @__PURE__ */
|
|
489
|
+
children: /* @__PURE__ */ K(Mt, {
|
|
490
490
|
disabled: t,
|
|
491
491
|
field: n,
|
|
492
492
|
id: "flow-name",
|
|
493
|
-
issue:
|
|
494
|
-
label:
|
|
495
|
-
name:
|
|
496
|
-
onNameChange:
|
|
497
|
-
onOpenChange:
|
|
498
|
-
onSubmit: (e) => void
|
|
499
|
-
pending:
|
|
500
|
-
title:
|
|
493
|
+
issue: vt(ce),
|
|
494
|
+
label: S("resource.flowName"),
|
|
495
|
+
name: ce,
|
|
496
|
+
onNameChange: de,
|
|
497
|
+
onOpenChange: O,
|
|
498
|
+
onSubmit: (e) => void M(e),
|
|
499
|
+
pending: w == "flow",
|
|
500
|
+
title: S("resource.newFlow")
|
|
501
501
|
})
|
|
502
502
|
})
|
|
503
503
|
]
|
|
@@ -505,8 +505,50 @@ function Lt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
507
|
//#endregion
|
|
508
|
+
//#region ../../node_modules/.bun/dequal@2.0.3/node_modules/dequal/dist/index.mjs
|
|
509
|
+
var Rt = Object.prototype.hasOwnProperty;
|
|
510
|
+
function zt(e, t, n) {
|
|
511
|
+
for (n of e.keys()) if (Z(n, t)) return n;
|
|
512
|
+
}
|
|
513
|
+
function Z(e, t) {
|
|
514
|
+
var n, r, i;
|
|
515
|
+
if (e === t) return !0;
|
|
516
|
+
if (e && t && (n = e.constructor) === t.constructor) {
|
|
517
|
+
if (n === Date) return e.getTime() === t.getTime();
|
|
518
|
+
if (n === RegExp) return e.toString() === t.toString();
|
|
519
|
+
if (n === Array) {
|
|
520
|
+
if ((r = e.length) === t.length) for (; r-- && Z(e[r], t[r]););
|
|
521
|
+
return r === -1;
|
|
522
|
+
}
|
|
523
|
+
if (n === Set) {
|
|
524
|
+
if (e.size !== t.size) return !1;
|
|
525
|
+
for (r of e) if (i = r, i && typeof i == "object" && (i = zt(t, i), !i) || !t.has(i)) return !1;
|
|
526
|
+
return !0;
|
|
527
|
+
}
|
|
528
|
+
if (n === Map) {
|
|
529
|
+
if (e.size !== t.size) return !1;
|
|
530
|
+
for (r of e) if (i = r[0], i && typeof i == "object" && (i = zt(t, i), !i) || !Z(r[1], t.get(i))) return !1;
|
|
531
|
+
return !0;
|
|
532
|
+
}
|
|
533
|
+
if (n === ArrayBuffer) e = new Uint8Array(e), t = new Uint8Array(t);
|
|
534
|
+
else if (n === DataView) {
|
|
535
|
+
if ((r = e.byteLength) === t.byteLength) for (; r-- && e.getInt8(r) === t.getInt8(r););
|
|
536
|
+
return r === -1;
|
|
537
|
+
}
|
|
538
|
+
if (ArrayBuffer.isView(e)) {
|
|
539
|
+
if ((r = e.byteLength) === t.byteLength) for (; r-- && e[r] === t[r];);
|
|
540
|
+
return r === -1;
|
|
541
|
+
}
|
|
542
|
+
if (!n || typeof e == "object") {
|
|
543
|
+
for (n in r = 0, e) if (Rt.call(e, n) && ++r && !Rt.call(t, n) || !(n in t) || !Z(e[n], t[n])) return !1;
|
|
544
|
+
return Object.keys(t).length === r;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
return e !== e && t !== t;
|
|
548
|
+
}
|
|
549
|
+
//#endregion
|
|
508
550
|
//#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
|
|
509
|
-
var
|
|
551
|
+
var Bt = (e) => crypto.getRandomValues(new Uint8Array(e)), Vt = (e, t, n) => {
|
|
510
552
|
let r = 256 - 256 % e.length;
|
|
511
553
|
if (r === 256) {
|
|
512
554
|
let r = e.length - 1;
|
|
@@ -528,29 +570,29 @@ var Rt = (e) => crypto.getRandomValues(new Uint8Array(e)), zt = (e, t, n) => {
|
|
|
528
570
|
for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
|
|
529
571
|
}
|
|
530
572
|
};
|
|
531
|
-
},
|
|
573
|
+
}, Ht = (e, t = 21) => Vt(e, t | 0, Bt);
|
|
532
574
|
//#endregion
|
|
533
575
|
//#region src/flow/common/edgeChanges.ts
|
|
534
|
-
function
|
|
535
|
-
return
|
|
576
|
+
function Ut(e, t, n) {
|
|
577
|
+
return Gt(e, t)?.edges.some((e) => u(e, n)) ? [] : [{
|
|
536
578
|
edge: n,
|
|
537
579
|
kind: "graph.edge.connect",
|
|
538
580
|
target: t
|
|
539
581
|
}];
|
|
540
582
|
}
|
|
541
|
-
function
|
|
542
|
-
return
|
|
583
|
+
function Wt(e, t, n) {
|
|
584
|
+
return Gt(e, t)?.edges.some((e) => u(e, n)) ? [{
|
|
543
585
|
edge: n,
|
|
544
586
|
kind: "graph.edge.disconnect",
|
|
545
587
|
target: t
|
|
546
588
|
}] : [];
|
|
547
589
|
}
|
|
548
|
-
function
|
|
590
|
+
function Gt(e, t) {
|
|
549
591
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
550
592
|
}
|
|
551
593
|
//#endregion
|
|
552
594
|
//#region src/flow/common/moduleChanges.ts
|
|
553
|
-
async function
|
|
595
|
+
async function Kt(e) {
|
|
554
596
|
try {
|
|
555
597
|
let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
|
|
556
598
|
errorRecovery: !0,
|
|
@@ -566,7 +608,7 @@ async function Wt(e) {
|
|
|
566
608
|
return [];
|
|
567
609
|
}
|
|
568
610
|
}
|
|
569
|
-
function
|
|
611
|
+
function qt(e, t, n, r, i) {
|
|
570
612
|
return [{
|
|
571
613
|
beforeImports: n,
|
|
572
614
|
beforeSource: t,
|
|
@@ -576,7 +618,7 @@ function Gt(e, t, n, r, i) {
|
|
|
576
618
|
source: r
|
|
577
619
|
}];
|
|
578
620
|
}
|
|
579
|
-
var
|
|
621
|
+
var Jt = Ht("23456789abcdefghjkmnpqrstuvwxyz", 10), Yt = {
|
|
580
622
|
activities: [],
|
|
581
623
|
activitiesLoadFailed: !1,
|
|
582
624
|
activitiesLoading: !1,
|
|
@@ -591,25 +633,25 @@ var Kt = Bt("23456789abcdefghjkmnpqrstuvwxyz", 10), Z = {
|
|
|
591
633
|
publications: [],
|
|
592
634
|
publishing: !1,
|
|
593
635
|
refreshing: !1
|
|
594
|
-
},
|
|
636
|
+
}, Xt = 20, Zt = 50, Qt = 750;
|
|
595
637
|
function Q(e, t) {
|
|
596
638
|
return e?.flowId == t.flowId;
|
|
597
639
|
}
|
|
598
|
-
var
|
|
640
|
+
var $t = class {
|
|
599
641
|
#e;
|
|
600
642
|
#t;
|
|
601
643
|
#n;
|
|
602
|
-
#r = new
|
|
603
|
-
#i = new
|
|
644
|
+
#r = new L();
|
|
645
|
+
#i = new L();
|
|
604
646
|
#a;
|
|
605
|
-
#o = new
|
|
606
|
-
#s = new
|
|
647
|
+
#o = new L();
|
|
648
|
+
#s = new L();
|
|
607
649
|
#c;
|
|
608
|
-
#l = n(
|
|
650
|
+
#l = n(Yt);
|
|
609
651
|
#u;
|
|
610
652
|
#d;
|
|
611
653
|
#f;
|
|
612
|
-
constructor(t, n, r, i, a =
|
|
654
|
+
constructor(t, n, r, i, a = P, o = p()) {
|
|
613
655
|
this.#e = t, this.#t = a, this.#n = o, this.#a = i, this.#c = r, this.#u = n, this.$ = {
|
|
614
656
|
activities: e(this.#l, (e) => e.activities),
|
|
615
657
|
activitiesLoadFailed: e(this.#l, (e) => e.activitiesLoadFailed),
|
|
@@ -643,7 +685,7 @@ var Xt = class {
|
|
|
643
685
|
this.#l.dispose();
|
|
644
686
|
}
|
|
645
687
|
reset() {
|
|
646
|
-
this.#r.invalidate(), this.#i.invalidate(), this.#y(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(
|
|
688
|
+
this.#r.invalidate(), this.#i.invalidate(), this.#y(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(Yt);
|
|
647
689
|
}
|
|
648
690
|
async load(e) {
|
|
649
691
|
let t = { flowId: e }, n = this.#l.value, r = n.loaded && Q(n.target, t), i = this.#r.begin();
|
|
@@ -653,7 +695,7 @@ var Xt = class {
|
|
|
653
695
|
loadMoreFailed: !1,
|
|
654
696
|
refreshing: !0
|
|
655
697
|
}) : this.#l.set({
|
|
656
|
-
...
|
|
698
|
+
...Yt,
|
|
657
699
|
loading: !0,
|
|
658
700
|
target: t
|
|
659
701
|
});
|
|
@@ -683,7 +725,7 @@ var Xt = class {
|
|
|
683
725
|
loadFailed: !r,
|
|
684
726
|
loading: !1,
|
|
685
727
|
refreshing: !1
|
|
686
|
-
}), this.#c(
|
|
728
|
+
}), this.#c(B(e, this.#n.t));
|
|
687
729
|
}
|
|
688
730
|
}
|
|
689
731
|
async loadMore() {
|
|
@@ -697,7 +739,7 @@ var Xt = class {
|
|
|
697
739
|
try {
|
|
698
740
|
let e = await this.#e.listPublications(n.flowId, {
|
|
699
741
|
cursor: t,
|
|
700
|
-
limit:
|
|
742
|
+
limit: Zt
|
|
701
743
|
});
|
|
702
744
|
if (!r()) return;
|
|
703
745
|
let i = new Set(this.#l.value.publications.map((e) => e.publicationId));
|
|
@@ -712,7 +754,7 @@ var Xt = class {
|
|
|
712
754
|
this.#S({
|
|
713
755
|
loadMoreFailed: !0,
|
|
714
756
|
loadingMore: !1
|
|
715
|
-
}), this.#c(
|
|
757
|
+
}), this.#c(B(e, this.#n.t));
|
|
716
758
|
}
|
|
717
759
|
}
|
|
718
760
|
async publish() {
|
|
@@ -739,7 +781,7 @@ var Xt = class {
|
|
|
739
781
|
publishing: e.status == "pending"
|
|
740
782
|
}), await this.#_(r, e, s, t.name)) : !1;
|
|
741
783
|
} catch (e) {
|
|
742
|
-
return s() ? (e instanceof
|
|
784
|
+
return s() ? (e instanceof U && e.code == "live.conflict" && await this.#m(r), this.#c(B(e, this.#n.t)), !1) : !1;
|
|
743
785
|
} finally {
|
|
744
786
|
s() && this.#S({ publishing: !1 });
|
|
745
787
|
}
|
|
@@ -765,7 +807,7 @@ var Xt = class {
|
|
|
765
807
|
message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
|
|
766
808
|
}), !0);
|
|
767
809
|
} catch (e) {
|
|
768
|
-
return s() ? (e instanceof
|
|
810
|
+
return s() ? (e instanceof U && e.code == "live.conflict" && await this.#m(r), this.#c(B(e, this.#n.t)), !1) : !1;
|
|
769
811
|
} finally {
|
|
770
812
|
s() && this.#S({ rollingBackPublicationId: void 0 });
|
|
771
813
|
}
|
|
@@ -800,13 +842,13 @@ var Xt = class {
|
|
|
800
842
|
testingTriggerId: void 0,
|
|
801
843
|
testResult: void 0
|
|
802
844
|
});
|
|
803
|
-
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit:
|
|
845
|
+
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: Xt })]);
|
|
804
846
|
if (n()) {
|
|
805
847
|
if (r.status == "rejected") {
|
|
806
848
|
this.#S({
|
|
807
849
|
activitiesLoading: !1,
|
|
808
850
|
detailLoading: !1
|
|
809
|
-
}), this.#c(
|
|
851
|
+
}), this.#c(B(r.reason, this.#n.t));
|
|
810
852
|
return;
|
|
811
853
|
}
|
|
812
854
|
this.#S({
|
|
@@ -820,7 +862,7 @@ var Xt = class {
|
|
|
820
862
|
}) : (this.#S({
|
|
821
863
|
activitiesLoadFailed: !0,
|
|
822
864
|
activitiesLoading: !1
|
|
823
|
-
}), this.#c(
|
|
865
|
+
}), this.#c(B(i.reason, this.#n.t)));
|
|
824
866
|
}
|
|
825
867
|
}
|
|
826
868
|
async loadMoreTriggerActivities() {
|
|
@@ -834,7 +876,7 @@ var Xt = class {
|
|
|
834
876
|
try {
|
|
835
877
|
let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
|
|
836
878
|
cursor: t,
|
|
837
|
-
limit:
|
|
879
|
+
limit: Xt
|
|
838
880
|
});
|
|
839
881
|
if (!i() || this.#l.value.selectedTriggerId != n) return;
|
|
840
882
|
let a = new Set(this.#l.value.activities.map((e) => e.activityId));
|
|
@@ -849,7 +891,7 @@ var Xt = class {
|
|
|
849
891
|
this.#S({
|
|
850
892
|
activitiesLoadFailed: !0,
|
|
851
893
|
activitiesLoadingMore: !1
|
|
852
|
-
}), this.#c(
|
|
894
|
+
}), this.#c(B(e, this.#n.t));
|
|
853
895
|
}
|
|
854
896
|
}
|
|
855
897
|
async testTrigger() {
|
|
@@ -864,7 +906,7 @@ var Xt = class {
|
|
|
864
906
|
let e = await this.#e.testFlowPollTrigger(n.flowId, t);
|
|
865
907
|
return !i() || this.#l.value.selectedTriggerId != t ? !1 : (this.#S({ testResult: e }), !0);
|
|
866
908
|
} catch (e) {
|
|
867
|
-
return i() && this.#l.value.selectedTriggerId == t && this.#c(
|
|
909
|
+
return i() && this.#l.value.selectedTriggerId == t && this.#c(B(e, this.#n.t)), !1;
|
|
868
910
|
} finally {
|
|
869
911
|
i() && this.#l.value.selectedTriggerId == t && this.#S({ testingTriggerId: void 0 });
|
|
870
912
|
}
|
|
@@ -883,7 +925,7 @@ var Xt = class {
|
|
|
883
925
|
message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
|
|
884
926
|
}), !0) : !1;
|
|
885
927
|
} catch (e) {
|
|
886
|
-
return n() && this.#c(
|
|
928
|
+
return n() && this.#c(B(e, this.#n.t)), !1;
|
|
887
929
|
} finally {
|
|
888
930
|
n() && this.#S({ changingTriggerId: void 0 });
|
|
889
931
|
}
|
|
@@ -916,7 +958,7 @@ var Xt = class {
|
|
|
916
958
|
this.#e.getLive(e.flowId, t),
|
|
917
959
|
this.#e.listPublications(e.flowId, {
|
|
918
960
|
includeTotal: !0,
|
|
919
|
-
limit:
|
|
961
|
+
limit: Zt
|
|
920
962
|
}, t),
|
|
921
963
|
this.#e.listFlowTriggerBindings(e.flowId, t)
|
|
922
964
|
]);
|
|
@@ -926,7 +968,7 @@ var Xt = class {
|
|
|
926
968
|
if (t != null && t != "") try {
|
|
927
969
|
return await this.#e.getPublishOperation(e.flowId, t);
|
|
928
970
|
} catch (t) {
|
|
929
|
-
if (t instanceof
|
|
971
|
+
if (t instanceof U && t.code == "publication.operation-not-found") {
|
|
930
972
|
this.#a.setItem(this.#b(e.flowId), "");
|
|
931
973
|
return;
|
|
932
974
|
}
|
|
@@ -949,7 +991,7 @@ var Xt = class {
|
|
|
949
991
|
try: (t) => this.#p(e, t),
|
|
950
992
|
catch: (e) => e
|
|
951
993
|
}).pipe(X.match({
|
|
952
|
-
onFailure: (e) => (n() && this.#c(
|
|
994
|
+
onFailure: (e) => (n() && this.#c(B(e, this.#n.t)), !1),
|
|
953
995
|
onSuccess: () => !0
|
|
954
996
|
}));
|
|
955
997
|
return n() ? (a && this.#c({
|
|
@@ -967,7 +1009,7 @@ var Xt = class {
|
|
|
967
1009
|
return X.gen({ self: this }, function* () {
|
|
968
1010
|
let r = t;
|
|
969
1011
|
for (; r.status == "pending";) {
|
|
970
|
-
if (yield* X.sleep(
|
|
1012
|
+
if (yield* X.sleep(Qt), !n()) return;
|
|
971
1013
|
let t = yield* X.tryPromise({
|
|
972
1014
|
try: (t) => this.#e.getPublishOperation(e.flowId, r.operationId, t),
|
|
973
1015
|
catch: (e) => e
|
|
@@ -978,14 +1020,14 @@ var Xt = class {
|
|
|
978
1020
|
if (!n()) return;
|
|
979
1021
|
if ("error" in t) {
|
|
980
1022
|
let n = t.error;
|
|
981
|
-
if (n instanceof
|
|
1023
|
+
if (n instanceof U && n.code == "publication.operation-not-found") {
|
|
982
1024
|
this.#a.setItem(this.#b(e.flowId), ""), this.#x(e, {
|
|
983
1025
|
operation: void 0,
|
|
984
1026
|
publishing: !1
|
|
985
|
-
}), this.#c(
|
|
1027
|
+
}), this.#c(B(n, this.#n.t));
|
|
986
1028
|
return;
|
|
987
1029
|
}
|
|
988
|
-
this.#c(
|
|
1030
|
+
this.#c(B(n, this.#n.t));
|
|
989
1031
|
continue;
|
|
990
1032
|
}
|
|
991
1033
|
r = t.value, this.#x(e, { operation: r });
|
|
@@ -1001,7 +1043,7 @@ var Xt = class {
|
|
|
1001
1043
|
}
|
|
1002
1044
|
#x(e, t) {
|
|
1003
1045
|
Q(this.#l.value.target, e) ? this.#S(t) : this.#l.set({
|
|
1004
|
-
...
|
|
1046
|
+
...Yt,
|
|
1005
1047
|
...t,
|
|
1006
1048
|
target: e
|
|
1007
1049
|
});
|
|
@@ -1012,8 +1054,8 @@ var Xt = class {
|
|
|
1012
1054
|
...e
|
|
1013
1055
|
});
|
|
1014
1056
|
}
|
|
1015
|
-
},
|
|
1016
|
-
function
|
|
1057
|
+
}, en = { starting: !1 };
|
|
1058
|
+
function tn(e) {
|
|
1017
1059
|
switch (e.kind) {
|
|
1018
1060
|
case "condition": return { [e.node.input.handle]: e.node.input };
|
|
1019
1061
|
case "subflow": return tt(e.definition?.inputs ?? []);
|
|
@@ -1022,10 +1064,10 @@ function Qt(e) {
|
|
|
1022
1064
|
case "wait": return { [e.node.input.handle]: e.node.input };
|
|
1023
1065
|
}
|
|
1024
1066
|
}
|
|
1025
|
-
function
|
|
1067
|
+
function nn(e) {
|
|
1026
1068
|
return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
|
|
1027
1069
|
}
|
|
1028
|
-
function
|
|
1070
|
+
function rn(e, t) {
|
|
1029
1071
|
let n = z(e), r = n.graph({ kind: "flow" });
|
|
1030
1072
|
if (r == null) return [];
|
|
1031
1073
|
let i = /* @__PURE__ */ new Set([t]), a = [t];
|
|
@@ -1038,13 +1080,13 @@ function en(e, t) {
|
|
|
1038
1080
|
if (r.kind == "trigger") return r.trigger.kind == "manual" || r.trigger.kind == "cron" ? [] : [{
|
|
1039
1081
|
definitions: [{
|
|
1040
1082
|
handle: "payload",
|
|
1041
|
-
jsonSchema:
|
|
1083
|
+
jsonSchema: He(r.trigger),
|
|
1042
1084
|
nullable: !1
|
|
1043
1085
|
}],
|
|
1044
1086
|
nodeId: e,
|
|
1045
1087
|
title: r.trigger.name
|
|
1046
1088
|
}];
|
|
1047
|
-
let i = Object.entries(
|
|
1089
|
+
let i = Object.entries(tn(r)).filter(([e, t]) => r.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
|
|
1048
1090
|
handle: e,
|
|
1049
1091
|
jsonSchema: t.jsonSchema,
|
|
1050
1092
|
nullable: t.nullable
|
|
@@ -1052,18 +1094,18 @@ function en(e, t) {
|
|
|
1052
1094
|
return i.length == 0 ? [] : [{
|
|
1053
1095
|
definitions: i,
|
|
1054
1096
|
nodeId: e,
|
|
1055
|
-
title:
|
|
1097
|
+
title: nn(r)
|
|
1056
1098
|
}];
|
|
1057
1099
|
});
|
|
1058
1100
|
}
|
|
1059
|
-
function
|
|
1101
|
+
function an(e) {
|
|
1060
1102
|
return JSON.stringify(e.map((e) => [e.nodeId, e.definitions.map((e) => [
|
|
1061
1103
|
e.handle,
|
|
1062
1104
|
e.jsonSchema,
|
|
1063
1105
|
e.nullable
|
|
1064
1106
|
])]));
|
|
1065
1107
|
}
|
|
1066
|
-
async function
|
|
1108
|
+
async function on(e, t, n) {
|
|
1067
1109
|
let { FlowRunInputEditorStore: r } = await import("./flowRunInputEditorStore-BBqQIOCR.js").then((e) => e.n);
|
|
1068
1110
|
return e.map((e) => {
|
|
1069
1111
|
let i = new r(e.definitions, t);
|
|
@@ -1074,28 +1116,28 @@ async function nn(e, t, n) {
|
|
|
1074
1116
|
};
|
|
1075
1117
|
});
|
|
1076
1118
|
}
|
|
1077
|
-
function
|
|
1119
|
+
function sn(e) {
|
|
1078
1120
|
return Object.fromEntries(e.map((e) => [e.nodeId, e.editor.values()]));
|
|
1079
1121
|
}
|
|
1080
|
-
function
|
|
1122
|
+
function cn(e, t) {
|
|
1081
1123
|
return {
|
|
1082
1124
|
inputs: Object.fromEntries(e.filter((e) => e.nodeId != t).map((e) => [e.nodeId, e.editor.values()])),
|
|
1083
1125
|
payload: e.find((e) => e.nodeId == t)?.editor.values().payload ?? {}
|
|
1084
1126
|
};
|
|
1085
1127
|
}
|
|
1086
|
-
var
|
|
1128
|
+
var ln = class {
|
|
1087
1129
|
#e;
|
|
1088
1130
|
#t;
|
|
1089
1131
|
#n;
|
|
1090
1132
|
#r;
|
|
1091
|
-
#i = new
|
|
1092
|
-
#a = new
|
|
1133
|
+
#i = new L();
|
|
1134
|
+
#a = new L();
|
|
1093
1135
|
#o;
|
|
1094
1136
|
#s = /* @__PURE__ */ new Map();
|
|
1095
1137
|
#c;
|
|
1096
|
-
#l = n(
|
|
1138
|
+
#l = n(en);
|
|
1097
1139
|
#u;
|
|
1098
|
-
constructor(t, n, r, i, a =
|
|
1140
|
+
constructor(t, n, r, i, a = p(), o = P) {
|
|
1099
1141
|
this.#e = i, this.#t = t, this.#o = n, this.#c = r, this.#r = a, this.#n = o, this.$ = {
|
|
1100
1142
|
inputRequest: e(this.#l, (e) => e.inputRequest),
|
|
1101
1143
|
starting: e(this.#l, (e) => e.starting),
|
|
@@ -1110,14 +1152,14 @@ var on = class {
|
|
|
1110
1152
|
reset() {
|
|
1111
1153
|
this.#i.invalidate(), this.#a.invalidate(), this.#u = void 0;
|
|
1112
1154
|
let e = this.#l.value.inputRequest;
|
|
1113
|
-
this.#h(e), this.#l.set(
|
|
1155
|
+
this.#h(e), this.#l.set(en), this.#p(e);
|
|
1114
1156
|
}
|
|
1115
1157
|
async requestDraft(e, t, n) {
|
|
1116
1158
|
let r = this.#a.begin();
|
|
1117
1159
|
try {
|
|
1118
1160
|
return await this.#d("draft", e, t, t.revisionId, r, void 0, n);
|
|
1119
1161
|
} catch (e) {
|
|
1120
|
-
return r() && this.#c(
|
|
1162
|
+
return r() && this.#c(B(e, this.#r.t)), "unavailable";
|
|
1121
1163
|
} finally {
|
|
1122
1164
|
r() && this.#g({ starting: !1 });
|
|
1123
1165
|
}
|
|
@@ -1127,16 +1169,16 @@ var on = class {
|
|
|
1127
1169
|
try {
|
|
1128
1170
|
return await this.#d("draft", e, t, t.revisionId, r, void 0, n, !0);
|
|
1129
1171
|
} catch (e) {
|
|
1130
|
-
return r() && this.#c(
|
|
1172
|
+
return r() && this.#c(B(e, this.#r.t)), "unavailable";
|
|
1131
1173
|
} finally {
|
|
1132
1174
|
r() && this.#g({ starting: !1 });
|
|
1133
1175
|
}
|
|
1134
1176
|
}
|
|
1135
1177
|
inputStatus(e, t, n) {
|
|
1136
|
-
let r =
|
|
1178
|
+
let r = rn(t, n);
|
|
1137
1179
|
if (r.length == 0) return "none";
|
|
1138
1180
|
let i = this.#s.get(this.#m(e, n));
|
|
1139
|
-
return i?.valid == 1 && i.signature ==
|
|
1181
|
+
return i?.valid == 1 && i.signature == an(r) ? "ready" : "missing";
|
|
1140
1182
|
}
|
|
1141
1183
|
async requestLive(e) {
|
|
1142
1184
|
let t = this.#a.begin();
|
|
@@ -1147,7 +1189,7 @@ var on = class {
|
|
|
1147
1189
|
let r = await this.#t.getRevision(e.flowId, n.revisionId);
|
|
1148
1190
|
return t() ? await this.#d("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
|
|
1149
1191
|
} catch (e) {
|
|
1150
|
-
return t() && this.#c(
|
|
1192
|
+
return t() && this.#c(B(e, this.#r.t)), "unavailable";
|
|
1151
1193
|
} finally {
|
|
1152
1194
|
t() && this.#g({ starting: !1 });
|
|
1153
1195
|
}
|
|
@@ -1164,7 +1206,7 @@ var on = class {
|
|
|
1164
1206
|
attempted: !0
|
|
1165
1207
|
} }), !1;
|
|
1166
1208
|
this.#h(e);
|
|
1167
|
-
let { inputs: t, payload: n } =
|
|
1209
|
+
let { inputs: t, payload: n } = cn(e.groups, e.triggerId), r = await this.#f(e.source, e.flow, e.revisionId, {
|
|
1168
1210
|
nodeId: e.triggerId,
|
|
1169
1211
|
payload: n
|
|
1170
1212
|
}, t, e.publicationId);
|
|
@@ -1176,7 +1218,7 @@ var on = class {
|
|
|
1176
1218
|
let r = this.#a.begin();
|
|
1177
1219
|
this.#h(n), this.#g({ starting: !0 });
|
|
1178
1220
|
try {
|
|
1179
|
-
let i =
|
|
1221
|
+
let i = rn(n.revision, e), a = this.#s.get(this.#m(n.flow.flowId, e)), o = await on(i, this.#r.lang$, a?.values);
|
|
1180
1222
|
if (!r() || this.#l.value.inputRequest !== n) {
|
|
1181
1223
|
for (let e of o) e.editor.dispose();
|
|
1182
1224
|
return;
|
|
@@ -1190,7 +1232,7 @@ var on = class {
|
|
|
1190
1232
|
valid: s
|
|
1191
1233
|
} }), this.#p(n);
|
|
1192
1234
|
} catch (e) {
|
|
1193
|
-
r() && this.#c(
|
|
1235
|
+
r() && this.#c(B(e, this.#r.t));
|
|
1194
1236
|
} finally {
|
|
1195
1237
|
r() && this.#g({ starting: !1 });
|
|
1196
1238
|
}
|
|
@@ -1215,7 +1257,7 @@ var on = class {
|
|
|
1215
1257
|
kind: "error",
|
|
1216
1258
|
message: this.#r.t("runInput.selectTrigger")
|
|
1217
1259
|
}), "unavailable";
|
|
1218
|
-
let p = f == null ? [] :
|
|
1260
|
+
let p = f == null ? [] : rn(r, f.nodeId), m = an(p), h = f == null ? void 0 : this.#s.get(this.#m(n.flowId, f.nodeId)), g = f == null ? [] : await on(p, this.#r.lang$, h?.values);
|
|
1219
1261
|
if (!a()) {
|
|
1220
1262
|
for (let e of g) e.editor.dispose();
|
|
1221
1263
|
return "unavailable";
|
|
@@ -1225,7 +1267,7 @@ var on = class {
|
|
|
1225
1267
|
payload: {}
|
|
1226
1268
|
}, {}, o) ? "started" : "unavailable";
|
|
1227
1269
|
if (!c && f != null && h?.valid == 1 && h.signature == m && g.every((e) => e.editor.valid$.value)) {
|
|
1228
|
-
let t =
|
|
1270
|
+
let t = cn(g, f.nodeId);
|
|
1229
1271
|
for (let e of g) e.editor.dispose();
|
|
1230
1272
|
return await this.#f(e, n, i, {
|
|
1231
1273
|
nodeId: f.nodeId,
|
|
@@ -1287,7 +1329,7 @@ var on = class {
|
|
|
1287
1329
|
});
|
|
1288
1330
|
return !o() || !s() ? !1 : (this.#u = void 0, this.#o.follow(d, s));
|
|
1289
1331
|
} catch (e) {
|
|
1290
|
-
return o() && s() && this.#c(
|
|
1332
|
+
return o() && s() && this.#c(B(e, this.#r.t)), !1;
|
|
1291
1333
|
} finally {
|
|
1292
1334
|
o() && this.#g({
|
|
1293
1335
|
starting: !1,
|
|
@@ -1306,9 +1348,9 @@ var on = class {
|
|
|
1306
1348
|
}
|
|
1307
1349
|
#h(e) {
|
|
1308
1350
|
e?.triggerId != null && e.groups.length != 0 && this.#s.set(this.#m(e.flow.flowId, e.triggerId), {
|
|
1309
|
-
signature:
|
|
1351
|
+
signature: an(rn(e.revision, e.triggerId)),
|
|
1310
1352
|
valid: e.valid.value,
|
|
1311
|
-
values:
|
|
1353
|
+
values: sn(e.groups)
|
|
1312
1354
|
});
|
|
1313
1355
|
}
|
|
1314
1356
|
#g(e) {
|
|
@@ -1320,101 +1362,101 @@ var on = class {
|
|
|
1320
1362
|
};
|
|
1321
1363
|
//#endregion
|
|
1322
1364
|
//#region src/connector/common/actionSchema.ts
|
|
1323
|
-
function
|
|
1324
|
-
let n =
|
|
1365
|
+
function un(e, t) {
|
|
1366
|
+
let n = dn(e);
|
|
1325
1367
|
return {
|
|
1326
1368
|
inputs: n,
|
|
1327
1369
|
initialInputs: n.flatMap((e) => e.value === void 0 ? [] : [{
|
|
1328
1370
|
handle: e.handle,
|
|
1329
1371
|
value: e.value
|
|
1330
1372
|
}]),
|
|
1331
|
-
outputs:
|
|
1373
|
+
outputs: fn(t)
|
|
1332
1374
|
};
|
|
1333
1375
|
}
|
|
1334
|
-
function
|
|
1335
|
-
let t =
|
|
1376
|
+
function dn(e) {
|
|
1377
|
+
let t = G(e);
|
|
1336
1378
|
if (t == null || t.type != "object" && t.properties == null) throw Error("Connector action inputSchema must be an object schema.");
|
|
1337
|
-
let n =
|
|
1379
|
+
let n = G(t.properties);
|
|
1338
1380
|
if (n == null) return [];
|
|
1339
|
-
let r =
|
|
1381
|
+
let r = gn(t.required);
|
|
1340
1382
|
return Object.entries(n).map(([e, n]) => {
|
|
1341
1383
|
let i = !r.has(e) || $(n, t);
|
|
1342
1384
|
return {
|
|
1343
|
-
description:
|
|
1385
|
+
description: mn(t, n),
|
|
1344
1386
|
handle: e,
|
|
1345
|
-
json_schema:
|
|
1387
|
+
json_schema: pn(t, n),
|
|
1346
1388
|
nullable: i,
|
|
1347
|
-
value:
|
|
1389
|
+
value: hn(t, n, i)
|
|
1348
1390
|
};
|
|
1349
1391
|
});
|
|
1350
1392
|
}
|
|
1351
|
-
function
|
|
1352
|
-
let t =
|
|
1393
|
+
function fn(e) {
|
|
1394
|
+
let t = G(e), n = G(t?.properties);
|
|
1353
1395
|
if (t != null && (t.type == "object" || n != null)) {
|
|
1354
1396
|
if (n == null) return [];
|
|
1355
|
-
let e =
|
|
1397
|
+
let e = gn(t.required);
|
|
1356
1398
|
return Object.entries(n).map(([n, r]) => ({
|
|
1357
|
-
description:
|
|
1399
|
+
description: mn(t, r),
|
|
1358
1400
|
handle: n,
|
|
1359
|
-
json_schema:
|
|
1401
|
+
json_schema: pn(t, r),
|
|
1360
1402
|
nullable: !e.has(n) || $(r, t)
|
|
1361
1403
|
}));
|
|
1362
1404
|
}
|
|
1363
1405
|
return [{
|
|
1364
|
-
description:
|
|
1406
|
+
description: mn(t, e),
|
|
1365
1407
|
handle: "output",
|
|
1366
1408
|
json_schema: e,
|
|
1367
1409
|
nullable: $(e)
|
|
1368
1410
|
}];
|
|
1369
1411
|
}
|
|
1370
|
-
function
|
|
1371
|
-
let n =
|
|
1412
|
+
function pn(e, t) {
|
|
1413
|
+
let n = G(t);
|
|
1372
1414
|
if (n == null) return t;
|
|
1373
1415
|
let r = Object.assign({}, n);
|
|
1374
1416
|
return r.$defs == null && e.$defs != null && (r.$defs = e.$defs), r.definitions == null && e.definitions != null && (r.definitions = e.definitions), r;
|
|
1375
1417
|
}
|
|
1376
|
-
function
|
|
1377
|
-
for (let n of
|
|
1418
|
+
function mn(e, t) {
|
|
1419
|
+
for (let n of _n(e, t)) if (typeof n.description == "string") return n.description;
|
|
1378
1420
|
}
|
|
1379
|
-
function
|
|
1380
|
-
for (let n of
|
|
1421
|
+
function hn(e, t, n) {
|
|
1422
|
+
for (let n of _n(e, t)) if (Object.hasOwn(n, "default")) return n.default;
|
|
1381
1423
|
return n ? null : void 0;
|
|
1382
1424
|
}
|
|
1383
|
-
function
|
|
1425
|
+
function gn(e) {
|
|
1384
1426
|
return Array.isArray(e) ? new Set(e.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set();
|
|
1385
1427
|
}
|
|
1386
1428
|
function $(e, t = e, n = /* @__PURE__ */ new Set()) {
|
|
1387
|
-
let r =
|
|
1429
|
+
let r = G(e);
|
|
1388
1430
|
if (r == null) return !1;
|
|
1389
1431
|
if (Object.hasOwn(r, "type")) return r.type == "null" || Array.isArray(r.type) && r.type.includes("null");
|
|
1390
1432
|
if (Object.hasOwn(r, "enum")) return Array.isArray(r.enum) && r.enum.includes(null);
|
|
1391
1433
|
for (let e of ["anyOf", "oneOf"]) if (Object.hasOwn(r, e)) return Array.isArray(r[e]) && r[e].some((e) => $(e, t, n));
|
|
1392
1434
|
let i = typeof r.$ref == "string" ? r.$ref : void 0;
|
|
1393
1435
|
if (i == null || n.has(i)) return !1;
|
|
1394
|
-
let a =
|
|
1436
|
+
let a = vn(t, i);
|
|
1395
1437
|
if (a === void 0) return !1;
|
|
1396
1438
|
let o = new Set(n);
|
|
1397
1439
|
return o.add(i), $(a, t, o);
|
|
1398
1440
|
}
|
|
1399
|
-
function
|
|
1441
|
+
function _n(e, t) {
|
|
1400
1442
|
let n = [], r = /* @__PURE__ */ new Set(), i = t;
|
|
1401
1443
|
for (;;) {
|
|
1402
|
-
let t =
|
|
1444
|
+
let t = G(i);
|
|
1403
1445
|
if (t == null) return n;
|
|
1404
1446
|
n.push(t);
|
|
1405
1447
|
let a = typeof t.$ref == "string" ? t.$ref : void 0;
|
|
1406
1448
|
if (a == null || r.has(a)) return n;
|
|
1407
|
-
let o =
|
|
1449
|
+
let o = vn(e, a);
|
|
1408
1450
|
if (o === void 0) return n;
|
|
1409
1451
|
r.add(a), i = o;
|
|
1410
1452
|
}
|
|
1411
1453
|
}
|
|
1412
|
-
function
|
|
1454
|
+
function vn(e, t) {
|
|
1413
1455
|
if (t == "#") return e;
|
|
1414
1456
|
if (!t.startsWith("#/")) return;
|
|
1415
1457
|
let n = e;
|
|
1416
1458
|
for (let e of t.slice(2).split("/")) {
|
|
1417
|
-
let t =
|
|
1459
|
+
let t = G(n), r = e.replaceAll("~1", "/").replaceAll("~0", "~");
|
|
1418
1460
|
if (t == null || !Object.hasOwn(t, r)) return;
|
|
1419
1461
|
n = t[r];
|
|
1420
1462
|
}
|
|
@@ -1422,77 +1464,77 @@ function hn(e, t) {
|
|
|
1422
1464
|
}
|
|
1423
1465
|
//#endregion
|
|
1424
1466
|
//#region src/workbench/browser/runtime/stores/proxyCatalog.ts
|
|
1425
|
-
function
|
|
1426
|
-
let n =
|
|
1427
|
-
if (n.success === !1) throw new
|
|
1428
|
-
if (n.success !== !0 || !Array.isArray(n.data)) return
|
|
1429
|
-
for (let e of n.data) t(
|
|
1467
|
+
function yn(e, t) {
|
|
1468
|
+
let n = pe(e);
|
|
1469
|
+
if (n.success === !1) throw new U(502, typeof n.errorCode == "string" ? n.errorCode : "connector.unavailable", typeof n.message == "string" ? n.message : "Connector request failed.");
|
|
1470
|
+
if (n.success !== !0 || !Array.isArray(n.data)) return F();
|
|
1471
|
+
for (let e of n.data) t(pe(e));
|
|
1430
1472
|
return n;
|
|
1431
1473
|
}
|
|
1432
|
-
function
|
|
1433
|
-
return !Array.isArray(e.authTypes) || e.authTypes.some((e) => typeof e != "string") ?
|
|
1434
|
-
serviceId:
|
|
1435
|
-
serviceName:
|
|
1474
|
+
function bn(e) {
|
|
1475
|
+
return !Array.isArray(e.authTypes) || e.authTypes.some((e) => typeof e != "string") ? F() : {
|
|
1476
|
+
serviceId: V(e.service),
|
|
1477
|
+
serviceName: V(e.displayName),
|
|
1436
1478
|
noSetup: e.authTypes.length == 1 && e.authTypes[0] == "no_auth",
|
|
1437
|
-
...e.iconUrl == null || e.iconUrl === "" ? {} : { icon:
|
|
1438
|
-
...e.homepageUrl == null || e.homepageUrl === "" ? {} : { homepageUrl:
|
|
1479
|
+
...e.iconUrl == null || e.iconUrl === "" ? {} : { icon: V(e.iconUrl) },
|
|
1480
|
+
...e.homepageUrl == null || e.homepageUrl === "" ? {} : { homepageUrl: V(e.homepageUrl) }
|
|
1439
1481
|
};
|
|
1440
1482
|
}
|
|
1441
|
-
function
|
|
1483
|
+
function xn(e) {
|
|
1442
1484
|
return typeof e.isDefault != "boolean" || typeof e.status != "string" || ![
|
|
1443
1485
|
"active",
|
|
1444
1486
|
"disconnected",
|
|
1445
1487
|
"error",
|
|
1446
1488
|
"reauth_required"
|
|
1447
|
-
].includes(e.status) ?
|
|
1448
|
-
connectionId:
|
|
1449
|
-
serviceId:
|
|
1450
|
-
displayName:
|
|
1489
|
+
].includes(e.status) ? F() : {
|
|
1490
|
+
connectionId: V(e.id),
|
|
1491
|
+
serviceId: V(e.service),
|
|
1492
|
+
displayName: V(e.displayName),
|
|
1451
1493
|
isDefault: e.isDefault,
|
|
1452
1494
|
status: e.status,
|
|
1453
|
-
...e.alias == null ? {} : { alias:
|
|
1495
|
+
...e.alias == null ? {} : { alias: V(e.alias) },
|
|
1454
1496
|
...e.marketplace == null ? {} : { builtInAccount: !0 }
|
|
1455
1497
|
};
|
|
1456
1498
|
}
|
|
1457
|
-
function
|
|
1458
|
-
if (
|
|
1459
|
-
|
|
1499
|
+
function Sn(e) {
|
|
1500
|
+
if (V(e.id), V(e.service), V(e.name), typeof e.description != "string") return F();
|
|
1501
|
+
un(e.inputSchema, e.outputSchema);
|
|
1460
1502
|
}
|
|
1461
|
-
function
|
|
1503
|
+
function Cn(e) {
|
|
1462
1504
|
return {
|
|
1463
1505
|
nullable: e.nullable,
|
|
1464
|
-
jsonSchema:
|
|
1506
|
+
jsonSchema: Te(e.json_schema),
|
|
1465
1507
|
...e.description == null ? {} : { description: e.description },
|
|
1466
|
-
...e.value === void 0 ? {} : { value:
|
|
1508
|
+
...e.value === void 0 ? {} : { value: Te(e.value) }
|
|
1467
1509
|
};
|
|
1468
1510
|
}
|
|
1469
|
-
function
|
|
1511
|
+
function wn(e, t) {
|
|
1470
1512
|
let n = t.data.find((t) => t.service == e.service);
|
|
1471
|
-
if (n == null) return
|
|
1472
|
-
let r =
|
|
1513
|
+
if (n == null) return F();
|
|
1514
|
+
let r = bn(n), i = un(e.inputSchema, e.outputSchema);
|
|
1473
1515
|
return {
|
|
1474
1516
|
serviceId: r.serviceId,
|
|
1475
1517
|
serviceName: r.serviceName,
|
|
1476
1518
|
...r.icon == null ? {} : { icon: r.icon },
|
|
1477
1519
|
...r.homepageUrl == null ? {} : { homepageUrl: r.homepageUrl },
|
|
1478
|
-
actionId:
|
|
1479
|
-
...e.operationType == null ? {} : { operationType:
|
|
1480
|
-
name:
|
|
1520
|
+
actionId: V(e.id),
|
|
1521
|
+
...e.operationType == null ? {} : { operationType: V(e.operationType) },
|
|
1522
|
+
name: V(e.name),
|
|
1481
1523
|
description: e.description,
|
|
1482
1524
|
authenticated: !n.authTypes.includes("no_auth"),
|
|
1483
|
-
inputSchema:
|
|
1484
|
-
outputSchema:
|
|
1485
|
-
inputs: Object.fromEntries(i.inputs.map((e) => [e.handle,
|
|
1486
|
-
outputs: Object.fromEntries(i.outputs.map((e) => [e.handle,
|
|
1525
|
+
inputSchema: Te(e.inputSchema),
|
|
1526
|
+
outputSchema: Te(e.outputSchema),
|
|
1527
|
+
inputs: Object.fromEntries(i.inputs.map((e) => [e.handle, Cn(e)])),
|
|
1528
|
+
outputs: Object.fromEntries(i.outputs.map((e) => [e.handle, Cn(e)]))
|
|
1487
1529
|
};
|
|
1488
1530
|
}
|
|
1489
1531
|
//#endregion
|
|
1490
1532
|
//#region src/workbench/browser/runtime/stores/catalogStores.ts
|
|
1491
|
-
function
|
|
1492
|
-
let t =
|
|
1493
|
-
return t.version != 1 || !Array.isArray(t.actions) ?
|
|
1533
|
+
function Tn(e) {
|
|
1534
|
+
let t = pe(e);
|
|
1535
|
+
return t.version != 1 || !Array.isArray(t.actions) ? F() : t.actions.map(ze);
|
|
1494
1536
|
}
|
|
1495
|
-
var
|
|
1537
|
+
var En = (...e) => JSON.stringify(e), Dn = class {
|
|
1496
1538
|
constructor(e, t, n) {
|
|
1497
1539
|
this.client = e, this.kind = t, this.options = n, this.entries = /* @__PURE__ */ new Map();
|
|
1498
1540
|
}
|
|
@@ -1503,10 +1545,10 @@ var Cn = (...e) => JSON.stringify(e), wn = class {
|
|
|
1503
1545
|
...t == null ? {} : { locale: t }
|
|
1504
1546
|
}), a = `/v1/connector/proxy/${this.kind}${i.size ? `?${i}` : ""}`, o = this.entries.get(a);
|
|
1505
1547
|
if (o == null) {
|
|
1506
|
-
let e = (e) =>
|
|
1507
|
-
if (
|
|
1548
|
+
let e = (e) => yn(e, this.kind == "providers" ? bn : this.kind == "apps" ? xn : (e) => {
|
|
1549
|
+
if (Sn(e), e.service != n) return F();
|
|
1508
1550
|
});
|
|
1509
|
-
o = new
|
|
1551
|
+
o = new ie((t, n) => this.client.readProxyCatalog({
|
|
1510
1552
|
path: a,
|
|
1511
1553
|
decode: e
|
|
1512
1554
|
}, t, n), this.kind == "providers" ? 3e5 : 3e4, this.options == null ? void 0 : {
|
|
@@ -1524,7 +1566,7 @@ var Cn = (...e) => JSON.stringify(e), wn = class {
|
|
|
1524
1566
|
for (let e of this.entries.values()) e.dispose();
|
|
1525
1567
|
this.entries.clear();
|
|
1526
1568
|
}
|
|
1527
|
-
},
|
|
1569
|
+
}, On = class {
|
|
1528
1570
|
constructor() {
|
|
1529
1571
|
this.entries = /* @__PURE__ */ new Map();
|
|
1530
1572
|
}
|
|
@@ -1562,13 +1604,13 @@ var Cn = (...e) => JSON.stringify(e), wn = class {
|
|
|
1562
1604
|
for (let e of this.entries.values()) e.dispose();
|
|
1563
1605
|
this.entries.clear();
|
|
1564
1606
|
}
|
|
1565
|
-
},
|
|
1566
|
-
#e = new
|
|
1607
|
+
}, kn = class {
|
|
1608
|
+
#e = new On();
|
|
1567
1609
|
constructor(e, t) {
|
|
1568
|
-
this.raw = new
|
|
1610
|
+
this.raw = new Dn(e, "providers", t);
|
|
1569
1611
|
}
|
|
1570
1612
|
get(e, t = "en", n = !1) {
|
|
1571
|
-
return this.#e.get(
|
|
1613
|
+
return this.#e.get(En(e, t), [this.raw.get(e, t, void 0, n)], (e) => e.data.map(bn));
|
|
1572
1614
|
}
|
|
1573
1615
|
retryFailed() {
|
|
1574
1616
|
this.raw.retryFailed();
|
|
@@ -1576,14 +1618,14 @@ var Cn = (...e) => JSON.stringify(e), wn = class {
|
|
|
1576
1618
|
dispose() {
|
|
1577
1619
|
this.#e.dispose(), this.raw.dispose();
|
|
1578
1620
|
}
|
|
1579
|
-
},
|
|
1621
|
+
}, An = class {
|
|
1580
1622
|
#e;
|
|
1581
|
-
#t = new
|
|
1623
|
+
#t = new On();
|
|
1582
1624
|
constructor(e, t) {
|
|
1583
|
-
this.#e = new
|
|
1625
|
+
this.#e = new Dn(e, "apps", t);
|
|
1584
1626
|
}
|
|
1585
1627
|
get(e, t, n = !1) {
|
|
1586
|
-
return this.#t.get(
|
|
1628
|
+
return this.#t.get(En(t, e), [this.#e.get(t, void 0, void 0, n)], (t) => t.data.filter((t) => e == null || t.service == e).map(xn));
|
|
1587
1629
|
}
|
|
1588
1630
|
retryFailed() {
|
|
1589
1631
|
this.#e.retryFailed();
|
|
@@ -1591,20 +1633,20 @@ var Cn = (...e) => JSON.stringify(e), wn = class {
|
|
|
1591
1633
|
dispose() {
|
|
1592
1634
|
this.#t.dispose(), this.#e.dispose();
|
|
1593
1635
|
}
|
|
1594
|
-
},
|
|
1636
|
+
}, jn = class {
|
|
1595
1637
|
#e;
|
|
1596
|
-
#t = new
|
|
1638
|
+
#t = new On();
|
|
1597
1639
|
#n = /* @__PURE__ */ new Map();
|
|
1598
1640
|
#r = /* @__PURE__ */ new Set();
|
|
1599
1641
|
#i = /* @__PURE__ */ new WeakMap();
|
|
1600
1642
|
constructor(e, t, n) {
|
|
1601
|
-
this.client = e, this.providers = t, this.#e = new
|
|
1643
|
+
this.client = e, this.providers = t, this.#e = new Dn(e, "actions", n);
|
|
1602
1644
|
}
|
|
1603
1645
|
get(e, t, n = "en", r = !1) {
|
|
1604
|
-
return this.#t.get(
|
|
1646
|
+
return this.#t.get(En(t, e, n), [this.#e.get(t, n, e, r), this.providers.raw.get(t, n)], (e, t) => e.data.map((e) => wn(e, t)));
|
|
1605
1647
|
}
|
|
1606
1648
|
detail(e, n, r = "en", i = !1) {
|
|
1607
|
-
let a = this.get(e.slice(0, e.indexOf(".")), n, r, i), o =
|
|
1649
|
+
let a = this.get(e.slice(0, e.indexOf(".")), n, r, i), o = En(n, e, r), s = this.#n.get(o);
|
|
1608
1650
|
return s ?? (s = t((t) => {
|
|
1609
1651
|
let n = t(a), r = n.data?.find((t) => t.actionId == e);
|
|
1610
1652
|
return {
|
|
@@ -1630,9 +1672,9 @@ var Cn = (...e) => JSON.stringify(e), wn = class {
|
|
|
1630
1672
|
}
|
|
1631
1673
|
let s = o.get(a);
|
|
1632
1674
|
if (s != null) return s.refresh(), s;
|
|
1633
|
-
let c = new
|
|
1675
|
+
let c = new ie((e, t) => this.client.readCatalog({
|
|
1634
1676
|
path: `/v1/connector/action-metadata?${i}`,
|
|
1635
|
-
decode:
|
|
1677
|
+
decode: Tn
|
|
1636
1678
|
}, null, t), 3e4);
|
|
1637
1679
|
return r.aborted ? c.dispose() : (o.set(a, c), this.#r.add(c)), c;
|
|
1638
1680
|
}
|
|
@@ -1645,25 +1687,22 @@ var Cn = (...e) => JSON.stringify(e), wn = class {
|
|
|
1645
1687
|
for (let e of this.#n.values()) e.dispose();
|
|
1646
1688
|
this.#n.clear(), this.#t.dispose(), this.#e.dispose();
|
|
1647
1689
|
}
|
|
1648
|
-
},
|
|
1690
|
+
}, Mn = class {
|
|
1649
1691
|
constructor(e, t) {
|
|
1650
|
-
this.providers = new
|
|
1692
|
+
this.providers = new kn(e, t), this.actions = new jn(e, this.providers, t), this.connections = new An(e, t);
|
|
1651
1693
|
}
|
|
1652
1694
|
dispose() {
|
|
1653
1695
|
this.actions.dispose(), this.connections.dispose(), this.providers.dispose();
|
|
1654
1696
|
}
|
|
1655
|
-
},
|
|
1656
|
-
|
|
1657
|
-
services: []
|
|
1658
|
-
};
|
|
1659
|
-
function jn(e) {
|
|
1697
|
+
}, Nn = {};
|
|
1698
|
+
function Pn(e) {
|
|
1660
1699
|
return Object.entries(e).map(([e, t]) => ({
|
|
1661
1700
|
description: t.description,
|
|
1662
1701
|
handle: e,
|
|
1663
1702
|
jsonSchema: t.jsonSchema
|
|
1664
1703
|
}));
|
|
1665
1704
|
}
|
|
1666
|
-
function
|
|
1705
|
+
function Fn(e, t) {
|
|
1667
1706
|
return {
|
|
1668
1707
|
connector: e,
|
|
1669
1708
|
description: e.authenticated && e.defaultConnection == null ? t("addNode.connectorNeedsConnection", {
|
|
@@ -1671,15 +1710,15 @@ function Mn(e, t) {
|
|
|
1671
1710
|
service: e.serviceName
|
|
1672
1711
|
}) : e.description,
|
|
1673
1712
|
group: t("addNode.connectorActions"),
|
|
1674
|
-
icon:
|
|
1713
|
+
icon: M(e),
|
|
1675
1714
|
id: `connector:${e.actionId}`,
|
|
1676
|
-
inputs:
|
|
1715
|
+
inputs: Pn(e.inputs),
|
|
1677
1716
|
kind: "connector",
|
|
1678
1717
|
label: e.name,
|
|
1679
|
-
outputs:
|
|
1718
|
+
outputs: Pn(e.outputs)
|
|
1680
1719
|
};
|
|
1681
1720
|
}
|
|
1682
|
-
function
|
|
1721
|
+
function In(e, t) {
|
|
1683
1722
|
let n = /* @__PURE__ */ new Map();
|
|
1684
1723
|
for (let t of e) {
|
|
1685
1724
|
let e = n.get(t.serviceId) ?? [];
|
|
@@ -1687,7 +1726,7 @@ function Nn(e, t) {
|
|
|
1687
1726
|
}
|
|
1688
1727
|
return [...n.values()].toSorted((e, t) => e[0].serviceName.localeCompare(t[0].serviceName)).map((e) => {
|
|
1689
1728
|
let n = e[0], r = e.map((e) => {
|
|
1690
|
-
let n =
|
|
1729
|
+
let n = Fn(e, t);
|
|
1691
1730
|
return {
|
|
1692
1731
|
description: n.description,
|
|
1693
1732
|
label: n.label,
|
|
@@ -1698,7 +1737,7 @@ function Nn(e, t) {
|
|
|
1698
1737
|
choices: r,
|
|
1699
1738
|
description: t(r.length == 1 ? "addNode.connectorActionCountOne" : "addNode.connectorActionCount", { count: r.length }),
|
|
1700
1739
|
group: t("addNode.connectorActions"),
|
|
1701
|
-
icon:
|
|
1740
|
+
icon: M(n),
|
|
1702
1741
|
id: `connector-provider:${n.serviceId}`,
|
|
1703
1742
|
inputs: [],
|
|
1704
1743
|
kind: "connector-group",
|
|
@@ -1708,12 +1747,12 @@ function Nn(e, t) {
|
|
|
1708
1747
|
};
|
|
1709
1748
|
});
|
|
1710
1749
|
}
|
|
1711
|
-
function
|
|
1750
|
+
function Ln(e, t) {
|
|
1712
1751
|
return {
|
|
1713
1752
|
choices: [],
|
|
1714
1753
|
description: t("addNode.connectorBrowseActions"),
|
|
1715
1754
|
group: t("addNode.connectorActions"),
|
|
1716
|
-
icon:
|
|
1755
|
+
icon: M(e),
|
|
1717
1756
|
id: `connector-provider:${e.serviceId}`,
|
|
1718
1757
|
inputs: [],
|
|
1719
1758
|
kind: "connector-group",
|
|
@@ -1723,9 +1762,9 @@ function Pn(e, t) {
|
|
|
1723
1762
|
serviceId: e.serviceId
|
|
1724
1763
|
};
|
|
1725
1764
|
}
|
|
1726
|
-
function
|
|
1765
|
+
function Rn(e, t) {
|
|
1727
1766
|
if (e == null) return;
|
|
1728
|
-
let n = e.kind == "
|
|
1767
|
+
let n = e.kind == "task" && e.node.task == null ? e.node.taskId : void 0;
|
|
1729
1768
|
if (n == null) return;
|
|
1730
1769
|
let r = e.kind == "task" ? e.definition : t?.task(n);
|
|
1731
1770
|
if (!(r == null || !("executor" in r) || r.executor.kind != "connector")) return {
|
|
@@ -1735,16 +1774,16 @@ function Fn(e, t) {
|
|
|
1735
1774
|
taskId: n
|
|
1736
1775
|
};
|
|
1737
1776
|
}
|
|
1738
|
-
function
|
|
1777
|
+
function zn(e, t, n) {
|
|
1739
1778
|
if (e == null) return [];
|
|
1740
1779
|
let r = [];
|
|
1741
|
-
for (let i of [...
|
|
1780
|
+
for (let i of [...Ae(e.revision.content).tasks].toSorted()) {
|
|
1742
1781
|
let a = e.task(i);
|
|
1743
1782
|
if (a?.executor.kind != "connector") continue;
|
|
1744
1783
|
let o = t[a.executor.action];
|
|
1745
1784
|
if (o?.authenticated != 1) continue;
|
|
1746
1785
|
let s = a.executor.connectionId == null ? void 0 : n[o.serviceId]?.byId.get(a.executor.connectionId);
|
|
1747
|
-
|
|
1786
|
+
(a.executor.connectionId == null || n[o.serviceId] != null && s?.status != "active") && r.push({
|
|
1748
1787
|
code: "task.connector-connection-required",
|
|
1749
1788
|
column: 0,
|
|
1750
1789
|
line: 1,
|
|
@@ -1755,7 +1794,7 @@ function In(e, t, n) {
|
|
|
1755
1794
|
}
|
|
1756
1795
|
return r;
|
|
1757
1796
|
}
|
|
1758
|
-
var
|
|
1797
|
+
var Bn = class {
|
|
1759
1798
|
#e;
|
|
1760
1799
|
#t;
|
|
1761
1800
|
#n;
|
|
@@ -1771,26 +1810,28 @@ var Ln = class {
|
|
|
1771
1810
|
#f;
|
|
1772
1811
|
#p;
|
|
1773
1812
|
#m;
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1813
|
+
#h;
|
|
1814
|
+
#g;
|
|
1815
|
+
constructor(r, i, a, o, s = p(), c = i.catalogs) {
|
|
1816
|
+
this.data = c, this.#i = /* @__PURE__ */ new Set(), this.#a = new L(), this.#o = new L(), this.#d = n(Nn), this.#f = n([]), this.#p = n([]), this.#g = !1, this.loadConnections = async (e) => {
|
|
1817
|
+
let t = this.#m.$.flowId.value;
|
|
1818
|
+
this.#g || t == null || await w(this.data.connections.get(void 0, t), e);
|
|
1778
1819
|
}, this.browseAddNodeOptions = (e) => {
|
|
1779
|
-
let t = this.data.providers.get(this.#
|
|
1780
|
-
return
|
|
1820
|
+
let t = this.data.providers.get(this.#m.$.flowId.value, this.#n);
|
|
1821
|
+
return I(e, (e) => {
|
|
1781
1822
|
let n = e(t), r = e(this.#t.t$);
|
|
1782
1823
|
return {
|
|
1783
1824
|
...n,
|
|
1784
|
-
data: n.data?.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) =>
|
|
1825
|
+
data: n.data?.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => Ln(e, r))
|
|
1785
1826
|
};
|
|
1786
1827
|
});
|
|
1787
1828
|
}, this.provideAddNodeOptionChoices = (e, t) => {
|
|
1788
|
-
let n = e.slice(19), r = this.#
|
|
1789
|
-
return
|
|
1829
|
+
let n = e.slice(19), r = this.#m.$.flowId.value, i = this.data.actions.get(n, r, this.#n), a = this.data.providers.get(r, this.#n), o = this.data.connections.get(n, r);
|
|
1830
|
+
return I(t, (e) => {
|
|
1790
1831
|
let t = e(i), r = e(a).data?.find((e) => e.serviceId == n), s = e(o).data, c = e(this.#t.t$);
|
|
1791
1832
|
return {
|
|
1792
1833
|
...t,
|
|
1793
|
-
data: t.data?.map((e) =>
|
|
1834
|
+
data: t.data?.map((e) => Fn(E({
|
|
1794
1835
|
...e,
|
|
1795
1836
|
...r == null ? {} : {
|
|
1796
1837
|
serviceName: r.serviceName,
|
|
@@ -1800,117 +1841,118 @@ var Ln = class {
|
|
|
1800
1841
|
};
|
|
1801
1842
|
});
|
|
1802
1843
|
}, this.provideAddNodeOptions = (e, t, n = t) => {
|
|
1803
|
-
let r = this.#
|
|
1804
|
-
if (i.length == 0) return
|
|
1805
|
-
data:
|
|
1844
|
+
let r = this.#m.$.flowId.value, i = e.trim();
|
|
1845
|
+
if (i.length == 0) return I(t, (e) => ({
|
|
1846
|
+
data: In(Object.values(e(this.$.actions)), e(this.#t.t$)),
|
|
1806
1847
|
refreshing: !1,
|
|
1807
1848
|
error: void 0
|
|
1808
1849
|
}));
|
|
1809
1850
|
let a = this.data.actions.search(i, r, this.#n, n).get();
|
|
1810
|
-
return
|
|
1851
|
+
return I(t, (e) => {
|
|
1811
1852
|
let t = e(a), n = e(this.#t.t$);
|
|
1812
1853
|
return {
|
|
1813
1854
|
...t,
|
|
1814
|
-
data: t.data?.map((t) =>
|
|
1855
|
+
data: t.data?.map((t) => Fn(E(t, e(k(this.data.connections.get(t.serviceId, r)))), n))
|
|
1815
1856
|
};
|
|
1816
1857
|
});
|
|
1817
1858
|
}, this.retryCatalog = () => {
|
|
1818
1859
|
this.data.providers.retryFailed(), this.data.actions.retryFailed(), this.data.connections.retryFailed();
|
|
1819
|
-
}, this.#e = r, this.#r = o, this.#
|
|
1860
|
+
}, this.#e = r, this.#r = o, this.#m = i, this.#u = a, this.#t = s, this.#n = s.lang;
|
|
1820
1861
|
let l = t((e) => {
|
|
1821
1862
|
let t = e(i.$.flowId);
|
|
1822
|
-
return Object.fromEntries(e(this.#
|
|
1823
|
-
let r = e(this.data.actions.detail(n, t, this.#n))
|
|
1824
|
-
return r == null ? [] : [[n,
|
|
1863
|
+
return Object.fromEntries(e(this.#f).flatMap((n) => {
|
|
1864
|
+
let r = e(k(this.data.actions.detail(n, t, this.#n)));
|
|
1865
|
+
return r == null ? [] : [[n, E(r, e(k(this.data.connections.get(r.serviceId, t))))]];
|
|
1825
1866
|
}));
|
|
1826
1867
|
}), u = t((e) => {
|
|
1827
1868
|
let t = e(i.$.flowId);
|
|
1828
|
-
return Object.fromEntries(e(this.#
|
|
1829
|
-
let r = e(this.data.connections.get(n, t))
|
|
1830
|
-
return r == null ? [] : [[n,
|
|
1869
|
+
return Object.fromEntries(e(this.#p).flatMap((n) => {
|
|
1870
|
+
let r = e(k(this.data.connections.get(n, t)));
|
|
1871
|
+
return r == null ? [] : [[n, et(r)]];
|
|
1831
1872
|
}));
|
|
1832
1873
|
});
|
|
1833
1874
|
this.#l = t((e) => {
|
|
1834
|
-
let t =
|
|
1875
|
+
let t = Rn(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
|
|
1835
1876
|
if (t == null) return { authorizationPending: !1 };
|
|
1836
1877
|
let r = e(l)[t.actionId], a = r == null ? void 0 : e(u)[r.serviceId], o = e(this.data.actions.detail(t.actionId, e(i.$.flowId), this.#n)).error, s = r == null ? void 0 : e(this.data.connections.get(r.serviceId, e(i.$.flowId))).error, c = t.connectionId == null ? void 0 : a?.byId.get(t.connectionId);
|
|
1837
|
-
return
|
|
1878
|
+
return {
|
|
1838
1879
|
action: r,
|
|
1839
|
-
actionError: o == null ? void 0 :
|
|
1880
|
+
actionError: o == null ? void 0 : B(o, this.#t.t).message,
|
|
1840
1881
|
activeConnections: a?.active,
|
|
1841
1882
|
authorizationPending: r != null && n.authorizationServiceId == r.serviceId,
|
|
1842
1883
|
connection: c,
|
|
1843
|
-
connectionError: s == null ? void 0 :
|
|
1884
|
+
connectionError: s == null ? void 0 : B(s, this.#t.t).message
|
|
1844
1885
|
};
|
|
1845
1886
|
}), this.$ = {
|
|
1846
1887
|
connections: t((e) => {
|
|
1847
1888
|
let t = e(i.$.flowId);
|
|
1848
|
-
return t == null ? [] : e(this.data.connections.get(void 0, t))
|
|
1889
|
+
return t == null ? [] : e(k(this.data.connections.get(void 0, t))) ?? [];
|
|
1849
1890
|
}),
|
|
1850
1891
|
actionLoading: e(this.#d, (e) => e.actionLoading),
|
|
1851
1892
|
actions: l,
|
|
1852
1893
|
catalogs: u,
|
|
1853
1894
|
connectionLoading: e(this.#d, (e) => e.connectionLoading),
|
|
1854
|
-
diagnostics: t((e) =>
|
|
1895
|
+
diagnostics: t((e) => zn(e(i.$.revision), e(l), e(u))),
|
|
1855
1896
|
selectedAction: e(this.#l, (e) => e.action),
|
|
1856
1897
|
selectedActionError: e(this.#l, (e) => e.actionError),
|
|
1857
1898
|
selectedActiveConnections: e(this.#l, (e) => e.activeConnections),
|
|
1858
1899
|
selectedAuthorizationPending: e(this.#l, (e) => e.authorizationPending),
|
|
1859
1900
|
selectedConnection: e(this.#l, (e) => e.connection),
|
|
1860
1901
|
selectedConnectionError: e(this.#l, (e) => e.connectionError)
|
|
1861
|
-
}, this.#s = i.$.flowId.reaction(() => this.reset()), this.#c = i.$.revision.reaction(() => void this.#
|
|
1902
|
+
}, this.#s = i.$.flowId.reaction(() => this.reset()), this.#c = i.$.revision.reaction(() => void this.#C());
|
|
1862
1903
|
}
|
|
1863
1904
|
dispose() {
|
|
1864
|
-
this.#
|
|
1905
|
+
this.#g = !0, this.#a.invalidate(), this.#o.invalidate(), this.#s(), this.#c();
|
|
1865
1906
|
for (let e of Object.values(this.$)) e.dispose();
|
|
1866
|
-
this.#l.dispose(), this.#d.dispose();
|
|
1907
|
+
this.#l.dispose(), this.#d.dispose(), this.#f.dispose(), this.#p.dispose();
|
|
1867
1908
|
}
|
|
1868
1909
|
setLanguage(e) {
|
|
1869
|
-
e == this.#n || this.#
|
|
1910
|
+
e == this.#n || this.#g || (this.#n = e, this.reset(), this.#C());
|
|
1870
1911
|
}
|
|
1871
1912
|
reset() {
|
|
1872
|
-
this.#
|
|
1913
|
+
this.#g || (this.#a.invalidate(), this.#o.invalidate(), this.#h = void 0, this.#i.clear(), this.#d.set(Nn), this.#f.set([]), this.#p.set([]));
|
|
1873
1914
|
}
|
|
1874
1915
|
async refresh(e = !1) {
|
|
1875
|
-
if (this.#
|
|
1876
|
-
let t = this.#o.begin(), n = this.#
|
|
1916
|
+
if (this.#g) return;
|
|
1917
|
+
let t = this.#o.begin(), n = this.#m.$.flowId.value, r = Rn(this.#m.$.selection.value, this.#m.$.revision.value);
|
|
1877
1918
|
if (n == null || r == null) {
|
|
1878
|
-
(this.#d.value.actionLoading != null || this.#d.value.connectionLoading != null) && this.#
|
|
1919
|
+
(this.#d.value.actionLoading != null || this.#d.value.connectionLoading != null) && this.#x({
|
|
1879
1920
|
actionLoading: void 0,
|
|
1880
1921
|
connectionLoading: void 0
|
|
1881
1922
|
});
|
|
1882
1923
|
return;
|
|
1883
1924
|
}
|
|
1884
|
-
this.#
|
|
1925
|
+
let i = this.data.actions.detail(r.actionId, n, this.#n);
|
|
1926
|
+
this.#x({
|
|
1885
1927
|
actionError: void 0,
|
|
1886
|
-
actionLoading: r.actionId,
|
|
1928
|
+
actionLoading: i.value.data == null ? r.actionId : void 0,
|
|
1887
1929
|
connectionError: void 0,
|
|
1888
1930
|
connectionLoading: void 0
|
|
1889
1931
|
});
|
|
1890
1932
|
try {
|
|
1891
|
-
let
|
|
1892
|
-
if (!this.#
|
|
1893
|
-
this.#
|
|
1933
|
+
let a = await w(i);
|
|
1934
|
+
if (!this.#S(t, n)) return;
|
|
1935
|
+
this.#b(this.#f, [a.actionId]), a.authenticated && await this.#_(n, r, a.serviceId, e, t);
|
|
1894
1936
|
} catch (e) {
|
|
1895
|
-
this.#
|
|
1937
|
+
this.#S(t, n) && this.#x({ actionError: {
|
|
1896
1938
|
actionId: r.actionId,
|
|
1897
|
-
message:
|
|
1939
|
+
message: B(e, this.#t.t).message
|
|
1898
1940
|
} });
|
|
1899
1941
|
} finally {
|
|
1900
|
-
this.#
|
|
1942
|
+
this.#S(t, n) && this.#d.value.actionLoading == r.actionId && this.#x({ actionLoading: void 0 });
|
|
1901
1943
|
}
|
|
1902
1944
|
}
|
|
1903
1945
|
async loadCodeConnections(e, t) {
|
|
1904
|
-
let n = this.#
|
|
1905
|
-
n == null || this.#
|
|
1946
|
+
let n = this.#m.$.flowId.value;
|
|
1947
|
+
n == null || this.#g || (await w(this.data.connections.get(e, n), t), !(t.aborted || this.#g || n != this.#m.$.flowId.value) && this.#b(this.#p, [e]));
|
|
1906
1948
|
}
|
|
1907
1949
|
async loadCodeAction(e, t) {
|
|
1908
|
-
let n = this.#n, r = this.#
|
|
1909
|
-
r == null || this.#
|
|
1950
|
+
let n = this.#n, r = this.#m.$.flowId.value;
|
|
1951
|
+
r == null || this.#g || (await w(this.data.actions.detail(e, r, n), t), !(t.aborted || this.#g || n != this.#n || r != this.#m.$.flowId.value) && this.#b(this.#f, [e]));
|
|
1910
1952
|
}
|
|
1911
1953
|
async connect(e) {
|
|
1912
|
-
if (this.#
|
|
1913
|
-
let t = this.#
|
|
1954
|
+
if (this.#g) return;
|
|
1955
|
+
let t = this.#m.$.flowId.value;
|
|
1914
1956
|
if (t == null) return;
|
|
1915
1957
|
let n = this.$.catalogs.value[e];
|
|
1916
1958
|
try {
|
|
@@ -1921,105 +1963,105 @@ var Ln = class {
|
|
|
1921
1963
|
});
|
|
1922
1964
|
return;
|
|
1923
1965
|
}
|
|
1924
|
-
if (this.#
|
|
1925
|
-
this.#
|
|
1966
|
+
if (this.#g || t != this.#m.$.flowId.value) return;
|
|
1967
|
+
this.#h = {
|
|
1926
1968
|
connectionIds: new Set(n?.all.map((e) => e.connectionId)),
|
|
1927
1969
|
serviceId: e
|
|
1928
|
-
}, this.#
|
|
1970
|
+
}, this.#x({ authorizationServiceId: e });
|
|
1929
1971
|
} catch (e) {
|
|
1930
|
-
this.#
|
|
1972
|
+
this.#g || this.#u(B(e, this.#t.t));
|
|
1931
1973
|
}
|
|
1932
1974
|
}
|
|
1933
1975
|
async setConnection(e, t) {
|
|
1934
|
-
return await this.#
|
|
1976
|
+
return await this.#m.setConnectorConnection(e, t);
|
|
1935
1977
|
}
|
|
1936
1978
|
async refreshAfterAuthorization() {
|
|
1937
|
-
if (this.#
|
|
1938
|
-
let e = this.#
|
|
1939
|
-
this.#
|
|
1979
|
+
if (this.#g || this.#h == null) return;
|
|
1980
|
+
let e = this.#h.serviceId;
|
|
1981
|
+
this.#x({ authorizationServiceId: void 0 }), this.$.selectedAction.value?.serviceId == e && await this.refresh(!0), !this.#g && this.#h?.serviceId == e && (this.#h = void 0);
|
|
1940
1982
|
}
|
|
1941
|
-
async #
|
|
1942
|
-
let
|
|
1943
|
-
|
|
1944
|
-
}
|
|
1945
|
-
async #g(e, t, n, r, i) {
|
|
1946
|
-
this.#y({ connectionLoading: n });
|
|
1983
|
+
async #_(e, t, n, r, i) {
|
|
1984
|
+
let a = this.data.connections.get(n, e);
|
|
1985
|
+
this.#x({ connectionLoading: r || a.value.data == null ? n : void 0 });
|
|
1947
1986
|
try {
|
|
1948
|
-
let a = await this.#
|
|
1949
|
-
if (a == null || !this.#
|
|
1950
|
-
await this.#
|
|
1987
|
+
let a = await this.#v(e, n, r, i);
|
|
1988
|
+
if (a == null || !this.#S(i, e)) return;
|
|
1989
|
+
await this.#y(t, n, a);
|
|
1951
1990
|
} finally {
|
|
1952
|
-
this.#
|
|
1991
|
+
this.#S(i, e) && this.#d.value.connectionLoading == n && this.#x({ connectionLoading: void 0 });
|
|
1953
1992
|
}
|
|
1954
1993
|
}
|
|
1955
|
-
async #
|
|
1994
|
+
async #v(e, t, n, r) {
|
|
1956
1995
|
let i;
|
|
1957
1996
|
try {
|
|
1958
1997
|
let r = this.data.connections.get(t, e, n);
|
|
1959
|
-
await Promise.resolve(), i = await
|
|
1998
|
+
await Promise.resolve(), i = await w(r, void 0, n);
|
|
1960
1999
|
} catch (n) {
|
|
1961
|
-
this.#
|
|
1962
|
-
message:
|
|
2000
|
+
this.#S(r, e) && this.#x({ connectionError: {
|
|
2001
|
+
message: B(n, this.#t.t).message,
|
|
1963
2002
|
serviceId: t
|
|
1964
2003
|
} });
|
|
1965
2004
|
return;
|
|
1966
2005
|
}
|
|
1967
|
-
if (!this.#
|
|
1968
|
-
let a =
|
|
1969
|
-
return this.#
|
|
2006
|
+
if (!this.#S(r, e)) return;
|
|
2007
|
+
let a = et(i);
|
|
2008
|
+
return this.#b(this.#p, [t]), a;
|
|
1970
2009
|
}
|
|
1971
|
-
async #
|
|
1972
|
-
let r = this.#
|
|
1973
|
-
a != null && this.#
|
|
2010
|
+
async #y(e, t, n) {
|
|
2011
|
+
let r = this.#h?.serviceId == t ? this.#h : void 0, i = r == null ? [] : n.active.filter((e) => !r.connectionIds.has(e.connectionId)), a = i.length == 1 ? i[0] : n.preferred, o = this.#m.$.revision.value?.task(e.taskId);
|
|
2012
|
+
a != null && this.#m.$.selectedNodeIds.value.includes(e.nodeId) && o != null && "executor" in o && o.executor.kind == "connector" && o.executor.connectionId == null && await this.#m.setConnectorConnection(e.taskId, a.connectionId);
|
|
1974
2013
|
}
|
|
1975
|
-
#
|
|
1976
|
-
|
|
2014
|
+
#b(e, t) {
|
|
2015
|
+
t.some((t) => !e.value.includes(t)) && e.set([.../* @__PURE__ */ new Set([...e.value, ...t])]);
|
|
2016
|
+
}
|
|
2017
|
+
#x(e) {
|
|
2018
|
+
this.#g || Object.entries(e).every(([e, t]) => this.#d.value[e] === t) || this.#d.set({
|
|
1977
2019
|
...this.#d.value,
|
|
1978
2020
|
...e
|
|
1979
2021
|
});
|
|
1980
2022
|
}
|
|
1981
|
-
#
|
|
1982
|
-
return !this.#
|
|
2023
|
+
#S(e, t) {
|
|
2024
|
+
return !this.#g && e() && t == this.#m.$.flowId.value;
|
|
1983
2025
|
}
|
|
1984
|
-
async #
|
|
1985
|
-
if (this.#
|
|
1986
|
-
let e = this.#a.begin(), t = this.#
|
|
2026
|
+
async #C() {
|
|
2027
|
+
if (this.#g) return;
|
|
2028
|
+
let e = this.#a.begin(), t = this.#m.$.flowId.value, n = this.#m.$.revision.value;
|
|
1987
2029
|
if (t == null || n == null) return;
|
|
1988
2030
|
Object.values(n.graph({ kind: "flow" })?.nodes ?? {}).some((e) => e.kind == "integration" || e.kind == "poll") && this.data.providers.get(t, this.#n);
|
|
1989
2031
|
let r = [...n.connectorActionIds].filter((e) => this.$.actions.value[e] == null && !this.#i.has(e));
|
|
1990
2032
|
if (r.length > 0) {
|
|
1991
2033
|
for (let e of r) this.#i.add(e);
|
|
1992
2034
|
try {
|
|
1993
|
-
let n = await Promise.all(r.map((e) =>
|
|
1994
|
-
if (!this.#
|
|
1995
|
-
this.#
|
|
2035
|
+
let n = await Promise.all(r.map((e) => w(this.data.actions.detail(e, t, this.#n))));
|
|
2036
|
+
if (!this.#S(e, t)) return;
|
|
2037
|
+
this.#b(this.#f, n.map((e) => e.actionId));
|
|
1996
2038
|
} catch {
|
|
1997
2039
|
return;
|
|
1998
2040
|
} finally {
|
|
1999
2041
|
for (let e of r) this.#i.delete(e);
|
|
2000
2042
|
}
|
|
2001
2043
|
}
|
|
2002
|
-
if (!this.#
|
|
2044
|
+
if (!this.#S(e, t)) return;
|
|
2003
2045
|
let i = /* @__PURE__ */ new Set();
|
|
2004
|
-
for (let e of
|
|
2046
|
+
for (let e of Ae(n.revision.content).tasks) {
|
|
2005
2047
|
let t = n.task(e);
|
|
2006
2048
|
if (t?.executor.kind != "connector") continue;
|
|
2007
2049
|
let r = this.$.actions.value[t.executor.action];
|
|
2008
2050
|
r?.authenticated == 1 && i.add(r.serviceId);
|
|
2009
2051
|
}
|
|
2010
|
-
await Promise.all([...i].map((n) => this.#
|
|
2052
|
+
await Promise.all([...i].map((n) => this.#v(t, n, !1, e)));
|
|
2011
2053
|
}
|
|
2012
2054
|
};
|
|
2013
2055
|
//#endregion
|
|
2014
2056
|
//#region src/workbench/browser/runtime/stores/triggerCatalog.ts
|
|
2015
|
-
function
|
|
2057
|
+
function Vn(e, t) {
|
|
2016
2058
|
let n = `open-flow:trigger-catalog:v2:${encodeURIComponent(e)}:`;
|
|
2017
2059
|
return {
|
|
2018
2060
|
getItem: (e) => (t ?? window.localStorage).getItem(n + e),
|
|
2019
2061
|
setItem: (e, r) => (t ?? window.localStorage).setItem(n + e, r)
|
|
2020
2062
|
};
|
|
2021
2063
|
}
|
|
2022
|
-
var
|
|
2064
|
+
var Hn = class {
|
|
2023
2065
|
#e;
|
|
2024
2066
|
#t;
|
|
2025
2067
|
constructor(e, r, i) {
|
|
@@ -2031,16 +2073,16 @@ var zn = class {
|
|
|
2031
2073
|
let t = this.#t.get(e);
|
|
2032
2074
|
if (t == null) {
|
|
2033
2075
|
let n = (t) => {
|
|
2034
|
-
let n =
|
|
2076
|
+
let n = Ie(t);
|
|
2035
2077
|
if (n.locale != e) throw Error("Unexpected Trigger catalog language.");
|
|
2036
2078
|
return n;
|
|
2037
2079
|
}, r = this.host.triggerCatalogCache;
|
|
2038
|
-
t = new
|
|
2080
|
+
t = new ie((t, r) => this.client.readCatalog({
|
|
2039
2081
|
path: `/v1/trigger-keys/catalog?locale=${encodeURIComponent(e)}`,
|
|
2040
2082
|
decode: n
|
|
2041
2083
|
}, t, r), 3e5, r == null ? void 0 : {
|
|
2042
2084
|
key: e,
|
|
2043
|
-
storage: () =>
|
|
2085
|
+
storage: () => Vn(r.namespace, r.storage),
|
|
2044
2086
|
decode: n
|
|
2045
2087
|
}), this.#t.set(e, t);
|
|
2046
2088
|
}
|
|
@@ -2060,8 +2102,8 @@ var zn = class {
|
|
|
2060
2102
|
for (let e of this.#t.values()) e.dispose();
|
|
2061
2103
|
this.#t.clear();
|
|
2062
2104
|
}
|
|
2063
|
-
},
|
|
2064
|
-
function
|
|
2105
|
+
}, Un = {}, Wn = "trigger:";
|
|
2106
|
+
function Gn(e, t) {
|
|
2065
2107
|
if (e?.kind != "trigger") return;
|
|
2066
2108
|
let n = e.trigger;
|
|
2067
2109
|
if (n.kind != "poll" && n.kind != "integration") return;
|
|
@@ -2072,15 +2114,15 @@ function Hn(e, t) {
|
|
|
2072
2114
|
triggerId: e.id
|
|
2073
2115
|
};
|
|
2074
2116
|
}
|
|
2075
|
-
function
|
|
2117
|
+
function Kn(e, t, n) {
|
|
2076
2118
|
return {
|
|
2077
2119
|
description: n?.description ?? e.description,
|
|
2078
2120
|
group: t.t("addNode.integrationTriggers"),
|
|
2079
|
-
icon:
|
|
2121
|
+
icon: M({
|
|
2080
2122
|
serviceId: e.provider,
|
|
2081
2123
|
serviceName: e.provider
|
|
2082
2124
|
}),
|
|
2083
|
-
id: `${
|
|
2125
|
+
id: `${Wn}${e.key}`,
|
|
2084
2126
|
inputs: [],
|
|
2085
2127
|
kind: "trigger",
|
|
2086
2128
|
label: n?.displayName ?? e.displayName,
|
|
@@ -2094,7 +2136,7 @@ function Un(e, t, n) {
|
|
|
2094
2136
|
}
|
|
2095
2137
|
};
|
|
2096
2138
|
}
|
|
2097
|
-
var
|
|
2139
|
+
var qn = class {
|
|
2098
2140
|
#e;
|
|
2099
2141
|
#t;
|
|
2100
2142
|
#n;
|
|
@@ -2105,18 +2147,18 @@ var Wn = class {
|
|
|
2105
2147
|
#s;
|
|
2106
2148
|
#c;
|
|
2107
2149
|
#l;
|
|
2108
|
-
constructor(r, i, a, o, s =
|
|
2109
|
-
this.#r = new
|
|
2110
|
-
let t = e(i.$.selection), n =
|
|
2150
|
+
constructor(r, i, a, o, s = p()) {
|
|
2151
|
+
this.#r = new L(), this.#i = /* @__PURE__ */ new Set(), this.#s = n(Un), this.#l = !1, this.browseAddNodeOptions = (e) => this.#u("", e), this.provideAddNodeOptions = (e, t) => this.#u(e, t), this.catalog = new Hn(r, bt([s.lang]), o), this.#e = r, this.#t = o, this.#n = s, this.#o = a, this.#c = i, this.#a = t((e) => {
|
|
2152
|
+
let t = e(i.$.selection), n = Gn(t, i), r = e(this.#s);
|
|
2111
2153
|
if (t?.kind != "trigger") return { authorizationPending: !1 };
|
|
2112
2154
|
let a = t.trigger;
|
|
2113
2155
|
if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
|
|
2114
|
-
let o = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).data, s = o == null ? void 0 :
|
|
2156
|
+
let o = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).data, s = o == null ? void 0 : et(o), c = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).error;
|
|
2115
2157
|
return {
|
|
2116
2158
|
activeConnections: s?.active,
|
|
2117
2159
|
authorizationPending: r.authorizationProvider == n?.provider,
|
|
2118
2160
|
connection: n?.connectionId == null ? void 0 : s?.byId.get(n.connectionId),
|
|
2119
|
-
connectionError: c == null ? void 0 :
|
|
2161
|
+
connectionError: c == null ? void 0 : B(c, this.#n.t).message,
|
|
2120
2162
|
definition: a.definition
|
|
2121
2163
|
};
|
|
2122
2164
|
}), this.$ = {
|
|
@@ -2134,11 +2176,11 @@ var Wn = class {
|
|
|
2134
2176
|
this.#a.dispose(), this.#s.dispose();
|
|
2135
2177
|
}
|
|
2136
2178
|
reset() {
|
|
2137
|
-
this.#l || (this.#i.clear(), this.#r.invalidate(), this.#s.set(
|
|
2179
|
+
this.#l || (this.#i.clear(), this.#r.invalidate(), this.#s.set(Un));
|
|
2138
2180
|
}
|
|
2139
2181
|
#u(e, t) {
|
|
2140
2182
|
let n = this.catalog.get(), r = e.trim().toLowerCase();
|
|
2141
|
-
return
|
|
2183
|
+
return I(t, (e) => {
|
|
2142
2184
|
let t = e(n);
|
|
2143
2185
|
e(this.#n.t$);
|
|
2144
2186
|
let i = e(this.#c.$.flowId) != null && e(this.#c.$.target)?.kind == "flow", a = t.data, o = a?.definitions.filter((e) => !r || [
|
|
@@ -2153,13 +2195,13 @@ var Wn = class {
|
|
|
2153
2195
|
].some((e) => e?.toLowerCase().includes(r)));
|
|
2154
2196
|
return {
|
|
2155
2197
|
...t,
|
|
2156
|
-
data: i ? o?.map((e) =>
|
|
2198
|
+
data: i ? o?.map((e) => Kn(e, this.#n, a.display[e.key])) : []
|
|
2157
2199
|
};
|
|
2158
2200
|
});
|
|
2159
2201
|
}
|
|
2160
2202
|
async refresh(e = !1) {
|
|
2161
2203
|
if (this.#l) return;
|
|
2162
|
-
let t = this.#r.begin(), n = this.#c.$.flowId.value, r =
|
|
2204
|
+
let t = this.#r.begin(), n = this.#c.$.flowId.value, r = Gn(this.#c.$.selection.value, this.#c);
|
|
2163
2205
|
if (n == null || r == null) {
|
|
2164
2206
|
this.#s.value.connectionLoading != null && this.#d({ connectionLoading: void 0 });
|
|
2165
2207
|
return;
|
|
@@ -2170,11 +2212,11 @@ var Wn = class {
|
|
|
2170
2212
|
});
|
|
2171
2213
|
try {
|
|
2172
2214
|
let i = this.#c.catalogs.connections.get(r.provider, n, e || this.#i.has(r.provider));
|
|
2173
|
-
if (await Promise.resolve(), await
|
|
2215
|
+
if (await Promise.resolve(), await w(i, void 0, e || this.#i.has(r.provider)), !this.#f(t, n)) return;
|
|
2174
2216
|
this.#i.delete(r.provider);
|
|
2175
2217
|
} catch (e) {
|
|
2176
2218
|
this.#f(t, n) && this.#d({ connectionError: {
|
|
2177
|
-
message:
|
|
2219
|
+
message: B(e, this.#n.t).message,
|
|
2178
2220
|
provider: r.provider
|
|
2179
2221
|
} });
|
|
2180
2222
|
} finally {
|
|
@@ -2193,7 +2235,7 @@ var Wn = class {
|
|
|
2193
2235
|
}
|
|
2194
2236
|
!this.#l && t == this.#c.$.flowId.value && this.#d({ authorizationProvider: e });
|
|
2195
2237
|
} catch (e) {
|
|
2196
|
-
this.#l || this.#o(
|
|
2238
|
+
this.#l || this.#o(B(e, this.#n.t));
|
|
2197
2239
|
}
|
|
2198
2240
|
}
|
|
2199
2241
|
async setConnection(e, t) {
|
|
@@ -2202,7 +2244,7 @@ var Wn = class {
|
|
|
2202
2244
|
async refreshAfterAuthorization() {
|
|
2203
2245
|
if (this.#l) return;
|
|
2204
2246
|
let e = this.#s.value.authorizationProvider;
|
|
2205
|
-
e != null && (this.#i.add(e), this.#d({ authorizationProvider: void 0 }),
|
|
2247
|
+
e != null && (this.#i.add(e), this.#d({ authorizationProvider: void 0 }), Gn(this.#c.$.selection.value, this.#c)?.provider == e && await this.refresh(!0));
|
|
2206
2248
|
}
|
|
2207
2249
|
#d(e) {
|
|
2208
2250
|
this.#l || this.#s.set({
|
|
@@ -2216,10 +2258,10 @@ var Wn = class {
|
|
|
2216
2258
|
};
|
|
2217
2259
|
//#endregion
|
|
2218
2260
|
//#region src/flow/common/inverseChanges.ts
|
|
2219
|
-
function
|
|
2261
|
+
function Jn(e, t) {
|
|
2220
2262
|
let n = e, r = [];
|
|
2221
2263
|
for (let e of t) {
|
|
2222
|
-
let t =
|
|
2264
|
+
let t = _t(n, [e]), i = [];
|
|
2223
2265
|
switch (e.kind) {
|
|
2224
2266
|
case "graph.node.create":
|
|
2225
2267
|
i.push({
|
|
@@ -2238,7 +2280,7 @@ function Gn(e, t) {
|
|
|
2238
2280
|
});
|
|
2239
2281
|
for (let [e, t] of Object.entries(s.nodes)) {
|
|
2240
2282
|
let n = o.nodes[e];
|
|
2241
|
-
if (!(!("inputs" in t) || !("inputs" in n))) for (let a of /* @__PURE__ */ new Set([...Object.keys(n.inputs), ...Object.keys(t.inputs)]))
|
|
2283
|
+
if (!(!("inputs" in t) || !("inputs" in n))) for (let a of /* @__PURE__ */ new Set([...Object.keys(n.inputs), ...Object.keys(t.inputs)])) u(t.inputs[a], n.inputs[a]) || i.push({
|
|
2242
2284
|
kind: "graph.node.input.set",
|
|
2243
2285
|
target: r,
|
|
2244
2286
|
nodeId: e,
|
|
@@ -2259,7 +2301,7 @@ function Gn(e, t) {
|
|
|
2259
2301
|
});
|
|
2260
2302
|
if (r.kind == "subflow") {
|
|
2261
2303
|
let { graph: e, ...a } = n.document.subflows[r.id], { graph: o, ...s } = t.document.subflows[r.id];
|
|
2262
|
-
|
|
2304
|
+
u(s, a) || i.push({
|
|
2263
2305
|
kind: "subflow.definition.set",
|
|
2264
2306
|
subflowId: r.id,
|
|
2265
2307
|
before: s,
|
|
@@ -2341,7 +2383,7 @@ function Gn(e, t) {
|
|
|
2341
2383
|
}
|
|
2342
2384
|
//#endregion
|
|
2343
2385
|
//#region src/workbench/browser/runtime/stores/canvasHistory.ts
|
|
2344
|
-
var
|
|
2386
|
+
var Yn = class {
|
|
2345
2387
|
constructor() {
|
|
2346
2388
|
this.state$ = n({
|
|
2347
2389
|
canUndo: !1,
|
|
@@ -2384,7 +2426,7 @@ var Kn = class {
|
|
|
2384
2426
|
};
|
|
2385
2427
|
//#endregion
|
|
2386
2428
|
//#region src/workbench/browser/runtime/stores/draftChanges.ts
|
|
2387
|
-
function
|
|
2429
|
+
function Xn(e, t) {
|
|
2388
2430
|
if (e.length != 1 || t.length != 1) return;
|
|
2389
2431
|
let n = e[0], r = t[0];
|
|
2390
2432
|
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 : [{
|
|
@@ -2404,7 +2446,7 @@ function qn(e, t) {
|
|
|
2404
2446
|
value: r.value
|
|
2405
2447
|
}];
|
|
2406
2448
|
}
|
|
2407
|
-
var
|
|
2449
|
+
var Zn = class {
|
|
2408
2450
|
#e;
|
|
2409
2451
|
#t;
|
|
2410
2452
|
#n;
|
|
@@ -2432,15 +2474,15 @@ var Jn = class {
|
|
|
2432
2474
|
this.#a = e;
|
|
2433
2475
|
let t = e, n = [];
|
|
2434
2476
|
for (let e of this.#o) try {
|
|
2435
|
-
t =
|
|
2477
|
+
t = R(t, e.changes), n.push(e);
|
|
2436
2478
|
} catch (t) {
|
|
2437
|
-
if (!(t instanceof
|
|
2479
|
+
if (!(t instanceof rt)) throw t;
|
|
2438
2480
|
e.active = !1;
|
|
2439
2481
|
}
|
|
2440
2482
|
return this.#o = n, t;
|
|
2441
2483
|
}
|
|
2442
2484
|
project(e) {
|
|
2443
|
-
return this.#o.reduce((e, t) =>
|
|
2485
|
+
return this.#o.reduce((e, t) => R(e, t.changes), e);
|
|
2444
2486
|
}
|
|
2445
2487
|
async settled() {
|
|
2446
2488
|
await this.#s;
|
|
@@ -2454,13 +2496,13 @@ var Jn = class {
|
|
|
2454
2496
|
return this.#s = t, t;
|
|
2455
2497
|
}
|
|
2456
2498
|
async change(e, t, n, r = !0) {
|
|
2457
|
-
let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 :
|
|
2499
|
+
let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 : Xn(i.changes, n);
|
|
2458
2500
|
if (i != null && a != null) return i.changes = a, this.#a != null && this.#t.apply(this.project(this.#a)), i.result;
|
|
2459
2501
|
this.#t.beforeChange(r);
|
|
2460
2502
|
let o = {
|
|
2461
2503
|
...e,
|
|
2462
2504
|
active: !0,
|
|
2463
|
-
changeId:
|
|
2505
|
+
changeId: P(),
|
|
2464
2506
|
changes: n,
|
|
2465
2507
|
started: !1
|
|
2466
2508
|
};
|
|
@@ -2485,21 +2527,21 @@ var Jn = class {
|
|
|
2485
2527
|
let r = this.#l(e, n, t);
|
|
2486
2528
|
return this.#o.length == 0 && this.#t.check(), r;
|
|
2487
2529
|
} catch (n) {
|
|
2488
|
-
if (n instanceof
|
|
2530
|
+
if (n instanceof U && n.code == "flow.revision-conflict") {
|
|
2489
2531
|
if (!t && await this.#t.recover(e)) {
|
|
2490
|
-
t = !0, e.changeId =
|
|
2532
|
+
t = !0, e.changeId = P();
|
|
2491
2533
|
continue;
|
|
2492
2534
|
}
|
|
2493
2535
|
t && await this.#t.recover(e), this.#u(e);
|
|
2494
2536
|
} else {
|
|
2495
|
-
if (!(n instanceof
|
|
2537
|
+
if (!(n instanceof U) && !t) {
|
|
2496
2538
|
let n = this.#a?.revisionId;
|
|
2497
2539
|
if (await this.#t.recover(e)) {
|
|
2498
|
-
t = !0, e.active && this.#a?.revisionId != n && (e.changeId =
|
|
2540
|
+
t = !0, e.active && this.#a?.revisionId != n && (e.changeId = P());
|
|
2499
2541
|
continue;
|
|
2500
2542
|
}
|
|
2501
2543
|
}
|
|
2502
|
-
this.#u(e), this.#t.current(e) && this.#r(
|
|
2544
|
+
this.#u(e), this.#t.current(e) && this.#r(B(n, this.#n.t));
|
|
2503
2545
|
}
|
|
2504
2546
|
return;
|
|
2505
2547
|
}
|
|
@@ -2508,14 +2550,14 @@ var Jn = class {
|
|
|
2508
2550
|
#l(e, t, n) {
|
|
2509
2551
|
let r = {
|
|
2510
2552
|
...n.revision,
|
|
2511
|
-
content:
|
|
2553
|
+
content: R(t, e.changes).content
|
|
2512
2554
|
};
|
|
2513
2555
|
return this.#o = this.#o.filter((t) => t !== e), this.#a = r, this.#t.apply(this.project(r)), this.#t.headChanged(e.flowId, r.revisionId), r;
|
|
2514
2556
|
}
|
|
2515
2557
|
#u(e) {
|
|
2516
2558
|
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));
|
|
2517
2559
|
}
|
|
2518
|
-
},
|
|
2560
|
+
}, Qn = 50, $n = {
|
|
2519
2561
|
failed: !1,
|
|
2520
2562
|
loaded: !1,
|
|
2521
2563
|
loading: !0,
|
|
@@ -2523,12 +2565,12 @@ var Jn = class {
|
|
|
2523
2565
|
loadMoreFailed: !1,
|
|
2524
2566
|
refreshing: !1,
|
|
2525
2567
|
flows: []
|
|
2526
|
-
},
|
|
2568
|
+
}, er = class {
|
|
2527
2569
|
#e;
|
|
2528
2570
|
#t;
|
|
2529
|
-
#n = new
|
|
2571
|
+
#n = new L();
|
|
2530
2572
|
#r;
|
|
2531
|
-
#i = n(
|
|
2573
|
+
#i = n($n);
|
|
2532
2574
|
#a = new AbortController();
|
|
2533
2575
|
#o = /* @__PURE__ */ new Set();
|
|
2534
2576
|
#s = !1;
|
|
@@ -2575,7 +2617,7 @@ var Jn = class {
|
|
|
2575
2617
|
try {
|
|
2576
2618
|
let t = await this.#e.listFlows({
|
|
2577
2619
|
includeTotal: !0,
|
|
2578
|
-
limit:
|
|
2620
|
+
limit: Qn
|
|
2579
2621
|
});
|
|
2580
2622
|
if (!e()) return;
|
|
2581
2623
|
this.#c({
|
|
@@ -2592,7 +2634,7 @@ var Jn = class {
|
|
|
2592
2634
|
failed: !t,
|
|
2593
2635
|
loading: !1,
|
|
2594
2636
|
refreshing: !1
|
|
2595
|
-
}), this.#r(
|
|
2637
|
+
}), this.#r(B(n, this.#t.t));
|
|
2596
2638
|
}
|
|
2597
2639
|
}
|
|
2598
2640
|
async loadMore() {
|
|
@@ -2606,7 +2648,7 @@ var Jn = class {
|
|
|
2606
2648
|
try {
|
|
2607
2649
|
let e = await this.#e.listFlows({
|
|
2608
2650
|
cursor: t,
|
|
2609
|
-
limit:
|
|
2651
|
+
limit: Qn
|
|
2610
2652
|
});
|
|
2611
2653
|
if (!r()) return;
|
|
2612
2654
|
let n = new Set(this.#i.value.flows.map((e) => e.flowId));
|
|
@@ -2620,7 +2662,7 @@ var Jn = class {
|
|
|
2620
2662
|
this.#c({
|
|
2621
2663
|
loadingMore: !1,
|
|
2622
2664
|
loadMoreFailed: !0
|
|
2623
|
-
}), this.#r(
|
|
2665
|
+
}), this.#r(B(e, this.#t.t));
|
|
2624
2666
|
}
|
|
2625
2667
|
}
|
|
2626
2668
|
async setEnabled(e, t) {
|
|
@@ -2630,7 +2672,7 @@ var Jn = class {
|
|
|
2630
2672
|
let n = await this.#e.setFlowEnabled(e.flowId, e.live.publicationId, t);
|
|
2631
2673
|
this.#s || this.include(n);
|
|
2632
2674
|
} catch (e) {
|
|
2633
|
-
this.#s || (this.#r(
|
|
2675
|
+
this.#s || (this.#r(B(e, this.#t.t)), await this.reload());
|
|
2634
2676
|
} finally {
|
|
2635
2677
|
this.#o.delete(e.flowId);
|
|
2636
2678
|
}
|
|
@@ -2656,7 +2698,7 @@ var Jn = class {
|
|
|
2656
2698
|
message: this.#t.t("notice.published", { name: e.name })
|
|
2657
2699
|
}), this.include(await this.#e.getFlow(e.flowId));
|
|
2658
2700
|
} catch (e) {
|
|
2659
|
-
this.#s || this.#r(
|
|
2701
|
+
this.#s || this.#r(B(e, this.#t.t));
|
|
2660
2702
|
} finally {
|
|
2661
2703
|
this.#o.delete(e.flowId);
|
|
2662
2704
|
}
|
|
@@ -2698,7 +2740,7 @@ var Jn = class {
|
|
|
2698
2740
|
...e
|
|
2699
2741
|
});
|
|
2700
2742
|
}
|
|
2701
|
-
},
|
|
2743
|
+
}, tr = class {
|
|
2702
2744
|
#e;
|
|
2703
2745
|
#t;
|
|
2704
2746
|
#n;
|
|
@@ -2722,7 +2764,7 @@ var Jn = class {
|
|
|
2722
2764
|
async change(e, t, n, r) {
|
|
2723
2765
|
if (this.#o || this.#a == null) return !1;
|
|
2724
2766
|
let i = r(t.value);
|
|
2725
|
-
if (
|
|
2767
|
+
if (u(i, t.value)) return !0;
|
|
2726
2768
|
let a = {
|
|
2727
2769
|
current: n,
|
|
2728
2770
|
flowId: e,
|
|
@@ -2736,7 +2778,7 @@ var Jn = class {
|
|
|
2736
2778
|
return this.#i = this.#i.then(async () => {
|
|
2737
2779
|
if (this.#o || !n()) return;
|
|
2738
2780
|
let t = this.#a, i = r(t.value);
|
|
2739
|
-
if (
|
|
2781
|
+
if (u(i, t.value)) {
|
|
2740
2782
|
this.#c(a, t), o = !0;
|
|
2741
2783
|
return;
|
|
2742
2784
|
}
|
|
@@ -2746,7 +2788,7 @@ var Jn = class {
|
|
|
2746
2788
|
this.#c(a, r), o = !0;
|
|
2747
2789
|
} catch (r) {
|
|
2748
2790
|
if (this.#o || !n()) return;
|
|
2749
|
-
if (r instanceof
|
|
2791
|
+
if (r instanceof U && r.code == "flow.presentation-conflict") try {
|
|
2750
2792
|
let t = await this.#e.getPresentation(e);
|
|
2751
2793
|
if (this.#o || !n()) return;
|
|
2752
2794
|
this.#c(a, t), this.#n({
|
|
@@ -2754,9 +2796,9 @@ var Jn = class {
|
|
|
2754
2796
|
message: this.#t.t("notice.layoutConflict")
|
|
2755
2797
|
});
|
|
2756
2798
|
} catch (e) {
|
|
2757
|
-
!this.#o && n() && this.#c(a, t), !this.#o && n() && this.#n(
|
|
2799
|
+
!this.#o && n() && this.#c(a, t), !this.#o && n() && this.#n(B(e, this.#t.t));
|
|
2758
2800
|
}
|
|
2759
|
-
else this.#c(a, t), this.#n(
|
|
2801
|
+
else this.#c(a, t), this.#n(B(r, this.#t.t));
|
|
2760
2802
|
}
|
|
2761
2803
|
}), await this.#i, o;
|
|
2762
2804
|
}
|
|
@@ -2768,21 +2810,21 @@ var Jn = class {
|
|
|
2768
2810
|
value: n
|
|
2769
2811
|
});
|
|
2770
2812
|
}
|
|
2771
|
-
},
|
|
2813
|
+
}, nr = {
|
|
2772
2814
|
checkLoading: !1,
|
|
2773
2815
|
selectedNodeIds: [],
|
|
2774
2816
|
workspaceLoadFailed: !1,
|
|
2775
2817
|
workspaceLoading: !1
|
|
2776
2818
|
};
|
|
2777
|
-
function
|
|
2819
|
+
function rr(e) {
|
|
2778
2820
|
return e.workspaceLoading ? "loading" : e.moduleSaveStatus == null ? e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved" : e.moduleSaveStatus;
|
|
2779
2821
|
}
|
|
2780
|
-
function
|
|
2822
|
+
function ir(e, t) {
|
|
2781
2823
|
if (t.phase != null) return t.phase;
|
|
2782
2824
|
let n = e?.content.modules[t.moduleId];
|
|
2783
2825
|
return n == null ? "failed" : t.source == n.source ? "saved" : "dirty";
|
|
2784
2826
|
}
|
|
2785
|
-
function
|
|
2827
|
+
function ar(e, t, n) {
|
|
2786
2828
|
if (e == null || t == null || n.length != 1) return;
|
|
2787
2829
|
let r = e.node(t, n[0]);
|
|
2788
2830
|
if (!(r?.kind != "task" || r.definition == null || !("moduleId" in r.definition) || r.module == null)) return {
|
|
@@ -2790,9 +2832,9 @@ function nr(e, t, n) {
|
|
|
2790
2832
|
source: r.module.source
|
|
2791
2833
|
};
|
|
2792
2834
|
}
|
|
2793
|
-
var
|
|
2835
|
+
var or = class {
|
|
2794
2836
|
#e;
|
|
2795
|
-
#t = n(
|
|
2837
|
+
#t = n(nr);
|
|
2796
2838
|
#n;
|
|
2797
2839
|
constructor(n, r) {
|
|
2798
2840
|
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) => {
|
|
@@ -2800,7 +2842,7 @@ var rr = class {
|
|
|
2800
2842
|
let { phase: t, ...n } = e.moduleEditor;
|
|
2801
2843
|
return {
|
|
2802
2844
|
...n,
|
|
2803
|
-
status:
|
|
2845
|
+
status: ir(e.draft, e.moduleEditor)
|
|
2804
2846
|
};
|
|
2805
2847
|
}), 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 : z(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);
|
|
2806
2848
|
this.#e = e(this.#t, (e) => ({
|
|
@@ -2813,12 +2855,12 @@ var rr = class {
|
|
|
2813
2855
|
this.$ = {
|
|
2814
2856
|
addNodeOptions: t((e) => {
|
|
2815
2857
|
let { revision: t, target: r } = e(this.#e);
|
|
2816
|
-
return
|
|
2858
|
+
return Ye(t?.revision, r, e(n.t$));
|
|
2817
2859
|
}),
|
|
2818
2860
|
busy: i,
|
|
2819
2861
|
checkLoading: a,
|
|
2820
2862
|
diagnosticFocus: o,
|
|
2821
|
-
diagnosticItems: e(this.#t, (e) =>
|
|
2863
|
+
diagnosticItems: e(this.#t, (e) => Se(e.draft == null ? void 0 : z(e.draft), e.target, e.diagnostics)),
|
|
2822
2864
|
diagnostics: s,
|
|
2823
2865
|
draft: c,
|
|
2824
2866
|
flow: t((e) => {
|
|
@@ -2834,7 +2876,7 @@ var rr = class {
|
|
|
2834
2876
|
flowRefreshing: r.$.refreshing,
|
|
2835
2877
|
flowTotal: r.$.total,
|
|
2836
2878
|
flows: r.$.flows,
|
|
2837
|
-
inspectorDiagnostics: e(this.#t, (e) =>
|
|
2879
|
+
inspectorDiagnostics: e(this.#t, (e) => Ke(e.draft == null ? void 0 : z(e.draft), e.target, e.diagnostics, y.value)),
|
|
2838
2880
|
live: p,
|
|
2839
2881
|
moduleEditor: l,
|
|
2840
2882
|
nodeFocus: u,
|
|
@@ -2842,7 +2884,7 @@ var rr = class {
|
|
|
2842
2884
|
revision: m,
|
|
2843
2885
|
selection: y,
|
|
2844
2886
|
selectedNodeIds: h,
|
|
2845
|
-
status: e(this.#t,
|
|
2887
|
+
status: e(this.#t, rr),
|
|
2846
2888
|
target: g,
|
|
2847
2889
|
targetFlow: t((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
|
|
2848
2890
|
targetName: e(this.#t, (e) => {
|
|
@@ -2865,14 +2907,14 @@ var rr = class {
|
|
|
2865
2907
|
for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
|
|
2866
2908
|
this.#e.dispose(), this.#t.dispose();
|
|
2867
2909
|
}
|
|
2868
|
-
},
|
|
2910
|
+
}, sr = {
|
|
2869
2911
|
x: 40,
|
|
2870
2912
|
y: 40
|
|
2871
2913
|
};
|
|
2872
|
-
function
|
|
2914
|
+
function cr(e, t) {
|
|
2873
2915
|
if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
|
|
2874
2916
|
}
|
|
2875
|
-
var
|
|
2917
|
+
var lr = class {
|
|
2876
2918
|
#e;
|
|
2877
2919
|
#t;
|
|
2878
2920
|
#n;
|
|
@@ -2896,8 +2938,8 @@ var or = class {
|
|
|
2896
2938
|
#b;
|
|
2897
2939
|
#x;
|
|
2898
2940
|
#S;
|
|
2899
|
-
constructor(e, t, n =
|
|
2900
|
-
this.catalogs = a, this.#n = new
|
|
2941
|
+
constructor(e, t, n = Jt, r = p(), i = () => {}, a = new Mn(e)) {
|
|
2942
|
+
this.catalogs = a, this.#n = new L(), this.#u = /* @__PURE__ */ new Map(), this.#d = new Yn(), this.history$ = this.#d.state$, this.#h = 0, this.#g = 0, this.#_ = !1, this.#v = !1, this.#y = !1, this.#b = 0, this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new er(e, t, r), this.#l = new or(r, this.#o), this.#t = new Zn(e, t, r, {
|
|
2901
2943
|
apply: (e) => this.#O(e, "local"),
|
|
2902
2944
|
beforeChange: (e) => {
|
|
2903
2945
|
e && this.#V({ busy: "designer" });
|
|
@@ -2909,7 +2951,7 @@ var or = class {
|
|
|
2909
2951
|
},
|
|
2910
2952
|
headChanged: (e, t) => this.#o.advanceHead(e, t),
|
|
2911
2953
|
recover: (e) => (this.retryHistorySync(), this.#F(e, !0))
|
|
2912
|
-
}), this.#a = new
|
|
2954
|
+
}), this.#a = new tr(e, t, (e) => this.#V({ presentation: e }), r), this.$ = this.#l.$;
|
|
2913
2955
|
}
|
|
2914
2956
|
dispose() {
|
|
2915
2957
|
this.catalogs.dispose(), this.#v = !0, this.#n.invalidate(), this.#a.dispose(), this.#x?.(), this.#S?.(), this.history$.dispose(), this.#l.dispose(), this.#o.dispose();
|
|
@@ -2972,7 +3014,7 @@ var or = class {
|
|
|
2972
3014
|
} catch (e) {
|
|
2973
3015
|
if (!t()) return !1;
|
|
2974
3016
|
this.#S?.(), this.#S = void 0;
|
|
2975
|
-
let n = e instanceof
|
|
3017
|
+
let n = e instanceof U && e.code == ve.flowNotFound;
|
|
2976
3018
|
return this.#V(n ? {
|
|
2977
3019
|
flowId: void 0,
|
|
2978
3020
|
target: void 0,
|
|
@@ -2984,12 +3026,12 @@ var or = class {
|
|
|
2984
3026
|
}), this.#c(n ? {
|
|
2985
3027
|
kind: "error",
|
|
2986
3028
|
message: this.#r.t("notice.flowMissing")
|
|
2987
|
-
} :
|
|
3029
|
+
} : B(e, this.#r.t)), !1;
|
|
2988
3030
|
}
|
|
2989
3031
|
return !0;
|
|
2990
3032
|
}
|
|
2991
3033
|
selectTarget(e) {
|
|
2992
|
-
return !this.#d.applying && (
|
|
3034
|
+
return !this.#d.applying && (u(e, this.#l.value.target) || this.#d.clear(), this.#C(), this.#V({
|
|
2993
3035
|
diagnosticFocus: void 0,
|
|
2994
3036
|
diagnostics: void 0,
|
|
2995
3037
|
moduleEditor: void 0,
|
|
@@ -3001,7 +3043,7 @@ var or = class {
|
|
|
3001
3043
|
selectNodes(e) {
|
|
3002
3044
|
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : (this.#C(), this.#V({
|
|
3003
3045
|
diagnosticFocus: void 0,
|
|
3004
|
-
moduleEditor:
|
|
3046
|
+
moduleEditor: ar(this.#l.value.draft == null ? void 0 : z(this.#l.value.draft), this.#l.value.target, e),
|
|
3005
3047
|
nodeFocus: void 0,
|
|
3006
3048
|
selectedNodeIds: e
|
|
3007
3049
|
}), !0);
|
|
@@ -3014,7 +3056,7 @@ var or = class {
|
|
|
3014
3056
|
let n = await this.#e.getFlow(await t(e));
|
|
3015
3057
|
return this.#o.insert(n), n;
|
|
3016
3058
|
} catch (e) {
|
|
3017
|
-
this.#v || this.#c(
|
|
3059
|
+
this.#v || this.#c(B(e, this.#r.t));
|
|
3018
3060
|
} finally {
|
|
3019
3061
|
this.#V({ busy: void 0 });
|
|
3020
3062
|
}
|
|
@@ -3031,7 +3073,7 @@ var or = class {
|
|
|
3031
3073
|
message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
|
|
3032
3074
|
}), !0);
|
|
3033
3075
|
} catch (e) {
|
|
3034
|
-
return this.#v || this.#c(
|
|
3076
|
+
return this.#v || this.#c(B(e, this.#r.t)), !1;
|
|
3035
3077
|
} finally {
|
|
3036
3078
|
this.#V({ busy: void 0 });
|
|
3037
3079
|
}
|
|
@@ -3040,7 +3082,7 @@ var or = class {
|
|
|
3040
3082
|
if (!await this.saveModuleEditor() || this.#l.value.draft == null) return !1;
|
|
3041
3083
|
let t = this.#i();
|
|
3042
3084
|
this.#V({ busy: "resource" });
|
|
3043
|
-
let n = await this.#E(
|
|
3085
|
+
let n = await this.#E(Le(t, e), !1);
|
|
3044
3086
|
return this.#V({ busy: void 0 }), n != null && (this.selectTarget({
|
|
3045
3087
|
id: t,
|
|
3046
3088
|
kind: "subflow"
|
|
@@ -3058,7 +3100,7 @@ var or = class {
|
|
|
3058
3100
|
try {
|
|
3059
3101
|
i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
|
|
3060
3102
|
} catch (e) {
|
|
3061
|
-
this.#v || this.#c(
|
|
3103
|
+
this.#v || this.#c(B(e, this.#r.t));
|
|
3062
3104
|
}
|
|
3063
3105
|
return this.#V({ busy: void 0 }), i != null && (this.#c({
|
|
3064
3106
|
kind: "success",
|
|
@@ -3071,28 +3113,28 @@ var or = class {
|
|
|
3071
3113
|
if (r == null || i == null) return;
|
|
3072
3114
|
let a = this.#i();
|
|
3073
3115
|
if (e.kind == "comment") return await this.#T(i, a, t);
|
|
3074
|
-
let o = z(r), s =
|
|
3116
|
+
let o = z(r), s = v(e, o, i, this.#r.t);
|
|
3075
3117
|
if (s == null) return;
|
|
3076
3118
|
if (s.kind == "provider-trigger" && s.connectionId == null && s.definition.key != "feishu_app_bot.on_event") {
|
|
3077
3119
|
try {
|
|
3078
|
-
let e = await
|
|
3120
|
+
let e = await w(this.catalogs.connections.get(s.definition.provider, r.flowId));
|
|
3079
3121
|
s = {
|
|
3080
3122
|
...s,
|
|
3081
|
-
connectionId:
|
|
3123
|
+
connectionId: et(e).preferred?.connectionId
|
|
3082
3124
|
};
|
|
3083
3125
|
} catch (e) {
|
|
3084
|
-
!this.#v && this.#l.value.draft == r && this.#c(
|
|
3126
|
+
!this.#v && this.#l.value.draft == r && this.#c(B(e, this.#r.t));
|
|
3085
3127
|
}
|
|
3086
3128
|
if (this.#v || this.#l.value.draft != r || this.#l.value.target != i) return;
|
|
3087
3129
|
}
|
|
3088
|
-
let c = n?.(a), l =
|
|
3130
|
+
let c = n?.(a), l = Ue(o, i, a, s, this.#i);
|
|
3089
3131
|
if (l == null) return;
|
|
3090
|
-
let u = c == null ? l : [...l, ...
|
|
3132
|
+
let u = c == null ? l : [...l, ...Ut(R(r, l).content, i, {
|
|
3091
3133
|
source: c.source,
|
|
3092
3134
|
target: c.target,
|
|
3093
3135
|
...c.sourceHandle.startsWith("$branch:") ? { sourceHandle: c.sourceHandle.slice(8) } : {}
|
|
3094
3136
|
})];
|
|
3095
|
-
if (await this.#j("add", 1, u, (e) =>
|
|
3137
|
+
if (await this.#j("add", 1, u, (e) => Be(e, i, { [a]: t }), [a]) && !this.#v) return this.#V({ nodeFocus: {
|
|
3096
3138
|
nodeId: a,
|
|
3097
3139
|
requestId: ++this.#b
|
|
3098
3140
|
} }), a;
|
|
@@ -3100,7 +3142,7 @@ var or = class {
|
|
|
3100
3142
|
async connect(e) {
|
|
3101
3143
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
3102
3144
|
if (t == null || n == null) return;
|
|
3103
|
-
let r =
|
|
3145
|
+
let r = Ut(t.revision.content, n, {
|
|
3104
3146
|
source: e.source,
|
|
3105
3147
|
target: e.target,
|
|
3106
3148
|
...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
|
|
@@ -3110,7 +3152,7 @@ var or = class {
|
|
|
3110
3152
|
async disconnect(e) {
|
|
3111
3153
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
3112
3154
|
if (t == null || n == null) return;
|
|
3113
|
-
let r =
|
|
3155
|
+
let r = Wt(t.revision.content, n, {
|
|
3114
3156
|
source: e.source,
|
|
3115
3157
|
target: e.target,
|
|
3116
3158
|
...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
|
|
@@ -3121,10 +3163,10 @@ var or = class {
|
|
|
3121
3163
|
if (!await this.saveModuleEditor()) return;
|
|
3122
3164
|
let e = this.$.revision.value, t = this.#l.value.target;
|
|
3123
3165
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
3124
|
-
let n = [...this.#l.value.selectedNodeIds], r =
|
|
3166
|
+
let n = [...this.#l.value.selectedNodeIds], r = se(this.#l.value.presentation?.value ?? {}, t), i = new Set(this.#l.value.selectedNodeIds.filter((e) => r.has(e))), a = Ve(e, t, this.#l.value.selectedNodeIds);
|
|
3125
3167
|
await this.#j("delete", this.#l.value.selectedNodeIds.length, a, (e) => {
|
|
3126
|
-
let r = i.size == 0 ? e :
|
|
3127
|
-
for (let e of n) r =
|
|
3168
|
+
let r = i.size == 0 ? e : T(e, t, i);
|
|
3169
|
+
for (let e of n) r = D(r, t, e, !1);
|
|
3128
3170
|
return r;
|
|
3129
3171
|
}, []);
|
|
3130
3172
|
}
|
|
@@ -3140,14 +3182,14 @@ var or = class {
|
|
|
3140
3182
|
sourceId: e.id,
|
|
3141
3183
|
title: e.title
|
|
3142
3184
|
}] : []),
|
|
3143
|
-
nodes:
|
|
3185
|
+
nodes: he(e, t, this.#l.value.selectedNodeIds)
|
|
3144
3186
|
};
|
|
3145
3187
|
}
|
|
3146
|
-
async pasteNodes(e, t =
|
|
3188
|
+
async pasteNodes(e, t = sr) {
|
|
3147
3189
|
if (!await this.saveModuleEditor()) return;
|
|
3148
3190
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3149
3191
|
if (n == null || r == null || this.#m == null) return;
|
|
3150
|
-
let i = new Set(this.#m.hiddenNodeIds), a =
|
|
3192
|
+
let i = new Set(this.#m.hiddenNodeIds), a = ye(n, r, this.#m.nodes, this.#i), o = this.#m.comments.map((e) => ({
|
|
3151
3193
|
...e,
|
|
3152
3194
|
nodeId: this.#i()
|
|
3153
3195
|
}));
|
|
@@ -3165,9 +3207,9 @@ var or = class {
|
|
|
3165
3207
|
}];
|
|
3166
3208
|
}));
|
|
3167
3209
|
await this.#j("paste", c.size, a.changes, (e) => {
|
|
3168
|
-
let n =
|
|
3169
|
-
for (let [e, t] of a.sourceIds.entries()) i.has(t) && (n =
|
|
3170
|
-
for (let e of o) i.has(e.sourceId) && (n =
|
|
3210
|
+
let n = Be(e, r, f);
|
|
3211
|
+
for (let [e, t] of a.sourceIds.entries()) i.has(t) && (n = D(n, r, a.nodeIds[e], !0));
|
|
3212
|
+
for (let e of o) i.has(e.sourceId) && (n = D(n, r, e.nodeId, !0)), n = j(n, r, e.nodeId, {
|
|
3171
3213
|
content: e.content,
|
|
3172
3214
|
position: {
|
|
3173
3215
|
x: e.position.x + t.x * d,
|
|
@@ -3184,36 +3226,36 @@ var or = class {
|
|
|
3184
3226
|
async saveNodeSettings(e, t) {
|
|
3185
3227
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3186
3228
|
if (n == null || r == null) return !1;
|
|
3187
|
-
let i =
|
|
3229
|
+
let i = De(n, r, e, t);
|
|
3188
3230
|
return i != null && await this.#E(i) != null;
|
|
3189
3231
|
}
|
|
3190
3232
|
async saveNodeDescription(e, t) {
|
|
3191
3233
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3192
3234
|
if (n == null || r == null) return !1;
|
|
3193
|
-
let i =
|
|
3235
|
+
let i = Ce(n, r, e, t);
|
|
3194
3236
|
return i != null && await this.#E(i) != null;
|
|
3195
3237
|
}
|
|
3196
3238
|
async saveNodeIcon(e, t) {
|
|
3197
3239
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3198
3240
|
if (n == null || r == null) return !1;
|
|
3199
|
-
let i =
|
|
3241
|
+
let i = Re(n, r, e, t);
|
|
3200
3242
|
return i != null && await this.#E(i) != null;
|
|
3201
3243
|
}
|
|
3202
3244
|
async saveNodeTitle(e, t) {
|
|
3203
3245
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3204
3246
|
if (n == null || r == null) return !1;
|
|
3205
|
-
let i =
|
|
3247
|
+
let i = Fe(n, r, e, t);
|
|
3206
3248
|
return i != null && await this.#E(i) != null;
|
|
3207
3249
|
}
|
|
3208
3250
|
async setInputValue(e, t, n) {
|
|
3209
3251
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
3210
3252
|
if (r == null || i == null) return !1;
|
|
3211
|
-
let a =
|
|
3253
|
+
let a = Pe(r, i, e, t, n);
|
|
3212
3254
|
return a != null && await this.#E(a) != null;
|
|
3213
3255
|
}
|
|
3214
3256
|
async setInputSource(e, t, n) {
|
|
3215
3257
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
3216
|
-
return r == null || i == null ? !1 : await this.#E(
|
|
3258
|
+
return r == null || i == null ? !1 : await this.#E(Je(r.revision.content, i, e, t, [{
|
|
3217
3259
|
kind: "node",
|
|
3218
3260
|
...n
|
|
3219
3261
|
}])) != null;
|
|
@@ -3221,40 +3263,36 @@ var or = class {
|
|
|
3221
3263
|
async setInputVariable(e, t, n) {
|
|
3222
3264
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
3223
3265
|
if (r == null || i == null) return !1;
|
|
3224
|
-
let a = n == null ?
|
|
3266
|
+
let a = n == null ? Pe(r, i, e, t, void 0) : Ge(r, i, e, t, n, this.#i());
|
|
3225
3267
|
return a != null && await this.#E(a) != null;
|
|
3226
3268
|
}
|
|
3227
3269
|
async saveCondition(e, t) {
|
|
3228
3270
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3229
3271
|
if (n == null || r == null) return !1;
|
|
3230
|
-
let i =
|
|
3272
|
+
let i = be(n, r, e, t);
|
|
3231
3273
|
return i != null && await this.#E(i) != null;
|
|
3232
3274
|
}
|
|
3233
3275
|
async saveValue(e, t) {
|
|
3234
3276
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3235
3277
|
if (n == null || r == null) return !1;
|
|
3236
|
-
let i =
|
|
3278
|
+
let i = _e(n, r, e, t);
|
|
3237
3279
|
return i != null && await this.#E(i) != null;
|
|
3238
3280
|
}
|
|
3239
3281
|
async saveWait(e, t) {
|
|
3240
3282
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3241
3283
|
if (n == null || r?.kind != "flow") return !1;
|
|
3242
|
-
let i =
|
|
3284
|
+
let i = Xe(n, r, e, t);
|
|
3243
3285
|
return i != null && await this.#E(i) != null;
|
|
3244
3286
|
}
|
|
3245
|
-
async setWaitNotification(e, t) {
|
|
3246
|
-
let n = this.$.revision.value, r = n == null ? void 0 : he(n, e, t, this.#i());
|
|
3247
|
-
return r != null && await this.#E(r) != null;
|
|
3248
|
-
}
|
|
3249
3287
|
async saveNodeContentHidden(e, t) {
|
|
3250
3288
|
let n = this.#l.value.target, r = this.#I().nodes.find((t) => t.id == e);
|
|
3251
|
-
n != null && r != null && r.kind != "condition" && await this.#k((r) =>
|
|
3289
|
+
n != null && r != null && r.kind != "condition" && await this.#k((r) => D(r, n, e, t));
|
|
3252
3290
|
}
|
|
3253
3291
|
async saveComment(e, t) {
|
|
3254
3292
|
let n = this.#l.value.target;
|
|
3255
3293
|
if (n == null) return;
|
|
3256
3294
|
let r = this.#I().nodes.find((t) => t.id == e)?.position;
|
|
3257
|
-
r != null && await this.#k((i) =>
|
|
3295
|
+
r != null && await this.#k((i) => j(i, n, e, {
|
|
3258
3296
|
...t,
|
|
3259
3297
|
position: r
|
|
3260
3298
|
}));
|
|
@@ -3262,31 +3300,31 @@ var or = class {
|
|
|
3262
3300
|
async saveTaskSettings(e, t) {
|
|
3263
3301
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3264
3302
|
if (n == null || r == null) return !1;
|
|
3265
|
-
let i =
|
|
3303
|
+
let i = fe(n, r, e, t);
|
|
3266
3304
|
return i != null && await this.#E(i) != null;
|
|
3267
3305
|
}
|
|
3268
3306
|
async saveCodeActions(e, t) {
|
|
3269
3307
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3270
3308
|
if (n == null || r == null) return !1;
|
|
3271
|
-
let i =
|
|
3309
|
+
let i = Ee(n.revision.content, r, e, t);
|
|
3272
3310
|
return i == null || await this.#E(i) != null;
|
|
3273
3311
|
}
|
|
3274
3312
|
async saveTaskPorts(e, t) {
|
|
3275
3313
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3276
3314
|
if (n == null || r == null) return !1;
|
|
3277
|
-
let i =
|
|
3315
|
+
let i = Qe(n, r, e, t);
|
|
3278
3316
|
return i != null && await this.#E(i) != null;
|
|
3279
3317
|
}
|
|
3280
3318
|
async saveTaskAdditionalInputs(e, t) {
|
|
3281
3319
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3282
3320
|
if (n == null || r == null) return !1;
|
|
3283
|
-
let i =
|
|
3321
|
+
let i = qe(n, r, e, t);
|
|
3284
3322
|
return i != null && await this.#E(i) != null;
|
|
3285
3323
|
}
|
|
3286
3324
|
async setConnectorConnection(e, t) {
|
|
3287
3325
|
let n = this.$.revision.value;
|
|
3288
3326
|
if (n == null) return !1;
|
|
3289
|
-
let r =
|
|
3327
|
+
let r = me(n.revision.content, e, t);
|
|
3290
3328
|
return r != null && await this.#E(r) != null;
|
|
3291
3329
|
}
|
|
3292
3330
|
get eventSourceClient() {
|
|
@@ -3302,15 +3340,15 @@ var or = class {
|
|
|
3302
3340
|
if (n == null || r?.kind != "flow") return !1;
|
|
3303
3341
|
let i = n.graph(r)?.nodes[e];
|
|
3304
3342
|
if (i?.kind != "integration" || i.definition.key != "feishu_app_bot.on_event" || t.provider != i.definition.provider) return !1;
|
|
3305
|
-
let a =
|
|
3343
|
+
let a = $e(n.revision.content, r, e, t.connectionId);
|
|
3306
3344
|
if (a == null) return !1;
|
|
3307
3345
|
let o = i.config.sourceId != t.sourceId;
|
|
3308
3346
|
return await this.#E([
|
|
3309
3347
|
...a,
|
|
3310
|
-
...
|
|
3311
|
-
...o ?
|
|
3312
|
-
...o ?
|
|
3313
|
-
...o ?
|
|
3348
|
+
...N(n.revision.content, r, e, "sourceId", t.sourceId) ?? [],
|
|
3349
|
+
...o ? N(n.revision.content, r, e, "eventTypes", []) ?? [] : [],
|
|
3350
|
+
...o ? N(n.revision.content, r, e, "resource", void 0) ?? [] : [],
|
|
3351
|
+
...o ? N(n.revision.content, r, e, "chatIds", void 0) ?? [] : []
|
|
3314
3352
|
]) != null;
|
|
3315
3353
|
}
|
|
3316
3354
|
async loadTriggerConfigOptions(e, t, n) {
|
|
@@ -3321,39 +3359,39 @@ var or = class {
|
|
|
3321
3359
|
async saveTriggerConfig(e, t, n) {
|
|
3322
3360
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
3323
3361
|
if (r == null || i?.kind != "flow") return !1;
|
|
3324
|
-
let a =
|
|
3362
|
+
let a = N(r.revision.content, i, e, t, n);
|
|
3325
3363
|
if (a == null) return !1;
|
|
3326
3364
|
let o = r.graph(i)?.nodes[e];
|
|
3327
3365
|
if (a.length > 0 && o?.kind == "integration" && o.definition.key == "feishu_app_bot.on_event" && t == "eventTypes") {
|
|
3328
3366
|
let t = Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
|
|
3329
|
-
|
|
3367
|
+
b(t) || (a = [...a, ...N(r.revision.content, i, e, "chatIds", void 0) ?? []]), O(o.config.resource) && o.config.resource.kind != S(t) && (a = [...a, ...N(r.revision.content, i, e, "resource", void 0) ?? []]);
|
|
3330
3368
|
}
|
|
3331
|
-
return a.length > 0 && o?.kind == "poll" && o.definition.key == "linear.on_issue_changed" && t == "teamId" ? await this.#E([...a, ...
|
|
3369
|
+
return a.length > 0 && o?.kind == "poll" && o.definition.key == "linear.on_issue_changed" && t == "teamId" ? await this.#E([...a, ...N(r.revision.content, i, e, "stateIds", void 0) ?? []]) != null : await this.#E(a) != null;
|
|
3332
3370
|
}
|
|
3333
3371
|
async saveTriggerSchedule(e, t) {
|
|
3334
3372
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3335
3373
|
if (n == null || r?.kind != "flow") return !1;
|
|
3336
|
-
let i =
|
|
3374
|
+
let i = Ze(n.revision.content, r, e, t);
|
|
3337
3375
|
return i != null && await this.#E(i) != null;
|
|
3338
3376
|
}
|
|
3339
3377
|
async saveWebhook(e, t) {
|
|
3340
3378
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3341
3379
|
if (n == null || r?.kind != "flow") return !1;
|
|
3342
|
-
let i =
|
|
3380
|
+
let i = ce(n, r, e, t);
|
|
3343
3381
|
return i != null && await this.#E(i) != null;
|
|
3344
3382
|
}
|
|
3345
3383
|
async setTriggerConnection(e, t) {
|
|
3346
3384
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
3347
3385
|
if (n == null || r?.kind != "flow") return !1;
|
|
3348
|
-
let i =
|
|
3386
|
+
let i = $e(n.revision.content, r, e, t);
|
|
3349
3387
|
if (i == null) return !1;
|
|
3350
3388
|
let a = n.graph(r)?.nodes[e];
|
|
3351
|
-
return i.length > 0 && a?.kind == "poll" && a.definition.key == "linear.on_issue_changed" ? await this.#E([...i, ...["teamId", "stateIds"].flatMap((t) =>
|
|
3389
|
+
return i.length > 0 && a?.kind == "poll" && a.definition.key == "linear.on_issue_changed" ? await this.#E([...i, ...["teamId", "stateIds"].flatMap((t) => N(n.revision.content, r, e, t, void 0) ?? [])]) != null : await this.#E(i) != null;
|
|
3352
3390
|
}
|
|
3353
3391
|
async saveSubflowSettings(e, t) {
|
|
3354
3392
|
let n = this.$.revision.value;
|
|
3355
3393
|
if (n == null) return !1;
|
|
3356
|
-
let r =
|
|
3394
|
+
let r = we(n, e, t);
|
|
3357
3395
|
return r != null && await this.#E(r) != null;
|
|
3358
3396
|
}
|
|
3359
3397
|
updateModuleSource(e) {
|
|
@@ -3414,11 +3452,11 @@ var or = class {
|
|
|
3414
3452
|
phase: "saving"
|
|
3415
3453
|
}, this.#B();
|
|
3416
3454
|
try {
|
|
3417
|
-
let t = await
|
|
3455
|
+
let t = await Kt(i);
|
|
3418
3456
|
if (this.#v || !e()) return !1;
|
|
3419
3457
|
let a = this.#l.value.draft?.content.modules[n];
|
|
3420
3458
|
if (a == null || a.source != r.base.source || JSON.stringify(a.imports) != JSON.stringify(r.base.imports)) throw Error(this.#r.t("notice.moduleUpdated"));
|
|
3421
|
-
let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#l.value.draft : await this.#E(
|
|
3459
|
+
let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#l.value.draft : await this.#E(qt(n, r.base.source, r.base.imports, i, t), !1);
|
|
3422
3460
|
if (this.#v || !e()) return !1;
|
|
3423
3461
|
let s = this.#u.get(n);
|
|
3424
3462
|
if (s == null) continue;
|
|
@@ -3442,7 +3480,7 @@ var or = class {
|
|
|
3442
3480
|
r != null && (r.editor = {
|
|
3443
3481
|
...r.editor,
|
|
3444
3482
|
phase: "failed"
|
|
3445
|
-
}), this.#c(
|
|
3483
|
+
}), this.#c(B(t, this.#r.t));
|
|
3446
3484
|
}
|
|
3447
3485
|
this.#B();
|
|
3448
3486
|
}
|
|
@@ -3450,11 +3488,11 @@ var or = class {
|
|
|
3450
3488
|
}
|
|
3451
3489
|
async moveNodes(e) {
|
|
3452
3490
|
let t = this.#l.value.target;
|
|
3453
|
-
t != null && await this.#j("move", Object.keys(e).length, [], (n) =>
|
|
3491
|
+
t != null && await this.#j("move", Object.keys(e).length, [], (n) => Be(n, t, e));
|
|
3454
3492
|
}
|
|
3455
3493
|
async moveViewport(e) {
|
|
3456
3494
|
let t = this.#l.value.target;
|
|
3457
|
-
t != null && await this.#k((n) =>
|
|
3495
|
+
t != null && await this.#k((n) => te(n, t, e), !0);
|
|
3458
3496
|
}
|
|
3459
3497
|
async check() {
|
|
3460
3498
|
await this.#N();
|
|
@@ -3485,7 +3523,7 @@ var or = class {
|
|
|
3485
3523
|
let t = /#(\d+)$/.exec(e.title);
|
|
3486
3524
|
return t == null ? [] : [Number(t[1])];
|
|
3487
3525
|
}));
|
|
3488
|
-
if (!(!await this.#j("add", 1, [], (i) =>
|
|
3526
|
+
if (!(!await this.#j("add", 1, [], (i) => j(i, e, t, {
|
|
3489
3527
|
content: "",
|
|
3490
3528
|
position: n,
|
|
3491
3529
|
title: this.#r.t("addNode.commentName", { number: r + 1 })
|
|
@@ -3495,7 +3533,7 @@ var or = class {
|
|
|
3495
3533
|
if (this.#v || (this.#d.applying || this.#d.failed) && !n) return;
|
|
3496
3534
|
let r = this.#l.value.flowId, i = this.#l.value.draft;
|
|
3497
3535
|
if (r == null || i == null) return;
|
|
3498
|
-
if (e.length == 0 ||
|
|
3536
|
+
if (e.length == 0 || u(R(i, e).content, i.content)) return i;
|
|
3499
3537
|
let a = !n && this.#d.clear(), o = this.#n.capture();
|
|
3500
3538
|
this.#d.pending++, this.#d.publish();
|
|
3501
3539
|
try {
|
|
@@ -3517,7 +3555,7 @@ var or = class {
|
|
|
3517
3555
|
for (let t = 0; t < 2 && e(); t += 1) {
|
|
3518
3556
|
let t = this.#l.value.draft;
|
|
3519
3557
|
if (t == null) return;
|
|
3520
|
-
let n =
|
|
3558
|
+
let n = Oe(t.content);
|
|
3521
3559
|
if (n.length == 0) {
|
|
3522
3560
|
this.#N();
|
|
3523
3561
|
return;
|
|
@@ -3528,11 +3566,11 @@ var or = class {
|
|
|
3528
3566
|
e() && this.#N();
|
|
3529
3567
|
}
|
|
3530
3568
|
#O(e, t) {
|
|
3531
|
-
let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#L(e), o = this.#l.value.moduleEditor, s = o != null && (t == "external" || n != null) &&
|
|
3569
|
+
let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#L(e), o = this.#l.value.moduleEditor, s = o != null && (t == "external" || n != null) && ir(n, o) != "saved", c;
|
|
3532
3570
|
return c = s ? t == "external" ? {
|
|
3533
3571
|
...o,
|
|
3534
3572
|
phase: "failed"
|
|
3535
|
-
} : o :
|
|
3573
|
+
} : o : ar(r, a, i), this.#V({
|
|
3536
3574
|
draft: e,
|
|
3537
3575
|
moduleEditor: c,
|
|
3538
3576
|
selectedNodeIds: i,
|
|
@@ -3543,7 +3581,7 @@ var or = class {
|
|
|
3543
3581
|
if (this.#v || (this.#d.applying || this.#d.failed) && !t) return !1;
|
|
3544
3582
|
let n = this.#l.value.flowId, r = this.#l.value.presentation;
|
|
3545
3583
|
if (n == null || r == null) return !1;
|
|
3546
|
-
if (
|
|
3584
|
+
if (u(e(r.value), r.value)) return !0;
|
|
3547
3585
|
t || this.#A();
|
|
3548
3586
|
let i = this.#n.capture();
|
|
3549
3587
|
this.#d.pending++, this.#d.publish();
|
|
@@ -3564,9 +3602,9 @@ var or = class {
|
|
|
3564
3602
|
if (this.#v || this.#d.applying || this.#d.failed) return !1;
|
|
3565
3603
|
let { draft: a, target: o, presentation: s, selectedNodeIds: c } = this.#l.value;
|
|
3566
3604
|
if (a == null || o == null || s == null) return !1;
|
|
3567
|
-
let
|
|
3568
|
-
if (
|
|
3569
|
-
let f = this.#d.generation, p =
|
|
3605
|
+
let l = r?.(s.value) ?? s.value, d = re(s.value, l, o);
|
|
3606
|
+
if (u(R(a, n).content, a.content) && d.nodeIds.length == 0) return !0;
|
|
3607
|
+
let f = this.#d.generation, p = Jn(a.content, n);
|
|
3570
3608
|
this.#d.pending++;
|
|
3571
3609
|
let m = this.#d.record({
|
|
3572
3610
|
action: e,
|
|
@@ -3587,7 +3625,7 @@ var or = class {
|
|
|
3587
3625
|
let [o, s] = await Promise.all([e, t]);
|
|
3588
3626
|
return o != null && s && (!m || f == this.#d.generation);
|
|
3589
3627
|
} catch (e) {
|
|
3590
|
-
return this.#c(
|
|
3628
|
+
return this.#c(B(e, this.#r.t)), this.retryHistorySync(), !1;
|
|
3591
3629
|
} finally {
|
|
3592
3630
|
this.#d.pending--, this.#v || this.#d.publish();
|
|
3593
3631
|
}
|
|
@@ -3606,10 +3644,10 @@ var or = class {
|
|
|
3606
3644
|
let r = this.#d.generation;
|
|
3607
3645
|
this.#d.applying = !0, this.#d.publish();
|
|
3608
3646
|
try {
|
|
3609
|
-
let [t, i] = await Promise.all([this.#E(e ? n.forward : n.inverse, !0, !0), this.#k((t) =>
|
|
3647
|
+
let [t, i] = await Promise.all([this.#E(e ? n.forward : n.inverse, !0, !0), this.#k((t) => de(t, n.target, n.presentation, e), !0)]);
|
|
3610
3648
|
t != null && i && r == this.#d.generation && (this.selectNodes(e ? n.afterSelection : n.beforeSelection), this.#d.complete(e));
|
|
3611
3649
|
} catch (e) {
|
|
3612
|
-
this.#c(
|
|
3650
|
+
this.#c(B(e, this.#r.t)), this.retryHistorySync();
|
|
3613
3651
|
} finally {
|
|
3614
3652
|
this.#d.applying = !1, this.#v || this.#d.publish();
|
|
3615
3653
|
}
|
|
@@ -3666,7 +3704,7 @@ var or = class {
|
|
|
3666
3704
|
});
|
|
3667
3705
|
}
|
|
3668
3706
|
} catch (n) {
|
|
3669
|
-
!this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(
|
|
3707
|
+
!this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(B(n, this.#r.t));
|
|
3670
3708
|
} finally {
|
|
3671
3709
|
!this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#V({ checkLoading: !1 });
|
|
3672
3710
|
}
|
|
@@ -3707,15 +3745,15 @@ var or = class {
|
|
|
3707
3745
|
message: this.#r.t(o ? "notice.moduleUpdated" : "notice.draftUpdated")
|
|
3708
3746
|
}), this.#N(), !0;
|
|
3709
3747
|
} catch (n) {
|
|
3710
|
-
return t && this.#R(e) && this.#c(
|
|
3748
|
+
return t && this.#R(e) && this.#c(B(n, this.#r.t)), !1;
|
|
3711
3749
|
}
|
|
3712
3750
|
}
|
|
3713
3751
|
#I() {
|
|
3714
3752
|
let e = this.#l.value;
|
|
3715
|
-
return
|
|
3753
|
+
return _(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
|
|
3716
3754
|
}
|
|
3717
3755
|
#L(e) {
|
|
3718
|
-
let t = z(e), n =
|
|
3756
|
+
let t = z(e), n = cr(t, this.#l.value.target);
|
|
3719
3757
|
return {
|
|
3720
3758
|
revision: t,
|
|
3721
3759
|
selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
|
|
@@ -3746,13 +3784,13 @@ var or = class {
|
|
|
3746
3784
|
};
|
|
3747
3785
|
//#endregion
|
|
3748
3786
|
//#region src/workbench/browser/runtime/stores/workbenchStore.ts
|
|
3749
|
-
function
|
|
3787
|
+
function ur(e) {
|
|
3750
3788
|
return new Map(e.nodes.map((e) => [e.id, e]));
|
|
3751
3789
|
}
|
|
3752
|
-
function
|
|
3790
|
+
function dr(e, t) {
|
|
3753
3791
|
return e == null || t == null ? [] : z(e).designerInputs(t);
|
|
3754
3792
|
}
|
|
3755
|
-
function
|
|
3793
|
+
function fr(e, t, n, r, i) {
|
|
3756
3794
|
if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
|
|
3757
3795
|
let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
|
|
3758
3796
|
return typeof a == "string" ? new Map(r.flatMap((t) => {
|
|
@@ -3760,7 +3798,7 @@ function lr(e, t, n, r, i) {
|
|
|
3760
3798
|
return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
|
|
3761
3799
|
})) : /* @__PURE__ */ new Map();
|
|
3762
3800
|
}
|
|
3763
|
-
var
|
|
3801
|
+
var pr = { openExternalPage: async () => !1 }, mr = class {
|
|
3764
3802
|
#e;
|
|
3765
3803
|
#t;
|
|
3766
3804
|
#n;
|
|
@@ -3775,16 +3813,16 @@ var ur = { openExternalPage: async () => !1 }, dr = class {
|
|
|
3775
3813
|
#c;
|
|
3776
3814
|
#l;
|
|
3777
3815
|
#u;
|
|
3778
|
-
constructor(r, i, a =
|
|
3779
|
-
this.#t = new
|
|
3816
|
+
constructor(r, i, a = P, o = p(), s = pr, c = !0) {
|
|
3817
|
+
this.#t = new L(), this.#r = n(), this.#a = n([]), this.#o = n(!1), this.#s = n(!1), this.#c = !0, this.#u = !1, this.retryCatalog = () => {
|
|
3780
3818
|
this.connectors.retryCatalog(), this.triggers.catalog.retry();
|
|
3781
|
-
}, this.provideAddNodeOptions = (e, t, n = t) =>
|
|
3819
|
+
}, this.provideAddNodeOptions = (e, t, n = t) => Me(t, [this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t, n)]), this.browseAddNodeOptions = (e) => Me(e, [this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)]), this.provideAddNodeOptionChoices = (e, t) => this.connectors.provideAddNodeOptionChoices(e, t), this.#e = r, this.results = r, this.#n = o, this.#i = c;
|
|
3782
3820
|
let l = (e) => {
|
|
3783
3821
|
this.#u || this.#r.set(e);
|
|
3784
3822
|
};
|
|
3785
|
-
this.runs = new
|
|
3823
|
+
this.runs = new We(r, l, o), this.workspace = new lr(r, l, Jt, o, (e) => {
|
|
3786
3824
|
e.kind == "run.created" ? this.#d(r, e) : this.runs.changed(e.runId);
|
|
3787
|
-
}, new
|
|
3825
|
+
}, new Mn(r, s.connectorCache)), this.connectors = new Bn(r, this.workspace, l, s, o), this.triggers = new qn(r, this.workspace, l, s, o), this.publications = new $t(r, this.workspace, l, i, a, o), this.runRequests = new ln(r, this.runs, l, async (e) => {
|
|
3788
3826
|
if (!(e != this.workspace.$.flowId.value || !await this.workspace.saveModuleEditor() || this.#u || e != this.workspace.$.flowId.value)) return this.workspace.$.draft.value?.revisionId;
|
|
3789
3827
|
}, o, a);
|
|
3790
3828
|
let u = t((e) => {
|
|
@@ -3796,28 +3834,28 @@ var ur = { openExternalPage: async () => !1 }, dr = class {
|
|
|
3796
3834
|
diagnostics: [...t.diagnostics, ...n],
|
|
3797
3835
|
valid: !1
|
|
3798
3836
|
};
|
|
3799
|
-
}),
|
|
3837
|
+
}), d = /* @__PURE__ */ new Map(), f, m = t((e) => {
|
|
3800
3838
|
let t = e(this.workspace.$.draft);
|
|
3801
|
-
|
|
3802
|
-
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(u)?.diagnostics ?? e(this.connectors.$.diagnostics), a = t == null ? void 0 : e(this.workspace.catalogs.providers.get(t.flowId, o.lang))
|
|
3803
|
-
...
|
|
3804
|
-
r == null || n == null ? void 0 :
|
|
3839
|
+
f != t?.flowId && (d.clear(), f = t?.flowId);
|
|
3840
|
+
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(u)?.diagnostics ?? e(this.connectors.$.diagnostics), a = t == null ? void 0 : e(k(this.workspace.catalogs.providers.get(t.flowId, o.lang))), s = Object.fromEntries((a ?? []).map((e) => [e.serviceId, e])), c = e(this.connectors.$.actions), l = e(this.connectors.$.catalogs), p = e(o.t$), m = e(this.runs.$.run), h = e(this.runs.$.events), g = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, v = [
|
|
3841
|
+
...dr(t, n),
|
|
3842
|
+
r == null || n == null ? void 0 : ne(r, n),
|
|
3805
3843
|
i,
|
|
3806
3844
|
c,
|
|
3807
3845
|
a,
|
|
3808
3846
|
l,
|
|
3809
|
-
|
|
3847
|
+
p,
|
|
3848
|
+
m,
|
|
3810
3849
|
h,
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
], y = p.get(_);
|
|
3850
|
+
...m == null ? [] : [t?.revisionId]
|
|
3851
|
+
], y = d.get(g);
|
|
3814
3852
|
if (y != null && y.inputs.length == v.length && y.inputs.every((e, t) => e === v[t])) return y.graph;
|
|
3815
|
-
let b =
|
|
3816
|
-
return
|
|
3853
|
+
let b = _(t, n, r, i, c, l, p, m, h, s);
|
|
3854
|
+
return d.set(g, {
|
|
3817
3855
|
graph: b,
|
|
3818
3856
|
inputs: v
|
|
3819
3857
|
}), b;
|
|
3820
|
-
}),
|
|
3858
|
+
}), h = e(m, ur);
|
|
3821
3859
|
this.$ = {
|
|
3822
3860
|
busy: t((e) => {
|
|
3823
3861
|
let t = e(this.workspace.$.busy);
|
|
@@ -3828,15 +3866,16 @@ var ur = { openExternalPage: async () => !1 }, dr = class {
|
|
|
3828
3866
|
if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
|
|
3829
3867
|
if (e(this.publications.$.changingTriggerId) != null) return "trigger";
|
|
3830
3868
|
}),
|
|
3831
|
-
diagnosticItems: t((e) =>
|
|
3869
|
+
diagnosticItems: t((e) => Se(e(this.workspace.$.revision), e(this.workspace.$.target), e(u))),
|
|
3832
3870
|
diagnostics: u,
|
|
3833
|
-
designer:
|
|
3834
|
-
designerNodeById:
|
|
3871
|
+
designer: m,
|
|
3872
|
+
designerNodeById: h,
|
|
3873
|
+
sourceNodeIcons: e(m, (e) => Object.fromEntries(e.nodes.flatMap((e) => "icon" in e ? [[e.id, e.icon]] : [])), { equal: Z }),
|
|
3835
3874
|
notice: this.#r,
|
|
3836
|
-
runEventNodes: t((e) =>
|
|
3875
|
+
runEventNodes: t((e) => fr(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(h))),
|
|
3837
3876
|
selectedDesignerNode: t((e) => {
|
|
3838
3877
|
let t = e(this.workspace.$.selectedNodeIds);
|
|
3839
|
-
return t.length == 1 ? e(
|
|
3878
|
+
return t.length == 1 ? e(h).get(t[0]) : void 0;
|
|
3840
3879
|
}),
|
|
3841
3880
|
variableNames: this.#a,
|
|
3842
3881
|
variableNamesLoaded: this.#o,
|
|
@@ -3869,7 +3908,7 @@ var ur = { openExternalPage: async () => !1 }, dr = class {
|
|
|
3869
3908
|
if (this.#u) return;
|
|
3870
3909
|
this.#a.set(e.map((e) => e.name)), this.#o.set(!0);
|
|
3871
3910
|
} catch (e) {
|
|
3872
|
-
this.#c = !0, this.#u || this.#r.set(
|
|
3911
|
+
this.#c = !0, this.#u || this.#r.set(B(e, this.#n.t));
|
|
3873
3912
|
} finally {
|
|
3874
3913
|
this.#l = void 0, this.#u || this.#s.set(!1);
|
|
3875
3914
|
}
|
|
@@ -3900,9 +3939,9 @@ var ur = { openExternalPage: async () => !1 }, dr = class {
|
|
|
3900
3939
|
let t = this.$.runEventNodes.value.get(e);
|
|
3901
3940
|
return t != null && this.workspace.locateNode(t);
|
|
3902
3941
|
}
|
|
3903
|
-
locateRunWait() {
|
|
3904
|
-
let
|
|
3905
|
-
return
|
|
3942
|
+
locateRunWait(e) {
|
|
3943
|
+
let t = this.runs.$.run.value;
|
|
3944
|
+
return t == null || !("waits" in t) || !t.waits.some((t) => t.nodeId == e) ? !1 : this.workspace.locateNode(e);
|
|
3906
3945
|
}
|
|
3907
3946
|
async addNode(e, t, n) {
|
|
3908
3947
|
try {
|
|
@@ -3913,7 +3952,7 @@ var ur = { openExternalPage: async () => !1 }, dr = class {
|
|
|
3913
3952
|
let r = await this.workspace.addNode(e, t, n);
|
|
3914
3953
|
return r != null && e.kind == "connector" && this.connectors.refresh(), r != null && e.kind == "trigger" && this.triggers.refresh(), r;
|
|
3915
3954
|
} catch (e) {
|
|
3916
|
-
this.#u || this.#r.set(
|
|
3955
|
+
this.#u || this.#r.set(B(e, this.#n.t));
|
|
3917
3956
|
return;
|
|
3918
3957
|
}
|
|
3919
3958
|
}
|
|
@@ -3948,13 +3987,13 @@ var ur = { openExternalPage: async () => !1 }, dr = class {
|
|
|
3948
3987
|
return;
|
|
3949
3988
|
}
|
|
3950
3989
|
}
|
|
3951
|
-
},
|
|
3952
|
-
function
|
|
3953
|
-
let d =
|
|
3954
|
-
/* @__PURE__ */
|
|
3990
|
+
}, hr = Tt(() => import("./flowWorkspace-CpMGzmfz.js").then((e) => e.t));
|
|
3991
|
+
function gr({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: c, tokenLabel: u }) {
|
|
3992
|
+
let d = c != null && u != null && i != null, f = c ?? "", p = /* @__PURE__ */ q(Ct, { children: [
|
|
3993
|
+
/* @__PURE__ */ K("div", {
|
|
3955
3994
|
"aria-hidden": "true",
|
|
3956
3995
|
className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
|
|
3957
|
-
children: /* @__PURE__ */
|
|
3996
|
+
children: /* @__PURE__ */ q("svg", {
|
|
3958
3997
|
className: "size-5",
|
|
3959
3998
|
fill: "none",
|
|
3960
3999
|
stroke: "currentColor",
|
|
@@ -3962,40 +4001,40 @@ function pr({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
3962
4001
|
strokeLinejoin: "round",
|
|
3963
4002
|
strokeWidth: "1.8",
|
|
3964
4003
|
viewBox: "0 0 24 24",
|
|
3965
|
-
children: [/* @__PURE__ */
|
|
4004
|
+
children: [/* @__PURE__ */ K("rect", {
|
|
3966
4005
|
height: "9",
|
|
3967
4006
|
rx: "2",
|
|
3968
4007
|
width: "14",
|
|
3969
4008
|
x: "5",
|
|
3970
4009
|
y: "11"
|
|
3971
|
-
}), /* @__PURE__ */
|
|
4010
|
+
}), /* @__PURE__ */ K("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
|
|
3972
4011
|
})
|
|
3973
4012
|
}),
|
|
3974
|
-
/* @__PURE__ */
|
|
4013
|
+
/* @__PURE__ */ q("header", {
|
|
3975
4014
|
className: "flex flex-col gap-2",
|
|
3976
|
-
children: [/* @__PURE__ */
|
|
4015
|
+
children: [/* @__PURE__ */ K("h1", {
|
|
3977
4016
|
className: "text-xl font-semibold tracking-tight text-balance",
|
|
3978
4017
|
children: o
|
|
3979
|
-
}), /* @__PURE__ */
|
|
4018
|
+
}), /* @__PURE__ */ K("p", {
|
|
3980
4019
|
className: "text-sm/relaxed text-muted-foreground text-pretty",
|
|
3981
4020
|
children: t
|
|
3982
4021
|
})]
|
|
3983
4022
|
}),
|
|
3984
|
-
d && /* @__PURE__ */
|
|
4023
|
+
d && /* @__PURE__ */ K(lt, { children: /* @__PURE__ */ q(st, {
|
|
3985
4024
|
"data-invalid": n != null,
|
|
3986
4025
|
children: [
|
|
3987
|
-
/* @__PURE__ */
|
|
4026
|
+
/* @__PURE__ */ K(ct, {
|
|
3988
4027
|
htmlFor: "session-token",
|
|
3989
4028
|
children: u
|
|
3990
4029
|
}),
|
|
3991
|
-
/* @__PURE__ */
|
|
4030
|
+
/* @__PURE__ */ K(l, {
|
|
3992
4031
|
autoComplete: "username",
|
|
3993
4032
|
name: "username",
|
|
3994
4033
|
type: "hidden",
|
|
3995
4034
|
value: "open-flow",
|
|
3996
4035
|
readOnly: !0
|
|
3997
4036
|
}),
|
|
3998
|
-
/* @__PURE__ */
|
|
4037
|
+
/* @__PURE__ */ K(l, {
|
|
3999
4038
|
autoComplete: "current-password",
|
|
4000
4039
|
"aria-invalid": n != null,
|
|
4001
4040
|
autoFocus: !0,
|
|
@@ -4007,29 +4046,29 @@ function pr({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
4007
4046
|
type: "password",
|
|
4008
4047
|
value: f
|
|
4009
4048
|
}),
|
|
4010
|
-
n != null && /* @__PURE__ */
|
|
4049
|
+
n != null && /* @__PURE__ */ K(ft, { children: n })
|
|
4011
4050
|
]
|
|
4012
4051
|
}) }),
|
|
4013
|
-
e != null && r != null && /* @__PURE__ */
|
|
4052
|
+
e != null && r != null && /* @__PURE__ */ q(s, {
|
|
4014
4053
|
disabled: a || d && f.length == 0,
|
|
4015
4054
|
size: "lg",
|
|
4016
4055
|
type: "submit",
|
|
4017
|
-
children: [a && /* @__PURE__ */
|
|
4056
|
+
children: [a && /* @__PURE__ */ K(ot, {
|
|
4018
4057
|
"aria-label": e,
|
|
4019
4058
|
"data-icon": "inline-start"
|
|
4020
4059
|
}), e]
|
|
4021
4060
|
}),
|
|
4022
|
-
a && e == null && /* @__PURE__ */
|
|
4061
|
+
a && e == null && /* @__PURE__ */ K(ot, { "aria-label": t })
|
|
4023
4062
|
] }), m = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
|
|
4024
|
-
return /* @__PURE__ */
|
|
4063
|
+
return /* @__PURE__ */ K("main", {
|
|
4025
4064
|
className: "open-flow-workbench",
|
|
4026
|
-
children: /* @__PURE__ */
|
|
4065
|
+
children: /* @__PURE__ */ K("div", {
|
|
4027
4066
|
className: "grid h-full overflow-auto bg-muted/20 p-4",
|
|
4028
|
-
children: r == null ? /* @__PURE__ */
|
|
4067
|
+
children: r == null ? /* @__PURE__ */ K("section", {
|
|
4029
4068
|
"aria-busy": a,
|
|
4030
4069
|
className: m,
|
|
4031
4070
|
children: p
|
|
4032
|
-
}) : /* @__PURE__ */
|
|
4071
|
+
}) : /* @__PURE__ */ K("form", {
|
|
4033
4072
|
"aria-busy": a,
|
|
4034
4073
|
className: m,
|
|
4035
4074
|
onSubmit: r,
|
|
@@ -4038,15 +4077,15 @@ function pr({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
4038
4077
|
})
|
|
4039
4078
|
});
|
|
4040
4079
|
}
|
|
4041
|
-
function
|
|
4080
|
+
function _r({ host: e, store: t }) {
|
|
4042
4081
|
let [n] = Y(() => e.notify.bind(e)), i = r(t.$.notice);
|
|
4043
|
-
return
|
|
4082
|
+
return J(() => n(i), [n, i]), J(() => () => n(void 0), [n]), null;
|
|
4044
4083
|
}
|
|
4045
|
-
function
|
|
4084
|
+
function vr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: i, flowBadges: a, hrefFor: o, hostAction: s, hostTitle: c, language: l, navigation: u, onConfigureConnector: d, onHostAction: f, onLanguageChange: p, store: m, theme: h }) {
|
|
4046
4085
|
let g = r(m.workspace.$.flowId);
|
|
4047
|
-
return /* @__PURE__ */
|
|
4086
|
+
return /* @__PURE__ */ K("div", {
|
|
4048
4087
|
className: "app-shell",
|
|
4049
|
-
children: g == null ? /* @__PURE__ */
|
|
4088
|
+
children: g == null ? /* @__PURE__ */ K(Lt, {
|
|
4050
4089
|
catalogWidth: e,
|
|
4051
4090
|
createFlowDisabled: n,
|
|
4052
4091
|
createFlowField: i,
|
|
@@ -4063,12 +4102,12 @@ function hr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
4063
4102
|
onLanguageChange: p,
|
|
4064
4103
|
onSelectFlow: (e) => void u.selectFlow(e),
|
|
4065
4104
|
store: m
|
|
4066
|
-
}) : /* @__PURE__ */
|
|
4067
|
-
fallback: /* @__PURE__ */
|
|
4105
|
+
}) : /* @__PURE__ */ K(wt, {
|
|
4106
|
+
fallback: /* @__PURE__ */ K("main", {
|
|
4068
4107
|
"aria-busy": "true",
|
|
4069
4108
|
className: "workspace"
|
|
4070
4109
|
}),
|
|
4071
|
-
children: /* @__PURE__ */
|
|
4110
|
+
children: /* @__PURE__ */ K(hr, {
|
|
4072
4111
|
hostAction: s,
|
|
4073
4112
|
hostTitle: c,
|
|
4074
4113
|
hrefFor: o,
|
|
@@ -4081,44 +4120,44 @@ function hr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
4081
4120
|
})
|
|
4082
4121
|
});
|
|
4083
4122
|
}
|
|
4084
|
-
function
|
|
4085
|
-
let
|
|
4086
|
-
|
|
4087
|
-
let [{ i18n:
|
|
4088
|
-
let e =
|
|
4123
|
+
function yr({ 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: m, onLanguageChange: h, onNavigate: g, preferences: _, theme: v, variables: y = !0 }) {
|
|
4124
|
+
let b = Et(g);
|
|
4125
|
+
b.current = g;
|
|
4126
|
+
let [{ i18n: x, navigation: S, store: C }] = Y(() => {
|
|
4127
|
+
let e = p(u), t = new mr(new xe((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), _, P, e, a, y);
|
|
4089
4128
|
return {
|
|
4090
4129
|
i18n: e,
|
|
4091
|
-
navigation: new At(t, d, (e, t) =>
|
|
4130
|
+
navigation: new At(t, d, (e, t) => b.current(e, t)),
|
|
4092
4131
|
store: t
|
|
4093
4132
|
};
|
|
4094
4133
|
});
|
|
4095
|
-
return
|
|
4096
|
-
|
|
4134
|
+
return J(() => {
|
|
4135
|
+
S.start();
|
|
4097
4136
|
let e = () => {
|
|
4098
|
-
|
|
4137
|
+
C.connectors.refreshAfterAuthorization(), C.triggers.refreshAfterAuthorization(), C.invalidateVariableNames();
|
|
4099
4138
|
};
|
|
4100
4139
|
return globalThis.addEventListener("focus", e), () => {
|
|
4101
|
-
globalThis.removeEventListener("focus", e),
|
|
4140
|
+
globalThis.removeEventListener("focus", e), S.dispose(), C.dispose(), x.dispose();
|
|
4102
4141
|
};
|
|
4103
4142
|
}, [
|
|
4104
|
-
b,
|
|
4105
4143
|
x,
|
|
4106
|
-
S
|
|
4107
|
-
|
|
4108
|
-
|
|
4144
|
+
S,
|
|
4145
|
+
C
|
|
4146
|
+
]), J(() => void S.apply(d), [d, S]), J(() => {
|
|
4147
|
+
C.triggers.catalog.setLanguage(u), C.connectors.setLanguage(u), x.lang != u && x.switchLang(u);
|
|
4109
4148
|
}, [
|
|
4110
|
-
|
|
4149
|
+
x,
|
|
4111
4150
|
u,
|
|
4112
|
-
|
|
4113
|
-
]), /* @__PURE__ */
|
|
4114
|
-
i18n:
|
|
4115
|
-
children: /* @__PURE__ */
|
|
4151
|
+
C
|
|
4152
|
+
]), /* @__PURE__ */ K(o, {
|
|
4153
|
+
i18n: x,
|
|
4154
|
+
children: /* @__PURE__ */ q("div", {
|
|
4116
4155
|
className: "open-flow-theme open-flow-workbench",
|
|
4117
|
-
"data-theme":
|
|
4118
|
-
children: [/* @__PURE__ */
|
|
4156
|
+
"data-theme": v,
|
|
4157
|
+
children: [/* @__PURE__ */ K(_r, {
|
|
4119
4158
|
host: a,
|
|
4120
|
-
store:
|
|
4121
|
-
}), /* @__PURE__ */
|
|
4159
|
+
store: C
|
|
4160
|
+
}), /* @__PURE__ */ K(vr, {
|
|
4122
4161
|
catalogWidth: e,
|
|
4123
4162
|
createFlow: t,
|
|
4124
4163
|
createFlowDisabled: n,
|
|
@@ -4128,18 +4167,18 @@ function gr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
4128
4167
|
hostTitle: c,
|
|
4129
4168
|
hrefFor: l,
|
|
4130
4169
|
language: u,
|
|
4131
|
-
navigation:
|
|
4170
|
+
navigation: S,
|
|
4132
4171
|
onConfigureConnector: f,
|
|
4133
|
-
onHostAction:
|
|
4134
|
-
onLanguageChange:
|
|
4135
|
-
store:
|
|
4136
|
-
theme:
|
|
4172
|
+
onHostAction: m,
|
|
4173
|
+
onLanguageChange: h,
|
|
4174
|
+
store: C,
|
|
4175
|
+
theme: v
|
|
4137
4176
|
})]
|
|
4138
4177
|
})
|
|
4139
4178
|
});
|
|
4140
4179
|
}
|
|
4141
|
-
function
|
|
4142
|
-
return /* @__PURE__ */
|
|
4180
|
+
function br({ sessionKey: e, ...t }) {
|
|
4181
|
+
return /* @__PURE__ */ K(yr, { ...t }, e);
|
|
4143
4182
|
}
|
|
4144
4183
|
//#endregion
|
|
4145
|
-
export {
|
|
4184
|
+
export { ge as EventSourcesPage, gr as OpenFlowSessionGate, br as OpenFlowWorkbench, St as isWorkbenchLanguage, bt as resolveWorkbenchLanguage, xt as workbenchLanguageNames, yt as workbenchLanguages };
|