@overlayed/app 0.10.0 → 0.10.2

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/index.js CHANGED
@@ -4,13 +4,13 @@ var c = (n, e, t) => ht(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { type as R } from "arktype";
5
5
  import O, { mkdirSync as be, existsSync as ve, writeFileSync as we, createWriteStream as Ge, readdirSync as je, unlinkSync as Ue, readFileSync as ze, copyFileSync as dt } from "node:fs";
6
6
  import m, { join as x, resolve as gt } from "node:path";
7
- import { createRequire as ae } from "node:module";
7
+ import { createRequire as oe } from "node:module";
8
8
  import S from "node:fs/promises";
9
9
  import He from "jszip";
10
10
  import { createHash as ft } from "node:crypto";
11
11
  import pt from "node:events";
12
12
  import yt, { app as Ve } from "electron";
13
- var mt = Object.defineProperty, bt = (n, e, t) => e in n ? mt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, E = (n, e, t) => bt(n, typeof e != "symbol" ? e + "" : e, t);
13
+ var mt = Object.defineProperty, bt = (n, e, t) => e in n ? mt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, I = (n, e, t) => bt(n, typeof e != "symbol" ? e + "" : e, t);
14
14
  function vt(n) {
15
15
  return { all: n = n || /* @__PURE__ */ new Map(), on: function(e, t) {
16
16
  var r = n.get(e);
@@ -27,9 +27,9 @@ function vt(n) {
27
27
  });
28
28
  } };
29
29
  }
