@necrolab/dashboard 0.4.61 → 0.4.209
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/.prettierrc +1 -27
- package/.vscode/extensions.json +1 -1
- package/README.md +2 -64
- package/backend/api.js +48 -40
- package/backend/auth.js +3 -3
- package/backend/batching.js +1 -1
- package/backend/endpoints.js +76 -12
- package/backend/index.js +2 -2
- package/backend/mock-data.js +36 -27
- package/backend/mock-src/classes/logger.js +8 -8
- package/backend/mock-src/classes/utils.js +3 -7
- package/backend/mock-src/database.js +0 -0
- package/backend/mock-src/ticketmaster.js +79 -79
- package/backend/validator.js +2 -2
- package/config/configs.json +3 -2
- package/config/filter.json +3 -2
- package/index.html +8 -79
- package/index.js +1 -1
- package/package.json +25 -40
- package/postcss.config.js +1 -1
- package/postinstall.js +17 -98
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/manifest.json +7 -12
- package/public/sw.js +2 -0
- package/public/workbox-49fdaf31.js +2 -0
- package/public/workbox-49fdaf31.js.map +1 -0
- package/public/workbox-88575b92.js +2 -0
- package/public/workbox-88575b92.js.map +1 -0
- package/public/workbox-a67a7b11.js +2 -0
- package/public/workbox-a67a7b11.js.map +1 -0
- package/public/workbox-d4314735.js +2 -0
- package/public/workbox-d4314735.js.map +1 -0
- package/public/workbox-e0f89ef3.js +2 -0
- package/public/workbox-e0f89ef3.js.map +1 -0
- package/run +9 -176
- package/src/App.vue +85 -498
- package/src/assets/css/_input.scss +99 -144
- package/src/assets/css/main.scss +99 -450
- package/src/assets/img/background.svg +2 -2
- package/src/assets/img/logo_icon.png +0 -0
- package/src/components/Auth/LoginForm.vue +11 -62
- package/src/components/Editors/Account/Account.vue +40 -116
- package/src/components/Editors/Account/AccountCreator.vue +39 -88
- package/src/components/Editors/Account/AccountView.vue +34 -102
- package/src/components/Editors/Account/CreateAccount.vue +32 -80
- package/src/components/Editors/Profile/CreateProfile.vue +83 -269
- package/src/components/Editors/Profile/Profile.vue +47 -132
- package/src/components/Editors/Profile/ProfileCountryChooser.vue +20 -82
- package/src/components/Editors/Profile/ProfileView.vue +34 -91
- package/src/components/Editors/TagLabel.vue +6 -67
- package/src/components/Filter/Filter.vue +72 -289
- package/src/components/Filter/FilterPreview.vue +30 -171
- package/src/components/Filter/PriceSortToggle.vue +4 -74
- package/src/components/Table/Header.vue +1 -1
- package/src/components/Table/Row.vue +1 -1
- package/src/components/Table/Table.vue +2 -19
- package/src/components/Tasks/CheckStock.vue +13 -28
- package/src/components/Tasks/Controls/DesktopControls.vue +17 -17
- package/src/components/Tasks/Controls/MobileControls.vue +45 -8
- package/src/components/Tasks/CreateTaskAXS.vue +73 -79
- package/src/components/Tasks/CreateTaskTM.vue +142 -94
- package/src/components/Tasks/MassEdit.vue +7 -9
- package/src/components/Tasks/QuickSettings.vue +55 -169
- package/src/components/Tasks/ScrapeVenue.vue +4 -7
- package/src/components/Tasks/Stats.vue +23 -52
- package/src/components/Tasks/Task.vue +135 -377
- package/src/components/Tasks/TaskView.vue +47 -107
- package/src/components/Tasks/Utilities.vue +6 -5
- package/src/components/icons/Bag.vue +1 -1
- package/src/components/icons/Loyalty.vue +1 -1
- package/src/components/icons/Mail.vue +2 -2
- package/src/components/icons/Play.vue +2 -2
- package/src/components/icons/Reload.vue +5 -4
- package/src/components/icons/Sandclock.vue +2 -2
- package/src/components/icons/Stadium.vue +1 -1
- package/src/components/icons/index.js +1 -24
- package/src/components/ui/Modal.vue +13 -105
- package/src/components/ui/Navbar.vue +37 -170
- package/src/components/ui/ReconnectIndicator.vue +55 -351
- package/src/components/ui/Splash.vue +35 -5
- package/src/components/ui/controls/CountryChooser.vue +62 -200
- package/src/components/ui/controls/atomic/Checkbox.vue +10 -119
- package/src/components/ui/controls/atomic/Dropdown.vue +39 -208
- package/src/components/ui/controls/atomic/MultiDropdown.vue +37 -300
- package/src/libs/Filter.js +170 -200
- package/src/registerServiceWorker.js +1 -1
- package/src/stores/connection.js +53 -51
- package/src/stores/logger.js +3 -11
- package/src/stores/sampleData.js +201 -173
- package/src/stores/ui.js +44 -112
- package/src/stores/utils.js +6 -90
- package/src/views/Accounts.vue +35 -44
- package/src/views/Console.vue +90 -341
- package/src/views/Editor.vue +123 -1176
- package/src/views/FilterBuilder.vue +251 -607
- package/src/views/Login.vue +14 -76
- package/src/views/Profiles.vue +25 -44
- package/src/views/Tasks.vue +100 -187
- package/static/offline.html +50 -192
- package/tailwind.config.js +26 -104
- package/vite.config.js +16 -73
- package/vue.config.js +32 -0
- package/workbox-config.js +11 -0
- package/artwork/image.png +0 -0
- package/dev-server.js +0 -136
- package/exit +0 -209
- package/jsconfig.json +0 -16
- package/src/assets/css/_utilities.scss +0 -388
- package/src/assets/img/background.svg.backup +0 -11
- package/src/components/icons/Check.vue +0 -5
- package/src/components/icons/Close.vue +0 -21
- package/src/components/icons/CloseX.vue +0 -5
- package/src/components/icons/Key.vue +0 -21
- package/src/components/icons/Pencil.vue +0 -21
- package/src/components/icons/Profile.vue +0 -18
- package/src/components/icons/Sell.vue +0 -21
- package/src/components/icons/Spinner.vue +0 -42
- package/src/components/icons/SquareCheck.vue +0 -18
- package/src/components/icons/SquareUncheck.vue +0 -18
- package/src/components/icons/Wildcard.vue +0 -18
- package/src/components/ui/controls/atomic/LoadingButton.vue +0 -45
- package/src/composables/useClickOutside.js +0 -21
- package/src/composables/useDropdownPosition.js +0 -174
- package/src/types/index.js +0 -41
- package/src/utils/debug.js +0 -1
- package/switch-branch.sh +0 -41
- package/workbox-config.cjs +0 -63
- /package/src/assets/img/{logo_icon-old.png → logo_icon_2.png} +0 -0
package/.prettierrc
CHANGED
|
@@ -6,31 +6,5 @@
|
|
|
6
6
|
"trailingComma": "none",
|
|
7
7
|
"bracketSpacing": true,
|
|
8
8
|
"arrowParens": "always",
|
|
9
|
-
"printWidth": 120
|
|
10
|
-
"vueIndentScriptAndStyle": false,
|
|
11
|
-
"htmlWhitespaceSensitivity": "ignore",
|
|
12
|
-
"bracketSameLine": true,
|
|
13
|
-
"singleAttributePerLine": false,
|
|
14
|
-
"endOfLine": "lf",
|
|
15
|
-
"overrides": [
|
|
16
|
-
{
|
|
17
|
-
"files": "*.vue",
|
|
18
|
-
"options": {
|
|
19
|
-
"vueIndentScriptAndStyle": false,
|
|
20
|
-
"htmlWhitespaceSensitivity": "ignore",
|
|
21
|
-
"singleAttributePerLine": false,
|
|
22
|
-
"bracketSameLine": true,
|
|
23
|
-
"printWidth": 120,
|
|
24
|
-
"tabWidth": 4,
|
|
25
|
-
"useTabs": false,
|
|
26
|
-
"semi": true,
|
|
27
|
-
"singleQuote": false,
|
|
28
|
-
"trailingComma": "none",
|
|
29
|
-
"bracketSpacing": true,
|
|
30
|
-
"arrowParens": "always"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"plugins": ["prettier-plugin-tailwindcss"],
|
|
35
|
-
"tailwindConfig": "./tailwind.config.js"
|
|
9
|
+
"printWidth": 120
|
|
36
10
|
}
|
package/.vscode/extensions.json
CHANGED
package/README.md
CHANGED
|
@@ -1,65 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
<img src="./artwork/image.png" alt="Dashboard" width="400">
|
|
3
|
-
</div>
|
|
1
|
+
# Necro
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
A sophisticated PWA dashboard for managing ticket purchasing automation across multiple platforms. Built with Vue 3 and real-time WebSocket communication.
|
|
8
|
-
|
|
9
|
-
## ⚡ Quick Start
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install
|
|
13
|
-
npm run dev
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Visit `http://localhost:5173` and you're live.
|
|
17
|
-
|
|
18
|
-
## 🚀 Commands
|
|
19
|
-
|
|
20
|
-
| Command | Action |
|
|
21
|
-
| ---------------- | ----------------------------- |
|
|
22
|
-
| `npm run dev` | Development server |
|
|
23
|
-
| `npm run expose` | Network-accessible dev server |
|
|
24
|
-
| `npm run build` | Production build with PWA |
|
|
25
|
-
| `npm run lint` | Code formatting |
|
|
26
|
-
|
|
27
|
-
### 🧱 Frontend Stack
|
|
28
|
-
|
|
29
|
-
- Vue 3 + Composition API
|
|
30
|
-
- Pinia state management
|
|
31
|
-
- TailwindCSS + SCSS
|
|
32
|
-
- PWA with offline support
|
|
33
|
-
|
|
34
|
-
### 🛠 Backend Stack
|
|
35
|
-
|
|
36
|
-
- Express.js with WebSockets
|
|
37
|
-
- MessagePack serialization
|
|
38
|
-
- Real-time message batching
|
|
39
|
-
- Platform abstraction layer
|
|
40
|
-
|
|
41
|
-
## 📱 PWA Support
|
|
42
|
-
|
|
43
|
-
- 📲 Install to home screen
|
|
44
|
-
- 🔄 Background sync
|
|
45
|
-
- 📶 Offline functionality
|
|
46
|
-
- 🎨 Native app feel
|
|
47
|
-
|
|
48
|
-
## 🛠️ Development
|
|
49
|
-
|
|
50
|
-
Runs in mock mode by default. Backend simulates bot operations; frontend provides full UI functionality.
|
|
51
|
-
|
|
52
|
-
### 🗂️ File Structure
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
src/
|
|
56
|
-
├─ components/ # Reusable Vue components
|
|
57
|
-
├─ views/ # Page-level components
|
|
58
|
-
├─ stores/ # Pinia state management
|
|
59
|
-
└─ assets/ # Static resources
|
|
60
|
-
|
|
61
|
-
backend/
|
|
62
|
-
├─ api.js # Express server + WebSocket
|
|
63
|
-
├─ mock-data.js # Development data
|
|
64
|
-
└─ endpoints.js # API route definitions
|
|
65
|
-
```
|
|
3
|
+
PWA dashboard using vue.js and vite
|
package/backend/api.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import endpoints from "./endpoints.js";
|
|
18
|
-
import authSystem from "./auth.js";
|
|
19
|
-
import { users } from "./mock-data.js";
|
|
1
|
+
const enableWs = require("express-ws");
|
|
2
|
+
const express = require("express");
|
|
3
|
+
const cors = require("cors");
|
|
4
|
+
const uuid = require("uuid").v4;
|
|
5
|
+
const cookieParser = require("cookie-parser");
|
|
6
|
+
const { encode } = require("@msgpack/msgpack");
|
|
7
|
+
const fs = require("node:fs");
|
|
8
|
+
const path = require("node:path");
|
|
9
|
+
|
|
10
|
+
const { createLogger } = require("./mock-src/classes/logger");
|
|
11
|
+
const utils = require("./mock-src/classes/utils");
|
|
12
|
+
|
|
13
|
+
const Batcher = require("./batching");
|
|
14
|
+
const endpoints = require("./endpoints");
|
|
15
|
+
const authSystem = require("./auth");
|
|
16
|
+
const { users } = require("./mock-data.js");
|
|
20
17
|
|
|
21
18
|
const logger = createLogger("WEB UI");
|
|
22
19
|
|
|
@@ -122,7 +119,7 @@ app.ws("/api/updates", async function (ws, req) {
|
|
|
122
119
|
}
|
|
123
120
|
|
|
124
121
|
try {
|
|
125
|
-
const id =
|
|
122
|
+
const id = uuid();
|
|
126
123
|
|
|
127
124
|
logger.Info(`New websocket connected: ${id}`);
|
|
128
125
|
// Add client to array
|
|
@@ -139,7 +136,7 @@ app.ws("/api/updates", async function (ws, req) {
|
|
|
139
136
|
pushWSUpdate({ event: "startup", message: "Starting Bot", user: currentUser.name });
|
|
140
137
|
await utils.sleep(750);
|
|
141
138
|
|
|
142
|
-
pushWSUpdate({ event: "startup", done: true, user: currentUser.name
|
|
139
|
+
pushWSUpdate({ event: "startup", done: true, user: currentUser.name });
|
|
143
140
|
ws.send(
|
|
144
141
|
JSON.stringify([
|
|
145
142
|
{ event: "set-button-disabled", button: "add-tasks", value: false },
|
|
@@ -164,7 +161,7 @@ app.ws("/api/updates", async function (ws, req) {
|
|
|
164
161
|
for (let c = 0; c < Bot.ConsoleBuffer.length; c++) {
|
|
165
162
|
pushWSUpdate({
|
|
166
163
|
type: "console",
|
|
167
|
-
|
|
164
|
+
log: Bot.ConsoleBuffer[c]
|
|
168
165
|
});
|
|
169
166
|
}
|
|
170
167
|
}
|
|
@@ -295,6 +292,25 @@ app.get("/api/tasks", async (req, res) => {
|
|
|
295
292
|
return res.send(await endpoints.getTasks());
|
|
296
293
|
});
|
|
297
294
|
|
|
295
|
+
// Start all
|
|
296
|
+
app.post("/api/tasks/start-all", async (req, res) => {
|
|
297
|
+
const r = await endpoints.startAllTasks();
|
|
298
|
+
if (r.error) return res.send(r);
|
|
299
|
+
else closeTab(res);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// Stop all
|
|
303
|
+
app.post("/api/tasks/stop-all", async (req, res) => {
|
|
304
|
+
const r = await endpoints.stopAllTasks();
|
|
305
|
+
if (r.error) return res.send(r);
|
|
306
|
+
else closeTab(res);
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
app.post("/api/tasks/delete-all", async (req, res) => {
|
|
310
|
+
await endpoints.deleteAllTasks();
|
|
311
|
+
closeTab(res);
|
|
312
|
+
});
|
|
313
|
+
|
|
298
314
|
app.get("/api/tasks/load-presale", async (req, res) => {
|
|
299
315
|
await endpoints.deleteAllTasks();
|
|
300
316
|
closeTab(res);
|
|
@@ -366,9 +382,14 @@ app.get("/api/cors", async (req, res) => {
|
|
|
366
382
|
|
|
367
383
|
res.type(contentType).send(data);
|
|
368
384
|
|
|
369
|
-
logger.
|
|
385
|
+
logger.info("Proxied", {
|
|
386
|
+
url,
|
|
387
|
+
status: response.status,
|
|
388
|
+
contentType,
|
|
389
|
+
size: data.length
|
|
390
|
+
});
|
|
370
391
|
} catch (error) {
|
|
371
|
-
logger.
|
|
392
|
+
logger.error("Proxy error", { url, error: error.message });
|
|
372
393
|
res.status(500).send({ error: error.message });
|
|
373
394
|
}
|
|
374
395
|
});
|
|
@@ -377,20 +398,7 @@ app.get("/api/cors", async (req, res) => {
|
|
|
377
398
|
|
|
378
399
|
let config = {};
|
|
379
400
|
app.get("/api/quickconfig", async (req, res) => {
|
|
380
|
-
return res.json(
|
|
381
|
-
keys: {
|
|
382
|
-
Captcha: {
|
|
383
|
-
CapMonster: "example",
|
|
384
|
-
CapSolver: "example",
|
|
385
|
-
Invizible: "example",
|
|
386
|
-
TwoCaptcha: "example"
|
|
387
|
-
},
|
|
388
|
-
SMS: {
|
|
389
|
-
Quackr: "example",
|
|
390
|
-
SMSActivate: "example"
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
});
|
|
401
|
+
return res.json(config);
|
|
394
402
|
});
|
|
395
403
|
|
|
396
404
|
app.post("/api/quickconfig", async (req, res) => {
|
|
@@ -421,10 +429,10 @@ app.get("/api/userconfig/proxylists", async (req, res) => {
|
|
|
421
429
|
});
|
|
422
430
|
|
|
423
431
|
app.get("/api/userconfig/balances", async (req, res) => {
|
|
424
|
-
return res.send({
|
|
432
|
+
return res.send({ capsolver: "$10", hyper: "$40" });
|
|
425
433
|
});
|
|
426
434
|
|
|
427
|
-
|
|
435
|
+
module.exports = {
|
|
428
436
|
start: async () => {
|
|
429
437
|
// onChange = (await import('on-change')).default;
|
|
430
438
|
app.listen(port, "0.0.0.0", () => {
|
package/backend/auth.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const uuid = require("uuid").v4;
|
|
2
2
|
|
|
3
3
|
const generateAuthToken = () => {
|
|
4
|
-
return
|
|
4
|
+
return uuid().replace(/-/g, "");
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// This is not secure, at all.
|
|
@@ -59,4 +59,4 @@ class Auth {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
module.exports = Auth;
|
package/backend/batching.js
CHANGED
package/backend/endpoints.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const { createLogger } = require("./mock-src/classes/logger");
|
|
2
|
+
const TicketMaster = require("./mock-src/ticketmaster");
|
|
3
|
+
const utils = require("./mock-src/classes/utils");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const validateTaskData = require("./validator");
|
|
6
6
|
const logger = createLogger("WEB UI");
|
|
7
7
|
|
|
8
8
|
const none = (v) => {
|
|
@@ -53,12 +53,53 @@ const getTasks = async () => {
|
|
|
53
53
|
return getStrippedTasks();
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
+
const startAllTasks = async () => {
|
|
57
|
+
var taskIds = Object.keys(Bot.Tasks);
|
|
58
|
+
for (let c = 0; c < taskIds.length; c++) {
|
|
59
|
+
var taskId = taskIds[c] + "";
|
|
60
|
+
if (!Bot.Tasks[taskId] || Bot.Tasks[taskId].active) continue;
|
|
61
|
+
if (Bot.Tasks[taskId].status == "Stopped")
|
|
62
|
+
Bot.Tasks[taskId] = new TicketMaster({
|
|
63
|
+
taskId: Bot.Tasks[taskId].taskId,
|
|
64
|
+
...Bot.Tasks[taskId].settings
|
|
65
|
+
});
|
|
66
|
+
Bot.Tasks[taskId].start();
|
|
67
|
+
}
|
|
68
|
+
pushWSUpdate({
|
|
69
|
+
event: "start-all"
|
|
70
|
+
});
|
|
71
|
+
return {};
|
|
72
|
+
};
|
|
73
|
+
const stopAllTasks = async () => {
|
|
74
|
+
var taskIds = Object.keys(Bot.Tasks);
|
|
75
|
+
for (let c = 0; c < taskIds.length; c++) {
|
|
76
|
+
var taskId = taskIds[c] + "";
|
|
77
|
+
if (!Bot.Tasks[taskId] || !Bot.Tasks[taskId].active) continue;
|
|
78
|
+
Bot.Tasks[taskId].stop();
|
|
79
|
+
}
|
|
80
|
+
pushWSUpdate({
|
|
81
|
+
event: "stop-all"
|
|
82
|
+
});
|
|
83
|
+
return {};
|
|
84
|
+
};
|
|
85
|
+
const deleteAllTasks = async () => {
|
|
86
|
+
Bot.Tasks = {};
|
|
87
|
+
var taskIds = Object.keys(Bot.Tasks);
|
|
88
|
+
for (let c = 0; c < taskIds.length; c++) {
|
|
89
|
+
var taskId = taskIds[c] + "";
|
|
90
|
+
if (!Bot.Tasks[taskId]) continue;
|
|
91
|
+
Bot.Tasks[c].destroy();
|
|
92
|
+
}
|
|
93
|
+
pushWSUpdate({
|
|
94
|
+
event: "delete-all"
|
|
95
|
+
});
|
|
96
|
+
return {};
|
|
97
|
+
};
|
|
56
98
|
const tasksLoadPresale = async (data) => {
|
|
57
99
|
var { eventId, ticketQty } = data;
|
|
58
100
|
await createPresaleModeTasks(eventId, ticketQty);
|
|
59
101
|
return {};
|
|
60
102
|
};
|
|
61
|
-
|
|
62
103
|
const startTask = async (data) => {
|
|
63
104
|
const taskId = data.id;
|
|
64
105
|
|
|
@@ -80,7 +121,6 @@ const startTask = async (data) => {
|
|
|
80
121
|
Bot.Tasks[taskId].start();
|
|
81
122
|
return {};
|
|
82
123
|
};
|
|
83
|
-
|
|
84
124
|
const stopTask = async (data) => {
|
|
85
125
|
const taskId = data.id;
|
|
86
126
|
|
|
@@ -96,7 +136,6 @@ const stopTask = async (data) => {
|
|
|
96
136
|
Bot.Tasks[taskId].stop();
|
|
97
137
|
return {};
|
|
98
138
|
};
|
|
99
|
-
|
|
100
139
|
const deleteTask = async (data) => {
|
|
101
140
|
const taskId = data.id;
|
|
102
141
|
if (!Bot.Tasks[taskId])
|
|
@@ -170,6 +209,7 @@ const scrapeMap = async (data) => {
|
|
|
170
209
|
taskId: "SCRAPER-" + eventId,
|
|
171
210
|
account: utils.pickAccount(),
|
|
172
211
|
eventId: eventId,
|
|
212
|
+
incapsulaBypass: true,
|
|
173
213
|
hidden: true,
|
|
174
214
|
presaleCode: presaleCode
|
|
175
215
|
});
|
|
@@ -187,6 +227,7 @@ const checkStock = async (data) => {
|
|
|
187
227
|
var taskObj = new TicketMaster({
|
|
188
228
|
taskId: "SCRAPER-" + eventId,
|
|
189
229
|
eventId: eventId,
|
|
230
|
+
incapsulaBypass: true,
|
|
190
231
|
hidden: true
|
|
191
232
|
});
|
|
192
233
|
taskObj.scrapeSeats();
|
|
@@ -195,6 +236,7 @@ const checkStock = async (data) => {
|
|
|
195
236
|
|
|
196
237
|
async function createPresaleModeTasks(eventId, ticketQty) {
|
|
197
238
|
const presaleModeSettings = {
|
|
239
|
+
incapsulaBypass: false,
|
|
198
240
|
agedAccount: false,
|
|
199
241
|
manual: false,
|
|
200
242
|
openCart: false,
|
|
@@ -244,6 +286,13 @@ const createAccounts = async () => {};
|
|
|
244
286
|
const saveAccount = async (account) => {
|
|
245
287
|
const user = account.user;
|
|
246
288
|
user.tags = [user.name];
|
|
289
|
+
// TODO: handle in database
|
|
290
|
+
if (account._id) {
|
|
291
|
+
// database.models.profile.findOneAndUpdate()
|
|
292
|
+
} else {
|
|
293
|
+
// database.models.profile.create()
|
|
294
|
+
}
|
|
295
|
+
|
|
247
296
|
Bot[account.module].Accounts.push(account);
|
|
248
297
|
pushWSUpdate({ event: "add-account", account: account });
|
|
249
298
|
return {};
|
|
@@ -266,15 +315,21 @@ const saveProfile = async (profile) => {
|
|
|
266
315
|
newTags = [...newTags, ...profile.tags];
|
|
267
316
|
profile.tags = newTags;
|
|
268
317
|
|
|
318
|
+
// TODO: handle in database
|
|
319
|
+
if (profile._id) {
|
|
320
|
+
// database.models.profile.findOneAndUpdate()
|
|
321
|
+
} else {
|
|
322
|
+
// database.models.profile.create()
|
|
323
|
+
}
|
|
269
324
|
Bot.Profiles.push(profile);
|
|
270
325
|
pushWSUpdate({ event: "add-profile", profile: profile });
|
|
271
326
|
return {};
|
|
272
327
|
};
|
|
273
328
|
|
|
274
329
|
const deleteProfile = async (profile) => {
|
|
275
|
-
const {
|
|
276
|
-
Bot.Profiles = Bot.Profiles.filter((p) => p.
|
|
277
|
-
pushWSUpdate({ event: "delete-profile", profile: {
|
|
330
|
+
const { _id } = profile;
|
|
331
|
+
Bot.Profiles = Bot.Profiles.filter((p) => p._id !== profile._id);
|
|
332
|
+
pushWSUpdate({ event: "delete-profile", profile: { _id: _id } });
|
|
278
333
|
};
|
|
279
334
|
|
|
280
335
|
async function handleWebsocketMessage(msg) {
|
|
@@ -286,8 +341,14 @@ async function handleWebsocketMessage(msg) {
|
|
|
286
341
|
return await tasksOpen(data);
|
|
287
342
|
case "tasks/delete":
|
|
288
343
|
return await deleteTask(data);
|
|
289
|
-
case "tasks/
|
|
344
|
+
case "tasks/":
|
|
290
345
|
return await getTasks();
|
|
346
|
+
case "tasks/start-all":
|
|
347
|
+
return await startAllTasks();
|
|
348
|
+
case "tasks/stop-all":
|
|
349
|
+
return await stopAllTasks();
|
|
350
|
+
case "tasks/delete-all":
|
|
351
|
+
return await deleteAllTasks();
|
|
291
352
|
case "tasks/load-presale":
|
|
292
353
|
return await tasksLoadPresale(data);
|
|
293
354
|
case "tasks/start":
|
|
@@ -323,11 +384,14 @@ async function handleWebsocketMessage(msg) {
|
|
|
323
384
|
}
|
|
324
385
|
}
|
|
325
386
|
|
|
326
|
-
|
|
387
|
+
module.exports = {
|
|
327
388
|
continueTask,
|
|
328
389
|
tasksOpen,
|
|
329
390
|
deleteTask,
|
|
330
391
|
getTasks,
|
|
392
|
+
startAllTasks,
|
|
393
|
+
stopAllTasks,
|
|
394
|
+
deleteAllTasks,
|
|
331
395
|
tasksLoadPresale,
|
|
332
396
|
startTask,
|
|
333
397
|
stopTask,
|
package/backend/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const { users, profiles, tmAccounts, axsAccounts } = require("./mock-data");
|
|
2
2
|
|
|
3
3
|
const Bot = {};
|
|
4
4
|
|
|
@@ -20,4 +20,4 @@ Bot.AXS = {
|
|
|
20
20
|
Accounts: axsAccounts
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
module.exports = require("./api");
|
package/backend/mock-data.js
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
const users = [
|
|
2
2
|
{
|
|
3
3
|
event: "auth",
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
botChannels: {
|
|
5
|
+
splash: "950761407119511582",
|
|
6
|
+
carts: "961558093832011807",
|
|
7
|
+
checkouts: "1025407596120776794",
|
|
8
|
+
declines: "1027868055696572508",
|
|
9
|
+
stockChecker: "1099079655962722375",
|
|
10
|
+
venueMaps: "1099125114450214973"
|
|
11
|
+
},
|
|
12
|
+
_id: "641a5292b561088b64fe390b",
|
|
13
|
+
name: "admin",
|
|
14
|
+
password: "p33t",
|
|
15
|
+
profilePicture: "https://cdn.discordapp.com/avatars/843244136945549312/14686df31bfe8889f3c7fb396e8869c9.png",
|
|
8
16
|
admin: true,
|
|
9
17
|
proxyList: { checkout: "admin-proxies" },
|
|
10
|
-
profileTags: ["Citi", "Mercury", "
|
|
11
|
-
|
|
18
|
+
profileTags: ["Amex", "Citi", "Mercury", "CapOne", "Veridian", "WIO", "Kez", "Xpence"],
|
|
19
|
+
accountTags: ["admin"]
|
|
12
20
|
}
|
|
13
21
|
];
|
|
14
22
|
|
|
15
23
|
const profile = {
|
|
16
|
-
|
|
24
|
+
_id: "645a82606ef8b7201b728805",
|
|
17
25
|
enabled: false,
|
|
18
26
|
profileName: "Master US 43725 [admin]",
|
|
19
27
|
address: "88081 Piper Ways",
|
|
@@ -34,24 +42,25 @@ const profile = {
|
|
|
34
42
|
};
|
|
35
43
|
|
|
36
44
|
const profiles = [];
|
|
37
|
-
for (let i = 0; i < 1000; i++) profiles.push({ ...profile,
|
|
45
|
+
for (let i = 0; i < 1000; i++) profiles.push({ ...profile, _id: i });
|
|
38
46
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
]
|
|
47
|
+
module.exports = {
|
|
48
|
+
users,
|
|
49
|
+
profiles,
|
|
50
|
+
tmAccounts: [
|
|
51
|
+
{
|
|
52
|
+
tags: ["admin"],
|
|
53
|
+
_id: 1,
|
|
54
|
+
password: "123",
|
|
55
|
+
email: "tm@tm.com"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
axsAccounts: [
|
|
59
|
+
{
|
|
60
|
+
tags: ["admin"],
|
|
61
|
+
_id: 2,
|
|
62
|
+
password: "123",
|
|
63
|
+
email: "axs@axs.com"
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const util = require("node:util");
|
|
2
2
|
|
|
3
3
|
const zeroPadding = (num, length) => String(num).padStart(length, "0");
|
|
4
4
|
|
|
@@ -38,7 +38,6 @@ class Logger {
|
|
|
38
38
|
this.user = null;
|
|
39
39
|
this.global = false;
|
|
40
40
|
this.siteId = null;
|
|
41
|
-
this.taskId = null;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
logToWorker(...args) {
|
|
@@ -49,8 +48,7 @@ class Logger {
|
|
|
49
48
|
metadata: {
|
|
50
49
|
global: this.global || !this.user,
|
|
51
50
|
user: this.user,
|
|
52
|
-
siteId: this.siteId
|
|
53
|
-
taskId: this.taskId
|
|
51
|
+
siteId: this.siteId
|
|
54
52
|
}
|
|
55
53
|
});
|
|
56
54
|
}
|
|
@@ -103,8 +101,10 @@ class Logger {
|
|
|
103
101
|
}
|
|
104
102
|
}
|
|
105
103
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
module.exports = {
|
|
105
|
+
createLogger: (args) => {
|
|
106
|
+
const logger = new Logger();
|
|
107
|
+
logger.defaultArgs = typeof args == "string" ? [args] : typeof args == "object" ? args : undefined;
|
|
108
|
+
return logger;
|
|
109
|
+
}
|
|
110
110
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import crypto from "node:crypto";
|
|
2
|
-
|
|
3
1
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
module.exports = {
|
|
6
4
|
pickAccount: () => {
|
|
7
5
|
return "demo@email.com";
|
|
8
6
|
},
|
|
@@ -18,15 +16,13 @@ export default {
|
|
|
18
16
|
return atob(i);
|
|
19
17
|
},
|
|
20
18
|
massEditPresaleCode: async (eventId, presaleCode) => {
|
|
21
|
-
for (const [, value] of Object.entries(Bot.Tasks)) {
|
|
19
|
+
for (const [key, value] of Object.entries(Bot.Tasks)) {
|
|
22
20
|
if (value.eventId === eventId) {
|
|
23
21
|
value.presaleCode = presaleCode;
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
},
|
|
27
|
-
|
|
28
|
-
return crypto.randomUUID();
|
|
29
|
-
},
|
|
25
|
+
|
|
30
26
|
chunk: (arr, len) => {
|
|
31
27
|
let chunks = [],
|
|
32
28
|
i = 0,
|
|
File without changes
|