@w6w/embed 0.2.30 → 0.2.32
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-CCYi9deY.js → CreateFunctionModal-glk2zg1r.js} +28 -27
- package/dist/{CreateFunctionModal-CCYi9deY.js.map → CreateFunctionModal-glk2zg1r.js.map} +1 -1
- package/dist/{DocumentFormModal-B3VudaLb.js → DocumentFormModal-Cw85R4wk.js} +2 -2
- package/dist/{DocumentFormModal-B3VudaLb.js.map → DocumentFormModal-Cw85R4wk.js.map} +1 -1
- package/dist/{ImportSpecModal-C-B8Jwxk.js → ImportSpecModal-fU5RsVTa.js} +2 -2
- package/dist/{ImportSpecModal-C-B8Jwxk.js.map → ImportSpecModal-fU5RsVTa.js.map} +1 -1
- package/dist/WorkflowEditor-C7oudiIb.js +1169 -0
- package/dist/WorkflowEditor-C7oudiIb.js.map +1 -0
- package/dist/callable-record-Bhxim8C1.js +14 -0
- package/dist/callable-record-Bhxim8C1.js.map +1 -0
- package/dist/callables-B49tS2vv.js +297 -0
- package/dist/callables-B49tS2vv.js.map +1 -0
- package/dist/{document-sources-DNmBojx6.js → document-sources-Khcw2zB5.js} +16 -16
- package/dist/document-sources-Khcw2zB5.js.map +1 -0
- package/dist/draft.mjs +1 -1
- package/dist/editor/WorkflowEditor.d.ts +2 -1
- package/dist/editor/WorkflowInputsModal.d.ts +12 -0
- package/dist/editor/WorkflowVariablesEditor.d.ts +1 -1
- package/dist/{editor-tools-BIAW-wzt.js → editor-tools-Dn7TgCP4.js} +566 -486
- package/dist/editor-tools-Dn7TgCP4.js.map +1 -0
- package/dist/editor.mjs +1 -1
- package/dist/editors.mjs +81 -80
- package/dist/editors.mjs.map +1 -1
- package/dist/endpoints-zOuwci2U.js +136 -0
- package/dist/endpoints-zOuwci2U.js.map +1 -0
- package/dist/fields-CXHRR5eK.js +28 -0
- package/dist/fields-CXHRR5eK.js.map +1 -0
- package/dist/forms.mjs +1 -1
- package/dist/index.mjs +91 -91
- package/dist/index.mjs.map +1 -1
- package/dist/lib/callable-duplicate.d.ts +26 -0
- package/dist/lib/settings-rail.d.ts +12 -0
- package/dist/lib/variable-preview.d.ts +6 -0
- package/dist/lib.mjs +41 -40
- package/dist/lib.mjs.map +1 -1
- package/dist/lists/CallableKindList.d.ts +4 -1
- package/dist/lists/CallableRowParts.d.ts +5 -0
- package/dist/lists/CredentialDetail.d.ts +2 -0
- package/dist/lists/CredentialFields.d.ts +1 -1
- package/dist/lists/EndpointList.d.ts +2 -1
- package/dist/lists/WorkflowList.d.ts +2 -1
- package/dist/lists.mjs +1509 -1421
- package/dist/lists.mjs.map +1 -1
- package/dist/rail.mjs +1 -1
- package/dist/repos/callables.d.ts +23 -0
- package/dist/repos/fields.d.ts +4 -1
- package/dist/repos.mjs +242 -239
- package/dist/settings-rail-gUU2ZbSw.js +36 -0
- package/dist/settings-rail-gUU2ZbSw.js.map +1 -0
- package/dist/{spec-import-FygyV8sy.js → spec-import-CGPqUUjN.js} +2 -2
- package/dist/{spec-import-FygyV8sy.js.map → spec-import-CGPqUUjN.js.map} +1 -1
- package/dist/{use-callable-draft-DCauHt5o.js → use-callable-draft-w4tDTYcb.js} +8 -7
- package/dist/{use-callable-draft-DCauHt5o.js.map → use-callable-draft-w4tDTYcb.js.map} +1 -1
- package/package.json +3 -3
- package/src/styles.css +174 -40
- package/dist/WorkflowEditor-8NAcpjO_.js +0 -1140
- package/dist/WorkflowEditor-8NAcpjO_.js.map +0 -1
- package/dist/callables-tOlflvbl.js +0 -151
- package/dist/callables-tOlflvbl.js.map +0 -1
- package/dist/document-sources-DNmBojx6.js.map +0 -1
- package/dist/editor-tools-BIAW-wzt.js.map +0 -1
- package/dist/endpoints-DArAqoLT.js +0 -233
- package/dist/endpoints-DArAqoLT.js.map +0 -1
- package/dist/fields-DvS8XZFc.js +0 -21
- package/dist/fields-DvS8XZFc.js.map +0 -1
- package/dist/settings-rail--GdRMusb.js +0 -33
- package/dist/settings-rail--GdRMusb.js.map +0 -1
package/dist/editors.mjs
CHANGED
|
@@ -2,23 +2,24 @@
|
|
|
2
2
|
var tn = Object.defineProperty;
|
|
3
3
|
var an = (t, i, a) => i in t ? tn(t, i, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[i] = a;
|
|
4
4
|
var Se = (t, i, a) => an(t, typeof i != "symbol" ? i + "" : i, a);
|
|
5
|
-
import { H as sn, E as on, B as rn, a as Re, J as xe, b as De } from "./WorkflowEditor-
|
|
6
|
-
import { W as
|
|
5
|
+
import { H as sn, E as on, B as rn, a as Re, J as xe, b as De } from "./WorkflowEditor-C7oudiIb.js";
|
|
6
|
+
import { W as Wt } from "./WorkflowEditor-C7oudiIb.js";
|
|
7
7
|
import { jsx as e, jsxs as o, Fragment as D } from "react/jsx-runtime";
|
|
8
8
|
import { EditButton as ln, DeleteButton as dn, Copyable as Ke, CodeBlock as cn, IconButton as pe, AppIcon as un, ExpressionInput as hn, StepBuilderModal as mn, ExpressionOptionsProvider as Te } from "@w6w/ui";
|
|
9
9
|
import { useState as g, Component as fn, useRef as _, useEffect as se, useMemo as L, useCallback as he } from "react";
|
|
10
10
|
import { b as pn, C as yn } from "./ConfirmModal-WqBfWftD.js";
|
|
11
|
-
import { D as vn } from "./DocumentFormModal-
|
|
11
|
+
import { D as vn } from "./DocumentFormModal-Cw85R4wk.js";
|
|
12
12
|
import { u as ke } from "./project-context-Tvp-La7A.js";
|
|
13
|
-
import { j as bn, i as gn, r as
|
|
13
|
+
import { j as bn, i as gn, r as Oe, m as kn, o as wn } from "./spec-import-CGPqUUjN.js";
|
|
14
14
|
import { ApiError as ye } from "@w6w/sdk";
|
|
15
15
|
import { k as Nn, i as Cn } from "./apps-FMcQfyL2.js";
|
|
16
|
-
import { C as Sn, c as
|
|
17
|
-
import { a as En, b as In } from "./use-callable-draft-
|
|
18
|
-
import { E as Fn, F as Pn } from "./CreateFunctionModal-
|
|
19
|
-
import {
|
|
20
|
-
import { t as
|
|
16
|
+
import { C as Sn, c as Ae } from "./editor-tools-Dn7TgCP4.js";
|
|
17
|
+
import { a as En, b as In } from "./use-callable-draft-w4tDTYcb.js";
|
|
18
|
+
import { E as Fn, F as Pn } from "./CreateFunctionModal-glk2zg1r.js";
|
|
19
|
+
import { j as je } from "./callables-B49tS2vv.js";
|
|
20
|
+
import { t as Bn, a as Me, c as Je, I as Rn, b as xn, p as ve, f as Dn, u as Ee, s as Le, m as We, g as Qe, i as Ie, e as Kn, h as Tn } from "./coerce-input-DFJ4n_wc.js";
|
|
21
21
|
import { e as me } from "./import-bindings-EUtxZ9Ti.js";
|
|
22
|
+
import { w as On, b as An, u as jn, s as Ue, r as qe, x as Mn } from "./endpoints-zOuwci2U.js";
|
|
22
23
|
import { useQueryClient as we } from "@tanstack/react-query";
|
|
23
24
|
import { o as $e, a1 as Jn, a0 as Ln } from "./workflows-Dz8LMjnt.js";
|
|
24
25
|
import { SECRET_MASK as Wn } from "@w6w/sdk/console";
|
|
@@ -205,18 +206,18 @@ function be(t) {
|
|
|
205
206
|
...h,
|
|
206
207
|
key: String(t.key ?? "").trim()
|
|
207
208
|
};
|
|
208
|
-
|
|
209
|
-
const n =
|
|
209
|
+
Bn(i) && (d.target = i);
|
|
210
|
+
const n = Me(a ?? [], { emptyMeansPassthrough: !0 });
|
|
210
211
|
return n !== void 0 && (d.input = n), d;
|
|
211
212
|
}
|
|
212
|
-
function
|
|
213
|
+
function Ge(t) {
|
|
213
214
|
return t && t.length > 1 ? t : void 0;
|
|
214
215
|
}
|
|
215
|
-
function
|
|
216
|
-
const a =
|
|
216
|
+
function Gn(t, i) {
|
|
217
|
+
const a = Ge(t);
|
|
217
218
|
return a ? a.find((h) => h.domain === i) ?? a.find((h) => h.default) ?? a[0] : null;
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
+
function zn(t, i, a) {
|
|
220
221
|
return t ?? {
|
|
221
222
|
url: i ?? "",
|
|
222
223
|
urlByKey: a,
|
|
@@ -226,7 +227,7 @@ function Gn(t, i, a) {
|
|
|
226
227
|
const Xn = (t) => t instanceof Error ? t.message : String(t);
|
|
227
228
|
function Zn(t) {
|
|
228
229
|
var y;
|
|
229
|
-
const { kind: i, id: a, onError: h } = t, d =
|
|
230
|
+
const { kind: i, id: a, onError: h } = t, d = Oe(i, a, !0), n = kn(i), [c, I] = g(!1), v = ((y = d.data) == null ? void 0 : y.currentPublishedVersion) != null, N = i === "function" ? "fn-publish" : "ep-publish";
|
|
230
231
|
async function m() {
|
|
231
232
|
h(null), I(!0);
|
|
232
233
|
try {
|
|
@@ -256,7 +257,7 @@ function Zn(t) {
|
|
|
256
257
|
}
|
|
257
258
|
);
|
|
258
259
|
}
|
|
259
|
-
function
|
|
260
|
+
function ze(t) {
|
|
260
261
|
const i = je(t.kind), [a, h] = g(null), d = t.slots, n = (d == null ? void 0 : d.backLabel) ?? i.editor.backLabel, c = () => t.onNavigate({ type: "list" });
|
|
261
262
|
return t.notFound ? /* @__PURE__ */ o("div", { children: [
|
|
262
263
|
/* @__PURE__ */ e("button", { type: "button", className: "btn ghost", onClick: c, children: n }),
|
|
@@ -468,10 +469,10 @@ function ge(t) {
|
|
|
468
469
|
] });
|
|
469
470
|
}
|
|
470
471
|
function tt(t) {
|
|
471
|
-
const { id: i, inputs: a } = t, [h, d] = g({}), [n, c] = g(void 0), [I, v] = g(null), [N, m] = g(!1), y = we(), s =
|
|
472
|
+
const { id: i, inputs: a } = t, [h, d] = g({}), [n, c] = g(void 0), [I, v] = g(null), [N, m] = g(!1), y = we(), s = On(), P = async () => {
|
|
472
473
|
const u = {};
|
|
473
474
|
for (const r of a) {
|
|
474
|
-
const b =
|
|
475
|
+
const b = Je(r.type, h[r.key] ?? "");
|
|
475
476
|
b !== void 0 && (u[r.key] = b);
|
|
476
477
|
}
|
|
477
478
|
m(!0);
|
|
@@ -596,7 +597,7 @@ function Xe(t) {
|
|
|
596
597
|
value: m.type,
|
|
597
598
|
"aria-label": "Input type",
|
|
598
599
|
onChange: (s) => v(y, { type: s.target.value }),
|
|
599
|
-
children:
|
|
600
|
+
children: Rn.map((s) => /* @__PURE__ */ e("option", { value: s, children: s }, s))
|
|
600
601
|
}
|
|
601
602
|
),
|
|
602
603
|
/* @__PURE__ */ o("label", { className: "row", style: { gap: 4, alignItems: "center" }, children: [
|
|
@@ -638,7 +639,7 @@ const at = ["action", "function", "workflow", "endpoint"], it = {
|
|
|
638
639
|
};
|
|
639
640
|
function Ze(t) {
|
|
640
641
|
var F;
|
|
641
|
-
const { kind: i, id: a, uses: h, dirty: d } = t, n = (h == null ? void 0 : h.app) ?? "", c = (h == null ? void 0 : h.connection) ?? "", I = we(), v = _e(n, n !== ""), N = (F =
|
|
642
|
+
const { kind: i, id: a, uses: h, dirty: d } = t, n = (h == null ? void 0 : h.app) ?? "", c = (h == null ? void 0 : h.connection) ?? "", I = we(), v = _e(n, n !== ""), N = (F = Oe(i, a, !0).data) == null ? void 0 : F.enabled, m = wn(i), y = v.isSuccess && !v.isFetching, s = L(() => new Set((v.data ?? []).map((k) => k.id)), [v.data]), P = He(
|
|
642
643
|
[{ id: "target", uses: h }],
|
|
643
644
|
() => y ? { state: "ready", ids: s } : void 0
|
|
644
645
|
).length, u = _({ id: a, had: !1 });
|
|
@@ -666,7 +667,7 @@ function Ze(t) {
|
|
|
666
667
|
) : null;
|
|
667
668
|
}
|
|
668
669
|
function en(t) {
|
|
669
|
-
var
|
|
670
|
+
var z, q, le;
|
|
670
671
|
const {
|
|
671
672
|
allowedKinds: i,
|
|
672
673
|
excludeCallableIds: a,
|
|
@@ -680,7 +681,7 @@ function en(t) {
|
|
|
680
681
|
function u(l) {
|
|
681
682
|
d(l);
|
|
682
683
|
}
|
|
683
|
-
const r = y.kind === "action" ? y : void 0, b = (r == null ? void 0 : r.uses.app) ?? "", F = (r == null ? void 0 : r.uses.action) ?? "", k =
|
|
684
|
+
const r = y.kind === "action" ? y : void 0, b = (r == null ? void 0 : r.uses.app) ?? "", F = (r == null ? void 0 : r.uses.action) ?? "", k = xn(y), B = qn(b), [W, V] = g(null);
|
|
684
685
|
se(() => {
|
|
685
686
|
let l = !1;
|
|
686
687
|
return import("@w6w/ui/flow").then((E) => {
|
|
@@ -695,23 +696,23 @@ function en(t) {
|
|
|
695
696
|
).length > 0, R = L(
|
|
696
697
|
() => (Q.data ?? []).find((l) => l.key === F),
|
|
697
698
|
[Q.data, F]
|
|
698
|
-
), $ = ["function", "workflow"].filter(P), re = `Choose ${c.charAt(0).toLowerCase()}${c.slice(1)}`, S =
|
|
699
|
+
), $ = ["function", "workflow"].filter(P), re = `Choose ${c.charAt(0).toLowerCase()}${c.slice(1)}`, S = An(P("function")), f = Jn(void 0, P("workflow")), x = jn(P("endpoint")), Y = Ue(k, s === "function" && k !== ""), G = Ln(k, s === "workflow" && k !== ""), Z = qe(k, s === "endpoint" && k !== ""), A = L(() => {
|
|
699
700
|
var l, E, w;
|
|
700
|
-
return s === "action" ? ve((R == null ? void 0 : R.params) ?? []) : s === "function" ? ve(((l = Y.data) == null ? void 0 : l.inputs) ?? []) : s === "workflow" ? W ?
|
|
701
|
-
(E =
|
|
701
|
+
return s === "action" ? ve((R == null ? void 0 : R.params) ?? []) : s === "function" ? ve(((l = Y.data) == null ? void 0 : l.inputs) ?? []) : s === "workflow" ? W ? Dn(
|
|
702
|
+
(E = G.data) == null ? void 0 : E.workflow,
|
|
702
703
|
W
|
|
703
704
|
) : [] : s === "endpoint" ? ve(((w = Z.data) == null ? void 0 : w.endpoint.input) ?? []) : [];
|
|
704
705
|
}, [
|
|
705
706
|
s,
|
|
706
707
|
R,
|
|
707
708
|
Y.data,
|
|
708
|
-
|
|
709
|
+
G.data,
|
|
709
710
|
Z.data,
|
|
710
711
|
W
|
|
711
712
|
]);
|
|
712
713
|
se(() => {
|
|
713
|
-
n == null || n({ meta: { kind: s, ref: s === "action" ? b : k }, kind: s, fields:
|
|
714
|
-
}, [s, b, k,
|
|
714
|
+
n == null || n({ meta: { kind: s, ref: s === "action" ? b : k }, kind: s, fields: A });
|
|
715
|
+
}, [s, b, k, A, n]);
|
|
715
716
|
function X(l) {
|
|
716
717
|
if (l.uses.app === Sn) {
|
|
717
718
|
const T = l.with ?? {}, M = T.targetKind === "workflow" ? "workflow" : "function", p = typeof T.targetId == "string" ? T.targetId : "";
|
|
@@ -758,8 +759,8 @@ function en(t) {
|
|
|
758
759
|
const l = (R == null ? void 0 : R.params) ?? [], E = (r == null ? void 0 : r.with) ?? {};
|
|
759
760
|
return l.filter((w) => {
|
|
760
761
|
if (w.showIf) {
|
|
761
|
-
const { field: T, equals: M, in: p, notIn:
|
|
762
|
-
if (M !== void 0 && ie !== M || p !== void 0 && !p.includes(ie) ||
|
|
762
|
+
const { field: T, equals: M, in: p, notIn: O, truthy: ue } = w.showIf, ie = E[T];
|
|
763
|
+
if (M !== void 0 && ie !== M || p !== void 0 && !p.includes(ie) || O != null && O.includes(ie) || ue !== void 0 && !!ie !== ue) return !1;
|
|
763
764
|
}
|
|
764
765
|
const J = w.key in E && E[w.key] !== "" && E[w.key] !== void 0;
|
|
765
766
|
return w.required || J;
|
|
@@ -787,7 +788,7 @@ function en(t) {
|
|
|
787
788
|
/* @__PURE__ */ e("strong", { children: (R == null ? void 0 : R.title) ?? F }),
|
|
788
789
|
" ",
|
|
789
790
|
/* @__PURE__ */ e("code", { className: "muted", children: b }),
|
|
790
|
-
/* @__PURE__ */ e("span", { className: "muted small block", children: oe ? /* @__PURE__ */ e("span", { className: "error", "data-testid": "binding-missing", children: "Missing connection — choose another" }) : r != null && r.uses.connection ? `via ${((q = (
|
|
791
|
+
/* @__PURE__ */ e("span", { className: "muted small block", children: oe ? /* @__PURE__ */ e("span", { className: "error", "data-testid": "binding-missing", children: "Missing connection — choose another" }) : r != null && r.uses.connection ? `via ${((q = (z = K.data) == null ? void 0 : z.find((l) => l.id === r.uses.connection)) == null ? void 0 : q.displayName) ?? r.uses.connection}` : "no connection" })
|
|
791
792
|
] }),
|
|
792
793
|
/* @__PURE__ */ e("button", { type: "button", className: "btn ghost", onClick: () => m(!0), children: "Change" })
|
|
793
794
|
] }) : /* @__PURE__ */ e("button", { type: "button", className: "btn", onClick: () => m(!0), children: "+ Choose an action" }),
|
|
@@ -878,7 +879,7 @@ const st = () => {
|
|
|
878
879
|
function de(t) {
|
|
879
880
|
return t instanceof ye || t instanceof Error ? t.message : String(t);
|
|
880
881
|
}
|
|
881
|
-
function
|
|
882
|
+
function jt(t) {
|
|
882
883
|
const { endpointId: i, onNavigate: a = st, slots: h, tools: d } = t, n = ke(t.project), c = he(
|
|
883
884
|
(I) => a(I),
|
|
884
885
|
[a]
|
|
@@ -912,7 +913,7 @@ function Ot(t) {
|
|
|
912
913
|
}
|
|
913
914
|
function ot(t) {
|
|
914
915
|
var Ne;
|
|
915
|
-
const { id: i, onNavigate: a, slots: h } = t, d = je("endpoint"), n =
|
|
916
|
+
const { id: i, onNavigate: a, slots: h } = t, d = je("endpoint"), n = qe(i).data, [c, I] = g([]), v = _(c);
|
|
916
917
|
v.current = c;
|
|
917
918
|
const N = _(!1), m = _(!1), [y, s] = g("id"), [P, u] = g(null), [r, b] = g(!1), [F, k] = g(!1), [B, W] = g(!1), [V, Q] = g(""), [K, oe] = g({ id: i, key: "" }), [R, $] = g(null), re = he((C) => {
|
|
918
919
|
const H = ce(C), j = Ee({
|
|
@@ -929,16 +930,16 @@ function ot(t) {
|
|
|
929
930
|
id: i,
|
|
930
931
|
uses: (f == null ? void 0 : f.target.kind) === "action" ? f.target.uses : void 0,
|
|
931
932
|
dirty: S.dirty
|
|
932
|
-
}),
|
|
933
|
+
}), G = ((Ne = f == null ? void 0 : f.exposure) == null ? void 0 : Ne.security) ?? {
|
|
933
934
|
auth: "platform"
|
|
934
|
-
}, Z =
|
|
935
|
-
|
|
935
|
+
}, Z = Ge(n == null ? void 0 : n.invokeUrls), A = Gn(n == null ? void 0 : n.invokeUrls, P);
|
|
936
|
+
Ae({
|
|
936
937
|
kind: "endpoint",
|
|
937
938
|
id: i,
|
|
938
939
|
label: (f == null ? void 0 : f.displayName) || void 0,
|
|
939
940
|
key: (f == null ? void 0 : f.key.trim()) || void 0,
|
|
940
|
-
invokeUrl:
|
|
941
|
-
invokeUrlByKey:
|
|
941
|
+
invokeUrl: A ? A.url : n == null ? void 0 : n.invokeUrl,
|
|
942
|
+
invokeUrlByKey: A ? A.urlByKey : n == null ? void 0 : n.invokeUrlByKey,
|
|
942
943
|
urlForm: y,
|
|
943
944
|
inputs: c.map((C) => C.key),
|
|
944
945
|
policy: S.policy,
|
|
@@ -967,33 +968,33 @@ function ot(t) {
|
|
|
967
968
|
}
|
|
968
969
|
se(() => {
|
|
969
970
|
if (N.current) {
|
|
970
|
-
if (!
|
|
971
|
+
if (!Le({ rows: x, touched: m.current })) {
|
|
971
972
|
N.current = !1;
|
|
972
973
|
return;
|
|
973
974
|
}
|
|
974
|
-
c.length !== 0 && (U({ input:
|
|
975
|
+
c.length !== 0 && (U({ input: We(x, c) }), N.current = !1);
|
|
975
976
|
}
|
|
976
977
|
}, [c]);
|
|
977
978
|
const te = L(
|
|
978
979
|
() => ({ inputs: x.map((C) => C.key).filter(Boolean) }),
|
|
979
980
|
[x]
|
|
980
981
|
), ae = L(
|
|
981
|
-
() =>
|
|
982
|
+
() => Qe(x, c),
|
|
982
983
|
[x, c]
|
|
983
|
-
),
|
|
984
|
+
), z = L(
|
|
984
985
|
() => f ? Ee({
|
|
985
986
|
target: f.target,
|
|
986
987
|
rows: x,
|
|
987
988
|
fields: c
|
|
988
989
|
}) : [],
|
|
989
990
|
[f, x, c]
|
|
990
|
-
), q = f &&
|
|
991
|
+
), q = f && z.length > 0 ? /* @__PURE__ */ o("p", { className: "error small", "data-testid": "save-blocked", children: [
|
|
991
992
|
"Can’t save yet — the target needs",
|
|
992
993
|
" ",
|
|
993
994
|
f.target.kind === "action" ? "these required params mapped under Input mapping" : "these required keys declared under Input",
|
|
994
995
|
": ",
|
|
995
|
-
/* @__PURE__ */ e("strong", { children:
|
|
996
|
-
] }) : null, l = !!((f == null ? void 0 : f.key.trim()) ?? "") &&
|
|
996
|
+
/* @__PURE__ */ e("strong", { children: z.join(", ") })
|
|
997
|
+
] }) : null, l = !!((f == null ? void 0 : f.key.trim()) ?? "") && z.length === 0 && S.canSave;
|
|
997
998
|
async function E() {
|
|
998
999
|
if (!f) return;
|
|
999
1000
|
const C = await S.commit(be(f));
|
|
@@ -1022,16 +1023,16 @@ function ot(t) {
|
|
|
1022
1023
|
return /* @__PURE__ */ e("div", { className: "error", role: "alert", children: de(M) });
|
|
1023
1024
|
if (!p) return /* @__PURE__ */ e("p", { className: "muted", children: "Loading…" });
|
|
1024
1025
|
}
|
|
1025
|
-
const
|
|
1026
|
+
const O = f && (f.displayName || f.key) || d.editor.newTitle, ue = S.error !== null && !S.stale ? de(S.error) : null, ie = S.stale || S.changedElsewhere ? /* @__PURE__ */ o("div", { className: "error", role: "alert", "data-testid": "endpoint-stale", children: [
|
|
1026
1027
|
S.stale ? de(S.error) : "This endpoint was changed elsewhere. Reload to see the new version (your edits will be discarded).",
|
|
1027
1028
|
" ",
|
|
1028
1029
|
/* @__PURE__ */ e("button", { type: "button", className: "btn ghost", onClick: () => void S.reload(), children: "Reload" })
|
|
1029
1030
|
] }) : null;
|
|
1030
1031
|
return /* @__PURE__ */ e(Te, { value: te, children: /* @__PURE__ */ e(
|
|
1031
|
-
|
|
1032
|
+
ze,
|
|
1032
1033
|
{
|
|
1033
1034
|
kind: "endpoint",
|
|
1034
|
-
title:
|
|
1035
|
+
title: O,
|
|
1035
1036
|
incomplete: !1,
|
|
1036
1037
|
canSave: l,
|
|
1037
1038
|
isSaving: S.saving,
|
|
@@ -1080,9 +1081,9 @@ function ot(t) {
|
|
|
1080
1081
|
/* @__PURE__ */ e(
|
|
1081
1082
|
et,
|
|
1082
1083
|
{
|
|
1083
|
-
entry:
|
|
1084
|
+
entry: zn(A, n == null ? void 0 : n.invokeUrl, n == null ? void 0 : n.invokeUrlByKey),
|
|
1084
1085
|
domainOptions: Z,
|
|
1085
|
-
urlDomain: (
|
|
1086
|
+
urlDomain: (A == null ? void 0 : A.domain) ?? null,
|
|
1086
1087
|
onUrlDomain: u,
|
|
1087
1088
|
urlForm: y,
|
|
1088
1089
|
onUrlForm: s
|
|
@@ -1121,7 +1122,7 @@ function ot(t) {
|
|
|
1121
1122
|
onResolved: (C) => I(C.fields)
|
|
1122
1123
|
}
|
|
1123
1124
|
),
|
|
1124
|
-
/* @__PURE__ */ e(nt, { security:
|
|
1125
|
+
/* @__PURE__ */ e(nt, { security: G, onPatch: ee }),
|
|
1125
1126
|
/* @__PURE__ */ e(tt, { id: i, inputs: x, saveFirst: w }),
|
|
1126
1127
|
/* @__PURE__ */ o(
|
|
1127
1128
|
"div",
|
|
@@ -1170,7 +1171,7 @@ function ot(t) {
|
|
|
1170
1171
|
{
|
|
1171
1172
|
open: B,
|
|
1172
1173
|
onClose: () => W(!1),
|
|
1173
|
-
title: `JSON — ${
|
|
1174
|
+
title: `JSON — ${O}`,
|
|
1174
1175
|
mode: "disconnected",
|
|
1175
1176
|
value: V,
|
|
1176
1177
|
onChange: Q,
|
|
@@ -1187,7 +1188,7 @@ function ot(t) {
|
|
|
1187
1188
|
}
|
|
1188
1189
|
const rt = () => {
|
|
1189
1190
|
}, Be = (t) => t instanceof Error ? t.message : String(t);
|
|
1190
|
-
function
|
|
1191
|
+
function Mt(t) {
|
|
1191
1192
|
const { functionId: i, onNavigate: a = rt, slots: h, tools: d } = t, n = ke(t.project);
|
|
1192
1193
|
return /* @__PURE__ */ e(
|
|
1193
1194
|
"div",
|
|
@@ -1214,13 +1215,13 @@ function lt(t) {
|
|
|
1214
1215
|
}
|
|
1215
1216
|
function dt(t) {
|
|
1216
1217
|
var M;
|
|
1217
|
-
const { functionId: i, draft: a, onNavigate: h, slots: d } = t, n = a.definition, c = (n == null ? void 0 : n.inputs) ?? [], v = ((M =
|
|
1218
|
+
const { functionId: i, draft: a, onNavigate: h, slots: d } = t, n = a.definition, c = (n == null ? void 0 : n.inputs) ?? [], v = ((M = Ue(i).data) == null ? void 0 : M.valid) === !0, N = a.loadError, m = n ? Ie(n.impl) : void 0, y = Ze({
|
|
1218
1219
|
kind: "function",
|
|
1219
1220
|
id: i,
|
|
1220
1221
|
uses: (m == null ? void 0 : m.kind) === "action" ? m.uses : void 0,
|
|
1221
1222
|
dirty: a.dirty
|
|
1222
1223
|
}), s = N instanceof ye && N.status === 404, [P, u] = g(!1), [r, b] = g(null), [F, k] = g(!1), [B, W] = g(!1), V = ((n == null ? void 0 : n.key) ?? "").trim() || $n((n == null ? void 0 : n.displayName) ?? "");
|
|
1223
|
-
|
|
1224
|
+
Ae({
|
|
1224
1225
|
kind: "function",
|
|
1225
1226
|
id: i,
|
|
1226
1227
|
label: (n == null ? void 0 : n.displayName) || void 0,
|
|
@@ -1229,59 +1230,59 @@ function dt(t) {
|
|
|
1229
1230
|
policy: a.policy,
|
|
1230
1231
|
onPolicyChange: a.onPolicyChange
|
|
1231
1232
|
});
|
|
1232
|
-
const Q = (p) => a.setDefinition((
|
|
1233
|
+
const Q = (p) => a.setDefinition((O) => ({ ...O, ...p })), [K, oe] = g([]), R = _(!1), $ = _(!1);
|
|
1233
1234
|
se(() => {
|
|
1234
1235
|
if (R.current) {
|
|
1235
|
-
if (!
|
|
1236
|
+
if (!Le({ rows: c, touched: $.current })) {
|
|
1236
1237
|
R.current = !1;
|
|
1237
1238
|
return;
|
|
1238
1239
|
}
|
|
1239
|
-
K.length !== 0 && (Q({ inputs:
|
|
1240
|
+
K.length !== 0 && (Q({ inputs: We(c, K) }), R.current = !1);
|
|
1240
1241
|
}
|
|
1241
1242
|
}, [K]);
|
|
1242
1243
|
const re = L(
|
|
1243
|
-
() =>
|
|
1244
|
+
() => Qe(c, K),
|
|
1244
1245
|
[c, K]
|
|
1245
1246
|
), S = L(
|
|
1246
1247
|
() => ({ inputs: c.map((p) => p.key).filter(Boolean) }),
|
|
1247
1248
|
[c]
|
|
1248
1249
|
);
|
|
1249
1250
|
function f(p) {
|
|
1250
|
-
R.current = !0, Q({ impl:
|
|
1251
|
+
R.current = !0, Q({ impl: Tn(n == null ? void 0 : n.impl, p) });
|
|
1251
1252
|
}
|
|
1252
1253
|
const x = L(
|
|
1253
|
-
() =>
|
|
1254
|
+
() => Kn({ impl: n == null ? void 0 : n.impl, fields: K }),
|
|
1254
1255
|
[n == null ? void 0 : n.impl, K]
|
|
1255
1256
|
), Y = !!V && x.length === 0 && a.canSave;
|
|
1256
|
-
function
|
|
1257
|
+
function G() {
|
|
1257
1258
|
return {
|
|
1258
1259
|
...n,
|
|
1259
1260
|
key: V,
|
|
1260
|
-
inputs:
|
|
1261
|
+
inputs: Me(c, { emptyMeansPassthrough: !1 })
|
|
1261
1262
|
};
|
|
1262
1263
|
}
|
|
1263
1264
|
async function Z() {
|
|
1264
1265
|
b(null), k(!1);
|
|
1265
|
-
const p = await a.commit(
|
|
1266
|
+
const p = await a.commit(G());
|
|
1266
1267
|
p.status === "saved" || p.status === "clean" ? k(!0) : p.status === "blocked" && b(p.reason);
|
|
1267
1268
|
}
|
|
1268
|
-
async function
|
|
1269
|
-
return a.dirty ? Y ? a.commit(
|
|
1269
|
+
async function A() {
|
|
1270
|
+
return a.dirty ? Y ? a.commit(G()) : {
|
|
1270
1271
|
status: "blocked",
|
|
1271
1272
|
reason: "Fix the highlighted problems, then save, to test this Function."
|
|
1272
1273
|
} : { status: "clean" };
|
|
1273
1274
|
}
|
|
1274
|
-
const [X, U] = g(!1), [ee, ne] = g(""), [te, ae] = g({ id: i, key: "" }), [
|
|
1275
|
+
const [X, U] = g(!1), [ee, ne] = g(""), [te, ae] = g({ id: i, key: "" }), [z, q] = g(null);
|
|
1275
1276
|
function le() {
|
|
1276
|
-
const p =
|
|
1277
|
+
const p = G();
|
|
1277
1278
|
ne(JSON.stringify(p, null, 2)), ae({ id: String(p.id), key: String(p.key) }), q(null), U(!0);
|
|
1278
1279
|
}
|
|
1279
1280
|
async function l() {
|
|
1280
1281
|
const p = me(ee, te);
|
|
1281
1282
|
if (!p.parsed || p.blockedReason) return;
|
|
1282
1283
|
k(!1);
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1284
|
+
const O = await a.commit(p.parsed);
|
|
1285
|
+
O.status === "saved" || O.status === "clean" ? (q(null), U(!1), k(!0)) : O.status === "blocked" ? q(O.reason) : O.status === "failed" && q(Be(O.error));
|
|
1285
1286
|
}
|
|
1286
1287
|
const E = he(async () => {
|
|
1287
1288
|
W(!0);
|
|
@@ -1292,7 +1293,7 @@ function dt(t) {
|
|
|
1292
1293
|
}
|
|
1293
1294
|
}, [a.reload]), w = a.stale ? null : a.error ?? N, J = r ?? (w === null ? null : Be(w)), T = (n == null ? void 0 : n.displayName) || (n == null ? void 0 : n.key) || "New function";
|
|
1294
1295
|
return a.loading || n === null && N === null ? /* @__PURE__ */ e("p", { className: "muted", children: "Loading…" }) : /* @__PURE__ */ e("div", { style: { flex: 1, minWidth: 0, overflow: "auto" }, children: /* @__PURE__ */ e(Te, { value: S, children: /* @__PURE__ */ e(
|
|
1295
|
-
|
|
1296
|
+
ze,
|
|
1296
1297
|
{
|
|
1297
1298
|
kind: "function",
|
|
1298
1299
|
title: T,
|
|
@@ -1304,7 +1305,7 @@ function dt(t) {
|
|
|
1304
1305
|
notFound: s,
|
|
1305
1306
|
onNavigate: h,
|
|
1306
1307
|
slots: d,
|
|
1307
|
-
publish: { id: i, saveFirst:
|
|
1308
|
+
publish: { id: i, saveFirst: A, disabled: !Y || !v },
|
|
1308
1309
|
headerActions: n && /* @__PURE__ */ o(D, { children: [
|
|
1309
1310
|
/* @__PURE__ */ e(Ye, { kind: "function", id: i }),
|
|
1310
1311
|
/* @__PURE__ */ e(De, { onClick: le })
|
|
@@ -1393,7 +1394,7 @@ function dt(t) {
|
|
|
1393
1394
|
inputs: c,
|
|
1394
1395
|
disabled: !v,
|
|
1395
1396
|
invalid: !v,
|
|
1396
|
-
saveFirst:
|
|
1397
|
+
saveFirst: A
|
|
1397
1398
|
}
|
|
1398
1399
|
),
|
|
1399
1400
|
P && /* @__PURE__ */ e(
|
|
@@ -1422,7 +1423,7 @@ function dt(t) {
|
|
|
1422
1423
|
guard: (p) => me(p, te).blockedReason,
|
|
1423
1424
|
onSave: () => void l(),
|
|
1424
1425
|
saving: a.saving,
|
|
1425
|
-
error:
|
|
1426
|
+
error: z,
|
|
1426
1427
|
editorLabel: "Function definition JSON"
|
|
1427
1428
|
}
|
|
1428
1429
|
)
|
|
@@ -1431,11 +1432,11 @@ function dt(t) {
|
|
|
1431
1432
|
) }) });
|
|
1432
1433
|
}
|
|
1433
1434
|
function ct(t) {
|
|
1434
|
-
const { id: i, inputs: a } = t, [h, d] = g({}), [n, c] = g(void 0), [I, v] = g(null), [N, m] = g(!1), y = we(), s =
|
|
1435
|
+
const { id: i, inputs: a } = t, [h, d] = g({}), [n, c] = g(void 0), [I, v] = g(null), [N, m] = g(!1), y = we(), s = Mn();
|
|
1435
1436
|
async function P() {
|
|
1436
1437
|
const u = {};
|
|
1437
1438
|
for (const r of a) {
|
|
1438
|
-
const b =
|
|
1439
|
+
const b = Je(r.type, h[r.key] ?? "");
|
|
1439
1440
|
b !== void 0 && (u[r.key] = b);
|
|
1440
1441
|
}
|
|
1441
1442
|
m(!0);
|
|
@@ -1517,8 +1518,8 @@ function ct(t) {
|
|
|
1517
1518
|
}
|
|
1518
1519
|
export {
|
|
1519
1520
|
At as DocumentEditor,
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1521
|
+
jt as EndpointEditor,
|
|
1522
|
+
Mt as FunctionEditor,
|
|
1523
|
+
Wt as WorkflowEditor
|
|
1523
1524
|
};
|
|
1524
1525
|
//# sourceMappingURL=editors.mjs.map
|