30
- let Ee = class {
30
+ let Ie = class {
31
31
  constructor() {
32
- E(this, "emitter"), this.emitter = vt();
32
+ I(this, "emitter"), this.emitter = vt();
33
33
  }
34
34
  on(e, t) {
35
35
  this.emitter.on(e, t);
@@ -44,7 +44,7 @@ let Ee = class {
44
44
  this.emitter.all.clear();
45
45
  }
46
46
  };
47
- function Ie(n, ...e) {
47
+ function Ee(n, ...e) {
48
48
  var t;
49
49
  return t = class extends n {
50
50
  /**
@@ -59,9 +59,9 @@ function Ie(n, ...e) {
59
59
  static clearInstance() {
60
60
  this._instance = void 0;
61
61
  }
62
- }, E(t, "_instance"), t;
62
+ }, I(t, "_instance"), t;
63
63
  }
64
- let wt = class extends Ee {
64
+ let wt = class extends Ie {
65
65
  destroy() {
66
66
  this.removeAllListeners();
67
67
  }
@@ -90,10 +90,10 @@ let wt = class extends Ee {
90
90
  });
91
91
  }
92
92
  };
93
- Ie(wt);
94
- let Et = class We extends Ee {
93
+ Ee(wt);
94
+ let It = class We extends Ie {
95
95
  constructor(e, t) {
96
- super(), E(this, "stream"), E(this, "logPath"), E(this, "baseFileName"), E(this, "currentDate"), E(this, "rotationCheckInterval"), E(this, "isRotating", !1), this.logPath = e, this.baseFileName = t.replace(".log", ""), this.currentDate = this.getDateString(/* @__PURE__ */ new Date()), this.ensureLogDirectory(), this.ensureLogFile(), this.stream = this.createStream(), this.rotationCheckInterval = this.startRotationCheck(), this.cleanupOldLogs();
96
+ super(), I(this, "stream"), I(this, "logPath"), I(this, "baseFileName"), I(this, "currentDate"), I(this, "rotationCheckInterval"), I(this, "isRotating", !1), this.logPath = e, this.baseFileName = t.replace(".log", ""), this.currentDate = this.getDateString(/* @__PURE__ */ new Date()), this.ensureLogDirectory(), this.ensureLogFile(), this.stream = this.createStream(), this.rotationCheckInterval = this.startRotationCheck(), this.cleanupOldLogs();
97
97
  }
98
98
  static scope(e, t) {
99
99
  return new We(e, t);
@@ -184,10 +184,10 @@ let Et = class We extends Ee {
184
184
  });
185
185
  }
186
186
  };
187
- const It = () => m.join(process.env.APPDATA ?? "", "overlayed"), kt = (n) => m.join(It(), "apps", n), _t = (n) => m.join(kt(n), "logs");
187
+ const Et = () => m.join(process.env.APPDATA ?? "", "overlayed"), kt = (n) => m.join(Et(), "apps", n), _t = (n) => m.join(kt(n), "logs");
188
188
  let Pt = class {
189
189
  constructor() {
190
- E(this, "data", []);
190
+ I(this, "data", []);
191
191
  }
192
192
  get size() {
193
193
  return this.data.length;
@@ -209,10 +209,10 @@ let Pt = class {
209
209
  }
210
210
  }, St = class {
211
211
  constructor() {
212
- E(this, "fileName", "app.log"), E(this, "fileLogger"), E(this, "path"), E(this, "appId"), E(this, "messageQueue", new Pt());
212
+ I(this, "fileName", "app.log"), I(this, "fileLogger"), I(this, "path"), I(this, "appId"), I(this, "messageQueue", new Pt());
213
213
  }
214
214
  init(e) {
215
- this.appId = e, this.path = _t(e), this.fileLogger = new Et(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
215
+ this.appId = e, this.path = _t(e), this.fileLogger = new It(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
216
216
  var r;
217
217
  (r = this.fileLogger) == null || r[t.type](...t.args);
218
218
  });
@@ -269,20 +269,20 @@ let Pt = class {
269
269
  console[e](...t), ((r = this.fileLogger) == null ? void 0 : r[e](...t)) ?? this.messageQueue.add({ type: e, args: t });
270
270
  }
271
271
  };
272
- Ie(St);
273
- const Ct = ae(import.meta.url), {
272
+ Ee(St);
273
+ const Ct = oe(import.meta.url), {
274
274
  PipeEventServer: Lt,
275
275
  PipeEventClient: vn,
276
276
  PipeEventBase: wn,
277
- ProcessMonitor: En,
278
- Process: In,
277
+ ProcessMonitor: In,
278
+ Process: En,
279
279
  InjectionMethod: kn,
280
280
  AccessLevel: _n,
281
281
  HardwareInterface: Pn
282
282
  } = Ct("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
283
- let Dt = class extends Ee {
283
+ let Dt = class extends Ie {
284
284
  constructor(e) {
285
- super(), E(this, "server", null), E(this, "_hasConnection", !1), E(this, "pipeId"), this.pipeId = e, this.init();
285
+ super(), I(this, "server", null), I(this, "_hasConnection", !1), I(this, "pipeId"), this.pipeId = e, this.init();
286
286
  }
287
287
  get hasConnection() {
288
288
  return this._hasConnection;
@@ -308,7 +308,7 @@ let Dt = class extends Ee {
308
308
  });
309
309
  }
310
310
  };
311
- const ke = Ie(Dt, "stats-cc");
311
+ const ke = Ee(Dt, "stats-cc");
312
312
  function At(n) {
313
313
  return { all: n = n || /* @__PURE__ */ new Map(), on: function(e, t) {
314
314
  var r = n.get(e);
@@ -708,7 +708,7 @@ class Ft {
708
708
  console[e](...t), ((r = this.fileLogger) == null ? void 0 : r[e](...t)) ?? this.messageQueue.add({ type: e, args: t });
709
709
  }
710
710
  }
711
- const oe = L(Ft);
711
+ const N = L(Ft);
712
712
  function $t(n) {
713
713
  return n;
714
714
  }
@@ -760,7 +760,7 @@ class Ye {
760
760
  constructor(e) {
761
761
  c(this, "logger");
762
762
  c(this, "initialized", !1);
763
- this.logger = oe.getInstance().scope(e);
763
+ this.logger = N.getInstance().scope(e);
764
764
  }
765
765
  init() {
766
766
  this.logger.log("Initializing"), this.initialized = !0;
@@ -774,7 +774,7 @@ class le extends _e {
774
774
  super();
775
775
  c(this, "logger");
776
776
  c(this, "initialized", !1);
777
- this.logger = oe.getInstance().scope(t);
777
+ this.logger = N.getInstance().scope(t);
778
778
  }
779
779
  init() {
780
780
  this.logger.log("Initializing"), this.initialized = !0;
@@ -788,7 +788,7 @@ class Nt extends Mt {
788
788
  super();
789
789
  c(this, "logger");
790
790
  c(this, "initialized", !1);
791
- this.logger = oe.getInstance().scope(t);
791
+ this.logger = N.getInstance().scope(t);
792
792
  }
793
793
  init() {
794
794
  this.logger.log("Initializing"), this.initialized = !0;
@@ -797,7 +797,7 @@ class Nt extends Mt {
797
797
  this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
798
798
  }
799
799
  }
800
- var N = "object", Je = "function", Xe = "prototype", ue = "text", Ce = "json", Ke = "abort", de = "paramsSerializer", Re = "addEventListener", q = "status", A = "headers", ce = Object, F = void 0, re = null, ge = ce[Xe], ne = ce.keys, j = Array.isArray, Fe = "method", Ze = "HEAD", fe = "GET", et = "OPTIONS", Bt = "POST", Gt = "PUT", jt = "PATCH", Ut = "DELETE";
800
+ var B = "object", Je = "function", Xe = "prototype", ue = "text", Ce = "json", Ke = "abort", de = "paramsSerializer", Re = "addEventListener", Q = "status", A = "headers", ce = Object, F = void 0, ne = null, ge = ce[Xe], se = ce.keys, U = Array.isArray, Fe = "method", Ze = "HEAD", fe = "GET", et = "OPTIONS", Bt = "POST", Gt = "PUT", jt = "PATCH", Ut = "DELETE";
801
801
  function zt(n, e) {
802
802
  let t = new AbortController();
803
803
  function r(i) {
@@ -826,23 +826,23 @@ function zt(n, e) {
826
826
  return o.clear = a, o;
827
827
  }
828
828
  var $e = ce.getPrototypeOf, xe = (n) => {
829
- if (n !== re && typeof n === N) {
829
+ if (n !== ne && typeof n === B) {
830
830
  if (typeof $e === Je) {
831
831
  let e = $e(n);
832
- return e === ge || e === re;
832
+ return e === ge || e === ne;
833
833
  }
834
- return ge.toString.call(n) === `[${N} Object]`;
834
+ return ge.toString.call(n) === `[${B} Object]`;
835
835
  }
836
836
  return !1;
837
837
  }, Le = (...n) => n.reduce((e, t) => {
838
- if (j(t)) throw new TypeError(`Arguments must be ${N}s, not arrays.`);
839
- return ne(t).forEach((r) => {
840
- ["__proto__", "constructor", Xe].includes(r) || (j(e[r]) && j(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : xe(e[r]) && xe(t[r]) ? e[r] = Le(e[r], t[r]) : e[r] = t[r]);
838
+ if (U(t)) throw new TypeError(`Arguments must be ${B}s, not arrays.`);
839
+ return se(t).forEach((r) => {
840
+ ["__proto__", "constructor", Xe].includes(r) || (U(e[r]) && U(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : xe(e[r]) && xe(t[r]) ? e[r] = Le(e[r], t[r]) : e[r] = t[r]);
841
841
  }), e;
842
842
  }, {});
843
- function De(n, e = !0, t = re, r) {
844
- if (n === F || n === re) return "";
845
- let s = [], a = e ? encodeURIComponent : (f) => f, o = j(n), { arrayFormat: i, allowDots: l, serializeDate: h } = r || {}, g = (f) => {
843
+ function De(n, e = !0, t = ne, r) {
844
+ if (n === F || n === ne) return "";
845
+ let s = [], a = e ? encodeURIComponent : (f) => f, o = U(n), { arrayFormat: i, allowDots: l, serializeDate: h } = r || {}, g = (f) => {
846
846
  if (l && !o) return `.${f}`;
847
847
  if (o) {
848
848
  if (i === "brackets") return "[]";
@@ -854,7 +854,7 @@ function De(n, e = !0, t = re, r) {
854
854
  let p = n[f];
855
855
  if (p !== F) {
856
856
  let u = t ? `${t}${g(f)}` : a(f);
857
- if (!isNaN(p) && p instanceof Date && (p = h ? h(p) : p.toISOString()), typeof p === N) {
857
+ if (!isNaN(p) && p instanceof Date && (p = h ? h(p) : p.toISOString()), typeof p === B) {
858
858
  let d = De(p, e, u, r);
859
859
  d !== "" && s.push(d);
860
860
  } else s.push(`${a(u)}=${a(p)}`);
@@ -863,7 +863,7 @@ function De(n, e = !0, t = re, r) {
863
863
  return s.join("&");
864
864
  }
865
865
  function pe(n) {
866
- return j(n) ? n.map(pe) : (n && typeof n === N && ne(n).forEach((e) => {
866
+ return U(n) ? n.map(pe) : (n && typeof n === B && se(n).forEach((e) => {
867
867
  let t = n[e];
868
868
  t === F ? delete n[e] : pe(t);
869
869
  }), n);
@@ -882,16 +882,16 @@ var Wt = "XiorError", qt = "XiorTimeoutError", tt = class extends Error {
882
882
  constructor(e, t, r) {
883
883
  super(e, t, r), this.name = qt;
884
884
  }
885
- }, Yt = Object.defineProperty, Jt = Object.defineProperties, Xt = Object.getOwnPropertyDescriptors, se = Object.getOwnPropertySymbols, rt = Object.prototype.hasOwnProperty, nt = Object.prototype.propertyIsEnumerable, Te = (n, e, t) => e in n ? Yt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, U = (n, e) => {
885
+ }, Yt = Object.defineProperty, Jt = Object.defineProperties, Xt = Object.getOwnPropertyDescriptors, ie = Object.getOwnPropertySymbols, rt = Object.prototype.hasOwnProperty, nt = Object.prototype.propertyIsEnumerable, Te = (n, e, t) => e in n ? Yt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, z = (n, e) => {
886
886
  for (var t in e || (e = {})) rt.call(e, t) && Te(n, t, e[t]);
887
- if (se) for (var t of se(e)) nt.call(e, t) && Te(n, t, e[t]);
887
+ if (ie) for (var t of ie(e)) nt.call(e, t) && Te(n, t, e[t]);
888
888
  return n;
889
- }, Z = (n, e) => Jt(n, Xt(e)), Zt = (n, e) => {
889
+ }, ee = (n, e) => Jt(n, Xt(e)), Zt = (n, e) => {
890
890
  var t = {};
891
891
  for (var r in n) rt.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
892
- if (n != null && se) for (var r of se(n)) e.indexOf(r) < 0 && nt.call(n, r) && (t[r] = n[r]);
892
+ if (n != null && ie) for (var r of ie(n)) e.indexOf(r) < 0 && nt.call(n, r) && (t[r] = n[r]);
893
893
  return t;
894
- }, z = (n, e, t) => new Promise((r, s) => {
894
+ }, H = (n, e, t) => new Promise((r, s) => {
895
895
  var a = (l) => {
896
896
  try {
897
897
  i(t.next(l));
@@ -912,26 +912,26 @@ function nr(n = fe) {
912
912
  }
913
913
  var sr = typeof URLSearchParams != `${F}`;
914
914
  function ir(n) {
915
- return z(this, null, function* () {
916
- let e = n[de] || De, t = n.encodeURI !== !1, r = n[Fe] && n[Fe].toUpperCase(), s = n.url, a = s, o = sr && n.data instanceof URLSearchParams, i = o ? ce.fromEntries(n.data.entries()) : n.data, l = i, h = n != null && n[A] ? U({}, n[A]) : {}, g = n.params, f = nr(r);
915
+ return H(this, null, function* () {
916
+ let e = n[de] || De, t = n.encodeURI !== !1, r = n[Fe] && n[Fe].toUpperCase(), s = n.url, a = s, o = sr && n.data instanceof URLSearchParams, i = o ? ce.fromEntries(n.data.entries()) : n.data, l = i, h = n != null && n[A] ? z({}, n[A]) : {}, g = n.params, f = nr(r);
917
917
  if (i && typeof i.append !== Je) {
918
918
  let p = "", u = "content-type";
919
919
  if (n != null && n[A]) {
920
- let d = ne(n[A]).find((b) => b.toLowerCase() === u);
920
+ let d = se(n[A]).find((b) => b.toLowerCase() === u);
921
921
  d && (u = d, p = n[A][d]);
922
922
  }
923
- (!p || o) && (p = f || o ? st : tr, h[u] = p), typeof i === N && (f && g && (g = Le(i, g)), rr.test(p) ? l = JSON.stringify(pe(i)) : !f && er.test(p) && (l = e(i)));
923
+ (!p || o) && (p = f || o ? st : tr, h[u] = p), typeof i === B && (f && g && (g = Le(i, g)), rr.test(p) ? l = JSON.stringify(pe(i)) : !f && er.test(p) && (l = e(i)));
924
924
  }
925
- if (g && ne(g).length > 0) {
925
+ if (g && se(g).length > 0) {
926
926
  let p = e(g, t);
927
927
  s += s.includes("?") ? `&${p}` : `?${p}`;
928
928
  }
929
- return Z(U({}, n), { _data: l, _url: s, data: i, url: a, method: r, [A]: h, isGet: f });
929
+ return ee(z({}, n), { _data: l, _url: s, data: i, url: a, method: r, [A]: h, isGet: f });
930
930
  });
931
931
  }
932
932
  var ar = typeof AbortController != `${F}`;
933
933
  function or(n, e) {
934
- return z(this, null, function* () {
934
+ return H(this, null, function* () {
935
935
  let t;
936
936
  if (!e || !n.ok || [ue, Ce].includes(e)) {
937
937
  if (t = yield n[ue](), t && e !== ue) try {
@@ -968,7 +968,7 @@ var lr = (n) => new T(n), T = class {
968
968
  } };
969
969
  }
970
970
  request(e) {
971
- return z(this, null, function* () {
971
+ return H(this, null, function* () {
972
972
  let t = Le(this.config || {}, this.defaults, typeof e == "string" ? { url: e } : e), r = "credentials";
973
973
  t.withCredentials && !t[r] && (t[r] = "include"), t[de] || (t[de] = De);
974
974
  for (let o of this.REQI) t = yield o(t);
@@ -987,7 +987,7 @@ var lr = (n) => new T(n), T = class {
987
987
  });
988
988
  }
989
989
  _(e) {
990
- return z(this, null, function* () {
990
+ return H(this, null, function* () {
991
991
  let t = yield ir(e), { url: r, method: s, headers: a, timeout: o, signal: i, data: l, _data: h, _url: g, isGet: f, fetch: p } = t, u = Zt(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
992
992
  e._url = g;
993
993
  let d, b = [], k = F;
@@ -1001,11 +1001,11 @@ var lr = (n) => new T(n), T = class {
1001
1001
  clearTimeout(k);
1002
1002
  }));
1003
1003
  let P = g || r, D = "baseURL";
1004
- return e[D] && !Ht(P) && (P = Vt(e[D], P)), (p || fetch)(P, Z(U({ body: f ? F : h }, u), { signal: d, method: s, headers: a })).then((v) => z(this, null, function* () {
1005
- let { responseType: W } = e, y = { data: yield or(v, W), response: v, config: e, request: e, [q]: v[q], statusText: v.statusText, [A]: v[A] };
1004
+ return e[D] && !Ht(P) && (P = Vt(e[D], P)), (p || fetch)(P, ee(z({ body: f ? F : h }, u), { signal: d, method: s, headers: a })).then((v) => H(this, null, function* () {
1005
+ let { responseType: q } = e, y = { data: yield or(v, q), response: v, config: e, request: e, [Q]: v[Q], statusText: v.statusText, [A]: v[A] };
1006
1006
  if (!v.ok) {
1007
- let I = new tt(v[q] ? `Request failed with status code ${v[q]}` : "Network error", e, y);
1008
- return Promise.reject(I);
1007
+ let E = new tt(v[Q] ? `Request failed with status code ${v[Q]}` : "Network error", e, y);
1008
+ return Promise.reject(E);
1009
1009
  }
1010
1010
  return y;
1011
1011
  })).finally(() => {
@@ -1015,10 +1015,10 @@ var lr = (n) => new T(n), T = class {
1015
1015
  });
1016
1016
  }
1017
1017
  cG(e) {
1018
- return (t, r) => this.request(r ? Z(U({}, r), { method: e, url: t }) : { method: e, url: t });
1018
+ return (t, r) => this.request(r ? ee(z({}, r), { method: e, url: t }) : { method: e, url: t });
1019
1019
  }
1020
1020
  cP(e) {
1021
- return (t, r, s) => this.request(s ? Z(U({}, s), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
1021
+ return (t, r, s) => this.request(s ? ee(z({}, s), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
1022
1022
  }
1023
1023
  get(e, t) {
1024
1024
  return this.cG(fe)(e, t);
@@ -1055,7 +1055,7 @@ let ye;
1055
1055
  function Dn(n) {
1056
1056
  ye = n;
1057
1057
  }
1058
- const V = at.create({
1058
+ const W = at.create({
1059
1059
  baseURL: "https://api.overlayed.gg",
1060
1060
  headers: {
1061
1061
  Accept: "application/json",
@@ -1067,7 +1067,7 @@ Me.interceptors.request.use((n) => {
1067
1067
  return e && (n.headers ?? (n.headers = {}), n.headers.Authorization = e), n;
1068
1068
  });
1069
1069
  function ur(n) {
1070
- return V.get(`/v1/public/applications/${n}`);
1070
+ return W.get(`/v1/public/applications/${n}`);
1071
1071
  }
1072
1072
  function hr(n, e) {
1073
1073
  return Me.get(`/v1/native/${ot(n)}/version.txt`, {
@@ -1085,20 +1085,20 @@ function ot(n) {
1085
1085
  return n === "01JXPFK6YQ3N00N2Y9JHFNG55D" || n === "01JZEBPGHT5M4Y6SGY4P7Q9EZT" ? "siege-game-module" : n;
1086
1086
  }
1087
1087
  function gr() {
1088
- return V.get("/v1/public/raven/config");
1088
+ return W.get("/v1/public/raven/config");
1089
1089
  }
1090
1090
  const fr = xt();
1091
1091
  function pr(n, e) {
1092
- return V.get(`/v1/public/raven/games/${n}/builds/${e}`);
1092
+ return W.get(`/v1/public/raven/games/${n}/builds/${e}`);
1093
1093
  }
1094
1094
  function yr(n, e) {
1095
- return V.post(`/v1/public/raven/games/${n}/builds/upload`, null, {
1095
+ return W.post(`/v1/public/raven/games/${n}/builds/upload`, null, {
1096
1096
  params: e
1097
1097
  });
1098
1098
  }
1099
1099
  function mr(n, e) {
1100
1100
  const t = new FormData();
1101
- return t.append("file", e.chunk), V.patch(`/v1/public/raven/games/${n}/builds/upload`, t, {
1101
+ return t.append("file", e.chunk), W.patch(`/v1/public/raven/games/${n}/builds/upload`, t, {
1102
1102
  params: e
1103
1103
  });
1104
1104
  }
@@ -1108,9 +1108,9 @@ function br(n) {
1108
1108
  function vr(n) {
1109
1109
  return !!(n && "kind" in n.data && "message" in n.data);
1110
1110
  }
1111
- let ee;
1111
+ let te;
1112
1112
  function An(n) {
1113
- ee = n;
1113
+ te = n;
1114
1114
  }
1115
1115
  class wr extends le {
1116
1116
  constructor() {
@@ -1147,7 +1147,7 @@ class wr extends le {
1147
1147
  this.logger.sentryError("Invalid VITE_BUILD_CHANNEL");
1148
1148
  return;
1149
1149
  }
1150
- await (ee == null ? void 0 : ee());
1150
+ await (te == null ? void 0 : te());
1151
1151
  for (const s of t)
1152
1152
  try {
1153
1153
  const { data: a } = await hr(s, r), o = await this.getCurrentVersion(s);
@@ -1188,8 +1188,8 @@ class wr extends le {
1188
1188
  o.isDirectory() && o.name !== r && await S.rm(m.join(s, o.name), { recursive: !0, force: !0 });
1189
1189
  }
1190
1190
  }
1191
- const ie = L(wr);
1192
- class Er extends le {
1191
+ const ae = L(wr);
1192
+ class Ir extends le {
1193
1193
  constructor() {
1194
1194
  super("RavenManager");
1195
1195
  c(this, "REFETCH_INTERVAL", 1e3 * 60 * 5);
@@ -1215,7 +1215,7 @@ class Er extends le {
1215
1215
  return this._executableToGameMap;
1216
1216
  }
1217
1217
  destroy() {
1218
- this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler), ie.getInstance().destroy(), super.destroy();
1218
+ this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler), ae.getInstance().destroy(), super.destroy();
1219
1219
  }
1220
1220
  async fetchRavenConfig() {
1221
1221
  try {
@@ -1239,7 +1239,7 @@ class Er extends le {
1239
1239
  }
1240
1240
  a.modules.forEach((o) => s.add(o));
1241
1241
  }
1242
- await ie.getInstance().initWithDlls(Array.from(s)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
1242
+ await ae.getInstance().initWithDlls(Array.from(s)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
1243
1243
  } catch (t) {
1244
1244
  this.logger.captureSentryException("Failed to fetch Raven config", t), this._failedRefetchTimeoutHandler = setTimeout(() => this.fetchRavenConfig(), this.FAILED_REFETCH_INTERVAL);
1245
1245
  }
@@ -1248,16 +1248,16 @@ class Er extends le {
1248
1248
  this._executableToGameMap.clear(), this._executablesArray = [];
1249
1249
  }
1250
1250
  }
1251
- const H = L(Er), Ir = ae(import.meta.url), {
1251
+ const V = L(Ir), Er = oe(import.meta.url), {
1252
1252
  PipeEventServer: Mn,
1253
1253
  PipeEventClient: On,
1254
1254
  PipeEventBase: Kn,
1255
1255
  ProcessMonitor: kr,
1256
- Process: Q,
1256
+ Process: Y,
1257
1257
  InjectionMethod: Rn,
1258
1258
  AccessLevel: Fn,
1259
1259
  HardwareInterface: lt
1260
- } = Ir("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
1260
+ } = Er("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
1261
1261
  class _r extends le {
1262
1262
  constructor() {
1263
1263
  super("ProcessManager");
@@ -1273,14 +1273,14 @@ class _r extends le {
1273
1273
  return Array.from(this._processes.values()).flat().filter((t) => !t.destroyedAt);
1274
1274
  }
1275
1275
  init() {
1276
- super.init(), H.getInstance().on("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processMonitor.on("create", (t) => {
1276
+ super.init(), V.getInstance().on("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processMonitor.on("create", (t) => {
1277
1277
  this.logger.log("Process created", t), this.addProcess(t), this.logger.log(`Active Process Count: ${this._processes.size}`), this.emit("create", { process: t });
1278
1278
  }), this._processMonitor.on("destroy", (t) => {
1279
1279
  this.logger.log("Process destroyed", t), this.deleteProcess(t), this.logger.log(`Active Process Count: ${this._processes.size}`), this.emit("destroy", { process: t });
1280
1280
  });
1281
1281
  }
1282
1282
  destroy() {
1283
- H.getInstance().off("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processes.clear(), this._processMonitor.removeAllListeners(), super.destroy();
1283
+ V.getInstance().off("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processes.clear(), this._processMonitor.removeAllListeners(), super.destroy();
1284
1284
  }
1285
1285
  isProcessRunning(t) {
1286
1286
  const r = this._processes.get(t);
@@ -1308,11 +1308,11 @@ class _r extends le {
1308
1308
  s.length === 0 ? this._processes.delete(t.name) : this._processes.set(t.name, s);
1309
1309
  }
1310
1310
  }
1311
- const K = L(_r), Pr = ae(import.meta.url), { RenderInterface: Sr, renderHookPath: $n } = Pr("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1312
- var Cr = Object.defineProperty, Lr = (n, e, t) => e in n ? Cr(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, te = (n, e, t) => Lr(n, typeof e != "symbol" ? e + "" : e, t);
1311
+ const K = L(_r), Pr = oe(import.meta.url), { RenderInterface: Sr, renderHookPath: $n } = Pr("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1312
+ var Cr = Object.defineProperty, Lr = (n, e, t) => e in n ? Cr(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, re = (n, e, t) => Lr(n, typeof e != "symbol" ? e + "" : e, t);
1313
1313
  let Dr = class {
1314
1314
  constructor(e) {
1315
- te(this, "_instance"), te(this, "_resolution"), te(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
1315
+ re(this, "_instance"), re(this, "_resolution"), re(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
1316
1316
  }
1317
1317
  destroy() {
1318
1318
  this._instance.off("resolution", this.boundOnResolutionChanged);
@@ -1328,7 +1328,7 @@ let Dr = class {
1328
1328
  }
1329
1329
  }, Ar = class {
1330
1330
  constructor() {
1331
- te(this, "interfaces", {});
1331
+ re(this, "interfaces", {});
1332
1332
  }
1333
1333
  createInterface(e) {
1334
1334
  return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new Dr(new Sr(e, { access: 1 })), this.interfaces[e]);
@@ -1337,11 +1337,11 @@ let Dr = class {
1337
1337
  return this.interfaces[e] ? this.interfaces[e] : this.createInterface(e);
1338
1338
  }
1339
1339
  };
1340
- const B = L(Ar);
1341
- var Mr = Object.defineProperty, Or = (n, e, t) => e in n ? Mr(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Y = (n, e, t) => Or(n, typeof e != "symbol" ? e + "" : e, t);
1340
+ const G = L(Ar);
1341
+ var Mr = Object.defineProperty, Or = (n, e, t) => e in n ? Mr(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, J = (n, e, t) => Or(n, typeof e != "symbol" ? e + "" : e, t);
1342
1342
  class Kr {
1343
1343
  constructor(e) {
1344
- Y(this, "_clientId", null), Y(this, "_userId", null), Y(this, "options"), Y(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new Qe(), this.setupFlushInterval();
1344
+ J(this, "_clientId", null), J(this, "_userId", null), J(this, "options"), J(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new Qe(), this.setupFlushInterval();
1345
1345
  }
1346
1346
  set clientId(e) {
1347
1347
  this._clientId = e;
@@ -1378,7 +1378,7 @@ class Kr {
1378
1378
  };
1379
1379
  }
1380
1380
  }
1381
- const M = L(Kr), Rr = ae(import.meta.url), Fr = Rr.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1381
+ const M = L(Kr), Rr = oe(import.meta.url), Fr = Rr.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1382
1382
  class $r extends Nt {
1383
1383
  constructor() {
1384
1384
  super("GameLaunchManager");
@@ -1390,7 +1390,7 @@ class $r extends Nt {
1390
1390
  this.subscribedGames = new Set(t);
1391
1391
  }
1392
1392
  init() {
1393
- super.init(), B.getInstance().createInterface("OGG_SIEGE"), K.getInstance().on("create", this.boundOnProcessCreate), K.getInstance().on("destroy", this.boundOnProcessDestroy);
1393
+ super.init(), G.getInstance().createInterface("OGG_SIEGE"), K.getInstance().on("create", this.boundOnProcessCreate), K.getInstance().on("destroy", this.boundOnProcessDestroy);
1394
1394
  }
1395
1395
  destroy() {
1396
1396
  K.getInstance().off("create", this.boundOnProcessCreate), K.getInstance().off("destroy", this.boundOnProcessDestroy), super.destroy();
@@ -1408,12 +1408,12 @@ class $r extends Nt {
1408
1408
  const s = new AbortController();
1409
1409
  if (await this.emit("gameLaunch", { game: r.identifier, reject: () => s.abort }), s.signal.aborted)
1410
1410
  return;
1411
- if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", Q.currentProcess.isElevated), t.isElevated && !Q.currentProcess.isElevated) {
1411
+ if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", Y.currentProcess.isElevated), t.isElevated && !Y.currentProcess.isElevated) {
1412
1412
  C.getInstance().fatal("Game is elevated but the App is not", "ELEVATION_MISMATCH", {
1413
- appElevated: !!Q.currentProcess.isElevated,
1413
+ appElevated: !!Y.currentProcess.isElevated,
1414
1414
  gameElevated: !!t.isElevated
1415
1415
  }), this.logger.sentryLog("Game elevated but App is not", {
1416
- appElevated: Q.currentProcess.isElevated,
1416
+ appElevated: Y.currentProcess.isElevated,
1417
1417
  gameElevated: t.isElevated
1418
1418
  });
1419
1419
  return;
@@ -1428,10 +1428,10 @@ class $r extends Nt {
1428
1428
  });
1429
1429
  }
1430
1430
  const o = r == null ? void 0 : r.modules.map(async (i) => {
1431
- const l = await ie.getInstance().getCurrentVersion(i);
1431
+ const l = await ae.getInstance().getCurrentVersion(i);
1432
1432
  if (!l)
1433
1433
  return this.logger.sentryError("No version found for DLL", { identifier: i }), Promise.resolve();
1434
- const h = ie.getInstance().getTargetVersionPath(i, l);
1434
+ const h = ae.getInstance().getTargetVersionPath(i, l);
1435
1435
  this.logger.log("DLL Path", h);
1436
1436
  const g = await this.getDllFiles(h);
1437
1437
  return this.logger.log("DLL Files", g), Promise.all(
@@ -1484,7 +1484,7 @@ class $r extends Nt {
1484
1484
  getRavenGame(t) {
1485
1485
  if (!t.name)
1486
1486
  return;
1487
- const r = H.getInstance().getExecutableData(t.name);
1487
+ const r = V.getInstance().getExecutableData(t.name);
1488
1488
  if (!r) {
1489
1489
  this.logger.sentryError("No raven game found for process", { process: t });
1490
1490
  return;
@@ -1492,17 +1492,17 @@ class $r extends Nt {
1492
1492
  return r;
1493
1493
  }
1494
1494
  }
1495
- const G = L($r);
1495
+ const j = L($r);
1496
1496
  class xr extends Ye {
1497
1497
  constructor() {
1498
1498
  super("GameBuildManager");
1499
1499
  c(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
1500
1500
  }
1501
1501
  init() {
1502
- super.init(), G.getInstance().on("gameReadyInternal", this.boundOnGameLaunch);
1502
+ super.init(), j.getInstance().on("gameReadyInternal", this.boundOnGameLaunch);
1503
1503
  }
1504
1504
  destroy() {
1505
- G.getInstance().off("gameReadyInternal", this.boundOnGameLaunch), super.destroy();
1505
+ j.getInstance().off("gameReadyInternal", this.boundOnGameLaunch), super.destroy();
1506
1506
  }
1507
1507
  async onGameLaunch(...t) {
1508
1508
  const [{ ravenGame: r, process: s }] = t;
@@ -1781,7 +1781,7 @@ class Gr extends le {
1781
1781
  }
1782
1782
  init() {
1783
1783
  super.init();
1784
- const t = B.getInstance().getInterface("OGG_SIEGE");
1784
+ const t = G.getInstance().getInterface("OGG_SIEGE");
1785
1785
  t.instance.on("keyboardFocus", this.boundHandleKeyboardFocus), t.instance.on("keyDown", this.boundHandleKeyDown), t.instance.on("keyUp", this.boundHandleKeyUp);
1786
1786
  }
1787
1787
  // TODO support multiple callbacks
@@ -1815,7 +1815,7 @@ class Gr extends le {
1815
1815
  return this.keybindsFile.get();
1816
1816
  }
1817
1817
  destroy() {
1818
- const t = B.getInstance().getInterface("OGG_SIEGE");
1818
+ const t = G.getInstance().getInterface("OGG_SIEGE");
1819
1819
  t.instance.off("keyboardFocus", this.boundHandleKeyboardFocus), t.instance.off("keyDown", this.boundHandleKeyDown), t.instance.off("keyUp", this.boundHandleKeyUp), super.destroy();
1820
1820
  }
1821
1821
  handleKeyDown(t) {
@@ -1891,7 +1891,7 @@ class jr extends Ye {
1891
1891
  c(this, "globalMouseBlockCount", /* @__PURE__ */ new Set());
1892
1892
  c(this, "globalKeyboardBlockCount", /* @__PURE__ */ new Set());
1893
1893
  c(this, "keyInputBlocks", {});
1894
- this.renderInterface = B.getInstance().getInterface(t);
1894
+ this.renderInterface = G.getInstance().getInterface(t);
1895
1895
  }
1896
1896
  scope(t) {
1897
1897
  return {
@@ -1936,34 +1936,34 @@ function zr() {
1936
1936
  function v() {
1937
1937
  D = Date.now();
1938
1938
  }
1939
- function W() {
1940
- let y = Date.now() - D, I = y < 150;
1941
- return I || console.warn("was not recently active", y), I;
1939
+ function q() {
1940
+ let y = Date.now() - D, E = y < 150;
1941
+ return E || console.warn("was not recently active", y), E;
1942
1942
  }
1943
1943
  if (process.platform === "win32") {
1944
1944
  let y = { KEYDOWN: 256, LBUTTONUP: 514, MBUTTONUP: 520, RBUTTONUP: 517, XBUTTONUP: 524, TOUCH: 576 };
1945
- for (let I of Object.values(y)) f.hookWindowMessage(I, v);
1945
+ for (let E of Object.values(y)) f.hookWindowMessage(E, v);
1946
1946
  }
1947
- b.on("input-event", (y, I) => {
1948
- l.has(I.type) && v();
1949
- }), b.on("will-navigate", (y, I) => {
1950
- let _ = y.url || I;
1947
+ b.on("input-event", (y, E) => {
1948
+ l.has(E.type) && v();
1949
+ }), b.on("will-navigate", (y, E) => {
1950
+ let _ = y.url || E;
1951
1951
  if (console.log("will-navigate", _), !_) return;
1952
1952
  let Oe = new URL(_);
1953
1953
  if (!k(Oe)) {
1954
- if (!W()) {
1954
+ if (!q()) {
1955
1955
  console.log("blocked navigation", _), y.preventDefault();
1956
1956
  return;
1957
1957
  }
1958
1958
  P(Oe) && (console.log("external navigation", _), y.preventDefault(), d.openExternal(_));
1959
1959
  }
1960
- }), b.session.on("will-download", (y, I) => {
1961
- let _ = I.getURL();
1960
+ }), b.session.on("will-download", (y, E) => {
1961
+ let _ = E.getURL();
1962
1962
  /^blob:/.test(_) || y.preventDefault();
1963
1963
  }), b.setWindowOpenHandler((y) => {
1964
1964
  console.log("window-open", y.url);
1965
- let { url: I } = y, _ = new URL(I);
1966
- if (!k(_)) return W() ? (P(_) && d.openExternal(y.url), { action: "deny" }) : (console.log("blocked navigation", I), { action: "deny" });
1965
+ let { url: E } = y, _ = new URL(E);
1966
+ if (!k(_)) return q() ? (P(_) && d.openExternal(y.url), { action: "deny" }) : (console.log("blocked navigation", E), { action: "deny" });
1967
1967
  });
1968
1968
  }
1969
1969
  i.exports = g;
@@ -1984,15 +1984,15 @@ function zr() {
1984
1984
  return he = { setupRevUtils: a, setupLinkHandler: r, setUserAgent: s }, he;
1985
1985
  }
1986
1986
  var Hr = zr();
1987
- let J = !1, X;
1987
+ let X = !1, Z;
1988
1988
  function Nn(n) {
1989
1989
  const { init: e = !0 } = n;
1990
- if (Vr(n), oe.getInstance().init(n.applicationId), J)
1991
- return X;
1990
+ if (Vr(n), N.getInstance().init(n.applicationId), X)
1991
+ return Z;
1992
1992
  function t() {
1993
1993
  nn(n);
1994
1994
  const r = /* @__PURE__ */ new Map(), s = Qr(n.modules, r), a = Yr(), o = Xr(n.keybinds), i = Zr(), l = en(), h = rn(), g = tn();
1995
- Wr(n), Jr(n, r), J = !0, X = {
1995
+ Wr(n), Jr(n, r), X = !0, Z = {
1996
1996
  ...s,
1997
1997
  ...a,
1998
1998
  ads: h,
@@ -2002,18 +2002,18 @@ function Nn(n) {
2002
2002
  cortex: g,
2003
2003
  hasAnyActiveProcesses: () => K.getInstance().hasAnyActiveProcesses,
2004
2004
  init: t,
2005
- initialized: J
2005
+ initialized: X
2006
2006
  };
2007
2007
  }
2008
- return e ? (t(), X) : new Proxy(
2008
+ return e ? (t(), Z) : new Proxy(
2009
2009
  {
2010
2010
  init: t
2011
2011
  },
2012
2012
  {
2013
2013
  get: (r, s) => {
2014
- if (s !== "init" && !J)
2014
+ if (s !== "init" && !X)
2015
2015
  throw new Error(`overlayed was called before initialized: ${s}`);
2016
- return s === "init" ? r[s] : X[s];
2016
+ return s === "init" ? r[s] : Z[s];
2017
2017
  }
2018
2018
  }
2019
2019
  );
@@ -2031,18 +2031,24 @@ function Vr(n) {
2031
2031
  };
2032
2032
  }
2033
2033
  function Wr(n) {
2034
- const e = n.universal ? ["*"] : n.modules.map((r) => r.key);
2035
- G.getInstance().setSubscribedGames(e), ct.getInstance().init(), G.getInstance().init(), K.getInstance().init(), H.getInstance().init();
2036
- let t;
2037
- global.OVERLAYED.electron.ipcMain.handle("getAppInfo", async () => t || (t = ur(global.OVERLAYED.APPLICATION_ID).then((s) => s.data), {
2038
- ...await t,
2039
- userId: lt.generateUniqueIdentifier()
2040
- })), Ve.on("quit", () => {
2034
+ const e = n.universal ? ["*"] : n.modules.map((s) => s.key);
2035
+ j.getInstance().setSubscribedGames(e), ct.getInstance().init(), j.getInstance().init(), K.getInstance().init(), V.getInstance().init();
2036
+ async function t() {
2037
+ const s = ur(global.OVERLAYED.APPLICATION_ID).then((i) => i.data), a = lt.generateUniqueIdentifier();
2038
+ N.getInstance().log("userId", a);
2039
+ const o = {
2040
+ ...await s,
2041
+ userId: a
2042
+ };
2043
+ return N.getInstance().log("appInfo", o), o;
2044
+ }
2045
+ let r;
2046
+ global.OVERLAYED.electron.ipcMain.handle("getAppInfo", async () => (r = r ?? t(), r)), Ve.on("quit", () => {
2041
2047
  qr();
2042
2048
  });
2043
2049
  }
2044
2050
  function qr() {
2045
- H.getInstance().destroy(), G.getInstance().destroy(), ct.getInstance().destroy(), K.getInstance().destroy(), B.getInstance().getInterface("OGG_SIEGE").destroy(), ke.getInstance().destroy(), C.getInstance().destroy();
2051
+ V.getInstance().destroy(), j.getInstance().destroy(), ct.getInstance().destroy(), K.getInstance().destroy(), G.getInstance().getInterface("OGG_SIEGE").destroy(), ke.getInstance().destroy(), C.getInstance().destroy();
2046
2052
  }
2047
2053
  function Qr(n, e) {
2048
2054
  return n.reduce((t, r) => {
@@ -2071,7 +2077,7 @@ function Qr(n, e) {
2071
2077
  }, {});
2072
2078
  }
2073
2079
  function Yr() {
2074
- const n = C.getInstance(), e = G.getInstance();
2080
+ const n = C.getInstance(), e = j.getInstance();
2075
2081
  return {
2076
2082
  on: (t, r) => {
2077
2083
  switch (t) {
@@ -2267,7 +2273,7 @@ function nn(n) {
2267
2273
  });
2268
2274
  }
2269
2275
  function w() {
2270
- return B.getInstance().getInterface("OGG_SIEGE");
2276
+ return G.getInstance().getInterface("OGG_SIEGE");
2271
2277
  }
2272
2278
  export {
2273
2279
  Nn as overlayed,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@overlayed/app",
3
3
  "author": "overlayed.gg",
4
4
  "homepage": "https://overlayed.gg",
5
- "version": "0.10.0",
5
+ "version": "0.10.2",
6
6
  "description": "Overlayed app",
7
7
  "license": "BSD-3-Clause",
8
8
  "repository": {
@@ -52,7 +52,7 @@
52
52
  "devDependencies": {
53
53
  "@ark/attest": "^0.45.0",
54
54
  "@overlayed-gg/native-interface": "0.1.7",
55
- "@overlayed-gg/render-interface": "0.1.10",
55
+ "@overlayed-gg/render-interface": "0.1.11",
56
56
  "msw": "^2.10.3",
57
57
  "rev-utils": "https://r2.reviq.app/rev-utils-v1.0.3.tgz",
58
58
  "rollup-plugin-node-externals": "^8.0.0",
@@ -61,11 +61,11 @@
61
61
  "vite-plugin-dts": "^4.5.3",
62
62
  "vite-plugin-static-copy": "^2.3.1",
63
63
  "vitest": "^3.0.9",
64
+ "@overlayed/api": "0.0.3",
64
65
  "@overlayed/cortex-client": "0.0.2",
65
- "@overlayed/native-managers": "0.0.2",
66
66
  "@overlayed/events": "0.0.2",
67
+ "@overlayed/native-managers": "0.0.2",
67
68
  "@overlayed/siege": "0.0.2",
68
- "@overlayed/api": "0.0.3",
69
69
  "@overlayed/utils": "0.0.2"
70
70
  },
71
71
  "dependencies": {