@oomol-lab/open-flow 0.1.0-beta.37 → 0.1.0-beta.38
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/{editorComponent-B-FXsvGH.js → editorComponent-BUEAVBsL.js} +154 -74
- package/dist/browser/flow-authoring.js +11976 -1720
- package/dist/browser/{flowChanges-Bc3Jncg9.js → flowChanges-Bu_BEtpj.js} +2797 -2663
- package/dist/browser/{flowWorkspace-JCjjQZzW.js → flowWorkspace-etUB3NSN.js} +9625 -9538
- package/dist/browser/{inputValues-eKZ3xev7.js → inputValues-CiSzEYeK.js} +1 -1
- package/dist/browser/{typeScriptSession-DnAmJCzu.js → typeScriptSession-vC9uPDVV.js} +1 -1
- package/dist/browser/ui.css +1 -1
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +910 -853
- package/dist/common/connectorDecoders.d.ts +8 -0
- package/dist/common/control-api-conformance.d.ts +2 -1
- package/dist/common/control-api-conformance.js +1660 -1629
- package/dist/common/control-api.d.ts +26 -7
- package/dist/common/control-api.js +2844 -2739
- package/dist/common/control-requests.d.ts +8 -0
- package/dist/common/control-requests.js +4733 -1645
- package/dist/common/flow-semantics.d.ts +1 -0
- package/dist/common/flow-semantics.js +12 -2
- package/dist/common/mcp.js +578 -498
- package/dist/common/providerAccess.d.ts +20 -0
- package/package.json +1 -1
- package/dist/browser/lib-GrGxYjsJ.js +0 -7855
|
@@ -1,19 +1,19 @@
|
|
|
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
3
|
import { Bn as s, Hn as c, kt as l, t as u } from "./lite-BA96NG4M.js";
|
|
4
|
-
import { E as d, M as f, N as p, O as m, P as h, T as g, _, h as v, j as y, k as b, m as x, w as S } from "./editorComponent-
|
|
5
|
-
import { $
|
|
6
|
-
import { C as
|
|
7
|
-
import { c as
|
|
8
|
-
import { a as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { Suspense as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
4
|
+
import { E as d, M as f, N as p, O as m, P as h, T as g, _, h as v, j as y, k as b, m as x, w as S } from "./editorComponent-BUEAVBsL.js";
|
|
5
|
+
import { $ as C, $t as w, Bt as ee, E as T, Gt as te, H as E, Ht as D, J as ne, Lt as re, M as O, N as k, O as A, Q as ie, Qt as j, R as ae, Rt as M, S as oe, T as N, U as se, Ut as ce, V as P, Vt as le, W as ue, Wt as de, X as fe, Xt as F, Y as pe, Z as me, Zt as he, _ as ge, a as _e, an as ve, b as ye, c as be, cn as I, d as xe, en as Se, et as Ce, f as we, g as Te, h as Ee, i as De, in as L, j as R, k as Oe, l as ke, ln as Ae, lt as je, m as Me, nn as Ne, nt as Pe, o as Fe, on as Ie, ot as Le, p as Re, r as z, rn as ze, rt as Be, s as Ve, sn as B, st as He, t as Ue, tn as We, tt as Ge, u as Ke, ut as qe, v as Je, w as Ye, x as Xe, y as Ze, zt as Qe } from "./flowChanges-Bu_BEtpj.js";
|
|
6
|
+
import { C as $e, D as et, O as tt, _ as nt, a as rt, c as it, d as at, f as ot, g as st, h as ct, i as lt, l as ut, m as dt, n as ft, o as pt, r as mt, s as ht, t as gt, v as _t, w as vt } from "./workbenchSelect-DNteZJYP.js";
|
|
7
|
+
import { c as yt, d as bt, l as xt, u as St } from "./value-B_yE9ean.js";
|
|
8
|
+
import { a as V } from "./dist-CoszrK7m.js";
|
|
9
|
+
import { Fragment as Ct, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
10
|
+
import { Suspense as wt, lazy as Tt, useEffect as Et, useRef as Dt, useState as W } from "react";
|
|
11
|
+
import * as Ot from "effect/Cause";
|
|
12
|
+
import * as G from "effect/Effect";
|
|
13
|
+
import * as kt from "effect/Exit";
|
|
14
|
+
import * as At from "effect/Fiber";
|
|
15
15
|
//#region src/workbench/browser/runtime/navigation.ts
|
|
16
|
-
var
|
|
16
|
+
var jt = class {
|
|
17
17
|
#e;
|
|
18
18
|
#t;
|
|
19
19
|
#n;
|
|
@@ -72,7 +72,7 @@ var Et = class {
|
|
|
72
72
|
this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
|
|
73
73
|
}
|
|
74
74
|
async apply(e) {
|
|
75
|
-
if (
|
|
75
|
+
if (Mt(e, this.#t)) return;
|
|
76
76
|
this.#t = e;
|
|
77
77
|
let t = ++this.#i;
|
|
78
78
|
this.#s = !0;
|
|
@@ -88,39 +88,39 @@ var Et = class {
|
|
|
88
88
|
flowId: n,
|
|
89
89
|
view: n == null ? "design" : e
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
Mt(r, this.#t) || (this.#t = r, this.#e(r, { replace: t })), this.#r.set(r.view);
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
function
|
|
94
|
+
function Mt(e, t) {
|
|
95
95
|
return e.flowId == t.flowId && e.view == t.view;
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
|
|
99
|
-
var
|
|
100
|
-
label:
|
|
99
|
+
var Nt = Tt(() => import("./createResourceDialog-DRB0OEtr.js")), Pt = bt.map((e) => ({
|
|
100
|
+
label: St[e],
|
|
101
101
|
value: e
|
|
102
|
-
})),
|
|
103
|
-
function
|
|
104
|
-
let n = i(), [r, a] =
|
|
105
|
-
return t == null ? null : /* @__PURE__ */
|
|
102
|
+
})), Ft = 44, It = -12, Lt = 8, Rt = "a, button, input, select, textarea, [data-slot=\"tooltip-trigger\"]";
|
|
103
|
+
function zt({ language: e, onLanguageChange: t }) {
|
|
104
|
+
let n = i(), [r, a] = W(null);
|
|
105
|
+
return t == null ? null : /* @__PURE__ */ U("div", {
|
|
106
106
|
className: "resource-language",
|
|
107
107
|
ref: a,
|
|
108
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ H("span", {
|
|
109
109
|
className: "sr-only",
|
|
110
110
|
children: n("language.label")
|
|
111
|
-
}), /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ H(gt, {
|
|
112
112
|
ariaLabel: n("language.label"),
|
|
113
113
|
onValueChange: (e) => t(e),
|
|
114
|
-
options:
|
|
114
|
+
options: Pt,
|
|
115
115
|
portalRoot: r,
|
|
116
116
|
value: e
|
|
117
117
|
})]
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Bt(e) {
|
|
121
121
|
return e.length <= 20 ? e : `${e.slice(0, 10)}…${e.slice(-6)}`;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Vt(e, t) {
|
|
124
124
|
let n = new Date(e), r = /* @__PURE__ */ new Date();
|
|
125
125
|
return n.toLocaleString(t, {
|
|
126
126
|
day: "numeric",
|
|
@@ -130,51 +130,51 @@ function It(e, t) {
|
|
|
130
130
|
year: n.getFullYear() == r.getFullYear() ? void 0 : "numeric"
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
return e.target instanceof Element && e.target.closest(
|
|
133
|
+
function Ht(e) {
|
|
134
|
+
return e.target instanceof Element && e.target.closest(Rt) != null;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
let [f, p] =
|
|
138
|
-
async function
|
|
139
|
-
|
|
136
|
+
function Ut({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: u }) {
|
|
137
|
+
let [f, p] = W(null), h = Dt(null), y = Dt(null), C = Dt(null), w = Dt(null), ee = a(), T = i(), [te, E] = W("idle"), [D, ne] = W(n.name), [O, k] = W(!1), [A, ie] = W(), j = n.live != null && n.live.revisionId != n.draftRevisionId, ae = n.status == "retiring" ? "resource.retiring" : n.live == null ? "resource.notPublished" : j ? "resource.unpublishedChanges" : "resource.isPublished", M = n.status == "retiring" ? "danger" : n.live == null ? "neutral" : j ? "running" : "success";
|
|
138
|
+
async function oe(e) {
|
|
139
|
+
ie(e == "publish" ? "publish" : "enabled");
|
|
140
140
|
try {
|
|
141
141
|
e == "publish" ? await u.workspace.publishFlow(n) : await u.workspace.setFlowEnabled(n, e);
|
|
142
142
|
} finally {
|
|
143
|
-
|
|
143
|
+
ie(void 0);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
let
|
|
147
|
-
async function
|
|
146
|
+
let N = vt(D);
|
|
147
|
+
async function se(e) {
|
|
148
148
|
e.preventDefault();
|
|
149
|
-
let t =
|
|
150
|
-
|
|
149
|
+
let t = D.trim();
|
|
150
|
+
vt(t) == null && await u.workspace.renameFlow(n.flowId, t) && E("idle");
|
|
151
151
|
}
|
|
152
|
-
async function
|
|
153
|
-
await u.workspace.deleteFlow(n.flowId) &&
|
|
152
|
+
async function ce() {
|
|
153
|
+
await u.workspace.deleteFlow(n.flowId) && E("idle");
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
|
|
155
|
+
function P(e) {
|
|
156
|
+
Ht(e) || o(n);
|
|
157
157
|
}
|
|
158
|
-
return /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ U("div", {
|
|
159
159
|
className: "resource-item-row",
|
|
160
160
|
ref: p,
|
|
161
161
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ U("div", {
|
|
163
163
|
className: "resource-list-row flow-columns",
|
|
164
|
-
onClick:
|
|
164
|
+
onClick: P,
|
|
165
165
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ U("span", {
|
|
167
167
|
className: "resource-primary-cell",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ H("span", {
|
|
169
169
|
"aria-hidden": "true",
|
|
170
170
|
className: "resource-flow-icon",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
-
}), /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ H("i", { className: "i-lucide-light:workflow" })
|
|
172
|
+
}), /* @__PURE__ */ U("span", {
|
|
173
173
|
className: "resource-primary-copy",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ U("span", {
|
|
175
175
|
className: "resource-primary-heading",
|
|
176
176
|
ref: h,
|
|
177
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ H(s, {
|
|
178
178
|
"aria-disabled": n.status == "retiring",
|
|
179
179
|
className: "resource-primary-title",
|
|
180
180
|
nativeButton: !1,
|
|
@@ -183,33 +183,33 @@ function Rt({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: u }) {
|
|
|
183
183
|
e.preventDefault();
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
re(e, () => o(n));
|
|
187
187
|
},
|
|
188
|
-
render: /* @__PURE__ */
|
|
188
|
+
render: /* @__PURE__ */ H("a", { href: n.status == "retiring" ? void 0 : r }),
|
|
189
189
|
tabIndex: n.status == "retiring" ? -1 : void 0,
|
|
190
190
|
title: n.name,
|
|
191
191
|
variant: "link",
|
|
192
192
|
children: n.name
|
|
193
|
-
}), n.status == "active" && /* @__PURE__ */
|
|
193
|
+
}), n.status == "active" && /* @__PURE__ */ U(g, {
|
|
194
194
|
onOpenChange: (e) => {
|
|
195
|
-
|
|
195
|
+
E(e ? "rename" : "idle"), e && ne(n.name);
|
|
196
196
|
},
|
|
197
|
-
open:
|
|
198
|
-
children: [/* @__PURE__ */
|
|
199
|
-
render: /* @__PURE__ */
|
|
200
|
-
"aria-label":
|
|
197
|
+
open: te == "rename",
|
|
198
|
+
children: [/* @__PURE__ */ H(b, {
|
|
199
|
+
render: /* @__PURE__ */ H(s, {
|
|
200
|
+
"aria-label": T("sidebar.renameFlow", { name: n.name }),
|
|
201
201
|
className: "resource-rename-trigger",
|
|
202
202
|
size: "icon-xs",
|
|
203
203
|
type: "button",
|
|
204
204
|
variant: "ghost"
|
|
205
205
|
}),
|
|
206
|
-
children: /* @__PURE__ */
|
|
206
|
+
children: /* @__PURE__ */ H("i", {
|
|
207
207
|
"aria-hidden": "true",
|
|
208
208
|
className: "i-lucide-light:pencil"
|
|
209
209
|
})
|
|
210
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ U(d, {
|
|
211
211
|
align: "start",
|
|
212
|
-
alignOffset:
|
|
212
|
+
alignOffset: It,
|
|
213
213
|
anchor: h,
|
|
214
214
|
className: "resource-rename-popover",
|
|
215
215
|
collisionBoundary: [],
|
|
@@ -217,84 +217,84 @@ function Rt({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: u }) {
|
|
|
217
217
|
initialFocus: C,
|
|
218
218
|
positionMethod: "fixed",
|
|
219
219
|
side: "top",
|
|
220
|
-
sideOffset: ({ anchor: e, positioner: t }) => -(e.height + t.height) / 2 -
|
|
221
|
-
children: [/* @__PURE__ */
|
|
220
|
+
sideOffset: ({ anchor: e, positioner: t }) => -(e.height + t.height) / 2 - Lt,
|
|
221
|
+
children: [/* @__PURE__ */ H(m, {
|
|
222
222
|
className: "sr-only",
|
|
223
|
-
children:
|
|
224
|
-
}), /* @__PURE__ */
|
|
223
|
+
children: T("sidebar.renameFlow", { name: n.name })
|
|
224
|
+
}), /* @__PURE__ */ U("form", {
|
|
225
225
|
className: "resource-rename-form",
|
|
226
|
-
onSubmit: (e) => void
|
|
226
|
+
onSubmit: (e) => void se(e),
|
|
227
227
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ U(ot, {
|
|
229
229
|
className: "min-w-0 flex-1",
|
|
230
|
-
"data-invalid":
|
|
230
|
+
"data-invalid": D.length > 0 && N != null,
|
|
231
231
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ H(st, {
|
|
233
233
|
className: "sr-only",
|
|
234
234
|
htmlFor: `rename-flow-${n.flowId}`,
|
|
235
|
-
children:
|
|
235
|
+
children: T("resource.flowName")
|
|
236
236
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ H(l, {
|
|
238
238
|
autoComplete: "off",
|
|
239
|
-
"aria-invalid":
|
|
240
|
-
"aria-describedby":
|
|
239
|
+
"aria-invalid": D.length > 0 && N != null,
|
|
240
|
+
"aria-describedby": D.length > 0 && N != null ? `rename-error-${n.flowId}` : void 0,
|
|
241
241
|
id: `rename-flow-${n.flowId}`,
|
|
242
242
|
name: "flow-name",
|
|
243
|
-
onChange: (e) =>
|
|
243
|
+
onChange: (e) => ne(e.target.value),
|
|
244
244
|
ref: C,
|
|
245
245
|
required: !0,
|
|
246
|
-
value:
|
|
246
|
+
value: D
|
|
247
247
|
}),
|
|
248
|
-
|
|
248
|
+
D.length > 0 && N != null && /* @__PURE__ */ H(dt, {
|
|
249
249
|
id: `rename-error-${n.flowId}`,
|
|
250
|
-
children:
|
|
250
|
+
children: T(`resource.nameIssue.${N}`, { max: 80 })
|
|
251
251
|
})
|
|
252
252
|
]
|
|
253
253
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
-
onClick: () =>
|
|
254
|
+
/* @__PURE__ */ H(s, {
|
|
255
|
+
onClick: () => E("idle"),
|
|
256
256
|
size: "sm",
|
|
257
257
|
type: "button",
|
|
258
258
|
variant: "ghost",
|
|
259
|
-
children:
|
|
259
|
+
children: T("common.cancel")
|
|
260
260
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
disabled: t != null ||
|
|
261
|
+
/* @__PURE__ */ H(s, {
|
|
262
|
+
disabled: t != null || N != null,
|
|
263
263
|
size: "sm",
|
|
264
264
|
type: "submit",
|
|
265
|
-
children:
|
|
265
|
+
children: T("common.save")
|
|
266
266
|
})
|
|
267
267
|
]
|
|
268
268
|
})]
|
|
269
269
|
})]
|
|
270
270
|
})]
|
|
271
|
-
}), e != null && /* @__PURE__ */
|
|
271
|
+
}), e != null && /* @__PURE__ */ H("span", {
|
|
272
272
|
className: "resource-team-label",
|
|
273
273
|
title: e,
|
|
274
274
|
children: e
|
|
275
275
|
})]
|
|
276
276
|
})]
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ H("span", {
|
|
279
279
|
className: "resource-flow-id-cell",
|
|
280
|
-
children: /* @__PURE__ */
|
|
281
|
-
render: /* @__PURE__ */
|
|
280
|
+
children: /* @__PURE__ */ U(x, { children: [/* @__PURE__ */ H(_, {
|
|
281
|
+
render: /* @__PURE__ */ H("code", {
|
|
282
282
|
className: "resource-flow-id",
|
|
283
283
|
tabIndex: 0,
|
|
284
284
|
translate: "no"
|
|
285
285
|
}),
|
|
286
|
-
children:
|
|
287
|
-
}), /* @__PURE__ */
|
|
286
|
+
children: Bt(n.flowId)
|
|
287
|
+
}), /* @__PURE__ */ U(v, {
|
|
288
288
|
align: "start",
|
|
289
|
-
alignOffset:
|
|
289
|
+
alignOffset: Ft,
|
|
290
290
|
className: "resource-flow-id-tooltip",
|
|
291
291
|
collisionBoundary: [],
|
|
292
292
|
container: f,
|
|
293
293
|
positionMethod: "fixed",
|
|
294
294
|
side: "top",
|
|
295
295
|
sideOffset: 6,
|
|
296
|
-
children: [/* @__PURE__ */
|
|
297
|
-
"aria-label":
|
|
296
|
+
children: [/* @__PURE__ */ H(s, {
|
|
297
|
+
"aria-label": T(O ? "resource.flowIdCopied" : "resource.copyFlowId"),
|
|
298
298
|
className: "resource-tooltip-icon-button",
|
|
299
299
|
onClick: () => {
|
|
300
300
|
navigator.clipboard.writeText(n.flowId).then(() => k(!0));
|
|
@@ -302,206 +302,206 @@ function Rt({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: u }) {
|
|
|
302
302
|
size: "icon-xs",
|
|
303
303
|
type: "button",
|
|
304
304
|
variant: "ghost",
|
|
305
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: /* @__PURE__ */ H("i", {
|
|
306
306
|
"aria-hidden": "true",
|
|
307
307
|
className: "i-lucide-light:copy"
|
|
308
308
|
})
|
|
309
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ H("code", {
|
|
310
310
|
translate: "no",
|
|
311
311
|
children: n.flowId
|
|
312
312
|
})]
|
|
313
313
|
})] })
|
|
314
314
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
render: /* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ U(x, { children: [/* @__PURE__ */ H(_, {
|
|
316
|
+
render: /* @__PURE__ */ H("time", {
|
|
317
317
|
className: "resource-updated-at",
|
|
318
318
|
dateTime: n.updatedAt,
|
|
319
319
|
tabIndex: 0
|
|
320
320
|
}),
|
|
321
|
-
children:
|
|
322
|
-
}), /* @__PURE__ */
|
|
321
|
+
children: Vt(n.updatedAt, ee)
|
|
322
|
+
}), /* @__PURE__ */ H(v, {
|
|
323
323
|
align: "center",
|
|
324
324
|
collisionBoundary: [],
|
|
325
325
|
container: f,
|
|
326
326
|
positionMethod: "fixed",
|
|
327
327
|
side: "top",
|
|
328
328
|
sideOffset: 6,
|
|
329
|
-
children: new Date(n.updatedAt).toLocaleString(
|
|
329
|
+
children: new Date(n.updatedAt).toLocaleString(ee)
|
|
330
330
|
})] }),
|
|
331
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ U("span", {
|
|
332
332
|
className: "resource-status",
|
|
333
333
|
children: [
|
|
334
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ H("span", {
|
|
335
335
|
"aria-hidden": "true",
|
|
336
|
-
className: c("status-dot",
|
|
336
|
+
className: c("status-dot", M)
|
|
337
337
|
}),
|
|
338
|
-
|
|
339
|
-
n.live != null && /* @__PURE__ */
|
|
338
|
+
T(ae),
|
|
339
|
+
n.live != null && /* @__PURE__ */ U(Ct, { children: [/* @__PURE__ */ H("span", {
|
|
340
340
|
"aria-hidden": "true",
|
|
341
341
|
className: "resource-status-separator",
|
|
342
342
|
children: "·"
|
|
343
|
-
}), /* @__PURE__ */
|
|
343
|
+
}), /* @__PURE__ */ H("span", { children: T(n.live.enabled ? "resource.enabled" : "resource.disabled") })] })
|
|
344
344
|
]
|
|
345
345
|
})
|
|
346
346
|
]
|
|
347
347
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ U("div", {
|
|
349
349
|
className: "resource-live-controls",
|
|
350
350
|
"aria-busy": A != null,
|
|
351
|
-
onClick:
|
|
351
|
+
onClick: P,
|
|
352
352
|
children: [
|
|
353
|
-
n.live != null && /* @__PURE__ */
|
|
354
|
-
"aria-label":
|
|
353
|
+
n.live != null && /* @__PURE__ */ H(S, {
|
|
354
|
+
"aria-label": T("resource.enableFlow", { name: n.name }),
|
|
355
355
|
checked: n.live.enabled,
|
|
356
356
|
disabled: n.status != "active" || t != null || A != null,
|
|
357
|
-
onCheckedChange: (e) => void
|
|
357
|
+
onCheckedChange: (e) => void oe(e),
|
|
358
358
|
size: "sm",
|
|
359
|
-
title:
|
|
359
|
+
title: T("resource.enabledHint")
|
|
360
360
|
}),
|
|
361
|
-
n.status == "active" && /* @__PURE__ */
|
|
361
|
+
n.status == "active" && /* @__PURE__ */ H(s, {
|
|
362
362
|
onClick: () => o(n),
|
|
363
363
|
size: "sm",
|
|
364
364
|
variant: "outline",
|
|
365
|
-
children:
|
|
365
|
+
children: T("resource.edit")
|
|
366
366
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
disabled: n.status != "active" || t != null || A != null || n.live != null && !
|
|
369
|
-
onClick: () => void
|
|
367
|
+
/* @__PURE__ */ H(s, {
|
|
368
|
+
disabled: n.status != "active" || t != null || A != null || n.live != null && !j,
|
|
369
|
+
onClick: () => void oe("publish"),
|
|
370
370
|
size: "sm",
|
|
371
371
|
variant: "outline",
|
|
372
|
-
children:
|
|
372
|
+
children: T(A == "publish" ? "workspace.publishing" : n.live == null ? "resource.publish" : "resource.publishUpdate")
|
|
373
373
|
}),
|
|
374
|
-
n.status == "active" && /* @__PURE__ */
|
|
375
|
-
render: /* @__PURE__ */
|
|
376
|
-
"aria-label":
|
|
374
|
+
n.status == "active" && /* @__PURE__ */ U(x, { children: [/* @__PURE__ */ H(_, {
|
|
375
|
+
render: /* @__PURE__ */ H(s, {
|
|
376
|
+
"aria-label": T("sidebar.deleteFlow", { name: n.name }),
|
|
377
377
|
ref: y,
|
|
378
378
|
disabled: t != null || A != null,
|
|
379
|
-
onClick: () =>
|
|
379
|
+
onClick: () => E("delete"),
|
|
380
380
|
size: "icon-sm",
|
|
381
381
|
variant: "destructive"
|
|
382
382
|
}),
|
|
383
|
-
children: /* @__PURE__ */
|
|
383
|
+
children: /* @__PURE__ */ H("i", {
|
|
384
384
|
"aria-hidden": "true",
|
|
385
385
|
className: "i-lucide-light:trash-2"
|
|
386
386
|
})
|
|
387
|
-
}), /* @__PURE__ */
|
|
387
|
+
}), /* @__PURE__ */ H(v, {
|
|
388
388
|
align: "center",
|
|
389
389
|
collisionBoundary: [],
|
|
390
390
|
container: f,
|
|
391
391
|
positionMethod: "fixed",
|
|
392
392
|
side: "top",
|
|
393
|
-
children:
|
|
393
|
+
children: T("common.delete")
|
|
394
394
|
})] })
|
|
395
395
|
]
|
|
396
396
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
open:
|
|
397
|
+
/* @__PURE__ */ H(mt, {
|
|
398
|
+
open: te == "delete",
|
|
399
399
|
onOpenChange: (e) => {
|
|
400
|
-
e ||
|
|
400
|
+
e || E("idle");
|
|
401
401
|
},
|
|
402
|
-
children: /* @__PURE__ */
|
|
402
|
+
children: /* @__PURE__ */ U(rt, {
|
|
403
403
|
container: f,
|
|
404
404
|
initialFocus: w,
|
|
405
405
|
finalFocus: y,
|
|
406
406
|
showCloseButton: !1,
|
|
407
|
-
children: [/* @__PURE__ */
|
|
408
|
-
render: /* @__PURE__ */
|
|
407
|
+
children: [/* @__PURE__ */ U(it, { children: [/* @__PURE__ */ H(ut, { children: T("sidebar.deleteFlowConfirm", { name: n.name }) }), /* @__PURE__ */ H(pt, { children: T("resource.deleteDescription") })] }), /* @__PURE__ */ U(ht, { children: [/* @__PURE__ */ H(lt, {
|
|
408
|
+
render: /* @__PURE__ */ H(s, {
|
|
409
409
|
ref: w,
|
|
410
410
|
variant: "outline"
|
|
411
411
|
}),
|
|
412
|
-
children:
|
|
413
|
-
}), /* @__PURE__ */
|
|
412
|
+
children: T("common.cancel")
|
|
413
|
+
}), /* @__PURE__ */ H(s, {
|
|
414
414
|
disabled: t != null,
|
|
415
|
-
onClick: () => void
|
|
415
|
+
onClick: () => void ce(),
|
|
416
416
|
variant: "destructive",
|
|
417
|
-
children:
|
|
417
|
+
children: T(t == "flow" ? "common.deleting" : "common.delete")
|
|
418
418
|
})] })]
|
|
419
419
|
})
|
|
420
420
|
})
|
|
421
421
|
]
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
return /* @__PURE__ */
|
|
424
|
+
function Wt() {
|
|
425
|
+
return /* @__PURE__ */ U("div", {
|
|
426
426
|
"aria-hidden": "true",
|
|
427
427
|
className: "resource-item-row",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ U("div", {
|
|
429
429
|
className: "resource-list-row resource-skeleton-row flow-columns",
|
|
430
430
|
children: [
|
|
431
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ U("span", {
|
|
432
432
|
className: "resource-skeleton-copy",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
433
|
+
children: [/* @__PURE__ */ H(M, { className: "h-3.5 w-36 max-w-full" }), /* @__PURE__ */ H(M, { className: "h-3 w-24 max-w-full" })]
|
|
434
434
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ H(M, { className: "h-3 w-36 max-w-full" }),
|
|
436
|
+
/* @__PURE__ */ H(M, { className: "h-3 w-28 max-w-full" }),
|
|
437
|
+
/* @__PURE__ */ H(M, { className: "h-3 w-16" })
|
|
438
438
|
]
|
|
439
|
-
}), /* @__PURE__ */
|
|
439
|
+
}), /* @__PURE__ */ U("div", {
|
|
440
440
|
className: "resource-live-controls",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ H(M, { className: "h-7 w-16" }), /* @__PURE__ */ H(M, { className: "h-7 w-14" })]
|
|
442
442
|
})]
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
let b = i(), x = r(v.workspace.$.busy), S = r(v.workspace.$.flowLoadFailed), C = r(v.workspace.$.flowLoadMoreFailed),
|
|
447
|
-
async function
|
|
445
|
+
function Gt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: a, hrefForFlow: o, hostAction: l, hostTitle: u, language: d, onCreateFlow: m, onHostAction: h, onLanguageChange: g, onSelectFlow: _, store: v }) {
|
|
446
|
+
let b = i(), x = r(v.workspace.$.busy), S = r(v.workspace.$.flowLoadFailed), C = r(v.workspace.$.flowLoadMoreFailed), w = r(v.workspace.$.flowLoading), T = r(v.workspace.$.flowLoadingMore), te = r(v.workspace.$.flowNextCursor), E = r(v.workspace.$.flowRefreshing), ne = r(v.workspace.$.flows), re = r(v.workspace.$.flowTotal), [O, k] = W(!1), [A, ie] = W(""), [j, ae] = W(""), M = A.trim().toLocaleLowerCase(), oe = ne.filter((e) => e.name.toLocaleLowerCase().includes(M));
|
|
447
|
+
async function N(e) {
|
|
448
448
|
e.preventDefault();
|
|
449
|
-
let t =
|
|
450
|
-
|
|
449
|
+
let t = j.trim();
|
|
450
|
+
vt(t) != null || !await m(t) || (k(!1), ae(""));
|
|
451
451
|
}
|
|
452
|
-
return /* @__PURE__ */
|
|
452
|
+
return /* @__PURE__ */ H("main", {
|
|
453
453
|
className: "resource-browser",
|
|
454
454
|
"data-tooltip-portal": !0,
|
|
455
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ U("div", {
|
|
456
456
|
className: c("resource-page", e != "default" && "resource-page-full"),
|
|
457
457
|
children: [
|
|
458
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ H("h1", {
|
|
459
459
|
className: "sr-only",
|
|
460
460
|
children: b("resource.flows")
|
|
461
461
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ U("section", {
|
|
463
463
|
"aria-labelledby": "flow-list-title",
|
|
464
464
|
className: "resource-list-section rounded-lg",
|
|
465
465
|
children: [
|
|
466
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ U("div", {
|
|
467
467
|
className: "resource-list-title",
|
|
468
|
-
children: [/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ U("div", {
|
|
469
469
|
className: "resource-list-heading",
|
|
470
|
-
children: [/* @__PURE__ */
|
|
470
|
+
children: [/* @__PURE__ */ H("h2", {
|
|
471
471
|
id: "flow-list-title",
|
|
472
472
|
children: b("resource.all")
|
|
473
|
-
}), !
|
|
474
|
-
}), /* @__PURE__ */
|
|
473
|
+
}), !w && /* @__PURE__ */ H("span", { children: b("resource.flowCount", { count: re ?? ne.length }) })]
|
|
474
|
+
}), /* @__PURE__ */ U("div", {
|
|
475
475
|
className: "resource-list-actions",
|
|
476
476
|
children: [
|
|
477
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ H(zt, {
|
|
478
478
|
language: d,
|
|
479
479
|
onLanguageChange: g
|
|
480
480
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ U(y, {
|
|
482
482
|
className: "w-full sm:w-56",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
483
|
+
children: [/* @__PURE__ */ H(f, { children: /* @__PURE__ */ H(ft, {
|
|
484
484
|
name: "search",
|
|
485
485
|
size: 17
|
|
486
|
-
}) }), /* @__PURE__ */
|
|
486
|
+
}) }), /* @__PURE__ */ H(p, {
|
|
487
487
|
autoComplete: "off",
|
|
488
488
|
"aria-label": b("resource.searchByName"),
|
|
489
489
|
name: "flow-search",
|
|
490
|
-
onChange: (e) =>
|
|
490
|
+
onChange: (e) => ie(e.target.value),
|
|
491
491
|
placeholder: b("resource.searchByName"),
|
|
492
|
-
value:
|
|
492
|
+
value: A
|
|
493
493
|
})]
|
|
494
494
|
}),
|
|
495
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ U(s, {
|
|
496
496
|
className: "pr-3",
|
|
497
497
|
disabled: x != null,
|
|
498
|
-
onClick: () =>
|
|
499
|
-
children: [/* @__PURE__ */
|
|
498
|
+
onClick: () => k(!0),
|
|
499
|
+
children: [/* @__PURE__ */ H(ft, {
|
|
500
500
|
"data-icon": "inline-start",
|
|
501
501
|
name: "plus"
|
|
502
502
|
}), b("resource.newFlow")]
|
|
503
503
|
}),
|
|
504
|
-
l != null && u != null && h != null && /* @__PURE__ */
|
|
504
|
+
l != null && u != null && h != null && /* @__PURE__ */ H(qe, {
|
|
505
505
|
action: l,
|
|
506
506
|
onAction: h,
|
|
507
507
|
title: u
|
|
@@ -509,69 +509,69 @@ function Bt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
509
509
|
]
|
|
510
510
|
})]
|
|
511
511
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ U("div", {
|
|
513
513
|
"aria-hidden": "true",
|
|
514
514
|
className: "resource-list-columns-shell",
|
|
515
|
-
children: [/* @__PURE__ */
|
|
515
|
+
children: [/* @__PURE__ */ U("div", {
|
|
516
516
|
className: "resource-list-columns flow-columns",
|
|
517
517
|
children: [
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ H("span", { children: b("resource.name") }),
|
|
519
|
+
/* @__PURE__ */ H("span", {
|
|
520
520
|
className: "resource-flow-id-heading",
|
|
521
521
|
children: b("resource.flowId")
|
|
522
522
|
}),
|
|
523
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ H("span", {
|
|
524
524
|
className: "resource-updated-heading",
|
|
525
525
|
children: b("resource.updated")
|
|
526
526
|
}),
|
|
527
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ H("span", { children: b("resource.status") })
|
|
528
528
|
]
|
|
529
|
-
}), /* @__PURE__ */
|
|
529
|
+
}), /* @__PURE__ */ H("span", {
|
|
530
530
|
className: "resource-actions-heading",
|
|
531
531
|
children: b("resource.actions")
|
|
532
532
|
})]
|
|
533
533
|
}),
|
|
534
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ H("div", {
|
|
535
535
|
className: "resource-list",
|
|
536
|
-
children:
|
|
536
|
+
children: w ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ H(Wt, {}, t)) : S ? /* @__PURE__ */ U(Qe, {
|
|
537
537
|
className: "min-h-64",
|
|
538
538
|
role: "alert",
|
|
539
|
-
children: [/* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
539
|
+
children: [/* @__PURE__ */ U(D, { children: [
|
|
540
|
+
/* @__PURE__ */ H(ce, {
|
|
541
541
|
variant: "icon",
|
|
542
|
-
children: /* @__PURE__ */
|
|
542
|
+
children: /* @__PURE__ */ H(ft, {
|
|
543
543
|
name: "alert",
|
|
544
544
|
size: 20
|
|
545
545
|
})
|
|
546
546
|
}),
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
] }), /* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ H(de, { children: b("resource.flowsLoadFailed") }),
|
|
548
|
+
/* @__PURE__ */ H(le, { children: b("resource.flowsLoadFailedDescription") })
|
|
549
|
+
] }), /* @__PURE__ */ H(ee, { children: /* @__PURE__ */ H(s, {
|
|
550
550
|
onClick: () => void v.retryFlows(),
|
|
551
551
|
variant: "outline",
|
|
552
552
|
children: b("empty.retry")
|
|
553
553
|
}) })]
|
|
554
|
-
}) :
|
|
554
|
+
}) : oe.length == 0 ? /* @__PURE__ */ U(Qe, {
|
|
555
555
|
className: "min-h-64",
|
|
556
|
-
children: [/* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
556
|
+
children: [/* @__PURE__ */ U(D, { children: [
|
|
557
|
+
/* @__PURE__ */ H(ce, {
|
|
558
558
|
variant: "icon",
|
|
559
|
-
children: /* @__PURE__ */
|
|
559
|
+
children: /* @__PURE__ */ H(ft, {
|
|
560
560
|
name: "flow",
|
|
561
561
|
size: 20
|
|
562
562
|
})
|
|
563
563
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
] }),
|
|
567
|
-
onClick: () =>
|
|
564
|
+
/* @__PURE__ */ H(de, { children: b(M.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
|
|
565
|
+
/* @__PURE__ */ H(le, { children: b(M.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
|
|
566
|
+
] }), M.length == 0 && /* @__PURE__ */ H(ee, { children: /* @__PURE__ */ U(s, {
|
|
567
|
+
onClick: () => k(!0),
|
|
568
568
|
variant: "outline",
|
|
569
|
-
children: [/* @__PURE__ */
|
|
569
|
+
children: [/* @__PURE__ */ H(ft, {
|
|
570
570
|
"data-icon": "inline-start",
|
|
571
571
|
name: "plus"
|
|
572
572
|
}), b("resource.newFlow")]
|
|
573
573
|
}) })]
|
|
574
|
-
}) :
|
|
574
|
+
}) : oe.map((e) => /* @__PURE__ */ H(Ut, {
|
|
575
575
|
badge: a?.[e.flowId],
|
|
576
576
|
busy: x,
|
|
577
577
|
flow: e,
|
|
@@ -580,29 +580,29 @@ function Bt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
580
580
|
store: v
|
|
581
581
|
}, e.flowId))
|
|
582
582
|
}),
|
|
583
|
-
|
|
583
|
+
te != null && /* @__PURE__ */ H("div", {
|
|
584
584
|
className: "resource-list-footer",
|
|
585
|
-
children: /* @__PURE__ */
|
|
586
|
-
disabled:
|
|
585
|
+
children: /* @__PURE__ */ H(s, {
|
|
586
|
+
disabled: T || E,
|
|
587
587
|
onClick: () => void v.workspace.loadMoreFlows(),
|
|
588
588
|
variant: "outline",
|
|
589
|
-
children: b(
|
|
589
|
+
children: b(T ? "resource.loadingMore" : C ? "resource.retryLoadMore" : "resource.loadMore")
|
|
590
590
|
})
|
|
591
591
|
})
|
|
592
592
|
]
|
|
593
593
|
}),
|
|
594
|
-
|
|
594
|
+
O && /* @__PURE__ */ H(wt, {
|
|
595
595
|
fallback: null,
|
|
596
|
-
children: /* @__PURE__ */
|
|
596
|
+
children: /* @__PURE__ */ H(Nt, {
|
|
597
597
|
disabled: t,
|
|
598
598
|
field: n,
|
|
599
599
|
id: "flow-name",
|
|
600
|
-
issue:
|
|
600
|
+
issue: vt(j),
|
|
601
601
|
label: b("resource.flowName"),
|
|
602
|
-
name:
|
|
602
|
+
name: j,
|
|
603
603
|
onNameChange: ae,
|
|
604
|
-
onOpenChange:
|
|
605
|
-
onSubmit: (e) => void
|
|
604
|
+
onOpenChange: k,
|
|
605
|
+
onSubmit: (e) => void N(e),
|
|
606
606
|
pending: x == "flow",
|
|
607
607
|
title: b("resource.newFlow")
|
|
608
608
|
})
|
|
@@ -613,28 +613,28 @@ function Bt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
613
613
|
}
|
|
614
614
|
//#endregion
|
|
615
615
|
//#region ../../node_modules/.bun/dequal@2.0.3/node_modules/dequal/dist/index.mjs
|
|
616
|
-
var
|
|
617
|
-
function
|
|
618
|
-
for (n of e.keys()) if (
|
|
616
|
+
var Kt = Object.prototype.hasOwnProperty;
|
|
617
|
+
function qt(e, t, n) {
|
|
618
|
+
for (n of e.keys()) if (K(n, t)) return n;
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function K(e, t) {
|
|
621
621
|
var n, r, i;
|
|
622
622
|
if (e === t) return !0;
|
|
623
623
|
if (e && t && (n = e.constructor) === t.constructor) {
|
|
624
624
|
if (n === Date) return e.getTime() === t.getTime();
|
|
625
625
|
if (n === RegExp) return e.toString() === t.toString();
|
|
626
626
|
if (n === Array) {
|
|
627
|
-
if ((r = e.length) === t.length) for (; r-- &&
|
|
627
|
+
if ((r = e.length) === t.length) for (; r-- && K(e[r], t[r]););
|
|
628
628
|
return r === -1;
|
|
629
629
|
}
|
|
630
630
|
if (n === Set) {
|
|
631
631
|
if (e.size !== t.size) return !1;
|
|
632
|
-
for (r of e) if (i = r, i && typeof i == "object" && (i =
|
|
632
|
+
for (r of e) if (i = r, i && typeof i == "object" && (i = qt(t, i), !i) || !t.has(i)) return !1;
|
|
633
633
|
return !0;
|
|
634
634
|
}
|
|
635
635
|
if (n === Map) {
|
|
636
636
|
if (e.size !== t.size) return !1;
|
|
637
|
-
for (r of e) if (i = r[0], i && typeof i == "object" && (i =
|
|
637
|
+
for (r of e) if (i = r[0], i && typeof i == "object" && (i = qt(t, i), !i) || !K(r[1], t.get(i))) return !1;
|
|
638
638
|
return !0;
|
|
639
639
|
}
|
|
640
640
|
if (n === ArrayBuffer) e = new Uint8Array(e), t = new Uint8Array(t);
|
|
@@ -647,7 +647,7 @@ function Ut(e, t) {
|
|
|
647
647
|
return r === -1;
|
|
648
648
|
}
|
|
649
649
|
if (!n || typeof e == "object") {
|
|
650
|
-
for (n in r = 0, e) if (
|
|
650
|
+
for (n in r = 0, e) if (Kt.call(e, n) && ++r && !Kt.call(t, n) || !(n in t) || !K(e[n], t[n])) return !1;
|
|
651
651
|
return Object.keys(t).length === r;
|
|
652
652
|
}
|
|
653
653
|
}
|
|
@@ -655,7 +655,7 @@ function Ut(e, t) {
|
|
|
655
655
|
}
|
|
656
656
|
//#endregion
|
|
657
657
|
//#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
|
|
658
|
-
var
|
|
658
|
+
var Jt = (e) => crypto.getRandomValues(new Uint8Array(e)), Yt = (e, t, n) => {
|
|
659
659
|
let r = 256 - 256 % e.length;
|
|
660
660
|
if (r === 256) {
|
|
661
661
|
let r = e.length - 1;
|
|
@@ -677,29 +677,29 @@ var Wt = (e) => crypto.getRandomValues(new Uint8Array(e)), Gt = (e, t, n) => {
|
|
|
677
677
|
for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
|
|
678
678
|
}
|
|
679
679
|
};
|
|
680
|
-
},
|
|
680
|
+
}, Xt = (e, t = 21) => Yt(e, t | 0, Jt);
|
|
681
681
|
//#endregion
|
|
682
682
|
//#region src/flow/common/edgeChanges.ts
|
|
683
|
-
function
|
|
684
|
-
return
|
|
683
|
+
function Zt(e, t, n) {
|
|
684
|
+
return $t(e, t)?.edges.some((e) => u(e, n)) ? [] : [{
|
|
685
685
|
edge: n,
|
|
686
686
|
kind: "graph.edge.connect",
|
|
687
687
|
target: t
|
|
688
688
|
}];
|
|
689
689
|
}
|
|
690
|
-
function
|
|
691
|
-
return
|
|
690
|
+
function Qt(e, t, n) {
|
|
691
|
+
return $t(e, t)?.edges.some((e) => u(e, n)) ? [{
|
|
692
692
|
edge: n,
|
|
693
693
|
kind: "graph.edge.disconnect",
|
|
694
694
|
target: t
|
|
695
695
|
}] : [];
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function $t(e, t) {
|
|
698
698
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
699
699
|
}
|
|
700
700
|
//#endregion
|
|
701
701
|
//#region src/flow/common/moduleChanges.ts
|
|
702
|
-
async function
|
|
702
|
+
async function en(e) {
|
|
703
703
|
try {
|
|
704
704
|
let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
|
|
705
705
|
errorRecovery: !0,
|
|
@@ -715,7 +715,7 @@ async function Xt(e) {
|
|
|
715
715
|
return [];
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function tn(e, t, n, r, i) {
|
|
719
719
|
return [{
|
|
720
720
|
beforeImports: n,
|
|
721
721
|
beforeSource: t,
|
|
@@ -725,51 +725,51 @@ function Zt(e, t, n, r, i) {
|
|
|
725
725
|
source: r
|
|
726
726
|
}];
|
|
727
727
|
}
|
|
728
|
-
var
|
|
728
|
+
var nn = Xt("23456789abcdefghjkmnpqrstuvwxyz", 10);
|
|
729
729
|
//#endregion
|
|
730
730
|
//#region src/workbench/browser/runtime/canvasPresentation.ts
|
|
731
|
-
function
|
|
731
|
+
function q(e) {
|
|
732
732
|
if (!(typeof e != "object" || !e || Array.isArray(e))) return e;
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function rn(e) {
|
|
735
735
|
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
738
|
-
let n =
|
|
739
|
-
if (n?.version == 1) return
|
|
737
|
+
function J(e, t) {
|
|
738
|
+
let n = q(e.designer);
|
|
739
|
+
if (n?.version == 1) return ln(n, t);
|
|
740
740
|
}
|
|
741
|
-
function
|
|
742
|
-
return ((e) => Object.fromEntries(Object.entries(
|
|
743
|
-
let n =
|
|
741
|
+
function an(e, t) {
|
|
742
|
+
return ((e) => Object.fromEntries(Object.entries(q(e) ?? {}).flatMap(([e, t]) => {
|
|
743
|
+
let n = q(t), r = rn(n?.x), i = rn(n?.y);
|
|
744
744
|
return r == null || i == null ? [] : [[e, {
|
|
745
745
|
x: r,
|
|
746
746
|
y: i
|
|
747
747
|
}]];
|
|
748
|
-
})))(
|
|
748
|
+
})))(J(e, t)?.nodes);
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
let n =
|
|
750
|
+
function Y(e, t) {
|
|
751
|
+
let n = an(e, t), r = J(e, t)?.order, i = Array.isArray(r) ? r.flatMap((e) => typeof e == "string" && n[e] != null ? [e] : []) : [];
|
|
752
752
|
return [.../* @__PURE__ */ new Set([...i, ...Object.keys(n)])];
|
|
753
753
|
}
|
|
754
|
-
function
|
|
755
|
-
let n =
|
|
754
|
+
function on(e, t) {
|
|
755
|
+
let n = q(J(e, t)?.viewport), r = rn(n?.x), i = rn(n?.y), a = rn(n?.zoom);
|
|
756
756
|
return r == null || i == null || a == null || a <= 0 ? void 0 : {
|
|
757
757
|
x: r,
|
|
758
758
|
y: i,
|
|
759
759
|
zoom: a
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
return
|
|
762
|
+
function sn(e, t) {
|
|
763
|
+
return on(e, t) ?? {
|
|
764
764
|
x: 0,
|
|
765
765
|
y: 0,
|
|
766
766
|
zoom: 1
|
|
767
767
|
};
|
|
768
768
|
}
|
|
769
|
-
function
|
|
770
|
-
let r =
|
|
769
|
+
function cn(e, t, n) {
|
|
770
|
+
let r = q(J(e, t)?.comments) ?? {};
|
|
771
771
|
return Object.fromEntries(Object.entries(r).flatMap(([e, t]) => {
|
|
772
|
-
let r =
|
|
772
|
+
let r = q(t), i = typeof r?.title == "string" ? r.title : void 0, a = typeof r?.content == "string" ? r.content : void 0;
|
|
773
773
|
return i == null || a == null ? [] : [[e, {
|
|
774
774
|
content: a,
|
|
775
775
|
position: n[e] ?? {
|
|
@@ -780,20 +780,20 @@ function rn(e, t, n) {
|
|
|
780
780
|
}]];
|
|
781
781
|
}));
|
|
782
782
|
}
|
|
783
|
-
function
|
|
784
|
-
let t =
|
|
783
|
+
function X(e) {
|
|
784
|
+
let t = q(e.designer);
|
|
785
785
|
return t?.version == 1 ? t : { version: 1 };
|
|
786
786
|
}
|
|
787
|
-
function
|
|
788
|
-
return t.kind == "flow" ?
|
|
787
|
+
function ln(e, t) {
|
|
788
|
+
return t.kind == "flow" ? q(e.flow) : q(q(e.subflows)?.[t.id]);
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function Z(e, t, n) {
|
|
791
791
|
if (t.kind == "flow") return {
|
|
792
792
|
...e,
|
|
793
793
|
flow: n,
|
|
794
794
|
version: 1
|
|
795
795
|
};
|
|
796
|
-
let r =
|
|
796
|
+
let r = q(e.subflows) ?? {};
|
|
797
797
|
return {
|
|
798
798
|
...e,
|
|
799
799
|
subflows: {
|
|
@@ -803,17 +803,17 @@ function sn(e, t, n) {
|
|
|
803
803
|
version: 1
|
|
804
804
|
};
|
|
805
805
|
}
|
|
806
|
-
function
|
|
806
|
+
function Q(e, t) {
|
|
807
807
|
let n = {
|
|
808
|
-
...
|
|
809
|
-
viewport: { ...
|
|
810
|
-
nodes:
|
|
811
|
-
order:
|
|
808
|
+
...J(e, t),
|
|
809
|
+
viewport: { ...sn(e, t) },
|
|
810
|
+
nodes: an(e, t),
|
|
811
|
+
order: Y(e, t)
|
|
812
812
|
};
|
|
813
813
|
return delete n.layouts, n;
|
|
814
814
|
}
|
|
815
|
-
function
|
|
816
|
-
let r =
|
|
815
|
+
function un(e, t, n) {
|
|
816
|
+
let r = X(e), i = Q(e, t), a = q(i.nodes) ?? {}, o = [...Y(e, t)];
|
|
817
817
|
for (let e of Object.keys(n)) o.includes(e) || o.push(e);
|
|
818
818
|
let s = {
|
|
819
819
|
...a,
|
|
@@ -824,29 +824,29 @@ function cn(e, t, n) {
|
|
|
824
824
|
};
|
|
825
825
|
return {
|
|
826
826
|
...e,
|
|
827
|
-
designer:
|
|
827
|
+
designer: Z(r, t, {
|
|
828
828
|
...i,
|
|
829
829
|
nodes: s,
|
|
830
830
|
order: o
|
|
831
831
|
})
|
|
832
832
|
};
|
|
833
833
|
}
|
|
834
|
-
function
|
|
835
|
-
if (
|
|
836
|
-
let i =
|
|
834
|
+
function dn(e, t, n, r) {
|
|
835
|
+
if (q(J(e, t)?.hiddenNodeContent)?.[n] === !0 === r) return e;
|
|
836
|
+
let i = Q(e, t), a = { ...q(i.hiddenNodeContent) };
|
|
837
837
|
return r ? a[n] = !0 : delete a[n], {
|
|
838
838
|
...e,
|
|
839
|
-
designer:
|
|
839
|
+
designer: Z(X(e), t, {
|
|
840
840
|
...i,
|
|
841
841
|
hiddenNodeContent: a
|
|
842
842
|
})
|
|
843
843
|
};
|
|
844
844
|
}
|
|
845
|
-
function
|
|
846
|
-
let i =
|
|
845
|
+
function fn(e, t, n, r) {
|
|
846
|
+
let i = un(e, t, { [n]: r.position }), a = X(i), o = ln(a, t) ?? {}, s = q(o.comments) ?? {};
|
|
847
847
|
return {
|
|
848
848
|
...i,
|
|
849
|
-
designer:
|
|
849
|
+
designer: Z(a, t, {
|
|
850
850
|
...o,
|
|
851
851
|
comments: {
|
|
852
852
|
...s,
|
|
@@ -858,13 +858,13 @@ function un(e, t, n, r) {
|
|
|
858
858
|
})
|
|
859
859
|
};
|
|
860
860
|
}
|
|
861
|
-
function
|
|
862
|
-
let r =
|
|
861
|
+
function pn(e, t, n) {
|
|
862
|
+
let r = X(e), i = Q(e, t), a = { ...q(i.comments) }, o = { ...q(i.nodes) };
|
|
863
863
|
for (let e of n) delete a[e], delete o[e];
|
|
864
|
-
let s =
|
|
864
|
+
let s = Y(e, t).filter((e) => !n.has(e));
|
|
865
865
|
return {
|
|
866
866
|
...e,
|
|
867
|
-
designer:
|
|
867
|
+
designer: Z(r, t, {
|
|
868
868
|
...i,
|
|
869
869
|
comments: a,
|
|
870
870
|
nodes: o,
|
|
@@ -872,16 +872,16 @@ function dn(e, t, n) {
|
|
|
872
872
|
})
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
|
-
function
|
|
876
|
-
return new Set(Object.keys(
|
|
875
|
+
function mn(e, t) {
|
|
876
|
+
return new Set(Object.keys(q(J(e, t)?.comments) ?? {}));
|
|
877
877
|
}
|
|
878
|
-
function
|
|
879
|
-
let r =
|
|
878
|
+
function hn(e, t, n) {
|
|
879
|
+
let r = on(e, t);
|
|
880
880
|
if (r?.x == n.x && r.y == n.y && r.zoom == n.zoom) return e;
|
|
881
|
-
let i =
|
|
881
|
+
let i = X(e), a = Q(e, t);
|
|
882
882
|
return {
|
|
883
883
|
...e,
|
|
884
|
-
designer:
|
|
884
|
+
designer: Z(i, t, {
|
|
885
885
|
...a,
|
|
886
886
|
viewport: {
|
|
887
887
|
x: n.x,
|
|
@@ -891,52 +891,52 @@ function pn(e, t, n) {
|
|
|
891
891
|
})
|
|
892
892
|
};
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
let r =
|
|
894
|
+
function gn(e, t, n) {
|
|
895
|
+
let r = Q(e, n), i = Q(t, n), a = /* @__PURE__ */ new Set();
|
|
896
896
|
for (let e of [
|
|
897
897
|
"nodes",
|
|
898
898
|
"comments",
|
|
899
899
|
"hiddenNodeContent"
|
|
900
900
|
]) {
|
|
901
|
-
let t =
|
|
901
|
+
let t = q(r[e]) ?? {}, n = q(i[e]) ?? {};
|
|
902
902
|
for (let e of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])) u(t[e], n[e]) || a.add(e);
|
|
903
903
|
}
|
|
904
904
|
let o = (e) => Object.fromEntries([
|
|
905
905
|
"nodes",
|
|
906
906
|
"comments",
|
|
907
907
|
"hiddenNodeContent"
|
|
908
|
-
].map((t) => [t, Object.fromEntries(Object.entries(
|
|
908
|
+
].map((t) => [t, Object.fromEntries(Object.entries(q(e[t]) ?? {}).filter(([e]) => a.has(e)))]));
|
|
909
909
|
return {
|
|
910
910
|
before: o(r),
|
|
911
911
|
after: o(i),
|
|
912
912
|
nodeIds: [...a],
|
|
913
|
-
beforeOrder:
|
|
914
|
-
afterOrder:
|
|
913
|
+
beforeOrder: Y(e, n),
|
|
914
|
+
afterOrder: Y(t, n)
|
|
915
915
|
};
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function _n(e, t, n, r) {
|
|
918
918
|
if (n.nodeIds.length == 0) return e;
|
|
919
|
-
let i =
|
|
919
|
+
let i = Q(e, t), a = r ? n.after : n.before;
|
|
920
920
|
for (let e of [
|
|
921
921
|
"nodes",
|
|
922
922
|
"comments",
|
|
923
923
|
"hiddenNodeContent"
|
|
924
924
|
]) {
|
|
925
|
-
let t = { ...
|
|
925
|
+
let t = { ...q(i[e]) }, r = q(a[e]) ?? {};
|
|
926
926
|
for (let e of n.nodeIds) r[e] == null ? delete t[e] : t[e] = r[e];
|
|
927
927
|
i[e] = t;
|
|
928
928
|
}
|
|
929
929
|
return i.order = [...r ? n.afterOrder : n.beforeOrder], {
|
|
930
930
|
...e,
|
|
931
|
-
designer:
|
|
931
|
+
designer: Z(X(e), t, i)
|
|
932
932
|
};
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
return
|
|
934
|
+
function vn(e, t) {
|
|
935
|
+
return q(J(e, t)?.hiddenNodeContent);
|
|
936
936
|
}
|
|
937
937
|
//#endregion
|
|
938
938
|
//#region src/workbench/browser/runtime/publications/publicationStore.ts
|
|
939
|
-
var
|
|
939
|
+
var yn = {
|
|
940
940
|
activities: [],
|
|
941
941
|
activitiesLoadFailed: !1,
|
|
942
942
|
activitiesLoading: !1,
|
|
@@ -951,25 +951,25 @@ var _n = {
|
|
|
951
951
|
publications: [],
|
|
952
952
|
publishing: !1,
|
|
953
953
|
refreshing: !1
|
|
954
|
-
},
|
|
955
|
-
function
|
|
954
|
+
}, bn = 20, xn = 50, Sn = 750;
|
|
955
|
+
function Cn(e, t) {
|
|
956
956
|
return e?.flowId == t.flowId;
|
|
957
957
|
}
|
|
958
|
-
var
|
|
958
|
+
var wn = class {
|
|
959
959
|
#e;
|
|
960
960
|
#t;
|
|
961
961
|
#n;
|
|
962
|
-
#r = new
|
|
963
|
-
#i = new
|
|
962
|
+
#r = new E();
|
|
963
|
+
#i = new E();
|
|
964
964
|
#a;
|
|
965
|
-
#o = new
|
|
966
|
-
#s = new
|
|
965
|
+
#o = new E();
|
|
966
|
+
#s = new E();
|
|
967
967
|
#c;
|
|
968
|
-
#l = n(
|
|
968
|
+
#l = n(yn);
|
|
969
969
|
#u;
|
|
970
970
|
#d;
|
|
971
971
|
#f;
|
|
972
|
-
constructor(t, n, r, i, a =
|
|
972
|
+
constructor(t, n, r, i, a = j, o = h()) {
|
|
973
973
|
this.#e = t, this.#t = a, this.#n = o, this.#a = i, this.#c = r, this.#u = n, this.$ = {
|
|
974
974
|
activities: e(this.#l, (e) => e.activities),
|
|
975
975
|
activitiesLoadFailed: e(this.#l, (e) => e.activitiesLoadFailed),
|
|
@@ -1003,17 +1003,17 @@ var Sn = class {
|
|
|
1003
1003
|
this.#l.dispose();
|
|
1004
1004
|
}
|
|
1005
1005
|
reset() {
|
|
1006
|
-
this.#r.invalidate(), this.#i.invalidate(), this.#y(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(
|
|
1006
|
+
this.#r.invalidate(), this.#i.invalidate(), this.#y(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(yn);
|
|
1007
1007
|
}
|
|
1008
1008
|
async load(e) {
|
|
1009
|
-
let t = { flowId: e }, n = this.#l.value, r = n.loaded &&
|
|
1010
|
-
|
|
1009
|
+
let t = { flowId: e }, n = this.#l.value, r = n.loaded && Cn(n.target, t), i = this.#r.begin();
|
|
1010
|
+
Cn(n.target, t) || (this.#i.invalidate(), this.#y(), this.#f = void 0), r ? this.#S({
|
|
1011
1011
|
loadFailed: !1,
|
|
1012
1012
|
loadingMore: !1,
|
|
1013
1013
|
loadMoreFailed: !1,
|
|
1014
1014
|
refreshing: !0
|
|
1015
1015
|
}) : this.#l.set({
|
|
1016
|
-
...
|
|
1016
|
+
...yn,
|
|
1017
1017
|
loading: !0,
|
|
1018
1018
|
target: t
|
|
1019
1019
|
});
|
|
@@ -1043,7 +1043,7 @@ var Sn = class {
|
|
|
1043
1043
|
loadFailed: !r,
|
|
1044
1044
|
loading: !1,
|
|
1045
1045
|
refreshing: !1
|
|
1046
|
-
}), this.#c(
|
|
1046
|
+
}), this.#c(F(e, this.#n.t));
|
|
1047
1047
|
}
|
|
1048
1048
|
}
|
|
1049
1049
|
async loadMore() {
|
|
@@ -1057,7 +1057,7 @@ var Sn = class {
|
|
|
1057
1057
|
try {
|
|
1058
1058
|
let e = await this.#e.listPublications(n.flowId, {
|
|
1059
1059
|
cursor: t,
|
|
1060
|
-
limit:
|
|
1060
|
+
limit: xn
|
|
1061
1061
|
});
|
|
1062
1062
|
if (!r()) return;
|
|
1063
1063
|
let i = new Set(this.#l.value.publications.map((e) => e.publicationId));
|
|
@@ -1072,7 +1072,7 @@ var Sn = class {
|
|
|
1072
1072
|
this.#S({
|
|
1073
1073
|
loadMoreFailed: !0,
|
|
1074
1074
|
loadingMore: !1
|
|
1075
|
-
}), this.#c(
|
|
1075
|
+
}), this.#c(F(e, this.#n.t));
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
1078
|
async publish() {
|
|
@@ -1099,7 +1099,7 @@ var Sn = class {
|
|
|
1099
1099
|
publishing: e.status == "pending"
|
|
1100
1100
|
}), await this.#_(r, e, s, t.name)) : !1;
|
|
1101
1101
|
} catch (e) {
|
|
1102
|
-
return s() ? (e instanceof
|
|
1102
|
+
return s() ? (e instanceof I && e.code == "live.conflict" && await this.#m(r), this.#c(F(e, this.#n.t)), !1) : !1;
|
|
1103
1103
|
} finally {
|
|
1104
1104
|
s() && this.#S({ publishing: !1 });
|
|
1105
1105
|
}
|
|
@@ -1125,7 +1125,7 @@ var Sn = class {
|
|
|
1125
1125
|
message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
|
|
1126
1126
|
}), !0);
|
|
1127
1127
|
} catch (e) {
|
|
1128
|
-
return s() ? (e instanceof
|
|
1128
|
+
return s() ? (e instanceof I && e.code == "live.conflict" && await this.#m(r), this.#c(F(e, this.#n.t)), !1) : !1;
|
|
1129
1129
|
} finally {
|
|
1130
1130
|
s() && this.#S({ rollingBackPublicationId: void 0 });
|
|
1131
1131
|
}
|
|
@@ -1160,13 +1160,13 @@ var Sn = class {
|
|
|
1160
1160
|
testingTriggerId: void 0,
|
|
1161
1161
|
testResult: void 0
|
|
1162
1162
|
});
|
|
1163
|
-
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit:
|
|
1163
|
+
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: bn })]);
|
|
1164
1164
|
if (n()) {
|
|
1165
1165
|
if (r.status == "rejected") {
|
|
1166
1166
|
this.#S({
|
|
1167
1167
|
activitiesLoading: !1,
|
|
1168
1168
|
detailLoading: !1
|
|
1169
|
-
}), this.#c(
|
|
1169
|
+
}), this.#c(F(r.reason, this.#n.t));
|
|
1170
1170
|
return;
|
|
1171
1171
|
}
|
|
1172
1172
|
this.#S({
|
|
@@ -1180,7 +1180,7 @@ var Sn = class {
|
|
|
1180
1180
|
}) : (this.#S({
|
|
1181
1181
|
activitiesLoadFailed: !0,
|
|
1182
1182
|
activitiesLoading: !1
|
|
1183
|
-
}), this.#c(
|
|
1183
|
+
}), this.#c(F(i.reason, this.#n.t)));
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
1186
|
async loadMoreTriggerActivities() {
|
|
@@ -1194,7 +1194,7 @@ var Sn = class {
|
|
|
1194
1194
|
try {
|
|
1195
1195
|
let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
|
|
1196
1196
|
cursor: t,
|
|
1197
|
-
limit:
|
|
1197
|
+
limit: bn
|
|
1198
1198
|
});
|
|
1199
1199
|
if (!i() || this.#l.value.selectedTriggerId != n) return;
|
|
1200
1200
|
let a = new Set(this.#l.value.activities.map((e) => e.activityId));
|
|
@@ -1209,7 +1209,7 @@ var Sn = class {
|
|
|
1209
1209
|
this.#S({
|
|
1210
1210
|
activitiesLoadFailed: !0,
|
|
1211
1211
|
activitiesLoadingMore: !1
|
|
1212
|
-
}), this.#c(
|
|
1212
|
+
}), this.#c(F(e, this.#n.t));
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
1215
|
async testTrigger() {
|
|
@@ -1224,7 +1224,7 @@ var Sn = class {
|
|
|
1224
1224
|
let e = await this.#e.testFlowPollTrigger(n.flowId, t);
|
|
1225
1225
|
return !i() || this.#l.value.selectedTriggerId != t ? !1 : (this.#S({ testResult: e }), !0);
|
|
1226
1226
|
} catch (e) {
|
|
1227
|
-
return i() && this.#l.value.selectedTriggerId == t && this.#c(
|
|
1227
|
+
return i() && this.#l.value.selectedTriggerId == t && this.#c(F(e, this.#n.t)), !1;
|
|
1228
1228
|
} finally {
|
|
1229
1229
|
i() && this.#l.value.selectedTriggerId == t && this.#S({ testingTriggerId: void 0 });
|
|
1230
1230
|
}
|
|
@@ -1243,16 +1243,16 @@ var Sn = class {
|
|
|
1243
1243
|
message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
|
|
1244
1244
|
}), !0) : !1;
|
|
1245
1245
|
} catch (e) {
|
|
1246
|
-
return n() && this.#c(
|
|
1246
|
+
return n() && this.#c(F(e, this.#n.t)), !1;
|
|
1247
1247
|
} finally {
|
|
1248
1248
|
n() && this.#S({ changingTriggerId: void 0 });
|
|
1249
1249
|
}
|
|
1250
1250
|
}
|
|
1251
1251
|
async #p(e, t) {
|
|
1252
1252
|
let n = this.#r.begin(), [r, i, a] = await this.#h(e, t).catch((t) => {
|
|
1253
|
-
throw n() &&
|
|
1253
|
+
throw n() && Cn(this.#l.value.target, e) && this.#S({ refreshing: !1 }), t;
|
|
1254
1254
|
});
|
|
1255
|
-
t?.throwIfAborted(), n() && this.#u.updateLive(r), n() &&
|
|
1255
|
+
t?.throwIfAborted(), n() && this.#u.updateLive(r), n() && Cn(this.#l.value.target, e) && this.#S({
|
|
1256
1256
|
bindings: a,
|
|
1257
1257
|
live: r,
|
|
1258
1258
|
loaded: !0,
|
|
@@ -1276,7 +1276,7 @@ var Sn = class {
|
|
|
1276
1276
|
this.#e.getLive(e.flowId, t),
|
|
1277
1277
|
this.#e.listPublications(e.flowId, {
|
|
1278
1278
|
includeTotal: !0,
|
|
1279
|
-
limit:
|
|
1279
|
+
limit: xn
|
|
1280
1280
|
}, t),
|
|
1281
1281
|
this.#e.listFlowTriggerBindings(e.flowId, t)
|
|
1282
1282
|
]);
|
|
@@ -1286,7 +1286,7 @@ var Sn = class {
|
|
|
1286
1286
|
if (t != null && t != "") try {
|
|
1287
1287
|
return await this.#e.getPublishOperation(e.flowId, t);
|
|
1288
1288
|
} catch (t) {
|
|
1289
|
-
if (t instanceof
|
|
1289
|
+
if (t instanceof I && t.code == "publication.operation-not-found") {
|
|
1290
1290
|
this.#a.setItem(this.#b(e.flowId), "");
|
|
1291
1291
|
return;
|
|
1292
1292
|
}
|
|
@@ -1295,7 +1295,7 @@ var Sn = class {
|
|
|
1295
1295
|
}
|
|
1296
1296
|
async #_(e, t, n, r) {
|
|
1297
1297
|
this.#y();
|
|
1298
|
-
let i =
|
|
1298
|
+
let i = G.runFork(G.gen({ self: this }, function* () {
|
|
1299
1299
|
let i = yield* this.#v(e, t, n);
|
|
1300
1300
|
if (i == null || !n()) return !1;
|
|
1301
1301
|
if (this.#f = void 0, this.#x(e, {
|
|
@@ -1305,11 +1305,11 @@ var Sn = class {
|
|
|
1305
1305
|
kind: "error",
|
|
1306
1306
|
message: i.issue.message
|
|
1307
1307
|
}), !1;
|
|
1308
|
-
let a = yield*
|
|
1308
|
+
let a = yield* G.tryPromise({
|
|
1309
1309
|
try: (t) => this.#p(e, t),
|
|
1310
1310
|
catch: (e) => e
|
|
1311
|
-
}).pipe(
|
|
1312
|
-
onFailure: (e) => (n() && this.#c(
|
|
1311
|
+
}).pipe(G.match({
|
|
1312
|
+
onFailure: (e) => (n() && this.#c(F(e, this.#n.t)), !1),
|
|
1313
1313
|
onSuccess: () => !0
|
|
1314
1314
|
}));
|
|
1315
1315
|
return n() ? (a && this.#c({
|
|
@@ -1318,34 +1318,34 @@ var Sn = class {
|
|
|
1318
1318
|
}), !0) : !1;
|
|
1319
1319
|
}));
|
|
1320
1320
|
this.#d = i;
|
|
1321
|
-
let a = await
|
|
1322
|
-
if (
|
|
1323
|
-
if (
|
|
1324
|
-
throw
|
|
1321
|
+
let a = await G.runPromiseExit(At.join(i));
|
|
1322
|
+
if (kt.isSuccess(a)) return a.value;
|
|
1323
|
+
if (Ot.hasInterruptsOnly(a.cause)) return !1;
|
|
1324
|
+
throw Ot.squash(a.cause);
|
|
1325
1325
|
}
|
|
1326
1326
|
#v(e, t, n) {
|
|
1327
|
-
return
|
|
1327
|
+
return G.gen({ self: this }, function* () {
|
|
1328
1328
|
let r = t;
|
|
1329
1329
|
for (; r.status == "pending";) {
|
|
1330
|
-
if (yield*
|
|
1331
|
-
let t = yield*
|
|
1330
|
+
if (yield* G.sleep(Sn), !n()) return;
|
|
1331
|
+
let t = yield* G.tryPromise({
|
|
1332
1332
|
try: (t) => this.#e.getPublishOperation(e.flowId, r.operationId, t),
|
|
1333
1333
|
catch: (e) => e
|
|
1334
|
-
}).pipe(
|
|
1334
|
+
}).pipe(G.match({
|
|
1335
1335
|
onFailure: (e) => ({ error: e }),
|
|
1336
1336
|
onSuccess: (e) => ({ value: e })
|
|
1337
1337
|
}));
|
|
1338
1338
|
if (!n()) return;
|
|
1339
1339
|
if ("error" in t) {
|
|
1340
1340
|
let n = t.error;
|
|
1341
|
-
if (n instanceof
|
|
1341
|
+
if (n instanceof I && n.code == "publication.operation-not-found") {
|
|
1342
1342
|
this.#a.setItem(this.#b(e.flowId), ""), this.#x(e, {
|
|
1343
1343
|
operation: void 0,
|
|
1344
1344
|
publishing: !1
|
|
1345
|
-
}), this.#c(
|
|
1345
|
+
}), this.#c(F(n, this.#n.t));
|
|
1346
1346
|
return;
|
|
1347
1347
|
}
|
|
1348
|
-
this.#c(
|
|
1348
|
+
this.#c(F(n, this.#n.t));
|
|
1349
1349
|
continue;
|
|
1350
1350
|
}
|
|
1351
1351
|
r = t.value, this.#x(e, { operation: r });
|
|
@@ -1360,8 +1360,8 @@ var Sn = class {
|
|
|
1360
1360
|
return `publish-operation:${e}`;
|
|
1361
1361
|
}
|
|
1362
1362
|
#x(e, t) {
|
|
1363
|
-
|
|
1364
|
-
...
|
|
1363
|
+
Cn(this.#l.value.target, e) ? this.#S(t) : this.#l.set({
|
|
1364
|
+
...yn,
|
|
1365
1365
|
...t,
|
|
1366
1366
|
target: e
|
|
1367
1367
|
});
|
|
@@ -1372,22 +1372,22 @@ var Sn = class {
|
|
|
1372
1372
|
...e
|
|
1373
1373
|
});
|
|
1374
1374
|
}
|
|
1375
|
-
},
|
|
1376
|
-
function
|
|
1375
|
+
}, Tn = { starting: !1 };
|
|
1376
|
+
function En(e) {
|
|
1377
1377
|
switch (e.kind) {
|
|
1378
1378
|
case "condition": return {};
|
|
1379
|
-
case "subflow": return
|
|
1380
|
-
case "task": return
|
|
1379
|
+
case "subflow": return $e(e.definition?.inputs ?? []);
|
|
1380
|
+
case "task": return $e(e.definition?.inputs ?? []);
|
|
1381
1381
|
case "value": return {};
|
|
1382
1382
|
case "approval":
|
|
1383
|
-
case "wait": return
|
|
1383
|
+
case "wait": return $e(e.node.inputDefinitions);
|
|
1384
1384
|
}
|
|
1385
1385
|
}
|
|
1386
|
-
function
|
|
1386
|
+
function Dn(e) {
|
|
1387
1387
|
return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
|
|
1388
1388
|
}
|
|
1389
|
-
function
|
|
1390
|
-
let n =
|
|
1389
|
+
function On(e, t) {
|
|
1390
|
+
let n = P(e), r = n.graph({ kind: "flow" });
|
|
1391
1391
|
if (r == null) return [];
|
|
1392
1392
|
let i = /* @__PURE__ */ new Set([t]), a = [t];
|
|
1393
1393
|
for (; a.length > 0;) {
|
|
@@ -1397,11 +1397,11 @@ function En(e, t) {
|
|
|
1397
1397
|
return Object.entries(r.nodes).filter(([e]) => i.has(e)).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, t]) => {
|
|
1398
1398
|
let r = n.resolveNode(e, t);
|
|
1399
1399
|
if (r.kind == "trigger") return r.trigger.kind == "manual" || r.trigger.kind == "cron" ? [] : [{
|
|
1400
|
-
definitions:
|
|
1400
|
+
definitions: Le(r.trigger),
|
|
1401
1401
|
nodeId: e,
|
|
1402
1402
|
title: r.trigger.name
|
|
1403
1403
|
}];
|
|
1404
|
-
let i = Object.entries(
|
|
1404
|
+
let i = Object.entries(En(r)).filter(([e, t]) => r.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
|
|
1405
1405
|
handle: e,
|
|
1406
1406
|
jsonSchema: t.jsonSchema,
|
|
1407
1407
|
nullable: t.nullable
|
|
@@ -1409,18 +1409,18 @@ function En(e, t) {
|
|
|
1409
1409
|
return i.length == 0 ? [] : [{
|
|
1410
1410
|
definitions: i,
|
|
1411
1411
|
nodeId: e,
|
|
1412
|
-
title:
|
|
1412
|
+
title: Dn(r)
|
|
1413
1413
|
}];
|
|
1414
1414
|
});
|
|
1415
1415
|
}
|
|
1416
|
-
function
|
|
1416
|
+
function kn(e) {
|
|
1417
1417
|
return JSON.stringify(e.map((e) => [e.nodeId, e.definitions.map((e) => [
|
|
1418
1418
|
e.handle,
|
|
1419
1419
|
e.jsonSchema,
|
|
1420
1420
|
e.nullable
|
|
1421
1421
|
])]));
|
|
1422
1422
|
}
|
|
1423
|
-
async function
|
|
1423
|
+
async function An(e, t, n) {
|
|
1424
1424
|
let { FlowRunInputEditorStore: r } = await import("./flowRunInputEditorStore-Bgb5vSeS.js").then((e) => e.n);
|
|
1425
1425
|
return e.map((e) => {
|
|
1426
1426
|
let i = new r(e.definitions, t);
|
|
@@ -1431,31 +1431,31 @@ async function On(e, t, n) {
|
|
|
1431
1431
|
};
|
|
1432
1432
|
});
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1434
|
+
function jn(e) {
|
|
1435
1435
|
return Object.fromEntries(e.map((e) => [e.nodeId, e.editor.values()]));
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1438
|
-
return
|
|
1437
|
+
function Mn(e, t) {
|
|
1438
|
+
return P(e).graph({ kind: "flow" })?.nodes[t]?.kind === "cron" ? { scheduledAt: (/* @__PURE__ */ new Date()).toISOString() } : {};
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1440
|
+
function Nn(e, t, n) {
|
|
1441
1441
|
return {
|
|
1442
1442
|
inputs: Object.fromEntries(e.filter((e) => e.nodeId != t).map((e) => [e.nodeId, e.editor.values()])),
|
|
1443
|
-
outputs: e.find((e) => e.nodeId == t)?.editor.values() ??
|
|
1443
|
+
outputs: e.find((e) => e.nodeId == t)?.editor.values() ?? Mn(n, t)
|
|
1444
1444
|
};
|
|
1445
1445
|
}
|
|
1446
|
-
var
|
|
1446
|
+
var Pn = class {
|
|
1447
1447
|
#e;
|
|
1448
1448
|
#t;
|
|
1449
1449
|
#n;
|
|
1450
1450
|
#r;
|
|
1451
|
-
#i = new
|
|
1452
|
-
#a = new
|
|
1451
|
+
#i = new E();
|
|
1452
|
+
#a = new E();
|
|
1453
1453
|
#o;
|
|
1454
1454
|
#s = /* @__PURE__ */ new Map();
|
|
1455
1455
|
#c;
|
|
1456
|
-
#l = n(
|
|
1456
|
+
#l = n(Tn);
|
|
1457
1457
|
#u;
|
|
1458
|
-
constructor(t, n, r, i, a = h(), o =
|
|
1458
|
+
constructor(t, n, r, i, a = h(), o = j) {
|
|
1459
1459
|
this.#e = i, this.#t = t, this.#o = n, this.#c = r, this.#r = a, this.#n = o, this.$ = {
|
|
1460
1460
|
inputRequest: e(this.#l, (e) => e.inputRequest),
|
|
1461
1461
|
starting: e(this.#l, (e) => e.starting),
|
|
@@ -1470,14 +1470,14 @@ var Mn = class {
|
|
|
1470
1470
|
reset() {
|
|
1471
1471
|
this.#i.invalidate(), this.#a.invalidate(), this.#u = void 0;
|
|
1472
1472
|
let e = this.#l.value.inputRequest;
|
|
1473
|
-
this.#h(e), this.#l.set(
|
|
1473
|
+
this.#h(e), this.#l.set(Tn), this.#p(e);
|
|
1474
1474
|
}
|
|
1475
1475
|
async requestDraft(e, t, n) {
|
|
1476
1476
|
let r = this.#a.begin();
|
|
1477
1477
|
try {
|
|
1478
1478
|
return await this.#d("draft", e, t, t.revisionId, r, void 0, n);
|
|
1479
1479
|
} catch (e) {
|
|
1480
|
-
return r() && this.#c(
|
|
1480
|
+
return r() && this.#c(F(e, this.#r.t)), "unavailable";
|
|
1481
1481
|
} finally {
|
|
1482
1482
|
r() && this.#g({ starting: !1 });
|
|
1483
1483
|
}
|
|
@@ -1487,16 +1487,16 @@ var Mn = class {
|
|
|
1487
1487
|
try {
|
|
1488
1488
|
return await this.#d("draft", e, t, t.revisionId, r, void 0, n, !0);
|
|
1489
1489
|
} catch (e) {
|
|
1490
|
-
return r() && this.#c(
|
|
1490
|
+
return r() && this.#c(F(e, this.#r.t)), "unavailable";
|
|
1491
1491
|
} finally {
|
|
1492
1492
|
r() && this.#g({ starting: !1 });
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
inputStatus(e, t, n) {
|
|
1496
|
-
let r =
|
|
1496
|
+
let r = On(t, n);
|
|
1497
1497
|
if (r.length == 0) return "none";
|
|
1498
1498
|
let i = this.#s.get(this.#m(e, n));
|
|
1499
|
-
return i?.valid == 1 && i.signature ==
|
|
1499
|
+
return i?.valid == 1 && i.signature == kn(r) ? "ready" : "missing";
|
|
1500
1500
|
}
|
|
1501
1501
|
async requestLive(e) {
|
|
1502
1502
|
let t = this.#a.begin();
|
|
@@ -1507,7 +1507,7 @@ var Mn = class {
|
|
|
1507
1507
|
let r = await this.#t.getRevision(e.flowId, n.revisionId);
|
|
1508
1508
|
return t() ? await this.#d("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
|
|
1509
1509
|
} catch (e) {
|
|
1510
|
-
return t() && this.#c(
|
|
1510
|
+
return t() && this.#c(F(e, this.#r.t)), "unavailable";
|
|
1511
1511
|
} finally {
|
|
1512
1512
|
t() && this.#g({ starting: !1 });
|
|
1513
1513
|
}
|
|
@@ -1524,7 +1524,7 @@ var Mn = class {
|
|
|
1524
1524
|
attempted: !0
|
|
1525
1525
|
} }), !1;
|
|
1526
1526
|
this.#h(e);
|
|
1527
|
-
let { inputs: t, outputs: n } =
|
|
1527
|
+
let { inputs: t, outputs: n } = Nn(e.groups, e.triggerId, e.revision), r = await this.#f(e.source, e.flow, e.revisionId, {
|
|
1528
1528
|
nodeId: e.triggerId,
|
|
1529
1529
|
outputs: n
|
|
1530
1530
|
}, t, e.publicationId);
|
|
@@ -1536,7 +1536,7 @@ var Mn = class {
|
|
|
1536
1536
|
let r = this.#a.begin();
|
|
1537
1537
|
this.#h(n), this.#g({ starting: !0 });
|
|
1538
1538
|
try {
|
|
1539
|
-
let i =
|
|
1539
|
+
let i = On(n.revision, e), a = this.#s.get(this.#m(n.flow.flowId, e)), o = await An(i, this.#r.lang$, a?.values);
|
|
1540
1540
|
if (!r() || this.#l.value.inputRequest !== n) {
|
|
1541
1541
|
for (let e of o) e.editor.dispose();
|
|
1542
1542
|
return;
|
|
@@ -1550,7 +1550,7 @@ var Mn = class {
|
|
|
1550
1550
|
valid: s
|
|
1551
1551
|
} }), this.#p(n);
|
|
1552
1552
|
} catch (e) {
|
|
1553
|
-
r() && this.#c(
|
|
1553
|
+
r() && this.#c(F(e, this.#r.t));
|
|
1554
1554
|
} finally {
|
|
1555
1555
|
r() && this.#g({ starting: !1 });
|
|
1556
1556
|
}
|
|
@@ -1562,7 +1562,7 @@ var Mn = class {
|
|
|
1562
1562
|
starting: !c,
|
|
1563
1563
|
submitting: void 0
|
|
1564
1564
|
}), this.#p(l);
|
|
1565
|
-
let u =
|
|
1565
|
+
let u = P(r).graph({ kind: "flow" }), d = Object.entries(u?.nodes ?? {}).flatMap(([e, t]) => "inputs" in t ? [] : [{
|
|
1566
1566
|
nodeId: e,
|
|
1567
1567
|
title: t.name
|
|
1568
1568
|
}]);
|
|
@@ -1575,17 +1575,17 @@ var Mn = class {
|
|
|
1575
1575
|
kind: "error",
|
|
1576
1576
|
message: this.#r.t("runInput.selectTrigger")
|
|
1577
1577
|
}), "unavailable";
|
|
1578
|
-
let p = f == null ? [] :
|
|
1578
|
+
let p = f == null ? [] : On(r, f.nodeId), m = kn(p), h = f == null ? void 0 : this.#s.get(this.#m(n.flowId, f.nodeId)), g = f == null ? [] : await An(p, this.#r.lang$, h?.values);
|
|
1579
1579
|
if (!a()) {
|
|
1580
1580
|
for (let e of g) e.editor.dispose();
|
|
1581
1581
|
return "unavailable";
|
|
1582
1582
|
}
|
|
1583
1583
|
if (!c && f != null && g.length == 0) return await this.#f(e, n, i, {
|
|
1584
1584
|
nodeId: f.nodeId,
|
|
1585
|
-
outputs:
|
|
1585
|
+
outputs: Mn(r, f.nodeId)
|
|
1586
1586
|
}, {}, o) ? "started" : "unavailable";
|
|
1587
1587
|
if (!c && f != null && h?.valid == 1 && h.signature == m && g.every((e) => e.editor.valid$.value)) {
|
|
1588
|
-
let t =
|
|
1588
|
+
let t = Nn(g, f.nodeId, r);
|
|
1589
1589
|
for (let e of g) e.editor.dispose();
|
|
1590
1590
|
return await this.#f(e, n, i, {
|
|
1591
1591
|
nodeId: f.nodeId,
|
|
@@ -1647,7 +1647,7 @@ var Mn = class {
|
|
|
1647
1647
|
});
|
|
1648
1648
|
return !o() || !s() ? !1 : (this.#u = void 0, this.#o.follow(d, s));
|
|
1649
1649
|
} catch (e) {
|
|
1650
|
-
return o() && s() && this.#c(
|
|
1650
|
+
return o() && s() && this.#c(F(e, this.#r.t)), !1;
|
|
1651
1651
|
} finally {
|
|
1652
1652
|
o() && this.#g({
|
|
1653
1653
|
starting: !1,
|
|
@@ -1666,9 +1666,9 @@ var Mn = class {
|
|
|
1666
1666
|
}
|
|
1667
1667
|
#h(e) {
|
|
1668
1668
|
e?.triggerId != null && e.groups.length != 0 && this.#s.set(this.#m(e.flow.flowId, e.triggerId), {
|
|
1669
|
-
signature:
|
|
1669
|
+
signature: kn(On(e.revision, e.triggerId)),
|
|
1670
1670
|
valid: e.valid.value,
|
|
1671
|
-
values:
|
|
1671
|
+
values: jn(e.groups)
|
|
1672
1672
|
});
|
|
1673
1673
|
}
|
|
1674
1674
|
#g(e) {
|
|
@@ -1680,22 +1680,22 @@ var Mn = class {
|
|
|
1680
1680
|
};
|
|
1681
1681
|
//#endregion
|
|
1682
1682
|
//#region src/workbench/browser/runtime/workspace.ts
|
|
1683
|
-
function
|
|
1683
|
+
function Fn(e, t) {
|
|
1684
1684
|
if (e.node.icon != null) return e.node.icon;
|
|
1685
|
-
if (e.kind != "task" || e.definition == null || !("executor" in e.definition) || e.definition.executor.kind != "connector") return
|
|
1685
|
+
if (e.kind != "task" || e.definition == null || !("executor" in e.definition) || e.definition.executor.kind != "connector") return Rn(e);
|
|
1686
1686
|
let n = t[e.definition.executor.action];
|
|
1687
|
-
return n == null ?
|
|
1687
|
+
return n == null ? Rn(e) : k(n);
|
|
1688
1688
|
}
|
|
1689
|
-
function
|
|
1689
|
+
function In(e, t) {
|
|
1690
1690
|
return e.kind == "trigger" ? {
|
|
1691
|
-
icon:
|
|
1691
|
+
icon: qn(e.trigger, t.providers),
|
|
1692
1692
|
title: e.trigger.name
|
|
1693
1693
|
} : {
|
|
1694
|
-
icon:
|
|
1695
|
-
title:
|
|
1694
|
+
icon: Fn(e, t.connectorActions),
|
|
1695
|
+
title: Ln(e, t.t)
|
|
1696
1696
|
};
|
|
1697
1697
|
}
|
|
1698
|
-
function
|
|
1698
|
+
function Ln(e, t) {
|
|
1699
1699
|
if (e.node.name != null) return e.node.name;
|
|
1700
1700
|
switch (e.kind) {
|
|
1701
1701
|
case "condition": return t?.("addNode.condition") ?? "Condition";
|
|
@@ -1706,7 +1706,7 @@ function Fn(e, t) {
|
|
|
1706
1706
|
case "task": return e.definition?.name ?? (e.node.task == null ? e.node.taskId : e.node.task.moduleId);
|
|
1707
1707
|
}
|
|
1708
1708
|
}
|
|
1709
|
-
function
|
|
1709
|
+
function Rn(e) {
|
|
1710
1710
|
switch (e.kind) {
|
|
1711
1711
|
case "condition": return ":carbon:child-node:";
|
|
1712
1712
|
case "subflow": return ":carbon:subflow:";
|
|
@@ -1719,7 +1719,7 @@ function In(e) {
|
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
|
-
function
|
|
1722
|
+
function zn(e, t, n, r) {
|
|
1723
1723
|
return JSON.stringify([
|
|
1724
1724
|
e,
|
|
1725
1725
|
t,
|
|
@@ -1727,10 +1727,10 @@ function Ln(e, t, n, r) {
|
|
|
1727
1727
|
r
|
|
1728
1728
|
]);
|
|
1729
1729
|
}
|
|
1730
|
-
function
|
|
1730
|
+
function Bn(e) {
|
|
1731
1731
|
if (e.kind == "trigger") return {
|
|
1732
1732
|
inputs: /* @__PURE__ */ new Map(),
|
|
1733
|
-
outputs: new Map(Object.entries(
|
|
1733
|
+
outputs: new Map(Object.entries(He(e.trigger)))
|
|
1734
1734
|
};
|
|
1735
1735
|
let t = new Map(Object.keys(e.node.inputs).map((e) => [e, {}])), n = /* @__PURE__ */ new Map();
|
|
1736
1736
|
switch (e.kind) {
|
|
@@ -1753,7 +1753,7 @@ function Rn(e) {
|
|
|
1753
1753
|
jsonSchema: n.jsonSchema,
|
|
1754
1754
|
nullable: n.nullable
|
|
1755
1755
|
});
|
|
1756
|
-
for (let [t, r] of Object.entries(
|
|
1756
|
+
for (let [t, r] of Object.entries(Pe(e.node))) n.set(t, r);
|
|
1757
1757
|
break;
|
|
1758
1758
|
case "subflow": {
|
|
1759
1759
|
let r = e.definition;
|
|
@@ -1799,7 +1799,7 @@ function Rn(e) {
|
|
|
1799
1799
|
outputs: n
|
|
1800
1800
|
};
|
|
1801
1801
|
}
|
|
1802
|
-
function
|
|
1802
|
+
function Vn(e) {
|
|
1803
1803
|
switch (e) {
|
|
1804
1804
|
case "endsWith": return "ends with";
|
|
1805
1805
|
case "hasKey": return "has key";
|
|
@@ -1823,7 +1823,7 @@ function zn(e) {
|
|
|
1823
1823
|
case "contains": return e;
|
|
1824
1824
|
}
|
|
1825
1825
|
}
|
|
1826
|
-
function
|
|
1826
|
+
function Hn(e, t) {
|
|
1827
1827
|
if (e.kind == "value") return JSON.stringify(e.value) ?? "…";
|
|
1828
1828
|
let n = e.source;
|
|
1829
1829
|
if (n.kind == "flow") return n.input;
|
|
@@ -1831,14 +1831,14 @@ function Bn(e, t) {
|
|
|
1831
1831
|
kind: "environment",
|
|
1832
1832
|
label: t.t?.("nodeInput.variable") ?? "Env"
|
|
1833
1833
|
};
|
|
1834
|
-
let r = t.nodes.get(n.nodeId), i = r == null ? void 0 :
|
|
1834
|
+
let r = t.nodes.get(n.nodeId), i = r == null ? void 0 : In(r, t);
|
|
1835
1835
|
return {
|
|
1836
1836
|
icon: i?.icon,
|
|
1837
1837
|
kind: "node",
|
|
1838
|
-
label: `${i?.title ?? n.nodeId} · ${
|
|
1838
|
+
label: `${i?.title ?? n.nodeId} · ${Be(n)}`
|
|
1839
1839
|
};
|
|
1840
1840
|
}
|
|
1841
|
-
function
|
|
1841
|
+
function Un(e, t, n) {
|
|
1842
1842
|
let r = e.kind == "flow" ? `/document/graph/nodes/${t.id}` : `/document/subflows/${e.id}/graph/nodes/${t.id}`, i = [r];
|
|
1843
1843
|
if (t.kind == "task") {
|
|
1844
1844
|
t.node.task == null ? i.push(`/document/tasks/${t.node.taskId}`) : i.push(`${r}/task`);
|
|
@@ -1847,7 +1847,7 @@ function Vn(e, t, n) {
|
|
|
1847
1847
|
} else t.kind == "subflow" && i.push(`/document/subflows/${t.node.subflowId}`);
|
|
1848
1848
|
return n.filter((e) => i.some((t) => e.path.startsWith(t))).length;
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1850
|
+
function Wn(e, t, n, r) {
|
|
1851
1851
|
if (t.kind != "flow" || n?.flowId != e.revision.flowId || n.revisionId != e.revision.revisionId) return { nodes: /* @__PURE__ */ new Map() };
|
|
1852
1852
|
let i = n.status == "queued" || n.status == "starting" || n.status == "running" || n.status == "waiting", a = /* @__PURE__ */ new Map();
|
|
1853
1853
|
if ("waits" in n) for (let e of n.waits) a.set(e.nodeId, {
|
|
@@ -1946,10 +1946,10 @@ function Hn(e, t, n, r) {
|
|
|
1946
1946
|
status: i ? "running" : "idle"
|
|
1947
1947
|
};
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1949
|
+
function Gn(e, t, n) {
|
|
1950
1950
|
if (e != null) return "moduleId" in e ? n?.("designer.executorJavaScript") ?? "javascript" : e.executor.kind == "agent" ? "Agent" : e.executor.kind == "llm" ? n?.("designer.executorLlm") ?? "llm" : `${n?.("designer.executorConnector") ?? "connector"} · ${t ?? e.executor.action.split(".")[0]}`;
|
|
1951
1951
|
}
|
|
1952
|
-
function
|
|
1952
|
+
function Kn(e) {
|
|
1953
1953
|
switch (e.kind) {
|
|
1954
1954
|
case "manual": return ":carbon:play:";
|
|
1955
1955
|
case "cron": return ":carbon:time:";
|
|
@@ -1958,17 +1958,17 @@ function Wn(e) {
|
|
|
1958
1958
|
case "webhook": return ":carbon:webhook:";
|
|
1959
1959
|
}
|
|
1960
1960
|
}
|
|
1961
|
-
function
|
|
1962
|
-
return e.icon == null ? e.kind != "integration" && e.kind != "poll" ?
|
|
1961
|
+
function qn(e, t) {
|
|
1962
|
+
return e.icon == null ? e.kind != "integration" && e.kind != "poll" ? Kn(e) : k(t[e.definition.provider] ?? {
|
|
1963
1963
|
serviceId: e.definition.provider,
|
|
1964
1964
|
serviceName: e.definition.provider
|
|
1965
1965
|
}) : e.icon;
|
|
1966
1966
|
}
|
|
1967
|
-
function
|
|
1967
|
+
function Jn(e, t) {
|
|
1968
1968
|
let n = `/document/graph/nodes/${e}`;
|
|
1969
1969
|
return t.filter((e) => e.code != "trigger.config-incomplete" && (e.path == n || e.path.startsWith(`${n}/`)));
|
|
1970
1970
|
}
|
|
1971
|
-
function
|
|
1971
|
+
function Yn(e, t) {
|
|
1972
1972
|
let n = [], r = new Map([...t].map((e) => [e, /* @__PURE__ */ new Set()])), i = new Map([...t].map((e) => [e, /* @__PURE__ */ new Set()])), a = Array.isArray(e.edges) ? e.edges : [];
|
|
1973
1973
|
for (let e of a) {
|
|
1974
1974
|
if (typeof e != "object" || !e || Array.isArray(e)) continue;
|
|
@@ -1976,7 +1976,7 @@ function qn(e, t) {
|
|
|
1976
1976
|
if (typeof a.source != "string" || typeof a.target != "string" || a.sourceHandle != null && typeof a.sourceHandle != "string" || !t.has(a.source) || !t.has(a.target)) continue;
|
|
1977
1977
|
let o = a.sourceHandle == null ? "$out" : `$branch:${a.sourceHandle}`;
|
|
1978
1978
|
n.push({
|
|
1979
|
-
id:
|
|
1979
|
+
id: zn(a.source, o, a.target, "$in"),
|
|
1980
1980
|
source: a.source,
|
|
1981
1981
|
sourceHandle: o,
|
|
1982
1982
|
target: a.target,
|
|
@@ -1989,7 +1989,7 @@ function qn(e, t) {
|
|
|
1989
1989
|
edges: n
|
|
1990
1990
|
};
|
|
1991
1991
|
}
|
|
1992
|
-
function
|
|
1992
|
+
function Xn(e, t, n) {
|
|
1993
1993
|
let r = new Map([...t].map(([e, t]) => [e, t.size])), i = /* @__PURE__ */ new Map(), a = [], o = /* @__PURE__ */ new Set(), s = [...r].filter(([, e]) => e == 0).map(([e]) => e).toSorted();
|
|
1994
1994
|
for (let e = 0; e < s.length; e += 1) {
|
|
1995
1995
|
let t = s[e];
|
|
@@ -2008,14 +2008,14 @@ function Jn(e, t, n) {
|
|
|
2008
2008
|
ordered: a
|
|
2009
2009
|
};
|
|
2010
2010
|
}
|
|
2011
|
-
function
|
|
2011
|
+
function Zn(e, t, n) {
|
|
2012
2012
|
if (!("inputs" in t)) return [];
|
|
2013
2013
|
let r = [];
|
|
2014
2014
|
for (let [i, a] of n.inputs) {
|
|
2015
2015
|
let n = t.inputs[i], o = [], s = /* @__PURE__ */ new Set();
|
|
2016
2016
|
if (n?.kind == "sources") for (let t of n.sources) {
|
|
2017
2017
|
if (t.kind != "node") continue;
|
|
2018
|
-
let n = t.nodeId, r = t.output, a =
|
|
2018
|
+
let n = t.nodeId, r = t.output, a = zn(n, r, e, i);
|
|
2019
2019
|
s.has(a) || (s.add(a), o.push({
|
|
2020
2020
|
nodeId: n,
|
|
2021
2021
|
output: r
|
|
@@ -2030,10 +2030,10 @@ function Yn(e, t, n) {
|
|
|
2030
2030
|
}
|
|
2031
2031
|
return r;
|
|
2032
2032
|
}
|
|
2033
|
-
function
|
|
2033
|
+
function Qn(e) {
|
|
2034
2034
|
return [...e.outputs].map(([e, t]) => Object.assign({ handle: e }, t));
|
|
2035
2035
|
}
|
|
2036
|
-
function
|
|
2036
|
+
function $n(e, t) {
|
|
2037
2037
|
if (e.kind != "task" || e.definition == null) return t;
|
|
2038
2038
|
let n = new Map(t.map((e) => [e.handle, e])), r = [];
|
|
2039
2039
|
for (let t of e.definition.inputs) {
|
|
@@ -2046,7 +2046,7 @@ function Zn(e, t) {
|
|
|
2046
2046
|
}
|
|
2047
2047
|
return r.push(...n.values()), r;
|
|
2048
2048
|
}
|
|
2049
|
-
function
|
|
2049
|
+
function er(e, t) {
|
|
2050
2050
|
if (e.kind != "task" || e.definition == null) return t;
|
|
2051
2051
|
let n = new Map(t.map((e) => [e.handle, e])), r = [];
|
|
2052
2052
|
for (let t of e.definition.outputs) {
|
|
@@ -2059,8 +2059,8 @@ function Qn(e, t) {
|
|
|
2059
2059
|
}
|
|
2060
2060
|
return r.push(...n.values()), r;
|
|
2061
2061
|
}
|
|
2062
|
-
function
|
|
2063
|
-
let a =
|
|
2062
|
+
function tr(e, t, n, r, i) {
|
|
2063
|
+
let a = Jn(e, r), o = a.some((e) => e.code == "trigger.connection-missing" || e.code == "trigger.connection-invalid"), s = t.kind == "integration" || t.kind == "poll" ? i[t.definition.provider] : void 0, c;
|
|
2064
2064
|
switch (t.kind) {
|
|
2065
2065
|
case "manual":
|
|
2066
2066
|
c = {
|
|
@@ -2097,27 +2097,27 @@ function $n(e, t, n, r, i) {
|
|
|
2097
2097
|
description: t.description,
|
|
2098
2098
|
diagnostics: a.length,
|
|
2099
2099
|
connectionRequired: o,
|
|
2100
|
-
icon:
|
|
2100
|
+
icon: qn(t, i),
|
|
2101
2101
|
id: e,
|
|
2102
2102
|
inputs: [],
|
|
2103
2103
|
kind: "trigger",
|
|
2104
|
-
outputs: Object.entries(
|
|
2104
|
+
outputs: Object.entries(He(t)).map(([e, t]) => Object.assign({ handle: e }, t)),
|
|
2105
2105
|
presentation: c,
|
|
2106
2106
|
position: n,
|
|
2107
2107
|
title: t.name
|
|
2108
2108
|
};
|
|
2109
2109
|
}
|
|
2110
|
-
function
|
|
2111
|
-
let a = t.node, o =
|
|
2110
|
+
function nr(e, t, n, r, i) {
|
|
2111
|
+
let a = t.node, o = $n(t, Zn(e, a, n)), s = er(t, Qn(n)), c = t.kind == "task" ? t.definition : void 0, l = c != null && "executor" in c && c.executor.kind == "connector" ? c.executor : void 0, u = l == null ? void 0 : i.connectorActions[l.action], d = u == null ? void 0 : i.connectionCatalogs[u.serviceId], f = l?.connectionId, p = f == null ? void 0 : d?.byId.get(f), m = u?.authenticated == 1 && (l?.connectionId == null || d != null && p?.status != "active"), h = i.runNodes.get(e), g = {
|
|
2112
2112
|
description: a.description,
|
|
2113
|
-
diagnostics:
|
|
2114
|
-
icon:
|
|
2113
|
+
diagnostics: Un(i.target, t, i.diagnostics),
|
|
2114
|
+
icon: Fn(t, i.connectorActions),
|
|
2115
2115
|
id: e,
|
|
2116
2116
|
inputs: o,
|
|
2117
2117
|
outputs: s,
|
|
2118
2118
|
position: r,
|
|
2119
2119
|
...h == null ? {} : { run: h },
|
|
2120
|
-
title:
|
|
2120
|
+
title: Ln(t, i.t)
|
|
2121
2121
|
};
|
|
2122
2122
|
switch (a.kind) {
|
|
2123
2123
|
case "condition": return {
|
|
@@ -2126,9 +2126,9 @@ function er(e, t, n, r, i) {
|
|
|
2126
2126
|
cases: a.cases.map((e) => ({
|
|
2127
2127
|
...e.description == null ? {} : { description: e.description },
|
|
2128
2128
|
groups: e.groups.map((e) => ({ expressions: e.expressions.map((e) => ({
|
|
2129
|
-
left:
|
|
2130
|
-
operator:
|
|
2131
|
-
right: e.right == null ? void 0 :
|
|
2129
|
+
left: Hn(e.left, i),
|
|
2130
|
+
operator: Vn(e.operator),
|
|
2131
|
+
right: e.right == null ? void 0 : Hn(e.right, i)
|
|
2132
2132
|
})) })),
|
|
2133
2133
|
output: e.output
|
|
2134
2134
|
})),
|
|
@@ -2147,13 +2147,13 @@ function er(e, t, n, r, i) {
|
|
|
2147
2147
|
return t == null || "group" in t ? [] : [t];
|
|
2148
2148
|
}),
|
|
2149
2149
|
kind: a.kind,
|
|
2150
|
-
executorName:
|
|
2150
|
+
executorName: Gn(c, u?.serviceName, i.t),
|
|
2151
2151
|
connectionRequired: m,
|
|
2152
2152
|
...c != null && "executor" in c && c.executor.kind == "agent" ? { tools: c.executor.tools.map((e) => {
|
|
2153
2153
|
let t = i.connectorActions[e.action], n = t?.serviceId ?? e.action.split(".")[0], r = t?.serviceName ?? n;
|
|
2154
2154
|
return {
|
|
2155
2155
|
id: e.id,
|
|
2156
|
-
icon:
|
|
2156
|
+
icon: k(t ?? {
|
|
2157
2157
|
serviceId: n,
|
|
2158
2158
|
serviceName: r
|
|
2159
2159
|
}),
|
|
@@ -2174,8 +2174,8 @@ function er(e, t, n, r, i) {
|
|
|
2174
2174
|
};
|
|
2175
2175
|
}
|
|
2176
2176
|
}
|
|
2177
|
-
function
|
|
2178
|
-
let u = e == null ? void 0 :
|
|
2177
|
+
function rr(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = {}) {
|
|
2178
|
+
let u = e == null ? void 0 : P(e), d = u == null || t == null ? void 0 : u.graph(t);
|
|
2179
2179
|
if (u == null || t == null || d == null) return {
|
|
2180
2180
|
edges: [],
|
|
2181
2181
|
nodes: [],
|
|
@@ -2185,7 +2185,7 @@ function tr(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = {}) {
|
|
|
2185
2185
|
zoom: 1
|
|
2186
2186
|
}
|
|
2187
2187
|
};
|
|
2188
|
-
let f =
|
|
2188
|
+
let f = Wn(u, t, s, c), p = Object.entries(d.nodes), m = new Map(p.map(([e, t]) => [e, u.resolveNode(e, t)])), h = new Set(p.map(([e]) => e)), g = new Map([...m].map(([e, t]) => [e, Bn(t)])), _ = Yn(d, h), v = Xn(h, _.dependencies, _.dependents), y = an(n, t), b = vn(n, t), x = {
|
|
2189
2189
|
connectionCatalogs: a,
|
|
2190
2190
|
connectorActions: i,
|
|
2191
2191
|
diagnostics: r,
|
|
@@ -2205,128 +2205,128 @@ function tr(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = {}) {
|
|
|
2205
2205
|
}, a = m.get(e);
|
|
2206
2206
|
if (a.kind == "trigger") {
|
|
2207
2207
|
C.push({
|
|
2208
|
-
|
|
2208
|
+
...tr(e, a.trigger, i, r, l),
|
|
2209
2209
|
contentHidden: b?.[e] === !0
|
|
2210
2210
|
});
|
|
2211
2211
|
continue;
|
|
2212
2212
|
}
|
|
2213
|
-
let o =
|
|
2213
|
+
let o = nr(e, a, g.get(e), i, x);
|
|
2214
2214
|
C.push({
|
|
2215
2215
|
...o,
|
|
2216
2216
|
contentHidden: b?.[e] === !0
|
|
2217
2217
|
});
|
|
2218
2218
|
}
|
|
2219
|
-
for (let [e, r] of Object.entries(
|
|
2219
|
+
for (let [e, r] of Object.entries(cn(n, t, y)).toSorted(([e], [t]) => e.localeCompare(t))) C.push({
|
|
2220
2220
|
...r,
|
|
2221
2221
|
id: e,
|
|
2222
2222
|
kind: "comment",
|
|
2223
2223
|
contentHidden: b?.[e] === !0
|
|
2224
2224
|
});
|
|
2225
|
-
let w = new Map(
|
|
2225
|
+
let w = new Map(Y(n, t).map((e, t) => [e, t]));
|
|
2226
2226
|
return C.sort((e, t) => (w.get(e.id) ?? -1) - (w.get(t.id) ?? -1)), {
|
|
2227
2227
|
edges: _.edges,
|
|
2228
2228
|
nodes: C,
|
|
2229
2229
|
...f.status == null ? {} : { runStatus: f.status },
|
|
2230
|
-
viewport:
|
|
2230
|
+
viewport: sn(n, t)
|
|
2231
2231
|
};
|
|
2232
2232
|
}
|
|
2233
2233
|
//#endregion
|
|
2234
2234
|
//#region src/connector/common/actionSchema.ts
|
|
2235
|
-
function
|
|
2236
|
-
let n =
|
|
2235
|
+
function ir(e, t) {
|
|
2236
|
+
let n = ar(e);
|
|
2237
2237
|
return {
|
|
2238
2238
|
inputs: n,
|
|
2239
2239
|
initialInputs: n.flatMap((e) => e.value === void 0 ? [] : [{
|
|
2240
2240
|
handle: e.handle,
|
|
2241
2241
|
value: e.value
|
|
2242
2242
|
}]),
|
|
2243
|
-
outputs:
|
|
2243
|
+
outputs: or(t)
|
|
2244
2244
|
};
|
|
2245
2245
|
}
|
|
2246
|
-
function
|
|
2247
|
-
let t =
|
|
2246
|
+
function ar(e) {
|
|
2247
|
+
let t = V(e);
|
|
2248
2248
|
if (t == null || t.type != "object" && t.properties == null) throw Error("Connector action inputSchema must be an object schema.");
|
|
2249
|
-
let n =
|
|
2249
|
+
let n = V(t.properties);
|
|
2250
2250
|
if (n == null) return [];
|
|
2251
|
-
let r =
|
|
2251
|
+
let r = ur(t.required);
|
|
2252
2252
|
return Object.entries(n).map(([e, n]) => {
|
|
2253
|
-
let i = !r.has(e) ||
|
|
2253
|
+
let i = !r.has(e) || dr(n, t);
|
|
2254
2254
|
return {
|
|
2255
|
-
description:
|
|
2255
|
+
description: cr(t, n),
|
|
2256
2256
|
handle: e,
|
|
2257
|
-
json_schema:
|
|
2257
|
+
json_schema: sr(t, n),
|
|
2258
2258
|
nullable: i,
|
|
2259
|
-
value:
|
|
2259
|
+
value: lr(t, n, i)
|
|
2260
2260
|
};
|
|
2261
2261
|
});
|
|
2262
2262
|
}
|
|
2263
|
-
function
|
|
2264
|
-
let t =
|
|
2263
|
+
function or(e) {
|
|
2264
|
+
let t = V(e), n = V(t?.properties);
|
|
2265
2265
|
if (t != null && (t.type == "object" || n != null)) {
|
|
2266
2266
|
if (n == null) return [];
|
|
2267
|
-
let e =
|
|
2267
|
+
let e = ur(t.required);
|
|
2268
2268
|
return Object.entries(n).map(([n, r]) => ({
|
|
2269
|
-
description:
|
|
2269
|
+
description: cr(t, r),
|
|
2270
2270
|
handle: n,
|
|
2271
|
-
json_schema:
|
|
2272
|
-
nullable: !e.has(n) ||
|
|
2271
|
+
json_schema: sr(t, r),
|
|
2272
|
+
nullable: !e.has(n) || dr(r, t)
|
|
2273
2273
|
}));
|
|
2274
2274
|
}
|
|
2275
2275
|
return [{
|
|
2276
|
-
description:
|
|
2276
|
+
description: cr(t, e),
|
|
2277
2277
|
handle: "output",
|
|
2278
2278
|
json_schema: e,
|
|
2279
|
-
nullable:
|
|
2279
|
+
nullable: dr(e)
|
|
2280
2280
|
}];
|
|
2281
2281
|
}
|
|
2282
|
-
function
|
|
2283
|
-
let n =
|
|
2282
|
+
function sr(e, t) {
|
|
2283
|
+
let n = V(t);
|
|
2284
2284
|
if (n == null) return t;
|
|
2285
2285
|
let r = Object.assign({}, n);
|
|
2286
2286
|
return r.$defs == null && e.$defs != null && (r.$defs = e.$defs), r.definitions == null && e.definitions != null && (r.definitions = e.definitions), r;
|
|
2287
2287
|
}
|
|
2288
|
-
function
|
|
2289
|
-
for (let n of
|
|
2288
|
+
function cr(e, t) {
|
|
2289
|
+
for (let n of fr(e, t)) if (typeof n.description == "string") return n.description;
|
|
2290
2290
|
}
|
|
2291
|
-
function
|
|
2292
|
-
for (let n of
|
|
2291
|
+
function lr(e, t, n) {
|
|
2292
|
+
for (let n of fr(e, t)) if (Object.hasOwn(n, "default")) return n.default;
|
|
2293
2293
|
return n ? null : void 0;
|
|
2294
2294
|
}
|
|
2295
|
-
function
|
|
2295
|
+
function ur(e) {
|
|
2296
2296
|
return Array.isArray(e) ? new Set(e.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set();
|
|
2297
2297
|
}
|
|
2298
|
-
function
|
|
2299
|
-
let r =
|
|
2298
|
+
function dr(e, t = e, n = /* @__PURE__ */ new Set()) {
|
|
2299
|
+
let r = V(e);
|
|
2300
2300
|
if (r == null) return !1;
|
|
2301
2301
|
if (Object.hasOwn(r, "type")) return r.type == "null" || Array.isArray(r.type) && r.type.includes("null");
|
|
2302
2302
|
if (Object.hasOwn(r, "enum")) return Array.isArray(r.enum) && r.enum.includes(null);
|
|
2303
|
-
for (let e of ["anyOf", "oneOf"]) if (Object.hasOwn(r, e)) return Array.isArray(r[e]) && r[e].some((e) =>
|
|
2303
|
+
for (let e of ["anyOf", "oneOf"]) if (Object.hasOwn(r, e)) return Array.isArray(r[e]) && r[e].some((e) => dr(e, t, n));
|
|
2304
2304
|
let i = typeof r.$ref == "string" ? r.$ref : void 0;
|
|
2305
2305
|
if (i == null || n.has(i)) return !1;
|
|
2306
|
-
let a =
|
|
2306
|
+
let a = pr(t, i);
|
|
2307
2307
|
if (a === void 0) return !1;
|
|
2308
2308
|
let o = new Set(n);
|
|
2309
|
-
return o.add(i),
|
|
2309
|
+
return o.add(i), dr(a, t, o);
|
|
2310
2310
|
}
|
|
2311
|
-
function
|
|
2311
|
+
function fr(e, t) {
|
|
2312
2312
|
let n = [], r = /* @__PURE__ */ new Set(), i = t;
|
|
2313
2313
|
for (;;) {
|
|
2314
|
-
let t =
|
|
2314
|
+
let t = V(i);
|
|
2315
2315
|
if (t == null) return n;
|
|
2316
2316
|
n.push(t);
|
|
2317
2317
|
let a = typeof t.$ref == "string" ? t.$ref : void 0;
|
|
2318
2318
|
if (a == null || r.has(a)) return n;
|
|
2319
|
-
let o =
|
|
2319
|
+
let o = pr(e, a);
|
|
2320
2320
|
if (o === void 0) return n;
|
|
2321
2321
|
r.add(a), i = o;
|
|
2322
2322
|
}
|
|
2323
2323
|
}
|
|
2324
|
-
function
|
|
2324
|
+
function pr(e, t) {
|
|
2325
2325
|
if (t == "#") return e;
|
|
2326
2326
|
if (!t.startsWith("#/")) return;
|
|
2327
2327
|
let n = e;
|
|
2328
2328
|
for (let e of t.slice(2).split("/")) {
|
|
2329
|
-
let t =
|
|
2329
|
+
let t = V(n), r = e.replaceAll("~1", "/").replaceAll("~0", "~");
|
|
2330
2330
|
if (t == null || !Object.hasOwn(t, r)) return;
|
|
2331
2331
|
n = t[r];
|
|
2332
2332
|
}
|
|
@@ -2334,15 +2334,15 @@ function dr(e, t) {
|
|
|
2334
2334
|
}
|
|
2335
2335
|
//#endregion
|
|
2336
2336
|
//#region src/workbench/browser/runtime/stores/proxyCatalog.ts
|
|
2337
|
-
function
|
|
2338
|
-
let n =
|
|
2339
|
-
if (n.success === !1) throw new
|
|
2340
|
-
if (n.success !== !0 || !Array.isArray(n.data)) return
|
|
2341
|
-
for (let e of n.data) t(
|
|
2337
|
+
function mr(e, t) {
|
|
2338
|
+
let n = Ie(e);
|
|
2339
|
+
if (n.success === !1) throw new I(502, typeof n.errorCode == "string" ? n.errorCode : "connector.unavailable", typeof n.message == "string" ? n.message : "Connector request failed.");
|
|
2340
|
+
if (n.success !== !0 || !Array.isArray(n.data)) return L();
|
|
2341
|
+
if (t != null) for (let e of n.data) t(Ie(e));
|
|
2342
2342
|
return n;
|
|
2343
2343
|
}
|
|
2344
|
-
function
|
|
2345
|
-
return !Array.isArray(e.authTypes) || e.authTypes.some((e) => typeof e != "string") ?
|
|
2344
|
+
function hr(e) {
|
|
2345
|
+
return !Array.isArray(e.authTypes) || e.authTypes.some((e) => typeof e != "string") ? L() : {
|
|
2346
2346
|
serviceId: B(e.service),
|
|
2347
2347
|
serviceName: B(e.displayName),
|
|
2348
2348
|
noSetup: e.authTypes.length == 1 && e.authTypes[0] == "no_auth",
|
|
@@ -2350,38 +2350,22 @@ function pr(e) {
|
|
|
2350
2350
|
...e.homepageUrl == null || e.homepageUrl === "" ? {} : { homepageUrl: B(e.homepageUrl) }
|
|
2351
2351
|
};
|
|
2352
2352
|
}
|
|
2353
|
-
function mr(e) {
|
|
2354
|
-
return typeof e.isDefault != "boolean" || typeof e.status != "string" || ![
|
|
2355
|
-
"active",
|
|
2356
|
-
"disconnected",
|
|
2357
|
-
"error",
|
|
2358
|
-
"reauth_required"
|
|
2359
|
-
].includes(e.status) ? H() : {
|
|
2360
|
-
connectionId: B(e.id),
|
|
2361
|
-
serviceId: B(e.service),
|
|
2362
|
-
displayName: B(e.displayName),
|
|
2363
|
-
isDefault: e.isDefault,
|
|
2364
|
-
status: e.status,
|
|
2365
|
-
...e.alias == null ? {} : { alias: B(e.alias) },
|
|
2366
|
-
...e.marketplace == null ? {} : { builtInAccount: !0 }
|
|
2367
|
-
};
|
|
2368
|
-
}
|
|
2369
|
-
function hr(e) {
|
|
2370
|
-
if (B(e.id), B(e.service), B(e.name), typeof e.description != "string") return H();
|
|
2371
|
-
nr(e.inputSchema, e.outputSchema);
|
|
2372
|
-
}
|
|
2373
2353
|
function gr(e) {
|
|
2354
|
+
if (B(e.id), B(e.service), B(e.name), typeof e.description != "string") return L();
|
|
2355
|
+
ir(e.inputSchema, e.outputSchema);
|
|
2356
|
+
}
|
|
2357
|
+
function _r(e) {
|
|
2374
2358
|
return {
|
|
2375
2359
|
nullable: e.nullable,
|
|
2376
|
-
jsonSchema:
|
|
2360
|
+
jsonSchema: ve(e.json_schema),
|
|
2377
2361
|
...e.description == null ? {} : { description: e.description },
|
|
2378
|
-
...e.value === void 0 ? {} : { value:
|
|
2362
|
+
...e.value === void 0 ? {} : { value: ve(e.value) }
|
|
2379
2363
|
};
|
|
2380
2364
|
}
|
|
2381
|
-
function
|
|
2365
|
+
function vr(e, t) {
|
|
2382
2366
|
let n = t.data.find((t) => t.service == e.service);
|
|
2383
|
-
if (n == null) return
|
|
2384
|
-
let r =
|
|
2367
|
+
if (n == null) return L();
|
|
2368
|
+
let r = hr(n), i = ir(e.inputSchema, e.outputSchema);
|
|
2385
2369
|
return {
|
|
2386
2370
|
serviceId: r.serviceId,
|
|
2387
2371
|
serviceName: r.serviceName,
|
|
@@ -2392,19 +2376,19 @@ function _r(e, t) {
|
|
|
2392
2376
|
name: B(e.name),
|
|
2393
2377
|
description: e.description,
|
|
2394
2378
|
authenticated: !n.authTypes.includes("no_auth"),
|
|
2395
|
-
inputSchema:
|
|
2396
|
-
outputSchema:
|
|
2397
|
-
inputs: Object.fromEntries(i.inputs.map((e) => [e.handle,
|
|
2398
|
-
outputs: Object.fromEntries(i.outputs.map((e) => [e.handle,
|
|
2379
|
+
inputSchema: ve(e.inputSchema),
|
|
2380
|
+
outputSchema: ve(e.outputSchema),
|
|
2381
|
+
inputs: Object.fromEntries(i.inputs.map((e) => [e.handle, _r(e)])),
|
|
2382
|
+
outputs: Object.fromEntries(i.outputs.map((e) => [e.handle, _r(e)]))
|
|
2399
2383
|
};
|
|
2400
2384
|
}
|
|
2401
2385
|
//#endregion
|
|
2402
2386
|
//#region src/workbench/browser/runtime/stores/catalogStores.ts
|
|
2403
|
-
function
|
|
2404
|
-
let t =
|
|
2405
|
-
return t.version != 1 || !Array.isArray(t.actions) ?
|
|
2387
|
+
function yr(e) {
|
|
2388
|
+
let t = Ie(e);
|
|
2389
|
+
return t.version != 1 || !Array.isArray(t.actions) ? L() : t.actions.map(Ne);
|
|
2406
2390
|
}
|
|
2407
|
-
var
|
|
2391
|
+
var br = (...e) => JSON.stringify(e), xr = class {
|
|
2408
2392
|
constructor(e, t, n) {
|
|
2409
2393
|
this.client = e, this.kind = t, this.options = n, this.entries = /* @__PURE__ */ new Map();
|
|
2410
2394
|
}
|
|
@@ -2415,15 +2399,13 @@ var yr = (...e) => JSON.stringify(e), br = class {
|
|
|
2415
2399
|
...t == null ? {} : { locale: t }
|
|
2416
2400
|
}), a = `/v1/connector/proxy/${this.kind}${i.size ? `?${i}` : ""}`, o = this.entries.get(a);
|
|
2417
2401
|
if (o == null) {
|
|
2418
|
-
let e = (e) =>
|
|
2419
|
-
|
|
2420
|
-
});
|
|
2421
|
-
o = new ke((t, n) => this.client.readProxyCatalog({
|
|
2402
|
+
let e = (e) => mr(e, this.kind == "providers" ? hr : void 0);
|
|
2403
|
+
o = new Oe((t, n) => this.client.readProxyCatalog({
|
|
2422
2404
|
path: a,
|
|
2423
2405
|
decode: e
|
|
2424
2406
|
}, t, n), this.kind == "providers" ? 3e5 : 3e4, this.options == null ? void 0 : {
|
|
2425
2407
|
key: `open-flow:proxy:${this.kind}:v1:${encodeURIComponent(this.options.namespace)}:${a}`,
|
|
2426
|
-
storage: () => this.
|
|
2408
|
+
storage: () => this.options.localStorage ?? window.localStorage,
|
|
2427
2409
|
decode: e
|
|
2428
2410
|
}), this.entries.set(a, o);
|
|
2429
2411
|
}
|
|
@@ -2439,7 +2421,7 @@ var yr = (...e) => JSON.stringify(e), br = class {
|
|
|
2439
2421
|
for (let e of this.entries.values()) e.dispose();
|
|
2440
2422
|
this.entries.clear();
|
|
2441
2423
|
}
|
|
2442
|
-
},
|
|
2424
|
+
}, Sr = class {
|
|
2443
2425
|
constructor() {
|
|
2444
2426
|
this.entries = /* @__PURE__ */ new Map();
|
|
2445
2427
|
}
|
|
@@ -2477,13 +2459,13 @@ var yr = (...e) => JSON.stringify(e), br = class {
|
|
|
2477
2459
|
for (let e of this.entries.values()) e.dispose();
|
|
2478
2460
|
this.entries.clear();
|
|
2479
2461
|
}
|
|
2480
|
-
},
|
|
2481
|
-
#e = new
|
|
2462
|
+
}, Cr = class {
|
|
2463
|
+
#e = new Sr();
|
|
2482
2464
|
constructor(e, t) {
|
|
2483
|
-
this.raw = new
|
|
2465
|
+
this.raw = new xr(e, "providers", t);
|
|
2484
2466
|
}
|
|
2485
2467
|
get(e, t = "en", n = !1) {
|
|
2486
|
-
return this.#e.get(
|
|
2468
|
+
return this.#e.get(br(e, t), [this.raw.get(e, t, void 0, n)], (e) => e.data.map(hr));
|
|
2487
2469
|
}
|
|
2488
2470
|
retryFailed() {
|
|
2489
2471
|
this.raw.retryFailed();
|
|
@@ -2494,50 +2476,79 @@ var yr = (...e) => JSON.stringify(e), br = class {
|
|
|
2494
2476
|
dispose() {
|
|
2495
2477
|
this.#e.dispose(), this.raw.dispose();
|
|
2496
2478
|
}
|
|
2497
|
-
},
|
|
2498
|
-
#e;
|
|
2499
|
-
#t = new
|
|
2479
|
+
}, wr = class {
|
|
2480
|
+
#e = /* @__PURE__ */ new Map();
|
|
2481
|
+
#t = /* @__PURE__ */ new Map();
|
|
2500
2482
|
constructor(e, t) {
|
|
2501
|
-
this
|
|
2483
|
+
this.client = e, this.options = t;
|
|
2502
2484
|
}
|
|
2503
|
-
get(
|
|
2504
|
-
|
|
2485
|
+
get(t, n, r = !1) {
|
|
2486
|
+
let i = this.#e.get(n);
|
|
2487
|
+
if (i == null) {
|
|
2488
|
+
let e = w(n);
|
|
2489
|
+
i = new Oe((t, n) => this.client.readCatalog(e, t, n), 3e4, this.options == null ? void 0 : {
|
|
2490
|
+
key: `open-flow:connections:v1:${encodeURIComponent(this.options.namespace)}:${e.path}`,
|
|
2491
|
+
storage: () => this.options.sessionStorage ?? window.sessionStorage,
|
|
2492
|
+
decode: (e) => Array.isArray(e) ? e.map(We) : L()
|
|
2493
|
+
}), this.#e.set(n, i);
|
|
2494
|
+
}
|
|
2495
|
+
let a = i.get(r);
|
|
2496
|
+
if (t == null) return a;
|
|
2497
|
+
let o = br(n, t), s = this.#t.get(o);
|
|
2498
|
+
return s ?? (s = e(a, (e) => ({
|
|
2499
|
+
...e,
|
|
2500
|
+
data: e.data?.filter((e) => e.serviceId == t)
|
|
2501
|
+
})), this.#t.set(o, s)), s;
|
|
2505
2502
|
}
|
|
2506
2503
|
retryFailed() {
|
|
2507
|
-
this.#e.
|
|
2504
|
+
for (let e of this.#e.values()) e.state.value.error != null && e.refresh();
|
|
2508
2505
|
}
|
|
2509
2506
|
refreshFlow(e) {
|
|
2510
|
-
this.#e.
|
|
2507
|
+
this.#e.get(e)?.refresh(!0);
|
|
2511
2508
|
}
|
|
2512
2509
|
dispose() {
|
|
2513
|
-
this.#t.
|
|
2510
|
+
for (let e of this.#t.values()) e.dispose();
|
|
2511
|
+
this.#t.clear();
|
|
2512
|
+
for (let e of this.#e.values()) e.dispose();
|
|
2513
|
+
this.#e.clear();
|
|
2514
2514
|
}
|
|
2515
|
-
},
|
|
2515
|
+
}, Tr = class {
|
|
2516
2516
|
#e;
|
|
2517
|
-
#t = new
|
|
2517
|
+
#t = new Sr();
|
|
2518
2518
|
#n = /* @__PURE__ */ new Map();
|
|
2519
2519
|
#r = /* @__PURE__ */ new Set();
|
|
2520
2520
|
#i = /* @__PURE__ */ new WeakMap();
|
|
2521
2521
|
constructor(e, t, n) {
|
|
2522
|
-
this.client = e, this.providers = t, this.#e = new
|
|
2522
|
+
this.client = e, this.providers = t, this.#e = new xr(e, "actions", n);
|
|
2523
2523
|
}
|
|
2524
2524
|
get(e, t, n = "en", r = !1) {
|
|
2525
|
-
return this.#t.get(
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
let n = me(t);
|
|
2536
|
-
if (n.version != 1) return H();
|
|
2537
|
-
let r = Se(n.action);
|
|
2538
|
-
return r.actionId == e ? r : H();
|
|
2525
|
+
return this.#t.get(br(t, e, n), [this.#e.get(t, n, e, r), this.providers.raw.get(t, n)], (t, n) => t.data.flatMap((t) => {
|
|
2526
|
+
try {
|
|
2527
|
+
let r = Ie(t);
|
|
2528
|
+
return gr(r), r.service == e ? [vr(r, n)] : L();
|
|
2529
|
+
} catch (n) {
|
|
2530
|
+
return console.warn("Could not load Connector Action.", {
|
|
2531
|
+
serviceId: e,
|
|
2532
|
+
actionId: t?.id,
|
|
2533
|
+
error: n
|
|
2534
|
+
}), [];
|
|
2539
2535
|
}
|
|
2540
|
-
}
|
|
2536
|
+
}));
|
|
2537
|
+
}
|
|
2538
|
+
detail(t, n, r = "en", i = !1) {
|
|
2539
|
+
let a = t.split(".")[0], o = this.get(a, n, r, i), s = br(n, t, r), c = this.#n.get(s);
|
|
2540
|
+
if (c == null) {
|
|
2541
|
+
let n = new I(404, "connector.action-not-found", `Connector Action "${t}" was not found.`);
|
|
2542
|
+
c = e(o, (e) => {
|
|
2543
|
+
let r = e.data?.find((e) => e.actionId == t);
|
|
2544
|
+
return {
|
|
2545
|
+
data: r,
|
|
2546
|
+
refreshing: e.refreshing,
|
|
2547
|
+
error: e.error ?? (e.data != null && r == null && !e.refreshing ? n : void 0)
|
|
2548
|
+
};
|
|
2549
|
+
}), this.#n.set(s, c);
|
|
2550
|
+
}
|
|
2551
|
+
return c;
|
|
2541
2552
|
}
|
|
2542
2553
|
search(e, t, n, r) {
|
|
2543
2554
|
let i = new URLSearchParams({
|
|
@@ -2555,19 +2566,17 @@ var yr = (...e) => JSON.stringify(e), br = class {
|
|
|
2555
2566
|
}
|
|
2556
2567
|
let s = o.get(a);
|
|
2557
2568
|
if (s != null) return s.refresh(), s;
|
|
2558
|
-
let c = new
|
|
2569
|
+
let c = new Oe((e, t) => this.client.readCatalog({
|
|
2559
2570
|
path: `/v1/connector/action-metadata?${i}`,
|
|
2560
|
-
decode:
|
|
2571
|
+
decode: yr
|
|
2561
2572
|
}, null, t), 3e4);
|
|
2562
2573
|
return r.aborted ? c.dispose() : (o.set(a, c), this.#r.add(c)), c;
|
|
2563
2574
|
}
|
|
2564
2575
|
retryFailed() {
|
|
2565
2576
|
this.#e.retryFailed();
|
|
2566
|
-
for (let e of this.#n.values()) e.state.value.error != null && e.refresh();
|
|
2567
2577
|
}
|
|
2568
2578
|
refreshFlow(e) {
|
|
2569
2579
|
this.#e.refreshFlow(e);
|
|
2570
|
-
for (let [t, n] of this.#n) new URL(t, "https://open-flow.invalid").searchParams.get("flowId") == e && n.refresh(!0);
|
|
2571
2580
|
}
|
|
2572
2581
|
dispose() {
|
|
2573
2582
|
for (let e of this.#r) e.dispose();
|
|
@@ -2575,9 +2584,9 @@ var yr = (...e) => JSON.stringify(e), br = class {
|
|
|
2575
2584
|
for (let e of this.#n.values()) e.dispose();
|
|
2576
2585
|
this.#n.clear(), this.#t.dispose(), this.#e.dispose();
|
|
2577
2586
|
}
|
|
2578
|
-
},
|
|
2587
|
+
}, Er = class {
|
|
2579
2588
|
constructor(e, t) {
|
|
2580
|
-
this.providers = new
|
|
2589
|
+
this.providers = new Cr(e, t), this.actions = new Tr(e, this.providers, t), this.connections = new wr(e, t);
|
|
2581
2590
|
}
|
|
2582
2591
|
dispose() {
|
|
2583
2592
|
this.actions.dispose(), this.connections.dispose(), this.providers.dispose();
|
|
@@ -2585,38 +2594,37 @@ var yr = (...e) => JSON.stringify(e), br = class {
|
|
|
2585
2594
|
refreshFlow(e) {
|
|
2586
2595
|
this.actions.refreshFlow(e), this.connections.refreshFlow(e), this.providers.refreshFlow(e);
|
|
2587
2596
|
}
|
|
2588
|
-
},
|
|
2597
|
+
}, Dr = {
|
|
2589
2598
|
candidates: {},
|
|
2590
2599
|
candidateErrors: [],
|
|
2591
2600
|
loading: !1,
|
|
2592
2601
|
loadingCandidates: []
|
|
2593
|
-
},
|
|
2602
|
+
}, Or = class {
|
|
2594
2603
|
#e;
|
|
2595
2604
|
#t;
|
|
2596
2605
|
#n;
|
|
2597
2606
|
#r;
|
|
2607
|
+
#i;
|
|
2598
2608
|
constructor(e, t, r = h(), i = () => {}) {
|
|
2599
|
-
this.client = e, this.setNotice = t, this.i18n = r, this.onSaved = i, this.#e = n(
|
|
2609
|
+
this.client = e, this.setNotice = t, this.i18n = r, this.onSaved = i, this.#e = n(Dr), this.#n = 0, this.#r = !1, this.#i = new AbortController(), this.$ = this.#e;
|
|
2600
2610
|
}
|
|
2601
2611
|
async load(e) {
|
|
2602
2612
|
let t = e != null && e == this.#t && this.#e.value.access != null, n = ++this.#n;
|
|
2603
|
-
if (this.#t = e, t || this.#e.set(e == null ?
|
|
2604
|
-
...
|
|
2613
|
+
if (this.#t = e, t || (this.#i.abort(), this.#i = new AbortController(), this.#e.set(e == null ? Dr : {
|
|
2614
|
+
...Dr,
|
|
2605
2615
|
loading: !0
|
|
2606
|
-
}), e != null) try {
|
|
2607
|
-
let
|
|
2616
|
+
})), e != null) try {
|
|
2617
|
+
let t = await this.client.getConnectorAccess(e);
|
|
2608
2618
|
if (!this.#r && n == this.#n) {
|
|
2609
|
-
let e = this.#e.value, n = e.access != null && e.access.accessRevision >
|
|
2610
|
-
this.#e.set(
|
|
2619
|
+
let e = this.#e.value, n = e.access != null && e.access.accessRevision > t.accessRevision ? e.access : t;
|
|
2620
|
+
this.#e.set({
|
|
2611
2621
|
...e,
|
|
2612
|
-
access: n
|
|
2613
|
-
|
|
2614
|
-
...Er,
|
|
2615
|
-
access: n
|
|
2622
|
+
access: n,
|
|
2623
|
+
loading: !1
|
|
2616
2624
|
});
|
|
2617
2625
|
}
|
|
2618
2626
|
} catch (e) {
|
|
2619
|
-
!this.#r && n == this.#n && (t || this.#e.set(
|
|
2627
|
+
!this.#r && n == this.#n && (t || this.#e.set(Dr), this.setNotice(F(e, this.i18n.t)));
|
|
2620
2628
|
}
|
|
2621
2629
|
}
|
|
2622
2630
|
changed(e) {
|
|
@@ -2625,77 +2633,115 @@ var yr = (...e) => JSON.stringify(e), br = class {
|
|
|
2625
2633
|
configure(e) {
|
|
2626
2634
|
this.#r || this.#t == null || (this.#e.set({
|
|
2627
2635
|
...this.#e.value,
|
|
2628
|
-
configuration: { providerId: e }
|
|
2629
|
-
}), this.loadCandidates(e));
|
|
2630
|
-
}
|
|
2631
|
-
async loadCandidates(e) {
|
|
2632
|
-
let
|
|
2633
|
-
if (
|
|
2636
|
+
configuration: e == null ? {} : { providerId: e }
|
|
2637
|
+
}), e != null && this.loadCandidates([e], !0));
|
|
2638
|
+
}
|
|
2639
|
+
async loadCandidates(e, t = !1) {
|
|
2640
|
+
let n = this.#t, r = this.#e.value;
|
|
2641
|
+
if (this.#r || n == null || r.access?.mode != "selectable") return;
|
|
2642
|
+
let i = [...new Set(e)].filter((e) => !r.loadingCandidates.includes(e) && (t || r.candidates[e] == null && !r.candidateErrors.includes(e)));
|
|
2643
|
+
if (i.length == 0) return;
|
|
2644
|
+
let a = this.#i.signal;
|
|
2645
|
+
this.#e.set({
|
|
2646
|
+
...r,
|
|
2647
|
+
candidateErrors: r.candidateErrors.filter((e) => !i.includes(e)),
|
|
2648
|
+
loadingCandidates: [...r.loadingCandidates, ...i]
|
|
2649
|
+
});
|
|
2650
|
+
try {
|
|
2651
|
+
let e = await this.client.listProviderAccessBindingCandidates(n, i, a);
|
|
2652
|
+
if (a.aborted) return;
|
|
2653
|
+
let t = this.#e.value, r = { ...t.candidates }, o = [...t.candidateErrors];
|
|
2654
|
+
for (let t of e.results) "error" in t ? o.push(t.providerId) : r[t.providerId] = t;
|
|
2634
2655
|
this.#e.set({
|
|
2635
|
-
...
|
|
2636
|
-
|
|
2637
|
-
|
|
2656
|
+
...t,
|
|
2657
|
+
candidates: r,
|
|
2658
|
+
candidateErrors: o,
|
|
2659
|
+
loadingCandidates: t.loadingCandidates.filter((e) => !i.includes(e))
|
|
2638
2660
|
});
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
loadingCandidates: r.loadingCandidates.filter((t) => t != e)
|
|
2650
|
-
});
|
|
2651
|
-
} catch (n) {
|
|
2652
|
-
if (this.#r || t != this.#t) return;
|
|
2653
|
-
let r = this.#e.value;
|
|
2654
|
-
this.#e.set({
|
|
2655
|
-
...r,
|
|
2656
|
-
candidateErrors: [...r.candidateErrors.filter((t) => t != e), e],
|
|
2657
|
-
loadingCandidates: r.loadingCandidates.filter((t) => t != e)
|
|
2658
|
-
}), this.setNotice(L(n, this.i18n.t));
|
|
2659
|
-
}
|
|
2661
|
+
let s = e.results.find((e) => "error" in e);
|
|
2662
|
+
s != null && "error" in s && this.setNotice(F(new I(502, s.error.code, s.error.message), this.i18n.t));
|
|
2663
|
+
} catch (e) {
|
|
2664
|
+
if (a.aborted) return;
|
|
2665
|
+
let t = this.#e.value;
|
|
2666
|
+
this.#e.set({
|
|
2667
|
+
...t,
|
|
2668
|
+
candidateErrors: [...t.candidateErrors, ...i],
|
|
2669
|
+
loadingCandidates: t.loadingCandidates.filter((e) => !i.includes(e))
|
|
2670
|
+
}), this.setNotice(F(e, this.i18n.t));
|
|
2660
2671
|
}
|
|
2661
2672
|
}
|
|
2662
2673
|
async select(e, t, n = !0) {
|
|
2663
2674
|
let r = this.#t, i = this.#e.value.access;
|
|
2664
|
-
if (r == null || i?.mode != "selectable" || this.#e.value.savingProviderId != null) return !1;
|
|
2675
|
+
if (this.#r || r == null || i?.mode != "selectable" || this.#e.value.savingProviderId != null) return !1;
|
|
2665
2676
|
this.#e.set({
|
|
2666
2677
|
...this.#e.value,
|
|
2667
|
-
savingProviderId: e
|
|
2678
|
+
savingProviderId: e,
|
|
2679
|
+
pendingSelection: {
|
|
2680
|
+
providerId: e,
|
|
2681
|
+
accessBindingId: t,
|
|
2682
|
+
selected: n
|
|
2683
|
+
}
|
|
2668
2684
|
});
|
|
2669
2685
|
try {
|
|
2670
2686
|
let a = n ? await this.client.addProviderAccessBinding(r, e, t, i.accessRevision) : await this.client.removeProviderAccessBinding(r, e, t, i.accessRevision);
|
|
2671
|
-
if (!this.#r && r == this.#t)
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2687
|
+
if (!this.#r && r == this.#t) {
|
|
2688
|
+
let e = this.#e.value.access;
|
|
2689
|
+
return this.#e.set({
|
|
2690
|
+
...this.#e.value,
|
|
2691
|
+
access: e != null && e.accessRevision > a.accessRevision ? e : a,
|
|
2692
|
+
savingProviderId: void 0,
|
|
2693
|
+
pendingSelection: void 0
|
|
2694
|
+
}), this.onSaved(r), !0;
|
|
2695
|
+
}
|
|
2676
2696
|
} catch (e) {
|
|
2677
2697
|
if (this.#r || r != this.#t) return !1;
|
|
2678
2698
|
this.#e.set({
|
|
2679
2699
|
...this.#e.value,
|
|
2680
|
-
savingProviderId: void 0
|
|
2681
|
-
|
|
2700
|
+
savingProviderId: void 0,
|
|
2701
|
+
pendingSelection: void 0
|
|
2702
|
+
}), this.setNotice(F(e, this.i18n.t)), await this.load(r);
|
|
2682
2703
|
}
|
|
2683
2704
|
return !1;
|
|
2684
2705
|
}
|
|
2706
|
+
async setService(e, t) {
|
|
2707
|
+
let n = this.#t, r = this.#e.value.access;
|
|
2708
|
+
if (this.#r || n == null || r?.mode != "selectable" || this.#e.value.savingProviderId != null) return !1;
|
|
2709
|
+
this.#e.set({
|
|
2710
|
+
...this.#e.value,
|
|
2711
|
+
savingProviderId: e
|
|
2712
|
+
});
|
|
2713
|
+
try {
|
|
2714
|
+
let i = await this.client.setConnectorService(n, e, t, r.accessRevision);
|
|
2715
|
+
if (this.#r || n != this.#t) return !1;
|
|
2716
|
+
let a = this.#e.value.access;
|
|
2717
|
+
return this.#e.set({
|
|
2718
|
+
...this.#e.value,
|
|
2719
|
+
access: a != null && a.accessRevision > i.accessRevision ? a : i,
|
|
2720
|
+
savingProviderId: void 0,
|
|
2721
|
+
...!t && this.#e.value.configuration?.providerId == e ? { configuration: {} } : {}
|
|
2722
|
+
}), this.onSaved(n), t && this.configure(e), !0;
|
|
2723
|
+
} catch (e) {
|
|
2724
|
+
return this.#r || n != this.#t ? !1 : (this.#e.set({
|
|
2725
|
+
...this.#e.value,
|
|
2726
|
+
savingProviderId: void 0,
|
|
2727
|
+
pendingSelection: void 0
|
|
2728
|
+
}), this.setNotice(F(e, this.i18n.t)), await this.load(n), !1);
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2685
2731
|
dispose() {
|
|
2686
|
-
this.#r = !0, this.#n += 1, this.#e.dispose();
|
|
2732
|
+
this.#r = !0, this.#i.abort(), this.#n += 1, this.#e.dispose();
|
|
2687
2733
|
}
|
|
2688
2734
|
};
|
|
2689
2735
|
//#endregion
|
|
2690
2736
|
//#region src/workbench/browser/runtime/connectionCatalog.ts
|
|
2691
|
-
function
|
|
2692
|
-
let n = e.authenticated && t != null ?
|
|
2737
|
+
function kr(e, t) {
|
|
2738
|
+
let n = e.authenticated && t != null ? $(t).preferred : void 0;
|
|
2693
2739
|
return {
|
|
2694
2740
|
...e,
|
|
2695
2741
|
...n == null ? {} : { defaultConnection: n }
|
|
2696
2742
|
};
|
|
2697
2743
|
}
|
|
2698
|
-
function
|
|
2744
|
+
function $(e) {
|
|
2699
2745
|
let t = [], n = /* @__PURE__ */ new Map(), r;
|
|
2700
2746
|
for (let i of e) n.set(i.connectionId, i), i.status == "active" && (t.push(i), i.isDefault && (r = i));
|
|
2701
2747
|
return {
|
|
@@ -2723,7 +2769,7 @@ function Mr(e, t) {
|
|
|
2723
2769
|
service: e.serviceName
|
|
2724
2770
|
}) : e.description,
|
|
2725
2771
|
group: t("addNode.connectorActions"),
|
|
2726
|
-
icon:
|
|
2772
|
+
icon: k(e),
|
|
2727
2773
|
id: `connector:${e.actionId}`,
|
|
2728
2774
|
inputs: jr(e.inputs),
|
|
2729
2775
|
kind: "connector",
|
|
@@ -2750,7 +2796,7 @@ function Nr(e, t) {
|
|
|
2750
2796
|
choices: r,
|
|
2751
2797
|
description: t(r.length == 1 ? "addNode.connectorActionCountOne" : "addNode.connectorActionCount", { count: r.length }),
|
|
2752
2798
|
group: t("addNode.connectorActions"),
|
|
2753
|
-
icon:
|
|
2799
|
+
icon: k(n),
|
|
2754
2800
|
id: `connector-provider:${n.serviceId}`,
|
|
2755
2801
|
inputs: [],
|
|
2756
2802
|
kind: "connector-group",
|
|
@@ -2765,7 +2811,7 @@ function Pr(e, t) {
|
|
|
2765
2811
|
choices: [],
|
|
2766
2812
|
description: t("addNode.connectorBrowseActions"),
|
|
2767
2813
|
group: t("addNode.connectorActions"),
|
|
2768
|
-
icon:
|
|
2814
|
+
icon: k(e),
|
|
2769
2815
|
id: `connector-provider:${e.serviceId}`,
|
|
2770
2816
|
inputs: [],
|
|
2771
2817
|
kind: "connector-group",
|
|
@@ -2790,7 +2836,7 @@ function Fr(e, t) {
|
|
|
2790
2836
|
function Ir(e, t, n) {
|
|
2791
2837
|
if (e == null) return [];
|
|
2792
2838
|
let r = [];
|
|
2793
|
-
for (let i of [...
|
|
2839
|
+
for (let i of [...Ge(e.revision.content).tasks].toSorted()) {
|
|
2794
2840
|
let a = e.task(i);
|
|
2795
2841
|
if (a?.executor.kind != "connector") continue;
|
|
2796
2842
|
let o = t[a.executor.action];
|
|
@@ -2826,12 +2872,12 @@ var Lr = class {
|
|
|
2826
2872
|
#h;
|
|
2827
2873
|
#g;
|
|
2828
2874
|
constructor(r, i, a, o, s = h(), c = i.catalogs) {
|
|
2829
|
-
this.data = c, this.#i = /* @__PURE__ */ new Set(), this.#a = new
|
|
2875
|
+
this.data = c, this.#i = /* @__PURE__ */ new Set(), this.#a = new E(), this.#o = new E(), this.#d = n(Ar), this.#f = n([]), this.#p = n([]), this.#g = !1, this.loadConnections = async (e) => {
|
|
2830
2876
|
let t = this.#m.$.flowId.value;
|
|
2831
|
-
this.#g || t == null || await
|
|
2877
|
+
this.#g || t == null || await O(this.data.connections.get(void 0), e);
|
|
2832
2878
|
}, this.browseAddNodeOptions = (e) => {
|
|
2833
2879
|
let t = this.data.providers.get(void 0, this.#n);
|
|
2834
|
-
return
|
|
2880
|
+
return A(e, (e) => {
|
|
2835
2881
|
let n = e(t), r = e(this.#t.t$);
|
|
2836
2882
|
return {
|
|
2837
2883
|
...n,
|
|
@@ -2840,11 +2886,11 @@ var Lr = class {
|
|
|
2840
2886
|
});
|
|
2841
2887
|
}, this.provideAddNodeOptionChoices = (e, t) => {
|
|
2842
2888
|
let n = e.slice(19), r = this.data.actions.get(n, void 0, this.#n), i = this.data.providers.get(void 0, this.#n);
|
|
2843
|
-
return
|
|
2889
|
+
return A(t, (e) => {
|
|
2844
2890
|
let t = e(r), a = e(i).data?.find((e) => e.serviceId == n), o = e(this.#t.t$);
|
|
2845
2891
|
return {
|
|
2846
2892
|
...t,
|
|
2847
|
-
data: t.data?.map((e) => Mr(
|
|
2893
|
+
data: t.data?.map((e) => Mr(kr({
|
|
2848
2894
|
...e,
|
|
2849
2895
|
...a == null ? {} : {
|
|
2850
2896
|
serviceName: a.serviceName,
|
|
@@ -2855,17 +2901,17 @@ var Lr = class {
|
|
|
2855
2901
|
});
|
|
2856
2902
|
}, this.provideAddNodeOptions = (e, t, n = t) => {
|
|
2857
2903
|
let r = e.trim();
|
|
2858
|
-
if (r.length == 0) return
|
|
2904
|
+
if (r.length == 0) return A(t, (e) => ({
|
|
2859
2905
|
data: Nr(Object.values(e(this.$.actions)), e(this.#t.t$)),
|
|
2860
2906
|
refreshing: !1,
|
|
2861
2907
|
error: void 0
|
|
2862
2908
|
}));
|
|
2863
2909
|
let i = this.data.actions.search(r, void 0, this.#n, n).get();
|
|
2864
|
-
return
|
|
2910
|
+
return A(t, (e) => {
|
|
2865
2911
|
let t = e(i), n = e(this.#t.t$);
|
|
2866
2912
|
return {
|
|
2867
2913
|
...t,
|
|
2868
|
-
data: t.data?.map((e) => Mr(
|
|
2914
|
+
data: t.data?.map((e) => Mr(kr(e, void 0), n))
|
|
2869
2915
|
};
|
|
2870
2916
|
});
|
|
2871
2917
|
}, this.retryCatalog = () => {
|
|
@@ -2875,13 +2921,13 @@ var Lr = class {
|
|
|
2875
2921
|
let t = e(i.$.flowId);
|
|
2876
2922
|
return Object.fromEntries(e(this.#f).flatMap((n) => {
|
|
2877
2923
|
let r = e(R(this.data.actions.detail(n, t, this.#n)));
|
|
2878
|
-
return r == null ? [] : [[n,
|
|
2924
|
+
return r == null ? [] : [[n, kr(r, e(R(this.data.connections.get(r.serviceId, t))))]];
|
|
2879
2925
|
}));
|
|
2880
2926
|
}), u = t((e) => {
|
|
2881
2927
|
let t = e(i.$.flowId);
|
|
2882
2928
|
return Object.fromEntries(e(this.#p).flatMap((n) => {
|
|
2883
2929
|
let r = e(R(this.data.connections.get(n, t)));
|
|
2884
|
-
return r == null ? [] : [[n,
|
|
2930
|
+
return r == null ? [] : [[n, $(r)]];
|
|
2885
2931
|
}));
|
|
2886
2932
|
});
|
|
2887
2933
|
this.#l = t((e) => {
|
|
@@ -2891,13 +2937,13 @@ var Lr = class {
|
|
|
2891
2937
|
return {
|
|
2892
2938
|
action: r,
|
|
2893
2939
|
actionError: o == null ? void 0 : {
|
|
2894
|
-
...o instanceof
|
|
2895
|
-
message:
|
|
2940
|
+
...o instanceof I ? { code: o.code } : {},
|
|
2941
|
+
message: F(o, this.#t.t).message
|
|
2896
2942
|
},
|
|
2897
2943
|
activeConnections: a?.active,
|
|
2898
2944
|
authorizationPending: r != null && n.authorizationServiceId == r.serviceId,
|
|
2899
2945
|
connection: c,
|
|
2900
|
-
connectionError: s == null ? void 0 :
|
|
2946
|
+
connectionError: s == null ? void 0 : F(s, this.#t.t).message
|
|
2901
2947
|
};
|
|
2902
2948
|
}), this.$ = {
|
|
2903
2949
|
pickerConnections: t((e) => e(i.$.flowId) == null ? [] : e(R(this.data.connections.get(void 0))) ?? []),
|
|
@@ -2933,10 +2979,10 @@ var Lr = class {
|
|
|
2933
2979
|
let t = this.#m.$.flowId.value;
|
|
2934
2980
|
if (t == null || this.#g) throw Error("Connector Action cannot be resolved without an active Flow.");
|
|
2935
2981
|
await Promise.resolve();
|
|
2936
|
-
let n = await
|
|
2982
|
+
let n = await O(this.data.actions.detail(e, t, this.#n), void 0, !0), r = n.authenticated ? await O(this.data.connections.get(n.serviceId, t), void 0, !0) : [];
|
|
2937
2983
|
return this.#b(this.#f, [e]), n.authenticated && this.#b(this.#p, [n.serviceId]), {
|
|
2938
|
-
action:
|
|
2939
|
-
connections:
|
|
2984
|
+
action: kr(n, r),
|
|
2985
|
+
connections: $(r).active
|
|
2940
2986
|
};
|
|
2941
2987
|
}
|
|
2942
2988
|
async refresh(e = !1) {
|
|
@@ -2958,13 +3004,13 @@ var Lr = class {
|
|
|
2958
3004
|
});
|
|
2959
3005
|
try {
|
|
2960
3006
|
await Promise.resolve();
|
|
2961
|
-
let a = await
|
|
3007
|
+
let a = await O(i, void 0, e);
|
|
2962
3008
|
if (!this.#S(t, n)) return;
|
|
2963
3009
|
this.#b(this.#f, [a.actionId]), a.authenticated && await this.#_(n, r, a.serviceId, e, t);
|
|
2964
3010
|
} catch (e) {
|
|
2965
3011
|
this.#S(t, n) && this.#x({ actionError: {
|
|
2966
3012
|
actionId: r.actionId,
|
|
2967
|
-
message:
|
|
3013
|
+
message: F(e, this.#t.t).message
|
|
2968
3014
|
} });
|
|
2969
3015
|
} finally {
|
|
2970
3016
|
this.#S(t, n) && this.#d.value.actionLoading == r.actionId && this.#x({ actionLoading: void 0 });
|
|
@@ -2972,11 +3018,11 @@ var Lr = class {
|
|
|
2972
3018
|
}
|
|
2973
3019
|
async loadCodeConnections(e, t) {
|
|
2974
3020
|
let n = this.#m.$.flowId.value;
|
|
2975
|
-
n == null || this.#g || (await
|
|
3021
|
+
n == null || this.#g || (await O(this.data.connections.get(e, n), t), !(t.aborted || this.#g || n != this.#m.$.flowId.value) && this.#b(this.#p, [e]));
|
|
2976
3022
|
}
|
|
2977
3023
|
async loadCodeAction(e, t) {
|
|
2978
3024
|
let n = this.#n, r = this.#m.$.flowId.value;
|
|
2979
|
-
r == null || this.#g || (await
|
|
3025
|
+
r == null || this.#g || (await O(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]));
|
|
2980
3026
|
}
|
|
2981
3027
|
async connect(e) {
|
|
2982
3028
|
if (this.#g) return;
|
|
@@ -2997,7 +3043,7 @@ var Lr = class {
|
|
|
2997
3043
|
serviceId: e
|
|
2998
3044
|
}, this.#x({ authorizationServiceId: e });
|
|
2999
3045
|
} catch (e) {
|
|
3000
|
-
this.#g || this.#u(
|
|
3046
|
+
this.#g || this.#u(F(e, this.#t.t));
|
|
3001
3047
|
}
|
|
3002
3048
|
}
|
|
3003
3049
|
async setConnection(e, t) {
|
|
@@ -3023,16 +3069,16 @@ var Lr = class {
|
|
|
3023
3069
|
let i;
|
|
3024
3070
|
try {
|
|
3025
3071
|
let r = this.data.connections.get(t, e, n);
|
|
3026
|
-
await Promise.resolve(), i = await
|
|
3072
|
+
await Promise.resolve(), i = await O(r, void 0, n);
|
|
3027
3073
|
} catch (n) {
|
|
3028
3074
|
this.#S(r, e) && this.#x({ connectionError: {
|
|
3029
|
-
message:
|
|
3075
|
+
message: F(n, this.#t.t).message,
|
|
3030
3076
|
serviceId: t
|
|
3031
3077
|
} });
|
|
3032
3078
|
return;
|
|
3033
3079
|
}
|
|
3034
3080
|
if (!this.#S(r, e)) return;
|
|
3035
|
-
let a =
|
|
3081
|
+
let a = $(i);
|
|
3036
3082
|
return this.#b(this.#p, [t]), a;
|
|
3037
3083
|
}
|
|
3038
3084
|
async #y(e, t, n) {
|
|
@@ -3060,7 +3106,7 @@ var Lr = class {
|
|
|
3060
3106
|
if (r.length > 0) {
|
|
3061
3107
|
for (let e of r) this.#i.add(e);
|
|
3062
3108
|
try {
|
|
3063
|
-
let n = await Promise.all(r.map((e) =>
|
|
3109
|
+
let n = await Promise.all(r.map((e) => O(this.data.actions.detail(e, t, this.#n))));
|
|
3064
3110
|
if (!this.#S(e, t)) return;
|
|
3065
3111
|
this.#b(this.#f, n.map((e) => e.actionId));
|
|
3066
3112
|
} catch {
|
|
@@ -3071,7 +3117,7 @@ var Lr = class {
|
|
|
3071
3117
|
}
|
|
3072
3118
|
if (!this.#S(e, t)) return;
|
|
3073
3119
|
let i = /* @__PURE__ */ new Set();
|
|
3074
|
-
for (let e of
|
|
3120
|
+
for (let e of Ge(n.revision.content).tasks) {
|
|
3075
3121
|
let t = n.task(e);
|
|
3076
3122
|
if (t?.executor.kind != "connector") continue;
|
|
3077
3123
|
let r = this.$.actions.value[t.executor.action];
|
|
@@ -3101,11 +3147,11 @@ var zr = class {
|
|
|
3101
3147
|
let t = this.#t.get(e);
|
|
3102
3148
|
if (t == null) {
|
|
3103
3149
|
let n = (t) => {
|
|
3104
|
-
let n =
|
|
3150
|
+
let n = Se(t);
|
|
3105
3151
|
if (n.locale != e) throw Error("Unexpected Trigger catalog language.");
|
|
3106
3152
|
return n;
|
|
3107
3153
|
}, r = this.host.triggerCatalogCache;
|
|
3108
|
-
t = new
|
|
3154
|
+
t = new Oe((t, r) => this.client.readCatalog({
|
|
3109
3155
|
path: `/v1/trigger-keys/catalog?locale=${encodeURIComponent(e)}`,
|
|
3110
3156
|
decode: n
|
|
3111
3157
|
}, t, r), 3e5, r == null ? void 0 : {
|
|
@@ -3146,7 +3192,7 @@ function Ur(e, t, n) {
|
|
|
3146
3192
|
return {
|
|
3147
3193
|
description: n?.description ?? e.description,
|
|
3148
3194
|
group: t.t("addNode.integrationTriggers"),
|
|
3149
|
-
icon:
|
|
3195
|
+
icon: k({
|
|
3150
3196
|
serviceId: e.provider,
|
|
3151
3197
|
serviceName: e.provider
|
|
3152
3198
|
}),
|
|
@@ -3179,17 +3225,17 @@ var Wr = class {
|
|
|
3179
3225
|
#c;
|
|
3180
3226
|
#l;
|
|
3181
3227
|
constructor(r, i, a, o, s = h()) {
|
|
3182
|
-
this.#r = new
|
|
3228
|
+
this.#r = new E(), this.#i = /* @__PURE__ */ new Set(), this.#s = n(Br), this.#l = !1, this.browseAddNodeOptions = (e) => this.#u("", e), this.provideAddNodeOptions = (e, t) => this.#u(e, t), this.catalog = new zr(r, xt([s.lang]), o), this.#e = r, this.#t = o, this.#n = s, this.#o = a, this.#c = i, this.#a = t((e) => {
|
|
3183
3229
|
let t = e(i.$.selection), n = Hr(t, i), r = e(this.#s);
|
|
3184
3230
|
if (t?.kind != "trigger") return { authorizationPending: !1 };
|
|
3185
3231
|
let a = t.trigger;
|
|
3186
3232
|
if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
|
|
3187
|
-
let o = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).data, s = o == null ? void 0 :
|
|
3233
|
+
let o = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).data, s = o == null ? void 0 : $(o), c = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).error;
|
|
3188
3234
|
return {
|
|
3189
3235
|
activeConnections: s?.active,
|
|
3190
3236
|
authorizationPending: r.authorizationProvider == n?.provider,
|
|
3191
3237
|
connection: n?.connectionId == null ? void 0 : s?.byId.get(n.connectionId),
|
|
3192
|
-
connectionError: c == null ? void 0 :
|
|
3238
|
+
connectionError: c == null ? void 0 : F(c, this.#n.t).message,
|
|
3193
3239
|
definition: a.definition
|
|
3194
3240
|
};
|
|
3195
3241
|
}), this.$ = {
|
|
@@ -3211,7 +3257,7 @@ var Wr = class {
|
|
|
3211
3257
|
}
|
|
3212
3258
|
#u(e, t) {
|
|
3213
3259
|
let n = this.catalog.get(), r = e.trim().toLowerCase();
|
|
3214
|
-
return
|
|
3260
|
+
return A(t, (e) => {
|
|
3215
3261
|
let t = e(n);
|
|
3216
3262
|
e(this.#n.t$);
|
|
3217
3263
|
let i = e(this.#c.$.flowId) != null && e(this.#c.$.target)?.kind == "flow", a = t.data, o = a?.definitions.filter((e) => !r || [
|
|
@@ -3243,11 +3289,11 @@ var Wr = class {
|
|
|
3243
3289
|
});
|
|
3244
3290
|
try {
|
|
3245
3291
|
let i = this.#c.catalogs.connections.get(r.provider, n, e || this.#i.has(r.provider));
|
|
3246
|
-
if (await Promise.resolve(), await
|
|
3292
|
+
if (await Promise.resolve(), await O(i, void 0, e || this.#i.has(r.provider)), !this.#f(t, n)) return;
|
|
3247
3293
|
this.#i.delete(r.provider);
|
|
3248
3294
|
} catch (e) {
|
|
3249
3295
|
this.#f(t, n) && this.#d({ connectionError: {
|
|
3250
|
-
message:
|
|
3296
|
+
message: F(e, this.#n.t).message,
|
|
3251
3297
|
provider: r.provider
|
|
3252
3298
|
} });
|
|
3253
3299
|
} finally {
|
|
@@ -3266,7 +3312,7 @@ var Wr = class {
|
|
|
3266
3312
|
}
|
|
3267
3313
|
!this.#l && t == this.#c.$.flowId.value && this.#d({ authorizationProvider: e });
|
|
3268
3314
|
} catch (e) {
|
|
3269
|
-
this.#l || this.#o(
|
|
3315
|
+
this.#l || this.#o(F(e, this.#n.t));
|
|
3270
3316
|
}
|
|
3271
3317
|
}
|
|
3272
3318
|
async setConnection(e, t) {
|
|
@@ -3292,7 +3338,7 @@ var Wr = class {
|
|
|
3292
3338
|
function Gr(e, t) {
|
|
3293
3339
|
let n = e, r = [];
|
|
3294
3340
|
for (let e of t) {
|
|
3295
|
-
let t =
|
|
3341
|
+
let t = _t(n, [e]), i = [];
|
|
3296
3342
|
switch (e.kind) {
|
|
3297
3343
|
case "graph.node.create":
|
|
3298
3344
|
i.push({
|
|
@@ -3551,7 +3597,7 @@ function Kr(e, t, n) {
|
|
|
3551
3597
|
let r = e.graph(t)?.nodes ?? {}, i = Object.fromEntries(n.flatMap((e) => r[e] == null ? [] : [[e, r[e]]]));
|
|
3552
3598
|
return {
|
|
3553
3599
|
edges: (e.graph(t)?.edges ?? []).filter((e) => i[e.source] != null && i[e.target] != null),
|
|
3554
|
-
bindings: Object.fromEntries(Object.values(i).flatMap((t) => "inputs" in t ? Object.values(
|
|
3600
|
+
bindings: Object.fromEntries(Object.values(i).flatMap((t) => "inputs" in t ? Object.values(tt(t)).flatMap((t) => t.kind == "sources" ? t.sources.flatMap((t) => {
|
|
3555
3601
|
if (t.kind != "binding") return [];
|
|
3556
3602
|
let n = e.binding(t.bindingId);
|
|
3557
3603
|
return n?.kind == "variable" ? [[t.bindingId, n]] : [];
|
|
@@ -3573,7 +3619,7 @@ function qr(e, t, n, r) {
|
|
|
3573
3619
|
let i = Object.values(e.graph(t)?.nodes ?? {}).some((e) => e.kind === "manual"), a = Object.entries(n.nodes).filter(([, e]) => (t.kind == "flow" || "inputs" in e) && (e.kind !== "manual" || !i) && (e.kind != "task" || e.task == null || n.modules[e.task.moduleId] != null)), o = a.map(([e]) => e), s = new Map(o.map((e) => [e, r()])), c = [], l = /* @__PURE__ */ new Map();
|
|
3574
3620
|
for (let [, e] of a) {
|
|
3575
3621
|
if (!("inputs" in e)) continue;
|
|
3576
|
-
let t = Object.values(
|
|
3622
|
+
let t = Object.values(tt(e));
|
|
3577
3623
|
for (let e of t) if (e.kind == "sources") for (let t of e.sources) t.kind != "binding" || n.bindings[t.bindingId]?.kind != "variable" || l.has(t.bindingId) || l.set(t.bindingId, r());
|
|
3578
3624
|
}
|
|
3579
3625
|
for (let [e, t] of l) {
|
|
@@ -3647,7 +3693,7 @@ function qr(e, t, n, r) {
|
|
|
3647
3693
|
...o,
|
|
3648
3694
|
inputs: u
|
|
3649
3695
|
};
|
|
3650
|
-
if (o.kind == "condition" && (d =
|
|
3696
|
+
if (o.kind == "condition" && (d = et(o, (e) => e.kind == "node" ? {
|
|
3651
3697
|
...e,
|
|
3652
3698
|
nodeId: s.get(e.nodeId) ?? e.nodeId
|
|
3653
3699
|
} : e.kind == "binding" ? {
|
|
@@ -3693,7 +3739,7 @@ function qr(e, t, n, r) {
|
|
|
3693
3739
|
});
|
|
3694
3740
|
}
|
|
3695
3741
|
return {
|
|
3696
|
-
changes:
|
|
3742
|
+
changes: Fe(e, t, c),
|
|
3697
3743
|
nodeIds: [...s.values()],
|
|
3698
3744
|
sourceIds: o
|
|
3699
3745
|
};
|
|
@@ -3791,15 +3837,15 @@ var Xr = class {
|
|
|
3791
3837
|
this.#a = e;
|
|
3792
3838
|
let t = e, n = [];
|
|
3793
3839
|
for (let e of this.#o) try {
|
|
3794
|
-
t =
|
|
3840
|
+
t = z(t, e.changes), n.push(e);
|
|
3795
3841
|
} catch (t) {
|
|
3796
|
-
if (!(t instanceof
|
|
3842
|
+
if (!(t instanceof nt)) throw t;
|
|
3797
3843
|
e.active = !1;
|
|
3798
3844
|
}
|
|
3799
3845
|
return this.#o = n, t;
|
|
3800
3846
|
}
|
|
3801
3847
|
project(e) {
|
|
3802
|
-
return this.#o.reduce((e, t) =>
|
|
3848
|
+
return this.#o.reduce((e, t) => z(e, t.changes), e);
|
|
3803
3849
|
}
|
|
3804
3850
|
async settled() {
|
|
3805
3851
|
await this.#s;
|
|
@@ -3819,7 +3865,7 @@ var Xr = class {
|
|
|
3819
3865
|
let o = {
|
|
3820
3866
|
...e,
|
|
3821
3867
|
active: !0,
|
|
3822
|
-
changeId:
|
|
3868
|
+
changeId: j(),
|
|
3823
3869
|
changes: n,
|
|
3824
3870
|
started: !1
|
|
3825
3871
|
};
|
|
@@ -3844,21 +3890,21 @@ var Xr = class {
|
|
|
3844
3890
|
let r = this.#l(e, n, t);
|
|
3845
3891
|
return this.#o.length == 0 && this.#t.check(), r;
|
|
3846
3892
|
} catch (n) {
|
|
3847
|
-
if (n instanceof
|
|
3893
|
+
if (n instanceof I && n.code == "flow.revision-conflict") {
|
|
3848
3894
|
if (!t && await this.#t.recover(e)) {
|
|
3849
|
-
t = !0, e.changeId =
|
|
3895
|
+
t = !0, e.changeId = j();
|
|
3850
3896
|
continue;
|
|
3851
3897
|
}
|
|
3852
3898
|
t && await this.#t.recover(e), this.#u(e);
|
|
3853
3899
|
} else {
|
|
3854
|
-
if (!(n instanceof
|
|
3900
|
+
if (!(n instanceof I) && !t) {
|
|
3855
3901
|
let n = this.#a?.revisionId;
|
|
3856
3902
|
if (await this.#t.recover(e)) {
|
|
3857
|
-
t = !0, e.active && this.#a?.revisionId != n && (e.changeId =
|
|
3903
|
+
t = !0, e.active && this.#a?.revisionId != n && (e.changeId = j());
|
|
3858
3904
|
continue;
|
|
3859
3905
|
}
|
|
3860
3906
|
}
|
|
3861
|
-
this.#u(e), this.#t.current(e) && this.#r(
|
|
3907
|
+
this.#u(e), this.#t.current(e) && this.#r(F(n, this.#n.t));
|
|
3862
3908
|
}
|
|
3863
3909
|
return;
|
|
3864
3910
|
}
|
|
@@ -3867,7 +3913,7 @@ var Xr = class {
|
|
|
3867
3913
|
#l(e, t, n) {
|
|
3868
3914
|
let r = {
|
|
3869
3915
|
...n.revision,
|
|
3870
|
-
content:
|
|
3916
|
+
content: z(t, e.changes).content
|
|
3871
3917
|
};
|
|
3872
3918
|
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;
|
|
3873
3919
|
}
|
|
@@ -3885,7 +3931,7 @@ var Xr = class {
|
|
|
3885
3931
|
}, $r = class {
|
|
3886
3932
|
#e;
|
|
3887
3933
|
#t;
|
|
3888
|
-
#n = new
|
|
3934
|
+
#n = new E();
|
|
3889
3935
|
#r;
|
|
3890
3936
|
#i = n(Qr);
|
|
3891
3937
|
#a = new AbortController();
|
|
@@ -3951,7 +3997,7 @@ var Xr = class {
|
|
|
3951
3997
|
failed: !t,
|
|
3952
3998
|
loading: !1,
|
|
3953
3999
|
refreshing: !1
|
|
3954
|
-
}), this.#r(
|
|
4000
|
+
}), this.#r(F(n, this.#t.t));
|
|
3955
4001
|
}
|
|
3956
4002
|
}
|
|
3957
4003
|
async loadMore() {
|
|
@@ -3979,7 +4025,7 @@ var Xr = class {
|
|
|
3979
4025
|
this.#c({
|
|
3980
4026
|
loadingMore: !1,
|
|
3981
4027
|
loadMoreFailed: !0
|
|
3982
|
-
}), this.#r(
|
|
4028
|
+
}), this.#r(F(e, this.#t.t));
|
|
3983
4029
|
}
|
|
3984
4030
|
}
|
|
3985
4031
|
async setEnabled(e, t) {
|
|
@@ -3989,7 +4035,7 @@ var Xr = class {
|
|
|
3989
4035
|
let n = await this.#e.setFlowEnabled(e.flowId, e.live.publicationId, t);
|
|
3990
4036
|
this.#s || this.include(n);
|
|
3991
4037
|
} catch (e) {
|
|
3992
|
-
this.#s || (this.#r(
|
|
4038
|
+
this.#s || (this.#r(F(e, this.#t.t)), await this.reload());
|
|
3993
4039
|
} finally {
|
|
3994
4040
|
this.#o.delete(e.flowId);
|
|
3995
4041
|
}
|
|
@@ -4001,9 +4047,9 @@ var Xr = class {
|
|
|
4001
4047
|
try {
|
|
4002
4048
|
let t = await this.#e.publishFlow(e.flowId, e.draftRevisionId, e.live?.publicationId ?? null);
|
|
4003
4049
|
if (this.#s) return;
|
|
4004
|
-
let n = await
|
|
4050
|
+
let n = await G.runPromise(G.gen({ self: this }, function* () {
|
|
4005
4051
|
let n = t;
|
|
4006
|
-
for (; n.status == "pending";) yield*
|
|
4052
|
+
for (; n.status == "pending";) yield* G.sleep(1e3), n = yield* G.tryPromise((t) => this.#e.getPublishOperation(e.flowId, n.operationId, t));
|
|
4007
4053
|
return n;
|
|
4008
4054
|
}), { signal: this.#a.signal });
|
|
4009
4055
|
if (this.#s) return;
|
|
@@ -4015,7 +4061,7 @@ var Xr = class {
|
|
|
4015
4061
|
message: this.#t.t("notice.published", { name: e.name })
|
|
4016
4062
|
}), this.include(await this.#e.getFlow(e.flowId));
|
|
4017
4063
|
} catch (e) {
|
|
4018
|
-
this.#s || this.#r(
|
|
4064
|
+
this.#s || this.#r(F(e, this.#t.t));
|
|
4019
4065
|
} finally {
|
|
4020
4066
|
this.#o.delete(e.flowId);
|
|
4021
4067
|
}
|
|
@@ -4124,11 +4170,11 @@ var Xr = class {
|
|
|
4124
4170
|
phase: "saving"
|
|
4125
4171
|
}, this.#c();
|
|
4126
4172
|
try {
|
|
4127
|
-
let t = await
|
|
4173
|
+
let t = await en(i);
|
|
4128
4174
|
if (this.#n || !e()) return !1;
|
|
4129
4175
|
let a = this.#r.value.draft?.content.modules[n];
|
|
4130
4176
|
if (a == null || a.source != r.base.source || JSON.stringify(a.imports) != JSON.stringify(r.base.imports)) throw Error(this.#o.t("notice.moduleUpdated"));
|
|
4131
|
-
let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#r.value.draft : await this.changeDraft(
|
|
4177
|
+
let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#r.value.draft : await this.changeDraft(tn(n, r.base.source, r.base.imports, i, t));
|
|
4132
4178
|
if (this.#n || !e()) return !1;
|
|
4133
4179
|
let s = this.#e.get(n);
|
|
4134
4180
|
if (s == null) continue;
|
|
@@ -4152,7 +4198,7 @@ var Xr = class {
|
|
|
4152
4198
|
r != null && (r.editor = {
|
|
4153
4199
|
...r.editor,
|
|
4154
4200
|
phase: "failed"
|
|
4155
|
-
}), this.#a(
|
|
4201
|
+
}), this.#a(F(t, this.#o.t));
|
|
4156
4202
|
}
|
|
4157
4203
|
this.#c();
|
|
4158
4204
|
}
|
|
@@ -4216,7 +4262,7 @@ var Xr = class {
|
|
|
4216
4262
|
this.#c(a, r), o = !0;
|
|
4217
4263
|
} catch (r) {
|
|
4218
4264
|
if (this.#o || !n()) return;
|
|
4219
|
-
if (r instanceof
|
|
4265
|
+
if (r instanceof I && r.code == "flow.presentation-conflict") try {
|
|
4220
4266
|
let t = await this.#e.getPresentation(e);
|
|
4221
4267
|
if (this.#o || !n()) return;
|
|
4222
4268
|
this.#c(a, t), this.#n({
|
|
@@ -4224,9 +4270,9 @@ var Xr = class {
|
|
|
4224
4270
|
message: this.#t.t("notice.layoutConflict")
|
|
4225
4271
|
});
|
|
4226
4272
|
} catch (e) {
|
|
4227
|
-
!this.#o && n() && this.#c(a, t), !this.#o && n() && this.#n(
|
|
4273
|
+
!this.#o && n() && this.#c(a, t), !this.#o && n() && this.#n(F(e, this.#t.t));
|
|
4228
4274
|
}
|
|
4229
|
-
else this.#c(a, t), this.#n(
|
|
4275
|
+
else this.#c(a, t), this.#n(F(r, this.#t.t));
|
|
4230
4276
|
}
|
|
4231
4277
|
}), await this.#i, o;
|
|
4232
4278
|
}
|
|
@@ -4273,23 +4319,23 @@ var oi = class {
|
|
|
4273
4319
|
...n,
|
|
4274
4320
|
status: ii(e.draft, e.moduleEditor)
|
|
4275
4321
|
};
|
|
4276
|
-
}), 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 :
|
|
4322
|
+
}), 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 : P(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.workspaceLoadProblem), y = e(this.#t, (e) => e.workspaceLoading), b = e(this.#t, (e) => e.workspaceRepairing);
|
|
4277
4323
|
this.#e = e(this.#t, (e) => ({
|
|
4278
|
-
revision: e.draft == null ? void 0 :
|
|
4324
|
+
revision: e.draft == null ? void 0 : P(e.draft),
|
|
4279
4325
|
target: e.target
|
|
4280
4326
|
}), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
|
|
4281
4327
|
let x = e(this.#t, (e) => {
|
|
4282
|
-
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return
|
|
4328
|
+
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return P(e.draft).selection(e.target, e.selectedNodeIds[0]);
|
|
4283
4329
|
});
|
|
4284
4330
|
this.$ = {
|
|
4285
4331
|
addNodeOptions: t((e) => {
|
|
4286
4332
|
let { revision: t, target: r } = e(this.#e);
|
|
4287
|
-
return
|
|
4333
|
+
return oe(t?.revision, r, e(n.t$));
|
|
4288
4334
|
}),
|
|
4289
4335
|
busy: i,
|
|
4290
4336
|
checkLoading: a,
|
|
4291
4337
|
diagnosticFocus: o,
|
|
4292
|
-
diagnosticItems: e(this.#t, (e) =>
|
|
4338
|
+
diagnosticItems: e(this.#t, (e) => ue(e.draft == null ? void 0 : P(e.draft), e.target, e.diagnostics)),
|
|
4293
4339
|
diagnostics: s,
|
|
4294
4340
|
draft: c,
|
|
4295
4341
|
flow: t((e) => {
|
|
@@ -4305,7 +4351,7 @@ var oi = class {
|
|
|
4305
4351
|
flowRefreshing: r.$.refreshing,
|
|
4306
4352
|
flowTotal: r.$.total,
|
|
4307
4353
|
flows: r.$.flows,
|
|
4308
|
-
inspectorDiagnostics: e(this.#t, (e) =>
|
|
4354
|
+
inspectorDiagnostics: e(this.#t, (e) => se(e.draft == null ? void 0 : P(e.draft), e.target, e.diagnostics, x.value)),
|
|
4309
4355
|
live: p,
|
|
4310
4356
|
moduleEditor: l,
|
|
4311
4357
|
nodeFocus: u,
|
|
@@ -4317,7 +4363,7 @@ var oi = class {
|
|
|
4317
4363
|
target: g,
|
|
4318
4364
|
targetFlow: t((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
|
|
4319
4365
|
targetName: e(this.#t, (e) => {
|
|
4320
|
-
if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id :
|
|
4366
|
+
if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : P(e.draft).subflow(e.target.id)?.name ?? e.target.id;
|
|
4321
4367
|
}),
|
|
4322
4368
|
workspaceLoadFailed: _,
|
|
4323
4369
|
workspaceLoadProblem: v,
|
|
@@ -4379,8 +4425,8 @@ var ui = class {
|
|
|
4379
4425
|
#x;
|
|
4380
4426
|
#S;
|
|
4381
4427
|
#C;
|
|
4382
|
-
constructor(e, t, n =
|
|
4383
|
-
this.catalogs = a, this.flowCreated = o, this.accessChanged = s, this.#n = new
|
|
4428
|
+
constructor(e, t, n = nn, r = h(), i = () => {}, a = new Er(e), o = () => {}, s = () => {}) {
|
|
4429
|
+
this.catalogs = a, this.flowCreated = o, this.accessChanged = s, this.#n = new E(), this.#d = new Jr(), this.history$ = this.#d.state$, this.#m = 0, this.#h = 0, this.#g = !1, 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 $r(e, t, r), this.#l = new oi(r, this.#o), this.#u = new ei(this.#l, this.#n, (e) => this.#O(e, !1), t, r), this.#t = new Xr(e, t, r, {
|
|
4384
4430
|
apply: (e) => this.#A(e, "local"),
|
|
4385
4431
|
beforeChange: (e) => {
|
|
4386
4432
|
e && this.#V({ busy: "designer" });
|
|
@@ -4462,12 +4508,12 @@ var ui = class {
|
|
|
4462
4508
|
} catch (e) {
|
|
4463
4509
|
if (!t()) return !1;
|
|
4464
4510
|
this.#C?.(), this.#C = void 0;
|
|
4465
|
-
let n = e instanceof
|
|
4511
|
+
let n = e instanceof I && e.code == Ae.flowUpgradeRequired ? "upgrade" : e instanceof I && (e.code == Ae.flowRepairRequired || e.code == Ae.flowInvalid) ? "repair" : "failed";
|
|
4466
4512
|
return this.#V({
|
|
4467
4513
|
workspaceLoadFailed: !0,
|
|
4468
4514
|
workspaceLoadProblem: {
|
|
4469
4515
|
kind: n,
|
|
4470
|
-
...n == "failed" ? { message:
|
|
4516
|
+
...n == "failed" ? { message: F(e, this.#r.t).message } : {}
|
|
4471
4517
|
},
|
|
4472
4518
|
workspaceLoading: !1
|
|
4473
4519
|
}), !1;
|
|
@@ -4489,14 +4535,14 @@ var ui = class {
|
|
|
4489
4535
|
await this.#e.repairDraft(e, n.expectedRevisionId, n.changeId), this.#x = void 0, await this.selectFlow(e);
|
|
4490
4536
|
} catch (t) {
|
|
4491
4537
|
if (this.#_) return;
|
|
4492
|
-
if (t instanceof
|
|
4538
|
+
if (t instanceof I && t.code == Ae.flowRevisionConflict) {
|
|
4493
4539
|
this.#x = void 0, await this.selectFlow(e);
|
|
4494
4540
|
return;
|
|
4495
4541
|
}
|
|
4496
4542
|
this.#V({
|
|
4497
4543
|
workspaceLoadProblem: {
|
|
4498
4544
|
kind: this.#l.value.workspaceLoadProblem?.kind == "upgrade" ? "upgrade" : "repair",
|
|
4499
|
-
message:
|
|
4545
|
+
message: F(t, this.#r.t).message
|
|
4500
4546
|
},
|
|
4501
4547
|
workspaceRepairing: !1
|
|
4502
4548
|
});
|
|
@@ -4507,7 +4553,7 @@ var ui = class {
|
|
|
4507
4553
|
let n = await this.#e.getLive(e);
|
|
4508
4554
|
t() && this.#l.value.flowId == e && this.#V({ live: n });
|
|
4509
4555
|
} catch (n) {
|
|
4510
|
-
t() && this.#l.value.flowId == e && this.#c(
|
|
4556
|
+
t() && this.#l.value.flowId == e && this.#c(F(n, this.#r.t));
|
|
4511
4557
|
}
|
|
4512
4558
|
}
|
|
4513
4559
|
selectTarget(e) {
|
|
@@ -4523,7 +4569,7 @@ var ui = class {
|
|
|
4523
4569
|
selectNodes(e) {
|
|
4524
4570
|
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : (this.#u.flush(), this.#V({
|
|
4525
4571
|
diagnosticFocus: void 0,
|
|
4526
|
-
moduleEditor: ai(this.#l.value.draft == null ? void 0 :
|
|
4572
|
+
moduleEditor: ai(this.#l.value.draft == null ? void 0 : P(this.#l.value.draft), this.#l.value.target, e),
|
|
4527
4573
|
nodeFocus: void 0,
|
|
4528
4574
|
selectedNodeIds: e
|
|
4529
4575
|
}), !0);
|
|
@@ -4536,7 +4582,7 @@ var ui = class {
|
|
|
4536
4582
|
let n = await this.#e.getFlow(await t(e));
|
|
4537
4583
|
return this.#o.insert(n), n;
|
|
4538
4584
|
} catch (e) {
|
|
4539
|
-
this.#_ || this.#c(
|
|
4585
|
+
this.#_ || this.#c(F(e, this.#r.t));
|
|
4540
4586
|
} finally {
|
|
4541
4587
|
this.#V({ busy: void 0 });
|
|
4542
4588
|
}
|
|
@@ -4553,7 +4599,7 @@ var ui = class {
|
|
|
4553
4599
|
message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
|
|
4554
4600
|
}), !0);
|
|
4555
4601
|
} catch (e) {
|
|
4556
|
-
return this.#_ || this.#c(
|
|
4602
|
+
return this.#_ || this.#c(F(e, this.#r.t)), !1;
|
|
4557
4603
|
} finally {
|
|
4558
4604
|
this.#V({ busy: void 0 });
|
|
4559
4605
|
}
|
|
@@ -4562,7 +4608,7 @@ var ui = class {
|
|
|
4562
4608
|
if (!await this.saveModuleEditor() || this.#l.value.draft == null) return !1;
|
|
4563
4609
|
let t = this.#i();
|
|
4564
4610
|
this.#V({ busy: "resource" });
|
|
4565
|
-
let n = await this.#O(
|
|
4611
|
+
let n = await this.#O(De(t, e), !1);
|
|
4566
4612
|
return this.#V({ busy: void 0 }), n != null && (this.selectTarget({
|
|
4567
4613
|
id: t,
|
|
4568
4614
|
kind: "subflow"
|
|
@@ -4580,7 +4626,7 @@ var ui = class {
|
|
|
4580
4626
|
try {
|
|
4581
4627
|
i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
|
|
4582
4628
|
} catch (e) {
|
|
4583
|
-
this.#_ || this.#c(
|
|
4629
|
+
this.#_ || this.#c(F(e, this.#r.t));
|
|
4584
4630
|
}
|
|
4585
4631
|
return this.#V({ busy: void 0 }), i != null && (this.#c({
|
|
4586
4632
|
kind: "success",
|
|
@@ -4593,28 +4639,28 @@ var ui = class {
|
|
|
4593
4639
|
if (r == null || i == null) return;
|
|
4594
4640
|
let a = this.#i();
|
|
4595
4641
|
if (e.kind == "comment") return await this.#T(i, a, t);
|
|
4596
|
-
let o =
|
|
4642
|
+
let o = P(r), s = Xe(e, o, i, this.#r.t);
|
|
4597
4643
|
if (s == null) return;
|
|
4598
4644
|
if (s.kind == "provider-trigger" && s.connectionId == null && s.definition.key != "feishu_app_bot.on_event") {
|
|
4599
4645
|
try {
|
|
4600
|
-
let e = await
|
|
4646
|
+
let e = await O(this.catalogs.connections.get(s.definition.provider, r.flowId));
|
|
4601
4647
|
s = {
|
|
4602
4648
|
...s,
|
|
4603
|
-
connectionId:
|
|
4649
|
+
connectionId: $(e).preferred?.connectionId
|
|
4604
4650
|
};
|
|
4605
4651
|
} catch (e) {
|
|
4606
|
-
!this.#_ && this.#l.value.draft == r && this.#c(
|
|
4652
|
+
!this.#_ && this.#l.value.draft == r && this.#c(F(e, this.#r.t));
|
|
4607
4653
|
}
|
|
4608
4654
|
if (this.#_ || this.#l.value.draft != r || this.#l.value.target != i) return;
|
|
4609
4655
|
}
|
|
4610
|
-
let c = n?.(a), l =
|
|
4656
|
+
let c = n?.(a), l = Ue(o, i, a, s, this.#i);
|
|
4611
4657
|
if (l == null) return;
|
|
4612
|
-
let u = c == null ? l : [...l, ...
|
|
4658
|
+
let u = c == null ? l : [...l, ...Zt(z(r, l).content, i, {
|
|
4613
4659
|
source: c.source,
|
|
4614
4660
|
target: c.target,
|
|
4615
4661
|
...c.sourceHandle.startsWith("$branch:") ? { sourceHandle: c.sourceHandle.slice(8) } : {}
|
|
4616
4662
|
})];
|
|
4617
|
-
if (await this.#N("add", 1, u, (e) =>
|
|
4663
|
+
if (await this.#N("add", 1, u, (e) => un(e, i, { [a]: t }), [a]) && !this.#_) return this.#V({ nodeFocus: {
|
|
4618
4664
|
nodeId: a,
|
|
4619
4665
|
requestId: ++this.#b
|
|
4620
4666
|
} }), a;
|
|
@@ -4622,7 +4668,7 @@ var ui = class {
|
|
|
4622
4668
|
async connect(e) {
|
|
4623
4669
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
4624
4670
|
if (t == null || n == null) return;
|
|
4625
|
-
let r =
|
|
4671
|
+
let r = Zt(t.revision.content, n, {
|
|
4626
4672
|
source: e.source,
|
|
4627
4673
|
target: e.target,
|
|
4628
4674
|
...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
|
|
@@ -4632,7 +4678,7 @@ var ui = class {
|
|
|
4632
4678
|
async disconnect(e) {
|
|
4633
4679
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
4634
4680
|
if (t == null || n == null) return;
|
|
4635
|
-
let r =
|
|
4681
|
+
let r = Qt(t.revision.content, n, {
|
|
4636
4682
|
source: e.source,
|
|
4637
4683
|
target: e.target,
|
|
4638
4684
|
...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
|
|
@@ -4643,10 +4689,10 @@ var ui = class {
|
|
|
4643
4689
|
if (!await this.saveModuleEditor()) return;
|
|
4644
4690
|
let e = this.$.revision.value, t = this.#l.value.target;
|
|
4645
4691
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
4646
|
-
let n = [...this.#l.value.selectedNodeIds], r =
|
|
4692
|
+
let n = [...this.#l.value.selectedNodeIds], r = mn(this.#l.value.presentation?.value ?? {}, t), i = new Set(this.#l.value.selectedNodeIds.filter((e) => r.has(e))), a = _e(e, t, this.#l.value.selectedNodeIds);
|
|
4647
4693
|
await this.#N("delete", this.#l.value.selectedNodeIds.length, a, (e) => {
|
|
4648
|
-
let r = i.size == 0 ? e :
|
|
4649
|
-
for (let e of n) r =
|
|
4694
|
+
let r = i.size == 0 ? e : pn(e, t, i);
|
|
4695
|
+
for (let e of n) r = dn(r, t, e, !1);
|
|
4650
4696
|
return r;
|
|
4651
4697
|
}, []);
|
|
4652
4698
|
}
|
|
@@ -4687,9 +4733,9 @@ var ui = class {
|
|
|
4687
4733
|
}];
|
|
4688
4734
|
}));
|
|
4689
4735
|
await this.#N("paste", c.size, a.changes, (e) => {
|
|
4690
|
-
let n =
|
|
4691
|
-
for (let [e, t] of a.sourceIds.entries()) i.has(t) && (n =
|
|
4692
|
-
for (let e of o) i.has(e.sourceId) && (n =
|
|
4736
|
+
let n = un(e, r, f);
|
|
4737
|
+
for (let [e, t] of a.sourceIds.entries()) i.has(t) && (n = dn(n, r, a.nodeIds[e], !0));
|
|
4738
|
+
for (let e of o) i.has(e.sourceId) && (n = dn(n, r, e.nodeId, !0)), n = fn(n, r, e.nodeId, {
|
|
4693
4739
|
content: e.content,
|
|
4694
4740
|
position: {
|
|
4695
4741
|
x: e.position.x + t.x * d,
|
|
@@ -4706,36 +4752,36 @@ var ui = class {
|
|
|
4706
4752
|
async saveNodeSettings(e, t) {
|
|
4707
4753
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4708
4754
|
if (n == null || r == null) return !1;
|
|
4709
|
-
let i =
|
|
4755
|
+
let i = Re(n, r, e, t);
|
|
4710
4756
|
return i != null && await this.#E(i) != null;
|
|
4711
4757
|
}
|
|
4712
4758
|
async saveNodeDescription(e, t) {
|
|
4713
4759
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4714
4760
|
if (n == null || r == null) return !1;
|
|
4715
|
-
let i =
|
|
4761
|
+
let i = Ke(n, r, e, t);
|
|
4716
4762
|
return i != null && await this.#E(i) != null;
|
|
4717
4763
|
}
|
|
4718
4764
|
async saveNodeIcon(e, t) {
|
|
4719
4765
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4720
4766
|
if (n == null || r == null) return !1;
|
|
4721
|
-
let i =
|
|
4767
|
+
let i = xe(n, r, e, t);
|
|
4722
4768
|
return i != null && await this.#E(i) != null;
|
|
4723
4769
|
}
|
|
4724
4770
|
async saveNodeTitle(e, t) {
|
|
4725
4771
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4726
4772
|
if (n == null || r == null) return !1;
|
|
4727
|
-
let i =
|
|
4773
|
+
let i = we(n, r, e, t);
|
|
4728
4774
|
return i != null && await this.#E(i) != null;
|
|
4729
4775
|
}
|
|
4730
4776
|
async setInputValue(e, t, n, r) {
|
|
4731
4777
|
let i = this.$.revision.value, a = this.#l.value.target;
|
|
4732
4778
|
if (i == null || a == null) return !1;
|
|
4733
|
-
let o =
|
|
4779
|
+
let o = Ve(i, a, e, t, n);
|
|
4734
4780
|
return o != null && await this.#E(o, r) != null;
|
|
4735
4781
|
}
|
|
4736
4782
|
async resetInputs(e, t) {
|
|
4737
4783
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4738
|
-
return n == null || r == null ? !1 : await this.#E(
|
|
4784
|
+
return n == null || r == null ? !1 : await this.#E(pe(n.revision.content, r, e, t)) != null;
|
|
4739
4785
|
}
|
|
4740
4786
|
async resetTriggerConfig(e, t) {
|
|
4741
4787
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
@@ -4753,7 +4799,7 @@ var ui = class {
|
|
|
4753
4799
|
}
|
|
4754
4800
|
async setInputSource(e, t, n) {
|
|
4755
4801
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
4756
|
-
return r == null || i == null ? !1 : await this.#E(
|
|
4802
|
+
return r == null || i == null ? !1 : await this.#E(me(r.revision.content, i, e, t, [{
|
|
4757
4803
|
kind: "node",
|
|
4758
4804
|
...n
|
|
4759
4805
|
}])) != null;
|
|
@@ -4761,36 +4807,36 @@ var ui = class {
|
|
|
4761
4807
|
async setInputVariable(e, t, n) {
|
|
4762
4808
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
4763
4809
|
if (r == null || i == null) return !1;
|
|
4764
|
-
let a = n == null ?
|
|
4810
|
+
let a = n == null ? Ve(r, i, e, t, void 0) : be(r, i, e, t, n, this.#i());
|
|
4765
4811
|
return a != null && await this.#E(a) != null;
|
|
4766
4812
|
}
|
|
4767
4813
|
async saveCondition(e, t, n) {
|
|
4768
4814
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
4769
4815
|
if (r == null || i == null) return !1;
|
|
4770
|
-
let a =
|
|
4816
|
+
let a = ke(r, i, e, t);
|
|
4771
4817
|
return a != null && await this.#E(a, n) != null;
|
|
4772
4818
|
}
|
|
4773
4819
|
async saveValue(e, t, n) {
|
|
4774
4820
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
4775
4821
|
if (r == null || i == null) return !1;
|
|
4776
|
-
let a =
|
|
4822
|
+
let a = Ze(r, i, e, t);
|
|
4777
4823
|
return a != null && await this.#E(a, n) != null;
|
|
4778
4824
|
}
|
|
4779
4825
|
async saveResolution(e, t, n, r) {
|
|
4780
4826
|
let i = this.$.revision.value, a = this.#l.value.target;
|
|
4781
4827
|
if (i == null || a?.kind != "flow") return !1;
|
|
4782
|
-
let o =
|
|
4828
|
+
let o = Me(i, a, e, t, r);
|
|
4783
4829
|
return o != null && await this.#E(o, n) != null;
|
|
4784
4830
|
}
|
|
4785
4831
|
async saveNodeContentHidden(e, t) {
|
|
4786
4832
|
let n = this.#l.value.target, r = this.#R().nodes.find((t) => t.id == e);
|
|
4787
|
-
n != null && r != null && r.kind != "condition" && await this.#N("edit", 1, [], (r) =>
|
|
4833
|
+
n != null && r != null && r.kind != "condition" && await this.#N("edit", 1, [], (r) => dn(r, n, e, t));
|
|
4788
4834
|
}
|
|
4789
4835
|
async saveComment(e, t) {
|
|
4790
4836
|
let n = this.#l.value.target;
|
|
4791
4837
|
if (n == null) return;
|
|
4792
4838
|
let r = this.#R().nodes.find((t) => t.id == e)?.position;
|
|
4793
|
-
r != null && await this.#N("edit", 1, [], (i) =>
|
|
4839
|
+
r != null && await this.#N("edit", 1, [], (i) => fn(i, n, e, {
|
|
4794
4840
|
...t,
|
|
4795
4841
|
position: r
|
|
4796
4842
|
}));
|
|
@@ -4798,31 +4844,25 @@ var ui = class {
|
|
|
4798
4844
|
async saveTaskSettings(e, t) {
|
|
4799
4845
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4800
4846
|
if (n == null || r == null) return !1;
|
|
4801
|
-
let i =
|
|
4847
|
+
let i = Te(n, r, e, t);
|
|
4802
4848
|
return i != null && await this.#E(i) != null;
|
|
4803
4849
|
}
|
|
4804
|
-
async saveCodeActions(e, t) {
|
|
4805
|
-
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4806
|
-
if (n == null || r == null) return !1;
|
|
4807
|
-
let i = he(n.revision.content, r, e, t);
|
|
4808
|
-
return i == null || await this.#E(i) != null;
|
|
4809
|
-
}
|
|
4810
4850
|
async saveTaskPorts(e, t, n, r) {
|
|
4811
4851
|
let i = this.$.revision.value, a = this.#l.value.target;
|
|
4812
4852
|
if (i == null || a == null) return !1;
|
|
4813
|
-
let o =
|
|
4853
|
+
let o = Je(i, a, e, t, r);
|
|
4814
4854
|
return o != null && await this.#E(o, n) != null;
|
|
4815
4855
|
}
|
|
4816
4856
|
async saveTaskAdditionalInputs(e, t, n, r) {
|
|
4817
4857
|
let i = this.$.revision.value, a = this.#l.value.target;
|
|
4818
4858
|
if (i == null || a == null) return !1;
|
|
4819
|
-
let o =
|
|
4859
|
+
let o = ge(i, a, e, t, r);
|
|
4820
4860
|
return o != null && await this.#E(o, n) != null;
|
|
4821
4861
|
}
|
|
4822
4862
|
async setConnectorConnection(e, t) {
|
|
4823
4863
|
let n = this.$.revision.value;
|
|
4824
4864
|
if (n == null) return !1;
|
|
4825
|
-
let r =
|
|
4865
|
+
let r = fe(n.revision.content, e, t);
|
|
4826
4866
|
return r != null && await this.#E(r) != null;
|
|
4827
4867
|
}
|
|
4828
4868
|
get eventSourceClient() {
|
|
@@ -4838,15 +4878,15 @@ var ui = class {
|
|
|
4838
4878
|
if (n == null || r?.kind != "flow") return !1;
|
|
4839
4879
|
let i = n.graph(r)?.nodes[e];
|
|
4840
4880
|
if (i?.kind != "integration" || i.definition.key != "feishu_app_bot.on_event" || t.provider != i.definition.provider) return !1;
|
|
4841
|
-
let a =
|
|
4881
|
+
let a = ie(n.revision.content, r, e, t.connectionId);
|
|
4842
4882
|
if (a == null) return !1;
|
|
4843
|
-
let o =
|
|
4883
|
+
let o = ze(i.config.sourceId, void 0) != t.sourceId;
|
|
4844
4884
|
return await this.#E([
|
|
4845
4885
|
...a,
|
|
4846
|
-
...
|
|
4847
|
-
...o ?
|
|
4848
|
-
...o ?
|
|
4849
|
-
...o ?
|
|
4886
|
+
...C(n.revision.content, r, e, "sourceId", t.sourceId) ?? [],
|
|
4887
|
+
...o ? C(n.revision.content, r, e, "eventTypes", []) ?? [] : [],
|
|
4888
|
+
...o ? C(n.revision.content, r, e, "resource", void 0) ?? [] : [],
|
|
4889
|
+
...o ? C(n.revision.content, r, e, "chatIds", void 0) ?? [] : []
|
|
4850
4890
|
]) != null;
|
|
4851
4891
|
}
|
|
4852
4892
|
async loadTriggerConfigOptions(e, t, n) {
|
|
@@ -4857,41 +4897,41 @@ var ui = class {
|
|
|
4857
4897
|
async saveTriggerConfig(e, t, n) {
|
|
4858
4898
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
4859
4899
|
if (r == null || i?.kind != "flow") return !1;
|
|
4860
|
-
let a =
|
|
4900
|
+
let a = C(r.revision.content, i, e, t, n);
|
|
4861
4901
|
if (a == null) return !1;
|
|
4862
4902
|
let o = r.graph(i)?.nodes[e];
|
|
4863
4903
|
if (a.length > 0 && o?.kind == "integration" && o.definition.key == "feishu_app_bot.on_event" && t == "eventTypes") {
|
|
4864
4904
|
let t = Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
|
|
4865
|
-
N(t) || (a = [...a, ...
|
|
4866
|
-
let s =
|
|
4867
|
-
|
|
4905
|
+
N(t) || (a = [...a, ...C(r.revision.content, i, e, "chatIds", void 0) ?? []]);
|
|
4906
|
+
let s = ze(o.config.resource, void 0);
|
|
4907
|
+
je(s) && s.kind != Ye(t) && (a = [...a, ...C(r.revision.content, i, e, "resource", void 0) ?? []]);
|
|
4868
4908
|
}
|
|
4869
|
-
return a.length > 0 && o?.kind == "poll" && o.definition.key == "linear.on_issue_changed" && t == "teamId" ? await this.#E([...a, ...
|
|
4909
|
+
return a.length > 0 && o?.kind == "poll" && o.definition.key == "linear.on_issue_changed" && t == "teamId" ? await this.#E([...a, ...C(r.revision.content, i, e, "stateIds", void 0) ?? []]) != null : await this.#E(a) != null;
|
|
4870
4910
|
}
|
|
4871
4911
|
async saveTriggerSchedule(e, t) {
|
|
4872
4912
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4873
4913
|
if (n == null || r?.kind != "flow") return !1;
|
|
4874
|
-
let i =
|
|
4914
|
+
let i = Ce(n.revision.content, r, e, t);
|
|
4875
4915
|
return i != null && await this.#E(i) != null;
|
|
4876
4916
|
}
|
|
4877
4917
|
async saveWebhook(e, t, n) {
|
|
4878
4918
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
4879
4919
|
if (r == null || i?.kind != "flow") return !1;
|
|
4880
|
-
let a =
|
|
4920
|
+
let a = ye(r, i, e, t);
|
|
4881
4921
|
return a != null && await this.#E(a, n) != null;
|
|
4882
4922
|
}
|
|
4883
4923
|
async setTriggerConnection(e, t) {
|
|
4884
4924
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4885
4925
|
if (n == null || r?.kind != "flow") return !1;
|
|
4886
|
-
let i =
|
|
4926
|
+
let i = ie(n.revision.content, r, e, t);
|
|
4887
4927
|
if (i == null) return !1;
|
|
4888
4928
|
let a = n.graph(r)?.nodes[e];
|
|
4889
|
-
return i.length > 0 && a?.kind == "poll" && a.definition.key == "linear.on_issue_changed" ? await this.#E([...i, ...["teamId", "stateIds"].flatMap((t) =>
|
|
4929
|
+
return i.length > 0 && a?.kind == "poll" && a.definition.key == "linear.on_issue_changed" ? await this.#E([...i, ...["teamId", "stateIds"].flatMap((t) => C(n.revision.content, r, e, t, void 0) ?? [])]) != null : await this.#E(i) != null;
|
|
4890
4930
|
}
|
|
4891
4931
|
async saveSubflowSettings(e, t) {
|
|
4892
4932
|
let n = this.$.revision.value;
|
|
4893
4933
|
if (n == null) return !1;
|
|
4894
|
-
let r =
|
|
4934
|
+
let r = Ee(n, e, t);
|
|
4895
4935
|
return r != null && await this.#E(r) != null;
|
|
4896
4936
|
}
|
|
4897
4937
|
updateModuleSource(e) {
|
|
@@ -4913,11 +4953,11 @@ var ui = class {
|
|
|
4913
4953
|
}
|
|
4914
4954
|
async moveNodes(e) {
|
|
4915
4955
|
let t = this.#l.value.target;
|
|
4916
|
-
t != null && await this.#N("move", Object.keys(e).length, [], (n) =>
|
|
4956
|
+
t != null && await this.#N("move", Object.keys(e).length, [], (n) => un(n, t, e));
|
|
4917
4957
|
}
|
|
4918
4958
|
async moveViewport(e) {
|
|
4919
4959
|
let t = this.#l.value.target;
|
|
4920
|
-
t != null && await this.#j((n) =>
|
|
4960
|
+
t != null && await this.#j((n) => hn(n, t, e), !0);
|
|
4921
4961
|
}
|
|
4922
4962
|
async check() {
|
|
4923
4963
|
await this.#F();
|
|
@@ -4930,7 +4970,7 @@ var ui = class {
|
|
|
4930
4970
|
}
|
|
4931
4971
|
locateNode(e, { preserveSelection: t = !1 } = {}) {
|
|
4932
4972
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4933
|
-
return n == null || r == null || n.node(r, e) == null && !
|
|
4973
|
+
return n == null || r == null || n.node(r, e) == null && !mn(this.#l.value.presentation?.value ?? {}, r).has(e) || !t && !this.selectNodes([e]) ? !1 : (this.#V({ nodeFocus: {
|
|
4934
4974
|
nodeId: e,
|
|
4935
4975
|
requestId: ++this.#b
|
|
4936
4976
|
} }), !0);
|
|
@@ -4948,7 +4988,7 @@ var ui = class {
|
|
|
4948
4988
|
let t = /#(\d+)$/.exec(e.title);
|
|
4949
4989
|
return t == null ? [] : [Number(t[1])];
|
|
4950
4990
|
}));
|
|
4951
|
-
if (!(!await this.#N("add", 1, [], (i) =>
|
|
4991
|
+
if (!(!await this.#N("add", 1, [], (i) => fn(i, e, t, {
|
|
4952
4992
|
content: "",
|
|
4953
4993
|
position: n,
|
|
4954
4994
|
title: this.#r.t("addNode.commentName", { number: r + 1 })
|
|
@@ -4973,7 +5013,7 @@ var ui = class {
|
|
|
4973
5013
|
if (this.#_ || (this.#d.applying || this.#d.failed) && !n) return;
|
|
4974
5014
|
let r = this.#l.value.flowId, i = this.#l.value.draft;
|
|
4975
5015
|
if (r == null || i == null) return;
|
|
4976
|
-
if (e.length == 0 || u(
|
|
5016
|
+
if (e.length == 0 || u(z(i, e).content, i.content)) return i;
|
|
4977
5017
|
let a = !n && this.#d.clear(), o = this.#n.capture();
|
|
4978
5018
|
this.#d.pending++, this.#d.publish();
|
|
4979
5019
|
try {
|
|
@@ -4995,7 +5035,7 @@ var ui = class {
|
|
|
4995
5035
|
for (let t = 0; t < 2 && e(); t += 1) {
|
|
4996
5036
|
let t = this.#l.value.draft;
|
|
4997
5037
|
if (t == null) return;
|
|
4998
|
-
let n =
|
|
5038
|
+
let n = ne(t.content);
|
|
4999
5039
|
if (n.length == 0) {
|
|
5000
5040
|
this.#F();
|
|
5001
5041
|
return;
|
|
@@ -5042,8 +5082,8 @@ var ui = class {
|
|
|
5042
5082
|
if (this.#_ || this.#d.applying || this.#d.failed) return !1;
|
|
5043
5083
|
let { draft: o, target: s, presentation: c, selectedNodeIds: l } = this.#l.value;
|
|
5044
5084
|
if (o == null || s == null || c == null) return !1;
|
|
5045
|
-
let d = r?.(c.value) ?? c.value, f =
|
|
5046
|
-
if (u(
|
|
5085
|
+
let d = r?.(c.value) ?? c.value, f = gn(c.value, d, s);
|
|
5086
|
+
if (u(z(o, n).content, o.content) && f.nodeIds.length == 0) return !0;
|
|
5047
5087
|
let p = this.#d.generation, m = Gr(o.content, n);
|
|
5048
5088
|
this.#d.pending++;
|
|
5049
5089
|
let h = {
|
|
@@ -5065,7 +5105,7 @@ var ui = class {
|
|
|
5065
5105
|
let [s, c] = await Promise.all([e, t]), l = s != null && c && (!g || p == this.#d.generation);
|
|
5066
5106
|
return l && g && a != null && this.history$.value.undo === h && this.#D(a, h), l;
|
|
5067
5107
|
} catch (e) {
|
|
5068
|
-
return this.#c(
|
|
5108
|
+
return this.#c(F(e, this.#r.t)), this.retryHistorySync(), !1;
|
|
5069
5109
|
} finally {
|
|
5070
5110
|
this.#d.pending--, this.#_ || this.#d.publish();
|
|
5071
5111
|
}
|
|
@@ -5084,10 +5124,10 @@ var ui = class {
|
|
|
5084
5124
|
let r = this.#d.generation;
|
|
5085
5125
|
this.#d.applying = !0, this.#d.publish();
|
|
5086
5126
|
try {
|
|
5087
|
-
let [t, i] = await Promise.all([this.#O(e ? n.forward : n.inverse, !0, !0), this.#j((t) =>
|
|
5127
|
+
let [t, i] = await Promise.all([this.#O(e ? n.forward : n.inverse, !0, !0), this.#j((t) => _n(t, n.target, n.presentation, e), !0)]);
|
|
5088
5128
|
t != null && i && r == this.#d.generation && (this.selectNodes(e ? n.afterSelection : n.beforeSelection), this.#d.complete(e));
|
|
5089
5129
|
} catch (e) {
|
|
5090
|
-
this.#c(
|
|
5130
|
+
this.#c(F(e, this.#r.t)), this.retryHistorySync();
|
|
5091
5131
|
} finally {
|
|
5092
5132
|
this.#d.applying = !1, this.#_ || this.#d.publish();
|
|
5093
5133
|
}
|
|
@@ -5144,7 +5184,7 @@ var ui = class {
|
|
|
5144
5184
|
});
|
|
5145
5185
|
}
|
|
5146
5186
|
} catch (n) {
|
|
5147
|
-
!this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(
|
|
5187
|
+
!this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(F(n, this.#r.t));
|
|
5148
5188
|
} finally {
|
|
5149
5189
|
!this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#V({ checkLoading: !1 });
|
|
5150
5190
|
}
|
|
@@ -5185,15 +5225,15 @@ var ui = class {
|
|
|
5185
5225
|
message: this.#r.t(o ? "notice.moduleUpdated" : "notice.draftUpdated")
|
|
5186
5226
|
}), this.#F(), !0;
|
|
5187
5227
|
} catch (n) {
|
|
5188
|
-
return t && this.#B(e) && this.#c(
|
|
5228
|
+
return t && this.#B(e) && this.#c(F(n, this.#r.t)), !1;
|
|
5189
5229
|
}
|
|
5190
5230
|
}
|
|
5191
5231
|
#R() {
|
|
5192
5232
|
let e = this.#l.value;
|
|
5193
|
-
return
|
|
5233
|
+
return rr(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
|
|
5194
5234
|
}
|
|
5195
5235
|
#z(e) {
|
|
5196
|
-
let t =
|
|
5236
|
+
let t = P(e), n = li(t, this.#l.value.target);
|
|
5197
5237
|
return {
|
|
5198
5238
|
revision: t,
|
|
5199
5239
|
selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
|
|
@@ -5218,7 +5258,7 @@ function di(e) {
|
|
|
5218
5258
|
return new Map(e.nodes.map((e) => [e.id, e]));
|
|
5219
5259
|
}
|
|
5220
5260
|
function fi(e, t) {
|
|
5221
|
-
return e == null || t == null ? [] :
|
|
5261
|
+
return e == null || t == null ? [] : P(e).designerInputs(t);
|
|
5222
5262
|
}
|
|
5223
5263
|
function pi(e, t, n, r, i) {
|
|
5224
5264
|
if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
|
|
@@ -5246,21 +5286,22 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
|
|
|
5246
5286
|
#d;
|
|
5247
5287
|
#f;
|
|
5248
5288
|
#p;
|
|
5249
|
-
|
|
5250
|
-
|
|
5289
|
+
#m;
|
|
5290
|
+
constructor(r, i, a = j, o = h(), s = mi, c = !0) {
|
|
5291
|
+
this.#t = new E(), this.#r = n(), this.#a = n([]), this.#o = n(!1), this.#s = n(!1), this.#c = !0, this.#u = n([]), this.#d = !1, this.#f = !1, this.#m = Promise.resolve(), this.retryCatalog = () => {
|
|
5251
5292
|
this.connectors.retryCatalog(), this.triggers.catalog.retry();
|
|
5252
5293
|
}, this.provideAddNodeOptions = (e, t, n = t) => T(t, [this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t, n)]), this.browseAddNodeOptions = (e) => T(e, [this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)]), this.provideAddNodeOptionChoices = (e, t) => this.connectors.provideAddNodeOptionChoices(e, t), this.preferences = i, this.#e = r, this.results = r, this.#n = o, this.#i = c;
|
|
5253
5294
|
let l = (e) => {
|
|
5254
|
-
this.#
|
|
5295
|
+
this.#d || this.#r.set(e);
|
|
5255
5296
|
};
|
|
5256
|
-
this.connectorAccess = new
|
|
5257
|
-
e.kind == "run.created" ? this.#
|
|
5258
|
-
}, new
|
|
5297
|
+
this.connectorAccess = new Or(r, l, o, (e) => this.workspace.catalogs.refreshFlow(e)), this.runs = new ae(r, l, o), this.workspace = new ui(r, l, nn, o, (e) => {
|
|
5298
|
+
e.kind == "run.created" ? this.#_(r, e) : this.runs.changed(e.runId);
|
|
5299
|
+
}, new Er(r, s.connectorCache), (e) => void this.#h(e), (e) => {
|
|
5259
5300
|
this.connectorAccess.changed(e), this.workspace.catalogs.refreshFlow(e);
|
|
5260
|
-
}), this.#
|
|
5261
|
-
this.#
|
|
5262
|
-
}), this.connectors = new Lr(r, this.workspace, l, s, o), this.triggers = new Wr(r, this.workspace, l, s, o), this.publications = new
|
|
5263
|
-
if (!(e != this.workspace.$.flowId.value || !await this.workspace.saveModuleEditor() || this.#
|
|
5301
|
+
}), this.#p = this.workspace.$.flowId.reaction((e) => {
|
|
5302
|
+
this.#m = this.connectorAccess.load(e);
|
|
5303
|
+
}), this.connectors = new Lr(r, this.workspace, l, s, o), this.triggers = new Wr(r, this.workspace, l, s, o), this.publications = new wn(r, this.workspace, l, i, a, o), this.runRequests = new Pn(r, this.runs, l, async (e) => {
|
|
5304
|
+
if (!(e != this.workspace.$.flowId.value || !await this.workspace.saveModuleEditor() || this.#d || e != this.workspace.$.flowId.value)) return this.workspace.$.draft.value?.revisionId;
|
|
5264
5305
|
}, o, a);
|
|
5265
5306
|
let u = t((e) => {
|
|
5266
5307
|
let t = e(this.workspace.$.diagnostics);
|
|
@@ -5276,7 +5317,7 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
|
|
|
5276
5317
|
f != t?.flowId && (d.clear(), f = t?.flowId);
|
|
5277
5318
|
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(R(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}`, _ = [
|
|
5278
5319
|
...fi(t, n),
|
|
5279
|
-
r == null || n == null ? void 0 :
|
|
5320
|
+
r == null || n == null ? void 0 : J(r, n),
|
|
5280
5321
|
i,
|
|
5281
5322
|
c,
|
|
5282
5323
|
a,
|
|
@@ -5287,13 +5328,19 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
|
|
|
5287
5328
|
...m == null ? [] : [t?.revisionId]
|
|
5288
5329
|
], v = d.get(g);
|
|
5289
5330
|
if (v != null && v.inputs.length == _.length && v.inputs.every((e, t) => e === _[t])) return v.graph;
|
|
5290
|
-
let y =
|
|
5331
|
+
let y = rr(t, n, r, i, c, l, p, m, h, s);
|
|
5291
5332
|
return d.set(g, {
|
|
5292
5333
|
graph: y,
|
|
5293
5334
|
inputs: _
|
|
5294
5335
|
}), y;
|
|
5295
5336
|
}), m = e(p, di);
|
|
5296
5337
|
this.$ = {
|
|
5338
|
+
connectorSetupPending: t((e) => {
|
|
5339
|
+
let t = e(this.workspace.$.flowId), n = e(this.workspace.$.target), r = e(this.workspace.$.selection);
|
|
5340
|
+
if (r?.kind != "task" || r.definition == null || !("executor" in r.definition) || r.definition.executor.kind != "connector") return !1;
|
|
5341
|
+
let i = r.definition.executor.action;
|
|
5342
|
+
return e(this.#u).some((e) => e.flowId == t && K(e.target, n) && e.actionId == i && (e.nodeId == null || e.nodeId == r.id));
|
|
5343
|
+
}),
|
|
5297
5344
|
busy: t((e) => {
|
|
5298
5345
|
let t = e(this.workspace.$.busy);
|
|
5299
5346
|
if (t != null) return t;
|
|
@@ -5303,11 +5350,11 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
|
|
|
5303
5350
|
if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
|
|
5304
5351
|
if (e(this.publications.$.changingTriggerId) != null) return "trigger";
|
|
5305
5352
|
}),
|
|
5306
|
-
diagnosticItems: t((e) =>
|
|
5353
|
+
diagnosticItems: t((e) => ue(e(this.workspace.$.revision), e(this.workspace.$.target), e(u))),
|
|
5307
5354
|
diagnostics: u,
|
|
5308
5355
|
designer: p,
|
|
5309
5356
|
designerNodeById: m,
|
|
5310
|
-
sourceNodeIcons: e(p, (e) => Object.fromEntries(e.nodes.flatMap((e) => "icon" in e ? [[e.id, e.icon]] : [])), { equal:
|
|
5357
|
+
sourceNodeIcons: e(p, (e) => Object.fromEntries(e.nodes.flatMap((e) => "icon" in e ? [[e.id, e.icon]] : [])), { equal: K }),
|
|
5311
5358
|
notice: this.#r,
|
|
5312
5359
|
runEventNodes: t((e) => pi(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(m))),
|
|
5313
5360
|
selectedDesignerNode: t((e) => {
|
|
@@ -5320,57 +5367,57 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
|
|
|
5320
5367
|
};
|
|
5321
5368
|
}
|
|
5322
5369
|
dispose() {
|
|
5323
|
-
this.#
|
|
5370
|
+
this.#d = !0, this.#p(), this.#t.invalidate();
|
|
5324
5371
|
for (let e of Object.values(this.$)) e.dispose();
|
|
5325
5372
|
this.connectors.dispose(), this.connectorAccess.dispose(), this.publications.dispose(), this.runRequests.dispose(), this.runs.dispose(), this.triggers.dispose(), this.workspace.dispose(), this.#a.dispose(), this.#o.dispose(), this.#s.dispose();
|
|
5326
5373
|
}
|
|
5327
5374
|
async start(e) {
|
|
5328
|
-
this.#t.invalidate(), this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), await this.workspace.start(e), await this.#
|
|
5375
|
+
this.#t.invalidate(), this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), await this.workspace.start(e), await this.#m;
|
|
5329
5376
|
}
|
|
5330
5377
|
async retryFlows() {
|
|
5331
5378
|
await this.workspace.reloadFlows();
|
|
5332
5379
|
}
|
|
5333
5380
|
dismissNotice() {
|
|
5334
|
-
this.#
|
|
5381
|
+
this.#d || this.#r.set(void 0);
|
|
5335
5382
|
}
|
|
5336
5383
|
invalidateVariableNames() {
|
|
5337
5384
|
this.#c = !0;
|
|
5338
5385
|
}
|
|
5339
5386
|
async refreshVariableNames() {
|
|
5340
|
-
if (!(this.#
|
|
5387
|
+
if (!(this.#d || !this.#i)) {
|
|
5341
5388
|
if (this.#l != null) return this.#l;
|
|
5342
5389
|
if (this.#c) return this.#c = !1, this.#s.set(!0), this.#l = (async () => {
|
|
5343
5390
|
try {
|
|
5344
5391
|
let { variables: e } = await this.#e.listVariables();
|
|
5345
|
-
if (this.#
|
|
5392
|
+
if (this.#d) return;
|
|
5346
5393
|
this.#a.set(e.map((e) => e.name)), this.#o.set(!0);
|
|
5347
5394
|
} catch (e) {
|
|
5348
|
-
this.#c = !0, this.#
|
|
5395
|
+
this.#c = !0, this.#d || this.#r.set(F(e, this.#n.t));
|
|
5349
5396
|
} finally {
|
|
5350
|
-
this.#l = void 0, this.#
|
|
5397
|
+
this.#l = void 0, this.#d || this.#s.set(!1);
|
|
5351
5398
|
}
|
|
5352
5399
|
})(), this.#l;
|
|
5353
5400
|
}
|
|
5354
5401
|
}
|
|
5355
5402
|
async selectFlow(e) {
|
|
5356
|
-
if (this.#
|
|
5403
|
+
if (this.#d) return !1;
|
|
5357
5404
|
this.#t.invalidate();
|
|
5358
5405
|
let t = this.workspace.$.flowId.value, n = this.#r.value;
|
|
5359
|
-
return !await this.workspace.selectFlow(e) || this.#
|
|
5406
|
+
return !await this.workspace.selectFlow(e) || this.#d ? !1 : (e != t && this.#r.value === n && this.#r.set(void 0), this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), await this.#m, !0);
|
|
5360
5407
|
}
|
|
5361
|
-
async #
|
|
5362
|
-
if (!(this.#
|
|
5363
|
-
this.#
|
|
5408
|
+
async #h(e) {
|
|
5409
|
+
if (!(this.#d || this.#f || this.workspace.$.flowId.value != null)) {
|
|
5410
|
+
this.#f = !0;
|
|
5364
5411
|
try {
|
|
5365
5412
|
await this.selectFlow(e);
|
|
5366
5413
|
} finally {
|
|
5367
|
-
this.#
|
|
5414
|
+
this.#f = !1;
|
|
5368
5415
|
}
|
|
5369
5416
|
}
|
|
5370
5417
|
}
|
|
5371
5418
|
async createFlow(e, t) {
|
|
5372
5419
|
let n = await this.workspace.createFlow(e, t);
|
|
5373
|
-
return this.#
|
|
5420
|
+
return this.#d || n == null ? !1 : (await this.selectFlow(n.flowId), this.#d || this.#r.set({
|
|
5374
5421
|
kind: "success",
|
|
5375
5422
|
message: this.#n.t("notice.created", { name: n.name })
|
|
5376
5423
|
}), !0);
|
|
@@ -5391,12 +5438,13 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
|
|
|
5391
5438
|
return t == null || !("waits" in t) || !t.waits.some((t) => t.nodeId == e) ? !1 : this.workspace.locateNode(e);
|
|
5392
5439
|
}
|
|
5393
5440
|
async addNode(e, t, n) {
|
|
5441
|
+
let r;
|
|
5394
5442
|
try {
|
|
5395
5443
|
if (e.kind == "trigger" && "trigger" in e && e.trigger.kind == "connect") {
|
|
5396
5444
|
await this.triggers.connect(e.trigger.provider);
|
|
5397
5445
|
return;
|
|
5398
5446
|
}
|
|
5399
|
-
let
|
|
5447
|
+
let i = this.workspace.$.flowId.value, a = this.workspace.$.target.value;
|
|
5400
5448
|
if (e.kind == "connector") {
|
|
5401
5449
|
let { defaultConnection: t, ...n } = e.connector;
|
|
5402
5450
|
e = {
|
|
@@ -5404,26 +5452,35 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
|
|
|
5404
5452
|
connector: n
|
|
5405
5453
|
};
|
|
5406
5454
|
}
|
|
5407
|
-
let
|
|
5408
|
-
|
|
5455
|
+
let o = e.kind == "connector" && i != null && a != null ? {
|
|
5456
|
+
flowId: i,
|
|
5457
|
+
target: a,
|
|
5458
|
+
actionId: e.connector.actionId,
|
|
5459
|
+
nodeId: void 0
|
|
5460
|
+
} : void 0;
|
|
5461
|
+
o != null && (this.#u.set([...this.#u.value, o]), r = () => this.#u.set(this.#u.value.filter((e) => e !== o)));
|
|
5462
|
+
let s = await this.workspace.addNode(e, t, n);
|
|
5463
|
+
return s != null && e.kind == "connector" && o != null && (o.nodeId = s, this.#u.set([...this.#u.value]), this.#g(o.flowId, o.target, s, e.connector).finally(r), r = void 0), s != null && e.kind == "trigger" && this.triggers.refresh(), s;
|
|
5409
5464
|
} catch (e) {
|
|
5410
|
-
this.#
|
|
5465
|
+
this.#d || this.#r.set(F(e, this.#n.t));
|
|
5411
5466
|
return;
|
|
5467
|
+
} finally {
|
|
5468
|
+
r?.();
|
|
5412
5469
|
}
|
|
5413
5470
|
}
|
|
5414
|
-
async #
|
|
5471
|
+
async #g(e, t, n, r) {
|
|
5415
5472
|
try {
|
|
5416
|
-
if (this.#
|
|
5473
|
+
if (this.#d || e != this.workspace.$.flowId.value) return;
|
|
5417
5474
|
let i = await this.prepareConnectorAction(r);
|
|
5418
|
-
if (i == null || this.#
|
|
5475
|
+
if (i == null || this.#d || e != this.workspace.$.flowId.value) return;
|
|
5419
5476
|
let a = this.workspace.$.revision.value?.node(t, n);
|
|
5420
5477
|
if (a?.kind != "task" || a.node.task != null) return;
|
|
5421
5478
|
let o = this.workspace.$.revision.value?.task(a.node.taskId)?.executor;
|
|
5422
5479
|
if (o?.kind != "connector" || o.action != r.actionId || o.connectionId != null) return;
|
|
5423
5480
|
let s = i.action.defaultConnection;
|
|
5424
|
-
s != null && await this.workspace.setConnectorConnection(a.node.taskId, s.connectionId), !this.#
|
|
5481
|
+
s != null && await this.workspace.setConnectorConnection(a.node.taskId, s.connectionId), !this.#d && e == this.workspace.$.flowId.value && await this.connectors.refresh();
|
|
5425
5482
|
} catch (t) {
|
|
5426
|
-
!this.#
|
|
5483
|
+
!this.#d && e == this.workspace.$.flowId.value && this.#r.set(F(t, this.#n.t));
|
|
5427
5484
|
}
|
|
5428
5485
|
}
|
|
5429
5486
|
async prepareConnectorAction(e) {
|
|
@@ -5435,32 +5492,32 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
|
|
|
5435
5492
|
};
|
|
5436
5493
|
if (!e.authenticated) {
|
|
5437
5494
|
let n = await this.connectors.resolveAction(e.actionId);
|
|
5438
|
-
return this.#
|
|
5495
|
+
return this.#d || t != this.workspace.$.flowId.value ? void 0 : n;
|
|
5439
5496
|
}
|
|
5440
|
-
if (this.connectorAccess.$.value.access ?? await this.connectorAccess.load(t), this.#
|
|
5497
|
+
if (this.connectorAccess.$.value.access ?? await this.connectorAccess.load(t), this.#d || t != this.workspace.$.flowId.value) return;
|
|
5441
5498
|
let a = this.connectorAccess.$.value.access;
|
|
5442
5499
|
if (a == null) return i;
|
|
5443
5500
|
let o;
|
|
5444
5501
|
if (a?.mode == "selectable") {
|
|
5445
|
-
if (this.connectorAccess.$.value.candidates[e.serviceId] ?? await this.connectorAccess.loadCandidates(e.serviceId), this.#
|
|
5502
|
+
if (this.connectorAccess.$.value.candidates[e.serviceId] ?? await this.connectorAccess.loadCandidates([e.serviceId]), this.#d || t != this.workspace.$.flowId.value) return;
|
|
5446
5503
|
let n = this.connectorAccess.$.value.candidates[e.serviceId]?.candidates.filter((t) => t.permissions == null || t.permissions.allActions || t.permissions.actionIds.includes(e.actionId));
|
|
5447
5504
|
if (n == null) return i;
|
|
5448
5505
|
let r = new Set(a.bindings.filter((t) => t.providerId == e.serviceId && t.status == "active").map((e) => e.accessBindingId));
|
|
5449
5506
|
if (n != null && !n.some((e) => r.has(e.accessBindingId))) {
|
|
5450
5507
|
let r = n.find((e) => e.isDefault) ?? (n.length == 1 ? n[0] : void 0);
|
|
5451
5508
|
if (r != null) {
|
|
5452
|
-
if (!await this.connectorAccess.select(e.serviceId, r.accessBindingId)) return this.#
|
|
5509
|
+
if (!await this.connectorAccess.select(e.serviceId, r.accessBindingId)) return this.#d || t != this.workspace.$.flowId.value ? void 0 : i;
|
|
5453
5510
|
a = this.connectorAccess.$.value.access;
|
|
5454
5511
|
}
|
|
5455
5512
|
}
|
|
5456
5513
|
o = n?.some((e) => a?.bindings.some((t) => t.accessBindingId == e.accessBindingId && t.status == "active"));
|
|
5457
5514
|
}
|
|
5458
|
-
if (this.#
|
|
5515
|
+
if (this.#d || t != this.workspace.$.flowId.value) return;
|
|
5459
5516
|
let s = a?.bindings.some((t) => t.providerId == e.serviceId && t.status == "active") ?? !1;
|
|
5460
5517
|
if (a?.mode != "implicit" && !(o ?? s)) return i;
|
|
5461
5518
|
this.workspace.catalogs.refreshFlow(t);
|
|
5462
5519
|
let c = await this.connectors.resolveAction(e.actionId);
|
|
5463
|
-
if (!(this.#
|
|
5520
|
+
if (!(this.#d || t != this.workspace.$.flowId.value)) {
|
|
5464
5521
|
if (c.action.serviceId != e.serviceId) throw Error("Connector Action Provider changed while access was being configured.");
|
|
5465
5522
|
return c;
|
|
5466
5523
|
}
|
|
@@ -5470,13 +5527,13 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
|
|
|
5470
5527
|
}
|
|
5471
5528
|
async requestDraftRun(e) {
|
|
5472
5529
|
let t = this.workspace.$.flowId.value;
|
|
5473
|
-
if (!await this.workspace.saveDraft() || this.#
|
|
5530
|
+
if (!await this.workspace.saveDraft() || this.#d || t != this.workspace.$.flowId.value) return "unavailable";
|
|
5474
5531
|
let n = this.workspace.$.targetFlow.value, r = this.workspace.$.draft.value;
|
|
5475
5532
|
return n == null || r == null ? "unavailable" : await this.runRequests.requestDraft(n, r, e);
|
|
5476
5533
|
}
|
|
5477
5534
|
async editDraftRunInputs(e) {
|
|
5478
5535
|
let t = this.workspace.$.flowId.value;
|
|
5479
|
-
if (!await this.workspace.saveDraft() || this.#
|
|
5536
|
+
if (!await this.workspace.saveDraft() || this.#d || t != this.workspace.$.flowId.value) return "unavailable";
|
|
5480
5537
|
let n = this.workspace.$.targetFlow.value, r = this.workspace.$.draft.value;
|
|
5481
5538
|
return n == null || r == null ? "unavailable" : await this.runRequests.editDraft(n, r, e);
|
|
5482
5539
|
}
|
|
@@ -5484,25 +5541,25 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
|
|
|
5484
5541
|
let e = this.workspace.$.targetFlow.value;
|
|
5485
5542
|
return e == null ? "unavailable" : await this.runRequests.requestLive(e);
|
|
5486
5543
|
}
|
|
5487
|
-
async #
|
|
5544
|
+
async #_(e, t) {
|
|
5488
5545
|
let n = this.workspace.$.target.value;
|
|
5489
|
-
if (this.#
|
|
5546
|
+
if (this.#d || this.runRequests.$.submitting.value != null || n?.kind != "flow" || this.workspace.$.flowId.value != t.flowId) return;
|
|
5490
5547
|
let r = this.#t.begin();
|
|
5491
5548
|
try {
|
|
5492
5549
|
let n = await e.getRun(t.runId), i = this.workspace.$.target.value;
|
|
5493
|
-
if (!r() || this.#
|
|
5550
|
+
if (!r() || this.#d || i?.kind != "flow" || this.workspace.$.flowId.value != t.flowId || n.flowId != t.flowId || n.runId != t.runId) return;
|
|
5494
5551
|
this.runs.followExternal(n);
|
|
5495
5552
|
} catch {
|
|
5496
5553
|
return;
|
|
5497
5554
|
}
|
|
5498
5555
|
}
|
|
5499
|
-
}, gi =
|
|
5556
|
+
}, gi = Tt(() => import("./flowWorkspace-etUB3NSN.js").then((e) => e.t));
|
|
5500
5557
|
function _i({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: c, tokenLabel: u }) {
|
|
5501
|
-
let d = c != null && u != null && i != null, f = c ?? "", p = /* @__PURE__ */
|
|
5502
|
-
/* @__PURE__ */
|
|
5558
|
+
let d = c != null && u != null && i != null, f = c ?? "", p = /* @__PURE__ */ U(Ct, { children: [
|
|
5559
|
+
/* @__PURE__ */ H("div", {
|
|
5503
5560
|
"aria-hidden": "true",
|
|
5504
5561
|
className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
|
|
5505
|
-
children: /* @__PURE__ */
|
|
5562
|
+
children: /* @__PURE__ */ U("svg", {
|
|
5506
5563
|
className: "size-5",
|
|
5507
5564
|
fill: "none",
|
|
5508
5565
|
stroke: "currentColor",
|
|
@@ -5510,40 +5567,40 @@ function _i({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
5510
5567
|
strokeLinejoin: "round",
|
|
5511
5568
|
strokeWidth: "1.8",
|
|
5512
5569
|
viewBox: "0 0 24 24",
|
|
5513
|
-
children: [/* @__PURE__ */
|
|
5570
|
+
children: [/* @__PURE__ */ H("rect", {
|
|
5514
5571
|
height: "9",
|
|
5515
5572
|
rx: "2",
|
|
5516
5573
|
width: "14",
|
|
5517
5574
|
x: "5",
|
|
5518
5575
|
y: "11"
|
|
5519
|
-
}), /* @__PURE__ */
|
|
5576
|
+
}), /* @__PURE__ */ H("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
|
|
5520
5577
|
})
|
|
5521
5578
|
}),
|
|
5522
|
-
/* @__PURE__ */
|
|
5579
|
+
/* @__PURE__ */ U("header", {
|
|
5523
5580
|
className: "flex flex-col gap-2",
|
|
5524
|
-
children: [/* @__PURE__ */
|
|
5581
|
+
children: [/* @__PURE__ */ H("h1", {
|
|
5525
5582
|
className: "text-xl font-semibold tracking-tight text-balance",
|
|
5526
5583
|
children: o
|
|
5527
|
-
}), /* @__PURE__ */
|
|
5584
|
+
}), /* @__PURE__ */ H("p", {
|
|
5528
5585
|
className: "text-sm/relaxed text-muted-foreground text-pretty",
|
|
5529
5586
|
children: t
|
|
5530
5587
|
})]
|
|
5531
5588
|
}),
|
|
5532
|
-
d && /* @__PURE__ */
|
|
5589
|
+
d && /* @__PURE__ */ H(ct, { children: /* @__PURE__ */ U(ot, {
|
|
5533
5590
|
"data-invalid": n != null,
|
|
5534
5591
|
children: [
|
|
5535
|
-
/* @__PURE__ */
|
|
5592
|
+
/* @__PURE__ */ H(st, {
|
|
5536
5593
|
htmlFor: "session-token",
|
|
5537
5594
|
children: u
|
|
5538
5595
|
}),
|
|
5539
|
-
/* @__PURE__ */
|
|
5596
|
+
/* @__PURE__ */ H(l, {
|
|
5540
5597
|
autoComplete: "username",
|
|
5541
5598
|
name: "username",
|
|
5542
5599
|
type: "hidden",
|
|
5543
5600
|
value: "open-flow",
|
|
5544
5601
|
readOnly: !0
|
|
5545
5602
|
}),
|
|
5546
|
-
/* @__PURE__ */
|
|
5603
|
+
/* @__PURE__ */ H(l, {
|
|
5547
5604
|
autoComplete: "current-password",
|
|
5548
5605
|
"aria-invalid": n != null,
|
|
5549
5606
|
autoFocus: !0,
|
|
@@ -5555,29 +5612,29 @@ function _i({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
5555
5612
|
type: "password",
|
|
5556
5613
|
value: f
|
|
5557
5614
|
}),
|
|
5558
|
-
n != null && /* @__PURE__ */
|
|
5615
|
+
n != null && /* @__PURE__ */ H(dt, { children: n })
|
|
5559
5616
|
]
|
|
5560
5617
|
}) }),
|
|
5561
|
-
e != null && r != null && /* @__PURE__ */
|
|
5618
|
+
e != null && r != null && /* @__PURE__ */ U(s, {
|
|
5562
5619
|
disabled: a || d && f.length == 0,
|
|
5563
5620
|
size: "lg",
|
|
5564
5621
|
type: "submit",
|
|
5565
|
-
children: [a && /* @__PURE__ */
|
|
5622
|
+
children: [a && /* @__PURE__ */ H(at, {
|
|
5566
5623
|
"aria-label": e,
|
|
5567
5624
|
"data-icon": "inline-start"
|
|
5568
5625
|
}), e]
|
|
5569
5626
|
}),
|
|
5570
|
-
a && e == null && /* @__PURE__ */
|
|
5627
|
+
a && e == null && /* @__PURE__ */ H(at, { "aria-label": t })
|
|
5571
5628
|
] }), m = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
|
|
5572
|
-
return /* @__PURE__ */
|
|
5629
|
+
return /* @__PURE__ */ H("main", {
|
|
5573
5630
|
className: "open-flow-workbench",
|
|
5574
|
-
children: /* @__PURE__ */
|
|
5631
|
+
children: /* @__PURE__ */ H("div", {
|
|
5575
5632
|
className: "grid h-full overflow-auto bg-muted/20 p-4",
|
|
5576
|
-
children: r == null ? /* @__PURE__ */
|
|
5633
|
+
children: r == null ? /* @__PURE__ */ H("section", {
|
|
5577
5634
|
"aria-busy": a,
|
|
5578
5635
|
className: m,
|
|
5579
5636
|
children: p
|
|
5580
|
-
}) : /* @__PURE__ */
|
|
5637
|
+
}) : /* @__PURE__ */ H("form", {
|
|
5581
5638
|
"aria-busy": a,
|
|
5582
5639
|
className: m,
|
|
5583
5640
|
onSubmit: r,
|
|
@@ -5587,14 +5644,14 @@ function _i({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
5587
5644
|
});
|
|
5588
5645
|
}
|
|
5589
5646
|
function vi({ host: e, store: t }) {
|
|
5590
|
-
let [n] =
|
|
5591
|
-
return
|
|
5647
|
+
let [n] = W(() => e.notify.bind(e)), i = r(t.$.notice);
|
|
5648
|
+
return Et(() => n(i), [n, i]), Et(() => () => n(void 0), [n]), null;
|
|
5592
5649
|
}
|
|
5593
5650
|
function yi({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: i, flowBadges: a, hrefFor: o, hostAction: s, hostTitle: c, language: l, navigation: u, onConfigureConnector: d, onManageConnectorAccess: f, onHostAction: p, onLanguageChange: m, store: h, theme: g }) {
|
|
5594
5651
|
let _ = r(h.workspace.$.flowId);
|
|
5595
|
-
return /* @__PURE__ */
|
|
5652
|
+
return /* @__PURE__ */ H("div", {
|
|
5596
5653
|
className: "app-shell",
|
|
5597
|
-
children: _ == null ? /* @__PURE__ */
|
|
5654
|
+
children: _ == null ? /* @__PURE__ */ H(Gt, {
|
|
5598
5655
|
catalogWidth: e,
|
|
5599
5656
|
createFlowDisabled: n,
|
|
5600
5657
|
createFlowField: i,
|
|
@@ -5611,12 +5668,12 @@ function yi({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
5611
5668
|
onLanguageChange: m,
|
|
5612
5669
|
onSelectFlow: (e) => void u.selectFlow(e),
|
|
5613
5670
|
store: h
|
|
5614
|
-
}) : /* @__PURE__ */
|
|
5615
|
-
fallback: /* @__PURE__ */
|
|
5671
|
+
}) : /* @__PURE__ */ H(wt, {
|
|
5672
|
+
fallback: /* @__PURE__ */ H("main", {
|
|
5616
5673
|
"aria-busy": "true",
|
|
5617
5674
|
className: "workspace"
|
|
5618
5675
|
}),
|
|
5619
|
-
children: /* @__PURE__ */
|
|
5676
|
+
children: /* @__PURE__ */ H(gi, {
|
|
5620
5677
|
hostAction: s,
|
|
5621
5678
|
hostTitle: c,
|
|
5622
5679
|
hrefFor: o,
|
|
@@ -5631,43 +5688,43 @@ function yi({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
5631
5688
|
});
|
|
5632
5689
|
}
|
|
5633
5690
|
function bi({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, host: a, hostAction: s, hostTitle: c, hrefFor: l, language: u, location: d, onConfigureConnector: f, onManageConnectorAccess: p, onHostAction: m, onLanguageChange: g, onNavigate: _, preferences: v, theme: y, variables: b = !0 }) {
|
|
5634
|
-
let x =
|
|
5691
|
+
let x = Dt(_);
|
|
5635
5692
|
x.current = _;
|
|
5636
|
-
let [{ i18n: S, navigation:
|
|
5637
|
-
let e = h(u), t = new hi(new
|
|
5693
|
+
let [{ i18n: S, navigation: C, store: w }] = W(() => {
|
|
5694
|
+
let e = h(u), t = new hi(new he((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), v, j, e, a, b);
|
|
5638
5695
|
return {
|
|
5639
5696
|
i18n: e,
|
|
5640
|
-
navigation: new
|
|
5697
|
+
navigation: new jt(t, d, (e, t) => x.current(e, t)),
|
|
5641
5698
|
store: t
|
|
5642
5699
|
};
|
|
5643
5700
|
});
|
|
5644
|
-
return
|
|
5645
|
-
|
|
5701
|
+
return Et(() => {
|
|
5702
|
+
C.start();
|
|
5646
5703
|
let e = () => {
|
|
5647
|
-
|
|
5704
|
+
w.connectors.refreshAfterAuthorization(), w.triggers.refreshAfterAuthorization(), w.invalidateVariableNames();
|
|
5648
5705
|
};
|
|
5649
5706
|
return globalThis.addEventListener("focus", e), () => {
|
|
5650
|
-
globalThis.removeEventListener("focus", e),
|
|
5707
|
+
globalThis.removeEventListener("focus", e), C.dispose(), w.dispose(), S.dispose();
|
|
5651
5708
|
};
|
|
5652
5709
|
}, [
|
|
5653
5710
|
S,
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
]),
|
|
5657
|
-
|
|
5711
|
+
C,
|
|
5712
|
+
w
|
|
5713
|
+
]), Et(() => void C.apply(d), [d, C]), Et(() => {
|
|
5714
|
+
w.triggers.catalog.setLanguage(u), w.connectors.setLanguage(u), S.lang != u && S.switchLang(u);
|
|
5658
5715
|
}, [
|
|
5659
5716
|
S,
|
|
5660
5717
|
u,
|
|
5661
|
-
|
|
5662
|
-
]), /* @__PURE__ */
|
|
5718
|
+
w
|
|
5719
|
+
]), /* @__PURE__ */ H(o, {
|
|
5663
5720
|
i18n: S,
|
|
5664
|
-
children: /* @__PURE__ */
|
|
5721
|
+
children: /* @__PURE__ */ U("div", {
|
|
5665
5722
|
className: "open-flow-theme open-flow-workbench",
|
|
5666
5723
|
"data-theme": y,
|
|
5667
|
-
children: [/* @__PURE__ */
|
|
5724
|
+
children: [/* @__PURE__ */ H(vi, {
|
|
5668
5725
|
host: a,
|
|
5669
|
-
store:
|
|
5670
|
-
}), /* @__PURE__ */
|
|
5726
|
+
store: w
|
|
5727
|
+
}), /* @__PURE__ */ H(yi, {
|
|
5671
5728
|
catalogWidth: e,
|
|
5672
5729
|
createFlow: t,
|
|
5673
5730
|
createFlowDisabled: n,
|
|
@@ -5677,19 +5734,19 @@ function bi({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
5677
5734
|
hostTitle: c,
|
|
5678
5735
|
hrefFor: l,
|
|
5679
5736
|
language: u,
|
|
5680
|
-
navigation:
|
|
5737
|
+
navigation: C,
|
|
5681
5738
|
onConfigureConnector: f,
|
|
5682
5739
|
onManageConnectorAccess: p,
|
|
5683
5740
|
onHostAction: m,
|
|
5684
5741
|
onLanguageChange: g,
|
|
5685
|
-
store:
|
|
5742
|
+
store: w,
|
|
5686
5743
|
theme: y
|
|
5687
5744
|
})]
|
|
5688
5745
|
})
|
|
5689
5746
|
});
|
|
5690
5747
|
}
|
|
5691
5748
|
function xi({ sessionKey: e, ...t }) {
|
|
5692
|
-
return /* @__PURE__ */
|
|
5749
|
+
return /* @__PURE__ */ H(bi, { ...t }, e);
|
|
5693
5750
|
}
|
|
5694
5751
|
//#endregion
|
|
5695
|
-
export {
|
|
5752
|
+
export { te as EventSourcesPage, _i as OpenFlowSessionGate, xi as OpenFlowWorkbench, yt as isWorkbenchLanguage, xt as resolveWorkbenchLanguage, St as workbenchLanguageNames, bt as workbenchLanguages };
|