soonjs 0.0.24 → 0.0.26

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 (37) hide show
  1. package/dist/index.cjs +4 -4
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.js +104 -92
  4. package/dist/types.d.ts +1 -0
  5. package/dist/vite-plugin-soon-client.cjs +2 -2
  6. package/dist/vite-plugin-soon-client.js +14 -14
  7. package/dist/vite-plugin-soon-server.cjs +4 -1
  8. package/dist/vite-plugin-soon-server.js +4 -1
  9. package/package.json +1 -1
  10. /package/dist/deps/{acorn-vpnsvv0vl.js → acorn-63l42ciyb.js} +0 -0
  11. /package/dist/deps/{acorn-4bbswh3l6.js → acorn-anqp0uy6j.js} +0 -0
  12. /package/dist/deps/{angular-83zjjtd76.js → angular-6eqe81rmp.js} +0 -0
  13. /package/dist/deps/{angular-rxw0rdr8c.js → angular-zw5oic5ku.js} +0 -0
  14. /package/dist/deps/{babel-fw6tfzzbf.js → babel-4qh4iup2l.js} +0 -0
  15. /package/dist/deps/{babel-bp403m6zg.js → babel-ly0w2f9gt.js} +0 -0
  16. /package/dist/deps/{estree-gg8m4wsex.js → estree-9f8ovhtb1.js} +0 -0
  17. /package/dist/deps/{estree-8kj0he6rx.js → estree-zxumoq6qz.js} +0 -0
  18. /package/dist/deps/{flow-g4yga74xo.js → flow-niz9iy21e.js} +0 -0
  19. /package/dist/deps/{flow-6i0s1nbzq.js → flow-p4uemghmk.js} +0 -0
  20. /package/dist/deps/{glimmer-kwpa0i2hl.js → glimmer-6qbhhpyhp.js} +0 -0
  21. /package/dist/deps/{glimmer-41uyapmgd.js → glimmer-vvnfh71r6.js} +0 -0
  22. /package/dist/deps/{graphql-147kg788t.js → graphql-dgk8o6z8k.js} +0 -0
  23. /package/dist/deps/{graphql-k4vvtoaxx.js → graphql-dx88uylp4.js} +0 -0
  24. /package/dist/deps/{html-5plv0l5rz.js → html-awy57fcu4.js} +0 -0
  25. /package/dist/deps/{html-qgw95yt0p.js → html-gzei84ljz.js} +0 -0
  26. /package/dist/deps/{markdown-36u2qw6ev.js → markdown-d10pykzzv.js} +0 -0
  27. /package/dist/deps/{markdown-ctg3s4wvp.js → markdown-g9in9megz.js} +0 -0
  28. /package/dist/deps/{meriyah-icy3boh6d.js → meriyah-kcg8mxjpm.js} +0 -0
  29. /package/dist/deps/{meriyah-ejbnz31wa.js → meriyah-vfexh9fuw.js} +0 -0
  30. /package/dist/deps/{postcss-u5nb3hsle.js → postcss-bfwau6mgf.js} +0 -0
  31. /package/dist/deps/{postcss-d1ptsms6d.js → postcss-ggzdvxigr.js} +0 -0
  32. /package/dist/deps/{soon-id-96lbx7g47.js → soon-id-a6raaezni.js} +0 -0
  33. /package/dist/deps/{soon-id-j90jf02bq.js → soon-id-unm7ynfew.js} +0 -0
  34. /package/dist/deps/{typescript-ss2fqxu8g.js → typescript-4xb86hasm.js} +0 -0
  35. /package/dist/deps/{typescript-jp50r3t1c.js → typescript-zgna0nw0e.js} +0 -0
  36. /package/dist/deps/{yaml-16o42r2fx.js → yaml-8f94xxplf.js} +0 -0
  37. /package/dist/deps/{yaml-dcz0vkx91.js → yaml-zv7u9r84n.js} +0 -0
