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