@loybung/launcher 7.0.13 → 7.0.15
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -41,6 +41,9 @@ class Launcher {
|
|
41
41
|
this.expireTimestamp = null;
|
42
42
|
this.expireTimeout = null;
|
43
43
|
}
|
44
|
+
setFilePath(path) {
|
45
|
+
this.filePath = path;
|
46
|
+
}
|
44
47
|
setExpire(unixTimestamp) {
|
45
48
|
if (!unixTimestamp)
|
46
49
|
return;
|
@@ -62,16 +65,13 @@ class Launcher {
|
|
62
65
|
}, expireIn);
|
63
66
|
}
|
64
67
|
}
|
65
|
-
setFilePath(path) {
|
66
|
-
this.filePath = path;
|
67
|
-
}
|
68
68
|
Run() {
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
70
70
|
try {
|
71
71
|
if (this.expireTimestamp && Date.now() / 1000 > this.expireTimestamp) {
|
72
72
|
throw new Error("Code has expired.");
|
73
73
|
}
|
74
|
-
const response = yield fetch(this.apiURL);
|
74
|
+
const response = yield fetch(this.apiURL, { method: "POST" });
|
75
75
|
if (!response.ok) {
|
76
76
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
77
77
|
}
|