package/dist/index.js CHANGED
@@ -2,14 +2,14 @@ var dt = Object.defineProperty;
2
2
  var mt = (r, e, t) => e in r ? dt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var x = (r, e, t) => mt(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { PassThrough as ht } from "stream";
5
- import { g as Fr, c as yr, u as vt } from "./deps/soon-id-96lbx7g47.js";
5
+ import { g as Fr, c as yr, u as vt } from "./deps/soon-id-a6raaezni.js";
6
6
  import gt from "util";
7
7
  var k = {};
8
8
  Object.defineProperty(k, "__esModule", { value: !0 });
9
9
  k.TokenData = void 0;
10
- k.parse = Oe;
10
+ k.parse = Te;
11
11
  k.compile = $t;
12
- var wt = k.match = Ot;
12
+ var wt = k.match = Tt;
13
13
  k.pathToRegexp = Rt;
14
14
  const bt = "/", tr = (r) => r, St = new RegExp("^\\p{XID_Continue}$", "u"), le = "https://git.new/pathToRegexpError", Et = {
15
15
  "!": "!",
@@ -109,7 +109,7 @@ class se {
109
109
  }
110
110
  }
111
111
  k.TokenData = se;
112
- function Oe(r, e = {}) {
112
+ function Te(r, e = {}) {
113
113
  const { encodePath: t = tr, delimiter: n = t(bt) } = e, a = [], o = At(r);
114
114
  let i = 0;
115
115
  do {
@@ -155,7 +155,7 @@ function Oe(r, e = {}) {
155
155
  return new se(a, n);
156
156
  }
157
157
  function $t(r, e = {}) {
158
- const t = r instanceof se ? r : Oe(r, e);
158
+ const t = r instanceof se ? r : Te(r, e);
159
159
  return It(t, e);
160
160
  }
161
161
  function xt(r, e) {
@@ -213,8 +213,8 @@ function It(r, e) {
213
213
  return c;
214
214
  };
215
215
  }
216
- function Ot(r, e = {}) {
217
- const { decode: t = decodeURIComponent, loose: n = !0 } = e, a = r instanceof se ? r : Oe(r, e), o = nr(n, a.delimiter), i = [], f = Wr(a, i, e), l = i.map((u) => {
216
+ function Tt(r, e = {}) {
217
+ const { decode: t = decodeURIComponent, loose: n = !0 } = e, a = r instanceof se ? r : Te(r, e), o = nr(n, a.delimiter), i = [], f = Wr(a, i, e), l = i.map((u) => {
218
218
  if (t && (u.modifier === "+" || u.modifier === "*")) {
219
219
  const { prefix: s = "", suffix: p = "", separator: c = p + s } = u, d = new RegExp(o(c), "g");
220
220
  return (y) => y.split(d).map(t);
@@ -238,7 +238,7 @@ function Ot(r, e = {}) {
238
238
  function J(r) {
239
239
  return r.replace(/([.+*?^${}()[\]|/\\])/g, "\\$1");
240
240
  }
241
- function Tt(r, e) {
241
+ function Ct(r, e) {
242
242
  const t = J(r);
243
243
  return e ? `(?:${t})+(?!${t})` : t;
244
244
  }
@@ -246,7 +246,7 @@ function nr(r, e) {
246
246
  if (!r)
247
247
  return J;
248
248
  const t = new RegExp(`(?:(?!${J(e)}).)+|(.)`, "g");
249
- return (n) => n.replace(t, Tt);
249
+ return (n) => n.replace(t, Ct);
250
250
  }
251
251
  function Lr(r) {
252
252
  return r.sensitive ? "" : "i";
@@ -264,7 +264,7 @@ function qr(r, e, t, n, a) {
264
264
  return i = l, e(l);
265
265
  const { prefix: s = "", suffix: p = "", separator: c = p + s, modifier: d = "" } = l, y = e(s), m = e(p);
266
266
  if (l.name) {
267
- const g = l.pattern ? `(?:${l.pattern})` : o, S = Ct(g, l.name, n);
267
+ const g = l.pattern ? `(?:${l.pattern})` : o, S = Ot(g, l.name, n);
268
268
  if (f || (f = _e(S, s || i)), !f)
269
269
  throw new TypeError(`Ambiguous pattern for "${l.name}": ${le}`);
270
270
  if (f = !a || _e(S, p), i = "", t.push(l), d === "+" || d === "*") {
@@ -280,7 +280,7 @@ function qr(r, e, t, n, a) {
280
280
  return `(?:${y}${m})${d}`;
281
281
  });
282
282
  }
283
- function Ct(r, e, t) {
283
+ function Ot(r, e, t) {
284
284
  try {
285
285
  return new RegExp(`^${r}$`, t);
286
286
  } catch (n) {
@@ -291,14 +291,14 @@ function _e(r, e) {
291
291
  return e ? !r.test(e) : !1;
292
292
  }
293
293
  function Rt(r, e = {}) {
294
- const t = r instanceof se ? r : Oe(r, e), n = [], a = Wr(t, n, e);
294
+ const t = r instanceof se ? r : Te(r, e), n = [], a = Wr(t, n, e);
295
295
  return Object.assign(a, { keys: n });
296
296
  }
297
- var Te = {};
298
- Object.defineProperty(Te, "__esModule", {
297
+ var Ce = {};
298
+ Object.defineProperty(Ce, "__esModule", {
299
299
  value: !0
300
300
  });
301
- Te.Observable = void 0;
301
+ Ce.Observable = void 0;
302
302
  const Gr = (r) => !!Symbol[r], ar = (r) => Gr(r) ? Symbol[r] : "@@" + r, Dt = ar("iterator"), Ve = ar("observable"), kr = ar("species");
303
303
  function Ae(r, e) {
304
304
  let t = r[e];
@@ -309,10 +309,10 @@ function Ae(r, e) {
309
309
  }
310
310
  function oe(r) {
311
311
  let e = r.constructor;
312
- return e !== void 0 && (e = e[kr], e === null && (e = void 0)), e !== void 0 ? e : Ce;
312
+ return e !== void 0 && (e = e[kr], e === null && (e = void 0)), e !== void 0 ? e : Oe;
313
313
  }
314
314
  function _t(r) {
315
- return r instanceof Ce;
315
+ return r instanceof Oe;
316
316
  }
317
317
  function X(r) {
318
318
  X.log ? X.log(r) : setTimeout(() => {
@@ -425,7 +425,7 @@ class Nt {
425
425
  this._state !== "closed" && (Qe(this), zr(this));
426
426
  }
427
427
  }
428
- let Ce = class be {
428
+ let Oe = class be {
429
429
  constructor(e) {
430
430
  if (!(this instanceof be)) throw new TypeError("Observable cannot be called as a function");
431
431
  if (typeof e != "function") throw new TypeError("Observable initializer must be a function");
@@ -641,17 +641,17 @@ let Ce = class be {
641
641
  return this;
642
642
  }
643
643
  };
644
- Te.Observable = Ce;
645
- Object.defineProperty(Ce, Symbol("extensions"), {
644
+ Ce.Observable = Oe;
645
+ Object.defineProperty(Oe, Symbol("extensions"), {
646
646
  value: {
647
647
  symbol: Ve,
648
648
  hostReportError: X
649
649
  },
650
650
  configurable: !0
651
651
  });
652
- var Bt = Te.Observable;
653
- const Kr = /* @__PURE__ */ Fr(Bt);
654
- var Ut = Error, Ft = EvalError, Lt = RangeError, Wt = ReferenceError, Vr = SyntaxError, pe = TypeError, qt = URIError, Gt = function() {
652
+ var Ut = Ce.Observable;
653
+ const Kr = /* @__PURE__ */ Fr(Ut);
654
+ var Bt = Error, Ft = EvalError, Lt = RangeError, Wt = ReferenceError, Vr = SyntaxError, pe = TypeError, qt = URIError, Gt = function() {
655
655
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
656
656
  return !1;
657
657
  if (typeof Symbol.iterator == "symbol")
@@ -719,7 +719,7 @@ var Ut = Error, Ft = EvalError, Lt = RangeError, Wt = ReferenceError, Vr = Synta
719
719
  u.prototype = t.prototype, a.prototype = new u(), u.prototype = null;
720
720
  }
721
721
  return a;
722
- }, en = Zt, or = Function.prototype.bind || en, rn = Function.prototype.call, tn = Object.prototype.hasOwnProperty, nn = or, an = nn.call(rn, tn), v, on = Ut, ln = Ft, fn = Lt, un = Wt, Y = Vr, j = pe, cn = qt, Qr = Function, Be = function(r) {
722
+ }, en = Zt, or = Function.prototype.bind || en, rn = Function.prototype.call, tn = Object.prototype.hasOwnProperty, nn = or, an = nn.call(rn, tn), v, on = Bt, ln = Ft, fn = Lt, un = Wt, Y = Vr, j = pe, cn = qt, Qr = Function, Ue = function(r) {
723
723
  try {
724
724
  return Qr('"use strict"; return (' + r + ").constructor;")();
725
725
  } catch {
@@ -731,19 +731,19 @@ if (q)
731
731
  } catch {
732
732
  q = null;
733
733
  }
734
- var Ue = function() {
734
+ var Be = function() {
735
735
  throw new j();
736
736
  }, sn = q ? function() {
737
737
  try {
738
- return arguments.callee, Ue;
738
+ return arguments.callee, Be;
739
739
  } catch {
740
740
  try {
741
741
  return q(arguments, "callee").get;
742
742
  } catch {
743
- return Ue;
743
+ return Be;
744
744
  }
745
745
  }
746
- }() : Ue, K = zt(), pn = Kt(), A = Object.getPrototypeOf || (pn ? function(r) {
746
+ }() : Be, K = zt(), pn = Kt(), A = Object.getPrototypeOf || (pn ? function(r) {
747
747
  return r.__proto__;
748
748
  } : null), Q = {}, yn = typeof Uint8Array > "u" || !A ? v : A(Uint8Array), G = {
749
749
  __proto__: null,
@@ -825,11 +825,11 @@ if (A)
825
825
  var mn = function r(e) {
826
826
  var t;
827
827
  if (e === "%AsyncFunction%")
828
- t = Be("async function () {}");
828
+ t = Ue("async function () {}");
829
829
  else if (e === "%GeneratorFunction%")
830
- t = Be("function* () {}");
830
+ t = Ue("function* () {}");
831
831
  else if (e === "%AsyncGeneratorFunction%")
832
- t = Be("async function* () {}");
832
+ t = Ue("async function* () {}");
833
833
  else if (e === "%AsyncGenerator%") {
834
834
  var n = r("%AsyncGeneratorFunction%");
835
835
  n && (t = n.prototype);
@@ -1001,17 +1001,17 @@ Xr.hasArrayLengthDefineBug = function() {
1001
1001
  return !0;
1002
1002
  }
1003
1003
  };
1004
- var xn = Xr, In = re, Sr = $n, On = xn(), Er = Jr, Ar = pe, Tn = In("%Math.floor%"), Cn = function(e, t) {
1004
+ var xn = Xr, In = re, Sr = $n, Tn = xn(), Er = Jr, Ar = pe, Cn = In("%Math.floor%"), On = function(e, t) {
1005
1005
  if (typeof e != "function")
1006
1006
  throw new Ar("`fn` is not a function");
1007
- if (typeof t != "number" || t < 0 || t > 4294967295 || Tn(t) !== t)
1007
+ if (typeof t != "number" || t < 0 || t > 4294967295 || Cn(t) !== t)
1008
1008
  throw new Ar("`length` must be a positive 32-bit integer");
1009
1009
  var n = arguments.length > 2 && !!arguments[2], a = !0, o = !0;
1010
1010
  if ("length" in e && Er) {
1011
1011
  var i = Er(e, "length");
1012
1012
  i && !i.configurable && (a = !1), i && !i.writable && (o = !1);
1013
1013
  }
1014
- return (a || o || !n) && (On ? Sr(
1014
+ return (a || o || !n) && (Tn ? Sr(
1015
1015
  /** @type {Parameters<define>[0]} */
1016
1016
  e,
1017
1017
  "length",
@@ -1026,7 +1026,7 @@ var xn = Xr, In = re, Sr = $n, On = xn(), Er = Jr, Ar = pe, Tn = In("%Math.floor
1026
1026
  )), e;
1027
1027
  };
1028
1028
  (function(r) {
1029
- var e = or, t = re, n = Cn, a = pe, o = t("%Function.prototype.apply%"), i = t("%Function.prototype.call%"), f = t("%Reflect.apply%", !0) || e.call(i, o), l = ir(), u = t("%Math.max%");
1029
+ var e = or, t = re, n = On, a = pe, o = t("%Function.prototype.apply%"), i = t("%Function.prototype.call%"), f = t("%Reflect.apply%", !0) || e.call(i, o), l = ir(), u = t("%Math.max%");
1030
1030
  r.exports = function(c) {
1031
1031
  if (typeof c != "function")
1032
1032
  throw new a("a function is required");
@@ -1045,7 +1045,7 @@ var xn = Xr, In = re, Sr = $n, On = xn(), Er = Jr, Ar = pe, Tn = In("%Math.floor
1045
1045
  var Rn = jr.exports, Yr = re, Zr = Rn, Dn = Zr(Yr("String.prototype.indexOf")), _n = function(e, t) {
1046
1046
  var n = Yr(e, !!t);
1047
1047
  return typeof n == "function" && Dn(e, ".prototype.") > -1 ? Zr(n) : n;
1048
- }, Mn = gt.inspect, lr = typeof Map == "function" && Map.prototype, Le = Object.getOwnPropertyDescriptor && lr ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, xe = lr && Le && typeof Le.get == "function" ? Le.get : null, Pr = lr && Map.prototype.forEach, fr = typeof Set == "function" && Set.prototype, We = Object.getOwnPropertyDescriptor && fr ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, Ie = fr && We && typeof We.get == "function" ? We.get : null, $r = fr && Set.prototype.forEach, Nn = typeof WeakMap == "function" && WeakMap.prototype, fe = Nn ? WeakMap.prototype.has : null, Bn = typeof WeakSet == "function" && WeakSet.prototype, ue = Bn ? WeakSet.prototype.has : null, Un = typeof WeakRef == "function" && WeakRef.prototype, xr = Un ? WeakRef.prototype.deref : null, Fn = Boolean.prototype.valueOf, Ln = Object.prototype.toString, Wn = Function.prototype.toString, qn = String.prototype.match, ur = String.prototype.slice, B = String.prototype.replace, Gn = String.prototype.toUpperCase, Ir = String.prototype.toLowerCase, et = RegExp.prototype.test, Or = Array.prototype.concat, C = Array.prototype.join, kn = Array.prototype.slice, Tr = Math.floor, Je = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, qe = Object.getOwnPropertySymbols, Xe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, Z = typeof Symbol == "function" && typeof Symbol.iterator == "object", $ = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === Z || !0) ? Symbol.toStringTag : null, rt = Object.prototype.propertyIsEnumerable, Cr = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(r) {
1048
+ }, Mn = gt.inspect, lr = typeof Map == "function" && Map.prototype, Le = Object.getOwnPropertyDescriptor && lr ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, xe = lr && Le && typeof Le.get == "function" ? Le.get : null, Pr = lr && Map.prototype.forEach, fr = typeof Set == "function" && Set.prototype, We = Object.getOwnPropertyDescriptor && fr ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, Ie = fr && We && typeof We.get == "function" ? We.get : null, $r = fr && Set.prototype.forEach, Nn = typeof WeakMap == "function" && WeakMap.prototype, fe = Nn ? WeakMap.prototype.has : null, Un = typeof WeakSet == "function" && WeakSet.prototype, ue = Un ? WeakSet.prototype.has : null, Bn = typeof WeakRef == "function" && WeakRef.prototype, xr = Bn ? WeakRef.prototype.deref : null, Fn = Boolean.prototype.valueOf, Ln = Object.prototype.toString, Wn = Function.prototype.toString, qn = String.prototype.match, ur = String.prototype.slice, U = String.prototype.replace, Gn = String.prototype.toUpperCase, Ir = String.prototype.toLowerCase, et = RegExp.prototype.test, Tr = Array.prototype.concat, O = Array.prototype.join, kn = Array.prototype.slice, Cr = Math.floor, Je = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, qe = Object.getOwnPropertySymbols, Xe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, Z = typeof Symbol == "function" && typeof Symbol.iterator == "object", $ = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === Z || !0) ? Symbol.toStringTag : null, rt = Object.prototype.propertyIsEnumerable, Or = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(r) {
1049
1049
  return r.__proto__;
1050
1050
  } : null);
1051
1051
  function Rr(r, e) {
@@ -1053,13 +1053,13 @@ function Rr(r, e) {
1053
1053
  return e;
1054
1054
  var t = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
1055
1055
  if (typeof r == "number") {
1056
- var n = r < 0 ? -Tr(-r) : Tr(r);
1056
+ var n = r < 0 ? -Cr(-r) : Cr(r);
1057
1057
  if (n !== r) {
1058
1058
  var a = String(n), o = ur.call(e, a.length + 1);
1059
- return B.call(a, t, "$&_") + "." + B.call(B.call(o, /([0-9]{3})/g, "$&_"), /_$/, "");
1059
+ return U.call(a, t, "$&_") + "." + U.call(U.call(o, /([0-9]{3})/g, "$&_"), /_$/, "");
1060
1060
  }
1061
1061
  }
1062
- return B.call(e, t, "$&_");
1062
+ return U.call(e, t, "$&_");
1063
1063
  }
1064
1064
  var Ye = Mn, Dr = Ye.custom, _r = nt(Dr) ? Dr : null, zn = function r(e, t, n, a) {
1065
1065
  var o = t || {};
@@ -1112,10 +1112,10 @@ var Ye = Mn, Dr = Ye.custom, _r = nt(Dr) ? Dr : null, zn = function r(e, t, n, a
1112
1112
  }
1113
1113
  if (typeof e == "function" && !Mr(e)) {
1114
1114
  var d = Zn(e), y = he(e, c);
1115
- return "[Function" + (d ? ": " + d : " (anonymous)") + "]" + (y.length > 0 ? " { " + C.call(y, ", ") + " }" : "");
1115
+ return "[Function" + (d ? ": " + d : " (anonymous)") + "]" + (y.length > 0 ? " { " + O.call(y, ", ") + " }" : "");
1116
1116
  }
1117
1117
  if (nt(e)) {
1118
- var m = Z ? B.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Xe.call(e);
1118
+ var m = Z ? U.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Xe.call(e);
1119
1119
  return typeof e == "object" && !Z ? ie(m) : m;
1120
1120
  }
1121
1121
  if (oa(e)) {
@@ -1127,11 +1127,11 @@ var Ye = Mn, Dr = Ye.custom, _r = nt(Dr) ? Dr : null, zn = function r(e, t, n, a
1127
1127
  if (e.length === 0)
1128
1128
  return "[]";
1129
1129
  var h = he(e, c);
1130
- return p && !la(h) ? "[" + er(h, p) + "]" : "[ " + C.call(h, ", ") + " ]";
1130
+ return p && !la(h) ? "[" + er(h, p) + "]" : "[ " + O.call(h, ", ") + " ]";
1131
1131
  }
1132
1132
  if (Vn(e)) {
1133
1133
  var R = he(e, c);
1134
- return !("cause" in Error.prototype) && "cause" in e && !rt.call(e, "cause") ? "{ [" + String(e) + "] " + C.call(Or.call("[cause]: " + c(e.cause), R), ", ") + " }" : R.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + C.call(R, ", ") + " }";
1134
+ return !("cause" in Error.prototype) && "cause" in e && !rt.call(e, "cause") ? "{ [" + String(e) + "] " + O.call(Tr.call("[cause]: " + c(e.cause), R), ", ") + " }" : R.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + O.call(R, ", ") + " }";
1135
1135
  }
1136
1136
  if (typeof e == "object" && i) {
1137
1137
  if (_r && typeof e[_r] == "function" && Ye)
@@ -1170,8 +1170,8 @@ var Ye = Mn, Dr = Ye.custom, _r = nt(Dr) ? Dr : null, zn = function r(e, t, n, a
1170
1170
  if (typeof globalThis < "u" && e === globalThis || typeof yr < "u" && e === yr)
1171
1171
  return "{ [object globalThis] }";
1172
1172
  if (!Kn(e) && !Mr(e)) {
1173
- var z = he(e, c), de = Cr ? Cr(e) === Object.prototype : e instanceof Object || e.constructor === Object, L = e instanceof Object ? "" : "null prototype", D = !de && $ && Object(e) === e && $ in e ? ur.call(U(e), 8, -1) : L ? "Object" : "", me = de || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", H = me + (D || L ? "[" + C.call(Or.call([], D || [], L || []), ": ") + "] " : "");
1174
- return z.length === 0 ? H + "{}" : p ? H + "{" + er(z, p) + "}" : H + "{ " + C.call(z, ", ") + " }";
1173
+ var z = he(e, c), de = Or ? Or(e) === Object.prototype : e instanceof Object || e.constructor === Object, L = e instanceof Object ? "" : "null prototype", D = !de && $ && Object(e) === e && $ in e ? ur.call(B(e), 8, -1) : L ? "Object" : "", me = de || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", H = me + (D || L ? "[" + O.call(Tr.call([], D || [], L || []), ": ") + "] " : "");
1174
+ return z.length === 0 ? H + "{}" : p ? H + "{" + er(z, p) + "}" : H + "{ " + O.call(z, ", ") + " }";
1175
1175
  }
1176
1176
  return String(e);
1177
1177
  };
@@ -1180,28 +1180,28 @@ function tt(r, e, t) {
1180
1180
  return n + r + n;
1181
1181
  }
1182
1182
  function Hn(r) {
1183
- return B.call(String(r), /"/g, "&quot;");
1183
+ return U.call(String(r), /"/g, "&quot;");
1184
1184
  }
1185
1185
  function Ze(r) {
1186
- return U(r) === "[object Array]" && (!$ || !(typeof r == "object" && $ in r));
1186
+ return B(r) === "[object Array]" && (!$ || !(typeof r == "object" && $ in r));
1187
1187
  }
1188
1188
  function Kn(r) {
1189
- return U(r) === "[object Date]" && (!$ || !(typeof r == "object" && $ in r));
1189
+ return B(r) === "[object Date]" && (!$ || !(typeof r == "object" && $ in r));
1190
1190
  }
1191
1191
  function Mr(r) {
1192
- return U(r) === "[object RegExp]" && (!$ || !(typeof r == "object" && $ in r));
1192
+ return B(r) === "[object RegExp]" && (!$ || !(typeof r == "object" && $ in r));
1193
1193
  }
1194
1194
  function Vn(r) {
1195
- return U(r) === "[object Error]" && (!$ || !(typeof r == "object" && $ in r));
1195
+ return B(r) === "[object Error]" && (!$ || !(typeof r == "object" && $ in r));
1196
1196
  }
1197
1197
  function Qn(r) {
1198
- return U(r) === "[object String]" && (!$ || !(typeof r == "object" && $ in r));
1198
+ return B(r) === "[object String]" && (!$ || !(typeof r == "object" && $ in r));
1199
1199
  }
1200
1200
  function jn(r) {
1201
- return U(r) === "[object Number]" && (!$ || !(typeof r == "object" && $ in r));
1201
+ return B(r) === "[object Number]" && (!$ || !(typeof r == "object" && $ in r));
1202
1202
  }
1203
1203
  function Jn(r) {
1204
- return U(r) === "[object Boolean]" && (!$ || !(typeof r == "object" && $ in r));
1204
+ return B(r) === "[object Boolean]" && (!$ || !(typeof r == "object" && $ in r));
1205
1205
  }
1206
1206
  function nt(r) {
1207
1207
  if (Z)
@@ -1231,7 +1231,7 @@ var Yn = Object.prototype.hasOwnProperty || function(r) {
1231
1231
  function N(r, e) {
1232
1232
  return Yn.call(r, e);
1233
1233
  }
1234
- function U(r) {
1234
+ function B(r) {
1235
1235
  return Ln.call(r);
1236
1236
  }
1237
1237
  function Zn(r) {
@@ -1325,7 +1325,7 @@ function ot(r, e) {
1325
1325
  var t = r.length - e.maxStringLength, n = "... " + t + " more character" + (t > 1 ? "s" : "");
1326
1326
  return ot(ur.call(r, 0, e.maxStringLength), e) + n;
1327
1327
  }
1328
- var a = B.call(B.call(r, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, ia);
1328
+ var a = U.call(U.call(r, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, ia);
1329
1329
  return tt(a, "single", e);
1330
1330
  }
1331
1331
  function ia(r) {
@@ -1345,7 +1345,7 @@ function Ge(r) {
1345
1345
  return r + " { ? }";
1346
1346
  }
1347
1347
  function Nr(r, e, t, n) {
1348
- var a = n ? er(t, n) : C.call(t, ", ");
1348
+ var a = n ? er(t, n) : O.call(t, ", ");
1349
1349
  return r + " (" + e + ") {" + a + "}";
1350
1350
  }
1351
1351
  function la(r) {
@@ -1360,12 +1360,12 @@ function fa(r, e) {
1360
1360
  if (r.indent === " ")
1361
1361
  t = " ";
1362
1362
  else if (typeof r.indent == "number" && r.indent > 0)
1363
- t = C.call(Array(r.indent + 1), " ");
1363
+ t = O.call(Array(r.indent + 1), " ");
1364
1364
  else
1365
1365
  return null;
1366
1366
  return {
1367
1367
  base: t,
1368
- prev: C.call(Array(e + 1), t)
1368
+ prev: O.call(Array(e + 1), t)
1369
1369
  };
1370
1370
  }
1371
1371
  function er(r, e) {
@@ -1373,7 +1373,7 @@ function er(r, e) {
1373
1373
  return "";
1374
1374
  var t = `
1375
1375
  ` + e.prev + e.base;
1376
- return t + C.call(r, "," + t) + `
1376
+ return t + O.call(r, "," + t) + `
1377
1377
  ` + e.prev;
1378
1378
  }
1379
1379
  function he(r, e) {
@@ -1462,7 +1462,7 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1462
1462
  },
1463
1463
  RFC1738: ke.RFC1738,
1464
1464
  RFC3986: ke.RFC3986
1465
- }, Aa = sr, ze = Object.prototype.hasOwnProperty, W = Array.isArray, O = function() {
1465
+ }, Aa = sr, ze = Object.prototype.hasOwnProperty, W = Array.isArray, T = function() {
1466
1466
  for (var r = [], e = 0; e < 256; ++e)
1467
1467
  r.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
1468
1468
  return r;
@@ -1517,7 +1517,7 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1517
1517
  } catch {
1518
1518
  return n;
1519
1519
  }
1520
- }, He = 1024, Oa = function(e, t, n, a, o) {
1520
+ }, He = 1024, Ta = function(e, t, n, a, o) {
1521
1521
  if (e.length === 0)
1522
1522
  return e;
1523
1523
  var i = e;
@@ -1533,30 +1533,30 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1533
1533
  continue;
1534
1534
  }
1535
1535
  if (c < 128) {
1536
- s[s.length] = O[c];
1536
+ s[s.length] = T[c];
1537
1537
  continue;
1538
1538
  }
1539
1539
  if (c < 2048) {
1540
- s[s.length] = O[192 | c >> 6] + O[128 | c & 63];
1540
+ s[s.length] = T[192 | c >> 6] + T[128 | c & 63];
1541
1541
  continue;
1542
1542
  }
1543
1543
  if (c < 55296 || c >= 57344) {
1544
- s[s.length] = O[224 | c >> 12] + O[128 | c >> 6 & 63] + O[128 | c & 63];
1544
+ s[s.length] = T[224 | c >> 12] + T[128 | c >> 6 & 63] + T[128 | c & 63];
1545
1545
  continue;
1546
1546
  }
1547
- p += 1, c = 65536 + ((c & 1023) << 10 | u.charCodeAt(p) & 1023), s[s.length] = O[240 | c >> 18] + O[128 | c >> 12 & 63] + O[128 | c >> 6 & 63] + O[128 | c & 63];
1547
+ p += 1, c = 65536 + ((c & 1023) << 10 | u.charCodeAt(p) & 1023), s[s.length] = T[240 | c >> 18] + T[128 | c >> 12 & 63] + T[128 | c >> 6 & 63] + T[128 | c & 63];
1548
1548
  }
1549
1549
  f += s.join("");
1550
1550
  }
1551
1551
  return f;
1552
- }, Ta = function(e) {
1552
+ }, Ca = function(e) {
1553
1553
  for (var t = [{ obj: { o: e }, prop: "o" }], n = [], a = 0; a < t.length; ++a)
1554
1554
  for (var o = t[a], i = o.obj[o.prop], f = Object.keys(i), l = 0; l < f.length; ++l) {
1555
1555
  var u = f[l], s = i[u];
1556
1556
  typeof s == "object" && s !== null && n.indexOf(s) === -1 && (t.push({ obj: i, prop: u }), n.push(s));
1557
1557
  }
1558
1558
  return Pa(t), e;
1559
- }, Ca = function(e) {
1559
+ }, Oa = function(e) {
1560
1560
  return Object.prototype.toString.call(e) === "[object RegExp]";
1561
1561
  }, Ra = function(e) {
1562
1562
  return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
@@ -1573,11 +1573,11 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1573
1573
  arrayToObject: lt,
1574
1574
  assign: xa,
1575
1575
  combine: Da,
1576
- compact: Ta,
1576
+ compact: Ca,
1577
1577
  decode: Ia,
1578
- encode: Oa,
1578
+ encode: Ta,
1579
1579
  isBuffer: Ra,
1580
- isRegExp: Ca,
1580
+ isRegExp: Oa,
1581
1581
  maybeMap: _a,
1582
1582
  merge: $a
1583
1583
  }, ut = ba, Ee = ft, ce = sr, Ma = Object.prototype.hasOwnProperty, ct = {
@@ -1591,9 +1591,9 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1591
1591
  repeat: function(e) {
1592
1592
  return e;
1593
1593
  }
1594
- }, T = Array.isArray, Na = Array.prototype.push, st = function(r, e) {
1595
- Na.apply(r, T(e) ? e : [e]);
1596
- }, Ba = Date.prototype.toISOString, Br = ce.default, E = {
1594
+ }, C = Array.isArray, Na = Array.prototype.push, st = function(r, e) {
1595
+ Na.apply(r, C(e) ? e : [e]);
1596
+ }, Ua = Date.prototype.toISOString, Ur = ce.default, E = {
1597
1597
  addQueryPrefix: !1,
1598
1598
  allowDots: !1,
1599
1599
  allowEmptyArrays: !1,
@@ -1605,16 +1605,16 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1605
1605
  encodeDotInKeys: !1,
1606
1606
  encoder: Ee.encode,
1607
1607
  encodeValuesOnly: !1,
1608
- format: Br,
1609
- formatter: ce.formatters[Br],
1608
+ format: Ur,
1609
+ formatter: ce.formatters[Ur],
1610
1610
  // deprecated
1611
1611
  indices: !1,
1612
1612
  serializeDate: function(e) {
1613
- return Ba.call(e);
1613
+ return Ua.call(e);
1614
1614
  },
1615
1615
  skipNulls: !1,
1616
1616
  strictNullHandling: !1
1617
- }, Ua = function(e) {
1617
+ }, Ba = function(e) {
1618
1618
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
1619
1619
  }, Ke = {}, Fa = function r(e, t, n, a, o, i, f, l, u, s, p, c, d, y, m, g, S, P) {
1620
1620
  for (var h = e, R = P, F = 0, ne = !1; (R = R.get(Ke)) !== void 0 && !ne; ) {
@@ -1626,14 +1626,14 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1626
1626
  }
1627
1627
  typeof R.get(Ke) > "u" && (F = 0);
1628
1628
  }
1629
- if (typeof s == "function" ? h = s(t, h) : h instanceof Date ? h = d(h) : n === "comma" && T(h) && (h = Ee.maybeMap(h, function(De) {
1629
+ if (typeof s == "function" ? h = s(t, h) : h instanceof Date ? h = d(h) : n === "comma" && C(h) && (h = Ee.maybeMap(h, function(De) {
1630
1630
  return De instanceof Date ? d(De) : De;
1631
1631
  })), h === null) {
1632
1632
  if (i)
1633
1633
  return u && !g ? u(t, E.encoder, S, "key", y) : t;
1634
1634
  h = "";
1635
1635
  }
1636
- if (Ua(h) || Ee.isBuffer(h)) {
1636
+ if (Ba(h) || Ee.isBuffer(h)) {
1637
1637
  if (u) {
1638
1638
  var de = g ? t : u(t, E.encoder, S, "key", y);
1639
1639
  return [m(de) + "=" + m(u(h, E.encoder, S, "value", y))];
@@ -1644,21 +1644,21 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1644
1644
  if (typeof h > "u")
1645
1645
  return L;
1646
1646
  var D;
1647
- if (n === "comma" && T(h))
1647
+ if (n === "comma" && C(h))
1648
1648
  g && u && (h = Ee.maybeMap(h, u)), D = [{ value: h.length > 0 ? h.join(",") || null : void 0 }];
1649
- else if (T(s))
1649
+ else if (C(s))
1650
1650
  D = s;
1651
1651
  else {
1652
1652
  var me = Object.keys(h);
1653
1653
  D = p ? me.sort(p) : me;
1654
1654
  }
1655
- var H = l ? t.replace(/\./g, "%2E") : t, I = a && T(h) && h.length === 1 ? H + "[]" : H;
1656
- if (o && T(h) && h.length === 0)
1655
+ var H = l ? t.replace(/\./g, "%2E") : t, I = a && C(h) && h.length === 1 ? H + "[]" : H;
1656
+ if (o && C(h) && h.length === 0)
1657
1657
  return I + "[]";
1658
1658
  for (var _ = 0; _ < D.length; ++_) {
1659
1659
  var M = D[_], ae = typeof M == "object" && typeof M.value < "u" ? M.value : h[M];
1660
1660
  if (!(f && ae === null)) {
1661
- var Re = c && l ? M.replace(/\./g, "%2E") : M, yt = T(h) ? typeof n == "function" ? n(I, Re) : I : I + (c ? "." + Re : "[" + Re + "]");
1661
+ var Re = c && l ? M.replace(/\./g, "%2E") : M, yt = C(h) ? typeof n == "function" ? n(I, Re) : I : I + (c ? "." + Re : "[" + Re + "]");
1662
1662
  P.set(e, F);
1663
1663
  var pr = ut();
1664
1664
  pr.set(Ke, P), st(L, r(
@@ -1670,7 +1670,7 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1670
1670
  i,
1671
1671
  f,
1672
1672
  l,
1673
- n === "comma" && g && T(h) ? null : u,
1673
+ n === "comma" && g && C(h) ? null : u,
1674
1674
  s,
1675
1675
  p,
1676
1676
  c,
@@ -1703,7 +1703,7 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1703
1703
  n = e.format;
1704
1704
  }
1705
1705
  var a = ce.formatters[n], o = E.filter;
1706
- (typeof e.filter == "function" || T(e.filter)) && (o = e.filter);
1706
+ (typeof e.filter == "function" || C(e.filter)) && (o = e.filter);
1707
1707
  var i;
1708
1708
  if (e.arrayFormat in ct ? i = e.arrayFormat : "indices" in e ? i = e.indices ? "indices" : "repeat" : i = E.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
1709
1709
  throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
@@ -1731,7 +1731,7 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1731
1731
  };
1732
1732
  }, Wa = function(r, e) {
1733
1733
  var t = r, n = La(e), a, o;
1734
- typeof n.filter == "function" ? (o = n.filter, t = o("", t)) : T(n.filter) && (o = n.filter, a = o);
1734
+ typeof n.filter == "function" ? (o = n.filter, t = o("", t)) : C(n.filter) && (o = n.filter, a = o);
1735
1735
  var i = [];
1736
1736
  if (typeof t != "object" || t === null)
1737
1737
  return "";
@@ -1895,7 +1895,7 @@ var it = re, te = _n, ua = zn, ca = pe, ve = it("%WeakMap%", !0), ge = it("%Map%
1895
1895
  stringify: Ja
1896
1896
  };
1897
1897
  const eo = /* @__PURE__ */ Fr(Za);
1898
- function Ur(r) {
1898
+ function Br(r) {
1899
1899
  if (!Array.isArray(r)) throw new TypeError("Middleware stack must be an array!");
1900
1900
  for (const e of r)
1901
1901
  if (typeof e != "function") throw new TypeError("Middleware must be composed of functions!");
@@ -1976,7 +1976,7 @@ class to {
1976
1976
  action: (a, o) => {
1977
1977
  throw o.res.status = 404, Error("Not Found");
1978
1978
  }
1979
- }, this.fnMiddleware = Ur(this.middlewares), this.getId = vt({ workerId: e.workId }), this.init(t);
1979
+ }, this.fnMiddleware = Br(this.middlewares), this.getId = vt({ workerId: e.workId }), this.init(t);
1980
1980
  }
1981
1981
  async init(e) {
1982
1982
  var t, n, a, o;
@@ -2056,15 +2056,24 @@ class to {
2056
2056
  m !== void 0 && (u.body = m);
2057
2057
  };
2058
2058
  if (l.middlewares && l.middlewares.length > 0) {
2059
- const y = Ur(l.middlewares);
2060
- await this.fnMiddleware(s, () => y(s, p));
2059
+ const y = Br(l.middlewares), m = async () => await y(s, p);
2060
+ n != null && n.noPublicMiddleware ? await m : await this.fnMiddleware(s, m);
2061
2061
  } else
2062
- await this.fnMiddleware(s, p);
2062
+ n != null && n.noPublicMiddleware ? await this.fnMiddleware(s, p) : await p();
2063
2063
  return s.res;
2064
2064
  }
2065
2065
  async fetch(e, t, n) {
2066
2066
  return (await this.fetchRaw(e, t, n)).body;
2067
2067
  }
2068
+ // API间互相调用
2069
+ async action(e, t, n) {
2070
+ const a = {
2071
+ ...n ?? {},
2072
+ url: (n == null ? void 0 : n.url) ?? e,
2073
+ noPublicMiddleware: !0
2074
+ };
2075
+ return await this.fetch(e, t, a);
2076
+ }
2068
2077
  mount(e, t) {
2069
2078
  this.extensions.set(e, t);
2070
2079
  }
@@ -2077,6 +2086,9 @@ class to {
2077
2086
  async unloadService() {
2078
2087
  return Promise.all(this.onDestroyCbs.map((e) => e == null ? void 0 : e()));
2079
2088
  }
2089
+ get baseUrl() {
2090
+ return this.options.baseUrl ?? "";
2091
+ }
2080
2092
  }
2081
2093
  const no = Symbol("soon-api");
2082
2094
  function co(r) {
package/dist/types.d.ts CHANGED
@@ -85,6 +85,7 @@ export type SoonFetchOptions = {
85
85
  ip?: string;
86
86
  platform?: Context['platform'];
87
87
  namespace?: keyof Namespace;
88
+ noPublicMiddleware?: boolean;
88
89
  };
89
90
  export type Middleware = (context: Context, next: () => any) => Promise<void> | void;
90
91
  export type SoonAppOptions = {