@w6w/embed 0.2.33 → 0.2.34
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/{DocumentFormModal-Cw85R4wk.js → DocumentFormModal-B3OkvI5v.js} +2 -2
- package/dist/{DocumentFormModal-Cw85R4wk.js.map → DocumentFormModal-B3OkvI5v.js.map} +1 -1
- package/dist/{ImportSpecModal-fU5RsVTa.js → ImportSpecModal-SQvTwtcX.js} +2 -2
- package/dist/{ImportSpecModal-fU5RsVTa.js.map → ImportSpecModal-SQvTwtcX.js.map} +1 -1
- package/dist/WorkflowEditor-D2EfEP-U.js +1201 -0
- package/dist/WorkflowEditor-D2EfEP-U.js.map +1 -0
- package/dist/apps-CFWdgGst.js +106 -0
- package/dist/apps-CFWdgGst.js.map +1 -0
- package/dist/chrome/HistoryView.d.ts +3 -0
- package/dist/editor-apps-ShwCmvLY.js +178 -0
- package/dist/editor-apps-ShwCmvLY.js.map +1 -0
- package/dist/{editor-tools-Dn7TgCP4.js → editor-tools-rY9nddqr.js} +49 -49
- package/dist/{editor-tools-Dn7TgCP4.js.map → editor-tools-rY9nddqr.js.map} +1 -1
- package/dist/editor.mjs +1 -1
- package/dist/editors.mjs +8 -8
- package/dist/index.mjs +4 -4
- package/dist/lib/history-query.d.ts +22 -1
- package/dist/lib/run-log-nodes.d.ts +43 -0
- package/dist/lists.mjs +6 -6
- package/dist/rail.mjs +1 -1
- package/dist/repos/history.d.ts +5 -1
- package/dist/repos.mjs +304 -300
- package/dist/{spec-import-CGPqUUjN.js → spec-import-CPbDnnuv.js} +2 -2
- package/dist/{spec-import-CGPqUUjN.js.map → spec-import-CPbDnnuv.js.map} +1 -1
- package/dist/{workflows-Dz8LMjnt.js → workflows-RhR8kwt7.js} +255 -214
- package/dist/workflows-RhR8kwt7.js.map +1 -0
- package/package.json +2 -2
- package/dist/WorkflowEditor-C7oudiIb.js +0 -1169
- package/dist/WorkflowEditor-C7oudiIb.js.map +0 -1
- package/dist/apps-FMcQfyL2.js +0 -92
- package/dist/apps-FMcQfyL2.js.map +0 -1
- package/dist/editor-apps-HEOclsxL.js +0 -152
- package/dist/editor-apps-HEOclsxL.js.map +0 -1
- package/dist/workflows-Dz8LMjnt.js.map +0 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { useQueryClient as
|
|
2
|
-
import { isTerminalRunStatus as
|
|
3
|
-
import { u as
|
|
1
|
+
import { useQueryClient as g, useMutation as w, useQuery as y } from "@tanstack/react-query";
|
|
2
|
+
import { isTerminalRunStatus as R, path as h } from "@w6w/sdk";
|
|
3
|
+
import { u as d } from "./client-context-CX61Bgw-.js";
|
|
4
4
|
import { foldStateLog as C } from "@w6w/expr";
|
|
5
5
|
function K(t) {
|
|
6
6
|
return (t == null ? void 0 : t.nodes) ?? (t == null ? void 0 : t.steps) ?? void 0;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return t === void 0 || !
|
|
8
|
+
const q = "Node failed without reporting a reason.", $ = "Run failed without reporting a reason.";
|
|
9
|
+
function T(t) {
|
|
10
|
+
return t === void 0 || !R(t);
|
|
11
11
|
}
|
|
12
12
|
function P(t, e) {
|
|
13
|
-
return e || t === void 0 ? !1 : !
|
|
13
|
+
return e || t === void 0 ? !1 : !R(t);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
return t !== void 0 &&
|
|
15
|
+
const bt = [0, 1500];
|
|
16
|
+
function qt(t, e, n) {
|
|
17
|
+
return t !== void 0 && R(t) && e === n;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function vt(t, e) {
|
|
20
20
|
return P(t, e) ? t === "queued" ? "Queued…" : "Running…" : "Run";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function It(t) {
|
|
23
23
|
return t === "run_not_cancelable" ? "reconcile" : "surface";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function U(t, e) {
|
|
26
26
|
if (!t) return [];
|
|
27
|
-
const n = e ?
|
|
27
|
+
const n = e ? W(e) : void 0;
|
|
28
28
|
return Object.entries(t).map(([o, r]) => ({
|
|
29
|
-
...
|
|
29
|
+
...A(o, r),
|
|
30
30
|
...N(r),
|
|
31
31
|
...(n == null ? void 0 : n.get(o)) ?? {}
|
|
32
32
|
}));
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function W(t) {
|
|
35
35
|
const e = [...t].sort((r, i) => r.seq - i.seq), n = /* @__PURE__ */ new Map();
|
|
36
36
|
for (const r of e) {
|
|
37
37
|
if (r.nodeId === null || r.nodeId === void 0) continue;
|
|
@@ -45,17 +45,17 @@ function U(t) {
|
|
|
45
45
|
o.set(r, { stateWrites: i, stateAfter: C(e, a) });
|
|
46
46
|
return o;
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const Q = /* @__PURE__ */ new Set([
|
|
49
49
|
"not_on_path",
|
|
50
50
|
"condition",
|
|
51
51
|
"stopped",
|
|
52
52
|
"disabled"
|
|
53
53
|
]);
|
|
54
|
-
function
|
|
54
|
+
function A(t, e) {
|
|
55
55
|
return {
|
|
56
56
|
id: t,
|
|
57
57
|
status: e.status,
|
|
58
|
-
...e.status === "skipped" &&
|
|
58
|
+
...e.status === "skipped" && Q.has(e.skipReason) ? { skipReason: e.skipReason } : {},
|
|
59
59
|
startedAt: e.startedAt,
|
|
60
60
|
finishedAt: e.finishedAt,
|
|
61
61
|
input: e.input,
|
|
@@ -65,15 +65,15 @@ function T(t, e) {
|
|
|
65
65
|
...D(e)
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const L = /* @__PURE__ */ new Set(["succeeded", "failed", "running"]);
|
|
69
69
|
function N(t) {
|
|
70
70
|
if (!t || !Array.isArray(t.iterations)) return {};
|
|
71
71
|
const e = t.iterations.filter((o) => o !== null && typeof o == "object").map((o) => {
|
|
72
72
|
var u;
|
|
73
|
-
const r = o.nodes !== null && typeof o.nodes == "object" ? o.nodes : {}, i = Object.entries(r).map(([s,
|
|
74
|
-
...
|
|
75
|
-
...N(
|
|
76
|
-
})), a = typeof o.failedNodeId == "string" && o.failedNodeId !== "" ? o.failedNodeId : (u = i.find((s) => s.status === "failed")) == null ? void 0 : u.id, c =
|
|
73
|
+
const r = o.nodes !== null && typeof o.nodes == "object" ? o.nodes : {}, i = Object.entries(r).map(([s, l]) => ({
|
|
74
|
+
...A(s, l),
|
|
75
|
+
...N(l)
|
|
76
|
+
})), a = typeof o.failedNodeId == "string" && o.failedNodeId !== "" ? o.failedNodeId : (u = i.find((s) => s.status === "failed")) == null ? void 0 : u.id, c = L.has(o.status) ? o.status : i.some((s) => s.status === "failed") ? "failed" : i.some((s) => s.status === "running") ? "running" : "succeeded";
|
|
77
77
|
return {
|
|
78
78
|
index: o.index,
|
|
79
79
|
status: c,
|
|
@@ -89,14 +89,14 @@ function N(t) {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
function D(t) {
|
|
92
|
-
const e =
|
|
93
|
-
return e ? { error: e } : t.status === "failed" ? { error: { message:
|
|
92
|
+
const e = v(t.error);
|
|
93
|
+
return e ? { error: e } : t.status === "failed" ? { error: { message: q } } : {};
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function v(t) {
|
|
96
96
|
if (t != null) {
|
|
97
97
|
if (typeof t == "string" && t !== "") return { message: t };
|
|
98
98
|
if (typeof t == "object") {
|
|
99
|
-
const e = t, n = typeof e.code == "string" ? e.code : void 0, o = typeof e.message == "string" && e.message !== "" ? e.message : n ||
|
|
99
|
+
const e = t, n = typeof e.code == "string" ? e.code : void 0, o = typeof e.message == "string" && e.message !== "" ? e.message : n || j(t);
|
|
100
100
|
return {
|
|
101
101
|
...n !== void 0 ? { code: n } : {},
|
|
102
102
|
message: o || "Unknown error.",
|
|
@@ -107,34 +107,34 @@ function b(t) {
|
|
|
107
107
|
return { message: String(t) || "Unknown error." };
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function j(t) {
|
|
111
111
|
try {
|
|
112
112
|
return JSON.stringify(t) ?? "";
|
|
113
113
|
} catch {
|
|
114
114
|
return "";
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function Rt(t, e) {
|
|
118
118
|
if (!t) return {};
|
|
119
119
|
const n = new Set(e.filter((s) => s.error !== void 0).map((s) => s.id)), o = new Set(
|
|
120
|
-
e.filter((s) => s.error !== void 0 && s.error.message !==
|
|
121
|
-
), r = (t.stepErrors ?? []).map((s) => ({ e: s, id: s.nodeId ?? s.stepId ?? "" })).filter(({ id: s }) => !o.has(s)).map(({ e: s, id:
|
|
122
|
-
stepId:
|
|
123
|
-
error:
|
|
124
|
-
})), i =
|
|
120
|
+
e.filter((s) => s.error !== void 0 && s.error.message !== q).map((s) => s.id)
|
|
121
|
+
), r = (t.stepErrors ?? []).map((s) => ({ e: s, id: s.nodeId ?? s.stepId ?? "" })).filter(({ id: s }) => !o.has(s)).map(({ e: s, id: l }) => ({
|
|
122
|
+
stepId: l,
|
|
123
|
+
error: v(s.error) ?? { message: q }
|
|
124
|
+
})), i = v(t.error), a = (s) => i !== void 0 && (s == null ? void 0 : s.message) === i.message && (s == null ? void 0 : s.code) === i.code;
|
|
125
125
|
let u = e.some((s) => a(s.error)) || r.some((s) => a(s.error)) ? void 0 : i;
|
|
126
|
-
return !u && t.status === "failed" && n.size === 0 && r.length === 0 && (u = { message:
|
|
126
|
+
return !u && t.status === "failed" && n.size === 0 && r.length === 0 && (u = { message: $ }), {
|
|
127
127
|
...u ? { runError: u } : {},
|
|
128
128
|
...r.length > 0 ? { stepErrors: r } : {}
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function x(t) {
|
|
132
132
|
var n;
|
|
133
133
|
const e = (n = t == null ? void 0 : t[t.length - 1]) == null ? void 0 : n.with;
|
|
134
134
|
if (!(e === null || typeof e != "object" || Array.isArray(e)))
|
|
135
135
|
return e;
|
|
136
136
|
}
|
|
137
|
-
async function
|
|
137
|
+
async function Tt(t, e, n) {
|
|
138
138
|
var o;
|
|
139
139
|
if (t) {
|
|
140
140
|
if (n)
|
|
@@ -147,13 +147,13 @@ async function bt(t, e, n) {
|
|
|
147
147
|
} catch {
|
|
148
148
|
}
|
|
149
149
|
try {
|
|
150
|
-
return
|
|
150
|
+
return x(await e(t));
|
|
151
151
|
} catch {
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Et(t, e, n) {
|
|
157
157
|
const o = t.find((i) => {
|
|
158
158
|
var a;
|
|
159
159
|
return !!((a = i.uses) != null && a.app) && e(i.uses.app);
|
|
@@ -167,75 +167,83 @@ function Rt(t, e, n) {
|
|
|
167
167
|
);
|
|
168
168
|
return r ? { id: r.id, manual: !1 } : void 0;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
171
|
-
function
|
|
170
|
+
const G = /* @__PURE__ */ new Set(["succeeded", "failed", "canceled"]);
|
|
171
|
+
function H(t) {
|
|
172
172
|
return new Promise((e) => setTimeout(e, t));
|
|
173
173
|
}
|
|
174
|
-
async function F(t, e =
|
|
174
|
+
async function F(t, e = H) {
|
|
175
175
|
for (let n = 0; n < 600; n++) {
|
|
176
176
|
const o = await t();
|
|
177
|
-
if (
|
|
177
|
+
if (G.has(o.status)) return o;
|
|
178
178
|
await e(500);
|
|
179
179
|
}
|
|
180
180
|
return t();
|
|
181
181
|
}
|
|
182
|
-
const
|
|
182
|
+
const Y = {
|
|
183
183
|
status: "",
|
|
184
184
|
kind: "",
|
|
185
185
|
from: "",
|
|
186
186
|
to: "",
|
|
187
187
|
q: "",
|
|
188
|
+
trigger: "",
|
|
188
189
|
offset: 0
|
|
189
|
-
}, _ =
|
|
190
|
+
}, _ = /^(entry|kind):.{1,200}$/;
|
|
191
|
+
function B(t) {
|
|
192
|
+
if (!_.test(t)) return {};
|
|
193
|
+
const e = t.slice(t.indexOf(":") + 1);
|
|
194
|
+
return t.startsWith("entry:") ? { entry: e } : { trigger: e };
|
|
195
|
+
}
|
|
196
|
+
const O = 25, J = /* @__PURE__ */ new Set([
|
|
190
197
|
"queued",
|
|
191
198
|
"running",
|
|
192
199
|
"succeeded",
|
|
193
200
|
"failed",
|
|
194
201
|
"canceled"
|
|
195
|
-
]),
|
|
202
|
+
]), V = /* @__PURE__ */ new Set(["function", "endpoint", "workflow"]), z = /^\d{4}-\d{2}-\d{2}$/;
|
|
196
203
|
function m(t) {
|
|
197
|
-
if (!
|
|
198
|
-
const { y: e, m: n, d: o } =
|
|
204
|
+
if (!z.test(t)) return !1;
|
|
205
|
+
const { y: e, m: n, d: o } = I(t), r = new Date(e, n - 1, o);
|
|
199
206
|
return r.getFullYear() === e && r.getMonth() === n - 1 && r.getDate() === o;
|
|
200
207
|
}
|
|
201
|
-
function
|
|
208
|
+
function I(t) {
|
|
202
209
|
const [e, n, o] = t.split("-").map(Number);
|
|
203
210
|
return { y: e, m: n, d: o };
|
|
204
211
|
}
|
|
205
|
-
function
|
|
206
|
-
const e = new URLSearchParams(t), n = e.get("status") ?? "", o = e.get("kind") ?? "", r = e.get("from") ?? "", i = e.get("to") ?? "", a = e.get("q") ?? "", c = e.get("offset");
|
|
207
|
-
let
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
Number.isInteger(
|
|
212
|
+
function At(t) {
|
|
213
|
+
const e = new URLSearchParams(t), n = e.get("status") ?? "", o = e.get("kind") ?? "", r = e.get("from") ?? "", i = e.get("to") ?? "", a = e.get("q") ?? "", c = e.get("trigger") ?? "", u = e.get("offset");
|
|
214
|
+
let s = 0;
|
|
215
|
+
if (u !== null) {
|
|
216
|
+
const l = Number(u);
|
|
217
|
+
Number.isInteger(l) && l >= 0 && (s = l);
|
|
211
218
|
}
|
|
212
219
|
return {
|
|
213
|
-
status:
|
|
214
|
-
kind:
|
|
220
|
+
status: J.has(n) ? n : "",
|
|
221
|
+
kind: V.has(o) ? o : "",
|
|
215
222
|
from: m(r) ? r : "",
|
|
216
223
|
to: m(i) ? i : "",
|
|
217
224
|
q: a,
|
|
218
|
-
|
|
225
|
+
trigger: _.test(c) ? c : "",
|
|
226
|
+
offset: s
|
|
219
227
|
};
|
|
220
228
|
}
|
|
221
|
-
function
|
|
229
|
+
function Nt(t) {
|
|
222
230
|
const e = new URLSearchParams();
|
|
223
|
-
t.status !== "" && e.set("status", t.status), t.kind !== "" && e.set("kind", t.kind), t.from !== "" && e.set("from", t.from), t.to !== "" && e.set("to", t.to), t.q !== "" && e.set("q", t.q), t.offset > 0 && e.set("offset", String(t.offset));
|
|
231
|
+
t.status !== "" && e.set("status", t.status), t.kind !== "" && e.set("kind", t.kind), t.from !== "" && e.set("from", t.from), t.to !== "" && e.set("to", t.to), t.q !== "" && e.set("q", t.q), t.trigger && e.set("trigger", t.trigger), t.offset > 0 && e.set("offset", String(t.offset));
|
|
224
232
|
const n = e.toString();
|
|
225
233
|
return n === "" ? "" : `?${n}`;
|
|
226
234
|
}
|
|
227
|
-
function
|
|
235
|
+
function M(t, e, n) {
|
|
228
236
|
const o = {};
|
|
229
237
|
if ("project" in t ? (o.project = t.project, e.kind !== "" && (o.kind = e.kind)) : o.callable = t.callable, e.status !== "" && (o.status = e.status), e.from !== "" && m(e.from)) {
|
|
230
|
-
const { y: i, m: a, d: c } =
|
|
238
|
+
const { y: i, m: a, d: c } = I(e.from);
|
|
231
239
|
o.from = new Date(i, a - 1, c).toISOString();
|
|
232
240
|
}
|
|
233
241
|
if (e.to !== "" && m(e.to)) {
|
|
234
|
-
const { y: i, m: a, d: c } =
|
|
242
|
+
const { y: i, m: a, d: c } = I(e.to);
|
|
235
243
|
o.to = new Date(i, a - 1, c + 1).toISOString();
|
|
236
244
|
}
|
|
237
245
|
const r = e.q.trim();
|
|
238
|
-
return r !== "" && (o.q = r), n.paged && (o.limit = String(n.limit ??
|
|
246
|
+
return r !== "" && (o.q = r), e.trigger && Object.assign(o, B(e.trigger)), n.paged && (o.limit = String(n.limit ?? O), e.offset > 0 && (o.offset = String(e.offset))), o;
|
|
239
247
|
}
|
|
240
248
|
const E = {
|
|
241
249
|
root: ["history"],
|
|
@@ -250,23 +258,26 @@ const E = {
|
|
|
250
258
|
},
|
|
251
259
|
detail(t, e) {
|
|
252
260
|
return ["history", "detail", t, e];
|
|
261
|
+
},
|
|
262
|
+
triggers(t) {
|
|
263
|
+
return ["history", "triggers", t];
|
|
253
264
|
}
|
|
254
265
|
};
|
|
255
|
-
function
|
|
266
|
+
function Z(t, e, n, o = O) {
|
|
256
267
|
return t.request({
|
|
257
268
|
method: "GET",
|
|
258
269
|
path: "/history",
|
|
259
|
-
query:
|
|
270
|
+
query: M(e, n, { paged: !0, limit: o })
|
|
260
271
|
}).then((r) => r.body);
|
|
261
272
|
}
|
|
262
|
-
function
|
|
273
|
+
function Ft(t, e, n) {
|
|
263
274
|
return t.request({
|
|
264
275
|
method: "GET",
|
|
265
276
|
path: "/history/stats",
|
|
266
|
-
query:
|
|
277
|
+
query: M(e, n, { paged: !1 })
|
|
267
278
|
}).then((o) => o.body.stats);
|
|
268
279
|
}
|
|
269
|
-
async function
|
|
280
|
+
async function X(t, e) {
|
|
270
281
|
var a, c, u;
|
|
271
282
|
const n = /* @__PURE__ */ new Map();
|
|
272
283
|
let o;
|
|
@@ -277,36 +288,63 @@ async function z(t, e) {
|
|
|
277
288
|
return n;
|
|
278
289
|
}
|
|
279
290
|
for (const s of o) {
|
|
280
|
-
const
|
|
281
|
-
typeof s.id != "string" || typeof
|
|
291
|
+
const l = (a = s.uses) == null ? void 0 : a.app, f = (c = s.uses) == null ? void 0 : c.action;
|
|
292
|
+
typeof s.id != "string" || typeof l != "string" || typeof f != "string" || n.set(s.id, { app: l, action: f, ...((u = s.uses) == null ? void 0 : u.trigger) === !0 ? { trigger: !0 } : {} });
|
|
282
293
|
}
|
|
283
294
|
const r = [...new Set([...n.values()].map((s) => s.app))].filter(
|
|
284
295
|
(s) => !s.startsWith("@w6w/")
|
|
285
296
|
), i = await Promise.all(
|
|
286
297
|
r.map(async (s) => {
|
|
287
|
-
const
|
|
298
|
+
const l = [...n.values()].some((p) => p.app === s && p.trigger), [f, k] = await Promise.all([
|
|
288
299
|
t.console.apps.get(s).catch(() => null),
|
|
289
|
-
|
|
290
|
-
]),
|
|
291
|
-
for (const p of (f == null ? void 0 : f.actions) ?? [])
|
|
292
|
-
for (const p of k)
|
|
293
|
-
return { app: s, displayName: f == null ? void 0 : f.app.displayName, titles:
|
|
300
|
+
l ? t.console.apps.getTriggers(s).catch(() => []) : Promise.resolve([])
|
|
301
|
+
]), b = /* @__PURE__ */ new Map();
|
|
302
|
+
for (const p of (f == null ? void 0 : f.actions) ?? []) b.set(`a:${p.key}`, p.title);
|
|
303
|
+
for (const p of k) b.set(`t:${p.key}`, p.title);
|
|
304
|
+
return { app: s, displayName: f == null ? void 0 : f.app.displayName, titles: b };
|
|
294
305
|
})
|
|
295
306
|
);
|
|
296
307
|
for (const s of n.values()) {
|
|
297
|
-
const
|
|
298
|
-
if (!
|
|
299
|
-
|
|
300
|
-
const f =
|
|
308
|
+
const l = i.find((k) => k.app === s.app);
|
|
309
|
+
if (!l) continue;
|
|
310
|
+
l.displayName && (s.appName = l.displayName);
|
|
311
|
+
const f = l.titles.get(`${s.trigger ? "t" : "a"}:${s.action}`);
|
|
301
312
|
f && (s.actionName = f);
|
|
302
313
|
}
|
|
303
314
|
return n;
|
|
304
315
|
}
|
|
305
|
-
|
|
316
|
+
const tt = {
|
|
317
|
+
"@w6w/trigger": "Manual trigger",
|
|
318
|
+
"@w6w/webhook": "Webhook",
|
|
319
|
+
"@w6w/scheduler": "Schedule",
|
|
320
|
+
"@w6w/form": "Form"
|
|
321
|
+
};
|
|
322
|
+
function _t(t) {
|
|
323
|
+
const e = [];
|
|
324
|
+
for (const [o, r] of t) {
|
|
325
|
+
const i = tt[r.app];
|
|
326
|
+
if (!i && !r.trigger) continue;
|
|
327
|
+
const a = i ?? `${r.appName ?? r.app} · ${r.actionName ?? r.action}`;
|
|
328
|
+
e.push({ nodeId: o, label: a, app: r.app });
|
|
329
|
+
}
|
|
330
|
+
const n = /* @__PURE__ */ new Map();
|
|
331
|
+
for (const o of e) n.set(o.label, (n.get(o.label) ?? 0) + 1);
|
|
332
|
+
return e.map(
|
|
333
|
+
(o) => (n.get(o.label) ?? 0) > 1 ? { ...o, label: `${o.label} (${o.nodeId})` } : o
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
function Ot(t, e) {
|
|
337
|
+
if (t.triggerNodeId) {
|
|
338
|
+
const n = e.find((o) => o.nodeId === t.triggerNodeId);
|
|
339
|
+
if (n) return n.label;
|
|
340
|
+
}
|
|
341
|
+
return t.trigger ? t.trigger === "manual" ? "Manual run" : t.trigger.charAt(0).toUpperCase() + t.trigger.slice(1) : null;
|
|
342
|
+
}
|
|
343
|
+
async function Mt(t, e) {
|
|
306
344
|
if (e.kind === "workflow") {
|
|
307
345
|
const [r, i] = await Promise.all([
|
|
308
346
|
t.console.workflows.getRun(e.id),
|
|
309
|
-
|
|
347
|
+
X(t, e.callableId)
|
|
310
348
|
]), a = r;
|
|
311
349
|
return {
|
|
312
350
|
id: e.id,
|
|
@@ -320,7 +358,7 @@ async function Tt(t, e) {
|
|
|
320
358
|
output: r.output,
|
|
321
359
|
error: r.error,
|
|
322
360
|
rerunOf: e.rerunOf ?? null,
|
|
323
|
-
steps:
|
|
361
|
+
steps: U(K(r)).map((c) => {
|
|
324
362
|
const u = i.get(c.id);
|
|
325
363
|
return u ? { ...c, node: u } : c;
|
|
326
364
|
})
|
|
@@ -344,14 +382,14 @@ async function Tt(t, e) {
|
|
|
344
382
|
rerunOf: e.rerunOf ?? null
|
|
345
383
|
};
|
|
346
384
|
}
|
|
347
|
-
function
|
|
385
|
+
function et(t) {
|
|
348
386
|
const e = t == null ? void 0 : t.raw, n = e == null ? void 0 : e.invocationId;
|
|
349
387
|
return typeof n == "string" ? n : void 0;
|
|
350
388
|
}
|
|
351
|
-
function
|
|
389
|
+
function nt(t) {
|
|
352
390
|
return t !== null && typeof t == "object" && !Array.isArray(t) ? t : {};
|
|
353
391
|
}
|
|
354
|
-
async function
|
|
392
|
+
async function ot(t, e, n) {
|
|
355
393
|
const o = encodeURIComponent(e.callableId);
|
|
356
394
|
if (e.kind === "workflow") {
|
|
357
395
|
const u = (await t.request({
|
|
@@ -364,7 +402,7 @@ async function tt(t, e, n) {
|
|
|
364
402
|
const r = await t.request({
|
|
365
403
|
method: "GET",
|
|
366
404
|
path: `/invocations/${encodeURIComponent(e.id)}`
|
|
367
|
-
}), i =
|
|
405
|
+
}), i = nt(r.body.invocation.input), a = e.kind === "function" ? { inputs: i, allowUnpublished: !0, rerunOf: e.id } : { input: i, allowUnpublished: !0, rerunOf: e.id };
|
|
368
406
|
try {
|
|
369
407
|
const u = (await t.request({
|
|
370
408
|
method: "POST",
|
|
@@ -374,56 +412,56 @@ async function tt(t, e, n) {
|
|
|
374
412
|
if (typeof u != "string") throw new Error("The server did not return an invocation id.");
|
|
375
413
|
return u;
|
|
376
414
|
} catch (c) {
|
|
377
|
-
const u =
|
|
415
|
+
const u = et(c);
|
|
378
416
|
if (u === void 0) throw c;
|
|
379
417
|
return u;
|
|
380
418
|
}
|
|
381
419
|
}
|
|
382
|
-
async function
|
|
383
|
-
const o = await
|
|
384
|
-
return
|
|
420
|
+
async function Ct(t, e, n = {}) {
|
|
421
|
+
const o = await ot(t, e, n.sleep);
|
|
422
|
+
return rt(t, e.callableId, o);
|
|
385
423
|
}
|
|
386
|
-
async function
|
|
387
|
-
return (await
|
|
424
|
+
async function rt(t, e, n) {
|
|
425
|
+
return (await Z(
|
|
388
426
|
t,
|
|
389
427
|
{ callable: e },
|
|
390
|
-
{ ...
|
|
428
|
+
{ ...Y, q: n },
|
|
391
429
|
1
|
|
392
430
|
)).executions.find((r) => r.id === n) ?? null;
|
|
393
431
|
}
|
|
394
|
-
const
|
|
395
|
-
function
|
|
432
|
+
const st = (t) => ["workflows", t];
|
|
433
|
+
function it(t, e) {
|
|
396
434
|
return t.workflows.list({ project: e });
|
|
397
435
|
}
|
|
398
|
-
function
|
|
399
|
-
const n =
|
|
400
|
-
return
|
|
401
|
-
queryKey:
|
|
402
|
-
queryFn: () =>
|
|
436
|
+
function Kt(t, e = !0) {
|
|
437
|
+
const n = d();
|
|
438
|
+
return y({
|
|
439
|
+
queryKey: st(t),
|
|
440
|
+
queryFn: () => it(n, t),
|
|
403
441
|
enabled: e
|
|
404
442
|
});
|
|
405
443
|
}
|
|
406
|
-
const
|
|
407
|
-
function
|
|
444
|
+
const at = (t) => ["workflow", t];
|
|
445
|
+
function ut(t, e) {
|
|
408
446
|
return t.workflows.get(e);
|
|
409
447
|
}
|
|
410
|
-
function
|
|
411
|
-
const n =
|
|
412
|
-
return
|
|
413
|
-
queryKey:
|
|
414
|
-
queryFn: () =>
|
|
448
|
+
function $t(t, e = !0) {
|
|
449
|
+
const n = d();
|
|
450
|
+
return y({
|
|
451
|
+
queryKey: at(t),
|
|
452
|
+
queryFn: () => ut(n, t),
|
|
415
453
|
enabled: e
|
|
416
454
|
});
|
|
417
455
|
}
|
|
418
|
-
function
|
|
419
|
-
const e =
|
|
456
|
+
function Pt(t) {
|
|
457
|
+
const e = d(), n = g();
|
|
420
458
|
return w({
|
|
421
459
|
mutationFn: (o) => t ? e.console.workflows.upsert(o, { project: t }) : Promise.reject(new Error("No project selected yet.")),
|
|
422
460
|
onSuccess: () => n.invalidateQueries({ queryKey: ["workflows"] })
|
|
423
461
|
});
|
|
424
462
|
}
|
|
425
|
-
function
|
|
426
|
-
const e =
|
|
463
|
+
function Ut(t) {
|
|
464
|
+
const e = d(), n = g();
|
|
427
465
|
return w({
|
|
428
466
|
mutationFn: (o) => t ? e.console.workflows.upsert(o.definition, {
|
|
429
467
|
project: t,
|
|
@@ -432,46 +470,46 @@ function Ct(t) {
|
|
|
432
470
|
onSuccess: () => n.invalidateQueries({ queryKey: ["workflows"] })
|
|
433
471
|
});
|
|
434
472
|
}
|
|
435
|
-
function
|
|
436
|
-
const t =
|
|
473
|
+
function Wt() {
|
|
474
|
+
const t = d(), e = g();
|
|
437
475
|
return w({
|
|
438
476
|
mutationFn: (n) => t.workflows.archive(n),
|
|
439
477
|
onSuccess: () => e.invalidateQueries({ queryKey: ["workflows"] })
|
|
440
478
|
});
|
|
441
479
|
}
|
|
442
|
-
function
|
|
443
|
-
const t =
|
|
480
|
+
function Qt() {
|
|
481
|
+
const t = d(), e = g();
|
|
444
482
|
return w({
|
|
445
483
|
mutationFn: (n) => t.workflows.delete(n),
|
|
446
484
|
onSuccess: () => e.invalidateQueries({ queryKey: ["workflows"] })
|
|
447
485
|
});
|
|
448
486
|
}
|
|
449
487
|
const S = (t) => ["runs", t];
|
|
450
|
-
function
|
|
451
|
-
const e =
|
|
452
|
-
return
|
|
488
|
+
function Lt(t) {
|
|
489
|
+
const e = d();
|
|
490
|
+
return y({
|
|
453
491
|
queryKey: S(t),
|
|
454
492
|
queryFn: () => e.console.workflows.listRuns(t)
|
|
455
493
|
});
|
|
456
494
|
}
|
|
457
|
-
function
|
|
495
|
+
function ct(t, e, n, o) {
|
|
458
496
|
return t.workflows.run(e, { variables: n, input: o, allowUnpublished: !0 }).then((r) => F(() => t.console.workflows.getRun(r.runId)));
|
|
459
497
|
}
|
|
460
|
-
function
|
|
461
|
-
const t =
|
|
498
|
+
function Dt() {
|
|
499
|
+
const t = d(), e = g();
|
|
462
500
|
return w({
|
|
463
|
-
mutationFn: (n) =>
|
|
501
|
+
mutationFn: (n) => ct(t, n.id, n.variables, n.input),
|
|
464
502
|
onSuccess: (n, o) => e.invalidateQueries({ queryKey: S(o.id) }),
|
|
465
503
|
onSettled: () => e.invalidateQueries({ queryKey: E.root })
|
|
466
504
|
});
|
|
467
505
|
}
|
|
468
|
-
function
|
|
506
|
+
function jt(t, e, n, o, r) {
|
|
469
507
|
return t.workflows.run(e, { variables: n, input: o, entry: r, wait: !0 });
|
|
470
508
|
}
|
|
471
|
-
function
|
|
509
|
+
function lt(t, e, n, o) {
|
|
472
510
|
return t.workflows.run(e, { variables: n, input: o, allowUnpublished: !0 }).then((r) => ({ runId: r.runId }));
|
|
473
511
|
}
|
|
474
|
-
async function
|
|
512
|
+
async function dt(t, e, n, o) {
|
|
475
513
|
return { runId: (await t.request({
|
|
476
514
|
method: "POST",
|
|
477
515
|
path: h`/workflows/${e}/nodes/${n}/run`,
|
|
@@ -483,19 +521,19 @@ async function ut(t, e, n, o) {
|
|
|
483
521
|
}
|
|
484
522
|
})).body.runId };
|
|
485
523
|
}
|
|
486
|
-
function
|
|
524
|
+
function xt(t, e) {
|
|
487
525
|
return t.request({
|
|
488
526
|
method: "GET",
|
|
489
527
|
path: h`/workflows/${e}/node-samples`
|
|
490
528
|
}).then((n) => n.body.nodeSamples ?? []);
|
|
491
529
|
}
|
|
492
|
-
function
|
|
530
|
+
function Gt(t, e) {
|
|
493
531
|
return t.request({
|
|
494
532
|
method: "GET",
|
|
495
533
|
path: h`/workflows/${e}/test-inputs`
|
|
496
534
|
}).then((n) => n.body.testInputs ?? []);
|
|
497
535
|
}
|
|
498
|
-
function
|
|
536
|
+
function Ht(t, e, n, o) {
|
|
499
537
|
return t.request({
|
|
500
538
|
method: "PUT",
|
|
501
539
|
path: h`/workflows/${e}/nodes/${n}/test-input`,
|
|
@@ -503,124 +541,127 @@ function Dt(t, e, n, o) {
|
|
|
503
541
|
}).then(() => {
|
|
504
542
|
});
|
|
505
543
|
}
|
|
506
|
-
function
|
|
507
|
-
const t =
|
|
544
|
+
function Yt() {
|
|
545
|
+
const t = d(), e = g();
|
|
508
546
|
return w({
|
|
509
|
-
mutationFn: (n) =>
|
|
547
|
+
mutationFn: (n) => dt(t, n.id, n.nodeId, n.body),
|
|
510
548
|
onSuccess: (n, o) => e.invalidateQueries({ queryKey: S(o.id) }),
|
|
511
549
|
onSettled: () => e.invalidateQueries({ queryKey: E.root })
|
|
512
550
|
});
|
|
513
551
|
}
|
|
514
|
-
function
|
|
515
|
-
const t =
|
|
552
|
+
function Bt() {
|
|
553
|
+
const t = d(), e = g();
|
|
516
554
|
return w({
|
|
517
|
-
mutationFn: (n) =>
|
|
555
|
+
mutationFn: (n) => lt(t, n.id, n.variables, n.input),
|
|
518
556
|
onSuccess: (n, o) => e.invalidateQueries({ queryKey: S(o.id) }),
|
|
519
557
|
onSettled: () => e.invalidateQueries({ queryKey: E.root })
|
|
520
558
|
});
|
|
521
559
|
}
|
|
522
|
-
function
|
|
560
|
+
function ft(t, e) {
|
|
523
561
|
return t.workflows.cancel(e);
|
|
524
562
|
}
|
|
525
|
-
function
|
|
526
|
-
const t =
|
|
563
|
+
function Jt() {
|
|
564
|
+
const t = d();
|
|
527
565
|
return w({
|
|
528
|
-
mutationFn: (e) =>
|
|
566
|
+
mutationFn: (e) => ft(t, e)
|
|
529
567
|
});
|
|
530
568
|
}
|
|
531
|
-
function
|
|
569
|
+
function pt(t, e) {
|
|
532
570
|
return t.console.workflows.getRun(e);
|
|
533
571
|
}
|
|
534
|
-
const
|
|
535
|
-
function
|
|
536
|
-
const e =
|
|
537
|
-
return
|
|
538
|
-
queryKey:
|
|
539
|
-
queryFn: () =>
|
|
572
|
+
const wt = (t) => ["run", t];
|
|
573
|
+
function Vt(t) {
|
|
574
|
+
const e = d();
|
|
575
|
+
return y({
|
|
576
|
+
queryKey: wt(t ?? ""),
|
|
577
|
+
queryFn: () => pt(e, t),
|
|
540
578
|
enabled: t != null,
|
|
541
579
|
refetchInterval: (n) => {
|
|
542
580
|
var o;
|
|
543
|
-
return
|
|
581
|
+
return T((o = n.state.data) == null ? void 0 : o.status) ? 500 : !1;
|
|
544
582
|
}
|
|
545
583
|
});
|
|
546
584
|
}
|
|
547
|
-
function
|
|
585
|
+
function gt(t, e) {
|
|
548
586
|
return t.request({
|
|
549
587
|
method: "GET",
|
|
550
588
|
path: h`/runs/${e}/state-writes`
|
|
551
589
|
}).then((n) => ({ writes: n.body.writes ?? [], truncated: n.body.truncated === !0 }));
|
|
552
590
|
}
|
|
553
|
-
function
|
|
554
|
-
return ["run", t, "state-writes",
|
|
591
|
+
function yt(t, e) {
|
|
592
|
+
return ["run", t, "state-writes", T(e) ? "live" : "final"];
|
|
555
593
|
}
|
|
556
|
-
function
|
|
557
|
-
const n =
|
|
558
|
-
return
|
|
559
|
-
queryKey:
|
|
560
|
-
queryFn: () =>
|
|
594
|
+
function zt(t, e) {
|
|
595
|
+
const n = d(), o = T(e);
|
|
596
|
+
return y({
|
|
597
|
+
queryKey: yt(t ?? "", e),
|
|
598
|
+
queryFn: () => gt(n, t),
|
|
561
599
|
enabled: t != null,
|
|
562
600
|
refetchInterval: o ? 500 : !1,
|
|
563
601
|
retry: !1
|
|
564
602
|
});
|
|
565
603
|
}
|
|
566
604
|
export {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
605
|
+
Lt as $,
|
|
606
|
+
Tt as A,
|
|
607
|
+
vt as B,
|
|
608
|
+
Rt as C,
|
|
609
|
+
K as D,
|
|
610
|
+
Y as E,
|
|
611
|
+
wt as F,
|
|
612
|
+
yt as G,
|
|
613
|
+
O as H,
|
|
614
|
+
ct as I,
|
|
615
|
+
jt as J,
|
|
616
|
+
S as K,
|
|
617
|
+
Ht as L,
|
|
618
|
+
T as M,
|
|
619
|
+
dt as N,
|
|
620
|
+
lt as O,
|
|
621
|
+
qt as P,
|
|
622
|
+
v as Q,
|
|
623
|
+
$ as R,
|
|
624
|
+
q as S,
|
|
625
|
+
Wt as T,
|
|
626
|
+
Jt as U,
|
|
627
|
+
Pt as V,
|
|
628
|
+
Qt as W,
|
|
629
|
+
Vt as X,
|
|
630
|
+
Yt as Y,
|
|
631
|
+
zt as Z,
|
|
632
|
+
Dt as _,
|
|
633
|
+
bt as a,
|
|
634
|
+
Ut as a0,
|
|
635
|
+
Bt as a1,
|
|
636
|
+
$t as a2,
|
|
637
|
+
Kt as a3,
|
|
638
|
+
at as a4,
|
|
639
|
+
_t as a5,
|
|
640
|
+
st as a6,
|
|
641
|
+
It as b,
|
|
642
|
+
ft as c,
|
|
643
|
+
X as d,
|
|
644
|
+
Nt as e,
|
|
645
|
+
At as f,
|
|
646
|
+
rt as g,
|
|
647
|
+
Mt as h,
|
|
648
|
+
Z as i,
|
|
649
|
+
Ft as j,
|
|
650
|
+
pt as k,
|
|
651
|
+
gt as l,
|
|
652
|
+
ut as m,
|
|
653
|
+
Et as n,
|
|
613
654
|
E as o,
|
|
614
|
-
|
|
655
|
+
M as p,
|
|
615
656
|
P as q,
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
657
|
+
Ot as r,
|
|
658
|
+
x as s,
|
|
659
|
+
B as t,
|
|
660
|
+
xt as u,
|
|
661
|
+
Gt as v,
|
|
662
|
+
it as w,
|
|
663
|
+
U as x,
|
|
664
|
+
F as y,
|
|
665
|
+
Ct as z
|
|
625
666
|
};
|
|
626
|
-
//# sourceMappingURL=workflows-
|
|
667
|
+
//# sourceMappingURL=workflows-RhR8kwt7.js.map
|