@overlayed/app 0.5.1 → 0.6.1
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 +103 -103
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var l = (s, e, t) =>
|
|
1
|
+
var rt = Object.defineProperty;
|
|
2
|
+
var st = (s, e, t) => e in s ? rt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var l = (s, e, t) => st(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { type as L } from "arktype";
|
|
5
|
-
import P, { mkdirSync as
|
|
6
|
-
import f, { join as D, resolve as
|
|
5
|
+
import P, { mkdirSync as le, existsSync as ce, writeFileSync as he, createWriteStream as Oe, readdirSync as Me, unlinkSync as $e, readFileSync as Ae, copyFileSync as nt } from "node:fs";
|
|
6
|
+
import f, { join as D, resolve as it } from "node:path";
|
|
7
7
|
import { createRequire as ee } from "node:module";
|
|
8
8
|
import w from "node:fs/promises";
|
|
9
9
|
import Re from "jszip";
|
|
10
|
-
import { createHash as
|
|
11
|
-
import
|
|
12
|
-
var
|
|
13
|
-
function
|
|
10
|
+
import { createHash as at } from "node:crypto";
|
|
11
|
+
import ot, { app as xe } from "electron";
|
|
12
|
+
var lt = Object.defineProperty, ct = (s, e, t) => e in s ? lt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, b = (s, e, t) => ct(s, typeof e != "symbol" ? e + "" : e, t);
|
|
13
|
+
function ht(s) {
|
|
14
14
|
return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
|
|
15
15
|
var r = s.get(e);
|
|
16
16
|
r ? r.push(t) : s.set(e, [t]);
|
|
@@ -26,9 +26,9 @@ function ct(s) {
|
|
|
26
26
|
});
|
|
27
27
|
} };
|
|
28
28
|
}
|
|
29
|
-
let
|
|
29
|
+
let ue = class {
|
|
30
30
|
constructor() {
|
|
31
|
-
b(this, "emitter"), this.emitter =
|
|
31
|
+
b(this, "emitter"), this.emitter = ht();
|
|
32
32
|
}
|
|
33
33
|
on(e, t) {
|
|
34
34
|
this.emitter.on(e, t);
|
|
@@ -44,7 +44,7 @@ let de = class {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
function
|
|
47
|
+
function de(s, ...e) {
|
|
48
48
|
var t;
|
|
49
49
|
return t = class extends s {
|
|
50
50
|
/**
|
|
@@ -61,7 +61,7 @@ function ge(s, ...e) {
|
|
|
61
61
|
}
|
|
62
62
|
}, b(t, "_instance"), t;
|
|
63
63
|
}
|
|
64
|
-
let
|
|
64
|
+
let ut = class extends ue {
|
|
65
65
|
destroy() {
|
|
66
66
|
this.removeAllListeners();
|
|
67
67
|
}
|
|
@@ -90,8 +90,8 @@ let ht = class extends de {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
-
|
|
94
|
-
let
|
|
93
|
+
de(ut);
|
|
94
|
+
let dt = class Te extends ue {
|
|
95
95
|
constructor(e, t, r = "") {
|
|
96
96
|
super(), b(this, "stream"), b(this, "logPath"), b(this, "baseFileName"), b(this, "currentDate"), b(this, "rotationCheckInterval"), b(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
|
}
|
|
@@ -126,16 +126,16 @@ let ut = class Te extends de {
|
|
|
126
126
|
}
|
|
127
127
|
ensureLogDirectory() {
|
|
128
128
|
try {
|
|
129
|
-
|
|
129
|
+
le(this.logPath, { recursive: !0 });
|
|
130
130
|
} catch (e) {
|
|
131
131
|
throw console.error(`Failed to create log directory ${this.logPath}:`, e), e;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
ensureLogFile() {
|
|
135
135
|
const e = D(this.logPath, this.getFileName(this.currentDate));
|
|
136
|
-
if (!
|
|
136
|
+
if (!ce(e))
|
|
137
137
|
try {
|
|
138
|
-
|
|
138
|
+
he(e, "", "utf8");
|
|
139
139
|
} catch (t) {
|
|
140
140
|
throw console.error(`Failed to create log file ${e}:`, t), t;
|
|
141
141
|
}
|
|
@@ -184,8 +184,8 @@ let ut = class Te extends de {
|
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
|
-
const
|
|
188
|
-
let
|
|
187
|
+
const gt = () => f.join(process.env.APPDATA ?? "", "overlayed"), ft = (s) => f.join(gt(), "apps", s), pt = (s) => f.join(ft(s), "logs");
|
|
188
|
+
let yt = class {
|
|
189
189
|
constructor() {
|
|
190
190
|
b(this, "data", []);
|
|
191
191
|
}
|
|
@@ -207,12 +207,12 @@ let pt = class {
|
|
|
207
207
|
e && (yield e);
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
},
|
|
210
|
+
}, mt = class {
|
|
211
211
|
constructor() {
|
|
212
|
-
b(this, "fileName", "app.log"), b(this, "fileLogger"), b(this, "path"), b(this, "appId"), b(this, "messageQueue", new
|
|
212
|
+
b(this, "fileName", "app.log"), b(this, "fileLogger"), b(this, "path"), b(this, "appId"), b(this, "messageQueue", new yt());
|
|
213
213
|
}
|
|
214
214
|
init(e) {
|
|
215
|
-
this.appId = e, this.path =
|
|
215
|
+
this.appId = e, this.path = pt(e), this.fileLogger = new dt(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,9 +269,9 @@ 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
|
-
|
|
273
|
-
const
|
|
274
|
-
PipeEventServer:
|
|
272
|
+
de(mt);
|
|
273
|
+
const bt = ee(import.meta.url), {
|
|
274
|
+
PipeEventServer: vt,
|
|
275
275
|
PipeEventClient: Yr,
|
|
276
276
|
PipeEventBase: Zr,
|
|
277
277
|
ProcessMonitor: es,
|
|
@@ -279,8 +279,8 @@ const mt = ee(import.meta.url), {
|
|
|
279
279
|
InjectionMethod: rs,
|
|
280
280
|
AccessLevel: ss,
|
|
281
281
|
HardwareInterface: ns
|
|
282
|
-
} =
|
|
283
|
-
let
|
|
282
|
+
} = bt("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
|
|
283
|
+
let wt = class extends ue {
|
|
284
284
|
constructor(e) {
|
|
285
285
|
super(), b(this, "server", null), b(this, "_hasConnection", !1), b(this, "pipeId"), this.pipeId = e, this.init();
|
|
286
286
|
}
|
|
@@ -294,7 +294,7 @@ let vt = class extends de {
|
|
|
294
294
|
// TODO make sure that new events and new event keys do not stop the app from working
|
|
295
295
|
// this is because we may have new events/event keys from a DLL but the types/validations might not be up to date
|
|
296
296
|
init() {
|
|
297
|
-
this.server = new
|
|
297
|
+
this.server = new vt(this.pipeId, { clientCount: 1, access: 1 }), this.server.on("event", (e) => {
|
|
298
298
|
try {
|
|
299
299
|
const t = JSON.parse(e);
|
|
300
300
|
this.emit("data", [t]);
|
|
@@ -308,8 +308,8 @@ let vt = class extends de {
|
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
|
-
const
|
|
312
|
-
function
|
|
311
|
+
const ge = de(wt, "stats-cc");
|
|
312
|
+
function It(s) {
|
|
313
313
|
return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
|
|
314
314
|
var r = s.get(e);
|
|
315
315
|
r ? r.push(t) : s.set(e, [t]);
|
|
@@ -325,10 +325,10 @@ function wt(s) {
|
|
|
325
325
|
});
|
|
326
326
|
} };
|
|
327
327
|
}
|
|
328
|
-
class
|
|
328
|
+
class fe {
|
|
329
329
|
constructor() {
|
|
330
330
|
l(this, "emitter");
|
|
331
|
-
this.emitter =
|
|
331
|
+
this.emitter = It();
|
|
332
332
|
}
|
|
333
333
|
on(e, t) {
|
|
334
334
|
this.emitter.on(e, t);
|
|
@@ -361,7 +361,7 @@ function E(s, ...e) {
|
|
|
361
361
|
}
|
|
362
362
|
}, l(r, "_instance"), r;
|
|
363
363
|
}
|
|
364
|
-
class
|
|
364
|
+
class Et extends fe {
|
|
365
365
|
destroy() {
|
|
366
366
|
this.removeAllListeners();
|
|
367
367
|
}
|
|
@@ -390,8 +390,8 @@ class It extends pe {
|
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
const I = E(
|
|
394
|
-
class
|
|
393
|
+
const I = E(Et);
|
|
394
|
+
class _t {
|
|
395
395
|
constructor(e) {
|
|
396
396
|
l(this, "data");
|
|
397
397
|
l(this, "_schema");
|
|
@@ -488,7 +488,7 @@ class Et {
|
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
-
class
|
|
491
|
+
class pe extends fe {
|
|
492
492
|
constructor(t, r, n = "") {
|
|
493
493
|
super();
|
|
494
494
|
l(this, "stream");
|
|
@@ -500,7 +500,7 @@ class ye extends pe {
|
|
|
500
500
|
this.logPath = t, this.baseFileName = r.replace(".log", ""), this.currentDate = this.getDateString(/* @__PURE__ */ new Date()), this.ensureLogDirectory(), this.ensureLogFile(), this.stream = this.createStream(), this.rotationCheckInterval = this.startRotationCheck(), this.cleanupOldLogs();
|
|
501
501
|
}
|
|
502
502
|
static scope(t, r, n) {
|
|
503
|
-
return new
|
|
503
|
+
return new pe(t, r, n);
|
|
504
504
|
}
|
|
505
505
|
log(...t) {
|
|
506
506
|
this.write("log", ...t);
|
|
@@ -530,16 +530,16 @@ class ye extends pe {
|
|
|
530
530
|
}
|
|
531
531
|
ensureLogDirectory() {
|
|
532
532
|
try {
|
|
533
|
-
|
|
533
|
+
le(this.logPath, { recursive: !0 });
|
|
534
534
|
} catch (t) {
|
|
535
535
|
throw console.error(`Failed to create log directory ${this.logPath}:`, t), t;
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
ensureLogFile() {
|
|
539
539
|
const t = D(this.logPath, this.getFileName(this.currentDate));
|
|
540
|
-
if (!
|
|
540
|
+
if (!ce(t))
|
|
541
541
|
try {
|
|
542
|
-
|
|
542
|
+
he(t, "", "utf8");
|
|
543
543
|
} catch (r) {
|
|
544
544
|
throw console.error(`Failed to create log file ${t}:`, r), r;
|
|
545
545
|
}
|
|
@@ -588,8 +588,8 @@ class ye extends pe {
|
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
const
|
|
592
|
-
class
|
|
591
|
+
const ye = () => f.join(process.env.APPDATA ?? "", "overlayed"), Be = (s) => f.join(ye(), "apps", s), kt = (s) => f.join(Be(s), "logs");
|
|
592
|
+
class Ne {
|
|
593
593
|
constructor() {
|
|
594
594
|
l(this, "data", []);
|
|
595
595
|
}
|
|
@@ -618,10 +618,10 @@ class Pt {
|
|
|
618
618
|
l(this, "fileLogger");
|
|
619
619
|
l(this, "path");
|
|
620
620
|
l(this, "appId");
|
|
621
|
-
l(this, "messageQueue", new
|
|
621
|
+
l(this, "messageQueue", new Ne());
|
|
622
622
|
}
|
|
623
623
|
init(e) {
|
|
624
|
-
this.appId = e, this.path = kt(e), this.fileLogger = new
|
|
624
|
+
this.appId = e, this.path = kt(e), this.fileLogger = new pe(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
|
|
625
625
|
var r;
|
|
626
626
|
(r = this.fileLogger) == null || r[t.type](...t.args);
|
|
627
627
|
});
|
|
@@ -680,14 +680,14 @@ class Pt {
|
|
|
680
680
|
}
|
|
681
681
|
const me = E(Pt);
|
|
682
682
|
function St(s = []) {
|
|
683
|
-
return f.normalize(f.join(
|
|
683
|
+
return f.normalize(f.join(Be(global.OVERLAYED.APP_NAME), ...s));
|
|
684
684
|
}
|
|
685
685
|
const Ct = L({
|
|
686
686
|
game: "string",
|
|
687
687
|
type: "string",
|
|
688
688
|
creation_time: "number"
|
|
689
689
|
});
|
|
690
|
-
class
|
|
690
|
+
class Ge {
|
|
691
691
|
constructor(e) {
|
|
692
692
|
l(this, "logger");
|
|
693
693
|
l(this, "initialized", !1);
|
|
@@ -700,7 +700,7 @@ class Ne {
|
|
|
700
700
|
this.logger.log("Destroying"), this.initialized = !1;
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
|
-
class N extends
|
|
703
|
+
class N extends fe {
|
|
704
704
|
constructor(t) {
|
|
705
705
|
super();
|
|
706
706
|
l(this, "logger");
|
|
@@ -714,7 +714,7 @@ class N extends pe {
|
|
|
714
714
|
this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
-
var M = "object",
|
|
717
|
+
var M = "object", je = "function", Ve = "prototype", re = "text", be = "json", Pe = "abort", se = "paramsSerializer", Se = "addEventListener", V = "status", k = "headers", te = Object, K = void 0, J = null, ne = te[Ve], X = te.keys, A = Array.isArray, Ce = "method", He = "HEAD", ie = "GET", Ue = "OPTIONS", Lt = "POST", Kt = "PUT", Ft = "PATCH", Dt = "DELETE";
|
|
718
718
|
function Ot(s, e) {
|
|
719
719
|
let t = new AbortController();
|
|
720
720
|
function r(o) {
|
|
@@ -742,19 +742,19 @@ function Ot(s, e) {
|
|
|
742
742
|
let a = t.signal;
|
|
743
743
|
return a.clear = i, a;
|
|
744
744
|
}
|
|
745
|
-
var Le =
|
|
745
|
+
var Le = te.getPrototypeOf, Ke = (s) => {
|
|
746
746
|
if (s !== J && typeof s === M) {
|
|
747
|
-
if (typeof Le ===
|
|
747
|
+
if (typeof Le === je) {
|
|
748
748
|
let e = Le(s);
|
|
749
|
-
return e ===
|
|
749
|
+
return e === ne || e === J;
|
|
750
750
|
}
|
|
751
|
-
return
|
|
751
|
+
return ne.toString.call(s) === `[${M} Object]`;
|
|
752
752
|
}
|
|
753
753
|
return !1;
|
|
754
754
|
}, ve = (...s) => s.reduce((e, t) => {
|
|
755
755
|
if (A(t)) throw new TypeError(`Arguments must be ${M}s, not arrays.`);
|
|
756
756
|
return X(t).forEach((r) => {
|
|
757
|
-
["__proto__", "constructor",
|
|
757
|
+
["__proto__", "constructor", Ve].includes(r) || (A(e[r]) && A(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : Ke(e[r]) && Ke(t[r]) ? e[r] = ve(e[r], t[r]) : e[r] = t[r]);
|
|
758
758
|
}), e;
|
|
759
759
|
}, {});
|
|
760
760
|
function we(s, e = !0, t = J, r) {
|
|
@@ -767,7 +767,7 @@ function we(s, e = !0, t = J, r) {
|
|
|
767
767
|
}
|
|
768
768
|
return `[${g}]`;
|
|
769
769
|
};
|
|
770
|
-
for (let g in s) if (
|
|
770
|
+
for (let g in s) if (ne.hasOwnProperty.call(s, g)) {
|
|
771
771
|
let h = s[g];
|
|
772
772
|
if (h !== K) {
|
|
773
773
|
let y = t ? `${t}${d(g)}` : i(g);
|
|
@@ -779,10 +779,10 @@ function we(s, e = !0, t = J, r) {
|
|
|
779
779
|
}
|
|
780
780
|
return n.join("&");
|
|
781
781
|
}
|
|
782
|
-
function
|
|
783
|
-
return A(s) ? s.map(
|
|
782
|
+
function ae(s) {
|
|
783
|
+
return A(s) ? s.map(ae) : (s && typeof s === M && X(s).forEach((e) => {
|
|
784
784
|
let t = s[e];
|
|
785
|
-
t === K ? delete s[e] :
|
|
785
|
+
t === K ? delete s[e] : ae(t);
|
|
786
786
|
}), s);
|
|
787
787
|
}
|
|
788
788
|
function Mt(s) {
|
|
@@ -791,22 +791,22 @@ function Mt(s) {
|
|
|
791
791
|
function $t(s, e) {
|
|
792
792
|
return s ? e ? (s.endsWith("/") ? s : s + "/") + (e[0] === "/" ? e.slice(1) : e) : s : e || "";
|
|
793
793
|
}
|
|
794
|
-
var At = "XiorError", Rt = "XiorTimeoutError",
|
|
794
|
+
var At = "XiorError", Rt = "XiorTimeoutError", ze = class extends Error {
|
|
795
795
|
constructor(s, e, t) {
|
|
796
796
|
super(s), this.name = At, this.request = e, this.config = e, this.response = t;
|
|
797
797
|
}
|
|
798
|
-
}, xt = class extends
|
|
798
|
+
}, xt = class extends ze {
|
|
799
799
|
constructor(e, t, r) {
|
|
800
800
|
super(e, t, r), this.name = Rt;
|
|
801
801
|
}
|
|
802
|
-
}, Tt = Object.defineProperty, Bt = Object.defineProperties, Nt = Object.getOwnPropertyDescriptors, Y = Object.getOwnPropertySymbols,
|
|
803
|
-
for (var t in e || (e = {}))
|
|
804
|
-
if (Y) for (var t of Y(e))
|
|
802
|
+
}, Tt = Object.defineProperty, Bt = Object.defineProperties, Nt = Object.getOwnPropertyDescriptors, Y = Object.getOwnPropertySymbols, We = Object.prototype.hasOwnProperty, qe = Object.prototype.propertyIsEnumerable, Fe = (s, e, t) => e in s ? Tt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, R = (s, e) => {
|
|
803
|
+
for (var t in e || (e = {})) We.call(e, t) && Fe(s, t, e[t]);
|
|
804
|
+
if (Y) for (var t of Y(e)) qe.call(e, t) && Fe(s, t, e[t]);
|
|
805
805
|
return s;
|
|
806
806
|
}, q = (s, e) => Bt(s, Nt(e)), Gt = (s, e) => {
|
|
807
807
|
var t = {};
|
|
808
|
-
for (var r in s)
|
|
809
|
-
if (s != null && Y) for (var r of Y(s)) e.indexOf(r) < 0 &&
|
|
808
|
+
for (var r in s) We.call(s, r) && e.indexOf(r) < 0 && (t[r] = s[r]);
|
|
809
|
+
if (s != null && Y) for (var r of Y(s)) e.indexOf(r) < 0 && qe.call(s, r) && (t[r] = s[r]);
|
|
810
810
|
return t;
|
|
811
811
|
}, x = (s, e, t) => new Promise((r, n) => {
|
|
812
812
|
var i = (c) => {
|
|
@@ -823,21 +823,21 @@ var At = "XiorError", Rt = "XiorTimeoutError", Ue = class extends Error {
|
|
|
823
823
|
}
|
|
824
824
|
}, o = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(i, a);
|
|
825
825
|
o((t = t.apply(s, e)).next());
|
|
826
|
-
}), Ie = "application/",
|
|
827
|
-
function Ut(s =
|
|
828
|
-
return [
|
|
826
|
+
}), Ie = "application/", Qe = `${Ie}x-www-form-urlencoded`, Je = RegExp, jt = new Je(`^${Qe}`, "i"), Vt = `${Ie}${be}`, Ht = new Je(`^${Ie}.*${be}.*`, "i");
|
|
827
|
+
function Ut(s = ie) {
|
|
828
|
+
return [He, ie, Ue].includes(s);
|
|
829
829
|
}
|
|
830
830
|
var zt = typeof URLSearchParams != `${K}`;
|
|
831
831
|
function Wt(s) {
|
|
832
832
|
return x(this, null, function* () {
|
|
833
|
-
let e = s[
|
|
834
|
-
if (o && typeof o.append !==
|
|
833
|
+
let e = s[se] || we, t = s.encodeURI !== !1, r = s[Ce] && s[Ce].toUpperCase(), n = s.url, i = n, a = zt && s.data instanceof URLSearchParams, o = a ? te.fromEntries(s.data.entries()) : s.data, c = o, u = s != null && s[k] ? R({}, s[k]) : {}, d = s.params, g = Ut(r);
|
|
834
|
+
if (o && typeof o.append !== je) {
|
|
835
835
|
let h = "", y = "content-type";
|
|
836
836
|
if (s != null && s[k]) {
|
|
837
837
|
let p = X(s[k]).find((_) => _.toLowerCase() === y);
|
|
838
838
|
p && (y = p, h = s[k][p]);
|
|
839
839
|
}
|
|
840
|
-
(!h || a) && (h = g || a ?
|
|
840
|
+
(!h || a) && (h = g || a ? Qe : Vt, u[y] = h), typeof o === M && (g && d && (d = ve(o, d)), Ht.test(h) ? c = JSON.stringify(ae(o)) : !g && jt.test(h) && (c = e(o)));
|
|
841
841
|
}
|
|
842
842
|
if (d && X(d).length > 0) {
|
|
843
843
|
let h = e(d, t);
|
|
@@ -850,8 +850,8 @@ var qt = typeof AbortController != `${K}`;
|
|
|
850
850
|
function Qt(s, e) {
|
|
851
851
|
return x(this, null, function* () {
|
|
852
852
|
let t;
|
|
853
|
-
if (!e || !s.ok || [
|
|
854
|
-
if (t = yield s[
|
|
853
|
+
if (!e || !s.ok || [re, be].includes(e)) {
|
|
854
|
+
if (t = yield s[re](), t && e !== re) try {
|
|
855
855
|
t = JSON.parse(t);
|
|
856
856
|
} catch {
|
|
857
857
|
}
|
|
@@ -887,7 +887,7 @@ var Jt = (s) => new O(s), O = class {
|
|
|
887
887
|
request(e) {
|
|
888
888
|
return x(this, null, function* () {
|
|
889
889
|
let t = ve(this.config || {}, this.defaults, typeof e == "string" ? { url: e } : e), r = "credentials";
|
|
890
|
-
t.withCredentials && !t[r] && (t[r] = "include"), t[
|
|
890
|
+
t.withCredentials && !t[r] && (t[r] = "include"), t[se] || (t[se] = we);
|
|
891
891
|
for (let a of this.REQI) t = yield a(t);
|
|
892
892
|
let n = this._.bind(this);
|
|
893
893
|
this.P.forEach((a) => {
|
|
@@ -919,10 +919,10 @@ var Jt = (s) => new O(s), O = class {
|
|
|
919
919
|
}));
|
|
920
920
|
let j = d || r, _e = "baseURL";
|
|
921
921
|
return e[_e] && !Mt(j) && (j = $t(e[_e], j)), (h || fetch)(j, q(R({ body: g ? K : u }, y), { signal: p, method: n, headers: i })).then((v) => x(this, null, function* () {
|
|
922
|
-
let { responseType:
|
|
922
|
+
let { responseType: et } = e, ke = { data: yield Qt(v, et), response: v, config: e, request: e, [V]: v[V], statusText: v.statusText, [k]: v[k] };
|
|
923
923
|
if (!v.ok) {
|
|
924
|
-
let
|
|
925
|
-
return Promise.reject(
|
|
924
|
+
let tt = new ze(v[V] ? `Request failed with status code ${v[V]}` : "Network error", e, ke);
|
|
925
|
+
return Promise.reject(tt);
|
|
926
926
|
}
|
|
927
927
|
return ke;
|
|
928
928
|
})).finally(() => {
|
|
@@ -938,10 +938,10 @@ var Jt = (s) => new O(s), O = class {
|
|
|
938
938
|
return (t, r, n) => this.request(n ? q(R({}, n), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
|
|
939
939
|
}
|
|
940
940
|
get(e, t) {
|
|
941
|
-
return this.cG(
|
|
941
|
+
return this.cG(ie)(e, t);
|
|
942
942
|
}
|
|
943
943
|
head(e, t) {
|
|
944
|
-
return this.cG(
|
|
944
|
+
return this.cG(He)(e, t);
|
|
945
945
|
}
|
|
946
946
|
post(e, t, r) {
|
|
947
947
|
return this.cP(Lt)(e, t, r);
|
|
@@ -956,18 +956,18 @@ var Jt = (s) => new O(s), O = class {
|
|
|
956
956
|
return this.cG(Dt)(e, t);
|
|
957
957
|
}
|
|
958
958
|
options(e, t) {
|
|
959
|
-
return this.cG(
|
|
959
|
+
return this.cG(Ue)(e, t);
|
|
960
960
|
}
|
|
961
961
|
};
|
|
962
962
|
O.create = Jt, O.VERSION = "0.7.7";
|
|
963
|
-
var Xt = Object.assign(O.create(), { create: O.create, VERSION: O.VERSION }),
|
|
964
|
-
const
|
|
963
|
+
var Xt = Object.assign(O.create(), { create: O.create, VERSION: O.VERSION }), Xe = Xt;
|
|
964
|
+
const Ye = Xe.create({
|
|
965
965
|
baseURL: "https://updater.stats.cc",
|
|
966
966
|
headers: {
|
|
967
967
|
Accept: "application/json",
|
|
968
968
|
"Accept-Encoding": "gzip, deflate, br"
|
|
969
969
|
}
|
|
970
|
-
}), Ee =
|
|
970
|
+
}), Ee = Xe.create({
|
|
971
971
|
baseURL: "https://api.stats.cc",
|
|
972
972
|
headers: {
|
|
973
973
|
Accept: "application/json",
|
|
@@ -975,13 +975,13 @@ const Xe = Je.create({
|
|
|
975
975
|
}
|
|
976
976
|
});
|
|
977
977
|
function Yt(s, e) {
|
|
978
|
-
return
|
|
978
|
+
return Ye.get(`/v1/native/${s}/version.txt`, {
|
|
979
979
|
params: { channel: e },
|
|
980
980
|
responseType: "text"
|
|
981
981
|
});
|
|
982
982
|
}
|
|
983
983
|
function Zt(s, e) {
|
|
984
|
-
return
|
|
984
|
+
return Ye.get(`/v1/native/${s}/files`, {
|
|
985
985
|
params: { channel: e },
|
|
986
986
|
responseType: "arraybuffer"
|
|
987
987
|
});
|
|
@@ -1012,7 +1012,7 @@ class ar extends N {
|
|
|
1012
1012
|
// 5 minutes
|
|
1013
1013
|
l(this, "targetDir");
|
|
1014
1014
|
l(this, "updateInterval");
|
|
1015
|
-
this.targetDir = f.join(
|
|
1015
|
+
this.targetDir = f.join(ye(), "resources"), this.logger.log("Target directory", this.targetDir);
|
|
1016
1016
|
}
|
|
1017
1017
|
async initWithDlls(t) {
|
|
1018
1018
|
super.init(), await w.mkdir(this.targetDir, { recursive: !0 }), await this.checkForUpdates(t), clearInterval(this.updateInterval), this.updateInterval = setInterval(() => this.checkForUpdates(t), this.UPDATE_CHECK_INTERVAL_MS);
|
|
@@ -1221,7 +1221,7 @@ const $ = E(mr);
|
|
|
1221
1221
|
var br = Object.defineProperty, vr = (s, e, t) => e in s ? br(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, U = (s, e, t) => vr(s, typeof e != "symbol" ? e + "" : e, t);
|
|
1222
1222
|
class wr {
|
|
1223
1223
|
constructor(e) {
|
|
1224
|
-
U(this, "_clientId", null), U(this, "_userId", null), U(this, "options"), U(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new
|
|
1224
|
+
U(this, "_clientId", null), U(this, "_userId", null), U(this, "options"), U(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new Ne(), this.setupFlushInterval();
|
|
1225
1225
|
}
|
|
1226
1226
|
set clientId(e) {
|
|
1227
1227
|
this._clientId = e;
|
|
@@ -1312,12 +1312,12 @@ class _r extends N {
|
|
|
1312
1312
|
});
|
|
1313
1313
|
}
|
|
1314
1314
|
copyDll(t) {
|
|
1315
|
-
const r = f.basename(t), n =
|
|
1315
|
+
const r = f.basename(t), n = it(t), i = f.join(ye(), "resources"), a = f.join(i, r);
|
|
1316
1316
|
this.logger.debug("Copying", n, "to", a);
|
|
1317
1317
|
try {
|
|
1318
|
-
|
|
1318
|
+
ce(i) || le(i, { recursive: !0 });
|
|
1319
1319
|
const o = Ae(n);
|
|
1320
|
-
|
|
1320
|
+
he(a, o), nt(n, a);
|
|
1321
1321
|
} catch (o) {
|
|
1322
1322
|
return o.code === "EBUSY" ? a : (this.logger.captureSentryException("Failed to copy", o), this.logger.sentryError("Failed to copy", { originalPath: n, targetPath: a }), !1);
|
|
1323
1323
|
}
|
|
@@ -1348,7 +1348,7 @@ class _r extends N {
|
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
1350
|
const B = E(_r);
|
|
1351
|
-
class kr extends
|
|
1351
|
+
class kr extends Ge {
|
|
1352
1352
|
constructor() {
|
|
1353
1353
|
super("GameBuildManager");
|
|
1354
1354
|
l(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
|
|
@@ -1369,7 +1369,7 @@ class kr extends Ne {
|
|
|
1369
1369
|
);
|
|
1370
1370
|
return;
|
|
1371
1371
|
}
|
|
1372
|
-
const i = Ae(n.path), a =
|
|
1372
|
+
const i = Ae(n.path), a = at("sha256").update(i).digest("hex");
|
|
1373
1373
|
this.logger.log("Process Path", n.path), this.logger.log("Process Name", n.name), this.logger.log("Build Hash", a);
|
|
1374
1374
|
let o = !1;
|
|
1375
1375
|
try {
|
|
@@ -1392,7 +1392,7 @@ class kr extends Ne {
|
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
|
-
const
|
|
1395
|
+
const Ze = E(kr), oe = /* @__PURE__ */ new Map([
|
|
1396
1396
|
[1, "LeftButton"],
|
|
1397
1397
|
[2, "RightButton"],
|
|
1398
1398
|
[3, "Cancel"],
|
|
@@ -1585,7 +1585,7 @@ const Ye = E(kr), le = /* @__PURE__ */ new Map([
|
|
|
1585
1585
|
[252, "Noname"],
|
|
1586
1586
|
[253, "PA1"],
|
|
1587
1587
|
[254, "OEM_Clear"]
|
|
1588
|
-
]), De = new Map(
|
|
1588
|
+
]), De = new Map(oe.entries().map(([s, e]) => [e, s])), Pr = L({
|
|
1589
1589
|
"[string]": {
|
|
1590
1590
|
keys: "string[]",
|
|
1591
1591
|
mode: L("'toggle' | 'hold'").pipe((s) => s ?? "toggle")
|
|
@@ -1604,7 +1604,7 @@ class Sr extends N {
|
|
|
1604
1604
|
l(this, "keybindsFile");
|
|
1605
1605
|
// TODO try to figure out a better way to handle this
|
|
1606
1606
|
l(this, "keybindListeningPaused", !1);
|
|
1607
|
-
this.keybindsFile = new
|
|
1607
|
+
this.keybindsFile = new _t({
|
|
1608
1608
|
path: St(["keybinds.json"]),
|
|
1609
1609
|
schema: Pr,
|
|
1610
1610
|
default: t
|
|
@@ -1652,7 +1652,7 @@ class Sr extends N {
|
|
|
1652
1652
|
handleKeyDown(t) {
|
|
1653
1653
|
if (this.keybindListeningPaused)
|
|
1654
1654
|
return;
|
|
1655
|
-
const r =
|
|
1655
|
+
const r = oe.get(t.key);
|
|
1656
1656
|
if (!r) {
|
|
1657
1657
|
this.logger.error("Unknown key down", t);
|
|
1658
1658
|
return;
|
|
@@ -1665,7 +1665,7 @@ class Sr extends N {
|
|
|
1665
1665
|
async handleKeyUp(t) {
|
|
1666
1666
|
if (this.keybindListeningPaused)
|
|
1667
1667
|
return;
|
|
1668
|
-
const r =
|
|
1668
|
+
const r = oe.get(t.key);
|
|
1669
1669
|
if (!r)
|
|
1670
1670
|
return;
|
|
1671
1671
|
this.pressedKeys.delete(r);
|
|
@@ -1714,7 +1714,7 @@ class Sr extends N {
|
|
|
1714
1714
|
return `(${t.keys.join("+")}${t.mode ? ` ${t.mode}` : ""})`;
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
|
-
class Cr extends
|
|
1717
|
+
class Cr extends Ge {
|
|
1718
1718
|
constructor(t) {
|
|
1719
1719
|
super("OverridesManager");
|
|
1720
1720
|
l(this, "renderInterface");
|
|
@@ -1789,12 +1789,12 @@ function Kr(s) {
|
|
|
1789
1789
|
};
|
|
1790
1790
|
}
|
|
1791
1791
|
function Fr() {
|
|
1792
|
-
|
|
1792
|
+
Ze.getInstance().init(), B.getInstance().init(), C.getInstance().init(), T.getInstance().init(), xe.on("quit", () => {
|
|
1793
1793
|
Dr();
|
|
1794
1794
|
});
|
|
1795
1795
|
}
|
|
1796
1796
|
function Dr() {
|
|
1797
|
-
T.getInstance().destroy(), B.getInstance().destroy(),
|
|
1797
|
+
T.getInstance().destroy(), B.getInstance().destroy(), Ze.getInstance().destroy(), C.getInstance().destroy(), $.getInstance().getInterface("OGG_SIEGE").destroy(), ge.getInstance().destroy(), I.getInstance().destroy();
|
|
1798
1798
|
}
|
|
1799
1799
|
function Or(s, e) {
|
|
1800
1800
|
return s.reduce((t, r) => {
|
|
@@ -1873,7 +1873,7 @@ function F(s, e) {
|
|
|
1873
1873
|
return `${s}:${e}`;
|
|
1874
1874
|
}
|
|
1875
1875
|
function $r(s, e) {
|
|
1876
|
-
const t =
|
|
1876
|
+
const t = ge.getInstance();
|
|
1877
1877
|
function r(n) {
|
|
1878
1878
|
const i = Ct(n);
|
|
1879
1879
|
if (i instanceof L.errors) {
|
|
@@ -1945,7 +1945,7 @@ function Ar(s) {
|
|
|
1945
1945
|
}
|
|
1946
1946
|
function Rr() {
|
|
1947
1947
|
return {
|
|
1948
|
-
createWindow: (s) => m().instance.newWindowInternal(
|
|
1948
|
+
createWindow: (s) => m().instance.newWindowInternal(ot.BrowserWindow, s),
|
|
1949
1949
|
on: (s, e) => m().instance.on(s, e),
|
|
1950
1950
|
off: (s, e) => m().instance.off(s, e),
|
|
1951
1951
|
once: (s, e) => m().instance.once(s, e),
|
|
@@ -1955,7 +1955,7 @@ function Rr() {
|
|
|
1955
1955
|
prependListener: (s, e) => m().instance.prependListener(s, e),
|
|
1956
1956
|
prependOnceListener: (s, e) => m().instance.prependOnceListener(s, e),
|
|
1957
1957
|
getActiveGameInfo: () => {
|
|
1958
|
-
const s = m(), e =
|
|
1958
|
+
const s = m(), e = ge.getInstance();
|
|
1959
1959
|
return {
|
|
1960
1960
|
resolution: s.resolution,
|
|
1961
1961
|
isConnected: e.hasConnection
|
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.
|
|
5
|
+
"version": "0.6.1",
|
|
6
6
|
"description": "Overlayed app",
|
|
7
7
|
"license": "BSD-3-Clause",
|
|
8
8
|
"repository": {
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"vite-plugin-dts": "^4.5.3",
|
|
55
55
|
"vite-plugin-static-copy": "^2.3.1",
|
|
56
56
|
"vitest": "^3.0.9",
|
|
57
|
-
"@overlayed/api": "0.0.3",
|
|
58
57
|
"@overlayed/cortex-client": "0.0.2",
|
|
58
|
+
"@overlayed/api": "0.0.3",
|
|
59
59
|
"@overlayed/events": "0.0.2",
|
|
60
60
|
"@overlayed/native-managers": "0.0.2",
|
|
61
61
|
"@overlayed/siege": "0.0.2",
|
|
@@ -64,8 +64,7 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"arktype": "^2.1.10",
|
|
66
66
|
"electron": "33.3.0",
|
|
67
|
-
"jszip": "^3.10.1"
|
|
68
|
-
"@overlayed/electron": "33.3.0-0"
|
|
67
|
+
"jszip": "^3.10.1"
|
|
69
68
|
},
|
|
70
69
|
"engines": {
|
|
71
70
|
"node": ">=20.10.0"
|