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