@kestra-io/ui-libs 0.0.276 → 0.0.278
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/{FlowYamlUtils-iwOU9gyM.cjs → FlowYamlUtils-BR3BpHdP.cjs} +3 -3
- package/dist/{FlowYamlUtils-iwOU9gyM.cjs.map → FlowYamlUtils-BR3BpHdP.cjs.map} +1 -1
- package/dist/{FlowYamlUtils-BGPYSdJC.js → FlowYamlUtils-C3eJz7Bx.js} +42 -39
- package/dist/FlowYamlUtils-C3eJz7Bx.js.map +1 -0
- package/dist/{VueFlowUtils-CRaNW-OV.js → VueFlowUtils-BggSZjHw.js} +2 -2
- package/dist/{VueFlowUtils-CRaNW-OV.js.map → VueFlowUtils-BggSZjHw.js.map} +1 -1
- package/dist/{VueFlowUtils-BkJ3LZKs.cjs → VueFlowUtils-BjgsYtwb.cjs} +2 -2
- package/dist/{VueFlowUtils-BkJ3LZKs.cjs.map → VueFlowUtils-BjgsYtwb.cjs.map} +1 -1
- package/dist/kestra-flowyamlutils.cjs.js +1 -1
- package/dist/kestra-flowyamlutils.es.js +1 -1
- package/dist/kestra-index.cjs.js +5 -21
- package/dist/kestra-index.cjs.js.map +1 -1
- package/dist/kestra-index.es.js +6 -26
- package/dist/kestra-index.es.js.map +1 -1
- package/dist/kestra-vueflowutils.cjs.js +1 -1
- package/dist/kestra-vueflowutils.es.js +2 -2
- package/dist/ui-libs.css +1 -1
- package/dist/utils/FlowYamlUtils.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/utils/FlowYamlUtils.test.ts +26 -0
- package/src/utils/FlowYamlUtils.ts +6 -1
- package/dist/FlowYamlUtils-BGPYSdJC.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { load as Oi, dump as Pi } from "js-yaml";
|
|
2
|
-
import { visit as m, Document as $, isSeq as j, parseDocument as
|
|
2
|
+
import { visit as m, Document as $, isSeq as j, parseDocument as A, isMap as C, isPair as _t, LineCounter as ce, Pair as W, Scalar as B, YAMLMap as Ba, YAMLSeq as fe } from "yaml";
|
|
3
3
|
var ue = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
4
4
|
function Di(e) {
|
|
5
5
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -1318,7 +1318,7 @@ function P({ source: e, section: r }) {
|
|
|
1318
1318
|
return { yamlDoc: t, sectionNode: n };
|
|
1319
1319
|
}
|
|
1320
1320
|
function F(e) {
|
|
1321
|
-
return
|
|
1321
|
+
return A(e);
|
|
1322
1322
|
}
|
|
1323
1323
|
function ro({ yamlDoc: e, section: r }) {
|
|
1324
1324
|
return e.contents?.items?.find(
|
|
@@ -1373,7 +1373,7 @@ function to({ source: e, section: r, key: t, keyName: n }) {
|
|
|
1373
1373
|
keyName: n,
|
|
1374
1374
|
key: t
|
|
1375
1375
|
});
|
|
1376
|
-
return i === void 0 ? void 0 : new $(i).toString(
|
|
1376
|
+
return i === void 0 ? void 0 : new $(i).toString(q);
|
|
1377
1377
|
}
|
|
1378
1378
|
function O({ yamlDoc: e, keyName: r, key: t, callback: n }) {
|
|
1379
1379
|
function a(s) {
|
|
@@ -1402,7 +1402,7 @@ function qo({ source: e, path: r }) {
|
|
|
1402
1402
|
path: r
|
|
1403
1403
|
});
|
|
1404
1404
|
if (t)
|
|
1405
|
-
return new $(t).toString(
|
|
1405
|
+
return new $(t).toString(q);
|
|
1406
1406
|
}
|
|
1407
1407
|
function no({ yamlDoc: e, path: r, callback: t }) {
|
|
1408
1408
|
const n = re(r), a = e.getIn(n);
|
|
@@ -1415,11 +1415,14 @@ function no({ yamlDoc: e, path: r, callback: t }) {
|
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
1417
|
function Ao({ source: e, path: r, newContent: t }) {
|
|
1418
|
-
const n = F(e), a =
|
|
1419
|
-
|
|
1418
|
+
const n = F(e), a = re(r);
|
|
1419
|
+
if (t === "")
|
|
1420
|
+
return n.deleteIn(a), n.toString(q);
|
|
1421
|
+
const i = n.createNode(A(t)), s = !n.hasIn(a);
|
|
1422
|
+
return n.setIn(a, i), s && a.length === 1 && n.contents && C(n.contents) && n.contents.items.sort((o, u) => ni(o.key.value ?? o.key, u.key.value ?? o.key)), n.toString(q);
|
|
1420
1423
|
}
|
|
1421
1424
|
function ao({ source: e, section: r, keyName: t, key: n, newContent: a }) {
|
|
1422
|
-
const { yamlDoc: i, sectionNode: s } = P({ source: e, section: r }), o = i.createNode(
|
|
1425
|
+
const { yamlDoc: i, sectionNode: s } = P({ source: e, section: r }), o = i.createNode(A(a));
|
|
1423
1426
|
if (s)
|
|
1424
1427
|
return O({
|
|
1425
1428
|
yamlDoc: s,
|
|
@@ -1431,7 +1434,7 @@ function ao({ source: e, section: r, keyName: t, key: n, newContent: a }) {
|
|
|
1431
1434
|
o
|
|
1432
1435
|
), o;
|
|
1433
1436
|
}
|
|
1434
|
-
}), i.toString(
|
|
1437
|
+
}), i.toString(q);
|
|
1435
1438
|
}
|
|
1436
1439
|
function io(e, r) {
|
|
1437
1440
|
for (const t of e.items)
|
|
@@ -1455,7 +1458,7 @@ function So({ source: e, section: r, key1: t, key2: n, keyName: a }) {
|
|
|
1455
1458
|
messageOptions: { taskId: n }
|
|
1456
1459
|
};
|
|
1457
1460
|
}
|
|
1458
|
-
}), O({ yamlDoc: s, keyName: a, key: t, callback: () => u }), O({ yamlDoc: s, keyName: a, key: n, callback: () => o }), i.toString(
|
|
1461
|
+
}), O({ yamlDoc: s, keyName: a, key: t, callback: () => u }), O({ yamlDoc: s, keyName: a, key: n, callback: () => o }), i.toString(q));
|
|
1459
1462
|
}
|
|
1460
1463
|
function Io({
|
|
1461
1464
|
source: e,
|
|
@@ -1468,7 +1471,7 @@ function Io({
|
|
|
1468
1471
|
subBlockName: o
|
|
1469
1472
|
}) {
|
|
1470
1473
|
s || (s = "id"), o || (o = r), a || (a = "after");
|
|
1471
|
-
const { yamlDoc: u, sectionNode: c } = P({ source: e, section: r }), l = u.createNode(
|
|
1474
|
+
const { yamlDoc: u, sectionNode: c } = P({ source: e, section: r }), l = u.createNode(A(t)), f = i && c ? O({ yamlDoc: c, keyName: s, key: i })?.contents : c;
|
|
1472
1475
|
if (!f && i)
|
|
1473
1476
|
throw new Error(`Parent block with ID ${i} not found in ${r}`);
|
|
1474
1477
|
if (!f || i && !f.get(o)) {
|
|
@@ -1476,9 +1479,9 @@ function Io({
|
|
|
1476
1479
|
y.items.push(l);
|
|
1477
1480
|
const b = new W(new B(o), y);
|
|
1478
1481
|
if (!i)
|
|
1479
|
-
return u.contents?.items.push(b), u.toString(
|
|
1482
|
+
return u.contents?.items.push(b), u.toString(q);
|
|
1480
1483
|
if (f && !f.get(o))
|
|
1481
|
-
return f.items.push(b), u.toString(
|
|
1484
|
+
return f.items.push(b), u.toString(q);
|
|
1482
1485
|
}
|
|
1483
1486
|
const v = n ?? (a === "after" ? oo({ source: e, section: r, parentKey: i, keyName: s, subBlockName: o }) : f.items?.[0]?.get(s));
|
|
1484
1487
|
let _ = !1;
|
|
@@ -1494,7 +1497,7 @@ function Io({
|
|
|
1494
1497
|
}
|
|
1495
1498
|
}
|
|
1496
1499
|
}
|
|
1497
|
-
}), wt(u).toString(
|
|
1500
|
+
}), wt(u).toString(q);
|
|
1498
1501
|
}
|
|
1499
1502
|
function ai(e, r, t, n, a = "after") {
|
|
1500
1503
|
if (n === void 0)
|
|
@@ -1516,22 +1519,22 @@ function To({
|
|
|
1516
1519
|
parentPath: a
|
|
1517
1520
|
}) {
|
|
1518
1521
|
n || (n = "after");
|
|
1519
|
-
const i = F(e), s = i.createNode(
|
|
1522
|
+
const i = F(e), s = i.createNode(A(r)), o = re(a), u = i.getIn(o);
|
|
1520
1523
|
if (!u) {
|
|
1521
1524
|
const l = new fe();
|
|
1522
1525
|
l.add(s);
|
|
1523
1526
|
const f = a.split(".").pop(), v = new W(new B(f), l);
|
|
1524
1527
|
if (f.length === a.length)
|
|
1525
|
-
return i.contents?.items.push(v), i.toString(
|
|
1528
|
+
return i.contents?.items.push(v), i.toString(q);
|
|
1526
1529
|
{
|
|
1527
1530
|
const _ = a.substring(0, a.length - f.length - 1), y = i.getIn(re(_));
|
|
1528
1531
|
if (!y)
|
|
1529
1532
|
throw new Error(`Parent block with path ${_} not found`);
|
|
1530
|
-
return y.items.push(v), i.toString(
|
|
1533
|
+
return y.items.push(v), i.toString(q);
|
|
1531
1534
|
}
|
|
1532
1535
|
}
|
|
1533
1536
|
const c = ai(i, u, o, t);
|
|
1534
|
-
return n === "before" ? u.items.splice(c, 0, s) : u.items.splice(c + 1, 0, s), i.toString(
|
|
1537
|
+
return n === "before" ? u.items.splice(c, 0, s) : u.items.splice(c + 1, 0, s), i.toString(q);
|
|
1535
1538
|
}
|
|
1536
1539
|
function so({ source: e, section: r, key: t, keyName: n }) {
|
|
1537
1540
|
n || (n = "id");
|
|
@@ -1550,14 +1553,14 @@ function so({ source: e, section: r, key: t, keyName: n }) {
|
|
|
1550
1553
|
if (j(s.value) && s.value.items.length === 0)
|
|
1551
1554
|
return m.REMOVE;
|
|
1552
1555
|
}
|
|
1553
|
-
}), a.toString(
|
|
1556
|
+
}), a.toString(q);
|
|
1554
1557
|
}
|
|
1555
1558
|
function Co({ source: e, path: r }) {
|
|
1556
1559
|
const t = F(e), n = re(r), a = n.slice(0, -1), i = t.getIn(a);
|
|
1557
1560
|
if (!i)
|
|
1558
1561
|
return e;
|
|
1559
1562
|
const s = ai(t, i, n.slice(0, -1), n[n.length - 1]);
|
|
1560
|
-
return i.items.length === 1 ? t.deleteIn(a) : i.items.splice(s, 1), t.toString(
|
|
1563
|
+
return i.items.length === 1 ? t.deleteIn(a) : i.items.splice(s, 1), t.toString(q);
|
|
1561
1564
|
}
|
|
1562
1565
|
function Ka(e, r, t, n, a) {
|
|
1563
1566
|
const { sectionNode: i } = P({ source: e, section: r });
|
|
@@ -1583,7 +1586,7 @@ function jo(e, r, t) {
|
|
|
1583
1586
|
const a = n.getIn(["namespace"], !0);
|
|
1584
1587
|
a ? a.value = t : n.contents.items.unshift(new W(new B("namespace"), new B(t)));
|
|
1585
1588
|
const i = n.getIn(["id"], !0);
|
|
1586
|
-
return i ? i.value = r : n.contents.items.unshift(new W(new B("id"), new B(r))), n.toString(
|
|
1589
|
+
return i ? i.value = r : n.contents.items.unshift(new W(new B("id"), new B(r))), n.toString(q);
|
|
1587
1590
|
}
|
|
1588
1591
|
function wo({ source: e, section: r, newContent: t, keyName: n }) {
|
|
1589
1592
|
const { sectionNode: a } = P({ source: e, section: r }), i = ti(t);
|
|
@@ -1612,7 +1615,7 @@ function oo({ source: e, section: r, parentKey: t, keyName: n, subBlockName: a }
|
|
|
1612
1615
|
return i[r]?.[i?.[r]?.length - 1]?.[n];
|
|
1613
1616
|
}
|
|
1614
1617
|
function Oo(e, r) {
|
|
1615
|
-
const t =
|
|
1618
|
+
const t = A(e);
|
|
1616
1619
|
if (!t?.contents?.items)
|
|
1617
1620
|
return e;
|
|
1618
1621
|
for (const n in r)
|
|
@@ -1621,7 +1624,7 @@ function Oo(e, r) {
|
|
|
1621
1624
|
).value = r[n] : t.contents.items.push(
|
|
1622
1625
|
new W(new B(n), r[n])
|
|
1623
1626
|
);
|
|
1624
|
-
return wt(t).toString(
|
|
1627
|
+
return wt(t).toString(q);
|
|
1625
1628
|
}
|
|
1626
1629
|
const ii = [
|
|
1627
1630
|
"tasks",
|
|
@@ -1665,10 +1668,10 @@ function wt(e) {
|
|
|
1665
1668
|
}
|
|
1666
1669
|
function Po(e) {
|
|
1667
1670
|
const r = F(e);
|
|
1668
|
-
return wt(r).toString(
|
|
1671
|
+
return wt(r).toString(q);
|
|
1669
1672
|
}
|
|
1670
1673
|
function Do(e) {
|
|
1671
|
-
const r =
|
|
1674
|
+
const r = A(e);
|
|
1672
1675
|
if (!r.contents?.items) return {};
|
|
1673
1676
|
const t = {};
|
|
1674
1677
|
for (const n of r.contents.items)
|
|
@@ -1676,11 +1679,11 @@ function Do(e) {
|
|
|
1676
1679
|
return t;
|
|
1677
1680
|
}
|
|
1678
1681
|
function xo(e, r) {
|
|
1679
|
-
const t =
|
|
1682
|
+
const t = A(e);
|
|
1680
1683
|
if (!t.contents.items)
|
|
1681
1684
|
return e;
|
|
1682
1685
|
const n = t.contents.items.find((a) => a.key.value === r);
|
|
1683
|
-
return n && t.contents.items.splice(t.contents.items.indexOf(n), 1), t.toString(
|
|
1686
|
+
return n && t.contents.items.splice(t.contents.items.indexOf(n), 1), t.toString(q);
|
|
1684
1687
|
}
|
|
1685
1688
|
function Eo(e) {
|
|
1686
1689
|
const { sectionNode: r } = P({ source: e, section: "tasks" });
|
|
@@ -1696,7 +1699,7 @@ function Lo(e, r) {
|
|
|
1696
1699
|
return so({ source: e, section: "pluginDefaults", key: r, keyName: "type" });
|
|
1697
1700
|
}
|
|
1698
1701
|
function Ko(e, r, t) {
|
|
1699
|
-
const n =
|
|
1702
|
+
const n = A(e), a = n.createNode(A(r));
|
|
1700
1703
|
let i = !1;
|
|
1701
1704
|
return m(n, {
|
|
1702
1705
|
Map(s, o) {
|
|
@@ -1714,10 +1717,10 @@ function Ko(e, r, t) {
|
|
|
1714
1717
|
return i = !0, o;
|
|
1715
1718
|
}
|
|
1716
1719
|
}
|
|
1717
|
-
}), n.toString(
|
|
1720
|
+
}), n.toString(q);
|
|
1718
1721
|
}
|
|
1719
1722
|
function si(e, r, t = (i, s) => !0, n = (i) => !0, a = !1) {
|
|
1720
|
-
const i =
|
|
1723
|
+
const i = A(e), s = [];
|
|
1721
1724
|
return m(i, {
|
|
1722
1725
|
Map(o, u, c) {
|
|
1723
1726
|
if (t(
|
|
@@ -1750,7 +1753,7 @@ function fo(e, r = []) {
|
|
|
1750
1753
|
}
|
|
1751
1754
|
function Bo(e, r, t) {
|
|
1752
1755
|
const n = fo(e, t), a = new ce();
|
|
1753
|
-
|
|
1756
|
+
A(e, { lineCounter: a });
|
|
1754
1757
|
const i = a.lineStarts[r.lineNumber - 1] + r.column;
|
|
1755
1758
|
for (const s of n.reverse())
|
|
1756
1759
|
if (i >= s.range[0])
|
|
@@ -1759,7 +1762,7 @@ function Bo(e, r, t) {
|
|
|
1759
1762
|
}
|
|
1760
1763
|
function Fo(e, r) {
|
|
1761
1764
|
const t = lo(e), n = new ce();
|
|
1762
|
-
|
|
1765
|
+
A(e, { lineCounter: n });
|
|
1763
1766
|
const a = n.lineStarts[r.lineNumber - 1] + r.column;
|
|
1764
1767
|
for (const i of t.reverse())
|
|
1765
1768
|
if (a >= i.range[0])
|
|
@@ -1769,7 +1772,7 @@ function Fo(e, r) {
|
|
|
1769
1772
|
function lo(e) {
|
|
1770
1773
|
return si(e, "version", () => !0, () => !0, !0);
|
|
1771
1774
|
}
|
|
1772
|
-
const
|
|
1775
|
+
const q = {
|
|
1773
1776
|
lineWidth: 0
|
|
1774
1777
|
}, oi = "([^:\\n]+): *", vo = new RegExp(
|
|
1775
1778
|
`(( *)(?:${oi})?)[^\\n]*?$`
|
|
@@ -1810,7 +1813,7 @@ function Go(e, r) {
|
|
|
1810
1813
|
a = l?.key, s = l?.valueStartIndex;
|
|
1811
1814
|
} else
|
|
1812
1815
|
s = t.lastIndexOf(a + ":") + a.length + 1;
|
|
1813
|
-
const o =
|
|
1816
|
+
const o = A(e), u = [];
|
|
1814
1817
|
return m(o, {
|
|
1815
1818
|
Pair(l, f, v) {
|
|
1816
1819
|
if (f.value?.range !== void 0 && f.key.value === a) {
|
|
@@ -1831,7 +1834,7 @@ function Go(e, r) {
|
|
|
1831
1834
|
).sort((l, f) => f.range[0] - l.range[0])?.[0];
|
|
1832
1835
|
}
|
|
1833
1836
|
function No(e) {
|
|
1834
|
-
const r =
|
|
1837
|
+
const r = A(e), t = [];
|
|
1835
1838
|
return m(r, {
|
|
1836
1839
|
Map(n, a) {
|
|
1837
1840
|
if (a.items) {
|
|
@@ -1844,8 +1847,8 @@ function No(e) {
|
|
|
1844
1847
|
}), t;
|
|
1845
1848
|
}
|
|
1846
1849
|
function Uo(e, r) {
|
|
1847
|
-
const t =
|
|
1848
|
-
|
|
1850
|
+
const t = A(e), n = new ce();
|
|
1851
|
+
A(e, { lineCounter: n });
|
|
1849
1852
|
const a = n.lineStarts[r.lineNumber - 1] + r.column;
|
|
1850
1853
|
let i;
|
|
1851
1854
|
return m(t, {
|
|
@@ -1863,8 +1866,8 @@ function Uo(e, r) {
|
|
|
1863
1866
|
}
|
|
1864
1867
|
function Vo(e) {
|
|
1865
1868
|
const r = e + `
|
|
1866
|
-
`, t =
|
|
1867
|
-
|
|
1869
|
+
`, t = A(r), n = new ce();
|
|
1870
|
+
A(r, { lineCounter: n });
|
|
1868
1871
|
let a = {};
|
|
1869
1872
|
return m(t, {
|
|
1870
1873
|
Map(i, s) {
|
|
@@ -1989,4 +1992,4 @@ export {
|
|
|
1989
1992
|
Io as y,
|
|
1990
1993
|
ao as z
|
|
1991
1994
|
};
|
|
1992
|
-
//# sourceMappingURL=FlowYamlUtils-
|
|
1995
|
+
//# sourceMappingURL=FlowYamlUtils-C3eJz7Bx.js.map
|