@w6w/embed 0.2.33 → 0.2.35
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/{CreateFunctionModal-glk2zg1r.js → CreateFunctionModal-CYNHJUGJ.js} +3 -3
- package/dist/{CreateFunctionModal-glk2zg1r.js.map → CreateFunctionModal-CYNHJUGJ.js.map} +1 -1
- package/dist/{DocumentFormModal-Cw85R4wk.js → DocumentFormModal-CLmdGx34.js} +2 -2
- package/dist/{DocumentFormModal-Cw85R4wk.js.map → DocumentFormModal-CLmdGx34.js.map} +1 -1
- package/dist/ImportSpecModal-BzEyiNWD.js +378 -0
- package/dist/ImportSpecModal-BzEyiNWD.js.map +1 -0
- package/dist/WorkflowEditor-CxTuK8_d.js +1272 -0
- package/dist/WorkflowEditor-CxTuK8_d.js.map +1 -0
- package/dist/apps-CyEszfIu.js +106 -0
- package/dist/apps-CyEszfIu.js.map +1 -0
- package/dist/callable-row-actions-BPBPflMn.js +56 -0
- package/dist/callable-row-actions-BPBPflMn.js.map +1 -0
- package/dist/callables-dLF2IcwA.js +317 -0
- package/dist/callables-dLF2IcwA.js.map +1 -0
- package/dist/chrome/HistoryView.d.ts +3 -0
- package/dist/chrome/TagEditor.d.ts +6 -1
- package/dist/chrome/workspace.d.ts +16 -0
- package/dist/documents-hgltn0xe.js +1017 -0
- package/dist/documents-hgltn0xe.js.map +1 -0
- package/dist/draft.mjs +1 -1
- package/dist/editor/WaitingForm.d.ts +19 -0
- package/dist/editor-apps-DsGrGKfe.js +178 -0
- package/dist/editor-apps-DsGrGKfe.js.map +1 -0
- package/dist/{editor-tools-Dn7TgCP4.js → editor-tools-Ct7YPPj8.js} +681 -783
- package/dist/editor-tools-Ct7YPPj8.js.map +1 -0
- package/dist/editor.mjs +1 -1
- package/dist/editors.mjs +18 -18
- package/dist/{endpoints-zOuwci2U.js → endpoints-DJxXRh-I.js} +12 -12
- package/dist/{endpoints-zOuwci2U.js.map → endpoints-DJxXRh-I.js.map} +1 -1
- package/dist/forms.mjs +1 -1
- package/dist/index.mjs +140 -115
- package/dist/index.mjs.map +1 -1
- package/dist/lib/callable-row-actions.d.ts +17 -0
- package/dist/lib/history-query.d.ts +22 -1
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/run-event-stream.d.ts +122 -0
- package/dist/lib/run-log-nodes.d.ts +43 -0
- package/dist/lib/tag-editor.d.ts +6 -0
- package/dist/lib/workflow-live-run.d.ts +7 -0
- package/dist/lib/workflow-validity.d.ts +7 -1
- package/dist/lib.mjs +52 -47
- package/dist/lists/CallableKindList.d.ts +12 -0
- package/dist/lists/CallableRowParts.d.ts +8 -1
- package/dist/lists/EndpointList.d.ts +3 -0
- package/dist/lists/FunctionList.d.ts +3 -0
- package/dist/lists/WorkflowList.d.ts +3 -0
- package/dist/lists.d.ts +1 -0
- package/dist/lists.mjs +1589 -1513
- package/dist/lists.mjs.map +1 -1
- package/dist/rail.mjs +1 -1
- package/dist/repos/callables.d.ts +25 -0
- package/dist/repos/documents.d.ts +9 -1
- package/dist/repos/history.d.ts +5 -1
- package/dist/repos/saved-file-names.d.ts +10 -0
- package/dist/repos/workflows.d.ts +19 -13
- package/dist/repos.mjs +338 -329
- package/dist/{setup-incomplete-BHs3Lpfy.js → setup-incomplete-6PAbN0EW.js} +50 -49
- package/dist/setup-incomplete-6PAbN0EW.js.map +1 -0
- package/dist/spec-import-BKyfhTYG.js +200 -0
- package/dist/spec-import-BKyfhTYG.js.map +1 -0
- package/dist/{use-callable-draft-w4tDTYcb.js → use-callable-draft-7HwfTuYQ.js} +3 -3
- package/dist/{use-callable-draft-w4tDTYcb.js.map → use-callable-draft-7HwfTuYQ.js.map} +1 -1
- package/package.json +3 -3
- package/src/styles.css +43 -0
- package/dist/ImportSpecModal-fU5RsVTa.js +0 -252
- package/dist/ImportSpecModal-fU5RsVTa.js.map +0 -1
- 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/callable-record-Bhxim8C1.js +0 -14
- package/dist/callable-record-Bhxim8C1.js.map +0 -1
- package/dist/callables-B49tS2vv.js +0 -297
- package/dist/callables-B49tS2vv.js.map +0 -1
- package/dist/editor-apps-HEOclsxL.js +0 -152
- package/dist/editor-apps-HEOclsxL.js.map +0 -1
- package/dist/editor-tools-Dn7TgCP4.js.map +0 -1
- package/dist/setup-incomplete-BHs3Lpfy.js.map +0 -1
- package/dist/spec-import-CGPqUUjN.js +0 -272
- package/dist/spec-import-CGPqUUjN.js.map +0 -1
- package/dist/workflows-Dz8LMjnt.js +0 -626
- package/dist/workflows-Dz8LMjnt.js.map +0 -1
|
@@ -1,273 +1,272 @@
|
|
|
1
|
-
import { jsx as n, jsxs as r, Fragment as
|
|
2
|
-
import { r as Cn, l as
|
|
3
|
-
import { useContext as
|
|
4
|
-
import { ExpressionOptionsProvider as
|
|
5
|
-
import { d as
|
|
6
|
-
import { u as
|
|
7
|
-
import { i as Bn, f as
|
|
8
|
-
import {
|
|
9
|
-
import { s as
|
|
10
|
-
import { u as
|
|
11
|
-
import { WorkflowConnectionsPanel as
|
|
12
|
-
import { ApiError as
|
|
13
|
-
import { c as
|
|
14
|
-
import { i as
|
|
15
|
-
import { s as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function Fi({
|
|
1
|
+
import { jsx as n, jsxs as r, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { r as Cn, l as Qe, m as We, d as Me, e as En, h as Re, c as An } from "./import-bindings-EUtxZ9Ti.js";
|
|
3
|
+
import { useContext as ge, useState as f, useMemo as $e, useEffect as ve, createContext as He, useRef as Fe } from "react";
|
|
4
|
+
import { ExpressionOptionsProvider as qe, Icon as J, RetryPolicyFields as Pn, StepBuilderModal as In, CodeBlock as pe, DeleteButton as Dn, EditButton as Tn, IconButton as Be, ConfirmModal as je, JsonEditor as On, useExpressionOptions as Mn, ExpressionInput as Rn, ResultViewer as jn } from "@w6w/ui";
|
|
5
|
+
import { d as Ln, p as Vn, i as Qn, t as Wn, e as Le, a as $n, h as Hn, s as Fn } from "./document-sources-Khcw2zB5.js";
|
|
6
|
+
import { u as qn, a as Je } from "./spec-export-BtnoV0ex.js";
|
|
7
|
+
import { i as Bn, f as Jn, e as Kn, b as Un, u as zn } from "./vault-BSEWhMYC.js";
|
|
8
|
+
import { a3 as _n, ad as Ke, ac as Gn, a9 as Yn, Z as Zn, a1 as Xn, ag as xn, a8 as et, a4 as nt, a6 as tt, U as it, Q as st } from "./documents-hgltn0xe.js";
|
|
9
|
+
import { s as at, M as B, c as rt, C as ot } from "./ConfirmModal-WqBfWftD.js";
|
|
10
|
+
import { u as lt } from "./slug-BVdgiP_L.js";
|
|
11
|
+
import { WorkflowConnectionsPanel as dt } from "@w6w/ui/flow";
|
|
12
|
+
import { ApiError as M } from "@w6w/sdk";
|
|
13
|
+
import { c as Ue } from "./callable-row-actions-BPBPflMn.js";
|
|
14
|
+
import { i as ct, d as ut, p as ht } from "./settings-rail-gUU2ZbSw.js";
|
|
15
|
+
import { s as ze, r as _e, v as Ge, t as Ye, b as Ze, d as ft, g as mt, u as pt, q as gt, p as vt, o as bt, n as kt } from "./endpoints-DJxXRh-I.js";
|
|
16
|
+
import { C as Xe, I as xe } from "./ImportSpecModal-BzEyiNWD.js";
|
|
17
|
+
import { h as wt, e as yt, c as Nt, i as en, d as nn, f as tn } from "./spec-import-BKyfhTYG.js";
|
|
18
|
+
import { useQueryClient as St } from "@tanstack/react-query";
|
|
19
|
+
import { foldStateLog as Ct } from "@w6w/expr";
|
|
20
|
+
const be = He(null);
|
|
21
|
+
function Mi({
|
|
23
22
|
children: e,
|
|
24
|
-
base:
|
|
23
|
+
base: i = null
|
|
25
24
|
}) {
|
|
26
|
-
const [
|
|
27
|
-
return /* @__PURE__ */ n(
|
|
25
|
+
const [s, t] = f(null), a = s ?? i, l = $e(() => ({ resource: a, setCallable: t }), [a]);
|
|
26
|
+
return /* @__PURE__ */ n(be.Provider, { value: l, children: e });
|
|
28
27
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
28
|
+
function Ri() {
|
|
29
|
+
return ge(be) !== null;
|
|
31
30
|
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
35
|
-
const { setCallable:
|
|
36
|
-
|
|
31
|
+
function ji(e) {
|
|
32
|
+
const i = ge(be);
|
|
33
|
+
if (!i) throw new Error("useWorkspace must be used within <WorkspaceProvider>");
|
|
34
|
+
const { setCallable: s } = i, t = e ? JSON.stringify(e) : "";
|
|
35
|
+
ve(() => (s(e), () => s(null)), [t, s]);
|
|
37
36
|
}
|
|
38
|
-
function
|
|
39
|
-
const e =
|
|
37
|
+
function Et() {
|
|
38
|
+
const e = ge(be);
|
|
40
39
|
if (!e) throw new Error("useWorkspaceCallable must be used within <WorkspaceProvider>");
|
|
41
40
|
return e.resource;
|
|
42
41
|
}
|
|
43
|
-
const
|
|
44
|
-
function
|
|
45
|
-
if (typeof localStorage > "u") return
|
|
46
|
-
const
|
|
47
|
-
return { open: !1, activeTool:
|
|
42
|
+
const sn = { open: !1, activeTool: null };
|
|
43
|
+
function At(e) {
|
|
44
|
+
if (typeof localStorage > "u") return sn;
|
|
45
|
+
const i = localStorage.getItem(e), { activeTool: s } = Cn(i);
|
|
46
|
+
return { open: !1, activeTool: s };
|
|
48
47
|
}
|
|
49
|
-
function
|
|
48
|
+
function an({
|
|
50
49
|
tools: e,
|
|
51
|
-
ctx:
|
|
52
|
-
state:
|
|
53
|
-
onToggle:
|
|
50
|
+
ctx: i,
|
|
51
|
+
state: s,
|
|
52
|
+
onToggle: t
|
|
54
53
|
}) {
|
|
55
|
-
const a =
|
|
54
|
+
const a = s.open ? e.find((o) => o.id === s.activeTool && o.Panel) ?? null : null, l = a == null ? void 0 : a.Panel;
|
|
56
55
|
return /* @__PURE__ */ r("aside", { className: "right-rail", children: [
|
|
57
|
-
/* @__PURE__ */ n("div", { className: "right-rail-strip", children: e.map((
|
|
58
|
-
var
|
|
56
|
+
/* @__PURE__ */ n("div", { className: "right-rail-strip", children: e.map((o) => {
|
|
57
|
+
var c;
|
|
59
58
|
return /* @__PURE__ */ r(
|
|
60
59
|
"button",
|
|
61
60
|
{
|
|
62
61
|
type: "button",
|
|
63
|
-
"data-testid": `rail-tool-${
|
|
64
|
-
className: `right-rail-tool-btn${(a == null ? void 0 : a.id) ===
|
|
65
|
-
title:
|
|
66
|
-
"aria-label":
|
|
67
|
-
"aria-pressed":
|
|
68
|
-
onClick: () =>
|
|
62
|
+
"data-testid": `rail-tool-${o.id}`,
|
|
63
|
+
className: `right-rail-tool-btn${(a == null ? void 0 : a.id) === o.id ? " active" : ""}`,
|
|
64
|
+
title: o.title,
|
|
65
|
+
"aria-label": o.title,
|
|
66
|
+
"aria-pressed": o.onActivate ? void 0 : (a == null ? void 0 : a.id) === o.id,
|
|
67
|
+
onClick: () => o.onActivate ? o.onActivate(i) : t(o.id),
|
|
69
68
|
children: [
|
|
70
|
-
/* @__PURE__ */ n(
|
|
71
|
-
((
|
|
69
|
+
/* @__PURE__ */ n(o.Icon, {}),
|
|
70
|
+
((c = o.hasIndicator) == null ? void 0 : c.call(o, i)) && /* @__PURE__ */ n(
|
|
72
71
|
"span",
|
|
73
72
|
{
|
|
74
73
|
className: "right-rail-tool-dot",
|
|
75
|
-
"data-testid": `rail-tool-${
|
|
74
|
+
"data-testid": `rail-tool-${o.id}-dot`,
|
|
76
75
|
"aria-hidden": "true"
|
|
77
76
|
}
|
|
78
77
|
)
|
|
79
78
|
]
|
|
80
79
|
},
|
|
81
|
-
|
|
80
|
+
o.id
|
|
82
81
|
);
|
|
83
82
|
}) }),
|
|
84
|
-
a &&
|
|
83
|
+
a && l && /* @__PURE__ */ r("div", { className: "right-rail-panel", "data-testid": `rail-panel-${a.id}`, children: [
|
|
85
84
|
!a.rendersHeading && /* @__PURE__ */ n("div", { className: "right-rail-panel-head", children: /* @__PURE__ */ n("h3", { children: a.title }) }),
|
|
86
|
-
/* @__PURE__ */ n(
|
|
85
|
+
/* @__PURE__ */ n(l, { ctx: i })
|
|
87
86
|
] })
|
|
88
87
|
] });
|
|
89
88
|
}
|
|
90
|
-
function
|
|
89
|
+
function Pt({
|
|
91
90
|
storageKey: e,
|
|
92
|
-
tools:
|
|
93
|
-
ctx:
|
|
91
|
+
tools: i,
|
|
92
|
+
ctx: s
|
|
94
93
|
}) {
|
|
95
|
-
const [
|
|
96
|
-
|
|
97
|
-
typeof localStorage > "u" || localStorage.setItem(e, JSON.stringify({ activeTool:
|
|
98
|
-
}, [e,
|
|
99
|
-
function o
|
|
94
|
+
const [t, a] = f(() => At(e));
|
|
95
|
+
ve(() => {
|
|
96
|
+
typeof localStorage > "u" || localStorage.setItem(e, JSON.stringify({ activeTool: t.activeTool }));
|
|
97
|
+
}, [e, t.activeTool]);
|
|
98
|
+
function l(o) {
|
|
100
99
|
a(
|
|
101
|
-
(
|
|
100
|
+
(c) => c.open && c.activeTool === o ? { open: !1, activeTool: o } : { open: !0, activeTool: o }
|
|
102
101
|
);
|
|
103
102
|
}
|
|
104
|
-
return /* @__PURE__ */ n(
|
|
103
|
+
return /* @__PURE__ */ n(an, { tools: i, ctx: s, state: t, onToggle: l });
|
|
105
104
|
}
|
|
106
|
-
function
|
|
105
|
+
function Li({
|
|
107
106
|
tools: e,
|
|
108
|
-
storageKey:
|
|
107
|
+
storageKey: i
|
|
109
108
|
}) {
|
|
110
|
-
const
|
|
111
|
-
return
|
|
112
|
-
} }) : /* @__PURE__ */ n(
|
|
109
|
+
const s = Et(), t = e.filter((a) => a.isAvailable(s));
|
|
110
|
+
return t.length === 0 ? null : i === null ? /* @__PURE__ */ n(an, { tools: t, ctx: s, state: sn, onToggle: () => {
|
|
111
|
+
} }) : /* @__PURE__ */ n(Pt, { storageKey: i, tools: t, ctx: s }, i);
|
|
113
112
|
}
|
|
114
|
-
function
|
|
115
|
-
const
|
|
116
|
-
return
|
|
113
|
+
function It(e) {
|
|
114
|
+
const i = e, s = Bn(i ?? void 0, i != null), t = Jn(), a = qn(), l = _n(i ?? void 0, i != null), o = Kn(), c = Un(), h = zn();
|
|
115
|
+
return $e(
|
|
117
116
|
() => ({
|
|
118
|
-
vars: (
|
|
119
|
-
constants: (a.data ?? []).map((
|
|
120
|
-
secrets: (
|
|
117
|
+
vars: (s.data ?? []).map((d) => d.name),
|
|
118
|
+
constants: (a.data ?? []).map((d) => d.name),
|
|
119
|
+
secrets: (t.data ?? []).map((d) => d.name),
|
|
121
120
|
// `document-sources.ts` owns the `format === "json"` gate and the raw
|
|
122
121
|
// field enumeration — no parsing, no gate logic, and no filtering here
|
|
123
122
|
// (A5c); `isRefSafeKey` filtering happens once, downstream, at the
|
|
124
123
|
// modal's render site.
|
|
125
|
-
documents:
|
|
124
|
+
documents: Vn(l.data ?? []),
|
|
126
125
|
// Real project values so the ƒx Result preview substitutes them for
|
|
127
126
|
// `var.<name>` / `const.<name>` / `documents.<key>` / `documents.<key>.<field>` refs
|
|
128
127
|
// instead of the raw template.
|
|
129
128
|
sampleValues: {
|
|
130
|
-
...Object.fromEntries((
|
|
131
|
-
...Object.fromEntries((a.data ?? []).map((
|
|
132
|
-
...
|
|
129
|
+
...Object.fromEntries((s.data ?? []).map((d) => [`var.${d.name}`, d.value])),
|
|
130
|
+
...Object.fromEntries((a.data ?? []).map((d) => [`const.${d.name}`, d.value])),
|
|
131
|
+
...Ln(l.data ?? [])
|
|
133
132
|
},
|
|
134
|
-
sealSecret:
|
|
133
|
+
sealSecret: o,
|
|
135
134
|
// A created var carries the SAME project the read above carried (B3) —
|
|
136
135
|
// it must land in the project whose rail asked for it. `type: "string"`
|
|
137
136
|
// is pinned (a string type's `raw` passes through untouched) — the modal
|
|
138
137
|
// has no type field.
|
|
139
|
-
createVar: (
|
|
138
|
+
createVar: (d) => c.mutateAsync({
|
|
140
139
|
input: {
|
|
141
|
-
name:
|
|
140
|
+
name: d.name,
|
|
142
141
|
type: "string",
|
|
143
|
-
value:
|
|
144
|
-
description:
|
|
142
|
+
value: d.value,
|
|
143
|
+
description: d.description
|
|
145
144
|
},
|
|
146
|
-
project:
|
|
145
|
+
project: i ?? void 0
|
|
147
146
|
}).then(() => {
|
|
148
147
|
}),
|
|
149
148
|
// Secrets carry NO project (B4) — `vault_secrets` has no `project`
|
|
150
149
|
// column and the routes read no `?project=`. Plaintext in, the server
|
|
151
150
|
// encrypts; the resolved value is referenced nowhere (B5).
|
|
152
|
-
createSecret: (
|
|
151
|
+
createSecret: (d) => h.mutateAsync({ name: d.name, value: d.value, description: d.description }).then(() => {
|
|
153
152
|
})
|
|
154
153
|
}),
|
|
155
154
|
[
|
|
156
|
-
i.data,
|
|
157
|
-
a.data,
|
|
158
155
|
s.data,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
a.data,
|
|
157
|
+
t.data,
|
|
158
|
+
l.data,
|
|
159
|
+
o,
|
|
160
|
+
c.mutateAsync,
|
|
162
161
|
h.mutateAsync,
|
|
163
|
-
|
|
162
|
+
i
|
|
164
163
|
]
|
|
165
164
|
);
|
|
166
165
|
}
|
|
167
|
-
function
|
|
166
|
+
function Vi({
|
|
168
167
|
project: e,
|
|
169
|
-
children:
|
|
168
|
+
children: i
|
|
170
169
|
}) {
|
|
171
|
-
const
|
|
172
|
-
return /* @__PURE__ */ n(
|
|
170
|
+
const s = It(e);
|
|
171
|
+
return /* @__PURE__ */ n(qe, { value: s, children: i });
|
|
173
172
|
}
|
|
174
|
-
function
|
|
175
|
-
const [
|
|
176
|
-
if (!
|
|
177
|
-
const a = (e == null ? void 0 : e.kind) === "workflow" ? e.triggers : void 0,
|
|
178
|
-
return
|
|
173
|
+
function Dt({ ctx: e }) {
|
|
174
|
+
const [i, s] = f(null), t = Wn(e);
|
|
175
|
+
if (!t) return null;
|
|
176
|
+
const a = (e == null ? void 0 : e.kind) === "workflow" ? e.triggers : void 0, l = at(t);
|
|
177
|
+
return l.length === 0 ? /* @__PURE__ */ n("p", { className: "muted", children: lt(t) }) : /* @__PURE__ */ r("div", { children: [
|
|
179
178
|
/* @__PURE__ */ n("p", { className: "muted small", style: { marginTop: 0 }, children: "Call this from:" }),
|
|
180
|
-
/* @__PURE__ */ n("div", { className: "rail-code-langs", children:
|
|
179
|
+
/* @__PURE__ */ n("div", { className: "rail-code-langs", children: l.map(({ id: o, label: c, icon: h }) => /* @__PURE__ */ r(
|
|
181
180
|
"button",
|
|
182
181
|
{
|
|
183
182
|
type: "button",
|
|
184
183
|
className: "rail-code-lang",
|
|
185
|
-
"data-testid": `rail-code-lang-${
|
|
186
|
-
title: `Show the ${
|
|
187
|
-
"aria-label": `Show the ${
|
|
188
|
-
onClick: () =>
|
|
184
|
+
"data-testid": `rail-code-lang-${o}`,
|
|
185
|
+
title: `Show the ${c} snippet`,
|
|
186
|
+
"aria-label": `Show the ${c} snippet`,
|
|
187
|
+
onClick: () => s(o),
|
|
189
188
|
children: [
|
|
190
|
-
/* @__PURE__ */ n(
|
|
191
|
-
/* @__PURE__ */ n("span", { children:
|
|
189
|
+
/* @__PURE__ */ n(J, { name: h, size: 20 }),
|
|
190
|
+
/* @__PURE__ */ n("span", { children: c })
|
|
192
191
|
]
|
|
193
192
|
},
|
|
194
|
-
|
|
193
|
+
o
|
|
195
194
|
)) }),
|
|
196
|
-
|
|
195
|
+
i !== null && /* @__PURE__ */ n(B, { title: "Call from code", wide: !0, onClose: () => s(null), children: /* @__PURE__ */ n("div", { style: { height: 450 }, children: /* @__PURE__ */ n(rt, { resource: t, triggers: a, initialTab: i }) }) })
|
|
197
196
|
] });
|
|
198
197
|
}
|
|
199
|
-
function
|
|
200
|
-
return /* @__PURE__ */ n(
|
|
198
|
+
function Tt() {
|
|
199
|
+
return /* @__PURE__ */ n(J, { name: "code" });
|
|
201
200
|
}
|
|
202
|
-
const
|
|
201
|
+
const Ot = {
|
|
203
202
|
id: "code",
|
|
204
203
|
title: "Code",
|
|
205
|
-
Icon:
|
|
206
|
-
isAvailable: (e) =>
|
|
207
|
-
Panel:
|
|
208
|
-
},
|
|
204
|
+
Icon: Tt,
|
|
205
|
+
isAvailable: (e) => Qn(e),
|
|
206
|
+
Panel: Dt
|
|
207
|
+
}, Mt = {
|
|
209
208
|
id: "connections",
|
|
210
209
|
title: "Connections",
|
|
211
210
|
rendersHeading: !0,
|
|
212
|
-
Icon: () => /* @__PURE__ */ n(
|
|
211
|
+
Icon: () => /* @__PURE__ */ n(J, { name: "plug" }),
|
|
213
212
|
isAvailable: (e) => (e == null ? void 0 : e.kind) === "workflow" && !!e.connectionResources,
|
|
214
213
|
hasIndicator: (e) => {
|
|
215
|
-
var
|
|
216
|
-
return (e == null ? void 0 : e.kind) === "workflow" && Object.keys(((
|
|
214
|
+
var i;
|
|
215
|
+
return (e == null ? void 0 : e.kind) === "workflow" && Object.keys(((i = e.connectionResources) == null ? void 0 : i.connections) ?? {}).length > 0;
|
|
217
216
|
},
|
|
218
|
-
Panel: ({ ctx: e }) => (e == null ? void 0 : e.kind) === "workflow" && e.connectionResources ? /* @__PURE__ */ n(
|
|
219
|
-
},
|
|
220
|
-
} },
|
|
221
|
-
function
|
|
217
|
+
Panel: ({ ctx: e }) => (e == null ? void 0 : e.kind) === "workflow" && e.connectionResources ? /* @__PURE__ */ n(dt, { resources: e.connectionResources }, e.id) : null
|
|
218
|
+
}, Rt = { project: null, onNavigate: () => {
|
|
219
|
+
} }, rn = He(Rt);
|
|
220
|
+
function Qi({
|
|
222
221
|
project: e,
|
|
223
|
-
onNavigate:
|
|
224
|
-
children:
|
|
222
|
+
onNavigate: i,
|
|
223
|
+
children: s
|
|
225
224
|
}) {
|
|
226
|
-
return /* @__PURE__ */ n(
|
|
225
|
+
return /* @__PURE__ */ n(rn.Provider, { value: { project: e, onNavigate: i }, children: s });
|
|
227
226
|
}
|
|
228
|
-
function
|
|
229
|
-
return
|
|
227
|
+
function on() {
|
|
228
|
+
return ge(rn);
|
|
230
229
|
}
|
|
231
|
-
const
|
|
232
|
-
function
|
|
230
|
+
const jt = "@w6w/call";
|
|
231
|
+
function Ve(e) {
|
|
233
232
|
return e ? e.kind === "workflow" ? e.workflow : e.kind === "function" ? e.function : `${e.uses.app}/${e.uses.action}` : "";
|
|
234
233
|
}
|
|
235
|
-
function
|
|
234
|
+
function Lt(e) {
|
|
236
235
|
return (e == null ? void 0 : e.kind) === "workflow" ? "Workflow (asynchronous)" : (e == null ? void 0 : e.kind) === "function" ? "Function (synchronous)" : "App action (synchronous)";
|
|
237
236
|
}
|
|
238
|
-
function
|
|
237
|
+
function ln({
|
|
239
238
|
kind: e,
|
|
240
|
-
id:
|
|
241
|
-
policy:
|
|
242
|
-
ready:
|
|
239
|
+
id: i,
|
|
240
|
+
policy: s,
|
|
241
|
+
ready: t,
|
|
243
242
|
saving: a,
|
|
244
|
-
onPersist:
|
|
243
|
+
onPersist: l
|
|
245
244
|
}) {
|
|
246
|
-
var
|
|
247
|
-
const
|
|
248
|
-
resource: { kind: e, id:
|
|
249
|
-
target: { kind:
|
|
250
|
-
hasAdapter: ((
|
|
251
|
-
}) : "allow",
|
|
252
|
-
var
|
|
253
|
-
const g = (
|
|
245
|
+
var N, H, K, O;
|
|
246
|
+
const o = Ze(!0), { project: c } = on(), h = Ke(c ?? void 0, !0), [d, b] = f(!1), [w, p] = f(null), P = (N = s.reroute) == null ? void 0 : N.target, y = Ve(P), T = P ? Le({
|
|
247
|
+
resource: { kind: e, id: i },
|
|
248
|
+
target: { kind: P.kind, id: y },
|
|
249
|
+
hasAdapter: ((H = s.reroute) == null ? void 0 : H.with) !== void 0
|
|
250
|
+
}) : "allow", j = (P == null ? void 0 : P.kind) === "workflow" ? ((O = (K = h.data) == null ? void 0 : K.find((g) => g.id === y)) == null ? void 0 : O.displayName) ?? void 0 : (() => {
|
|
251
|
+
var S;
|
|
252
|
+
const g = (S = o.data) == null ? void 0 : S.find((F) => F.id === y);
|
|
254
253
|
return g ? g.displayName || g.key : void 0;
|
|
255
254
|
})();
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}, [
|
|
259
|
-
function
|
|
260
|
-
|
|
255
|
+
ve(() => {
|
|
256
|
+
i && e && p(null);
|
|
257
|
+
}, [i, e]);
|
|
258
|
+
function D(g) {
|
|
259
|
+
p(null), l(g, p);
|
|
261
260
|
}
|
|
262
|
-
function
|
|
261
|
+
function L(g) {
|
|
263
262
|
var U;
|
|
264
|
-
let
|
|
265
|
-
if (g.uses.app ===
|
|
266
|
-
const
|
|
267
|
-
if (
|
|
268
|
-
|
|
263
|
+
let S;
|
|
264
|
+
if (g.uses.app === jt) {
|
|
265
|
+
const V = g.with ?? {}, Q = typeof V.targetId == "string" ? V.targetId : "";
|
|
266
|
+
if (!Q) return;
|
|
267
|
+
S = V.targetKind === "workflow" ? { kind: "workflow", workflow: Q } : { kind: "function", function: Q };
|
|
269
268
|
} else if (!g.uses.app.startsWith("@w6w/"))
|
|
270
|
-
|
|
269
|
+
S = {
|
|
271
270
|
kind: "action",
|
|
272
271
|
uses: {
|
|
273
272
|
app: g.uses.app,
|
|
@@ -278,30 +277,30 @@ function on({
|
|
|
278
277
|
};
|
|
279
278
|
else
|
|
280
279
|
return;
|
|
281
|
-
if (
|
|
282
|
-
resource: { kind: e, id:
|
|
283
|
-
target: { kind:
|
|
284
|
-
hasAdapter: ((U =
|
|
280
|
+
if (Le({
|
|
281
|
+
resource: { kind: e, id: i },
|
|
282
|
+
target: { kind: S.kind, id: Ve(S) },
|
|
283
|
+
hasAdapter: ((U = s.reroute) == null ? void 0 : U.with) !== void 0
|
|
285
284
|
}) === "block") {
|
|
286
|
-
|
|
285
|
+
p(
|
|
287
286
|
"This handler would call itself with the same inputs and can loop forever. Choose another handler or keep a differing imported adapter."
|
|
288
|
-
),
|
|
287
|
+
), b(!1);
|
|
289
288
|
return;
|
|
290
289
|
}
|
|
291
|
-
|
|
290
|
+
D({ ...s, reroute: { ...s.reroute, target: S } }), b(!1);
|
|
292
291
|
}
|
|
293
|
-
return !
|
|
292
|
+
return !t && !a ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : /* @__PURE__ */ r("div", { className: "w6w-stack", "data-testid": "rail-errorhandling-body", children: [
|
|
294
293
|
/* @__PURE__ */ r("section", { "data-testid": "rail-retry-section", children: [
|
|
295
294
|
/* @__PURE__ */ n(
|
|
296
295
|
Pn,
|
|
297
296
|
{
|
|
298
|
-
value:
|
|
299
|
-
onChange: (g) =>
|
|
297
|
+
value: s.retry,
|
|
298
|
+
onChange: (g) => D({ ...s, retry: g }),
|
|
300
299
|
readOnly: a,
|
|
301
300
|
target: e
|
|
302
301
|
}
|
|
303
302
|
),
|
|
304
|
-
e === "function" &&
|
|
303
|
+
e === "function" && s.timeoutApplicable && /* @__PURE__ */ r("label", { className: "w6w-field", "data-testid": "rail-timeout-field", children: [
|
|
305
304
|
/* @__PURE__ */ n("span", { children: "Timeout (seconds)" }),
|
|
306
305
|
/* @__PURE__ */ n(
|
|
307
306
|
"input",
|
|
@@ -311,13 +310,13 @@ function on({
|
|
|
311
310
|
max: 280,
|
|
312
311
|
step: 1,
|
|
313
312
|
placeholder: "120",
|
|
314
|
-
value:
|
|
313
|
+
value: s.timeoutMs === void 0 ? "" : s.timeoutMs / 1e3,
|
|
315
314
|
disabled: a,
|
|
316
315
|
onChange: (g) => {
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
...
|
|
320
|
-
timeoutMs: g.target.value === "" || !Number.isFinite(
|
|
316
|
+
const S = g.target.valueAsNumber;
|
|
317
|
+
D({
|
|
318
|
+
...s,
|
|
319
|
+
timeoutMs: g.target.value === "" || !Number.isFinite(S) ? void 0 : Math.round(S * 1e3)
|
|
321
320
|
});
|
|
322
321
|
}
|
|
323
322
|
}
|
|
@@ -327,12 +326,12 @@ function on({
|
|
|
327
326
|
e === "workflow" && /* @__PURE__ */ n("p", { className: "muted small", "data-testid": "rail-retry-run-warning", children: "Retrying re-runs the whole workflow from its first step, so steps that already succeeded run again. For a step that must not repeat (a send or a charge), set retry on that step instead." })
|
|
328
327
|
] }),
|
|
329
328
|
/* @__PURE__ */ n("p", { className: "muted small", children: e === "workflow" ? "What runs when this workflow's run fails, after every node's own retry is spent." : "What runs when this call fails, after retry (if any) is exhausted." }),
|
|
330
|
-
|
|
329
|
+
y ? /* @__PURE__ */ r("div", { className: "row", style: { alignItems: "center", gap: 8 }, children: [
|
|
331
330
|
/* @__PURE__ */ r("span", { className: "list-main", children: [
|
|
332
|
-
/* @__PURE__ */ n("strong", { children:
|
|
331
|
+
/* @__PURE__ */ n("strong", { children: j ?? y }),
|
|
333
332
|
" ",
|
|
334
|
-
/* @__PURE__ */ n("code", { className: "muted", children:
|
|
335
|
-
/* @__PURE__ */ n("span", { className: "muted small block", children:
|
|
333
|
+
/* @__PURE__ */ n("code", { className: "muted", children: y }),
|
|
334
|
+
/* @__PURE__ */ n("span", { className: "muted small block", children: Lt(P) })
|
|
336
335
|
] }),
|
|
337
336
|
/* @__PURE__ */ n(
|
|
338
337
|
"button",
|
|
@@ -341,7 +340,7 @@ function on({
|
|
|
341
340
|
className: "btn ghost",
|
|
342
341
|
"data-testid": "rail-errorhandling-change",
|
|
343
342
|
disabled: a,
|
|
344
|
-
onClick: () =>
|
|
343
|
+
onClick: () => b(!0),
|
|
345
344
|
children: "Change"
|
|
346
345
|
}
|
|
347
346
|
)
|
|
@@ -352,203 +351,94 @@ function on({
|
|
|
352
351
|
className: "btn",
|
|
353
352
|
"data-testid": "rail-errorhandling-choose",
|
|
354
353
|
disabled: a,
|
|
355
|
-
onClick: () =>
|
|
354
|
+
onClick: () => b(!0),
|
|
356
355
|
children: "+ Choose what runs on failure"
|
|
357
356
|
}
|
|
358
357
|
),
|
|
359
|
-
|
|
358
|
+
y && /* @__PURE__ */ n(
|
|
360
359
|
"button",
|
|
361
360
|
{
|
|
362
361
|
type: "button",
|
|
363
362
|
className: "btn ghost",
|
|
364
363
|
"data-testid": "rail-errorhandling-clear",
|
|
365
364
|
disabled: a,
|
|
366
|
-
onClick: () =>
|
|
365
|
+
onClick: () => D({ ...s, reroute: void 0 }),
|
|
367
366
|
children: "Remove handler"
|
|
368
367
|
}
|
|
369
368
|
),
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
369
|
+
T === "warn" && /* @__PURE__ */ n("div", { className: "result error", "data-testid": "rail-errorhandling-self-caution", children: "This handler targets itself. Its imported input adapter is preserved; the server will refuse it if it resolves to the failed call's same inputs." }),
|
|
370
|
+
w && /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-errorhandling-error", children: w }),
|
|
371
|
+
d && /* @__PURE__ */ n(
|
|
373
372
|
In,
|
|
374
373
|
{
|
|
375
374
|
appsOnly: !0,
|
|
376
375
|
callables: ["function", "workflow"],
|
|
377
376
|
title: "Choose what runs on failure",
|
|
378
|
-
onClose: () =>
|
|
379
|
-
onAdd:
|
|
377
|
+
onClose: () => b(!1),
|
|
378
|
+
onAdd: L
|
|
380
379
|
}
|
|
381
380
|
)
|
|
382
381
|
] });
|
|
383
382
|
}
|
|
384
|
-
function
|
|
385
|
-
const
|
|
383
|
+
function Vt({ ctx: e }) {
|
|
384
|
+
const i = "policy" in e ? e.policy : void 0, s = "onPolicyChange" in e ? e.onPolicyChange : void 0;
|
|
386
385
|
return /* @__PURE__ */ n(
|
|
387
|
-
|
|
386
|
+
ln,
|
|
388
387
|
{
|
|
389
388
|
kind: e.kind,
|
|
390
389
|
id: e.id,
|
|
391
|
-
policy:
|
|
392
|
-
ready: !!
|
|
390
|
+
policy: i ?? {},
|
|
391
|
+
ready: !!s,
|
|
393
392
|
saving: !1,
|
|
394
|
-
onPersist: (
|
|
393
|
+
onPersist: (t) => s == null ? void 0 : s(t)
|
|
395
394
|
}
|
|
396
395
|
);
|
|
397
396
|
}
|
|
398
|
-
function
|
|
399
|
-
const
|
|
397
|
+
function Qt({ id: e, kind: i }) {
|
|
398
|
+
const s = ze(e, i === "function"), t = _e(e, i === "endpoint"), a = Ge(), l = Ye(), o = Ue(i, i === "function" ? s.data : t.data), c = i === "function" ? a.isPending : l.isPending;
|
|
400
399
|
return /* @__PURE__ */ n(
|
|
401
|
-
|
|
400
|
+
ln,
|
|
402
401
|
{
|
|
403
|
-
kind:
|
|
402
|
+
kind: i,
|
|
404
403
|
id: e,
|
|
405
|
-
policy:
|
|
406
|
-
ready: !!
|
|
407
|
-
saving:
|
|
408
|
-
onPersist: (h,
|
|
409
|
-
if (!
|
|
410
|
-
const
|
|
411
|
-
definition:
|
|
412
|
-
ifUnmodifiedSince:
|
|
413
|
-
},
|
|
414
|
-
onError: (
|
|
404
|
+
policy: o ? ht(o.definition) : {},
|
|
405
|
+
ready: !!o,
|
|
406
|
+
saving: c,
|
|
407
|
+
onPersist: (h, d) => {
|
|
408
|
+
if (!o) return;
|
|
409
|
+
const b = {
|
|
410
|
+
definition: ut(o.definition, h),
|
|
411
|
+
ifUnmodifiedSince: o.updatedAt
|
|
412
|
+
}, w = {
|
|
413
|
+
onError: (p) => d(p instanceof M ? p.message : String(p))
|
|
415
414
|
};
|
|
416
|
-
|
|
415
|
+
i === "function" ? a.mutate(b, w) : l.mutate(b, w);
|
|
417
416
|
}
|
|
418
417
|
}
|
|
419
418
|
);
|
|
420
419
|
}
|
|
421
|
-
function
|
|
422
|
-
return (e == null ? void 0 : e.kind) !== "workflow" && (e == null ? void 0 : e.kind) !== "function" && (e == null ? void 0 : e.kind) !== "endpoint" ? null : e.kind === "workflow" || typeof e.onPolicyChange == "function" ? /* @__PURE__ */ n(
|
|
420
|
+
function Wt({ ctx: e }) {
|
|
421
|
+
return (e == null ? void 0 : e.kind) !== "workflow" && (e == null ? void 0 : e.kind) !== "function" && (e == null ? void 0 : e.kind) !== "endpoint" ? null : e.kind === "workflow" || typeof e.onPolicyChange == "function" ? /* @__PURE__ */ n(Vt, { ctx: e }) : /* @__PURE__ */ n(Qt, { id: e.id, kind: e.kind });
|
|
423
422
|
}
|
|
424
|
-
function
|
|
425
|
-
return /* @__PURE__ */ n(
|
|
423
|
+
function $t() {
|
|
424
|
+
return /* @__PURE__ */ n(J, { name: "warning" });
|
|
426
425
|
}
|
|
427
|
-
const
|
|
426
|
+
const Ht = {
|
|
428
427
|
id: "error-handling",
|
|
429
428
|
title: "Error handling",
|
|
430
|
-
Icon:
|
|
431
|
-
isAvailable: (e) =>
|
|
432
|
-
Panel:
|
|
433
|
-
},
|
|
429
|
+
Icon: $t,
|
|
430
|
+
isAvailable: (e) => ct(e),
|
|
431
|
+
Panel: Wt
|
|
432
|
+
}, Ft = {
|
|
434
433
|
id: "history",
|
|
435
434
|
title: "Execution history",
|
|
436
|
-
Icon: () => /* @__PURE__ */ n(
|
|
435
|
+
Icon: () => /* @__PURE__ */ n(J, { name: "history" }),
|
|
437
436
|
isAvailable: (e) => (e == null ? void 0 : e.kind) === "workflow" && !!e.onOpenHistory,
|
|
438
437
|
onActivate: (e) => {
|
|
439
|
-
var
|
|
440
|
-
(e == null ? void 0 : e.kind) === "workflow" && ((
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
function Ut(e, t) {
|
|
444
|
-
if (!t.includes(",")) return { tags: e, typed: t };
|
|
445
|
-
let i = e;
|
|
446
|
-
for (const s of t.split(",")) {
|
|
447
|
-
const a = s.trim();
|
|
448
|
-
a && !i.includes(a) && (i = [...i, a]);
|
|
438
|
+
var i;
|
|
439
|
+
(e == null ? void 0 : e.kind) === "workflow" && ((i = e.onOpenHistory) == null || i.call(e));
|
|
449
440
|
}
|
|
450
|
-
|
|
451
|
-
}
|
|
452
|
-
function _t(e, t) {
|
|
453
|
-
return e.filter((i) => i !== t);
|
|
454
|
-
}
|
|
455
|
-
function zt({ tags: e, onChange: t }) {
|
|
456
|
-
const [i, s] = u("");
|
|
457
|
-
function a(o) {
|
|
458
|
-
const l = Ut(e, o);
|
|
459
|
-
s(l.typed), l.tags !== e && t(l.tags);
|
|
460
|
-
}
|
|
461
|
-
return /* @__PURE__ */ r("div", { className: "tag-list", "data-testid": "tag-editor", children: [
|
|
462
|
-
e.map((o) => /* @__PURE__ */ r("span", { className: "tag removable", children: [
|
|
463
|
-
o,
|
|
464
|
-
/* @__PURE__ */ n(
|
|
465
|
-
Se,
|
|
466
|
-
{
|
|
467
|
-
danger: !0,
|
|
468
|
-
icon: "close",
|
|
469
|
-
label: `Remove tag ${o}`,
|
|
470
|
-
title: `Remove ${o}`,
|
|
471
|
-
onClick: () => t(_t(e, o))
|
|
472
|
-
}
|
|
473
|
-
)
|
|
474
|
-
] }, o)),
|
|
475
|
-
/* @__PURE__ */ n(
|
|
476
|
-
"input",
|
|
477
|
-
{
|
|
478
|
-
type: "text",
|
|
479
|
-
value: i,
|
|
480
|
-
placeholder: "Add a tag…",
|
|
481
|
-
"aria-label": "New tag",
|
|
482
|
-
onChange: (o) => a(o.target.value)
|
|
483
|
-
}
|
|
484
|
-
)
|
|
485
|
-
] });
|
|
486
|
-
}
|
|
487
|
-
function ln(e) {
|
|
488
|
-
const t = At(e.kind).settings, { initial: i } = e, [s, a] = u(i.displayName), [o, l] = u(i.key ?? ""), [d, h] = u(i.tags ?? []), [c, v] = u(!1), [b, m] = u(null), C = s !== i.displayName, k = o !== (i.key ?? ""), D = t.hasTags && JSON.stringify(d) !== JSON.stringify(i.tags ?? []), O = C || k || D, E = t.canEditKey, M = o === "" || it(o), y = O && M && !c;
|
|
489
|
-
async function R() {
|
|
490
|
-
if (y) {
|
|
491
|
-
m(null), v(!0);
|
|
492
|
-
try {
|
|
493
|
-
await e.onSave({
|
|
494
|
-
displayName: s.trim(),
|
|
495
|
-
key: E && k ? o : i.key,
|
|
496
|
-
tags: t.hasTags ? d : void 0
|
|
497
|
-
}), e.onClose();
|
|
498
|
-
} catch (N) {
|
|
499
|
-
m(N instanceof j ? N.message : String(N));
|
|
500
|
-
} finally {
|
|
501
|
-
v(!1);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
const Q = Tn(R, { enabled: y });
|
|
506
|
-
return /* @__PURE__ */ r(B, { title: "Edit settings", onClose: e.onClose, children: [
|
|
507
|
-
/* @__PURE__ */ r("div", { className: "modal-body", children: [
|
|
508
|
-
/* @__PURE__ */ r("label", { className: "field", children: [
|
|
509
|
-
/* @__PURE__ */ n("span", { children: "Name" }),
|
|
510
|
-
/* @__PURE__ */ n(
|
|
511
|
-
"input",
|
|
512
|
-
{
|
|
513
|
-
type: "text",
|
|
514
|
-
value: s,
|
|
515
|
-
onChange: (N) => a(N.target.value),
|
|
516
|
-
placeholder: t.namePlaceholder,
|
|
517
|
-
autoFocus: !0,
|
|
518
|
-
...Q
|
|
519
|
-
}
|
|
520
|
-
)
|
|
521
|
-
] }),
|
|
522
|
-
E && /* @__PURE__ */ r("label", { className: "field", children: [
|
|
523
|
-
/* @__PURE__ */ n("span", { children: "Key" }),
|
|
524
|
-
/* @__PURE__ */ n(
|
|
525
|
-
"input",
|
|
526
|
-
{
|
|
527
|
-
type: "text",
|
|
528
|
-
value: o,
|
|
529
|
-
onChange: (N) => l(st(N.target.value)),
|
|
530
|
-
placeholder: t.keyPlaceholder,
|
|
531
|
-
...Q
|
|
532
|
-
}
|
|
533
|
-
),
|
|
534
|
-
/* @__PURE__ */ r("span", { className: "muted small", children: [
|
|
535
|
-
"Lowercase, kebab-case, 3–39 characters.",
|
|
536
|
-
t.keyHintSuffix
|
|
537
|
-
] })
|
|
538
|
-
] }),
|
|
539
|
-
t.hasTags && /* @__PURE__ */ r("div", { children: [
|
|
540
|
-
/* @__PURE__ */ n("p", { className: "muted small", style: { marginBottom: "8px" }, children: "Tags" }),
|
|
541
|
-
/* @__PURE__ */ n(zt, { tags: d, onChange: h })
|
|
542
|
-
] }),
|
|
543
|
-
b && /* @__PURE__ */ n("div", { className: "error", children: b })
|
|
544
|
-
] }),
|
|
545
|
-
/* @__PURE__ */ r("div", { className: "modal-actions", children: [
|
|
546
|
-
/* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Cancel" }),
|
|
547
|
-
/* @__PURE__ */ n("button", { type: "button", className: "btn", disabled: !y, onClick: R, children: c ? "Saving…" : "Save" })
|
|
548
|
-
] })
|
|
549
|
-
] });
|
|
550
|
-
}
|
|
551
|
-
const Gt = {
|
|
441
|
+
}, qt = {
|
|
552
442
|
function: {
|
|
553
443
|
json: "functions-version-json",
|
|
554
444
|
error: "functions-version-error",
|
|
@@ -575,30 +465,30 @@ const Gt = {
|
|
|
575
465
|
}
|
|
576
466
|
};
|
|
577
467
|
function dn(e) {
|
|
578
|
-
const { kind:
|
|
579
|
-
return /* @__PURE__ */ r(
|
|
580
|
-
/* @__PURE__ */ r(B, { title: `Version ${
|
|
468
|
+
const { kind: i, id: s, versionNumber: t } = e, a = qt[i], l = wt(i, s, t, !0), o = yt(i), c = Nt(i), [h, d] = f(!1), [b, w] = f(null);
|
|
469
|
+
return /* @__PURE__ */ r(R, { children: [
|
|
470
|
+
/* @__PURE__ */ r(B, { title: `Version ${t}`, onClose: e.onClose, wide: !0, children: [
|
|
581
471
|
/* @__PURE__ */ r("div", { className: "modal-body", children: [
|
|
582
|
-
|
|
583
|
-
|
|
472
|
+
l.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : l.isError ? /* @__PURE__ */ n("div", { className: "error", "data-testid": a.error, children: l.error instanceof Error ? l.error.message : String(l.error) }) : l.data ? /* @__PURE__ */ n("div", { "data-testid": a.json, children: /* @__PURE__ */ n(
|
|
473
|
+
pe,
|
|
584
474
|
{
|
|
585
|
-
code: JSON.stringify(
|
|
475
|
+
code: JSON.stringify(l.data.definition, null, 2),
|
|
586
476
|
language: "json",
|
|
587
477
|
maxHeight: "420px",
|
|
588
478
|
copyable: !0
|
|
589
479
|
}
|
|
590
480
|
) }) : null,
|
|
591
|
-
(
|
|
592
|
-
|
|
593
|
-
|
|
481
|
+
(b || o.isError) && /* @__PURE__ */ n("div", { className: "error", children: b ?? String(o.error) }),
|
|
482
|
+
c.data !== void 0 && /* @__PURE__ */ n("div", { "data-testid": a.invokeJson, children: /* @__PURE__ */ n(
|
|
483
|
+
pe,
|
|
594
484
|
{
|
|
595
|
-
code: JSON.stringify(
|
|
485
|
+
code: JSON.stringify(c.data, null, 2),
|
|
596
486
|
language: "json",
|
|
597
487
|
maxHeight: "240px",
|
|
598
488
|
copyable: !0
|
|
599
489
|
}
|
|
600
490
|
) }),
|
|
601
|
-
|
|
491
|
+
c.isError && /* @__PURE__ */ n("div", { className: "error", "data-testid": a.invokeError, children: c.error instanceof M ? c.error.message : String(c.error) })
|
|
602
492
|
] }),
|
|
603
493
|
/* @__PURE__ */ r("div", { className: "modal-actions", children: [
|
|
604
494
|
/* @__PURE__ */ n(
|
|
@@ -607,9 +497,9 @@ function dn(e) {
|
|
|
607
497
|
type: "button",
|
|
608
498
|
className: "btn ghost",
|
|
609
499
|
"data-testid": a.invokeButton,
|
|
610
|
-
disabled:
|
|
611
|
-
onClick: () =>
|
|
612
|
-
children:
|
|
500
|
+
disabled: c.isPending,
|
|
501
|
+
onClick: () => c.mutate({ id: s, versionNumber: t }),
|
|
502
|
+
children: c.isPending ? "Invoking…" : "Invoke this version"
|
|
613
503
|
}
|
|
614
504
|
),
|
|
615
505
|
/* @__PURE__ */ n(
|
|
@@ -618,49 +508,49 @@ function dn(e) {
|
|
|
618
508
|
type: "button",
|
|
619
509
|
className: "btn danger",
|
|
620
510
|
"data-testid": a.revertButton,
|
|
621
|
-
disabled:
|
|
622
|
-
onClick: () =>
|
|
623
|
-
children:
|
|
511
|
+
disabled: o.isPending,
|
|
512
|
+
onClick: () => d(!0),
|
|
513
|
+
children: o.isPending ? "Reverting…" : "Revert to this version"
|
|
624
514
|
}
|
|
625
515
|
),
|
|
626
516
|
/* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Close" })
|
|
627
517
|
] })
|
|
628
518
|
] }),
|
|
629
519
|
h && /* @__PURE__ */ n(
|
|
630
|
-
|
|
520
|
+
ot,
|
|
631
521
|
{
|
|
632
522
|
title: "Revert to this version",
|
|
633
|
-
message: `Revert to version ${
|
|
523
|
+
message: `Revert to version ${t}? This restores its content onto the resource's current draft; the resource's key and address stay unchanged.`,
|
|
634
524
|
confirmLabel: "Revert",
|
|
635
525
|
destructive: !0,
|
|
636
526
|
onConfirm: () => {
|
|
637
|
-
|
|
527
|
+
d(!1), e.onRestore ? (w(null), e.onRestore(t).then(e.onClose, (p) => w(String(p)))) : o.mutate({ id: s, versionNumber: t });
|
|
638
528
|
},
|
|
639
|
-
onClose: () =>
|
|
529
|
+
onClose: () => d(!1)
|
|
640
530
|
}
|
|
641
531
|
)
|
|
642
532
|
] });
|
|
643
533
|
}
|
|
644
|
-
function
|
|
534
|
+
function Bt(e) {
|
|
645
535
|
const {
|
|
646
|
-
archived:
|
|
647
|
-
deleteLabel:
|
|
648
|
-
deleteTestId:
|
|
536
|
+
archived: i,
|
|
537
|
+
deleteLabel: s,
|
|
538
|
+
deleteTestId: t,
|
|
649
539
|
archiveTestId: a,
|
|
650
|
-
onRequestDelete:
|
|
651
|
-
onRequestArchive:
|
|
652
|
-
deleteError:
|
|
540
|
+
onRequestDelete: l,
|
|
541
|
+
onRequestArchive: o,
|
|
542
|
+
deleteError: c,
|
|
653
543
|
archiveError: h
|
|
654
544
|
} = e;
|
|
655
545
|
return /* @__PURE__ */ r("div", { className: "rail-danger-zone rail-danger-zone--panel", "data-testid": "rail-danger-zone-panel", children: [
|
|
656
546
|
/* @__PURE__ */ r("div", { className: "rail-danger-zone-actions", children: [
|
|
657
|
-
!
|
|
547
|
+
!i && /* @__PURE__ */ n(
|
|
658
548
|
"button",
|
|
659
549
|
{
|
|
660
550
|
type: "button",
|
|
661
551
|
className: "btn danger",
|
|
662
552
|
"data-testid": a,
|
|
663
|
-
onClick:
|
|
553
|
+
onClick: o,
|
|
664
554
|
disabled: e.pending,
|
|
665
555
|
children: "Archive"
|
|
666
556
|
}
|
|
@@ -670,37 +560,37 @@ function Yt(e) {
|
|
|
670
560
|
{
|
|
671
561
|
type: "button",
|
|
672
562
|
className: "btn danger",
|
|
673
|
-
"aria-label":
|
|
674
|
-
"data-testid":
|
|
675
|
-
onClick:
|
|
563
|
+
"aria-label": s,
|
|
564
|
+
"data-testid": t,
|
|
565
|
+
onClick: l,
|
|
676
566
|
disabled: e.pending,
|
|
677
567
|
children: "Delete"
|
|
678
568
|
}
|
|
679
|
-
) :
|
|
569
|
+
) : i ? /* @__PURE__ */ r("span", { className: "rail-danger-zone-delete", children: [
|
|
680
570
|
/* @__PURE__ */ n(
|
|
681
571
|
Dn,
|
|
682
572
|
{
|
|
683
|
-
label:
|
|
684
|
-
"data-testid":
|
|
685
|
-
onClick:
|
|
573
|
+
label: s,
|
|
574
|
+
"data-testid": t,
|
|
575
|
+
onClick: l,
|
|
686
576
|
disabled: e.pending
|
|
687
577
|
}
|
|
688
578
|
),
|
|
689
579
|
/* @__PURE__ */ n("span", { children: "Delete" })
|
|
690
580
|
] }) : null
|
|
691
581
|
] }),
|
|
692
|
-
|
|
582
|
+
c && /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-delete-error", children: c }),
|
|
693
583
|
h && /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-archive-error", children: h })
|
|
694
584
|
] });
|
|
695
585
|
}
|
|
696
586
|
function cn(e) {
|
|
697
587
|
return /* @__PURE__ */ r("div", { className: "right-rail-panel-head rail-settings-head", children: [
|
|
698
588
|
/* @__PURE__ */ n("h3", { children: "Settings" }),
|
|
699
|
-
/* @__PURE__ */ n(
|
|
589
|
+
/* @__PURE__ */ n(Tn, { label: "Edit settings", "data-testid": "rail-settings-edit", onClick: e.onEdit })
|
|
700
590
|
] });
|
|
701
591
|
}
|
|
702
592
|
function un(e) {
|
|
703
|
-
const { id:
|
|
593
|
+
const { id: i, displayName: s, fields: t, row: a, tags: l } = e;
|
|
704
594
|
return /* @__PURE__ */ n("div", { className: "rail-meta", children: /* @__PURE__ */ n(
|
|
705
595
|
"div",
|
|
706
596
|
{
|
|
@@ -711,23 +601,23 @@ function un(e) {
|
|
|
711
601
|
gap: "8px"
|
|
712
602
|
},
|
|
713
603
|
children: /* @__PURE__ */ r("dl", { className: "rail-meta-list", children: [
|
|
714
|
-
|
|
604
|
+
s && /* @__PURE__ */ r(R, { children: [
|
|
715
605
|
/* @__PURE__ */ n("dt", { children: "Name" }),
|
|
716
|
-
/* @__PURE__ */ n("dd", { "data-testid": "rail-meta-name", children: /* @__PURE__ */ n("code", { children:
|
|
606
|
+
/* @__PURE__ */ n("dd", { "data-testid": "rail-meta-name", children: /* @__PURE__ */ n("code", { children: s }) })
|
|
717
607
|
] }),
|
|
718
608
|
/* @__PURE__ */ n("dt", { children: "ID" }),
|
|
719
|
-
/* @__PURE__ */ n("dd", { "data-testid": "rail-meta-id", children: /* @__PURE__ */ n("code", { children:
|
|
720
|
-
|
|
609
|
+
/* @__PURE__ */ n("dd", { "data-testid": "rail-meta-id", children: /* @__PURE__ */ n("code", { children: i }) }),
|
|
610
|
+
t.includes("key") && a && /* @__PURE__ */ r(R, { children: [
|
|
721
611
|
/* @__PURE__ */ n("dt", { children: "Key" }),
|
|
722
612
|
/* @__PURE__ */ n("dd", { "data-testid": "rail-meta-key", children: /* @__PURE__ */ n("code", { children: a.key || "unset" }) })
|
|
723
613
|
] }),
|
|
724
|
-
|
|
614
|
+
t.includes("updatedAt") && a && /* @__PURE__ */ r(R, { children: [
|
|
725
615
|
/* @__PURE__ */ n("dt", { children: "Updated" }),
|
|
726
616
|
/* @__PURE__ */ n("dd", { "data-testid": "rail-meta-updated", "data-value": a.updatedAt, children: new Date(a.updatedAt).toLocaleString() })
|
|
727
617
|
] }),
|
|
728
|
-
|
|
618
|
+
l !== void 0 && a && /* @__PURE__ */ r(R, { children: [
|
|
729
619
|
/* @__PURE__ */ n("dt", { children: "Tags" }),
|
|
730
|
-
/* @__PURE__ */ n("dd", { "data-testid": "rail-meta-tags", children:
|
|
620
|
+
/* @__PURE__ */ n("dd", { "data-testid": "rail-meta-tags", children: l.length > 0 ? l.map((o) => /* @__PURE__ */ n("span", { className: "tag", children: o }, o)) : "No tags" })
|
|
731
621
|
] })
|
|
732
622
|
] })
|
|
733
623
|
}
|
|
@@ -735,7 +625,7 @@ function un(e) {
|
|
|
735
625
|
}
|
|
736
626
|
function hn(e) {
|
|
737
627
|
return /* @__PURE__ */ n("div", { className: "rail-spec-actions", children: /* @__PURE__ */ n(
|
|
738
|
-
|
|
628
|
+
Be,
|
|
739
629
|
{
|
|
740
630
|
icon: "file-text",
|
|
741
631
|
label: "Export, edit, or import",
|
|
@@ -745,15 +635,15 @@ function hn(e) {
|
|
|
745
635
|
) });
|
|
746
636
|
}
|
|
747
637
|
function fn(e) {
|
|
748
|
-
const { kind:
|
|
638
|
+
const { kind: i, children: s, onImport: t, onClose: a } = e;
|
|
749
639
|
return /* @__PURE__ */ r(B, { title: "Definition", onClose: a, children: [
|
|
750
640
|
/* @__PURE__ */ r("div", { className: "modal-body", children: [
|
|
751
|
-
|
|
641
|
+
s,
|
|
752
642
|
/* @__PURE__ */ r("p", { className: "muted small", children: [
|
|
753
643
|
"Import a spec document to create a NEW ",
|
|
754
|
-
|
|
644
|
+
i,
|
|
755
645
|
" and navigate to it — this does not replace the ",
|
|
756
|
-
|
|
646
|
+
i,
|
|
757
647
|
" you have open."
|
|
758
648
|
] }),
|
|
759
649
|
/* @__PURE__ */ n("div", { className: "rail-spec-menu-row", children: /* @__PURE__ */ n(
|
|
@@ -762,7 +652,7 @@ function fn(e) {
|
|
|
762
652
|
type: "button",
|
|
763
653
|
className: "btn ghost",
|
|
764
654
|
"data-testid": "rail-spec-import",
|
|
765
|
-
onClick:
|
|
655
|
+
onClick: t,
|
|
766
656
|
children: "Import"
|
|
767
657
|
}
|
|
768
658
|
) })
|
|
@@ -771,7 +661,7 @@ function fn(e) {
|
|
|
771
661
|
] });
|
|
772
662
|
}
|
|
773
663
|
function mn(e) {
|
|
774
|
-
const { open:
|
|
664
|
+
const { open: i, versions: s } = e;
|
|
775
665
|
return /* @__PURE__ */ r("div", { className: "rail-version-section", children: [
|
|
776
666
|
e.definitionStatus && /* @__PURE__ */ r("div", { "aria-live": "polite", "data-testid": "rail-definition-status", children: [
|
|
777
667
|
/* @__PURE__ */ n("span", { className: `badge wf-definition-status ${e.definitionStatus}`, children: e.definitionStatus === "published" ? "Live" : "Draft" }),
|
|
@@ -787,13 +677,13 @@ function mn(e) {
|
|
|
787
677
|
title: "Version history",
|
|
788
678
|
onClick: e.onShow,
|
|
789
679
|
children: [
|
|
790
|
-
/* @__PURE__ */ n(
|
|
680
|
+
/* @__PURE__ */ n(J, { name: "clock", size: 14 }),
|
|
791
681
|
/* @__PURE__ */ n("span", { children: "Version history" })
|
|
792
682
|
]
|
|
793
683
|
}
|
|
794
684
|
),
|
|
795
|
-
(
|
|
796
|
-
|
|
685
|
+
(i || e.definitionStatus) && /* @__PURE__ */ n("p", { className: "muted small", "data-testid": "rail-version-published", children: (s == null ? void 0 : s.currentPublishedVersion) != null ? `Published: v${s.currentPublishedVersion}` : "Never published" }),
|
|
686
|
+
i && /* @__PURE__ */ r(R, { children: [
|
|
797
687
|
/* @__PURE__ */ r("div", { className: "rail-version-actions", children: [
|
|
798
688
|
/* @__PURE__ */ n(
|
|
799
689
|
"button",
|
|
@@ -803,7 +693,7 @@ function mn(e) {
|
|
|
803
693
|
"data-testid": "rail-publish",
|
|
804
694
|
disabled: e.publishing || e.publishDisabled || e.definitionStatus === "published",
|
|
805
695
|
onClick: e.onPublish,
|
|
806
|
-
children: e.publishing ? (
|
|
696
|
+
children: e.publishing ? (s == null ? void 0 : s.currentPublishedVersion) != null ? "Republishing…" : "Publishing…" : e.definitionStatus === "published" || e.publishDisabled !== void 0 && e.definitionStatus === void 0 && (s == null ? void 0 : s.currentPublishedVersion) != null ? "Published" : (s == null ? void 0 : s.currentPublishedVersion) != null ? "Republish" : "Publish"
|
|
807
697
|
}
|
|
808
698
|
),
|
|
809
699
|
" ",
|
|
@@ -813,9 +703,9 @@ function mn(e) {
|
|
|
813
703
|
type: "button",
|
|
814
704
|
className: "btn ghost",
|
|
815
705
|
"data-testid": "rail-enable-toggle",
|
|
816
|
-
disabled: e.togglingEnabled ||
|
|
706
|
+
disabled: e.togglingEnabled || s === void 0,
|
|
817
707
|
onClick: e.onToggleEnabled,
|
|
818
|
-
children: e.togglingEnabled ? "Saving…" :
|
|
708
|
+
children: e.togglingEnabled ? "Saving…" : s != null && s.enabled ? "Disable" : "Enable"
|
|
819
709
|
}
|
|
820
710
|
)
|
|
821
711
|
] }),
|
|
@@ -825,34 +715,34 @@ function mn(e) {
|
|
|
825
715
|
] });
|
|
826
716
|
}
|
|
827
717
|
function pn(e) {
|
|
828
|
-
const { loading:
|
|
718
|
+
const { loading: i, versions: s } = e;
|
|
829
719
|
return /* @__PURE__ */ r(B, { title: "All versions", onClose: e.onClose, wide: !0, children: [
|
|
830
720
|
/* @__PURE__ */ r("div", { className: "modal-body", children: [
|
|
831
|
-
|
|
832
|
-
(
|
|
833
|
-
|
|
721
|
+
i && /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }),
|
|
722
|
+
(s == null ? void 0 : s.length) === 0 && /* @__PURE__ */ n("p", { className: "muted small", children: "No versions yet." }),
|
|
723
|
+
s && s.length > 0 && /* @__PURE__ */ n("ul", { className: "list", children: s.map((t) => /* @__PURE__ */ n("li", { className: "selectable", children: /* @__PURE__ */ n(
|
|
834
724
|
"button",
|
|
835
725
|
{
|
|
836
726
|
type: "button",
|
|
837
727
|
className: "row-select",
|
|
838
728
|
"data-testid": "rail-version-row",
|
|
839
|
-
onClick: () => e.onSelect(
|
|
729
|
+
onClick: () => e.onSelect(t.versionNumber),
|
|
840
730
|
children: /* @__PURE__ */ r("div", { className: "list-main", children: [
|
|
841
731
|
/* @__PURE__ */ r("code", { children: [
|
|
842
732
|
"v",
|
|
843
|
-
|
|
733
|
+
t.versionNumber
|
|
844
734
|
] }),
|
|
845
735
|
" ",
|
|
846
|
-
|
|
847
|
-
/* @__PURE__ */ n("div", { className: "muted small", children: new Date(
|
|
736
|
+
t.isCurrentPublished && /* @__PURE__ */ n("span", { className: "badge", "data-testid": "rail-version-current", children: "Published" }),
|
|
737
|
+
/* @__PURE__ */ n("div", { className: "muted small", children: new Date(t.createdAt).toLocaleString() })
|
|
848
738
|
] })
|
|
849
739
|
}
|
|
850
|
-
) },
|
|
740
|
+
) }, t.versionNumber)) })
|
|
851
741
|
] }),
|
|
852
742
|
/* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Done" }) })
|
|
853
743
|
] });
|
|
854
744
|
}
|
|
855
|
-
const
|
|
745
|
+
const Jt = {
|
|
856
746
|
function: {
|
|
857
747
|
deleteTitle: "Delete function",
|
|
858
748
|
deleteMessage: "Delete this function permanently? Any endpoint, workflow, or call pointing to it will start failing with a not-found error the next time it runs, and this cannot be undone.",
|
|
@@ -882,17 +772,17 @@ const Zt = {
|
|
|
882
772
|
}
|
|
883
773
|
};
|
|
884
774
|
function gn(e) {
|
|
885
|
-
const
|
|
886
|
-
return /* @__PURE__ */ r(
|
|
775
|
+
const i = Jt[e.kind];
|
|
776
|
+
return /* @__PURE__ */ r(R, { children: [
|
|
887
777
|
/* @__PURE__ */ n(
|
|
888
|
-
|
|
778
|
+
Bt,
|
|
889
779
|
{
|
|
890
780
|
archived: e.archived,
|
|
891
781
|
allowDirectDelete: e.kind === "workflow",
|
|
892
782
|
pending: e.pending,
|
|
893
|
-
deleteLabel:
|
|
894
|
-
deleteTestId:
|
|
895
|
-
archiveTestId:
|
|
783
|
+
deleteLabel: i.deleteLabel,
|
|
784
|
+
deleteTestId: i.deleteTestId,
|
|
785
|
+
archiveTestId: i.archiveTestId,
|
|
896
786
|
onRequestDelete: e.onRequestDelete,
|
|
897
787
|
onRequestArchive: e.onRequestArchive,
|
|
898
788
|
deleteError: e.deleteError,
|
|
@@ -900,10 +790,10 @@ function gn(e) {
|
|
|
900
790
|
}
|
|
901
791
|
),
|
|
902
792
|
e.deleteConfirming && /* @__PURE__ */ n(
|
|
903
|
-
|
|
793
|
+
je,
|
|
904
794
|
{
|
|
905
|
-
title:
|
|
906
|
-
message:
|
|
795
|
+
title: i.deleteTitle,
|
|
796
|
+
message: i.deleteMessage,
|
|
907
797
|
confirmLabel: "Delete",
|
|
908
798
|
pending: e.pending,
|
|
909
799
|
onConfirm: e.onConfirmDelete,
|
|
@@ -911,10 +801,10 @@ function gn(e) {
|
|
|
911
801
|
}
|
|
912
802
|
),
|
|
913
803
|
e.archiveConfirming && /* @__PURE__ */ n(
|
|
914
|
-
|
|
804
|
+
je,
|
|
915
805
|
{
|
|
916
|
-
title:
|
|
917
|
-
message:
|
|
806
|
+
title: i.archiveTitle,
|
|
807
|
+
message: i.archiveMessage,
|
|
918
808
|
confirmLabel: "Archive",
|
|
919
809
|
pending: e.pending,
|
|
920
810
|
onConfirm: e.onConfirmArchive,
|
|
@@ -923,51 +813,51 @@ function gn(e) {
|
|
|
923
813
|
)
|
|
924
814
|
] });
|
|
925
815
|
}
|
|
926
|
-
const vn = { functionsKey:
|
|
927
|
-
function
|
|
816
|
+
const vn = { functionsKey: mt, endpointsKey: ft, workflowsKey: xn };
|
|
817
|
+
function Kt({
|
|
928
818
|
ctx: e,
|
|
929
|
-
project:
|
|
930
|
-
onNavigate:
|
|
931
|
-
open:
|
|
819
|
+
project: i,
|
|
820
|
+
onNavigate: s,
|
|
821
|
+
open: t
|
|
932
822
|
}) {
|
|
933
|
-
var
|
|
823
|
+
var me, oe;
|
|
934
824
|
const {
|
|
935
825
|
editingSettings: a,
|
|
936
|
-
setEditingSettings:
|
|
937
|
-
historyOpen:
|
|
938
|
-
setHistoryOpen:
|
|
826
|
+
setEditingSettings: l,
|
|
827
|
+
historyOpen: o,
|
|
828
|
+
setHistoryOpen: c,
|
|
939
829
|
versionListOpen: h,
|
|
940
|
-
setVersionListOpen:
|
|
941
|
-
} =
|
|
830
|
+
setVersionListOpen: d
|
|
831
|
+
} = t, b = Ke(i ?? void 0), w = (e == null ? void 0 : e.kind) === "workflow", p = (e == null ? void 0 : e.id) ?? "", P = Gn(p, w), y = Yn(i ?? void 0), T = Zn(), j = Xn(), D = Fe(!1), [L, N] = f(!1), [H, K] = f(!1), [O, g] = f(!1), [S, F] = f(!1), [U, V] = f(!1), [Q, le] = f(null), [G, de] = f(null), W = Je(Qe("workflow"), p, O), Y = en("workflow", p, o && w), te = nn("workflow"), ce = tn("workflow"), [ke, Z] = f(null), [ie, ue] = f(null), [se, he] = f(
|
|
942
832
|
null
|
|
943
833
|
);
|
|
944
834
|
if (!e || e.kind !== "workflow")
|
|
945
835
|
return /* @__PURE__ */ n("p", { className: "muted small", children: "Open a workflow to see its settings." });
|
|
946
|
-
const
|
|
947
|
-
async function
|
|
948
|
-
if (!
|
|
949
|
-
|
|
836
|
+
const C = (me = b.data) == null ? void 0 : me.find((u) => u.id === e.id), z = e.onSettingsChange, $ = C && typeof C.displayName == "string" ? C.displayName : "", X = z ? e.label ?? $ : $, _ = z ? e.key ?? null : (C == null ? void 0 : C.key) ?? null, ae = z ? e.tags ?? [] : (C == null ? void 0 : C.tags) ?? [], re = (C == null ? void 0 : C.status) === "archived";
|
|
837
|
+
async function we() {
|
|
838
|
+
if (!D.current) {
|
|
839
|
+
D.current = !0, le(null);
|
|
950
840
|
try {
|
|
951
|
-
|
|
952
|
-
} catch (
|
|
953
|
-
|
|
841
|
+
re || await T.mutateAsync(p), await j.mutateAsync(p), F(!1), s({ type: "list" });
|
|
842
|
+
} catch (u) {
|
|
843
|
+
F(!1), le(u instanceof M ? u.message : String(u));
|
|
954
844
|
} finally {
|
|
955
|
-
|
|
845
|
+
D.current = !1;
|
|
956
846
|
}
|
|
957
847
|
}
|
|
958
848
|
}
|
|
959
849
|
function fe() {
|
|
960
|
-
|
|
850
|
+
de(null), T.mutate(p, {
|
|
961
851
|
onSuccess: () => {
|
|
962
|
-
|
|
852
|
+
V(!1), s({ type: "list" });
|
|
963
853
|
},
|
|
964
|
-
onError: (
|
|
965
|
-
|
|
854
|
+
onError: (u) => {
|
|
855
|
+
V(!1), de(u instanceof M ? u.message : String(u));
|
|
966
856
|
}
|
|
967
857
|
});
|
|
968
858
|
}
|
|
969
859
|
return /* @__PURE__ */ r("div", { className: "rail-settings-panel", children: [
|
|
970
|
-
/* @__PURE__ */ n(cn, { onEdit: () =>
|
|
860
|
+
/* @__PURE__ */ n(cn, { onEdit: () => l(!0) }),
|
|
971
861
|
e.authoringSettings && e.onAuthoringSettingChange && /* @__PURE__ */ r("section", { className: "w6w-stack", "data-testid": "rail-workflow-authoring", children: [
|
|
972
862
|
/* @__PURE__ */ r("label", { children: [
|
|
973
863
|
/* @__PURE__ */ n(
|
|
@@ -975,9 +865,9 @@ function Xt({
|
|
|
975
865
|
{
|
|
976
866
|
type: "checkbox",
|
|
977
867
|
checked: e.authoringSettings.autoSave,
|
|
978
|
-
onChange: (
|
|
979
|
-
var
|
|
980
|
-
return (
|
|
868
|
+
onChange: (u) => {
|
|
869
|
+
var E;
|
|
870
|
+
return (E = e.onAuthoringSettingChange) == null ? void 0 : E.call(e, "autoSave", u.target.checked);
|
|
981
871
|
}
|
|
982
872
|
}
|
|
983
873
|
),
|
|
@@ -989,9 +879,9 @@ function Xt({
|
|
|
989
879
|
{
|
|
990
880
|
type: "checkbox",
|
|
991
881
|
checked: e.authoringSettings.savePosition,
|
|
992
|
-
onChange: (
|
|
993
|
-
var
|
|
994
|
-
return (
|
|
882
|
+
onChange: (u) => {
|
|
883
|
+
var E;
|
|
884
|
+
return (E = e.onAuthoringSettingChange) == null ? void 0 : E.call(e, "savePosition", u.target.checked);
|
|
995
885
|
}
|
|
996
886
|
}
|
|
997
887
|
),
|
|
@@ -1002,41 +892,41 @@ function Xt({
|
|
|
1002
892
|
un,
|
|
1003
893
|
{
|
|
1004
894
|
id: e.id,
|
|
1005
|
-
displayName:
|
|
1006
|
-
fields:
|
|
1007
|
-
row:
|
|
1008
|
-
tags:
|
|
895
|
+
displayName: X,
|
|
896
|
+
fields: We("workflow"),
|
|
897
|
+
row: C ? { ...C, key: _ } : void 0,
|
|
898
|
+
tags: ae
|
|
1009
899
|
}
|
|
1010
900
|
),
|
|
1011
|
-
/* @__PURE__ */ n(hn, { onOpen: () =>
|
|
901
|
+
/* @__PURE__ */ n(hn, { onOpen: () => N(!0) }),
|
|
1012
902
|
/* @__PURE__ */ n(
|
|
1013
903
|
mn,
|
|
1014
904
|
{
|
|
1015
905
|
definitionStatus: e.definitionStatus,
|
|
1016
906
|
publishDisabled: e.publishDisabled,
|
|
1017
|
-
open:
|
|
1018
|
-
versions:
|
|
907
|
+
open: o,
|
|
908
|
+
versions: Y.data,
|
|
1019
909
|
publishing: te.isPending,
|
|
1020
|
-
togglingEnabled:
|
|
910
|
+
togglingEnabled: ce.isPending,
|
|
1021
911
|
publishError: ke,
|
|
1022
912
|
enableError: ie,
|
|
1023
913
|
onShow: () => {
|
|
1024
|
-
|
|
914
|
+
c(!0), d(!0);
|
|
1025
915
|
},
|
|
1026
916
|
onPublish: () => {
|
|
1027
917
|
if (e.onPublish) {
|
|
1028
918
|
e.onPublish();
|
|
1029
919
|
return;
|
|
1030
920
|
}
|
|
1031
|
-
|
|
1032
|
-
onError: (
|
|
921
|
+
Z(null), te.mutate(p, {
|
|
922
|
+
onError: (u) => Z(u instanceof M ? u.message : String(u))
|
|
1033
923
|
});
|
|
1034
924
|
},
|
|
1035
925
|
onToggleEnabled: () => {
|
|
1036
|
-
var
|
|
1037
|
-
|
|
1038
|
-
{ id:
|
|
1039
|
-
{ onError: (
|
|
926
|
+
var u;
|
|
927
|
+
ue(null), ce.mutate(
|
|
928
|
+
{ id: p, enabled: !((u = Y.data) != null && u.enabled) },
|
|
929
|
+
{ onError: (E) => ue(E instanceof M ? E.message : String(E)) }
|
|
1040
930
|
);
|
|
1041
931
|
}
|
|
1042
932
|
}
|
|
@@ -1044,29 +934,29 @@ function Xt({
|
|
|
1044
934
|
h && /* @__PURE__ */ n(
|
|
1045
935
|
pn,
|
|
1046
936
|
{
|
|
1047
|
-
loading:
|
|
1048
|
-
versions: (
|
|
1049
|
-
onSelect: (
|
|
1050
|
-
onClose: () =>
|
|
937
|
+
loading: Y.isLoading,
|
|
938
|
+
versions: (oe = Y.data) == null ? void 0 : oe.versions,
|
|
939
|
+
onSelect: (u) => he({ id: p, versionNumber: u }),
|
|
940
|
+
onClose: () => d(!1)
|
|
1051
941
|
}
|
|
1052
942
|
),
|
|
1053
|
-
se && se.id ===
|
|
943
|
+
se && se.id === p && /* @__PURE__ */ n(
|
|
1054
944
|
dn,
|
|
1055
945
|
{
|
|
1056
946
|
kind: "workflow",
|
|
1057
|
-
id:
|
|
947
|
+
id: p,
|
|
1058
948
|
onRestore: e.onRestoreVersion,
|
|
1059
949
|
versionNumber: se.versionNumber,
|
|
1060
|
-
onClose: () =>
|
|
950
|
+
onClose: () => he(null)
|
|
1061
951
|
}
|
|
1062
952
|
),
|
|
1063
|
-
|
|
953
|
+
L && /* @__PURE__ */ r(
|
|
1064
954
|
fn,
|
|
1065
955
|
{
|
|
1066
956
|
kind: "workflow",
|
|
1067
|
-
onClose: () =>
|
|
957
|
+
onClose: () => N(!1),
|
|
1068
958
|
onImport: () => {
|
|
1069
|
-
|
|
959
|
+
N(!1), K(!0);
|
|
1070
960
|
},
|
|
1071
961
|
children: [
|
|
1072
962
|
/* @__PURE__ */ n("p", { className: "muted small", children: "Export a portable definition — the same shape Import accepts." }),
|
|
@@ -1077,7 +967,7 @@ function Xt({
|
|
|
1077
967
|
className: "btn ghost",
|
|
1078
968
|
"data-testid": "rail-spec-export",
|
|
1079
969
|
onClick: () => {
|
|
1080
|
-
|
|
970
|
+
N(!1), g(!0);
|
|
1081
971
|
},
|
|
1082
972
|
children: "Export"
|
|
1083
973
|
}
|
|
@@ -1085,11 +975,11 @@ function Xt({
|
|
|
1085
975
|
]
|
|
1086
976
|
}
|
|
1087
977
|
),
|
|
1088
|
-
|
|
1089
|
-
/* @__PURE__ */ n("div", { className: "modal-body", children:
|
|
1090
|
-
|
|
978
|
+
O && /* @__PURE__ */ r(B, { title: "Export spec document", onClose: () => g(!1), wide: !0, children: [
|
|
979
|
+
/* @__PURE__ */ n("div", { className: "modal-body", children: W.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : W.isError ? /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-spec-error", children: W.error instanceof Error ? W.error.message : String(W.error) }) : W.data ? /* @__PURE__ */ n("div", { "data-testid": "rail-spec-json", children: /* @__PURE__ */ n(
|
|
980
|
+
pe,
|
|
1091
981
|
{
|
|
1092
|
-
code: JSON.stringify(
|
|
982
|
+
code: JSON.stringify(W.data, null, 2),
|
|
1093
983
|
language: "json",
|
|
1094
984
|
maxHeight: "420px",
|
|
1095
985
|
copyable: !0
|
|
@@ -1097,167 +987,175 @@ function Xt({
|
|
|
1097
987
|
) }) : null }),
|
|
1098
988
|
/* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () => g(!1), children: "Close" }) })
|
|
1099
989
|
] }),
|
|
1100
|
-
a &&
|
|
1101
|
-
|
|
990
|
+
a && C && /* @__PURE__ */ n(
|
|
991
|
+
Xe,
|
|
1102
992
|
{
|
|
1103
993
|
kind: "workflow",
|
|
1104
|
-
id:
|
|
994
|
+
id: p,
|
|
1105
995
|
initial: {
|
|
1106
|
-
displayName:
|
|
1107
|
-
key:
|
|
1108
|
-
tags:
|
|
996
|
+
displayName: X,
|
|
997
|
+
key: _,
|
|
998
|
+
tags: ae
|
|
1109
999
|
},
|
|
1110
|
-
onSave: async (
|
|
1111
|
-
if (
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1000
|
+
onSave: async (u) => {
|
|
1001
|
+
if (z) {
|
|
1002
|
+
await z({
|
|
1003
|
+
displayName: u.displayName,
|
|
1004
|
+
key: u.key,
|
|
1005
|
+
tags: u.tags
|
|
1006
|
+
});
|
|
1007
|
+
return;
|
|
1008
|
+
}
|
|
1009
|
+
if (!P.data) throw new Error("Unable to save settings");
|
|
1010
|
+
const E = P.data;
|
|
1011
|
+
return new Promise((v, A) => {
|
|
1012
|
+
const I = {
|
|
1013
|
+
...E.workflow,
|
|
1014
|
+
displayName: u.displayName
|
|
1117
1015
|
};
|
|
1118
|
-
|
|
1119
|
-
{ definition:
|
|
1120
|
-
{ onSuccess: () =>
|
|
1016
|
+
u.key !== void 0 && (I.key = u.key), u.tags !== void 0 && (I.tags = u.tags), y.mutate(
|
|
1017
|
+
{ definition: I, ifUnmodifiedSince: E.updatedAt },
|
|
1018
|
+
{ onSuccess: () => v(), onError: A }
|
|
1121
1019
|
);
|
|
1122
1020
|
});
|
|
1123
1021
|
},
|
|
1124
|
-
onClose: () =>
|
|
1022
|
+
onClose: () => l(!1)
|
|
1125
1023
|
},
|
|
1126
|
-
|
|
1024
|
+
p
|
|
1127
1025
|
),
|
|
1128
1026
|
/* @__PURE__ */ n(
|
|
1129
1027
|
gn,
|
|
1130
1028
|
{
|
|
1131
1029
|
kind: "workflow",
|
|
1132
|
-
archived:
|
|
1133
|
-
pending:
|
|
1134
|
-
deleteConfirming:
|
|
1030
|
+
archived: re,
|
|
1031
|
+
pending: T.isPending || j.isPending,
|
|
1032
|
+
deleteConfirming: S,
|
|
1135
1033
|
archiveConfirming: U,
|
|
1136
|
-
deleteError:
|
|
1137
|
-
archiveError:
|
|
1138
|
-
onRequestDelete: () =>
|
|
1139
|
-
onRequestArchive: () =>
|
|
1140
|
-
onConfirmDelete:
|
|
1034
|
+
deleteError: Q,
|
|
1035
|
+
archiveError: G,
|
|
1036
|
+
onRequestDelete: () => F(!0),
|
|
1037
|
+
onRequestArchive: () => V(!0),
|
|
1038
|
+
onConfirmDelete: we,
|
|
1141
1039
|
onConfirmArchive: fe,
|
|
1142
|
-
onCloseDelete: () =>
|
|
1143
|
-
onCloseArchive: () =>
|
|
1040
|
+
onCloseDelete: () => F(!1),
|
|
1041
|
+
onCloseArchive: () => V(!1)
|
|
1144
1042
|
}
|
|
1145
1043
|
),
|
|
1146
|
-
|
|
1147
|
-
|
|
1044
|
+
H && /* @__PURE__ */ n(
|
|
1045
|
+
xe,
|
|
1148
1046
|
{
|
|
1149
1047
|
kind: "workflow",
|
|
1150
|
-
project:
|
|
1048
|
+
project: i ?? void 0,
|
|
1151
1049
|
listKeys: vn,
|
|
1152
|
-
onOpenImported: (
|
|
1153
|
-
onClose: () =>
|
|
1050
|
+
onOpenImported: (u, E) => s({ type: "imported", kind: u, id: E }),
|
|
1051
|
+
onClose: () => K(!1)
|
|
1154
1052
|
}
|
|
1155
1053
|
)
|
|
1156
1054
|
] });
|
|
1157
1055
|
}
|
|
1158
|
-
function
|
|
1159
|
-
const { project:
|
|
1160
|
-
editingSettings:
|
|
1056
|
+
function Ut({ ctx: e }) {
|
|
1057
|
+
const { project: i, onNavigate: s } = on(), [t, a] = f(!1), [l, o] = f(!1), [c, h] = f(!1), d = {
|
|
1058
|
+
editingSettings: t,
|
|
1161
1059
|
setEditingSettings: a,
|
|
1162
|
-
historyOpen:
|
|
1163
|
-
setHistoryOpen:
|
|
1164
|
-
versionListOpen:
|
|
1060
|
+
historyOpen: l,
|
|
1061
|
+
setHistoryOpen: o,
|
|
1062
|
+
versionListOpen: c,
|
|
1165
1063
|
setVersionListOpen: h
|
|
1166
1064
|
};
|
|
1167
|
-
return (e == null ? void 0 : e.kind) === "workflow" ? /* @__PURE__ */ n(
|
|
1065
|
+
return (e == null ? void 0 : e.kind) === "workflow" ? /* @__PURE__ */ n(Kt, { ctx: e, project: i, onNavigate: s, open: d }) : /* @__PURE__ */ n(zt, { ctx: e, project: i, onNavigate: s, open: d });
|
|
1168
1066
|
}
|
|
1169
|
-
function
|
|
1067
|
+
function zt({
|
|
1170
1068
|
ctx: e,
|
|
1171
|
-
project:
|
|
1172
|
-
onNavigate:
|
|
1173
|
-
open:
|
|
1069
|
+
project: i,
|
|
1070
|
+
onNavigate: s,
|
|
1071
|
+
open: t
|
|
1174
1072
|
}) {
|
|
1175
|
-
var Pe, Ie
|
|
1073
|
+
var Ae, Pe, Ie;
|
|
1176
1074
|
const {
|
|
1177
1075
|
editingSettings: a,
|
|
1178
|
-
setEditingSettings:
|
|
1179
|
-
historyOpen:
|
|
1180
|
-
setHistoryOpen:
|
|
1076
|
+
setEditingSettings: l,
|
|
1077
|
+
historyOpen: o,
|
|
1078
|
+
setHistoryOpen: c,
|
|
1181
1079
|
versionListOpen: h,
|
|
1182
|
-
setVersionListOpen:
|
|
1183
|
-
} =
|
|
1080
|
+
setVersionListOpen: d
|
|
1081
|
+
} = t, b = e == null ? void 0 : e.kind, w = pt(b === "endpoint"), p = Ze(b === "function"), [P, y] = f(!1), [T, j] = f(""), [D, L] = f(null), [N, H] = f(null), [K, O] = f(!1), [g, S] = f(!1), [F, U] = f(!1), [V, Q] = f(!1), [le, G] = f(!1), [de, W] = f(null), [Y, te] = f(null), ce = ze((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "function"), ke = _e((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "endpoint"), Z = Ge(), ie = Ye(), ue = gt(), se = vt(), he = bt(), C = kt(), z = e ? Qe(e.kind) : null, $ = Je(z, (e == null ? void 0 : e.id) ?? "", g), X = e && Me(e.kind) ? e.kind : null, _ = en(X, (e == null ? void 0 : e.id) ?? "", o), ae = nn(X ?? "function"), re = tn(X ?? "function"), [we, fe] = f(null), [me, oe] = f(null), [u, E] = f(
|
|
1184
1082
|
null
|
|
1185
1083
|
);
|
|
1186
1084
|
if (!e || e.kind !== "function" && e.kind !== "endpoint")
|
|
1187
1085
|
return /* @__PURE__ */ n("p", { className: "muted small", children: "Open a workflow, function, or endpoint to see its settings." });
|
|
1188
|
-
const
|
|
1189
|
-
function yn() {
|
|
1190
|
-
M(null), O(bn), R((J == null ? void 0 : J.updatedAt) ?? null), k(!0);
|
|
1191
|
-
}
|
|
1192
|
-
const ee = x ? En(D, { id: String(x.id), key: String(x.key) }) : { parsed: null, blockedReason: "No definition loaded yet." }, Ae = S === "function" ? G.isPending : ie.isPending;
|
|
1086
|
+
const v = e.kind, A = e.id, I = v === "function" ? (Ae = p.data) == null ? void 0 : Ae.find((m) => m.id === A) : (Pe = w.data) == null ? void 0 : Pe.find((m) => m.id === A), q = Ue(v, v === "function" ? ce.data : ke.data), x = (q == null ? void 0 : q.definition) ?? null, Ce = I && typeof I.displayName == "string" ? I.displayName : "", bn = x ? JSON.stringify(x, null, 2) : "";
|
|
1193
1087
|
function kn() {
|
|
1088
|
+
L(null), j(bn), H((q == null ? void 0 : q.updatedAt) ?? null), y(!0);
|
|
1089
|
+
}
|
|
1090
|
+
const ee = x ? En(T, { id: String(x.id), key: String(x.key) }) : { parsed: null, blockedReason: "No definition loaded yet." }, Ee = v === "function" ? Z.isPending : ie.isPending;
|
|
1091
|
+
function wn() {
|
|
1194
1092
|
if (!ee.parsed || ee.blockedReason) return;
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1197
|
-
onSuccess: () =>
|
|
1198
|
-
onError: (ne) =>
|
|
1199
|
-
},
|
|
1200
|
-
|
|
1093
|
+
L(null);
|
|
1094
|
+
const m = {
|
|
1095
|
+
onSuccess: () => y(!1),
|
|
1096
|
+
onError: (ne) => L(ne instanceof M ? ne.message : String(ne))
|
|
1097
|
+
}, k = { definition: ee.parsed, ifUnmodifiedSince: N };
|
|
1098
|
+
v === "function" ? Z.mutate(k, m) : ie.mutate(k, m);
|
|
1201
1099
|
}
|
|
1202
|
-
const
|
|
1100
|
+
const yn = (I == null ? void 0 : I.archivedAt) != null;
|
|
1203
1101
|
function Nn() {
|
|
1204
|
-
|
|
1205
|
-
const
|
|
1102
|
+
W(null);
|
|
1103
|
+
const m = {
|
|
1206
1104
|
onSuccess: () => {
|
|
1207
|
-
|
|
1105
|
+
Q(!1), s({ type: "list" });
|
|
1208
1106
|
},
|
|
1209
|
-
onError: (
|
|
1210
|
-
|
|
1107
|
+
onError: (k) => {
|
|
1108
|
+
Q(!1), W(k instanceof M ? k.message : String(k));
|
|
1211
1109
|
}
|
|
1212
1110
|
};
|
|
1213
|
-
|
|
1111
|
+
v === "function" ? ue.mutate(A, m) : se.mutate(A, m);
|
|
1214
1112
|
}
|
|
1215
1113
|
function Sn() {
|
|
1216
1114
|
te(null);
|
|
1217
|
-
const
|
|
1115
|
+
const m = {
|
|
1218
1116
|
onSuccess: () => {
|
|
1219
|
-
|
|
1117
|
+
G(!1), s({ type: "list" });
|
|
1220
1118
|
},
|
|
1221
|
-
onError: (
|
|
1222
|
-
|
|
1119
|
+
onError: (k) => {
|
|
1120
|
+
G(!1), te(k instanceof M ? k.message : String(k));
|
|
1223
1121
|
}
|
|
1224
1122
|
};
|
|
1225
|
-
|
|
1123
|
+
v === "function" ? he.mutate(A, m) : C.mutate(A, m);
|
|
1226
1124
|
}
|
|
1227
1125
|
return /* @__PURE__ */ r("div", { className: "rail-settings-panel", children: [
|
|
1228
|
-
/* @__PURE__ */ n(cn, { onEdit: () =>
|
|
1126
|
+
/* @__PURE__ */ n(cn, { onEdit: () => l(!0) }),
|
|
1229
1127
|
/* @__PURE__ */ n(
|
|
1230
1128
|
un,
|
|
1231
1129
|
{
|
|
1232
|
-
id:
|
|
1233
|
-
displayName:
|
|
1234
|
-
fields:
|
|
1235
|
-
row:
|
|
1130
|
+
id: A,
|
|
1131
|
+
displayName: Ce,
|
|
1132
|
+
fields: We(v),
|
|
1133
|
+
row: I
|
|
1236
1134
|
}
|
|
1237
1135
|
),
|
|
1238
|
-
|
|
1239
|
-
|
|
1136
|
+
Re(v) && /* @__PURE__ */ n(hn, { onOpen: () => O(!0) }),
|
|
1137
|
+
Me(v) && /* @__PURE__ */ n(
|
|
1240
1138
|
mn,
|
|
1241
1139
|
{
|
|
1242
|
-
open:
|
|
1243
|
-
versions:
|
|
1244
|
-
publishing:
|
|
1245
|
-
togglingEnabled:
|
|
1246
|
-
publishError:
|
|
1247
|
-
enableError:
|
|
1140
|
+
open: o,
|
|
1141
|
+
versions: _.data,
|
|
1142
|
+
publishing: ae.isPending,
|
|
1143
|
+
togglingEnabled: re.isPending,
|
|
1144
|
+
publishError: we,
|
|
1145
|
+
enableError: me,
|
|
1248
1146
|
onShow: () => {
|
|
1249
|
-
|
|
1147
|
+
c(!0), d(!0);
|
|
1250
1148
|
},
|
|
1251
1149
|
onPublish: () => {
|
|
1252
|
-
|
|
1253
|
-
onError: (
|
|
1150
|
+
fe(null), ae.mutate(A, {
|
|
1151
|
+
onError: (m) => fe(m instanceof M ? m.message : String(m))
|
|
1254
1152
|
});
|
|
1255
1153
|
},
|
|
1256
1154
|
onToggleEnabled: () => {
|
|
1257
|
-
var
|
|
1258
|
-
|
|
1259
|
-
{ id:
|
|
1260
|
-
{ onError: (
|
|
1155
|
+
var m;
|
|
1156
|
+
oe(null), re.mutate(
|
|
1157
|
+
{ id: A, enabled: !((m = _.data) != null && m.enabled) },
|
|
1158
|
+
{ onError: (k) => oe(k instanceof M ? k.message : String(k)) }
|
|
1261
1159
|
);
|
|
1262
1160
|
}
|
|
1263
1161
|
}
|
|
@@ -1265,30 +1163,30 @@ function ei({
|
|
|
1265
1163
|
h && /* @__PURE__ */ n(
|
|
1266
1164
|
pn,
|
|
1267
1165
|
{
|
|
1268
|
-
loading:
|
|
1269
|
-
versions: (
|
|
1270
|
-
onSelect: (
|
|
1271
|
-
onClose: () =>
|
|
1166
|
+
loading: _.isLoading,
|
|
1167
|
+
versions: (Ie = _.data) == null ? void 0 : Ie.versions,
|
|
1168
|
+
onSelect: (m) => E({ id: A, versionNumber: m }),
|
|
1169
|
+
onClose: () => d(!1)
|
|
1272
1170
|
}
|
|
1273
1171
|
),
|
|
1274
|
-
|
|
1172
|
+
u && u.id === A && /* @__PURE__ */ n(
|
|
1275
1173
|
dn,
|
|
1276
1174
|
{
|
|
1277
|
-
kind:
|
|
1278
|
-
id:
|
|
1279
|
-
versionNumber:
|
|
1280
|
-
onClose: () =>
|
|
1175
|
+
kind: v,
|
|
1176
|
+
id: A,
|
|
1177
|
+
versionNumber: u.versionNumber,
|
|
1178
|
+
onClose: () => E(null)
|
|
1281
1179
|
}
|
|
1282
1180
|
),
|
|
1283
|
-
|
|
1181
|
+
K && /* @__PURE__ */ n(
|
|
1284
1182
|
fn,
|
|
1285
1183
|
{
|
|
1286
|
-
kind:
|
|
1287
|
-
onClose: () =>
|
|
1184
|
+
kind: v,
|
|
1185
|
+
onClose: () => O(!1),
|
|
1288
1186
|
onImport: () => {
|
|
1289
|
-
|
|
1187
|
+
O(!1), U(!0);
|
|
1290
1188
|
},
|
|
1291
|
-
children:
|
|
1189
|
+
children: Re(v) && /* @__PURE__ */ r(R, { children: [
|
|
1292
1190
|
/* @__PURE__ */ n("p", { className: "muted small", children: "Export a portable definition — the same shape Import accepts — or Edit JSON to change what's stored directly." }),
|
|
1293
1191
|
/* @__PURE__ */ r("div", { className: "rail-spec-menu-row", children: [
|
|
1294
1192
|
/* @__PURE__ */ n(
|
|
@@ -1298,7 +1196,7 @@ function ei({
|
|
|
1298
1196
|
className: "btn ghost",
|
|
1299
1197
|
"data-testid": "rail-spec-export",
|
|
1300
1198
|
onClick: () => {
|
|
1301
|
-
|
|
1199
|
+
O(!1), S(!0);
|
|
1302
1200
|
},
|
|
1303
1201
|
children: "Export"
|
|
1304
1202
|
}
|
|
@@ -1312,7 +1210,7 @@ function ei({
|
|
|
1312
1210
|
disabled: !x,
|
|
1313
1211
|
"data-testid": "rail-json-edit",
|
|
1314
1212
|
onClick: () => {
|
|
1315
|
-
|
|
1213
|
+
O(!1), kn();
|
|
1316
1214
|
},
|
|
1317
1215
|
children: "Edit JSON"
|
|
1318
1216
|
}
|
|
@@ -1321,128 +1219,128 @@ function ei({
|
|
|
1321
1219
|
] })
|
|
1322
1220
|
}
|
|
1323
1221
|
),
|
|
1324
|
-
g && /* @__PURE__ */ r(B, { title: "Export spec document", onClose: () =>
|
|
1325
|
-
/* @__PURE__ */ n("div", { className: "modal-body", children:
|
|
1326
|
-
|
|
1222
|
+
g && /* @__PURE__ */ r(B, { title: "Export spec document", onClose: () => S(!1), wide: !0, children: [
|
|
1223
|
+
/* @__PURE__ */ n("div", { className: "modal-body", children: $.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : $.isError ? /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-spec-error", children: $.error instanceof Error ? $.error.message : String($.error) }) : $.data ? /* @__PURE__ */ n("div", { "data-testid": "rail-spec-json", children: /* @__PURE__ */ n(
|
|
1224
|
+
pe,
|
|
1327
1225
|
{
|
|
1328
|
-
code: JSON.stringify(
|
|
1226
|
+
code: JSON.stringify($.data, null, 2),
|
|
1329
1227
|
language: "json",
|
|
1330
1228
|
maxHeight: "420px",
|
|
1331
1229
|
copyable: !0
|
|
1332
1230
|
}
|
|
1333
1231
|
) }) : null }),
|
|
1334
|
-
/* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () =>
|
|
1232
|
+
/* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () => S(!1), children: "Close" }) })
|
|
1335
1233
|
] }),
|
|
1336
|
-
|
|
1234
|
+
P && /* @__PURE__ */ r(B, { title: "Edit definition", onClose: () => y(!1), wide: !0, children: [
|
|
1337
1235
|
/* @__PURE__ */ r("div", { className: "modal-body", children: [
|
|
1338
1236
|
/* @__PURE__ */ n(
|
|
1339
|
-
|
|
1237
|
+
On,
|
|
1340
1238
|
{
|
|
1341
|
-
value:
|
|
1342
|
-
onChange:
|
|
1239
|
+
value: T,
|
|
1240
|
+
onChange: j,
|
|
1343
1241
|
minHeight: "320px",
|
|
1344
1242
|
"aria-label": "Edit definition JSON"
|
|
1345
1243
|
}
|
|
1346
1244
|
),
|
|
1347
1245
|
ee.blockedReason && /* @__PURE__ */ n("p", { className: "muted small", "data-testid": "rail-edit-reason", children: ee.blockedReason }),
|
|
1348
|
-
|
|
1246
|
+
D && /* @__PURE__ */ n("div", { className: "error", children: D })
|
|
1349
1247
|
] }),
|
|
1350
1248
|
/* @__PURE__ */ r("div", { className: "modal-actions", children: [
|
|
1351
|
-
/* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () =>
|
|
1249
|
+
/* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () => y(!1), children: "Cancel" }),
|
|
1352
1250
|
/* @__PURE__ */ n(
|
|
1353
1251
|
"button",
|
|
1354
1252
|
{
|
|
1355
1253
|
type: "button",
|
|
1356
1254
|
className: "btn",
|
|
1357
|
-
disabled: ee.blockedReason !== null ||
|
|
1255
|
+
disabled: ee.blockedReason !== null || Ee,
|
|
1358
1256
|
"data-testid": "rail-json-save",
|
|
1359
|
-
onClick:
|
|
1360
|
-
children:
|
|
1257
|
+
onClick: wn,
|
|
1258
|
+
children: Ee ? "Saving…" : "Save"
|
|
1361
1259
|
}
|
|
1362
1260
|
)
|
|
1363
1261
|
] })
|
|
1364
1262
|
] }),
|
|
1365
|
-
a &&
|
|
1366
|
-
|
|
1263
|
+
a && I && /* @__PURE__ */ n(
|
|
1264
|
+
Xe,
|
|
1367
1265
|
{
|
|
1368
|
-
kind:
|
|
1369
|
-
id:
|
|
1266
|
+
kind: v,
|
|
1267
|
+
id: A,
|
|
1370
1268
|
initial: {
|
|
1371
|
-
displayName:
|
|
1372
|
-
key:
|
|
1373
|
-
tags:
|
|
1269
|
+
displayName: Ce,
|
|
1270
|
+
key: I.key ?? null,
|
|
1271
|
+
tags: I.tags ?? []
|
|
1374
1272
|
},
|
|
1375
|
-
onSave: async (
|
|
1376
|
-
if (!
|
|
1377
|
-
const
|
|
1273
|
+
onSave: async (m) => {
|
|
1274
|
+
if (!q) throw new Error("Unable to save settings");
|
|
1275
|
+
const k = q.definition, ne = I.tags ?? [], De = m.tags !== void 0 && (m.tags.length !== ne.length || m.tags.some((ye, Ne) => ye !== ne[Ne])) ? { tags: m.tags } : {}, Te = { definition: v === "function" ? (
|
|
1378
1276
|
// `canEditKey: true` for function (`callable-descriptors.ts`): `data.key` must
|
|
1379
1277
|
// reach the server (the modal falls back to `initial.key` when unchanged).
|
|
1380
|
-
{ ...
|
|
1381
|
-
) : { ...
|
|
1382
|
-
return new Promise((
|
|
1383
|
-
const
|
|
1384
|
-
|
|
1278
|
+
{ ...k, displayName: m.displayName, key: m.key ?? k.key, ...De }
|
|
1279
|
+
) : { ...k, displayName: m.displayName, ...De }, ifUnmodifiedSince: q.updatedAt };
|
|
1280
|
+
return new Promise((ye, Ne) => {
|
|
1281
|
+
const Oe = { onSuccess: () => ye(), onError: Ne };
|
|
1282
|
+
v === "function" ? Z.mutate(Te, Oe) : ie.mutate(Te, Oe);
|
|
1385
1283
|
});
|
|
1386
1284
|
},
|
|
1387
|
-
onClose: () =>
|
|
1285
|
+
onClose: () => l(!1)
|
|
1388
1286
|
},
|
|
1389
|
-
|
|
1287
|
+
A
|
|
1390
1288
|
),
|
|
1391
|
-
An(
|
|
1289
|
+
An(v) && /* @__PURE__ */ n(
|
|
1392
1290
|
gn,
|
|
1393
1291
|
{
|
|
1394
|
-
kind:
|
|
1395
|
-
archived:
|
|
1396
|
-
deleteConfirming:
|
|
1397
|
-
archiveConfirming:
|
|
1398
|
-
deleteError:
|
|
1399
|
-
archiveError:
|
|
1400
|
-
onRequestDelete: () =>
|
|
1401
|
-
onRequestArchive: () =>
|
|
1292
|
+
kind: v,
|
|
1293
|
+
archived: yn,
|
|
1294
|
+
deleteConfirming: V,
|
|
1295
|
+
archiveConfirming: le,
|
|
1296
|
+
deleteError: de,
|
|
1297
|
+
archiveError: Y,
|
|
1298
|
+
onRequestDelete: () => Q(!0),
|
|
1299
|
+
onRequestArchive: () => G(!0),
|
|
1402
1300
|
onConfirmDelete: Nn,
|
|
1403
1301
|
onConfirmArchive: Sn,
|
|
1404
|
-
onCloseDelete: () =>
|
|
1405
|
-
onCloseArchive: () =>
|
|
1302
|
+
onCloseDelete: () => Q(!1),
|
|
1303
|
+
onCloseArchive: () => G(!1)
|
|
1406
1304
|
}
|
|
1407
1305
|
),
|
|
1408
|
-
|
|
1409
|
-
|
|
1306
|
+
F && /* @__PURE__ */ n(
|
|
1307
|
+
xe,
|
|
1410
1308
|
{
|
|
1411
|
-
kind:
|
|
1412
|
-
project:
|
|
1309
|
+
kind: v,
|
|
1310
|
+
project: i ?? void 0,
|
|
1413
1311
|
listKeys: vn,
|
|
1414
|
-
onOpenImported: (
|
|
1312
|
+
onOpenImported: (m, k) => s({ type: "imported", kind: m, id: k }),
|
|
1415
1313
|
onClose: () => U(!1)
|
|
1416
1314
|
}
|
|
1417
1315
|
)
|
|
1418
1316
|
] });
|
|
1419
1317
|
}
|
|
1420
|
-
function
|
|
1421
|
-
return /* @__PURE__ */ n(
|
|
1318
|
+
function _t() {
|
|
1319
|
+
return /* @__PURE__ */ n(J, { name: "settings" });
|
|
1422
1320
|
}
|
|
1423
|
-
const
|
|
1321
|
+
const Gt = {
|
|
1424
1322
|
id: "settings",
|
|
1425
1323
|
title: "Settings",
|
|
1426
1324
|
rendersHeading: !0,
|
|
1427
|
-
Icon:
|
|
1325
|
+
Icon: _t,
|
|
1428
1326
|
isAvailable: (e) => (e == null ? void 0 : e.kind) === "workflow" || (e == null ? void 0 : e.kind) === "function" || (e == null ? void 0 : e.kind) === "endpoint",
|
|
1429
|
-
Panel:
|
|
1430
|
-
},
|
|
1431
|
-
function
|
|
1327
|
+
Panel: Ut
|
|
1328
|
+
}, Yt = ["string", "number", "boolean", "object", "array"];
|
|
1329
|
+
function Zt({
|
|
1432
1330
|
variables: e,
|
|
1433
|
-
onVariablesChange:
|
|
1331
|
+
onVariablesChange: i
|
|
1434
1332
|
}) {
|
|
1435
|
-
const
|
|
1436
|
-
function
|
|
1437
|
-
|
|
1333
|
+
const s = Mn().vars ?? [];
|
|
1334
|
+
function t() {
|
|
1335
|
+
i([...e, { key: "" }]);
|
|
1438
1336
|
}
|
|
1439
|
-
function a(
|
|
1440
|
-
|
|
1337
|
+
function a(c, h) {
|
|
1338
|
+
i(e.map((d, b) => b === c ? { ...d, ...h } : d));
|
|
1441
1339
|
}
|
|
1442
|
-
function
|
|
1443
|
-
|
|
1340
|
+
function l(c) {
|
|
1341
|
+
i(e.filter((h, d) => d !== c));
|
|
1444
1342
|
}
|
|
1445
|
-
const
|
|
1343
|
+
const o = $n(e);
|
|
1446
1344
|
return /* @__PURE__ */ r("div", { className: "workflow-variable-fields", children: [
|
|
1447
1345
|
/* @__PURE__ */ r("p", { className: "muted small", children: [
|
|
1448
1346
|
"Declaring variables here defines this workflow's ",
|
|
@@ -1451,7 +1349,7 @@ function si({
|
|
|
1451
1349
|
] }),
|
|
1452
1350
|
/* @__PURE__ */ r("div", { className: "row", style: { justifyContent: "space-between", alignItems: "center" }, children: [
|
|
1453
1351
|
/* @__PURE__ */ n("span", { className: "muted small", children: e.length === 0 ? "No variables declared." : `${e.length} variable${e.length === 1 ? "" : "s"} declared.` }),
|
|
1454
|
-
/* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick:
|
|
1352
|
+
/* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: t, children: "+ Add variable" })
|
|
1455
1353
|
] }),
|
|
1456
1354
|
e.length > 0 && /* @__PURE__ */ r("div", { className: "workflow-variable-head", "aria-hidden": "true", children: [
|
|
1457
1355
|
/* @__PURE__ */ n("span", { children: "Key" }),
|
|
@@ -1460,7 +1358,7 @@ function si({
|
|
|
1460
1358
|
/* @__PURE__ */ n("span", { children: "Required" }),
|
|
1461
1359
|
/* @__PURE__ */ n("span", {})
|
|
1462
1360
|
] }),
|
|
1463
|
-
e.length > 0 && /* @__PURE__ */ n("ul", { className: "workflow-variable-list", "data-testid": "workflow-variables-list", children: e.map((
|
|
1361
|
+
e.length > 0 && /* @__PURE__ */ n("ul", { className: "workflow-variable-list", "data-testid": "workflow-variables-list", children: e.map((c, h) => (
|
|
1464
1362
|
// biome-ignore lint/suspicious/noArrayIndexKey: rows are positional and reorderable
|
|
1465
1363
|
/* @__PURE__ */ r("li", { children: [
|
|
1466
1364
|
/* @__PURE__ */ r("div", { className: "workflow-variable-row", children: [
|
|
@@ -1469,36 +1367,36 @@ function si({
|
|
|
1469
1367
|
{
|
|
1470
1368
|
type: "text",
|
|
1471
1369
|
className: "workflow-variable-key",
|
|
1472
|
-
value:
|
|
1370
|
+
value: c.key,
|
|
1473
1371
|
placeholder: "key",
|
|
1474
1372
|
"aria-label": "Variable key",
|
|
1475
1373
|
spellCheck: !1,
|
|
1476
|
-
onChange: (
|
|
1374
|
+
onChange: (d) => a(h, { key: d.target.value })
|
|
1477
1375
|
}
|
|
1478
1376
|
),
|
|
1479
1377
|
/* @__PURE__ */ r(
|
|
1480
1378
|
"select",
|
|
1481
1379
|
{
|
|
1482
|
-
value:
|
|
1380
|
+
value: c.type ?? "",
|
|
1483
1381
|
"aria-label": "Variable type",
|
|
1484
|
-
onChange: (
|
|
1485
|
-
type:
|
|
1382
|
+
onChange: (d) => a(h, {
|
|
1383
|
+
type: d.target.value || void 0
|
|
1486
1384
|
}),
|
|
1487
1385
|
children: [
|
|
1488
1386
|
/* @__PURE__ */ n("option", { value: "", children: "(any)" }),
|
|
1489
|
-
|
|
1387
|
+
Yt.map((d) => /* @__PURE__ */ n("option", { value: d, children: d }, d))
|
|
1490
1388
|
]
|
|
1491
1389
|
}
|
|
1492
1390
|
),
|
|
1493
1391
|
/* @__PURE__ */ n(
|
|
1494
|
-
|
|
1392
|
+
qe,
|
|
1495
1393
|
{
|
|
1496
|
-
value: { vars: Hn(e, h,
|
|
1394
|
+
value: { vars: Hn(e, h, s) },
|
|
1497
1395
|
children: /* @__PURE__ */ n(
|
|
1498
|
-
|
|
1396
|
+
Rn,
|
|
1499
1397
|
{
|
|
1500
|
-
value:
|
|
1501
|
-
onChange: (
|
|
1398
|
+
value: c.default,
|
|
1399
|
+
onChange: (d) => a(h, { default: d }),
|
|
1502
1400
|
placeholder: "no default",
|
|
1503
1401
|
"aria-label": "Variable default"
|
|
1504
1402
|
},
|
|
@@ -1511,110 +1409,110 @@ function si({
|
|
|
1511
1409
|
{
|
|
1512
1410
|
type: "checkbox",
|
|
1513
1411
|
className: "workflow-variable-required",
|
|
1514
|
-
checked:
|
|
1515
|
-
"aria-label": `${
|
|
1516
|
-
onChange: (
|
|
1412
|
+
checked: c.required ?? !1,
|
|
1413
|
+
"aria-label": `${c.key || "Variable"} is required`,
|
|
1414
|
+
onChange: (d) => a(h, { required: d.target.checked })
|
|
1517
1415
|
}
|
|
1518
1416
|
),
|
|
1519
1417
|
/* @__PURE__ */ n(
|
|
1520
|
-
|
|
1418
|
+
Be,
|
|
1521
1419
|
{
|
|
1522
1420
|
danger: !0,
|
|
1523
1421
|
icon: "close",
|
|
1524
|
-
label: `Remove variable ${
|
|
1525
|
-
onClick: () =>
|
|
1422
|
+
label: `Remove variable ${c.key || h + 1}`,
|
|
1423
|
+
onClick: () => l(h)
|
|
1526
1424
|
}
|
|
1527
1425
|
)
|
|
1528
1426
|
] }),
|
|
1529
|
-
|
|
1427
|
+
o.includes(h) && /* @__PURE__ */ n("span", { className: "muted small", "data-testid": "variable-duplicate", children: "Duplicate key — a later row with the same name wins." })
|
|
1530
1428
|
] }, h)
|
|
1531
1429
|
)) })
|
|
1532
1430
|
] });
|
|
1533
1431
|
}
|
|
1534
|
-
function
|
|
1432
|
+
function Xt({
|
|
1535
1433
|
variables: e,
|
|
1536
|
-
onVariablesChange:
|
|
1537
|
-
onClose:
|
|
1434
|
+
onVariablesChange: i,
|
|
1435
|
+
onClose: s
|
|
1538
1436
|
}) {
|
|
1539
|
-
return /* @__PURE__ */ r(B, { title: "Workflow inputs", onClose:
|
|
1540
|
-
/* @__PURE__ */ n("div", { className: "modal-body", "data-testid": "workflow-inputs-modal", children: /* @__PURE__ */ n(
|
|
1541
|
-
/* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn", onClick:
|
|
1437
|
+
return /* @__PURE__ */ r(B, { title: "Workflow inputs", onClose: s, wide: !0, children: [
|
|
1438
|
+
/* @__PURE__ */ n("div", { className: "modal-body", "data-testid": "workflow-inputs-modal", children: /* @__PURE__ */ n(Zt, { variables: e, onVariablesChange: i }) }),
|
|
1439
|
+
/* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn", onClick: s, children: "Done" }) })
|
|
1542
1440
|
] });
|
|
1543
1441
|
}
|
|
1544
|
-
function
|
|
1442
|
+
function Se(e) {
|
|
1545
1443
|
return e !== null && typeof e == "object" && !Array.isArray(e);
|
|
1546
1444
|
}
|
|
1547
|
-
function
|
|
1548
|
-
if (
|
|
1549
|
-
if (
|
|
1445
|
+
function xt(e, i) {
|
|
1446
|
+
if (Se(e)) return e;
|
|
1447
|
+
if (i && i.length > 0) return Ct(i);
|
|
1550
1448
|
}
|
|
1551
|
-
function
|
|
1552
|
-
const
|
|
1553
|
-
for (const
|
|
1554
|
-
if (
|
|
1555
|
-
const a =
|
|
1556
|
-
if (
|
|
1557
|
-
if (
|
|
1449
|
+
function ei(e) {
|
|
1450
|
+
const i = /* @__PURE__ */ new Map(), s = [...e].sort((t, a) => t.seq - a.seq);
|
|
1451
|
+
for (const t of s) {
|
|
1452
|
+
if (t.warning !== void 0 || !Array.isArray(t.path)) continue;
|
|
1453
|
+
const a = t.nodeId ?? null, l = t.new !== void 0 && t.new !== null;
|
|
1454
|
+
if (t.path.length === 0) {
|
|
1455
|
+
if (i.clear(), l && Se(t.new)) for (const c of Object.keys(t.new)) i.set(c, a);
|
|
1558
1456
|
continue;
|
|
1559
1457
|
}
|
|
1560
|
-
const
|
|
1561
|
-
|
|
1458
|
+
const o = t.path[0];
|
|
1459
|
+
t.path.length === 1 && !l ? i.delete(o) : i.set(o, a);
|
|
1562
1460
|
}
|
|
1563
|
-
return
|
|
1461
|
+
return i;
|
|
1564
1462
|
}
|
|
1565
|
-
const
|
|
1566
|
-
function
|
|
1567
|
-
const
|
|
1568
|
-
if (
|
|
1569
|
-
for (const [
|
|
1463
|
+
const ni = /\{\{[\s\S]*?\}\}/;
|
|
1464
|
+
function ti(e) {
|
|
1465
|
+
const i = [], s = (t, a) => {
|
|
1466
|
+
if (Se(t) && Object.keys(t).length > 0) {
|
|
1467
|
+
for (const [l, o] of Object.entries(t)) s(o, a ? `${a}.${l}` : l);
|
|
1570
1468
|
return;
|
|
1571
1469
|
}
|
|
1572
|
-
if (typeof
|
|
1573
|
-
|
|
1470
|
+
if (typeof t == "string" && ni.test(t)) {
|
|
1471
|
+
i.push({ path: a, kind: "reference", text: t });
|
|
1574
1472
|
return;
|
|
1575
1473
|
}
|
|
1576
|
-
|
|
1474
|
+
i.push({ path: a, kind: "literal", text: JSON.stringify(t) ?? String(t) });
|
|
1577
1475
|
};
|
|
1578
|
-
if (e) for (const [
|
|
1579
|
-
return
|
|
1476
|
+
if (e) for (const [t, a] of Object.entries(e)) s(a, t);
|
|
1477
|
+
return i;
|
|
1580
1478
|
}
|
|
1581
|
-
function
|
|
1479
|
+
function ii(e) {
|
|
1582
1480
|
if (e == null || e === "") return null;
|
|
1583
1481
|
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
|
|
1584
1482
|
return String(e);
|
|
1585
1483
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
1586
|
-
const
|
|
1587
|
-
if (
|
|
1588
|
-
if (
|
|
1589
|
-
const
|
|
1590
|
-
return
|
|
1484
|
+
const i = e;
|
|
1485
|
+
if (i.type === "secret") return "•••";
|
|
1486
|
+
if (i.type === "expr" && Array.isArray(i.parts)) {
|
|
1487
|
+
const s = i.parts.map((t) => t.kind === "text" ? t.value ?? "" : t.kind === "secret" ? "•••" : (t.kind === "var" || t.kind === "render") && t.ref ? `{{${t.ref}}}` : "{{…}}").join("");
|
|
1488
|
+
return s === "" ? null : s;
|
|
1591
1489
|
}
|
|
1592
1490
|
}
|
|
1593
1491
|
return JSON.stringify(e);
|
|
1594
1492
|
}
|
|
1595
|
-
function
|
|
1493
|
+
function si(e) {
|
|
1596
1494
|
return (e == null ? void 0 : e.kind) === "workflow" ? e.onOpenStartingState : void 0;
|
|
1597
1495
|
}
|
|
1598
|
-
function
|
|
1599
|
-
return /* @__PURE__ */ n(
|
|
1496
|
+
function ai() {
|
|
1497
|
+
return /* @__PURE__ */ n(J, { name: "database" });
|
|
1600
1498
|
}
|
|
1601
|
-
function
|
|
1602
|
-
var
|
|
1603
|
-
const
|
|
1604
|
-
if (
|
|
1605
|
-
!
|
|
1606
|
-
}, [
|
|
1607
|
-
if (!
|
|
1499
|
+
function ri({ ctx: e }) {
|
|
1500
|
+
var y, T, j, D, L;
|
|
1501
|
+
const i = St(), s = et(e.id), t = (y = s.data) == null ? void 0 : y[0], a = nt((t == null ? void 0 : t.runId) ?? null), l = ((T = a.data) == null ? void 0 : T.status) ?? (t == null ? void 0 : t.status), o = tt((t == null ? void 0 : t.runId) ?? null, l), c = l !== void 0 && !it(l), h = Fe(null);
|
|
1502
|
+
if (ve(() => {
|
|
1503
|
+
!c || !t || t.finishedAt !== null || h.current !== t.runId && (h.current = t.runId, i.invalidateQueries({ queryKey: st(e.id) }));
|
|
1504
|
+
}, [c, t, i, e.id]), s.isLoading) return /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" });
|
|
1505
|
+
if (!t)
|
|
1608
1506
|
return /* @__PURE__ */ n("p", { className: "muted small", "data-testid": "rail-state-current-empty", children: "No run yet. Run the workflow and the state it ends with shows here." });
|
|
1609
|
-
const
|
|
1507
|
+
const d = ((j = o.data) == null ? void 0 : j.writes) ?? [], b = (D = a.data) == null ? void 0 : D.state, w = xt(b, d), p = ei(d), P = w ? Object.keys(w) : [];
|
|
1610
1508
|
return /* @__PURE__ */ r("div", { className: "w6w-stack", "data-testid": "rail-state-current", children: [
|
|
1611
1509
|
/* @__PURE__ */ r("dl", { className: "rail-meta-list", children: [
|
|
1612
1510
|
/* @__PURE__ */ n("dt", { children: "Run" }),
|
|
1613
|
-
/* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("code", { "data-testid": "rail-state-run-id", children:
|
|
1511
|
+
/* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("code", { "data-testid": "rail-state-run-id", children: t.runId }) }),
|
|
1614
1512
|
/* @__PURE__ */ n("dt", { children: "Started" }),
|
|
1615
|
-
/* @__PURE__ */ n("dd", { children: new Date(
|
|
1513
|
+
/* @__PURE__ */ n("dd", { children: new Date(t.startedAt).toLocaleString() }),
|
|
1616
1514
|
/* @__PURE__ */ n("dt", { children: "Status" }),
|
|
1617
|
-
/* @__PURE__ */ n("dd", { "data-testid": "rail-state-run-status", children:
|
|
1515
|
+
/* @__PURE__ */ n("dd", { "data-testid": "rail-state-run-status", children: l })
|
|
1618
1516
|
] }),
|
|
1619
1517
|
e.onOpenRun && /* @__PURE__ */ n(
|
|
1620
1518
|
"button",
|
|
@@ -1623,35 +1521,35 @@ function fi({ ctx: e }) {
|
|
|
1623
1521
|
className: "btn ghost",
|
|
1624
1522
|
"data-testid": "rail-state-open-run",
|
|
1625
1523
|
onClick: () => {
|
|
1626
|
-
var
|
|
1627
|
-
return (
|
|
1524
|
+
var N;
|
|
1525
|
+
return (N = e.onOpenRun) == null ? void 0 : N.call(e, t.runId);
|
|
1628
1526
|
},
|
|
1629
1527
|
children: "Open this run"
|
|
1630
1528
|
}
|
|
1631
1529
|
),
|
|
1632
|
-
a.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) :
|
|
1633
|
-
/* @__PURE__ */ n(
|
|
1634
|
-
/* @__PURE__ */ n("ul", { className: "list", "data-testid": "rail-state-writers", children:
|
|
1635
|
-
const
|
|
1530
|
+
a.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : P.length === 0 || !w ? /* @__PURE__ */ n("p", { className: "muted small", "data-testid": "rail-state-current-none", children: "This run has no state." }) : /* @__PURE__ */ r(R, { children: [
|
|
1531
|
+
/* @__PURE__ */ n(jn, { value: w }),
|
|
1532
|
+
/* @__PURE__ */ n("ul", { className: "list", "data-testid": "rail-state-writers", children: P.map((N) => {
|
|
1533
|
+
const H = p.get(N);
|
|
1636
1534
|
return /* @__PURE__ */ n("li", { "data-testid": "rail-state-writer", children: /* @__PURE__ */ r("span", { className: "list-main", children: [
|
|
1637
|
-
/* @__PURE__ */ n("code", { children:
|
|
1638
|
-
/* @__PURE__ */ n("span", { className: "muted small block", children:
|
|
1535
|
+
/* @__PURE__ */ n("code", { children: N }),
|
|
1536
|
+
/* @__PURE__ */ n("span", { className: "muted small block", children: H ? /* @__PURE__ */ r(R, { children: [
|
|
1639
1537
|
"Last written by ",
|
|
1640
|
-
/* @__PURE__ */ n("code", { children:
|
|
1641
|
-
] }) :
|
|
1642
|
-
] }) },
|
|
1538
|
+
/* @__PURE__ */ n("code", { children: H })
|
|
1539
|
+
] }) : p.has(N) ? "From the starting state" : "No step wrote it" })
|
|
1540
|
+
] }) }, N);
|
|
1643
1541
|
}) }),
|
|
1644
|
-
((
|
|
1542
|
+
((L = o.data) == null ? void 0 : L.truncated) && /* @__PURE__ */ n("p", { className: "muted small", children: "The run's state log reached its limit, so later writers aren't shown." })
|
|
1645
1543
|
] })
|
|
1646
1544
|
] });
|
|
1647
1545
|
}
|
|
1648
|
-
function
|
|
1649
|
-
const
|
|
1546
|
+
function oi({ ctx: e }) {
|
|
1547
|
+
const i = ti(e.startingState), s = Fn(e.startingState, e.variables ?? []);
|
|
1650
1548
|
return /* @__PURE__ */ r("div", { className: "w6w-stack", "data-testid": "rail-state-starting", children: [
|
|
1651
1549
|
/* @__PURE__ */ n("p", { className: "muted small", children: "Workflow inputs override starting state; starting state overrides project variables with the same name." }),
|
|
1652
|
-
|
|
1550
|
+
s.length > 0 && /* @__PURE__ */ r("p", { className: "muted small", "data-testid": "starting-data-collision", children: [
|
|
1653
1551
|
"Overridden by workflow inputs: ",
|
|
1654
|
-
|
|
1552
|
+
s.join(", "),
|
|
1655
1553
|
"."
|
|
1656
1554
|
] }),
|
|
1657
1555
|
/* @__PURE__ */ n(
|
|
@@ -1661,27 +1559,27 @@ function mi({ ctx: e }) {
|
|
|
1661
1559
|
className: "btn",
|
|
1662
1560
|
"data-testid": "rail-state-edit-starting",
|
|
1663
1561
|
onClick: () => {
|
|
1664
|
-
var
|
|
1665
|
-
return (
|
|
1562
|
+
var t;
|
|
1563
|
+
return (t = e.onOpenStartingState) == null ? void 0 : t.call(e);
|
|
1666
1564
|
},
|
|
1667
1565
|
children: "Edit starting state"
|
|
1668
1566
|
}
|
|
1669
1567
|
),
|
|
1670
|
-
|
|
1671
|
-
/* @__PURE__ */ n("code", { children:
|
|
1672
|
-
/* @__PURE__ */ n("span", { className: "muted small block", children:
|
|
1568
|
+
i.length === 0 ? /* @__PURE__ */ n("p", { className: "muted small", "data-testid": "rail-state-starting-empty", children: "No starting state. Every run begins with an empty state." }) : /* @__PURE__ */ n("ul", { className: "list", children: i.map((t) => /* @__PURE__ */ n("li", { "data-testid": "rail-state-starting-row", "data-kind": t.kind, children: /* @__PURE__ */ r("span", { className: "list-main", children: [
|
|
1569
|
+
/* @__PURE__ */ n("code", { children: t.path }),
|
|
1570
|
+
/* @__PURE__ */ n("span", { className: "muted small block", children: t.kind === "reference" ? /* @__PURE__ */ r(R, { children: [
|
|
1673
1571
|
"Reference ",
|
|
1674
|
-
/* @__PURE__ */ n("code", { children:
|
|
1572
|
+
/* @__PURE__ */ n("code", { children: t.text }),
|
|
1675
1573
|
", resolved when a run starts"
|
|
1676
|
-
] }) : /* @__PURE__ */ n("code", { children:
|
|
1677
|
-
] }) },
|
|
1574
|
+
] }) : /* @__PURE__ */ n("code", { children: t.text }) })
|
|
1575
|
+
] }) }, t.path)) })
|
|
1678
1576
|
] });
|
|
1679
1577
|
}
|
|
1680
|
-
function
|
|
1578
|
+
function li({
|
|
1681
1579
|
variables: e,
|
|
1682
|
-
onVariablesChange:
|
|
1580
|
+
onVariablesChange: i
|
|
1683
1581
|
}) {
|
|
1684
|
-
const [
|
|
1582
|
+
const [s, t] = f(!1), a = e.filter((l) => l.key !== "");
|
|
1685
1583
|
return /* @__PURE__ */ r("section", { "data-testid": "rail-workflow-variables", children: [
|
|
1686
1584
|
/* @__PURE__ */ r("div", { className: "rail-section-head", children: [
|
|
1687
1585
|
/* @__PURE__ */ n("h4", { children: "Workflow inputs" }),
|
|
@@ -1691,40 +1589,40 @@ function pi({
|
|
|
1691
1589
|
type: "button",
|
|
1692
1590
|
className: "btn ghost",
|
|
1693
1591
|
"data-testid": "rail-workflow-variables-edit",
|
|
1694
|
-
onClick: () =>
|
|
1592
|
+
onClick: () => t(!0),
|
|
1695
1593
|
children: a.length === 0 ? "+ Add inputs" : "Edit inputs"
|
|
1696
1594
|
}
|
|
1697
1595
|
)
|
|
1698
1596
|
] }),
|
|
1699
|
-
a.length === 0 ? /* @__PURE__ */ n("p", { className: "muted small", "data-testid": "rail-workflow-variables-empty", children: "None declared, so API and AI (MCP) callers may send anything." }) : /* @__PURE__ */ n("ul", { className: "rail-input-list", "data-testid": "rail-workflow-variables-list", children: a.map((
|
|
1700
|
-
const
|
|
1597
|
+
a.length === 0 ? /* @__PURE__ */ n("p", { className: "muted small", "data-testid": "rail-workflow-variables-empty", children: "None declared, so API and AI (MCP) callers may send anything." }) : /* @__PURE__ */ n("ul", { className: "rail-input-list", "data-testid": "rail-workflow-variables-list", children: a.map((l, o) => {
|
|
1598
|
+
const c = ii(l.default);
|
|
1701
1599
|
return /* @__PURE__ */ r("li", { "data-testid": "rail-workflow-variable", children: [
|
|
1702
1600
|
/* @__PURE__ */ r("span", { className: "rail-input-line", children: [
|
|
1703
|
-
/* @__PURE__ */ n("code", { className: "rail-input-key", title:
|
|
1704
|
-
/* @__PURE__ */ n("span", { className: "muted small", children:
|
|
1705
|
-
|
|
1601
|
+
/* @__PURE__ */ n("code", { className: "rail-input-key", title: l.key, children: l.key }),
|
|
1602
|
+
/* @__PURE__ */ n("span", { className: "muted small", children: l.type ?? "any" }),
|
|
1603
|
+
l.required && /* @__PURE__ */ n("span", { className: "rail-input-req", children: "required" })
|
|
1706
1604
|
] }),
|
|
1707
|
-
|
|
1605
|
+
c !== null && /* @__PURE__ */ r("span", { className: "muted small rail-input-default", title: c, children: [
|
|
1708
1606
|
"= ",
|
|
1709
|
-
|
|
1607
|
+
c
|
|
1710
1608
|
] })
|
|
1711
|
-
] }, `${
|
|
1609
|
+
] }, `${l.key}:${o}`);
|
|
1712
1610
|
}) }),
|
|
1713
|
-
|
|
1714
|
-
|
|
1611
|
+
s && /* @__PURE__ */ n(
|
|
1612
|
+
Xt,
|
|
1715
1613
|
{
|
|
1716
1614
|
variables: e,
|
|
1717
|
-
onVariablesChange:
|
|
1718
|
-
onClose: () =>
|
|
1615
|
+
onVariablesChange: i,
|
|
1616
|
+
onClose: () => t(!1)
|
|
1719
1617
|
}
|
|
1720
1618
|
)
|
|
1721
1619
|
] });
|
|
1722
1620
|
}
|
|
1723
|
-
function
|
|
1621
|
+
function di({ ctx: e }) {
|
|
1724
1622
|
return (e == null ? void 0 : e.kind) !== "workflow" || !e.onOpenStartingState ? null : /* @__PURE__ */ r("div", { className: "w6w-stack", "data-testid": "rail-state-body", children: [
|
|
1725
1623
|
/* @__PURE__ */ n("div", { className: "right-rail-panel-head", children: /* @__PURE__ */ n("h3", { children: "Data" }) }),
|
|
1726
1624
|
e.onVariablesChange && /* @__PURE__ */ n(
|
|
1727
|
-
|
|
1625
|
+
li,
|
|
1728
1626
|
{
|
|
1729
1627
|
variables: e.variables ?? [],
|
|
1730
1628
|
onVariablesChange: e.onVariablesChange
|
|
@@ -1732,41 +1630,41 @@ function gi({ ctx: e }) {
|
|
|
1732
1630
|
),
|
|
1733
1631
|
/* @__PURE__ */ r("section", { "data-testid": "rail-state-current-section", children: [
|
|
1734
1632
|
/* @__PURE__ */ n("h4", { children: "Current state" }),
|
|
1735
|
-
/* @__PURE__ */ n(
|
|
1633
|
+
/* @__PURE__ */ n(ri, { ctx: e })
|
|
1736
1634
|
] }),
|
|
1737
1635
|
/* @__PURE__ */ n("hr", {}),
|
|
1738
1636
|
/* @__PURE__ */ r("section", { "data-testid": "rail-state-starting-section", children: [
|
|
1739
1637
|
/* @__PURE__ */ n("h4", { children: "Starting state" }),
|
|
1740
|
-
/* @__PURE__ */ n(
|
|
1638
|
+
/* @__PURE__ */ n(oi, { ctx: e })
|
|
1741
1639
|
] })
|
|
1742
1640
|
] });
|
|
1743
1641
|
}
|
|
1744
|
-
const
|
|
1642
|
+
const ci = {
|
|
1745
1643
|
id: "starting-state",
|
|
1746
1644
|
title: "Data",
|
|
1747
1645
|
rendersHeading: !0,
|
|
1748
|
-
Icon:
|
|
1749
|
-
isAvailable: (e) =>
|
|
1750
|
-
Panel:
|
|
1646
|
+
Icon: ai,
|
|
1647
|
+
isAvailable: (e) => si(e) !== void 0,
|
|
1648
|
+
Panel: di,
|
|
1751
1649
|
hasIndicator: (e) => (e == null ? void 0 : e.kind) === "workflow" && e.hasStartingState === !0
|
|
1752
|
-
},
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1650
|
+
}, Wi = [
|
|
1651
|
+
Gt,
|
|
1652
|
+
Ot,
|
|
1653
|
+
Ht,
|
|
1654
|
+
ci,
|
|
1655
|
+
Mt,
|
|
1656
|
+
Ft
|
|
1759
1657
|
];
|
|
1760
1658
|
export {
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1659
|
+
jt as C,
|
|
1660
|
+
Vi as P,
|
|
1661
|
+
Qi as R,
|
|
1662
|
+
Mi as W,
|
|
1663
|
+
on as a,
|
|
1664
|
+
Li as b,
|
|
1665
|
+
ji as c,
|
|
1666
|
+
Ri as d,
|
|
1667
|
+
Wi as e,
|
|
1668
|
+
Et as u
|
|
1771
1669
|
};
|
|
1772
|
-
//# sourceMappingURL=editor-tools-
|
|
1670
|
+
//# sourceMappingURL=editor-tools-Ct7YPPj8.js.map
|