@cloud-cli/on 0.1.6 → 0.1.7

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.
Files changed (2) hide show
  1. package/dist/on.js +98 -97
  2. package/package.json +1 -1
package/dist/on.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { parseArgs as As } from "node:util";
3
3
  import { createServer as vs } from "node:http";
4
- import { readFile as nt, writeFile as $s, mkdtemp as Ls, rm as Cs } from "node:fs/promises";
4
+ import { readFile as je, writeFile as $s, mkdtemp as Ls, rm as Cs } from "node:fs/promises";
5
5
  import Nt, { join as it } from "node:path";
6
6
  import { spawn as Ut } from "node:child_process";
7
7
  import { mkdirSync as js, existsSync as Bs } from "node:fs";
@@ -32,7 +32,7 @@ function qt(s) {
32
32
  }
33
33
  }) : s ?? "";
34
34
  }
35
- function je(s, e) {
35
+ function Be(s, e) {
36
36
  const t = Function(
37
37
  "context",
38
38
  "const { secrets = {}, inputs = {}, step = {}, env } = context;return `" + s + "`;"
@@ -44,10 +44,10 @@ function xs(s, e) {
44
44
  return { ...s };
45
45
  const t = { inputs: s };
46
46
  for (const [n, i] of Object.entries(e))
47
- t.inputs[n] = je(`\${${i}}`, t);
47
+ t.inputs[n] = Be(`\${${i}}`, t);
48
48
  return t.inputs;
49
49
  }
50
- const ot = /* @__PURE__ */ Symbol.for("yaml.alias"), Xe = /* @__PURE__ */ Symbol.for("yaml.document"), J = /* @__PURE__ */ Symbol.for("yaml.map"), Vt = /* @__PURE__ */ Symbol.for("yaml.pair"), R = /* @__PURE__ */ Symbol.for("yaml.scalar"), le = /* @__PURE__ */ Symbol.for("yaml.seq"), D = /* @__PURE__ */ Symbol.for("yaml.node.type"), Q = (s) => !!s && typeof s == "object" && s[D] === ot, Be = (s) => !!s && typeof s == "object" && s[D] === Xe, be = (s) => !!s && typeof s == "object" && s[D] === J, $ = (s) => !!s && typeof s == "object" && s[D] === Vt, I = (s) => !!s && typeof s == "object" && s[D] === R, we = (s) => !!s && typeof s == "object" && s[D] === le;
50
+ const ot = /* @__PURE__ */ Symbol.for("yaml.alias"), ze = /* @__PURE__ */ Symbol.for("yaml.document"), J = /* @__PURE__ */ Symbol.for("yaml.map"), Vt = /* @__PURE__ */ Symbol.for("yaml.pair"), R = /* @__PURE__ */ Symbol.for("yaml.scalar"), le = /* @__PURE__ */ Symbol.for("yaml.seq"), D = /* @__PURE__ */ Symbol.for("yaml.node.type"), Q = (s) => !!s && typeof s == "object" && s[D] === ot, Me = (s) => !!s && typeof s == "object" && s[D] === ze, be = (s) => !!s && typeof s == "object" && s[D] === J, $ = (s) => !!s && typeof s == "object" && s[D] === Vt, I = (s) => !!s && typeof s == "object" && s[D] === R, we = (s) => !!s && typeof s == "object" && s[D] === le;
51
51
  function A(s) {
52
52
  if (s && typeof s == "object")
53
53
  switch (s[D]) {
@@ -71,7 +71,7 @@ function v(s) {
71
71
  const Jt = (s) => (I(s) || A(s)) && !!s.anchor, Y = /* @__PURE__ */ Symbol("break visit"), Ks = /* @__PURE__ */ Symbol("skip children"), pe = /* @__PURE__ */ Symbol("remove node");
72
72
  function ae(s, e) {
73
73
  const t = Rs(e);
74
- Be(s) ? ee(null, s.contents, t, Object.freeze([s])) === pe && (s.contents = null) : ee(null, s, t, Object.freeze([]));
74
+ Me(s) ? ee(null, s.contents, t, Object.freeze([s])) === pe && (s.contents = null) : ee(null, s, t, Object.freeze([]));
75
75
  }
76
76
  ae.BREAK = Y;
77
77
  ae.SKIP = Ks;
@@ -142,7 +142,7 @@ function Fs(s, e, t) {
142
142
  n.items[s] = t;
143
143
  else if ($(n))
144
144
  s === "key" ? n.key = t : n.value = t;
145
- else if (Be(n))
145
+ else if (Me(n))
146
146
  n.contents = t;
147
147
  else {
148
148
  const i = Q(n) ? "alias" : "scalar";
@@ -367,7 +367,7 @@ class lt {
367
367
  }
368
368
  /** A plain JavaScript representation of this node. */
369
369
  toJS(e, { mapAsMap: t, maxAliasCount: n, onAnchor: i, reviver: r } = {}) {
370
- if (!Be(e))
370
+ if (!Me(e))
371
371
  throw new TypeError("A document argument is required");
372
372
  const o = {
373
373
  anchors: /* @__PURE__ */ new Map(),
@@ -487,7 +487,7 @@ function Gs(s, e, t) {
487
487
  return t.find((n) => n.identify?.(s) && !n.format);
488
488
  }
489
489
  function ge(s, e, t) {
490
- if (Be(s) && (s = s.contents), v(s))
490
+ if (Me(s) && (s = s.contents), v(s))
491
491
  return s;
492
492
  if ($(s)) {
493
493
  const u = t.schema[J].createNode?.(t.schema, null, t);
@@ -637,8 +637,8 @@ function U(s, e) {
637
637
  const G = (s, e, t) => s.endsWith(`
638
638
  `) ? U(t, e) : t.includes(`
639
639
  `) ? `
640
- ` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t, Xt = "flow", ze = "block", ve = "quoted";
641
- function Me(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: l } = {}) {
640
+ ` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t, Xt = "flow", Ze = "block", ve = "quoted";
641
+ function Pe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: l } = {}) {
642
642
  if (!i || i < 0)
643
643
  return s;
644
644
  i < r && (r = 0);
@@ -649,7 +649,7 @@ function Me(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
649
649
  let u = i - e.length;
650
650
  typeof n == "number" && (n > i - Math.max(2, r) ? c.push(0) : u = i - n);
651
651
  let f, p, g = !1, h = -1, m = -1, b = -1;
652
- t === ze && (h = Ot(s, h, e.length), h !== -1 && (u = h + a));
652
+ t === Ze && (h = Ot(s, h, e.length), h !== -1 && (u = h + a));
653
653
  for (let S; S = s[h += 1]; ) {
654
654
  if (t === ve && S === "\\") {
655
655
  switch (m = h, s[h + 1]) {
@@ -669,7 +669,7 @@ function Me(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
669
669
  }
670
670
  if (S === `
671
671
  `)
672
- t === ze && (h = Ot(s, h, e.length)), u = h + e.length + a, f = void 0;
672
+ t === Ze && (h = Ot(s, h, e.length)), u = h + e.length + a, f = void 0;
673
673
  else {
674
674
  if (S === " " && p && p !== " " && p !== `
675
675
  ` && p !== " ") {
@@ -718,11 +718,11 @@ function Ot(s, e, t) {
718
718
  }
719
719
  return n;
720
720
  }
721
- const Pe = (s, e) => ({
721
+ const De = (s, e) => ({
722
722
  indentAtStart: e ? s.indent.length : s.indentAtStart,
723
723
  lineWidth: s.options.lineWidth,
724
724
  minContentWidth: s.options.minContentWidth
725
- }), De = (s) => /^(%|---|\.\.\.)/m.test(s);
725
+ }), xe = (s) => /^(%|---|\.\.\.)/m.test(s);
726
726
  function Ws(s, e, t) {
727
727
  if (!e || e < 0)
728
728
  return !1;
@@ -743,7 +743,7 @@ function me(s, e) {
743
743
  const t = JSON.stringify(s);
744
744
  if (e.options.doubleQuotedAsJSON)
745
745
  return t;
746
- const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (De(s) ? " " : "");
746
+ const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (xe(s) ? " " : "");
747
747
  let o = "", l = 0;
748
748
  for (let a = 0, c = t[a]; c; c = t[++a])
749
749
  if (c === " " && t[a + 1] === "\\" && t[a + 2] === "n" && (o += t.slice(l, a) + "\\ ", a += 1, l = a, c = "\\"), c === "\\")
@@ -798,15 +798,15 @@ function me(s, e) {
798
798
  default:
799
799
  a += 1;
800
800
  }
801
- return o = l ? o + t.slice(l) : t, n ? o : Me(o, r, ve, Pe(e, !1));
801
+ return o = l ? o + t.slice(l) : t, n ? o : Pe(o, r, ve, De(e, !1));
802
802
  }
803
- function Ze(s, e) {
803
+ function et(s, e) {
804
804
  if (e.options.singleQuote === !1 || e.implicitKey && s.includes(`
805
805
  `) || /[ \t]\n|\n[ \t]/.test(s))
806
806
  return me(s, e);
807
- const t = e.indent || (De(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
807
+ const t = e.indent || (xe(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
808
808
  ${t}`) + "'";
809
- return e.implicitKey ? n : Me(n, t, Xt, Pe(e, !1));
809
+ return e.implicitKey ? n : Pe(n, t, Xt, De(e, !1));
810
810
  }
811
811
  function se(s, e) {
812
812
  const { singleQuote: t } = e.options;
@@ -815,24 +815,24 @@ function se(s, e) {
815
815
  n = me;
816
816
  else {
817
817
  const i = s.includes('"'), r = s.includes("'");
818
- i && !r ? n = Ze : r && !i ? n = me : n = t ? Ze : me;
818
+ i && !r ? n = et : r && !i ? n = me : n = t ? et : me;
819
819
  }
820
820
  return n(s, e);
821
821
  }
822
- let et;
822
+ let tt;
823
823
  try {
824
- et = new RegExp(`(^|(?<!
824
+ tt = new RegExp(`(^|(?<!
825
825
  ))
826
826
  +(?!
827
827
  |$)`, "g");
828
828
  } catch {
829
- et = /\n+(?!\n|$)/g;
829
+ tt = /\n+(?!\n|$)/g;
830
830
  }
831
831
  function $e({ comment: s, type: e, value: t }, n, i, r) {
832
832
  const { blockQuote: o, commentString: l, lineWidth: a } = n.options;
833
833
  if (!o || /\n[\t ]+$/.test(t))
834
834
  return se(t, n);
835
- const c = n.indent || (n.forceBlockIndent || De(t) ? " " : ""), d = o === "literal" ? !0 : o === "folded" || e === N.BLOCK_FOLDED ? !1 : e === N.BLOCK_LITERAL ? !0 : !Ws(t, a, c.length);
835
+ const c = n.indent || (n.forceBlockIndent || xe(t) ? " " : ""), d = o === "literal" ? !0 : o === "folded" || e === N.BLOCK_FOLDED ? !1 : e === N.BLOCK_LITERAL ? !0 : !Ws(t, a, c.length);
836
836
  if (!t)
837
837
  return d ? `|
838
838
  ` : `>
@@ -848,7 +848,7 @@ function $e({ comment: s, type: e, value: t }, n, i, r) {
848
848
  const g = p.indexOf(`
849
849
  `);
850
850
  g === -1 ? u = "-" : t === p || g !== p.length - 1 ? (u = "+", r && r()) : u = "", p && (t = t.slice(0, -p.length), p[p.length - 1] === `
851
- ` && (p = p.slice(0, -1)), p = p.replace(et, `$&${c}`));
851
+ ` && (p = p.slice(0, -1)), p = p.replace(tt, `$&${c}`));
852
852
  let h = !1, m, b = -1;
853
853
  for (m = 0; m < t.length; ++m) {
854
854
  const _ = t[m];
@@ -867,11 +867,11 @@ function $e({ comment: s, type: e, value: t }, n, i, r) {
867
867
  const _ = t.replace(/\n+/g, `
868
868
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${c}`);
869
869
  let O = !1;
870
- const T = Pe(n, !0);
870
+ const T = De(n, !0);
871
871
  o !== "folded" && e !== N.BLOCK_FOLDED && (T.onOverflow = () => {
872
872
  O = !0;
873
873
  });
874
- const y = Me(`${w}${_}${p}`, c, ze, T);
874
+ const y = Pe(`${w}${_}${p}`, c, Ze, T);
875
875
  if (!O)
876
876
  return `>${k}
877
877
  ${c}${y}`;
@@ -890,7 +890,7 @@ function Qs(s, e, t, n) {
890
890
  if (!l && !d && i !== N.PLAIN && r.includes(`
891
891
  `))
892
892
  return $e(s, e, t, n);
893
- if (De(r)) {
893
+ if (xe(r)) {
894
894
  if (a === "")
895
895
  return e.forceBlockIndent = !0, $e(s, e, t, n);
896
896
  if (l && a === c)
@@ -903,7 +903,7 @@ ${a}`);
903
903
  if (g.some(f) || p?.some(f))
904
904
  return se(r, e);
905
905
  }
906
- return l ? u : Me(u, a, Xt, Pe(e, !1));
906
+ return l ? u : Pe(u, a, Xt, De(e, !1));
907
907
  }
908
908
  function ct(s, e, t, n) {
909
909
  const { implicitKey: i, inFlow: r } = e, o = typeof s.value == "string" ? s : Object.assign({}, s, { value: String(s.value) });
@@ -917,7 +917,7 @@ function ct(s, e, t, n) {
917
917
  case N.QUOTE_DOUBLE:
918
918
  return me(o.value, e);
919
919
  case N.QUOTE_SINGLE:
920
- return Ze(o.value, e);
920
+ return et(o.value, e);
921
921
  case N.PLAIN:
922
922
  return Qs(o, e, t, n);
923
923
  default:
@@ -1102,14 +1102,14 @@ const Ne = "<<", F = {
1102
1102
  function es(s, e, t) {
1103
1103
  if (t = s && Q(t) ? t.resolve(s.doc) : t, we(t))
1104
1104
  for (const n of t.items)
1105
- Ve(s, e, n);
1105
+ Je(s, e, n);
1106
1106
  else if (Array.isArray(t))
1107
1107
  for (const n of t)
1108
- Ve(s, e, n);
1108
+ Je(s, e, n);
1109
1109
  else
1110
- Ve(s, e, t);
1110
+ Je(s, e, t);
1111
1111
  }
1112
- function Ve(s, e, t) {
1112
+ function Je(s, e, t) {
1113
1113
  const n = s && Q(t) ? t.resolve(s.doc) : t;
1114
1114
  if (!be(n))
1115
1115
  throw new Error("Merge sources must be maps or map aliases");
@@ -1473,7 +1473,7 @@ const fe = {
1473
1473
  return we(s) || e("Expected a sequence for this tag"), s;
1474
1474
  },
1475
1475
  createNode: (s, e, t) => W.from(s, e, t)
1476
- }, xe = {
1476
+ }, Ke = {
1477
1477
  identify: (s) => typeof s == "string",
1478
1478
  default: !0,
1479
1479
  tag: "tag:yaml.org,2002:str",
@@ -1481,14 +1481,14 @@ const fe = {
1481
1481
  stringify(s, e, t, n) {
1482
1482
  return e = Object.assign({ actualString: !0 }, e), ct(s, e, t, n);
1483
1483
  }
1484
- }, Ke = {
1484
+ }, Re = {
1485
1485
  identify: (s) => s == null,
1486
1486
  createNode: () => new N(null),
1487
1487
  default: !0,
1488
1488
  tag: "tag:yaml.org,2002:null",
1489
1489
  test: /^(?:~|[Nn]ull|NULL)?$/,
1490
1490
  resolve: () => new N(null),
1491
- stringify: ({ source: s }, e) => typeof s == "string" && Ke.test.test(s) ? s : e.options.nullStr
1491
+ stringify: ({ source: s }, e) => typeof s == "string" && Re.test.test(s) ? s : e.options.nullStr
1492
1492
  }, ut = {
1493
1493
  identify: (s) => typeof s == "boolean",
1494
1494
  default: !0,
@@ -1548,13 +1548,13 @@ const ns = {
1548
1548
  return t !== -1 && s[s.length - 1] === "0" && (e.minFractionDigits = s.length - t - 1), e;
1549
1549
  },
1550
1550
  stringify: K
1551
- }, Re = (s) => typeof s == "bigint" || Number.isInteger(s), ht = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
1551
+ }, Ue = (s) => typeof s == "bigint" || Number.isInteger(s), ht = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
1552
1552
  function os(s, e, t) {
1553
1553
  const { value: n } = s;
1554
- return Re(n) && n >= 0 ? t + n.toString(e) : K(s);
1554
+ return Ue(n) && n >= 0 ? t + n.toString(e) : K(s);
1555
1555
  }
1556
1556
  const ls = {
1557
- identify: (s) => Re(s) && s >= 0,
1557
+ identify: (s) => Ue(s) && s >= 0,
1558
1558
  default: !0,
1559
1559
  tag: "tag:yaml.org,2002:int",
1560
1560
  format: "OCT",
@@ -1562,14 +1562,14 @@ const ls = {
1562
1562
  resolve: (s, e, t) => ht(s, 2, 8, t),
1563
1563
  stringify: (s) => os(s, 8, "0o")
1564
1564
  }, as = {
1565
- identify: Re,
1565
+ identify: Ue,
1566
1566
  default: !0,
1567
1567
  tag: "tag:yaml.org,2002:int",
1568
1568
  test: /^[-+]?[0-9]+$/,
1569
1569
  resolve: (s, e, t) => ht(s, 0, 10, t),
1570
1570
  stringify: K
1571
1571
  }, cs = {
1572
- identify: (s) => Re(s) && s >= 0,
1572
+ identify: (s) => Ue(s) && s >= 0,
1573
1573
  default: !0,
1574
1574
  tag: "tag:yaml.org,2002:int",
1575
1575
  format: "HEX",
@@ -1579,8 +1579,8 @@ const ls = {
1579
1579
  }, rn = [
1580
1580
  ce,
1581
1581
  fe,
1582
- xe,
1583
1582
  Ke,
1583
+ Re,
1584
1584
  ut,
1585
1585
  ls,
1586
1586
  as,
@@ -1830,7 +1830,7 @@ const ds = {
1830
1830
  },
1831
1831
  stringify: K
1832
1832
  }, Se = (s) => typeof s == "bigint" || Number.isInteger(s);
1833
- function Ue(s, e, t, { intAsBigInt: n }) {
1833
+ function Fe(s, e, t, { intAsBigInt: n }) {
1834
1834
  const i = s[0];
1835
1835
  if ((i === "-" || i === "+") && (e += 1), s = s.substring(e).replace(/_/g, ""), n) {
1836
1836
  switch (t) {
@@ -1864,7 +1864,7 @@ const hn = {
1864
1864
  tag: "tag:yaml.org,2002:int",
1865
1865
  format: "BIN",
1866
1866
  test: /^[-+]?0b[0-1_]+$/,
1867
- resolve: (s, e, t) => Ue(s, 2, 2, t),
1867
+ resolve: (s, e, t) => Fe(s, 2, 2, t),
1868
1868
  stringify: (s) => gt(s, 2, "0b")
1869
1869
  }, dn = {
1870
1870
  identify: Se,
@@ -1872,14 +1872,14 @@ const hn = {
1872
1872
  tag: "tag:yaml.org,2002:int",
1873
1873
  format: "OCT",
1874
1874
  test: /^[-+]?0[0-7_]+$/,
1875
- resolve: (s, e, t) => Ue(s, 1, 8, t),
1875
+ resolve: (s, e, t) => Fe(s, 1, 8, t),
1876
1876
  stringify: (s) => gt(s, 8, "0")
1877
1877
  }, pn = {
1878
1878
  identify: Se,
1879
1879
  default: !0,
1880
1880
  tag: "tag:yaml.org,2002:int",
1881
1881
  test: /^[-+]?[0-9][0-9_]*$/,
1882
- resolve: (s, e, t) => Ue(s, 0, 10, t),
1882
+ resolve: (s, e, t) => Fe(s, 0, 10, t),
1883
1883
  stringify: K
1884
1884
  }, mn = {
1885
1885
  identify: Se,
@@ -1887,7 +1887,7 @@ const hn = {
1887
1887
  tag: "tag:yaml.org,2002:int",
1888
1888
  format: "HEX",
1889
1889
  test: /^[-+]?0x[0-9a-fA-F_]+$/,
1890
- resolve: (s, e, t) => Ue(s, 2, 16, t),
1890
+ resolve: (s, e, t) => Fe(s, 2, 16, t),
1891
1891
  stringify: (s) => gt(s, 16, "0x")
1892
1892
  };
1893
1893
  class ie extends M {
@@ -1979,7 +1979,7 @@ const gs = {
1979
1979
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
1980
1980
  resolve: (s) => bt(s, !1),
1981
1981
  stringify: ms
1982
- }, Fe = {
1982
+ }, qe = {
1983
1983
  identify: (s) => s instanceof Date,
1984
1984
  default: !0,
1985
1985
  tag: "tag:yaml.org,2002:timestamp",
@@ -1988,7 +1988,7 @@ const gs = {
1988
1988
  // assumed to be 00:00:00Z (start of day, UTC).
1989
1989
  test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
1990
1990
  resolve(s) {
1991
- const e = s.match(Fe.test);
1991
+ const e = s.match(qe.test);
1992
1992
  if (!e)
1993
1993
  throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
1994
1994
  const [, t, n, i, r, o, l] = e.map(Number), a = e[7] ? Number((e[7] + "00").substr(1, 3)) : 0;
@@ -2004,8 +2004,8 @@ const gs = {
2004
2004
  }, Tt = [
2005
2005
  ce,
2006
2006
  fe,
2007
- xe,
2008
2007
  Ke,
2008
+ Re,
2009
2009
  ds,
2010
2010
  ps,
2011
2011
  hn,
@@ -2022,10 +2022,10 @@ const gs = {
2022
2022
  yt,
2023
2023
  gs,
2024
2024
  ys,
2025
- Fe
2025
+ qe
2026
2026
  ], It = /* @__PURE__ */ new Map([
2027
2027
  ["core", rn],
2028
- ["failsafe", [ce, fe, xe]],
2028
+ ["failsafe", [ce, fe, Ke]],
2029
2029
  ["json", an],
2030
2030
  ["yaml11", Tt],
2031
2031
  ["yaml-1.1", Tt]
@@ -2042,21 +2042,21 @@ const gs = {
2042
2042
  intTime: gs,
2043
2043
  map: ce,
2044
2044
  merge: F,
2045
- null: Ke,
2045
+ null: Re,
2046
2046
  omap: mt,
2047
2047
  pairs: pt,
2048
2048
  seq: fe,
2049
2049
  set: yt,
2050
- timestamp: Fe
2050
+ timestamp: qe
2051
2051
  }, gn = {
2052
2052
  "tag:yaml.org,2002:binary": dt,
2053
2053
  "tag:yaml.org,2002:merge": F,
2054
2054
  "tag:yaml.org,2002:omap": mt,
2055
2055
  "tag:yaml.org,2002:pairs": pt,
2056
2056
  "tag:yaml.org,2002:set": yt,
2057
- "tag:yaml.org,2002:timestamp": Fe
2057
+ "tag:yaml.org,2002:timestamp": qe
2058
2058
  };
2059
- function Je(s, e, t) {
2059
+ function Ye(s, e, t) {
2060
2060
  const n = It.get(e);
2061
2061
  if (n && !s)
2062
2062
  return t && !n.includes(F) ? n.concat(F) : n.slice();
@@ -2084,7 +2084,7 @@ function Je(s, e, t) {
2084
2084
  const yn = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
2085
2085
  class wt {
2086
2086
  constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: i, schema: r, sortMapEntries: o, toStringDefaults: l }) {
2087
- this.compat = Array.isArray(e) ? Je(e, "compat") : e ? Je(null, e) : null, this.name = typeof r == "string" && r || "core", this.knownTags = i ? gn : {}, this.tags = Je(t, this.name, n), this.toStringOptions = l ?? null, Object.defineProperty(this, J, { value: ce }), Object.defineProperty(this, R, { value: xe }), Object.defineProperty(this, le, { value: fe }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? yn : null;
2087
+ this.compat = Array.isArray(e) ? Ye(e, "compat") : e ? Ye(null, e) : null, this.name = typeof r == "string" && r || "core", this.knownTags = i ? gn : {}, this.tags = Ye(t, this.name, n), this.toStringOptions = l ?? null, Object.defineProperty(this, J, { value: ce }), Object.defineProperty(this, R, { value: Ke }), Object.defineProperty(this, le, { value: fe }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? yn : null;
2088
2088
  }
2089
2089
  clone() {
2090
2090
  const e = Object.create(wt.prototype, Object.getOwnPropertyDescriptors(this));
@@ -2134,9 +2134,9 @@ function bn(s, e) {
2134
2134
  `) + `
2135
2135
  `;
2136
2136
  }
2137
- class qe {
2137
+ class Ve {
2138
2138
  constructor(e, t, n) {
2139
- this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, D, { value: Xe });
2139
+ this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, D, { value: ze });
2140
2140
  let i = null;
2141
2141
  typeof t == "function" || Array.isArray(t) ? i = t : n === void 0 && t && (n = t, t = void 0);
2142
2142
  const r = Object.assign({
@@ -2159,8 +2159,8 @@ class qe {
2159
2159
  * Custom Node values that inherit from `Object` still refer to their original instances.
2160
2160
  */
2161
2161
  clone() {
2162
- const e = Object.create(qe.prototype, {
2163
- [D]: { value: Xe }
2162
+ const e = Object.create(Ve.prototype, {
2163
+ [D]: { value: ze }
2164
2164
  });
2165
2165
  return e.commentBefore = this.commentBefore, e.comment = this.comment, e.errors = this.errors.slice(), e.warnings = this.warnings.slice(), e.options = Object.assign({}, this.options), this.directives && (e.directives = this.directives.clone()), e.schema = this.schema.clone(), e.contents = v(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
2166
2166
  }
@@ -2476,7 +2476,7 @@ function ye(s) {
2476
2476
  return !0;
2477
2477
  }
2478
2478
  }
2479
- function tt(s, e, t) {
2479
+ function st(s, e, t) {
2480
2480
  if (e?.type === "flow-collection") {
2481
2481
  const n = e.end[0];
2482
2482
  n.indent === s && (n.source === "]" || n.source === "}") && ye(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
@@ -2513,7 +2513,7 @@ function Sn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2513
2513
  } else h.found?.indent !== n.indent && i(a, "BAD_INDENT", $t);
2514
2514
  t.atKey = !0;
2515
2515
  const b = h.end, w = f ? s(t, f, h, i) : e(t, b, u, null, h, i);
2516
- t.schema.compat && tt(n.indent, f, i), t.atKey = !1, ws(t, l.items, w) && i(b, "DUPLICATE_KEY", "Map keys must be unique");
2516
+ t.schema.compat && st(n.indent, f, i), t.atKey = !1, ws(t, l.items, w) && i(b, "DUPLICATE_KEY", "Map keys must be unique");
2517
2517
  const S = oe(p ?? [], {
2518
2518
  indicator: "map-value-ind",
2519
2519
  next: g,
@@ -2525,7 +2525,7 @@ function Sn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2525
2525
  if (a = S.end, S.found) {
2526
2526
  m && (g?.type === "block-map" && !S.hasNewline && i(a, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && h.start < S.found.offset - 1024 && i(w.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
2527
2527
  const k = g ? s(t, g, S, i) : e(t, a, p, null, S, i);
2528
- t.schema.compat && tt(n.indent, g, i), a = k.range[2];
2528
+ t.schema.compat && st(n.indent, g, i), a = k.range[2];
2529
2529
  const _ = new B(w, k);
2530
2530
  t.options.keepSourceTokens && (_.srcToken = d), l.items.push(_);
2531
2531
  } else {
@@ -2558,7 +2558,7 @@ function kn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2558
2558
  continue;
2559
2559
  }
2560
2560
  const p = u ? s(t, u, f, i) : e(t, f.end, d, null, f, i);
2561
- t.schema.compat && tt(n.indent, u, i), a = p.range[2], l.items.push(p);
2561
+ t.schema.compat && st(n.indent, u, i), a = p.range[2], l.items.push(p);
2562
2562
  }
2563
2563
  return l.range = [n.offset, a, c ?? a], l;
2564
2564
  }
@@ -2589,7 +2589,7 @@ function ke(s, e, t, n) {
2589
2589
  }
2590
2590
  return { comment: i, offset: e };
2591
2591
  }
2592
- const Ye = "Block collections are not allowed within flow collections", Ge = (s) => s && (s.type === "block-map" || s.type === "block-seq");
2592
+ const Ge = "Block collections are not allowed within flow collections", He = (s) => s && (s.type === "block-map" || s.type === "block-seq");
2593
2593
  function _n({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2594
2594
  const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = r?.nodeClass ?? (o ? M : W), c = new a(t.schema);
2595
2595
  c.flow = !0;
@@ -2642,11 +2642,11 @@ function _n({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2642
2642
  }
2643
2643
  if (!o && !k && !O.found) {
2644
2644
  const T = _ ? s(t, _, O, i) : e(t, O.end, k, null, O, i);
2645
- c.items.push(T), u = T.range[2], Ge(_) && i(T.range, "BLOCK_IN_FLOW", Ye);
2645
+ c.items.push(T), u = T.range[2], He(_) && i(T.range, "BLOCK_IN_FLOW", Ge);
2646
2646
  } else {
2647
2647
  t.atKey = !0;
2648
2648
  const T = O.end, y = S ? s(t, S, O, i) : e(t, T, w, null, O, i);
2649
- Ge(S) && i(y.range, "BLOCK_IN_FLOW", Ye), t.atKey = !1;
2649
+ He(S) && i(y.range, "BLOCK_IN_FLOW", Ge), t.atKey = !1;
2650
2650
  const L = oe(k ?? [], {
2651
2651
  flow: l,
2652
2652
  indicator: "map-value-ind",
@@ -2671,7 +2671,7 @@ function _n({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2671
2671
  }
2672
2672
  } else _ && ("source" in _ && _.source?.[0] === ":" ? i(_, "MISSING_CHAR", `Missing space after : in ${l}`) : i(L.start, "MISSING_CHAR", `Missing , or : between ${l} items`));
2673
2673
  const q = _ ? s(t, _, L, i) : L.found ? e(t, L.end, k, null, L, i) : null;
2674
- q ? Ge(_) && i(q.range, "BLOCK_IN_FLOW", Ye) : L.comment && (y.comment ? y.comment += `
2674
+ q ? He(_) && i(q.range, "BLOCK_IN_FLOW", Ge) : L.comment && (y.comment ? y.comment += `
2675
2675
  ` + L.comment : y.comment = L.comment);
2676
2676
  const X = new B(y, q);
2677
2677
  if (t.options.keepSourceTokens && (X.srcToken = b), o) {
@@ -2702,7 +2702,7 @@ function _n({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2702
2702
  c.range = [n.offset, h, h];
2703
2703
  return c;
2704
2704
  }
2705
- function He(s, e, t, n, i, r) {
2705
+ function We(s, e, t, n, i, r) {
2706
2706
  const o = t.type === "block-map" ? Sn(s, e, t, n, r) : t.type === "block-seq" ? kn(s, e, t, n, r) : _n(s, e, t, n, r), l = o.constructor;
2707
2707
  return i === "!" || i === l.tagName ? (o.tag = l.tagName, o) : (i && (o.tag = i), o);
2708
2708
  }
@@ -2714,16 +2714,16 @@ function Nn(s, e, t, n, i) {
2714
2714
  }
2715
2715
  const l = t.type === "block-map" ? "map" : t.type === "block-seq" ? "seq" : t.start.source === "{" ? "map" : "seq";
2716
2716
  if (!r || !o || o === "!" || o === M.tagName && l === "map" || o === W.tagName && l === "seq")
2717
- return He(s, e, t, i, o);
2717
+ return We(s, e, t, i, o);
2718
2718
  let a = e.schema.tags.find((f) => f.tag === o && f.collection === l);
2719
2719
  if (!a) {
2720
2720
  const f = e.schema.knownTags[o];
2721
2721
  if (f?.collection === l)
2722
2722
  e.schema.tags.push(Object.assign({}, f, { default: !1 })), a = f;
2723
2723
  else
2724
- return f ? i(r, "BAD_COLLECTION_TYPE", `${f.tag} used for ${l} collection, but expects ${f.collection ?? "scalar"}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), He(s, e, t, i, o);
2724
+ return f ? i(r, "BAD_COLLECTION_TYPE", `${f.tag} used for ${l} collection, but expects ${f.collection ?? "scalar"}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), We(s, e, t, i, o);
2725
2725
  }
2726
- const c = He(s, e, t, i, o, a), d = a.resolve?.(c, (f) => i(r, "TAG_RESOLVE_FAILED", f), e.options) ?? c, u = v(d) ? d : new N(d);
2726
+ const c = We(s, e, t, i, o, a), d = a.resolve?.(c, (f) => i(r, "TAG_RESOLVE_FAILED", f), e.options) ?? c, u = v(d) ? d : new N(d);
2727
2727
  return u.range = c.range, u.tag = o, a?.format && (u.format = a.format), u;
2728
2728
  }
2729
2729
  function On(s, e, t) {
@@ -3124,7 +3124,7 @@ function xn({ options: s }, { offset: e, source: t, end: n }, i) {
3124
3124
  return r.range = [e, o, l.offset], l.comment && (r.comment = l.comment), r;
3125
3125
  }
3126
3126
  function Kn(s, e, { offset: t, start: n, value: i, end: r }, o) {
3127
- const l = Object.assign({ _directives: e }, s), a = new qe(void 0, l), c = {
3127
+ const l = Object.assign({ _directives: e }, s), a = new Ve(void 0, l), c = {
3128
3128
  atKey: !1,
3129
3129
  atRoot: !0,
3130
3130
  directives: a.directives,
@@ -3280,12 +3280,12 @@ ${t.comment}` : t.comment;
3280
3280
  if (this.doc)
3281
3281
  this.decorate(this.doc, !0), yield this.doc, this.doc = null;
3282
3282
  else if (e) {
3283
- const n = Object.assign({ _directives: this.directives }, this.options), i = new qe(void 0, n);
3283
+ const n = Object.assign({ _directives: this.directives }, this.options), i = new Ve(void 0, n);
3284
3284
  this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), i.range = [0, t, t], this.decorate(i, !1), yield i;
3285
3285
  }
3286
3286
  }
3287
3287
  }
3288
- const Ns = "\uFEFF", Os = "", Es = "", st = "";
3288
+ const Ns = "\uFEFF", Os = "", Es = "", nt = "";
3289
3289
  function Un(s) {
3290
3290
  switch (s) {
3291
3291
  case Ns:
@@ -3294,7 +3294,7 @@ function Un(s) {
3294
3294
  return "doc-mode";
3295
3295
  case Es:
3296
3296
  return "flow-error-end";
3297
- case st:
3297
+ case nt:
3298
3298
  return "scalar";
3299
3299
  case "---":
3300
3300
  return "doc-start";
@@ -3361,7 +3361,7 @@ function x(s) {
3361
3361
  }
3362
3362
  }
3363
3363
  const Ct = new Set("0123456789ABCDEFabcdef"), Fn = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), Te = new Set(",[]{}"), qn = new Set(` ,[]{}
3364
- \r `), We = (s) => !s || qn.has(s);
3364
+ \r `), Qe = (s) => !s || qn.has(s);
3365
3365
  class Vn {
3366
3366
  constructor() {
3367
3367
  this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
@@ -3522,7 +3522,7 @@ class Vn {
3522
3522
  case "]":
3523
3523
  return yield* this.pushCount(1), "doc";
3524
3524
  case "*":
3525
- return yield* this.pushUntil(We), "doc";
3525
+ return yield* this.pushUntil(Qe), "doc";
3526
3526
  case '"':
3527
3527
  case "'":
3528
3528
  return yield* this.parseQuotedScalar();
@@ -3558,7 +3558,7 @@ class Vn {
3558
3558
  case "]":
3559
3559
  return yield* this.pushCount(1), this.flowKey = !0, this.flowLevel -= 1, this.flowLevel ? "flow" : "doc";
3560
3560
  case "*":
3561
- return yield* this.pushUntil(We), "flow";
3561
+ return yield* this.pushUntil(Qe), "flow";
3562
3562
  case '"':
3563
3563
  case "'":
3564
3564
  return this.flowKey = !0, yield* this.parseQuotedScalar();
@@ -3682,7 +3682,7 @@ class Vn {
3682
3682
  else
3683
3683
  break;
3684
3684
  } while (!0);
3685
- return yield st, yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
3685
+ return yield nt, yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
3686
3686
  }
3687
3687
  *parsePlainScalar() {
3688
3688
  const e = this.flowLevel > 0;
@@ -3711,7 +3711,7 @@ class Vn {
3711
3711
  break;
3712
3712
  t = n;
3713
3713
  }
3714
- return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield st, yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
3714
+ return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield nt, yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
3715
3715
  }
3716
3716
  *pushCount(e) {
3717
3717
  return e > 0 ? (yield this.buffer.substr(this.pos, e), this.pos += e, e) : 0;
@@ -3725,7 +3725,7 @@ class Vn {
3725
3725
  case "!":
3726
3726
  return (yield* this.pushTag()) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3727
3727
  case "&":
3728
- return (yield* this.pushUntil(We)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3728
+ return (yield* this.pushUntil(Qe)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3729
3729
  case "-":
3730
3730
  // this is an error
3731
3731
  case "?":
@@ -4474,7 +4474,7 @@ function Qn(s) {
4474
4474
  async function Xn(s) {
4475
4475
  if (!s)
4476
4476
  return { on: {} };
4477
- const e = Qn(s), t = await nt(e, "utf8");
4477
+ const e = Qn(s), t = await je(e, "utf8");
4478
4478
  return e.endsWith(".yaml") || e.endsWith(".yml") ? Wn(t) ?? { on: {} } : JSON.parse(t);
4479
4479
  }
4480
4480
  function zn(s) {
@@ -4491,7 +4491,7 @@ async function Zn(s) {
4491
4491
  for (const [t, n] of Object.entries(process.env))
4492
4492
  typeof n == "string" && (e[t] = n);
4493
4493
  for (const t of s ?? []) {
4494
- const n = await nt(t, "utf8");
4494
+ const n = await je(t, "utf8");
4495
4495
  if (t.endsWith(".json")) {
4496
4496
  const i = rt(JSON.parse(n));
4497
4497
  for (const [r, o] of Object.entries(i))
@@ -4502,7 +4502,7 @@ async function Zn(s) {
4502
4502
  }
4503
4503
  return e;
4504
4504
  }
4505
- var Qe = function(s, e) {
4505
+ var Xe = function(s, e) {
4506
4506
  return Object.defineProperty ? Object.defineProperty(s, "raw", { value: e }) : s.raw = e, s;
4507
4507
  }, E;
4508
4508
  (function(s) {
@@ -4632,7 +4632,7 @@ class ei {
4632
4632
  if (i != "[" && i != "]" && i != "(")
4633
4633
  return e.kind = E.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
4634
4634
  if (i == "[") {
4635
- this._csi_regex || (this._csi_regex = Mt(Pt || (Pt = Qe([`
4635
+ this._csi_regex || (this._csi_regex = Mt(Pt || (Pt = Xe([`
4636
4636
  ^ # beginning of line
4637
4637
  #
4638
4638
  # First attempt
@@ -4680,7 +4680,7 @@ class ei {
4680
4680
  return e.kind = E.Incomplete, e;
4681
4681
  if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";")
4682
4682
  return e.kind = E.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
4683
- this._osc_st || (this._osc_st = ti(Dt || (Dt = Qe([`
4683
+ this._osc_st || (this._osc_st = ti(Dt || (Dt = Xe([`
4684
4684
  (?: # legal sequence
4685
4685
  (\x1B\\) # ESC | # alternate
4686
4686
  (\x07) # BEL (what xterm did)
@@ -4722,7 +4722,7 @@ class ei {
4722
4722
  if (a[3])
4723
4723
  return e.kind = E.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
4724
4724
  }
4725
- this._osc_regex || (this._osc_regex = Mt(xt || (xt = Qe([`
4725
+ this._osc_regex || (this._osc_regex = Mt(xt || (xt = Xe([`
4726
4726
  ^ # beginning of line
4727
4727
  #
4728
4728
  \x1B]8; # OSC Hyperlink
@@ -4872,7 +4872,8 @@ async function si(s, e) {
4872
4872
  }
4873
4873
  async function ni(s) {
4874
4874
  try {
4875
- return await import(it(kt, `${s}.json`), { assert: { type: "json" } });
4875
+ const e = it(kt, `${s}.json`), t = await je(e, "utf8");
4876
+ return JSON.parse(t);
4876
4877
  } catch (e) {
4877
4878
  const t = e instanceof Error ? e.message : String(e);
4878
4879
  return console.error("Error reading report:", t), null;
@@ -4933,13 +4934,13 @@ function li(s, e) {
4933
4934
  if (typeof s.run != "string")
4934
4935
  throw new Error("Each workflow step must have a 'run' command string.");
4935
4936
  const t = e.workflow.defaults || {};
4936
- return s.image ||= t.image || oi, s.volumes ||= t.volumes || {}, s.args ||= t.args || [], s.run = je(s.run, { ...e, step: s }), s;
4937
+ return s.image ||= t.image || oi, s.volumes ||= t.volumes || {}, s.args ||= t.args || [], s.run = Be(s.run, { ...e, step: s }), s;
4937
4938
  }
4938
4939
  function ai(s, e) {
4939
4940
  return (s || []).flatMap(
4940
4941
  (t) => Object.entries(t).flatMap(([n, i]) => [
4941
4942
  `--${n}`,
4942
- je(String(i), e)
4943
+ Be(String(i), e)
4943
4944
  ])
4944
4945
  );
4945
4946
  }
@@ -4961,7 +4962,7 @@ function fi(s) {
4961
4962
  if (typeof e.env != "object")
4962
4963
  throw new Error("Workflow env field must be an object.");
4963
4964
  for (const [i, r] of Object.entries(e.env))
4964
- n[i] = je(r, s);
4965
+ n[i] = Be(r, s);
4965
4966
  }
4966
4967
  Object.assign(s.env, n);
4967
4968
  }
@@ -5058,7 +5059,7 @@ async function di(s, e, t) {
5058
5059
  console.warn(`Trigger file does not exist: ${s}`);
5059
5060
  return;
5060
5061
  }
5061
- const n = await nt(s, "utf8"), i = rt(JSON.parse(n));
5062
+ const n = await je(s, "utf8"), i = rt(JSON.parse(n));
5062
5063
  return await Is(i, e, t);
5063
5064
  }
5064
5065
  async function pi(s) {
@@ -5075,8 +5076,8 @@ async function pi(s) {
5075
5076
  return;
5076
5077
  }
5077
5078
  if (i.method === "GET" && i.url?.startsWith("/logs/")) {
5078
- const o = i.url.split("/logs/")[1], l = await ni(o), a = await Rt(l);
5079
- l ? (r.writeHead(200, { "Content-Type": "text/html" }), r.end(a)) : (r.writeHead(404, { "Content-Type": "text/html" }), r.end(Rt(null)));
5079
+ const o = i.url.split("/logs/")[1], l = await ni(o);
5080
+ l ? (r.writeHead(200, { "Content-Type": "text/html" }), r.end(await Rt(l))) : (r.writeHead(404, { "Content-Type": "text/html" }), r.end(await Rt(null)));
5080
5081
  return;
5081
5082
  }
5082
5083
  if (i.method !== "POST") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-cli/on",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "CLI entry point for the on plugin ecosystem.",
5
5
  "type": "module",
6
6
  "bin": {